p54: Added get_survey callback in order to get channel noise
authorJohn W. Linville <linville@tuxdriver.com>
Mon, 3 May 2010 20:06:47 +0000 (16:06 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Jul 2010 18:59:58 +0000 (14:59 -0400)
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/p54/main.c

index c072f41747cac9cf1e0c6c9c37c4c01e53c41a7c..47db439b63bfd9d3f2b9330095b4c4b606160479 100644 (file)
@@ -507,6 +507,22 @@ out_unlock:
        return ret;
 }
 
+static int p54_get_survey(struct ieee80211_hw *dev, int idx,
+                               struct survey_info *survey)
+{
+       struct p54_common *priv = dev->priv;
+       struct ieee80211_conf *conf = &dev->conf;
+
+       if (idx != 0)
+               return -ENOENT;
+
+       survey->channel = conf->channel;
+       survey->filled = SURVEY_INFO_NOISE_DBM;
+       survey->noise = clamp_t(s8, priv->noise, -128, 127);
+
+       return 0;
+}
+
 static const struct ieee80211_ops p54_ops = {
        .tx                     = p54_tx_80211,
        .start                  = p54_start,
@@ -523,6 +539,7 @@ static const struct ieee80211_ops p54_ops = {
        .configure_filter       = p54_configure_filter,
        .conf_tx                = p54_conf_tx,
        .get_stats              = p54_get_stats,
+       .get_survey             = p54_get_survey,
 };
 
 struct ieee80211_hw *p54_init_common(size_t priv_data_len)