freebsd-dev/sys/compat/ndis
Bill Paul 1e35c8564a Fix the problem with the Cisco Aironet 340 PCMCIA card. Most newer drivers
for Windows are deserialized miniports. Such drivers maintain their own
queues and do their own locking. This particular driver is not deserialized
though, and we need special support to handle it correctly.

Typically, in the ndis_rxeof() handler, we pass all incoming packets
directly to (*ifp->if_input)(). This in turn may cause another thread
to run and preempt us, and the packet may actually be processed and
then released before we even exit the ndis_rxeof() routine. The
problem with this is that releasing a packet calls the ndis_return_packet()
function, which hands the packet and its buffers back to the driver.
Calling ndis_return_packet() before ndis_rxeof() returns will screw
up the driver's internal queues since, not being deserialized,
it does no locking.

To avoid this problem, if we detect a serialized driver (by checking
the attribute flags passed to NdisSetAttributesEx(), we use an alternate
ndis_rxeof() handler, ndis_rxeof_serial(), which puts the call to
(*ifp->if_input)() on the NDIS SWI work queue. This guarantees the
packet won't be processed until after ndis_rxeof_serial() returns.

Note that another approach is to always copy the packet data into
another mbuf and just let the driver retain ownership of the ndis_packet
structure (ndis_return_packet() never needs to be called in this
case). I'm not sure which method is faster.
2004-03-11 09:40:00 +00:00
..
cfg_var.h Deal with the duplicate sysctl leaf problem. A .inf file may contain 2003-12-18 03:51:21 +00:00
hal_var.h The definition for __stdcall logically belongs in pe_var.h, but 2004-01-15 21:31:49 +00:00
kern_ndis.c Add preliminary support for PCMCIA devices in addition to PCI/cardbus. 2004-03-07 02:49:06 +00:00
ndis_var.h Fix a problem with the way we schedule work on the NDIS worker threads. 2004-02-14 20:57:32 +00:00
ntoskrnl_var.h - Some older Atheros drivers want KeInitializeTimer(), so implement it, 2004-03-04 23:04:02 +00:00
pe_var.h The definition for __stdcall logically belongs in pe_var.h, but 2004-01-15 21:31:49 +00:00
resource_var.h
subr_hal.c Add stub implementations of KfLowerIrql() and KfRaiseIrql() (both of 2004-02-09 19:13:58 +00:00
subr_ndis.c Fix the problem with the Cisco Aironet 340 PCMCIA card. Most newer drivers 2004-03-11 09:40:00 +00:00
subr_ntoskrnl.c Fix several issues related to the KeInitializeTimer() etc... API stuff 2004-03-10 07:43:11 +00:00
subr_pe.c AMD64 has a single MS-Win calling convention, so provide an empty __stdcall. 2004-01-13 22:49:45 +00:00