summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-03-15 23:20:10 +0000
committermdodd <mdodd@FreeBSD.org>2003-03-15 23:20:10 +0000
commitd12a81c808f3b35838d501396ae0d04bf4916f27 (patch)
treed9e75c690ca8ff4cf17ef101de90c0b1022500a2 /sys/contrib
parent9b731f89528a955ac12628d85e1cd5c2d08a78bb (diff)
downloadFreeBSD-src-d12a81c808f3b35838d501396ae0d04bf4916f27.zip
FreeBSD-src-d12a81c808f3b35838d501396ae0d04bf4916f27.tar.gz
Catch up with recent changes.
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/dev/oltr/if_oltr.c41
1 files changed, 5 insertions, 36 deletions
diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c
index 73f4d57..0675106 100644
--- a/sys/contrib/dev/oltr/if_oltr.c
+++ b/sys/contrib/dev/oltr/if_oltr.c
@@ -389,11 +389,11 @@ oltr_pci_attach(device_t dev)
ifp->if_softc = sc;
ifp->if_unit = device_get_unit(dev);
ifp->if_name = "oltr";
- ifp->if_output = iso88025_output;
ifp->if_init = oltr_init;
ifp->if_start = oltr_start;
ifp->if_ioctl = oltr_ioctl;
ifp->if_flags = IFF_BROADCAST;
+ ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
bcopy(sc->config.macaddress, sc->arpcom.ac_enaddr, sizeof(sc->config.macaddress));
/*
@@ -423,13 +423,7 @@ oltr_pci_attach(device_t dev)
/*
* Attach the interface
*/
- if_attach(ifp);
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
- iso88025_ifattach(ifp);
-
-#if (NBPFILTER > 0) || (__FreeBSD_version > 400000)
- bpfattach(ifp, DLT_IEEE802, sizeof(struct iso88025_header));
-#endif
+ iso88025_ifattach(ifp, ISO88025_BPF_SUPPORTED);
splx(s);
return(0);
@@ -451,7 +445,7 @@ oltr_pci_detach(device_t dev)
s = splimp();
- if_detach(ifp);
+ iso88025_ifdetach(ifp, ISO88025_BPF_SUPPORTED);
if (sc->state > OL_CLOSED)
oltr_stop(sc);
@@ -1397,7 +1391,6 @@ DriverReceiveFrameCompleted(void *DriverHandle, int ByteCount, int FragmentCount
struct oltr_softc *sc = (struct oltr_softc *)DriverHandle;
struct ifnet *ifp = (struct ifnet *)&sc->arpcom.ac_if;
struct mbuf *m0, *m1, *m;
- struct iso88025_header *th;
int frame_len = ByteCount, hdr_len, i = (int)FragmentHandle, rc, s;
int mbuf_offset, mbuf_size, frag_offset, copy_length;
char *fragment = sc->rx_ring[RING_BUFFER(i)].data;
@@ -1423,8 +1416,6 @@ DriverReceiveFrameCompleted(void *DriverHandle, int ByteCount, int FragmentCount
m0->m_pkthdr.len = ByteCount;
m0->m_len = 0;
m0->m_data += 2;
- th = mtod(m0, struct iso88025_header *);
- m0->m_pkthdr.header = (void *)th;
m = m0;
mbuf_offset = 0;
@@ -1469,32 +1460,10 @@ DriverReceiveFrameCompleted(void *DriverHandle, int ByteCount, int FragmentCount
m->m_len = 0;
}
}
-#if (NBPFILTER > 0) || (__FreeBSD_version > 400000)
- BPF_MTAP(ifp, m0);
-#endif
-
- /*if (ifp->if_flags & IFF_PROMISC) {*/
- if (bcmp(th->iso88025_dhost, etherbroadcastaddr
- , sizeof(th->iso88025_dhost))) {
- if ((bcmp(th->iso88025_dhost + 1, sc->arpcom.ac_enaddr + 1, ISO88025_ADDR_LEN - 1)) ||
- ((th->iso88025_dhost[0] & 0x7f) != sc->arpcom.ac_enaddr[0])) {
- m_freem(m0);
- goto dropped;
- }
- }
- /*}*/
ifp->if_ipackets++;
- hdr_len = ISO88025_HDR_LEN;
- if (th->iso88025_shost[0] & 0x80)
- hdr_len += (ntohs(th->rcf) & 0x1f00) >> 8;
-
- m0->m_pkthdr.len -= hdr_len;
- m0->m_len -= hdr_len;
- m0->m_data += hdr_len;
-
- iso88025_input(ifp, th, m0);
-
+ BPF_MTAP(ifp, m0);
+ iso88025_input(ifp, m0);
} else { /* Receiver error */
if (ReceiveStatus != TRLLD_RCV_NO_DATA) {
printf("oltr%d: receive error %d\n", sc->unit,
OpenPOWER on IntegriCloud