linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.12] cfg80211: fix ibss wext chandef creation
@ 2013-10-22 20:02 Simon Wunderlich
  2013-10-23  5:46 ` Dirk Gouders
  2013-10-28 14:21 ` Johannes Berg
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Wunderlich @ 2013-10-22 20:02 UTC (permalink / raw)
  To: linux-wireless
  Cc: Mathias Kretschmer, Dirk Gouders, Linux Kernel, Johannes Berg,
	Simon Wunderlich

The wext internal chandefs for ibss should be created using the
cfg80211_chandef_create() functions. Otherwise the center_freq1 field
will not be set and cfg80211_chandef_valid() will spit a warning and
report the chandef as invalid when it should be used.

Reported-by: Dirk Gouders <dirk@gouders.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Cc: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/ibss.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 39bff7d..a710019 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -246,7 +246,7 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
 
 	/* try to find an IBSS channel if none requested ... */
 	if (!wdev->wext.ibss.chandef.chan) {
-		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
+		struct ieee80211_channel *new_chan = NULL;
 
 		for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
 			struct ieee80211_supported_band *sband;
@@ -262,16 +262,19 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
 					continue;
 				if (chan->flags & IEEE80211_CHAN_DISABLED)
 					continue;
-				wdev->wext.ibss.chandef.chan = chan;
+				new_chan = chan;
 				break;
 			}
 
-			if (wdev->wext.ibss.chandef.chan)
+			if (new_chan)
 				break;
 		}
 
-		if (!wdev->wext.ibss.chandef.chan)
+		if (!new_chan)
 			return -EINVAL;
+
+		cfg80211_chandef_create(&wdev->wext.ibss.chandef, new_chan,
+					NL80211_CHAN_NO_HT);
 	}
 
 	/* don't join -- SSID is not there */
@@ -345,8 +348,8 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
 		return err;
 
 	if (chan) {
-		wdev->wext.ibss.chandef.chan = chan;
-		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
+		cfg80211_chandef_create(&wdev->wext.ibss.chandef, chan,
+					NL80211_CHAN_NO_HT);
 		wdev->wext.ibss.channel_fixed = true;
 	} else {
 		/* cfg80211_ibss_wext_join will pick one if needed */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3.12] cfg80211: fix ibss wext chandef creation
  2013-10-22 20:02 [PATCH 3.12] cfg80211: fix ibss wext chandef creation Simon Wunderlich
@ 2013-10-23  5:46 ` Dirk Gouders
  2013-10-28 14:21 ` Johannes Berg
  1 sibling, 0 replies; 5+ messages in thread
From: Dirk Gouders @ 2013-10-23  5:46 UTC (permalink / raw)
  To: Simon Wunderlich
  Cc: linux-wireless, Mathias Kretschmer, Linux Kernel, Johannes Berg

Simon Wunderlich <sw@simonwunderlich.de> writes:

> The wext internal chandefs for ibss should be created using the
> cfg80211_chandef_create() functions. Otherwise the center_freq1 field
> will not be set and cfg80211_chandef_valid() will spit a warning and
> report the chandef as invalid when it should be used.

Thanks a lot, Simon, I don't see anymore traces here.

Tested-by: Dirk Gouders <dirk@gouders.net>

> Reported-by: Dirk Gouders <dirk@gouders.net>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> Cc: Johannes Berg <johannes.berg@intel.com>
> ---
>  net/wireless/ibss.c |   15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
> index 39bff7d..a710019 100644
> --- a/net/wireless/ibss.c
> +++ b/net/wireless/ibss.c
> @@ -246,7 +246,7 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
>  
>  	/* try to find an IBSS channel if none requested ... */
>  	if (!wdev->wext.ibss.chandef.chan) {
> -		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
> +		struct ieee80211_channel *new_chan = NULL;
>  
>  		for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
>  			struct ieee80211_supported_band *sband;
> @@ -262,16 +262,19 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
>  					continue;
>  				if (chan->flags & IEEE80211_CHAN_DISABLED)
>  					continue;
> -				wdev->wext.ibss.chandef.chan = chan;
> +				new_chan = chan;
>  				break;
>  			}
>  
> -			if (wdev->wext.ibss.chandef.chan)
> +			if (new_chan)
>  				break;
>  		}
>  
> -		if (!wdev->wext.ibss.chandef.chan)
> +		if (!new_chan)
>  			return -EINVAL;
> +
> +		cfg80211_chandef_create(&wdev->wext.ibss.chandef, new_chan,
> +					NL80211_CHAN_NO_HT);
>  	}
>  
>  	/* don't join -- SSID is not there */
> @@ -345,8 +348,8 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
>  		return err;
>  
>  	if (chan) {
> -		wdev->wext.ibss.chandef.chan = chan;
> -		wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
> +		cfg80211_chandef_create(&wdev->wext.ibss.chandef, chan,
> +					NL80211_CHAN_NO_HT);
>  		wdev->wext.ibss.channel_fixed = true;
>  	} else {
>  		/* cfg80211_ibss_wext_join will pick one if needed */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3.12] cfg80211: fix ibss wext chandef creation
  2013-10-22 20:02 [PATCH 3.12] cfg80211: fix ibss wext chandef creation Simon Wunderlich
  2013-10-23  5:46 ` Dirk Gouders
@ 2013-10-28 14:21 ` Johannes Berg
  2013-10-28 17:05   ` Dirk Gouders
  2013-10-28 17:14   ` Dirk Gouders
  1 sibling, 2 replies; 5+ messages in thread
From: Johannes Berg @ 2013-10-28 14:21 UTC (permalink / raw)
  To: Simon Wunderlich
  Cc: linux-wireless, Mathias Kretschmer, Dirk Gouders, Linux Kernel

On Tue, 2013-10-22 at 22:02 +0200, Simon Wunderlich wrote:
> The wext internal chandefs for ibss should be created using the
> cfg80211_chandef_create() functions. Otherwise the center_freq1 field
> will not be set and cfg80211_chandef_valid() will spit a warning and
> report the chandef as invalid when it should be used.

I think

commit f478f33a93f9353dcd1fe55445343d76b1c3f84a
Author: Bruno Randolf <br1@einfach.org>
Date:   Thu Sep 26 16:55:28 2013 +0100

    cfg80211: fix warning when using WEXT for IBSS


already fixed this. Your patch doesn't apply, but feel free to send me a
new one (for -next) converting to the creation helpers.

johannes


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3.12] cfg80211: fix ibss wext chandef creation
  2013-10-28 14:21 ` Johannes Berg
@ 2013-10-28 17:05   ` Dirk Gouders
  2013-10-28 17:14   ` Dirk Gouders
  1 sibling, 0 replies; 5+ messages in thread
From: Dirk Gouders @ 2013-10-28 17:05 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Simon Wunderlich, linux-wireless, Mathias Kretschmer, Linux Kernel

Johannes Berg <johannes@sipsolutions.net> writes:

> On Tue, 2013-10-22 at 22:02 +0200, Simon Wunderlich wrote:
>> The wext internal chandefs for ibss should be created using the
>> cfg80211_chandef_create() functions. Otherwise the center_freq1 field
>> will not be set and cfg80211_chandef_valid() will spit a warning and
>> report the chandef as invalid when it should be used.
>
> I think
>
> commit f478f33a93f9353dcd1fe55445343d76b1c3f84a
> Author: Bruno Randolf <br1@einfach.org>
> Date:   Thu Sep 26 16:55:28 2013 +0100
>
>     cfg80211: fix warning when using WEXT for IBSS
>
>
> already fixed this. Your patch doesn't apply, but feel free to send me a
> new one (for -next) converting to the creation helpers.

I tested the above commit and it also fixes the problems I noticed here.

Dirk

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 3.12] cfg80211: fix ibss wext chandef creation
  2013-10-28 14:21 ` Johannes Berg
  2013-10-28 17:05   ` Dirk Gouders
@ 2013-10-28 17:14   ` Dirk Gouders
  1 sibling, 0 replies; 5+ messages in thread
From: Dirk Gouders @ 2013-10-28 17:14 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Simon Wunderlich, linux-wireless, Mathias Kretschmer, Linux Kernel

Johannes Berg <johannes@sipsolutions.net> writes:

> On Tue, 2013-10-22 at 22:02 +0200, Simon Wunderlich wrote:
>> The wext internal chandefs for ibss should be created using the
>> cfg80211_chandef_create() functions. Otherwise the center_freq1 field
>> will not be set and cfg80211_chandef_valid() will spit a warning and
>> report the chandef as invalid when it should be used.
>
> I think
>
> commit f478f33a93f9353dcd1fe55445343d76b1c3f84a
> Author: Bruno Randolf <br1@einfach.org>
> Date:   Thu Sep 26 16:55:28 2013 +0100
>
>     cfg80211: fix warning when using WEXT for IBSS
>
>
> already fixed this. Your patch doesn't apply, but feel free to send me a
> new one (for -next) converting to the creation helpers.

I tested the above commit and it also fixes the problems I noticed here.

Best regards,

Dirk

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-28 17:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-22 20:02 [PATCH 3.12] cfg80211: fix ibss wext chandef creation Simon Wunderlich
2013-10-23  5:46 ` Dirk Gouders
2013-10-28 14:21 ` Johannes Berg
2013-10-28 17:05   ` Dirk Gouders
2013-10-28 17:14   ` Dirk Gouders

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).