Michael Buesch wrote:
On Thursday 29 June 2006 06:08, Larry Finger wrote:
        /* 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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to