freebsd-nq/sys/dev
Bill Paul 58a6edd121 When you call MiniportInitialize() for an 802.11 driver, it will
at some point result in a status event being triggered (it should
be a link down event: the Microsoft driver design guide says you
should generate one when the NIC is initialized). Some drivers
generate the event during MiniportInitialize(), such that by the
time MiniportInitialize() completes, the NIC is ready to go. But
some drivers, in particular the ones for Atheros wireless NICs,
don't generate the event until after a device interrupt occurs
at some point after MiniportInitialize() has completed.

The gotcha is that you have to wait until the link status event
occurs one way or the other before you try to fiddle with any
settings (ssid, channel, etc...). For the drivers that set the
event sycnhronously this isn't a problem, but for the others
we have to pause after calling ndis_init_nic() and wait for the event
to arrive before continuing. Failing to wait can cause big trouble:
on my SMP system, calling ndis_setstate_80211() after ndis_init_nic()
completes, but _before_ the link event arrives, will lock up or
reset the system.

What we do now is check to see if a link event arrived while
ndis_init_nic() was running, and if it didn't we msleep() until
it does.

Along the way, I discovered a few other problems:

- Defered procedure calls run at PASSIVE_LEVEL, not DISPATCH_LEVEL.
  ntoskrnl_run_dpc() has been fixed accordingly. (I read the documentation
  wrong.)

- Similarly, the NDIS interrupt handler, which is essentially a
  DPC, also doesn't need to run at DISPATCH_LEVEL. ndis_intrtask()
  has been fixed accordingly.

- MiniportQueryInformation() and MiniportSetInformation() run at
  DISPATCH_LEVEL, and each request must complete before another
  can be submitted. ndis_get_info() and ndis_set_info() have been
  fixed accordingly.

- Turned the sleep lock that guards the NDIS thread job list into
  a spin lock. We never do anything with this lock held except manage
  the job list (no other locks are held), so it's safe to do this,
  and it's possible that ndis_sched() and ndis_unsched() can be
  called from DISPATCH_LEVEL, so using a sleep lock here is
  semantically incorrect. Also updated subr_witness.c to add the
  lock to the order list.
2005-03-07 03:05:31 +00:00
..
aac Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:24:22 +00:00
acpi_support Fix SCM ID's. 2005-03-02 09:22:34 +00:00
acpica On i386 platforms at least, ACPI throttling is accomplished by the chipset 2005-03-04 18:59:54 +00:00
adlink Use BUS_PROBE_DEFAULT 2005-03-06 06:55:11 +00:00
advansys Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:24:22 +00:00
agp Add device id for the Ali M1671 host to AGP bridge. 2005-02-27 13:05:34 +00:00
aha Simplify aha resource management, and fix a few bugs in unwinding 2005-01-19 06:54:10 +00:00
ahb Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
aic Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
aic7xxx Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:24:22 +00:00
amd Use BUS_PROBE_DEFAULT 2005-03-06 06:55:11 +00:00
amr Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:24:22 +00:00
an Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
ar Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
arl
asr Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
ata Whitespace nit. Clarifies which body this line belongs to. 2005-03-06 10:17:30 +00:00
ath Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
atkbdc plug memory leak 2005-02-26 18:55:53 +00:00
auxio Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
awi Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
bfe Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
bge Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
bktr Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 19:06:12 +00:00
buslogic Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
cardbus There were two calls to cardbus_do_cis when cardbus_do_cis changed, 2005-02-28 01:27:24 +00:00
ciss Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
cm
cnw Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
cp Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
cpufreq Make a pass through all drivers checking specs for desired behavior on 2005-02-27 02:43:02 +00:00
cs Fix the worst offenders of style(9) with a small style sweep. 2005-01-28 06:50:59 +00:00
ct Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
ctau Use dynamic major number allocation. 2005-02-27 22:16:58 +00:00
cx netchild's mega-patch to isolate compiler dependencies into a central 2005-03-02 21:33:29 +00:00
cy Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
dc Fix style(9) issues with __P removal. 2005-02-24 22:33:05 +00:00
dcons Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
de Return BUS_PROBE_DEFAULT instead of 0. 2005-02-24 21:32:56 +00:00
dec Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
digi Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
dpt Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
drm move ptr deref's to after null checks 2005-02-26 18:52:54 +00:00
ed Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
eisa Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
em Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
en Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
ep Don't print 'unknown id' in the ep_pccard_identify routine. It is 2005-01-20 20:36:59 +00:00
esp The existing locking in the esp driver appears to be fairly adequate, so 2005-03-02 15:56:42 +00:00
ex Include necessary declarations 2005-01-20 20:06:44 +00:00
exca Properly calculate the offset in mapping the memory of pccards. This 2005-01-11 00:32:43 +00:00
fatm Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
fb Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
fdc Add missing () 2005-02-28 13:49:06 +00:00
fe Perliminary support for Fujitsu SCSI LAN combo card. At least for the 2005-02-20 19:40:29 +00:00
firewire Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
fxp Cleanup: u_intXX_t -> uintX_t conversion. 2005-03-06 05:07:26 +00:00
gem Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
gfb Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
harp Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
hatm Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
hfa Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
hifn Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
hme Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
hptmv Clean up the botching of the previous repo-copy. Reference the included 2005-03-02 15:13:37 +00:00
ic Since we are quite unlikely to ever face another platform which 2005-02-06 13:46:39 +00:00
ichsmb Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
ichwd Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
ida Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
idt Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
ie Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
ieee488 Always go to standby efter each call. 2005-03-06 19:43:12 +00:00
if_ndis When you call MiniportInitialize() for an 802.11 driver, it will 2005-03-07 03:05:31 +00:00
iicbus Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
iir Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
io
ips Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
isp Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
ispfw Roll firmware to the latest version. There are a bunch of features 2005-01-29 01:12:37 +00:00
ixgb Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
joy
kbd plug memory leak 2005-02-26 18:55:53 +00:00
led Make a bunch of malloc types static. 2005-02-10 12:02:37 +00:00
lge Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
lnc Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:17:35 +00:00
mc146818 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
mca
mcd netchild's mega-patch to isolate compiler dependencies into a central 2005-03-02 21:33:29 +00:00
md Request a CPU private mapping from sf_buf_alloc(). If the swap-backed 2005-02-13 21:51:50 +00:00
mem
mii On second though, print the OUI, model and revision. This is the same 2005-02-16 05:56:39 +00:00
mk48txx o Sync with the NetBSD mk48txx driver (the result simplyfies some changes 2004-11-17 12:54:12 +00:00
mlx Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
mly Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
mpt Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
mse Use the standard FreeBSD license 2005-01-11 06:24:40 +00:00
musycc Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
my Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
ncv takawata tells me that KXLC0003 also works with this driver, so add it 2005-02-03 23:39:29 +00:00
nge Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
nmdm If CDSR_OFLOW (stty dsrflow) is enabled on one or both sides of a 2005-01-26 23:42:18 +00:00
nsp Minor style nits 2005-02-04 02:32:43 +00:00
null Use dynamic major number allocation. 2005-02-27 22:01:09 +00:00
ofw Merge revision 1.5 from NetBSD: Fix a typo in a comment. 2005-02-12 19:12:17 +00:00
owi MF dev/wi: merge the pccard lists. 2005-02-03 00:40:35 +00:00
patm Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
pbio Skip PNP probes. If there are isapnp or pnpbios instances of this driver, 2005-02-11 03:56:13 +00:00
pccard Belkin F5D5020 is an OEM'd card from RACORE based on the AX88190 2005-02-22 22:07:18 +00:00
pccbb Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
pcf
pci Expose pci_cfg_safe/restore for subclasses of pci to use. 2005-02-28 01:14:15 +00:00
pdq Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
ppbus Back out previous commit. The description didn't match the commit, 2005-03-06 06:59:15 +00:00
ppc Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
pst Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
puc Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:10:49 +00:00
random netchild's mega-patch to isolate compiler dependencies into a central 2005-03-02 21:33:29 +00:00
ray Make a bunch of malloc types static. 2005-02-10 12:02:37 +00:00
rc Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
re Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
rndtest Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
rp Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
sab Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
safe Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
sbni Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
sbsh Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
scd netchild's mega-patch to isolate compiler dependencies into a central 2005-03-02 21:33:29 +00:00
sf Fix style(9) issues with __P removal. 2005-02-24 22:33:05 +00:00
si Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
sio Simplify the "and if we're in the debugger, don't use locks" logic, 2005-02-08 17:56:04 +00:00
sk Fix style(9) issues with __P removal. 2005-02-24 22:33:05 +00:00
smbus Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
sn Only attach to network functions. I'm not aware of any multifunction 2005-01-20 19:59:31 +00:00
snc Only send packet to bpf if we are committed to send it. Previously it was 2005-02-21 17:30:10 +00:00
snp Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
sound Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
speaker /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 22:18:23 +00:00
sr Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
stg Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
streams Use kern_open() directly rather than a stackgap detour via open(). 2005-02-07 18:22:20 +00:00
sx Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
sym Use BUS_PROBE_DEFAULT 2005-03-06 06:55:11 +00:00
syscons Remove debug printout of major/minor numbers, print name instead. 2005-02-27 21:16:26 +00:00
tdfx Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
tga Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
ti Fix style(9) issues with __P removal. 2005-02-24 22:33:05 +00:00
trm Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
twa Use the correct flags for bus_dma_tag_create(). 2005-03-06 20:56:16 +00:00
twe Use correct flags for bus_dma_tag_create(). 2005-03-06 20:57:54 +00:00
tx Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
txp Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
uart - Allocate the interrupt resource as RF_SHAREABLE allowing uart(4) to work 2005-03-02 11:30:14 +00:00
ubsec Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
usb Merge from NetBSD. 2005-03-01 08:01:22 +00:00
utopia Split the chip-specific code from the generic Utopia code. This simplifies 2005-02-24 16:56:36 +00:00
vge Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
vkbd plug memory leak 2005-02-25 03:41:11 +00:00
vr Fix style(9) issues with __P removal. 2005-02-24 22:33:05 +00:00
vx Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
watchdog
wds Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
wi Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, return 2005-03-01 07:50:12 +00:00
wl Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
xe u_intXX_t -> uintXX_t 2005-01-20 19:32:37 +00:00
zs The zs(4) driver is superseded by uart(4) and broken in -CURRENT. Remove 2005-02-27 15:23:58 +00:00