Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/ahc_pci.c
RevisionDateAuthorComments
 1.76  27-Jun-2025  andvar Grammar and spelling fixes, mainly in comments. A few in documentation,
logging, test description, and SCSI ASC/ASCQ assignment descriptions.
 1.75  09-Feb-2024  andvar branches: 1.75.2;
fix spelling mistakes, mainly in comments and log messages.
 1.74  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.73  09-Dec-2018  jdolecek use pci_intr_establish_xname() everywhere
 1.72  03-Jun-2018  maxv branches: 1.72.2;
Constify ahc_pci_ident_table[] so that it lands in .rodata (1488 bytes).
 1.71  14-Jul-2016  msaitoh branches: 1.71.16;
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF
 1.70  29-Mar-2014  christos branches: 1.70.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.69  18-Feb-2014  macallan if MMIO is allowed and available, prefer it over PIO
now my ADPT,2930CU works again
 1.68  26-Nov-2009  njoly branches: 1.68.12; 1.68.22; 1.68.26;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.
 1.67  02-Sep-2009  tsutsui Call pmf_device_register(9) in ahc_attahc() rather than ahc_pci_attach()
since pmf_device_deregister(9) is called from ahc_detach() so that
cardbus backend also gets proper pmf(9) calls.
PCI backend is tested on on O2, but cardbus is untested.
 1.66  06-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.65  05-May-2009  cegger device_t/softc split
 1.64  03-Jan-2009  yamt branches: 1.64.2;
remove extra semicolons.
 1.63  22-Feb-2008  dyoung branches: 1.63.4; 1.63.12;
Use device_t and accessors. Use aprint_*_dev(). Use PMF_FN_*.
 1.62  28-Jan-2008  macallan branches: 1.62.2; 1.62.6;
get rid of the shutdown hook, add suspend and resume handlers instead
XXX: ahc_suspend panics here so suspend calls ahc_shutdown and resume does
nothing.
This fixes a hangup and subsequent panic which occured when the shutdown hooks
were called and /afterwards/ the sd suspend handler tried to flush caches
through an already shut down ahc.
 1.61  15-Dec-2007  tsutsui Rename a device property name: "override_ultra" -> "aic7xxx-override-ultra"
 1.60  19-Oct-2007  ad branches: 1.60.2; 1.60.4; 1.60.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.59  26-Sep-2007  macallan branches: 1.59.2;
allow to override the check for an external precision resistor via device
property so we can have 40MB/s on SGI O2
 1.58  16-Nov-2006  christos branches: 1.58.8; 1.58.22; 1.58.24; 1.58.26;
__unused removal on arguments; approved by core.
 1.57  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.56  10-Jul-2006  thorpej branches: 1.56.4; 1.56.6;
Put appropriate prefixes on property names to reduce chances of name
collisions.
 1.55  05-May-2006  thorpej branches: 1.55.4;
Remove the devprop API and switch everthing over to the new proplib. Add
a new device_properties() accessor for device_t that returns the device's
property dictionary.
 1.54  15-Apr-2006  tsutsui Add AHC_USETARGETDEFAULTS to ahc_flag, which enables to
use default target (but not for host) device settings on
ahc(4) interface without its SEEPROM (mostly on-board one).

This flag could be useful if host's BIOS (firmware) initializes
ahc(4) chip with some conservative (async, no tagged queuing etc.)
target settings for minimum support to load its primary loader etc.,
and it will be enabled in each attachment according to MD device
properties(9). Currently this property is set only on sgimips for
O2 on-board aic7880 adapters.

No objection on tech-kern (and netbsd-bugs), and closes PR kern/23276.
 1.53  24-Dec-2005  perry branches: 1.53.4; 1.53.6; 1.53.8; 1.53.10; 1.53.12;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.52  11-Dec-2005  christos merge ktrace-lwp.
 1.51  28-Jun-2005  thorpej branches: 1.51.2;
Use ANSI function decls and static.
 1.50  30-May-2005  christos - const poisoning
- avoid variable shadowing.
 1.49  27-Feb-2005  perry nuke trailing whitespace
 1.48  04-Feb-2005  perry de-__P
 1.47  17-Oct-2004  christos branches: 1.47.4; 1.47.6;
Bring back ALLOW_MEMIO change that was lost between 1.38 and 1.39. This
change reportedly makes the driver work on macppc. There must be a better
way of doing this (based on the chip revision?).
 1.46  16-Oct-2004  christos Make a commented out print statement compile and avoid wrapped lines.
No functional change.
 1.45  16-Mar-2004  simonb branches: 1.45.2;
Fix an assigned-to-but-not-used variable in the non AHC_ALLOW_MEMIO case.
 1.44  13-Jan-2004  augustss Print the device description in the attach routine like all other drivers do.
 1.43  18-Aug-2003  taca make ahc(4) to recognize Adaptec 2915LP Ultra160 SCSI adapter.
 1.42  14-Jul-2003  lukem add missing __KERNEL_RCSID()
 1.41  04-Jun-2003  pk branches: 1.41.2;
ahc_pci_probe: avoid placeholder entries in the `identities' table.
 1.40  25-Apr-2003  fvdl On the first read of the DEVCONFIG PCI config register, sparc64 systems
seem to return all 1s. The second read is ok, though. So, as a workaround,
read it twice. From Manuel Bouyer.
 1.39  19-Apr-2003  fvdl Newer ahc driver, port from Justin Gibbs' driver in FreeBSD. Ported by
Pascal Renauld at Network Storage Solutions, Inc, with some changes
by me.
 1.38  31-Jan-2003  thorpej Use aprint_*().
 1.37  20-Jan-2003  simonb The Double-Semi-Colon Police.
 1.36  20-Jan-2003  simonb Remove variable that is only assigned too but not referenced.
 1.35  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.34  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.33  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.32  21-Nov-2001  wiz branches: 1.32.10;
Presence looks better with a 'c' instead of an 's'.
 1.31  13-Nov-2001  lukem add RCSID
 1.30  24-Mar-2001  christos branches: 1.30.2;
There was a stray debugging message "OptionMode = %x\n". Prefix it with
the device name, and enable it only in debugging mode.
 1.29  18-Jan-2001  jdolecek branches: 1.29.2;
constify
 1.28  28-Dec-2000  sommerfeld Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.27  24-Sep-2000  jdolecek use new generic bootverbose instead of local definition
 1.26  04-Sep-2000  soren Fix 'RAID unsupported' printf.
 1.25  04-Sep-2000  soren Add support for the AAA-131 RAID controller by treating it as a 7890.
Taken from rev 1.32 of the FreeBSD ahc_pci.c.
 1.24  10-May-2000  thorpej branches: 1.24.4;
Support Adaptec U2W cards with a 64-bit PCI memory range (such cards
are available with Power Macintosh G3 and G4 systems).
 1.23  16-Mar-2000  fvdl Set bus_intr to ahc_pci_intr.
 1.22  15-Mar-2000  fvdl PCI frontend for new ahc driver.
 1.21  26-Jan-2000  thorpej Remove the FreeBSD support from this file. It hasn't worked in FreeBSD
for some time, and only made the code harder to read.
 1.20  26-Jan-2000  thorpej Split the code that reads the SEEPROM into its own file.
 1.19  12-Oct-1999  hannken branches: 1.19.2;
Add support for `Adaptec AHA 2940UW Pro'.
Behaves like the `Adaptec AHA 2940UW'.

Device info: product id = 0x8778, Chip = AIC7880P.
 1.18  08-Jun-1998  thorpej branches: 1.18.14;
Nuke __BROKEN_INDIRECT_CONFIG.
 1.17  16-Mar-1998  leo Use bus-dma functions.
 1.16  27-Aug-1997  bouyer Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.15  08-May-1997  thorpej branches: 1.15.2; 1.15.4;
Garbage-collect and uneeded #ifdef.
 1.14  13-Apr-1997  cgd rename pci_map_register to pci_mapreg_map. The latter name is more
descriptive, and allows for a sane name for a function which just digs
the info out of the mapping register but doesn't do the mapping.
 1.13  13-Apr-1997  cgd use pci_map_register(). map both mem and I/O spaces, preferring mem
space if it's usable, but falling back to I/O space if mem isn't usable.
 1.12  10-Apr-1997  cgd clean these up (mostly rename bus_space_{tag,handle}_t variables) so that
this code makes equal sense for memory and I/O space, prefer to map
the PCI front end via memory space (conditionalized on a patchable kernel
variable), and do a bit of other random NetBSD-specific cleanup. (These
changes were sent to Justin Gibbs on March 28.)
 1.11  13-Mar-1997  cgd clean up the __BROKEN_INDIRECT_CONFIG chunks of the last change
 1.10  13-Mar-1997  cgd fixes from Matt Jacob so that these can compile and run on the Alpha.
(aic7xxx has been tested and works on the Alpha, bha has not yet been
tested on thne Alpha.)
 1.9  21-Oct-1996  thorpej New bus.h implementation/interface:
- No more distinction between i/o-mapped and memory-mapped
devices. It's all "bus space" now, and space tags
differentiate the space with finer grain than the
bus chipset tag.
- Add memory barrier methods.
- Implement space alloc/free methods.
- Implement region read/write methods (like memcpy to/from
bus space).
This interface provides a better abstraction for dealing with
machine-independent chipset drivers.
 1.8  13-Oct-1996  christos backout kprintf changes
 1.7  10-Oct-1996  christos - move a variable declaration that is unused under NetBSD into the ifdef
for FreeBSD
- printf -> kprintf, sprintf -> ksprintf
 1.6  08-Oct-1996  gibbs dev/microcode/aic7xxx/aic7xxx.seq,
dev/microcode/aic7xxx_seq.h,
dev/ic/aic7xxxreg.h:
Remove intrinsic knowledge about SDTR and WDTR messages and replace it
with a generic message system that allows the kernel driver to handle
SDTR, WDTR and any other type of extended message it chooses too. This
makes the sequencer code much simpler, makes extended message handling
debuggable since the bulk of the work is in the kernel driver, and saves
lots of instruction space.

Regen microcode header file.

dev/ic/aic7xxx.c, dev/ic/aic7xxxvar.h:
Add code to handle WDTR and SDTR negotiation in light of the changes in
the message interface to the sequencer. Don't reject targets that
negotiate async by sending an SDTR with a 0 offset. Use an sdtr message
with 0,0 to negotiate async when a target suggests a period that is too
long for us to handle. Some tape and cdrom drives don't like us doing
the message reject that we did in the past.

Fix a problem with handing the QUEUE FULL condition.

Fix a race condition (most likely the cause of the SCB paging problems) that
might allow the sequencer to get unpaused before the condition that caused
it to be paused (a SEQINT) was handled.

Race condition pointed out by Doug Ledford <dledford@dialnet.net> and
by "Dan Willis" <dan@plutotech.com>.

dev/pci/ahc_pci.c:
Add support for the 2940AU, an aic7860 based controller.

dev/pci/pcidevs.h, dev/pci/pcidevs_data.h:
Add product IDs for the 2940AU, aic7860 and aic7855.

Regen data file.

scsi/scsi_message.h:
Add MSG_EXT_SDTR_LEN and MSG_EXT_WDTR_LEN - the length of bytes in these
extended messages.

Thanks to Chuck Cranor <chuck@maria.wustl.edu> for testing these changes
out for me.
 1.5  28-Aug-1996  thorpej Quiet the ahc driver down a bit by only enabling some of less useful
messages #if defined(DEBUG) in the NetBSD case.
 1.4  14-Jul-1996  cgd #ifdefs are not allowed in macro invocations.
 1.3  10-Jul-1996  explorer Updates to aic7xxx driver ; from pr port-i386/2600
 1.2  20-May-1996  thorpej branches: 1.2.4;
RCS Id police.
 1.1  16-May-1996  mycroft New version, with changes from Justin Gibbs and Noriyuki Soda.
 1.2.4.2  04-Mar-1997  mycroft Pull up latest ahc driver. Fixes several bugs.
 1.2.4.1  18-Jul-1996  jtc Pulled up from rev 1.4, ahc fixes
 1.15.4.1  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.1  01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.18.14.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.19.2.4  27-Mar-2001  bouyer Sync with HEAD.
 1.19.2.3  11-Feb-2001  bouyer Sync with HEAD.
 1.19.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.19.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.24.4.2  06-Feb-2002  he Pull up revision 1.30 (requested by jlam):
Move stray debugging message to only occur in debug mode.
 1.24.4.1  05-Sep-2000  soren Pull up revs 1.25-1.26:
> Add support for the AAA-131 RAID controller by treating it as a 7890.
> Taken from rev 1.32 of the FreeBSD ahc_pci.c.
> Fix 'RAID unsupported' printf.
 1.29.2.4  18-Oct-2002  nathanw Catch up to -current.
 1.29.2.3  08-Jan-2002  nathanw Catch up to -current.
 1.29.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.29.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.30.2.2  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.30.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.32.10.1  23-Aug-2003  tron Pull up revision 1.43 via patch (requested by taca in ticket #1430):
make ahc(4) to recognize Adaptec 2915LP Ultra160 SCSI adapter.
 1.41.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.41.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.41.2.5  04-Feb-2005  skrll Sync with HEAD.
 1.41.2.4  19-Oct-2004  skrll Sync with HEAD
 1.41.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.41.2.1  03-Aug-2004  skrll Sync with HEAD
 1.45.2.1  12-Nov-2004  jmc Pullup rev 1.46-1.47 (requested by christos in ticket #930)

Bring back ALLOW_MEMIO change that was lost between 1.38 and 1.39.
 1.47.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.47.6.1  12-Feb-2005  yamt sync with head.
 1.47.4.1  29-Apr-2005  kent sync with -current
 1.51.2.6  27-Feb-2008  yamt sync with head.
 1.51.2.5  04-Feb-2008  yamt sync with head.
 1.51.2.4  21-Jan-2008  yamt sync with head
 1.51.2.3  27-Oct-2007  yamt sync with head.
 1.51.2.2  30-Dec-2006  yamt sync with head.
 1.51.2.1  21-Jun-2006  yamt sync with head.
 1.53.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.53.10.2  11-May-2006  elad sync with head
 1.53.10.1  19-Apr-2006  elad sync with head.
 1.53.8.2  11-Aug-2006  yamt sync with head
 1.53.8.1  24-May-2006  yamt sync with head.
 1.53.6.2  01-Jun-2006  kardel Sync with head.
 1.53.6.1  22-Apr-2006  simonb Sync with head.
 1.53.4.1  09-Sep-2006  rpaulo sync with head
 1.55.4.1  13-Jul-2006  gdamore Merge from HEAD.
 1.56.6.2  10-Dec-2006  yamt sync with head.
 1.56.6.1  22-Oct-2006  yamt sync with head
 1.56.4.1  18-Nov-2006  ad Sync with head.
 1.58.26.1  06-Oct-2007  yamt sync with head.
 1.58.24.3  23-Mar-2008  matt sync with HEAD
 1.58.24.2  09-Jan-2008  matt sync with HEAD
 1.58.24.1  06-Nov-2007  matt sync with HEAD
 1.58.22.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.58.22.1  02-Oct-2007  joerg Sync with HEAD.
 1.58.8.2  23-Oct-2007  ad Sync with head.
 1.58.8.1  09-Oct-2007  ad Sync with head.
 1.59.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.60.8.1  02-Jan-2008  bouyer Sync with HEAD
 1.60.4.1  26-Dec-2007  ad Sync with head.
 1.60.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.62.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.62.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.62.2.1  24-Mar-2008  keiichi sync with head.
 1.63.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.63.4.4  11-Mar-2010  yamt sync with head
 1.63.4.3  16-Sep-2009  yamt sync with head
 1.63.4.2  16-May-2009  yamt sync with head
 1.63.4.1  04-May-2009  yamt sync with head.
 1.64.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.68.26.1  18-May-2014  rmind sync with head
 1.68.22.2  03-Dec-2017  jdolecek update from HEAD
 1.68.22.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.68.12.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.70.6.1  05-Oct-2016  skrll Sync with HEAD
 1.71.16.2  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.71.16.1  25-Jun-2018  pgoyette Sync with HEAD
 1.72.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.72.2.1  10-Jun-2019  christos Sync with HEAD
 1.75.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed