2010-09-28 08:29:56

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: [RFC] mac80211: sets basic rate set parameter for IBSS creator

From: Mohammed Shafi Shajakhan <[email protected]>

This fix sets the basic rate set parameter for IBSS creator when the
basic rates are not explicitly specified in the user space.

Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
---
net/mac80211/ibss.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 1a3aae5..e117155 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -541,6 +541,9 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
capability |= WLAN_CAPABILITY_PRIVACY;
else
sdata->drop_unencrypted = 0;
+ if (ifibss->basic_rates == 0)
+ ifibss->basic_rates = ieee80211_mandatory_rates(local,
+ local->hw.conf.channel->band);

__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
ifibss->channel, ifibss->basic_rates,
--
1.7.0.4



2010-09-28 09:31:36

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: Re: [RFC] mac80211: sets basic rate set parameter for IBSS creator


On Tuesday 28 September 2010 02:32 PM, Johannes Berg wrote:
> On Tue, 2010-09-28 at 13:59 +0530, Mohammed Shafi Shajakhan wrote:
>
>> From: Mohammed Shafi Shajakhan<[email protected]>
>>
>> This fix sets the basic rate set parameter for IBSS creator when the
>> basic rates are not explicitly specified in the user space.
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<[email protected]>
>> ---
>> net/mac80211/ibss.c | 3 +++
>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
>> index 1a3aae5..e117155 100644
>> --- a/net/mac80211/ibss.c
>> +++ b/net/mac80211/ibss.c
>> @@ -541,6 +541,9 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
>> capability |= WLAN_CAPABILITY_PRIVACY;
>> else
>> sdata->drop_unencrypted = 0;
>> + if (ifibss->basic_rates == 0)
>> + ifibss->basic_rates = ieee80211_mandatory_rates(local,
>> + local->hw.conf.channel->band);
>>
> Shouldn't cfg80211 do this?
>
> johannes
>
Hi Johannes ,

Thank you for your suggestion,just found out ,i
think its already there to configure basic rates (if the user had not
expicitly specified the basic rates in user space) in the
nl80211_join_ibss(nl80211.c) , but the basic rates does not seems to get
set there.I had checked its status in mac80211 in function
ieee80211_ibss_join function , its still zero and I thought of calling
it there itself , but the basic rate was not properly set for 2Ghz, so
called it here and I had tested it ,and everything working fine.
Pleas correct me if I am wrong .

with thanks,

shafi


2010-09-28 10:47:47

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC] mac80211: sets basic rate set parameter for IBSS creator

On Tue, 2010-09-28 at 15:01 +0530, Mohammed Shafi wrote:

> >> + if (ifibss->basic_rates == 0)
> >> + ifibss->basic_rates = ieee80211_mandatory_rates(local,
> >> + local->hw.conf.channel->band);
> >>
> > Shouldn't cfg80211 do this?

> Thank you for your suggestion,just found out ,i
> think its already there to configure basic rates (if the user had not
> expicitly specified the basic rates in user space) in the
> nl80211_join_ibss(nl80211.c) , but the basic rates does not seems to get
> set there.I had checked its status in mac80211 in function
> ieee80211_ibss_join function , its still zero and I thought of calling
> it there itself , but the basic rate was not properly set for 2Ghz, so
> called it here and I had tested it ,and everything working fine.
> Pleas correct me if I am wrong .

Well, I still think cfg80211 should do this, and it looks like it will
except when you use iwconfig. So are you using iw or iwconfig? If
iwconfig latter, you need to fix the wext code in cfg80211, if the
former you need to figure out where the information gets lost.

johannes


2010-09-28 09:02:52

by Johannes Berg

[permalink] [raw]
Subject: Re: [RFC] mac80211: sets basic rate set parameter for IBSS creator

On Tue, 2010-09-28 at 13:59 +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <[email protected]>
>
> This fix sets the basic rate set parameter for IBSS creator when the
> basic rates are not explicitly specified in the user space.
>
> Signed-off-by: Mohammed Shafi Shajakhan <[email protected]>
> ---
> net/mac80211/ibss.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
> index 1a3aae5..e117155 100644
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -541,6 +541,9 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
> capability |= WLAN_CAPABILITY_PRIVACY;
> else
> sdata->drop_unencrypted = 0;
> + if (ifibss->basic_rates == 0)
> + ifibss->basic_rates = ieee80211_mandatory_rates(local,
> + local->hw.conf.channel->band);

Shouldn't cfg80211 do this?

johannes


2010-09-28 11:00:08

by Mohammed Shafi Shajakhan

[permalink] [raw]
Subject: Re: [RFC] mac80211: sets basic rate set parameter for IBSS creator

On Tuesday 28 September 2010 04:17 PM, Johannes Berg wrote:
> On Tue, 2010-09-28 at 15:01 +0530, Mohammed Shafi wrote:
>
>
>>>> + if (ifibss->basic_rates == 0)
>>>> + ifibss->basic_rates = ieee80211_mandatory_rates(local,
>>>> + local->hw.conf.channel->band);
>>>>
>>>>
>>> Shouldn't cfg80211 do this?
>>>
>
>> Thank you for your suggestion,just found out ,i
>> think its already there to configure basic rates (if the user had not
>> expicitly specified the basic rates in user space) in the
>> nl80211_join_ibss(nl80211.c) , but the basic rates does not seems to get
>> set there.I had checked its status in mac80211 in function
>> ieee80211_ibss_join function , its still zero and I thought of calling
>> it there itself , but the basic rate was not properly set for 2Ghz, so
>> called it here and I had tested it ,and everything working fine.
>> Pleas correct me if I am wrong .
>>
> Well, I still think cfg80211 should do this, and it looks like it will
> except when you use iwconfig. So are you using iw or iwconfig? If
> iwconfig latter, you need to fix the wext code in cfg80211, if the
> former you need to figure out where the information gets lost.
>
> johannes
>
Sorry , I was using iwconfig and thanks for fixing it.

with regards ,

shafi


2010-09-28 10:53:16

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] cfg80211: always set IBSS basic rates

From: Johannes Berg <[email protected]>

IBSS started from wireless extensions is currently
missing basic rate configuration, fix this by moving
the code to generate the default to the common code
that gets invoked for both nl80211 and wext.

Signed-off-by: Johannes Berg <[email protected]>
---
net/wireless/ibss.c | 19 +++++++++++++++++++
net/wireless/nl80211.c | 17 -----------------
2 files changed, 19 insertions(+), 17 deletions(-)

--- wireless-testing.orig/net/wireless/ibss.c 2010-09-28 12:49:14.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c 2010-09-28 12:51:24.000000000 +0200
@@ -88,6 +88,25 @@ int __cfg80211_join_ibss(struct cfg80211
if (wdev->ssid_len)
return -EALREADY;

+ if (!params->basic_rates) {
+ /*
+ * If no rates were explicitly configured,
+ * use the mandatory rate set for 11b or
+ * 11a for maximum compatibility.
+ */
+ struct ieee80211_supported_band *sband =
+ rdev->wiphy.bands[params->channel->band];
+ int j;
+ u32 flag = params->channel->band == IEEE80211_BAND_5GHZ ?
+ IEEE80211_RATE_MANDATORY_A :
+ IEEE80211_RATE_MANDATORY_B;
+
+ for (j = 0; j < sband->n_bitrates; j++) {
+ if (sband->bitrates[j].flags & flag)
+ params->basic_rates |= BIT(j);
+ }
+ }
+
if (WARN_ON(wdev->connect_keys))
kfree(wdev->connect_keys);
wdev->connect_keys = connkeys;
--- wireless-testing.orig/net/wireless/nl80211.c 2010-09-28 12:49:14.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2010-09-28 12:50:32.000000000 +0200
@@ -4119,23 +4119,6 @@ static int nl80211_join_ibss(struct sk_b
goto out;
}
}
- } else {
- /*
- * If no rates were explicitly configured,
- * use the mandatory rate set for 11b or
- * 11a for maximum compatibility.
- */
- struct ieee80211_supported_band *sband =
- wiphy->bands[ibss.channel->band];
- int j;
- u32 flag = ibss.channel->band == IEEE80211_BAND_5GHZ ?
- IEEE80211_RATE_MANDATORY_A :
- IEEE80211_RATE_MANDATORY_B;
-
- for (j = 0; j < sband->n_bitrates; j++) {
- if (sband->bitrates[j].flags & flag)
- ibss.basic_rates |= BIT(j);
- }
}

err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys);