Store softc in ic_softc and access it without using struct ifnet.
Sponsored by: Netflix Sponsored by: Nginx, Inc.
This commit is contained in:
parent
151cc3ad26
commit
e6feb66faf
@ -556,6 +556,7 @@ iwn_attach(device_t dev)
|
|||||||
|
|
||||||
ic = ifp->if_l2com;
|
ic = ifp->if_l2com;
|
||||||
ic->ic_ifp = ifp;
|
ic->ic_ifp = ifp;
|
||||||
|
ic->ic_softc = sc;
|
||||||
ic->ic_name = device_get_nameunit(dev);
|
ic->ic_name = device_get_nameunit(dev);
|
||||||
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
|
ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
|
||||||
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
|
ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
|
||||||
@ -1316,10 +1317,10 @@ iwn_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
|
|||||||
const uint8_t bssid[IEEE80211_ADDR_LEN],
|
const uint8_t bssid[IEEE80211_ADDR_LEN],
|
||||||
const uint8_t mac[IEEE80211_ADDR_LEN])
|
const uint8_t mac[IEEE80211_ADDR_LEN])
|
||||||
{
|
{
|
||||||
|
struct iwn_softc *sc = ic->ic_softc;
|
||||||
struct iwn_vap *ivp;
|
struct iwn_vap *ivp;
|
||||||
struct ieee80211vap *vap;
|
struct ieee80211vap *vap;
|
||||||
uint8_t mac1[IEEE80211_ADDR_LEN];
|
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 */
|
if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -2526,7 +2527,7 @@ static int
|
|||||||
iwn_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *rd,
|
iwn_setregdomain(struct ieee80211com *ic, struct ieee80211_regdomain *rd,
|
||||||
int nchan, struct ieee80211_channel chans[])
|
int nchan, struct ieee80211_channel chans[])
|
||||||
{
|
{
|
||||||
struct iwn_softc *sc = ic->ic_ifp->if_softc;
|
struct iwn_softc *sc = ic->ic_softc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < nchan; i++) {
|
for (i = 0; i < nchan; i++) {
|
||||||
@ -2798,7 +2799,7 @@ iwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||||||
{
|
{
|
||||||
struct iwn_vap *ivp = IWN_VAP(vap);
|
struct iwn_vap *ivp = IWN_VAP(vap);
|
||||||
struct ieee80211com *ic = vap->iv_ic;
|
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;
|
int error = 0;
|
||||||
|
|
||||||
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
|
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
|
||||||
@ -5248,7 +5249,7 @@ static int
|
|||||||
iwn_updateedca(struct ieee80211com *ic)
|
iwn_updateedca(struct ieee80211com *ic)
|
||||||
{
|
{
|
||||||
#define IWN_EXP2(x) ((1 << (x)) - 1) /* CWmin = 2^ECWmin - 1 */
|
#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;
|
struct iwn_edca_params cmd;
|
||||||
int aci;
|
int aci;
|
||||||
|
|
||||||
@ -7082,7 +7083,7 @@ iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap,
|
|||||||
int baparamset, int batimeout, int baseqctl)
|
int baparamset, int batimeout, int baseqctl)
|
||||||
{
|
{
|
||||||
#define MS(_v, _f) (((_v) & _f) >> _f##_S)
|
#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_ops *ops = &sc->ops;
|
||||||
struct iwn_node *wn = (void *)ni;
|
struct iwn_node *wn = (void *)ni;
|
||||||
struct iwn_node_info node;
|
struct iwn_node_info node;
|
||||||
@ -7118,7 +7119,7 @@ static void
|
|||||||
iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
|
iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
|
||||||
{
|
{
|
||||||
struct ieee80211com *ic = ni->ni_ic;
|
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_ops *ops = &sc->ops;
|
||||||
struct iwn_node *wn = (void *)ni;
|
struct iwn_node *wn = (void *)ni;
|
||||||
struct iwn_node_info node;
|
struct iwn_node_info node;
|
||||||
@ -7146,7 +7147,7 @@ static int
|
|||||||
iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
|
iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
|
||||||
int dialogtoken, int baparamset, int batimeout)
|
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;
|
int qid;
|
||||||
|
|
||||||
DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
|
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,
|
iwn_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
|
||||||
int code, int baparamset, int batimeout)
|
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;
|
int qid = *(int *)tap->txa_private;
|
||||||
uint8_t tid = tap->txa_tid;
|
uint8_t tid = tap->txa_tid;
|
||||||
int ret;
|
int ret;
|
||||||
@ -7205,7 +7206,7 @@ iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni,
|
|||||||
uint8_t tid)
|
uint8_t tid)
|
||||||
{
|
{
|
||||||
struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[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_ops *ops = &sc->ops;
|
||||||
struct iwn_node *wn = (void *)ni;
|
struct iwn_node *wn = (void *)ni;
|
||||||
struct iwn_node_info node;
|
struct iwn_node_info node;
|
||||||
@ -7239,7 +7240,7 @@ iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni,
|
|||||||
static void
|
static void
|
||||||
iwn_ampdu_tx_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
|
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;
|
struct iwn_ops *ops = &sc->ops;
|
||||||
uint8_t tid = tap->txa_tid;
|
uint8_t tid = tap->txa_tid;
|
||||||
int qid;
|
int qid;
|
||||||
@ -8774,8 +8775,8 @@ static void
|
|||||||
iwn_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell)
|
iwn_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell)
|
||||||
{
|
{
|
||||||
struct ieee80211vap *vap = ss->ss_vap;
|
struct ieee80211vap *vap = ss->ss_vap;
|
||||||
struct iwn_softc *sc = vap->iv_ic->ic_ifp->if_softc;
|
|
||||||
struct ieee80211com *ic = vap->iv_ic;
|
struct ieee80211com *ic = vap->iv_ic;
|
||||||
|
struct iwn_softc *sc = ic->ic_softc;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
IWN_LOCK(sc);
|
IWN_LOCK(sc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user