Skip to contentSkip to conversation

iw: fix HT PHY BSS Membership selector value encoding

PATCH New Christian Lamparter 1 participant 1 message Oct 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iw: fix HT PHY BSS Membership selector value encoding

IEEE 802.11n 7.3.2.2 extended the supported rate IE to support a special encoding for HT rate support.

iw needs to be updated in order to recognize
the magic value and parse it accordingly.

e.g.:

Quoted 1 line

Extended supported rates: 63.5*

now becomes:

Quoted 1 line

Extended supported rates: HT*

---

scan.c +9 -1
index d083591..2220f26 100644
@@ -158,6 +158,8 @@ static void print_ssid(const uint8_t type, uint8_t len, const uint8_t *data)
 	printf("\n");
 }
 
+#define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
+
 static void print_supprates(const uint8_t type, uint8_t len, const uint8_t *data)
 {
 	int i;
@@ -166,7 +168,13 @@ static void print_supprates(const uint8_t type, uint8_t len, const uint8_t *data
 
 	for (i = 0; i < len; i++) {
 		int r = data[i] & 0x7f;
-		printf("%d.%d%s ", r/2, 5*(r&1), data[i] & 0x80 ? "*":"");
+
+		if (r == BSS_MEMBERSHIP_SELECTOR_HT_PHY)
+			printf("HT");
+		else
+			printf("%d.%d", r/2, 5*(r&1));
+
+		printf("%s ", data[i] & 0x80 ? "*" : "");
 	}
 	printf("\n");
 }