Compile fixes for Linux 2.6.29

Use netdev_priv() for Linux 2.4.27 and newer.  Provide compatibility
wrapper for older kernels.

Imply CONFIG_KMOD for Linux 2.6.27 and newer.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3902 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2009-01-14 02:36:53 +00:00
parent 512d58b4aa
commit 3e70e4f8c1
14 changed files with 214 additions and 208 deletions

View File

@ -475,7 +475,7 @@ MODULE_PARM_DESC(ieee80211_debug, "Load-time 802.11 debug output enable");
int
ath_attach(u_int16_t devid, struct net_device *dev, HAL_BUS_TAG tag)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211vap *vap;
struct ath_hal *ah;
@ -1127,7 +1127,7 @@ bad:
int
ath_detach(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
HAL_INT tmp;
@ -1191,7 +1191,7 @@ static struct ieee80211vap *
ath_vap_create(struct ieee80211com *ic, const char *name,
int opmode, int flags, struct net_device *mdev)
{
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
struct ath_hal *ah = sc->sc_ah;
struct net_device *dev;
struct ath_vap *avp;
@ -1266,7 +1266,7 @@ ath_vap_create(struct ieee80211com *ic, const char *name,
return NULL;
}
avp = dev->priv;
avp = netdev_priv(dev);
ieee80211_vap_setup(ic, dev, name, opmode, flags);
/* override with driver methods */
vap = &avp->av_vap;
@ -1450,7 +1450,7 @@ static void
ath_vap_delete(struct ieee80211vap *vap)
{
struct net_device *dev = vap->iv_ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ath_vap *avp = ATH_VAP(vap);
int decrease = 1;
@ -1550,14 +1550,16 @@ ath_vap_delete(struct ieee80211vap *vap)
void
ath_suspend(struct net_device *dev)
{
DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags);
DPRINTF(((struct ath_softc *)netdev_priv(dev)), ATH_DEBUG_ANY,
"flags=%x\n", dev->flags);
ath_stop(dev);
}
void
ath_resume(struct net_device *dev)
{
DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags);
DPRINTF(((struct ath_softc *)netdev_priv(dev)), ATH_DEBUG_ANY,
"flags=%x\n", dev->flags);
ath_init(dev);
}
@ -2312,7 +2314,7 @@ ath_intr(int irq, void *dev_id, struct pt_regs *regs)
#endif
{
struct net_device *dev = dev_id;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
u_int64_t hw_tsf = 0;
HAL_INT status;
@ -2508,7 +2510,7 @@ static void
ath_fatal_tasklet(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
EPRINTF(sc, "Hardware error; resetting.\n");
ath_reset(dev);
@ -2518,7 +2520,7 @@ static void
ath_rxorn_tasklet(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
EPRINTF(sc, "Receive FIFO overrun; resetting.\n");
ath_reset(dev);
@ -2528,7 +2530,7 @@ static void
ath_bmiss_tasklet(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
if (time_before(jiffies, sc->sc_ic.ic_bmiss_guard)) {
/* Beacon miss interrupt occured too short after last beacon
@ -2570,7 +2572,7 @@ ath_chan2flags(struct ieee80211_channel *chan)
static int
ath_init(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
HAL_STATUS status;
@ -2673,7 +2675,7 @@ done:
static int
ath_stop_locked(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
@ -2754,7 +2756,7 @@ static void ath_set_beacon_cal(struct ath_softc *sc, int val)
static int
ath_stop(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
int error;
ATH_LOCK(sc);
@ -2794,7 +2796,7 @@ ath_stop(struct net_device *dev)
static int
ath_reset(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
struct ieee80211_channel *c;
@ -2999,7 +3001,7 @@ dot11_to_ratecode(struct ath_softc *sc, const HAL_RATE_TABLE *rt, int dot11)
static int
ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211_phy_params *ph = &(SKB_CB(skb)->phy);
const HAL_RATE_TABLE *rt;
@ -3312,7 +3314,7 @@ _take_txbuf(struct ath_softc *sc, int for_management)
static int
ath_hardstart(struct sk_buff *__skb, struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211_node *ni = NULL;
struct ath_buf *bf = NULL;
struct ether_header *eh;
@ -3659,7 +3661,7 @@ static int
ath_mgtstart(struct ieee80211com *ic, struct sk_buff *skb)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_buf *bf = NULL;
int error;
@ -3991,7 +3993,7 @@ static ieee80211_keyix_t
ath_key_alloc(struct ieee80211vap *vap, const struct ieee80211_key *k)
{
struct net_device *dev = vap->iv_ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
/*
* Group key allocation must be handled specially for
@ -4056,7 +4058,7 @@ ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k,
struct ieee80211_node *ninfo)
{
struct net_device *dev = vap->iv_ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211_node *ni = NULL;
const struct ieee80211_cipher *cip = k->wk_cipher;
@ -4132,7 +4134,7 @@ ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k,
const u_int8_t mac[IEEE80211_ADDR_LEN])
{
struct net_device *dev = vap->iv_ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
return ath_keyset(sc, k, mac, vap->iv_bss);
}
@ -4147,7 +4149,7 @@ static void
ath_key_update_begin(struct ieee80211vap *vap)
{
struct net_device *dev = vap->iv_ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "Begin\n");
/*
@ -4168,7 +4170,7 @@ static void
ath_key_update_end(struct ieee80211vap *vap)
{
struct net_device *dev = vap->iv_ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n");
netif_wake_queue(dev);
@ -4258,7 +4260,7 @@ ath_merge_mcast(struct ath_softc *sc, u_int32_t mfilt[2])
static void
ath_mode_init(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
u_int32_t rfilt, mfilt[2];
@ -4452,7 +4454,7 @@ ath_setctstimeout(struct ath_softc *sc)
static void
ath_updateslot(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
/*
@ -4479,7 +4481,7 @@ static void
ath_beacon_dturbo_config(struct ieee80211vap *vap, u_int32_t intval)
{
struct ieee80211com *ic = vap->iv_ic;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
/* Check VAP capability. */
if ((ic->ic_opmode == IEEE80211_M_HOSTAP) && vap->iv_bss &&
@ -4528,7 +4530,7 @@ static void
ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark, u_int8_t dtim)
{
struct ieee80211com *ic = vap->iv_ic;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
u_int32_t bss_traffic;
if (sc->sc_ignore_ar) {
@ -4671,7 +4673,7 @@ static void
ath_turbo_switch_mode(unsigned long data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
unsigned int newflags;
@ -5385,7 +5387,7 @@ static void
ath_bstuck_tasklet(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
/*
* XXX:if the bmisscount is cleared while the
* tasklet execution is pending, the following
@ -5810,7 +5812,7 @@ ath_desc_free(struct ath_softc *sc)
static struct ieee80211_node *
ath_node_alloc(struct ieee80211vap *vap)
{
struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space;
struct ath_node *an = kzalloc(space, GFP_ATOMIC);
if (an != NULL) {
@ -5838,7 +5840,7 @@ static void
ath_node_cleanup(struct ieee80211_node *ni)
{
struct ieee80211com *ic = ni->ni_ic;
struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
struct ath_node *an = ATH_NODE(ni);
struct ath_buf *bf;
@ -5923,7 +5925,7 @@ ath_node_move_data(const struct ieee80211_node *ni)
#ifdef NOT_YET
struct ath_txq *txq = NULL;
struct ieee80211com *ic = ni->ni_ic;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
struct ath_buf *bf, *prev, *bf_tmp, *bf_tmp1;
struct ath_hal *ah = sc->sc_ah;
struct sk_buff *skb = NULL;
@ -6359,7 +6361,7 @@ static int
ath_recv_mgmt(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null,
struct sk_buff *skb, int subtype, int rssi, u_int64_t rtsf)
{
struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
struct ieee80211_node * ni = ni_or_null;
u_int64_t hw_tsf, beacon_tsf;
u_int32_t hw_tu, beacon_tu, intval;
@ -6490,7 +6492,7 @@ ath_rx_tasklet(TQUEUE_ARG data)
((_pa) - (_sc)->sc_rxdma.dd_desc_paddr)))
struct net_device *dev = (struct net_device *)data;
struct ath_buf *bf;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc ? sc->sc_ah : NULL;
struct ath_desc *ds;
@ -6928,7 +6930,7 @@ static void ath_grppoll_start(struct ieee80211vap *vap, int pollcount)
struct sk_buff *skb = NULL;
struct ath_buf *bf = NULL, *head = NULL;
struct ieee80211com *ic = vap->iv_ic;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
struct ath_hal *ah = sc->sc_ah;
u_int8_t rate;
unsigned int ctsrate = 0, ctsduration = 0;
@ -7134,7 +7136,7 @@ static void ath_grppoll_start(struct ieee80211vap *vap, int pollcount)
static void ath_grppoll_stop(struct ieee80211vap *vap)
{
struct ieee80211com *ic = vap->iv_ic;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
struct ath_hal *ah = sc->sc_ah;
struct ath_txq *txq = &sc->sc_grpplq;
struct ath_buf *bf;
@ -7340,7 +7342,7 @@ ath_txq_update(struct ath_softc *sc, struct ath_txq *txq, int ac)
static int
ath_wme_update(struct ieee80211com *ic)
{
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
if (sc->sc_uapsdq)
ath_txq_update(sc, sc->sc_uapsdq, WME_AC_VO);
@ -7359,7 +7361,7 @@ ath_uapsd_flush(struct ieee80211_node *ni)
{
struct ath_node *an = ATH_NODE(ni);
struct ath_buf *bf;
struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
struct ath_txq *txq;
ATH_NODE_UAPSD_LOCK_IRQ(an);
@ -7532,7 +7534,7 @@ static int
ath_tx_start(struct net_device *dev, struct ieee80211_node *ni,
struct ath_buf *bf, struct sk_buff *skb, int nextfraglen)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = ni->ni_ic;
struct ieee80211vap *vap = ni->ni_vap;
struct ath_hal *ah = sc->sc_ah;
@ -8381,7 +8383,7 @@ static void
ath_tx_tasklet_q0(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
if (txqactive(sc->sc_ah, 0))
ath_tx_processq(sc, &sc->sc_txq[0]);
@ -8402,7 +8404,7 @@ static void
ath_tx_tasklet_q0123(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
/*
* Process each active queue.
@ -8446,7 +8448,7 @@ static void
ath_tx_tasklet(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
unsigned int i;
for (i = 0; i < HAL_NUM_TX_QUEUES; i++) {
@ -8479,7 +8481,7 @@ ath_tx_tasklet(TQUEUE_ARG data)
static void
ath_tx_timeout(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
int i;
if (ath_chan_unavail(sc))
@ -8864,7 +8866,7 @@ static void
ath_calibrate(unsigned long arg)
{
struct net_device *dev = (struct net_device *)arg;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211com *ic = &sc->sc_ic;
/* u_int32_t nchans; */
@ -8944,7 +8946,7 @@ static void
ath_scan_start(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
u_int32_t rfilt;
@ -8964,7 +8966,7 @@ static void
ath_scan_end(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
u_int32_t rfilt;
@ -8982,7 +8984,7 @@ static void
ath_set_channel(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
(void) ath_chan_set(sc, ic->ic_curchan);
/*
@ -8998,7 +9000,7 @@ ath_set_channel(struct ieee80211com *ic)
static void
ath_set_coverageclass(struct ieee80211com *ic)
{
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
ath_hal_setcoverageclass(sc->sc_ah, ic->ic_coverageclass, 0);
@ -9008,7 +9010,7 @@ ath_set_coverageclass(struct ieee80211com *ic)
static u_int
ath_mhz2ieee(struct ieee80211com *ic, u_int freq, u_int flags)
{
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
return (ath_hal_mhz2ieee(sc->sc_ah, freq, flags));
}
@ -9023,7 +9025,7 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
struct ath_vap *avp = ATH_VAP(vap);
struct ieee80211com *ic = vap->iv_ic;
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211_node *ni, *wds_ni;
unsigned int i;
@ -9465,7 +9467,7 @@ static void
ath_setup_comp(struct ieee80211_node *ni, int enable)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
struct ath_node *an = ATH_NODE(ni);
ieee80211_keyix_t keyix;
@ -9518,7 +9520,7 @@ static void
ath_setup_stationkey(struct ieee80211_node *ni)
{
struct ieee80211vap *vap = ni->ni_vap;
struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
ieee80211_keyix_t keyix;
keyix = ath_key_alloc(vap, &ni->ni_ucastkey);
@ -9679,7 +9681,7 @@ ath_newassoc(struct ieee80211_node *ni, int isnew)
{
struct ieee80211com *ic = ni->ni_ic;
struct ieee80211vap *vap = ni->ni_vap;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
sc->sc_rc->ops->newassoc(sc, ATH_NODE(ni), isnew);
@ -9710,7 +9712,7 @@ static int
ath_getchannels(struct net_device *dev, u_int cc,
HAL_BOOL outdoor, HAL_BOOL xchanmode)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
HAL_CHANNEL *chans;
@ -10008,7 +10010,7 @@ ath_update_txpow(struct ath_softc *sc)
static int
ath_xr_rate_setup(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
@ -10037,7 +10039,7 @@ ath_xr_rate_setup(struct net_device *dev)
static void
ath_setup_subrates(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
@ -10080,7 +10082,7 @@ ath_setup_subrates(struct net_device *dev)
static int
ath_rate_setup(struct net_device *dev, u_int mode)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
@ -10304,7 +10306,7 @@ ath_printtxbuf(const struct ath_buf *bf, int done)
{
const struct ath_tx_status *ts = &bf->bf_dsstatus.ds_txstat;
const struct ath_desc *ds = bf->bf_desc;
struct ath_softc *sc = ATH_BUF_NI(bf)->ni_ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ATH_BUF_NI(bf)->ni_ic->ic_dev);
u_int8_t status = done ? ts->ts_status : 0;
DPRINTF(sc, ATH_DEBUG_ANY,
@ -10331,7 +10333,7 @@ ath_printtxbuf(const struct ath_buf *bf, int done)
static struct net_device_stats *
ath_getstats(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct net_device_stats *stats = &sc->sc_devstats;
/* update according to private statistics */
@ -10354,7 +10356,7 @@ ath_getstats(struct net_device *dev)
static int
ath_set_mac_address(struct net_device *dev, void *addr)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
struct sockaddr *mac = addr;
@ -10383,7 +10385,7 @@ ath_set_mac_address(struct net_device *dev, void *addr)
static int
ath_change_mtu(struct net_device *dev, int mtu)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
int error = 0;
if (!(ATH_MIN_MTU < mtu && mtu <= ATH_MAX_MTU)) {
@ -10472,7 +10474,7 @@ bad:
static int
ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ieee80211com *ic = &sc->sc_ic;
struct ath_diag ad;
int error;
@ -11221,7 +11223,7 @@ ath_dynamic_sysctl_unregister(struct ath_softc *sc)
static void
ath_announce(struct net_device *dev)
{
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
u_int modes, cc;
#if 0
@ -11417,7 +11419,7 @@ static void
txcont_configure_radio(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ieee80211_wme_state *wme = &ic->ic_wme;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
@ -11688,7 +11690,7 @@ static void
txcont_queue_packet(struct ieee80211com *ic, struct ath_txq *txq)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct ath_hal *ah = sc->sc_ah;
struct ath_buf *bf = NULL;
struct sk_buff *skb = NULL;
@ -11822,7 +11824,7 @@ static void
txcont_on(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
if (IFF_RUNNING != (ic->ic_dev->flags & IFF_RUNNING)) {
EPRINTF(sc, "Cannot enable txcont when"
@ -11843,7 +11845,7 @@ static void
txcont_off(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
if (TAILQ_FIRST(&ic->ic_vaps)->iv_opmode != IEEE80211_M_WDS)
sc->sc_beacons = 1;
@ -11857,7 +11859,7 @@ static int
ath_get_dfs_testmode(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
return sc->sc_dfs_testmode;
}
@ -11884,7 +11886,7 @@ static void
ath_set_dfs_testmode(struct ieee80211com *ic, int value)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
sc->sc_dfs_testmode = !!value;
}
@ -11894,7 +11896,7 @@ static int
ath_get_txcont(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
return sc->sc_txcont;
}
@ -11912,7 +11914,7 @@ static void
ath_set_txcont_power(struct ieee80211com *ic, unsigned int txpower)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
int new_txcont_power = txpower > IEEE80211_TXPOWER_MAX ?
IEEE80211_TXPOWER_MAX : txpower;
if (sc->sc_txcont_power != new_txcont_power) {
@ -11930,7 +11932,7 @@ static int
ath_get_txcont_power(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
/* VERY conservative default */
return sc->sc_txcont_power ? sc->sc_txcont_power : 0;
}
@ -11940,7 +11942,7 @@ ath_get_txcont_power(struct ieee80211com *ic)
ath_set_txcont_rate(struct ieee80211com *ic, unsigned int new_rate)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
if (sc->sc_txcont_rate != new_rate) {
/* NOTE: This value is sanity checked and dropped down to
* closest rate in txcont_on. */
@ -11957,7 +11959,7 @@ ath_set_txcont_rate(struct ieee80211com *ic, unsigned int new_rate)
ath_get_txcont_rate(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
return sc->sc_txcont_rate ? sc->sc_txcont_rate : 0;
}
@ -11967,7 +11969,7 @@ static void
ath_set_dfs_cac_time(struct ieee80211com *ic, unsigned int time_s)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
sc->sc_dfs_cac_period = time_s;
}
@ -11977,7 +11979,7 @@ static unsigned int
ath_get_dfs_cac_time(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
return sc->sc_dfs_cac_period;
}
@ -11997,7 +11999,7 @@ static void
ath_set_dfs_excl_period(struct ieee80211com *ic, unsigned int time_s)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
sc->sc_dfs_excl_period = time_s;
}
@ -12006,7 +12008,7 @@ static unsigned int
ath_get_dfs_excl_period(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
return sc->sc_dfs_excl_period;
}
@ -12018,7 +12020,7 @@ static unsigned int
ath_test_radar(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
if ((ic->ic_flags & IEEE80211_F_DOTH) && (sc->sc_curchan.privFlags & CHANNEL_DFS))
ath_radar_detected(sc, "ath_test_radar from user space");
else
@ -12033,7 +12035,7 @@ static unsigned int
ath_dump_hal_map(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
ath_hal_dump_map(sc->sc_ah);
return 0;
}
@ -12142,7 +12144,7 @@ ath_rcv_dev_event(struct notifier_block *this, unsigned long event,
void *ptr)
{
struct net_device *dev = (struct net_device *)ptr;
struct ath_softc *sc = (struct ath_softc *)dev->priv;
struct ath_softc *sc = (struct ath_softc *)netdev_priv(dev);
if (!dev || !sc || dev->open != &ath_init)
return 0;
@ -12259,7 +12261,7 @@ static unsigned int
ath_read_register(struct ieee80211com *ic, unsigned int address,
unsigned int *value)
{
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
if (address >= MAX_REGISTER_ADDRESS) {
IPRINTF(sc, "Illegal Atheros register access "
"attempted: 0x%04x >= 0x%04x\n",
@ -12289,7 +12291,7 @@ static unsigned int
ath_write_register(struct ieee80211com *ic, unsigned int address,
unsigned int value)
{
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
if (address >= MAX_REGISTER_ADDRESS) {
IPRINTF(sc, "Illegal Atheros register access "
"attempted: 0x%04x >= 0x%04x\n",
@ -12317,7 +12319,7 @@ static void
ath_registers_dump(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
ath_ar5212_registers_dump(sc);
}
#endif /* #ifdef ATH_REVERSE_ENGINEERING */
@ -12329,7 +12331,7 @@ static void
ath_registers_mark(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
ath_ar5212_registers_mark(sc);
}
#endif /* #ifdef ATH_REVERSE_ENGINEERING */
@ -12341,7 +12343,7 @@ static void
ath_registers_dump_delta(struct ieee80211com *ic)
{
struct net_device *dev = ic->ic_dev;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
ath_ar5212_registers_dump_delta(sc);
}
#endif /* #ifdef ATH_REVERSE_ENGINEERING */
@ -12513,7 +12515,7 @@ descdma_get_buffer(struct ath_descdma *dd, int index)
static int ath_debug_iwpriv(struct ieee80211com *ic,
unsigned int param, unsigned int value)
{
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
switch (param) {
case IEEE80211_PARAM_DRAINTXQ:
printk("Draining tx queue...\n");

View File

@ -199,7 +199,7 @@ init_ath_wmac(u_int16_t devid, u_int16_t wlanNum, struct ar531x_config *config)
printk(KERN_ERR "%s: no memory for device state\n", dev_info);
goto bad2;
}
sc = dev->priv;
sc = netdev_priv(dev);
sc->aps_sc.sc_dev = dev;
/*

View File

@ -214,7 +214,7 @@ ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
printk(KERN_ERR "%s: no memory for device state\n", dev_info);
goto bad2;
}
sc = dev->priv;
sc = netdev_priv(dev);
sc->aps_sc.sc_dev = dev;
sc->aps_sc.sc_iobase = mem;
@ -295,7 +295,7 @@ static void
ath_pci_remove(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct ath_pci_softc *sc = dev->priv;
struct ath_pci_softc *sc = netdev_priv(dev);
ath_detach(dev);
if (dev->irq)
@ -313,7 +313,7 @@ ath_pci_suspend(struct pci_dev *pdev, pm_message_t state)
struct net_device *dev = pci_get_drvdata(pdev);
ath_suspend(dev);
PCI_SAVE_STATE(pdev, ((struct ath_pci_softc *)dev->priv)->aps_pmstate);
PCI_SAVE_STATE(pdev, ((struct ath_pci_softc *)netdev_priv(dev))->aps_pmstate);
pci_disable_device(pdev);
return pci_set_power_state(pdev, PCI_D3hot);
}
@ -330,7 +330,7 @@ ath_pci_resume(struct pci_dev *pdev)
return err;
/* XXX - Should this return nonzero on fail? */
PCI_RESTORE_STATE(pdev, ((struct ath_pci_softc *)dev->priv)->aps_pmstate);
PCI_RESTORE_STATE(pdev, ((struct ath_pci_softc *)netdev_priv(dev))->aps_pmstate);
err = pci_enable_device(pdev);
if (err)

View File

@ -1524,7 +1524,7 @@ static void ath_rp_clear(struct ath_softc *sc)
static void ath_rp_tasklet(TQUEUE_ARG data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
if (sc->sc_rp_analyze != NULL)
sc->sc_rp_analyze(sc);

View File

@ -306,7 +306,7 @@ ath_rate_ctl_start(struct ath_softc *sc, struct ieee80211_node *ni)
static void
ath_rate_cb(void *arg, struct ieee80211_node *ni)
{
ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg);
ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg);
}
/*
@ -316,7 +316,7 @@ static void
ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state)
{
struct ieee80211com *ic = vap->iv_ic;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc;
struct ieee80211_node *ni;
@ -428,7 +428,7 @@ static void
ath_ratectl(unsigned long data)
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
struct ath_softc *sc = netdev_priv(dev);
struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc;
struct ieee80211com *ic = &sc->sc_ic;
int interval;

View File

@ -755,7 +755,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
static void
ath_rate_cb(void *arg, struct ieee80211_node *ni)
{
ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni);
ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni);
}
/* Reset the rate control state for each 802.11 state transition. */
@ -771,7 +771,7 @@ ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state newstate)
ieee80211_iterate_nodes(&ic->ic_sta,
ath_rate_cb, NULL);
}
ath_rate_newassoc(ic->ic_dev->priv,
ath_rate_newassoc(netdev_priv(ic->ic_dev),
ATH_NODE(vap->iv_bss), 1);
}
}
@ -960,7 +960,7 @@ ath_proc_read_nodes(struct ieee80211vap *vap, char *buf, int space)
(struct ieee80211_node_table *)&vap->iv_ic->ic_sta;
unsigned int x = 0;
unsigned int this_tp, this_prob, this_eprob;
struct ath_softc *sc = vap->iv_ic->ic_dev->priv;;
struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {

View File

@ -292,7 +292,7 @@ ath_rate_ctl_start(struct ath_softc *sc, struct ieee80211_node *ni)
static void
ath_rate_cb(void *arg, struct ieee80211_node *ni)
{
ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg);
ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg);
}
/*
@ -302,7 +302,7 @@ static void
ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state)
{
struct ieee80211com *ic = vap->iv_ic;
struct ath_softc *sc = ic->ic_dev->priv;
struct ath_softc *sc = netdev_priv(ic->ic_dev);
struct ieee80211_node *ni;
if (state == IEEE80211_S_INIT)

View File

@ -941,7 +941,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
static void
ath_rate_cb(void *arg, struct ieee80211_node *ni)
{
ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni);
ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni);
}
/*
@ -959,7 +959,7 @@ ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state newstate)
*/
ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL);
}
ath_rate_newassoc(ic->ic_dev->priv, ATH_NODE(vap->iv_bss), 1);
ath_rate_newassoc(netdev_priv(ic->ic_dev), ATH_NODE(vap->iv_bss), 1);
}
}

View File

@ -175,6 +175,10 @@ typedef unsigned long resource_size_t;
#define IRQF_SHARED SA_SHIRQ
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
#define netdev_priv(_netdev) ((_netdev)->priv)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
#define skb_end_pointer(_skb) ((_skb)->end)
#define skb_tail_pointer(_skb) ((_skb)->tail)

View File

@ -407,7 +407,7 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct net_device *dev,
#define IEEE80211_C_OPMODE \
(IEEE80211_C_IBSS | IEEE80211_C_HOSTAP | IEEE80211_C_AHDEMO | \
IEEE80211_C_MONITOR)
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct net_device *parent = ic->ic_dev;
int err;
@ -1262,7 +1262,7 @@ media_status(enum ieee80211_opmode opmode, const struct ieee80211_channel *chan)
static void
ieee80211com_media_status(struct net_device *dev, struct ifmediareq *imr)
{
struct ieee80211com *ic = dev->priv; /* XXX */
struct ieee80211com *ic = netdev_priv(dev); /* XXX */
imr->ifm_status = IFM_AVALID;
if (!TAILQ_EMPTY(&ic->ic_vaps))
@ -1314,7 +1314,7 @@ media2mode(const struct ifmedia_entry *ime, enum ieee80211_phymode *mode)
static int
ieee80211com_media_change(struct net_device *dev)
{
struct ieee80211com *ic = dev->priv; /* XXX */
struct ieee80211com *ic = netdev_priv(dev); /* XXX */
struct ieee80211vap *vap;
struct ifmedia_entry *ime = ic->ic_media.ifm_cur;
enum ieee80211_phymode newphymode;
@ -1418,7 +1418,7 @@ checkrate(struct ieee80211com *ic, enum ieee80211_phymode mode, int rate)
int
ieee80211_media_change(struct net_device *dev)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ifmedia_entry *ime = vap->iv_media.ifm_cur;
enum ieee80211_phymode newmode;
@ -1456,7 +1456,7 @@ EXPORT_SYMBOL(ieee80211_media_change);
void
ieee80211_media_status(struct net_device *dev, struct ifmediareq *imr)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
enum ieee80211_phymode mode;
struct ieee80211_rateset *rs;
@ -1662,7 +1662,7 @@ EXPORT_SYMBOL(ieee80211_media2rate);
static struct net_device_stats *
ieee80211_getstats(struct net_device *dev)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct net_device_stats *stats = &vap->iv_devstats;
/* XXX: Total guess as to what to count where */
@ -1701,7 +1701,7 @@ ieee80211_change_mtu(struct net_device *dev, int mtu)
static void
ieee80211_set_multicast_list(struct net_device *dev)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct net_device *parent = ic->ic_dev;

View File

@ -181,7 +181,7 @@ EXPORT_SYMBOL(ieee80211_getmgtframe);
static void
ieee80211_vlan_register(struct net_device *dev, struct vlan_group *grp)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
vap->iv_vlgrp = grp;
}
@ -192,7 +192,7 @@ ieee80211_vlan_register(struct net_device *dev, struct vlan_group *grp)
static void
ieee80211_vlan_add_vid(struct net_device *dev, unsigned short vid)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (vap->iv_vlgrp != NULL)
vap->iv_bss->ni_vlan = vid;
@ -204,7 +204,7 @@ ieee80211_vlan_add_vid(struct net_device *dev, unsigned short vid)
static void
ieee80211_vlan_kill_vid(struct net_device *dev, unsigned short vid)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (vap->iv_vlgrp != NULL)
vlan_group_set_device(vap->iv_vlgrp, vid, NULL);
@ -378,18 +378,18 @@ EXPORT_SYMBOL(ieee80211_notify_michael_failure);
int
ieee80211_load_module(const char *modname)
{
#ifdef CONFIG_KMOD
#if defined(CONFIG_KMOD) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
int rv;
rv = request_module("%s", modname);
if (rv < 0)
printk(KERN_ERR "failed to automatically load module: %s; " \
"errno: %d\n", modname, rv);
return rv;
#else /* CONFIG_KMOD */
#else /* CONFIG_KMOD || 2.6.27+ */
printk(KERN_ERR "Unable to load needed module: %s; no support for " \
"automatic module loading\n", modname);
return -ENOSYS;
#endif /* CONFIG_KMOD */
#endif /* CONFIG_KMOD || 2.6.27+ */
}
@ -967,8 +967,8 @@ ieee80211_rcv_dev_event(struct notifier_block *this, unsigned long event,
switch (event) {
case NETDEV_CHANGENAME:
ieee80211_virtfs_vdetach(dev->priv);
ieee80211_virtfs_latevattach(dev->priv);
ieee80211_virtfs_vdetach(netdev_priv(dev));
ieee80211_virtfs_latevattach(netdev_priv(dev));
return NOTIFY_DONE;
default:
break;

View File

@ -201,7 +201,7 @@ ieee80211_classify(struct ieee80211_node *ni, struct sk_buff *skb)
int
ieee80211_hardstart(struct sk_buff *skb, struct net_device *dev)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct net_device *parent = ic->ic_dev;
struct ieee80211_node *ni = NULL;
@ -309,7 +309,7 @@ bad:
* SKB is consumed in all cases.
*/
void ieee80211_parent_queue_xmit(struct sk_buff *skb) {
struct ieee80211vap *vap = skb->dev->priv;
struct ieee80211vap *vap = netdev_priv(skb->dev);
vap->iv_devstats.tx_packets++;
vap->iv_devstats.tx_bytes += skb->len;

View File

@ -952,7 +952,7 @@ ieee80211_init(struct net_device *dev, int forcescan)
{
#define IS_RUNNING(_dev) \
((_dev->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP))
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct net_device *parent = ic->ic_dev;
@ -1095,7 +1095,7 @@ EXPORT_SYMBOL(ieee80211_start_running);
int
ieee80211_stop(struct net_device *dev)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct net_device *parent = ic->ic_dev;

View File

@ -79,7 +79,7 @@ pre_announced_chanswitch(struct net_device *dev, u_int32_t channel, u_int32_t tb
static int
preempt_scan(struct net_device *dev, int max_grace, int max_wait)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
int total_delay = 0;
int canceled = 0, ready = 0;
@ -114,7 +114,7 @@ preempt_scan(struct net_device *dev, int max_grace, int max_wait)
static struct iw_statistics *
ieee80211_iw_getstats(struct net_device *dev)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct iw_statistics *is = &vap->iv_iwstats;
struct ieee80211com *ic = vap->iv_ic;
@ -138,7 +138,7 @@ static int
ieee80211_ioctl_giwname(struct net_device *dev, struct iw_request_info *info,
char *name, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211_channel *c = vap->iv_ic->ic_curchan;
if (IEEE80211_IS_CHAN_108G(c))
@ -190,7 +190,7 @@ static int
ieee80211_ioctl_siwencode(struct net_device *dev,
struct iw_request_info *info, struct iw_point *erq, char *keybuf)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
int error;
int wepchange = 0;
ieee80211_keyix_t kix;
@ -299,7 +299,7 @@ static int
ieee80211_ioctl_giwencode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *erq, char *key)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211_key *k;
int error;
ieee80211_keyix_t kix;
@ -344,7 +344,7 @@ ieee80211_ioctl_siwrate(struct net_device *dev, struct iw_request_info *info,
IFM_IEEE80211_11A | IFM_IEEE80211_TURBO,
IFM_IEEE80211_11G | IFM_IEEE80211_TURBO,
};
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ifreq ifr;
int rate, retv;
@ -382,7 +382,7 @@ static int
ieee80211_ioctl_giwrate(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ifmediareq imr;
int rate;
@ -420,7 +420,7 @@ static int
ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
u16 val;
@ -443,7 +443,7 @@ static int
ieee80211_ioctl_giwrts(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
rts->value = vap->iv_rtsthreshold;
rts->disabled = (rts->value == IEEE80211_RTS_MAX);
@ -456,7 +456,7 @@ static int
ieee80211_ioctl_siwfrag(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
u16 val;
@ -479,7 +479,7 @@ static int
ieee80211_ioctl_giwfrag(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
rts->value = vap->iv_fragthreshold;
rts->disabled = (rts->value == 2346);
@ -492,7 +492,7 @@ static int
ieee80211_ioctl_siwap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
/* NB: should not be set when in AP mode */
if (vap->iv_opmode == IEEE80211_M_HOSTAP)
@ -528,7 +528,7 @@ static int
ieee80211_ioctl_giwap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (vap->iv_flags & IEEE80211_F_DESBSSID)
IEEE80211_ADDR_COPY(&ap_addr->sa_data, vap->iv_des_bssid);
@ -549,7 +549,7 @@ static int
ieee80211_ioctl_siwnickn(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *nickname)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (data->length > IEEE80211_NWID_LEN)
return -E2BIG;
@ -565,7 +565,7 @@ static int
ieee80211_ioctl_giwnickn(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *nickname)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (data->length > vap->iv_nicknamelen + 1)
data->length = vap->iv_nicknamelen + 1;
@ -674,7 +674,7 @@ static int
ieee80211_ioctl_siwfreq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_channel *c, *c2;
int i;
@ -792,7 +792,7 @@ static int
ieee80211_ioctl_giwfreq(struct net_device *dev, struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
if (vap->iv_state == IEEE80211_S_RUN &&
@ -833,7 +833,7 @@ static int
ieee80211_ioctl_siwessid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *ssid)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (vap->iv_opmode == IEEE80211_M_WDS)
return -EOPNOTSUPP;
@ -878,7 +878,7 @@ static int
ieee80211_ioctl_giwessid(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *essid)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (vap->iv_opmode == IEEE80211_M_WDS)
return -EOPNOTSUPP;
@ -909,7 +909,7 @@ static int
ieee80211_ioctl_giwrange(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_node *ni = vap->iv_bss;
struct iw_range *range = (struct iw_range *)extra;
@ -1053,7 +1053,7 @@ ieee80211_ioctl_setspy(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
/* save the list of node addresses */
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct sockaddr address[IW_MAX_SPY];
unsigned int number = data->length;
int i;
@ -1091,7 +1091,7 @@ ieee80211_ioctl_getspy(struct net_device *dev, struct iw_request_info *info,
* locate nodes by mac (ieee80211_find_node()),
* copy out rssi, set updated flag appropriately
*/
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211_node_table *nt = &vap->iv_ic->ic_sta;
struct ieee80211_node *ni;
struct ieee80211com *ic = vap->iv_ic;
@ -1143,7 +1143,7 @@ static int
ieee80211_ioctl_setthrspy(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct iw_thrspy threshold;
if (data->length != 1)
@ -1180,7 +1180,7 @@ static int
ieee80211_ioctl_getthrspy(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct iw_thrspy *threshold;
@ -1201,7 +1201,7 @@ static int
ieee80211_ioctl_siwmode(struct net_device *dev, struct iw_request_info *info,
__u32 *mode, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ifmediareq imr;
int valid = 0;
@ -1226,7 +1226,7 @@ static int
ieee80211_ioctl_giwmode(struct net_device *dev, struct iw_request_info *info,
__u32 *mode, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ifmediareq imr;
memset(&imr, 0, sizeof(imr));
@ -1249,7 +1249,7 @@ static int
ieee80211_ioctl_siwpower(struct net_device *dev, struct iw_request_info *info,
struct iw_param *wrq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
/* XXX: These values, flags, and caps do not seem to be used elsewhere
@ -1288,7 +1288,7 @@ static int
ieee80211_ioctl_giwpower(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
rrq->disabled = (ic->ic_flags & IEEE80211_F_PMGTON) == 0;
@ -1312,7 +1312,7 @@ static int
ieee80211_ioctl_siwretry(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
if (rrq->disabled) {
@ -1344,7 +1344,7 @@ static int
ieee80211_ioctl_giwretry(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
rrq->disabled = (vap->iv_flags & IEEE80211_F_SWRETRY) == 0;
if (!rrq->disabled) {
@ -1375,7 +1375,7 @@ static int
ieee80211_ioctl_siwtxpow(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
int fixed, disabled;
@ -1432,7 +1432,7 @@ ieee80211_get_txcont(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
params[0] = ic->ic_get_txcont(ic);
return 0;
@ -1443,7 +1443,7 @@ ieee80211_get_dfs_cac_time(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
params[0] = ic->ic_get_dfs_cac_time(ic);
return 0;
@ -1454,7 +1454,7 @@ ieee80211_get_dfs_excl_period(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
params[0] = ic->ic_get_dfs_excl_period(ic);
return 0;
@ -1464,7 +1464,7 @@ ieee80211_set_dfs_cac_time(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
ic->ic_set_dfs_cac_time(ic, params[1]);
return 0;
@ -1474,7 +1474,7 @@ ieee80211_set_dfs_excl_period (struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
ic->ic_set_dfs_excl_period(ic, params[1]);
return 0;
@ -1485,7 +1485,7 @@ ieee80211_get_dfs_testmode(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
params[0] = ic->ic_get_dfs_testmode(ic);
return 0;
@ -1496,7 +1496,7 @@ ieee80211_get_txcont_rate(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
params[0] = ic->ic_get_txcont_rate(ic);
return 0;
@ -1507,7 +1507,7 @@ ieee80211_set_txcont(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
ic->ic_set_txcont(ic, params[1]);
return 0;
@ -1518,7 +1518,7 @@ ieee80211_set_dfs_testmode(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
ic->ic_set_dfs_testmode(ic, params[1]);
return 0;
@ -1529,7 +1529,7 @@ ieee80211_set_txcont_rate(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
ic->ic_set_txcont_rate(ic, params[1]);
return 0;
@ -1540,7 +1540,7 @@ ieee80211_set_txcont_power(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
ic->ic_set_txcont_power(ic, params[1]);
return 0;
@ -1551,7 +1551,7 @@ ieee80211_get_txcont_power(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
params[0] = ic->ic_get_txcont_power(ic);
return 0;
@ -1562,7 +1562,7 @@ ieee80211_ioctl_hal_map(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
params[0] = ic->ic_dump_hal_map(ic);
return 0;
@ -1574,7 +1574,7 @@ ieee80211_ioctl_radar(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
int *params = (int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
if (!(ic->ic_flags & IEEE80211_F_DOTH))
return 0;
@ -1586,7 +1586,7 @@ static int
ieee80211_ioctl_giwtxpow(struct net_device *dev, struct iw_request_info *info,
struct iw_param *rrq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
rrq->value = vap->iv_bss->ni_txpower / 2;
@ -1601,7 +1601,7 @@ static int
ieee80211_dump_registers(struct net_device *dev, struct iw_request_info *info, void *w, char *extra)
{
unsigned int *params = (unsigned int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
switch (params[1]) {
case 2:
@ -1624,7 +1624,7 @@ static int
ieee80211_ioctl_writereg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra)
{
unsigned int *params = (unsigned int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
return ic->ic_write_register(ic, params[0], params[1]);
}
@ -1635,7 +1635,7 @@ static int
ieee80211_ioctl_readreg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra)
{
unsigned int *params = (unsigned int *)extra;
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
return ic->ic_read_register(ic, params[0], &params[0]);
}
@ -1671,7 +1671,7 @@ static int
ieee80211_ioctl_iwaplist(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct waplistreq req; /* XXX off stack */
@ -1693,7 +1693,7 @@ static int
ieee80211_ioctl_siwscan(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
/*
* XXX don't permit a scan to be started unless we
@ -2028,7 +2028,7 @@ static int
ieee80211_ioctl_giwscan(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct iwscanreq req;
int res = 0;
@ -2130,7 +2130,7 @@ static int
ieee80211_ioctl_setmode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *wri, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ifreq ifr;
char s[6]; /* big enough for ``11adt'' */
@ -2254,10 +2254,10 @@ ieee80211_setathcap(struct ieee80211vap *vap, int cap, int setting)
static int
ieee80211_set_turbo(struct net_device *dev, int flag)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ifreq ifr;
struct ieee80211vap *tmpvap = dev->priv;
struct ieee80211vap *tmpvap = netdev_priv(dev);
int nvap = 0;
TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next)
@ -2278,7 +2278,7 @@ static int
ieee80211_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn;
unsigned int *i = (unsigned int *)extra;
@ -2923,7 +2923,7 @@ static int
ieee80211_ioctl_getmode(struct net_device *dev, struct iw_request_info *info,
struct iw_point *wri, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ifmediareq imr;
@ -2961,7 +2961,7 @@ static int
ieee80211_ioctl_getparam(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn;
unsigned int *param = (unsigned int *)extra;
@ -3276,7 +3276,7 @@ static int
ieee80211_ioctl_setoptie(struct net_device *dev, struct iw_request_info *info,
struct iw_point *wri, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
void *ie;
/*
@ -3310,7 +3310,7 @@ static int
ieee80211_ioctl_getoptie(struct net_device *dev, struct iw_request_info *info,
struct iw_point *wri, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (vap->iv_opt_ie == NULL) {
wri->length = 0;
@ -3374,7 +3374,7 @@ ieee80211_ioctl_setappiebuf(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211req_getset_appiebuf *iebuf =
(struct ieee80211req_getset_appiebuf *)extra;
enum ieee80211_opmode chk_opmode;
@ -3416,7 +3416,7 @@ static int
ieee80211_ioctl_getappiebuf(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211req_getset_appiebuf *iebuf =
(struct ieee80211req_getset_appiebuf *)extra;
int max_iebuf_len;
@ -3457,7 +3457,7 @@ static int
ieee80211_ioctl_setfilter(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211req_set_filter *app_filter = (struct ieee80211req_set_filter *)extra;
if ((extra == NULL) || (app_filter->app_filterype & ~IEEE80211_FILTER_TYPE_ALL))
@ -3472,7 +3472,7 @@ static int
ieee80211_ioctl_setkey(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211req_key *ik = (struct ieee80211req_key *)extra;
struct ieee80211_node *ni;
@ -3555,7 +3555,7 @@ ieee80211_ioctl_setkey(struct net_device *dev, struct iw_request_info *info,
static int
ieee80211_ioctl_getkey(struct net_device *dev, struct iwreq *iwr)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_node *ni;
struct ieee80211req_key ik;
@ -3616,7 +3616,7 @@ static int
ieee80211_ioctl_delkey(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211req_del_key *dk = (struct ieee80211req_del_key *)extra;
ieee80211_keyix_t kix;
@ -3690,7 +3690,7 @@ static int
ieee80211_ioctl_setmlme(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211req_mlme *mlme = (struct ieee80211req_mlme *)extra;
struct ieee80211_node *ni;
@ -3792,7 +3792,7 @@ static int
ieee80211_ioctl_wdsmac(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct sockaddr *sa = (struct sockaddr *)extra;
if (!IEEE80211_ADDR_NULL(vap->wds_mac)) {
@ -3821,7 +3821,7 @@ static int
ieee80211_ioctl_wdsdelmac(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct sockaddr *sa = (struct sockaddr *)extra;
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_node *wds_ni;
@ -3884,7 +3884,7 @@ static int
ieee80211_ioctl_addmac(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct sockaddr *sa = (struct sockaddr *)extra;
const struct ieee80211_aclator *acl = vap->iv_acl;
@ -3902,7 +3902,7 @@ static int
ieee80211_ioctl_delmac(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct sockaddr *sa = (struct sockaddr *)extra;
const struct ieee80211_aclator *acl = vap->iv_acl;
@ -3920,7 +3920,7 @@ static int
ieee80211_ioctl_setchanlist(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211req_chanlist *list =
(struct ieee80211req_chanlist *)extra;
@ -3966,7 +3966,7 @@ static int
ieee80211_ioctl_getchanlist(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
memcpy(extra, ic->ic_chan_active, sizeof(ic->ic_chan_active));
@ -3977,7 +3977,7 @@ static int
ieee80211_ioctl_getchaninfo(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211req_chaninfo chans;
u_int8_t reported[IEEE80211_CHAN_BYTES]; /* XXX stack usage? */
@ -4020,7 +4020,7 @@ static int
ieee80211_ioctl_setwmmparams(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
unsigned int *param = (unsigned int *)extra;
unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
unsigned int bss = param[2];
@ -4108,7 +4108,7 @@ static int
ieee80211_ioctl_getwmmparams(struct net_device *dev,
struct iw_request_info *info, void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
unsigned int *param = (unsigned int *)extra;
unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme;
@ -4143,7 +4143,7 @@ ieee80211_ioctl_getwmmparams(struct net_device *dev,
static int
ieee80211_ioctl_getwpaie(struct net_device *dev, struct iwreq *iwr)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_node *ni;
struct ieee80211req_wpaie wpaie;
@ -4177,7 +4177,7 @@ ieee80211_ioctl_getwpaie(struct net_device *dev, struct iwreq *iwr)
static int
ieee80211_ioctl_getstastats(struct net_device *dev, struct iwreq *iwr)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_node *ni;
u_int8_t macaddr[IEEE80211_ADDR_LEN];
@ -4296,7 +4296,7 @@ get_scan_result(void *arg, const struct ieee80211_scan_entry *se)
static int
ieee80211_ioctl_getscanresults(struct net_device *dev, struct iwreq *iwr)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct scanreq req;
int error;
@ -4454,7 +4454,7 @@ get_sta_info(void *arg, struct ieee80211_node *ni)
static int
ieee80211_ioctl_getstainfo(struct net_device *dev, struct iwreq *iwr)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
struct stainforeq req;
int error;
@ -4488,7 +4488,7 @@ ieee80211_ioctl_getstainfo(struct net_device *dev, struct iwreq *iwr)
static void
pre_announced_chanswitch(struct net_device *dev, u_int32_t channel, u_int32_t tbtt) {
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
/* now flag the beacon update to include the channel switch IE */
ic->ic_flags |= IEEE80211_F_CHANSWITCH;
@ -4500,7 +4500,7 @@ static int
ieee80211_ioctl_chanswitch(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct ieee80211com *ic = vap->iv_ic;
unsigned int *param = (unsigned int *)extra;
@ -4545,7 +4545,7 @@ static int
ieee80211_ioctl_giwgenie(struct net_device *dev,
struct iw_request_info *info, struct iw_point *out, char *buf)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
if (out->length < vap->iv_opt_ie_len)
return -E2BIG;
@ -5078,7 +5078,7 @@ static int
ieee80211_ioctl_giwencodeext(struct net_device *dev,
struct iw_request_info *info, struct iw_point *erq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct iw_encode_ext *ext;
struct ieee80211_key *wk;
ieee80211_keyix_t kix;
@ -5138,7 +5138,7 @@ static int
ieee80211_ioctl_siwencodeext(struct net_device *dev,
struct iw_request_info *info, struct iw_point *erq, char *extra)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
struct ieee80211req_key kr;
ieee80211_keyix_t kix;
@ -5781,7 +5781,7 @@ static struct iw_handler_def ieee80211_iw_handler_def = {
static int
ieee80211_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct ieee80211vap *vap = dev->priv;
struct ieee80211vap *vap = netdev_priv(dev);
switch (cmd) {
case SIOCG80211STATS: