All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Survey mode volunteers
       [not found]   ` <0290AB2F0A8E124B9FFC144088A1A95609D6096AB9@EX-MBS04.nbl.local>
@ 2010-04-12 18:04     ` Luis R. Rodriguez
  2010-04-14  7:11       ` Holger Schurig
  0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-04-12 18:04 UTC (permalink / raw)
  To: Anton Puolakka; +Cc: Luis Rodriguez, linux-wireless

On Fri, Apr 09, 2010 at 06:58:06AM -0700, Anton Puolakka wrote:
> 
> Hello,
> 
> 
> File nl80211.c contains function nl80211_dump_survey(...)
> but as soon as the relevant input parameter checks are done, we soon encounter EOPNOTSUPPORTED. The support would be more than welcomed so we are investigating the option to participate to the development.
> 

> So, the possible futures of supporting this network link layer dump_survey functionality in ath9k could be one of the following:
> 
> 1. shall never be there
> 2. we do not know yet, we should think about the design at some point
> 3. should be there but we've been busy enough with other stuff

This is the case, if someone gets to it, that would be great. Please
use the linux-wireless list moving forward.

  Luis

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

* Re: Survey mode volunteers
  2010-04-12 18:04     ` Survey mode volunteers Luis R. Rodriguez
@ 2010-04-14  7:11       ` Holger Schurig
  2010-04-14 17:30         ` Luis R. Rodriguez
  2010-04-15 11:15         ` Anton Puolakka
  0 siblings, 2 replies; 6+ messages in thread
From: Holger Schurig @ 2010-04-14  7:11 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Anton Puolakka, Luis Rodriguez, linux-wireless

I've some preliminary patch for ath5k.

---
Subject: [ath5k] add noise reporting to survey

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>

---
 drivers/net/wireless/ath/ath5k/base.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

--- compat-wireless-2010-03-15.orig/drivers/net/wireless/ath/ath5k/base.c
+++ compat-wireless-2010-03-15/drivers/net/wireless/ath/ath5k/base.c
@@ -273,6 +273,8 @@ static int ath5k_set_key(struct ieee8021
 		struct ieee80211_key_conf *key);
 static int ath5k_get_stats(struct ieee80211_hw *hw,
 		struct ieee80211_low_level_stats *stats);
+static int ath5k_get_survey(struct ieee80211_hw *hw,
+		int idx, struct survey_info *survey);
 static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
 static void ath5k_set_tsf(struct ieee80211_hw *hw, u64 tsf);
 static void ath5k_reset_tsf(struct ieee80211_hw *hw);
@@ -298,6 +300,7 @@ static const struct ieee80211_ops ath5k_
 	.configure_filter = ath5k_configure_filter,
 	.set_key 	= ath5k_set_key,
 	.get_stats 	= ath5k_get_stats,
+	.get_survey	= ath5k_get_survey,
 	.conf_tx 	= NULL,
 	.get_tsf 	= ath5k_get_tsf,
 	.set_tsf 	= ath5k_set_tsf,
@@ -3250,6 +3253,22 @@ ath5k_get_stats(struct ieee80211_hw *hw,
 
 	return 0;
 }
+
+static int ath5k_get_survey(struct ieee80211_hw *hw, int idx,
+		struct survey_info *survey)
+{
+	struct ath5k_softc *sc = hw->priv;
+	struct ieee80211_conf *conf = &hw->conf;
+
+	 if (idx != 0)
+		return -ENOENT;
+
+	survey->channel = conf->channel;
+	survey->filled = SURVEY_INFO_NOISE_DBM;
+	survey->noise = sc->ah->ah_noise_floor;
+
+	return 0;
+}
 
 static u64
 ath5k_get_tsf(struct ieee80211_hw *hw)


-- 
http://www.holgerschurig.de

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

* Re: Survey mode volunteers
  2010-04-14  7:11       ` Holger Schurig
@ 2010-04-14 17:30         ` Luis R. Rodriguez
  2010-04-16  6:45           ` Holger Schurig
  2010-04-15 11:15         ` Anton Puolakka
  1 sibling, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-04-14 17:30 UTC (permalink / raw)
  To: Holger Schurig
  Cc: Luis Rodriguez, Anton Puolakka, Benoit PAPILLAULT, linux-wireless

On Wed, Apr 14, 2010 at 12:11:11AM -0700, Holger Schurig wrote:
> I've some preliminary patch for ath5k.
> 
> ---
> Subject: [ath5k] add noise reporting to survey
> 
> Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
> 
> ---
>  drivers/net/wireless/ath/ath5k/base.c |   19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> --- compat-wireless-2010-03-15.orig/drivers/net/wireless/ath/ath5k/base.c
> +++ compat-wireless-2010-03-15/drivers/net/wireless/ath/ath5k/base.c
> @@ -273,6 +273,8 @@ static int ath5k_set_key(struct ieee8021
>  		struct ieee80211_key_conf *key);
>  static int ath5k_get_stats(struct ieee80211_hw *hw,
>  		struct ieee80211_low_level_stats *stats);
> +static int ath5k_get_survey(struct ieee80211_hw *hw,
> +		int idx, struct survey_info *survey);
>  static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
>  static void ath5k_set_tsf(struct ieee80211_hw *hw, u64 tsf);
>  static void ath5k_reset_tsf(struct ieee80211_hw *hw);
> @@ -298,6 +300,7 @@ static const struct ieee80211_ops ath5k_
>  	.configure_filter = ath5k_configure_filter,
>  	.set_key 	= ath5k_set_key,
>  	.get_stats 	= ath5k_get_stats,
> +	.get_survey	= ath5k_get_survey,
>  	.conf_tx 	= NULL,
>  	.get_tsf 	= ath5k_get_tsf,
>  	.set_tsf 	= ath5k_set_tsf,
> @@ -3250,6 +3253,22 @@ ath5k_get_stats(struct ieee80211_hw *hw,
>  
>  	return 0;
>  }
> +
> +static int ath5k_get_survey(struct ieee80211_hw *hw, int idx,
> +		struct survey_info *survey)
> +{
> +	struct ath5k_softc *sc = hw->priv;
> +	struct ieee80211_conf *conf = &hw->conf;
> +
> +	 if (idx != 0)
> +		return -ENOENT;
> +
> +	survey->channel = conf->channel;
> +	survey->filled = SURVEY_INFO_NOISE_DBM;
> +	survey->noise = sc->ah->ah_noise_floor;
> +
> +	return 0;
> +}

Nice, it should be very similar for ath9k BTW, one enhancement which we've
been meanint to address but haven't had the time yet is to split noise floor
per channel. This can be seen how its done on the legacy HAL with the code
sprinkled with the ATH_NF_PER_CHAN ifdef.

  Luis


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

* RE: Survey mode volunteers
  2010-04-14  7:11       ` Holger Schurig
  2010-04-14 17:30         ` Luis R. Rodriguez
@ 2010-04-15 11:15         ` Anton Puolakka
  2010-04-16  6:47           ` Holger Schurig
  1 sibling, 1 reply; 6+ messages in thread
From: Anton Puolakka @ 2010-04-15 11:15 UTC (permalink / raw)
  To: Holger Schurig; +Cc: Luis Rodriguez, linux-wireless


Hi,

and thanks for this.

We checked the most recent wireless-testing and saw no related patch on mac80211 yet. So, Holger, do You have one for that, too? Or anyone else on the mailing-list? Could You please share?


Kind regards,
Anton




-----Original Message-----
From: Holger Schurig [mailto:holgerschurig@gmail.com] 
Sent: 14. huhtikuuta 2010 10:11
To: Luis R. Rodriguez
Cc: Anton Puolakka; Luis Rodriguez; linux-wireless@vger.kernel.org
Subject: Re: Survey mode volunteers

I've some preliminary patch for ath5k.

---
Subject: [ath5k] add noise reporting to survey

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>

---
 drivers/net/wireless/ath/ath5k/base.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

--- compat-wireless-2010-03-15.orig/drivers/net/wireless/ath/ath5k/base.c
+++ compat-wireless-2010-03-15/drivers/net/wireless/ath/ath5k/base.c
@@ -273,6 +273,8 @@ static int ath5k_set_key(struct ieee8021
 		struct ieee80211_key_conf *key);
 static int ath5k_get_stats(struct ieee80211_hw *hw,
 		struct ieee80211_low_level_stats *stats);
+static int ath5k_get_survey(struct ieee80211_hw *hw,
+		int idx, struct survey_info *survey);
 static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
 static void ath5k_set_tsf(struct ieee80211_hw *hw, u64 tsf);
 static void ath5k_reset_tsf(struct ieee80211_hw *hw);
@@ -298,6 +300,7 @@ static const struct ieee80211_ops ath5k_
 	.configure_filter = ath5k_configure_filter,
 	.set_key 	= ath5k_set_key,
 	.get_stats 	= ath5k_get_stats,
+	.get_survey	= ath5k_get_survey,
 	.conf_tx 	= NULL,
 	.get_tsf 	= ath5k_get_tsf,
 	.set_tsf 	= ath5k_set_tsf,
@@ -3250,6 +3253,22 @@ ath5k_get_stats(struct ieee80211_hw *hw,
 
 	return 0;
 }
+
+static int ath5k_get_survey(struct ieee80211_hw *hw, int idx,
+		struct survey_info *survey)
+{
+	struct ath5k_softc *sc = hw->priv;
+	struct ieee80211_conf *conf = &hw->conf;
+
+	 if (idx != 0)
+		return -ENOENT;
+
+	survey->channel = conf->channel;
+	survey->filled = SURVEY_INFO_NOISE_DBM;
+	survey->noise = sc->ah->ah_noise_floor;
+
+	return 0;
+}
 
 static u64
 ath5k_get_tsf(struct ieee80211_hw *hw)


-- 
http://www.holgerschurig.de

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

* Re: Survey mode volunteers
  2010-04-14 17:30         ` Luis R. Rodriguez
@ 2010-04-16  6:45           ` Holger Schurig
  0 siblings, 0 replies; 6+ messages in thread
From: Holger Schurig @ 2010-04-16  6:45 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Luis Rodriguez, Anton Puolakka, Benoit PAPILLAULT, linux-wireless

> Nice, it should be very similar for ath9k

... but please be aware that is is only about 20% of survey. Things that need 
to be addressed are the reporting of some kind of duty-cycle (how much is this 
channel occupied) and logic inside scanning to actually trigger this for 
channels other than the current one.

> BTW, one enhancement which we've
> been meanint to address but haven't had the time yet is to split noise
> floor per channel. This can be seen how its done on the legacy HAL with
> the code sprinkled with the ATH_NF_PER_CHAN ifdef.

Nice, knowing the noise-per-channel AND the channel occupation would be quite 
helpful to select the "best" channel.

-- 
http://www.holgerschurig.de

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

* Re: Survey mode volunteers
  2010-04-15 11:15         ` Anton Puolakka
@ 2010-04-16  6:47           ` Holger Schurig
  0 siblings, 0 replies; 6+ messages in thread
From: Holger Schurig @ 2010-04-16  6:47 UTC (permalink / raw)
  To: Anton Puolakka; +Cc: Luis Rodriguez, linux-wireless

> We checked the most recent wireless-testing and saw no related patch on
> mac80211 yet. So, Holger, do You have one for that, too? Or anyone else on
> the mailing-list? Could You please share?

Sure. I thought I already posted that patch. This is a patch that
applied to compat-wireless 2010-03-23:

---------------
Subject: [PATCH] mac80211: sample survey implementation for mac80211_hwsim

This adds the survey function to both mac80211 itself and to mac80211_hwsim.
For the latter driver, we simply invent some noise level.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>

---
 drivers/net/wireless/mac80211_hwsim.c |   28 ++++++++++++++++++++++++++++
 include/net/mac80211.h                |    3 ++-
 net/mac80211/cfg.c                    |   12 ++++++++++++
 net/mac80211/driver-ops.h             |    9 +++++++++
 4 files changed, 51 insertions(+), 1 deletion(-)

--- compat-wireless-2010-03-15.orig/include/net/mac80211.h
+++ compat-wireless-2010-03-15/include/net/mac80211.h
@@ -1646,7 +1646,8 @@ struct ieee80211_ops {
 			    struct ieee80211_vif *vif,
 			    enum ieee80211_ampdu_mlme_action action,
 			    struct ieee80211_sta *sta, u16 tid, u16 *ssn);
-
+	int (*get_survey)(struct ieee80211_hw *hw, int idx,
+		struct survey_info *survey);
 	void (*rfkill_poll)(struct ieee80211_hw *hw);
 	void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
 #ifdef CONFIG_NL80211_TESTMODE
--- compat-wireless-2010-03-15.orig/net/mac80211/cfg.c
+++ compat-wireless-2010-03-15/net/mac80211/cfg.c
@@ -412,6 +412,17 @@ static int ieee80211_dump_station(struct
 	return ret;
 }
 
+static int ieee80211_dump_survey(struct wiphy *wiphy, struct net_device *dev,
+				 int idx, struct survey_info *survey)
+{
+	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+
+	if (!local->ops->get_survey)
+		return -EOPNOTSUPP;
+
+	return drv_get_survey(local, idx, survey);
+}
+
 static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 				 u8 *mac, struct station_info *sinfo)
 {
@@ -1476,6 +1487,7 @@ struct cfg80211_ops mac80211_config_ops
 	.change_station = ieee80211_change_station,
 	.get_station = ieee80211_get_station,
 	.dump_station = ieee80211_dump_station,
+	.dump_survey = ieee80211_dump_survey,
 #ifdef CONFIG_MAC80211_MESH
 	.add_mpath = ieee80211_add_mpath,
 	.del_mpath = ieee80211_del_mpath,
--- compat-wireless-2010-03-15.orig/net/mac80211/driver-ops.h
+++ compat-wireless-2010-03-15/net/mac80211/driver-ops.h
@@ -346,6 +346,15 @@ static inline int drv_ampdu_action(struc
 	return ret;
 }
 
+static inline int drv_get_survey(struct ieee80211_local *local, int idx,
+				struct survey_info *survey)
+{
+	int ret = -EOPNOTSUPP;
+	if (local->ops->get_survey)
+		ret = local->ops->get_survey(&local->hw, idx, survey);
+	/* trace_drv_get_survey(local, idx, survey, ret); */
+	return ret;
+}
 
 static inline void drv_rfkill_poll(struct ieee80211_local *local)
 {
--- compat-wireless-2010-03-15.orig/drivers/net/wireless/mac80211_hwsim.c
+++ compat-wireless-2010-03-15/drivers/net/wireless/mac80211_hwsim.c
@@ -828,6 +828,33 @@ static int mac80211_hwsim_conf_tx(
 	return 0;
 }
 
+static int mac80211_hwsim_get_survey(
+	struct ieee80211_hw *hw, int idx,
+	struct survey_info *survey)
+{
+	struct ieee80211_conf *conf = &hw->conf;
+
+	printk(KERN_DEBUG "%s:%s (idx=%d)\n",
+	       wiphy_name(hw->wiphy), __func__, idx);
+
+	if (idx != 0)
+		return -ENOENT;
+
+	/* Current channel */
+	survey->channel = conf->channel;
+
+	/*
+	 * Magically conjured noise level --- this is only ok for simulated hardware.
+	 *
+	 * A real driver which cannot determine the real channel noise MUST NOT
+	 * report any noise, especially not a magically conjured one :-)
+	 */
+	survey->filled = SURVEY_INFO_NOISE_DBM;
+	survey->noise = -92;
+
+	return 0;
+}
+
 #ifdef CONFIG_NL80211_TESTMODE
 /*
  * This section contains example code for using netlink
@@ -981,6 +1008,7 @@ static struct ieee80211_ops mac80211_hws
 	.sta_notify = mac80211_hwsim_sta_notify,
 	.set_tim = mac80211_hwsim_set_tim,
 	.conf_tx = mac80211_hwsim_conf_tx,
+	.get_survey = mac80211_hwsim_get_survey,
 	CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd)
 	.ampdu_action = mac80211_hwsim_ampdu_action,
 	.flush = mac80211_hwsim_flush,

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

end of thread, other threads:[~2010-04-16  6:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0290AB2F0A8E124B9FFC144088A1A95609D6029647@EX-MBS04.nbl.local>
     [not found] ` <20100401163526.GB2483@tux>
     [not found]   ` <0290AB2F0A8E124B9FFC144088A1A95609D6096AB9@EX-MBS04.nbl.local>
2010-04-12 18:04     ` Survey mode volunteers Luis R. Rodriguez
2010-04-14  7:11       ` Holger Schurig
2010-04-14 17:30         ` Luis R. Rodriguez
2010-04-16  6:45           ` Holger Schurig
2010-04-15 11:15         ` Anton Puolakka
2010-04-16  6:47           ` Holger Schurig

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.