rework messages so that 'fw0: maximum receive packet (2) is too small' error

doesn't appear corrupted.
This commit is contained in:
lukem 2004-04-30 01:31:43 +00:00
parent f233c99a3c
commit 388ed266e4

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_fw.c,v 1.20 2003/07/03 11:36:18 drochner Exp $ */
/* $NetBSD: if_fw.c,v 1.21 2004/04/30 01:31:43 lukem Exp $ */
/* XXX ALTQ XXX */
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_fw.c,v 1.20 2003/07/03 11:36:18 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_fw.c,v 1.21 2004/04/30 01:31:43 lukem Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -133,18 +133,24 @@ fw_attach(struct device *parent, struct device *self, void *aux)
break;
}
sc->sc_ic.ic_hwaddr.iha_maxrec = i;
if (i < 8) {
printf("%s: maximum receive packet (%d) is too small\n",
sc->sc_sc1394.sc1394_dev.dv_xname, psc->sc1394_max_receive);
splx(s);
return;
}
sc->sc_ic.ic_hwaddr.iha_offset[0] = (FW_FIFO_HI >> 8) & 0xff;
sc->sc_ic.ic_hwaddr.iha_offset[1] = FW_FIFO_HI & 0xff;
sc->sc_ic.ic_hwaddr.iha_offset[2] = (FW_FIFO_LO >> 24) & 0xff;
sc->sc_ic.ic_hwaddr.iha_offset[3] = (FW_FIFO_LO >> 16) & 0xff;
sc->sc_ic.ic_hwaddr.iha_offset[4] = (FW_FIFO_LO >> 8) & 0xff;
sc->sc_ic.ic_hwaddr.iha_offset[5] = FW_FIFO_LO & 0xff;
printf(":");
for (i = 0; i < sizeof(sc->sc_ic.ic_hwaddr); i++)
printf("%c%02x", (i == 0 ? ' ' : ':'),
((u_int8_t *)&sc->sc_ic.ic_hwaddr)[i]);
printf("\n");
if (sc->sc_ic.ic_hwaddr.iha_maxrec < 8) {
printf("%s: maximum receive packet (%d) is too small\n",
sc->sc_sc1394.sc1394_dev.dv_xname, psc->sc1394_max_receive);
splx(s);
return;
}
strcpy(ifp->if_xname, sc->sc_sc1394.sc1394_dev.dv_xname);
ifp->if_softc = sc;
#if __NetBSD_Version__ >= 105080000
@ -158,11 +164,6 @@ fw_attach(struct device *parent, struct device *self, void *aux)
ifp->if_addrlen = sizeof(struct ieee1394_hwaddr);
IFQ_SET_READY(&ifp->if_snd);
printf(":");
for (i = 0; i < sizeof(sc->sc_ic.ic_hwaddr); i++)
printf("%c%02x", (i == 0 ? ' ' : ':'),
((u_int8_t *)&sc->sc_ic.ic_hwaddr)[i]);
printf("\n");
if_attach(ifp);
ieee1394_ifattach(ifp, &sc->sc_ic.ic_hwaddr);