diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-08-06 21:14:36 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1996-08-06 21:14:36 +0000 |
commit | 26a8b0bf7e0b0c3ed382481b849b7d1d873d460a (patch) | |
tree | f630f4ed06a1ba25dccda323532d5e93e6a9d6f3 /sys/dev/ed/if_ed.c | |
parent | 590dbfbf6a2aa5e142795a422ceaf6ee6e724dea (diff) | |
download | src-26a8b0bf7e0b0c3ed382481b849b7d1d873d460a.tar.gz src-26a8b0bf7e0b0c3ed382481b849b7d1d873d460a.zip |
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 :-(
Notes
Notes:
svn path=/head/; revision=17455
Diffstat (limited to 'sys/dev/ed/if_ed.c')
-rw-r--r-- | sys/dev/ed/if_ed.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 4b009fe64068..9418e7651ce2 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. |