-Index: madwifi-trunk-r3314/ath/if_ath.c
-===================================================================
---- madwifi-trunk-r3314.orig/ath/if_ath.c 2008-02-20 21:56:33.725243076 +0100
-+++ madwifi-trunk-r3314/ath/if_ath.c 2008-02-20 21:57:34.912729951 +0100
+--- a/ath/if_ath.c
++++ b/ath/if_ath.c
@@ -184,7 +184,11 @@
struct sk_buff *, int, int, u_int64_t);
static void ath_setdefantenna(struct ath_softc *, u_int);
static int ath_hardstart(struct sk_buff *, struct net_device *);
static int ath_mgtstart(struct ieee80211com *, struct sk_buff *);
#ifdef ATH_SUPERG_COMP
-@@ -374,6 +378,9 @@
+@@ -376,6 +380,9 @@
u_int32_t new_clamped_maxtxpower);
static u_int32_t ath_get_real_maxtxpower(struct ath_softc *sc);
/* calibrate every 30 secs in steady state but check every second at first. */
static int ath_calinterval = ATH_SHORT_CALINTERVAL;
static int ath_countrycode = CTRY_DEFAULT; /* country code */
-@@ -545,7 +552,6 @@
+@@ -547,7 +554,6 @@
atomic_set(&sc->sc_txbuf_counter, 0);
ATH_INIT_TQUEUE(&sc->sc_txtq, ath_tx_tasklet, dev);
ATH_INIT_TQUEUE(&sc->sc_bmisstq, ath_bmiss_tasklet, dev);
ATH_INIT_TQUEUE(&sc->sc_bstucktq, ath_bstuck_tasklet, dev);
-@@ -819,6 +825,12 @@
+@@ -821,6 +827,12 @@
dev->set_mac_address = ath_set_mac_address;
dev->change_mtu = ath_change_mtu;
dev->tx_queue_len = ATH_TXBUF - ATH_TXBUF_MGT_RESERVED;
#ifdef USE_HEADERLEN_RESV
dev->hard_header_len += sizeof(struct ieee80211_qosframe) +
sizeof(struct llc) +
-@@ -2213,6 +2225,7 @@
+@@ -2220,6 +2232,7 @@
(status & HAL_INT_GLOBAL) ? " HAL_INT_GLOBAL" : ""
);
status &= sc->sc_imask; /* discard unasked for bits */
/* As soon as we know we have a real interrupt we intend to service,
* we will check to see if we need an initial hardware TSF reading.
-@@ -2270,7 +2283,23 @@
+@@ -2277,7 +2290,23 @@
}
if (status & (HAL_INT_RX | HAL_INT_RXPHY)) {
ath_uapsd_processtriggers(sc, hw_tsf);
}
if (status & HAL_INT_TX) {
#ifdef ATH_SUPERG_DYNTURBO
-@@ -2296,6 +2325,11 @@
+@@ -2303,6 +2332,11 @@
}
}
#endif
ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark);
}
if (status & HAL_INT_BMISS) {
-@@ -2508,6 +2542,7 @@
+@@ -2515,6 +2549,7 @@
if (sc->sc_tx99 != NULL)
sc->sc_tx99->start(sc->sc_tx99);
#endif
done:
ATH_UNLOCK(sc);
-@@ -2548,6 +2583,9 @@
+@@ -2555,6 +2590,9 @@
if (sc->sc_tx99 != NULL)
sc->sc_tx99->stop(sc->sc_tx99);
#endif
netif_stop_queue(dev); /* XXX re-enabled by ath_newstate */
dev->flags &= ~IFF_RUNNING; /* NB: avoid recursion */
ieee80211_stop_running(ic); /* stop all VAPs */
-@@ -4006,6 +4044,39 @@
+@@ -4013,12 +4051,47 @@
return ath_keyset(sc, k, mac, vap->iv_bss);
}
/*
* Block/unblock tx+rx processing while a key change is done.
* We assume the caller serializes key management operations
-@@ -4023,13 +4094,7 @@
+ * so we only need to worry about synchronization with other
+ * uses that originate in the driver.
+ */
++#define IS_UP(_dev) \
++ (((_dev)->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP))
+ static void
+ ath_key_update_begin(struct ieee80211vap *vap)
+ {
+@@ -4032,14 +4105,9 @@
* When called from the rx tasklet we cannot use
* tasklet_disable because it will block waiting
* for us to complete execution.
*/
- if (!in_softirq())
- tasklet_disable(&sc->sc_rxtq);
- netif_stop_queue(dev);
+- netif_stop_queue(dev);
++ if (IS_UP(vap->iv_dev))
++ netif_stop_queue(dev);
}
-@@ -4040,9 +4105,9 @@
- struct ath_softc *sc = dev->priv;
+ static void
+@@ -4051,9 +4119,9 @@
+ #endif
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "End\n");
- netif_wake_queue(dev);
- if (!in_softirq()) /* NB: see above */
- tasklet_enable(&sc->sc_rxtq);
+
-+ if (dev->flags&IFF_RUNNING)
++ if (IS_UP(vap->iv_dev))
+ netif_wake_queue(dev);
}
/*
-@@ -6347,13 +6412,23 @@
+@@ -6360,15 +6428,25 @@
sc->sc_rxotherant = 0;
}
((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \
((_pa) - (_sc)->sc_rxdma.dd_desc_paddr)))
- struct net_device *dev = (struct net_device *)data;
+- struct ath_buf *bf;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+ struct ath_softc *sc = container_of(napi, struct ath_softc, sc_napi);
+ struct net_device *dev = sc->sc_dev;
+ u_int rx_limit = budget;
+#else
-+ u_int rx_limit = dev->quota;
-+#endif
- struct ath_buf *bf;
struct ath_softc *sc = dev->priv;
++ u_int rx_limit = min(dev->quota, *budget);
++#endif
++ struct ath_buf *bf;
struct ieee80211com *ic = &sc->sc_ic;
-@@ -6365,8 +6440,10 @@
+ struct ath_hal *ah = sc ? sc->sc_ah : NULL;
+ struct ath_desc *ds;
+@@ -6378,8 +6456,10 @@
unsigned int len;
int type;
u_int phyerr;
do {
bf = STAILQ_FIRST(&sc->sc_rxbuf);
if (bf == NULL) { /* XXX ??? can this happen */
-@@ -6390,6 +6467,15 @@
+@@ -6403,6 +6483,15 @@
/* NB: never process the self-linked entry at the end */
break;
}
skb = bf->bf_skb;
if (skb == NULL) {
EPRINTF(sc, "Dropping; buffer contains NULL skbuff.\n");
-@@ -6437,6 +6523,7 @@
+@@ -6450,6 +6539,7 @@
sc->sc_stats.ast_rx_phyerr++;
phyerr = rs->rs_phyerr & 0x1f;
sc->sc_stats.ast_rx_phy[phyerr]++;
}
if (rs->rs_status & HAL_RXERR_DECRYPT) {
/*
-@@ -6632,9 +6719,38 @@
+@@ -6645,9 +6735,43 @@
STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
ATH_RXBUF_UNLOCK_IRQ(sc);
} while (ath_rxbuf_init(sc, bf) == 0);
+#else
+ netif_rx_complete(dev);
+ *budget -= processed;
++ dev->quota -= processed;
+#endif
/* rx signal state monitoring */
ath_hal_rxmonitor(ah, &sc->sc_halstats, &sc->sc_curchan);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
++ return processed;
++#else
+ return early_stop;
++#endif
#undef PA2DESC
}
-@@ -8285,12 +8401,24 @@
+@@ -8298,12 +8422,24 @@
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
netif_wake_queue(dev);
if (sc->sc_softled)
-@@ -8306,7 +8434,9 @@
+@@ -8319,7 +8455,9 @@
{
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
/*
* Process each active queue.
*/
-@@ -8327,6 +8457,16 @@
+@@ -8340,6 +8478,16 @@
if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum))
ath_tx_processq(sc, sc->sc_uapsdq);
netif_wake_queue(dev);
if (sc->sc_softled)
-@@ -8342,13 +8482,25 @@
+@@ -8355,13 +8503,25 @@
struct net_device *dev = (struct net_device *)data;
struct ath_softc *sc = dev->priv;
unsigned int i;
netif_wake_queue(dev);
if (sc->sc_softled)
-@@ -8423,6 +8575,7 @@
- ath_draintxq(struct ath_softc *sc)
- {
- struct ath_hal *ah = sc->sc_ah;
-+ int npend = 0;
- unsigned int i;
-
- /* XXX return value */
-@@ -10281,9 +10434,9 @@
+@@ -10296,9 +10456,9 @@
dev->mtu = mtu;
if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) {
/* NB: the rx buffers may need to be reallocated */
}
ATH_UNLOCK(sc);
-Index: madwifi-trunk-r3314/ath/if_athvar.h
-===================================================================
---- madwifi-trunk-r3314.orig/ath/if_athvar.h 2008-02-20 21:56:33.733243528 +0100
-+++ madwifi-trunk-r3314/ath/if_athvar.h 2008-02-20 21:57:34.892728811 +0100
+--- a/ath/if_athvar.h
++++ b/ath/if_athvar.h
@@ -53,6 +53,10 @@
# include <asm/bitops.h>
#endif
#define ATH_RXBUF_LOCK_INIT(_sc) spin_lock_init(&(_sc)->sc_rxbuflock)
#define ATH_RXBUF_LOCK_DESTROY(_sc)
-Index: madwifi-trunk-r3314/net80211/ieee80211_input.c
-===================================================================
---- madwifi-trunk-r3314.orig/net80211/ieee80211_input.c 2008-02-20 21:56:33.741243986 +0100
-+++ madwifi-trunk-r3314/net80211/ieee80211_input.c 2008-02-20 21:57:34.896729040 +0100
+--- a/net80211/ieee80211_input.c
++++ b/net80211/ieee80211_input.c
@@ -1198,7 +1198,7 @@
/* attach vlan tag */
struct ieee80211_node *ni_tmp = SKB_CB(skb)->ni;
* device was too busy */
if (ni_tmp != NULL) {
/* node reference was leaked */
-Index: madwifi-trunk-r3314/net80211/ieee80211_monitor.c
-===================================================================
---- madwifi-trunk-r3314.orig/net80211/ieee80211_monitor.c 2008-02-20 21:56:33.749244442 +0100
-+++ madwifi-trunk-r3314/net80211/ieee80211_monitor.c 2008-02-20 21:57:34.900729266 +0100
+--- a/net80211/ieee80211_monitor.c
++++ b/net80211/ieee80211_monitor.c
@@ -584,8 +584,8 @@
skb1->protocol =
__constant_htons(0x0019); /* ETH_P_80211_RAW */
* device was too busy, reclaim the ref. in
* the skb. */
if (SKB_CB(skb1)->ni != NULL)
-Index: madwifi-trunk-r3314/net80211/ieee80211_skb.c
-===================================================================
---- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.c 2008-02-20 21:56:33.757244897 +0100
-+++ madwifi-trunk-r3314/net80211/ieee80211_skb.c 2008-02-20 21:57:34.904729495 +0100
+--- a/net80211/ieee80211_skb.c
++++ b/net80211/ieee80211_skb.c
@@ -73,7 +73,7 @@
#undef dev_queue_xmit
#undef kfree_skb
EXPORT_SYMBOL(alloc_skb_debug);
EXPORT_SYMBOL(dev_alloc_skb_debug);
EXPORT_SYMBOL(skb_clone_debug);
-Index: madwifi-trunk-r3314/net80211/ieee80211_skb.h
-===================================================================
---- madwifi-trunk-r3314.orig/net80211/ieee80211_skb.h 2008-02-20 21:56:33.765245356 +0100
-+++ madwifi-trunk-r3314/net80211/ieee80211_skb.h 2008-02-20 21:57:34.908729722 +0100
+--- a/net80211/ieee80211_skb.h
++++ b/net80211/ieee80211_skb.h
@@ -116,7 +116,7 @@
int vlan_hwaccel_receive_skb_debug(struct sk_buff *skb,
struct vlan_group *grp, unsigned short vlan_tag,