3 @@ -119,7 +119,7 @@ ath_wprobe_sync(struct wprobe_iface *dev
4 struct ath_vap *avp = container_of(dev, struct ath_vap, av_wpif);
5 struct ieee80211vap *vap = &avp->av_vap;
6 struct ieee80211com *ic = vap->iv_ic;
7 - struct ath_softc *sc = ic->ic_dev->priv;
8 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
9 struct ath_hal *ah = sc->sc_ah;
12 @@ -192,7 +192,7 @@ ath_lookup_rateval(struct ieee80211_node
14 struct ieee80211vap *vap = ni->ni_vap;
15 struct ieee80211com *ic = vap->iv_ic;
16 - struct ath_softc *sc = ic->ic_dev->priv;
17 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
18 const HAL_RATE_TABLE *rt = sc->sc_currates;
20 if ((!rt) || (rate < 0) || (rate >= ARRAY_SIZE(sc->sc_hwmap)))
21 --- a/ath/if_ath_ahb.c
22 +++ b/ath/if_ath_ahb.c
23 @@ -268,7 +268,7 @@ static int ahb_wmac_probe(struct platfor
28 + sc = netdev_priv(dev);
29 sc->aps_sc.sc_dev = dev;
31 dev->irq = platform_get_irq(pdev, 0);
32 @@ -365,7 +365,7 @@ init_ath_wmac(u_int16_t devid, u_int16_t
33 printk(KERN_ERR "%s: no memory for device state\n", dev_info);
37 + sc = netdev_priv(dev);
38 sc->aps_sc.sc_dev = dev;
43 @@ -569,7 +569,7 @@ static inline int rate_factor(int mode)
45 ath_attach(u_int16_t devid, struct net_device *dev, HAL_BUS_TAG tag)
47 - struct ath_softc *sc = dev->priv;
48 + struct ath_softc *sc = netdev_priv(dev);
49 struct ieee80211com *ic = &sc->sc_ic;
50 struct ieee80211vap *vap;
52 @@ -1206,7 +1206,7 @@ bad:
54 ath_detach(struct net_device *dev)
56 - struct ath_softc *sc = dev->priv;
57 + struct ath_softc *sc = netdev_priv(dev);
58 struct ath_hal *ah = sc->sc_ah;
61 @@ -1266,7 +1266,7 @@ static struct ieee80211vap *
62 ath_vap_create(struct ieee80211com *ic, const char *name,
63 int opmode, int flags, struct net_device *mdev, struct ieee80211vap *master)
65 - struct ath_softc *sc = ic->ic_dev->priv;
66 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
67 struct ath_hal *ah = sc->sc_ah;
68 struct net_device *dev;
70 @@ -1344,7 +1344,7 @@ ath_vap_create(struct ieee80211com *ic,
75 + avp = netdev_priv(dev);
76 ieee80211_vap_setup(ic, dev, name, opmode, flags, master);
77 /* override with driver methods */
79 @@ -1570,7 +1570,7 @@ static void
80 ath_vap_delete(struct ieee80211vap *vap)
82 struct net_device *dev = vap->iv_ic->ic_dev;
83 - struct ath_softc *sc = dev->priv;
84 + struct ath_softc *sc = netdev_priv(dev);
85 struct ath_hal *ah = sc->sc_ah;
86 struct ath_vap *avp = ATH_VAP(vap);
88 @@ -1672,7 +1672,7 @@ void
89 ath_suspend(struct net_device *dev)
92 - struct ath_softc *sc = dev->priv;
93 + struct ath_softc *sc = netdev_priv(dev);
96 DPRINTF(sc, ATH_DEBUG_ANY, "flags=%x\n", dev->flags);
97 @@ -1683,7 +1683,7 @@ void
98 ath_resume(struct net_device *dev)
101 - struct ath_softc *sc = dev->priv;
102 + struct ath_softc *sc = netdev_priv(dev);
105 DPRINTF(sc, ATH_DEBUG_ANY, "flags=%x\n", dev->flags);
106 @@ -2247,7 +2247,7 @@ ath_intr(int irq, void *dev_id, struct p
109 struct net_device *dev = dev_id;
110 - struct ath_softc *sc = dev->priv;
111 + struct ath_softc *sc = netdev_priv(dev);
112 struct ath_hal *ah = sc->sc_ah;
113 u_int64_t hw_tsf = 0;
115 @@ -2468,7 +2468,7 @@ static void
116 ath_fatal_tasklet(TQUEUE_ARG data)
118 struct net_device *dev = (struct net_device *)data;
119 - struct ath_softc *sc = dev->priv;
120 + struct ath_softc *sc = netdev_priv(dev);
122 EPRINTF(sc, "Hardware error; resetting.\n");
124 @@ -2478,7 +2478,7 @@ static void
125 ath_rxorn_tasklet(TQUEUE_ARG data)
127 struct net_device *dev = (struct net_device *)data;
128 - struct ath_softc *sc = dev->priv;
129 + struct ath_softc *sc = netdev_priv(dev);
131 EPRINTF(sc, "Receive FIFO overrun; resetting.\n");
133 @@ -2488,7 +2488,7 @@ static void
134 ath_bmiss_tasklet(TQUEUE_ARG data)
136 struct net_device *dev = (struct net_device *)data;
137 - struct ath_softc *sc = dev->priv;
138 + struct ath_softc *sc = netdev_priv(dev);
140 if (time_before(jiffies, sc->sc_ic.ic_bmiss_guard)) {
141 /* Beacon miss interrupt occured too short after last beacon
142 @@ -2567,7 +2567,7 @@ done:
144 ath_init(struct net_device *dev)
146 - struct ath_softc *sc = dev->priv;
147 + struct ath_softc *sc = netdev_priv(dev);
148 struct ieee80211com *ic = &sc->sc_ic;
149 struct ath_hal *ah = sc->sc_ah;
151 @@ -2692,7 +2692,7 @@ done:
153 ath_stop_locked(struct net_device *dev)
155 - struct ath_softc *sc = dev->priv;
156 + struct ath_softc *sc = netdev_priv(dev);
157 struct ieee80211com *ic = &sc->sc_ic;
158 struct ath_hal *ah = sc->sc_ah;
160 @@ -2777,7 +2777,7 @@ static void ath_set_beacon_cal(struct at
162 ath_stop(struct net_device *dev)
164 - struct ath_softc *sc = dev->priv;
165 + struct ath_softc *sc = netdev_priv(dev);
169 @@ -2997,7 +2997,7 @@ ath_fetch_idle_time(struct ath_softc *sc
171 ath_reset(struct net_device *dev)
173 - struct ath_softc *sc = dev->priv;
174 + struct ath_softc *sc = netdev_priv(dev);
175 struct ieee80211com *ic = &sc->sc_ic;
176 struct ath_hal *ah = sc->sc_ah;
177 struct ieee80211_channel *c;
178 @@ -3163,7 +3163,7 @@ dot11_to_ratecode(struct ath_softc *sc,
180 ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb)
182 - struct ath_softc *sc = dev->priv;
183 + struct ath_softc *sc = netdev_priv(dev);
184 struct ath_hal *ah = sc->sc_ah;
185 struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *)
186 (SKB_CB(skb) + 1); /* NB: SKB_CB casts to CB struct*. */
187 @@ -3476,7 +3476,7 @@ _take_txbuf(struct ath_softc *sc, int fo
189 ath_hardstart(struct sk_buff *skb, struct net_device *dev)
191 - struct ath_softc *sc = dev->priv;
192 + struct ath_softc *sc = netdev_priv(dev);
193 struct ieee80211_node *ni = NULL;
194 struct ath_buf *bf = NULL;
196 @@ -3791,7 +3791,7 @@ static int
197 ath_mgtstart(struct ieee80211com *ic, struct sk_buff *skb)
199 struct net_device *dev = ic->ic_dev;
200 - struct ath_softc *sc = dev->priv;
201 + struct ath_softc *sc = netdev_priv(dev);
202 struct ath_buf *bf = NULL;
205 @@ -4150,7 +4150,7 @@ static ieee80211_keyix_t
206 ath_key_alloc(struct ieee80211vap *vap, const struct ieee80211_key *k)
208 struct net_device *dev = vap->iv_ic->ic_dev;
209 - struct ath_softc *sc = dev->priv;
210 + struct ath_softc *sc = netdev_priv(dev);
213 * Group key allocation must be handled specially for
214 @@ -4215,7 +4215,7 @@ ath_key_delete(struct ieee80211vap *vap,
215 struct ieee80211_node *ninfo)
217 struct net_device *dev = vap->iv_ic->ic_dev;
218 - struct ath_softc *sc = dev->priv;
219 + struct ath_softc *sc = netdev_priv(dev);
220 struct ath_hal *ah = sc->sc_ah;
221 struct ieee80211_node *ni = NULL;
222 const struct ieee80211_cipher *cip = k->wk_cipher;
223 @@ -4291,14 +4291,14 @@ ath_key_set(struct ieee80211vap *vap, co
224 const u_int8_t mac[IEEE80211_ADDR_LEN])
226 struct net_device *dev = vap->iv_ic->ic_dev;
227 - struct ath_softc *sc = dev->priv;
228 + struct ath_softc *sc = netdev_priv(dev);
230 return ath_keyset(sc, k, mac, vap->iv_bss);
233 static void ath_poll_disable(struct net_device *dev)
235 - struct ath_softc *sc = dev->priv;
236 + struct ath_softc *sc = netdev_priv(dev);
239 * XXX Using in_softirq is not right since we might
240 @@ -4316,7 +4316,7 @@ static void ath_poll_disable(struct net_
242 static void ath_poll_enable(struct net_device *dev)
244 - struct ath_softc *sc = dev->priv;
245 + struct ath_softc *sc = netdev_priv(dev);
249 @@ -4342,7 +4342,7 @@ ath_key_update_begin(struct ieee80211vap
251 struct net_device *dev = vap->iv_ic->ic_dev;
253 - struct ath_softc *sc = dev->priv;
254 + struct ath_softc *sc = netdev_priv(dev);
257 DPRINTF(sc, ATH_DEBUG_KEYCACHE, "Begin\n");
258 @@ -4360,7 +4360,7 @@ ath_key_update_end(struct ieee80211vap *
260 struct net_device *dev = vap->iv_ic->ic_dev;
262 - struct ath_softc *sc = dev->priv;
263 + struct ath_softc *sc = netdev_priv(dev);
266 DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n");
267 @@ -4453,7 +4453,7 @@ ath_merge_mcast(struct ath_softc *sc, u_
269 ath_mode_init(struct net_device *dev)
271 - struct ath_softc *sc = dev->priv;
272 + struct ath_softc *sc = netdev_priv(dev);
273 struct ath_hal *ah = sc->sc_ah;
274 u_int32_t rfilt, mfilt[2];
276 @@ -4539,7 +4539,7 @@ ath_set_timing(struct ath_softc *sc)
278 ath_updateslot(struct net_device *dev)
280 - struct ath_softc *sc = dev->priv;
281 + struct ath_softc *sc = netdev_priv(dev);
282 struct ieee80211com *ic = &sc->sc_ic;
285 @@ -4569,7 +4569,7 @@ ath_beacon_dturbo_config(struct ieee8021
286 (vap->iv_bss && (vap->iv_bss->ni_ath_flags & (IEEE80211_ATHC_TURBOP)) == \
287 (IEEE80211_ATHC_TURBOP))
288 struct ieee80211com *ic = vap->iv_ic;
289 - struct ath_softc *sc = ic->ic_dev->priv;
290 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
292 if (ic->ic_opmode == IEEE80211_M_HOSTAP && IS_CAPABLE(vap)) {
294 @@ -4617,7 +4617,7 @@ static void
295 ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark, u_int8_t dtim)
297 struct ieee80211com *ic = vap->iv_ic;
298 - struct ath_softc *sc = ic->ic_dev->priv;
299 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
300 u_int32_t bss_traffic;
302 if (sc->sc_ignore_ar) {
303 @@ -4758,7 +4758,7 @@ static void
304 ath_turbo_switch_mode(unsigned long data)
306 struct net_device *dev = (struct net_device *)data;
307 - struct ath_softc *sc = dev->priv;
308 + struct ath_softc *sc = netdev_priv(dev);
309 struct ieee80211com *ic = &sc->sc_ic;
310 unsigned int newflags;
312 @@ -5437,7 +5437,7 @@ static void
313 ath_bstuck_tasklet(TQUEUE_ARG data)
315 struct net_device *dev = (struct net_device *)data;
316 - struct ath_softc *sc = dev->priv;
317 + struct ath_softc *sc = netdev_priv(dev);
319 * XXX:if the bmisscount is cleared while the
320 * tasklet execution is pending, the following
321 @@ -5890,7 +5890,7 @@ ath_node_alloc_debug(struct ieee80211vap
322 ath_node_alloc(struct ieee80211vap *vap)
325 - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
326 + struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
327 const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space;
328 struct ath_node *an = kmalloc(space, GFP_ATOMIC);
330 @@ -5926,7 +5926,7 @@ ath_node_cleanup(struct ieee80211_node *
333 struct ieee80211com *ic = ni->ni_ic;
334 - struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
335 + struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
336 struct ath_node *an = ATH_NODE(ni);
339 @@ -5984,7 +5984,7 @@ ath_node_free_debug(struct ieee80211_nod
340 ath_node_free(struct ieee80211_node *ni)
343 - struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
344 + struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
346 #ifdef IEEE80211_DEBUG_REFCNT
347 sc->sc_node_free_debug(ni, func, line);
348 @@ -6032,7 +6032,7 @@ ath_node_move_data(const struct ieee8021
350 struct ath_txq *txq = NULL;
351 struct ieee80211com *ic = ni->ni_ic;
352 - struct ath_softc *sc = ic->ic_dev->priv;
353 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
354 struct ath_buf *bf, *prev, *bf_tmp, *bf_tmp1;
355 struct ath_hal *ah = sc->sc_ah;
356 struct sk_buff *skb = NULL;
357 @@ -6552,7 +6552,7 @@ static void
358 ath_capture(struct net_device *dev, const struct ath_buf *bf,
359 struct sk_buff *skb, u_int64_t tsf, unsigned int tx)
361 - struct ath_softc *sc = dev->priv;
362 + struct ath_softc *sc = netdev_priv(dev);
363 struct ieee80211com *ic = &sc->sc_ic;
364 struct sk_buff *tskb = NULL;
366 @@ -6612,7 +6612,7 @@ static void
367 ath_recv_mgmt(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null,
368 struct sk_buff *skb, int subtype, int rssi, u_int64_t rtsf)
370 - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
371 + struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
373 struct ieee80211_frame *wh = (struct ieee80211_frame *)skb->data;
375 @@ -6779,7 +6779,7 @@ ath_rx_poll(struct net_device *dev, int
376 struct net_device *dev = sc->sc_dev;
377 int rx_limit = budget;
379 - struct ath_softc *sc = dev->priv;
380 + struct ath_softc *sc = netdev_priv(dev);
381 int rx_limit = min(dev->quota, *budget);
384 @@ -7301,7 +7301,7 @@ static void ath_grppoll_start(struct iee
385 struct sk_buff *skb = NULL;
386 struct ath_buf *bf, *head = NULL;
387 struct ieee80211com *ic = vap->iv_ic;
388 - struct ath_softc *sc = ic->ic_dev->priv;
389 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
390 struct ath_hal *ah = sc->sc_ah;
392 unsigned int ctsrate = 0, ctsduration = 0;
393 @@ -7519,7 +7519,7 @@ static void ath_grppoll_start(struct iee
394 static void ath_grppoll_stop(struct ieee80211vap *vap)
396 struct ieee80211com *ic = vap->iv_ic;
397 - struct ath_softc *sc = ic->ic_dev->priv;
398 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
399 struct ath_hal *ah = sc->sc_ah;
400 struct ath_txq *txq = &sc->sc_grpplq;
402 @@ -7731,7 +7731,7 @@ ath_txq_update(struct ath_softc *sc, str
404 ath_wme_update(struct ieee80211com *ic)
406 - struct ath_softc *sc = ic->ic_dev->priv;
407 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
410 ath_txq_update(sc, sc->sc_uapsdq, WME_AC_VO);
411 @@ -7750,7 +7750,7 @@ ath_uapsd_flush(struct ieee80211_node *n
413 struct ath_node *an = ATH_NODE(ni);
415 - struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
416 + struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
419 ATH_NODE_UAPSD_LOCK_IRQ(an);
420 @@ -7941,7 +7941,7 @@ ath_tx_start(struct net_device *dev, str
421 struct ath_buf *bf, struct sk_buff *skb, int nextfraglen)
423 #define MIN(a,b) ((a) < (b) ? (a) : (b))
424 - struct ath_softc *sc = dev->priv;
425 + struct ath_softc *sc = netdev_priv(dev);
426 struct ieee80211com *ic = ni->ni_ic;
427 struct ieee80211vap *vap = ni->ni_vap;
428 struct ath_hal *ah = sc->sc_ah;
429 @@ -8850,7 +8850,7 @@ static void
430 ath_tx_tasklet_q0(TQUEUE_ARG data)
432 struct net_device *dev = (struct net_device *)data;
433 - struct ath_softc *sc = dev->priv;
434 + struct ath_softc *sc = netdev_priv(dev);
438 @@ -8881,7 +8881,7 @@ static void
439 ath_tx_tasklet_q0123(TQUEUE_ARG data)
441 struct net_device *dev = (struct net_device *)data;
442 - struct ath_softc *sc = dev->priv;
443 + struct ath_softc *sc = netdev_priv(dev);
447 @@ -8926,7 +8926,7 @@ static void
448 ath_tx_tasklet(TQUEUE_ARG data)
450 struct net_device *dev = (struct net_device *)data;
451 - struct ath_softc *sc = dev->priv;
452 + struct ath_softc *sc = netdev_priv(dev);
456 @@ -8954,7 +8954,7 @@ process_tx_again:
458 ath_tx_timeout(struct net_device *dev)
460 - struct ath_softc *sc = dev->priv;
461 + struct ath_softc *sc = netdev_priv(dev);
463 if (ath_chan_unavail(sc))
465 @@ -9362,7 +9362,7 @@ static void
466 ath_calibrate(unsigned long arg)
468 struct net_device *dev = (struct net_device *)arg;
469 - struct ath_softc *sc = dev->priv;
470 + struct ath_softc *sc = netdev_priv(dev);
471 struct ath_hal *ah = sc->sc_ah;
472 struct ieee80211com *ic = &sc->sc_ic;
473 /* u_int32_t nchans; */
474 @@ -9437,7 +9437,7 @@ static void
475 ath_scan_start(struct ieee80211com *ic)
477 struct net_device *dev = ic->ic_dev;
478 - struct ath_softc *sc = dev->priv;
479 + struct ath_softc *sc = netdev_priv(dev);
480 struct ath_hal *ah = sc->sc_ah;
483 @@ -9457,7 +9457,7 @@ static void
484 ath_scan_end(struct ieee80211com *ic)
486 struct net_device *dev = ic->ic_dev;
487 - struct ath_softc *sc = dev->priv;
488 + struct ath_softc *sc = netdev_priv(dev);
489 struct ath_hal *ah = sc->sc_ah;
492 @@ -9475,7 +9475,7 @@ static void
493 ath_set_channel(struct ieee80211com *ic)
495 struct net_device *dev = ic->ic_dev;
496 - struct ath_softc *sc = dev->priv;
497 + struct ath_softc *sc = netdev_priv(dev);
499 (void) ath_chan_set(sc, ic->ic_curchan);
500 ic->ic_channoise = ath_hal_get_channel_noise(sc->sc_ah, &(sc->sc_curchan));
501 @@ -9492,7 +9492,7 @@ ath_set_channel(struct ieee80211com *ic)
503 ath_set_coverageclass(struct ieee80211com *ic)
505 - struct ath_softc *sc = ic->ic_dev->priv;
506 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
508 sc->sc_coverage = ic->ic_coverageclass * 3;
510 @@ -9503,7 +9503,7 @@ ath_set_coverageclass(struct ieee80211co
512 ath_mhz2ieee(struct ieee80211com *ic, u_int freq, u_int flags)
514 - struct ath_softc *sc = ic->ic_dev->priv;
515 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
517 return (ath_hal_mhz2ieee(sc->sc_ah, freq, flags));
519 @@ -9518,7 +9518,7 @@ ath_newstate(struct ieee80211vap *vap, e
520 struct ath_vap *avp = ATH_VAP(vap);
521 struct ieee80211com *ic = vap->iv_ic;
522 struct net_device *dev = ic->ic_dev;
523 - struct ath_softc *sc = dev->priv;
524 + struct ath_softc *sc = netdev_priv(dev);
525 struct ath_hal *ah = sc->sc_ah;
526 struct ieee80211_node *ni, *wds_ni;
528 @@ -9958,7 +9958,7 @@ ath_setup_comp(struct ieee80211_node *ni
530 #define IEEE80211_KEY_XR (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV)
531 struct ieee80211vap *vap = ni->ni_vap;
532 - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
533 + struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
534 struct ath_node *an = ATH_NODE(ni);
535 ieee80211_keyix_t keyix;
537 @@ -10012,7 +10012,7 @@ static void
538 ath_setup_stationkey(struct ieee80211_node *ni)
540 struct ieee80211vap *vap = ni->ni_vap;
541 - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
542 + struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
543 ieee80211_keyix_t keyix;
545 keyix = ath_key_alloc(vap, &ni->ni_ucastkey);
546 @@ -10173,7 +10173,7 @@ ath_newassoc(struct ieee80211_node *ni,
548 struct ieee80211com *ic = ni->ni_ic;
549 struct ieee80211vap *vap = ni->ni_vap;
550 - struct ath_softc *sc = ic->ic_dev->priv;
551 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
553 sc->sc_rc->ops->newassoc(sc, ATH_NODE(ni), isnew);
554 ath_wprobe_node_join(ni->ni_vap, ni);
555 @@ -10204,7 +10204,7 @@ ath_newassoc(struct ieee80211_node *ni,
557 ath_getchannels(struct net_device *dev)
559 - struct ath_softc *sc = dev->priv;
560 + struct ath_softc *sc = netdev_priv(dev);
561 struct ieee80211com *ic = &sc->sc_ic;
562 struct ath_hal *ah = sc->sc_ah;
564 @@ -10479,7 +10479,7 @@ ath_update_txpow(struct ath_softc *sc)
566 ath_xr_rate_setup(struct net_device *dev)
568 - struct ath_softc *sc = dev->priv;
569 + struct ath_softc *sc = netdev_priv(dev);
570 struct ath_hal *ah = sc->sc_ah;
571 struct ieee80211com *ic = &sc->sc_ic;
572 const HAL_RATE_TABLE *rt;
573 @@ -10510,7 +10510,7 @@ ath_xr_rate_setup(struct net_device *dev
575 ath_rate_setup(struct net_device *dev, u_int mode)
577 - struct ath_softc *sc = dev->priv;
578 + struct ath_softc *sc = netdev_priv(dev);
579 struct ath_hal *ah = sc->sc_ah;
580 struct ieee80211com *ic = &sc->sc_ic;
581 const HAL_RATE_TABLE *rt;
582 @@ -10757,7 +10757,7 @@ ath_printtxbuf(const struct ath_buf *bf,
584 const struct ath_tx_status *ts = &bf->bf_dsstatus.ds_txstat;
585 const struct ath_desc *ds = bf->bf_desc;
586 - struct ath_softc *sc = bf->bf_node->ni_ic->ic_dev->priv;
587 + struct ath_softc *sc = netdev_priv(bf->bf_node->ni_ic->ic_dev);
588 u_int8_t status = done ? ts->ts_status : 0;
590 DPRINTF(sc, ATH_DEBUG_ANY,
591 @@ -10784,7 +10784,7 @@ ath_printtxbuf(const struct ath_buf *bf,
592 static struct net_device_stats *
593 ath_getstats(struct net_device *dev)
595 - struct ath_softc *sc = dev->priv;
596 + struct ath_softc *sc = netdev_priv(dev);
597 struct net_device_stats *stats = &sc->sc_devstats;
599 /* update according to private statistics */
600 @@ -10807,7 +10807,7 @@ ath_getstats(struct net_device *dev)
602 ath_set_mac_address(struct net_device *dev, void *addr)
604 - struct ath_softc *sc = dev->priv;
605 + struct ath_softc *sc = netdev_priv(dev);
606 struct ieee80211com *ic = &sc->sc_ic;
607 struct ath_hal *ah = sc->sc_ah;
608 struct sockaddr *mac = addr;
609 @@ -10836,7 +10836,7 @@ ath_set_mac_address(struct net_device *d
611 ath_change_mtu(struct net_device *dev, int mtu)
613 - struct ath_softc *sc = dev->priv;
614 + struct ath_softc *sc = netdev_priv(dev);
617 if (!(ATH_MIN_MTU < mtu && mtu <= ATH_MAX_MTU)) {
618 @@ -10923,7 +10923,7 @@ bad:
620 ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
622 - struct ath_softc *sc = dev->priv;
623 + struct ath_softc *sc = netdev_priv(dev);
624 struct ieee80211com *ic = &sc->sc_ic;
627 @@ -11804,7 +11804,7 @@ static void
628 ath_announce(struct net_device *dev)
630 #define HAL_MODE_DUALBAND (HAL_MODE_11A|HAL_MODE_11B)
631 - struct ath_softc *sc = dev->priv;
632 + struct ath_softc *sc = netdev_priv(dev);
633 struct ath_hal *ah = sc->sc_ah;
635 static const int MLEN = 1024;
636 @@ -11991,7 +11991,7 @@ static void
637 txcont_configure_radio(struct ieee80211com *ic)
639 struct net_device *dev = ic->ic_dev;
640 - struct ath_softc *sc = dev->priv;
641 + struct ath_softc *sc = netdev_priv(dev);
642 struct ath_hal *ah = sc->sc_ah;
643 struct ieee80211_wme_state *wme = &ic->ic_wme;
644 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
645 @@ -12265,7 +12265,7 @@ static void
646 txcont_queue_packet(struct ieee80211com *ic, struct ath_txq* txq)
648 struct net_device *dev = ic->ic_dev;
649 - struct ath_softc *sc = dev->priv;
650 + struct ath_softc *sc = netdev_priv(dev);
651 struct ath_hal *ah = sc->sc_ah;
652 struct ath_buf *bf = NULL;
653 struct sk_buff *skb = NULL;
654 @@ -12398,7 +12398,7 @@ static void
655 txcont_on(struct ieee80211com *ic)
657 struct net_device *dev = ic->ic_dev;
658 - struct ath_softc *sc = dev->priv;
659 + struct ath_softc *sc = netdev_priv(dev);
661 if (IFF_RUNNING != (ic->ic_dev->flags & IFF_RUNNING)) {
662 EPRINTF(sc, "Cannot enable txcont when"
663 @@ -12419,7 +12419,7 @@ static void
664 txcont_off(struct ieee80211com *ic)
666 struct net_device *dev = ic->ic_dev;
667 - struct ath_softc *sc = dev->priv;
668 + struct ath_softc *sc = netdev_priv(dev);
670 if (TAILQ_FIRST(&ic->ic_vaps)->iv_opmode != IEEE80211_M_WDS)
672 @@ -12433,7 +12433,7 @@ static int
673 ath_get_dfs_testmode(struct ieee80211com *ic)
675 struct net_device *dev = ic->ic_dev;
676 - struct ath_softc *sc = dev->priv;
677 + struct ath_softc *sc = netdev_priv(dev);
678 return sc->sc_dfs_testmode;
681 @@ -12460,7 +12460,7 @@ static void
682 ath_set_dfs_testmode(struct ieee80211com *ic, int value)
684 struct net_device *dev = ic->ic_dev;
685 - struct ath_softc *sc = dev->priv;
686 + struct ath_softc *sc = netdev_priv(dev);
687 sc->sc_dfs_testmode = !!value;
690 @@ -12470,7 +12470,7 @@ static int
691 ath_get_txcont(struct ieee80211com *ic)
693 struct net_device *dev = ic->ic_dev;
694 - struct ath_softc *sc = dev->priv;
695 + struct ath_softc *sc = netdev_priv(dev);
696 return sc->sc_txcont;
699 @@ -12488,7 +12488,7 @@ static void
700 ath_set_txcont_power(struct ieee80211com *ic, unsigned int txpower)
702 struct net_device *dev = ic->ic_dev;
703 - struct ath_softc *sc = dev->priv;
704 + struct ath_softc *sc = netdev_priv(dev);
705 int new_txcont_power = txpower > IEEE80211_TXPOWER_MAX ?
706 IEEE80211_TXPOWER_MAX : txpower;
707 if (sc->sc_txcont_power != new_txcont_power) {
708 @@ -12506,7 +12506,7 @@ static int
709 ath_get_txcont_power(struct ieee80211com *ic)
711 struct net_device *dev = ic->ic_dev;
712 - struct ath_softc *sc = dev->priv;
713 + struct ath_softc *sc = netdev_priv(dev);
714 /* VERY conservative default */
715 return sc->sc_txcont_power ? sc->sc_txcont_power : 0;
717 @@ -12516,7 +12516,7 @@ ath_get_txcont_power(struct ieee80211com
718 ath_set_txcont_rate(struct ieee80211com *ic, unsigned int new_rate)
720 struct net_device *dev = ic->ic_dev;
721 - struct ath_softc *sc = dev->priv;
722 + struct ath_softc *sc = netdev_priv(dev);
723 if (sc->sc_txcont_rate != new_rate) {
724 /* NOTE: This value is sanity checked and dropped down to
725 * closest rate in txcont_on. */
726 @@ -12533,7 +12533,7 @@ ath_set_txcont_rate(struct ieee80211com
727 ath_get_txcont_rate(struct ieee80211com *ic)
729 struct net_device *dev = ic->ic_dev;
730 - struct ath_softc *sc = dev->priv;
731 + struct ath_softc *sc = netdev_priv(dev);
732 return sc->sc_txcont_rate ? sc->sc_txcont_rate : 0;
735 @@ -12543,7 +12543,7 @@ static void
736 ath_set_dfs_cac_time(struct ieee80211com *ic, unsigned int time_s)
738 struct net_device *dev = ic->ic_dev;
739 - struct ath_softc *sc = dev->priv;
740 + struct ath_softc *sc = netdev_priv(dev);
741 sc->sc_dfs_cac_period = time_s;
744 @@ -12553,7 +12553,7 @@ static unsigned int
745 ath_get_dfs_cac_time(struct ieee80211com *ic)
747 struct net_device *dev = ic->ic_dev;
748 - struct ath_softc *sc = dev->priv;
749 + struct ath_softc *sc = netdev_priv(dev);
750 return sc->sc_dfs_cac_period;
753 @@ -12573,7 +12573,7 @@ static void
754 ath_set_dfs_excl_period(struct ieee80211com *ic, unsigned int time_s)
756 struct net_device *dev = ic->ic_dev;
757 - struct ath_softc *sc = dev->priv;
758 + struct ath_softc *sc = netdev_priv(dev);
759 sc->sc_dfs_excl_period = time_s;
762 @@ -12582,7 +12582,7 @@ static unsigned int
763 ath_get_dfs_excl_period(struct ieee80211com *ic)
765 struct net_device *dev = ic->ic_dev;
766 - struct ath_softc *sc = dev->priv;
767 + struct ath_softc *sc = netdev_priv(dev);
768 return sc->sc_dfs_excl_period;
771 @@ -12594,7 +12594,7 @@ static unsigned int
772 ath_test_radar(struct ieee80211com *ic)
774 struct net_device *dev = ic->ic_dev;
775 - struct ath_softc *sc = dev->priv;
776 + struct ath_softc *sc = netdev_priv(dev);
777 if ((ic->ic_flags & IEEE80211_F_DOTH) && (sc->sc_curchan.privFlags & CHANNEL_DFS))
778 ath_radar_detected(sc, "ath_test_radar from user space");
780 @@ -12610,7 +12610,7 @@ static unsigned int
781 ath_dump_hal_map(struct ieee80211com *ic)
783 struct net_device *dev = ic->ic_dev;
784 - struct ath_softc *sc = dev->priv;
785 + struct ath_softc *sc = netdev_priv(dev);
786 ath_hal_dump_map(sc->sc_ah);
789 @@ -12718,7 +12718,7 @@ ath_rcv_dev_event(struct notifier_block
792 struct net_device *dev = (struct net_device *)ptr;
793 - struct ath_softc *sc = (struct ath_softc *)dev->priv;
794 + struct ath_softc *sc = (struct ath_softc *)netdev_priv(dev);
796 if (!dev || !sc || dev->open != &ath_init)
798 @@ -13453,7 +13453,7 @@ static unsigned int
799 ath_read_register(struct ieee80211com *ic, unsigned int address,
802 - struct ath_softc *sc = ic->ic_dev->priv;
803 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
804 if (address >= MAX_REGISTER_ADDRESS) {
805 IPRINTF(sc, "Illegal Atheros register access "
806 "attempted: 0x%04x >= 0x%04x\n",
807 @@ -13483,7 +13483,7 @@ static unsigned int
808 ath_write_register(struct ieee80211com *ic, unsigned int address,
811 - struct ath_softc *sc = ic->ic_dev->priv;
812 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
813 if (address >= MAX_REGISTER_ADDRESS) {
814 IPRINTF(sc, "Illegal Atheros register access "
815 "attempted: 0x%04x >= 0x%04x\n",
816 @@ -13511,7 +13511,7 @@ static void
817 ath_registers_dump(struct ieee80211com *ic)
819 struct net_device *dev = ic->ic_dev;
820 - struct ath_softc *sc = dev->priv;
821 + struct ath_softc *sc = netdev_priv(dev);
822 ath_ar5212_registers_dump(sc);
824 #endif /* #ifdef ATH_REVERSE_ENGINEERING */
825 @@ -13523,7 +13523,7 @@ static void
826 ath_registers_mark(struct ieee80211com *ic)
828 struct net_device *dev = ic->ic_dev;
829 - struct ath_softc *sc = dev->priv;
830 + struct ath_softc *sc = netdev_priv(dev);
831 ath_ar5212_registers_mark(sc);
833 #endif /* #ifdef ATH_REVERSE_ENGINEERING */
834 @@ -13535,7 +13535,7 @@ static void
835 ath_registers_dump_delta(struct ieee80211com *ic)
837 struct net_device *dev = ic->ic_dev;
838 - struct ath_softc *sc = dev->priv;
839 + struct ath_softc *sc = netdev_priv(dev);
840 ath_ar5212_registers_dump_delta(sc);
842 #endif /* #ifdef ATH_REVERSE_ENGINEERING */
843 --- a/ath/if_ath_pci.c
844 +++ b/ath/if_ath_pci.c
845 @@ -199,7 +199,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
846 printk(KERN_ERR "%s: no memory for device state\n", dev_info);
850 + sc = netdev_priv(dev);
851 sc->aps_sc.sc_dev = dev;
852 sc->aps_sc.sc_iobase = mem;
854 @@ -278,7 +278,7 @@ static void
855 ath_pci_remove(struct pci_dev *pdev)
857 struct net_device *dev = pci_get_drvdata(pdev);
858 - struct ath_pci_softc *sc = dev->priv;
859 + struct ath_pci_softc *sc = netdev_priv(dev);
863 @@ -296,7 +296,7 @@ ath_pci_suspend(struct pci_dev *pdev, pm
864 struct net_device *dev = pci_get_drvdata(pdev);
867 - PCI_SAVE_STATE(pdev, ((struct ath_pci_softc *)dev->priv)->aps_pmstate);
868 + PCI_SAVE_STATE(pdev, ((struct ath_pci_softc *)netdev_priv(dev))->aps_pmstate);
869 pci_disable_device(pdev);
870 return pci_set_power_state(pdev, PCI_D3hot);
872 @@ -313,7 +313,7 @@ ath_pci_resume(struct pci_dev *pdev)
875 /* XXX - Should this return nonzero on fail? */
876 - PCI_RESTORE_STATE(pdev, ((struct ath_pci_softc *)dev->priv)->aps_pmstate);
877 + PCI_RESTORE_STATE(pdev, ((struct ath_pci_softc *)netdev_priv(dev))->aps_pmstate);
879 err = pci_enable_device(pdev);
881 --- a/ath/if_ath_radar.c
882 +++ b/ath/if_ath_radar.c
883 @@ -1533,7 +1533,7 @@ static void ath_rp_clear(struct ath_soft
884 static void ath_rp_tasklet(TQUEUE_ARG data)
886 struct net_device *dev = (struct net_device *) data;
887 - struct ath_softc *sc = dev->priv;
888 + struct ath_softc *sc = netdev_priv(dev);
890 if (sc->sc_rp_analyse != NULL)
891 sc->sc_rp_analyse(sc);
892 --- a/ath_rate/amrr/amrr.c
893 +++ b/ath_rate/amrr/amrr.c
894 @@ -298,7 +298,7 @@ ath_rate_ctl_start(struct ath_softc *sc,
896 ath_rate_cb(void *arg, struct ieee80211_node *ni)
898 - ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg);
899 + ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg);
903 @@ -308,7 +308,7 @@ static void
904 ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state)
906 struct ieee80211com *ic = vap->iv_ic;
907 - struct ath_softc *sc = ic->ic_dev->priv;
908 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
909 struct amrr_softc *asc = (struct amrr_softc *) sc->sc_rc;
910 struct ieee80211_node *ni;
912 @@ -420,7 +420,7 @@ static void
913 ath_ratectl(unsigned long data)
915 struct net_device *dev = (struct net_device *)data;
916 - struct ath_softc *sc = dev->priv;
917 + struct ath_softc *sc = netdev_priv(dev);
918 struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc;
919 struct ieee80211com *ic = &sc->sc_ic;
921 --- a/ath_rate/minstrel/minstrel.c
922 +++ b/ath_rate/minstrel/minstrel.c
923 @@ -622,7 +622,7 @@ ath_rate_ctl_reset(struct ath_softc *sc,
925 ath_rate_cb(void *arg, struct ieee80211_node *ni)
927 - ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni);
928 + ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni);
931 /* Reset the rate control state for each 802.11 state transition. */
932 @@ -636,7 +636,7 @@ ath_rate_newstate(struct ieee80211vap *v
933 /* Sync rates for associated stations and neighbors. */
934 ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL);
936 - ath_rate_newassoc(ic->ic_dev->priv, ATH_NODE(vap->iv_bss), 1);
937 + ath_rate_newassoc(netdev_priv(ic->ic_dev), ATH_NODE(vap->iv_bss), 1);
941 @@ -822,7 +822,7 @@ ath_proc_read_nodes(struct ieee80211vap
943 unsigned int this_tp, this_prob, this_eprob;
945 - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;;
946 + struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
949 IEEE80211_NODE_TABLE_LOCK_IRQ(nt);
950 --- a/ath_rate/onoe/onoe.c
951 +++ b/ath_rate/onoe/onoe.c
952 @@ -281,7 +281,7 @@ ath_rate_ctl_start(struct ath_softc *sc,
954 ath_rate_cb(void *arg, struct ieee80211_node *ni)
956 - ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg);
957 + ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg);
961 @@ -291,7 +291,7 @@ static void
962 ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state)
964 struct ieee80211com *ic = vap->iv_ic;
965 - struct ath_softc *sc = ic->ic_dev->priv;
966 + struct ath_softc *sc = netdev_priv(ic->ic_dev);
967 struct ieee80211_node *ni;
969 if (state == IEEE80211_S_INIT)
970 --- a/ath_rate/sample/sample.c
971 +++ b/ath_rate/sample/sample.c
972 @@ -803,7 +803,7 @@ ath_rate_ctl_reset(struct ath_softc *sc,
974 ath_rate_cb(void *arg, struct ieee80211_node *ni)
976 - ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni);
977 + ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni);
981 @@ -821,7 +821,7 @@ ath_rate_newstate(struct ieee80211vap *v
983 ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL);
985 - ath_rate_newassoc(ic->ic_dev->priv, ATH_NODE(vap->iv_bss), 1);
986 + ath_rate_newassoc(netdev_priv(ic->ic_dev), ATH_NODE(vap->iv_bss), 1);
990 --- a/include/compat.h
991 +++ b/include/compat.h
992 @@ -162,6 +162,10 @@ static inline int timeval_compare(struct
993 #define IRQF_SHARED SA_SHIRQ
996 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
997 +#define netdev_priv(_netdev) ((_netdev)->priv)
1000 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
1001 #define skb_end_pointer(_skb) ((_skb)->end)
1002 #define skb_tail_pointer(_skb) ((_skb)->tail)
1003 --- a/net80211/ieee80211.c
1004 +++ b/net80211/ieee80211.c
1005 @@ -457,7 +457,7 @@ ieee80211_vap_setup(struct ieee80211com
1006 #define IEEE80211_C_OPMODE \
1007 (IEEE80211_C_IBSS | IEEE80211_C_HOSTAP | IEEE80211_C_AHDEMO | \
1008 IEEE80211_C_MONITOR)
1009 - struct ieee80211vap *vap = dev->priv;
1010 + struct ieee80211vap *vap = netdev_priv(dev);
1011 struct net_device *parent = ic->ic_dev;
1014 @@ -1354,7 +1354,7 @@ media_status(enum ieee80211_opmode opmod
1016 ieee80211com_media_status(struct net_device *dev, struct ifmediareq *imr)
1018 - struct ieee80211com *ic = dev->priv; /* XXX */
1019 + struct ieee80211com *ic = netdev_priv(dev); /* XXX */
1021 imr->ifm_status = IFM_AVALID;
1022 if (!TAILQ_EMPTY(&ic->ic_vaps))
1023 @@ -1406,7 +1406,7 @@ media2mode(const struct ifmedia_entry *i
1025 ieee80211com_media_change(struct net_device *dev)
1027 - struct ieee80211com *ic = dev->priv; /* XXX */
1028 + struct ieee80211com *ic = netdev_priv(dev); /* XXX */
1029 struct ieee80211vap *vap;
1030 struct ifmedia_entry *ime = ic->ic_media.ifm_cur;
1031 enum ieee80211_phymode newphymode;
1032 @@ -1510,7 +1510,7 @@ checkrate(struct ieee80211com *ic, enum
1034 ieee80211_media_change(struct net_device *dev)
1036 - struct ieee80211vap *vap = dev->priv;
1037 + struct ieee80211vap *vap = netdev_priv(dev);
1038 struct ieee80211com *ic = vap->iv_ic;
1039 struct ifmedia_entry *ime = vap->iv_media.ifm_cur;
1040 enum ieee80211_phymode newmode;
1041 @@ -1544,7 +1544,7 @@ EXPORT_SYMBOL(ieee80211_media_change);
1043 ieee80211_media_status(struct net_device *dev, struct ifmediareq *imr)
1045 - struct ieee80211vap *vap = dev->priv;
1046 + struct ieee80211vap *vap = netdev_priv(dev);
1047 struct ieee80211com *ic = vap->iv_ic;
1048 enum ieee80211_phymode mode;
1049 struct ieee80211_rateset *rs;
1050 @@ -1750,7 +1750,7 @@ EXPORT_SYMBOL(ieee80211_media2rate);
1051 static struct net_device_stats *
1052 ieee80211_getstats(struct net_device *dev)
1054 - struct ieee80211vap *vap = dev->priv;
1055 + struct ieee80211vap *vap = netdev_priv(dev);
1056 struct net_device_stats *stats = &vap->iv_devstats;
1058 /* XXX: Total guess as to what to count where */
1059 @@ -1789,7 +1789,7 @@ ieee80211_change_mtu(struct net_device *
1061 ieee80211_set_multicast_list(struct net_device *dev)
1063 - struct ieee80211vap *vap = dev->priv;
1064 + struct ieee80211vap *vap = netdev_priv(dev);
1065 struct ieee80211com *ic = vap->iv_ic;
1066 struct net_device *parent = ic->ic_dev;
1068 --- a/net80211/ieee80211_linux.c
1069 +++ b/net80211/ieee80211_linux.c
1070 @@ -183,7 +183,7 @@ EXPORT_SYMBOL(ieee80211_getmgtframe);
1072 ieee80211_vlan_register(struct net_device *dev, struct vlan_group *grp)
1074 - struct ieee80211vap *vap = dev->priv;
1075 + struct ieee80211vap *vap = netdev_priv(dev);
1077 vap->iv_vlgrp = grp;
1079 @@ -194,7 +194,7 @@ ieee80211_vlan_register(struct net_devic
1081 ieee80211_vlan_add_vid(struct net_device *dev, unsigned short vid)
1083 - struct ieee80211vap *vap = dev->priv;
1084 + struct ieee80211vap *vap = netdev_priv(dev);
1086 if (vap->iv_vlgrp != NULL)
1087 vap->iv_bss->ni_vlan = vid;
1088 @@ -206,7 +206,7 @@ ieee80211_vlan_add_vid(struct net_device
1090 ieee80211_vlan_kill_vid(struct net_device *dev, unsigned short vid)
1092 - struct ieee80211vap *vap = dev->priv;
1093 + struct ieee80211vap *vap = netdev_priv(dev);
1095 if (vap->iv_vlgrp != NULL)
1096 vlan_group_set_device(vap->iv_vlgrp, vid, NULL);
1097 @@ -989,8 +989,8 @@ ieee80211_rcv_dev_event(struct notifier_
1100 case NETDEV_CHANGENAME:
1101 - ieee80211_virtfs_vdetach(dev->priv);
1102 - ieee80211_virtfs_latevattach(dev->priv);
1103 + ieee80211_virtfs_vdetach(netdev_priv(dev));
1104 + ieee80211_virtfs_latevattach(netdev_priv(dev));
1108 --- a/net80211/ieee80211_output.c
1109 +++ b/net80211/ieee80211_output.c
1110 @@ -201,7 +201,7 @@ ieee80211_classify(struct ieee80211_node
1112 ieee80211_hardstart(struct sk_buff *skb, struct net_device *dev)
1114 - struct ieee80211vap *vap = dev->priv;
1115 + struct ieee80211vap *vap = netdev_priv(dev);
1116 struct ieee80211com *ic = vap->iv_ic;
1117 struct net_device *parent = ic->ic_dev;
1118 struct ieee80211_node *ni = NULL;
1119 @@ -317,7 +317,7 @@ bad:
1122 void ieee80211_parent_queue_xmit(struct sk_buff *skb) {
1123 - struct ieee80211vap *vap = skb->dev->priv;
1124 + struct ieee80211vap *vap = netdev_priv(skb->dev);
1126 vap->iv_devstats.tx_packets++;
1127 vap->iv_devstats.tx_bytes += skb->len;
1128 --- a/net80211/ieee80211_proto.c
1129 +++ b/net80211/ieee80211_proto.c
1130 @@ -970,7 +970,7 @@ ieee80211_init(struct net_device *dev, i
1132 #define IS_RUNNING(_dev) \
1133 ((_dev->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP))
1134 - struct ieee80211vap *vap = dev->priv;
1135 + struct ieee80211vap *vap = netdev_priv(dev);
1136 struct ieee80211com *ic = vap->iv_ic;
1137 struct net_device *parent = ic->ic_dev;
1139 @@ -1081,7 +1081,7 @@ ieee80211_init(struct net_device *dev, i
1141 ieee80211_open(struct net_device *dev)
1143 - struct ieee80211vap *vap = dev->priv;
1144 + struct ieee80211vap *vap = netdev_priv(dev);
1146 return ieee80211_init(dev, 0);
1148 @@ -1125,7 +1125,7 @@ EXPORT_SYMBOL(ieee80211_start_running);
1150 ieee80211_stop(struct net_device *dev)
1152 - struct ieee80211vap *vap = dev->priv;
1153 + struct ieee80211vap *vap = netdev_priv(dev);
1154 struct ieee80211com *ic = vap->iv_ic;
1155 struct net_device *parent = ic->ic_dev;
1156 struct ieee80211_node *tni, *ni;
1157 --- a/net80211/ieee80211_wireless.c
1158 +++ b/net80211/ieee80211_wireless.c
1159 @@ -87,7 +87,7 @@ pre_announced_chanswitch(struct net_devi
1161 preempt_scan(struct net_device *dev, int max_grace, int max_wait)
1163 - struct ieee80211vap *vap = dev->priv;
1164 + struct ieee80211vap *vap = netdev_priv(dev);
1165 struct ieee80211com *ic = vap->iv_ic;
1166 int total_delay = 0;
1167 int canceled = 0, ready = 0;
1168 @@ -122,7 +122,7 @@ preempt_scan(struct net_device *dev, int
1169 static struct iw_statistics *
1170 ieee80211_iw_getstats(struct net_device *dev)
1172 - struct ieee80211vap *vap = dev->priv;
1173 + struct ieee80211vap *vap = netdev_priv(dev);
1174 struct iw_statistics *is = &vap->iv_iwstats;
1175 struct ieee80211com *ic = vap->iv_ic;
1177 @@ -146,7 +146,7 @@ static int
1178 ieee80211_ioctl_giwname(struct net_device *dev, struct iw_request_info *info,
1179 char *name, char *extra)
1181 - struct ieee80211vap *vap = dev->priv;
1182 + struct ieee80211vap *vap = netdev_priv(dev);
1183 struct ieee80211_channel *c = vap->iv_ic->ic_curchan;
1185 if (IEEE80211_IS_CHAN_108G(c))
1186 @@ -198,7 +198,7 @@ static int
1187 ieee80211_ioctl_siwencode(struct net_device *dev,
1188 struct iw_request_info *info, struct iw_point *erq, char *keybuf)
1190 - struct ieee80211vap *vap = dev->priv;
1191 + struct ieee80211vap *vap = netdev_priv(dev);
1194 ieee80211_keyix_t kix;
1195 @@ -306,7 +306,7 @@ static int
1196 ieee80211_ioctl_giwencode(struct net_device *dev, struct iw_request_info *info,
1197 struct iw_point *erq, char *key)
1199 - struct ieee80211vap *vap = dev->priv;
1200 + struct ieee80211vap *vap = netdev_priv(dev);
1201 struct ieee80211_key *k;
1203 ieee80211_keyix_t kix;
1204 @@ -351,7 +351,7 @@ ieee80211_ioctl_siwrate(struct net_devic
1205 IFM_IEEE80211_11A | IFM_IEEE80211_TURBO,
1206 IFM_IEEE80211_11G | IFM_IEEE80211_TURBO,
1208 - struct ieee80211vap *vap = dev->priv;
1209 + struct ieee80211vap *vap = netdev_priv(dev);
1210 struct ieee80211com *ic = vap->iv_ic;
1213 @@ -386,7 +386,7 @@ static int
1214 ieee80211_ioctl_giwrate(struct net_device *dev, struct iw_request_info *info,
1215 struct iw_param *rrq, char *extra)
1217 - struct ieee80211vap *vap = dev->priv;
1218 + struct ieee80211vap *vap = netdev_priv(dev);
1219 struct ifmediareq imr;
1222 @@ -424,7 +424,7 @@ static int
1223 ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info,
1224 struct iw_param *rts, char *extra)
1226 - struct ieee80211vap *vap = dev->priv;
1227 + struct ieee80211vap *vap = netdev_priv(dev);
1228 struct ieee80211com *ic = vap->iv_ic;
1231 @@ -447,7 +447,7 @@ static int
1232 ieee80211_ioctl_giwrts(struct net_device *dev, struct iw_request_info *info,
1233 struct iw_param *rts, char *extra)
1235 - struct ieee80211vap *vap = dev->priv;
1236 + struct ieee80211vap *vap = netdev_priv(dev);
1238 rts->value = vap->iv_rtsthreshold;
1239 rts->disabled = (rts->value == IEEE80211_RTS_MAX);
1240 @@ -460,7 +460,7 @@ static int
1241 ieee80211_ioctl_siwfrag(struct net_device *dev, struct iw_request_info *info,
1242 struct iw_param *rts, char *extra)
1244 - struct ieee80211vap *vap = dev->priv;
1245 + struct ieee80211vap *vap = netdev_priv(dev);
1246 struct ieee80211com *ic = vap->iv_ic;
1249 @@ -483,7 +483,7 @@ static int
1250 ieee80211_ioctl_giwfrag(struct net_device *dev, struct iw_request_info *info,
1251 struct iw_param *rts, char *extra)
1253 - struct ieee80211vap *vap = dev->priv;
1254 + struct ieee80211vap *vap = netdev_priv(dev);
1256 rts->value = vap->iv_fragthreshold;
1257 rts->disabled = (rts->value == 2346);
1258 @@ -496,7 +496,7 @@ static int
1259 ieee80211_ioctl_siwap(struct net_device *dev, struct iw_request_info *info,
1260 struct sockaddr *ap_addr, char *extra)
1262 - struct ieee80211vap *vap = dev->priv;
1263 + struct ieee80211vap *vap = netdev_priv(dev);
1265 /* NB: should not be set when in AP mode */
1266 if (vap->iv_opmode == IEEE80211_M_HOSTAP)
1267 @@ -532,7 +532,7 @@ static int
1268 ieee80211_ioctl_giwap(struct net_device *dev, struct iw_request_info *info,
1269 struct sockaddr *ap_addr, char *extra)
1271 - struct ieee80211vap *vap = dev->priv;
1272 + struct ieee80211vap *vap = netdev_priv(dev);
1274 if (vap->iv_flags & IEEE80211_F_DESBSSID)
1275 IEEE80211_ADDR_COPY(&ap_addr->sa_data, vap->iv_des_bssid);
1276 @@ -553,7 +553,7 @@ static int
1277 ieee80211_ioctl_siwnickn(struct net_device *dev, struct iw_request_info *info,
1278 struct iw_point *data, char *nickname)
1280 - struct ieee80211vap *vap = dev->priv;
1281 + struct ieee80211vap *vap = netdev_priv(dev);
1283 if (data->length > IEEE80211_NWID_LEN)
1285 @@ -569,7 +569,7 @@ static int
1286 ieee80211_ioctl_giwnickn(struct net_device *dev, struct iw_request_info *info,
1287 struct iw_point *data, char *nickname)
1289 - struct ieee80211vap *vap = dev->priv;
1290 + struct ieee80211vap *vap = netdev_priv(dev);
1292 if (data->length > vap->iv_nicknamelen + 1)
1293 data->length = vap->iv_nicknamelen + 1;
1294 @@ -678,7 +678,7 @@ static int
1295 ieee80211_ioctl_siwfreq(struct net_device *dev, struct iw_request_info *info,
1296 struct iw_freq *freq, char *extra)
1298 - struct ieee80211vap *vap = dev->priv;
1299 + struct ieee80211vap *vap = netdev_priv(dev);
1300 struct ieee80211com *ic = vap->iv_ic;
1301 struct ieee80211_channel *c, *c2;
1303 @@ -767,7 +767,7 @@ static int
1304 ieee80211_ioctl_giwfreq(struct net_device *dev, struct iw_request_info *info,
1305 struct iw_freq *freq, char *extra)
1307 - struct ieee80211vap *vap = dev->priv;
1308 + struct ieee80211vap *vap = netdev_priv(dev);
1309 struct ieee80211com *ic = vap->iv_ic;
1311 if (vap->iv_state == IEEE80211_S_RUN &&
1312 @@ -808,7 +808,7 @@ static int
1313 ieee80211_ioctl_siwessid(struct net_device *dev, struct iw_request_info *info,
1314 struct iw_point *data, char *ssid)
1316 - struct ieee80211vap *vap = dev->priv;
1317 + struct ieee80211vap *vap = netdev_priv(dev);
1319 if (vap->iv_opmode == IEEE80211_M_WDS)
1321 @@ -853,7 +853,7 @@ static int
1322 ieee80211_ioctl_giwessid(struct net_device *dev, struct iw_request_info *info,
1323 struct iw_point *data, char *essid)
1325 - struct ieee80211vap *vap = dev->priv;
1326 + struct ieee80211vap *vap = netdev_priv(dev);
1328 if (vap->iv_opmode == IEEE80211_M_WDS)
1330 @@ -884,7 +884,7 @@ static int
1331 ieee80211_ioctl_giwrange(struct net_device *dev, struct iw_request_info *info,
1332 struct iw_point *data, char *extra)
1334 - struct ieee80211vap *vap = dev->priv;
1335 + struct ieee80211vap *vap = netdev_priv(dev);
1336 struct ieee80211com *ic = vap->iv_ic;
1337 struct ieee80211_node *ni = vap->iv_bss;
1338 struct iw_range *range = (struct iw_range *) extra;
1339 @@ -1034,7 +1034,7 @@ ieee80211_ioctl_setspy(struct net_device
1340 struct iw_point *data, char *extra)
1342 /* save the list of node addresses */
1343 - struct ieee80211vap *vap = dev->priv;
1344 + struct ieee80211vap *vap = netdev_priv(dev);
1345 struct sockaddr address[IW_MAX_SPY];
1346 unsigned int number = data->length;
1348 @@ -1072,7 +1072,7 @@ ieee80211_ioctl_getspy(struct net_device
1349 * locate nodes by mac (ieee80211_find_node()),
1350 * copy out rssi, set updated flag appropriately
1352 - struct ieee80211vap *vap = dev->priv;
1353 + struct ieee80211vap *vap = netdev_priv(dev);
1354 struct ieee80211_node_table *nt = &vap->iv_ic->ic_sta;
1355 struct ieee80211_node *ni;
1356 struct ieee80211com *ic = vap->iv_ic;
1357 @@ -1120,7 +1120,7 @@ static int
1358 ieee80211_ioctl_setthrspy(struct net_device *dev, struct iw_request_info *info,
1359 struct iw_point *data, char *extra)
1361 - struct ieee80211vap *vap = dev->priv;
1362 + struct ieee80211vap *vap = netdev_priv(dev);
1363 struct iw_thrspy threshold;
1365 if (data->length != 1)
1366 @@ -1157,7 +1157,7 @@ static int
1367 ieee80211_ioctl_getthrspy(struct net_device *dev, struct iw_request_info *info,
1368 struct iw_point *data, char *extra)
1370 - struct ieee80211vap *vap = dev->priv;
1371 + struct ieee80211vap *vap = netdev_priv(dev);
1372 struct ieee80211com *ic = vap->iv_ic;
1373 struct iw_thrspy *threshold;
1375 @@ -1178,7 +1178,7 @@ static int
1376 ieee80211_ioctl_siwmode(struct net_device *dev, struct iw_request_info *info,
1377 __u32 *mode, char *extra)
1379 - struct ieee80211vap *vap = dev->priv;
1380 + struct ieee80211vap *vap = netdev_priv(dev);
1381 struct ifmediareq imr;
1384 @@ -1203,7 +1203,7 @@ static int
1385 ieee80211_ioctl_giwmode(struct net_device *dev, struct iw_request_info *info,
1386 __u32 *mode, char *extra)
1388 - struct ieee80211vap *vap = dev->priv;
1389 + struct ieee80211vap *vap = netdev_priv(dev);
1390 struct ifmediareq imr;
1392 memset(&imr, 0, sizeof(imr));
1393 @@ -1226,7 +1226,7 @@ static int
1394 ieee80211_ioctl_siwpower(struct net_device *dev, struct iw_request_info *info,
1395 struct iw_param *wrq, char *extra)
1397 - struct ieee80211vap *vap = dev->priv;
1398 + struct ieee80211vap *vap = netdev_priv(dev);
1399 struct ieee80211com *ic = vap->iv_ic;
1401 /* XXX: These values, flags, and caps do not seem to be used elsewhere
1402 @@ -1265,7 +1265,7 @@ static int
1403 ieee80211_ioctl_giwpower(struct net_device *dev, struct iw_request_info *info,
1404 struct iw_param *rrq, char *extra)
1406 - struct ieee80211vap *vap = dev->priv;
1407 + struct ieee80211vap *vap = netdev_priv(dev);
1408 struct ieee80211com *ic = vap->iv_ic;
1410 rrq->disabled = (ic->ic_flags & IEEE80211_F_PMGTON) == 0;
1411 @@ -1289,7 +1289,7 @@ static int
1412 ieee80211_ioctl_siwretry(struct net_device *dev, struct iw_request_info *info,
1413 struct iw_param *rrq, char *extra)
1415 - struct ieee80211vap *vap = dev->priv;
1416 + struct ieee80211vap *vap = netdev_priv(dev);
1417 struct ieee80211com *ic = vap->iv_ic;
1419 if (rrq->disabled) {
1420 @@ -1321,7 +1321,7 @@ static int
1421 ieee80211_ioctl_giwretry(struct net_device *dev, struct iw_request_info *info,
1422 struct iw_param *rrq, char *extra)
1424 - struct ieee80211vap *vap = dev->priv;
1425 + struct ieee80211vap *vap = netdev_priv(dev);
1427 rrq->disabled = (vap->iv_flags & IEEE80211_F_SWRETRY) == 0;
1428 if (!rrq->disabled) {
1429 @@ -1352,7 +1352,7 @@ static int
1430 ieee80211_ioctl_siwtxpow(struct net_device *dev, struct iw_request_info *info,
1431 struct iw_param *rrq, char *extra)
1433 - struct ieee80211vap *vap = dev->priv;
1434 + struct ieee80211vap *vap = netdev_priv(dev);
1435 struct ieee80211com *ic = vap->iv_ic;
1436 int fixed, disabled;
1438 @@ -1389,7 +1389,7 @@ ieee80211_get_txcont(struct net_device *
1439 struct iw_request_info *info, void *w, char *extra)
1441 int *params = (int*) extra;
1442 - struct ieee80211vap *vap = dev->priv;
1443 + struct ieee80211vap *vap = netdev_priv(dev);
1444 struct ieee80211com *ic = vap->iv_ic;
1445 params[0] = ic->ic_get_txcont(ic);
1447 @@ -1400,7 +1400,7 @@ ieee80211_get_dfs_cac_time(struct net_de
1448 struct iw_request_info *info, void *w, char *extra)
1450 int *params = (int*) extra;
1451 - struct ieee80211vap *vap = dev->priv;
1452 + struct ieee80211vap *vap = netdev_priv(dev);
1453 struct ieee80211com *ic = vap->iv_ic;
1454 params[0] = ic->ic_get_dfs_cac_time(ic);
1456 @@ -1411,7 +1411,7 @@ ieee80211_get_dfs_excl_period(struct net
1457 struct iw_request_info *info, void *w, char *extra)
1459 int *params = (int*) extra;
1460 - struct ieee80211vap *vap = dev->priv;
1461 + struct ieee80211vap *vap = netdev_priv(dev);
1462 struct ieee80211com *ic = vap->iv_ic;
1463 params[0] = ic->ic_get_dfs_excl_period(ic);
1465 @@ -1421,7 +1421,7 @@ ieee80211_set_dfs_cac_time(struct net_de
1466 struct iw_request_info *info, void *w, char *extra)
1468 int *params = (int*) extra;
1469 - struct ieee80211vap *vap = dev->priv;
1470 + struct ieee80211vap *vap = netdev_priv(dev);
1471 struct ieee80211com *ic = vap->iv_ic;
1472 ic->ic_set_dfs_cac_time(ic, params[1]);
1474 @@ -1431,7 +1431,7 @@ ieee80211_set_dfs_excl_period (struct n
1475 struct iw_request_info *info, void *w, char *extra)
1477 int *params = (int*) extra;
1478 - struct ieee80211vap *vap = dev->priv;
1479 + struct ieee80211vap *vap = netdev_priv(dev);
1480 struct ieee80211com *ic = vap->iv_ic;
1481 ic->ic_set_dfs_excl_period(ic, params[1]);
1483 @@ -1442,7 +1442,7 @@ ieee80211_get_dfs_testmode(struct net_de
1484 struct iw_request_info *info, void *w, char *extra)
1486 int *params = (int*) extra;
1487 - struct ieee80211vap *vap = dev->priv;
1488 + struct ieee80211vap *vap = netdev_priv(dev);
1489 struct ieee80211com *ic = vap->iv_ic;
1490 params[0] = ic->ic_get_dfs_testmode(ic);
1492 @@ -1453,7 +1453,7 @@ ieee80211_get_txcont_rate(struct net_dev
1493 struct iw_request_info *info, void *w, char *extra)
1495 int *params = (int*) extra;
1496 - struct ieee80211vap *vap = dev->priv;
1497 + struct ieee80211vap *vap = netdev_priv(dev);
1498 struct ieee80211com *ic = vap->iv_ic;
1499 params[0] = ic->ic_get_txcont_rate(ic);
1501 @@ -1464,7 +1464,7 @@ ieee80211_set_txcont(struct net_device *
1502 void *w, char *extra)
1504 int *params = (int*) extra;
1505 - struct ieee80211vap *vap = dev->priv;
1506 + struct ieee80211vap *vap = netdev_priv(dev);
1507 struct ieee80211com *ic = vap->iv_ic;
1508 ic->ic_set_txcont(ic, params[1]);
1510 @@ -1475,7 +1475,7 @@ ieee80211_set_dfs_testmode(struct net_de
1511 struct iw_request_info *info, void *w, char *extra)
1513 int *params = (int*) extra;
1514 - struct ieee80211vap *vap = dev->priv;
1515 + struct ieee80211vap *vap = netdev_priv(dev);
1516 struct ieee80211com *ic = vap->iv_ic;
1517 ic->ic_set_dfs_testmode(ic, params[1]);
1519 @@ -1486,7 +1486,7 @@ ieee80211_set_txcont_rate(struct net_dev
1520 struct iw_request_info *info, void *w, char *extra)
1522 int *params = (int*) extra;
1523 - struct ieee80211vap *vap = dev->priv;
1524 + struct ieee80211vap *vap = netdev_priv(dev);
1525 struct ieee80211com *ic = vap->iv_ic;
1526 ic->ic_set_txcont_rate(ic, params[1]);
1528 @@ -1497,7 +1497,7 @@ ieee80211_set_txcont_power(struct net_de
1529 struct iw_request_info *info, void *w, char *extra)
1531 int *params = (int*) extra;
1532 - struct ieee80211vap *vap = dev->priv;
1533 + struct ieee80211vap *vap = netdev_priv(dev);
1534 struct ieee80211com *ic = vap->iv_ic;
1535 ic->ic_set_txcont_power(ic, params[1]);
1537 @@ -1508,7 +1508,7 @@ ieee80211_get_txcont_power(struct net_de
1538 struct iw_request_info *info, void *w, char *extra)
1540 int *params = (int*) extra;
1541 - struct ieee80211vap *vap = dev->priv;
1542 + struct ieee80211vap *vap = netdev_priv(dev);
1543 struct ieee80211com *ic = vap->iv_ic;
1544 params[0] = ic->ic_get_txcont_power(ic);
1546 @@ -1520,7 +1520,7 @@ ieee80211_ioctl_hal_map(struct net_devic
1547 void *w, char *extra)
1549 int *params = (int*) extra;
1550 - struct ieee80211vap *vap = dev->priv;
1551 + struct ieee80211vap *vap = netdev_priv(dev);
1552 struct ieee80211com *ic = vap->iv_ic;
1553 params[0] = ic->ic_dump_hal_map(ic);
1555 @@ -1532,7 +1532,7 @@ ieee80211_ioctl_radar(struct net_device
1556 void *w, char *extra)
1558 int *params = (int*) extra;
1559 - struct ieee80211vap *vap = dev->priv;
1560 + struct ieee80211vap *vap = netdev_priv(dev);
1561 struct ieee80211com *ic = vap->iv_ic;
1562 if (!(ic->ic_flags & IEEE80211_F_DOTH))
1564 @@ -1544,7 +1544,7 @@ static int
1565 ieee80211_ioctl_giwtxpow(struct net_device *dev, struct iw_request_info *info,
1566 struct iw_param *rrq, char *extra)
1568 - struct ieee80211vap *vap = dev->priv;
1569 + struct ieee80211vap *vap = netdev_priv(dev);
1570 struct ieee80211com *ic = vap->iv_ic;
1571 unsigned int power = ic->ic_txpowlimit;
1572 struct ieee80211_channel *c;
1573 @@ -1572,7 +1572,7 @@ static int
1574 ieee80211_dump_registers(struct net_device *dev, struct iw_request_info *info, void *w, char *extra)
1576 unsigned int *params = (unsigned int*) extra;
1577 - struct ieee80211vap *vap = dev->priv;
1578 + struct ieee80211vap *vap = netdev_priv(dev);
1579 struct ieee80211com *ic = vap->iv_ic;
1580 switch (params[1]) {
1582 @@ -1595,7 +1595,7 @@ static int
1583 ieee80211_ioctl_writereg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra)
1585 unsigned int *params = (unsigned int*) extra;
1586 - struct ieee80211vap *vap = dev->priv;
1587 + struct ieee80211vap *vap = netdev_priv(dev);
1588 struct ieee80211com *ic = vap->iv_ic;
1589 return ic->ic_write_register(ic, params[0], params[1]);
1591 @@ -1606,7 +1606,7 @@ static int
1592 ieee80211_ioctl_readreg(struct net_device *dev, struct iw_request_info *info, void *w, char *extra)
1594 unsigned int *params = (unsigned int*) extra;
1595 - struct ieee80211vap *vap = dev->priv;
1596 + struct ieee80211vap *vap = netdev_priv(dev);
1597 struct ieee80211com *ic = vap->iv_ic;
1598 return ic->ic_read_register(ic, params[0], ¶ms[0]);
1600 @@ -1642,7 +1642,7 @@ static int
1601 ieee80211_ioctl_iwaplist(struct net_device *dev, struct iw_request_info *info,
1602 struct iw_point *data, char *extra)
1604 - struct ieee80211vap *vap = dev->priv;
1605 + struct ieee80211vap *vap = netdev_priv(dev);
1606 struct ieee80211com *ic = vap->iv_ic;
1607 struct waplistreq req; /* XXX off stack */
1609 @@ -1664,7 +1664,7 @@ static int
1610 ieee80211_ioctl_siwscan(struct net_device *dev, struct iw_request_info *info,
1611 struct iw_point *data, char *extra)
1613 - struct ieee80211vap *vap = dev->priv;
1614 + struct ieee80211vap *vap = netdev_priv(dev);
1617 * XXX don't permit a scan to be started unless we
1618 @@ -1988,7 +1988,7 @@ static int
1619 ieee80211_ioctl_giwscan(struct net_device *dev, struct iw_request_info *info,
1620 struct iw_point *data, char *extra)
1622 - struct ieee80211vap *vap = dev->priv;
1623 + struct ieee80211vap *vap = netdev_priv(dev);
1624 struct ieee80211com *ic = vap->iv_ic;
1625 struct iwscanreq req;
1627 @@ -2089,7 +2089,7 @@ static int
1628 ieee80211_ioctl_setmode(struct net_device *dev, struct iw_request_info *info,
1629 struct iw_point *wri, char *extra)
1631 - struct ieee80211vap *vap = dev->priv;
1632 + struct ieee80211vap *vap = netdev_priv(dev);
1633 struct ieee80211com *ic = vap->iv_ic;
1635 char s[6]; /* big enough for ``11adt'' */
1636 @@ -2213,10 +2213,10 @@ ieee80211_setathcap(struct ieee80211vap
1638 ieee80211_set_turbo(struct net_device *dev, int flag)
1640 - struct ieee80211vap *vap = dev->priv;
1641 + struct ieee80211vap *vap = netdev_priv(dev);
1642 struct ieee80211com *ic = vap->iv_ic;
1644 - struct ieee80211vap *tmpvap = dev->priv;
1645 + struct ieee80211vap *tmpvap = netdev_priv(dev);
1648 TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next)
1649 @@ -2237,7 +2237,7 @@ static int
1650 ieee80211_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
1651 void *w, char *extra)
1653 - struct ieee80211vap *vap = dev->priv;
1654 + struct ieee80211vap *vap = netdev_priv(dev);
1655 struct ieee80211com *ic = vap->iv_ic;
1656 struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn;
1657 unsigned int *i = (unsigned int *) extra;
1658 @@ -2917,7 +2917,7 @@ static int
1659 ieee80211_ioctl_getmode(struct net_device *dev, struct iw_request_info *info,
1660 struct iw_point *wri, char *extra)
1662 - struct ieee80211vap *vap = dev->priv;
1663 + struct ieee80211vap *vap = netdev_priv(dev);
1664 struct ieee80211com *ic = vap->iv_ic;
1665 struct ifmediareq imr;
1667 @@ -2955,7 +2955,7 @@ static int
1668 ieee80211_ioctl_getparam(struct net_device *dev, struct iw_request_info *info,
1669 void *w, char *extra)
1671 - struct ieee80211vap *vap = dev->priv;
1672 + struct ieee80211vap *vap = netdev_priv(dev);
1673 struct ieee80211com *ic = vap->iv_ic;
1674 struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn;
1675 unsigned int *param = (unsigned int *) extra;
1676 @@ -3300,7 +3300,7 @@ static int
1677 ieee80211_ioctl_setoptie(struct net_device *dev, struct iw_request_info *info,
1678 struct iw_point *wri, char *extra)
1680 - struct ieee80211vap *vap = dev->priv;
1681 + struct ieee80211vap *vap = netdev_priv(dev);
1685 @@ -3334,7 +3334,7 @@ static int
1686 ieee80211_ioctl_getoptie(struct net_device *dev, struct iw_request_info *info,
1687 struct iw_point *wri, char *extra)
1689 - struct ieee80211vap *vap = dev->priv;
1690 + struct ieee80211vap *vap = netdev_priv(dev);
1692 if (vap->iv_opt_ie == NULL) {
1694 @@ -3398,7 +3398,7 @@ ieee80211_ioctl_setappiebuf(struct net_d
1695 struct iw_request_info *info,
1696 struct iw_point *data, char *extra)
1698 - struct ieee80211vap *vap = dev->priv;
1699 + struct ieee80211vap *vap = netdev_priv(dev);
1700 struct ieee80211req_getset_appiebuf *iebuf =
1701 (struct ieee80211req_getset_appiebuf *)extra;
1702 enum ieee80211_opmode chk_opmode;
1703 @@ -3440,7 +3440,7 @@ static int
1704 ieee80211_ioctl_getappiebuf(struct net_device *dev, struct iw_request_info *info,
1705 struct iw_point *data, char *extra)
1707 - struct ieee80211vap *vap = dev->priv;
1708 + struct ieee80211vap *vap = netdev_priv(dev);
1709 struct ieee80211req_getset_appiebuf *iebuf =
1710 (struct ieee80211req_getset_appiebuf *)extra;
1712 @@ -3481,7 +3481,7 @@ static int
1713 ieee80211_ioctl_setfilter(struct net_device *dev, struct iw_request_info *info,
1714 void *w, char *extra)
1716 - struct ieee80211vap *vap = dev->priv;
1717 + struct ieee80211vap *vap = netdev_priv(dev);
1718 struct ieee80211req_set_filter *app_filter = (struct ieee80211req_set_filter *)extra;
1720 if ((extra == NULL) || (app_filter->app_filterype & ~IEEE80211_FILTER_TYPE_ALL))
1721 @@ -3496,7 +3496,7 @@ static int
1722 ieee80211_ioctl_setkey(struct net_device *dev, struct iw_request_info *info,
1723 void *w, char *extra)
1725 - struct ieee80211vap *vap = dev->priv;
1726 + struct ieee80211vap *vap = netdev_priv(dev);
1727 struct ieee80211com *ic = vap->iv_ic;
1728 struct ieee80211req_key *ik = (struct ieee80211req_key *)extra;
1729 struct ieee80211_node *ni;
1730 @@ -3579,7 +3579,7 @@ ieee80211_ioctl_setkey(struct net_device
1732 ieee80211_ioctl_getkey(struct net_device *dev, struct iwreq *iwr)
1734 - struct ieee80211vap *vap = dev->priv;
1735 + struct ieee80211vap *vap = netdev_priv(dev);
1736 struct ieee80211com *ic = vap->iv_ic;
1737 struct ieee80211_node *ni;
1738 struct ieee80211req_key ik;
1739 @@ -3640,7 +3640,7 @@ static int
1740 ieee80211_ioctl_delkey(struct net_device *dev, struct iw_request_info *info,
1741 void *w, char *extra)
1743 - struct ieee80211vap *vap = dev->priv;
1744 + struct ieee80211vap *vap = netdev_priv(dev);
1745 struct ieee80211com *ic = vap->iv_ic;
1746 struct ieee80211req_del_key *dk = (struct ieee80211req_del_key *)extra;
1747 ieee80211_keyix_t kix;
1748 @@ -3714,7 +3714,7 @@ static int
1749 ieee80211_ioctl_setmlme(struct net_device *dev, struct iw_request_info *info,
1750 void *w, char *extra)
1752 - struct ieee80211vap *vap = dev->priv;
1753 + struct ieee80211vap *vap = netdev_priv(dev);
1754 struct ieee80211com *ic = vap->iv_ic;
1755 struct ieee80211req_mlme *mlme = (struct ieee80211req_mlme *)extra;
1756 struct ieee80211_node *ni;
1757 @@ -3817,7 +3817,7 @@ static int
1758 ieee80211_ioctl_wdsaddmac(struct net_device *dev, struct iw_request_info *info,
1759 void *w, char *extra)
1761 - struct ieee80211vap *vap = dev->priv;
1762 + struct ieee80211vap *vap = netdev_priv(dev);
1763 struct sockaddr *sa = (struct sockaddr *)extra;
1764 struct ieee80211com *ic = vap->iv_ic;
1765 struct ieee80211vap *avp;
1766 @@ -3846,7 +3846,7 @@ static int
1767 ieee80211_ioctl_wdssetmac(struct net_device *dev, struct iw_request_info *info,
1768 void *w, char *extra)
1770 - struct ieee80211vap *vap = dev->priv;
1771 + struct ieee80211vap *vap = netdev_priv(dev);
1772 struct sockaddr *sa = (struct sockaddr *)extra;
1774 if (vap->iv_opmode != IEEE80211_M_WDS)
1775 @@ -3913,7 +3913,7 @@ ieee80211_ioctl_setscanlist(struct net_d
1776 struct iw_request_info *info,
1777 struct iw_point *data, char *extra)
1779 - struct ieee80211vap *vap = dev->priv;
1780 + struct ieee80211vap *vap = netdev_priv(dev);
1781 struct ieee80211com *ic = vap->iv_ic;
1784 @@ -3988,7 +3988,7 @@ static int
1785 ieee80211_ioctl_addmac(struct net_device *dev, struct iw_request_info *info,
1786 void *w, char *extra)
1788 - struct ieee80211vap *vap = dev->priv;
1789 + struct ieee80211vap *vap = netdev_priv(dev);
1790 struct sockaddr *sa = (struct sockaddr *)extra;
1791 const struct ieee80211_aclator *acl = vap->iv_acl;
1793 @@ -4006,7 +4006,7 @@ static int
1794 ieee80211_ioctl_delmac(struct net_device *dev, struct iw_request_info *info,
1795 void *w, char *extra)
1797 - struct ieee80211vap *vap = dev->priv;
1798 + struct ieee80211vap *vap = netdev_priv(dev);
1799 struct sockaddr *sa = (struct sockaddr *)extra;
1800 const struct ieee80211_aclator *acl = vap->iv_acl;
1802 @@ -4024,7 +4024,7 @@ static int
1803 ieee80211_ioctl_setchanlist(struct net_device *dev,
1804 struct iw_request_info *info, void *w, char *extra)
1806 - struct ieee80211vap *vap = dev->priv;
1807 + struct ieee80211vap *vap = netdev_priv(dev);
1808 struct ieee80211com *ic = vap->iv_ic;
1809 struct ieee80211req_chanlist *list =
1810 (struct ieee80211req_chanlist *)extra;
1811 @@ -4075,7 +4075,7 @@ static int
1812 ieee80211_ioctl_getchanlist(struct net_device *dev,
1813 struct iw_request_info *info, void *w, char *extra)
1815 - struct ieee80211vap *vap = dev->priv;
1816 + struct ieee80211vap *vap = netdev_priv(dev);
1817 struct ieee80211com *ic = vap->iv_ic;
1819 memcpy(extra, ic->ic_chan_active, sizeof(ic->ic_chan_active));
1820 @@ -4096,7 +4096,7 @@ static int
1821 ieee80211_ioctl_getchaninfo(struct net_device *dev,
1822 struct iw_request_info *info, void *w, char *extra)
1824 - struct ieee80211vap *vap = dev->priv;
1825 + struct ieee80211vap *vap = netdev_priv(dev);
1826 struct ieee80211com *ic = vap->iv_ic;
1827 struct ieee80211req_chaninfo *chans =
1828 (struct ieee80211req_chaninfo *)extra;
1829 @@ -4143,7 +4143,7 @@ static int
1830 ieee80211_ioctl_setwmmparams(struct net_device *dev,
1831 struct iw_request_info *info, void *w, char *extra)
1833 - struct ieee80211vap *vap = dev->priv;
1834 + struct ieee80211vap *vap = netdev_priv(dev);
1835 unsigned int *param = (unsigned int *) extra;
1836 unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
1837 unsigned int bss = param[2];
1838 @@ -4231,7 +4231,7 @@ static int
1839 ieee80211_ioctl_getwmmparams(struct net_device *dev,
1840 struct iw_request_info *info, void *w, char *extra)
1842 - struct ieee80211vap *vap = dev->priv;
1843 + struct ieee80211vap *vap = netdev_priv(dev);
1844 unsigned int *param = (unsigned int *) extra;
1845 unsigned int ac = (param[1] < WME_NUM_AC) ? param[1] : WME_AC_BE;
1846 struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme;
1847 @@ -4266,7 +4266,7 @@ ieee80211_ioctl_getwmmparams(struct net_
1849 ieee80211_ioctl_getwpaie(struct net_device *dev, struct iwreq *iwr)
1851 - struct ieee80211vap *vap = dev->priv;
1852 + struct ieee80211vap *vap = netdev_priv(dev);
1853 struct ieee80211com *ic = vap->iv_ic;
1854 struct ieee80211_node *ni;
1855 struct ieee80211req_wpaie wpaie;
1856 @@ -4300,7 +4300,7 @@ ieee80211_ioctl_getwpaie(struct net_devi
1858 ieee80211_ioctl_getstastats(struct net_device *dev, struct iwreq *iwr)
1860 - struct ieee80211vap *vap = dev->priv;
1861 + struct ieee80211vap *vap = netdev_priv(dev);
1862 struct ieee80211com *ic = vap->iv_ic;
1863 struct ieee80211_node *ni;
1864 u_int8_t macaddr[IEEE80211_ADDR_LEN];
1865 @@ -4419,7 +4419,7 @@ get_scan_result(void *arg, const struct
1867 ieee80211_ioctl_getscanresults(struct net_device *dev, struct iwreq *iwr)
1869 - struct ieee80211vap *vap = dev->priv;
1870 + struct ieee80211vap *vap = netdev_priv(dev);
1871 struct ieee80211com *ic = vap->iv_ic;
1874 @@ -4582,7 +4582,7 @@ get_sta_info(void *arg, struct ieee80211
1876 ieee80211_ioctl_getstainfo(struct net_device *dev, struct iwreq *iwr)
1878 - struct ieee80211vap *vap = dev->priv;
1879 + struct ieee80211vap *vap = netdev_priv(dev);
1880 struct ieee80211com *ic = vap->iv_ic;
1881 struct stainforeq req;
1883 @@ -4616,7 +4616,7 @@ ieee80211_ioctl_getstainfo(struct net_de
1886 pre_announced_chanswitch(struct net_device *dev, u_int32_t channel, u_int32_t tbtt) {
1887 - struct ieee80211vap *vap = dev->priv;
1888 + struct ieee80211vap *vap = netdev_priv(dev);
1889 struct ieee80211com *ic = vap->iv_ic;
1890 struct ieee80211vap *avp;
1892 @@ -4634,7 +4634,7 @@ static int
1893 ieee80211_ioctl_chanswitch(struct net_device *dev, struct iw_request_info *info,
1894 void *w, char *extra)
1896 - struct ieee80211vap *vap = dev->priv;
1897 + struct ieee80211vap *vap = netdev_priv(dev);
1898 struct ieee80211com *ic = vap->iv_ic;
1899 unsigned int *param = (unsigned int *) extra;
1901 @@ -4679,7 +4679,7 @@ static int
1902 ieee80211_ioctl_giwgenie(struct net_device *dev,
1903 struct iw_request_info *info, struct iw_point *out, char *buf)
1905 - struct ieee80211vap *vap = dev->priv;
1906 + struct ieee80211vap *vap = netdev_priv(dev);
1908 if (out->length < vap->iv_opt_ie_len)
1910 @@ -5212,7 +5212,7 @@ static int
1911 ieee80211_ioctl_giwencodeext(struct net_device *dev,
1912 struct iw_request_info *info, struct iw_point *erq, char *extra)
1914 - struct ieee80211vap *vap = dev->priv;
1915 + struct ieee80211vap *vap = netdev_priv(dev);
1916 struct iw_encode_ext *ext;
1917 struct ieee80211_key *wk;
1918 ieee80211_keyix_t kix;
1919 @@ -5272,7 +5272,7 @@ static int
1920 ieee80211_ioctl_siwencodeext(struct net_device *dev,
1921 struct iw_request_info *info, struct iw_point *erq, char *extra)
1923 - struct ieee80211vap *vap = dev->priv;
1924 + struct ieee80211vap *vap = netdev_priv(dev);
1925 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
1926 struct ieee80211req_key kr;
1927 ieee80211_keyix_t kix;
1928 @@ -5948,7 +5948,7 @@ static struct iw_handler_def ieee80211_i
1930 ieee80211_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1932 - struct ieee80211vap *vap = dev->priv;
1933 + struct ieee80211vap *vap = netdev_priv(dev);
1934 struct ieee80211com *ic = vap->iv_ic;
1935 struct ieee80211_node *ni;