Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c28df16e authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by Jeff Garzik
Browse files

[PATCH] hostap: Add support for WE-19



This patch adds support for WE-19 to the HostAP driver. One of
the major change is the use of an explicit flag to tell if iwstat is
in dBm or not.

Signed-off-by: default avatarJouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 7a716536
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -737,7 +737,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
		struct iw_quality wstats;
		struct iw_quality wstats;
		wstats.level = rx_stats->signal;
		wstats.level = rx_stats->signal;
		wstats.noise = rx_stats->noise;
		wstats.noise = rx_stats->noise;
		wstats.updated = 6;	/* No qual value */
		wstats.updated = IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_UPDATED
			| IW_QUAL_QUAL_INVALID | IW_QUAL_DBM;
		/* Update spy records */
		/* Update spy records */
		wireless_spy_update(dev, hdr->addr2, &wstats);
		wireless_spy_update(dev, hdr->addr2, &wstats);
	}
	}
+3 −3
Original line number Original line Diff line number Diff line
@@ -2349,7 +2349,7 @@ static int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
		qual[count].noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence);
		qual[count].noise = HFA384X_LEVEL_TO_dBm(sta->last_rx_silence);
		qual[count].updated = sta->last_rx_updated;
		qual[count].updated = sta->last_rx_updated;


		sta->last_rx_updated = 0;
		sta->last_rx_updated = IW_QUAL_DBM;


		count++;
		count++;
		if (count >= buf_size)
		if (count >= buf_size)
@@ -2467,7 +2467,7 @@ static int prism2_ap_translate_scan(struct net_device *dev, char *buffer)
		}
		}
#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */


		sta->last_rx_updated = 0;
		sta->last_rx_updated = IW_QUAL_DBM;


		/* To be continued, we should make good use of IWEVCUSTOM */
		/* To be continued, we should make good use of IWEVCUSTOM */
	}
	}
@@ -3174,7 +3174,7 @@ int hostap_update_rx_stats(struct ap_data *ap,
		sta->last_rx_silence = rx_stats->noise;
		sta->last_rx_silence = rx_stats->noise;
		sta->last_rx_signal = rx_stats->signal;
		sta->last_rx_signal = rx_stats->signal;
		sta->last_rx_rate = rx_stats->rate;
		sta->last_rx_rate = rx_stats->rate;
		sta->last_rx_updated = 7;
		sta->last_rx_updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
		if (rx_stats->rate == 10)
		if (rx_stats->rate == 10)
			sta->rx_count[0]++;
			sta->rx_count[0]++;
		else if (rx_stats->rate == 20)
		else if (rx_stats->rate == 20)
+7 −2
Original line number Original line Diff line number Diff line
@@ -50,7 +50,8 @@ static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev)
#endif /* in_atomic */
#endif /* in_atomic */


		if (update && prism2_update_comms_qual(dev) == 0)
		if (update && prism2_update_comms_qual(dev) == 0)
			wstats->qual.updated = 7;
			wstats->qual.updated = IW_QUAL_ALL_UPDATED |
				IW_QUAL_DBM;


		wstats->qual.qual = local->comms_qual;
		wstats->qual.qual = local->comms_qual;
		wstats->qual.level = local->avg_signal;
		wstats->qual.level = local->avg_signal;
@@ -59,7 +60,7 @@ static struct iw_statistics *hostap_get_wireless_stats(struct net_device *dev)
		wstats->qual.qual = 0;
		wstats->qual.qual = 0;
		wstats->qual.level = 0;
		wstats->qual.level = 0;
		wstats->qual.noise = 0;
		wstats->qual.noise = 0;
		wstats->qual.updated = 0;
		wstats->qual.updated = IW_QUAL_ALL_INVALID;
	}
	}


	return wstats;
	return wstats;
@@ -1894,6 +1895,10 @@ static char * __prism2_translate_scan(local_info_t *local,
			iwe.u.qual.noise =
			iwe.u.qual.noise =
				HFA384X_LEVEL_TO_dBm(le16_to_cpu(scan->anl));
				HFA384X_LEVEL_TO_dBm(le16_to_cpu(scan->anl));
		}
		}
		iwe.u.qual.updated = IW_QUAL_LEVEL_UPDATED
			| IW_QUAL_NOISE_UPDATED
			| IW_QUAL_QUAL_INVALID
			| IW_QUAL_DBM;
		iwe.len = IW_EV_QUAL_LEN;
		iwe.len = IW_EV_QUAL_LEN;
		current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
		current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
						  IW_EV_QUAL_LEN);
						  IW_EV_QUAL_LEN);