* [PATCH] iw: Configure basic rates when joining ibss network
From: Teemu Paasikivi @ 2010-06-15 6:24 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Teemu Paasikivi
This patch adds option to configure basic rates when joining ibss network.
Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
---
ibss.c | 34 +++++++++++++++++++++++++++++++++-
1 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/ibss.c b/ibss.c
index 4715ac8..cf57cf0 100644
--- a/ibss.c
+++ b/ibss.c
@@ -18,6 +18,11 @@ static int join_ibss(struct nl80211_state *state,
{
char *end;
unsigned char abssid[6];
+ unsigned char rates[NL80211_MAX_SUPP_RATES];
+ int n_rates = 0;
+ char *value = NULL, *sptr = NULL;
+ float rate;
+
if (argc < 2)
return 1;
@@ -41,6 +46,31 @@ static int join_ibss(struct nl80211_state *state,
argc--;
}
+ /* basic rates */
+ if (argc > 1 && strcmp(argv[0], "basic-rates") == 0) {
+ argv++;
+ argc--;
+
+ value = strtok_r(argv[0], ",", &sptr);
+
+ while (value && n_rates < NL80211_MAX_SUPP_RATES) {
+ rate = atof(value);
+ rates[n_rates] = rate * 2;
+
+ /* filter out suspicious values */
+ if (!rates[n_rates] || rate*2 != rates[n_rates])
+ return 1;
+
+ n_rates++;
+ value = strtok_r(NULL, ",", &sptr);
+ }
+
+ NLA_PUT(msg, NL80211_ATTR_BSS_BASIC_RATES, n_rates, rates);
+
+ argv++;
+ argc--;
+ }
+
if (argc) {
if (mac_addr_a2n(abssid, argv[0]) == 0) {
NLA_PUT(msg, NL80211_ATTR_MAC, 6, abssid);
@@ -73,7 +103,9 @@ static int leave_ibss(struct nl80211_state *state,
COMMAND(ibss, leave, NULL,
NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss,
"Leave the current IBSS cell.");
-COMMAND(ibss, join, "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [key d:0:abcde]",
+COMMAND(ibss, join,
+ "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] "
+ "[basic-rates <rate in Mbps,rate2,...>] [key d:0:abcde]",
NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss,
"Join the IBSS cell with the given SSID, if it doesn't exist create\n"
"it on the given frequency. When fixed frequency is requested, don't\n"
--
1.5.6.3
^ permalink raw reply related
* [PATCH] ath9k: Modify LED blinking pattern during wifi activity.
From: Vivek Natarajan @ 2010-06-15 5:20 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Some vendors require the LED to be ON always irrespective of any
radio activity. Introducing a module parameter to enable this,
so that one can choose between always on or led blink during
activity.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 1 +
drivers/net/wireless/ath/ath9k/gpio.c | 9 ++++++---
drivers/net/wireless/ath/ath9k/init.c | 4 ++++
drivers/net/wireless/ath/ath9k/main.c | 4 +++-
4 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 8d163ae..3a14630 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -628,6 +628,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)
extern struct ieee80211_ops ath9k_ops;
extern int modparam_nohwcrypt;
+extern int led_blink;
irqreturn_t ath_isr(int irq, void *dev);
int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 0ee75e7..3a8ee99 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -76,7 +76,8 @@ static void ath_led_brightness(struct led_classdev *led_cdev,
case LED_FULL:
if (led->led_type == ATH_LED_ASSOC) {
sc->sc_flags |= SC_OP_LED_ASSOCIATED;
- ieee80211_queue_delayed_work(sc->hw,
+ if (led_blink)
+ ieee80211_queue_delayed_work(sc->hw,
&sc->ath_led_blink_work, 0);
} else if (led->led_type == ATH_LED_RADIO) {
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 0);
@@ -143,7 +144,8 @@ void ath_init_leds(struct ath_softc *sc)
/* LED off, active low */
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
- INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);
+ if (led_blink)
+ INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);
trigger = ieee80211_get_radio_led_name(sc->hw);
snprintf(sc->radio_led.name, sizeof(sc->radio_led.name),
@@ -180,7 +182,8 @@ void ath_init_leds(struct ath_softc *sc)
return;
fail:
- cancel_delayed_work_sync(&sc->ath_led_blink_work);
+ if (led_blink)
+ cancel_delayed_work_sync(&sc->ath_led_blink_work);
ath_deinit_leds(sc);
}
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 514a401..b2bf0e8 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -33,6 +33,10 @@ int modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
+int led_blink;
+module_param_named(blink, led_blink, int, 0444);
+MODULE_PARM_DESC(blink, "Enable LED blink on activity");
+
/* We use the hw_value as an index into our private channel structure */
#define CHAN2G(_freq, _idx) { \
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c8de50f..5af2596 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1241,7 +1241,9 @@ static void ath9k_stop(struct ieee80211_hw *hw)
aphy->state = ATH_WIPHY_INACTIVE;
- cancel_delayed_work_sync(&sc->ath_led_blink_work);
+ if (led_blink)
+ cancel_delayed_work_sync(&sc->ath_led_blink_work);
+
cancel_delayed_work_sync(&sc->tx_complete_work);
cancel_work_sync(&sc->paprd_work);
--
1.7.1
^ permalink raw reply related
* Re: [ath5k-devel] [PATCH] ath5k: disable all tasklets while resetting
From: Bruno Randolf @ 2010-06-15 4:54 UTC (permalink / raw)
To: Bob Copeland; +Cc: Johannes Berg, ath5k-devel, linux-wireless, linville
In-Reply-To: <20100615041016.GA13984@hash.localnet>
On Tue June 15 2010 13:10:16 Bob Copeland wrote:
> On Tue, Jun 15, 2010 at 10:07:21AM +0900, Bruno Randolf wrote:
> > On Mon June 14 2010 20:43:02 you wrote:
> > > On Mon, Jun 14, 2010 at 10:50:59AM +0900, Bruno Randolf wrote:
> > > > we disable interrupts right after disabling the tasklets, so they
> > > > should not be scheduled again, right? actually, we should disable
> > > > interrupts first, and then disable tasklets... but then it should be
> > > > safe, no?
> > >
> > > Disable interrupts then tasklet_kill should do it.
> >
> > what's wrong with first disable interrupts and tasklet_disable?
>
> Look at the code for tasklet_disable... it only waits for tasks that
> are in the run state but doesn't do anything for scheduled tasks.
> So you can still get the spinning behavior if the interrupt runs and
> schedules the tasklet on another CPU.
if we disable interrupts in the chip (ath5k_hw_set_imr) , the hardware does
not generate any interrupts. so no tasklets will get scheduled...
bruno
^ permalink raw reply
* [PATCH] ath9k_htc: Fix ampdu_action callback
From: Sujith @ 2010-06-15 4:54 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Now that ampdu_action() can sleep, remove all
the driver hacks and just issue WMI commands
to the target.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
---
drivers/net/wireless/ath/ath9k/htc.h | 20 +----
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 3 -
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 93 +++++++------------------
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 21 +++++-
4 files changed, 45 insertions(+), 92 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index c584fbd..58f52a1 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -223,15 +223,6 @@ struct ath9k_htc_sta {
enum tid_aggr_state tid_state[ATH9K_HTC_MAX_TID];
};
-struct ath9k_htc_aggr_work {
- u16 tid;
- u8 sta_addr[ETH_ALEN];
- struct ieee80211_hw *hw;
- struct ieee80211_vif *vif;
- enum ieee80211_ampdu_mlme_action action;
- struct mutex mutex;
-};
-
#define ATH9K_HTC_RXBUF 256
#define HTC_RX_FRAME_HEADER_SIZE 40
@@ -331,11 +322,10 @@ struct htc_beacon_config {
#define OP_LED_ON BIT(4)
#define OP_PREAMBLE_SHORT BIT(5)
#define OP_PROTECT_ENABLE BIT(6)
-#define OP_TXAGGR BIT(7)
-#define OP_ASSOCIATED BIT(8)
-#define OP_ENABLE_BEACON BIT(9)
-#define OP_LED_DEINIT BIT(10)
-#define OP_UNPLUGGED BIT(11)
+#define OP_ASSOCIATED BIT(7)
+#define OP_ENABLE_BEACON BIT(8)
+#define OP_LED_DEINIT BIT(9)
+#define OP_UNPLUGGED BIT(10)
struct ath9k_htc_priv {
struct device *dev;
@@ -376,8 +366,6 @@ struct ath9k_htc_priv {
struct ath9k_htc_rx rx;
struct tasklet_struct tx_tasklet;
struct sk_buff_head tx_queue;
- struct ath9k_htc_aggr_work aggr_work;
- struct delayed_work ath9k_aggr_work;
struct delayed_work ath9k_ani_work;
struct work_struct ps_work;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index d339e5f..a63ae88 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -606,7 +606,6 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv)
if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
- priv->op_flags |= OP_TXAGGR;
priv->ah->opmode = NL80211_IFTYPE_STATION;
}
@@ -638,14 +637,12 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, u16 devid)
spin_lock_init(&priv->beacon_lock);
spin_lock_init(&priv->tx_lock);
mutex_init(&priv->mutex);
- mutex_init(&priv->aggr_work.mutex);
mutex_init(&priv->htc_pm_lock);
tasklet_init(&priv->wmi_tasklet, ath9k_wmi_tasklet,
(unsigned long)priv);
tasklet_init(&priv->rx_tasklet, ath9k_rx_tasklet,
(unsigned long)priv);
tasklet_init(&priv->tx_tasklet, ath9k_tx_tasklet, (unsigned long)priv);
- INIT_DELAYED_WORK(&priv->ath9k_aggr_work, ath9k_htc_aggr_work);
INIT_DELAYED_WORK(&priv->ath9k_ani_work, ath9k_ani_work);
INIT_WORK(&priv->ps_work, ath9k_ps_work);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index b9206e4..05445d8 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -438,13 +438,13 @@ static void ath9k_htc_update_rate(struct ath9k_htc_priv *priv,
bss_conf->bssid, be32_to_cpu(trate.capflags));
}
-static int ath9k_htc_aggr_oper(struct ath9k_htc_priv *priv,
- struct ieee80211_vif *vif,
- u8 *sta_addr, u8 tid, bool oper)
+int ath9k_htc_tx_aggr_oper(struct ath9k_htc_priv *priv,
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta,
+ enum ieee80211_ampdu_mlme_action action, u16 tid)
{
struct ath_common *common = ath9k_hw_common(priv->ah);
struct ath9k_htc_target_aggr aggr;
- struct ieee80211_sta *sta = NULL;
struct ath9k_htc_sta *ista;
int ret = 0;
u8 cmd_rsp;
@@ -453,72 +453,28 @@ static int ath9k_htc_aggr_oper(struct ath9k_htc_priv *priv,
return -EINVAL;
memset(&aggr, 0, sizeof(struct ath9k_htc_target_aggr));
-
- rcu_read_lock();
-
- /* Check if we are able to retrieve the station */
- sta = ieee80211_find_sta(vif, sta_addr);
- if (!sta) {
- rcu_read_unlock();
- return -EINVAL;
- }
-
ista = (struct ath9k_htc_sta *) sta->drv_priv;
- if (oper)
- ista->tid_state[tid] = AGGR_START;
- else
- ista->tid_state[tid] = AGGR_STOP;
-
aggr.sta_index = ista->index;
-
- rcu_read_unlock();
-
- aggr.tidno = tid;
- aggr.aggr_enable = oper;
+ aggr.tidno = tid & 0xf;
+ aggr.aggr_enable = (action == IEEE80211_AMPDU_TX_START) ? true : false;
WMI_CMD_BUF(WMI_TX_AGGR_ENABLE_CMDID, &aggr);
if (ret)
ath_print(common, ATH_DBG_CONFIG,
"Unable to %s TX aggregation for (%pM, %d)\n",
- (oper) ? "start" : "stop", sta->addr, tid);
+ (aggr.aggr_enable) ? "start" : "stop", sta->addr, tid);
else
ath_print(common, ATH_DBG_CONFIG,
- "%s aggregation for (%pM, %d)\n",
- (oper) ? "Starting" : "Stopping", sta->addr, tid);
-
- return ret;
-}
+ "%s TX aggregation for (%pM, %d)\n",
+ (aggr.aggr_enable) ? "Starting" : "Stopping",
+ sta->addr, tid);
-void ath9k_htc_aggr_work(struct work_struct *work)
-{
- int ret = 0;
- struct ath9k_htc_priv *priv =
- container_of(work, struct ath9k_htc_priv,
- ath9k_aggr_work.work);
- struct ath9k_htc_aggr_work *wk = &priv->aggr_work;
-
- mutex_lock(&wk->mutex);
-
- switch (wk->action) {
- case IEEE80211_AMPDU_TX_START:
- ret = ath9k_htc_aggr_oper(priv, wk->vif, wk->sta_addr,
- wk->tid, true);
- if (!ret)
- ieee80211_start_tx_ba_cb_irqsafe(wk->vif, wk->sta_addr,
- wk->tid);
- break;
- case IEEE80211_AMPDU_TX_STOP:
- ath9k_htc_aggr_oper(priv, wk->vif, wk->sta_addr,
- wk->tid, false);
- ieee80211_stop_tx_ba_cb_irqsafe(wk->vif, wk->sta_addr, wk->tid);
- break;
- default:
- ath_print(ath9k_hw_common(priv->ah), ATH_DBG_FATAL,
- "Unknown AMPDU action\n");
- }
+ spin_lock_bh(&priv->tx_lock);
+ ista->tid_state[tid] = (aggr.aggr_enable && !ret) ? AGGR_START : AGGR_STOP;
+ spin_unlock_bh(&priv->tx_lock);
- mutex_unlock(&wk->mutex);
+ return ret;
}
/*********/
@@ -1266,7 +1222,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
/* Cancel all the running timers/work .. */
cancel_work_sync(&priv->ps_work);
cancel_delayed_work_sync(&priv->ath9k_ani_work);
- cancel_delayed_work_sync(&priv->ath9k_aggr_work);
cancel_delayed_work_sync(&priv->ath9k_led_blink_work);
ath9k_led_stop_brightness(priv);
@@ -1767,8 +1722,8 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
u16 tid, u16 *ssn)
{
struct ath9k_htc_priv *priv = hw->priv;
- struct ath9k_htc_aggr_work *work = &priv->aggr_work;
struct ath9k_htc_sta *ista;
+ int ret = 0;
switch (action) {
case IEEE80211_AMPDU_RX_START:
@@ -1776,26 +1731,26 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
case IEEE80211_AMPDU_RX_STOP:
break;
case IEEE80211_AMPDU_TX_START:
+ ret = ath9k_htc_tx_aggr_oper(priv, vif, sta, action, tid);
+ if (!ret)
+ ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
+ break;
case IEEE80211_AMPDU_TX_STOP:
- if (!(priv->op_flags & OP_TXAGGR))
- return -ENOTSUPP;
- memcpy(work->sta_addr, sta->addr, ETH_ALEN);
- work->hw = hw;
- work->vif = vif;
- work->action = action;
- work->tid = tid;
- ieee80211_queue_delayed_work(hw, &priv->ath9k_aggr_work, 0);
+ ath9k_htc_tx_aggr_oper(priv, vif, sta, action, tid);
+ ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
case IEEE80211_AMPDU_TX_OPERATIONAL:
ista = (struct ath9k_htc_sta *) sta->drv_priv;
+ spin_lock_bh(&priv->tx_lock);
ista->tid_state[tid] = AGGR_OPERATIONAL;
+ spin_unlock_bh(&priv->tx_lock);
break;
default:
ath_print(ath9k_hw_common(priv->ah), ATH_DBG_FATAL,
"Unknown AMPDU action\n");
}
- return 0;
+ return ret;
}
static void ath9k_htc_sw_scan_start(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 89d3848..bd0b4ac 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -187,6 +187,19 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
return htc_send(priv->htc, skb, epid, &tx_ctl);
}
+static bool ath9k_htc_check_tx_aggr(struct ath9k_htc_priv *priv,
+ struct ath9k_htc_sta *ista, u8 tid)
+{
+ bool ret = false;
+
+ spin_lock_bh(&priv->tx_lock);
+ if ((tid < ATH9K_HTC_MAX_TID) && (ista->tid_state[tid] == AGGR_STOP))
+ ret = true;
+ spin_unlock_bh(&priv->tx_lock);
+
+ return ret;
+}
+
void ath9k_tx_tasklet(unsigned long data)
{
struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
@@ -216,8 +229,7 @@ void ath9k_tx_tasklet(unsigned long data)
/* Check if we need to start aggregation */
if (sta && conf_is_ht(&priv->hw->conf) &&
- (priv->op_flags & OP_TXAGGR)
- && !(skb->protocol == cpu_to_be16(ETH_P_PAE))) {
+ !(skb->protocol == cpu_to_be16(ETH_P_PAE))) {
if (ieee80211_is_data_qos(fc)) {
u8 *qc, tid;
struct ath9k_htc_sta *ista;
@@ -226,10 +238,11 @@ void ath9k_tx_tasklet(unsigned long data)
tid = qc[0] & 0xf;
ista = (struct ath9k_htc_sta *)sta->drv_priv;
- if ((tid < ATH9K_HTC_MAX_TID) &&
- ista->tid_state[tid] == AGGR_STOP) {
+ if (ath9k_htc_check_tx_aggr(priv, ista, tid)) {
ieee80211_start_tx_ba_session(sta, tid);
+ spin_lock_bh(&priv->tx_lock);
ista->tid_state[tid] = AGGR_PROGRESS;
+ spin_unlock_bh(&priv->tx_lock);
}
}
}
--
1.7.1
^ permalink raw reply related
* Re: [ath5k-devel] [PATCH] ath5k: disable all tasklets while resetting
From: Bob Copeland @ 2010-06-15 4:10 UTC (permalink / raw)
To: Bruno Randolf; +Cc: Johannes Berg, ath5k-devel, linux-wireless, linville
In-Reply-To: <201006151007.21708.br1@einfach.org>
On Tue, Jun 15, 2010 at 10:07:21AM +0900, Bruno Randolf wrote:
> On Mon June 14 2010 20:43:02 you wrote:
> > On Mon, Jun 14, 2010 at 10:50:59AM +0900, Bruno Randolf wrote:
> > > we disable interrupts right after disabling the tasklets, so they should
> > > not be scheduled again, right? actually, we should disable interrupts
> > > first, and then disable tasklets... but then it should be safe, no?
> >
> > Disable interrupts then tasklet_kill should do it.
>
> what's wrong with first disable interrupts and tasklet_disable?
Look at the code for tasklet_disable... it only waits for tasks that
are in the run state but doesn't do anything for scheduled tasks.
So you can still get the spinning behavior if the interrupt runs and
schedules the tasklet on another CPU.
--
Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* Re: [ath5k-devel] [PATCH] ath5k: disable all tasklets while resetting
From: Bruno Randolf @ 2010-06-15 1:07 UTC (permalink / raw)
To: Bob Copeland; +Cc: Johannes Berg, ath5k-devel, linux-wireless, linville
In-Reply-To: <20100614114302.GA15017@hash.localnet>
On Mon June 14 2010 20:43:02 you wrote:
> On Mon, Jun 14, 2010 at 10:50:59AM +0900, Bruno Randolf wrote:
> > we disable interrupts right after disabling the tasklets, so they should
> > not be scheduled again, right? actually, we should disable interrupts
> > first, and then disable tasklets... but then it should be safe, no?
>
> Disable interrupts then tasklet_kill should do it.
what's wrong with first disable interrupts and tasklet_disable?
bruno
^ permalink raw reply
* [PATCH] ath9k_hw: avoid setting cwmin/cwmax to 0 for IBSS for AR9003
From: Luis R. Rodriguez @ 2010-06-15 0:17 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis R. Rodriguez
IBSS requires the cwmin and cwmax to be respected when
we reset the txqueues on AR9003 otherwise the distribution
of beacons will be balanced towards the AR9003 card first
preventing equal contention for air time for other peers
on the IBSS.
Without this IBSS will work but only the AR9003 card will be
be issuing beacons on the IBSS.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/mac.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 1550591..e955bb9 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -555,8 +555,13 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
REGWRITE_BUFFER_FLUSH(ah);
DISABLE_REGWRITE_BUFFER(ah);
- /* cwmin and cwmax should be 0 for beacon queue */
- if (AR_SREV_9300_20_OR_LATER(ah)) {
+ /*
+ * cwmin and cwmax should be 0 for beacon queue
+ * but not for IBSS as we would create an imbalance
+ * on beaconing fairness for participating nodes.
+ */
+ if (AR_SREV_9300_20_OR_LATER(ah) &&
+ ah->opmode != NL80211_IFTYPE_ADHOC) {
REG_WRITE(ah, AR_DLCL_IFS(q), SM(0, AR_D_LCL_IFS_CWMIN)
| SM(0, AR_D_LCL_IFS_CWMAX)
| SM(qi->tqi_aifs, AR_D_LCL_IFS_AIFS));
--
1.6.3.3
^ permalink raw reply related
* Re: wireless button problem with atheros on hp machines
From: Luis R. Rodriguez @ 2010-06-14 22:49 UTC (permalink / raw)
To: Leonardo; +Cc: linux-wireless
In-Reply-To: <AANLkTik2kYW-GxWK7ZIPj7crBZKP6JTsWJs2Mfy7xvoe@mail.gmail.com>
On Mon, Jun 14, 2010 at 2:35 PM, Leonardo <sombriks@gmail.com> wrote:
> 2010/6/13 Luis R. Rodriguez <mcgrof@gmail.com>:
>> On Sun, Jun 13, 2010 at 1:49 PM, Leonardo <sombriks@gmail.com> wrote:
>>> hello all, i don't know if this is the correct channel to report, but
>>> from Slackware 13.0 (2.6.29.6) to 13.1 (2.6.33.4) the wireless button
>>> stopped to work properly.
>>
>> Try 2.6.30, 2.6.31, and 2.6.32 and see if you see the issue on one of
>> those. If so then you can use git bisect to find the culprit. I
>> realize this can be quite cumbersome, but without more information I'm
>> afraid this is as good as it gets. Instead of using Linus' tree you'll
>> want to use the linux-2.6-allstable.git tree since that will have the
>> extra version kernel revisions.
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-allstable.git
>>
>> Luis
>>
>
> Hello currently i'm trying those other kernel versions. I'm grabbing
> it from http://www.kernel.org/
>
> for now i have about 3 kernels running ok or almost ok:
>
> 2.6.33.4
> 2.6.29.6
> 2.6.31.13
>
> 29 and 33 are default packages from slackware, and as i related before
> by using 2.6.29.6 i get the perfect functionality of wireless
> button/led (those hp machines have the led, and if i touch the led it
> changes de color.. nvm)
>
> today i got the 31.13 running; i have to say, maybe i have missed
> something, because i lost sound and the 3d stuff. also ath5k.ko wasn't
> created... but the bluetooth worked as expected, just as 2.6.29.6; i
> am almost sure that i missed the kernel configuration, but fortunately
> i've made a package (make targz-pkg) so i can fix it.
>
> next i'll try the 2.6.32.15 and then 2.6.34, and with some hope find
> when the problem began and report there.
Once you narrow it down between kernel revisions then you can git
bisect yourself to narrow down the issue to the specific culprit
commit.
Luis
^ permalink raw reply
* Re: CARL9170
From: Christian Lamparter @ 2010-06-14 22:32 UTC (permalink / raw)
To: David H. Lynch Jr.; +Cc: linux-wireless
In-Reply-To: <4C169610.5020907@dlasys.net>
On Monday 14 June 2010 22:50:24 David H. Lynch Jr. wrote:
> Many routines are coded to look like interrupt handlers, but the
> code seems to be entirely polled ?
Hardware design decision.
(See "AR9170 STA Programming Guide" - Paragraph 3-3.)
> Am I correct there ? If so do you know if the AR9170-fw code or
> something else might show an example of interrupt handling for the
> AR9170. I must have tx complete interrupts.
Well you have to "poll" the MAC's WLAN Status Registers (0x1c3510?) for
BIT(0)=TX COMP (and BIT(2) = TX FAIL) changes...
Or, if you are only sending one frame at a time, you might be able to poll
0x1c36d4 instead. Also you could decrease the maximum pending tx "interrupt"
timeout in 0x1c3d7c etc...
But if that does not satisfy your need for "real-time responsiveness", you
should contact Stephen Chen @ Atheros directly, maybe he knows a undocumented
feature register which enables real-time interrupt processing.
> Next there are remarks throught the driver and firmware regarding
> cookies.
> I think a cookie is a u8 that uniquely identifies a packet - is
> that correct ?
>
> In the firmware there is a remark somewhere that suguests that the
> cookie AND something else are needed - is that correct or is the cookie
> sufficient ?
This is because of historic reasons. In ar9170usb the driver had
use dirty tricks to get the AC_ID into the firmware's tx report.
So it could do some primitive frame lookup.
carl9170 driver still needs the AC_ID (but now) to reduce the frame lookup cost.
This is somewhat necessary because tx feedback is usually processed in a
critical section and when aggregation is enabled, it can be up to 16 frames
at any time...
regards,
Chr
^ permalink raw reply
* radiotap rate no longer supported in mac80211?
From: Steve deRosier @ 2010-06-14 22:18 UTC (permalink / raw)
To: linux-wireless
I'm trying to support per-packet setting of rate on a packet injection
via the radiotap header. In an earlier version of mac80211 (around
2.6.26), there was code in __ieee80211_parse_tx_radiotap (in
net/mac80211/tx.c) to support the use of the the rate element from the
radiotap header. In current versions of wireless-testing, most of the
code here has been removed and only the flags are parsed.
I want to return the IEEE80211_RADIOTAP_RATE portion of this function
in order to support this. So the questions:
1. Why were all fields other than IEEE80211_RADIOTAP_FLAGS removed?
2. Would it be OK for me to prepare and submit a patch to restore the
rate functionality?
Thanks,
- Steve
^ permalink raw reply
* Re: wireless button problem with atheros on hp machines
From: Leonardo @ 2010-06-14 21:35 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <AANLkTimxtFMpJftSdwDK_DRap4Bw0iVPS9Tcwe_vE_f9@mail.gmail.com>
2010/6/13 Luis R. Rodriguez <mcgrof@gmail.com>:
> On Sun, Jun 13, 2010 at 1:49 PM, Leonardo <sombriks@gmail.com> wrote:
>> hello all, i don't know if this is the correct channel to report, but
>> from Slackware 13.0 (2.6.29.6) to 13.1 (2.6.33.4) the wireless button
>> stopped to work properly.
>
> Try 2.6.30, 2.6.31, and 2.6.32 and see if you see the issue on one of
> those. If so then you can use git bisect to find the culprit. I
> realize this can be quite cumbersome, but without more information I'm
> afraid this is as good as it gets. Instead of using Linus' tree you'll
> want to use the linux-2.6-allstable.git tree since that will have the
> extra version kernel revisions.
>
> git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-allstable.git
>
> Luis
>
Hello currently i'm trying those other kernel versions. I'm grabbing
it from http://www.kernel.org/
for now i have about 3 kernels running ok or almost ok:
2.6.33.4
2.6.29.6
2.6.31.13
29 and 33 are default packages from slackware, and as i related before
by using 2.6.29.6 i get the perfect functionality of wireless
button/led (those hp machines have the led, and if i touch the led it
changes de color.. nvm)
today i got the 31.13 running; i have to say, maybe i have missed
something, because i lost sound and the 3d stuff. also ath5k.ko wasn't
created... but the bluetooth worked as expected, just as 2.6.29.6; i
am almost sure that i missed the kernel configuration, but fortunately
i've made a package (make targz-pkg) so i can fix it.
next i'll try the 2.6.32.15 and then 2.6.34, and with some hope find
when the problem began and report there.
thanks a lot for the guidance,
^ permalink raw reply
* CARL9170
From: David H. Lynch Jr. @ 2010-06-14 20:50 UTC (permalink / raw)
To: Christian Lamparter, linux-wireless
I am trying to digest some things in the carl9170 firmware.
Many routines are coded to look like interrupt handlers, but the
code seems to be entirely polled ?
Am I correct there ? If so do you know if the AR9170-fw code or
something else might show an example of interrupt handling for the
AR9170. I must have tx complete interrupts.
Next there are remarks throught the driver and firmware regarding
cookies.
I think a cookie is a u8 that uniquely identifies a packet - is
that correct ?
In the firmware there is a remark somewhere that suguests that the
cookie AND something else are needed - is that correct or is the cookie
sufficient ?
Thank you.
^ permalink raw reply
* Re: [PATCH] iwlwifi: cancel scan watchdog in iwl_bg_abort_scan
From: reinette chatre @ 2010-06-14 20:26 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless@vger.kernel.org, Mihai Harpau, stable@kernel.org
In-Reply-To: <1276540554-5336-1-git-send-email-linville@tuxdriver.com>
On Mon, 2010-06-14 at 11:35 -0700, John W. Linville wrote:
> Avoids this:
>
> WARNING: at net/mac80211/scan.c:312 ieee80211_scan_completed+0x5f/0x1f1
> [mac80211]()
> Hardware name: Latitude E5400
> Modules linked in: aes_x86_64 aes_generic fuse ipt_MASQUERADE iptable_nat
> nf_nat rfcomm sco bridge stp llc bnep l2cap sunrpc cpufreq_ondemand
> acpi_cpufreq freq_table xt_physdev ip6t_REJECT nf_conntrack_ipv6
> ip6table_filter ip6_tables ipv6 kvm_intel kvm uinput arc4 ecb
> snd_hda_codec_intelhdmi snd_hda_codec_idt snd_hda_intel iwlagn snd_hda_codec
> snd_hwdep snd_seq snd_seq_device iwlcore snd_pcm dell_wmi sdhci_pci sdhci
> iTCO_wdt tg3 dell_laptop mmc_core i2c_i801 wmi mac80211 snd_timer
> iTCO_vendor_support btusb joydev dcdbas cfg80211 bluetooth snd soundcore
> microcode rfkill snd_page_alloc firewire_ohci firewire_core crc_itu_t
> yenta_socket rsrc_nonstatic i915 drm_kms_helper drm i2c_algo_bit i2c_core video
> output [last unloaded: scsi_wait_scan]
> Pid: 979, comm: iwlagn Tainted: G W 2.6.33.3-85.fc13.x86_64 #1
> Call Trace:
> [<ffffffff8104b558>] warn_slowpath_common+0x77/0x8f
> [<ffffffff8104b57f>] warn_slowpath_null+0xf/0x11
> [<ffffffffa01bb7d9>] ieee80211_scan_completed+0x5f/0x1f1 [mac80211]
> [<ffffffffa02a23f0>] iwl_bg_scan_completed+0xbb/0x17a [iwlcore]
> [<ffffffff81060d3d>] worker_thread+0x1a4/0x232
> [<ffffffffa02a2335>] ? iwl_bg_scan_completed+0x0/0x17a [iwlcore]
> [<ffffffff81064817>] ? autoremove_wake_function+0x0/0x34
> [<ffffffff81060b99>] ? worker_thread+0x0/0x232
> [<ffffffff810643c7>] kthread+0x7a/0x82
> [<ffffffff8100a924>] kernel_thread_helper+0x4/0x10
> [<ffffffff8106434d>] ? kthread+0x0/0x82
> [<ffffffff8100a920>] ? kernel_thread_helper+0x0/0x10
>
> Reported here:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=590436
>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> Reported-by: Mihai Harpau <mishu@piatafinanciara.ro>
> Cc: stable@kernel.org
> ---
Great catch. Thank you very much
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Reinette
^ permalink raw reply
* [PATCH 11/14] rt2x00: Update author rt2800lib
From: Ivo van Doorn @ 2010-06-14 20:13 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142212.55156.IvDoorn@gmail.com>
From: Ivo van Doorn <IvDoorn@gmail.com>
rt2800lib has been under development of the rt2x00 project,
so add it to the author string for the module information.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 6d4df3e..a83477a 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1,9 +1,9 @@
/*
+ Copyright (C) 2010 Ivo van Doorn <IvDoorn@gmail.com>
Copyright (C) 2009 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Copyright (C) 2009 Gertjan van Wingerde <gwingerde@gmail.com>
Based on the original rt2800pci.c and rt2800usb.c.
- Copyright (C) 2009 Ivo van Doorn <IvDoorn@gmail.com>
Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
Copyright (C) 2009 Luis Correia <luis.f.correia@gmail.com>
@@ -41,10 +41,6 @@
#include "rt2800lib.h"
#include "rt2800.h"
-MODULE_AUTHOR("Bartlomiej Zolnierkiewicz");
-MODULE_DESCRIPTION("rt2800 library");
-MODULE_LICENSE("GPL");
-
/*
* Register access.
* All access to the CSR registers will go through the methods
@@ -2761,3 +2757,9 @@ const struct ieee80211_ops rt2800_mac80211_ops = {
.rfkill_poll = rt2x00mac_rfkill_poll,
};
EXPORT_SYMBOL_GPL(rt2800_mac80211_ops);
+
+MODULE_AUTHOR(DRV_PROJECT ", Bartlomiej Zolnierkiewicz");
+MODULE_VERSION(DRV_VERSION);
+MODULE_DESCRIPTION("Ralink RT2800 library");
+MODULE_LICENSE("GPL");
+
--
1.6.6.1
^ permalink raw reply related
* [PATCH 13/14] rt2x00: Enable HW crypto by default
From: Ivo van Doorn @ 2010-06-14 20:13 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142213.38654.IvDoorn@gmail.com>
From: Ivo van Doorn <IvDoorn@gmail.com>
Hardware cryptography seems to be working
on a 11G network with WPA/WPA2 cryptography
enabled. WEP still needs to be tested...
Signed-of-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2800usb.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index afa30ea..165da7b 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -51,7 +51,7 @@
/*
* Allow hardware encryption to be disabled.
*/
-static int modparam_nohwcrypt = 1;
+static int modparam_nohwcrypt = 0;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index c437960..f18c12a 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -45,7 +45,7 @@
/*
* Allow hardware encryption to be disabled.
*/
-static int modparam_nohwcrypt = 1;
+static int modparam_nohwcrypt = 0;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
--
1.6.6.1
^ permalink raw reply related
* [PATCH 14/14] rt2x00: Synchronize WCID initialization with legacy driver
From: Ivo van Doorn @ 2010-06-14 20:14 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142213.57748.IvDoorn@gmail.com>
From: Ivo van Doorn <IvDoorn@gmail.com>
Legacy rt2870 driver handles WCID differently then we expected,
the BSSID and Cipher value are 3 bit values, while the 4th bit
should be set elsewhere in an extended field.
After this, rt2800usb reports frames have been decrypted
successfully, indicating that the Hardware decryption now is
working correctly.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800.h | 4 ++++
drivers/net/wireless/rt2x00/rt2800lib.c | 31 ++++++++++++++++++++++---------
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index b308421..3ed87ba 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -1436,6 +1436,10 @@ struct mac_iveiv_entry {
#define MAC_WCID_ATTRIBUTE_CIPHER FIELD32(0x0000000e)
#define MAC_WCID_ATTRIBUTE_BSS_IDX FIELD32(0x00000070)
#define MAC_WCID_ATTRIBUTE_RX_WIUDF FIELD32(0x00000380)
+#define MAC_WCID_ATTRIBUTE_CIPHER_EXT FIELD32(0x00000400)
+#define MAC_WCID_ATTRIBUTE_BSS_IDX_EXT FIELD32(0x00000800)
+#define MAC_WCID_ATTRIBUTE_WAPI_MCBC FIELD32(0x00008000)
+#define MAC_WCID_ATTRIBUTE_WAPI_KEY_IDX FIELD32(0xff000000)
/*
* SHARED_KEY_MODE:
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a83477a..636bfd6 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -554,15 +554,28 @@ static void rt2800_config_wcid_attr(struct rt2x00_dev *rt2x00dev,
offset = MAC_WCID_ATTR_ENTRY(key->hw_key_idx);
- rt2800_register_read(rt2x00dev, offset, ®);
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_KEYTAB,
- !!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE));
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_CIPHER,
- (crypto->cmd == SET_KEY) * crypto->cipher);
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_BSS_IDX,
- (crypto->cmd == SET_KEY) * crypto->bssidx);
- rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_RX_WIUDF, crypto->cipher);
- rt2800_register_write(rt2x00dev, offset, reg);
+ if (crypto->cmd == SET_KEY) {
+ rt2800_register_read(rt2x00dev, offset, ®);
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_KEYTAB,
+ !!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE));
+ /*
+ * Both the cipher as the BSS Idx numbers are split in a main
+ * value of 3 bits, and a extended field for adding one additional
+ * bit to the value.
+ */
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_CIPHER,
+ (crypto->cipher & 0x7));
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_CIPHER_EXT,
+ (crypto->cipher & 0x8) >> 3);
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_BSS_IDX,
+ (crypto->bssidx & 0x7));
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_BSS_IDX_EXT,
+ (crypto->bssidx & 0x8) >> 3);
+ rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_RX_WIUDF, crypto->cipher);
+ rt2800_register_write(rt2x00dev, offset, reg);
+ } else {
+ rt2800_register_write(rt2x00dev, offset, 0);
+ }
offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
--
1.6.6.1
^ permalink raw reply related
* [PATCH 12/14] rt2x00: Limit TX done looping to number of TX ring entries
From: Ivo van Doorn @ 2010-06-14 20:13 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142213.16315.IvDoorn@gmail.com>
From: Ivo van Doorn <IvDoorn@gmail.com>
Similar to rt2800pci, remove the check for duplicate
register reading, and instead limit the for-loop to
the maximum number of TX entries inside a queue.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt61pci.c | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index d127011..f7ee31e 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2052,29 +2052,24 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
struct txdone_entry_desc txdesc;
u32 word;
u32 reg;
- u32 old_reg;
int type;
int index;
+ int i;
/*
- * During each loop we will compare the freshly read
- * STA_CSR4 register value with the value read from
- * the previous loop. If the 2 values are equal then
- * we should stop processing because the chance is
- * quite big that the device has been unplugged and
- * we risk going into an endless loop.
+ * TX_STA_FIFO is a stack of X entries, hence read TX_STA_FIFO
+ * at most X times and also stop processing once the TX_STA_FIFO_VALID
+ * flag is not set anymore.
+ *
+ * The legacy drivers use X=TX_RING_SIZE but state in a comment
+ * that the TX_STA_FIFO stack has a size of 16. We stick to our
+ * tx ring size for now.
*/
- old_reg = 0;
-
- while (1) {
+ for (i = 0; i < TX_ENTRIES; i++) {
rt2x00pci_register_read(rt2x00dev, STA_CSR4, ®);
if (!rt2x00_get_field32(reg, STA_CSR4_VALID))
break;
- if (old_reg == reg)
- break;
- old_reg = reg;
-
/*
* Skip this entry when it contains an invalid
* queue identication number.
--
1.6.6.1
^ permalink raw reply related
* [PATCH 10/14] rt2x00: Enable fallback rates for rt61pci and rt73usb
From: Ivo van Doorn @ 2010-06-14 20:12 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142212.27713.IvDoorn@gmail.com>
From: Ivo van Doorn <IvDoorn@gmail.com>
Explicitly enable the usage of fallback rates for
the transmission of frames with rt61pci and rt73usb hardware.
Note that for txdone reporting, only rt61pci is capable of
reporting the fallback rates, for USB it is not possible
to determine the number of retries. However the device will
use the fallback rates, so it might still help in the performance.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt61pci.c | 22 ++++++++++++++++++++++
drivers/net/wireless/rt2x00/rt73usb.c | 3 +++
2 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 243df08..d127011 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -931,6 +931,9 @@ static void rt61pci_config_retry_limit(struct rt2x00_dev *rt2x00dev,
u32 reg;
rt2x00pci_register_read(rt2x00dev, TXRX_CSR4, ®);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_DOWN, 1);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_STEP, 0);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_FALLBACK_CCK, 0);
rt2x00_set_field32(®, TXRX_CSR4_LONG_RETRY_LIMIT,
libconf->conf->long_frame_max_tx_count);
rt2x00_set_field32(®, TXRX_CSR4_SHORT_RETRY_LIMIT,
@@ -2130,6 +2133,13 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
}
txdesc.retry = rt2x00_get_field32(reg, STA_CSR4_RETRY_COUNT);
+ /*
+ * the frame was retried at least once
+ * -> hw used fallback rates
+ */
+ if (txdesc.retry)
+ __set_bit(TXDONE_FALLBACK, &txdesc.flags);
+
rt2x00pci_txdone(entry, &txdesc);
}
}
@@ -2587,6 +2597,18 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
EEPROM_MAC_ADDR_0));
/*
+ * As rt61 has a global fallback table we cannot specify
+ * more then one tx rate per frame but since the hw will
+ * try several rates (based on the fallback table) we should
+ * still initialize max_rates to the maximum number of rates
+ * we are going to try. Otherwise mac80211 will truncate our
+ * reported tx rates and the rc algortihm will end up with
+ * incorrect data.
+ */
+ rt2x00dev->hw->max_rates = 7;
+ rt2x00dev->hw->max_rate_tries = 1;
+
+ /*
* Initialize hw_mode information.
*/
spec->supported_bands = SUPPORT_BAND_2GHZ;
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 113ad69..d06d90f 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -816,6 +816,9 @@ static void rt73usb_config_retry_limit(struct rt2x00_dev *rt2x00dev,
u32 reg;
rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, ®);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_DOWN, 1);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_RATE_STEP, 0);
+ rt2x00_set_field32(®, TXRX_CSR4_OFDM_TX_FALLBACK_CCK, 0);
rt2x00_set_field32(®, TXRX_CSR4_LONG_RETRY_LIMIT,
libconf->conf->long_frame_max_tx_count);
rt2x00_set_field32(®, TXRX_CSR4_SHORT_RETRY_LIMIT,
--
1.6.6.1
^ permalink raw reply related
* [PATCH 09/14] rt2x00: Fix tx status reporting when falling back to the lowest rate
From: Ivo van Doorn @ 2010-06-14 20:12 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142212.02575.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
In some corner cases the reported tx rates/retries didn't match the really
used ones.
The hardware lowers the tx rate on each consecutive retry by 1 (but won't
fall back from MCS to legacy rates) _until_ it reaches the lowest one.
In case the frame wasn't sent succesful the number of retries is 7 and if
a rate index <7 was used the previous code reported negative rate indexes
which were then ignored by the rate control algorithm and mac80211.
Instead, report the remaining number of retries to have happened with
the lowest rate (index 0). This should give the rate control algorithm
slightly more accurate information about the used tx rates/retries.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00dev.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index e7a208d..918451a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -258,11 +258,22 @@ void rt2x00lib_txdone(struct queue_entry *entry,
/*
* Frame was send with retries, hardware tried
* different rates to send out the frame, at each
- * retry it lowered the rate 1 step.
+ * retry it lowered the rate 1 step except when the
+ * lowest rate was used.
*/
for (i = 0; i < retry_rates && i < IEEE80211_TX_MAX_RATES; i++) {
tx_info->status.rates[i].idx = rate_idx - i;
tx_info->status.rates[i].flags = rate_flags;
+
+ if (rate_idx - i == 0) {
+ /*
+ * The lowest rate (index 0) was used until the
+ * number of max retries was reached.
+ */
+ tx_info->status.rates[i].count = retry_rates - i;
+ i++;
+ break;
+ }
tx_info->status.rates[i].count = 1;
}
if (i < (IEEE80211_TX_MAX_RATES - 1))
--
1.6.6.1
^ permalink raw reply related
* [PATCH 08/14] rt2x00: provide mac80211 a suitable max_rates value
From: Ivo van Doorn @ 2010-06-14 20:12 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142211.33421.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
Set up max_rates and max_rate_tries with suitable values even if we do not
support the whole functionality.
As rt2800 has a global fallback table we cannot specify more then one tx rate
per frame but since the hw will try several different rates (based on the
fallback table) we should still initialize max_rates to the maximum number of
rates we are going to try. Otherwise mac80211 will truncate our reported tx
rates and the rc algortihm will end up with incorrect data choosing unsuitable
rates for tx.
This improves throughput on rt2800 devices considerable.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index f158322..6d4df3e 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2497,6 +2497,18 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_addr(rt2x00dev,
EEPROM_MAC_ADDR_0));
+ /*
+ * As rt2800 has a global fallback table we cannot specify
+ * more then one tx rate per frame but since the hw will
+ * try several rates (based on the fallback table) we should
+ * still initialize max_rates to the maximum number of rates
+ * we are going to try. Otherwise mac80211 will truncate our
+ * reported tx rates and the rc algortihm will end up with
+ * incorrect data.
+ */
+ rt2x00dev->hw->max_rates = 7;
+ rt2x00dev->hw->max_rate_tries = 1;
+
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom);
/*
--
1.6.6.1
^ permalink raw reply related
* [PATCH 07/14] rt2x00: Fix typo in rt2800_config_txpower
From: Ivo van Doorn @ 2010-06-14 20:11 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142211.09880.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
Fix typo in rt2800_config_txpower.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index ae20e67..f158322 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1079,7 +1079,7 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev,
u8 r1;
rt2800_bbp_read(rt2x00dev, 1, &r1);
- rt2x00_set_field8(®, BBP1_TX_POWER, 0);
+ rt2x00_set_field8(&r1, BBP1_TX_POWER, 0);
rt2800_bbp_write(rt2x00dev, 1, r1);
rt2800_register_read(rt2x00dev, TX_PWR_CFG_0, ®);
--
1.6.6.1
^ permalink raw reply related
* [PATCH 06/14] rt2x00: Fix TX_STA_FIFO handling
From: Ivo van Doorn @ 2010-06-14 20:11 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142210.43525.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
Currently rt2800pci will read TX_STA_FIFO until the previously read value
matches the current value. However, it is obvious that TX_STA_FIFO only
contains values that can easily be the same for multiple consecutive frames
(especially when communicating with only one other STA). Hence, we often
ended up with reading only the first entry and ignoring the rest.
One result was that when the TX_STA_FIFO contained multiple entires, only
the first one was read and properly handled while the others remained in the
tx queue.
Thus, drop this check but introduce a maximum number of reads. All legacy
drivers use the size of the tx ring as limit but state that the TX_STA_FIFO
has only 16 entries. So, let's just stick with the tx ring size for now.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index eeecedb..afa30ea 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -813,29 +813,24 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
struct txdone_entry_desc txdesc;
u32 word;
u32 reg;
- u32 old_reg;
int wcid, ack, pid, tx_wcid, tx_ack, tx_pid;
u16 mcs, real_mcs;
+ int i;
/*
- * During each loop we will compare the freshly read
- * TX_STA_FIFO register value with the value read from
- * the previous loop. If the 2 values are equal then
- * we should stop processing because the chance it
- * quite big that the device has been unplugged and
- * we risk going into an endless loop.
+ * TX_STA_FIFO is a stack of X entries, hence read TX_STA_FIFO
+ * at most X times and also stop processing once the TX_STA_FIFO_VALID
+ * flag is not set anymore.
+ *
+ * The legacy drivers use X=TX_RING_SIZE but state in a comment
+ * that the TX_STA_FIFO stack has a size of 16. We stick to our
+ * tx ring size for now.
*/
- old_reg = 0;
-
- while (1) {
+ for (i = 0; i < TX_ENTRIES; i++) {
rt2800_register_read(rt2x00dev, TX_STA_FIFO, ®);
if (!rt2x00_get_field32(reg, TX_STA_FIFO_VALID))
break;
- if (old_reg == reg)
- break;
- old_reg = reg;
-
wcid = rt2x00_get_field32(reg, TX_STA_FIFO_WCID);
ack = rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED);
pid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE);
--
1.6.6.1
^ permalink raw reply related
* [PATCH 05/14] rt2x00: Add comment about BBP1_TX_POWER
From: Ivo van Doorn @ 2010-06-14 20:10 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142210.10378.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
Add a comment about the meaning of BBP1_TX_POWER stating all possible values.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 16bfaa8..b308421 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -1557,7 +1557,9 @@ struct mac_iveiv_entry {
*/
/*
- * BBP 1: TX Antenna
+ * BBP 1: TX Antenna & Power
+ * POWER: 0 - normal, 1 - drop tx power by 6dBm, 2 - drop tx power by 12dBm,
+ * 3 - increase tx power by 6dBm
*/
#define BBP1_TX_POWER FIELD8(0x07)
#define BBP1_TX_ANTENNA FIELD8(0x18)
--
1.6.6.1
^ permalink raw reply related
* [PATCH 04/14] rt2x00: Fix IEEE80211_TX_CTL_MORE_FRAMES handling
From: Ivo van Doorn @ 2010-06-14 20:10 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142209.42709.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
IEEE80211_TX_CTL_MORE_FRAMES indicates that more frames are queued for tx
but has nothing to do with fragmentation. Hence, don't set ENTRY_TXD_MORE_FRAG
but only ENTRY_TXD_BURST to not kick the tx queues immediately.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00queue.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 35858b1..f916371 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -353,13 +353,18 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
/*
* Check if more fragments are pending
*/
- if (ieee80211_has_morefrags(hdr->frame_control) ||
- (tx_info->flags & IEEE80211_TX_CTL_MORE_FRAMES)) {
+ if (ieee80211_has_morefrags(hdr->frame_control)) {
__set_bit(ENTRY_TXD_BURST, &txdesc->flags);
__set_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags);
}
/*
+ * Check if more frames (!= fragments) are pending
+ */
+ if (tx_info->flags & IEEE80211_TX_CTL_MORE_FRAMES)
+ __set_bit(ENTRY_TXD_BURST, &txdesc->flags);
+
+ /*
* Beacons and probe responses require the tsf timestamp
* to be inserted into the frame, except for a frame that has been injected
* through a monitor interface. This latter is needed for testing a
--
1.6.6.1
^ permalink raw reply related
* [PATCH 03/14] rt2x00: only set TXDONE_FALLBACK in rt2800pci if the frame was retried
From: Ivo van Doorn @ 2010-06-14 20:09 UTC (permalink / raw)
To: John W. Linville
Cc: Helmut Schaa, rt2x00 Users List, linux-wireless,
Gertjan van Wingerde
In-Reply-To: <201006142209.09943.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
TXDONE_FALLBACK expresses that fallback rates were used for retries. Hence,
it only makes sense to set the flag if retries > 0.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index b5a871e..eeecedb 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -903,8 +903,12 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
txdesc.retry = 7;
}
- __set_bit(TXDONE_FALLBACK, &txdesc.flags);
-
+ /*
+ * the frame was retried at least once
+ * -> hw used fallback rates
+ */
+ if (txdesc.retry)
+ __set_bit(TXDONE_FALLBACK, &txdesc.flags);
rt2x00pci_txdone(entry, &txdesc);
}
--
1.6.6.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox