summaryrefslogtreecommitdiffstats
path: root/sys/dev/if_ndis/if_ndis.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2004-01-09 06:53:49 +0000
committerwpaul <wpaul@FreeBSD.org>2004-01-09 06:53:49 +0000
commit1d43d52f79cad462e21256035e4900d91531600a (patch)
treec1685459398a5b77abead4f6bc795a0c457d1d40 /sys/dev/if_ndis/if_ndis.c
parentb676d86e23eec800e52a40be2803231c60b1e57f (diff)
downloadFreeBSD-src-1d43d52f79cad462e21256035e4900d91531600a.zip
FreeBSD-src-1d43d52f79cad462e21256035e4900d91531600a.tar.gz
The private data section of ndis_packets has a 'packet flags' byte
which has two important flags in it: the 'allocated by NDIS' flag and the 'media specific info present' flag. There are two Windows macros for getting/setting media specific info fields within the ndis_packet structure which can behave improperly if these flags are not initialized correctly when a packet is allocated. It seems the correct thing to do is always set the NDIS_PACKET_ALLOCATED_BY_NDIS flag on all newly allocated packets. This fixes the crashes with the Intel Centrino wireless driver. My sample card now seems to work correctly. Also, fix a potential LOR involving ndis_txeof() in if_ndis.c.
Diffstat (limited to 'sys/dev/if_ndis/if_ndis.c')
-rw-r--r--sys/dev/if_ndis/if_ndis.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index 6b5b78f..0d1a168 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -757,8 +757,6 @@ ndis_txeof(adapter, packet, status)
sc = (struct ndis_softc *)block->nmb_ifp;
ifp = block->nmb_ifp;
- NDIS_LOCK(sc);
-
m = packet->np_m0;
idx = packet->np_txidx;
ifp->if_opackets++;
@@ -772,8 +770,6 @@ ndis_txeof(adapter, packet, status)
ifp->if_timer = 0;
ifp->if_flags &= ~IFF_OACTIVE;
- NDIS_UNLOCK(sc);
-
m_freem(m);
taskqueue_enqueue(taskqueue_swi, &sc->ndis_starttask);
@@ -843,7 +839,9 @@ ndis_intrtask(arg, pending)
sc = arg;
ifp = &sc->arpcom.ac_if;
+ NDIS_LOCK(sc);
ndis_intrhand(sc);
+ NDIS_UNLOCK(sc);
mtx_lock(&sc->ndis_intrmtx);
ndis_enable_intr(sc);
mtx_unlock(&sc->ndis_intrmtx);
OpenPOWER on IntegriCloud