* [PATCHv2 17/18] ath5k: report 5/10 MHz channels
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath5k/base.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index a4e0b4e..2a2ec99 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1424,6 +1424,16 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
rxs->rate_idx = ath5k_hw_to_driver_rix(ah, rs->rs_rate);
rxs->flag |= ath5k_rx_decrypted(ah, skb, rs);
+ switch (ah->ah_bwmode) {
+ case AR5K_BWMODE_5MHZ:
+ rxs->flag |= RX_FLAG_5MHZ;
+ break;
+ case AR5K_BWMODE_10MHZ:
+ rxs->flag |= RX_FLAG_10MHZ;
+ break;
+ default:
+ break;
+ }
ath5k_get_bitrates(ah->ah_bwmode, &ah->sbands[ah->curchan->band],
&bitrates, &n_bitrates);
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 18/18] ath5k: enable support for 5 MHz and 10 MHz channels
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath5k/ath5k.h | 1 +
drivers/net/wireless/ath/ath5k/base.c | 25 ++++++++++++++++++++++---
drivers/net/wireless/ath/ath5k/base.h | 2 +-
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +-
4 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 1dee0c4..b43ef34 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -29,6 +29,7 @@
#include <linux/average.h>
#include <linux/leds.h>
#include <net/mac80211.h>
+#include <net/cfg80211.h>
/* RX/TX descriptor hw structs
* TODO: Driver part should only see sw structs */
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 2a2ec99..9490589 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -56,6 +56,7 @@
#include <linux/etherdevice.h>
#include <linux/nl80211.h>
+#include <net/cfg80211.h>
#include <net/ieee80211_radiotap.h>
#include <asm/unaligned.h>
@@ -501,11 +502,27 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
* Called with ah->lock.
*/
int
-ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan)
+ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef)
{
ATH5K_DBG(ah, ATH5K_DEBUG_RESET,
"channel set, resetting (%u -> %u MHz)\n",
- ah->curchan->center_freq, chan->center_freq);
+ ah->curchan->center_freq, chandef->chan->center_freq);
+
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_20:
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ ah->ah_bwmode = AR5K_BWMODE_DEFAULT;
+ break;
+ case NL80211_CHAN_WIDTH_5:
+ ah->ah_bwmode = AR5K_BWMODE_5MHZ;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ ah->ah_bwmode = AR5K_BWMODE_10MHZ;
+ break;
+ default:
+ WARN_ON(1);
+ return -EINVAL;
+ }
/*
* To switch channels clear any pending DMA operations;
@@ -513,7 +530,7 @@ ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan)
* hardware at the new frequency, and then re-enable
* the relevant bits of the h/w.
*/
- return ath5k_reset(ah, chan, true);
+ return ath5k_reset(ah, chandef->chan, true);
}
void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
@@ -2537,6 +2554,8 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
/* SW support for IBSS_RSN is provided by mac80211 */
hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+ hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
+
/* both antennas can be configured as RX or TX */
hw->wiphy->available_antennas_tx = 0x3;
hw->wiphy->available_antennas_rx = 0x3;
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index 6c94c7f..130075b 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -99,7 +99,7 @@ void ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable);
void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah,
struct ieee80211_vif *vif);
-int ath5k_chan_set(struct ath5k_hw *ah, struct ieee80211_channel *chan);
+int ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef);
void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 06f86f4..2129330 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -202,7 +202,7 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
mutex_lock(&ah->lock);
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
- ret = ath5k_chan_set(ah, conf->chandef.chan);
+ ret = ath5k_chan_set(ah, &conf->chandef);
if (ret < 0)
goto unlock;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 14/18] ath9k: report 5/10 MHz channels
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/recv.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 9e7c929..697d7f2 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -872,6 +872,17 @@ static int ath9k_process_rate(struct ath_common *common,
&bitrates, &n_bitrates)))
return 0;
+ switch (hw->conf.chandef.width) {
+ case NL80211_CHAN_WIDTH_5:
+ rxs->flag |= RX_FLAG_5MHZ;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ rxs->flag |= RX_FLAG_10MHZ;
+ break;
+ default:
+ break;
+ }
+
if (rx_stats->rs_rate & 0x80) {
/* HT rate */
rxs->flag |= RX_FLAG_HT;
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 16/18] ath5k: add and use 5/10 MHz bitrate tables
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
When a reduced bandwidth mode is enabled, the according bitrate tables
must be used instead of the standard tables. This patch adds these
bitrate tables and selects the appropriate table.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath5k/ath5k.h | 10 +++-
drivers/net/wireless/ath/ath5k/base.c | 98 ++++++++++++++++++++++++++++----
drivers/net/wireless/ath/ath5k/debug.c | 23 ++++++--
drivers/net/wireless/ath/ath5k/pcu.c | 30 ++++++++--
drivers/net/wireless/ath/ath5k/qcu.c | 23 +++++++-
5 files changed, 160 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 2d691b8..1dee0c4 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -486,7 +486,9 @@ enum ath5k_bw_mode {
AR5K_BWMODE_DEFAULT = 0,
AR5K_BWMODE_5MHZ = 1,
AR5K_BWMODE_10MHZ = 2,
- AR5K_BWMODE_40MHZ = 3
+ AR5K_BWMODE_40MHZ = 3,
+ AR5K_BWMODE_MAX
+
};
@@ -1264,8 +1266,10 @@ struct ath5k_hw {
struct ieee80211_hw *hw; /* IEEE 802.11 common */
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
struct ieee80211_channel channels[ATH_CHAN_MAX];
- struct ieee80211_rate rates[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
- s8 rate_idx[IEEE80211_NUM_BANDS][AR5K_MAX_RATES];
+ struct ieee80211_rate
+ rates[IEEE80211_NUM_BANDS][AR5K_BWMODE_MAX][AR5K_MAX_RATES];
+ s8
+ rate_idx[IEEE80211_NUM_BANDS][AR5K_BWMODE_MAX][AR5K_MAX_RATES];
enum nl80211_iftype opmode;
#ifdef CONFIG_ATH5K_DEBUG
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 7f702fe..a4e0b4e 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -330,18 +330,50 @@ ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
return count;
}
+static inline void
+ath5k_get_bitrates(int bwmode,
+ struct ieee80211_supported_band *b,
+ struct ieee80211_rate **bitrates,
+ int *n_bitrates)
+{
+ switch (bwmode) {
+ case AR5K_BWMODE_40MHZ:
+ /* 40 MHz not supported in mac80211, fall through to default */
+ case AR5K_BWMODE_DEFAULT:
+ *bitrates = b->bitrates;
+ *n_bitrates = b->n_bitrates;
+ break;
+ case AR5K_BWMODE_5MHZ:
+ *bitrates = b->bitrates_quarter;
+ *n_bitrates = b->n_bitrates_quarter;
+ break;
+ case AR5K_BWMODE_10MHZ:
+ *bitrates = b->bitrates_half;
+ *n_bitrates = b->n_bitrates_half;
+ break;
+ default:
+ BUG_ON(1);
+ }
+}
+
static void
ath5k_setup_rate_idx(struct ath5k_hw *ah, struct ieee80211_supported_band *b)
{
- u8 i;
+ struct ieee80211_rate *bitrates;
+ int n_bitrates, bwmode;
+ u8 i, val_s;
- for (i = 0; i < AR5K_MAX_RATES; i++)
- ah->rate_idx[b->band][i] = -1;
+ for (bwmode = 0; bwmode < AR5K_BWMODE_MAX; bwmode++) {
+ for (i = 0; i < AR5K_MAX_RATES; i++)
+ ah->rate_idx[b->band][bwmode][i] = -1;
+ ath5k_get_bitrates(bwmode, b, &bitrates, &n_bitrates);
- for (i = 0; i < b->n_bitrates; i++) {
- ah->rate_idx[b->band][b->bitrates[i].hw_value] = i;
- if (b->bitrates[i].hw_value_short)
- ah->rate_idx[b->band][b->bitrates[i].hw_value_short] = i;
+ for (i = 0; i < n_bitrates; i++) {
+ ah->rate_idx[b->band][bwmode][bitrates[i].hw_value] = i;
+ val_s = bitrates[i].hw_value_short;
+ if (val_s)
+ ah->rate_idx[b->band][bwmode][val_s] = i;
+ }
}
}
@@ -359,7 +391,12 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
/* 2GHz band */
sband = &ah->sbands[IEEE80211_BAND_2GHZ];
sband->band = IEEE80211_BAND_2GHZ;
- sband->bitrates = &ah->rates[IEEE80211_BAND_2GHZ][0];
+ sband->bitrates =
+ &ah->rates[IEEE80211_BAND_2GHZ][AR5K_BWMODE_DEFAULT][0];
+ sband->bitrates_half =
+ &ah->rates[IEEE80211_BAND_2GHZ][AR5K_BWMODE_10MHZ][0];
+ sband->bitrates_quarter =
+ &ah->rates[IEEE80211_BAND_2GHZ][AR5K_BWMODE_5MHZ][0];
if (test_bit(AR5K_MODE_11G, ah->ah_capabilities.cap_mode)) {
/* G mode */
@@ -367,6 +404,19 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
sizeof(struct ieee80211_rate) * 12);
sband->n_bitrates = 12;
+ memcpy(sband->bitrates_half, &ath5k_rates[4],
+ sizeof(struct ieee80211_rate) * 8);
+ sband->n_bitrates_half = 8;
+ for (i = 0; i < sband->n_bitrates_half; i++)
+ sband->bitrates_half[i].bitrate /= 2;
+
+ memcpy(sband->bitrates_quarter, &ath5k_rates[4],
+ sizeof(struct ieee80211_rate) * 8);
+ sband->n_bitrates_quarter = 8;
+ for (i = 0; i < sband->n_bitrates_quarter; i++)
+ sband->bitrates_quarter[i].bitrate /= 4;
+
+
sband->channels = ah->channels;
sband->n_channels = ath5k_setup_channels(ah, sband->channels,
AR5K_MODE_11G, max_c);
@@ -407,12 +457,29 @@ ath5k_setup_bands(struct ieee80211_hw *hw)
if (test_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode)) {
sband = &ah->sbands[IEEE80211_BAND_5GHZ];
sband->band = IEEE80211_BAND_5GHZ;
- sband->bitrates = &ah->rates[IEEE80211_BAND_5GHZ][0];
+ sband->bitrates =
+ &ah->rates[IEEE80211_BAND_5GHZ][AR5K_BWMODE_DEFAULT][0];
+ sband->bitrates_half =
+ &ah->rates[IEEE80211_BAND_5GHZ][AR5K_BWMODE_10MHZ][0];
+ sband->bitrates_quarter =
+ &ah->rates[IEEE80211_BAND_5GHZ][AR5K_BWMODE_5MHZ][0];
memcpy(sband->bitrates, &ath5k_rates[4],
sizeof(struct ieee80211_rate) * 8);
sband->n_bitrates = 8;
+ memcpy(sband->bitrates_half, &ath5k_rates[4],
+ sizeof(struct ieee80211_rate) * 8);
+ sband->n_bitrates_half = 8;
+ for (i = 0; i < sband->n_bitrates_half; i++)
+ sband->bitrates_half[i].bitrate /= 2;
+
+ memcpy(sband->bitrates_quarter, &ath5k_rates[4],
+ sizeof(struct ieee80211_rate) * 8);
+ sband->n_bitrates_quarter = 8;
+ for (i = 0; i < sband->n_bitrates_quarter; i++)
+ sband->bitrates_quarter[i].bitrate /= 4;
+
sband->channels = &ah->channels[count_c];
sband->n_channels = ath5k_setup_channels(ah, sband->channels,
AR5K_MODE_11A, max_c);
@@ -556,7 +623,7 @@ ath5k_hw_to_driver_rix(struct ath5k_hw *ah, int hw_rix)
"hw_rix out of bounds: %x\n", hw_rix))
return 0;
- rix = ah->rate_idx[ah->curchan->band][hw_rix];
+ rix = ah->rate_idx[ah->curchan->band][ah->ah_bwmode][hw_rix];
if (WARN(rix < 0, "invalid hw_rix: %x\n", hw_rix))
rix = 0;
@@ -1320,6 +1387,8 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
struct ath5k_rx_status *rs)
{
struct ieee80211_rx_status *rxs;
+ struct ieee80211_rate *bitrates;
+ int n_bitrates;
ath5k_remove_padding(skb);
@@ -1356,8 +1425,10 @@ ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
rxs->rate_idx = ath5k_hw_to_driver_rix(ah, rs->rs_rate);
rxs->flag |= ath5k_rx_decrypted(ah, skb, rs);
+ ath5k_get_bitrates(ah->ah_bwmode, &ah->sbands[ah->curchan->band],
+ &bitrates, &n_bitrates);
if (rxs->rate_idx >= 0 && rs->rs_rate ==
- ah->sbands[ah->curchan->band].bitrates[rxs->rate_idx].hw_value_short)
+ bitrates[rxs->rate_idx].hw_value_short)
rxs->flag |= RX_FLAG_SHORTPRE;
trace_ath5k_rx(ah, skb);
@@ -2513,6 +2584,11 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
AR5K_INIT_RETRY_LONG);
}
+ /* don't enable for the 11B only chips */
+ if (test_bit(AR5K_MODE_11G, ah->ah_capabilities.cap_mode) ||
+ test_bit(AR5K_MODE_11A, ah->ah_capabilities.cap_mode))
+ hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
+
hw->vif_data_size = sizeof(struct ath5k_vif);
/* Finish private driver data initialization */
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 9d00dab..cb6de88 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -961,10 +961,25 @@ ath5k_debug_dump_bands(struct ath5k_hw *ah)
printk(KERN_DEBUG " rates:\n");
for (i = 0; i < band->n_bitrates; i++)
printk(KERN_DEBUG " %4d %.4x %.4x %.4x\n",
- band->bitrates[i].bitrate,
- band->bitrates[i].hw_value,
- band->bitrates[i].flags,
- band->bitrates[i].hw_value_short);
+ band->bitrates[i].bitrate,
+ band->bitrates[i].hw_value,
+ band->bitrates[i].flags,
+ band->bitrates[i].hw_value_short);
+ printk(KERN_DEBUG " 10 MHz rates:\n");
+ for (i = 0; i < band->n_bitrates_half; i++)
+ printk(KERN_DEBUG " %4d %.4x %.4x %.4x\n",
+ band->bitrates_half[i].bitrate,
+ band->bitrates_half[i].hw_value,
+ band->bitrates_half[i].flags,
+ band->bitrates_half[i].hw_value_short);
+ printk(KERN_DEBUG " 5 MHz rates:\n");
+ for (i = 0; i < band->n_bitrates_quarter; i++)
+ printk(KERN_DEBUG " %4d %.4x %.4x %.4x\n",
+ band->bitrates_quarter[i].bitrate,
+ band->bitrates_quarter[i].hw_value,
+ band->bitrates_quarter[i].flags,
+ band->bitrates_quarter[i].hw_value_short);
+
}
}
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
index 1f16b42..39d3f17 100644
--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -274,24 +274,44 @@ ath5k_hw_update_mib_counters(struct ath5k_hw *ah)
static inline void
ath5k_hw_write_rate_duration(struct ath5k_hw *ah)
{
+ struct ieee80211_rate *bitrates;
struct ieee80211_rate *rate;
- unsigned int i;
+ unsigned int i, n_bitrates;
/* 802.11g covers both OFDM and CCK */
u8 band = IEEE80211_BAND_2GHZ;
+ switch (ah->ah_bwmode) {
+ case AR5K_BWMODE_DEFAULT:
+ case AR5K_BWMODE_40MHZ:
+ bitrates = ah->sbands[band].bitrates;
+ n_bitrates = ah->sbands[band].n_bitrates;
+ break;
+ case AR5K_BWMODE_5MHZ:
+ bitrates = ah->sbands[band].bitrates_quarter;
+ n_bitrates = ah->sbands[band].n_bitrates_quarter;
+ break;
+ case AR5K_BWMODE_10MHZ:
+ bitrates = ah->sbands[band].bitrates_half;
+ n_bitrates = ah->sbands[band].n_bitrates_half;
+ break;
+ default:
+ WARN_ON(1);
+ return;
+ }
+
/* Write rate duration table */
- for (i = 0; i < ah->sbands[band].n_bitrates; i++) {
+ for (i = 0; i < n_bitrates; i++) {
u32 reg;
u16 tx_time;
if (ah->ah_ack_bitrate_high)
- rate = &ah->sbands[band].bitrates[ack_rates_high[i]];
+ rate = &bitrates[ack_rates_high[i]];
/* CCK -> 1Mb */
else if (i < 4)
- rate = &ah->sbands[band].bitrates[0];
+ rate = &bitrates[0];
/* OFDM -> 6Mb */
else
- rate = &ah->sbands[band].bitrates[4];
+ rate = &bitrates[4];
/* Set ACK timeout */
reg = AR5K_RATE_DUR(rate->hw_value);
diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
index 65fe929..2de20ae 100644
--- a/drivers/net/wireless/ath/ath5k/qcu.c
+++ b/drivers/net/wireless/ath/ath5k/qcu.c
@@ -567,6 +567,8 @@ int ath5k_hw_set_ifs_intervals(struct ath5k_hw *ah, unsigned int slot_time)
struct ieee80211_channel *channel = ah->ah_current_channel;
enum ieee80211_band band;
struct ieee80211_rate *rate;
+ struct ieee80211_rate *bitrates;
+ int n_bitrates;
u32 ack_tx_time, eifs, eifs_clock, sifs, sifs_clock;
u32 slot_time_clock = ath5k_hw_htoclock(ah, slot_time);
@@ -605,7 +607,26 @@ int ath5k_hw_set_ifs_intervals(struct ath5k_hw *ah, unsigned int slot_time)
else
band = IEEE80211_BAND_2GHZ;
- rate = &ah->sbands[band].bitrates[0];
+ switch (ah->ah_bwmode) {
+ case AR5K_BWMODE_DEFAULT:
+ case AR5K_BWMODE_40MHZ:
+ bitrates = ah->sbands[band].bitrates;
+ n_bitrates = ah->sbands[band].n_bitrates;
+ break;
+ case AR5K_BWMODE_5MHZ:
+ bitrates = ah->sbands[band].bitrates_quarter;
+ n_bitrates = ah->sbands[band].n_bitrates_quarter;
+ break;
+ case AR5K_BWMODE_10MHZ:
+ bitrates = ah->sbands[band].bitrates_half;
+ n_bitrates = ah->sbands[band].n_bitrates_half;
+ break;
+ default:
+ WARN_ON(1);
+ return -EINVAL;
+ }
+
+ rate = &bitrates[0];
ack_tx_time = ath5k_hw_get_frame_duration(ah, band, 10, rate, false);
/* ack_tx_time includes an SIFS already */
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 11/18] ath9k: always use SIFS times from OFDM for 5/10 MHz
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
5/10 MHz channels should always use SIFS times as defined in IEEE
802.11-2012 18.4.4 (OFDM PHY characteristics). This makes it compatible
to ath5k, which does the same.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/hw.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 7f25da8..89ee731 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1071,7 +1071,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
if (IS_CHAN_A_FAST_CLOCK(ah, chan))
tx_lat += 11;
- sifstime *= 2;
+ sifstime = 32;
ack_offset = 16;
slottime = 13;
} else if (IS_CHAN_QUARTER_RATE(chan)) {
@@ -1081,7 +1081,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
if (IS_CHAN_A_FAST_CLOCK(ah, chan))
tx_lat += 22;
- sifstime *= 4;
+ sifstime = 64;
ack_offset = 32;
slottime = 21;
} else {
@@ -1118,7 +1118,6 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
ctstimeout += 48 - sifstime - ah->slottime;
}
-
ath9k_hw_set_sifs_time(ah, sifstime);
ath9k_hw_setslottime(ah, slottime);
ath9k_hw_set_ack_timeout(ah, acktimeout);
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 10/18] nl80211: allow 5 and 10 MHz channels for IBSS
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Whether the wiphy supports it or not is already checked, so what is left
is to enable these channel types.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
net/wireless/nl80211.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 75070da..a5f281a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -6297,6 +6297,8 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
return -EINVAL;
switch (ibss.chandef.width) {
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
case NL80211_CHAN_WIDTH_20_NOHT:
break;
case NL80211_CHAN_WIDTH_20:
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 15/18] ath9k: announce that ath9k supports 5/10 MHz
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 919d4c2..7eeb015 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -828,6 +828,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
+ hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
#ifdef CONFIG_PM_SLEEP
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 09/18] mac80211: change IBSS channel state to chandef
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
This should make some parts cleaner and is also required for handling
5/10 MHz properly.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
net/mac80211/ibss.c | 22 +++++++++++-----------
net/mac80211/ieee80211_i.h | 3 +--
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 3b55a43..b9356c3 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -83,7 +83,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
- cfg80211_chandef_create(&chandef, chan, ifibss->channel_type);
+ chandef = ifibss->chandef;
if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) {
chandef.width = NL80211_CHAN_WIDTH_20;
chandef.center_freq1 = chan->center_freq;
@@ -526,7 +526,9 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
set_sta_flag(sta, WLAN_STA_WME);
if (sta && elems->ht_operation && elems->ht_cap_elem &&
- sdata->u.ibss.channel_type != NL80211_CHAN_NO_HT) {
+ sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
+ sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_5 &&
+ sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_10) {
/* we both use HT */
struct ieee80211_ht_cap htcap_ie;
struct cfg80211_chan_def chandef;
@@ -541,8 +543,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
* fall back to HT20 if we don't use or use
* the other extension channel
*/
- if (cfg80211_get_chandef_type(&chandef) !=
- sdata->u.ibss.channel_type)
+ if (chandef.center_freq1 !=
+ sdata->u.ibss.chandef.center_freq1)
htcap_ie.cap_info &=
cpu_to_le16(~IEEE80211_HT_CAP_SUP_WIDTH_20_40);
@@ -581,7 +583,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
/* different channel */
if (sdata->u.ibss.fixed_channel &&
- sdata->u.ibss.channel != cbss->channel)
+ sdata->u.ibss.chandef.chan != cbss->channel)
goto put_bss;
/* different SSID */
@@ -769,7 +771,7 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
sdata->drop_unencrypted = 0;
__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
- ifibss->channel, ifibss->basic_rates,
+ ifibss->chandef.chan, ifibss->basic_rates,
capability, 0, true);
}
@@ -801,7 +803,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
if (ifibss->fixed_bssid)
bssid = ifibss->bssid;
if (ifibss->fixed_channel)
- chan = ifibss->channel;
+ chan = ifibss->chandef.chan;
if (!is_zero_ether_addr(ifibss->bssid))
bssid = ifibss->bssid;
cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid,
@@ -1071,9 +1073,7 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
sdata->vif.bss_conf.beacon_int = params->beacon_interval;
- sdata->u.ibss.channel = params->chandef.chan;
- sdata->u.ibss.channel_type =
- cfg80211_get_chandef_type(¶ms->chandef);
+ sdata->u.ibss.chandef = params->chandef;
sdata->u.ibss.fixed_channel = params->channel_fixed;
if (params->ie) {
@@ -1136,7 +1136,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
if (ifibss->privacy)
capability |= WLAN_CAPABILITY_PRIVACY;
- cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->channel,
+ cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->chandef.chan,
ifibss->bssid, ifibss->ssid,
ifibss->ssid_len, WLAN_CAPABILITY_IBSS |
WLAN_CAPABILITY_PRIVACY,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 3258039..d3d48cf 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -505,8 +505,7 @@ struct ieee80211_if_ibss {
u8 ssid[IEEE80211_MAX_SSID_LEN];
u8 ssid_len, ie_len;
u8 *ie;
- struct ieee80211_channel *channel;
- enum nl80211_channel_type channel_type;
+ struct cfg80211_chan_def chandef;
unsigned long ibss_join_req;
/* probe response/beacon for IBSS */
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 13/18] ath9k: add and use 5/10 MHz bitrate tables
From: Simon Wunderlich @ 2013-05-15 14:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
When a reduced bandwidth mode is enabled, the according bitrate tables
must be used instead of the standard tables. This patch adds these
bitrate tables and selects the appropriate table.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
drivers/net/wireless/ath/ath9k/beacon.c | 13 ++++++-
drivers/net/wireless/ath/ath9k/init.c | 63 +++++++++++++++++++++++--------
drivers/net/wireless/ath/ath9k/rc.c | 9 +++++
drivers/net/wireless/ath/ath9k/recv.c | 13 +++++--
drivers/net/wireless/ath/ath9k/xmit.c | 14 ++++++-
5 files changed, 90 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 2ff570f..56383e5 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -76,13 +76,22 @@ static void ath9k_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif,
struct ath_common *common = ath9k_hw_common(ah);
struct ath_tx_info info;
struct ieee80211_supported_band *sband;
+ struct ieee80211_rate *bitrates;
u8 chainmask = ah->txchainmask;
u8 rate = 0;
+ int n_bitrates;
sband = &sc->sbands[common->hw->conf.chandef.chan->band];
- rate = sband->bitrates[rateidx].hw_value;
+ if (WARN_ON(ieee80211_get_bitrates(sband,
+ common->hw->conf.chandef.width,
+ &bitrates, &n_bitrates))) {
+ bitrates = sband->bitrates;
+ n_bitrates = sband->n_bitrates;
+ }
+
+ rate = bitrates[rateidx].hw_value;
if (vif->bss_conf.use_short_preamble)
- rate |= sband->bitrates[rateidx].hw_value_short;
+ rate |= bitrates[rateidx].hw_value_short;
memset(&info, 0, sizeof(info));
info.pkt_len = skb->len + FCS_LEN;
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 5921194..919d4c2 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -155,6 +155,30 @@ static struct ieee80211_rate ath9k_legacy_rates[] = {
RATE(540, 0x0c, 0),
};
+static struct ieee80211_rate ath9k_legacy_rates_half[] = {
+ RATE(30, 0x0b, 0),
+ RATE(45, 0x0f, 0),
+ RATE(60, 0x0a, 0),
+ RATE(90, 0x0e, 0),
+ RATE(120, 0x09, 0),
+ RATE(180, 0x0d, 0),
+ RATE(240, 0x08, 0),
+ RATE(270, 0x0c, 0),
+};
+
+static struct ieee80211_rate ath9k_legacy_rates_quarter[] = {
+ RATE(15, 0x0b, 0),
+ RATE(22, 0x0f, 0), /* actually 22.5 */
+ RATE(30, 0x0a, 0),
+ RATE(45, 0x0e, 0),
+ RATE(60, 0x09, 0),
+ RATE(90, 0x0d, 0),
+ RATE(120, 0x08, 0),
+ RATE(135, 0x0c, 0),
+};
+
+
+
#ifdef CONFIG_MAC80211_LEDS
static const struct ieee80211_tpt_blink ath9k_tpt_blink[] = {
{ .throughput = 0 * 1024, .blink_time = 334 },
@@ -442,6 +466,7 @@ static int ath9k_init_queues(struct ath_softc *sc)
static int ath9k_init_channels_rates(struct ath_softc *sc)
{
void *channels;
+ struct ieee80211_supported_band *sband;
BUILD_BUG_ON(ARRAY_SIZE(ath9k_2ghz_chantable) +
ARRAY_SIZE(ath9k_5ghz_chantable) !=
@@ -455,13 +480,18 @@ static int ath9k_init_channels_rates(struct ath_softc *sc)
memcpy(channels, ath9k_2ghz_chantable,
sizeof(ath9k_2ghz_chantable));
- sc->sbands[IEEE80211_BAND_2GHZ].channels = channels;
- sc->sbands[IEEE80211_BAND_2GHZ].band = IEEE80211_BAND_2GHZ;
- sc->sbands[IEEE80211_BAND_2GHZ].n_channels =
- ARRAY_SIZE(ath9k_2ghz_chantable);
- sc->sbands[IEEE80211_BAND_2GHZ].bitrates = ath9k_legacy_rates;
- sc->sbands[IEEE80211_BAND_2GHZ].n_bitrates =
- ARRAY_SIZE(ath9k_legacy_rates);
+ sband = &sc->sbands[IEEE80211_BAND_2GHZ];
+ sband->channels = channels;
+ sband->band = IEEE80211_BAND_2GHZ;
+ sband->n_channels = ARRAY_SIZE(ath9k_2ghz_chantable);
+ sband->bitrates = ath9k_legacy_rates;
+ sband->n_bitrates = ARRAY_SIZE(ath9k_legacy_rates);
+ sband->bitrates_half = ath9k_legacy_rates_half;
+ sband->n_bitrates_half = ARRAY_SIZE(ath9k_legacy_rates_half);
+ sband->bitrates_quarter = ath9k_legacy_rates_quarter;
+ sband->n_bitrates_quarter =
+ ARRAY_SIZE(ath9k_legacy_rates_quarter);
+
}
if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) {
@@ -472,14 +502,17 @@ static int ath9k_init_channels_rates(struct ath_softc *sc)
memcpy(channels, ath9k_5ghz_chantable,
sizeof(ath9k_5ghz_chantable));
- sc->sbands[IEEE80211_BAND_5GHZ].channels = channels;
- sc->sbands[IEEE80211_BAND_5GHZ].band = IEEE80211_BAND_5GHZ;
- sc->sbands[IEEE80211_BAND_5GHZ].n_channels =
- ARRAY_SIZE(ath9k_5ghz_chantable);
- sc->sbands[IEEE80211_BAND_5GHZ].bitrates =
- ath9k_legacy_rates + 4;
- sc->sbands[IEEE80211_BAND_5GHZ].n_bitrates =
- ARRAY_SIZE(ath9k_legacy_rates) - 4;
+ sband = &sc->sbands[IEEE80211_BAND_5GHZ];
+ sband->channels = channels;
+ sband->band = IEEE80211_BAND_5GHZ;
+ sband->n_channels = ARRAY_SIZE(ath9k_5ghz_chantable);
+ sband->bitrates = ath9k_legacy_rates + 4;
+ sband->n_bitrates = ARRAY_SIZE(ath9k_legacy_rates) - 4;
+ sband->bitrates_half = ath9k_legacy_rates_half;
+ sband->n_bitrates_half = ARRAY_SIZE(ath9k_legacy_rates_half);
+ sband->bitrates_quarter = ath9k_legacy_rates_quarter;
+ sband->n_bitrates_quarter =
+ ARRAY_SIZE(ath9k_legacy_rates_quarter);
}
return 0;
}
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index ed57d57..0559ac6 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1283,8 +1283,17 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
struct ath_softc *sc = priv;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_rate_priv *ath_rc_priv = priv_sta;
+ struct ieee80211_rate *bitrates;
+ int n_bitrates;
int i, j = 0;
+ if (WARN_ON(ieee80211_get_bitrates(sband,
+ sc->hw->conf.chandef.width,
+ &bitrates, &n_bitrates))) {
+ bitrates = sband->bitrates;
+ n_bitrates = sband->n_bitrates;
+ }
+
for (i = 0; i < sband->n_bitrates; i++) {
if (sta->supp_rates[sband->band] & BIT(i)) {
ath_rc_priv->neg_rates.rs_rates[j]
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 8be2b5d..9e7c929 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -858,6 +858,8 @@ static int ath9k_process_rate(struct ath_common *common,
struct ieee80211_rx_status *rxs)
{
struct ieee80211_supported_band *sband;
+ struct ieee80211_rate *bitrates;
+ int n_bitrates;
enum ieee80211_band band;
unsigned int i = 0;
struct ath_softc __maybe_unused *sc = common->priv;
@@ -865,6 +867,11 @@ static int ath9k_process_rate(struct ath_common *common,
band = hw->conf.chandef.chan->band;
sband = hw->wiphy->bands[band];
+ if (WARN_ON(ieee80211_get_bitrates(sband,
+ hw->conf.chandef.width,
+ &bitrates, &n_bitrates)))
+ return 0;
+
if (rx_stats->rs_rate & 0x80) {
/* HT rate */
rxs->flag |= RX_FLAG_HT;
@@ -876,12 +883,12 @@ static int ath9k_process_rate(struct ath_common *common,
return 0;
}
- for (i = 0; i < sband->n_bitrates; i++) {
- if (sband->bitrates[i].hw_value == rx_stats->rs_rate) {
+ for (i = 0; i < n_bitrates; i++) {
+ if (bitrates[i].hw_value == rx_stats->rs_rate) {
rxs->rate_idx = i;
return 0;
}
- if (sband->bitrates[i].hw_value_short == rx_stats->rs_rate) {
+ if (bitrates[i].hw_value_short == rx_stats->rs_rate) {
rxs->flag |= RX_FLAG_SHORTPRE;
rxs->rate_idx = i;
return 0;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index eab0fcb..7062386 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -998,15 +998,25 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
struct ieee80211_tx_info *tx_info;
struct ieee80211_tx_rate *rates;
const struct ieee80211_rate *rate;
+ struct ieee80211_supported_band *sband;
+ struct ieee80211_rate *bitrates;
struct ieee80211_hdr *hdr;
struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
- int i;
+ int i, n_bitrates;
u8 rix = 0;
skb = bf->bf_mpdu;
tx_info = IEEE80211_SKB_CB(skb);
rates = bf->rates;
hdr = (struct ieee80211_hdr *)skb->data;
+ sband = &sc->sbands[tx_info->band];
+
+ if (WARN_ON(ieee80211_get_bitrates(sband,
+ sc->hw->conf.chandef.width,
+ &bitrates, &n_bitrates))) {
+ bitrates = sband->bitrates;
+ n_bitrates = sband->n_bitrates;
+ }
/* set dur_update_en for l-sig computation except for PS-Poll frames */
info->dur_update = !ieee80211_is_pspoll(hdr->frame_control);
@@ -1052,7 +1062,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
}
/* legacy rates */
- rate = &sc->sbands[tx_info->band].bitrates[rates[i].idx];
+ rate = &bitrates[rates[i].idx];
if ((tx_info->band == IEEE80211_BAND_2GHZ) &&
!(rate->flags & IEEE80211_RATE_ERP_G))
phy = WLAN_RC_PHY_CCK;
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 08/18] cfg80211/mac80211: use reduced txpower for 5 and 10 MHz
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Some regulations (like germany, but also FCC) express their transmission
power limit in dBm/MHz or mW/MHz. To cope with that and be on the safe
side, reduce the maximum power to half (10 MHz) or quarter (5 MHz)
when operating on these reduced bandwidth channels.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
include/net/cfg80211.h | 25 +++++++++++++++++++++++++
net/mac80211/iface.c | 2 +-
net/mac80211/main.c | 2 +-
net/mac80211/mlme.c | 3 ++-
4 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d4c687a..4e4a447 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -472,6 +472,31 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
u32 prohibited_flags);
/**
+ * ieee80211_chandef_max_power - maximum transmission power for the chandef
+ *
+ * In some regulations, the transmit power may depend on the configured channel
+ * bandwidth which may be defined as dBm/MHz. This function returns the actual
+ * max_power for non-standard (20 MHz) channels.
+ *
+ * @chandef: channel definition for the channel
+ *
+ * Returns: maximum allowed transmission power in dBm for the chandef
+ */
+static inline int
+ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef)
+{
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_5:
+ return chandef->chan->max_power - 6;
+ case NL80211_CHAN_WIDTH_10:
+ return chandef->chan->max_power - 3;
+ default:
+ break;
+ }
+ return chandef->chan->max_power;
+}
+
+/**
* enum survey_info_flags - survey information flags
*
* @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 28a38a7..3d859c7 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -54,7 +54,7 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
return false;
}
- power = chanctx_conf->def.chan->max_power;
+ power = ieee80211_chandef_max_power(&chanctx_conf->def);
rcu_read_unlock();
if (sdata->user_power_level != IEEE80211_UNSET_POWER_LEVEL)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index f6b6b57..eda4427 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -151,7 +151,7 @@ static u32 ieee80211_hw_conf_chan(struct ieee80211_local *local)
changed |= IEEE80211_CONF_CHANGE_SMPS;
}
- power = chandef.chan->max_power;
+ power = ieee80211_chandef_max_power(&chandef);
rcu_read_lock();
list_for_each_entry_rcu(sdata, &local->interfaces, list) {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 837a580..a7fd1db 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -798,7 +798,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
*pos++ = WLAN_EID_PWR_CAPABILITY;
*pos++ = 2;
*pos++ = 0; /* min tx power */
- *pos++ = chan->max_power; /* max tx power */
+ /* max tx power */
+ *pos++ = ieee80211_chandef_max_power(&chanctx_conf->def);
/* 2. supported channels */
/* TODO: get this in reg domain format */
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 04/18] mac80211: fix timing for 5 MHz and 10 MHz channels
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
according to IEEE 802.11-2012 section 18, various timings change
when using 5 MHz and 10 MHz. Reflect this by using a "divisor" when
calculating durations.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
net/mac80211/ieee80211_i.h | 42 +++++++++++++++++++++++++++++++++++-
net/mac80211/rc80211_minstrel.c | 14 +++++++-----
net/mac80211/rc80211_minstrel_ht.c | 8 ++++---
net/mac80211/tx.c | 10 ++++++---
net/mac80211/util.c | 39 ++++++++++++++++++++++-----------
5 files changed, 88 insertions(+), 25 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 158e6eb..0e8f2d0 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -793,6 +793,45 @@ ieee80211_get_sdata_band(struct ieee80211_sub_if_data *sdata)
return band;
}
+static inline int
+ieee80211_vif_get_divisor(struct ieee80211_vif *vif)
+{
+ struct ieee80211_chanctx_conf *chanctx_conf;
+ int divisor = 1;
+
+ rcu_read_lock();
+ chanctx_conf = rcu_dereference(vif->chanctx_conf);
+ if (chanctx_conf) {
+ switch (chanctx_conf->def.width) {
+ case NL80211_CHAN_WIDTH_5:
+ divisor = 4;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ divisor = 2;
+ break;
+ default:
+ divisor = 1;
+ break;
+ }
+ }
+ rcu_read_unlock();
+
+ return divisor;
+}
+
+static inline int
+ieee80211_hw_get_divisor(struct ieee80211_hw *hw)
+{
+ switch (hw->conf.chandef.width) {
+ case NL80211_CHAN_WIDTH_5:
+ return 4;
+ case NL80211_CHAN_WIDTH_10:
+ return 2;
+ default:
+ return 1;
+ }
+}
+
enum sdata_queue_type {
IEEE80211_SDATA_QUEUE_TYPE_FRAME = 0,
IEEE80211_SDATA_QUEUE_AGG_START = 1,
@@ -1448,7 +1487,8 @@ extern void *mac80211_wiphy_privid; /* for wiphy privid */
u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
enum nl80211_iftype type);
int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
- int rate, int erp, int short_preamble);
+ int rate, int erp, int short_preamble,
+ int divisor);
void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
struct ieee80211_hdr *hdr, const u8 *tsc,
gfp_t gfp);
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index ac7ef54..3fe134a 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -382,14 +382,17 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
static void
calc_rate_durations(enum ieee80211_band band,
struct minstrel_rate *d,
- struct ieee80211_rate *rate)
+ struct ieee80211_rate *rate,
+ struct minstrel_priv *mp)
{
int erp = !!(rate->flags & IEEE80211_RATE_ERP_G);
d->perfect_tx_time = ieee80211_frame_duration(band, 1200,
- rate->bitrate, erp, 1);
+ rate->bitrate, erp, 1,
+ ieee80211_hw_get_divisor(mp->hw));
d->ack_time = ieee80211_frame_duration(band, 10,
- rate->bitrate, erp, 1);
+ rate->bitrate, erp, 1,
+ ieee80211_hw_get_divisor(mp->hw));
}
static void
@@ -430,7 +433,8 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
ctl_rate = &sband->bitrates[mi->lowest_rix];
mi->sp_ack_dur = ieee80211_frame_duration(sband->band, 10,
ctl_rate->bitrate,
- !!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1);
+ !!(ctl_rate->flags & IEEE80211_RATE_ERP_G), 1,
+ ieee80211_hw_get_divisor(mp->hw));
memset(mi->max_tp_rate, 0, sizeof(mi->max_tp_rate));
mi->max_prob_rate = 0;
@@ -448,7 +452,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
mr->rix = i;
mr->bitrate = sband->bitrates[i].bitrate / 5;
- calc_rate_durations(sband->band, mr, &sband->bitrates[i]);
+ calc_rate_durations(sband->band, mr, &sband->bitrates[i], mp);
/* calculate maximum number of retransmissions before
* fallback (based on maximum segment size) */
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 5b2d301..f05eeff 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -844,7 +844,7 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
u16 sta_cap = sta->ht_cap.cap;
int n_supported = 0;
- int ack_dur;
+ int ack_dur, divisor;
int stbc;
int i;
@@ -861,8 +861,10 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
mi->sta = sta;
mi->stats_update = jiffies;
- ack_dur = ieee80211_frame_duration(sband->band, 10, 60, 1, 1);
- mi->overhead = ieee80211_frame_duration(sband->band, 0, 60, 1, 1) + ack_dur;
+ divisor = ieee80211_hw_get_divisor(mp->hw);
+ ack_dur = ieee80211_frame_duration(sband->band, 10, 60, 1, 1, divisor);
+ mi->overhead = ieee80211_frame_duration(sband->band, 0, 60, 1, 1,
+ divisor) + ack_dur;
mi->overhead_rtscts = mi->overhead + 2 * ack_dur;
mi->avg_ampdu_len = MINSTREL_FRAC(1, 1);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 9972e07..e1f18a8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -40,7 +40,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
struct sk_buff *skb, int group_addr,
int next_frag_len)
{
- int rate, mrate, erp, dur, i;
+ int rate, mrate, erp, dur, i, divisor;
struct ieee80211_rate *txrate;
struct ieee80211_local *local = tx->local;
struct ieee80211_supported_band *sband;
@@ -153,6 +153,8 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
rate = mrate;
}
+ divisor = ieee80211_vif_get_divisor(&tx->sdata->vif);
+
/* Don't calculate ACKs for QoS Frames with NoAck Policy set */
if (ieee80211_is_data_qos(hdr->frame_control) &&
*(ieee80211_get_qos_ctl(hdr)) & IEEE80211_QOS_CTL_ACK_POLICY_NOACK)
@@ -162,7 +164,8 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
* (10 bytes + 4-byte FCS = 112 bits) plus SIFS; rounded up
* to closest integer */
dur = ieee80211_frame_duration(sband->band, 10, rate, erp,
- tx->sdata->vif.bss_conf.use_short_preamble);
+ tx->sdata->vif.bss_conf.use_short_preamble,
+ divisor);
if (next_frag_len) {
/* Frame is fragmented: duration increases with time needed to
@@ -171,7 +174,8 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
/* next fragment */
dur += ieee80211_frame_duration(sband->band, next_frag_len,
txrate->bitrate, erp,
- tx->sdata->vif.bss_conf.use_short_preamble);
+ tx->sdata->vif.bss_conf.use_short_preamble,
+ divisor);
}
return cpu_to_le16(dur);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 3f87fa4..5496764 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -107,7 +107,8 @@ void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx)
}
int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
- int rate, int erp, int short_preamble)
+ int rate, int erp, int short_preamble,
+ int divisor)
{
int dur;
@@ -118,6 +119,9 @@ int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
*
* rate is in 100 kbps, so divident is multiplied by 10 in the
* DIV_ROUND_UP() operations.
+ *
+ * divisor may be 4 for 5 MHz channels or 2 for 1 MHz channels, and
+ * is assumed to be 1 otherwise.
*/
if (band == IEEE80211_BAND_5GHZ || erp) {
@@ -130,15 +134,21 @@ int ieee80211_frame_duration(enum ieee80211_band band, size_t len,
* TXTIME = T_PREAMBLE + T_SIGNAL + T_SYM x N_SYM + Signal Ext
*
* T_SYM = 4 usec
- * 802.11a - 17.5.2: aSIFSTime = 16 usec
+ * 802.11a - 18.5.2: aSIFSTime = 16 usec
* 802.11g - 19.8.4: aSIFSTime = 10 usec +
* signal ext = 6 usec
*/
dur = 16; /* SIFS + signal ext */
- dur += 16; /* 17.3.2.3: T_PREAMBLE = 16 usec */
- dur += 4; /* 17.3.2.3: T_SIGNAL = 4 usec */
+ dur += 16; /* IEEE 802.11-2012 18.3.2.4: T_PREAMBLE = 16 usec */
+ dur += 4; /* IEEE 802.11-2012 18.3.2.4: T_SIGNAL = 4 usec */
dur += 4 * DIV_ROUND_UP((16 + 8 * (len + 4) + 6) * 10,
4 * rate); /* T_SYM x N_SYM */
+
+ /* IEEE 802.11-2012 18.3.2.4: all values above are:
+ * * times 4 for 5 MHz
+ * * times 2 for 10 MHz
+ */
+ dur *= divisor;
} else {
/*
* 802.11b or 802.11g with 802.11b compatibility:
@@ -168,7 +178,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
{
struct ieee80211_sub_if_data *sdata;
u16 dur;
- int erp;
+ int erp, divisor = 1;
bool short_preamble = false;
erp = 0;
@@ -177,10 +187,11 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
short_preamble = sdata->vif.bss_conf.use_short_preamble;
if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
erp = rate->flags & IEEE80211_RATE_ERP_G;
+ divisor = ieee80211_vif_get_divisor(vif);
}
dur = ieee80211_frame_duration(band, frame_len, rate->bitrate, erp,
- short_preamble);
+ short_preamble, divisor);
return cpu_to_le16(dur);
}
@@ -194,7 +205,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
struct ieee80211_rate *rate;
struct ieee80211_sub_if_data *sdata;
bool short_preamble;
- int erp;
+ int erp, divisor = 1;
u16 dur;
struct ieee80211_supported_band *sband;
@@ -210,17 +221,18 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
short_preamble = sdata->vif.bss_conf.use_short_preamble;
if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
erp = rate->flags & IEEE80211_RATE_ERP_G;
+ divisor = ieee80211_vif_get_divisor(vif);
}
/* CTS duration */
dur = ieee80211_frame_duration(sband->band, 10, rate->bitrate,
- erp, short_preamble);
+ erp, short_preamble, divisor);
/* Data frame duration */
dur += ieee80211_frame_duration(sband->band, frame_len, rate->bitrate,
- erp, short_preamble);
+ erp, short_preamble, divisor);
/* ACK duration */
dur += ieee80211_frame_duration(sband->band, 10, rate->bitrate,
- erp, short_preamble);
+ erp, short_preamble, divisor);
return cpu_to_le16(dur);
}
@@ -235,7 +247,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
struct ieee80211_rate *rate;
struct ieee80211_sub_if_data *sdata;
bool short_preamble;
- int erp;
+ int erp, divisor = 1;
u16 dur;
struct ieee80211_supported_band *sband;
@@ -250,15 +262,16 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
short_preamble = sdata->vif.bss_conf.use_short_preamble;
if (sdata->flags & IEEE80211_SDATA_OPERATING_GMODE)
erp = rate->flags & IEEE80211_RATE_ERP_G;
+ divisor = ieee80211_vif_get_divisor(vif);
}
/* Data frame duration */
dur = ieee80211_frame_duration(sband->band, frame_len, rate->bitrate,
- erp, short_preamble);
+ erp, short_preamble, divisor);
if (!(frame_txctl->flags & IEEE80211_TX_CTL_NO_ACK)) {
/* ACK duration */
dur += ieee80211_frame_duration(sband->band, 10, rate->bitrate,
- erp, short_preamble);
+ erp, short_preamble, divisor);
}
return cpu_to_le16(dur);
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 05/18] mac80211: round rates to the next multiple of 500kbps
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
There are some rates in reduced bandwidth modes which can't be
represented as multiples of 500kbps, like 2.25 MBit/s in 5 MHz mode. The
standard suggests to round up to the next multiple of 500kbps, just do
that in mac80211 as well.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
net/mac80211/ibss.c | 8 ++++----
net/mac80211/mlme.c | 18 +++++++++---------
net/mac80211/rc80211_minstrel.c | 2 +-
net/mac80211/rx.c | 2 +-
net/mac80211/status.c | 5 ++++-
net/mac80211/util.c | 7 ++++---
6 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 4e1fb81..6a96663 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -142,7 +142,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
u8 basic = 0;
if (basic_rates & BIT(i))
basic = 0x80;
- *pos++ = basic | (u8) (rate / 5);
+ *pos++ = basic | (u8) ((rate + 4) / 5);
}
if (sband->band == IEEE80211_BAND_2GHZ) {
@@ -165,7 +165,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
u8 basic = 0;
if (basic_rates & BIT(i))
basic = 0x80;
- *pos++ = basic | (u8) (rate / 5);
+ *pos++ = basic | (u8) ((rate + 4) / 5);
}
}
@@ -275,11 +275,11 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
basic_rates = 0;
for (i = 0; i < bss->supp_rates_len; i++) {
- int rate = (bss->supp_rates[i] & 0x7f) * 5;
+ int rate = bss->supp_rates[i] & 0x7f;
bool is_basic = !!(bss->supp_rates[i] & 0x80);
for (j = 0; j < sband->n_bitrates; j++) {
- if (sband->bitrates[j].bitrate == rate) {
+ if ((sband->bitrates[j].bitrate + 4) / 5 == rate) {
if (is_basic)
basic_rates |= BIT(j);
break;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0eaee23..03c1b73 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -520,10 +520,10 @@ static int ieee80211_compatible_rates(const u8 *supp_rates, int supp_rates_len,
*rates = 0;
count = 0;
for (i = 0; i < supp_rates_len; i++) {
- int rate = (supp_rates[i] & 0x7F) * 5;
+ int rate = supp_rates[i] & 0x7F;
for (j = 0; j < sband->n_bitrates; j++)
- if (sband->bitrates[j].bitrate == rate) {
+ if ((sband->bitrates[j].bitrate + 4) / 5 == rate) {
*rates |= BIT(j);
count++;
break;
@@ -765,7 +765,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
for (i = 0; i < sband->n_bitrates; i++) {
if (BIT(i) & rates) {
int rate = sband->bitrates[i].bitrate;
- *pos++ = (u8) (rate / 5);
+ *pos++ = (u8) ((rate + 4) / 5);
if (++count == 8)
break;
}
@@ -779,7 +779,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
for (i++; i < sband->n_bitrates; i++) {
if (BIT(i) & rates) {
int rate = sband->bitrates[i].bitrate;
- *pos++ = (u8) (rate / 5);
+ *pos++ = (u8) ((rate + 4) / 5);
}
}
}
@@ -2448,10 +2448,10 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
int i, j;
for (i = 0; i < supp_rates_len; i++) {
- int rate = (supp_rates[i] & 0x7f) * 5;
+ int rate = supp_rates[i] & 0x7f;
bool is_basic = !!(supp_rates[i] & 0x80);
- if (rate > 110)
+ if ((rate * 5) > 110)
*have_higher_than_11mbit = true;
/*
@@ -2467,12 +2467,12 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
continue;
for (j = 0; j < sband->n_bitrates; j++) {
- if (sband->bitrates[j].bitrate == rate) {
+ if ((sband->bitrates[j].bitrate + 4) / 5 == rate) {
*rates |= BIT(j);
if (is_basic)
*basic_rates |= BIT(j);
- if (rate < *min_rate) {
- *min_rate = rate;
+ if ((rate * 5) < *min_rate) {
+ *min_rate = rate * 5;
*min_rate_index = j;
}
break;
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 3fe134a..6c89c29 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -451,7 +451,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
memset(mr, 0, sizeof(*mr));
mr->rix = i;
- mr->bitrate = sband->bitrates[i].bitrate / 5;
+ mr->bitrate = (sband->bitrates[i].bitrate + 4) / 5;
calc_rate_durations(sband->band, mr, &sband->bitrates[i], mp);
/* calculate maximum number of retransmissions before
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c8447af..06f71c6 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -208,7 +208,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
*pos = 0;
} else {
rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE);
- *pos = rate->bitrate / 5;
+ *pos = (rate->bitrate + 4) / 5;
}
pos++;
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 4343920..f62e4f6 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -280,8 +280,11 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band
/* IEEE80211_RADIOTAP_RATE */
if (info->status.rates[0].idx >= 0 &&
!(info->status.rates[0].flags & IEEE80211_TX_RC_MCS)) {
+ int rate;
+
rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE);
- *pos = sband->bitrates[info->status.rates[0].idx].bitrate / 5;
+ rate = sband->bitrates[info->status.rates[0].idx].bitrate;
+ *pos = (rate + 4) / 5;
/* padding for tx flags */
pos += 2;
}
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 5496764..9d04989 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1213,7 +1213,8 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
for (i = 0; i < sband->n_bitrates; i++) {
if ((BIT(i) & rate_mask) == 0)
continue; /* skip rate */
- rates[num_rates++] = (u8) (sband->bitrates[i].bitrate / 5);
+ rates[num_rates++] = (u8)
+ ((sband->bitrates[i].bitrate + 4) / 5);
}
supp_rates_len = min_t(int, num_rates, 8);
@@ -2055,7 +2056,7 @@ int ieee80211_add_srates_ie(struct ieee80211_sub_if_data *sdata,
if (need_basic && basic_rates & BIT(i))
basic = 0x80;
rate = sband->bitrates[i].bitrate;
- *pos++ = basic | (u8) (rate / 5);
+ *pos++ = basic | (u8) ((rate + 4) / 5);
}
return 0;
@@ -2090,7 +2091,7 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata,
if (need_basic && basic_rates & BIT(i))
basic = 0x80;
rate = sband->bitrates[i].bitrate;
- *pos++ = basic | (u8) (rate / 5);
+ *pos++ = basic | (u8) ((rate + 4) / 5);
}
}
return 0;
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 07/18] mac80211: add radiotap flag and handling for 5/10 MHz
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Wireshark already defines radiotap channel flags for 5 and 10 MHz, so
just use them in Linux radiotap too. Furthermore, add rx status flags to
allow drivers to report when they received data on 5 or 10 MHz channels.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
include/net/ieee80211_radiotap.h | 4 ++++
include/net/mac80211.h | 4 ++++
net/mac80211/rx.c | 21 ++++++++++++---------
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index c399963..8b991ff 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -230,6 +230,10 @@ enum ieee80211_radiotap_type {
#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
+#define IEEE80211_CHAN_GSM 0x1000 /* GSM (900 MHz) */
+#define IEEE80211_CHAN_STURBO 0x2000 /* Static Turbo */
+#define IEEE80211_CHAN_HALF 0x4000 /* Half channel (10 MHz wide) */
+#define IEEE80211_CHAN_QUARTER 0x8000 /* Quarter channel (5 MHz wide) */
/* For IEEE80211_RADIOTAP_FLAGS */
#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3e52e22..bae3138 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -805,6 +805,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
* on this subframe
* @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
* is stored in the @ampdu_delimiter_crc field)
+ * @RX_FLAG_10MHZ: 10 MHz (half channel) was used
+ * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used
*/
enum mac80211_rx_flags {
RX_FLAG_MMIC_ERROR = BIT(0),
@@ -832,6 +834,8 @@ enum mac80211_rx_flags {
RX_FLAG_80MHZ = BIT(23),
RX_FLAG_80P80MHZ = BIT(24),
RX_FLAG_160MHZ = BIT(25),
+ RX_FLAG_10MHZ = BIT(26),
+ RX_FLAG_5MHZ = BIT(27),
};
/**
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index b0834a9..8ab86cf 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -146,6 +146,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
struct ieee80211_radiotap_header *rthdr;
unsigned char *pos;
u16 rx_flags = 0;
+ u16 channel_flags = 0;
int mpdulen;
mpdulen = skb->len;
@@ -215,20 +216,22 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
/* IEEE80211_RADIOTAP_CHANNEL */
put_unaligned_le16(status->freq, pos);
pos += 2;
+ if (status->flag & RX_FLAG_10MHZ)
+ channel_flags |= IEEE80211_CHAN_HALF;
+ else if (status->flag & RX_FLAG_5MHZ)
+ channel_flags |= IEEE80211_CHAN_QUARTER;
+
if (status->band == IEEE80211_BAND_5GHZ)
- put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ,
- pos);
+ channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ;
else if (status->flag & (RX_FLAG_HT | RX_FLAG_VHT))
- put_unaligned_le16(IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ,
- pos);
+ channel_flags |= IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ;
else if (rate && rate->flags & IEEE80211_RATE_ERP_G)
- put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
- pos);
+ channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ;
else if (rate)
- put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
- pos);
+ channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ;
else
- put_unaligned_le16(IEEE80211_CHAN_2GHZ, pos);
+ channel_flags |= IEEE80211_CHAN_2GHZ;
+ put_unaligned_le16(channel_flags, pos);
pos += 2;
/* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 00/18] Add support for 5 and 10 MHz channels
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
This patchset adds support for 5 and 10 MHz in nl80211/cfg80211/mac80211
and enables support in ath5k and ath9k, which already support this feature
on the driver side. 5 and 10 MHz wide channels might be useful for:
* long shot links, as the transmissions are more robust
* future support for 802.11y which allows some 5 and 10 MHz channels in
3.6 GHz range
* future support for 802.11p which uses 10 MHz in 5.9 GHz range
* ... and more "special" applications.
This patchset enables 5 and 10 MHz channels only for OFDM, and without
HT/MIMO/aggregation (for now). Support may be added later.
Changes to PATCHv1:
* the actual datarates are handled, not the corresponding 20MHz rates
as before. This should make it compatible to freebsd, although I was
informed that some other implementors might still use the corresponding
20MHz rates. Anyway, from looking at the standard using the actual rates
should be the right thing to do.
* txpower is decremented according to channel bandwidth (the regulation I
checked all define limits in dBm/MHz)
* radiotap support for 5/10 MHz channel flag was added
* some fixes for ath5k/ath9k were included to make them interoperable
(having the same SIFS improved performance quite well,
300kbps -> 6600 kbps for 5 MHz channels :) )
As always, any comments are appreciated!
Cheers,
Simon
Simon Wunderlich (18):
nl80211/cfg80211: add 5 and 10 MHz defines and wiphy flag
nl80211: add half/quarter channel bitrate tables to supported band
struct
mac80211: fix various components for the new 5 and 10 MHz widths
mac80211: fix timing for 5 MHz and 10 MHz channels
mac80211: round rates to the next multiple of 500kbps
mac80211: choose bitrate table according to bandwidth
mac80211: add radiotap flag and handling for 5/10 MHz
cfg80211/mac80211: use reduced txpower for 5 and 10 MHz
mac80211: change IBSS channel state to chandef
nl80211: allow 5 and 10 MHz channels for IBSS
ath9k: always use SIFS times from OFDM for 5/10 MHz
ath9k: use chandef instead of channel_type
ath9k: add and use 5/10 MHz bitrate tables
ath9k: report 5/10 MHz channels
ath9k: announce that ath9k supports 5/10 MHz
ath5k: add and use 5/10 MHz bitrate tables
ath5k: report 5/10 MHz channels
ath5k: enable support for 5 MHz and 10 MHz channels
drivers/net/wireless/ath/ath5k/ath5k.h | 11 +-
drivers/net/wireless/ath/ath5k/base.c | 133 +++++++++++++++++++++---
drivers/net/wireless/ath/ath5k/base.h | 2 +-
drivers/net/wireless/ath/ath5k/debug.c | 23 ++++-
drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +-
drivers/net/wireless/ath/ath5k/pcu.c | 30 +++++-
drivers/net/wireless/ath/ath5k/qcu.c | 23 ++++-
drivers/net/wireless/ath/ath9k/beacon.c | 13 ++-
drivers/net/wireless/ath/ath9k/common.c | 67 +++++++-----
drivers/net/wireless/ath/ath9k/common.h | 3 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 5 +-
drivers/net/wireless/ath/ath9k/hw.c | 5 +-
drivers/net/wireless/ath/ath9k/init.c | 68 +++++++++---
drivers/net/wireless/ath/ath9k/main.c | 8 +-
drivers/net/wireless/ath/ath9k/rc.c | 13 ++-
drivers/net/wireless/ath/ath9k/recv.c | 24 ++++-
drivers/net/wireless/ath/ath9k/xmit.c | 14 ++-
include/net/cfg80211.h | 66 ++++++++++++
include/net/ieee80211_radiotap.h | 4 +
include/net/mac80211.h | 40 ++++++-
include/uapi/linux/nl80211.h | 4 +
net/mac80211/cfg.c | 50 +++++++--
net/mac80211/ibss.c | 58 +++++++----
net/mac80211/ieee80211_i.h | 47 ++++++++-
net/mac80211/iface.c | 7 +-
net/mac80211/main.c | 7 +-
net/mac80211/mesh.c | 4 +-
net/mac80211/mesh_plink.c | 18 +++-
net/mac80211/mlme.c | 84 ++++++++++-----
net/mac80211/rate.c | 102 ++++++++++++------
net/mac80211/rc80211_minstrel.c | 59 +++++++----
net/mac80211/rc80211_minstrel_ht.c | 26 +++--
net/mac80211/rc80211_pid.h | 2 +
net/mac80211/rc80211_pid_algo.c | 68 +++++++++---
net/mac80211/rx.c | 52 +++++++---
net/mac80211/status.c | 18 +++-
net/mac80211/tx.c | 43 ++++++--
net/mac80211/util.c | 138 +++++++++++++++++++------
net/wireless/chan.c | 57 ++++++++--
net/wireless/nl80211.c | 23 ++++-
net/wireless/util.c | 58 +++++++++++
41 files changed, 1179 insertions(+), 300 deletions(-)
--
1.7.10.4
^ permalink raw reply
* [PATCHv2 01/18] nl80211/cfg80211: add 5 and 10 MHz defines and wiphy flag
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Add defines for 5 and 10 MHz channel width and fix channel
handling functions accordingly.
Also check for and report the WIPHY_FLAG_SUPPORTS_5_10_MHZ
capability.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
include/net/cfg80211.h | 2 ++
include/uapi/linux/nl80211.h | 4 +++
net/wireless/chan.c | 57 ++++++++++++++++++++++++++++++++++++------
net/wireless/nl80211.c | 21 +++++++++++++---
4 files changed, 72 insertions(+), 12 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 26b5b69..08489cc 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2307,6 +2307,7 @@ struct cfg80211_ops {
* responds to probe-requests in hardware.
* @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
* @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
+ * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
*/
enum wiphy_flags {
WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2330,6 +2331,7 @@ enum wiphy_flags {
WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = BIT(19),
WIPHY_FLAG_OFFCHAN_TX = BIT(20),
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
+ WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index d1e48b5..3e95e74 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2730,6 +2730,8 @@ enum nl80211_channel_type {
* and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
* @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
* attribute must be provided as well
+ * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel
+ * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel
*/
enum nl80211_chan_width {
NL80211_CHAN_WIDTH_20_NOHT,
@@ -2738,6 +2740,8 @@ enum nl80211_chan_width {
NL80211_CHAN_WIDTH_80,
NL80211_CHAN_WIDTH_80P80,
NL80211_CHAN_WIDTH_160,
+ NL80211_CHAN_WIDTH_5,
+ NL80211_CHAN_WIDTH_10,
};
/**
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index fd556ac..598b609 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -54,6 +54,8 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
control_freq = chandef->chan->center_freq;
switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
case NL80211_CHAN_WIDTH_20:
case NL80211_CHAN_WIDTH_20_NOHT:
if (chandef->center_freq1 != control_freq)
@@ -152,6 +154,12 @@ static int cfg80211_chandef_get_width(const struct cfg80211_chan_def *c)
int width;
switch (c->width) {
+ case NL80211_CHAN_WIDTH_5:
+ width = 5;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ width = 10;
+ break;
case NL80211_CHAN_WIDTH_20:
case NL80211_CHAN_WIDTH_20_NOHT:
width = 20;
@@ -194,6 +202,16 @@ cfg80211_chandef_compatible(const struct cfg80211_chan_def *c1,
if (c1->width == c2->width)
return NULL;
+ /*
+ * can't be compatible if one of them are 5 or 10 MHz,
+ * but they have not the same width.
+ */
+ if (c1->width == NL80211_CHAN_WIDTH_5 ||
+ c1->width == NL80211_CHAN_WIDTH_10 ||
+ c2->width == NL80211_CHAN_WIDTH_5 ||
+ c2->width == NL80211_CHAN_WIDTH_10)
+ return NULL;
+
if (c1->width == NL80211_CHAN_WIDTH_20_NOHT ||
c1->width == NL80211_CHAN_WIDTH_20)
return c2;
@@ -264,11 +282,17 @@ static int cfg80211_get_chans_dfs_required(struct wiphy *wiphy,
u32 bandwidth)
{
struct ieee80211_channel *c;
- u32 freq;
+ u32 freq, start_freq, end_freq;
- for (freq = center_freq - bandwidth/2 + 10;
- freq <= center_freq + bandwidth/2 - 10;
- freq += 20) {
+ if (bandwidth <= 20) {
+ start_freq = center_freq;
+ end_freq = center_freq;
+ } else {
+ start_freq = center_freq - bandwidth/2 + 10;
+ end_freq = center_freq + bandwidth/2 - 10;
+ }
+
+ for (freq = start_freq; freq <= end_freq; freq += 20) {
c = ieee80211_get_channel(wiphy, freq);
if (!c)
return -EINVAL;
@@ -310,11 +334,17 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
u32 prohibited_flags)
{
struct ieee80211_channel *c;
- u32 freq;
+ u32 freq, start_freq, end_freq;
- for (freq = center_freq - bandwidth/2 + 10;
- freq <= center_freq + bandwidth/2 - 10;
- freq += 20) {
+ if (bandwidth <= 20) {
+ start_freq = end_freq;
+ end_freq = center_freq;
+ } else {
+ start_freq = center_freq - bandwidth/2 + 10;
+ end_freq = center_freq + bandwidth/2 - 10;
+ }
+
+ for (freq = start_freq; freq <= end_freq; freq += 20) {
c = ieee80211_get_channel(wiphy, freq);
if (!c)
return false;
@@ -349,6 +379,12 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
control_freq = chandef->chan->center_freq;
switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_5:
+ width = 5;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ width = 10;
+ break;
case NL80211_CHAN_WIDTH_20:
if (!ht_cap->ht_supported)
return false;
@@ -405,6 +441,11 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
if (width > 20)
prohibited_flags |= IEEE80211_CHAN_NO_OFDM;
+ /* 5 and 10 MHz are only defined for the OFDM PHY */
+ if (width < 20)
+ prohibited_flags |= IEEE80211_CHAN_NO_OFDM;
+
+
if (!cfg80211_secondary_chans_ok(wiphy, chandef->center_freq1,
width, prohibited_flags))
return false;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index afa2838..75070da 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1228,6 +1228,9 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
if ((dev->wiphy.flags & WIPHY_FLAG_TDLS_EXTERNAL_SETUP) &&
nla_put_flag(msg, NL80211_ATTR_TDLS_EXTERNAL_SETUP))
goto nla_put_failure;
+ if ((dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
+ nla_put_flag(msg, WIPHY_FLAG_SUPPORTS_5_10_MHZ))
+ goto nla_put_failure;
(*split_start)++;
if (split)
@@ -1771,6 +1774,11 @@ static int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
IEEE80211_CHAN_DISABLED))
return -EINVAL;
+ if ((chandef->width == NL80211_CHAN_WIDTH_5 ||
+ chandef->width == NL80211_CHAN_WIDTH_10) &&
+ !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ))
+ return -EINVAL;
+
return 0;
}
@@ -6288,11 +6296,16 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
if (!cfg80211_reg_can_beacon(&rdev->wiphy, &ibss.chandef))
return -EINVAL;
- if (ibss.chandef.width > NL80211_CHAN_WIDTH_40)
- return -EINVAL;
- if (ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
- !(rdev->wiphy.features & NL80211_FEATURE_HT_IBSS))
+ switch (ibss.chandef.width) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ break;
+ case NL80211_CHAN_WIDTH_20:
+ case NL80211_CHAN_WIDTH_40:
+ if (rdev->wiphy.features & NL80211_FEATURE_HT_IBSS)
+ break;
+ default:
return -EINVAL;
+ }
ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED];
ibss.privacy = !!info->attrs[NL80211_ATTR_PRIVACY];
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 03/18] mac80211: fix various components for the new 5 and 10 MHz widths
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
This is a collection of minor fixes:
* don't allow HT IEs in IBSS for 5/10 MHz
* don't allow HT IEs in Mesh for 5/10 MHz
* consider 5 and 10 MHz channels when downgrading
* don't try HT rates for 5 and 10 MHz channels when selecting rates
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
net/mac80211/ibss.c | 2 ++
net/mac80211/mesh.c | 4 +++-
net/mac80211/mesh_plink.c | 8 +++++++-
net/mac80211/mlme.c | 12 ++++++++++++
net/mac80211/rate.c | 8 +++++++-
5 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 170f9a7..4e1fb81 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -176,6 +176,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
/* add HT capability and information IEs */
if (chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
+ chandef.width != NL80211_CHAN_WIDTH_5 &&
+ chandef.width != NL80211_CHAN_WIDTH_10 &&
sband->ht_cap.ht_supported) {
pos = ieee80211_ie_build_ht_cap(pos, &sband->ht_cap,
sband->ht_cap.cap);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 6952760..5227b73 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -417,7 +417,9 @@ int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata,
sband = local->hw.wiphy->bands[band];
if (!sband->ht_cap.ht_supported ||
- sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT)
+ sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT ||
+ sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_5 ||
+ sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_10)
return 0;
if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_cap))
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 09bebed..02c05fa 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -154,8 +154,14 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
u16 ht_opmode;
bool non_ht_sta = false, ht20_sta = false;
- if (sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT)
+ switch (sdata->vif.bss_conf.chandef.width) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
return 0;
+ default:
+ break;
+ }
rcu_read_lock();
list_for_each_entry_rcu(sta, &local->sta_list, list) {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 29620bf..0eaee23 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -224,6 +224,12 @@ static u32 chandef_downgrade(struct cfg80211_chan_def *c)
c->width = NL80211_CHAN_WIDTH_20_NOHT;
ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT;
break;
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
+ WARN_ON_ONCE(1);
+ /* keep c->width */
+ ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT;
+ break;
}
WARN_ON_ONCE(!cfg80211_chandef_valid(c));
@@ -3809,6 +3815,12 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
*/
ret = ieee80211_vif_use_channel(sdata, &chandef,
IEEE80211_CHANCTX_SHARED);
+
+ /* don't downgrade for 5 and 10 MHz channels, though. */
+ if (chandef.width == NL80211_CHAN_WIDTH_5 ||
+ chandef.width == NL80211_CHAN_WIDTH_10)
+ return ret;
+
while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) {
ifmgd->flags |= chandef_downgrade(&chandef);
ret = ieee80211_vif_use_channel(sdata, &chandef,
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 0d51877..1ca7ded 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -397,8 +397,14 @@ static void rate_idx_match_mask(struct ieee80211_tx_rate *rate,
return;
/* if HT BSS, and we handle a data frame, also try HT rates */
- if (chan_width == NL80211_CHAN_WIDTH_20_NOHT)
+ switch (chan_width) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
return;
+ default:
+ break;
+ }
alt_rate.idx = 0;
/* keep protection flags */
--
1.7.10.4
^ permalink raw reply related
* [PATCHv2 02/18] nl80211: add half/quarter channel bitrate tables to supported band struct
From: Simon Wunderlich @ 2013-05-15 14:18 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Mathias Kretschmer, Simon Wunderlich
In-Reply-To: <1368627549-22518-1-git-send-email-siwu@hrz.tu-chemnitz.de>
Reduced bandwidth channels use other bitrates (half or quarter of the
original 20 MHz rate). To allow internal use of these different rates,
add bitrate tables for these channel types. Drivers which support these
channel types must fill these tables, and mac80211 (or full-mac drivers
support 5/10 MHz) must check them.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
include/net/cfg80211.h | 39 ++++++++++++++++++++++++++++++++
net/wireless/util.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 97 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 08489cc..d4c687a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -273,13 +273,52 @@ struct ieee80211_sta_vht_cap {
struct ieee80211_supported_band {
struct ieee80211_channel *channels;
struct ieee80211_rate *bitrates;
+ struct ieee80211_rate *bitrates_half;
+ struct ieee80211_rate *bitrates_quarter;
enum ieee80211_band band;
int n_channels;
int n_bitrates;
+ int n_bitrates_half;
+ int n_bitrates_quarter;
struct ieee80211_sta_ht_cap ht_cap;
struct ieee80211_sta_vht_cap vht_cap;
};
+/**
+ * ieee80211_get_bitrates - get the bitrates for the channel width
+ *
+ * @sband: supported band
+ * @width: channel width where the bitrates are operated
+ * @bitrates: pointer to bitrate array for return
+ * @n_bitrates: pointer for the number of bitrates to return
+ *
+ * Return: 0 on success, -EINVAL if no rates are defined
+ */
+static inline int
+ieee80211_get_bitrates(struct ieee80211_supported_band *sband,
+ enum nl80211_chan_width width,
+ struct ieee80211_rate **bitrates,
+ int *n_bitrates)
+{
+ switch (width) {
+ case NL80211_CHAN_WIDTH_5:
+ *bitrates = sband->bitrates_quarter;
+ *n_bitrates = sband->n_bitrates_quarter;
+ break;
+ case NL80211_CHAN_WIDTH_10:
+ *bitrates = sband->bitrates_half;
+ *n_bitrates = sband->n_bitrates_half;
+ break;
+ default:
+ *bitrates = sband->bitrates;
+ *n_bitrates = sband->n_bitrates;
+ break;
+ }
+ if (*bitrates)
+ return 0;
+ else
+ return -EINVAL;
+}
/*
* Wireless hardware/device configuration structures and methods
*/
diff --git a/net/wireless/util.c b/net/wireless/util.c
index f5ad4d9..b0fd2f3 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -122,6 +122,32 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
}
}
WARN_ON(want);
+ if (sband->n_bitrates_half) {
+ want = 3;
+ for (i = 0; i < sband->n_bitrates_half; i++) {
+ if (sband->bitrates_half[i].bitrate == 30 ||
+ sband->bitrates_half[i].bitrate == 60 ||
+ sband->bitrates_half[i].bitrate == 120) {
+ sband->bitrates_half[i].flags |=
+ IEEE80211_RATE_MANDATORY_A;
+ want--;
+ }
+ }
+ WARN_ON(want);
+ }
+ if (sband->n_bitrates_quarter) {
+ want = 3;
+ for (i = 0; i < sband->n_bitrates_quarter; i++) {
+ if (sband->bitrates_quarter[i].bitrate == 15 ||
+ sband->bitrates_quarter[i].bitrate == 30 ||
+ sband->bitrates_quarter[i].bitrate == 60) {
+ sband->bitrates_quarter[i].flags |=
+ IEEE80211_RATE_MANDATORY_A;
+ want--;
+ }
+ }
+ WARN_ON(want);
+ }
break;
case IEEE80211_BAND_2GHZ:
want = 7;
@@ -152,6 +178,38 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
IEEE80211_RATE_ERP_G;
}
WARN_ON(want != 0 && want != 3 && want != 6);
+
+ /*
+ * NOTE: half/quarter bitrates are actually only defined for
+ * the OFDM PHY, yet some chipsets support them so define
+ * mandatory rates as for 5 GHZ.
+ */
+ if (sband->n_bitrates_half) {
+ want = 3;
+ for (i = 0; i < sband->n_bitrates_half; i++) {
+ if (sband->bitrates_half[i].bitrate == 30 ||
+ sband->bitrates_half[i].bitrate == 60 ||
+ sband->bitrates_half[i].bitrate == 120) {
+ sband->bitrates_half[i].flags |=
+ IEEE80211_RATE_MANDATORY_B;
+ want--;
+ }
+ }
+ WARN_ON(want);
+ }
+ if (sband->n_bitrates_quarter) {
+ want = 3;
+ for (i = 0; i < sband->n_bitrates_quarter; i++) {
+ if (sband->bitrates_quarter[i].bitrate == 15 ||
+ sband->bitrates_quarter[i].bitrate == 30 ||
+ sband->bitrates_quarter[i].bitrate == 60) {
+ sband->bitrates_quarter[i].flags |=
+ IEEE80211_RATE_MANDATORY_B;
+ want--;
+ }
+ }
+ WARN_ON(want);
+ }
break;
case IEEE80211_BAND_60GHZ:
/* check for mandatory HT MCS 1..4 */
--
1.7.10.4
^ permalink raw reply related
* ath9k_htc: Target is unresponsive
From: Ignacy Gawedzki @ 2013-05-15 13:42 UTC (permalink / raw)
To: ath9k-devel, linux-wireless
Hi everyone,
This is an old issue, about which it seems the first posts date back to 2009.
With the latest possible version of the firmware for AR9271 and the latest
possible wireless drivers, the issue is still there. Whether this is still
the exact same problem every time remains to be checked, but it is annoying
enough to deserve some consideration.
The problem is that the driver can't talk to the device if the following
conditions are met:
- The system cold boots with the USB dongle inserted or the USB dongle is
inserted on a running system.
- The interface is *not* brought up.
- The system (warm) reboots.
Then the driver complains about the target being unresponsive after uploading
the firmware. Apparently the only way to make it work again is to unplug and
then plug the USB dongle back, physically. It seems that if the USB port is
not powered down during reboot (which happens with at least two different
setups that I've tested it with), the device is left in a broken state.
I would gladly help in tracing down this bug if only I knew where to start.
Thanks for any suggestion.
Ignacy
--
A person is shit's way of making more shit.
-- S. Barnett, anthropologist.
^ permalink raw reply
* [RFC] 802.11s needs to send about 900 frames to detect a lost peer on ath9k (AR9160 chip)
From: Jean-Pierre Tosoni @ 2013-05-15 13:58 UTC (permalink / raw)
To: linux-wireless
Hi all,
I am testing what happens when a mesh peer suddenly disappears while I am
sending data to it.
I am using compat-wireless 2013-04-16 plus openwrt patches, and I operate on
a clean 5GHz channel at HT40.
I am sending a low throughput UDP stream, then I suddenly poweroff the
receiver MP.
On Wireshark I can see that the sending MP continues sending approx. 900
frames for about one second before giving up, which seems a very large
number of frames (and a large detection delay).
I investigated for the reason of so many frames, I found the following
reasons, each of them bring questions.
1) ath9k does not give up before ATH_MAX_SW_RETRIES(=30) retries, some of
them done by hardware and some by software in ath9k/xmit.c.
Q: I saw that the number of retries is configurable in ath5k and nl80211
(NL80211_ATTR_WIPHY_RETRY_LONG). Should we use this instead of the constant,
or is this obsolete/unsupported/inappropriate/whatever?
2) ath9k retries are computed from ts_longretry. But when the peer
disappears, the last retries are subject to RTS, hence the retry count is in
ts_shortretry instead.
Q: shouldn't we add ts_shortretry and ts_longretry in
ath9k/xmit.c/ath_tx_complete_aggr() and ath_tx_rc_status() ?
3) In the rate control table, rates 1,2,3 are subject to RTS. When RTS fails
the shortretry count seems to be always 10, whatever is the retry count set
by the rate control. From Wireshark I see that indeed there are 10 RTS
retries per rate control slot. (I googled for this one, the point is rised
in madwifi-devel but not answered)
Q: is this a "feature" of the AR9160 ? or in the standard ? or a hidden
constant ?
4) The mac80211 mesh_hwmp code computes an error rate with a decaying
algorithm. Each time a TX frame fails it updates the error rate and gives up
when the error is >95%. But when the ath9k driver retries 26x4 = 104 times,
this accounts only for one failure.
Q1: shouldn't we take into account the number of retries done by the
underlying driver ?
Q2: Isn't a 95% error rate damn high for a useable link ??? (just kidding -
or not?)
>From (4), 17 frames are required for the mesh to detect failure. From (3) 26
frames are sent by the hardware for each try. From (2) the ath9k resends 4
times each failed frame. Total 17*4*26 = 1768 frames before detecting peer
failure. The observed count is lesser because at some point the driver
starts aggregating.
I plan to work on these issues - Any advice about the best ways to improve
this?
Cheers
^ permalink raw reply
* Re: Wifi signal level differences
From: Kalle Valo @ 2013-05-15 13:19 UTC (permalink / raw)
To: Dan Williams; +Cc: nick, linux-wireless
In-Reply-To: <1368023384.1664.10.camel@dcbw.foobar.com>
Dan Williams <dcbw@redhat.com> writes:
> On Wed, 2013-05-08 at 15:51 +0200, nick@nhthomas.freeserve.co.uk wrote:
>> Hi,
>>
>> I have an Atheros ath6kl_usb based wifi dongle.
>> I am using it with an embedded project.
[...]
> What kernel versions is each system running? The kernel's mac80211
> stack is what calculates the actual dBm/RSSI value based on information
> given from the dongle firmware. And the calculations may change in
> different kernel versions.
ath6kl is a fullmac device and doesn't use mac80211.
--
Kalle Valo
^ permalink raw reply
* warning in mac80211 from iwlwifi queuing work during suspend
From: James Bottomley @ 2013-05-15 13:13 UTC (permalink / raw)
To: linux-wireless
I got this message on resume
---
[24856.578799] ------------[ cut here ]------------
[24856.578849] WARNING: at /home/abuild/rpmbuild/BUILD/kernel-desktop-3.9.1/linux-3.9/net/mac80211/util.c:599 ieee80211_can_queue_work.isra.7+0x2d/0x40 [mac80211]()
[24856.578851] Hardware name: 4286CTO
[24856.578852] queueing ieee80211 work while going to suspend
[24856.578917] Modules linked in: cpufreq_stats fuse tun af_packet rfcomm bnep sha256_generic cbc dm_crypt dm_mod mperf coretemp crc32_pclmul crc32c_intel ghash_clmulni_intel cryptd arc4 iwldvm mac80211 snd_hda_codec_hdmi snd_hda_codec_conexant iTCO_wdt iTCO_vendor_support kvm_intel kvm microcode snd_hda_intel snd_hda_codec joydev snd_hwdep pcspkr snd_pcm_oss i2c_i801 snd_pcm uvcvideo btusb sg thinkpad_acpi videobuf2_core videodev videobuf2_vmalloc bluetooth snd_seq videobuf2_memops lpc_ich mfd_core iwlwifi sdhci_pci sdhci snd_seq_device mmc_core cfg80211 e1000e rfkill snd_mixer_oss snd_timer ptp snd_page_alloc pps_core mei wmi snd battery tpm_tis tpm tpm_bios ac soundcore edd autofs4 i915 drm_kms_helper drm i2c_algo_bit video button scsi_dh_hp_sw scsi_dh_alua scsi_dh_emc scsi_dh_rdac scsi_dh fan processor thermal thermal_sys
[24856.578921] Pid: 0, comm: swapper/0 Not tainted 3.9.1-7.gb6484b6-desktop #1
[24856.578921] Call Trace:
[24856.578933] [<ffffffff81004728>] dump_trace+0x88/0x300
[24856.578938] [<ffffffff815cafba>] dump_stack+0x69/0x6f
[24856.578945] [<ffffffff810461c9>] warn_slowpath_common+0x79/0xc0
[24856.578948] [<ffffffff810462c5>] warn_slowpath_fmt+0x45/0x50
[24856.578960] [<ffffffffa06053dd>] ieee80211_can_queue_work.isra.7+0x2d/0x40 [mac80211]
[24856.579004] [<ffffffffa0605487>] ieee80211_queue_work+0x27/0x60 [mac80211]
[24856.579029] [<ffffffff8105615c>] call_timer_fn+0x2c/0x170
[24856.579033] [<ffffffff810564c5>] run_timer_softirq+0x225/0x2d0
[24856.579037] [<ffffffff8104e60e>] __do_softirq+0xde/0x280
[24856.579040] [<ffffffff8104e905>] irq_exit+0x95/0xa0
[24856.579043] [<ffffffff810264e8>] smp_apic_timer_interrupt+0x68/0xa0
[24856.579047] [<ffffffff815df9dd>] apic_timer_interrupt+0x6d/0x80
[24856.579051] ---[ end trace 53ff81b324167a8a ]---
----
Kernel is
Linux version 3.9.1-7.gb6484b6-desktop (geeko@buildhost) (gcc version 4.7.2 20130108 [gcc-4_7-branch revision 195012] (SUSE Linux) ) #1 SMP PREEMPT Wed May 8 15:02:04 UTC 2013 (b6484b6)
and the wireless stack is
jejb@dabdike> lsmod|grep iwl
iwldvm 253990 0
mac80211 678341 1 iwldvm
iwlwifi 118000 1 iwldvm
cfg80211 579562 3 iwldvm,mac80211,iwlwifi
James
^ permalink raw reply
* Re: RTL driver for RTL8191SEvB and/or wpa-supplicant really broken at times
From: Dan Williams @ 2013-05-15 12:55 UTC (permalink / raw)
To: Norbert Preining
Cc: Larry Finger, Matt Causey, linux-wireless, linux-kernel, hostap
In-Reply-To: <20130515120801.GA24670@gamma.logic.tuwien.ac.at>
On Wed, 2013-05-15 at 21:08 +0900, Norbert Preining wrote:
> Hi everyone,
>
> sorry for the late reply, business trip to Tokyo.
>
> On Do, 09 Mai 2013, Larry Finger wrote:
> > absolutely critical, namely the PCI ID. There are at least three
>
> 10ec:8172
>
> > I also recommend that you try either the wireless-testing git repo or the
> > mainline git repo. There are a lot of changes that cannot be backported.
>
> Ok, I will try.
>
> On Fr, 10 Mai 2013, Matt Causey wrote:
> > Seems to indicate that the access point is ignoring your probe requests.
> > If that is happening for your client somehow, wpa_supplicant won't work
> > well. :-)
>
> I rebooted the rooter, after that it worked, for one day. After that
> agian problems.
>
> Then I rebooted also linux and it works again.
>
> > "NecAcces" - but I'm not familiar with that vendor. Also, do you have a
>
> Aterm WR8600N http://121ware.com/aterm/
> which is a NEC part, probably sold in other places under a different
> name. In Japan it is sold as this.
>
> > WLAN packet capture (from another host nearby on the same channel)? That
> > would be helpful as well.
>
> Difficult, I only have an iPhone, and a wireless repeater for the TV,
> and I guess both are not enough for wlan sniffing.
>
> In the meantime I have also tried wpa_supplicatn 2.0, without
> chagnes.
>
> In the current log there are strange things:
> May 15 20:36:38 tofuschnitzel kernel: [78541.678861] wlan0: send auth to 00:3a
> :9d:b4:54:5a (try 1/3)
> May 15 20:36:38 tofuschnitzel NetworkManager[16128]: <info> (wlan0): supplican
> t interface state: scanning -> authenticating
> May 15 20:36:38 tofuschnitzel kernel: [78541.681046] wlan0: authenticated
> May 15 20:36:43 tofuschnitzel kernel: [78546.680713] wlan0: deauthenticating from 00:3a:9d:b4:54:5a by local choice (reason=3)
The deauth by local choice can often be NM terminating the connection
after a 20 second timeout, because if you haven't connected to the AP
within 20 seconds, you probably aren't going to. Look above in the logs
for when NM actually tells the supplicant to connect. Here's what the
entire association process looks like on my machine:
May 15 07:00:14 dcbw NetworkManager[20259]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
May 15 07:00:14 dcbw NetworkManager[20259]: <info> (wlan0): supplicant interface state: disconnected -> inactive
May 15 07:00:14 dcbw NetworkManager[20259]: <info> Config: set interface ap_scan to 1
May 15 07:00:14 dcbw NetworkManager[20259]: <info> (wlan0): supplicant interface state: inactive -> scanning
May 15 07:00:17 dcbw kernel: wlan0: authenticate with 00:13:aa:bb:cc:dd
May 15 07:00:17 dcbw kernel: wlan0: send auth to 00:13:aa:bb:cc:dd (try 1/3)
May 15 07:00:17 dcbw kernel: wlan0: authenticated
May 15 07:00:17 dcbw kernel: iwlwifi 0000:02:00.0 wlan0: disabling HT as WMM/QoS is not supported by the AP
May 15 07:00:17 dcbw kernel: iwlwifi 0000:02:00.0 wlan0: disabling VHT as WMM/QoS is not supported by the AP
May 15 07:00:17 dcbw kernel: wlan0: associate with 00:13:aa:bb:cc:dd (try 1/3)
May 15 07:00:17 dcbw kernel: wlan0: RX AssocResp from 00:13:aa:bb:cc:dd (capab=0x411 status=0 aid=1)
May 15 07:00:17 dcbw kernel: wlan0: associated
May 15 07:00:17 dcbw kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
May 15 07:00:17 dcbw NetworkManager[20259]: <info> (wlan0): supplicant interface state: scanning -> authenticating
May 15 07:00:17 dcbw NetworkManager[20259]: <info> (wlan0): supplicant interface state: authenticating -> associating
May 15 07:00:17 dcbw NetworkManager[20259]: <info> (wlan0): supplicant interface state: associating -> 4-way handshake
May 15 07:00:17 dcbw NetworkManager[20259]: <info> (wlan0): supplicant interface state: 4-way handshake -> completed
May 15 07:00:17 dcbw NetworkManager[20259]: <info> Activation (wlan0/wireless) Stage 2 of 5 (Device Configure) successful. Connected to wireless n
Here it's a total of 3 seconds between telling the supplicant "GO!" and
the supplicant completing the association.
Dan
> May 15 20:36:43 tofuschnitzel NetworkManager[16128]: <info> (wlan0): supplicant interface state: authenticating -> disconnected
> May 15 20:36:44 tofuschnitzel NetworkManager[16128]: <info> (wlan0): supplicant interface state: disconnected -> scanning
>
> Why does it go from authenticated -> directly to deauthenticating. Uffa.
>
> Anyway, I will try some more things, esp wireless-testing.
>
> Norbert
>
> ------------------------------------------------------------------------
> PREINING, Norbert http://www.preining.info
> JAIST, Japan TeX Live & Debian Developer
> DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
> ------------------------------------------------------------------------
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v2] rtlwifi: rtl8192cu: Add new USB ID
From: Albert Pool @ 2013-05-15 12:54 UTC (permalink / raw)
To: larry.finger, chaoming_li; +Cc: linux-wireless, linux-kernel
This adds the USB ID of the On Networks N300MA, clone of Netgear WNA3100M.
Signed-off-by: Albert Pool<albertpool@solcon.nl>
Reported-by: Ana Rey<Anazul77@hotmail.com>
---
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 23d640a..0b593de 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -349,6 +349,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
{RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/
{RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
{RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/
+ {RTL_USB_DEVICE(0x0846, 0xf001, rtl92cu_hal_cfg)}, /*Netgear-On Networks*/
{RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
{RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/
{RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/
--
1.7.9.5
^ permalink raw reply related
* Re: RTL driver for RTL8191SEvB and/or wpa-supplicant really broken at times
From: Norbert Preining @ 2013-05-15 12:08 UTC (permalink / raw)
To: Larry Finger, Matt Causey; +Cc: linux-wireless, linux-kernel, hostap
In-Reply-To: <518BC290.2040306@lwfinger.net>
Hi everyone,
sorry for the late reply, business trip to Tokyo.
On Do, 09 Mai 2013, Larry Finger wrote:
> absolutely critical, namely the PCI ID. There are at least three
10ec:8172
> I also recommend that you try either the wireless-testing git repo or the
> mainline git repo. There are a lot of changes that cannot be backported.
Ok, I will try.
On Fr, 10 Mai 2013, Matt Causey wrote:
> Seems to indicate that the access point is ignoring your probe requests.
> If that is happening for your client somehow, wpa_supplicant won't work
> well. :-)
I rebooted the rooter, after that it worked, for one day. After that
agian problems.
Then I rebooted also linux and it works again.
> "NecAcces" - but I'm not familiar with that vendor. Also, do you have a
Aterm WR8600N http://121ware.com/aterm/
which is a NEC part, probably sold in other places under a different
name. In Japan it is sold as this.
> WLAN packet capture (from another host nearby on the same channel)? That
> would be helpful as well.
Difficult, I only have an iPhone, and a wireless repeater for the TV,
and I guess both are not enough for wlan sniffing.
In the meantime I have also tried wpa_supplicatn 2.0, without
chagnes.
In the current log there are strange things:
May 15 20:36:38 tofuschnitzel kernel: [78541.678861] wlan0: send auth to 00:3a
:9d:b4:54:5a (try 1/3)
May 15 20:36:38 tofuschnitzel NetworkManager[16128]: <info> (wlan0): supplican
t interface state: scanning -> authenticating
May 15 20:36:38 tofuschnitzel kernel: [78541.681046] wlan0: authenticated
May 15 20:36:43 tofuschnitzel kernel: [78546.680713] wlan0: deauthenticating from 00:3a:9d:b4:54:5a by local choice (reason=3)
May 15 20:36:43 tofuschnitzel NetworkManager[16128]: <info> (wlan0): supplicant interface state: authenticating -> disconnected
May 15 20:36:44 tofuschnitzel NetworkManager[16128]: <info> (wlan0): supplicant interface state: disconnected -> scanning
Why does it go from authenticated -> directly to deauthenticating. Uffa.
Anyway, I will try some more things, esp wireless-testing.
Norbert
------------------------------------------------------------------------
PREINING, Norbert http://www.preining.info
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
^ permalink raw reply
* Re: [PATCH] rtlwifi: rtl8192cu: Add new USB ID
From: Julian Calaby @ 2013-05-15 11:16 UTC (permalink / raw)
To: Albert Pool
Cc: Larry Finger, chaoming_li, linux-wireless,
linux-kernel@vger.kernel.org
In-Reply-To: <51935A67.6000804@solcon.nl>
Hi Albert,
Your patch appears to have been mangled, please check your email
client's settings, or send using git-send-email
There's instructions for most email clients in the Documentation
directory of the kernel source tree.
On Wed, May 15, 2013 at 7:50 PM, Albert Pool <albertpool@solcon.nl> wrote:
> This adds the USB ID of the On Networks N300MA, clone of Netgear WNA3100M.
>
> Signed-off-by: Albert Pool <albertpool@solcon.nl>
>
> Reported-by: Ana Rey <Anazul77@hotmail.com>
>
> ---
>
> drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 1 +
>
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
> b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
>
> index 23d640a..0b593de 100644
>
> --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
>
> +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
>
> @@ -349,6 +349,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
>
> {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/
>
> {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
>
> {RTL_USB_DEVICE(0x0846, 0x9021, rtl92cu_hal_cfg)}, /*Netgear-Sercomm*/
>
> + {RTL_USB_DEVICE(0x0846, 0xf001, rtl92cu_hal_cfg)}, /*Netgear-On
> Networks*/
>
> {RTL_USB_DEVICE(0x0b05, 0x17ab, rtl92cu_hal_cfg)}, /*ASUS-Edimax*/
>
> {RTL_USB_DEVICE(0x0bda, 0x8186, rtl92cu_hal_cfg)}, /*Realtek 92CE-VAU*/
>
> {RTL_USB_DEVICE(0x0df6, 0x0061, rtl92cu_hal_cfg)}, /*Sitecom-Edimax*/
>
> --
>
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
^ permalink raw reply
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