summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/if_el.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-11-24 14:29:38 +0000
committerdg <dg@FreeBSD.org>1994-11-24 14:29:38 +0000
commit68acac5e7669e7382032efb3be686d7d31127ff7 (patch)
treef24c94cbed7412ca371d1f76bc07b9dfdcdbc432 /sys/i386/isa/if_el.c
parent72223a20dbcc102ebb53c5b477fb878dadf67674 (diff)
downloadFreeBSD-src-68acac5e7669e7382032efb3be686d7d31127ff7.zip
FreeBSD-src-68acac5e7669e7382032efb3be686d7d31127ff7.tar.gz
Moved conversion of ether_type to host byte order out of ethernet drivers
and into ether_input(). It was silly to have bpf want this one way and ether_input want it another way. Ripped out trailer support from the few remaining drivers that still had it.
Diffstat (limited to 'sys/i386/isa/if_el.c')
-rw-r--r--sys/i386/isa/if_el.c44
1 files changed, 5 insertions, 39 deletions
diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c
index afc51d7..1835480 100644
--- a/sys/i386/isa/if_el.c
+++ b/sys/i386/isa/if_el.c
@@ -6,7 +6,7 @@
*
* Questions, comments, bug reports and fixes to kimmel@cs.umass.edu.
*
- * $Id: if_el.c,v 1.7 1994/10/21 01:19:06 wollman Exp $
+ * $Id: if_el.c,v 1.8 1994/10/23 21:27:17 wollman Exp $
*/
/* Except of course for the portions of code lifted from other FreeBSD
* drivers (mainly elread, elget and el_ioctl)
@@ -562,47 +562,21 @@ void elintr(int unit)
return;
}
-/* Pass a packet up to the higher levels. Deal with trailer protocol. */
+/* Pass a packet up to the higher levels. */
static inline void elread(struct el_softc *sc,caddr_t buf,int len)
{
register struct ether_header *eh;
struct mbuf *m;
- int off, resid;
- /* Deal with trailer protocol: if type is trailer type
- * get true type from first 16-bit word past data.
- * Remember that type was trailer by setting off.
- */
eh = (struct ether_header *)buf;
- eh->ether_type = ntohs((u_short)eh->ether_type);
-#define eldataaddr(eh,off,type) ((type)(((caddr_t)((eh)+1)+(off))))
- if(eh->ether_type >= ETHERTYPE_TRAIL &&
- eh->ether_type < ETHERTYPE_TRAIL+ETHERTYPE_NTRAILER) {
- off = (eh->ether_type - ETHERTYPE_TRAIL) * 512;
- if(off >= ETHERMTU)
- return;
- eh->ether_type = ntohs(*eldataaddr(eh,off,u_short *));
- resid = ntohs(*(eldataaddr(eh,off+2,u_short *)));
- if((off+resid) > len)
- return;
- len = off + resid;
- }
- else
- off = 0;
-
- if(len <= 0)
- return;
#if NBPFILTER > 0
/*
* Check if there's a bpf filter listening on this interface.
- * If so, hand off the raw packet to bpf, which must deal with
- * trailers in its own way.
+ * If so, hand off the raw packet to bpf.
*/
if(sc->bpf) {
- eh->ether_type = htons((u_short)eh->ether_type);
bpf_tap(sc->bpf,buf,len+sizeof(struct ether_header));
- eh->ether_type = ntohs((u_short)eh->ether_type);
/*
* Note that the interface cannot be in promiscuous mode if
@@ -621,12 +595,9 @@ static inline void elread(struct el_softc *sc,caddr_t buf,int len)
#endif
/*
- * Pull packet off interface. Off is nonzero if packet
- * has trailing header; neget will then force this header
- * information to be at the front, but we still have to drop
- * the type and length which are at the front of any trailer data.
+ * Pull packet off interface.
*/
- m = elget(buf,len,off,&sc->arpcom.ac_if);
+ m = elget(buf,len,0,&sc->arpcom.ac_if);
if(m == 0)
return;
@@ -636,11 +607,6 @@ static inline void elread(struct el_softc *sc,caddr_t buf,int len)
/*
* Pull read data off a interface.
* Len is length of data, with local net header stripped.
- * Off is non-zero if a trailer protocol was used, and
- * gives the offset of the trailer information.
- * We copy the trailer information and then all the normal
- * data into mbufs. When full cluster sized units are present
- * we copy into clusters.
*/
struct mbuf *
elget(buf, totlen, off0, ifp)
OpenPOWER on IntegriCloud