diff options
| -rw-r--r-- | recipes/madwifi/files/madwifi-fix-2.6.30.patch | 1857 | ||||
| -rw-r--r-- | recipes/madwifi/files/powerpc-fix.patch | 12 | ||||
| -rw-r--r-- | recipes/madwifi/madwifi-ng_r.inc | 1 | ||||
| -rw-r--r-- | recipes/madwifi/madwifi-ng_r3837-20080802.bb | 1 |
4 files changed, 1871 insertions, 0 deletions
diff --git a/recipes/madwifi/files/madwifi-fix-2.6.30.patch b/recipes/madwifi/files/madwifi-fix-2.6.30.patch new file mode 100644 index 0000000000..b0b039b896 --- /dev/null +++ b/recipes/madwifi/files/madwifi-fix-2.6.30.patch @@ -0,0 +1,1857 @@ +Index: madwifi-trunk-r3837-20080802/ath/if_ath.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath/if_ath.c 2008-07-19 02:00:42.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath/if_ath.c 2009-05-07 20:22:08.750387590 +0400 +@@ -475,7 +475,7 @@ + int + ath_attach(u_int16_t devid, struct net_device *dev, HAL_BUS_TAG tag) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap; + struct ath_hal *ah; +@@ -1127,7 +1127,7 @@ + int + ath_detach(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + + HAL_INT tmp; +@@ -1191,7 +1191,7 @@ + ath_vap_create(struct ieee80211com *ic, const char *name, + int opmode, int flags, struct net_device *mdev) + { +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + struct ath_hal *ah = sc->sc_ah; + struct net_device *dev; + struct ath_vap *avp; +@@ -1266,7 +1266,7 @@ + return NULL; + } + +- avp = dev->priv; ++ avp = netdev_priv(dev); + ieee80211_vap_setup(ic, dev, name, opmode, flags); + /* override with driver methods */ + vap = &avp->av_vap; +@@ -1450,7 +1450,7 @@ + ath_vap_delete(struct ieee80211vap *vap) + { + struct net_device *dev = vap->iv_ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ath_vap *avp = ATH_VAP(vap); + int decrease = 1; +@@ -1550,14 +1550,14 @@ + void + ath_suspend(struct net_device *dev) + { +- DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); ++ DPRINTF(((struct ath_softc *)netdev_priv(dev)), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); + ath_stop(dev); + } + + void + ath_resume(struct net_device *dev) + { +- DPRINTF(((struct ath_softc *)dev->priv), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); ++ DPRINTF(((struct ath_softc *)netdev_priv(dev)), ATH_DEBUG_ANY, "flags=%x\n", dev->flags); + ath_init(dev); + } + +@@ -2312,7 +2312,7 @@ + #endif + { + struct net_device *dev = dev_id; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + u_int64_t hw_tsf = 0; + HAL_INT status; +@@ -2508,7 +2508,7 @@ + ath_fatal_tasklet(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + EPRINTF(sc, "Hardware error; resetting.\n"); + ath_reset(dev); +@@ -2518,7 +2518,7 @@ + ath_rxorn_tasklet(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + EPRINTF(sc, "Receive FIFO overrun; resetting.\n"); + ath_reset(dev); +@@ -2528,7 +2528,7 @@ + ath_bmiss_tasklet(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + if (time_before(jiffies, sc->sc_ic.ic_bmiss_guard)) { + /* Beacon miss interrupt occured too short after last beacon +@@ -2570,7 +2570,7 @@ + static int + ath_init(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + HAL_STATUS status; +@@ -2673,7 +2673,7 @@ + static int + ath_stop_locked(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + +@@ -2754,7 +2754,7 @@ + static int + ath_stop(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + int error; + + ATH_LOCK(sc); +@@ -2794,7 +2794,7 @@ + static int + ath_reset(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_channel *c; +@@ -2999,7 +2999,7 @@ + static int + ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_phy_params *ph = &(SKB_CB(skb)->phy); + const HAL_RATE_TABLE *rt; +@@ -3312,7 +3312,7 @@ + static int + ath_hardstart(struct sk_buff *__skb, struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211_node *ni = NULL; + struct ath_buf *bf = NULL; + struct ether_header *eh; +@@ -3659,7 +3659,7 @@ + ath_mgtstart(struct ieee80211com *ic, struct sk_buff *skb) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_buf *bf = NULL; + int error; + +@@ -3991,7 +3991,7 @@ + ath_key_alloc(struct ieee80211vap *vap, const struct ieee80211_key *k) + { + struct net_device *dev = vap->iv_ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + /* + * Group key allocation must be handled specially for +@@ -4056,7 +4056,7 @@ + struct ieee80211_node *ninfo) + { + struct net_device *dev = vap->iv_ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_node *ni = NULL; + const struct ieee80211_cipher *cip = k->wk_cipher; +@@ -4132,7 +4132,7 @@ + const u_int8_t mac[IEEE80211_ADDR_LEN]) + { + struct net_device *dev = vap->iv_ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + return ath_keyset(sc, k, mac, vap->iv_bss); + } +@@ -4147,7 +4147,7 @@ + ath_key_update_begin(struct ieee80211vap *vap) + { + struct net_device *dev = vap->iv_ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "Begin\n"); + /* +@@ -4168,7 +4168,7 @@ + ath_key_update_end(struct ieee80211vap *vap) + { + struct net_device *dev = vap->iv_ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n"); + netif_wake_queue(dev); +@@ -4258,7 +4258,7 @@ + static void + ath_mode_init(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + u_int32_t rfilt, mfilt[2]; + +@@ -4393,7 +4393,7 @@ + static void + ath_updateslot(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + + /* +@@ -4420,7 +4420,7 @@ + ath_beacon_dturbo_config(struct ieee80211vap *vap, u_int32_t intval) + { + struct ieee80211com *ic = vap->iv_ic; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + + /* Check VAP capability. */ + if ((ic->ic_opmode == IEEE80211_M_HOSTAP) && vap->iv_bss && +@@ -4469,7 +4469,7 @@ + ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark, u_int8_t dtim) + { + struct ieee80211com *ic = vap->iv_ic; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + u_int32_t bss_traffic; + + if (sc->sc_ignore_ar) { +@@ -4612,7 +4612,7 @@ + ath_turbo_switch_mode(unsigned long data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + unsigned int newflags; + +@@ -5326,7 +5326,7 @@ + ath_bstuck_tasklet(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + /* + * XXX:if the bmisscount is cleared while the + * tasklet execution is pending, the following +@@ -5734,7 +5734,7 @@ + static struct ieee80211_node * + ath_node_alloc(struct ieee80211vap *vap) + { +- struct ath_softc *sc = vap->iv_ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev); + const size_t space = sizeof(struct ath_node) + sc->sc_rc->arc_space; + struct ath_node *an = kzalloc(space, GFP_ATOMIC); + if (an != NULL) { +@@ -5762,7 +5762,7 @@ + ath_node_cleanup(struct ieee80211_node *ni) + { + struct ieee80211com *ic = ni->ni_ic; +- struct ath_softc *sc = ni->ni_ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev); + struct ath_node *an = ATH_NODE(ni); + struct ath_buf *bf; + +@@ -5847,7 +5847,7 @@ + #ifdef NOT_YET + struct ath_txq *txq = NULL; + struct ieee80211com *ic = ni->ni_ic; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + struct ath_buf *bf, *prev, *bf_tmp, *bf_tmp1; + struct ath_hal *ah = sc->sc_ah; + struct sk_buff *skb = NULL; +@@ -6283,7 +6283,7 @@ + ath_recv_mgmt(struct ieee80211vap * vap, struct ieee80211_node *ni_or_null, + struct sk_buff *skb, int subtype, int rssi, u_int64_t rtsf) + { +- struct ath_softc *sc = vap->iv_ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev); + struct ieee80211_node * ni = ni_or_null; + u_int64_t hw_tsf, beacon_tsf; + u_int32_t hw_tu, beacon_tu, intval; +@@ -6406,7 +6406,7 @@ + ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr))) + struct net_device *dev = (struct net_device *)data; + struct ath_buf *bf; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc ? sc->sc_ah : NULL; + struct ath_desc *ds; +@@ -6844,7 +6844,7 @@ + struct sk_buff *skb = NULL; + struct ath_buf *bf = NULL, *head = NULL; + struct ieee80211com *ic = vap->iv_ic; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + struct ath_hal *ah = sc->sc_ah; + u_int8_t rate; + unsigned int ctsrate = 0, ctsduration = 0; +@@ -7050,7 +7050,7 @@ + static void ath_grppoll_stop(struct ieee80211vap *vap) + { + struct ieee80211com *ic = vap->iv_ic; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + struct ath_hal *ah = sc->sc_ah; + struct ath_txq *txq = &sc->sc_grpplq; + struct ath_buf *bf; +@@ -7256,7 +7256,7 @@ + static int + ath_wme_update(struct ieee80211com *ic) + { +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + + if (sc->sc_uapsdq) + ath_txq_update(sc, sc->sc_uapsdq, WME_AC_VO); +@@ -7275,7 +7275,7 @@ + { + struct ath_node *an = ATH_NODE(ni); + struct ath_buf *bf; +- struct ath_softc *sc = ni->ni_ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ni->ni_ic->ic_dev); + struct ath_txq *txq; + + ATH_NODE_UAPSD_LOCK_IRQ(an); +@@ -7448,7 +7448,7 @@ + ath_tx_start(struct net_device *dev, struct ieee80211_node *ni, + struct ath_buf *bf, struct sk_buff *skb, int nextfraglen) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = ni->ni_ic; + struct ieee80211vap *vap = ni->ni_vap; + struct ath_hal *ah = sc->sc_ah; +@@ -8297,7 +8297,7 @@ + ath_tx_tasklet_q0(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + if (txqactive(sc->sc_ah, 0)) + ath_tx_processq(sc, &sc->sc_txq[0]); +@@ -8318,7 +8318,7 @@ + ath_tx_tasklet_q0123(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + /* + * Process each active queue. +@@ -8362,7 +8362,7 @@ + ath_tx_tasklet(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + unsigned int i; + + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { +@@ -8395,7 +8395,7 @@ + static void + ath_tx_timeout(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + int i; + + if (ath_chan_unavail(sc)) +@@ -8780,7 +8780,7 @@ + ath_calibrate(unsigned long arg) + { + struct net_device *dev = (struct net_device *)arg; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + /* u_int32_t nchans; */ +@@ -8860,7 +8860,7 @@ + ath_scan_start(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + u_int32_t rfilt; + +@@ -8880,7 +8880,7 @@ + ath_scan_end(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + u_int32_t rfilt; + +@@ -8898,7 +8898,7 @@ + ath_set_channel(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + (void) ath_chan_set(sc, ic->ic_curchan); + /* +@@ -8914,7 +8914,7 @@ + static void + ath_set_coverageclass(struct ieee80211com *ic) + { +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + + ath_hal_setcoverageclass(sc->sc_ah, ic->ic_coverageclass, 0); + +@@ -8924,7 +8924,7 @@ + static u_int + ath_mhz2ieee(struct ieee80211com *ic, u_int freq, u_int flags) + { +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + + return (ath_hal_mhz2ieee(sc->sc_ah, freq, flags)); + } +@@ -8939,7 +8939,7 @@ + struct ath_vap *avp = ATH_VAP(vap); + struct ieee80211com *ic = vap->iv_ic; + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_node *ni, *wds_ni; + unsigned int i; +@@ -9381,7 +9381,7 @@ + ath_setup_comp(struct ieee80211_node *ni, int enable) + { + struct ieee80211vap *vap = ni->ni_vap; +- struct ath_softc *sc = vap->iv_ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev); + struct ath_node *an = ATH_NODE(ni); + ieee80211_keyix_t keyix; + +@@ -9434,7 +9434,7 @@ + ath_setup_stationkey(struct ieee80211_node *ni) + { + struct ieee80211vap *vap = ni->ni_vap; +- struct ath_softc *sc = vap->iv_ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev); + ieee80211_keyix_t keyix; + + keyix = ath_key_alloc(vap, &ni->ni_ucastkey); +@@ -9595,7 +9595,7 @@ + { + struct ieee80211com *ic = ni->ni_ic; + struct ieee80211vap *vap = ni->ni_vap; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + + sc->sc_rc->ops->newassoc(sc, ATH_NODE(ni), isnew); + +@@ -9626,7 +9626,7 @@ + ath_getchannels(struct net_device *dev, u_int cc, + HAL_BOOL outdoor, HAL_BOOL xchanmode) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + HAL_CHANNEL *chans; +@@ -9924,7 +9924,7 @@ + static int + ath_xr_rate_setup(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + const HAL_RATE_TABLE *rt; +@@ -9953,7 +9953,7 @@ + static void + ath_setup_subrates(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + const HAL_RATE_TABLE *rt; +@@ -9996,7 +9996,7 @@ + static int + ath_rate_setup(struct net_device *dev, u_int mode) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211com *ic = &sc->sc_ic; + const HAL_RATE_TABLE *rt; +@@ -10220,7 +10220,7 @@ + { + const struct ath_tx_status *ts = &bf->bf_dsstatus.ds_txstat; + const struct ath_desc *ds = bf->bf_desc; +- struct ath_softc *sc = ATH_BUF_NI(bf)->ni_ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ATH_BUF_NI(bf)->ni_ic->ic_dev); + u_int8_t status = done ? ts->ts_status : 0; + + DPRINTF(sc, ATH_DEBUG_ANY, +@@ -10247,7 +10247,7 @@ + static struct net_device_stats * + ath_getstats(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct net_device_stats *stats = &sc->sc_devstats; + + /* update according to private statistics */ +@@ -10270,7 +10270,7 @@ + static int + ath_set_mac_address(struct net_device *dev, void *addr) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct sockaddr *mac = addr; +@@ -10299,7 +10299,7 @@ + static int + ath_change_mtu(struct net_device *dev, int mtu) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + int error = 0; + + if (!(ATH_MIN_MTU < mtu && mtu <= ATH_MAX_MTU)) { +@@ -10388,7 +10388,7 @@ + static int + ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ieee80211com *ic = &sc->sc_ic; + struct ath_diag ad; + int error; +@@ -11141,7 +11141,7 @@ + static void + ath_announce(struct net_device *dev) + { +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + u_int modes, cc; + #if 0 +@@ -11337,7 +11337,7 @@ + txcont_configure_radio(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_wme_state *wme = &ic->ic_wme; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); +@@ -11608,7 +11608,7 @@ + txcont_queue_packet(struct ieee80211com *ic, struct ath_txq *txq) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct ath_hal *ah = sc->sc_ah; + struct ath_buf *bf = NULL; + struct sk_buff *skb = NULL; +@@ -11742,7 +11742,7 @@ + txcont_on(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + if (IFF_RUNNING != (ic->ic_dev->flags & IFF_RUNNING)) { + EPRINTF(sc, "Cannot enable txcont when" +@@ -11763,7 +11763,7 @@ + txcont_off(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + if (TAILQ_FIRST(&ic->ic_vaps)->iv_opmode != IEEE80211_M_WDS) + sc->sc_beacons = 1; +@@ -11777,7 +11777,7 @@ + ath_get_dfs_testmode(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + return sc->sc_dfs_testmode; + } + +@@ -11804,7 +11804,7 @@ + ath_set_dfs_testmode(struct ieee80211com *ic, int value) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + sc->sc_dfs_testmode = !!value; + } + +@@ -11814,7 +11814,7 @@ + ath_get_txcont(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + return sc->sc_txcont; + } + +@@ -11832,7 +11832,7 @@ + ath_set_txcont_power(struct ieee80211com *ic, unsigned int txpower) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + int new_txcont_power = txpower > IEEE80211_TXPOWER_MAX ? + IEEE80211_TXPOWER_MAX : txpower; + if (sc->sc_txcont_power != new_txcont_power) { +@@ -11850,7 +11850,7 @@ + ath_get_txcont_power(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + /* VERY conservative default */ + return sc->sc_txcont_power ? sc->sc_txcont_power : 0; + } +@@ -11860,7 +11860,7 @@ + ath_set_txcont_rate(struct ieee80211com *ic, unsigned int new_rate) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + if (sc->sc_txcont_rate != new_rate) { + /* NOTE: This value is sanity checked and dropped down to + * closest rate in txcont_on. */ +@@ -11877,7 +11877,7 @@ + ath_get_txcont_rate(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + return sc->sc_txcont_rate ? sc->sc_txcont_rate : 0; + } + +@@ -11887,7 +11887,7 @@ + ath_set_dfs_cac_time(struct ieee80211com *ic, unsigned int time_s) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + sc->sc_dfs_cac_period = time_s; + } + +@@ -11897,7 +11897,7 @@ + ath_get_dfs_cac_time(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + return sc->sc_dfs_cac_period; + } + +@@ -11917,7 +11917,7 @@ + ath_set_dfs_excl_period(struct ieee80211com *ic, unsigned int time_s) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + sc->sc_dfs_excl_period = time_s; + } + +@@ -11926,7 +11926,7 @@ + ath_get_dfs_excl_period(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + return sc->sc_dfs_excl_period; + } + +@@ -11938,7 +11938,7 @@ + ath_test_radar(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + if ((ic->ic_flags & IEEE80211_F_DOTH) && (sc->sc_curchan.privFlags & CHANNEL_DFS)) + ath_radar_detected(sc, "ath_test_radar from user space"); + else +@@ -11953,7 +11953,7 @@ + ath_dump_hal_map(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + ath_hal_dump_map(sc->sc_ah); + return 0; + } +@@ -12062,7 +12062,7 @@ + void *ptr) + { + struct net_device *dev = (struct net_device *)ptr; +- struct ath_softc *sc = (struct ath_softc *)dev->priv; ++ struct ath_softc *sc = (struct ath_softc *)netdev_priv(dev); + + if (!dev || !sc || dev->open != &ath_init) + return 0; +@@ -12179,7 +12179,7 @@ + ath_read_register(struct ieee80211com *ic, unsigned int address, + unsigned int *value) + { +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + if (address >= MAX_REGISTER_ADDRESS) { + IPRINTF(sc, "Illegal Atheros register access " + "attempted: 0x%04x >= 0x%04x\n", +@@ -12209,7 +12209,7 @@ + ath_write_register(struct ieee80211com *ic, unsigned int address, + unsigned int value) + { +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + if (address >= MAX_REGISTER_ADDRESS) { + IPRINTF(sc, "Illegal Atheros register access " + "attempted: 0x%04x >= 0x%04x\n", +@@ -12237,7 +12237,7 @@ + ath_registers_dump(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + ath_ar5212_registers_dump(sc); + } + #endif /* #ifdef ATH_REVERSE_ENGINEERING */ +@@ -12249,7 +12249,7 @@ + ath_registers_mark(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + ath_ar5212_registers_mark(sc); + } + #endif /* #ifdef ATH_REVERSE_ENGINEERING */ +@@ -12261,7 +12261,7 @@ + ath_registers_dump_delta(struct ieee80211com *ic) + { + struct net_device *dev = ic->ic_dev; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + ath_ar5212_registers_dump_delta(sc); + } + #endif /* #ifdef ATH_REVERSE_ENGINEERING */ +@@ -12433,7 +12433,7 @@ + static int ath_debug_iwpriv(struct ieee80211com *ic, + unsigned int param, unsigned int value) + { +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + switch (param) { + case IEEE80211_PARAM_DRAINTXQ: + printk("Draining tx queue...\n"); +Index: madwifi-trunk-r3837-20080802/ath/if_ath_pci.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath/if_ath_pci.c 2008-07-31 01:33:40.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath/if_ath_pci.c 2009-05-07 20:22:08.754386303 +0400 +@@ -214,7 +214,7 @@ + printk(KERN_ERR "%s: no memory for device state\n", dev_info); + goto bad2; + } +- sc = dev->priv; ++ sc = netdev_priv(dev); + sc->aps_sc.sc_dev = dev; + sc->aps_sc.sc_iobase = mem; + +@@ -295,7 +295,7 @@ + ath_pci_remove(struct pci_dev *pdev) + { + struct net_device *dev = pci_get_drvdata(pdev); +- struct ath_pci_softc *sc = dev->priv; ++ struct ath_pci_softc *sc = netdev_priv(dev); + + ath_detach(dev); + if (dev->irq) +@@ -313,7 +313,7 @@ + struct net_device *dev = pci_get_drvdata(pdev); + + ath_suspend(dev); +- PCI_SAVE_STATE(pdev, ((struct ath_pci_softc *)dev->priv)->aps_pmstate); ++ PCI_SAVE_STATE(pdev, ((struct ath_pci_softc *)netdev_priv(dev))->aps_pmstate); + pci_disable_device(pdev); + return pci_set_power_state(pdev, PCI_D3hot); + } +@@ -330,7 +330,7 @@ + return err; + + /* XXX - Should this return nonzero on fail? */ +- PCI_RESTORE_STATE(pdev, ((struct ath_pci_softc *)dev->priv)->aps_pmstate); ++ PCI_RESTORE_STATE(pdev, ((struct ath_pci_softc *)netdev_priv(dev))->aps_pmstate); + + err = pci_enable_device(pdev); + if (err) +Index: madwifi-trunk-r3837-20080802/ath/if_ath_radar.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath/if_ath_radar.c 2008-07-19 02:00:42.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath/if_ath_radar.c 2009-05-07 20:22:08.754386303 +0400 +@@ -1524,7 +1524,7 @@ + static void ath_rp_tasklet(TQUEUE_ARG data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + + if (sc->sc_rp_analyze != NULL) + sc->sc_rp_analyze(sc); +Index: madwifi-trunk-r3837-20080802/ath/if_athvar.h +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath/if_athvar.h 2008-07-19 01:50:53.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath/if_athvar.h 2009-05-07 20:22:08.758386556 +0400 +@@ -103,7 +103,7 @@ + /* + * Guess how the interrupt handler should work. + */ +-#if !defined(IRQ_NONE) ++#if !defined(IRQ_NONE) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) + typedef void irqreturn_t; + #define IRQ_NONE + #define IRQ_HANDLED +Index: madwifi-trunk-r3837-20080802/ath_rate/amrr/amrr.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath_rate/amrr/amrr.c 2008-06-21 18:40:43.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath_rate/amrr/amrr.c 2009-05-07 20:22:39.754890115 +0400 +@@ -306,7 +306,7 @@ + static void + ath_rate_cb(void *arg, struct ieee80211_node *ni) + { +- ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg); ++ ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg); + } + + /* +@@ -316,7 +316,7 @@ + ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state) + { + struct ieee80211com *ic = vap->iv_ic; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc; + struct ieee80211_node *ni; + +@@ -428,7 +428,7 @@ + ath_ratectl(unsigned long data) + { + struct net_device *dev = (struct net_device *)data; +- struct ath_softc *sc = dev->priv; ++ struct ath_softc *sc = netdev_priv(dev); + struct amrr_softc *asc = (struct amrr_softc *)sc->sc_rc; + struct ieee80211com *ic = &sc->sc_ic; + int interval; +Index: madwifi-trunk-r3837-20080802/ath_rate/minstrel/minstrel.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath_rate/minstrel/minstrel.c 2008-07-17 07:44:41.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath_rate/minstrel/minstrel.c 2009-05-07 20:22:08.762386084 +0400 +@@ -755,7 +755,7 @@ + static void + ath_rate_cb(void *arg, struct ieee80211_node *ni) + { +- ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni); ++ ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni); + } + + /* Reset the rate control state for each 802.11 state transition. */ +@@ -771,7 +771,7 @@ + ieee80211_iterate_nodes(&ic->ic_sta, + ath_rate_cb, NULL); + } +- ath_rate_newassoc(ic->ic_dev->priv, ++ ath_rate_newassoc(netdev_priv(ic->ic_dev), + ATH_NODE(vap->iv_bss), 1); + } + } +@@ -960,7 +960,7 @@ + (struct ieee80211_node_table *)&vap->iv_ic->ic_sta; + unsigned int x = 0; + unsigned int this_tp, this_prob, this_eprob; +- struct ath_softc *sc = vap->iv_ic->ic_dev->priv;; ++ struct ath_softc *sc = netdev_priv(vap->iv_ic->ic_dev); + + IEEE80211_NODE_TABLE_LOCK_IRQ(nt); + TAILQ_FOREACH(ni, &nt->nt_node, ni_list) { +Index: madwifi-trunk-r3837-20080802/ath_rate/onoe/onoe.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath_rate/onoe/onoe.c 2008-07-17 09:11:56.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath_rate/onoe/onoe.c 2009-05-07 20:22:08.762386084 +0400 +@@ -292,7 +292,7 @@ + static void + ath_rate_cb(void *arg, struct ieee80211_node *ni) + { +- ath_rate_update(ni->ni_ic->ic_dev->priv, ni, (long) arg); ++ ath_rate_update(netdev_priv(ni->ni_ic->ic_dev), ni, (long) arg); + } + + /* +@@ -302,7 +302,7 @@ + ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state) + { + struct ieee80211com *ic = vap->iv_ic; +- struct ath_softc *sc = ic->ic_dev->priv; ++ struct ath_softc *sc = netdev_priv(ic->ic_dev); + struct ieee80211_node *ni; + + if (state == IEEE80211_S_INIT) +Index: madwifi-trunk-r3837-20080802/ath_rate/sample/sample.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/ath_rate/sample/sample.c 2008-07-24 04:38:37.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/ath_rate/sample/sample.c 2009-05-07 20:22:08.762386084 +0400 +@@ -941,7 +941,7 @@ + static void + ath_rate_cb(void *arg, struct ieee80211_node *ni) + { +- ath_rate_ctl_reset(ni->ni_ic->ic_dev->priv, ni); ++ ath_rate_ctl_reset(netdev_priv(ni->ni_ic->ic_dev), ni); + } + + /* +@@ -959,7 +959,7 @@ + */ + ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL); + } +- ath_rate_newassoc(ic->ic_dev->priv, ATH_NODE(vap->iv_bss), 1); ++ ath_rate_newassoc(netdev_priv(ic->ic_dev), ATH_NODE(vap->iv_bss), 1); + } + } + +Index: madwifi-trunk-r3837-20080802/net80211/ieee80211.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/net80211/ieee80211.c 2008-07-17 08:50:29.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/net80211/ieee80211.c 2009-05-07 20:22:08.766384086 +0400 +@@ -407,7 +407,7 @@ + #define IEEE80211_C_OPMODE \ + (IEEE80211_C_IBSS | IEEE80211_C_HOSTAP | IEEE80211_C_AHDEMO | \ + IEEE80211_C_MONITOR) +- struct ieee80211vap *vap = dev->priv; ++ struct ieee80211vap *vap = netdev_priv(dev); + struct net_device *parent = ic->ic_dev; + int err; + +@@ -1276,7 +1276,7 @@ + static void + ieee80211com_media_status(struct net_device *dev, struct ifmediareq *imr) + { +- struct ieee80211com *ic = dev->priv; /* XXX */ ++ struct ieee80211com *ic = netdev_priv(dev); /* XXX */ + + imr->ifm_status = IFM_AVALID; + if (!TAILQ_EMPTY(&ic->ic_vaps)) +@@ -1328,7 +1328,7 @@ + static int + ieee80211com_media_change(struct net_device *dev) + { +- struct ieee80211com *ic = dev->priv; /* XXX */ ++ struct ieee80211com *ic = netdev_priv(dev); /* XXX */ + struct ieee80211vap *vap; + struct ifmedia_entry *ime = ic->ic_media.ifm_cur; + enum ieee80211_phymode newphymode; +@@ -1432,7 +1432,7 @@ + int + ieee80211_media_change(struct net_device *dev) + { +- struct ieee80211vap *vap = dev->priv; ++ struct ieee80211vap *vap = netdev_priv(dev); + struct ieee80211com *ic = vap->iv_ic; + struct ifmedia_entry *ime = vap->iv_media.ifm_cur; + enum ieee80211_phymode newmode; +@@ -1470,7 +1470,7 @@ + void + ieee80211_media_status(struct net_device *dev, struct ifmediareq *imr) + { +- struct ieee80211vap *vap = dev->priv; ++ struct ieee80211vap *vap = netdev_priv(dev); + struct ieee80211com *ic = vap->iv_ic; + enum ieee80211_phymode mode; + struct ieee80211_rateset *rs; +@@ -1676,7 +1676,7 @@ + static struct net_device_stats * + ieee80211_getstats(struct net_device *dev) + { +- struct ieee80211vap *vap = dev->priv; ++ struct ieee80211vap *vap = netdev_priv(dev); + struct net_device_stats *stats = &vap->iv_devstats; + + /* XXX: Total guess as to what to count where */ +@@ -1715,7 +1715,7 @@ + static void + ieee80211_set_multicast_list(struct net_device *dev) + { +- struct ieee80211vap *vap = dev->priv; ++ struct ieee80211vap *vap = netdev_priv(dev); + struct ieee80211com *ic = vap->iv_ic; + struct net_device *parent = ic->ic_dev; + +Index: madwifi-trunk-r3837-20080802/net80211/ieee80211_linux.c +=================================================================== +--- madwifi-trunk-r3837-20080802.orig/net80211/ieee80211_linux.c 2008-06-22 09:32:29.000000000 +0400 ++++ madwifi-trunk-r3837-20080802/net80211/ieee80211_linux.c 2009-05-07 20:22:08.766384086 +0400 +@@ -967,8 +967,8 @@ + + switch (event) { + case NETDEV_CHANGENAME: +- ieee80211_virtfs_vdetach(dev->priv); +- ieee80211_virtfs_latevattach(dev->priv); ++ ieee80211_virtfs_vdetach(netdev_priv(dev)); ++ ieee80211_virtfs_latevattach(netdev_priv(dev)); + return NOTIFY_DONE; + default: + break; +Index: madwifi-trunk-r3837-20080802/net80211/ieee80211_output.c +============================ |
