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
This commit is contained in:
Weongyo Jeong 2008-10-04 04:15:39 +00:00
parent a37d6ec935
commit db102f9a37
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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