forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
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)