hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/wireless/mediatek/mt76/mt76.h
....@@ -561,6 +561,7 @@
561561 struct mt76_channel_state *chan_state;
562562 ktime_t survey_time;
563563
564
+ struct mt76_hw_cap cap;
564565 struct mt76_sband sband_2g;
565566 struct mt76_sband sband_5g;
566567
....@@ -630,7 +631,6 @@
630631
631632 struct debugfs_blob_wrapper eeprom;
632633 struct debugfs_blob_wrapper otp;
633
- struct mt76_hw_cap cap;
634634
635635 struct mt76_rate_power rate_power;
636636
....@@ -884,8 +884,9 @@
884884 static inline u8 mt76_tx_power_nss_delta(u8 nss)
885885 {
886886 static const u8 nss_delta[4] = { 0, 6, 9, 12 };
887
+ u8 idx = nss - 1;
887888
888
- return nss_delta[nss - 1];
889
+ return (idx < ARRAY_SIZE(nss_delta)) ? nss_delta[idx] : 0;
889890 }
890891
891892 static inline bool mt76_testmode_enabled(struct mt76_dev *dev)