* [PATCH 3/3] ath: fix dynamic user regulatory domain support
From: Luis R. Rodriguez @ 2013-10-29 22:39 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1383086346-2096-1-git-send-email-mcgrof@do-not-panic.com>
As it stands dynamic user regulatory domain support is
only possible for a few programmed regulatory domains as
a few countries do not allow for this.
The existing code however only would take advantage of
the feature if a custom world regulatory domain is used
though as that's when we clear beconing flags. We need
to lift this restriction as otherwise this feature is
pointless.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/regd.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 5790aa2..b2c5e41 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -296,6 +296,7 @@ static void ath_force_no_ir_freq(struct wiphy *wiphy, u16 center_freq)
static void
__ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
+ struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator,
struct ieee80211_channel *ch)
{
@@ -307,6 +308,9 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
ath_force_clear_no_ir_chan(wiphy, ch);
break;
+ case NL80211_REGDOM_SET_BY_USER:
+ if (ath_reg_dyn_country_user_allow(reg))
+ ath_force_clear_no_ir_chan(wiphy, ch);
default:
if (ch->beacon_found)
ch->flags &= ~IEEE80211_CHAN_NO_IR;
@@ -322,6 +326,7 @@ __ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
*/
static void
ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
+ struct ath_regulatory *reg,
enum nl80211_reg_initiator initiator)
{
enum ieee80211_band band;
@@ -335,8 +340,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
sband = wiphy->bands[band];
for (i = 0; i < sband->n_channels; i++) {
ch = &sband->channels[i];
- __ath_reg_apply_beaconing_flags(wiphy, initiator, ch);
-
+ __ath_reg_apply_beaconing_flags(wiphy, reg,
+ initiator, ch);
}
}
}
@@ -357,7 +362,8 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
*/
static void
ath_reg_apply_ir_flags(struct wiphy *wiphy,
- enum nl80211_reg_initiator initiator)
+ struct ath_regulatory *reg,
+ enum nl80211_reg_initiator initiator)
{
struct ieee80211_supported_band *sband;
@@ -370,6 +376,11 @@ ath_reg_apply_ir_flags(struct wiphy *wiphy,
ath_force_clear_no_ir_freq(wiphy, 2467);
ath_force_clear_no_ir_freq(wiphy, 2472);
break;
+ case NL80211_REGDOM_SET_BY_USER:
+ if (!ath_reg_dyn_country_user_allow(reg))
+ break;
+ ath_force_clear_no_ir_freq(wiphy, 2467);
+ ath_force_clear_no_ir_freq(wiphy, 2472);
default:
ath_force_no_ir_freq(wiphy, 2467);
ath_force_no_ir_freq(wiphy, 2472);
@@ -418,12 +429,15 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy,
case 0x66:
case 0x67:
case 0x6C:
- ath_reg_apply_beaconing_flags(wiphy, initiator);
+ ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
break;
case 0x68:
- ath_reg_apply_beaconing_flags(wiphy, initiator);
- ath_reg_apply_ir_flags(wiphy, initiator);
+ ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
+ ath_reg_apply_ir_flags(wiphy, reg, initiator);
break;
+ default:
+ if (ath_reg_dyn_country_user_allow(reg))
+ ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
}
}
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 2/3] ath: dynamic user allow check helper to the top
From: Luis R. Rodriguez @ 2013-10-29 22:39 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1383086346-2096-1-git-send-email-mcgrof@do-not-panic.com>
This will be used later.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/regd.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index e27027c..5790aa2 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -185,6 +185,15 @@ static bool dynamic_country_user_possible(struct ath_regulatory *reg)
return true;
}
+static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
+{
+ if (!config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS))
+ return false;
+ if (!dynamic_country_user_possible(reg))
+ return false;
+ return true;
+}
+
static inline bool is_wwr_sku(u16 regd)
{
return ((regd & COUNTRY_ERD_FLAG) != COUNTRY_ERD_FLAG) &&
@@ -466,17 +475,6 @@ static void ath_reg_dyn_country(struct wiphy *wiphy,
reg_initiator_name(request->initiator));
}
-static void ath_reg_dyn_country_user(struct wiphy *wiphy,
- struct ath_regulatory *reg,
- struct regulatory_request *request)
-{
- if (!config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS))
- return;
- if (!dynamic_country_user_possible(reg))
- return;
- ath_reg_dyn_country(wiphy, reg, request);
-}
-
void ath_reg_notifier_apply(struct wiphy *wiphy,
struct regulatory_request *request,
struct ath_regulatory *reg)
@@ -509,7 +507,8 @@ void ath_reg_notifier_apply(struct wiphy *wiphy,
case NL80211_REGDOM_SET_BY_DRIVER:
break;
case NL80211_REGDOM_SET_BY_USER:
- ath_reg_dyn_country_user(wiphy, reg, request);
+ if (ath_reg_dyn_country_user_allow(reg))
+ ath_reg_dyn_country(wiphy, reg, request);
break;
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
ath_reg_dyn_country(wiphy, reg, request);
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 1/3] ath: move dynamic_country_user_possible() to the top
From: Luis R. Rodriguez @ 2013-10-29 22:39 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
In-Reply-To: <1383086346-2096-1-git-send-email-mcgrof@do-not-panic.com>
This will be used later.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/regd.c | 144 ++++++++++++++++++++--------------------
1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index bc9ba78..e27027c 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -113,6 +113,78 @@ static const struct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = {
}
};
+static bool dynamic_country_user_possible(struct ath_regulatory *reg)
+{
+ if (config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
+ return true;
+
+ switch (reg->country_code) {
+ case CTRY_UNITED_STATES:
+ case CTRY_JAPAN1:
+ case CTRY_JAPAN2:
+ case CTRY_JAPAN3:
+ case CTRY_JAPAN4:
+ case CTRY_JAPAN5:
+ case CTRY_JAPAN6:
+ case CTRY_JAPAN7:
+ case CTRY_JAPAN8:
+ case CTRY_JAPAN9:
+ case CTRY_JAPAN10:
+ case CTRY_JAPAN11:
+ case CTRY_JAPAN12:
+ case CTRY_JAPAN13:
+ case CTRY_JAPAN14:
+ case CTRY_JAPAN15:
+ case CTRY_JAPAN16:
+ case CTRY_JAPAN17:
+ case CTRY_JAPAN18:
+ case CTRY_JAPAN19:
+ case CTRY_JAPAN20:
+ case CTRY_JAPAN21:
+ case CTRY_JAPAN22:
+ case CTRY_JAPAN23:
+ case CTRY_JAPAN24:
+ case CTRY_JAPAN25:
+ case CTRY_JAPAN26:
+ case CTRY_JAPAN27:
+ case CTRY_JAPAN28:
+ case CTRY_JAPAN29:
+ case CTRY_JAPAN30:
+ case CTRY_JAPAN31:
+ case CTRY_JAPAN32:
+ case CTRY_JAPAN33:
+ case CTRY_JAPAN34:
+ case CTRY_JAPAN35:
+ case CTRY_JAPAN36:
+ case CTRY_JAPAN37:
+ case CTRY_JAPAN38:
+ case CTRY_JAPAN39:
+ case CTRY_JAPAN40:
+ case CTRY_JAPAN41:
+ case CTRY_JAPAN42:
+ case CTRY_JAPAN43:
+ case CTRY_JAPAN44:
+ case CTRY_JAPAN45:
+ case CTRY_JAPAN46:
+ case CTRY_JAPAN47:
+ case CTRY_JAPAN48:
+ case CTRY_JAPAN49:
+ case CTRY_JAPAN50:
+ case CTRY_JAPAN51:
+ case CTRY_JAPAN52:
+ case CTRY_JAPAN53:
+ case CTRY_JAPAN54:
+ case CTRY_JAPAN55:
+ case CTRY_JAPAN56:
+ case CTRY_JAPAN57:
+ case CTRY_JAPAN58:
+ case CTRY_JAPAN59:
+ return false;
+ }
+
+ return true;
+}
+
static inline bool is_wwr_sku(u16 regd)
{
return ((regd & COUNTRY_ERD_FLAG) != COUNTRY_ERD_FLAG) &&
@@ -394,78 +466,6 @@ static void ath_reg_dyn_country(struct wiphy *wiphy,
reg_initiator_name(request->initiator));
}
-static bool dynamic_country_user_possible(struct ath_regulatory *reg)
-{
- if (config_enabled(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
- return true;
-
- switch (reg->country_code) {
- case CTRY_UNITED_STATES:
- case CTRY_JAPAN1:
- case CTRY_JAPAN2:
- case CTRY_JAPAN3:
- case CTRY_JAPAN4:
- case CTRY_JAPAN5:
- case CTRY_JAPAN6:
- case CTRY_JAPAN7:
- case CTRY_JAPAN8:
- case CTRY_JAPAN9:
- case CTRY_JAPAN10:
- case CTRY_JAPAN11:
- case CTRY_JAPAN12:
- case CTRY_JAPAN13:
- case CTRY_JAPAN14:
- case CTRY_JAPAN15:
- case CTRY_JAPAN16:
- case CTRY_JAPAN17:
- case CTRY_JAPAN18:
- case CTRY_JAPAN19:
- case CTRY_JAPAN20:
- case CTRY_JAPAN21:
- case CTRY_JAPAN22:
- case CTRY_JAPAN23:
- case CTRY_JAPAN24:
- case CTRY_JAPAN25:
- case CTRY_JAPAN26:
- case CTRY_JAPAN27:
- case CTRY_JAPAN28:
- case CTRY_JAPAN29:
- case CTRY_JAPAN30:
- case CTRY_JAPAN31:
- case CTRY_JAPAN32:
- case CTRY_JAPAN33:
- case CTRY_JAPAN34:
- case CTRY_JAPAN35:
- case CTRY_JAPAN36:
- case CTRY_JAPAN37:
- case CTRY_JAPAN38:
- case CTRY_JAPAN39:
- case CTRY_JAPAN40:
- case CTRY_JAPAN41:
- case CTRY_JAPAN42:
- case CTRY_JAPAN43:
- case CTRY_JAPAN44:
- case CTRY_JAPAN45:
- case CTRY_JAPAN46:
- case CTRY_JAPAN47:
- case CTRY_JAPAN48:
- case CTRY_JAPAN49:
- case CTRY_JAPAN50:
- case CTRY_JAPAN51:
- case CTRY_JAPAN52:
- case CTRY_JAPAN53:
- case CTRY_JAPAN54:
- case CTRY_JAPAN55:
- case CTRY_JAPAN56:
- case CTRY_JAPAN57:
- case CTRY_JAPAN58:
- case CTRY_JAPAN59:
- return false;
- }
-
- return true;
-}
-
static void ath_reg_dyn_country_user(struct wiphy *wiphy,
struct ath_regulatory *reg,
struct regulatory_request *request)
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 0/3] ath: a few enhancements for dynamic user selection
From: Luis R. Rodriguez @ 2013-10-29 22:39 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
John, Johannes,
here's a few enhancements for the dynamic user selection stuff.
I think this will depend on application on the no-ir flag patches
so not sure what route to go.
Luis R. Rodriguez (3):
ath: move dynamic_country_user_possible() to the top
ath: dynamic user allow check helper to the top
ath: fix dynamic user regulatory domain support
drivers/net/wireless/ath/regd.c | 193 +++++++++++++++++++++-------------------
1 file changed, 103 insertions(+), 90 deletions(-)
--
1.8.4.rc3
^ permalink raw reply
* [PATCH] Revert "mac80211: allow disable power save in mesh"
From: Bob Copeland @ 2013-10-29 22:11 UTC (permalink / raw)
To: johannes, Chun-Yeow Yeoh; +Cc: linux-wireless, Bob Copeland
This reverts commit ee1f668136b2fb6640ee2d54c2a525ea41f98211.
The aformentioned commit added a check to allow
'iw wlan0 set power_save off' to work for mesh interfaces.
However, this is problematic because it also allows
'iw wlan0 set power_save on', which will crash in short order
because all of the subsequent code manipulates sdata->u.mgd.
The power-saving states for mesh interfaces can be manipulated
through the mesh config, e.g:
'iw wlan0 set mesh_param mesh_power_save=active' (which,
despite the name, actualy disables power saving since the
setting refers to the type of sleep the interface undergoes).
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
Chun-Yeow, I ran into the above mentioned crash when playing with
mesh PS. Can you clarify how the original patch helped?
net/mac80211/cfg.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ed1e9a8..478211c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2488,8 +2488,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- if (sdata->vif.type != NL80211_IFTYPE_STATION &&
- sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
+ if (sdata->vif.type != NL80211_IFTYPE_STATION)
return -EOPNOTSUPP;
if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
--
1.7.10.4
^ permalink raw reply related
* [ANN] backports stable releases based on kernel 3.10.17, 3.11.6 and 3.12-rc7 released
From: Hauke Mehrtens @ 2013-10-29 22:08 UTC (permalink / raw)
To: backports@vger.kernel.org, linux-wireless@vger.kernel.org,
linux-kernel
In-Reply-To: <526D6A5E.5000100@hauke-m.de>
As promised, here are the backports releases based on recent stable
kernel versions.
Based on 3.10.17:
https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.10.17/backports-3.10.17-2.tar.bz2
Based on 3.11.6:
https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.11.6/backports-3.11.6-1.tar.bz2
Based on 3.12-rc7:
https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.12-rc7/backports-3.12-rc7-1.tar.bz2
The source code can temporary be found here:
https://github.com/hauke/backports
More information can be found in our wiki:
https://backports.wiki.kernel.org/index.php/Main_Page
Hauke
^ permalink raw reply
* [PATCH NEXT] rtl8187: Increase RX queue depth
From: Larry Finger @ 2013-10-29 22:06 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Larry Finger, netdev
Under heavy load, the relatively small number of RX queue entries are
completely filled. With an increase from 16 to 32 entries, this condition
rarely happens.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtl818x/rtl8187/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 9a6edb0..ec9aa5b 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -416,7 +416,7 @@ static int rtl8187_init_urbs(struct ieee80211_hw *dev)
struct rtl8187_rx_info *info;
int ret = 0;
- while (skb_queue_len(&priv->rx_queue) < 16) {
+ while (skb_queue_len(&priv->rx_queue) < 32) {
skb = __dev_alloc_skb(RTL8187_MAX_RX, GFP_KERNEL);
if (!skb) {
ret = -ENOMEM;
--
1.8.4
^ permalink raw reply related
* Re: [PATCH NEXT] rtlwifi: Fix endian error in extracting packet type
From: Larry Finger @ 2013-10-29 20:16 UTC (permalink / raw)
To: Bjørn Mork, Ben Hutchings
Cc: linville, linux-wireless, Mark Cave-Ayland, netdev, Stable
In-Reply-To: <87y55cf8yq.fsf@nemi.mork.no>
On 10/29/2013 09:27 AM, Bjørn Mork wrote:
>
> It's not validating the upper 8 bits of the port numbers either, so it
> will hit random UDP traffic in addition to DHCP.
>
> But it was good to see this function now. I was wondering how to support
> some buggy 3G modem firmware without ugly hacks. Seems there will always
> be worse hacks in drivers/net, no matter what I do :-)
I'm happy that Realtek and I could make your day. The next version is checking
the full 16-bit port numbers.
Thanks,
Larry
^ permalink raw reply
* Re: [patch] libertas: potential oops in debugfs
From: Dan Carpenter @ 2013-10-29 20:09 UTC (permalink / raw)
To: John W. Linville
Cc: libertas-dev, linux-wireless, netdev, security, Nico Golde,
Fabian Yamaguchi
In-Reply-To: <20131029190641.GB21820@longonot.mountain>
On Tue, Oct 29, 2013 at 10:06:41PM +0300, Dan Carpenter wrote:
> If we do a zero size write then it will oops. This can only be
> triggered by root.
>
This one isn't right... Sorry for that. We do need to fix the while
loop. I wasn't thinking.
I will resend.
regards,
dan carpenter
^ permalink raw reply
* [patch] libertas: potential oops in debugfs
From: Dan Carpenter @ 2013-10-29 19:06 UTC (permalink / raw)
To: John W. Linville
Cc: libertas-dev, linux-wireless, netdev, security, Nico Golde,
Fabian Yamaguchi
In-Reply-To: <20131025144452.GA28451@ngolde.de>
If we do a zero size write then it will oops. This can only be
triggered by root.
Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 668dd27..a148f14 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -913,6 +913,9 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
char *p2;
struct debug_data *d = f->private_data;
+ if (cnt == 0)
+ return 0;
+
pdata = kmalloc(cnt, GFP_KERNEL);
if (pdata == NULL)
return 0;
^ permalink raw reply related
* Re: [PATCH 3/3] rtlwifi: fix usage of freq_reg_info()
From: Larry Finger @ 2013-10-29 18:56 UTC (permalink / raw)
To: Luis R. Rodriguez, linville, johannes
Cc: linux-wireless, Julia Lawall, Peter Senna Tschudin
In-Reply-To: <1383071666-26817-4-git-send-email-mcgrof@do-not-panic.com>
On 10/29/2013 01:34 PM, Luis R. Rodriguez wrote:
> freq_reg_info() expects KHz and not MHz, fix this. In
> this case we'll now be getting the no-ir flags cleared
> on channels for any channel when the country IE trusts
> that channel.
>
> @@
> struct ieee80211_channel *ch;
> struct wiphy *wiphy;
> const struct ieee80211_reg_rule *rule;
> @@
>
> -rule = freq_reg_info(wiphy, ch->center_freq);
> +rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
>
> Generated-by: Coccinelle SmPL
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Cc: Peter Senna Tschudin <peter.senna@gmail.com>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
> ---
This patch got some fuzz on my system in hunks 2 & 3 and failed "git am". With
patch, it yielded correct code despite the fuzz.
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Larry
> drivers/net/wireless/rtlwifi/regd.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c
> index 2e1642c..29d2813 100644
> --- a/drivers/net/wireless/rtlwifi/regd.c
> +++ b/drivers/net/wireless/rtlwifi/regd.c
> @@ -169,7 +169,8 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy,
> (ch->flags & IEEE80211_CHAN_RADAR))
> continue;
> if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
> - reg_rule = freq_reg_info(wiphy, ch->center_freq);
> + reg_rule = freq_reg_info(wiphy,
> + MHZ_TO_KHZ(ch->center_freq));
> if (IS_ERR(reg_rule))
> continue;
>
> @@ -228,7 +229,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
> */
>
> ch = &sband->channels[11]; /* CH 12 */
> - reg_rule = freq_reg_info(wiphy, ch->center_freq);
> + reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
> if (!IS_ERR(reg_rule)) {
> if (!(reg_rule->flags & NL80211_RRF_NO_IR))
> if (ch->flags & IEEE80211_CHAN_NO_IR)
> @@ -236,7 +237,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
> }
>
> ch = &sband->channels[12]; /* CH 13 */
> - reg_rule = freq_reg_info(wiphy, ch->center_freq);
> + reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
> if (!IS_ERR(reg_rule)) {
> if (!(reg_rule->flags & NL80211_RRF_NO_IR))
> if (ch->flags & IEEE80211_CHAN_NO_IR)
>
^ permalink raw reply
* Re: [PATCH 2/5] ath: clean up ath_reg_apply_active_scan_flags()
From: Luis R. Rodriguez @ 2013-10-29 18:34 UTC (permalink / raw)
To: Shete, Mihir
Cc: linville@tuxdriver.com, johannes@sipsolutions.net,
linux-wireless@vger.kernel.org, janusz.dziedzic@tieto.com,
Bhattacharyya, Tushnim, Julia Lawall, Peter Senna Tschudin
In-Reply-To: <5311DA48427A8F44AF96B64A3AF0074D06DCDF69@aphydexd01a>
On Tue, Oct 29, 2013 at 5:19 PM, Shete, Mihir <smihir@qti.qualcomm.com> wrote:
>
>
>> -----Original Message-----
>> From: Luis R. Rodriguez [mailto:mcgrof@gmail.com] On Behalf Of Luis R.
>> Rodriguez
>> Sent: Monday, October 21, 2013 10:45 PM
>> To: linville@tuxdriver.com; johannes@sipsolutions.net
>> Cc: linux-wireless@vger.kernel.org; janusz.dziedzic@tieto.com; Shete, Mihir;
>> Bhattacharyya, Tushnim; Luis R. Rodriguez
>> Subject: [PATCH 2/5] ath: clean up ath_reg_apply_active_scan_flags()
>>
>> The routine ath_reg_apply_active_scan_flags() can be a bit hard to read, this
>> cleans it up by adding helpers for the two cases of clearing IR flags or adding
>> them. This approach also makes no assumptions on the index of channels 12
>> and 13 so it should be portable accross different drivers.
>>
>> Cc: smihir@qti.qualcomm.com
>> Cc: tushnimb@qca.qualcomm.com
>> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
>> ---
>> drivers/net/wireless/ath/regd.c | 101 +++++++++++++++++++++++++-------
>> --------
>> 1 file changed, 63 insertions(+), 38 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/regd.c
>> b/drivers/net/wireless/ath/regd.c index 1b4a532..48e2368 100644
>> --- a/drivers/net/wireless/ath/regd.c
>> +++ b/drivers/net/wireless/ath/regd.c
>> @@ -177,6 +177,47 @@ static bool ath_is_radar_freq(u16 center_freq)
>> return (center_freq >= 5260 && center_freq <= 5700); }
>>
>> +static void ath_force_clear_no_ir_chan(struct wiphy *wiphy,
>> + struct ieee80211_channel *ch) {
>> + const struct ieee80211_reg_rule *reg_rule;
>> +
>> + reg_rule = freq_reg_info(wiphy, ch->center_freq);
>
> Do we not require to provide the frequency in KHZ here?
Good catch! This has been beautifully broken for eons. And guess, what
all those other drivers that copied the code also have this broken.
I'll just send a follow up patch to fix this on top of this patch for
each driver as they're all broken. In a way this seems to be begging
to just share a reg_notifier between drivers as a few drivers copied
the same behaviour from ath9k.
Luis
^ permalink raw reply
* [PATCH 3/3] rtlwifi: fix usage of freq_reg_info()
From: Luis R. Rodriguez @ 2013-10-29 18:34 UTC (permalink / raw)
To: linville, johannes
Cc: linux-wireless, Luis R. Rodriguez, Julia Lawall,
Peter Senna Tschudin, Larry Finger
In-Reply-To: <1383071666-26817-1-git-send-email-mcgrof@do-not-panic.com>
freq_reg_info() expects KHz and not MHz, fix this. In
this case we'll now be getting the no-ir flags cleared
on channels for any channel when the country IE trusts
that channel.
@@
struct ieee80211_channel *ch;
struct wiphy *wiphy;
const struct ieee80211_reg_rule *rule;
@@
-rule = freq_reg_info(wiphy, ch->center_freq);
+rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
Generated-by: Coccinelle SmPL
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/rtlwifi/regd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c
index 2e1642c..29d2813 100644
--- a/drivers/net/wireless/rtlwifi/regd.c
+++ b/drivers/net/wireless/rtlwifi/regd.c
@@ -169,7 +169,8 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy,
(ch->flags & IEEE80211_CHAN_RADAR))
continue;
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
- reg_rule = freq_reg_info(wiphy, ch->center_freq);
+ reg_rule = freq_reg_info(wiphy,
+ MHZ_TO_KHZ(ch->center_freq));
if (IS_ERR(reg_rule))
continue;
@@ -228,7 +229,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
*/
ch = &sband->channels[11]; /* CH 12 */
- reg_rule = freq_reg_info(wiphy, ch->center_freq);
+ reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
if (!IS_ERR(reg_rule)) {
if (!(reg_rule->flags & NL80211_RRF_NO_IR))
if (ch->flags & IEEE80211_CHAN_NO_IR)
@@ -236,7 +237,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
}
ch = &sband->channels[12]; /* CH 13 */
- reg_rule = freq_reg_info(wiphy, ch->center_freq);
+ reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
if (!IS_ERR(reg_rule)) {
if (!(reg_rule->flags & NL80211_RRF_NO_IR))
if (ch->flags & IEEE80211_CHAN_NO_IR)
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 2/3] brcm80211: fix usage of freq_reg_info()
From: Luis R. Rodriguez @ 2013-10-29 18:34 UTC (permalink / raw)
To: linville, johannes
Cc: linux-wireless, Luis R. Rodriguez, Julia Lawall,
Peter Senna Tschudin, Seth Forshee, Arend van Spriel
In-Reply-To: <1383071666-26817-1-git-send-email-mcgrof@do-not-panic.com>
freq_reg_info() expects KHz and not MHz, fix this. In
this case we'll now be getting the no-ir flags cleared
on channels for any channel when the country IE trusts
that channel.
@@
struct ieee80211_channel *ch;
struct wiphy *wiphy;
const struct ieee80211_reg_rule *rule;
@@
-rule = freq_reg_info(wiphy, ch->center_freq);
+rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
Generated-by: Coccinelle SmPL
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Seth Forshee <seth.forshee@canonical.com>
Cc: Arend van Spriel <arend@broadcom.com>
Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/brcm80211/brcmsmac/channel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index c99364f..8272570 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
@@ -678,7 +678,8 @@ brcms_reg_apply_beaconing_flags(struct wiphy *wiphy,
continue;
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
- rule = freq_reg_info(wiphy, ch->center_freq);
+ rule = freq_reg_info(wiphy,
+ MHZ_TO_KHZ(ch->center_freq));
if (IS_ERR(rule))
continue;
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 1/3] ath: fix usage of freq_reg_info()
From: Luis R. Rodriguez @ 2013-10-29 18:34 UTC (permalink / raw)
To: linville, johannes
Cc: linux-wireless, Luis R. Rodriguez, Julia Lawall,
Peter Senna Tschudin
In-Reply-To: <1383071666-26817-1-git-send-email-mcgrof@do-not-panic.com>
freq_reg_info() expects KHz and not MHz, fix this. In
this case we'll now be getting the no-ir flags cleared
on channels for any channel when the country IE trusts
that channel.
@@
struct ieee80211_channel *ch;
struct wiphy *wiphy;
const struct ieee80211_reg_rule *rule;
@@
-rule = freq_reg_info(wiphy, ch->center_freq);
+rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
Generated-by: Coccinelle SmPL
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
drivers/net/wireless/ath/regd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index a258283..bc9ba78 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -182,7 +182,7 @@ static void ath_force_clear_no_ir_chan(struct wiphy *wiphy,
{
const struct ieee80211_reg_rule *reg_rule;
- reg_rule = freq_reg_info(wiphy, ch->center_freq);
+ reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
if (IS_ERR(reg_rule))
return;
--
1.8.4.rc3
^ permalink raw reply related
* [PATCH 0/3] wireless: fix usage of freq_reg_info()
From: Luis R. Rodriguez @ 2013-10-29 18:34 UTC (permalink / raw)
To: linville, johannes; +Cc: linux-wireless, Luis R. Rodriguez
Mihir reported freq_reg_info() was being used incorrectly on
ath/regd.c, I spotted this was true for years, and given that
a few vendors copied the same behaviour it meant other drivers
also had this broken. This fixes this issue accross 3 drivers.
These patches depend on the no-ir patches, and depending
on what tree that goes in this may be desirable to be merged
there.
The fix is represented with the Coccinelle SmPL grammar:
@@
struct ieee80211_channel *ch;
struct wiphy *wiphy;
const struct ieee80211_reg_rule *rule;
@@
-rule = freq_reg_info(wiphy, ch->center_freq);
+rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));
Luis R. Rodriguez (3):
ath: fix usage of freq_reg_info()
brcm80211: fix usage of freq_reg_info()
rtlwifi: fix usage of freq_reg_info()
drivers/net/wireless/ath/regd.c | 2 +-
drivers/net/wireless/brcm80211/brcmsmac/channel.c | 3 ++-
drivers/net/wireless/rtlwifi/regd.c | 7 ++++---
3 files changed, 7 insertions(+), 5 deletions(-)
--
1.8.4.rc3
^ permalink raw reply
* Re: [PATCH 1/3] ath10k: add phyerr/dfs handling
From: Joe Perches @ 2013-10-29 17:25 UTC (permalink / raw)
To: Marek Puzyniak; +Cc: ath10k, linux-wireless, Janusz Dziedzic
In-Reply-To: <1383048394-15256-1-git-send-email-marek.puzyniak@tieto.com>
On Tue, 2013-10-29 at 13:06 +0100, Marek Puzyniak wrote:
> Handle phyerr, dfs event, radar_report and fft_report.
> Add also debugfs dfs_simulate_radar and dfs_stats files.
> Use ath dfs pattern detector.
Just some simple notes:
> diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
[]
> +#define ATH10K_DFS_STAT(s, p) (\
> + len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
> + ar->debug.dfs_stats.p))
> +
> +#define ATH10K_DFS_POOL_STAT(s, p) (\
> + len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
> + ar->debug.dfs_pool_stats.p))
You've already got sizes for the description field
might as well use %-28s
> +static ssize_t ath10k_read_file_dfs(struct file *file, char __user *user_buf,
> + size_t count, loff_t *ppos)
> +{
> + int retval = 0, size = 8000, len = 0;
size should either be a #define or a const
[]
> + len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
> + ATH10K_DFS_STAT("reported phy errors ", phy_errors);
> + ATH10K_DFS_STAT("pulse events reported ", pulses_total);
> + ATH10K_DFS_STAT("DFS pulses detected ", pulses_detected);
> + ATH10K_DFS_STAT("DFS pulses discarded ", pulses_discarded);
> + ATH10K_DFS_STAT("Radars detected ", radar_detected);
> +
> + len += scnprintf(buf + len, size - len, "Global Pool statistics:\n");
> + ATH10K_DFS_POOL_STAT("Pool references ", pool_reference);
> + ATH10K_DFS_POOL_STAT("Pulses allocated ", pulse_allocated);
> + ATH10K_DFS_POOL_STAT("Pulses alloc error ", pulse_alloc_error);
> + ATH10K_DFS_POOL_STAT("Pulses in use ", pulse_used);
> + ATH10K_DFS_POOL_STAT("Seqs. allocated ", pseq_allocated);
> + ATH10K_DFS_POOL_STAT("Seqs. alloc error ", pseq_alloc_error);
> + ATH10K_DFS_POOL_STAT("Seqs. in use ", pseq_used);
If using %-28s, the trailing quoted spaces can be removed.
^ permalink raw reply
* RE: [PATCH 2/5] ath: clean up ath_reg_apply_active_scan_flags()
From: Shete, Mihir @ 2013-10-29 16:19 UTC (permalink / raw)
To: Luis R. Rodriguez, linville@tuxdriver.com,
johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, janusz.dziedzic@tieto.com,
Bhattacharyya, Tushnim
In-Reply-To: <1382375691-25476-3-git-send-email-mcgrof@do-not-panic.com>
> -----Original Message-----
> From: Luis R. Rodriguez [mailto:mcgrof@gmail.com] On Behalf Of Luis R.
> Rodriguez
> Sent: Monday, October 21, 2013 10:45 PM
> To: linville@tuxdriver.com; johannes@sipsolutions.net
> Cc: linux-wireless@vger.kernel.org; janusz.dziedzic@tieto.com; Shete, Mihir;
> Bhattacharyya, Tushnim; Luis R. Rodriguez
> Subject: [PATCH 2/5] ath: clean up ath_reg_apply_active_scan_flags()
>
> The routine ath_reg_apply_active_scan_flags() can be a bit hard to read, this
> cleans it up by adding helpers for the two cases of clearing IR flags or adding
> them. This approach also makes no assumptions on the index of channels 12
> and 13 so it should be portable accross different drivers.
>
> Cc: smihir@qti.qualcomm.com
> Cc: tushnimb@qca.qualcomm.com
> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
> ---
> drivers/net/wireless/ath/regd.c | 101 +++++++++++++++++++++++++-------
> --------
> 1 file changed, 63 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/regd.c
> b/drivers/net/wireless/ath/regd.c index 1b4a532..48e2368 100644
> --- a/drivers/net/wireless/ath/regd.c
> +++ b/drivers/net/wireless/ath/regd.c
> @@ -177,6 +177,47 @@ static bool ath_is_radar_freq(u16 center_freq)
> return (center_freq >= 5260 && center_freq <= 5700); }
>
> +static void ath_force_clear_no_ir_chan(struct wiphy *wiphy,
> + struct ieee80211_channel *ch) {
> + const struct ieee80211_reg_rule *reg_rule;
> +
> + reg_rule = freq_reg_info(wiphy, ch->center_freq);
Do we not require to provide the frequency in KHZ here?
^ permalink raw reply
* Re: [PATCH NEXT] rtlwifi: Fix endian error in extracting packet type
From: Bjørn Mork @ 2013-10-29 14:27 UTC (permalink / raw)
To: Ben Hutchings
Cc: Larry Finger, linville, linux-wireless, Mark Cave-Ayland, netdev,
Stable
In-Reply-To: <1383005246.3779.61.camel@bwh-desktop.uk.level5networks.com>
Ben Hutchings <bhutchings@solarflare.com> writes:
>> @@ -1077,8 +1077,8 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
>>
>> ip = (struct iphdr *)((u8 *) skb->data + mac_hdr_len +
>> SNAP_SIZE + PROTOC_TYPE_SIZE);
>> - ether_type = *(u16 *) ((u8 *) skb->data + mac_hdr_len + SNAP_SIZE);
>> - /* ether_type = ntohs(ether_type); */
>> + ether_type = be16_to_cpu(*(__be16 *)((u8 *)skb->data + mac_hdr_len +
>> + SNAP_SIZE));
>>
>> if (ETH_P_IP == ether_type) {
>> if (IPPROTO_UDP == ip->protocol) {
>
> This crazy function also says that *all* IPv6 frames are special, which
> apparently means that on TX they should get sent at the lowest possible
> bit rate. So I think this is going to cause a regression for IPv6
> throughput unless you remove that case.
>
> The DHCP case is also not validating IP and UDP header lengths against
> the packet length, though this may be harmless in practice.
It's not validating the upper 8 bits of the port numbers either, so it
will hit random UDP traffic in addition to DHCP.
But it was good to see this function now. I was wondering how to support
some buggy 3G modem firmware without ugly hacks. Seems there will always
be worse hacks in drivers/net, no matter what I do :-)
Bjørn
^ permalink raw reply
* Re: I always need a miracle to connect with iwlwifi
From: Krishna Chaitanya @ 2013-10-29 14:23 UTC (permalink / raw)
To: Felipe Contreras
Cc: Oleksij Rempel, ilw, hostap@lists.shmoo.com,
linux-wireless Mailing List
In-Reply-To: <CAMP44s3uRF=jNn5ZHZ=QOcvuMoXxsfkxU=VOq3K02Q0qOspEdA@mail.gmail.com>
On Tue, Oct 29, 2013 at 3:02 AM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> On Mon, Oct 28, 2013 at 2:44 PM, Krishna Chaitanya
> <chaitanya.mgit@gmail.com> wrote:
>> On Tue, Oct 29, 2013 at 1:36 AM, Felipe Contreras
>> <felipe.contreras@gmail.com> wrote:
>>> On Mon, Oct 28, 2013 at 1:27 PM, Krishna Chaitanya
>>> <chaitanya.mgit@gmail.com> wrote:
>>
>>>> From the logs we can see that we have received authentication response,
>>>> so the association request is getting dropped somewhere? We might
>>>> need the mac80211 and iwlwifi trace-cmd logs to check for the drop.
>>>>
>>>> http://wireless.kernel.org/en/developers/Documentation/mac80211/tracing
>>>
>>> There you go:
>>> http://people.freedesktop.org/~felipec/wpa/trace.dat.xz
>>>
>> Hmm.."trace-cmd report -i trace.dat" returned lots of errors, i have even
>> tried with the trace-cmd from git (ubuntu). Did it worked fro you?
>
> Yes, but maybe I overrode the file. I've pushed a new one again. The
> sha-1 is 36c260d8d8c171a24eb1aa7b2ea736b06c9b55b7.
>
Thanks, able to decode now. I am not familiar with the
iwlwifi code, but let me give it a try.
--
Thanks,
Regards,
Chaitanya T K.
^ permalink raw reply
* Re: [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration
From: Kalle Valo @ 2013-10-29 13:35 UTC (permalink / raw)
To: Luca Coelho
Cc: Ben Hutchings, Pali Rohár, John W. Linville, Johannes Berg,
David S. Miller, linux-wireless, netdev, linux-kernel,
freemangordon, aaro.koskinen, pavel, sre, joni.lapilainen,
David Gnedt
In-Reply-To: <1383030565.21526.92.camel@porter.coelho.fi>
Luca Coelho <luca@coelho.fi> writes:
> On Mon, 2013-10-28 at 23:39 +0000, Ben Hutchings wrote:
>> On Sat, 2013-10-26 at 22:34 +0200, Pali Rohár wrote:
>> > From: David Gnedt <david.gnedt@davizone.at>
>> >
>> > Port the bt_coex_mode sysfs interface from wl1251 driver version included
>> > in the Maemo Fremantle kernel to allow bt-coexistence mode configuration.
>> > This enables userspace applications to set one of the modes
>> > WL1251_BT_COEX_OFF, WL1251_BT_COEX_ENABLE and WL1251_BT_COEX_MONOAUDIO.
>> > The default mode is WL1251_BT_COEX_OFF.
>> > It should be noted that this driver always enabled bt-coexistence before
>> > and enabled bt-coexistence directly affects the receiving performance,
>> > rendering it unusable in some low-signal situations. Especially monitor
>> > mode is affected very badly with bt-coexistence enabled.
>> [...]
>>
>> This should be implemented consistently with other drivers:
>>
>> drivers/net/wireless/ath/ath9k/htc_drv_init.c:module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444);
>> drivers/net/wireless/ath/ath9k/init.c:module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444);
>> drivers/net/wireless/b43/main.c:module_param_named(btcoex, modparam_btcoex, int, 0444);
>> drivers/net/wireless/ipw2x00/ipw2200.c:module_param(bt_coexist, int, 0444);
>> drivers/net/wireless/iwlegacy/common.c:module_param(bt_coex_active, bool, S_IRUGO);
>> drivers/net/wireless/iwlwifi/iwl-drv.c:module_param_named(bt_coex_active, iwlwifi_mod_params.bt_coex_active,
>> drivers/net/wireless/ti/wlcore/sysfs.c:static DEVICE_ATTR(bt_coex_state, S_IRUGO | S_IWUSR,
>>
>> Oh, hmm, I see a problem here.
>
> With so many drivers doing the same thing, isn't it about time to add
> this to nl80211?
Yes, this really needs to be in nl80211. I even suggested this years ago
but was turned down at the time. Can't remember the reason anymore.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v2 2/2] cfg80211: allow beaconing after DFS CAC
From: Luis R. Rodriguez @ 2013-10-29 13:16 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <1383048716-5886-2-git-send-email-janusz.dziedzic@tieto.com>
On Tue, Oct 29, 2013 at 1:11 PM, Janusz Dziedzic
<janusz.dziedzic@tieto.com> wrote:
> After going throught the Channel Availability Check (CAC)
> required by DFS enable beaconing. Channels that have
> gone through a CAC will be in the NL80211_DFS_AVAILABLE
> state. Without this change APs don't start beaconing
> after a successful CAC.
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This looks better but please merge the two patches together. Also
Johannes -- will this patch need to rely on the new no-ir patch? I
provided feedback on your concern there.
Luis
^ permalink raw reply
* Re: [PATCH v2 1/2] cfg80211: handle correctly prohibited flags
From: Luis R. Rodriguez @ 2013-10-29 13:13 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <1383048716-5886-1-git-send-email-janusz.dziedzic@tieto.com>
On Tue, Oct 29, 2013 at 1:11 PM, Janusz Dziedzic
<janusz.dziedzic@tieto.com> wrote:
> Handle correctly prohibited flags in cfg80211_secondary_chans_ok()
> function. Before, we ignore IEEE80211_CHAN_RADAR flag even
> caller put the flag as prohibited one.
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
> ---
> net/wireless/chan.c | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
> index a6f5c4c..6f2be48 100644
> --- a/net/wireless/chan.c
> +++ b/net/wireless/chan.c
> @@ -438,16 +438,7 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
>
> for (freq = start_freq; freq <= end_freq; freq += 20) {
> c = ieee80211_get_channel(wiphy, freq);
> - if (!c)
> - return false;
> -
> - /* check for radar flags */
> - if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
> - (c->dfs_state != NL80211_DFS_AVAILABLE))
> - return false;
> -
> - /* check for the other flags */
> - if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
> + if (!c || c->flags & prohibited_flags)
> return false;
> }
NACK
Although you do something that looks good here you are breaking this
check atomically for this commit and introducing a regression here,
you want to merge the two patches together.
Luis
^ permalink raw reply
* [PATCH v2 2/2] cfg80211: allow beaconing after DFS CAC
From: Janusz Dziedzic @ 2013-10-29 12:11 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, mcgrof, Janusz Dziedzic
In-Reply-To: <1383048716-5886-1-git-send-email-janusz.dziedzic@tieto.com>
After going throught the Channel Availability Check (CAC)
required by DFS enable beaconing. Channels that have
gone through a CAC will be in the NL80211_DFS_AVAILABLE
state. Without this change APs don't start beaconing
after a successful CAC.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
net/wireless/chan.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 73 insertions(+), 5 deletions(-)
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 6f2be48..a7168d5 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -426,6 +426,71 @@ bool cfg80211_chandef_dfs_usable(struct wiphy *wiphy,
}
+static bool cfg80211_get_chans_dfs_available(struct wiphy *wiphy,
+ u32 center_freq,
+ u32 bandwidth)
+{
+ struct ieee80211_channel *c;
+ u32 freq, start_freq, end_freq;
+
+ start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
+ end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
+
+ /* Check entire range of channels for the bandwidth.
+ * If any channel in between is disabled or has not
+ * had gone through CAC return false
+ */
+ for (freq = start_freq; freq <= end_freq; freq += 20) {
+ c = ieee80211_get_channel(wiphy, freq);
+ if (!c)
+ return false;
+
+ if (c->flags & IEEE80211_CHAN_DISABLED)
+ return false;
+
+ if ((c->flags & IEEE80211_CHAN_RADAR) &&
+ (c->dfs_state != NL80211_DFS_AVAILABLE))
+ return false;
+ }
+
+ return true;
+}
+
+static bool cfg80211_chandef_dfs_available(struct wiphy *wiphy,
+ const struct cfg80211_chan_def *chandef)
+{
+ int width;
+ int r;
+
+ if (WARN_ON(!cfg80211_chandef_valid(chandef)))
+ return false;
+
+ width = cfg80211_chandef_get_width(chandef);
+ if (width < 0)
+ return false;
+
+ r = cfg80211_get_chans_dfs_available(wiphy, chandef->center_freq1,
+ width);
+
+ /* If any of channels unavailable for cf1 just return */
+ if (!r)
+ return r;
+
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_80P80:
+ WARN_ON(!chandef->center_freq2);
+ r = cfg80211_get_chans_dfs_available(wiphy,
+ chandef->center_freq2,
+ width);
+ default:
+ WARN_ON(chandef->center_freq2);
+ break;
+ }
+
+ return r;
+}
+
+
static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
u32 center_freq, u32 bandwidth,
u32 prohibited_flags)
@@ -547,11 +612,14 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
trace_cfg80211_reg_can_beacon(wiphy, chandef);
- res = cfg80211_chandef_usable(wiphy, chandef,
- IEEE80211_CHAN_DISABLED |
- IEEE80211_CHAN_PASSIVE_SCAN |
- IEEE80211_CHAN_NO_IBSS |
- IEEE80211_CHAN_RADAR);
+ if (cfg80211_chandef_dfs_required(wiphy, chandef) > 0)
+ res = cfg80211_chandef_dfs_available(wiphy, chandef);
+ else
+ res = cfg80211_chandef_usable(wiphy, chandef,
+ IEEE80211_CHAN_DISABLED |
+ IEEE80211_CHAN_PASSIVE_SCAN |
+ IEEE80211_CHAN_NO_IBSS |
+ IEEE80211_CHAN_RADAR);
trace_cfg80211_return_bool(res);
return res;
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 1/2] cfg80211: handle correctly prohibited flags
From: Janusz Dziedzic @ 2013-10-29 12:11 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, mcgrof, Janusz Dziedzic
Handle correctly prohibited flags in cfg80211_secondary_chans_ok()
function. Before, we ignore IEEE80211_CHAN_RADAR flag even
caller put the flag as prohibited one.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
net/wireless/chan.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index a6f5c4c..6f2be48 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -438,16 +438,7 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy,
for (freq = start_freq; freq <= end_freq; freq += 20) {
c = ieee80211_get_channel(wiphy, freq);
- if (!c)
- return false;
-
- /* check for radar flags */
- if ((prohibited_flags & c->flags & IEEE80211_CHAN_RADAR) &&
- (c->dfs_state != NL80211_DFS_AVAILABLE))
- return false;
-
- /* check for the other flags */
- if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR)
+ if (!c || c->flags & prohibited_flags)
return false;
}
--
1.7.9.5
^ permalink raw reply related
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