Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Use ETHER_*_LEN constants from <net/if_ether.h> ins...



details:   https://anonhg.NetBSD.org/src/rev/af127aad6c43
branches:  trunk
changeset: 467559:af127aad6c43
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Mar 25 23:11:51 1999 +0000

description:
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves.

diffstat:

 sys/arch/arm32/podulebus/if_ea.c       |  10 +++-------
 sys/arch/arm32/podulebus/if_eb.c       |  10 +++-------
 sys/arch/arm32/podulebus/if_ie.c       |   5 +----
 sys/arch/hp300/stand/common/if_le.c    |   6 +-----
 sys/arch/mvme68k/stand/netboot/if_ie.c |   5 +----
 sys/arch/sun3/dev/if_ie.c              |   6 +-----
 sys/arch/vax/boot/if_le.c              |   6 +-----
 sys/arch/vax/boot/if_ze.c              |   5 +----
 8 files changed, 12 insertions(+), 41 deletions(-)

diffs (193 lines):

diff -r ef8555492760 -r af127aad6c43 sys/arch/arm32/podulebus/if_ea.c
--- a/sys/arch/arm32/podulebus/if_ea.c  Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/arm32/podulebus/if_ea.c  Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ea.c,v 1.20 1998/08/08 23:58:39 mycroft Exp $ */
+/* $NetBSD: if_ea.c,v 1.21 1999/03/25 23:11:51 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe
@@ -98,10 +98,6 @@
 #include <arm32/podulebus/podulebus.h>
 #include <arm32/podulebus/podules.h>
 
-#define ETHER_MIN_LEN  64
-#define ETHER_MAX_LEN  1514
-#define ETHER_ADDR_LEN 6
-
 #ifndef EA_TIMEOUT
 #define EA_TIMEOUT     60
 #endif
@@ -1028,7 +1024,7 @@
 
        len = max(len, ETHER_MIN_LEN);
        
-       if (len > ETHER_MAX_LEN)
+       if (len > (ETHER_MAX_LEN - ETHER_CRC_LEN))
                log(LOG_WARNING, "ea: oversize packet = %d bytes\n", len);
 
 /* Ok we now have a packet len bytes long in our packet buffer */
@@ -1266,7 +1262,7 @@
 
 /* Is the packet too big ? - this will probably be trapped above as a receive error */
 
-               if (len > ETHER_MAX_LEN) {
+               if (len > (ETHER_MAX_LEN - ETHER_CRC_LEN)) {
                        ++ifp->if_ierrors;
                        printf("rx packet size error len=%d\n", len);
                        sc->sc_config2 |= EA_CFG2_OUTPUT;
diff -r ef8555492760 -r af127aad6c43 sys/arch/arm32/podulebus/if_eb.c
--- a/sys/arch/arm32/podulebus/if_eb.c  Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/arm32/podulebus/if_eb.c  Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_eb.c,v 1.20 1998/08/08 23:58:40 mycroft Exp $ */
+/* $NetBSD: if_eb.c,v 1.21 1999/03/25 23:11:52 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe
@@ -97,10 +97,6 @@
 #include <arm32/podulebus/podulebus.h>
 #include <arm32/podulebus/podules.h>
 
-#define ETHER_MIN_LEN  64
-#define ETHER_MAX_LEN  1514
-#define ETHER_ADDR_LEN 6
-
 #ifndef EB_TIMEOUT
 #define EB_TIMEOUT     60
 #endif
@@ -1045,7 +1041,7 @@
 
        len = max(len, ETHER_MIN_LEN);
        
-       if (len > ETHER_MAX_LEN)
+       if (len > (ETHER_MAX_LEN - ETHER_CRC_LEN))
                log(LOG_WARNING, "ea: oversize packet = %d bytes\n", len);
 
 /* Ok we now have a packet len bytes long in our packet buffer */
@@ -1280,7 +1276,7 @@
 
 /* Is the packet too big ? - this will probably be trapped above as a receive error */
 
-               if (len > ETHER_MAX_LEN) {
+               if (len > (ETHER_MAX_LEN - ETHER_CRC_LEN)) {
                        ++ifp->if_ierrors;
                        printf("rx packet size error len=%d\n", len);
                        sc->sc_config2 |= EB_CFG2_OUTPUT;
diff -r ef8555492760 -r af127aad6c43 sys/arch/arm32/podulebus/if_ie.c
--- a/sys/arch/arm32/podulebus/if_ie.c  Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/arm32/podulebus/if_ie.c  Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.21 1999/02/28 09:59:33 mark Exp $ */
+/* $NetBSD: if_ie.c,v 1.22 1999/03/25 23:11:52 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Melvin Tang-Richardson.
@@ -117,9 +117,6 @@
 #define NTXBUF  (2)            /* number of transmit buffers to allocate */
 #define IE_TXBUF_SIZE (1522)   /* size of tx buffer */
 
-#define ETHER_MIN_LEN  (64)
-#define ETHER_MAX_LEN  (1518)
-
 #define PWriteShort(a,b)       WriteWord(a,(b)<<16|(b))
 
 #define        xoffsetof(type, member) (offsetof(type, member) << 1)
diff -r ef8555492760 -r af127aad6c43 sys/arch/hp300/stand/common/if_le.c
--- a/sys/arch/hp300/stand/common/if_le.c       Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/hp300/stand/common/if_le.c       Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le.c,v 1.2 1997/12/26 22:37:05 scottr Exp $ */
+/*     $NetBSD: if_le.c,v 1.3 1999/03/25 23:12:10 thorpej Exp $        */
 
 /*
  * Copyright (c) 1993 Adam Glass
@@ -51,10 +51,6 @@
 int le_debug = 0;
 #endif
 
-#define        ETHER_MIN_LEN   64
-#define        ETHER_MAX_LEN   1518
-#define        ETHER_ADDR_LEN  6
-
 int le_probe();
 int le_match();
 void le_init();
diff -r ef8555492760 -r af127aad6c43 sys/arch/mvme68k/stand/netboot/if_ie.c
--- a/sys/arch/mvme68k/stand/netboot/if_ie.c    Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/mvme68k/stand/netboot/if_ie.c    Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ie.c,v 1.1 1996/05/17 21:18:23 chuck Exp $  */
+/*     $NetBSD: if_ie.c,v 1.2 1999/03/25 23:13:08 thorpej Exp $        */
 
 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -37,9 +37,6 @@
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
 
-#define ETHER_MIN_LEN   64
-#define ETHER_MAX_LEN   1518
-
 #define NTXBUF 1
 #define NRXBUF 16
 #define IE_RBUF_SIZE   ETHER_MAX_LEN
diff -r ef8555492760 -r af127aad6c43 sys/arch/sun3/dev/if_ie.c
--- a/sys/arch/sun3/dev/if_ie.c Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/sun3/dev/if_ie.c Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ie.c,v 1.28 1998/10/01 20:05:09 thorpej Exp $ */
+/*     $NetBSD: if_ie.c,v 1.29 1999/03/25 23:13:54 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
@@ -167,10 +167,6 @@
 #define        IED_XMIT        0x40
 #define        IED_ALL         0x7f
 
-#define        ETHER_MIN_LEN   64
-#define        ETHER_MAX_LEN   1518
-#define        ETHER_ADDR_LEN  6
-
 #ifdef IEDEBUG
 #define        inline  /* not */
 void print_rbd __P((volatile struct ie_recv_buf_desc *));
diff -r ef8555492760 -r af127aad6c43 sys/arch/vax/boot/if_le.c
--- a/sys/arch/vax/boot/if_le.c Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/vax/boot/if_le.c Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le.c,v 1.6 1998/10/09 06:14:22 matt Exp $ */
+/*     $NetBSD: if_le.c,v 1.7 1999/03/25 23:16:09 thorpej Exp $ */
 /*
  * Copyright (c) 1997 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -47,10 +47,6 @@
 #include <dev/ic/lancereg.h>
 #include <dev/ic/am7990reg.h>
 
-#define        ETHER_MIN_LEN   64
-#define        ETHER_MAX_LEN   1518
-#define        ETHER_ADDR_LEN  6
-
 /*
  * The following are incorrect. Why doesn't DEC follow its own specs???
  */
diff -r ef8555492760 -r af127aad6c43 sys/arch/vax/boot/if_ze.c
--- a/sys/arch/vax/boot/if_ze.c Thu Mar 25 23:10:53 1999 +0000
+++ b/sys/arch/vax/boot/if_ze.c Thu Mar 25 23:11:51 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ze.c,v 1.1 1998/07/01 10:52:11 ragge Exp $  */
+/*     $NetBSD: if_ze.c,v 1.2 1999/03/25 23:16:09 thorpej Exp $        */
 /*
  * Copyright (c) 1998 James R. Maynard III.  All rights reserved.
  *
@@ -62,9 +62,6 @@
 
 #define NRCV 5                         /* allocate 5 receive descriptors */
 #define NXMT 5                         /* and 5 transmit - must be >1 */
-#define ETHER_MAX_LEN 1518             /* maximum Ethernet frame */
-#define ETHER_MIN_LEN 64               /* minimum Ethernet frame */
-#define ETHER_ADDR_LEN 6               /* length of an Ethernet address */
 #define SETUP_FRAME_LEN 128            /* length of the setup frame */
 
 /* allocate a buffer on an octaword boundary */



Home | Main Index | Thread Index | Old Index