Advertisement
Guest User

d4de

a guest
Aug 6th, 2009
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.93 KB | None | 0 0
  1. diff -rupN madwifi-0.9.4/ath/if_ath.c madwifi-0.9.4-patched/ath/if_ath.c
  2. --- madwifi-0.9.4/ath/if_ath.c 2008-02-13 07:13:10.000000000 +0200
  3. +++ madwifi-0.9.4-patched/ath/if_ath.c 2009-08-06 12:23:13.000000000 +0300
  4. @@ -48,6 +48,8 @@
  5. #include <linux/config.h>
  6. #endif
  7. #include <linux/version.h>
  8. +#include <linux/pci.h>
  9. +#include <linux/netdevice.h>
  10. #include <linux/module.h>
  11. #include <linux/init.h>
  12. #include <linux/skbuff.h>
  13. @@ -399,7 +401,7 @@ enum {
  14. int
  15. ath_attach(u_int16_t devid, struct net_device *dev, HAL_BUS_TAG tag)
  16. {
  17. - struct ath_softc *sc = dev->priv;
  18. + struct ath_softc *sc = netdev_priv(dev);
  19. struct ieee80211com *ic = &sc->sc_ic;
  20. struct ath_hal *ah;
  21. HAL_STATUS status;
  22. @@ -955,7 +957,7 @@ bad:
  23. int
  24. ath_detach(struct net_device *dev)
  25. {
  26. - struct ath_softc *sc = dev->priv;
  27. + struct ath_softc *sc = netdev_priv(dev);
  28. struct ath_hal *ah = sc->sc_ah;
  29.  
  30. HAL_INT tmp;
  31. @@ -1011,7 +1013,7 @@ static struct ieee80211vap *
  32. ath_vap_create(struct ieee80211com *ic, const char *name, int unit,
  33. int opmode, int flags, struct net_device *mdev)
  34. {
  35. - struct ath_softc *sc = ic->ic_dev->priv;
  36. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  37. struct ath_hal *ah = sc->sc_ah;
  38. struct net_device *dev;
  39. struct ath_vap *avp;
  40. @@ -1081,7 +1083,7 @@ ath_vap_create(struct ieee80211com *ic,
  41. return NULL;
  42. }
  43.  
  44. - avp = dev->priv;
  45. + avp = netdev_priv(dev);
  46. ieee80211_vap_setup(ic, dev, name, unit, opmode, flags);
  47. /* override with driver methods */
  48. vap = &avp->av_vap;
  49. @@ -1245,7 +1247,7 @@ static void
  50. ath_vap_delete(struct ieee80211vap *vap)
  51. {
  52. struct net_device *dev = vap->iv_ic->ic_dev;
  53. - struct ath_softc *sc = dev->priv;
  54. + struct ath_softc *sc = netdev_priv(dev);
  55. struct ath_hal *ah = sc->sc_ah;
  56. struct ath_vap *avp = ATH_VAP(vap);
  57. int decrease = 1;
  58. @@ -1347,7 +1349,7 @@ ath_vap_delete(struct ieee80211vap *vap)
  59. void
  60. ath_suspend(struct net_device *dev)
  61. {
  62. - struct ath_softc *sc = dev->priv;
  63. + struct ath_softc *sc = netdev_priv(dev);
  64.  
  65. DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags);
  66. ath_stop(dev);
  67. @@ -1356,7 +1358,7 @@ ath_suspend(struct net_device *dev)
  68. void
  69. ath_resume(struct net_device *dev)
  70. {
  71. - struct ath_softc *sc = dev->priv;
  72. + struct ath_softc *sc = netdev_priv(dev);
  73.  
  74. DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags);
  75. ath_init(dev);
  76. @@ -1649,7 +1651,7 @@ ath_intr(int irq, void *dev_id, struct p
  77. #endif
  78. {
  79. struct net_device *dev = dev_id;
  80. - struct ath_softc *sc = dev->priv;
  81. + struct ath_softc *sc = netdev_priv(dev);
  82. struct ath_hal *ah = sc->sc_ah;
  83. HAL_INT status;
  84. int needmark;
  85. @@ -1840,7 +1842,7 @@ static void
  86. ath_bmiss_tasklet(TQUEUE_ARG data)
  87. {
  88. struct net_device *dev = (struct net_device *)data;
  89. - struct ath_softc *sc = dev->priv;
  90. + struct ath_softc *sc = netdev_priv(dev);
  91.  
  92. if (time_before(jiffies, sc->sc_ic.ic_bmiss_guard)) {
  93. /* Beacon miss interrupt occured too short after last beacon
  94. @@ -1883,7 +1885,7 @@ ath_chan2flags(struct ieee80211_channel
  95. static int
  96. ath_init(struct net_device *dev)
  97. {
  98. - struct ath_softc *sc = dev->priv;
  99. + struct ath_softc *sc = netdev_priv(dev);
  100. struct ieee80211com *ic = &sc->sc_ic;
  101. struct ath_hal *ah = sc->sc_ah;
  102. HAL_STATUS status;
  103. @@ -2011,7 +2013,7 @@ done:
  104. static int
  105. ath_stop_locked(struct net_device *dev)
  106. {
  107. - struct ath_softc *sc = dev->priv;
  108. + struct ath_softc *sc = netdev_priv(dev);
  109. struct ieee80211com *ic = &sc->sc_ic;
  110. struct ath_hal *ah = sc->sc_ah;
  111.  
  112. @@ -2075,7 +2077,7 @@ ath_stop_locked(struct net_device *dev)
  113. static int
  114. ath_stop(struct net_device *dev)
  115. {
  116. - struct ath_softc *sc = dev->priv;
  117. + struct ath_softc *sc = netdev_priv(dev);
  118. int error;
  119.  
  120. ATH_LOCK(sc);
  121. @@ -2179,7 +2181,7 @@ ath_set_ack_bitrate(struct ath_softc *sc
  122. static int
  123. ath_reset(struct net_device *dev)
  124. {
  125. - struct ath_softc *sc = dev->priv;
  126. + struct ath_softc *sc = netdev_priv(dev);
  127. struct ieee80211com *ic = &sc->sc_ic;
  128. struct ath_hal *ah = sc->sc_ah;
  129. struct ieee80211_channel *c;
  130. @@ -2340,7 +2342,7 @@ dot11_to_ratecode(struct ath_softc *sc,
  131. static int
  132. ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb)
  133. {
  134. - struct ath_softc *sc = dev->priv;
  135. + struct ath_softc *sc = netdev_priv(dev);
  136. struct ath_hal *ah = sc->sc_ah;
  137. struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *) (skb->cb + sizeof(struct ieee80211_cb));
  138. const HAL_RATE_TABLE *rt;
  139. @@ -2555,7 +2557,7 @@ ath_ffstageq_flush(struct ath_softc *sc,
  140. static int
  141. ath_hardstart(struct sk_buff *skb, struct net_device *dev)
  142. {
  143. - struct ath_softc *sc = dev->priv;
  144. + struct ath_softc *sc = netdev_priv(dev);
  145. struct ieee80211_node *ni = NULL;
  146. struct ath_buf *bf = NULL;
  147. struct ieee80211_cb *cb = (struct ieee80211_cb *) skb->cb;
  148. @@ -2872,7 +2874,7 @@ static int
  149. ath_mgtstart(struct ieee80211com *ic, struct sk_buff *skb)
  150. {
  151. struct net_device *dev = ic->ic_dev;
  152. - struct ath_softc *sc = dev->priv;
  153. + struct ath_softc *sc = netdev_priv(dev);
  154. struct ieee80211_node *ni = NULL;
  155. struct ath_buf *bf = NULL;
  156. struct ieee80211_cb *cb;
  157. @@ -3234,7 +3236,7 @@ static int
  158. ath_key_alloc(struct ieee80211vap *vap, const struct ieee80211_key *k)
  159. {
  160. struct net_device *dev = vap->iv_ic->ic_dev;
  161. - struct ath_softc *sc = dev->priv;
  162. + struct ath_softc *sc = netdev_priv(dev);
  163.  
  164. /*
  165. * Group key allocation must be handled specially for
  166. @@ -3301,7 +3303,7 @@ ath_key_delete(struct ieee80211vap *vap,
  167. struct ieee80211_node *ninfo)
  168. {
  169. struct net_device *dev = vap->iv_ic->ic_dev;
  170. - struct ath_softc *sc = dev->priv;
  171. + struct ath_softc *sc = netdev_priv(dev);
  172. struct ath_hal *ah = sc->sc_ah;
  173. const struct ieee80211_cipher *cip = k->wk_cipher;
  174. struct ieee80211_node *ni;
  175. @@ -3377,7 +3379,7 @@ ath_key_set(struct ieee80211vap *vap, co
  176. const u_int8_t mac[IEEE80211_ADDR_LEN])
  177. {
  178. struct net_device *dev = vap->iv_ic->ic_dev;
  179. - struct ath_softc *sc = dev->priv;
  180. + struct ath_softc *sc = netdev_priv(dev);
  181.  
  182. return ath_keyset(sc, k, mac, vap->iv_bss);
  183. }
  184. @@ -3392,7 +3394,7 @@ static void
  185. ath_key_update_begin(struct ieee80211vap *vap)
  186. {
  187. struct net_device *dev = vap->iv_ic->ic_dev;
  188. - struct ath_softc *sc = dev->priv;
  189. + struct ath_softc *sc = netdev_priv(dev);
  190.  
  191. DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__);
  192. /*
  193. @@ -3413,7 +3415,7 @@ static void
  194. ath_key_update_end(struct ieee80211vap *vap)
  195. {
  196. struct net_device *dev = vap->iv_ic->ic_dev;
  197. - struct ath_softc *sc = dev->priv;
  198. + struct ath_softc *sc = netdev_priv(dev);
  199.  
  200. DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__);
  201. netif_start_queue(dev);
  202. @@ -3501,7 +3503,7 @@ ath_merge_mcast(struct ath_softc *sc, u_
  203. static void
  204. ath_mode_init(struct net_device *dev)
  205. {
  206. - struct ath_softc *sc = dev->priv;
  207. + struct ath_softc *sc = netdev_priv(dev);
  208. struct ath_hal *ah = sc->sc_ah;
  209. u_int32_t rfilt, mfilt[2];
  210.  
  211. @@ -3552,7 +3554,7 @@ ath_setslottime(struct ath_softc *sc)
  212. static void
  213. ath_updateslot(struct net_device *dev)
  214. {
  215. - struct ath_softc *sc = dev->priv;
  216. + struct ath_softc *sc = netdev_priv(dev);
  217. struct ieee80211com *ic = &sc->sc_ic;
  218.  
  219. /*
  220. @@ -3582,7 +3584,7 @@ ath_beacon_dturbo_config(struct ieee8021
  221. (vap->iv_bss && (vap->iv_bss->ni_ath_flags & (IEEE80211_ATHC_TURBOP )) == \
  222. (IEEE80211_ATHC_TURBOP))
  223. struct ieee80211com *ic = vap->iv_ic;
  224. - struct ath_softc *sc = ic->ic_dev->priv;
  225. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  226.  
  227. if (ic->ic_opmode == IEEE80211_M_HOSTAP && IS_CAPABLE(vap)) {
  228.  
  229. @@ -3630,7 +3632,7 @@ static void
  230. ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark,u_int8_t dtim)
  231. {
  232. struct ieee80211com *ic = vap->iv_ic;
  233. - struct ath_softc *sc = ic->ic_dev->priv;
  234. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  235. u_int32_t bss_traffic;
  236.  
  237. /* TBD: Age out CHANNEL_INTERFERENCE */
  238. @@ -3773,7 +3775,7 @@ static void
  239. ath_turbo_switch_mode(unsigned long data)
  240. {
  241. struct net_device *dev = (struct net_device *)data;
  242. - struct ath_softc *sc = dev->priv;
  243. + struct ath_softc *sc = netdev_priv(dev);
  244. struct ieee80211com *ic = &sc->sc_ic;
  245. int newflags;
  246.  
  247. @@ -4365,7 +4367,7 @@ static void
  248. ath_bstuck_tasklet(TQUEUE_ARG data)
  249. {
  250. struct net_device *dev = (struct net_device *)data;
  251. - struct ath_softc *sc = dev->priv;
  252. + struct ath_softc *sc = netdev_priv(dev);
  253. /*
  254. * XXX:if the bmisscount is cleared while the
  255. * tasklet execution is pending, the following
  256. @@ -4817,7 +4819,7 @@ ath_desc_free(struct ath_softc *sc)
  257. static struct ieee80211_node *
  258. ath_node_alloc(struct ieee80211_node_table *nt,struct ieee80211vap *vap)
  259. {
  260. - struct ath_softc *sc = nt->nt_ic->ic_dev->priv;
  261. + struct ath_softc *sc = netdev_priv(nt->nt_ic->ic_dev);
  262. const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space;
  263. struct ath_node *an;
  264.  
  265. @@ -4852,7 +4854,7 @@ static void
  266. ath_node_cleanup(struct ieee80211_node *ni)
  267. {
  268. struct ieee80211com *ic = ni->ni_ic;
  269. - struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
  270. + struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
  271. struct ath_node *an = ATH_NODE(ni);
  272. struct ath_buf *bf;
  273.  
  274. @@ -4906,7 +4908,7 @@ ath_node_cleanup(struct ieee80211_node *
  275. static void
  276. ath_node_free(struct ieee80211_node *ni)
  277. {
  278. - struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
  279. + struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
  280.  
  281. sc->sc_rc->ops->node_cleanup(sc, ATH_NODE(ni));
  282. sc->sc_node_free(ni);
  283. @@ -4949,7 +4951,7 @@ ath_node_move_data(const struct ieee8021
  284. #ifdef NOT_YET
  285. struct ath_txq *txq = NULL;
  286. struct ieee80211com *ic = ni->ni_ic;
  287. - struct ath_softc *sc = ic->ic_dev->priv;
  288. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  289. struct ath_buf *bf, *prev, *bf_tmp, *bf_tmp1;
  290. struct ath_hal *ah = sc->sc_ah;
  291. struct sk_buff *skb = NULL;
  292. @@ -5401,7 +5403,7 @@ ath_extend_tsf(struct ath_hal *ah, u_int
  293. static void
  294. ath_rx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb)
  295. {
  296. - struct ath_softc *sc = dev->priv;
  297. + struct ath_softc *sc = netdev_priv(dev);
  298. struct ieee80211com *ic = &sc->sc_ic;
  299. struct ieee80211_frame *wh = (struct ieee80211_frame *) skb->data;
  300. unsigned int headersize = ieee80211_anyhdrsize(wh);
  301. @@ -5434,7 +5436,7 @@ ath_rx_capture(struct net_device *dev, s
  302. static void
  303. ath_tx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb)
  304. {
  305. - struct ath_softc *sc = dev->priv;
  306. + struct ath_softc *sc = netdev_priv(dev);
  307. struct ieee80211com *ic = &sc->sc_ic;
  308. struct ieee80211_frame *wh;
  309. int extra = A_MAX(sizeof(struct ath_tx_radiotap_header),
  310. @@ -5499,7 +5501,7 @@ static void
  311. ath_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb,
  312. int subtype, int rssi, u_int32_t rstamp)
  313. {
  314. - struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
  315. + struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
  316. struct ieee80211vap *vap = ni->ni_vap;
  317.  
  318. /*
  319. @@ -5571,7 +5573,7 @@ ath_rx_tasklet(TQUEUE_ARG data)
  320. ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr)))
  321. struct net_device *dev = (struct net_device *)data;
  322. struct ath_buf *bf;
  323. - struct ath_softc *sc = dev->priv;
  324. + struct ath_softc *sc = netdev_priv(dev);
  325. struct ieee80211com *ic = &sc->sc_ic;
  326. struct ath_hal *ah = sc->sc_ah;
  327. struct ath_desc *ds;
  328. @@ -6010,7 +6012,7 @@ static void ath_grppoll_start(struct iee
  329. struct sk_buff *skb = NULL;
  330. struct ath_buf *bf, *head = NULL;
  331. struct ieee80211com *ic = vap->iv_ic;
  332. - struct ath_softc *sc = ic->ic_dev->priv;
  333. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  334. struct ath_hal *ah = sc->sc_ah;
  335. u_int8_t rate;
  336. int ctsrate = 0;
  337. @@ -6223,7 +6225,7 @@ static void ath_grppoll_start(struct iee
  338. static void ath_grppoll_stop(struct ieee80211vap *vap)
  339. {
  340. struct ieee80211com *ic = vap->iv_ic;
  341. - struct ath_softc *sc = ic->ic_dev->priv;
  342. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  343. struct ath_hal *ah = sc->sc_ah;
  344. struct ath_txq *txq = &sc->sc_grpplq;
  345. struct ath_buf *bf;
  346. @@ -6438,7 +6440,7 @@ ath_txq_update(struct ath_softc *sc, str
  347. static int
  348. ath_wme_update(struct ieee80211com *ic)
  349. {
  350. - struct ath_softc *sc = ic->ic_dev->priv;
  351. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  352.  
  353. if (sc->sc_uapsdq)
  354. ath_txq_update(sc, sc->sc_uapsdq, WME_AC_VO);
  355. @@ -6457,7 +6459,7 @@ ath_uapsd_flush(struct ieee80211_node *n
  356. {
  357. struct ath_node *an = ATH_NODE(ni);
  358. struct ath_buf *bf;
  359. - struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
  360. + struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev);
  361. struct ath_txq *txq;
  362.  
  363. ATH_NODE_UAPSD_LOCK_IRQ(an);
  364. @@ -6652,7 +6654,7 @@ static int
  365. ath_tx_start(struct net_device *dev, struct ieee80211_node *ni, struct ath_buf *bf, struct sk_buff *skb, int nextfraglen)
  366. {
  367. #define MIN(a,b) ((a) < (b) ? (a) : (b))
  368. - struct ath_softc *sc = dev->priv;
  369. + struct ath_softc *sc = netdev_priv(dev);
  370. struct ieee80211com *ic = ni->ni_ic;
  371. struct ieee80211vap *vap = ni->ni_vap;
  372. struct ath_hal *ah = sc->sc_ah;
  373. @@ -7492,7 +7494,7 @@ static void
  374. ath_tx_tasklet_q0(TQUEUE_ARG data)
  375. {
  376. struct net_device *dev = (struct net_device *)data;
  377. - struct ath_softc *sc = dev->priv;
  378. + struct ath_softc *sc = netdev_priv(dev);
  379.  
  380. if (txqactive(sc->sc_ah, 0))
  381. ath_tx_processq(sc, &sc->sc_txq[0]);
  382. @@ -7513,7 +7515,7 @@ static void
  383. ath_tx_tasklet_q0123(TQUEUE_ARG data)
  384. {
  385. struct net_device *dev = (struct net_device *)data;
  386. - struct ath_softc *sc = dev->priv;
  387. + struct ath_softc *sc = netdev_priv(dev);
  388.  
  389. /*
  390. * Process each active queue.
  391. @@ -7548,7 +7550,7 @@ static void
  392. ath_tx_tasklet(TQUEUE_ARG data)
  393. {
  394. struct net_device *dev = (struct net_device *)data;
  395. - struct ath_softc *sc = dev->priv;
  396. + struct ath_softc *sc = netdev_priv(dev);
  397. int i;
  398.  
  399. /*
  400. @@ -7571,7 +7573,7 @@ ath_tx_tasklet(TQUEUE_ARG data)
  401. static void
  402. ath_tx_timeout(struct net_device *dev)
  403. {
  404. - struct ath_softc *sc = dev->priv;
  405. + struct ath_softc *sc = netdev_priv(dev);
  406.  
  407. DPRINTF(sc, ATH_DEBUG_WATCHDOG, "%s: %sRUNNING %svalid\n",
  408. __func__, (dev->flags & IFF_RUNNING) ? "" : "!",
  409. @@ -7934,7 +7936,7 @@ static void
  410. ath_calibrate(unsigned long arg)
  411. {
  412. struct net_device *dev = (struct net_device *) arg;
  413. - struct ath_softc *sc = dev->priv;
  414. + struct ath_softc *sc = netdev_priv(dev);
  415. struct ath_hal *ah = sc->sc_ah;
  416. struct ieee80211com *ic = &sc->sc_ic;
  417. HAL_CHANNEL *chans;
  418. @@ -8000,7 +8002,7 @@ static void
  419. ath_scan_start(struct ieee80211com *ic)
  420. {
  421. struct net_device *dev = ic->ic_dev;
  422. - struct ath_softc *sc = dev->priv;
  423. + struct ath_softc *sc = netdev_priv(dev);
  424. struct ath_hal *ah = sc->sc_ah;
  425. u_int32_t rfilt;
  426.  
  427. @@ -8020,7 +8022,7 @@ static void
  428. ath_scan_end(struct ieee80211com *ic)
  429. {
  430. struct net_device *dev = ic->ic_dev;
  431. - struct ath_softc *sc = dev->priv;
  432. + struct ath_softc *sc = netdev_priv(dev);
  433. struct ath_hal *ah = sc->sc_ah;
  434. u_int32_t rfilt;
  435.  
  436. @@ -8038,7 +8040,7 @@ static void
  437. ath_set_channel(struct ieee80211com *ic)
  438. {
  439. struct net_device *dev = ic->ic_dev;
  440. - struct ath_softc *sc = dev->priv;
  441. + struct ath_softc *sc = netdev_priv(dev);
  442.  
  443. (void) ath_chan_set(sc, ic->ic_curchan);
  444. /*
  445. @@ -8054,7 +8056,7 @@ ath_set_channel(struct ieee80211com *ic)
  446. static void
  447. ath_set_coverageclass(struct ieee80211com *ic)
  448. {
  449. - struct ath_softc *sc = ic->ic_dev->priv;
  450. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  451.  
  452. ath_hal_setcoverageclass(sc->sc_ah, ic->ic_coverageclass, 0);
  453.  
  454. @@ -8064,7 +8066,7 @@ ath_set_coverageclass(struct ieee80211co
  455. static u_int
  456. ath_mhz2ieee(struct ieee80211com *ic, u_int freq, u_int flags)
  457. {
  458. - struct ath_softc *sc = ic->ic_dev->priv;
  459. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  460.  
  461. return (ath_hal_mhz2ieee(sc->sc_ah, freq, flags));
  462. }
  463. @@ -8079,7 +8081,7 @@ ath_newstate(struct ieee80211vap *vap, e
  464. struct ath_vap *avp = ATH_VAP(vap);
  465. struct ieee80211com *ic = vap->iv_ic;
  466. struct net_device *dev = ic->ic_dev;
  467. - struct ath_softc *sc = dev->priv;
  468. + struct ath_softc *sc = netdev_priv(dev);
  469. struct ath_hal *ah = sc->sc_ah;
  470. struct ieee80211_node *ni, *wds_ni;
  471. int i, error, stamode;
  472. @@ -8414,7 +8416,7 @@ ath_setup_comp(struct ieee80211_node *ni
  473. {
  474. #define IEEE80211_KEY_XR (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV)
  475. struct ieee80211vap *vap = ni->ni_vap;
  476. - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
  477. + struct ath_softc *sc = netdev_pric(vap->iv_ic->ic_dev);
  478. struct ath_node *an = ATH_NODE(ni);
  479. u_int16_t keyindex;
  480.  
  481. @@ -8468,7 +8470,7 @@ static void
  482. ath_setup_stationkey(struct ieee80211_node *ni)
  483. {
  484. struct ieee80211vap *vap = ni->ni_vap;
  485. - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;
  486. + struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);
  487. u_int16_t keyix;
  488.  
  489. keyix = ath_key_alloc(vap, &ni->ni_ucastkey);
  490. @@ -8628,7 +8630,7 @@ ath_newassoc(struct ieee80211_node *ni,
  491. {
  492. struct ieee80211com *ic = ni->ni_ic;
  493. struct ieee80211vap *vap = ni->ni_vap;
  494. - struct ath_softc *sc = ic->ic_dev->priv;
  495. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  496.  
  497. sc->sc_rc->ops->newassoc(sc, ATH_NODE(ni), isnew);
  498.  
  499. @@ -8659,7 +8661,7 @@ static int
  500. ath_getchannels(struct net_device *dev, u_int cc,
  501. HAL_BOOL outdoor, HAL_BOOL xchanmode)
  502. {
  503. - struct ath_softc *sc = dev->priv;
  504. + struct ath_softc *sc = netdev_priv(dev);
  505. struct ieee80211com *ic = &sc->sc_ic;
  506. struct ath_hal *ah = sc->sc_ah;
  507. HAL_CHANNEL *chans;
  508. @@ -8829,7 +8831,7 @@ ath_update_txpow(struct ath_softc *sc)
  509. static int
  510. ath_xr_rate_setup(struct net_device *dev)
  511. {
  512. - struct ath_softc *sc = dev->priv;
  513. + struct ath_softc *sc = netdev_priv(dev);
  514. struct ath_hal *ah = sc->sc_ah;
  515. struct ieee80211com *ic = &sc->sc_ic;
  516. const HAL_RATE_TABLE *rt;
  517. @@ -8858,7 +8860,7 @@ ath_xr_rate_setup(struct net_device *dev
  518. static void
  519. ath_setup_subrates(struct net_device *dev)
  520. {
  521. - struct ath_softc *sc = dev->priv;
  522. + struct ath_softc *sc = netdev_priv(dev);
  523. struct ath_hal *ah = sc->sc_ah;
  524. struct ieee80211com *ic = &sc->sc_ic;
  525. const HAL_RATE_TABLE *rt;
  526. @@ -8901,7 +8903,7 @@ ath_setup_subrates(struct net_device *de
  527. static int
  528. ath_rate_setup(struct net_device *dev, u_int mode)
  529. {
  530. - struct ath_softc *sc = dev->priv;
  531. + struct ath_softc *sc = netdev_priv(dev);
  532. struct ath_hal *ah = sc->sc_ah;
  533. struct ieee80211com *ic = &sc->sc_ic;
  534. const HAL_RATE_TABLE *rt;
  535. @@ -9138,7 +9140,7 @@ ath_printtxbuf(struct ath_buf *bf, int d
  536. static struct net_device_stats *
  537. ath_getstats(struct net_device *dev)
  538. {
  539. - struct ath_softc *sc = dev->priv;
  540. + struct ath_softc *sc = netdev_priv(dev);
  541. struct net_device_stats *stats = &sc->sc_devstats;
  542.  
  543. /* update according to private statistics */
  544. @@ -9161,7 +9163,7 @@ ath_getstats(struct net_device *dev)
  545. static int
  546. ath_set_mac_address(struct net_device *dev, void *addr)
  547. {
  548. - struct ath_softc *sc = dev->priv;
  549. + struct ath_softc *sc = netdev_priv(dev);
  550. struct ieee80211com *ic = &sc->sc_ic;
  551. struct ath_hal *ah = sc->sc_ah;
  552. struct sockaddr *mac = addr;
  553. @@ -9193,7 +9195,7 @@ ath_set_mac_address(struct net_device *d
  554. static int
  555. ath_change_mtu(struct net_device *dev, int mtu)
  556. {
  557. - struct ath_softc *sc = dev->priv;
  558. + struct ath_softc *sc = netdev_priv(dev);
  559. int error = 0;
  560.  
  561. if (!(ATH_MIN_MTU < mtu && mtu <= ATH_MAX_MTU)) {
  562. @@ -9280,7 +9282,7 @@ bad:
  563. static int
  564. ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
  565. {
  566. - struct ath_softc *sc = dev->priv;
  567. + struct ath_softc *sc = netdev_priv(dev);
  568. struct ieee80211com *ic = &sc->sc_ic;
  569. int error;
  570.  
  571. @@ -9776,7 +9778,7 @@ static void
  572. ath_announce(struct net_device *dev)
  573. {
  574. #define HAL_MODE_DUALBAND (HAL_MODE_11A|HAL_MODE_11B)
  575. - struct ath_softc *sc = dev->priv;
  576. + struct ath_softc *sc = netdev_priv(dev);
  577. struct ath_hal *ah = sc->sc_ah;
  578. u_int modes, cc;
  579.  
  580. @@ -9923,7 +9925,7 @@ ath_rcv_dev_event(struct notifier_block
  581. void *ptr)
  582. {
  583. struct net_device *dev = (struct net_device *) ptr;
  584. - struct ath_softc *sc = (struct ath_softc *) dev->priv;
  585. + struct ath_softc *sc = (struct ath_softc *) netdev_priv(dev);
  586.  
  587. if (!dev || !sc || dev->open != &ath_init)
  588. return 0;
  589. diff -rupN madwifi-0.9.4/ath/if_ath_pci.c madwifi-0.9.4-patched/ath/if_ath_pci.c
  590. --- madwifi-0.9.4/ath/if_ath_pci.c 2008-01-30 22:56:11.000000000 +0200
  591. +++ madwifi-0.9.4-patched/ath/if_ath_pci.c 2009-08-06 12:23:13.000000000 +0300
  592. @@ -184,7 +184,7 @@ ath_pci_probe(struct pci_dev *pdev, cons
  593. printk(KERN_ERR "ath_pci: no memory for device state\n");
  594. goto bad2;
  595. }
  596. - sc = dev->priv;
  597. + sc = netdev_priv(dev);
  598. sc->aps_sc.sc_dev = dev;
  599. sc->aps_sc.sc_iobase = mem;
  600.  
  601. @@ -265,7 +265,7 @@ static void
  602. ath_pci_remove(struct pci_dev *pdev)
  603. {
  604. struct net_device *dev = pci_get_drvdata(pdev);
  605. - struct ath_pci_softc *sc = dev->priv;
  606. + struct ath_pci_softc *sc = netdev_priv(dev);
  607.  
  608. ath_detach(dev);
  609. if (dev->irq)
  610. diff -rupN madwifi-0.9.4/ath/if_athvar.h madwifi-0.9.4-patched/ath/if_athvar.h
  611. --- madwifi-0.9.4/ath/if_athvar.h 2008-02-12 08:05:28.000000000 +0200
  612. +++ madwifi-0.9.4-patched/ath/if_athvar.h 2009-08-06 12:23:13.000000000 +0300
  613. @@ -94,7 +94,7 @@ typedef void *TQUEUE_ARG;
  614. /*
  615. * Guess how the interrupt handler should work.
  616. */
  617. -#if !defined(IRQ_NONE)
  618. +#if defined(IRQ_NONE)
  619. typedef void irqreturn_t;
  620. #define IRQ_NONE
  621. #define IRQ_HANDLED
  622. diff -rupN madwifi-0.9.4/ath/modules.order madwifi-0.9.4-patched/ath/modules.order
  623. --- madwifi-0.9.4/ath/modules.order 1970-01-01 02:00:00.000000000 +0200
  624. +++ madwifi-0.9.4-patched/ath/modules.order 2009-08-06 12:23:13.000000000 +0300
  625. @@ -0,0 +1 @@
  626. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath/ath_pci.ko
  627. diff -rupN madwifi-0.9.4/ath_hal/modules.order madwifi-0.9.4-patched/ath_hal/modules.order
  628. --- madwifi-0.9.4/ath_hal/modules.order 1970-01-01 02:00:00.000000000 +0200
  629. +++ madwifi-0.9.4-patched/ath_hal/modules.order 2009-08-06 12:23:14.000000000 +0300
  630. @@ -0,0 +1 @@
  631. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_hal/ath_hal.ko
  632. diff -rupN madwifi-0.9.4/ath_rate/amrr/amrr.c madwifi-0.9.4-patched/ath_rate/amrr/amrr.c
  633. --- madwifi-0.9.4/ath_rate/amrr/amrr.c 2007-10-31 07:46:45.000000000 +0200
  634. +++ madwifi-0.9.4-patched/ath_rate/amrr/amrr.c 2009-08-06 12:23:14.000000000 +0300
  635. @@ -303,7 +303,7 @@ ath_rate_ctl_start(struct ath_softc *sc,
  636. static void
  637. ath_rate_cb(void *arg, struct ieee80211_node *ni)
  638. {
  639. - ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg);
  640. + ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg);
  641. }
  642.  
  643. /*
  644. @@ -313,7 +313,7 @@ static void
  645. ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state)
  646. {
  647. struct ieee80211com *ic = vap->iv_ic;
  648. - struct ath_softc *sc = ic->ic_dev->priv;
  649. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  650. struct amrr_softc *asc = (struct amrr_softc *) sc->sc_rc;
  651. struct ieee80211_node *ni;
  652.  
  653. @@ -425,7 +425,7 @@ static void
  654. ath_ratectl(unsigned long data)
  655. {
  656. struct net_device *dev = (struct net_device *)data;
  657. - struct ath_softc *sc = dev->priv;
  658. + struct ath_softc *sc = netdev_priv(dev);
  659. struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc;
  660. struct ieee80211com *ic = &sc->sc_ic;
  661. int interval;
  662. diff -rupN madwifi-0.9.4/ath_rate/amrr/modules.order madwifi-0.9.4-patched/ath_rate/amrr/modules.order
  663. --- madwifi-0.9.4/ath_rate/amrr/modules.order 1970-01-01 02:00:00.000000000 +0200
  664. +++ madwifi-0.9.4-patched/ath_rate/amrr/modules.order 2009-08-06 12:23:14.000000000 +0300
  665. @@ -0,0 +1 @@
  666. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/amrr/ath_rate_amrr.ko
  667. diff -rupN madwifi-0.9.4/ath_rate/minstrel/minstrel.c madwifi-0.9.4-patched/ath_rate/minstrel/minstrel.c
  668. --- madwifi-0.9.4/ath_rate/minstrel/minstrel.c 2007-12-12 06:11:07.000000000 +0200
  669. +++ madwifi-0.9.4-patched/ath_rate/minstrel/minstrel.c 2009-08-06 12:23:14.000000000 +0300
  670. @@ -730,7 +730,7 @@ ath_rate_ctl_reset(struct ath_softc *sc,
  671. static void
  672. ath_rate_cb(void *arg, struct ieee80211_node *ni)
  673. {
  674. - ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni);
  675. + ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni);
  676. }
  677.  
  678. /* Reset the rate control state for each 802.11 state transition. */
  679. @@ -744,7 +744,7 @@ ath_rate_newstate(struct ieee80211vap *v
  680. /* Sync rates for associated stations and neighbors. */
  681. ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL);
  682. }
  683. - ath_rate_newassoc(ic->ic_dev->priv, ATH_NODE(vap->iv_bss), 1);
  684. + ath_rate_newassoc(netdev_priv(ic->ic_dev), ATH_NODE(vap->iv_bss), 1);
  685. }
  686. }
  687.  
  688. @@ -929,7 +929,7 @@ ath_proc_read_nodes(struct ieee80211vap
  689. (struct ieee80211_node_table *) &vap->iv_ic->ic_sta;
  690. unsigned int x = 0;
  691. unsigned int this_tp, this_prob, this_eprob;
  692. - struct ath_softc *sc = vap->iv_ic->ic_dev->priv;;
  693. + struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev);;
  694.  
  695. TAILQ_FOREACH(ni, &nt->nt_node, ni_list) {
  696. /* Assume each node needs 1500 bytes */
  697. diff -rupN madwifi-0.9.4/ath_rate/minstrel/modules.order madwifi-0.9.4-patched/ath_rate/minstrel/modules.order
  698. --- madwifi-0.9.4/ath_rate/minstrel/modules.order 1970-01-01 02:00:00.000000000 +0200
  699. +++ madwifi-0.9.4-patched/ath_rate/minstrel/modules.order 2009-08-06 12:23:14.000000000 +0300
  700. @@ -0,0 +1 @@
  701. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/minstrel/ath_rate_minstrel.ko
  702. diff -rupN madwifi-0.9.4/ath_rate/modules.order madwifi-0.9.4-patched/ath_rate/modules.order
  703. --- madwifi-0.9.4/ath_rate/modules.order 1970-01-01 02:00:00.000000000 +0200
  704. +++ madwifi-0.9.4-patched/ath_rate/modules.order 2009-08-06 12:23:14.000000000 +0300
  705. @@ -0,0 +1,4 @@
  706. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/amrr/ath_rate_amrr.ko
  707. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/onoe/ath_rate_onoe.ko
  708. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/sample/ath_rate_sample.ko
  709. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/minstrel/ath_rate_minstrel.ko
  710. diff -rupN madwifi-0.9.4/ath_rate/onoe/modules.order madwifi-0.9.4-patched/ath_rate/onoe/modules.order
  711. --- madwifi-0.9.4/ath_rate/onoe/modules.order 1970-01-01 02:00:00.000000000 +0200
  712. +++ madwifi-0.9.4-patched/ath_rate/onoe/modules.order 2009-08-06 12:23:14.000000000 +0300
  713. @@ -0,0 +1 @@
  714. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/onoe/ath_rate_onoe.ko
  715. diff -rupN madwifi-0.9.4/ath_rate/onoe/onoe.c madwifi-0.9.4-patched/ath_rate/onoe/onoe.c
  716. --- madwifi-0.9.4/ath_rate/onoe/onoe.c 2007-10-31 07:46:45.000000000 +0200
  717. +++ madwifi-0.9.4-patched/ath_rate/onoe/onoe.c 2009-08-06 12:23:14.000000000 +0300
  718. @@ -289,7 +289,7 @@ ath_rate_ctl_start(struct ath_softc *sc,
  719. static void
  720. ath_rate_cb(void *arg, struct ieee80211_node *ni)
  721. {
  722. - ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg);
  723. + ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg);
  724. }
  725.  
  726. /*
  727. @@ -299,7 +299,7 @@ static void
  728. ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state)
  729. {
  730. struct ieee80211com *ic = vap->iv_ic;
  731. - struct ath_softc *sc = ic->ic_dev->priv;
  732. + struct ath_softc *sc = netdev_priv(ic->ic_dev);
  733. struct ieee80211_node *ni;
  734.  
  735. if (state == IEEE80211_S_INIT)
  736. diff -rupN madwifi-0.9.4/ath_rate/sample/modules.order madwifi-0.9.4-patched/ath_rate/sample/modules.order
  737. --- madwifi-0.9.4/ath_rate/sample/modules.order 1970-01-01 02:00:00.000000000 +0200
  738. +++ madwifi-0.9.4-patched/ath_rate/sample/modules.order 2009-08-06 12:23:14.000000000 +0300
  739. @@ -0,0 +1 @@
  740. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/sample/ath_rate_sample.ko
  741. diff -rupN madwifi-0.9.4/ath_rate/sample/sample.c madwifi-0.9.4-patched/ath_rate/sample/sample.c
  742. --- madwifi-0.9.4/ath_rate/sample/sample.c 2007-02-27 19:45:56.000000000 +0200
  743. +++ madwifi-0.9.4-patched/ath_rate/sample/sample.c 2009-08-06 12:23:14.000000000 +0300
  744. @@ -882,7 +882,7 @@ ath_rate_ctl_reset(struct ath_softc *sc,
  745. static void
  746. ath_rate_cb(void *arg, struct ieee80211_node *ni)
  747. {
  748. - ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni);
  749. + ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni);
  750. }
  751.  
  752. /*
  753. @@ -900,7 +900,7 @@ ath_rate_newstate(struct ieee80211vap *v
  754. */
  755. ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL);
  756. }
  757. - ath_rate_newassoc(ic->ic_dev->priv, ATH_NODE(vap->iv_bss), 1);
  758. + ath_rate_newassoc(netdev_priv(ic->ic_dev), ATH_NODE(vap->iv_bss), 1);
  759. }
  760. }
  761.  
  762. diff -rupN madwifi-0.9.4/modules.order madwifi-0.9.4-patched/modules.order
  763. --- madwifi-0.9.4/modules.order 1970-01-01 02:00:00.000000000 +0200
  764. +++ madwifi-0.9.4-patched/modules.order 2009-08-06 12:23:14.000000000 +0300
  765. @@ -0,0 +1,14 @@
  766. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath/ath_pci.ko
  767. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_hal/ath_hal.ko
  768. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/amrr/ath_rate_amrr.ko
  769. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/onoe/ath_rate_onoe.ko
  770. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/sample/ath_rate_sample.ko
  771. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/ath_rate/minstrel/ath_rate_minstrel.ko
  772. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan.ko
  773. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_wep.ko
  774. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_tkip.ko
  775. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_ccmp.ko
  776. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_acl.ko
  777. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_xauth.ko
  778. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_scan_sta.ko
  779. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_scan_ap.ko
  780. diff -rupN madwifi-0.9.4/net80211/ieee80211.c madwifi-0.9.4-patched/net80211/ieee80211.c
  781. --- madwifi-0.9.4/net80211/ieee80211.c 2007-12-25 05:15:19.000000000 +0200
  782. +++ madwifi-0.9.4-patched/net80211/ieee80211.c 2009-08-06 12:23:14.000000000 +0300
  783. @@ -378,7 +378,7 @@ ieee80211_vap_setup(struct ieee80211com
  784. #define IEEE80211_C_OPMODE \
  785. (IEEE80211_C_IBSS | IEEE80211_C_HOSTAP | IEEE80211_C_AHDEMO | \
  786. IEEE80211_C_MONITOR)
  787. - struct ieee80211vap *vap = dev->priv;
  788. + struct ieee80211vap *vap = netdev_priv(dev);
  789. struct net_device *parent = ic->ic_dev;
  790. int err;
  791.  
  792. @@ -1018,7 +1018,7 @@ media_status(enum ieee80211_opmode opmod
  793. static void
  794. ieee80211com_media_status(struct net_device *dev, struct ifmediareq *imr)
  795. {
  796. - struct ieee80211com *ic = dev->priv; /*XXX*/
  797. + struct ieee80211com *ic = netdev_priv(dev); /*XXX*/
  798.  
  799. imr->ifm_status = IFM_AVALID;
  800. if (!TAILQ_EMPTY(&ic->ic_vaps))
  801. @@ -1070,7 +1070,7 @@ media2mode(const struct ifmedia_entry *i
  802. static int
  803. ieee80211com_media_change(struct net_device *dev)
  804. {
  805. - struct ieee80211com *ic = dev->priv; /*XXX*/
  806. + struct ieee80211com *ic = netdev_priv(dev); /*XXX*/
  807. struct ieee80211vap *vap;
  808. struct ifmedia_entry *ime = ic->ic_media.ifm_cur;
  809. enum ieee80211_phymode newphymode;
  810. @@ -1183,7 +1183,7 @@ checkrate(struct ieee80211com *ic, enum
  811. int
  812. ieee80211_media_change(struct net_device *dev)
  813. {
  814. - struct ieee80211vap *vap = dev->priv;
  815. + struct ieee80211vap *vap = netdev_priv(dev);
  816. struct ieee80211com *ic = vap->iv_ic;
  817. struct ifmedia_entry *ime = vap->iv_media.ifm_cur;
  818. enum ieee80211_phymode newmode;
  819. @@ -1227,7 +1227,7 @@ EXPORT_SYMBOL(ieee80211_media_change);
  820. void
  821. ieee80211_media_status(struct net_device *dev, struct ifmediareq *imr)
  822. {
  823. - struct ieee80211vap *vap = dev->priv;
  824. + struct ieee80211vap *vap = netdev_priv(dev);
  825. struct ieee80211com *ic = vap->iv_ic;
  826. enum ieee80211_phymode mode;
  827. struct ieee80211_rateset *rs;
  828. @@ -1445,7 +1445,7 @@ EXPORT_SYMBOL(ieee80211_media2rate);
  829. static struct net_device_stats *
  830. ieee80211_getstats(struct net_device *dev)
  831. {
  832. - struct ieee80211vap *vap = dev->priv;
  833. + struct ieee80211vap *vap = netdev_priv(dev);
  834. struct net_device_stats *stats = &vap->iv_devstats;
  835.  
  836. /* XXX total guess as to what to count where */
  837. @@ -1484,7 +1484,7 @@ ieee80211_change_mtu(struct net_device *
  838. static void
  839. ieee80211_set_multicast_list(struct net_device *dev)
  840. {
  841. - struct ieee80211vap *vap = dev->priv;
  842. + struct ieee80211vap *vap = netdev_priv(dev);
  843. struct ieee80211com *ic = vap->iv_ic;
  844. struct net_device *parent = ic->ic_dev;
  845.  
  846. diff -rupN madwifi-0.9.4/net80211/ieee80211_linux.c madwifi-0.9.4-patched/net80211/ieee80211_linux.c
  847. --- madwifi-0.9.4/net80211/ieee80211_linux.c 2007-12-13 05:53:42.000000000 +0200
  848. +++ madwifi-0.9.4-patched/net80211/ieee80211_linux.c 2009-08-06 12:23:14.000000000 +0300
  849. @@ -140,7 +140,7 @@ __skb_queue_drain(struct sk_buff_head *q
  850. static void
  851. ieee80211_vlan_register(struct net_device *dev, struct vlan_group *grp)
  852. {
  853. - struct ieee80211vap *vap = dev->priv;
  854. + struct ieee80211vap *vap = netdev_priv(dev);
  855.  
  856. vap->iv_vlgrp = grp;
  857. }
  858. @@ -151,7 +151,7 @@ ieee80211_vlan_register(struct net_devic
  859. static void
  860. ieee80211_vlan_add_vid(struct net_device *dev, unsigned short vid)
  861. {
  862. - struct ieee80211vap *vap = dev->priv;
  863. + struct ieee80211vap *vap = netdev_priv(dev);
  864.  
  865. if (vap->iv_vlgrp != NULL)
  866. vap->iv_bss->ni_vlan = vid;
  867. @@ -163,7 +163,7 @@ ieee80211_vlan_add_vid(struct net_device
  868. static void
  869. ieee80211_vlan_kill_vid(struct net_device *dev, unsigned short vid)
  870. {
  871. - struct ieee80211vap *vap = dev->priv;
  872. + struct ieee80211vap *vap = netdev_priv(dev);
  873.  
  874. if (vap->iv_vlgrp != NULL)
  875. vlan_group_set_device(vap->iv_vlgrp, vid, NULL);
  876. @@ -899,8 +899,8 @@ ieee80211_rcv_dev_event(struct notifier_
  877.  
  878. switch (event) {
  879. case NETDEV_CHANGENAME:
  880. - ieee80211_sysctl_vdetach(dev->priv);
  881. - ieee80211_sysctl_vattach(dev->priv);
  882. + ieee80211_sysctl_vdetach(netdev_priv(dev));
  883. + ieee80211_sysctl_vattach(netdev_priv(dev));
  884. return NOTIFY_DONE;
  885. default:
  886. break;
  887. diff -rupN madwifi-0.9.4/net80211/ieee80211_output.c madwifi-0.9.4-patched/net80211/ieee80211_output.c
  888. --- madwifi-0.9.4/net80211/ieee80211_output.c 2007-12-13 08:21:32.000000000 +0200
  889. +++ madwifi-0.9.4-patched/net80211/ieee80211_output.c 2009-08-06 12:23:14.000000000 +0300
  890. @@ -200,7 +200,7 @@ ieee80211_classify(struct ieee80211_node
  891. int
  892. ieee80211_hardstart(struct sk_buff *skb, struct net_device *dev)
  893. {
  894. - struct ieee80211vap *vap = dev->priv;
  895. + struct ieee80211vap *vap = netdev_priv(dev);
  896. struct ieee80211com *ic = vap->iv_ic;
  897. struct net_device *parent = ic->ic_dev;
  898. struct ieee80211_node *ni = NULL;
  899. @@ -304,7 +304,7 @@ bad:
  900. }
  901.  
  902. void ieee80211_parent_queue_xmit(struct sk_buff *skb) {
  903. - struct ieee80211vap *vap = skb->dev->priv;
  904. + struct ieee80211vap *vap = netdev_priv(skb->dev);
  905.  
  906. vap->iv_devstats.tx_packets++;
  907. vap->iv_devstats.tx_bytes += skb->len;
  908. diff -rupN madwifi-0.9.4/net80211/ieee80211_power.c madwifi-0.9.4-patched/net80211/ieee80211_power.c
  909. --- madwifi-0.9.4/net80211/ieee80211_power.c 2008-01-29 11:17:23.000000000 +0200
  910. +++ madwifi-0.9.4-patched/net80211/ieee80211_power.c 2009-08-06 12:23:14.000000000 +0300
  911. @@ -237,7 +237,7 @@ ieee80211_pwrsave(struct ieee80211_node
  912. tail = skb_peek_tail(&ni->ni_savedq);
  913. if (tail != NULL) {
  914. age -= M_AGE_GET(tail);
  915. - __skb_append(tail, skb, &ni->ni_savedq);
  916. + skb_append(tail, skb, &ni->ni_savedq);
  917. } else
  918. __skb_queue_head(&ni->ni_savedq, skb);
  919. M_AGE_SET(skb, age);
  920. diff -rupN madwifi-0.9.4/net80211/ieee80211_proto.c madwifi-0.9.4-patched/net80211/ieee80211_proto.c
  921. --- madwifi-0.9.4/net80211/ieee80211_proto.c 2007-12-25 05:12:31.000000000 +0200
  922. +++ madwifi-0.9.4-patched/net80211/ieee80211_proto.c 2009-08-06 12:23:14.000000000 +0300
  923. @@ -946,7 +946,7 @@ ieee80211_init(struct net_device *dev, i
  924. {
  925. #define IS_RUNNING(_dev) \
  926. ((_dev->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP))
  927. - struct ieee80211vap *vap = dev->priv;
  928. + struct ieee80211vap *vap = netdev_priv(dev);
  929. struct ieee80211com *ic = vap->iv_ic;
  930. struct net_device *parent = ic->ic_dev;
  931.  
  932. @@ -1043,7 +1043,7 @@ EXPORT_SYMBOL(ieee80211_start_running);
  933. int
  934. ieee80211_stop(struct net_device *dev)
  935. {
  936. - struct ieee80211vap *vap = dev->priv;
  937. + struct ieee80211vap *vap = netdev_priv(dev);
  938. struct ieee80211com *ic = vap->iv_ic;
  939. struct net_device *parent = ic->ic_dev;
  940.  
  941. diff -rupN madwifi-0.9.4/net80211/ieee80211_wireless.c madwifi-0.9.4-patched/net80211/ieee80211_wireless.c
  942. --- madwifi-0.9.4/net80211/ieee80211_wireless.c 2007-12-25 05:15:19.000000000 +0200
  943. +++ madwifi-0.9.4-patched/net80211/ieee80211_wireless.c 2009-08-06 12:23:14.000000000 +0300
  944. @@ -78,7 +78,7 @@ pre_announced_chanswitch(struct net_devi
  945. static void
  946. preempt_scan(struct net_device *dev, int max_grace, int max_wait)
  947. {
  948. - struct ieee80211vap *vap = dev->priv;
  949. + struct ieee80211vap *vap = netdev_priv(dev);
  950. struct ieee80211com *ic = vap->iv_ic;
  951. int total_delay = 0;
  952. int canceled = 0, ready = 0;
  953. @@ -111,7 +111,7 @@ preempt_scan(struct net_device *dev, int
  954. static struct iw_statistics *
  955. ieee80211_iw_getstats(struct net_device *dev)
  956. {
  957. - struct ieee80211vap *vap = dev->priv;
  958. + struct ieee80211vap *vap = netdev_priv(dev);
  959. struct iw_statistics *is = &vap->iv_iwstats;
  960. struct ieee80211com *ic = vap->iv_ic;
  961.  
  962. @@ -135,7 +135,7 @@ static int
  963. ieee80211_ioctl_giwname(struct net_device *dev, struct iw_request_info *info,
  964. char *name, char *extra)
  965. {
  966. - struct ieee80211vap *vap = dev->priv;
  967. + struct ieee80211vap *vap = netdev_priv(dev);
  968. struct ieee80211_channel *c = vap->iv_ic->ic_curchan;
  969.  
  970. if (IEEE80211_IS_CHAN_108G(c))
  971. @@ -185,7 +185,7 @@ static int
  972. ieee80211_ioctl_siwencode(struct net_device *dev,
  973. struct iw_request_info *info, struct iw_point *erq, char *keybuf)
  974. {
  975. - struct ieee80211vap *vap = dev->priv;
  976. + struct ieee80211vap *vap = netdev_priv(dev);
  977. int kid, error;
  978. int wepchange = 0;
  979.  
  980. @@ -289,7 +289,7 @@ static int
  981. ieee80211_ioctl_giwencode(struct net_device *dev, struct iw_request_info *info,
  982. struct iw_point *erq, char *key)
  983. {
  984. - struct ieee80211vap *vap = dev->priv;
  985. + struct ieee80211vap *vap = netdev_priv(dev);
  986. struct ieee80211_key *k;
  987. int error, kid;
  988.  
  989. @@ -333,7 +333,7 @@ ieee80211_ioctl_siwrate(struct net_devic
  990. IFM_IEEE80211_11A | IFM_IEEE80211_TURBO,
  991. IFM_IEEE80211_11G | IFM_IEEE80211_TURBO,
  992. };
  993. - struct ieee80211vap *vap = dev->priv;
  994. + struct ieee80211vap *vap = netdev_priv(dev);
  995. struct ieee80211com *ic = vap->iv_ic;
  996. struct ifreq ifr;
  997. int rate, retv;
  998. @@ -368,7 +368,7 @@ static int
  999. ieee80211_ioctl_giwrate(struct net_device *dev, struct iw_request_info *info,
  1000. struct iw_param *rrq, char *extra)
  1001. {
  1002. - struct ieee80211vap *vap = dev->priv;
  1003. + struct ieee80211vap *vap = netdev_priv(dev);
  1004. struct ifmediareq imr;
  1005. int rate;
  1006.  
  1007. @@ -406,7 +406,7 @@ static int
  1008. ieee80211_ioctl_siwrts(struct net_device *dev, struct iw_request_info *info,
  1009. struct iw_param *rts, char *extra)
  1010. {
  1011. - struct ieee80211vap *vap = dev->priv;
  1012. + struct ieee80211vap *vap = netdev_priv(dev);
  1013. struct ieee80211com *ic = vap->iv_ic;
  1014. u16 val;
  1015.  
  1016. @@ -429,7 +429,7 @@ static int
  1017. ieee80211_ioctl_giwrts(struct net_device *dev, struct iw_request_info *info,
  1018. struct iw_param *rts, char *extra)
  1019. {
  1020. - struct ieee80211vap *vap = dev->priv;
  1021. + struct ieee80211vap *vap = netdev_priv(dev);
  1022.  
  1023. rts->value = vap->iv_rtsthreshold;
  1024. rts->disabled = (rts->value == IEEE80211_RTS_MAX);
  1025. @@ -442,7 +442,7 @@ static int
  1026. ieee80211_ioctl_siwfrag(struct net_device *dev, struct iw_request_info *info,
  1027. struct iw_param *rts, char *extra)
  1028. {
  1029. - struct ieee80211vap *vap = dev->priv;
  1030. + struct ieee80211vap *vap = netdev_priv(dev);
  1031. struct ieee80211com *ic = vap->iv_ic;
  1032. u16 val;
  1033.  
  1034. @@ -465,7 +465,7 @@ static int
  1035. ieee80211_ioctl_giwfrag(struct net_device *dev, struct iw_request_info *info,
  1036. struct iw_param *rts, char *extra)
  1037. {
  1038. - struct ieee80211vap *vap = dev->priv;
  1039. + struct ieee80211vap *vap = netdev_priv(dev);
  1040.  
  1041. rts->value = vap->iv_fragthreshold;
  1042. rts->disabled = (rts->value == 2346);
  1043. @@ -478,7 +478,7 @@ static int
  1044. ieee80211_ioctl_siwap(struct net_device *dev, struct iw_request_info *info,
  1045. struct sockaddr *ap_addr, char *extra)
  1046. {
  1047. - struct ieee80211vap *vap = dev->priv;
  1048. + struct ieee80211vap *vap = netdev_priv(dev);
  1049.  
  1050. /* NB: should not be set when in AP mode */
  1051. if (vap->iv_opmode == IEEE80211_M_HOSTAP)
  1052. @@ -513,7 +513,7 @@ static int
  1053. ieee80211_ioctl_giwap(struct net_device *dev, struct iw_request_info *info,
  1054. struct sockaddr *ap_addr, char *extra)
  1055. {
  1056. - struct ieee80211vap *vap = dev->priv;
  1057. + struct ieee80211vap *vap = netdev_priv(dev);
  1058.  
  1059. if (vap->iv_flags & IEEE80211_F_DESBSSID)
  1060. IEEE80211_ADDR_COPY(&ap_addr->sa_data, vap->iv_des_bssid);
  1061. @@ -534,7 +534,7 @@ static int
  1062. ieee80211_ioctl_siwnickn(struct net_device *dev, struct iw_request_info *info,
  1063. struct iw_point *data, char *nickname)
  1064. {
  1065. - struct ieee80211vap *vap = dev->priv;
  1066. + struct ieee80211vap *vap = netdev_priv(dev);
  1067.  
  1068. if (data->length > IEEE80211_NWID_LEN)
  1069. return -EINVAL;
  1070. @@ -550,7 +550,7 @@ static int
  1071. ieee80211_ioctl_giwnickn(struct net_device *dev, struct iw_request_info *info,
  1072. struct iw_point *data, char *nickname)
  1073. {
  1074. - struct ieee80211vap *vap = dev->priv;
  1075. + struct ieee80211vap *vap = netdev_priv(dev);
  1076.  
  1077. if (data->length > vap->iv_nicknamelen + 1)
  1078. data->length = vap->iv_nicknamelen + 1;
  1079. @@ -659,7 +659,7 @@ static int
  1080. ieee80211_ioctl_siwfreq(struct net_device *dev, struct iw_request_info *info,
  1081. struct iw_freq *freq, char *extra)
  1082. {
  1083. - struct ieee80211vap *vap = dev->priv;
  1084. + struct ieee80211vap *vap = netdev_priv(dev);
  1085. struct ieee80211com *ic = vap->iv_ic;
  1086. struct ieee80211_channel *c, *c2;
  1087. int i;
  1088. @@ -773,7 +773,7 @@ static int
  1089. ieee80211_ioctl_giwfreq(struct net_device *dev, struct iw_request_info *info,
  1090. struct iw_freq *freq, char *extra)
  1091. {
  1092. - struct ieee80211vap *vap = dev->priv;
  1093. + struct ieee80211vap *vap = netdev_priv(dev);
  1094. struct ieee80211com *ic = vap->iv_ic;
  1095.  
  1096. if (vap->iv_state == IEEE80211_S_RUN &&
  1097. @@ -814,7 +814,7 @@ static int
  1098. ieee80211_ioctl_siwessid(struct net_device *dev, struct iw_request_info *info,
  1099. struct iw_point *data, char *ssid)
  1100. {
  1101. - struct ieee80211vap *vap = dev->priv;
  1102. + struct ieee80211vap *vap = netdev_priv(dev);
  1103.  
  1104. if (vap->iv_opmode == IEEE80211_M_WDS)
  1105. return -EOPNOTSUPP;
  1106. @@ -856,7 +856,7 @@ static int
  1107. ieee80211_ioctl_giwessid(struct net_device *dev, struct iw_request_info *info,
  1108. struct iw_point *data, char *essid)
  1109. {
  1110. - struct ieee80211vap *vap = dev->priv;
  1111. + struct ieee80211vap *vap = netdev_priv(dev);
  1112.  
  1113. if (vap->iv_opmode == IEEE80211_M_WDS)
  1114. return -EOPNOTSUPP;
  1115. @@ -887,7 +887,7 @@ static int
  1116. ieee80211_ioctl_giwrange(struct net_device *dev, struct iw_request_info *info,
  1117. struct iw_point *data, char *extra)
  1118. {
  1119. - struct ieee80211vap *vap = dev->priv;
  1120. + struct ieee80211vap *vap = netdev_priv(dev);
  1121. struct ieee80211com *ic = vap->iv_ic;
  1122. struct ieee80211_node *ni = vap->iv_bss;
  1123. struct iw_range *range = (struct iw_range *) extra;
  1124. @@ -1034,7 +1034,7 @@ ieee80211_ioctl_setspy(struct net_device
  1125. struct iw_point *data, char *extra)
  1126. {
  1127. /* save the list of node addresses */
  1128. - struct ieee80211vap *vap = dev->priv;
  1129. + struct ieee80211vap *vap = netdev_priv(dev);
  1130. struct sockaddr address[IW_MAX_SPY];
  1131. unsigned int number = data->length;
  1132. int i;
  1133. @@ -1072,7 +1072,7 @@ ieee80211_ioctl_getspy(struct net_device
  1134. * locate nodes by mac (ieee80211_find_node()),
  1135. * copy out rssi, set updated flag appropriately
  1136. */
  1137. - struct ieee80211vap *vap = dev->priv;
  1138. + struct ieee80211vap *vap = netdev_priv(dev);
  1139. struct ieee80211_node_table *nt = &vap->iv_ic->ic_sta;
  1140. struct ieee80211_node *ni;
  1141. struct ieee80211com *ic = vap->iv_ic;
  1142. @@ -1118,7 +1118,7 @@ static int
  1143. ieee80211_ioctl_setthrspy(struct net_device *dev, struct iw_request_info *info,
  1144. struct iw_point *data, char *extra)
  1145. {
  1146. - struct ieee80211vap *vap = dev->priv;
  1147. + struct ieee80211vap *vap = netdev_priv(dev);
  1148. struct iw_thrspy threshold;
  1149.  
  1150. if (data->length != 1)
  1151. @@ -1155,7 +1155,7 @@ static int
  1152. ieee80211_ioctl_getthrspy(struct net_device *dev, struct iw_request_info *info,
  1153. struct iw_point *data, char *extra)
  1154. {
  1155. - struct ieee80211vap *vap = dev->priv;
  1156. + struct ieee80211vap *vap = netdev_priv(dev);
  1157. struct ieee80211com *ic = vap->iv_ic;
  1158. struct iw_thrspy *threshold;
  1159.  
  1160. @@ -1176,7 +1176,7 @@ static int
  1161. ieee80211_ioctl_siwmode(struct net_device *dev, struct iw_request_info *info,
  1162. __u32 *mode, char *extra)
  1163. {
  1164. - struct ieee80211vap *vap = dev->priv;
  1165. + struct ieee80211vap *vap = netdev_priv(dev);
  1166. struct ifmediareq imr;
  1167. int valid = 0;
  1168.  
  1169. @@ -1203,7 +1203,7 @@ static int
  1170. ieee80211_ioctl_giwmode(struct net_device *dev, struct iw_request_info *info,
  1171. __u32 *mode, char *extra)
  1172. {
  1173. - struct ieee80211vap *vap = dev->priv;
  1174. + struct ieee80211vap *vap = netdev_priv(dev);
  1175. struct ifmediareq imr;
  1176.  
  1177. memset(&imr, 0, sizeof(imr));
  1178. @@ -1228,7 +1228,7 @@ static int
  1179. ieee80211_ioctl_siwpower(struct net_device *dev, struct iw_request_info *info,
  1180. struct iw_param *wrq, char *extra)
  1181. {
  1182. - struct ieee80211vap *vap = dev->priv;
  1183. + struct ieee80211vap *vap = netdev_priv(dev);
  1184. struct ieee80211com *ic = vap->iv_ic;
  1185.  
  1186. /* XXX: These values, flags, and caps do not seem to be used elsewhere
  1187. @@ -1268,7 +1268,7 @@ static int
  1188. ieee80211_ioctl_giwpower(struct net_device *dev, struct iw_request_info *info,
  1189. struct iw_param *rrq, char *extra)
  1190. {
  1191. - struct ieee80211vap *vap = dev->priv;
  1192. + struct ieee80211vap *vap = netdev_priv(dev);
  1193. struct ieee80211com *ic = vap->iv_ic;
  1194.  
  1195. rrq->disabled = (ic->ic_flags & IEEE80211_F_PMGTON) == 0;
  1196. @@ -1292,7 +1292,7 @@ static int
  1197. ieee80211_ioctl_siwretry(struct net_device *dev, struct iw_request_info *info,
  1198. struct iw_param *rrq, char *extra)
  1199. {
  1200. - struct ieee80211vap *vap = dev->priv;
  1201. + struct ieee80211vap *vap = netdev_priv(dev);
  1202. struct ieee80211com *ic = vap->iv_ic;
  1203.  
  1204. if (rrq->disabled) {
  1205. @@ -1324,7 +1324,7 @@ static int
  1206. ieee80211_ioctl_giwretry(struct net_device *dev, struct iw_request_info *info,
  1207. struct iw_param *rrq, char *extra)
  1208. {
  1209. - struct ieee80211vap *vap = dev->priv;
  1210. + struct ieee80211vap *vap = netdev_priv(dev);
  1211.  
  1212. rrq->disabled = (vap->iv_flags & IEEE80211_F_SWRETRY) == 0;
  1213. if (!rrq->disabled) {
  1214. @@ -1355,7 +1355,7 @@ static int
  1215. ieee80211_ioctl_siwtxpow(struct net_device *dev, struct iw_request_info *info,
  1216. struct iw_param *rrq, char *extra)
  1217. {
  1218. - struct ieee80211vap *vap = dev->priv;
  1219. + struct ieee80211vap *vap = netdev_priv(dev);
  1220. struct ieee80211com *ic = vap->iv_ic;
  1221. int fixed, disabled;
  1222.  
  1223. @@ -1410,7 +1410,7 @@ static int
  1224. ieee80211_ioctl_giwtxpow(struct net_device *dev, struct iw_request_info *info,
  1225. struct iw_param *rrq, char *extra)
  1226. {
  1227. - struct ieee80211vap *vap = dev->priv;
  1228. + struct ieee80211vap *vap = netdev_priv(dev);
  1229. struct ieee80211com *ic = vap->iv_ic;
  1230.  
  1231. rrq->value = vap->iv_bss->ni_txpower / 2;
  1232. @@ -1450,7 +1450,7 @@ static int
  1233. ieee80211_ioctl_iwaplist(struct net_device *dev, struct iw_request_info *info,
  1234. struct iw_point *data, char *extra)
  1235. {
  1236. - struct ieee80211vap *vap = dev->priv;
  1237. + struct ieee80211vap *vap = netdev_priv(dev);
  1238. struct ieee80211com *ic = vap->iv_ic;
  1239. struct waplistreq req; /* XXX off stack */
  1240.  
  1241. @@ -1472,7 +1472,7 @@ static int
  1242. ieee80211_ioctl_siwscan(struct net_device *dev, struct iw_request_info *info,
  1243. struct iw_point *data, char *extra)
  1244. {
  1245. - struct ieee80211vap *vap = dev->priv;
  1246. + struct ieee80211vap *vap = netdev_priv(dev);
  1247.  
  1248. /*
  1249. * XXX don't permit a scan to be started unless we
  1250. @@ -1590,7 +1590,7 @@ giwscan_cb(void *arg, const struct ieee8
  1251. IEEE80211_ADDR_COPY(iwe.u.ap_addr.sa_data, se->se_macaddr);
  1252. else
  1253. IEEE80211_ADDR_COPY(iwe.u.ap_addr.sa_data, se->se_bssid);
  1254. - current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN);
  1255. + current_ev = iwe_stream_add_event(NULL, current_ev, end_buf, &iwe, IW_EV_ADDR_LEN);
  1256.  
  1257. /* We ran out of space in the buffer. */
  1258. if (last_ev == current_ev)
  1259. @@ -1603,11 +1603,11 @@ giwscan_cb(void *arg, const struct ieee8
  1260. if (vap->iv_opmode == IEEE80211_M_HOSTAP) {
  1261. iwe.u.data.length = vap->iv_des_nssid > 0 ?
  1262. vap->iv_des_ssid[0].len : 0;
  1263. - current_ev = iwe_stream_add_point(current_ev,
  1264. + current_ev = iwe_stream_add_point(NULL, current_ev,
  1265. end_buf, &iwe, vap->iv_des_ssid[0].ssid);
  1266. } else {
  1267. iwe.u.data.length = se->se_ssid[1];
  1268. - current_ev = iwe_stream_add_point(current_ev,
  1269. + current_ev = iwe_stream_add_point(NULL, current_ev,
  1270. end_buf, &iwe, (char *) se->se_ssid+2);
  1271. }
  1272.  
  1273. @@ -1621,7 +1621,7 @@ giwscan_cb(void *arg, const struct ieee8
  1274. iwe.cmd = SIOCGIWMODE;
  1275. iwe.u.mode = se->se_capinfo & IEEE80211_CAPINFO_ESS ?
  1276. IW_MODE_MASTER : IW_MODE_ADHOC;
  1277. - current_ev = iwe_stream_add_event(current_ev,
  1278. + current_ev = iwe_stream_add_event(NULL, current_ev,
  1279. end_buf, &iwe, IW_EV_UINT_LEN);
  1280.  
  1281. /* We ran out of space in the buffer. */
  1282. @@ -1634,7 +1634,7 @@ giwscan_cb(void *arg, const struct ieee8
  1283. iwe.cmd = SIOCGIWFREQ;
  1284. iwe.u.freq.m = se->se_chan->ic_freq * 100000;
  1285. iwe.u.freq.e = 1;
  1286. - current_ev = iwe_stream_add_event(current_ev,
  1287. + current_ev = iwe_stream_add_event(NULL, current_ev,
  1288. end_buf, &iwe, IW_EV_FREQ_LEN);
  1289.  
  1290. /* We ran out of space in the buffer. */
  1291. @@ -1645,7 +1645,7 @@ giwscan_cb(void *arg, const struct ieee8
  1292. last_ev = current_ev;
  1293. iwe.cmd = IWEVQUAL;
  1294. set_quality(&iwe.u.qual, se->se_rssi, ATH_DEFAULT_NOISE);
  1295. - current_ev = iwe_stream_add_event(current_ev,
  1296. + current_ev = iwe_stream_add_event(NULL, current_ev,
  1297. end_buf, &iwe, IW_EV_QUAL_LEN);
  1298.  
  1299. /* We ran out of space in the buffer */
  1300. @@ -1660,7 +1660,7 @@ giwscan_cb(void *arg, const struct ieee8
  1301. else
  1302. iwe.u.data.flags = IW_ENCODE_DISABLED;
  1303. iwe.u.data.length = 0;
  1304. - current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, "");
  1305. + current_ev = iwe_stream_add_point(NULL, current_ev, end_buf, &iwe, "");
  1306.  
  1307. /* We ran out of space in the buffer. */
  1308. if (last_ev == current_ev)
  1309. @@ -1675,7 +1675,7 @@ giwscan_cb(void *arg, const struct ieee8
  1310. int r = se->se_rates[2 + j] & IEEE80211_RATE_VAL;
  1311. if (r != 0) {
  1312. iwe.u.bitrate.value = r * (1000000 / 2);
  1313. - current_val = iwe_stream_add_value(current_ev,
  1314. + current_val = iwe_stream_add_value(NULL, current_ev,
  1315. current_val, end_buf, &iwe,
  1316. IW_EV_PARAM_LEN);
  1317. }
  1318. @@ -1684,7 +1684,7 @@ giwscan_cb(void *arg, const struct ieee8
  1319. int r = se->se_xrates[2+j] & IEEE80211_RATE_VAL;
  1320. if (r != 0) {
  1321. iwe.u.bitrate.value = r * (1000000 / 2);
  1322. - current_val = iwe_stream_add_value(current_ev,
  1323. + current_val = iwe_stream_add_value(NULL, current_ev,
  1324. current_val, end_buf, &iwe,
  1325. IW_EV_PARAM_LEN);
  1326. }
  1327. @@ -1704,7 +1704,7 @@ giwscan_cb(void *arg, const struct ieee8
  1328. iwe.cmd = IWEVCUSTOM;
  1329. snprintf(buf, sizeof(buf), "bcn_int=%d", se->se_intval);
  1330. iwe.u.data.length = strlen(buf);
  1331. - current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
  1332. + current_ev = iwe_stream_add_point(NULL, current_ev, end_buf, &iwe, buf);
  1333.  
  1334. /* We ran out of space in the buffer. */
  1335. if (last_ev == current_ev)
  1336. @@ -1728,7 +1728,7 @@ giwscan_cb(void *arg, const struct ieee8
  1337. rsn_leader, sizeof(rsn_leader) - 1);
  1338. #endif
  1339. if (iwe.u.data.length != 0) {
  1340. - current_ev = iwe_stream_add_point(current_ev, end_buf,
  1341. + current_ev = iwe_stream_add_point(NULL, current_ev, end_buf,
  1342. &iwe, buf);
  1343.  
  1344. /* We ran out of space in the buffer */
  1345. @@ -1754,7 +1754,7 @@ giwscan_cb(void *arg, const struct ieee8
  1346. wpa_leader, sizeof(wpa_leader) - 1);
  1347. #endif
  1348. if (iwe.u.data.length != 0) {
  1349. - current_ev = iwe_stream_add_point(current_ev, end_buf,
  1350. + current_ev = iwe_stream_add_point(NULL, current_ev, end_buf,
  1351. &iwe, buf);
  1352.  
  1353. /* We ran out of space in the buffer. */
  1354. @@ -1773,7 +1773,7 @@ giwscan_cb(void *arg, const struct ieee8
  1355. se->se_wme_ie, se->se_wme_ie[1] + 2,
  1356. wme_leader, sizeof(wme_leader) - 1);
  1357. if (iwe.u.data.length != 0) {
  1358. - current_ev = iwe_stream_add_point(current_ev, end_buf,
  1359. + current_ev = iwe_stream_add_point(NULL, current_ev, end_buf,
  1360. &iwe, buf);
  1361.  
  1362. /* We ran out of space in the buffer. */
  1363. @@ -1791,7 +1791,7 @@ giwscan_cb(void *arg, const struct ieee8
  1364. se->se_ath_ie, se->se_ath_ie[1] + 2,
  1365. ath_leader, sizeof(ath_leader) - 1);
  1366. if (iwe.u.data.length != 0) {
  1367. - current_ev = iwe_stream_add_point(current_ev, end_buf,
  1368. + current_ev = iwe_stream_add_point(NULL, current_ev, end_buf,
  1369. &iwe, buf);
  1370.  
  1371. /* We ran out of space in the buffer. */
  1372. @@ -1809,7 +1809,7 @@ static int
  1373. ieee80211_ioctl_giwscan(struct net_device *dev, struct iw_request_info *info,
  1374. struct iw_point *data, char *extra)
  1375. {
  1376. - struct ieee80211vap *vap = dev->priv;
  1377. + struct ieee80211vap *vap = netdev_priv(dev);
  1378. struct ieee80211com *ic = vap->iv_ic;
  1379. struct iwscanreq req;
  1380. int res = 0;
  1381. @@ -1910,7 +1910,7 @@ static int
  1382. ieee80211_ioctl_setmode(struct net_device *dev, struct iw_request_info *info,
  1383. struct iw_point *wri, char *extra)
  1384. {
  1385. - struct ieee80211vap *vap = dev->priv;
  1386. + struct ieee80211vap *vap = netdev_priv(dev);
  1387. struct ieee80211com *ic = vap->iv_ic;
  1388. struct ifreq ifr;
  1389. char s[6]; /* big enough for ``11adt'' */
  1390. @@ -2035,10 +2035,10 @@ ieee80211_setathcap(struct ieee80211vap
  1391. static int
  1392. ieee80211_set_turbo(struct net_device *dev, int flag)
  1393. {
  1394. - struct ieee80211vap *vap = dev->priv;
  1395. + struct ieee80211vap *vap = netdev_priv(dev);
  1396. struct ieee80211com *ic = vap->iv_ic;
  1397. struct ifreq ifr;
  1398. - struct ieee80211vap *tmpvap = dev->priv;
  1399. + struct ieee80211vap *tmpvap = netdev_priv(dev);
  1400. int nvap = 0;
  1401.  
  1402. TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next)
  1403. @@ -2059,7 +2059,7 @@ static int
  1404. ieee80211_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
  1405. void *w, char *extra)
  1406. {
  1407. - struct ieee80211vap *vap = dev->priv;
  1408. + struct ieee80211vap *vap = netdev_priv(dev);
  1409. struct ieee80211com *ic = vap->iv_ic;
  1410. struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn;
  1411. int *i = (int *) extra;
  1412. @@ -2591,7 +2591,7 @@ static int
  1413. ieee80211_ioctl_getmode(struct net_device *dev, struct iw_request_info *info,
  1414. struct iw_point *wri, char *extra)
  1415. {
  1416. - struct ieee80211vap *vap = dev->priv;
  1417. + struct ieee80211vap *vap = netdev_priv(dev);
  1418. struct ieee80211com *ic = vap->iv_ic;
  1419. struct ifmediareq imr;
  1420.  
  1421. @@ -2629,7 +2629,7 @@ static int
  1422. ieee80211_ioctl_getparam(struct net_device *dev, struct iw_request_info *info,
  1423. void *w, char *extra)
  1424. {
  1425. - struct ieee80211vap *vap = dev->priv;
  1426. + struct ieee80211vap *vap = netdev_priv(dev);
  1427. struct ieee80211com *ic = vap->iv_ic;
  1428. struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn;
  1429. int *param = (int *) extra;
  1430. @@ -2904,7 +2904,7 @@ static int
  1431. ieee80211_ioctl_setoptie(struct net_device *dev, struct iw_request_info *info,
  1432. struct iw_point *wri, char *extra)
  1433. {
  1434. - struct ieee80211vap *vap = dev->priv;
  1435. + struct ieee80211vap *vap = netdev_priv(dev);
  1436. void *ie;
  1437.  
  1438. /*
  1439. @@ -2938,7 +2938,7 @@ static int
  1440. ieee80211_ioctl_getoptie(struct net_device *dev, struct iw_request_info *info,
  1441. struct iw_point *wri, char *extra)
  1442. {
  1443. - struct ieee80211vap *vap = dev->priv;
  1444. + struct ieee80211vap *vap = netdev_priv(dev);
  1445.  
  1446. if (vap->iv_opt_ie == NULL) {
  1447. wri->length = 0;
  1448. @@ -3002,7 +3002,7 @@ ieee80211_ioctl_setappiebuf(struct net_d
  1449. struct iw_request_info *info,
  1450. struct iw_point *data, char *extra)
  1451. {
  1452. - struct ieee80211vap *vap = dev->priv;
  1453. + struct ieee80211vap *vap = netdev_priv(dev);
  1454. struct ieee80211req_getset_appiebuf *iebuf =
  1455. (struct ieee80211req_getset_appiebuf *)extra;
  1456. enum ieee80211_opmode chk_opmode;
  1457. @@ -3044,7 +3044,7 @@ static int
  1458. ieee80211_ioctl_getappiebuf(struct net_device *dev, struct iw_request_info *info,
  1459. struct iw_point *data, char *extra)
  1460. {
  1461. - struct ieee80211vap *vap = dev->priv;
  1462. + struct ieee80211vap *vap = netdev_priv(dev);
  1463. struct ieee80211req_getset_appiebuf *iebuf =
  1464. (struct ieee80211req_getset_appiebuf *)extra;
  1465. int max_iebuf_len;
  1466. @@ -3085,7 +3085,7 @@ static int
  1467. ieee80211_ioctl_setfilter(struct net_device *dev, struct iw_request_info *info,
  1468. void *w, char *extra)
  1469. {
  1470. - struct ieee80211vap *vap = dev->priv;
  1471. + struct ieee80211vap *vap = netdev_priv(dev);
  1472. struct ieee80211req_set_filter *app_filter = (struct ieee80211req_set_filter *)extra;
  1473.  
  1474. if ((extra == NULL) || (app_filter->app_filterype & ~IEEE80211_FILTER_TYPE_ALL))
  1475. @@ -3100,7 +3100,7 @@ static int
  1476. ieee80211_ioctl_setkey(struct net_device *dev, struct iw_request_info *info,
  1477. void *w, char *extra)
  1478. {
  1479. - struct ieee80211vap *vap = dev->priv;
  1480. + struct ieee80211vap *vap = netdev_priv(dev);
  1481. struct ieee80211com *ic = vap->iv_ic;
  1482. struct ieee80211req_key *ik = (struct ieee80211req_key *)extra;
  1483. struct ieee80211_node *ni;
  1484. @@ -3169,7 +3169,7 @@ ieee80211_ioctl_setkey(struct net_device
  1485. static int
  1486. ieee80211_ioctl_getkey(struct net_device *dev, struct iwreq *iwr)
  1487. {
  1488. - struct ieee80211vap *vap = dev->priv;
  1489. + struct ieee80211vap *vap = netdev_priv(dev);
  1490. struct ieee80211com *ic = vap->iv_ic;
  1491. struct ieee80211_node *ni;
  1492. struct ieee80211req_key ik;
  1493. @@ -3225,7 +3225,7 @@ static int
  1494. ieee80211_ioctl_delkey(struct net_device *dev, struct iw_request_info *info,
  1495. void *w, char *extra)
  1496. {
  1497. - struct ieee80211vap *vap = dev->priv;
  1498. + struct ieee80211vap *vap = netdev_priv(dev);
  1499. struct ieee80211com *ic = vap->iv_ic;
  1500. struct ieee80211req_del_key *dk = (struct ieee80211req_del_key *)extra;
  1501. int kid;
  1502. @@ -3297,7 +3297,7 @@ static int
  1503. ieee80211_ioctl_setmlme(struct net_device *dev, struct iw_request_info *info,
  1504. void *w, char *extra)
  1505. {
  1506. - struct ieee80211vap *vap = dev->priv;
  1507. + struct ieee80211vap *vap = netdev_priv(dev);
  1508. struct ieee80211com *ic = vap->iv_ic;
  1509. struct ieee80211req_mlme *mlme = (struct ieee80211req_mlme *)extra;
  1510. struct ieee80211_node *ni;
  1511. @@ -3385,7 +3385,7 @@ static int
  1512. ieee80211_ioctl_wdsmac(struct net_device *dev, struct iw_request_info *info,
  1513. void *w, char *extra)
  1514. {
  1515. - struct ieee80211vap *vap = dev->priv;
  1516. + struct ieee80211vap *vap = netdev_priv(dev);
  1517. struct sockaddr *sa = (struct sockaddr *)extra;
  1518. struct ieee80211com *ic = vap->iv_ic;
  1519.  
  1520. @@ -3412,7 +3412,7 @@ static int
  1521. ieee80211_ioctl_wdsdelmac(struct net_device *dev, struct iw_request_info *info,
  1522. void *w, char *extra)
  1523. {
  1524. - struct ieee80211vap *vap = dev->priv;
  1525. + struct ieee80211vap *vap = netdev_priv(dev);
  1526. struct sockaddr *sa = (struct sockaddr *)extra;
  1527. struct ieee80211com *ic = vap->iv_ic;
  1528.  
  1529. @@ -3462,7 +3462,7 @@ static int
  1530. ieee80211_ioctl_addmac(struct net_device *dev, struct iw_request_info *info,
  1531. void *w, char *extra)
  1532. {
  1533. - struct ieee80211vap *vap = dev->priv;
  1534. + struct ieee80211vap *vap = netdev_priv(dev);
  1535. struct sockaddr *sa = (struct sockaddr *)extra;
  1536. const struct ieee80211_aclator *acl = vap->iv_acl;
  1537.  
  1538. @@ -3480,7 +3480,7 @@ static int
  1539. ieee80211_ioctl_delmac(struct net_device *dev, struct iw_request_info *info,
  1540. void *w, char *extra)
  1541. {
  1542. - struct ieee80211vap *vap = dev->priv;
  1543. + struct ieee80211vap *vap = netdev_priv(dev);
  1544. struct sockaddr *sa = (struct sockaddr *)extra;
  1545. const struct ieee80211_aclator *acl = vap->iv_acl;
  1546.  
  1547. @@ -3498,7 +3498,7 @@ static int
  1548. ieee80211_ioctl_setchanlist(struct net_device *dev,
  1549. struct iw_request_info *info, void *w, char *extra)
  1550. {
  1551. - struct ieee80211vap *vap = dev->priv;
  1552. + struct ieee80211vap *vap = netdev_priv(dev);
  1553. struct ieee80211com *ic = vap->iv_ic;
  1554. struct ieee80211req_chanlist *list =
  1555. (struct ieee80211req_chanlist *)extra;
  1556. @@ -3540,7 +3540,7 @@ static int
  1557. ieee80211_ioctl_getchanlist(struct net_device *dev,
  1558. struct iw_request_info *info, void *w, char *extra)
  1559. {
  1560. - struct ieee80211vap *vap = dev->priv;
  1561. + struct ieee80211vap *vap = netdev_priv(dev);
  1562. struct ieee80211com *ic = vap->iv_ic;
  1563.  
  1564. memcpy(extra, ic->ic_chan_active, sizeof(ic->ic_chan_active));
  1565. @@ -3551,7 +3551,7 @@ static int
  1566. ieee80211_ioctl_getchaninfo(struct net_device *dev,
  1567. struct iw_request_info *info, void *w, char *extra)
  1568. {
  1569. - struct ieee80211vap *vap = dev->priv;
  1570. + struct ieee80211vap *vap = netdev_priv(dev);
  1571. struct ieee80211com *ic = vap->iv_ic;
  1572. struct ieee80211req_chaninfo *chans =
  1573. (struct ieee80211req_chaninfo *) extra;
  1574. @@ -3595,7 +3595,7 @@ static int
  1575. ieee80211_ioctl_setwmmparams(struct net_device *dev,
  1576. struct iw_request_info *info, void *w, char *extra)
  1577. {
  1578. - struct ieee80211vap *vap = dev->priv;
  1579. + struct ieee80211vap *vap = netdev_priv(dev);
  1580. int *param = (int *) extra;
  1581. int ac = (param[1] >= 0 && param[1] < WME_NUM_AC) ?
  1582. param[1] : WME_AC_BE;
  1583. @@ -3684,7 +3684,7 @@ static int
  1584. ieee80211_ioctl_getwmmparams(struct net_device *dev,
  1585. struct iw_request_info *info, void *w, char *extra)
  1586. {
  1587. - struct ieee80211vap *vap = dev->priv;
  1588. + struct ieee80211vap *vap = netdev_priv(dev);
  1589. int *param = (int *) extra;
  1590. int ac = (param[1] >= 0 && param[1] < WME_NUM_AC) ?
  1591. param[1] : WME_AC_BE;
  1592. @@ -3720,7 +3720,7 @@ ieee80211_ioctl_getwmmparams(struct net_
  1593. static int
  1594. ieee80211_ioctl_getwpaie(struct net_device *dev, struct iwreq *iwr)
  1595. {
  1596. - struct ieee80211vap *vap = dev->priv;
  1597. + struct ieee80211vap *vap = netdev_priv(dev);
  1598. struct ieee80211com *ic = vap->iv_ic;
  1599. struct ieee80211_node *ni;
  1600. struct ieee80211req_wpaie wpaie;
  1601. @@ -3753,7 +3753,7 @@ ieee80211_ioctl_getwpaie(struct net_devi
  1602. static int
  1603. ieee80211_ioctl_getstastats(struct net_device *dev, struct iwreq *iwr)
  1604. {
  1605. - struct ieee80211vap *vap = dev->priv;
  1606. + struct ieee80211vap *vap = netdev_priv(dev);
  1607. struct ieee80211com *ic = vap->iv_ic;
  1608. struct ieee80211_node *ni;
  1609. u_int8_t macaddr[IEEE80211_ADDR_LEN];
  1610. @@ -3871,7 +3871,7 @@ get_scan_result(void *arg, const struct
  1611. static int
  1612. ieee80211_ioctl_getscanresults(struct net_device *dev, struct iwreq *iwr)
  1613. {
  1614. - struct ieee80211vap *vap = dev->priv;
  1615. + struct ieee80211vap *vap = netdev_priv(dev);
  1616. struct ieee80211com *ic = vap->iv_ic;
  1617. struct scanreq req;
  1618. int error;
  1619. @@ -4029,7 +4029,7 @@ get_sta_info(void *arg, struct ieee80211
  1620. static int
  1621. ieee80211_ioctl_getstainfo(struct net_device *dev, struct iwreq *iwr)
  1622. {
  1623. - struct ieee80211vap *vap = dev->priv;
  1624. + struct ieee80211vap *vap = netdev_priv(dev);
  1625. struct ieee80211com *ic = vap->iv_ic;
  1626. struct stainforeq req;
  1627. int error;
  1628. @@ -4063,7 +4063,7 @@ ieee80211_ioctl_getstainfo(struct net_de
  1629.  
  1630. static void
  1631. pre_announced_chanswitch(struct net_device *dev, u_int32_t channel, u_int32_t tbtt) {
  1632. - struct ieee80211vap *vap = dev->priv;
  1633. + struct ieee80211vap *vap = netdev_priv(dev);
  1634. struct ieee80211com *ic = vap->iv_ic;
  1635. /* now flag the beacon update to include the channel switch IE */
  1636. ic->ic_flags |= IEEE80211_F_CHANSWITCH;
  1637. @@ -4075,7 +4075,7 @@ static int
  1638. ieee80211_ioctl_chanswitch(struct net_device *dev, struct iw_request_info *info,
  1639. void *w, char *extra)
  1640. {
  1641. - struct ieee80211vap *vap = dev->priv;
  1642. + struct ieee80211vap *vap = netdev_priv(dev);
  1643. struct ieee80211com *ic = vap->iv_ic;
  1644. int *param = (int *) extra;
  1645.  
  1646. @@ -4120,7 +4120,7 @@ static int
  1647. ieee80211_ioctl_giwgenie(struct net_device *dev,
  1648. struct iw_request_info *info, struct iw_point *out, char *buf)
  1649. {
  1650. - struct ieee80211vap *vap = dev->priv;
  1651. + struct ieee80211vap *vap = netdev_priv(dev);
  1652.  
  1653. if (out->length < vap->iv_opt_ie_len)
  1654. return -E2BIG;
  1655. @@ -4653,7 +4653,7 @@ static int
  1656. ieee80211_ioctl_giwencodeext(struct net_device *dev,
  1657. struct iw_request_info *info, struct iw_point *erq, char *extra)
  1658. {
  1659. - struct ieee80211vap *vap = dev->priv;
  1660. + struct ieee80211vap *vap = netdev_priv(dev);
  1661. struct iw_encode_ext *ext;
  1662. struct ieee80211_key *wk;
  1663. int error;
  1664. @@ -4713,7 +4713,7 @@ static int
  1665. ieee80211_ioctl_siwencodeext(struct net_device *dev,
  1666. struct iw_request_info *info, struct iw_point *erq, char *extra)
  1667. {
  1668. - struct ieee80211vap *vap = dev->priv;
  1669. + struct ieee80211vap *vap = netdev_priv(dev);
  1670. struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
  1671. struct ieee80211req_key kr;
  1672. int error;
  1673. @@ -5297,7 +5297,7 @@ static void ieee80211_delete_wlanunit(u_
  1674. static int
  1675. ieee80211_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
  1676. {
  1677. - struct ieee80211vap *vap = dev->priv;
  1678. + struct ieee80211vap *vap = netdev_priv(dev);
  1679. u_int unit;
  1680.  
  1681. switch (cmd) {
  1682. diff -rupN madwifi-0.9.4/net80211/modules.order madwifi-0.9.4-patched/net80211/modules.order
  1683. --- madwifi-0.9.4/net80211/modules.order 1970-01-01 02:00:00.000000000 +0200
  1684. +++ madwifi-0.9.4-patched/net80211/modules.order 2009-08-06 12:23:14.000000000 +0300
  1685. @@ -0,0 +1,8 @@
  1686. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan.ko
  1687. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_wep.ko
  1688. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_tkip.ko
  1689. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_ccmp.ko
  1690. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_acl.ko
  1691. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_xauth.ko
  1692. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_scan_sta.ko
  1693. +kernel//home/d4de/docs/code/c/madwifi-0.9.4/net80211/wlan_scan_ap.ko
  1694.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement