Skip to contentSkip to conversation

d80211: diplay supported rates in readable format

PATCH Applied mabbas 2 participants 2 messages Aug 28, 2006 – Sep 21, 2006

Subsystems (2)
lore
Share & tools
lore

mabbas

author
#0 lore raw

PATCH 6/7 d80211: diplay supported rates in readable format

This patch modify d80211 to report supported rates in readable format in iwlist scan command.

net/d80211/ieee80211_sta.c +15 -9
index a933d92..b2e45a4 100644
@@ -2714,15 +2714,21 @@ ieee80211_sta_scan_result(struct net_dev
 		current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe,
 						  buf);
 
-		p = buf;
-		p += sprintf(p, "supp_rates=");
-		for (i = 0; i < bss->supp_rates_len; i++)
-			p+= sprintf(p, "%02x", bss->supp_rates[i]);
-		memset(&iwe, 0, sizeof(iwe));
-		iwe.cmd = IWEVCUSTOM;
-		iwe.u.data.length = strlen(buf);
-		current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe,
-						  buf);
+		/* dispaly all support rates in readable format */
+		p = current_ev + IW_EV_LCP_LEN;
+		iwe.cmd = SIOCGIWRATE;
+		/* Those two flags are ignored... */
+		iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
+
+		for (i = 0; i < bss->supp_rates_len; i++) {
+			iwe.u.bitrate.value = ((bss->supp_rates[i] & 
+							0x7f) * 500000);
+			p = iwe_stream_add_value(current_ev, p, 
+					end_buf, &iwe, IW_EV_PARAM_LEN);
+		}
+		/* Check if we added any rate */
+		if((p - current_ev) > IW_EV_LCP_LEN)
+			current_ev = p;
 
 		kfree(buf);
 		break;
Applied
#1 lore raw
Quoted 2 lines · mabbas

This patch modify d80211 to report supported rates in readable format in iwlist scan command.

Applied to my tree. Thanks for the patch!

Jiri

Signature · 2 lines
Jiri Benc
SUSE Labs