netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: John Linville <linville@tuxdriver.com>,
	netdev@vger.kernel.org, Ivo van Doorn <ivdoorn@gmail.com>,
	Michael Wu <flamingice@sourmilk.net>
Subject: [PATCH] Add wireless statistics code to d80211 versions of adm8211 and rt2x00 drivers
Date: Mon, 14 Aug 2006 13:51:11 -0500	[thread overview]
Message-ID: <44E0C61F.1020507@lwfinger.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

This patch adds the necessary bits to the adm8211 and rt2x00 family of drivers 
for them to report wireless statistics to the d80211 stack in the wireless-dev 
tree. At present as discussed with Ivo van Doorn (rt2x00) and Michael Wu 
(adm2311), the needed values of maxssi, noise and signal are totally bogus, with 
prominent FIXME's. As the proper quantities are available, these sections will 
be changed.

This patch has been compile tested only. I do not have the necessary hardware. 
To preserve white space and prevent line wraps, the patch is attached.

Signed-Off-By: Larry Finger <Larry.Finger@lwfinger.net>


[-- Attachment #2: patch_stats2 --]
[-- Type: text/plain, Size: 5897 bytes --]

diff --git a/drivers/net/wireless/d80211/adm8211/adm8211.c b/drivers/net/wireless/d80211/adm8211/adm8211.c
index dcabeab..6845f40 100644
--- a/drivers/net/wireless/d80211/adm8211/adm8211.c
+++ b/drivers/net/wireless/d80211/adm8211/adm8211.c
@@ -558,6 +558,16 @@ static void adm8211_interrupt_rci(struct
 			if (dev->flags & IFF_PROMISC)
 				skb_trim(skb, skb->len - FCS_LEN);
 
+
+/* FIXME: The following set of assignments supply additional data for wireless statistics. The
+	  necessary quantities are (1) "maxssi", the maximum value ssi (above) can reach,
+	  (2) the "noise" value in dBm, and (3) the "signal" value in dBm. The present code
+	  supplies dummy values for these three quantities. */
+
+			rx_status.maxssi = 100;  /* FIXME */
+			rx_status.noise = -85;   /* FIXME */
+			rx_status.signal = rx_status.ssi - rx_status.maxssi; /* FIXME */
+
 			ieee80211_rx_irqsafe(dev, skb, &rx_status);
 		}
 
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
index 96bcdf4..38b655c 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
@@ -1746,6 +1746,16 @@ static void rt2400pci_rxdone(void *data)
 			rt2x00dev->rx_params.ssi =
 				rt2x00_get_field32(rxd->word2, RXD_W2_RSSI);
 
+/* FIXME: The following set of assignments supply additional data for wireless statistics. The
+	  necessary quantities are (1) "maxssi", the maximum value ssi (above) can reach,
+	  (2) the "noise" value in dBm, and (3) the "signal" value in dBm. The present code
+	  supplies dummy values for these three quantities. */
+
+			rt2x00dev->rx_params.maxssi = 100;  /* FIXME */
+			rt2x00dev->rx_params.noise = -85;   /* FIXME */
+			rt2x00dev->rx_params.signal =
+				rt2x00dev->rx_params.ssi - rt2x00dev->rx_params.maxssi; /* FIXME */
+
 			__ieee80211_rx(ring->net_dev,
 				skb, &rt2x00dev->rx_params);
 		}
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
index 20095aa..40b543d 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
@@ -1890,6 +1890,16 @@ static void rt2500pci_rxdone(void *data)
 			rt2x00dev->rx_params.ssi =
 				rt2x00_get_field32(rxd->word2, RXD_W2_RSSI);
 
+/* FIXME: The following set of assignments supply additional data for wireless statistics. The
+	  necessary quantities are (1) "maxssi", the maximum value ssi (above) can reach,
+	  (2) the "noise" value in dBm, and (3) the "signal" value in dBm. The present code
+	  supplies dummy values for these three quantities. */
+
+			rt2x00dev->rx_params.maxssi = 100;  /* FIXME */
+			rt2x00dev->rx_params.noise = -85;   /* FIXME */
+			rt2x00dev->rx_params.signal =
+				rt2x00dev->rx_params.ssi - rt2x00dev->rx_params.maxssi; /* FIXME */
+
 			__ieee80211_rx(ring->net_dev,
 				skb, &rt2x00dev->rx_params);
 
diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
index 383f4a9..f375c52 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
@@ -1623,6 +1623,16 @@ static void rt2500usb_rxdone(void *data)
 			rt2x00dev->rx_params.ssi =
 				rt2x00_get_field32(rxd->word1, RXD_W1_RSSI);
 
+/* FIXME: The following set of assignments supply additional data for wireless statistics. The
+	  necessary quantities are (1) "maxssi", the maximum value ssi (above) can reach,
+	  (2) the "noise" value in dBm, and (3) the "signal" value in dBm. The present code
+	  supplies dummy values for these three quantities. */
+
+			rt2x00dev->rx_params.maxssi = 100;  /* FIXME */
+			rt2x00dev->rx_params.noise = -85;   /* FIXME */
+			rt2x00dev->rx_params.signal =
+				rt2x00dev->rx_params.ssi - rt2x00dev->rx_params.maxssi; /* FIXME */
+
 			__ieee80211_rx(ring->net_dev,
 				skb, &rt2x00dev->rx_params);
 
diff --git a/drivers/net/wireless/d80211/rt2x00/rt61pci.c b/drivers/net/wireless/d80211/rt2x00/rt61pci.c
index cc6789e..5d2a9ff 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt61pci.c
@@ -2337,6 +2337,16 @@ static void rt61pci_rxdone(void *data)
 			rt2x00dev->rx_params.ssi =
 				rt2x00_get_field32(rxd->word1, RXD_W1_RSSI);
 
+/* FIXME: The following set of assignments supply additional data for wireless statistics. The
+	  necessary quantities are (1) "maxssi", the maximum value ssi (above) can reach,
+	  (2) the "noise" value in dBm, and (3) the "signal" value in dBm. The present code
+	  supplies dummy values for these three quantities. */
+
+			rt2x00dev->rx_params.maxssi = 100;  /* FIXME */
+			rt2x00dev->rx_params.noise = -85;   /* FIXME */
+			rt2x00dev->rx_params.signal =
+				rt2x00dev->rx_params.ssi - rt2x00dev->rx_params.maxssi; /* FIXME */
+
 			__ieee80211_rx(ring->net_dev,
 				skb, &rt2x00dev->rx_params);
 
diff --git a/drivers/net/wireless/d80211/rt2x00/rt73usb.c b/drivers/net/wireless/d80211/rt2x00/rt73usb.c
index 682d078..5a90fb9 100644
--- a/drivers/net/wireless/d80211/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/d80211/rt2x00/rt73usb.c
@@ -1907,6 +1907,16 @@ static void rt73usb_rxdone(void *data)
 			rt2x00dev->rx_params.ssi =
 				rt2x00_get_field32(rxd->word1, RXD_W1_RSSI);
 
+/* FIXME: The following set of assignments supply additional data for wireless statistics. The
+	  necessary quantities are (1) "maxssi", the maximum value ssi (above) can reach,
+	  (2) the "noise" value in dBm, and (3) the "signal" value in dBm. The present code
+	  supplies dummy values for these three quantities. */
+
+			rt2x00dev->rx_params.maxssi = 100;  /* FIXME */
+			rt2x00dev->rx_params.noise = -85;   /* FIXME */
+			rt2x00dev->rx_params.signal =
+				rt2x00dev->rx_params.ssi - rt2x00dev->rx_params.maxssi; /* FIXME */
+
 			__ieee80211_rx(ring->net_dev,
 				skb, &rt2x00dev->rx_params);
 

                 reply	other threads:[~2006-08-14 18:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44E0C61F.1020507@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=flamingice@sourmilk.net \
    --cc=ivdoorn@gmail.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).