-diff -ur madwifi.old/ath/if_ath.c madwifi.dev/ath/if_ath.c
---- madwifi.old/ath/if_ath.c 2007-05-21 07:49:54.571131744 +0200
-+++ madwifi.dev/ath/if_ath.c 2007-05-21 07:51:40.208072488 +0200
+diff -urN madwifi-ng-r2377-20070526.old/ath/if_ath.c madwifi-ng-r2377-20070526.dev/ath/if_ath.c
+--- madwifi-ng-r2377-20070526.old/ath/if_ath.c 2007-05-26 18:51:09.318670888 +0200
++++ madwifi-ng-r2377-20070526.dev/ath/if_ath.c 2007-05-26 18:51:09.331668912 +0200
static int ath_hardstart(struct sk_buff *, struct net_device *);
static int ath_mgtstart(struct ieee80211com *, struct sk_buff *);
#ifdef ATH_SUPERG_COMP
static int ath_hardstart(struct sk_buff *, struct net_device *);
static int ath_mgtstart(struct ieee80211com *, struct sk_buff *);
#ifdef ATH_SUPERG_COMP
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);
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);
dev->set_mac_address = ath_set_mac_address;
dev->change_mtu = ath_change_mtu;
dev->tx_queue_len = ATH_TXBUF - 1; /* 1 for mgmt frame */
dev->set_mac_address = ath_set_mac_address;
dev->change_mtu = ath_change_mtu;
dev->tx_queue_len = ATH_TXBUF - 1; /* 1 for mgmt frame */
*/
ath_hal_getisr(ah, &status); /* NB: clears ISR too */
DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status);
*/
ath_hal_getisr(ah, &status); /* NB: clears ISR too */
DPRINTF(sc, ATH_DEBUG_INTR, "%s: status 0x%x\n", __func__, status);
status &= sc->sc_imask; /* discard unasked for bits */
if (status & HAL_INT_FATAL) {
sc->sc_stats.ast_hardware++;
status &= sc->sc_imask; /* discard unasked for bits */
if (status & HAL_INT_FATAL) {
sc->sc_stats.ast_hardware++;
-@@ -1674,7 +1676,12 @@
- * might take too long to fire */
- ath_hal_process_noisefloor(ah);
- sc->sc_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan));
+@@ -1688,7 +1690,12 @@
+ if (status & HAL_INT_RX) {
+ sc->sc_tsf = ath_hal_gettsf64(ah);
+ ath_uapsd_processtriggers(sc);
- ATH_SCHEDULE_TQUEUE(&sc->sc_rxtq, &needmark);
+ sc->sc_isr &= ~HAL_INT_RX;
+ if (netif_rx_schedule_prep(dev)) {
- ATH_SCHEDULE_TQUEUE(&sc->sc_rxtq, &needmark);
+ sc->sc_isr &= ~HAL_INT_RX;
+ if (netif_rx_schedule_prep(dev)) {
ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark);
}
if (status & HAL_INT_BMISS) {
ATH_SCHEDULE_TQUEUE(&sc->sc_txtq, &needmark);
}
if (status & HAL_INT_BMISS) {
ath_hal_intrset(ah, sc->sc_imask & ~HAL_INT_SWBA);
ATH_TXQ_INSERT_TAIL(txq, bf, bf_list);
DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: txq depth = %d\n", __func__, txq->axq_depth);
ath_hal_intrset(ah, sc->sc_imask & ~HAL_INT_SWBA);
ATH_TXQ_INSERT_TAIL(txq, bf, bf_list);
DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: txq depth = %d\n", __func__, txq->axq_depth);
ito64(bf->bf_daddr), bf->bf_desc);
}
txq->axq_link = &lastds->ds_link;
ito64(bf->bf_daddr), bf->bf_desc);
}
txq->axq_link = &lastds->ds_link;
ath_hal_intrset(ah, sc->sc_imask);
} else {
ATH_TXQ_INSERT_TAIL(txq, bf, bf_list);
ath_hal_intrset(ah, sc->sc_imask);
} else {
ATH_TXQ_INSERT_TAIL(txq, bf, bf_list);
bf_ff = TAILQ_LAST(&txq->axq_stageq, axq_headtype);
if ((!bf_ff) || ath_ff_flushdonetest(txq, bf_ff)) {
bf_ff = TAILQ_LAST(&txq->axq_stageq, axq_headtype);
if ((!bf_ff) || ath_ff_flushdonetest(txq, bf_ff)) {
ATH_NODE(ni)->an_tx_ffbuf[bf_ff->bf_skb->priority] = NULL;
TAILQ_REMOVE(&txq->axq_stageq, bf_ff, bf_stagelist);
ATH_NODE(ni)->an_tx_ffbuf[bf_ff->bf_skb->priority] = NULL;
TAILQ_REMOVE(&txq->axq_stageq, bf_ff, bf_stagelist);
bf = STAILQ_FIRST(&sc->sc_txbuf); \
if (bf != NULL) { \
STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); \
bf = STAILQ_FIRST(&sc->sc_txbuf); \
if (bf != NULL) { \
STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list); \
if (M_FLAG_GET(skb, M_UAPSD)) {
/* bypass FF handling */
ATH_HARDSTART_GET_TX_BUF_WITH_LOCK;
if (M_FLAG_GET(skb, M_UAPSD)) {
/* bypass FF handling */
ATH_HARDSTART_GET_TX_BUF_WITH_LOCK;
if (athff_can_aggregate(sc, eh, an, skb, vap->iv_fragthreshold, &ff_flush)) {
if (an->an_tx_ffbuf[skb->priority]) { /* i.e., frame on the staging queue */
if (athff_can_aggregate(sc, eh, an, skb, vap->iv_fragthreshold, &ff_flush)) {
if (an->an_tx_ffbuf[skb->priority]) { /* i.e., frame on the staging queue */
TAILQ_REMOVE(&txq->axq_stageq, bf, bf_stagelist);
an->an_tx_ffbuf[skb->priority] = NULL;
TAILQ_REMOVE(&txq->axq_stageq, bf, bf_stagelist);
an->an_tx_ffbuf[skb->priority] = NULL;
TAILQ_REMOVE(&txq->axq_stageq, bf_ff, bf_stagelist);
an->an_tx_ffbuf[skb->priority] = NULL;
TAILQ_REMOVE(&txq->axq_stageq, bf_ff, bf_stagelist);
an->an_tx_ffbuf[skb->priority] = NULL;
else if (an->an_tx_ffbuf[skb->priority]) {
DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF,
"%s: Out-Of-Order fast-frame\n", __func__);
else if (an->an_tx_ffbuf[skb->priority]) {
DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF,
"%s: Out-Of-Order fast-frame\n", __func__);
for (bfcnt = 1; bfcnt < framecnt; ++bfcnt) {
if ((tbf = STAILQ_FIRST(&sc->sc_txbuf)) != NULL) {
STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list);
for (bfcnt = 1; bfcnt < framecnt; ++bfcnt) {
if ((tbf = STAILQ_FIRST(&sc->sc_txbuf)) != NULL) {
STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list);
STAILQ_FOREACH_SAFE(tbf, &bf_head, bf_list, tempbf) {
tbf->bf_skb = NULL;
tbf->bf_node = NULL;
STAILQ_FOREACH_SAFE(tbf, &bf_head, bf_list, tempbf) {
tbf->bf_skb = NULL;
tbf->bf_node = NULL;
bf = STAILQ_FIRST(&sc->sc_txbuf);
if (bf != NULL)
STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list);
bf = STAILQ_FIRST(&sc->sc_txbuf);
if (bf != NULL)
STAILQ_REMOVE_HEAD(&sc->sc_txbuf, bf_list);
if (bf == NULL) {
printk("ath_mgtstart: discard, no xmit buf\n");
sc->sc_stats.ast_tx_nobufmgt++;
if (bf == NULL) {
printk("ath_mgtstart: discard, no xmit buf\n");
sc->sc_stats.ast_tx_nobufmgt++;
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__);
netif_start_queue(dev);
if (!in_softirq()) /* NB: see above */
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__);
netif_start_queue(dev);
if (!in_softirq()) /* NB: see above */
-+ int processed = 0, early_stop = 0;
-+ int rx_limit = dev->quota;
++ u_int processed = 0, early_stop = 0;
++ u_int rx_limit = dev->quota;
ic->ic_channoise = sc->sc_channoise;
DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s\n", __func__);
ic->ic_channoise = sc->sc_channoise;
DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s\n", __func__);
skb = bf->bf_skb;
if (skb == NULL) { /* XXX ??? can this happen */
printk("%s: no skbuff (%s)\n", dev->name, __func__);
skb = bf->bf_skb;
if (skb == NULL) { /* XXX ??? can this happen */
printk("%s: no skbuff (%s)\n", dev->name, __func__);
sc->sc_stats.ast_rx_phyerr++;
phyerr = rs->rs_phyerr & 0x1f;
sc->sc_stats.ast_rx_phy[phyerr]++;
sc->sc_stats.ast_rx_phyerr++;
phyerr = rs->rs_phyerr & 0x1f;
sc->sc_stats.ast_rx_phy[phyerr]++;
STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
ATH_RXBUF_UNLOCK_IRQ(sc);
} while (ath_rxbuf_init(sc, bf) == 0);
STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
ATH_RXBUF_UNLOCK_IRQ(sc);
} while (ath_rxbuf_init(sc, bf) == 0);
bf->bf_skbaddr = bus_map_single(sc->sc_bdev,
skb->data, skb->len, BUS_DMA_TODEVICE);
bf->bf_skbaddr = bus_map_single(sc->sc_bdev,
skb->data, skb->len, BUS_DMA_TODEVICE);
if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum))
ath_tx_processq(sc, sc->sc_uapsdq);
if (sc->sc_uapsdq && txqactive(sc->sc_ah, sc->sc_uapsdq->axq_qnum))
ath_tx_processq(sc, sc->sc_uapsdq);
for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
if (ATH_TXQ_SETUP(sc, i) && txqactive(sc->sc_ah, i))
ath_tx_processq(sc, &sc->sc_txq[i]);
for (i = 0; i < HAL_NUM_TX_QUEUES; i++)
if (ATH_TXQ_SETUP(sc, i) && txqactive(sc->sc_ah, i))
ath_tx_processq(sc, &sc->sc_txq[i]);
dev->mtu = mtu;
if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) {
/* NB: the rx buffers may need to be reallocated */
dev->mtu = mtu;
if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) {
/* NB: the rx buffers may need to be reallocated */
-diff -ur madwifi.old/ath/if_athvar.h madwifi.dev/ath/if_athvar.h
---- madwifi.old/ath/if_athvar.h 2007-05-21 07:49:54.563132960 +0200
-+++ madwifi.dev/ath/if_athvar.h 2007-05-21 07:50:22.814838048 +0200
+diff -urN madwifi-ng-r2377-20070526.old/ath/if_athvar.h madwifi-ng-r2377-20070526.dev/ath/if_athvar.h
+--- madwifi-ng-r2377-20070526.old/ath/if_athvar.h 2007-05-26 18:51:09.020716184 +0200
++++ madwifi-ng-r2377-20070526.dev/ath/if_athvar.h 2007-05-26 18:51:09.331668912 +0200
struct ATH_TQ_STRUCT sc_txtq; /* tx intr tasklet */
u_int8_t sc_grppoll_str[GRPPOLL_RATE_STR_LEN];
struct ath_descdma sc_bdma; /* beacon descriptors */
struct ATH_TQ_STRUCT sc_txtq; /* tx intr tasklet */
u_int8_t sc_grppoll_str[GRPPOLL_RATE_STR_LEN];
struct ath_descdma sc_bdma; /* beacon descriptors */
#define ATH_TXBUF_LOCK_DESTROY(_sc)
#define ATH_TXBUF_LOCK(_sc) spin_lock(&(_sc)->sc_txbuflock)
#define ATH_TXBUF_UNLOCK(_sc) spin_unlock(&(_sc)->sc_txbuflock)
#define ATH_TXBUF_LOCK_DESTROY(_sc)
#define ATH_TXBUF_LOCK(_sc) spin_lock(&(_sc)->sc_txbuflock)
#define ATH_TXBUF_UNLOCK(_sc) spin_unlock(&(_sc)->sc_txbuflock)
#define ATH_TXBUF_LOCK_IRQ(_sc) do { \
unsigned long __txbuflockflags; \
spin_lock_irqsave(&(_sc)->sc_txbuflock, __txbuflockflags);
#define ATH_TXBUF_LOCK_IRQ(_sc) do { \
unsigned long __txbuflockflags; \
spin_lock_irqsave(&(_sc)->sc_txbuflock, __txbuflockflags);
#define ATH_RXBUF_LOCK_DESTROY(_sc)
#define ATH_RXBUF_LOCK(_sc) spin_lock(&(_sc)->sc_rxbuflock)
#define ATH_RXBUF_UNLOCK(_sc) spin_unlock(&(_sc)->sc_rxbuflock)
#define ATH_RXBUF_LOCK_DESTROY(_sc)
#define ATH_RXBUF_LOCK(_sc) spin_lock(&(_sc)->sc_rxbuflock)
#define ATH_RXBUF_UNLOCK(_sc) spin_unlock(&(_sc)->sc_rxbuflock)
#define ATH_RXBUF_LOCK_IRQ(_sc) do { \
unsigned long __rxbuflockflags; \
spin_lock_irqsave(&(_sc)->sc_rxbuflock, __rxbuflockflags);
#define ATH_RXBUF_LOCK_IRQ(_sc) do { \
unsigned long __rxbuflockflags; \
spin_lock_irqsave(&(_sc)->sc_rxbuflock, __rxbuflockflags);
#define ATH_RXBUF_UNLOCK_IRQ_EARLY(_sc) \
spin_unlock_irqrestore(&(_sc)->sc_rxbuflock, __rxbuflockflags);
#define ATH_RXBUF_UNLOCK_IRQ_EARLY(_sc) \
spin_unlock_irqrestore(&(_sc)->sc_rxbuflock, __rxbuflockflags);
/* Protects the device from concurrent accesses */
#define ATH_LOCK_INIT(_sc) init_MUTEX(&(_sc)->sc_lock)
/* Protects the device from concurrent accesses */
#define ATH_LOCK_INIT(_sc) init_MUTEX(&(_sc)->sc_lock)
-diff -ur madwifi.old/net80211/ieee80211_beacon.c madwifi.dev/net80211/ieee80211_beacon.c
---- madwifi.old/net80211/ieee80211_beacon.c 2007-01-31 11:41:05.000000000 +0100
-+++ madwifi.dev/net80211/ieee80211_beacon.c 2007-05-21 07:50:22.815837896 +0200
+diff -urN madwifi-ng-r2377-20070526.old/net80211/ieee80211_beacon.c madwifi-ng-r2377-20070526.dev/net80211/ieee80211_beacon.c
+--- madwifi-ng-r2377-20070526.old/net80211/ieee80211_beacon.c 2007-01-30 05:01:29.000000000 +0100
++++ madwifi-ng-r2377-20070526.dev/net80211/ieee80211_beacon.c 2007-05-26 18:51:09.332668760 +0200
-diff -ur madwifi.old/net80211/ieee80211_input.c madwifi.dev/net80211/ieee80211_input.c
---- madwifi.old/net80211/ieee80211_input.c 2007-05-21 07:49:54.527138432 +0200
-+++ madwifi.dev/net80211/ieee80211_input.c 2007-05-21 07:50:22.816837744 +0200
-@@ -1155,8 +1155,9 @@
+diff -urN madwifi-ng-r2377-20070526.old/net80211/ieee80211_input.c madwifi-ng-r2377-20070526.dev/net80211/ieee80211_input.c
+--- madwifi-ng-r2377-20070526.old/net80211/ieee80211_input.c 2007-05-26 18:51:09.107702960 +0200
++++ madwifi-ng-r2377-20070526.dev/net80211/ieee80211_input.c 2007-05-26 18:51:09.333668608 +0200
+@@ -1169,8 +1169,9 @@
if (ni->ni_vlan != 0 && vap->iv_vlgrp != NULL) {
/* attach vlan tag */
vlan_hwaccel_receive_skb(skb, vap->iv_vlgrp, ni->ni_vlan);
if (ni->ni_vlan != 0 && vap->iv_vlgrp != NULL) {
/* attach vlan tag */
vlan_hwaccel_receive_skb(skb, vap->iv_vlgrp, ni->ni_vlan);
if (skb == NULL) {
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_POWER, wh->i_addr2,
"%s", "recv ps-poll, but queue empty");
if (skb == NULL) {
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_POWER, wh->i_addr2,
"%s", "recv ps-poll, but queue empty");
-diff -ur madwifi.old/net80211/ieee80211_linux.h madwifi.dev/net80211/ieee80211_linux.h
---- madwifi.old/net80211/ieee80211_linux.h 2007-05-21 07:49:54.528138280 +0200
-+++ madwifi.dev/net80211/ieee80211_linux.h 2007-05-21 07:50:22.817837592 +0200
+diff -urN madwifi-ng-r2377-20070526.old/net80211/ieee80211_linux.h madwifi-ng-r2377-20070526.dev/net80211/ieee80211_linux.h
+--- madwifi-ng-r2377-20070526.old/net80211/ieee80211_linux.h 2007-05-24 19:31:37.000000000 +0200
++++ madwifi-ng-r2377-20070526.dev/net80211/ieee80211_linux.h 2007-05-26 18:51:09.334668456 +0200
#if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)) && defined(spin_is_locked)
#define ACL_LOCK_ASSERT(_as) \
#if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)) && defined(spin_is_locked)
#define ACL_LOCK_ASSERT(_as) \
-diff -ur madwifi.old/net80211/ieee80211_node.c madwifi.dev/net80211/ieee80211_node.c
---- madwifi.old/net80211/ieee80211_node.c 2007-05-21 07:49:54.555134176 +0200
-+++ madwifi.dev/net80211/ieee80211_node.c 2007-05-21 07:50:22.818837440 +0200
-@@ -1570,7 +1570,7 @@
+diff -urN madwifi-ng-r2377-20070526.old/net80211/ieee80211_node.c madwifi-ng-r2377-20070526.dev/net80211/ieee80211_node.c
+--- madwifi-ng-r2377-20070526.old/net80211/ieee80211_node.c 2007-05-26 18:51:08.748757528 +0200
++++ madwifi-ng-r2377-20070526.dev/net80211/ieee80211_node.c 2007-05-26 18:51:09.335668304 +0200
+@@ -1567,7 +1567,7 @@
-diff -ur madwifi.old/net80211/ieee80211_power.c madwifi.dev/net80211/ieee80211_power.c
---- madwifi.old/net80211/ieee80211_power.c 2007-05-21 07:49:54.532137672 +0200
-+++ madwifi.dev/net80211/ieee80211_power.c 2007-05-21 07:50:22.818837440 +0200
+diff -urN madwifi-ng-r2377-20070526.old/net80211/ieee80211_power.c madwifi-ng-r2377-20070526.dev/net80211/ieee80211_power.c
+--- madwifi-ng-r2377-20070526.old/net80211/ieee80211_power.c 2007-05-24 19:31:37.000000000 +0200
++++ madwifi-ng-r2377-20070526.dev/net80211/ieee80211_power.c 2007-05-26 18:51:09.336668152 +0200
-@@ -297,9 +297,9 @@
- struct sk_buff *skb;
- int qlen;
-
-- IEEE80211_NODE_SAVEQ_LOCK(ni);
-+ IEEE80211_NODE_SAVEQ_LOCK_IRQ(ni);
- IEEE80211_NODE_SAVEQ_DEQUEUE(ni, skb, qlen);
-- IEEE80211_NODE_SAVEQ_UNLOCK(ni);
-+ IEEE80211_NODE_SAVEQ_UNLOCK_IRQ(ni);
- if (skb == NULL)
- break;
- /*
-@@ -361,9 +361,9 @@
+@@ -295,9 +295,9 @@
+ struct sk_buff *skb;
+ int qlen;
+
+- IEEE80211_NODE_SAVEQ_LOCK(ni);
++ IEEE80211_NODE_SAVEQ_LOCK_IRQ(ni);
+ IEEE80211_NODE_SAVEQ_DEQUEUE(ni, skb, qlen);
+- IEEE80211_NODE_SAVEQ_UNLOCK(ni);
++ IEEE80211_NODE_SAVEQ_UNLOCK_IRQ(ni);
+ if (skb == NULL)
+ break;
+ /*
+@@ -362,9 +362,9 @@
-diff -ur madwifi.old/net80211/ieee80211_proto.c madwifi.dev/net80211/ieee80211_proto.c
---- madwifi.old/net80211/ieee80211_proto.c 2007-05-21 07:49:54.574131288 +0200
-+++ madwifi.dev/net80211/ieee80211_proto.c 2007-05-21 07:50:22.819837288 +0200
+diff -urN madwifi-ng-r2377-20070526.old/net80211/ieee80211_proto.c madwifi-ng-r2377-20070526.dev/net80211/ieee80211_proto.c
+--- madwifi-ng-r2377-20070526.old/net80211/ieee80211_proto.c 2007-05-26 18:51:09.321670432 +0200
++++ madwifi-ng-r2377-20070526.dev/net80211/ieee80211_proto.c 2007-05-26 18:51:09.337668000 +0200
-diff -ur madwifi.old/net80211/ieee80211_scan_sta.c madwifi.dev/net80211/ieee80211_scan_sta.c
---- madwifi.old/net80211/ieee80211_scan_sta.c 2006-09-20 10:45:13.000000000 +0200
-+++ madwifi.dev/net80211/ieee80211_scan_sta.c 2007-05-21 07:50:22.819837288 +0200
+diff -urN madwifi-ng-r2377-20070526.old/net80211/ieee80211_scan_sta.c madwifi-ng-r2377-20070526.dev/net80211/ieee80211_scan_sta.c
+--- madwifi-ng-r2377-20070526.old/net80211/ieee80211_scan_sta.c 2007-05-21 17:53:39.000000000 +0200
++++ madwifi-ng-r2377-20070526.dev/net80211/ieee80211_scan_sta.c 2007-05-26 18:51:09.338667848 +0200