linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ar9170: add get_survey callback in order to get channel noise
@ 2010-07-28 18:48 John W. Linville
  2010-07-28 19:10 ` Christian Lamparter
  0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2010-07-28 18:48 UTC (permalink / raw)
  To: linux-wireless; +Cc: Christian Lamparter, John W. Linville

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/ath/ar9170/main.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 5e2c514..e089d9f 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1905,6 +1905,22 @@ static int ar9170_get_stats(struct ieee80211_hw *hw,
 	return 0;
 }
 
+static int ar9170_get_survey(struct ieee80211_hw *hw, int idx,
+				struct survey_info *survey)
+{
+	struct ar9170 *ar = 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 = ar->noise[0];
+
+	return 0;
+}
+
 static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
 			  const struct ieee80211_tx_queue_params *param)
 {
@@ -1957,6 +1973,7 @@ static const struct ieee80211_ops ar9170_ops = {
 	.get_tsf		= ar9170_op_get_tsf,
 	.set_key		= ar9170_set_key,
 	.get_stats		= ar9170_get_stats,
+	.get_survey		= ar9170_get_survey,
 	.ampdu_action		= ar9170_ampdu_action,
 };
 
-- 
1.7.1.1


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

* Re: [PATCH] ar9170: add get_survey callback in order to get channel noise
  2010-07-28 18:48 [PATCH] ar9170: add get_survey callback in order to get channel noise John W. Linville
@ 2010-07-28 19:10 ` Christian Lamparter
  2010-07-28 19:15   ` John W. Linville
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Lamparter @ 2010-07-28 19:10 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

On Wednesday 28 July 2010 20:48:44 John W. Linville wrote:
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>  drivers/net/wireless/ath/ar9170/main.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
> index 5e2c514..e089d9f 100644
> --- a/drivers/net/wireless/ath/ar9170/main.c
> +++ b/drivers/net/wireless/ath/ar9170/main.c
> @@ -1905,6 +1905,22 @@ static int ar9170_get_stats(struct ieee80211_hw *hw,
>  	return 0;
>  }
>  
> +static int ar9170_get_survey(struct ieee80211_hw *hw, int idx,
> +				struct survey_info *survey)
> +{
> +	struct ar9170 *ar = 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 = ar->noise[0];
> +
> +	return 0;
> +}
> +
>  static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
>  			  const struct ieee80211_tx_queue_params *param)
>  {
> @@ -1957,6 +1973,7 @@ static const struct ieee80211_ops ar9170_ops = {
>  	.get_tsf		= ar9170_op_get_tsf,
>  	.set_key		= ar9170_set_key,
>  	.get_stats		= ar9170_get_stats,
> +	.get_survey		= ar9170_get_survey,
>  	.ampdu_action		= ar9170_ampdu_action,
>  };

One problem: the noisefloor stays at the same level and
is not updated. You would have to call ar9170_set_channel,
but I don't recommend that because that may lockup
the device :(.

Regards,
	Chr

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

* Re: [PATCH] ar9170: add get_survey callback in order to get channel noise
  2010-07-28 19:10 ` Christian Lamparter
@ 2010-07-28 19:15   ` John W. Linville
  2010-07-28 19:57     ` Christian Lamparter
  0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2010-07-28 19:15 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless

On Wed, Jul 28, 2010 at 09:10:31PM +0200, Christian Lamparter wrote:
> On Wednesday 28 July 2010 20:48:44 John W. Linville wrote:
> > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> > ---
> >  drivers/net/wireless/ath/ar9170/main.c |   17 +++++++++++++++++
> >  1 files changed, 17 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
> > index 5e2c514..e089d9f 100644
> > --- a/drivers/net/wireless/ath/ar9170/main.c
> > +++ b/drivers/net/wireless/ath/ar9170/main.c
> > @@ -1905,6 +1905,22 @@ static int ar9170_get_stats(struct ieee80211_hw *hw,
> >  	return 0;
> >  }
> >  
> > +static int ar9170_get_survey(struct ieee80211_hw *hw, int idx,
> > +				struct survey_info *survey)
> > +{
> > +	struct ar9170 *ar = 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 = ar->noise[0];
> > +
> > +	return 0;
> > +}
> > +
> >  static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
> >  			  const struct ieee80211_tx_queue_params *param)
> >  {
> > @@ -1957,6 +1973,7 @@ static const struct ieee80211_ops ar9170_ops = {
> >  	.get_tsf		= ar9170_op_get_tsf,
> >  	.set_key		= ar9170_set_key,
> >  	.get_stats		= ar9170_get_stats,
> > +	.get_survey		= ar9170_get_survey,
> >  	.ampdu_action		= ar9170_ampdu_action,
> >  };
> 
> One problem: the noisefloor stays at the same level and
> is not updated. You would have to call ar9170_set_channel,
> but I don't recommend that because that may lockup
> the device :(.

I'm not sure I understand -- isn't ar9170_set_channel already called
from ar9170_op_config?  Or are you saying that the value will be
stale unless you call ar9170_set_channel again?

How is this patch any worse than the situation was before commit
5d6566ff356a19fb6ad994717cb937ff88063fa6?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* Re: [PATCH] ar9170: add get_survey callback in order to get channel noise
  2010-07-28 19:15   ` John W. Linville
@ 2010-07-28 19:57     ` Christian Lamparter
  2010-07-28 20:30       ` John W. Linville
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Lamparter @ 2010-07-28 19:57 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Benoit Papillault

On Wednesday 28 July 2010 21:15:53 John W. Linville wrote:
> On Wed, Jul 28, 2010 at 09:10:31PM +0200, Christian Lamparter wrote:
> > On Wednesday 28 July 2010 20:48:44 John W. Linville wrote:
> > > Signed-off-by: John W. Linville <linville@tuxdriver.com>
> > > ---
> > >  drivers/net/wireless/ath/ar9170/main.c |   17 +++++++++++++++++
> > >  1 files changed, 17 insertions(+), 0 deletions(-)
> > >  [...]
> > One problem: the noisefloor stays at the same level and
> > is not updated. You would have to call ar9170_set_channel,
> > but I don't recommend that because that may lockup
> > the device :(.
> 
> I'm not sure I understand -- isn't ar9170_set_channel already called
> from ar9170_op_config? Or are you saying that the value will be
> stale unless you call ar9170_set_channel again?
the latter... come to think of it, I wrote a RFT a while back:
"[RFT] ar9170: implement get_survey" <- 27. April

and Benoit joined in to point out that he has/had the same
issue with ath9k hardware. Was this ever sorted out? 

> How is this patch any worse than the situation was before commit
> 5d6566ff356a19fb6ad994717cb937ff88063fa6?

Well, a dodgy value is hardly an improvement, right?
Sure it is _just_ the noise *floor* and people
might argue that any value is better than nothing at all. 

Therefore, yes:

Acked-by: Christian Lamparter <chunkeey@googlemail.com>

and add the nf-update to the TODO-list...
Or wait and look how ath9k(_htc) does/did it. 

Regards,
	Christian

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

* [PATCH] ar9170: add get_survey callback in order to get channel noise
  2010-07-28 19:57     ` Christian Lamparter
@ 2010-07-28 20:30       ` John W. Linville
  2010-07-28 21:20         ` [PATCH v2] " John W. Linville
  0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2010-07-28 20:30 UTC (permalink / raw)
  To: linux-wireless; +Cc: Christian Lamparter, John W. Linville

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
---
 drivers/net/wireless/ath/ar9170/main.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 5e2c514..e089d9f 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1905,6 +1905,22 @@ static int ar9170_get_stats(struct ieee80211_hw *hw,
 	return 0;
 }
 
+static int ar9170_get_survey(struct ieee80211_hw *hw, int idx,
+				struct survey_info *survey)
+{
+	struct ar9170 *ar = 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 = ar->noise[0];
+
+	return 0;
+}
+
 static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
 			  const struct ieee80211_tx_queue_params *param)
 {
@@ -1957,6 +1973,7 @@ static const struct ieee80211_ops ar9170_ops = {
 	.get_tsf		= ar9170_op_get_tsf,
 	.set_key		= ar9170_set_key,
 	.get_stats		= ar9170_get_stats,
+	.get_survey		= ar9170_get_survey,
 	.ampdu_action		= ar9170_ampdu_action,
 };
 
-- 
1.7.1.1


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

* [PATCH v2] ar9170: add get_survey callback in order to get channel noise
  2010-07-28 20:30       ` John W. Linville
@ 2010-07-28 21:20         ` John W. Linville
  0 siblings, 0 replies; 6+ messages in thread
From: John W. Linville @ 2010-07-28 21:20 UTC (permalink / raw)
  To: linux-wireless; +Cc: Christian Lamparter, John W. Linville

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
---
v2 -> add TODO comment

 drivers/net/wireless/ath/ar9170/main.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 5e2c514..c67b05f 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1905,6 +1905,24 @@ static int ar9170_get_stats(struct ieee80211_hw *hw,
 	return 0;
 }
 
+static int ar9170_get_survey(struct ieee80211_hw *hw, int idx,
+				struct survey_info *survey)
+{
+	struct ar9170 *ar = hw->priv;
+	struct ieee80211_conf *conf = &hw->conf;
+
+	if (idx != 0)
+		return -ENOENT;
+
+	/* TODO: update noise value, e.g. call ar9170_set_channel */
+
+	survey->channel = conf->channel;
+	survey->filled = SURVEY_INFO_NOISE_DBM;
+	survey->noise = ar->noise[0];
+
+	return 0;
+}
+
 static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
 			  const struct ieee80211_tx_queue_params *param)
 {
@@ -1957,6 +1975,7 @@ static const struct ieee80211_ops ar9170_ops = {
 	.get_tsf		= ar9170_op_get_tsf,
 	.set_key		= ar9170_set_key,
 	.get_stats		= ar9170_get_stats,
+	.get_survey		= ar9170_get_survey,
 	.ampdu_action		= ar9170_ampdu_action,
 };
 
-- 
1.7.1.1


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-28 18:48 [PATCH] ar9170: add get_survey callback in order to get channel noise John W. Linville
2010-07-28 19:10 ` Christian Lamparter
2010-07-28 19:15   ` John W. Linville
2010-07-28 19:57     ` Christian Lamparter
2010-07-28 20:30       ` John W. Linville
2010-07-28 21:20         ` [PATCH v2] " John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).