2012-02-24 06:07:30

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [RFC 1/3] ath9k: completely zero intialize valid_phy_rate_idx

From: Mohammed Shafi Shajakhan <[email protected]>

its better to zero initialize the 'valid_phy_rate_idx' array completely

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
drivers/net/wireless/ath/ath9k/rc.c | 2 +-
drivers/net/wireless/ath/ath9k/rc.h | 2 --
2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index a427a16..424864b 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1228,7 +1228,7 @@ static void ath_rc_init(struct ath_softc *sc,
ath_rc_init_valid_rate_idx(ath_rc_priv);

for (i = 0; i < WLAN_RC_PHY_MAX; i++) {
- for (j = 0; j < MAX_TX_RATE_PHY; j++)
+ for (j = 0; j < RATE_TABLE_SIZE; j++)
ath_rc_priv->valid_phy_rateidx[i][j] = 0;
ath_rc_priv->valid_phy_ratecnt[i] = 0;
}
diff --git a/drivers/net/wireless/ath/ath9k/rc.h b/drivers/net/wireless/ath/ath9k/rc.h
index b7a4bcd..75f8e9b 100644
--- a/drivers/net/wireless/ath/ath9k/rc.h
+++ b/drivers/net/wireless/ath/ath9k/rc.h
@@ -25,8 +25,6 @@ struct ath_softc;

#define ATH_RATE_MAX 30
#define RATE_TABLE_SIZE 72
-#define MAX_TX_RATE_PHY 48
-

#define RC_INVALID 0x0000
#define RC_LEGACY 0x0001
--
1.7.0.4



2012-02-24 06:07:41

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [RFC 2/3] ath9k: make use of list_for_each_entry_safe

From: Mohammed Shafi Shajakhan <[email protected]>

this does the same thing as the previous code

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
drivers/net/wireless/ath/ath9k/recv.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 7e1a91a..4633f51 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -169,22 +169,17 @@ static void ath_rx_addbuffer_edma(struct ath_softc *sc,
enum ath9k_rx_qtype qtype, int size)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
- u32 nbuf = 0;
+ struct ath_buf *bf, *tbf;

if (list_empty(&sc->rx.rxbuf)) {
ath_dbg(common, QUEUE, "No free rx buf available\n");
return;
}

- while (!list_empty(&sc->rx.rxbuf)) {
- nbuf++;
-
+ list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list)
if (!ath_rx_edma_buf_link(sc, qtype))
break;

- if (nbuf >= size)
- break;
- }
}

static void ath_rx_remove_buffer(struct ath_softc *sc,
--
1.7.0.4


2012-02-24 06:07:52

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [RFC 3/3] ath9k: handle invalid/error in processing tx descriptors

From: Mohammed Shafi Shajakhan <[email protected]>

for EDMA based chipsets there are few more errors/invalid conditions to
be handled when processing tx descriptors apart from descriptor
processing incomplete.
based on the commit dcfcbd590d91e8385eb554aaed419bdebaf4c72a
ENOENT error happened in ad-hoc mode during the invocation of
drv_last_beacon

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
drivers/net/wireless/ath/ath9k/main.c | 3 +++
drivers/net/wireless/ath/ath9k/xmit.c | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c81304d..e5f366f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2341,6 +2341,9 @@ static int ath9k_tx_last_beacon(struct ieee80211_hw *hw)
if (status == -EINPROGRESS)
goto skip;

+ if (status == -EIO || status == -ENOENT)
+ goto skip;
+
sc->beacon.tx_processed = true;
sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK);

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 3182408..8330a82 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2290,7 +2290,7 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)
break;

status = ath9k_hw_txprocdesc(ah, NULL, (void *)&ts);
- if (status == -EINPROGRESS)
+ if (status == -EINPROGRESS || status == -ENOENT)
break;
if (status == -EIO) {
ath_dbg(common, XMIT, "Error processing tx status\n");
--
1.7.0.4