static char * format_assocrate(struct iwinfo_rate_entry *r)
{
- static char buf[40];
+ static char buf[80];
char *p = buf;
int l = sizeof(buf);
p += snprintf(p, l, "%s", format_rate(r->rate));
l = sizeof(buf) - (p - buf);
- if (r->mcs >= 0)
+ if (r->is_ht)
{
- p += snprintf(p, l, ", MCS %d, %dMHz", r->mcs, 20 + r->is_40mhz*20);
+ p += snprintf(p, l, ", MCS %d, %dMHz", r->mcs, r->mhz);
+ l = sizeof(buf) - (p - buf);
+ }
+ else if (r->is_vht)
+ {
+ p += snprintf(p, l, ", VHT-MCS %d, %dMHz", r->mcs, r->mhz);
l = sizeof(buf) - (p - buf);
- if (r->is_short_gi)
- p += snprintf(p, l, ", short GI");
+ if (r->nss)
+ {
+ p += snprintf(p, l, ", VHT-NSS %d", r->nss);
+ l = sizeof(buf) - (p - buf);
+ }
}
}
}
}
+static void print_htmodelist(const struct iwinfo_ops *iw, const char *ifname)
+{
+ int i, htmodes = 0;
+
+ if (iw->htmodelist(ifname, &htmodes))
+ {
+ printf("No HT mode information available\n");
+ return;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(IWINFO_HTMODE_NAMES); i++)
+ if (htmodes & (1 << i))
+ printf("%s ", IWINFO_HTMODE_NAMES[i]);
+
+ printf("\n");
+}
+
static void lookup_phy(const struct iwinfo_ops *iw, const char *section)
{
char buf[IWINFO_BUFSIZE];
" iwinfo <device> freqlist\n"
" iwinfo <device> assoclist\n"
" iwinfo <device> countrylist\n"
+ " iwinfo <device> htmodelist\n"
" iwinfo <backend> phyname <section>\n"
);
print_countrylist(iw, argv[1]);
break;
+ case 'h':
+ print_htmodelist(iw, argv[1]);
+ break;
+
default:
fprintf(stderr, "Unknown command: %s\n", argv[i]);
rv = 1;
}
}
-out:
iwinfo_finish();
return rv;