Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amiga/dev Use ETHER_*_LEN constants from <net/if_et...
details: https://anonhg.NetBSD.org/src/rev/ef8555492760
branches: trunk
changeset: 467558:ef8555492760
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Mar 25 23:10:53 1999 +0000
description:
Use ETHER_*_LEN constants from <net/if_ether.h> instead of defining them
ourselves. Subtract ETHER_CRC_LEN as necessary to get the same values
for these constants as were previously defined locally.
diffstat:
sys/arch/amiga/dev/if_qn.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diffs (60 lines):
diff -r 4379735b8b90 -r ef8555492760 sys/arch/amiga/dev/if_qn.c
--- a/sys/arch/amiga/dev/if_qn.c Thu Mar 25 23:10:13 1999 +0000
+++ b/sys/arch/amiga/dev/if_qn.c Thu Mar 25 23:10:53 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_qn.c,v 1.16 1998/07/05 06:49:03 jonathan Exp $ */
+/* $NetBSD: if_qn.c,v 1.17 1999/03/25 23:10:53 thorpej Exp $ */
/*
* Copyright (c) 1995 Mika Kortelainen
@@ -118,9 +118,6 @@
#include <amiga/dev/if_qnreg.h>
-#define ETHER_MIN_LEN 60
-#define ETHER_MAX_LEN 1514
-#define ETHER_HDR_SIZE 14
#define NIC_R_MASK (R_INT_PKT_RDY | R_INT_ALG_ERR |\
R_INT_CRC_ERR | R_INT_OVR_FLO)
#define MAX_PACKETS 30 /* max number of packets read per interrupt */
@@ -539,14 +536,15 @@
*addr = *((u_short *)savebyte);
}
- if(totlen < ETHER_MIN_LEN) {
+ if(totlen < (ETHER_MIN_LEN - ETHER_CRC_LEN)) {
/*
* Fill the rest of the packet with zeros.
* N.B.: This is required! Otherwise MB86950 fails.
*/
- for(len = totlen + 1; len < ETHER_MIN_LEN; len += 2)
+ for(len = totlen + 1; len < (ETHER_MIN_LEN - ETHER_CRC_LEN);
+ len += 2)
*addr = (u_short)0x0000;
- totlen = ETHER_MIN_LEN;
+ totlen = (ETHER_MIN_LEN - ETHER_CRC_LEN);
}
return (totlen);
@@ -737,17 +735,18 @@
len = ((len << 8) & 0xff00) | ((len >> 8) & 0x00ff);
#ifdef QN_CHECKS
- if (len > ETHER_MAX_LEN || len < ETHER_HDR_SIZE) {
+ if (len > (ETHER_MAX_LEN - ETHER_CRC_LEN) ||
+ len < ETHER_HDR_LEN) {
log(LOG_WARNING,
"%s: received a %s packet? (%u bytes)\n",
sc->sc_dev.dv_xname,
- len < ETHER_HDR_SIZE ? "partial" : "big", len);
+ len < ETHER_HDR_LEN ? "partial" : "big", len);
++sc->sc_ethercom.ec_if.if_ierrors;
continue;
}
#endif
#ifdef QN_CHECKS
- if (len < ETHER_MIN_LEN)
+ if (len < (ETHER_MIN_LEN - ETHER_CRC_LEN))
log(LOG_WARNING,
"%s: received a short packet? (%u bytes)\n",
sc->sc_dev.dv_xname, len);
Home |
Main Index |
Thread Index |
Old Index