diff options
author | wpaul <wpaul@FreeBSD.org> | 2003-12-25 06:04:40 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2003-12-25 06:04:40 +0000 |
commit | 41facc2cd68777079dd8e655f83ed4cce3538f91 (patch) | |
tree | bb19c8c3f36fb73d2988fb6a4f982f2dd595413d /sys/dev/if_ndis/if_ndis.c | |
parent | 088a25112c830fb17d05924c0aac145ac6bcaa5c (diff) | |
download | FreeBSD-src-41facc2cd68777079dd8e655f83ed4cce3538f91.zip FreeBSD-src-41facc2cd68777079dd8e655f83ed4cce3538f91.tar.gz |
Avoid using any of the ndis_packet/ndis_packet_private fields for
mbuf<->packet housekeeping. Instead, add a couple of extra fields
to the end of ndis_packet. These should be invisible to the Windows
driver module.
This also lets me get rid of a little bit of evil from ndis_ptom()
(frobbing of the ext_buf field instead of relying on the MEXTADD()
macro).
Diffstat (limited to 'sys/dev/if_ndis/if_ndis.c')
-rw-r--r-- | sys/dev/if_ndis/if_ndis.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 79db5e9..e199567 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -651,7 +651,7 @@ ndis_rxeof(adapter, packets, pktcnt) for (i = 0; i < pktcnt; i++) { p = packets[i]; /* Stash the softc here so ptom can use it. */ - p->np_rsvd[0] = (uint32_t *)sc; + p->np_softc = sc; if (ndis_ptom(&m0, p)) { printf ("ndis%d: ptom failed\n", sc->ndis_unit); ndis_return_packet(sc, p); @@ -686,13 +686,10 @@ ndis_txeof(adapter, packet, status) sc = (struct ndis_softc *)block->nmb_ifp; ifp = block->nmb_ifp; - if (packet->np_rsvd[1] == NULL) - panic("NDIS driver corrupted reserved packet fields"); - NDIS_LOCK(sc); - m = (struct mbuf *)packet->np_rsvd[1]; - idx = (int)packet->np_rsvd[0]; + m = packet->np_m0; + idx = packet->np_txidx; ifp->if_opackets++; if (sc->ndis_sc) bus_dmamap_unload(sc->ndis_ttag, sc->ndis_tmaps[idx]); @@ -900,9 +897,8 @@ ndis_start(ifp) * so we can free it later. */ - (sc->ndis_txarray[sc->ndis_txidx])->np_rsvd[0] = - (uint32_t *)sc->ndis_txidx; - (sc->ndis_txarray[sc->ndis_txidx])->np_rsvd[1] = (uint32_t *)m; + (sc->ndis_txarray[sc->ndis_txidx])->np_txidx = sc->ndis_txidx; + (sc->ndis_txarray[sc->ndis_txidx])->np_m0 = m; /* * Do scatter/gather processing, if driver requested it. |