mt76: testmode: add snr attribute in rx statistics

Support to display snr value when dumping rx statistics.

Reviewed-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]> [update tools/]
This commit is contained in:
Shayne Chen
2020-11-10 13:25:19 +01:00
committed by Felix Fietkau
parent cdeb1b29cd
commit 0a898c0549
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -101,6 +101,7 @@ enum mt76_testmode_stats_attr {
* @MT76_TM_RX_ATTR_RCPI: received channel power indicator (array, u8)
* @MT76_TM_RX_ATTR_IB_RSSI: internal inband RSSI (array, s8)
* @MT76_TM_RX_ATTR_WB_RSSI: internal wideband RSSI (array, s8)
* @MT76_TM_RX_ATTR_SNR: signal-to-noise ratio (u8)
*/
enum mt76_testmode_rx_attr {
MT76_TM_RX_ATTR_UNSPEC,
@@ -109,6 +110,7 @@ enum mt76_testmode_rx_attr {
MT76_TM_RX_ATTR_RCPI,
MT76_TM_RX_ATTR_IB_RSSI,
MT76_TM_RX_ATTR_WB_RSSI,
MT76_TM_RX_ATTR_SNR,
/* keep last */
NUM_MT76_TM_RX_ATTRS,
+2
View File
@@ -252,12 +252,14 @@ static const struct tm_field rx_fields[NUM_MT76_TM_RX_ATTRS] = {
FIELD_ARRAY_RO(u8, RCPI, "rcpi"),
FIELD_ARRAY_RO(s8, IB_RSSI, "ib_rssi"),
FIELD_ARRAY_RO(s8, WB_RSSI, "wb_rssi"),
FIELD_RO(s8, SNR, "snr"),
};
static struct nla_policy rx_policy[NUM_MT76_TM_RX_ATTRS] = {
[MT76_TM_RX_ATTR_FREQ_OFFSET] = { .type = NLA_U32 },
[MT76_TM_RX_ATTR_RCPI] = { .type = NLA_NESTED },
[MT76_TM_RX_ATTR_IB_RSSI] = { .type = NLA_NESTED },
[MT76_TM_RX_ATTR_WB_RSSI] = { .type = NLA_NESTED },
[MT76_TM_RX_ATTR_SNR] = { .type = NLA_U8 },
};
#undef FIELD_NAME