summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pci.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't try to enable io or memory access for non-standard resourcedfr2003-09-011-6/+9
| | | | | addresses. This stops resource allocations for e.g. amdpm failing - this has its own special ways of enabling access.
* - Rename PCIx_HEADERTYPE* to PCIx_HDRTYPE* so the constants aren't so long.jhb2003-08-281-3/+3
| | | | | | | | | | | - Add a new PCIM_HDRTYPE constant for the field in PCIR_HDRTYPE that holds the header type. - Replace several magic numbers with appropriate constants for the header type register and a couple of PCI_FUNCMAX. - Merge to amd64 the fix to the i386 bridge code to skip devices with unknown header types. Requested by: imp (1, 2)
* Prefer the uintXX_t to the u_intXX_t names.imp2003-08-221-30/+30
|
* Define PCI_MAXHDRTYPE to be 2. We know about header types 0, 1 and 2.imp2003-08-011-1/+1
| | | | | Update the MI device scanning code to use PCI_MAXHDRTYPE rather than the hard coded 2.
* Update the 'ps', 'show pci', and 'show ktr' ddb commands to use the newjhb2003-07-311-29/+4
| | | | pager callout instead of homerolling their own paging facility.
* Add a new PCI interface method, assign_interrupt, to determine thetmm2003-07-011-6/+17
| | | | | | | | | | | | | | | | interrupt to be used for a device. This is intended solely for internal use of PCI bus implementations, and exists so that PCI bus drivers implementing special interrupt assignment methods which require additional work at the bus level to work right can be easily derived from the generic driver (or any other one) without resorting to hacks. It will be used in the sparc64 ofw_pcibus driver, which will be committed shortly. Make use of this method in the generic implementation, and add it to the method table of bus drivers derived from the PCI one. Reviewed by: imp, -hackers
* Allow to write the intpin ivar using the pci_set_intpin() accessor. Theretmm2003-07-011-1/+3
| | | | | | | | are some Sun PCI devices around which bogusly set intpin to 0, although they use the intline mechanism; this allows the device driver to correct that. Reviewed by: imp
* Re-enabled PCI irq routing on pc98.nyan2003-06-221-1/+1
|
* use a REG macro that was already defined.jmg2003-06-221-3/+10
| | | | | | | | Reorder how the pci probing in handled. before adding devices, check to see if the slot is a multi-function device to see if we should probe all the functions. Original idea by: imp
* When we re-route a PCI interrupt, write the new IRQ value into the intlinejhb2003-06-091-2/+3
| | | | | | register. Reviewed by: imp
* Don't route PCI irq on pc98.nyan2003-06-081-1/+1
|
* - Adjust the comment about re-routing PCI interrupts to be lessjhb2003-06-071-7/+11
| | | | | | | | | | | ia64-specific. - When trying to re-route interrupts, don't change cfg->intline if the re-route fails by returning an invalid vector. This fixes machines without any way of routing interrupts such as older PC's without a $PIR table. We do not currently write the new intline value back to the hardware, but we should. That will likely be added in a later commit.
* Batton down the hatches!!!jhb2003-06-041-1/+1
| | | | | | | | Always route PCI interrupts on i386 UP machines. I was planning to enable this for i386 anyways once SMP support is done. Having this enabled fixes problems on many people's laptops. Requested by: imp
* Remove unused variable(s).phk2003-05-311-9/+0
| | | | | | Remove break after return; Found by: FlexeLint
* Return status for PCI methods '{enable,disable}_{io,busmaster}'.mdodd2003-04-161-9/+49
| | | | Reviewed by: imp
* When the driver allocates memory or I/O ports, enable that bit in theimp2003-04-151-14/+26
| | | | | | | | | command config register. At the present, this represents a nop because these bits should have been set earlier in the process. In the future, we'll only set these bits when the driver requests the resource, not when the bus code detects the resource. Reviewed by: mdodd
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Include class designation in pnpinfo for generic driver loadingimp2003-02-181-2/+3
|
* Move the pnp and location info into the common pci bus. Make all knownimp2003-02-171-0/+31
| | | | | | | | | pci busses implement this. Also minor comment smithing in cardbus. Fix copyright to this year with my name on it since I've been doing a lot to this file. Reviewed by: jhb
* These don't need to be semi-public after all.imp2003-02-171-2/+5
|
* Use rman_get_device rather than rle->resl->r_dev.imp2003-02-161-7/+3
| | | | | make pci_hdrtypedata and pci_read_extcap accessible (but maybe in the end we'll make them private again).
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Add a new cardbus specific ivar: PCI_IVAR_ETHADDR. Some pci-likeimp2002-11-271-0/+8
| | | | | | | | buses support querying the MAC address in a standard-for-that-bus way. The base pci bus returns NULL for this IVAR always. Submitted by: sam Approved by: re (blanket for NEWCARD)
* Staticize local variable.mdodd2002-11-131-1/+1
| | | | | Submitted by: Hiten Pandya <hiten@angelica.unixdaemons.com> Obtained from: re (murray)
* Whitespace.jhb2002-10-161-2/+2
|
* Removed the only PCI_DEBUG ifdef in the kernel. PCI_DEBUG was not abde2002-10-011-2/+0
| | | | | | | supported option and it disabled a whole 2 lines of bootverbose messages. I wanted to see 1 of the messages (about the latency timers). This is a wrong place to decode pci configurations, but the code is already here and handles more details than pciconf(8).
* The bus number is unsigned, it cannot be less than zero.phk2002-10-011-3/+0
| | | | Found by: FlexeLint
* Don't use GCC shorthand for ?: unless it really matters.phk2002-09-281-2/+3
|
* Fix up a comment.jhb2002-09-041-2/+2
|
* - Make pci_load_vendor_data() static and do it during MOD_LOAD instead ofjhb2002-09-041-16/+16
| | | | | | | when the first PCI bus attaches. - Create /dev/pci during MOD_LOAD as well. - Destroy /dev/pci during MOD_UNLOAD (not that you can kldunload pci, but might as well get the code right)
* Add a new command: show pciregs, equivalent to pciconf -lguido2002-08-281-0/+77
| | | | | Reviewed by: Doug Rabson (quite some time ago) MFC after: 1 week
* Overhaul the ACPI PCI bridge driver a bit:jhb2002-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add an ACPI PCI-PCI bridge driver (the previous driver just handled Host-PCI bridges) that is a PCI driver that is a subclass of the generic PCI-PCI bridge driver. It overrides probe, attach, read_ivar, and pci_route_interrupt. - The probe routine only succeeds if our parent is an ACPI PCI bus which we test for by seeing if we can read our ACPI_HANDLE as an ivar. - The attach routine saves a copy of our handle and calls the new acpi_pcib_attach_common() function described below. - The read_ivar routine handles normal PCI-PCI bridge ivars and adds an ivar to return the ACPI_HANDLE of the bus this bridge represents. - The route_interrupt routine fetches the _PRT (PCI Interrupt Routing Table) from the bridge device's softc and passes it off to acpi_pcib_route_interrupt() to route the interrupt. - Split the old ACPI Host-PCI bridge driver into two pieces. Part of the attach routine and most of the route_interrupt routine remain in acpi_pcib.c and are shared by both ACPI PCI bridge drivers. - The attach routine verifies the PCI bridge is present, reads in the _PRT for the bridge, and attaches the child PCI bus. - The route_interrupt routine uses the passed in _PRT to route a PCI interrupt. The rest of the driver is the ACPI Host-PCI bridge specific bits that live in acpi_pcib_acpi.c. - We no longer duplicate pcib_maxslots but use it directly. - The driver now uses the pcib devclass instead of its own devclass. This means that PCI busses are now only children of pcib devices. - Allow the ACPI_HANDLE for the child PCI bus to be read as an ivar of the child bus. - Fetch the _PRT for routing PCI interrupts directly from our softc instead of walking the devclass to find ourself and then fetch our own softc. With this change and the new ACPI PCI bus driver, ACPI can now properly route interrupts for devices behind PCI-PCI bridges. That is, the Itanium2 with like 10 PCI busses can now boot ok and route all the PCI interrupts. Hopefully this will also fix problems people are having with CardBus bridges behind PCI-PCI bridges not properly routing interrupts when ACPI is used. Tested on: i386, ia64
* Various changes to make it easier to subclass the PCI bus device.jhb2002-08-261-30/+56
| | | | | | | | | | | | | | | | | | | | | | | | | - Make the pci devclass a global variable. - Add child devices in pci_attach() instead of pci_probe(). Change pci_probe() to just check for a valid bus number from the associated bridge and return -1000 if successful. This allows subclasses of the PCI bus driver to override the generic driver. - Move the code to load the vendor data into its own public function. Really though, doing this at attach is just plain wrong. This should really be done in the module load routine instead. As a side effect, the 'busno' variable in pci_attach() is now no longer static (minor bug that was harmless so far.) - Change pci_add_children() to take an extra argument that is the size of the device info structure passed to pci_read_device() and make it public so subclasses of the PCI bus can call it in their attach routines. - Move the bits to attach a probed PCI child to a PCI bus into a global pci_add_child() function. This will allow subclasses that can detect a PCI device not found in the normal PCI probe to add those devices in their own attach routine. (I have seen this in the ACPI tree on my laptop for example.) As a side effect, change the static function pci_add_resources() to get the busno, slot, and func from the passed in dinfo structure instead of requiring them as function arguments. Tested on: i386, alpha, ia64, sparc64
* While PCI interrupts are shareable, this should not have been committed justimp2002-08-021-7/+0
| | | | yet.
* Make PCI_ENABLE_IO_MODES a sysctl hw.pci.enable_io_modes. It can alsoimp2002-07-261-20/+35
| | | | | be set at boot time. It defaults to 1 now since it can be set in the boot loader. If this proves unwise, we can reset it to defaulting to 0.
* Use PCI_INTERRUPT_VALI in stead of hard coded 255imp2002-06-011-5/+5
|
* More style(9) nitsimp2002-06-011-20/+23
|
* Make this file mostly conform to style(9).imp2002-06-011-87/+86
| | | | Approved by: msmith in principle before walkabout
* Add MODULE_VERSION.mdodd2002-04-171-0/+1
|
* intline == 0 is not a valid intline on 386. See pci_cfgintr() inn_hibma2002-04-101-1/+5
| | | | | | | sys/i386/pci/pci_cfgreg.c. This should resolve some cases where adding USB support to the kernel produced an interrupt storm.
* Add 5th parameter to pci_read_device specifying the size of the objectimp2002-03-131-5/+4
| | | | to create.
* Use the pci.c code wherever possible, rather than copying all the pciimp2002-02-271-54/+49
| | | | | | | | | | | | | | code into cardbus and s/pci/cardbus. This exposes a few pci_* functions that are now static. This work is similar to work Justin posted to the mobile list about a year or two ago, which I have neglected since then. This is a subset of his current work with the multiple inheritance newbus architecutre. When completed, that will eliminate the need for pci/pci_private.h. Similar work is needed for the cardbus_cis and pccard_cis code as well.
* Implement 2 small helper functions:mdodd2002-01-101-0/+35
| | | | | pci_find_bsf() - Find a device_t by bus/slot/function. pci_find_device() - Find a device_t by vendor/device ID.
* Use the new resource_list_print_type() function to print resource listtmm2001-12-211-34/+3
| | | | | contents, and the new __BUS_ACCESSOR macro to construct the accessor functions.
* Add support for the Intel 82443MX chipsetpirzyk2001-12-211-1/+2
| | | | | PR: kern/33032 MFC after: 1 month
* Don't put variable declarations in header files, put prototypes.mdodd2001-12-191-0/+2
| | | | 'pci_devq' provides useful information now.
* Add PCI_ENABLE_IO_MODES option, for BIOSen that neglect this.jlemon2001-10-251-0/+1
| | | | Submitted by: Andrew R. Reiter arr@watson.org
* Re-route interrupts on ia64 so that we can get the I/O SAPIC interruptdfr2001-10-051-1/+12
| | | | | numbers (the BIOS leaves legacy PIC interrupt numbers in the intline registers).
* Small nit: Make both prints use 'at device %d.%d'.n_hibma2001-09-011-1/+1
|
* Ugggg. I thought I'd already committed this to -current:imp2001-08-271-1/+1
| | | | | If the intline is 0 or 255, then it needs an interrupt routed. Some Sony laptops improperly flag devices that need an interrupt with 0 :-(.
OpenPOWER on IntegriCloud