3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:49:24 +01:00

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.
This commit is contained in:
James Prestwood 2022-07-19 11:55:39 -07:00 committed by Denis Kenzior
parent bdcbccbb9f
commit 3d48d147ca

View File

@ -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, static void wiphy_print_mcs_info(const uint8_t *mcs_map,
const char *prefix) const char *prefix,
uint8_t value0,
uint8_t value1,
uint8_t value2)
{ {
int i; int i;
for (i = 14; i >= 0; i -= 2) { for (i = 14; i >= 0; i -= 2) {
uint8_t value;
int mcs = bit_field(mcs_map[i / 8], i % 8, 2); int mcs = bit_field(mcs_map[i / 8], i % 8, 2);
if (mcs == 0x3) if (mcs == 0x3)
continue; 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, l_info("\t\t\tMax %s MCS: 0-%d for NSS: %d", prefix,
mcs + 7, i / 2 + 1); value, i / 2 + 1);
return; return;
} }
} }
@ -976,8 +992,8 @@ static void wiphy_print_band_info(struct band *band, const char *name)
if (test_bit(band->vht_capabilities, 6)) if (test_bit(band->vht_capabilities, 6))
l_info("\t\t\tShort GI for 160 and 80 + 80 Mhz"); l_info("\t\t\tShort GI for 160 and 80 + 80 Mhz");
wiphy_print_vht_mcs_info(band->vht_mcs_set, "RX"); wiphy_print_mcs_info(band->vht_mcs_set, "RX", 7, 8, 9);
wiphy_print_vht_mcs_info(band->vht_mcs_set + 4, "TX"); wiphy_print_mcs_info(band->vht_mcs_set + 4, "TX", 7, 8, 9);
} }
} }