summaryrefslogtreecommitdiffstats
path: root/sys/dev/lge
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
committersam <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
commit14c32b5f40c5ee3bd5649c3737f359f7e65e6944 (patch)
tree84eb7252cc6a518796c6bf88903ed6e2d12e7b91 /sys/dev/lge
parent10eb947d277840d02ef35d6c6303b64329d53806 (diff)
downloadFreeBSD-src-14c32b5f40c5ee3bd5649c3737f359f7e65e6944.zip
FreeBSD-src-14c32b5f40c5ee3bd5649c3737f359f7e65e6944.tar.gz
network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
Diffstat (limited to 'sys/dev/lge')
-rw-r--r--sys/dev/lge/if_lge.c20
-rw-r--r--sys/dev/lge/if_lgereg.h1
2 files changed, 5 insertions, 16 deletions
diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c
index 30feaf9..9efa94da 100644
--- a/sys/dev/lge/if_lge.c
+++ b/sys/dev/lge/if_lge.c
@@ -674,7 +674,7 @@ lge_attach(dev)
/*
* Call MI attach routine.
*/
- ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifattach(ifp, eaddr);
callout_handle_init(&sc->lge_stat_ch);
fail:
@@ -697,7 +697,7 @@ lge_detach(dev)
lge_reset(sc);
lge_stop(sc);
- ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifdetach(ifp);
bus_generic_detach(dev);
device_delete_child(dev, sc->lge_miibus);
@@ -971,7 +971,6 @@ lge_rxeof(sc, cnt)
struct lge_softc *sc;
int cnt;
{
- struct ether_header *eh;
struct mbuf *m;
struct ifnet *ifp;
struct lge_rx_desc *cur_rx;
@@ -1027,10 +1026,6 @@ lge_rxeof(sc, cnt)
}
ifp->if_ipackets++;
- eh = mtod(m, struct ether_header *);
-
- /* Remove header from mbuf and pass it on. */
- m_adj(m, sizeof(struct ether_header));
/* Do IP checksum checking. */
if (rxsts & LGE_RXSTS_ISIP)
@@ -1046,7 +1041,7 @@ lge_rxeof(sc, cnt)
m->m_pkthdr.csum_data = 0xffff;
}
- ether_input(ifp, eh, m);
+ (*ifp->if_input)(ifp, m);
}
sc->lge_cdata.lge_rx_cons = i;
@@ -1299,8 +1294,7 @@ lge_start(ifp)
* If there's a BPF listener, bounce a copy of this frame
* to him.
*/
- if (ifp->if_bpf)
- bpf_mtap(ifp, m_head);
+ BPF_MTAP(ifp, m_head);
}
sc->lge_cdata.lge_tx_prod = idx;
@@ -1508,10 +1502,6 @@ lge_ioctl(ifp, command, data)
s = splimp();
switch(command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- error = ether_ioctl(ifp, command, data);
- break;
case SIOCSIFMTU:
if (ifr->ifr_mtu > LGE_JUMBO_MTU)
error = EINVAL;
@@ -1553,7 +1543,7 @@ lge_ioctl(ifp, command, data)
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
break;
default:
- error = EINVAL;
+ error = ether_ioctl(ifp, command, data);
break;
}
diff --git a/sys/dev/lge/if_lgereg.h b/sys/dev/lge/if_lgereg.h
index f0254b1..28a6aec 100644
--- a/sys/dev/lge/if_lgereg.h
+++ b/sys/dev/lge/if_lgereg.h
@@ -563,7 +563,6 @@ struct lge_softc {
bus_space_read_1(sc->lge_btag, sc->lge_bhandle, reg)
#define LGE_TIMEOUT 1000
-#define ETHER_ALIGN 2
#define LGE_RXLEN 1536
#define LGE_MIN_FRAMELEN 60
OpenPOWER on IntegriCloud