All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] hostapd: add ACS support
@ 2011-06-23  3:50 Luis R. Rodriguez
  2011-06-23  3:50 ` [PATCH 3/4] hostapd: add survey dump support Luis R. Rodriguez
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2011-06-23  3:50 UTC (permalink / raw)
  To: hostap; +Cc: linux-wireless, Luis R. Rodriguez

This series adds ACS support to hostapd. I've completed
a few of my own TODOs and splitted up the patches as
best as possible. I'm pretty satisfied with this code now
as an initial start for ACS code. At this point we need
to start finding ideal values for the metrics for offchannel
operation so that we can consistently always find the same
channel, even if it means surveying longer or doing more
scans.

Other algorithms for ACS shoudl be easy to plug in, for example,
spectral scan ;)

Anyway, to enable and test this thing just set CONFIG_ACS=1
on your build config and then something like this on your
hostapd.conf:

channel=acs_survey
acs_num_req_surveys=10
acs_roc_duration_ms=100

Test results, rants are appreciated.

Luis R. Rodriguez (4):
  hostapd: split up channel checking into helpers
  hostapd: add offchannel support
  hostapd: add survey dump support
  hostapd: add Automatic Channel Selection (ACS) support

 hostapd/Makefile             |    5 +
 hostapd/config_file.c        |   47 ++++-
 hostapd/defconfig            |   25 +++
 hostapd/hostapd.conf         |   17 ++
 src/ap/acs.c                 |  464 ++++++++++++++++++++++++++++++++++++++++++
 src/ap/acs.h                 |   40 ++++
 src/ap/ap_config.c           |   15 ++
 src/ap/ap_config.h           |    4 +
 src/ap/ap_drv_ops.h          |   27 +++
 src/ap/drv_callbacks.c       |  139 +++++++++++++-
 src/ap/hostapd.c             |    2 +
 src/ap/hostapd.h             |   24 +++
 src/ap/hw_features.c         |  188 +++++++++++------
 src/drivers/driver.h         |  171 +++++++++++++++-
 src/drivers/driver_nl80211.c |  193 ++++++++++++++++++
 15 files changed, 1290 insertions(+), 71 deletions(-)
 create mode 100644 src/ap/acs.c
 create mode 100644 src/ap/acs.h

-- 
1.7.4.15.g7811d


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

* [PATCH 3/4] hostapd: add survey dump support
  2011-06-23  3:50 [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
@ 2011-06-23  3:50 ` Luis R. Rodriguez
  2011-06-23  3:58 ` [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2011-06-23  3:50 UTC (permalink / raw)
  To: hostap; +Cc: linux-wireless, Luis R. Rodriguez

This adds survey dump support for all frequencies
and for specific desired frequencies. This will later
be used by ACS code for spectrum heuristics.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 src/ap/ap_drv_ops.h          |   15 +++
 src/ap/drv_callbacks.c       |   72 +++++++++++++++-
 src/ap/hostapd.h             |    8 ++
 src/drivers/driver.h         |   89 +++++++++++++++++++-
 src/drivers/driver_nl80211.c |  193 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 375 insertions(+), 2 deletions(-)

diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index a62e1e5..24c7e95 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -213,4 +213,19 @@ static inline int hostapd_drv_remain_on_channel(struct hostapd_data *hapd,
 	return hapd->driver->remain_on_channel(hapd->drv_priv, freq, duration);
 }
 
+static inline int hostapd_drv_survey_freq(struct hostapd_data *hapd,
+					  unsigned int freq)
+{
+	if (hapd->driver == NULL)
+		return -1;
+        if (!hapd->driver->get_survey)
+		return -1;
+	return hapd->driver->get_survey(hapd->drv_priv, freq);
+}
+
+static inline int hostapd_drv_survey(struct hostapd_data *hapd)
+{
+	return hostapd_drv_survey_freq(hapd, 0);
+}
+
 #endif /* AP_DRV_OPS */
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index 676fac1..6953b71 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -545,6 +545,73 @@ static void hostapd_event_roc_cancel(struct hostapd_data *hapd,
 	/* XXX: pass err to listeners, no one yet */
 }
 
+struct hostapd_channel_data *hostapd_get_mode_channel(struct hostapd_iface *iface,
+						      unsigned int freq)
+{
+	unsigned int i;
+	struct hostapd_channel_data *chan;
+
+	for (i = 0; i < iface->current_mode->num_channels; i++) {
+		chan = &iface->current_mode->channels[i];
+		if (!chan)
+			return NULL;
+		if (chan->freq == freq)
+			return chan;
+	}
+
+	return NULL;
+}
+
+static void hostapd_update_nf(struct hostapd_iface *iface,
+			      struct hostapd_channel_data *chan,
+			      struct freq_survey *survey)
+{
+	if (!iface->chans_surveyed) {
+		chan->min_nf = survey->nf;
+		iface->lowest_nf = survey->nf;
+	} else {
+		if (!chan->survey_count)
+			chan->min_nf = survey->nf;
+		else if (survey->nf < chan->min_nf)
+			chan->min_nf = survey->nf;
+		if (survey->nf < iface->lowest_nf)
+			iface->lowest_nf = survey->nf;
+	}
+}
+
+static void hostapd_event_get_survey(struct hostapd_data *hapd,
+				     struct survey_results *survey_results)
+{
+	struct hostapd_iface *iface = hapd->iface;
+	struct freq_survey *survey, *tmp;
+	struct hostapd_channel_data *chan;
+
+	if (dl_list_empty(&survey_results->survey_list)) {
+		wpa_printf(MSG_DEBUG, "ACS: no survey data received");
+                return;
+	}
+
+	dl_list_for_each_safe(survey, tmp, &survey_results->survey_list, struct freq_survey, list_member) {
+		chan = hostapd_get_mode_channel(iface, survey->freq);
+		if (!chan)
+			goto fail;
+		if (chan->flag & HOSTAPD_CHAN_DISABLED)
+			continue;
+
+		dl_list_del(&survey->list_member);
+		dl_list_add_tail(&chan->survey_list, &survey->list_member);
+
+		hostapd_update_nf(iface, chan, survey);
+
+		chan->survey_count++;
+		iface->chans_surveyed++;
+	}
+
+	return;
+fail:
+	iface->chans_surveyed = 0;
+}
+
 void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 			  union wpa_event_data *data)
 {
@@ -633,6 +700,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 		    data->rx_action.bssid == NULL)
 			break;
 		hostapd_rx_action(hapd, &data->rx_action);
+#endif /* NEED_AP_MLME */
 	case EVENT_REMAIN_ON_CHANNEL:
 		hostapd_event_roc(hapd,
 				  data->remain_on_channel.freq,
@@ -643,7 +711,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 					 data->remain_on_channel.freq,
 					 data->remain_on_channel.duration);
 		break;
-#endif /* NEED_AP_MLME */
+	case EVENT_SURVEY:
+		hostapd_event_get_survey(hapd, &data->survey_results);
+		break;
 	default:
 		wpa_printf(MSG_DEBUG, "Unknown event %d", event);
 		break;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index d8318ee..1095d2b 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -231,6 +231,14 @@ struct hostapd_iface {
 	/* Offchannel operation helper */
 	unsigned int off_channel_freq_idx;
 
+	/* surveying helpers */
+
+	/* number of channels surveyed */
+	unsigned int chans_surveyed;
+
+	/* lowest observed noise floor in dBm */
+	s8 lowest_nf;
+
 	void (*scan_cb)(struct hostapd_iface *iface);
 
 	int (*ctrl_iface_init)(struct hostapd_data *hapd);
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 513580a..0e1c5c1 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -26,6 +26,7 @@
 #define WPA_SUPPLICANT_DRIVER_VERSION 4
 
 #include "common/defs.h"
+#include "list.h"
 
 #define HOSTAPD_CHAN_DISABLED 0x00000001
 #define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002
@@ -58,6 +59,22 @@ struct hostapd_channel_data {
 	 * max_tx_power - maximum transmit power in dBm
 	 */
 	u8 max_tx_power;
+
+	/*
+	 * survey_count - number of surveys XXX: can we remove this and use the count of the linked list?
+	 */
+        unsigned int survey_count;
+
+	/*
+	 * survey_list - linked list of surveys
+	 */
+	struct dl_list survey_list;
+
+	/**
+	 * min_nf - minimum observed noise floor, in dBm, based on all surveyed channel data
+	 */
+	s8 min_nf;
+
 };
 
 /**
@@ -2253,6 +2270,30 @@ struct wpa_driver_ops {
 	 * implementation, there is no need to implement this function.
 	 */
 	int (*set_authmode)(void *priv, int authmode);
+
+	/**
+	 * get_survey - Retrieve survey data
+	 * @priv: Private driver interface data
+	 * @freq: if set survey data for the specified frequency is only
+	 *	being requested. If not set all survey data is requested.
+	 * Returns: 0 on success, -1 on failure
+	 *
+	 * Use this to retreieve:
+	 *
+	 * - the observed channel noise floor
+	 * - the amount of time we have spent on the channel
+	 * - the amount of time during which we have spent on the channel that
+	 *   the radio has determined the the medium is busy and we cannot transmit
+	 * - the amount of time we have spent RX'ing data
+	 * - the amount of time we have spent TX'ing data
+	 *
+	 * This data can be use for spectrum heuristics, one example is
+	 * Automatic Channel Selection (ACS). The channel survey data is
+	 * kept on a linked list on the channel data, one entry is added
+	 * for each survey. The min_nf of the channel is updated for
+	 * each survey.
+	 */
+	int (*get_survey)(void *priv, unsigned int freq);
 };
 
 
@@ -2655,9 +2696,44 @@ enum wpa_event_type {
 	/**
 	 * EVENT_IBSS_PEER_LOST - IBSS peer not reachable anymore
 	 */
-	EVENT_IBSS_PEER_LOST
+	EVENT_IBSS_PEER_LOST,
+
+	/**
+	 * EVENT_SURVEY - Received survey data
+	 *
+	 * This event gets triggered when a driver query is issued for survey
+	 * data and its returned. The returned data is stored in
+	 * struct survey_results. The results provide at most one survey
+	 * entry for each frequency and at minimum will provide survey
+	 * one survey entry for one frequency. The survey data can be
+	 * os_malloc()'d and then os_free()'d, so the event callback must
+	 * only copy data.
+	 */
+	EVENT_SURVEY,
 };
 
+/**
+ * struct survey_info - channel survey info
+ *
+ * @ifidx: interface index in which this survey was observed
+ * @freq: center of frequency of the surveyed channel
+ * @nf: channel noise floor in dBm
+ * @channel_time: amount of time in ms the radio spent on the channel
+ * @channel_time_busy: amount of time in ms the radio detected some signal
+ *	that indicated to the radio the channel was not clear
+ * @channel_time_rx: amount of time the radio spent receiving data
+ * @channel_time_tx: amount of time the radio spent transmitting data
+ */
+struct freq_survey {
+	u32 ifidx;
+	unsigned int freq;
+	s8 nf;
+	u64 channel_time;
+	u64 channel_time_busy;
+	u64 channel_time_rx;
+	u64 channel_time_tx;
+	struct dl_list list_member;
+};
 
 /**
  * union wpa_event_data - Additional data for wpa_supplicant_event() calls
@@ -3187,6 +3263,17 @@ union wpa_event_data {
 	struct ibss_peer_lost {
 		u8 peer[ETH_ALEN];
 	} ibss_peer_lost;
+
+	/**
+	 * survey_results - survey result data for EVENT_SURVEY
+	 * @freq_filter: requested frequency survey filter, 0 if request
+	 *	was for all survey data
+	 * @survey_list: linked list of survey data
+	 */
+	struct survey_results {
+		unsigned int freq_filter;
+		struct dl_list survey_list;
+	} survey_results;
 };
 
 /**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index cfc9372..e5c4962 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6603,6 +6603,198 @@ static int nl80211_flush_pmkid(void *priv)
 	return nl80211_pmkid(bss, NL80211_CMD_FLUSH_PMKSA, NULL, NULL);
 }
 
+static void clean_survey_results(struct survey_results *survey_results)
+{
+	struct freq_survey *survey, *tmp;
+
+	if (dl_list_empty(&survey_results->survey_list))
+		return;
+
+	dl_list_for_each_safe(survey, tmp, &survey_results->survey_list, struct freq_survey, list_member) {
+		dl_list_del(&survey->list_member);
+		os_free(survey);
+	}
+}
+
+static void add_survey(struct nlattr **sinfo, u32 ifidx, struct dl_list *survey_list)
+{
+	struct freq_survey *survey;
+
+	survey = (struct freq_survey*) os_malloc(sizeof(struct freq_survey));
+	if  (!survey)
+		return;
+	os_memset(survey, 0, sizeof(struct freq_survey));
+
+	survey->ifidx = ifidx;
+	survey->freq = nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]);
+	survey->nf = (int8_t) nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE]);
+	survey->channel_time = nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME]);
+	survey->channel_time_busy = nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY]);
+	survey->channel_time_rx = nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]);
+	survey->channel_time_tx = nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]);
+
+	wpa_printf(MSG_DEBUG, "nl80211: Freq survey dump event  (freq=%d MHz noise=%d "
+		   "channel_time=%ld busy_time=%ld tx_time=%ld rx_time=%ld)",
+		   survey->freq,
+		   survey->nf,
+		   survey->channel_time,
+		   survey->channel_time_busy,
+		   survey->channel_time_rx,
+		   survey->channel_time_tx);
+
+	dl_list_add_tail(survey_list, &survey->list_member);
+}
+
+static int survey_check(struct nlattr **sinfo)
+{
+	if (!sinfo[NL80211_SURVEY_INFO_NOISE] ||
+	    !sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME] ||
+	    !sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY] ||
+	    !sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX])
+		return 0;
+	return 1;
+}
+
+static void survey_fail_reason(struct nlattr **sinfo, u32 surveyed_freq)
+{
+	wpa_printf(MSG_ERROR,
+		   "nl80211: Following survey data missing "
+		   "for freq %d MHz:",
+		   surveyed_freq);
+
+	if (!sinfo[NL80211_SURVEY_INFO_NOISE])
+		wpa_printf(MSG_ERROR, "\tnoise");
+
+	if (!sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME])
+		wpa_printf(MSG_ERROR, "\tchannel time");
+
+	if (!sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY])
+		wpa_printf(MSG_ERROR, "\tchannel busy time");
+
+	if (!sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX])
+		wpa_printf(MSG_ERROR, "\tchannel tx time");
+}
+
+static int check_survey_ok(struct nlattr **sinfo,
+			   u32 surveyed_freq,
+			   unsigned int freq_filter)
+{
+	int good_survey = survey_check(sinfo);
+
+	/* If no filter is specified we just drop data for any bogus survey */
+	if (!freq_filter) {
+		if (good_survey)
+			return 1;
+		/* No filter used but no usable survey data found */
+		survey_fail_reason(sinfo, surveyed_freq);
+		return 0;
+	}
+
+	if (freq_filter != surveyed_freq)
+		return 0;
+
+	if (good_survey)
+		return 1;
+	/* Filter matches now, lets be verbose why this is a bad survey */
+
+	survey_fail_reason(sinfo, surveyed_freq);
+	return 0;
+}
+
+static int survey_handler(struct nl_msg *msg, void *arg)
+{
+	struct nlattr *tb[NL80211_ATTR_MAX + 1];
+	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+	struct nlattr *sinfo[NL80211_SURVEY_INFO_MAX + 1];
+	struct survey_results *survey_results;
+	u32 surveyed_freq = 0;
+	u32 ifidx;
+
+	static struct nla_policy survey_policy[NL80211_SURVEY_INFO_MAX + 1] = {
+		[NL80211_SURVEY_INFO_FREQUENCY] = { .type = NLA_U32 },
+		[NL80211_SURVEY_INFO_NOISE] = { .type = NLA_U8 },
+	};
+
+	survey_results = (struct survey_results *) arg;
+
+	nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+		  genlmsg_attrlen(gnlh, 0), NULL);
+
+	ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
+
+	if (!tb[NL80211_ATTR_SURVEY_INFO])
+		return NL_SKIP;
+
+	if (nla_parse_nested(sinfo, NL80211_SURVEY_INFO_MAX,
+			     tb[NL80211_ATTR_SURVEY_INFO],
+			     survey_policy))
+		return NL_SKIP;
+
+	if (!sinfo[NL80211_SURVEY_INFO_FREQUENCY]) {
+		wpa_printf(MSG_ERROR, "nl80211: invalid survey data");
+		return NL_SKIP;
+	}
+
+	surveyed_freq = nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]);
+
+	if (!check_survey_ok(sinfo, surveyed_freq, survey_results->freq_filter))
+		return NL_SKIP;
+
+	if (survey_results->freq_filter &&
+	    survey_results->freq_filter != surveyed_freq) {
+		wpa_printf(MSG_EXCESSIVE, "nl80211: ignoring survey data "
+			   "for freq %d MHz", surveyed_freq);
+		return NL_SKIP;
+	}
+
+	add_survey(sinfo, ifidx, &survey_results->survey_list);
+
+	return NL_SKIP;
+}
+
+static int wpa_driver_nl80211_get_survey(void *priv, unsigned int freq)
+{
+	struct i802_bss *bss = priv;
+	struct wpa_driver_nl80211_data *drv = bss->drv;
+	struct nl_msg *msg;
+	int err = -ENOBUFS;
+	union wpa_event_data data;
+	struct survey_results *survey_results;
+
+	os_memset(&data, 0, sizeof(data));
+	survey_results = &data.survey_results;
+
+	dl_list_init(&survey_results->survey_list);
+
+	msg = nlmsg_alloc();
+	if (!msg)
+		goto nla_put_failure;
+
+	genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, NLM_F_DUMP,
+		    NL80211_CMD_GET_SURVEY, 0);
+
+	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
+
+	if (freq)
+		data.survey_results.freq_filter = freq;
+
+	do {
+		err = send_and_recv_msgs(drv, msg, survey_handler, survey_results);
+	} while (err > 0);
+
+	if (err) {
+		wpa_printf(MSG_ERROR, "nl80211: failed to process survey data");
+		goto out_clean;
+	}
+
+	wpa_supplicant_event(drv->ctx, EVENT_SURVEY, &data);
+
+out_clean:
+	clean_survey_results(survey_results);
+nla_put_failure:
+	return err;
+}
+
 
 const struct wpa_driver_ops wpa_driver_nl80211_ops = {
 	.name = "nl80211",
@@ -6676,4 +6868,5 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
 	.add_pmkid = nl80211_add_pmkid,
 	.remove_pmkid = nl80211_remove_pmkid,
 	.flush_pmkid = nl80211_flush_pmkid,
+	.get_survey = wpa_driver_nl80211_get_survey,
 };
-- 
1.7.4.15.g7811d


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

* Re: [PATCH 0/4] hostapd: add ACS support
  2011-06-23  3:50 [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
  2011-06-23  3:50 ` [PATCH 3/4] hostapd: add survey dump support Luis R. Rodriguez
@ 2011-06-23  3:58 ` Luis R. Rodriguez
  2011-07-11  8:11 ` Swaminathan Vasanth
  2011-07-15 21:38 ` Swaminathan Vasanth
  3 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2011-06-23  3:58 UTC (permalink / raw)
  To: hostap; +Cc: Luis R. Rodriguez, linux-wireless

On Wed, Jun 22, 2011 at 8:50 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> Test results, rants are appreciated.

For the impatient, just wget and git am this all-in-one file (as soon
as kernel.org synchs)

http://www.kernel.org/pub/linux/kernel/people/mcgrof/patches/hostapd/acs-all-in-one-v1.patch

  Luis

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

* Re: [PATCH 0/4] hostapd: add ACS support
  2011-06-23  3:50 [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
  2011-06-23  3:50 ` [PATCH 3/4] hostapd: add survey dump support Luis R. Rodriguez
  2011-06-23  3:58 ` [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
@ 2011-07-11  8:11 ` Swaminathan Vasanth
  2011-07-15 21:38 ` Swaminathan Vasanth
  3 siblings, 0 replies; 7+ messages in thread
From: Swaminathan Vasanth @ 2011-07-11  8:11 UTC (permalink / raw)
  To: linux-wireless

Luis R. Rodriguez <lrodriguez@...> writes:

> Other algorithms for ACS shoudl be easy to plug in, for example,
> spectral scan ;)
> 
> Anyway, to enable and test this thing just set CONFIG_ACS=1
> on your build config and then something like this on your
> hostapd.conf:
> 
> channel=acs_survey
> acs_num_req_surveys=10
> acs_roc_duration_ms=100
> 
> Test results, rants are appreciated.

I am willing to test the hostapd auto channel selection implementation by
integrating it with Openwrt firmware with Netgear WNDR 3700 Router. Currently i
got the patch (acs-all-in-one-v1.patch) and integrating it with the stable
release of hostapd 0.6.10. 

Hope it will be useful for you. 

BR,
Vasanth 
> 
> Luis R. Rodriguez (4):
>   hostapd: split up channel checking into helpers
>   hostapd: add offchannel support
>   hostapd: add survey dump support
>   hostapd: add Automatic Channel Selection (ACS) support



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

* Re: [PATCH 0/4] hostapd: add ACS support
  2011-06-23  3:50 [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
                   ` (2 preceding siblings ...)
  2011-07-11  8:11 ` Swaminathan Vasanth
@ 2011-07-15 21:38 ` Swaminathan Vasanth
  2011-07-21 20:29   ` Luis R. Rodriguez
  3 siblings, 1 reply; 7+ messages in thread
From: Swaminathan Vasanth @ 2011-07-15 21:38 UTC (permalink / raw)
  To: linux-wireless

> Other algorithms for ACS shoudl be easy to plug in, for example,
> spectral scan ;)
> 
> Anyway, to enable and test this thing just set CONFIG_ACS=1
> on your build config and then something like this on your
> hostapd.conf:
> 
> channel=acs_survey
> acs_num_req_surveys=10
> acs_roc_duration_ms=100
> 
> Test results, rants are appreciated.
>

Hi,

 I am trying to enable the Auto Channel Selection in hostapd with ath5k and
ath9k drivers. I cloned the source of hostap from the git and applied the patch
( 
http://www.kernel.org/pub/linux/kernel/people/mcgrof/patches/hostapd/acs-all-in-one-v2.patch
). I then went to the hostapd directory of hostap and did make and make install.
Followed instruction from (
http://wireless.kernel.org/en/users/Documentation/hostapd#Download_and_compile_hostapd
).

While building the software i enabled CONFIG_ACS=y in  the defconfig file
present in /hostap/hostapd/ to .config and performed the build. I then did a
make install and configured the hostapd.conf file.

Hostapd is working fine for me without ACS but when i enable channel=0 or
channel=acs_survey and uncomment the

acs_num_req_surveys=10
acs_roc_duration_ms=5

options for ACS to be enabled it throws this error when starting hostapd,


> sudo hostapd hostapd.conf

Configuration file: hostapd.conf
Line 113: set as '0' tries to enable ACS but CONFIG_ACS disabled
Line 125: invalid acs_num_req_surveys 10 (CONFIG_ACS disabled)
Line 126: invalid acs_roc_duration_ms 5 (CONFIG_ACS disabled)1..5000)
3 errors found in configuration file 'hostapd.conf'

Infact i enabled CONFIG_ACS when building.


Any pointers on what to do to enable ACS please.

Awaiting your kind reply.

Thanks,







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

* Re: [PATCH 0/4] hostapd: add ACS support
  2011-07-15 21:38 ` Swaminathan Vasanth
@ 2011-07-21 20:29   ` Luis R. Rodriguez
  0 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2011-07-21 20:29 UTC (permalink / raw)
  To: Swaminathan Vasanth; +Cc: linux-wireless

On Fri, Jul 15, 2011 at 2:38 PM, Swaminathan Vasanth
<swaminathanvasanth.r@gmail.com> wrote:
>> Other algorithms for ACS shoudl be easy to plug in, for example,
>> spectral scan ;)
>>
>> Anyway, to enable and test this thing just set CONFIG_ACS=1
>> on your build config and then something like this on your
>> hostapd.conf:
>>
>> channel=acs_survey
>> acs_num_req_surveys=10
>> acs_roc_duration_ms=100
>>
>> Test results, rants are appreciated.
>>
>
> Hi,
>
>  I am trying to enable the Auto Channel Selection in hostapd with ath5k and
> ath9k drivers. I cloned the source of hostap from the git and applied the patch
> (
> http://www.kernel.org/pub/linux/kernel/people/mcgrof/patches/hostapd/acs-all-in-one-v2.patch
> ). I then went to the hostapd directory of hostap and did make and make install.
> Followed instruction from (
> http://wireless.kernel.org/en/users/Documentation/hostapd#Download_and_compile_hostapd
> ).
>
> While building the software i enabled CONFIG_ACS=y in  the defconfig file
> present in /hostap/hostapd/ to .config and performed the build. I then did a
> make install and configured the hostapd.conf file.
>
> Hostapd is working fine for me without ACS but when i enable channel=0 or
> channel=acs_survey and uncomment the
>
> acs_num_req_surveys=10
> acs_roc_duration_ms=5
>
> options for ACS to be enabled it throws this error when starting hostapd,
>
>
>> sudo hostapd hostapd.conf
>
> Configuration file: hostapd.conf
> Line 113: set as '0' tries to enable ACS but CONFIG_ACS disabled
> Line 125: invalid acs_num_req_surveys 10 (CONFIG_ACS disabled)
> Line 126: invalid acs_roc_duration_ms 5 (CONFIG_ACS disabled)1..5000)
> 3 errors found in configuration file 'hostapd.conf'
>
> Infact i enabled CONFIG_ACS when building.

Hmm, try:

make V=1 | grep -i ACS

> Any pointers on what to do to enable ACS please.
>
> Awaiting your kind reply.

I'm about to respin these patches to apply to the latest hostapd.git
with 1 fix. Try that.

  Luis

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

* [PATCH 0/4] hostapd: add ACS support
@ 2011-06-23  3:50 Luis R. Rodriguez
  0 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2011-06-23  3:50 UTC (permalink / raw)
  To: hostap; +Cc: linux-wireless, Luis R. Rodriguez

This series adds ACS support to hostapd. I've completed
a few of my own TODOs and splitted up the patches as
best as possible. I'm pretty satisfied with this code now
as an initial start for ACS code. At this point we need
to start finding ideal values for the metrics for offchannel
operation so that we can consistently always find the same
channel, even if it means surveying longer or doing more
scans.

Other algorithms for ACS shoudl be easy to plug in, for example,
spectral scan ;)

Anyway, to enable and test this thing just set CONFIG_ACS=1
on your build config and then something like this on your
hostapd.conf:

channel=acs_survey
acs_num_req_surveys=10
acs_roc_duration_ms=100

Test results, rants are appreciated.

Luis R. Rodriguez (4):
  hostapd: split up channel checking into helpers
  hostapd: add offchannel support
  hostapd: add survey dump support
  hostapd: add Automatic Channel Selection (ACS) support

 hostapd/Makefile             |    5 +
 hostapd/config_file.c        |   47 ++++-
 hostapd/defconfig            |   25 +++
 hostapd/hostapd.conf         |   17 ++
 src/ap/acs.c                 |  464 ++++++++++++++++++++++++++++++++++++++++++
 src/ap/acs.h                 |   40 ++++
 src/ap/ap_config.c           |   15 ++
 src/ap/ap_config.h           |    4 +
 src/ap/ap_drv_ops.h          |   27 +++
 src/ap/drv_callbacks.c       |  139 +++++++++++++-
 src/ap/hostapd.c             |    2 +
 src/ap/hostapd.h             |   24 +++
 src/ap/hw_features.c         |  188 +++++++++++------
 src/drivers/driver.h         |  171 +++++++++++++++-
 src/drivers/driver_nl80211.c |  193 ++++++++++++++++++
 15 files changed, 1290 insertions(+), 71 deletions(-)
 create mode 100644 src/ap/acs.c
 create mode 100644 src/ap/acs.h

-- 
1.7.4.15.g7811d


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

end of thread, other threads:[~2011-07-21 20:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-23  3:50 [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
2011-06-23  3:50 ` [PATCH 3/4] hostapd: add survey dump support Luis R. Rodriguez
2011-06-23  3:58 ` [PATCH 0/4] hostapd: add ACS support Luis R. Rodriguez
2011-07-11  8:11 ` Swaminathan Vasanth
2011-07-15 21:38 ` Swaminathan Vasanth
2011-07-21 20:29   ` Luis R. Rodriguez
  -- strict thread matches above, loose matches on Subject: below --
2011-06-23  3:50 Luis R. Rodriguez

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.