commit 3d48d147ca2cee9880dbf94bbc1f999d7dcf4f2d
parent bdcbccbb9f5889136fde17c4a39bee011a4e28af
Author: James Prestwood <prestwoj@gmail.com>
Date: Tue, 19 Jul 2022 11:55:39 -0700
wiphy: make MCS info print more generic
With the addition of HE, the print function for MCS sets needs to change
slightly. The maps themselves are the same format, but the values indicate
different MCS ranges. Now the three MCS max values are passed in.
Diffstat:
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/wiphy.c b/src/wiphy.c
@@ -903,19 +903,35 @@ static void wiphy_print_mcs_indexes(const uint8_t *mcs)
}
}
-static void wiphy_print_vht_mcs_info(const uint8_t *mcs_map,
- const char *prefix)
+static void wiphy_print_mcs_info(const uint8_t *mcs_map,
+ const char *prefix,
+ uint8_t value0,
+ uint8_t value1,
+ uint8_t value2)
{
int i;
for (i = 14; i >= 0; i -= 2) {
+ uint8_t value;
int mcs = bit_field(mcs_map[i / 8], i % 8, 2);
if (mcs == 0x3)
continue;
+ switch (mcs) {
+ case 0:
+ value = value0;
+ break;
+ case 1:
+ value = value1;
+ break;
+ case 2:
+ value = value2;
+ break;
+ }
+
l_info("\t\t\tMax %s MCS: 0-%d for NSS: %d", prefix,
- mcs + 7, i / 2 + 1);
+ value, i / 2 + 1);
return;
}
}
@@ -976,8 +992,8 @@ static void wiphy_print_band_info(struct band *band, const char *name)
if (test_bit(band->vht_capabilities, 6))
l_info("\t\t\tShort GI for 160 and 80 + 80 Mhz");
- wiphy_print_vht_mcs_info(band->vht_mcs_set, "RX");
- wiphy_print_vht_mcs_info(band->vht_mcs_set + 4, "TX");
+ wiphy_print_mcs_info(band->vht_mcs_set, "RX", 7, 8, 9);
+ wiphy_print_mcs_info(band->vht_mcs_set + 4, "TX", 7, 8, 9);
}
}