* [PATCH 1/2] mac80211: insert mesh peer after init
@ 2012-04-26 22:01 Thomas Pedersen
2012-04-26 22:01 ` [PATCH 2/2] mac80211: don't transmit 40MHz frames to 20MHz peer Thomas Pedersen
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Pedersen @ 2012-04-26 22:01 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, Thomas Pedersen, johannes, linville
Drivers need the station rate info when inserting a new sta_info. The
patch "mac80211: refactor mesh peer initialization" wrongly assumed the
rate info could be applied after insertion. After further review, this
is clearly not the case.
This fixes a regression where HT parameters were not applied before
inserting the sta_info, causing performance degradation.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
net/mac80211/mesh_plink.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 1ff2a5c..f4124d7 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -102,9 +102,6 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
set_sta_flag(sta, WLAN_STA_WME);
- if (sta_info_insert(sta))
- return NULL;
-
return sta;
}
@@ -281,6 +278,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband;
u32 rates, basic_rates = 0;
struct sta_info *sta;
+ bool insert = false;
sband = local->hw.wiphy->bands[band];
rates = ieee80211_sta_get_rates(local, elems, band, &basic_rates);
@@ -290,6 +288,7 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
sta = mesh_plink_alloc(sdata, addr);
if (!sta)
return NULL;
+ insert = true;
}
spin_lock_bh(&sta->lock);
@@ -306,6 +305,9 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
rate_control_rate_init(sta);
spin_unlock_bh(&sta->lock);
+ if (insert && sta_info_insert(sta))
+ return NULL;
+
return sta;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] mac80211: don't transmit 40MHz frames to 20MHz peer
2012-04-26 22:01 [PATCH 1/2] mac80211: insert mesh peer after init Thomas Pedersen
@ 2012-04-26 22:01 ` Thomas Pedersen
2012-05-03 18:55 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Pedersen @ 2012-04-26 22:01 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, Thomas Pedersen, johannes, linville
If a mesh peer indicates it is operating as 20MHz-only in its HT
operation IE, have the rate control algorithm respect this by disabling
the equivalent bit in the ieee80211_sta HT capabilities.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
net/mac80211/mesh_plink.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index f4124d7..6209327 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -302,6 +302,12 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
else
memset(&sta->sta.ht_cap, 0, sizeof(sta->sta.ht_cap));
+ if (elems->ht_operation)
+ if (!(elems->ht_operation->ht_param &
+ IEEE80211_HT_PARAM_CHAN_WIDTH_ANY))
+ sta->sta.ht_cap.cap &=
+ ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+
rate_control_rate_init(sta);
spin_unlock_bh(&sta->lock);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] mac80211: don't transmit 40MHz frames to 20MHz peer
2012-04-26 22:01 ` [PATCH 2/2] mac80211: don't transmit 40MHz frames to 20MHz peer Thomas Pedersen
@ 2012-05-03 18:55 ` Johannes Berg
2012-05-03 19:02 ` Thomas Pedersen
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2012-05-03 18:55 UTC (permalink / raw)
To: Thomas Pedersen; +Cc: linux-wireless, devel, linville
On Thu, 2012-04-26 at 15:01 -0700, Thomas Pedersen wrote:
> If a mesh peer indicates it is operating as 20MHz-only in its HT
> operation IE, have the rate control algorithm respect this by disabling
> the equivalent bit in the ieee80211_sta HT capabilities.
>
> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
> ---
> net/mac80211/mesh_plink.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index f4124d7..6209327 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -302,6 +302,12 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
> else
> memset(&sta->sta.ht_cap, 0, sizeof(sta->sta.ht_cap));
>
> + if (elems->ht_operation)
> + if (!(elems->ht_operation->ht_param &
> + IEEE80211_HT_PARAM_CHAN_WIDTH_ANY))
> + sta->sta.ht_cap.cap &=
> + ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
The double if is a bit odd, why not use && to clean up all the
formatting?
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] mac80211: don't transmit 40MHz frames to 20MHz peer
2012-05-03 18:55 ` Johannes Berg
@ 2012-05-03 19:02 ` Thomas Pedersen
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Pedersen @ 2012-05-03 19:02 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, devel, linville
On Thu, May 3, 2012 at 11:55 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2012-04-26 at 15:01 -0700, Thomas Pedersen wrote:
>> If a mesh peer indicates it is operating as 20MHz-only in its HT
>> operation IE, have the rate control algorithm respect this by disabling
>> the equivalent bit in the ieee80211_sta HT capabilities.
>>
>> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
>> ---
>> net/mac80211/mesh_plink.c | 6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
>> index f4124d7..6209327 100644
>> --- a/net/mac80211/mesh_plink.c
>> +++ b/net/mac80211/mesh_plink.c
>> @@ -302,6 +302,12 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
>> else
>> memset(&sta->sta.ht_cap, 0, sizeof(sta->sta.ht_cap));
>>
>> + if (elems->ht_operation)
>> + if (!(elems->ht_operation->ht_param &
>> + IEEE80211_HT_PARAM_CHAN_WIDTH_ANY))
>> + sta->sta.ht_cap.cap &=
>> + ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
>
> The double if is a bit odd, why not use && to clean up all the
> formatting?
Good point, but later Ashok adds a patch which takes the same branch anyway.
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-03 19:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-26 22:01 [PATCH 1/2] mac80211: insert mesh peer after init Thomas Pedersen
2012-04-26 22:01 ` [PATCH 2/2] mac80211: don't transmit 40MHz frames to 20MHz peer Thomas Pedersen
2012-05-03 18:55 ` Johannes Berg
2012-05-03 19:02 ` Thomas Pedersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).