diff mbox

RFC: patch to support 5Mhz and 10Mhz widths.

Message ID 573793D2.1060408@candelatech.com
State Not Applicable
Headers show

Commit Message

Ben Greear May 14, 2016, 9:08 p.m. UTC
I'm giving up on this for now, but the patches I was trying
are attached in case someone else wants to try it someday.

It compiles now, but AP won't start...I have no idea why.

Thanks,
Ben

On 05/14/2016 09:18 AM, Ben Greear wrote:
>
>
> On 05/14/2016 07:13 AM, Jouni Malinen wrote:
>> On Sat, May 14, 2016 at 06:38:23AM -0700, Ben Greear wrote:
>>> This patch does not compile....looks like I have to pass chwidth into a lot
>>> more places.  But, I'm curious if anyone has any opinions on whether this is
>>> even remotely the right way to go about doing this?
>>
>> What is your use case for this? 5 and 10 MHz channel widths are not
>> really used very commonly today and only in quite special use cases..
>
> Seems they are used in the 4.9Ghz band, at least.  That is what my user
> is interested in...
>
> Thanks,
> Ben
>
diff mbox

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 506c9f3..98d5f53 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1973,6 +1973,14 @@  static int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
 			       chantype);
 			return -EINVAL;
 		}
+
+		if (info->attrs[NL80211_ATTR_CHANNEL_WIDTH]) {
+			chandef->width =
+				nla_get_u32(info->attrs[NL80211_ATTR_CHANNEL_WIDTH]);
+		}
+		pr_err("parse-chandef, ctype:  width: %d addr-cwidth: %p\n",
+		       chandef->width, info->attrs[NL80211_ATTR_CHANNEL_WIDTH]);
+		WARN_ON(chandef->width == 0);
 	} else if (info->attrs[NL80211_ATTR_CHANNEL_WIDTH]) {
 		chandef->width =
 			nla_get_u32(info->attrs[NL80211_ATTR_CHANNEL_WIDTH]);
@@ -1986,6 +1994,9 @@  static int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
 					info->attrs[NL80211_ATTR_CENTER_FREQ2]);
 	}
 
+	pr_err("parse-chandef:  width: %d addr-cwidth: %p\n",
+	       chandef->width, info->attrs[NL80211_ATTR_CHANNEL_WIDTH]);
+
 	if (!cfg80211_chandef_valid(chandef)) {
 		pr_err("parse-chandef:  chandef is not valid\n");
 		return -EINVAL;