diff mbox

cfg80211: allow driver to signal noise level

Message ID 200910201413.29734.hs4233@mail.mn-solutions.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Holger Schurig Oct. 20, 2009, 12:13 p.m. UTC
None
diff mbox

Patch

--- 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)