diff options
author | Andrew Thompson <thompsa@FreeBSD.org> | 2007-06-12 07:29:11 +0000 |
---|---|---|
committer | Andrew Thompson <thompsa@FreeBSD.org> | 2007-06-12 07:29:11 +0000 |
commit | ec32b37ecdad940d55176cc388455ceb02479d4b (patch) | |
tree | cc1d42fdbfb92e5c9963aa6326f1b2ab50b6dc18 /sys/net/if_lagg.c | |
parent | ff8fbcffcb92225adcc8ae77c4e3619f6f0d6ac5 (diff) | |
download | src-ec32b37ecdad940d55176cc388455ceb02479d4b.tar.gz src-ec32b37ecdad940d55176cc388455ceb02479d4b.zip |
non-functional cleanup
- remove dead code
- use consistent variable names
- gc unused defines
- whitespace cleanup
Notes
Notes:
svn path=/head/; revision=170599
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r-- | sys/net/if_lagg.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index 1ea112369377..0bf0c84fa212 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -76,7 +76,7 @@ static struct { }; SLIST_HEAD(__trhead, lagg_softc) lagg_list; /* list of laggs */ -static struct mtx lagg_list_mtx; +static struct mtx lagg_list_mtx; eventhandler_tag lagg_detach_cookie = NULL; static int lagg_clone_create(struct if_clone *, int, caddr_t); @@ -331,7 +331,7 @@ lagg_capabilities(struct lagg_softc *sc) static void lagg_port_lladdr(struct lagg_port *lp, uint8_t *lladdr) { - struct lagg_softc *sc = lp->lp_lagg; + struct lagg_softc *sc = lp->lp_softc; struct ifnet *ifp = lp->lp_ifp; struct lagg_llq *llq; int pending = 0; @@ -460,7 +460,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp) ifp->if_output = lagg_port_output; lp->lp_ifp = ifp; - lp->lp_lagg = sc; + lp->lp_softc = sc; /* Save port link layer address */ bcopy(IF_LLADDR(ifp), lp->lp_lladdr, ETHER_ADDR_LEN); @@ -487,7 +487,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp) if (sc->sc_port_create != NULL) error = (*sc->sc_port_create)(lp); if (error) { - /* remove the port again, without calling sc_port_destroy */ + /* remove the port again, without calling sc_port_destroy */ lagg_port_destroy(lp, 0); return (error); } @@ -517,7 +517,7 @@ lagg_port_checkstacking(struct lagg_softc *sc) static int lagg_port_destroy(struct lagg_port *lp, int runpd) { - struct lagg_softc *sc = lp->lp_lagg; + struct lagg_softc *sc = lp->lp_softc; struct lagg_port *lp_ptr; struct lagg_llq *llq; struct ifnet *ifp = lp->lp_ifp; @@ -598,7 +598,7 @@ lagg_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* Should be checked by the caller */ if (ifp->if_type != IFT_IEEE8023ADLAG || - (lp = ifp->if_lagg) == NULL || (sc = lp->lp_lagg) == NULL) + (lp = ifp->if_lagg) == NULL || (sc = lp->lp_softc) == NULL) goto fallback; switch (cmd) { @@ -610,7 +610,7 @@ lagg_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - if (lp->lp_lagg != sc) { + if (lp->lp_softc != sc) { error = ENOENT; break; } @@ -670,7 +670,7 @@ lagg_port_ifdetach(void *arg __unused, struct ifnet *ifp) if ((lp = ifp->if_lagg) == NULL) return; - sc = lp->lp_lagg; + sc = lp->lp_softc; LAGG_WLOCK(sc); lp->lp_detaching = 1; @@ -681,7 +681,7 @@ lagg_port_ifdetach(void *arg __unused, struct ifnet *ifp) static void lagg_port2req(struct lagg_port *lp, struct lagg_reqport *rp) { - struct lagg_softc *sc = lp->lp_lagg; + struct lagg_softc *sc = lp->lp_softc; strlcpy(rp->rp_ifname, sc->sc_ifname, sizeof(rp->rp_ifname)); strlcpy(rp->rp_portname, lp->lp_ifp->if_xname, sizeof(rp->rp_portname)); rp->rp_prio = lp->lp_prio; @@ -828,7 +828,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if ((lp = (struct lagg_port *)tpif->if_lagg) == NULL || - lp->lp_lagg != sc) { + lp->lp_softc != sc) { error = ENOENT; break; } @@ -857,7 +857,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if ((lp = (struct lagg_port *)tpif->if_lagg) == NULL || - lp->lp_lagg != sc) { + lp->lp_softc != sc) { error = ENOENT; break; } @@ -930,9 +930,9 @@ lagg_ether_setmulti(struct lagg_softc *sc) static int lagg_ether_cmdmulti(struct lagg_port *lp, int set) { - struct lagg_softc *sc = lp->lp_lagg; + struct lagg_softc *sc = lp->lp_softc; struct ifnet *ifp = lp->lp_ifp; - struct ifnet *trifp = sc->sc_ifp; + struct ifnet *scifp = sc->sc_ifp; struct lagg_mc *mc; struct ifmultiaddr *ifma, *rifma = NULL; struct sockaddr_dl sdl; @@ -948,7 +948,7 @@ lagg_ether_cmdmulti(struct lagg_port *lp, int set) sdl.sdl_index = ifp->if_index; if (set) { - TAILQ_FOREACH(ifma, &trifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), @@ -978,14 +978,14 @@ static int lagg_setflag(struct lagg_port *lp, int flag, int status, int (*func)(struct ifnet *, int)) { - struct lagg_softc *sc = lp->lp_lagg; - struct ifnet *trifp = sc->sc_ifp; + struct lagg_softc *sc = lp->lp_softc; + struct ifnet *scifp = sc->sc_ifp; struct ifnet *ifp = lp->lp_ifp; int error; LAGG_WLOCK_ASSERT(sc); - status = status ? (trifp->if_flags & flag) : 0; + status = status ? (scifp->if_flags & flag) : 0; /* Now "status" contains the flag value or 0 */ /* @@ -1016,7 +1016,7 @@ static int lagg_setflags(struct lagg_port *lp, int status) { int error, i; - + for (i = 0; lagg_pflags[i].flag; i++) { error = lagg_setflag(lp, lagg_pflags[i].flag, status, lagg_pflags[i].func); @@ -1062,10 +1062,10 @@ static struct mbuf * lagg_input(struct ifnet *ifp, struct mbuf *m) { struct lagg_port *lp = ifp->if_lagg; - struct lagg_softc *sc = lp->lp_lagg; - struct ifnet *trifp = sc->sc_ifp; + struct lagg_softc *sc = lp->lp_softc; + struct ifnet *scifp = sc->sc_ifp; - if ((trifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (lp->lp_flags & LAGG_PORT_DISABLED) || sc->sc_proto == LAGG_PROTO_NONE) { m_freem(m); @@ -1073,13 +1073,13 @@ lagg_input(struct ifnet *ifp, struct mbuf *m) } LAGG_RLOCK(sc); - BPF_MTAP(trifp, m); + BPF_MTAP(scifp, m); m = (*sc->sc_input)(sc, lp, m); if (m != NULL) { - trifp->if_ipackets++; - trifp->if_ibytes += m->m_pkthdr.len; + scifp->if_ipackets++; + scifp->if_ibytes += m->m_pkthdr.len; } LAGG_RUNLOCK(sc); @@ -1122,7 +1122,7 @@ lagg_port_state(struct ifnet *ifp, int state) struct lagg_softc *sc = NULL; if (lp != NULL) - sc = lp->lp_lagg; + sc = lp->lp_softc; if (sc == NULL) return; @@ -1228,7 +1228,7 @@ lagg_hashmbuf(struct mbuf *m, uint32_t key) sizeof(m->m_pkthdr.ether_vtag), p); } else if (etype == ETHERTYPE_VLAN) { vlan = lagg_gethdr(m, off, sizeof(*vlan), &vlanbuf); - if (vlan == NULL) + if (vlan == NULL) goto out; p = hash32_buf(&vlan->evl_tag, sizeof(vlan->evl_tag), p); @@ -1305,7 +1305,7 @@ lagg_rr_detach(struct lagg_softc *sc) static void lagg_rr_port_destroy(struct lagg_port *lp) { - struct lagg_softc *sc = lp->lp_lagg; + struct lagg_softc *sc = lp->lp_softc; if (lp == (struct lagg_port *)sc->sc_psc) sc->sc_psc = NULL; @@ -1467,14 +1467,14 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_port *lp) static int lagg_lb_port_create(struct lagg_port *lp) { - struct lagg_softc *sc = lp->lp_lagg; + struct lagg_softc *sc = lp->lp_softc; return (lagg_lb_porttable(sc, NULL)); } static void lagg_lb_port_destroy(struct lagg_port *lp) { - struct lagg_softc *sc = lp->lp_lagg; + struct lagg_softc *sc = lp->lp_softc; lagg_lb_porttable(sc, lp); } |