2014-01-22 10:51:44

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] mac80211_hwsim: add channel switch support

From: Andrei Otcheretianski <[email protected]>

Advertise to mac80211 that we can do channel switch both
for STA and AP/GO.
After each beacon transmission check if CSA is done and
call ieee80211_csa_finish if needed.

Change-Id: I1cb34c04f533275522236381ae14b624bec35418
Signed-off-by: Andrei Otcheretianski <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
---
drivers/net/wireless/mac80211_hwsim.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4950359..5268ede 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1307,6 +1307,9 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,

mac80211_hwsim_tx_frame(hw, skb,
rcu_dereference(vif->chanctx_conf)->def.chan);
+
+ if (vif->csa_active && ieee80211_csa_is_complete(vif))
+ ieee80211_csa_finish(vif);
}

static enum hrtimer_restart
@@ -2109,13 +2112,15 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
IEEE80211_HW_AMPDU_AGGREGATION |
IEEE80211_HW_WANT_MONITOR_VIF |
IEEE80211_HW_QUEUE_CONTROL |
- IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES |
+ IEEE80211_HW_CHANCTX_STA_CSA;
if (rctbl)
hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE;

hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
- WIPHY_FLAG_AP_UAPSD;
+ WIPHY_FLAG_AP_UAPSD |
+ WIPHY_FLAG_HAS_CHANNEL_SWITCH;
hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;

/* ask mac80211 to reserve space for magic */
--
1.8.5.1



2014-01-22 10:54:54

by Liu, Bopeng

[permalink] [raw]
Subject: RE: [PATCH] mac80211_hwsim: add channel switch support

Hi, Johannes:

Very glad to mail you , and I just found the latest kernel version can't support the wifi Mode A by AP Mode.

Our chip is:

01:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)
Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN

iwconfig wlan0
wlan0 IEEE 802.11abg ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

Have you ever met such problem?




Best Regards.
--------------------------------------
Bopeng Liu
WIND RIVER | China Development Center
Phone: 8610-6483-5012



________________________________________
From: [email protected] [[email protected]] on behalf of Johannes Berg [[email protected]]
Sent: Wednesday, January 22, 2014 6:51 PM
To: [email protected]
Cc: Andrei Otcheretianski
Subject: [PATCH] mac80211_hwsim: add channel switch support

From: Andrei Otcheretianski <[email protected]>

Advertise to mac80211 that we can do channel switch both
for STA and AP/GO.
After each beacon transmission check if CSA is done and
call ieee80211_csa_finish if needed.

Change-Id: I1cb34c04f533275522236381ae14b624bec35418
Signed-off-by: Andrei Otcheretianski <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
---
drivers/net/wireless/mac80211_hwsim.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4950359..5268ede 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1307,6 +1307,9 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,

mac80211_hwsim_tx_frame(hw, skb,
rcu_dereference(vif->chanctx_conf)->def.chan);
+
+ if (vif->csa_active && ieee80211_csa_is_complete(vif))
+ ieee80211_csa_finish(vif);
}

static enum hrtimer_restart
@@ -2109,13 +2112,15 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
IEEE80211_HW_AMPDU_AGGREGATION |
IEEE80211_HW_WANT_MONITOR_VIF |
IEEE80211_HW_QUEUE_CONTROL |
- IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES |
+ IEEE80211_HW_CHANCTX_STA_CSA;
if (rctbl)
hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE;

hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
- WIPHY_FLAG_AP_UAPSD;
+ WIPHY_FLAG_AP_UAPSD |
+ WIPHY_FLAG_HAS_CHANNEL_SWITCH;
hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;

/* ask mac80211 to reserve space for magic */
--
1.8.5.1

2014-01-22 10:56:22

by Liu, Bopeng

[permalink] [raw]
Subject: RE: [PATCH] mac80211_hwsim: add channel switch support

It will show :


Best Regards.
--------------------------------------
Bopeng Liu
WIND RIVER | China Development Center
Phone: 8610-6483-5012



________________________________________
From: [email protected] [[email protected]] on behalf of Liu, Bopeng [[email protected]]
Sent: Wednesday, January 22, 2014 6:54 PM
To: Johannes Berg; [email protected]
Cc: Andrei Otcheretianski
Subject: RE: [PATCH] mac80211_hwsim: add channel switch support

Hi, Johannes:

Very glad to mail you , and I just found the latest kernel version can't support the wifi Mode A by AP Mode.

Our chip is:

01:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)
Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN

iwconfig wlan0
wlan0 IEEE 802.11abg ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

Have you ever met such problem?




Best Regards.
--------------------------------------
Bopeng Liu
WIND RIVER | China Development Center
Phone: 8610-6483-5012



________________________________________
From: [email protected] [[email protected]] on behalf of Johannes Berg [[email protected]]
Sent: Wednesday, January 22, 2014 6:51 PM
To: [email protected]
Cc: Andrei Otcheretianski
Subject: [PATCH] mac80211_hwsim: add channel switch support

From: Andrei Otcheretianski <[email protected]>

Advertise to mac80211 that we can do channel switch both
for STA and AP/GO.
After each beacon transmission check if CSA is done and
call ieee80211_csa_finish if needed.

Change-Id: I1cb34c04f533275522236381ae14b624bec35418
Signed-off-by: Andrei Otcheretianski <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
---
drivers/net/wireless/mac80211_hwsim.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4950359..5268ede 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1307,6 +1307,9 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,

mac80211_hwsim_tx_frame(hw, skb,
rcu_dereference(vif->chanctx_conf)->def.chan);
+
+ if (vif->csa_active && ieee80211_csa_is_complete(vif))
+ ieee80211_csa_finish(vif);
}

static enum hrtimer_restart
@@ -2109,13 +2112,15 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
IEEE80211_HW_AMPDU_AGGREGATION |
IEEE80211_HW_WANT_MONITOR_VIF |
IEEE80211_HW_QUEUE_CONTROL |
- IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES |
+ IEEE80211_HW_CHANCTX_STA_CSA;
if (rctbl)
hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE;

hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
- WIPHY_FLAG_AP_UAPSD;
+ WIPHY_FLAG_AP_UAPSD |
+ WIPHY_FLAG_HAS_CHANNEL_SWITCH;
hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;

/* ask mac80211 to reserve space for magic */
--
1.8.5.1

2014-01-23 15:10:17

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mac80211_hwsim: add channel switch support

Johannes Berg <[email protected]> writes:

> From: Andrei Otcheretianski <[email protected]>
>
> Advertise to mac80211 that we can do channel switch both
> for STA and AP/GO.
> After each beacon transmission check if CSA is done and
> call ieee80211_csa_finish if needed.
>
> Change-Id: I1cb34c04f533275522236381ae14b624bec35418

Change id visible.

--
Kalle Valo

2014-01-23 18:47:09

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211_hwsim: add channel switch support

On Wed, 2014-01-22 at 11:51 +0100, Johannes Berg wrote:
> From: Andrei Otcheretianski <[email protected]>
>
> Advertise to mac80211 that we can do channel switch both
> for STA and AP/GO.
> After each beacon transmission check if CSA is done and
> call ieee80211_csa_finish if needed.

Applied. Let's see how that goes.

johannes


2014-01-22 10:57:13

by Liu, Bopeng

[permalink] [raw]
Subject: RE: [PATCH] mac80211_hwsim: add channel switch support

AP Mode:

hw_mode can't be supported, have you ever met such problem?


hostapd -B /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
channel [9] (104) is disabled for use in AP mode, flags: 0x1
wlan0: IEEE 802.11 Configured channel (104) not found from the channel list of current mode (2) IEEE 802.11a
wlan0: IEEE 802.11 Hardware does not support configured channel
Could not select hw_mode and channel. (-4)
wlan0: Unable to setup interface.


Best Regards.
--------------------------------------
Bopeng Liu
WIND RIVER | China Development Center
Phone: 8610-6483-5012



________________________________________
From: Liu, Bopeng
Sent: Wednesday, January 22, 2014 6:56 PM
To: Johannes Berg; [email protected]
Cc: Andrei Otcheretianski
Subject: RE: [PATCH] mac80211_hwsim: add channel switch support

It will show :


Best Regards.
--------------------------------------
Bopeng Liu
WIND RIVER | China Development Center
Phone: 8610-6483-5012



________________________________________
From: [email protected] [[email protected]] on behalf of Liu, Bopeng [[email protected]]
Sent: Wednesday, January 22, 2014 6:54 PM
To: Johannes Berg; [email protected]
Cc: Andrei Otcheretianski
Subject: RE: [PATCH] mac80211_hwsim: add channel switch support

Hi, Johannes:

Very glad to mail you , and I just found the latest kernel version can't support the wifi Mode A by AP Mode.

Our chip is:

01:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)
Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN

iwconfig wlan0
wlan0 IEEE 802.11abg ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off

Have you ever met such problem?




Best Regards.
--------------------------------------
Bopeng Liu
WIND RIVER | China Development Center
Phone: 8610-6483-5012



________________________________________
From: [email protected] [[email protected]] on behalf of Johannes Berg [[email protected]]
Sent: Wednesday, January 22, 2014 6:51 PM
To: [email protected]
Cc: Andrei Otcheretianski
Subject: [PATCH] mac80211_hwsim: add channel switch support

From: Andrei Otcheretianski <[email protected]>

Advertise to mac80211 that we can do channel switch both
for STA and AP/GO.
After each beacon transmission check if CSA is done and
call ieee80211_csa_finish if needed.

Change-Id: I1cb34c04f533275522236381ae14b624bec35418
Signed-off-by: Andrei Otcheretianski <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
---
drivers/net/wireless/mac80211_hwsim.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4950359..5268ede 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1307,6 +1307,9 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,

mac80211_hwsim_tx_frame(hw, skb,
rcu_dereference(vif->chanctx_conf)->def.chan);
+
+ if (vif->csa_active && ieee80211_csa_is_complete(vif))
+ ieee80211_csa_finish(vif);
}

static enum hrtimer_restart
@@ -2109,13 +2112,15 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
IEEE80211_HW_AMPDU_AGGREGATION |
IEEE80211_HW_WANT_MONITOR_VIF |
IEEE80211_HW_QUEUE_CONTROL |
- IEEE80211_HW_SUPPORTS_HT_CCK_RATES;
+ IEEE80211_HW_SUPPORTS_HT_CCK_RATES |
+ IEEE80211_HW_CHANCTX_STA_CSA;
if (rctbl)
hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE;

hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
- WIPHY_FLAG_AP_UAPSD;
+ WIPHY_FLAG_AP_UAPSD |
+ WIPHY_FLAG_HAS_CHANNEL_SWITCH;
hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;

/* ask mac80211 to reserve space for magic */
--
1.8.5.1