aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/main.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-05-03 16:06:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-27 14:59:58 -0400
commit1b2fb7dc71c1f8f97663c2da84fa1c8183588474 (patch)
tree79cd0ab74ec03a07daf263755e81fd2bbd63ae84 /drivers/net/wireless/p54/main.c
parent800f65bba8d2030b3fef62850e203f9f176625a8 (diff)
p54: Added get_survey callback in order to get channel noise
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/main.c')
-rw-r--r--drivers/net/wireless/p54/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index c072f41747ca..47db439b63bf 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -507,6 +507,22 @@ out_unlock:
507 return ret; 507 return ret;
508} 508}
509 509
510static int p54_get_survey(struct ieee80211_hw *dev, int idx,
511 struct survey_info *survey)
512{
513 struct p54_common *priv = dev->priv;
514 struct ieee80211_conf *conf = &dev->conf;
515
516 if (idx != 0)
517 return -ENOENT;
518
519 survey->channel = conf->channel;
520 survey->filled = SURVEY_INFO_NOISE_DBM;
521 survey->noise = clamp_t(s8, priv->noise, -128, 127);
522
523 return 0;
524}
525
510static const struct ieee80211_ops p54_ops = { 526static const struct ieee80211_ops p54_ops = {
511 .tx = p54_tx_80211, 527 .tx = p54_tx_80211,
512 .start = p54_start, 528 .start = p54_start,
@@ -523,6 +539,7 @@ static const struct ieee80211_ops p54_ops = {
523 .configure_filter = p54_configure_filter, 539 .configure_filter = p54_configure_filter,
524 .conf_tx = p54_conf_tx, 540 .conf_tx = p54_conf_tx,
525 .get_stats = p54_get_stats, 541 .get_stats = p54_get_stats,
542 .get_survey = p54_get_survey,
526}; 543};
527 544
528struct ieee80211_hw *p54_init_common(size_t priv_data_len) 545struct ieee80211_hw *p54_init_common(size_t priv_data_len)