summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweongyo <weongyo@FreeBSD.org>2008-10-04 04:15:39 +0000
committerweongyo <weongyo@FreeBSD.org>2008-10-04 04:15:39 +0000
commit37709ec805ec0bca8d5cd489c40c6808c98841c7 (patch)
tree8cf64cddea2b0c0c95c29d58ff619ff3fc6f80ac
parente2b86d399f2169828c9ee42719aa43e3a55b283f (diff)
downloadFreeBSD-src-37709ec805ec0bca8d5cd489c40c6808c98841c7.zip
FreeBSD-src-37709ec805ec0bca8d5cd489c40c6808c98841c7.tar.gz
sc->ndis_txidx should be cycle between 0 and sc->ndis_maxpkts, not
NDIS_TXPKTS and don't allocate unused extra spaces for sc->ndis_txarray and sc->ndis_txpool. PR: kern/127644 Submitted by: Antoine Pelisse <apelisse_at_gmail.com> MFC after: 1 week
-rw-r--r--sys/dev/if_ndis/if_ndis.c4
-rw-r--r--sys/dev/if_ndis/if_ndisvar.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index 4981a2e..c833c4e 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -641,12 +641,12 @@ ndis_attach(dev)
sc->ndis_maxpkts = 10;
sc->ndis_txarray = malloc(sizeof(ndis_packet *) *
- NDIS_TXPKTS, M_DEVBUF, M_NOWAIT|M_ZERO);
+ sc->ndis_maxpkts, M_DEVBUF, M_NOWAIT|M_ZERO);
/* Allocate a pool of ndis_packets for TX encapsulation. */
NdisAllocatePacketPool(&i, &sc->ndis_txpool,
- NDIS_TXPKTS, PROTOCOL_RESERVED_SIZE_IN_PACKET);
+ sc->ndis_maxpkts, PROTOCOL_RESERVED_SIZE_IN_PACKET);
if (i != NDIS_STATUS_SUCCESS) {
sc->ndis_txpool = NULL;
diff --git a/sys/dev/if_ndis/if_ndisvar.h b/sys/dev/if_ndis/if_ndisvar.h
index 868b5de..5f9fe75 100644
--- a/sys/dev/if_ndis/if_ndisvar.h
+++ b/sys/dev/if_ndis/if_ndisvar.h
@@ -87,7 +87,7 @@ TAILQ_HEAD(nch, ndis_cfglist);
#define NDIS_TXPKTS 64
#define NDIS_INC(x) \
- (x)->ndis_txidx = ((x)->ndis_txidx + 1) % NDIS_TXPKTS
+ (x)->ndis_txidx = ((x)->ndis_txidx + 1) % (x)->ndis_maxpkts
#define NDIS_EVENTS 4
OpenPOWER on IntegriCloud