Date: Mon, 25 May 2015 15:09:17 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283532 - head/sys/dev/iwn Message-ID: <201505251509.t4PF9HYl079719@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Mon May 25 15:09:17 2015 New Revision: 283532 URL: https://svnweb.freebsd.org/changeset/base/283532 Log: Store softc in ic_softc and access it without using struct ifnet. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon May 25 15:08:38 2015 (r283531) +++ head/sys/dev/iwn/if_iwn.c Mon May 25 15:09:17 2015 (r283532) @@ -556,6 +556,7 @@ iwn_attach(device_t dev) ic = ifp->if_l2com; ic->ic_ifp = ifp; + ic->ic_softc = sc; ic->ic_name = device_get_nameunit(dev); ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */ @@ -1316,10 +1317,10 @@ iwn_vap_create(struct ieee80211com *ic, const uint8_t bssid[IEEE80211_ADDR_LEN], const uint8_t mac[IEEE80211_ADDR_LEN]) { + struct iwn_softc *sc = ic->ic_softc; struct iwn_vap *ivp; struct ieee80211vap *vap; uint8_t mac1[IEEE80211_ADDR_LEN]; - struct iwn_softc *sc = ic->ic_ifp->if_softc; if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */ return NULL; @@ -2526,7 +2527,7 @@ static int iwn_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *rd, int nchan, struct ieee80211_channel chans[]) { - struct iwn_softc *sc = ic->ic_ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; int i; for (i = 0; i < nchan; i++) { @@ -2798,7 +2799,7 @@ iwn_newstate(struct ieee80211vap *vap, e { struct iwn_vap *ivp = IWN_VAP(vap); struct ieee80211com *ic = vap->iv_ic; - struct iwn_softc *sc = ic->ic_ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; int error = 0; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -5248,7 +5249,7 @@ static int iwn_updateedca(struct ieee80211com *ic) { #define IWN_EXP2(x) ((1 << (x)) - 1) /* CWmin = 2^ECWmin - 1 */ - struct iwn_softc *sc = ic->ic_ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; struct iwn_edca_params cmd; int aci; @@ -7082,7 +7083,7 @@ iwn_ampdu_rx_start(struct ieee80211_node int baparamset, int batimeout, int baseqctl) { #define MS(_v, _f) (((_v) & _f) >> _f##_S) - struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct iwn_softc *sc = ni->ni_ic->ic_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; @@ -7118,7 +7119,7 @@ static void iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) { struct ieee80211com *ic = ni->ni_ic; - struct iwn_softc *sc = ic->ic_ifp->if_softc; + struct iwn_softc *sc = ic->ic_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; @@ -7146,7 +7147,7 @@ static int iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int dialogtoken, int baparamset, int batimeout) { - struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct iwn_softc *sc = ni->ni_ic->ic_softc; int qid; DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); @@ -7176,7 +7177,7 @@ static int iwn_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int code, int baparamset, int batimeout) { - struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct iwn_softc *sc = ni->ni_ic->ic_softc; int qid = *(int *)tap->txa_private; uint8_t tid = tap->txa_tid; int ret; @@ -7205,7 +7206,7 @@ iwn_ampdu_tx_start(struct ieee80211com * uint8_t tid) { struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[tid]; - struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct iwn_softc *sc = ni->ni_ic->ic_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; @@ -7239,7 +7240,7 @@ iwn_ampdu_tx_start(struct ieee80211com * static void iwn_ampdu_tx_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { - struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + struct iwn_softc *sc = ni->ni_ic->ic_softc; struct iwn_ops *ops = &sc->ops; uint8_t tid = tap->txa_tid; int qid; @@ -8774,8 +8775,8 @@ static void iwn_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell) { struct ieee80211vap *vap = ss->ss_vap; - struct iwn_softc *sc = vap->iv_ic->ic_ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; + struct iwn_softc *sc = ic->ic_softc; int error; IWN_LOCK(sc);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505251509.t4PF9HYl079719>