Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ieee1394 rework messages so that 'fw0: maximum recei...



details:   https://anonhg.NetBSD.org/src/rev/0c89d67474dc
branches:  trunk
changeset: 566178:0c89d67474dc
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Apr 30 01:31:43 2004 +0000

description:
rework messages so that 'fw0: maximum receive packet (2) is too small' error
doesn't appear corrupted.

diffstat:

 sys/dev/ieee1394/if_fw.c |  27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diffs (61 lines):

diff -r f105f3af1f6a -r 0c89d67474dc sys/dev/ieee1394/if_fw.c
--- a/sys/dev/ieee1394/if_fw.c  Fri Apr 30 01:08:35 2004 +0000
+++ b/sys/dev/ieee1394/if_fw.c  Fri Apr 30 01:31:43 2004 +0000
@@ -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 @@
                        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 @@
        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);
 



Home | Main Index | Thread Index | Old Index