Skip to contentSkip to conversation

d80211: Add wireless statistics

PATCH In review Larry Finger 1 participant 1 message Nov 2, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 d80211: Add wireless statistics

This patch modifies d80211 to support wireless statistics.

---

John,

Please add to wireless-dev.

Larry

include/net/d80211.h +4 -0
Index: wireless-dev/include/net/d80211.h
===================================================================
@@ -195,6 +195,8 @@ struct ieee80211_rx_status {
         int channel;
         int phymode;
         int ssi;
+	int signal;
+	int noise;
         int antenna;
         int rate;
         int flag;
@@ -479,6 +481,8 @@ struct ieee80211_hw {
         /* This is the time in us to change channels
          */
         int channel_change_time;
+	/* This is maximum value for rssi reported by this device */
+	int maxssi;
 
 	int num_modes;
 	struct ieee80211_hw_modes *modes;
net/d80211/ieee80211.c +2 -0
Index: wireless-dev/net/d80211/ieee80211.c
===================================================================
@@ -3152,6 +3152,8 @@ ieee80211_rx_h_sta_process(struct ieee80
 	sta->rx_fragments++;
 	sta->rx_bytes += rx->skb->len;
 	sta->last_rssi = rx->u.rx.status->ssi;
+	sta->last_signal = rx->u.rx.status->signal;
+	sta->last_noise = rx->u.rx.status->noise;
 
 	if (!(rx->fc & IEEE80211_FCTL_MOREFRAGS)) {
 		/* Change STA power saving mode only in the end of a frame
net/d80211/ieee80211_i.h +1 -0
Index: wireless-dev/net/d80211/ieee80211_i.h
===================================================================
@@ -336,6 +336,7 @@ struct ieee80211_local {
 	struct net_device *apdev; /* wlan#ap - management frames (hostapd) */
 	int open_count;
 	int monitors;
+	struct iw_statistics wstats;
 	struct ieee80211_conf conf;
 
 	int dev_index;
net/d80211/ieee80211_ioctl.c +44 -0

62 lines not on this page · raw message

net/d80211/ieee80211_sysfs_sta.c +5 -1
Index: wireless-dev/net/d80211/ieee80211_sysfs_sta.c
===================================================================
@@ -48,7 +48,7 @@ static ssize_t show_sta_##name(const str
 
 #define __STA_ATTR(name)						\
 static struct sta_attribute sta_attr_##name =				\
-	__ATTR(name, S_IRUSR, show_sta_##name, NULL)
+	__ATTR(name, S_IRUGO, show_sta_##name, NULL)
 
 #define STA_ATTR(name, field, format)					\
 		STA_SHOW_##format(name, field)				\
@@ -72,6 +72,8 @@ STA_ATTR(last_txrate, last_txrate, RATE)
 STA_ATTR(tx_retry_failed, tx_retry_failed, LU);
 STA_ATTR(tx_retry_count, tx_retry_count, LU);
 STA_ATTR(last_rssi, last_rssi, D);
+STA_ATTR(last_signal, last_signal, D);
+STA_ATTR(last_noise, last_noise, D);
 STA_ATTR(channel_use, channel_use, D);
 STA_ATTR(wep_weak_iv_count, wep_weak_iv_count, D);
 
@@ -174,6 +176,8 @@ static struct attribute *sta_ktype_attrs
 	&sta_attr_tx_retry_failed.attr,
 	&sta_attr_tx_retry_count.attr,
 	&sta_attr_last_rssi.attr,
+	&sta_attr_last_signal.attr,
+	&sta_attr_last_noise.attr,
 	&sta_attr_channel_use.attr,
 	&sta_attr_wep_weak_iv_count.attr,
 
net/d80211/sta_info.h +2 -0
Index: wireless-dev/net/d80211/sta_info.h
===================================================================
@@ -82,6 +82,8 @@ struct sta_info {
 	unsigned long rx_dropped; /* number of dropped MPDUs from this STA */
 
 	int last_rssi; /* RSSI of last received frame from this STA */
+	int last_signal; /* signal of last received frame from this STA */
+	int last_noise; /* noise of last received frame from this STA */
 	int last_ack_rssi[3]; /* RSSI of last received ACKs from this STA */
 	unsigned long last_ack;
         int channel_use;