freebsd-nq/sys/dev
John Baldwin 6b0ff427a5 Further refine the handling of resources for BARs in the PCI bus driver.
A while back, Warner changed the PCI bus code to reserve resources when
enumerating devices and simply give devices the previously allocated
resources when they call bus_alloc_resource().  This ensures that address
ranges being decoded by a BAR are always allocated in the nexus0 device
(or whatever device the PCI bus gets its address space from) even if a
device driver is not attached to the device.  This patch extends this
behavior further:
- To let the PCI bus distinguish between a resource being allocated by
  a device driver vs. merely being allocated by the bus, use
  rman_set_device() to assign the device to the bus when it is owned
  by the bus and to the child device when it is allocated by the child
  device's driver.  We can now prevent a device driver from allocating
  the same device twice.  Doing so could result in odd things like
  allocating duplicate virtual memory to map the resource on some
  archs and leaking the original mapping.
- When a PCI device driver releases a resource, don't pass the request
  all the way up the tree and release it in the nexus (or similar device)
  since the BAR is still active and decoding.  Otherwise, another device
  could later allocate the same range even though it is still in use.
  Instead, deactivate the resource and assign it back to the PCI bus
  using rman_set_device().
- pci_delete_resource() will actually completely free a BAR including
  attemping to disable it.
- Disable BAR decoding via the command register when sizing a BAR in
  pci_alloc_map() which is used to allocate resources for a BAR when
  the BIOS/firmware did not assign a usable resource range during boot.
  This mirrors an earlier fix to pci_add_map() which is used when to
  size BARs during boot.
- Move the activation of I/O decoding in the PCI command register into
  pci_activate_resource() instead of doing it in pci_alloc_resource().
  Previously we could actually enable decoding before a BAR was
  initialized via pci_alloc_map().

Glanced at by:	bsdimp
2009-03-03 16:38:59 +00:00
..
aac SVN rev 188743 modified aac_rx_get_fwstatus to use the AAC_RX_OMR0 2009-02-23 18:22:06 +00:00
acpi_support device_shutdown returns int. 2009-02-05 18:39:33 +00:00
acpica acpi_cpu: fixup for PIIX4E PCI config related to C2 2009-02-19 14:39:52 +00:00
adb Use si_drv1 to hold the softc for the adb_mouse character device instead of 2009-01-29 16:18:49 +00:00
adlink Set D_NEEDGIANT. 2007-08-04 17:43:11 +00:00
advansys
ae detach doesn't return an unsinged int, but returns an int. 2009-02-04 20:35:22 +00:00
age Remove informational messages left. These messages were intended to 2008-11-07 07:02:28 +00:00
agp Fix AGP debugging code: 2009-02-06 20:57:10 +00:00
aha Pass bus_get_dma_tag() into the first argument of bus_dma_create_tag() 2008-10-07 23:55:32 +00:00
ahb
aic
aic7xxx Make ddb command registration dynamic so modules can extend 2008-09-15 22:45:14 +00:00
ale AR8113 also need to set DMA read burst value. This should fix 2008-12-03 09:01:12 +00:00
amd
amr Move the CAM passthrough code into a true module so that it doesn't have to be 2008-11-03 00:53:54 +00:00
an Shutdown routine returns int. 2009-02-04 20:39:45 +00:00
ar Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
arcmsr Tell CAM that SPI disconnect works, which in turn will let it use tags. 2009-02-20 07:40:54 +00:00
asmc Check for non-existing model DMI string. 2008-11-29 14:20:36 +00:00
asr Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
ata Set PortMultiplier port only for SATA2 channels, where it is applicable. 2009-03-03 06:39:38 +00:00
ath fix typo's 2009-02-24 15:43:42 +00:00
atkbdc bus_add_child takes a const char *. 2009-02-05 18:38:39 +00:00
auxio
bce - Update copyright to 2009. 2009-02-27 19:25:06 +00:00
bfe Add a new sysctl node 'dev.bfe.N.stats' that shows various MAC 2008-08-22 06:46:55 +00:00
bge Don't reset the PHY probe retry counter within the loop so 2009-02-10 21:54:23 +00:00
bktr Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
bm Fix bm_shutdown() KOBJ method to correspond to return int, as it should. 2009-02-04 22:16:27 +00:00
buslogic
cardbus Remove unused variable. 2009-02-06 00:55:19 +00:00
ce Remove debug.ce.mpsafenet: we no longer support running the network 2009-02-15 23:29:13 +00:00
cfe Remove an unused variable to make the SENTRY5 mips kernel compile 2008-12-27 11:38:41 +00:00
cfi fix whitespace 2009-02-17 23:43:17 +00:00
ciss Tell CAM that CISS logical devices support tagged queueing. This fixes 2009-02-20 07:43:43 +00:00
cm Remove unused ifaddr and ifreq local variables. 2009-02-12 23:55:35 +00:00
cmx Commit cmx(4), a driver for Omnikey CardMan 4040 PCMCIA smartcard readers. 2008-03-06 08:09:45 +00:00
coretemp Introduce cpu_vendor_id and replace a lot of strcmp(cpu_vendor, "..."). 2008-11-26 19:25:13 +00:00
cp Remove debug.cp.mpsafenet: we no longer support running the network 2009-02-15 23:18:29 +00:00
cpuctl Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
cpufreq Attach the cpufreq child devices with specific orders to enforce relative 2008-08-13 16:09:40 +00:00
cs Improve the EEPROM parsing, based on finding a datasheet that describes 2008-07-09 16:47:55 +00:00
ct
ctau Remove debug.ctau.mpsafenet: we no longer support running the network 2009-02-15 23:21:52 +00:00
cx if_cx is currently disconnected from the build due to a dependence on 2009-02-19 00:06:01 +00:00
cxgb For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
cy
dc - According to the corresponding Linux, NetBSD and OpenSolaris 2008-12-07 23:02:37 +00:00
dcons Check the return values of contigmalloc(9) as well as bus_dma(9) 2009-01-07 21:25:44 +00:00
de tulip_busdma_cleanup: pass correct vaddr (2nd arg) to bus_dmamem_free() 2009-02-09 17:07:29 +00:00
digi Remove unused files from the digi(4) driver. 2009-01-16 14:45:48 +00:00
dpt
drm Initialize the vblank structures at load time. Previously we did this 2009-02-28 02:37:55 +00:00
e1000 Fix a cut/paste bug which prevents us from setting the average 2009-01-13 00:10:50 +00:00
ed When the miibus for the AX88x90 or TC5299J cards fails to attach, we 2008-08-06 22:22:27 +00:00
eisa
en Hide an unused variable in case we compile with neither INET nor INET6. 2008-11-06 09:41:31 +00:00
ep
esp o Move the MODULE_DEPEND() for cam(4) from the esp_sbus.c front-end to 2008-09-08 20:20:44 +00:00
et Don't leak DMA map if not freed. 2008-07-11 18:26:12 +00:00
ex Add preliminary support for the OLICOM OC2231 and OC2232. This is the 2008-08-27 04:11:03 +00:00
exca fix spelling error 2009-02-06 09:34:17 +00:00
fatm Use bus_get_dma_tag() so fatm(4) works on platforms requiring it. 2008-09-30 18:52:43 +00:00
fb Third argument to the vi_mmap_t function is vm_paddr_t *. 2008-11-29 20:16:53 +00:00
fdc Eliminate an unused variable reported by coverity 2008-11-23 23:04:28 +00:00
fe - Use bus_foo() rather than bus_space_foo() and retire the bus tag and handle 2008-06-23 18:16:25 +00:00
firewire Enhance debugging mode by storing the string "BB:TT:LL" once and use 2009-02-18 18:41:34 +00:00
flash Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
fxp writereg returns an int. 2009-02-05 19:33:35 +00:00
gem - Restore the behavior of enabling the MII buffer for an internal 2008-08-23 15:03:26 +00:00
glxsb Fix two possible (but unlikely) NULL-pointer dereferences in glxsb(4). 2008-11-17 07:09:40 +00:00
hatm Give MEXTADD() another argument to make both void pointers to the 2008-02-01 19:36:27 +00:00
hifn shutdown returns an int 2009-02-05 19:37:49 +00:00
hme - Use the revamped code from the gem(4) PCI front-end, which 2008-04-26 14:17:21 +00:00
hptiop - Spell cam correctly (scbus), this makes it possible to compile hptiop 2008-10-04 10:39:31 +00:00
hptmv Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
hptrr Fix a mistake made during the import of the driver. Previous versions of 2008-03-08 18:06:48 +00:00
hwpmc - Add support for nehalem/corei7 cpus. This supports all of the core 2009-01-27 07:29:37 +00:00
ic - Cleanup i8251 related defines. 2008-09-07 04:35:04 +00:00
ichsmb - Change ichsmb(4) to follow the format of all the other smbus controllers 2009-02-03 16:14:37 +00:00
ichwd ichwd: correct range check for timeout value 2009-03-03 15:50:24 +00:00
ida
ie Use the new bus device_shutdown hook for performing the shutdown action 2008-08-01 21:33:07 +00:00
ieee488 Remove the distinction between device minor and unit numbers. 2008-05-29 12:50:46 +00:00
if_ndis Move usb to a graveyard location under sys/legacy/dev, it is intended that the 2009-02-23 18:16:17 +00:00
iicbus Fix iicbus_intr, iicbus_write and device_read_ivar prototypes... 2009-02-10 22:50:23 +00:00
iir Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
io Remove D_NEEDGIANT from io(4). 2008-08-08 13:43:56 +00:00
ipmi Don't right-adjust the SMBus slave address for SSIF IPMI BMCs enumerated 2009-02-03 16:39:51 +00:00
ips
ipw Minor cleanup of vap create work: 2008-05-12 00:15:30 +00:00
iscsi/initiator This commit fixes the issue with alias_sctp.c. No 2009-02-14 11:34:57 +00:00
isp Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSI 2008-12-15 21:42:38 +00:00
ispfw Make ispfw(4) play nice with individual firmware modules. 2008-11-11 00:14:10 +00:00
iwi Change the calling convention for ic_node_alloc to deal with 2008-06-07 18:38:02 +00:00
iwn remove references to ic_stats 2009-02-13 16:17:05 +00:00
ixgb
ixgbe Small nit I just noticed, a pre-decrement should be post. 2008-11-27 02:19:44 +00:00
jme Add HW MAC counter support for newer JMC250/JMC260 revisions. 2008-12-04 02:16:53 +00:00
joy Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
k8temp Check the return value of config_intrhook_establish(). 2008-11-29 14:26:22 +00:00
kbd Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
kbdmux Since r188030 the error value for attach is returned, this means if kbdmux 2009-02-13 23:36:08 +00:00
le - Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etc 2008-09-24 21:26:46 +00:00
led Remove unit2minor() use from kernel code. 2008-09-26 14:19:52 +00:00
lge Plug memory leak in jumbo buffer allocation failure path. 2008-03-05 05:36:09 +00:00
lmc shutdown returns an int 2009-02-05 19:37:49 +00:00
malo Minor cleanup of vap create work: 2008-05-12 00:15:30 +00:00
mc146818
mca Change the functions to ANSI in those cases where it breaks promotion 2009-02-24 18:09:31 +00:00
mcd
md Remove unnecessary page queues locking around vm_page_wakeup(). (This 2009-02-22 02:50:31 +00:00
mem
mfi Change Dell's gen2 catch-all from Dell PERC H700/H800 to Dell PERC Gen2 2008-12-15 17:11:40 +00:00
mge Handle mge(4) chip revision differences at run-time rather then compile time, 2009-01-08 11:09:27 +00:00
mii Renamed the FRAMELEN macro to TRUEPHY_FRAMELEN as for powerpc 2008-11-28 23:44:13 +00:00
mk48txx
mlx Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
mly Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
mmc Add kernel dumping support. Works fine with sdhci controller driver. 2009-02-17 19:17:25 +00:00
mn Move mn over. One of the last stragglers in sys/pci. There's no 2008-11-02 17:04:54 +00:00
mpt Make the whole initiator mode part of mpt(4) endian-clean, 2009-01-07 21:52:47 +00:00
mse Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
msk Add hardware MAC statistics support. Also added some reserved 2009-01-16 08:06:55 +00:00
mxge Fix cut/paste error in previous commit and use the 2009-02-17 22:25:19 +00:00
my Shutdown returns an int. 2009-02-05 19:30:55 +00:00
ncv
nfe Fix a typo. 2008-12-20 00:04:04 +00:00
nge Fix function prototype for device_shutdown method. 2007-11-22 02:45:00 +00:00
nmdm Make nmdm(4) use MPSAFE callouts. 2008-11-19 21:07:33 +00:00
nsp Change the functions to ANSI in those cases where it breaks promotion 2009-02-24 18:09:31 +00:00
null
nve writereg returns an int. 2009-02-05 19:33:20 +00:00
nvram - Use an sx lock to serialize writes since they update the checksum. 2008-08-01 20:39:18 +00:00
nxge - bump __FreeBSD version to reflect added buf_ring, memory barriers, 2008-11-22 05:55:56 +00:00
ofw Some Apple I2C buses give the device's I2C address in a property with the 2009-03-02 15:22:01 +00:00
patm Remove unused variable. 2008-11-26 13:44:11 +00:00
pbio Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
pccard Store the entire funce for disk type functions (eg CF cards and the 2009-02-06 07:49:03 +00:00
pccbb Hold off root mounting until we've gone through the loop of our thread 2009-02-17 02:14:04 +00:00
pcf - Consolidate module version for the pcf module into just pcf.c instead 2008-08-05 17:39:37 +00:00
pci Further refine the handling of resources for BARs in the PCI bus driver. 2009-03-03 16:38:59 +00:00
pcn shutdown returns an int 2009-02-05 19:36:14 +00:00
pdq
powermac_nvram Convert PowerPC AIM PCI and nexus busses to standard OFW bus interface. This 2008-10-14 14:54:14 +00:00
ppbus Fix lptopen() and lptclose() to not trash the state of the HAVEBUS flag 2009-02-11 14:25:09 +00:00
ppc Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. The 2009-02-11 00:08:03 +00:00
pst
puc Add support for the Sunix SUN1889-based dual parallel port card. 2009-02-12 10:39:19 +00:00
quicc Support for Freescale QUad Integrated Communications Controller. 2008-03-03 18:20:17 +00:00
ral o use the new association callback to notify the driver when joining a bss 2008-10-27 16:46:50 +00:00
random Make sure arc4random(9) is properly seeded when /etc/rc.d/initrandom returns. 2008-11-24 17:39:39 +00:00
ray Fix a number of style issues in the MALLOC / FREE commit. I've tried to 2008-10-23 20:26:15 +00:00
rc
re Allocating 2 MSI messages do not seem to work on certain controllers 2009-02-11 00:23:56 +00:00
rndtest
rp Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
safe shutdown returns an int 2009-02-05 19:37:49 +00:00
sbni Disable the inline assembly crc32 routine and use the C version instead. 2008-09-10 18:42:19 +00:00
scc Make iclear return int, since that matches all function definitions of it. 2009-02-05 19:32:34 +00:00
scd
sdhci Add support for interruptless kernel dumping. 2009-02-17 19:12:15 +00:00
sf Fix build. 2008-01-21 09:51:28 +00:00
si si_cmdname() is defined only when SI_DEBUG is enabled, thus 2009-02-07 02:14:27 +00:00
siba Use some casting to get the right addresses. This is likely unwise 2008-09-26 05:40:56 +00:00
sio Allow device hints to wire the unit numbers of devices. 2008-11-18 21:01:54 +00:00
sis Receving VLAN oversized frames raise SIS_ISR_RX_ERR interrupt, so 2009-02-13 02:08:20 +00:00
sk Prefer NULL over integer 0 for pointer type. 2008-02-14 01:25:01 +00:00
smbus - Change ichsmb(4) to follow the format of all the other smbus controllers 2009-02-03 16:14:37 +00:00
smc - Move ether_ifdetach earlier. 2008-06-17 05:48:42 +00:00
sn
snc Convert to new style PC Card front end driver. Add support for the 2008-08-07 20:55:20 +00:00
snp Slightly improve the design of the TTY buffer. 2009-02-03 19:58:28 +00:00
sound Rename the ushub device class back to uhub as it was in the old usb stack, 2009-03-02 05:37:05 +00:00
speaker Remove unneeded checks of device unit number from speaker(4). 2009-01-25 09:20:59 +00:00
spibus
sr Fix a number of style issues in the MALLOC / FREE commit. I've tried to 2008-10-23 20:26:15 +00:00
ste Move the ste driver from sys/pci to sys/dev/ste. 2008-08-14 20:09:58 +00:00
stg Change the functions to ANSI in those cases where it breaks promotion 2009-02-24 18:09:31 +00:00
stge Use m_collapse(9) to collapse mbuf chains instead of relying on 2008-01-18 08:32:08 +00:00
streams The streams ptm code is pretty awful and likely incorrect. I don't know 2009-02-16 20:12:28 +00:00
sym Use xpt_register_async() in order to remove code duplication. 2008-10-14 20:18:57 +00:00
syscons Remove unneeded variable assignment. 2009-02-26 12:02:38 +00:00
tdfx Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
ti Remove some remnant alpha hacks. 2008-04-26 14:13:48 +00:00
tl Fix shutdown prototypes. 2009-02-10 23:17:20 +00:00
trm
tsec tsec(4) cosmetics. 2009-02-17 16:02:45 +00:00
twa Limit DMA memory to lower addressable 4GB, without this patch, we 2008-10-06 22:34:17 +00:00
twe Replace all calls to minor() with dev2unit(). 2008-09-27 08:51:18 +00:00
tx Fix shutdown prototypes. 2009-02-10 23:17:20 +00:00
txp Update to latest 3Com firmware image. The latest fimware is 2009-02-25 01:12:56 +00:00
uart Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. The 2009-02-11 00:08:03 +00:00
ubsec
usb Rename the ushub device class back to uhub as it was in the old usb stack, 2009-03-02 05:37:05 +00:00
utopia Fix a use-after-free. 2007-12-05 19:32:59 +00:00
vge Fix Rx/Tx checksum offload ioctl handling. Now checksum offload 2008-11-13 04:11:01 +00:00
vkbd Remove unit2minor() use from kernel code. 2008-09-26 14:19:52 +00:00
vr It seems there are still issues on multicast perfect filtering. 2008-12-12 01:26:11 +00:00
vx MFp4: Network Adapter is redundant. 2008-08-25 05:20:17 +00:00
watchdog
wb Move wb driver from sys/pci to sys/dev/wb. 2008-08-14 21:26:29 +00:00
wds
wi Remove opt_wi.h 2008-08-27 05:39:44 +00:00
wl
wpi remove references to ic_stats 2009-02-13 16:17:05 +00:00
xe Style(9) xe(4). The MD5 sums are different, but comparing the dissassemblies 2008-06-04 20:26:57 +00:00
xen fix non-witness compile 2009-02-05 21:18:39 +00:00
xl Move the xl driver form sys/pci to sys/dev/xl for consistency. 2008-08-10 09:45:52 +00:00