ragge said this chip should autopad, so just remove the check for len.

This commit is contained in:
bouyer 2003-01-15 22:08:08 +00:00
parent 490bb906c8
commit 0a5eae1855
1 changed files with 2 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ni.c,v 1.19 2003/01/15 21:51:47 bouyer Exp $ */
/* $NetBSD: if_ni.c,v 1.20 2003/01/15 22:08:08 bouyer Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
*
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.19 2003/01/15 21:51:47 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.20 2003/01/15 22:08:08 bouyer Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -153,8 +153,6 @@ static int failtest(struct ni_softc *, int, int, int, char *);
volatile int endwait, retry; /* Used during autoconfig */
static char *padbuf = NULL;
CFATTACH_DECL(ni, sizeof(struct ni_softc),
nimatch, niattach, NULL, NULL);
@ -473,16 +471,6 @@ retry: WAITREG(NI_PCR, PCR_OWN);
printf("%s: hardware address %s\n", sc->sc_dev.dv_xname,
ether_sprintf(sc->sc_enaddr));
if (padbuf == NULL) {
padbuf = malloc(ETHER_MIN_LEN - ETHER_CRC_LEN, M_DEVBUF,
M_ZERO | M_NOWAIT);
if (padbuf == NULL) {
printf("%s: can't allocate pad buffer\n",
sc->sc_dev.dv_xname);
return;
}
}
/*
* Attach the interface.
*/
@ -556,8 +544,6 @@ nistart(ifp)
for (m0 = m, cnt = 0; m0; m0 = m0->m_next)
if (m0->m_len)
cnt++;
if (if m->m_pkthdr.len < ETHER_MIN_LEN)
cnt++;
if (cnt > NTXFRAGS)
panic("nistart"); /* XXX */
@ -580,18 +566,6 @@ nistart(ifp)
bdp++;
i++;
}
if (mlen < ETHER_MIN_LEN) {
bdp->nb_status = ((u_int32_t)padbuf & NIBD_OFFSET) |
NIBD_VALID;
bdp->nb_pte = (u_int32_t)kvtopte(padbuf);
bdp->nb_len = ETHER_MIN_LEN - mlen;
data->bufs[i]._offset = 0;
data->bufs[i]._len = bdp->nb_len;
data->bufs[i]._index |= NIDG_CHAIN;
mlen += bdp->nb_len;
bdp++;
i++;
}
data->nd_opcode = BVP_DGRAM;
data->nd_pad3 = 1;
data->nd_ptdbidx = 1;