From patchwork Tue Oct 20 12:13:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Schurig X-Patchwork-Id: 54929 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9KCDvmS001517 for ; Tue, 20 Oct 2009 12:13:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941AbZJTMNw (ORCPT ); Tue, 20 Oct 2009 08:13:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751937AbZJTMNw (ORCPT ); Tue, 20 Oct 2009 08:13:52 -0400 Received: from mx51.mymxserver.com ([85.199.173.110]:47544 "EHLO mx51.mymxserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751934AbZJTMNv (ORCPT ); Tue, 20 Oct 2009 08:13:51 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost.mx51.mymxserver.com (Postfix) with ESMTP id 3D8BC4B00C; Tue, 20 Oct 2009 14:13:54 +0200 (CEST) X-Virus-Scanned: by Mittwald Mailscanner Received: from mx51.mymxserver.com ([127.0.0.1]) by localhost (mx51.mymxserver.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GzNSPn9eIwv8; Tue, 20 Oct 2009 14:13:54 +0200 (CEST) Received: from lin01.mn-solutions.de (pD95FA5CF.dip0.t-ipconnect.de [217.95.165.207]) by mx51.mymxserver.com (Postfix) with ESMTP id C86D94B01C; Tue, 20 Oct 2009 14:13:52 +0200 (CEST) Received: by lin01.mn-solutions.de (Postfix, from userid 116) id 34F391E004F; Tue, 20 Oct 2009 14:13:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7-deb3 (2006-10-05) on lin01.mn-logistik.de X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, UPPERCASE_25_50 autolearn=ham version=3.1.7-deb3 Received: from mnz66.mn-solutions.de (mnz66.mn-solutions.de [192.168.233.66]) by lin01.mn-solutions.de (Postfix) with ESMTP id 3DAE51E0010; Tue, 20 Oct 2009 14:13:43 +0200 (CEST) From: Holger Schurig To: John Linville , Johannes Berg , "linux-wireless" Subject: [PATCH] cfg80211: allow driver to signal noise level Date: Tue, 20 Oct 2009 14:13:29 +0200 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200910201413.29734.hs4233@mail.mn-solutions.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- linux-wl.orig/include/linux/nl80211.h +++ linux-wl/include/linux/nl80211.h @@ -871,6 +871,8 @@ * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this * station) + * @NL80211_STA_INFO_NOISE: noise level (u8, dBm) (used in station mode for + * "iw link") */ enum nl80211_sta_info { __NL80211_STA_INFO_INVALID, @@ -884,6 +886,7 @@ NL80211_STA_INFO_TX_BITRATE, NL80211_STA_INFO_RX_PACKETS, NL80211_STA_INFO_TX_PACKETS, + NL80211_STA_INFO_NOISE, /* keep last */ __NL80211_STA_INFO_AFTER_LAST, --- linux-wl.orig/include/net/cfg80211.h +++ linux-wl/include/net/cfg80211.h @@ -309,6 +309,7 @@ * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) * @STATION_INFO_RX_PACKETS: @rx_packets filled * @STATION_INFO_TX_PACKETS: @tx_packets filled + * @STATION_INFO_NOISE: @noise filled */ enum station_info_flags { STATION_INFO_INACTIVE_TIME = 1<<0, @@ -321,6 +322,7 @@ STATION_INFO_TX_BITRATE = 1<<7, STATION_INFO_RX_PACKETS = 1<<8, STATION_INFO_TX_PACKETS = 1<<9, + STATION_INFO_NOISE = 1<<10, }; /** @@ -367,6 +369,7 @@ * @plid: mesh peer link id * @plink_state: mesh peer link state * @signal: signal strength of last received packet in dBm + * @noise: noise level in dBm * @txrate: current unicast bitrate to this station * @rx_packets: packets received from this station * @tx_packets: packets transmitted to this station @@ -384,6 +387,7 @@ u16 plid; u8 plink_state; s8 signal; + s8 noise; struct rate_info txrate; u32 rx_packets; u32 tx_packets; --- linux-wl.orig/net/wireless/nl80211.c +++ linux-wl/net/wireless/nl80211.c @@ -1636,6 +1636,9 @@ if (sinfo->filled & STATION_INFO_SIGNAL) NLA_PUT_U8(msg, NL80211_STA_INFO_SIGNAL, sinfo->signal); + if (sinfo->filled & STATION_INFO_NOISE) + NLA_PUT_U8(msg, NL80211_STA_INFO_NOISE, + sinfo->noise); if (sinfo->filled & STATION_INFO_TX_BITRATE) { txrate = nla_nest_start(msg, NL80211_STA_INFO_TX_BITRATE); if (!txrate)