Thread (5 messages) 5 messages, 3 authors, 2006-06-30

Re: [PATCH] improved statistics for bcm43xx-softmac

From: Larry Finger <hidden>
Date: 2006-06-29 15:31:39

Michael Buesch wrote:
On Thursday 29 June 2006 06:08, Larry Finger wrote:
quoted
	/* fill in the real statistics when iface associated */
-	wstats->qual.qual = 100;     // TODO: get the real signal quality
-	wstats->qual.level = 3 - bcm->stats.link_quality;
+	list_for_each_entry(network, &mac->ieee->network_list, list) {
+		if (!memcmp(mac->associnfo.bssid, network->bssid, ETH_ALEN)) {
+			if (!tmp_level)		/* get initial value */
+				tmp_level = network->stats.rssi;
+			else			/* smooth results */
+				tmp_level = (7 * tmp_level + network->stats.rssi)/8;
+			break;
+		}
+	}
You need to lock the ieee80211 lock here. Otherwise it might race and crash,
if some workqueue modifies the list inbetween.
Thanks for the comment. Is there an easier way to get to network->stats?

Larry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help