All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode
@ 2012-06-18 11:00 Vivek Natarajan
  2012-06-18 11:00 ` [PATCH v2] wpa_supplicant: Add support for auto " Vivek Natarajan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Vivek Natarajan @ 2012-06-18 11:00 UTC (permalink / raw)
  To: jouni, johannes, kvalo; +Cc: linux-wireless

If the driver sets WIPHY_FLAG_SUPPORTS_ACS, auto_channel_select
is passed to the driver as ap settings and frequency setting is
skipped. When the AP mode comes up in the new channel, it is 
intimated to cfg80211 through cfg80211_ch_switch_notify which
in turn notifies the channel information to wpa_supplicant
through CH_SWITCH event.

Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
---
v2: Add a new flag attribute for _START_AP command to indicate ACS request.
    Update the channel/frequency information using ch_switch_notify
    once the driver (firmware) has selected the channel.

For P2P, the operating channel needs to be known before group negotiation starts.
This is true in case of P2P GO or client. It needs a separate p2p command from
wpa_cli to get the acs-based best channel information from the driver.

 include/linux/nl80211.h |    5 +++++
 include/net/cfg80211.h  |    4 ++++
 net/wireless/nl80211.c  |    7 +++++++
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 970afdf..ed6653b 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1224,6 +1224,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
  *      or 0 to disable background scan.
  *
+ * @NL80211_ATTR_ACS: Enable automatic channel selection by the driver
+ *	for AP mode.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1475,6 +1478,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_BG_SCAN_PERIOD,
 
+	NL80211_ATTR_ACS,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7319f25..b0262b5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -417,6 +417,7 @@ struct cfg80211_beacon_data {
  * @privacy: the BSS uses privacy
  * @auth_type: Authentication type (algorithm)
  * @inactivity_timeout: time in seconds to determine station's inactivity.
+ * @auto_channel_select: automatic channel selection
  */
 struct cfg80211_ap_settings {
 	struct ieee80211_channel *channel;
@@ -432,6 +433,7 @@ struct cfg80211_ap_settings {
 	bool privacy;
 	enum nl80211_auth_type auth_type;
 	int inactivity_timeout;
+	bool auto_channel_select;
 };
 
 /**
@@ -1810,6 +1812,7 @@ struct cfg80211_ops {
  *	responds to probe-requests in hardware.
  * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
  * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
+ * @WIPHY_FLAG_SUPPORTS_ACS: Device supports automatic channel selection.
  */
 enum wiphy_flags {
 	WIPHY_FLAG_CUSTOM_REGULATORY		= BIT(0),
@@ -1833,6 +1836,7 @@ enum wiphy_flags {
 	WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD	= BIT(19),
 	WIPHY_FLAG_OFFCHAN_TX			= BIT(20),
 	WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL	= BIT(21),
+	WIPHY_FLAG_SUPPORTS_ACS			= BIT(22),
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7ae54b8..26f8c03 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -206,6 +206,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_NOACK_MAP] = { .type = NLA_U16 },
 	[NL80211_ATTR_INACTIVITY_TIMEOUT] = { .type = NLA_U16 },
 	[NL80211_ATTR_BG_SCAN_PERIOD] = { .type = NLA_U16 },
+	[NL80211_ATTR_ACS] = { .type = NLA_FLAG },
 };
 
 /* policy for the key attributes */
@@ -2348,6 +2349,12 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
 	} else if (wdev->preset_chan) {
 		params.channel = wdev->preset_chan;
 		params.channel_type = wdev->preset_chantype;
+	} else if (info->attrs[NL80211_ATTR_ACS]) {
+		if (rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_ACS)
+			params.auto_channel_select =
+				!!info->attrs[NL80211_ATTR_ACS];
+		else
+			return -EINVAL;
 	} else
 		return -EINVAL;
 
-- 
1.7.4.1


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

* [PATCH v2] wpa_supplicant: Add support for auto channel selection in AP mode
  2012-06-18 11:00 [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode Vivek Natarajan
@ 2012-06-18 11:00 ` Vivek Natarajan
  2012-06-18 11:00 ` [PATCH 2/2] ath6kl: Enable auto channel selection for " Vivek Natarajan
  2012-06-20  8:55 ` [PATCH 1/2] cfg80211: Support for automatic channel selection in " Johannes Berg
  2 siblings, 0 replies; 9+ messages in thread
From: Vivek Natarajan @ 2012-06-18 11:00 UTC (permalink / raw)
  To: jouni, johannes, kvalo; +Cc: linux-wireless

If conf parameter 'auto_chan_select' is enabled for AP mode, send 
NL80211_ATTR_ACS attribute to cfg80211.
The new channel information is received from cfg80211 through
CH_SWITCH event.

Signed-hostap: Vivek Natarajan <nataraja@qca.qualcomm.com>
---
v2: Add a new flag attribute for _START_AP command to indicate ACS request.
    Update the channel/frequency information within hostapd/wpa_supplicant
    once the driver (firmware) has selected the channel.(This is addressed by
    Thomas' patch, 'nl80211: handle CH_SWITCH event')

 src/ap/ap_config.h           |    1 +
 src/ap/beacon.c              |    1 +
 src/ap/hw_features.c         |    2 +-
 src/drivers/driver.h         |    5 +++++
 src/drivers/driver_nl80211.c |    5 ++++-
 wpa_supplicant/ap.c          |   20 ++++++++++++++++----
 wpa_supplicant/config.c      |    1 +
 wpa_supplicant/config_ssid.h |    8 ++++++++
 8 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 78c9068..54759bb 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -407,6 +407,7 @@ struct hostapd_config {
 	int fragm_threshold;
 	u8 send_probe_response;
 	u8 channel;
+	int acs;
 	enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
 	enum {
 		LONG_PREAMBLE = 0,
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index b711063..037f172 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -634,6 +634,7 @@ void ieee802_11_set_beacon(struct hostapd_data *hapd)
 	params.dtim_period = hapd->conf->dtim_period;
 	params.beacon_int = hapd->iconf->beacon_int;
 	params.basic_rates = hapd->iconf->basic_rates;
+	params.auto_chan_select = hapd->iconf->acs;
 	params.ssid = (u8 *) hapd->conf->ssid.ssid;
 	params.ssid_len = hapd->conf->ssid.ssid_len;
 	params.pairwise_ciphers = hapd->conf->rsn_pairwise ?
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 76c4211..f33b7fd 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -715,7 +715,7 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
 			ok = 0;
 		}
 	}
-	if (iface->conf->channel == 0) {
+	if (iface->conf->channel == 0 && iface->conf->acs == 0) {
 		/* TODO: could request a scan of neighboring BSSes and select
 		 * the channel automatically */
 		wpa_printf(MSG_ERROR, "Channel not configured "
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index f7fb2ef..053ccd0 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -577,6 +577,11 @@ struct wpa_driver_ap_params {
 	int beacon_int;
 
 	/**
+	 * auto_chan_select - Automatic channel selection
+	 */
+	int auto_chan_select;
+
+	/**
 	 * basic_rates: -1 terminated array of basic rates in 100 kbps
 	 *
 	 * This parameter can be used to set a specific basic rate set for the
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 693a885..d4293fd 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5330,6 +5330,8 @@ static int wpa_driver_nl80211_set_ap(void *priv,
 	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, ifindex);
 	NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, params->beacon_int);
 	NLA_PUT_U32(msg, NL80211_ATTR_DTIM_PERIOD, params->dtim_period);
+	if (params->auto_chan_select)
+		NLA_PUT_FLAG(msg, NL80211_ATTR_ACS);
 	NLA_PUT(msg, NL80211_ATTR_SSID, params->ssid_len,
 		params->ssid);
 	if (params->proberesp && params->proberesp_len)
@@ -6388,7 +6390,8 @@ static int wpa_driver_nl80211_ap(struct wpa_driver_nl80211_data *drv,
 		nlmode = NL80211_IFTYPE_AP;
 
 	if (wpa_driver_nl80211_set_mode(&drv->first_bss, nlmode) ||
-	    wpa_driver_nl80211_set_freq(&drv->first_bss, params->freq, 0, 0)) {
+	    ((params->freq) &&
+	    wpa_driver_nl80211_set_freq(&drv->first_bss, params->freq, 0, 0))) {
 		nl80211_remove_monitor_interface(drv);
 		return -1;
 	}
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index d531583..87bc9b8 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -52,10 +52,22 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
 
 	os_strlcpy(bss->iface, wpa_s->ifname, sizeof(bss->iface));
 
-	if (ssid->frequency == 0) {
-		/* default channel 11 */
-		conf->hw_mode = HOSTAPD_MODE_IEEE80211G;
-		conf->channel = 11;
+	if (ssid->auto_chan_select) {
+		if (ssid->frequency == 0)
+			wpa_printf(MSG_INFO, "Automatic channel "
+				   "selection is enabled");
+		else {
+			wpa_printf(MSG_INFO, "Automatic channel "
+				   "selection is enabled. Override "
+				   "frequency configuration");
+			ssid->frequency = 0;
+		}
+
+		conf->acs = ssid->auto_chan_select;
+	} else if (ssid->frequency == 0) {
+			/* default channel 11 */
+			conf->hw_mode = HOSTAPD_MODE_IEEE80211G;
+			conf->channel = 8;
 	} else if (ssid->frequency >= 2412 && ssid->frequency <= 2472) {
 		conf->hw_mode = HOSTAPD_MODE_IEEE80211G;
 		conf->channel = (ssid->frequency - 2407) / 5;
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index ce763b3..7b85712 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -1598,6 +1598,7 @@ static const struct parse_data ssid_fields[] = {
 	{ INT(wpa_ptk_rekey) },
 	{ STR(bgscan) },
 	{ INT_RANGE(ignore_broadcast_ssid, 0, 2) },
+	{ INT_RANGE(auto_chan_select, 0, 1) },
 #ifdef CONFIG_P2P
 	{ FUNC(p2p_client_list) },
 #endif /* CONFIG_P2P */
diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
index 80d4382..88806fb 100644
--- a/wpa_supplicant/config_ssid.h
+++ b/wpa_supplicant/config_ssid.h
@@ -398,6 +398,14 @@ struct wpa_ssid {
 	int ignore_broadcast_ssid;
 
 	/**
+	 * auto_chan_select - Automatic channel selection in AP mode
+	 *
+	 * Optional parameter to enable channel selection by the driver if it
+	 * is capable of.
+	 */
+
+	int auto_chan_select;
+	/**
 	 * freq_list - Array of allowed frequencies or %NULL for all
 	 *
 	 * This is an optional zero-terminated array of frequencies in
-- 
1.7.4.1


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

* [PATCH 2/2] ath6kl: Enable auto channel selection for AP mode
  2012-06-18 11:00 [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode Vivek Natarajan
  2012-06-18 11:00 ` [PATCH v2] wpa_supplicant: Add support for auto " Vivek Natarajan
@ 2012-06-18 11:00 ` Vivek Natarajan
  2012-07-11 15:42   ` Kalle Valo
  2012-06-20  8:55 ` [PATCH 1/2] cfg80211: Support for automatic channel selection in " Johannes Berg
  2 siblings, 1 reply; 9+ messages in thread
From: Vivek Natarajan @ 2012-06-18 11:00 UTC (permalink / raw)
  To: jouni, johannes, kvalo; +Cc: linux-wireless

Also update the new channel information through ch_switch_notify.

Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index f27e973..4a30bdc 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2762,7 +2762,16 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	p.ssid_len = vif->ssid_len;
 	memcpy(p.ssid, vif->ssid, vif->ssid_len);
 	p.dot11_auth_mode = vif->dot11_auth_mode;
-	p.ch = cpu_to_le16(info->channel->center_freq);
+
+	if (info->auto_channel_select)
+		ar->want_ch_switch |= 1 << vif->fw_vif_idx;
+
+	if (info->channel) {
+		p.ch = cpu_to_le16(info->channel->center_freq);
+		if (ath6kl_set_htcap(vif, info->channel->band,
+				     info->channel_type != NL80211_CHAN_NO_HT))
+			return -EIO;
+	}
 
 	/* Enable uAPSD support by default */
 	res = ath6kl_wmi_ap_set_apsd(ar->wmi, vif->fw_vif_idx, true);
@@ -2786,10 +2795,6 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
 			return res;
 	}
 
-	if (ath6kl_set_htcap(vif, info->channel->band,
-			     info->channel_type != NL80211_CHAN_NO_HT))
-		return -EIO;
-
 	/*
 	 * Get the PTKSA replay counter in the RSN IE. Supplicant
 	 * will use the RSN IE in M3 message and firmware has to
@@ -3502,7 +3507,8 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
 	ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM |
 			    WIPHY_FLAG_HAVE_AP_SME |
 			    WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
-			    WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
+			    WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
+			    WIPHY_FLAG_SUPPORTS_ACS;
 
 	if (test_bit(ATH6KL_FW_CAPABILITY_SCHED_SCAN, ar->fw_capabilities))
 		ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
-- 
1.7.4.1


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

* Re: [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode
  2012-06-18 11:00 [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode Vivek Natarajan
  2012-06-18 11:00 ` [PATCH v2] wpa_supplicant: Add support for auto " Vivek Natarajan
  2012-06-18 11:00 ` [PATCH 2/2] ath6kl: Enable auto channel selection for " Vivek Natarajan
@ 2012-06-20  8:55 ` Johannes Berg
  2012-06-20  9:42   ` Vivek Natarajan
  2 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2012-06-20  8:55 UTC (permalink / raw)
  To: Vivek Natarajan; +Cc: jouni, kvalo, linux-wireless

On Mon, 2012-06-18 at 16:30 +0530, Vivek Natarajan wrote:
> If the driver sets WIPHY_FLAG_SUPPORTS_ACS, auto_channel_select
> is passed to the driver as ap settings and frequency setting is
> skipped. When the AP mode comes up in the new channel, it is 
> intimated to cfg80211 through cfg80211_ch_switch_notify which
> in turn notifies the channel information to wpa_supplicant
> through CH_SWITCH event.
> 
> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
> ---
> v2: Add a new flag attribute for _START_AP command to indicate ACS request.
>     Update the channel/frequency information using ch_switch_notify
>     once the driver (firmware) has selected the channel.
> 
> For P2P, the operating channel needs to be known before group negotiation starts.
> This is true in case of P2P GO or client. It needs a separate p2p command from
> wpa_cli to get the acs-based best channel information from the driver.

So .. is there any reason to not do only the second, and then pass that
channel back here instead?

johannes


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

* Re: [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode
  2012-06-20  8:55 ` [PATCH 1/2] cfg80211: Support for automatic channel selection in " Johannes Berg
@ 2012-06-20  9:42   ` Vivek Natarajan
  2012-06-20 15:41     ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Vivek Natarajan @ 2012-06-20  9:42 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Vivek Natarajan, jouni, kvalo, linux-wireless

On Wed, Jun 20, 2012 at 2:25 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2012-06-18 at 16:30 +0530, Vivek Natarajan wrote:
>> If the driver sets WIPHY_FLAG_SUPPORTS_ACS, auto_channel_select
>> is passed to the driver as ap settings and frequency setting is
>> skipped. When the AP mode comes up in the new channel, it is
>> intimated to cfg80211 through cfg80211_ch_switch_notify which
>> in turn notifies the channel information to wpa_supplicant
>> through CH_SWITCH event.
>>
>> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
>> ---
>> v2: Add a new flag attribute for _START_AP command to indicate ACS request.
>>     Update the channel/frequency information using ch_switch_notify
>>     once the driver (firmware) has selected the channel.
>>
>> For P2P, the operating channel needs to be known before group negotiation starts.
>> This is true in case of P2P GO or client. It needs a separate p2p command from
>> wpa_cli to get the acs-based best channel information from the driver.
>
> So .. is there any reason to not do only the second, and then pass that
> channel back here instead?

So, what you recommend is, for both AP and P2P GO modes, the logic
should be to request the driver for best channel, then the best
channel information event to be passed to userspace and then starting
the AP/GO mode of operation.
The current ath6kl firmware has some limitation for getting this
channel information separately and hence not yet implemented this.
Moreover this needs to be a synchronous operation: to request and get
the event for best channel after a full cycle of channel assessment is
done.

Vivek.

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

* Re: [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode
  2012-06-20  9:42   ` Vivek Natarajan
@ 2012-06-20 15:41     ` Johannes Berg
  2012-06-21  6:21       ` Michal Kazior
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2012-06-20 15:41 UTC (permalink / raw)
  To: Vivek Natarajan; +Cc: Vivek Natarajan, jouni, kvalo, linux-wireless

On Wed, 2012-06-20 at 15:12 +0530, Vivek Natarajan wrote:

> >> For P2P, the operating channel needs to be known before group negotiation starts.
> >> This is true in case of P2P GO or client. It needs a separate p2p command from
> >> wpa_cli to get the acs-based best channel information from the driver.
> >
> > So .. is there any reason to not do only the second, and then pass that
> > channel back here instead?
> 
> So, what you recommend is, for both AP and P2P GO modes, the logic
> should be to request the driver for best channel, then the best
> channel information event to be passed to userspace and then starting
> the AP/GO mode of operation.

That's what I'm thinking, yes.

> The current ath6kl firmware has some limitation for getting this
> channel information separately and hence not yet implemented this.
> Moreover this needs to be a synchronous operation: to request and get
> the event for best channel after a full cycle of channel assessment is
> done.

Right, but if you're working on this surely you can do without this
particular patch for now?

The reason I'm talking about this is the channel concurrency framework
that Michal is working on, which would conflict somehow with this I
think.

johannes


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

* Re: [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode
  2012-06-20 15:41     ` Johannes Berg
@ 2012-06-21  6:21       ` Michal Kazior
  2012-06-21  8:26         ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Kazior @ 2012-06-21  6:21 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vivek Natarajan, Vivek Natarajan, jouni, kvalo, linux-wireless

Johannes Berg wrote:
> On Wed, 2012-06-20 at 15:12 +0530, Vivek Natarajan wrote:
>
>>>> For P2P, the operating channel needs to be known before group negotiation starts.
>>>> This is true in case of P2P GO or client. It needs a separate p2p command from
>>>> wpa_cli to get the acs-based best channel information from the driver.
>>>
>>> So .. is there any reason to not do only the second, and then pass that
>>> channel back here instead?
>>
>> So, what you recommend is, for both AP and P2P GO modes, the logic
>> should be to request the driver for best channel, then the best
>> channel information event to be passed to userspace and then starting
>> the AP/GO mode of operation.
>
> That's what I'm thinking, yes.
>
>> The current ath6kl firmware has some limitation for getting this
>> channel information separately and hence not yet implemented this.
>> Moreover this needs to be a synchronous operation: to request and get
>> the event for best channel after a full cycle of channel assessment is
>> done.
>
> Right, but if you're working on this surely you can do without this
> particular patch for now?
>
> The reason I'm talking about this is the channel concurrency framework
> that Michal is working on, which would conflict somehow with this I
> think.

Hmm.. we should be able to deal with it. I have a couple of ideas:

  a) treat ACS AP as a non-fixed channel IBSS (i.e. reserve a single
     channel resource); once channel notifications comes in we'd drop
     the behaviour

  b) trust the driver it won't do anything funny (we already trust it
     with channel switch notification)


The a) requires more tricks to be done. Once we run out of channels to 
run on we need to either:

  1) reject it and leave it to userspace to handle (i.e. retry .start_ap
     without ACS)

  2) disable ACS implicitly and pick a channel ourselves (we'd need to
     do a synthetic channel switch notification to userspace)

  3) extend ACS to accept channel list, so we could implicitly reduce it
     to channels we're already on (probably involves some nice hackery)


The b) seems to have an issue. Consider the following scenario:

     [ no channels are used, max 1 channel concurrency, max 2 APs ]
  1. wlan0: .start_ap with ACS
     [ driver is starting ACS AP.. ]
  2. wlan1: .start_ap on channel 1
     [ the driver is probably locked right now
       as it needs to complete (1); even if it's not locked
       (1) probably can't be influenced by (2) anymore.
       once it completes (1) it might end up on channel 6 on wlan0.
       this means (2) fails kind of unexpectedly ]


-- 
Pozdrawiam / Best regards, Michal Kazior.

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

* Re: [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode
  2012-06-21  6:21       ` Michal Kazior
@ 2012-06-21  8:26         ` Johannes Berg
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2012-06-21  8:26 UTC (permalink / raw)
  To: Michal Kazior
  Cc: Vivek Natarajan, Vivek Natarajan, jouni, kvalo, linux-wireless

On Thu, 2012-06-21 at 08:21 +0200, Michal Kazior wrote:

> > The reason I'm talking about this is the channel concurrency framework
> > that Michal is working on, which would conflict somehow with this I
> > think.
> 
> Hmm.. we should be able to deal with it. I have a couple of ideas:
> 
>   a) treat ACS AP as a non-fixed channel IBSS (i.e. reserve a single
>      channel resource); once channel notifications comes in we'd drop
>      the behaviour
> 
>   b) trust the driver it won't do anything funny (we already trust it
>      with channel switch notification)
> 
> 
> The a) requires more tricks to be done. Once we run out of channels to 
> run on we need to either:
> 
>   1) reject it and leave it to userspace to handle (i.e. retry .start_ap
>      without ACS)
> 
>   2) disable ACS implicitly and pick a channel ourselves (we'd need to
>      do a synthetic channel switch notification to userspace)
> 
>   3) extend ACS to accept channel list, so we could implicitly reduce it
>      to channels we're already on (probably involves some nice hackery)
> 

Seems tricky :-)

> The b) seems to have an issue. Consider the following scenario:
> 
>      [ no channels are used, max 1 channel concurrency, max 2 APs ]
>   1. wlan0: .start_ap with ACS
>      [ driver is starting ACS AP.. ]
>   2. wlan1: .start_ap on channel 1
>      [ the driver is probably locked right now
>        as it needs to complete (1); even if it's not locked
>        (1) probably can't be influenced by (2) anymore.
>        once it completes (1) it might end up on channel 6 on wlan0.
>        this means (2) fails kind of unexpectedly ]

I suspect that in this case the driver would have to fail the
second .start_ap though, since it's actually doing ACS at that time ...


johannes


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

* Re: [PATCH 2/2] ath6kl: Enable auto channel selection for AP mode
  2012-06-18 11:00 ` [PATCH 2/2] ath6kl: Enable auto channel selection for " Vivek Natarajan
@ 2012-07-11 15:42   ` Kalle Valo
  0 siblings, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2012-07-11 15:42 UTC (permalink / raw)
  To: Vivek Natarajan; +Cc: jouni, johannes, linux-wireless, ath6kl-devel

On 06/18/2012 02:00 PM, Vivek Natarajan wrote:
> Also update the new channel information through ch_switch_notify.
> 
> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>

I assume this patch depends on "cfg80211: Support for automatic channel
selection in AP mode" but I don't see that in wireless-next. So I have
to drop this patch for now, please resend once the cfg80211 patch is
applied.

Kalle

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

end of thread, other threads:[~2012-07-11 15:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-18 11:00 [PATCH 1/2] cfg80211: Support for automatic channel selection in AP mode Vivek Natarajan
2012-06-18 11:00 ` [PATCH v2] wpa_supplicant: Add support for auto " Vivek Natarajan
2012-06-18 11:00 ` [PATCH 2/2] ath6kl: Enable auto channel selection for " Vivek Natarajan
2012-07-11 15:42   ` Kalle Valo
2012-06-20  8:55 ` [PATCH 1/2] cfg80211: Support for automatic channel selection in " Johannes Berg
2012-06-20  9:42   ` Vivek Natarajan
2012-06-20 15:41     ` Johannes Berg
2012-06-21  6:21       ` Michal Kazior
2012-06-21  8:26         ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.