From patchwork Tue Apr 27 22:08:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit PAPILLAULT X-Patchwork-Id: 95533 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3RM8o34031076 for ; Tue, 27 Apr 2010 22:08:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757289Ab0D0WIg (ORCPT ); Tue, 27 Apr 2010 18:08:36 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:55192 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757288Ab0D0WIf (ORCPT ); Tue, 27 Apr 2010 18:08:35 -0400 Received: from smtp3-g21.free.fr (localhost [127.0.0.1]) by smtp3-g21.free.fr (Postfix) with ESMTP id AC1818180B2; Wed, 28 Apr 2010 00:08:27 +0200 (CEST) Received: from xian.sabine-et-benoit.com (ns.popipo.fr [88.163.232.53]) by smtp3-g21.free.fr (Postfix) with ESMTP id A7EBC81809D; Wed, 28 Apr 2010 00:08:24 +0200 (CEST) Received: by xian.sabine-et-benoit.com (Postfix, from userid 1000) id 404BC70203; Wed, 28 Apr 2010 00:08:24 +0200 (CEST) From: Benoit Papillault To: lrodriguez@atheros.com, jmalinen@atheros.com Cc: ath9k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org, Benoit Papillault Subject: [PATCH] ath9k: Added get_survey callback in order to get channel noise Date: Wed, 28 Apr 2010 00:08:24 +0200 Message-Id: <1272406104-6870-1-git-send-email-benoit.papillault@free.fr> X-Mailer: git-send-email 1.5.6.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 27 Apr 2010 22:08:50 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index c03821e..f0b2aa2 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -2047,6 +2047,25 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, return ret; } +static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, + struct survey_info *survey) +{ + struct ath_wiphy *aphy = hw->priv; + struct ath_softc *sc = aphy->sc; + struct ath_hw *ah = sc->sc_ah; + struct ath_common *common = ath9k_hw_common(ah); + struct ieee80211_conf *conf = &hw->conf; + + if (idx != 0) + return -ENOENT; + + survey->channel = conf->channel; + survey->filled = SURVEY_INFO_NOISE_DBM; + survey->noise = common->ani.noise_floor; + + return 0; +} + static void ath9k_sw_scan_start(struct ieee80211_hw *hw) { struct ath_wiphy *aphy = hw->priv; @@ -2122,6 +2141,7 @@ struct ieee80211_ops ath9k_ops = { .set_tsf = ath9k_set_tsf, .reset_tsf = ath9k_reset_tsf, .ampdu_action = ath9k_ampdu_action, + .get_survey = ath9k_get_survey, .sw_scan_start = ath9k_sw_scan_start, .sw_scan_complete = ath9k_sw_scan_complete, .rfkill_poll = ath9k_rfkill_poll_state,