summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-08-06 21:14:36 +0000
committerphk <phk@FreeBSD.org>1996-08-06 21:14:36 +0000
commit5ac19ff3ee101aa4e4a4b1116882a4b5e5a11161 (patch)
treef630f4ed06a1ba25dccda323532d5e93e6a9d6f3 /sys/dev/ed
parent954270700febe9302cf12727a332d854d9b4188e (diff)
downloadFreeBSD-src-5ac19ff3ee101aa4e4a4b1116882a4b5e5a11161.zip
FreeBSD-src-5ac19ff3ee101aa4e4a4b1116882a4b5e5a11161.tar.gz
Megacommit to straigthen out ETHER_ mess.
I'm pretty convinced after looking at this that the majority of our drivers are confused about the in/exclusion of ETHER_CRC_LEN :-(
Diffstat (limited to 'sys/dev/ed')
-rw-r--r--sys/dev/ed/if_ed.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index 4b009fe..9418e76 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ed.c,v 1.101 1996/06/25 20:30:05 bde Exp $
+ * $Id: if_ed.c,v 1.102 1996/08/04 10:57:29 phk Exp $
*/
/*
@@ -325,11 +325,6 @@ static unsigned short ed_790_intr_mask[] = {
IRQ15
};
-#define ETHER_MIN_LEN 60
-#define ETHER_MAX_LEN 1514
-#define ETHER_ADDR_LEN 6
-#define ETHER_HDR_SIZE 14
-
static struct kern_devconf kdc_ed_template = {
0, 0, 0, /* filled in by dev_attach */
"ed", 0, { MDDT_ISA, 0, "net" },
@@ -1944,7 +1939,7 @@ outloop:
goto outloop;
}
- sc->txb_len[sc->txb_new] = max(len, ETHER_MIN_LEN);
+ sc->txb_len[sc->txb_new] = max(len, (ETHER_MIN_LEN-ETHER_CRC_LEN));
sc->txb_inuse++;
@@ -2020,8 +2015,8 @@ ed_rint(sc)
ed_pio_readmem(sc, (int)packet_ptr, (char *) &packet_hdr,
sizeof(packet_hdr));
len = packet_hdr.count;
- if (len > (ETHER_MAX_LEN + sizeof(struct ed_ring)) ||
- len < (ETHER_HDR_SIZE + sizeof(struct ed_ring))) {
+ if (len > (ETHER_MAX_LEN - ETHER_CRC_LEN + sizeof(struct ed_ring)) ||
+ len < (ETHER_MIN_LEN - ETHER_CRC_LEN + sizeof(struct ed_ring))) {
/*
* Length is a wild value. There's a good chance that
* this was caused by the NIC being old and buggy.
OpenPOWER on IntegriCloud