Subject: Re: [PATCH] improved statistics for bcm43xx-softmac

From: Larry Finger <[email-masked]>
Date: Thu, 29 Jun 2006 10:31:34 -0500

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