developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 1 | From e5b0035623fe1ae0e770dcff3c0c97fc6379249e Mon Sep 17 00:00:00 2001 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Mon, 5 Dec 2022 18:21:51 +0800 |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 4 | Subject: [PATCH 1022/1051] wifi: mt76: mt7915: add bf backoff limit table |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 5 | support |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 6 | |
| 7 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 8 | --- |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 9 | debugfs.c | 4 +- |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 10 | eeprom.c | 43 ++++++++++-- |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 11 | mt76.h | 8 +++ |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 12 | mt7915/debugfs.c | 73 +++++++++++++++++-- |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 13 | mt7915/init.c | 7 ++ |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 14 | mt7915/main.c | 6 +- |
| 15 | mt7915/mcu.c | 178 +++++++++++++++++++++++++++++++++++++---------- |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 16 | mt7915/mcu.h | 6 ++ |
| 17 | mt7915/mt7915.h | 9 ++- |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 18 | 9 files changed, 279 insertions(+), 55 deletions(-) |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 19 | |
developer | f9b0021 | 2023-07-31 12:27:06 +0800 | [diff] [blame] | 20 | diff --git a/debugfs.c b/debugfs.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 21 | index 1c8328d5..a626f7cf 100644 |
developer | f9b0021 | 2023-07-31 12:27:06 +0800 | [diff] [blame] | 22 | --- a/debugfs.c |
| 23 | +++ b/debugfs.c |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 24 | @@ -95,9 +95,9 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str, |
developer | f9b0021 | 2023-07-31 12:27:06 +0800 | [diff] [blame] | 25 | { |
| 26 | int i; |
| 27 | |
| 28 | - seq_printf(file, "%10s:", str); |
| 29 | + seq_printf(file, "%16s:", str); |
| 30 | for (i = 0; i < len; i++) |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 31 | - seq_printf(file, " %2d", val[i]); |
| 32 | + seq_printf(file, " %4d", val[i]); |
developer | f9b0021 | 2023-07-31 12:27:06 +0800 | [diff] [blame] | 33 | seq_puts(file, "\n"); |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 34 | } |
| 35 | EXPORT_SYMBOL_GPL(mt76_seq_puts_array); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 36 | diff --git a/eeprom.c b/eeprom.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 37 | index 9d029c04..4213e444 100644 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 38 | --- a/eeprom.c |
| 39 | +++ b/eeprom.c |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 40 | @@ -336,9 +336,10 @@ mt76_apply_array_limit(s8 *pwr, size_t pwr_len, const __be32 *data, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 41 | static void |
| 42 | mt76_apply_multi_array_limit(s8 *pwr, size_t pwr_len, s8 pwr_num, |
| 43 | const __be32 *data, size_t len, s8 target_power, |
| 44 | - s8 nss_delta, s8 *max_power) |
| 45 | + s8 nss_delta) |
| 46 | { |
| 47 | int i, cur; |
| 48 | + s8 max_power = -128; |
| 49 | |
| 50 | if (!data) |
| 51 | return; |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 52 | @@ -350,7 +351,7 @@ mt76_apply_multi_array_limit(s8 *pwr, size_t pwr_len, s8 pwr_num, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 53 | break; |
| 54 | |
| 55 | mt76_apply_array_limit(pwr + pwr_len * i, pwr_len, data + 1, |
| 56 | - target_power, nss_delta, max_power); |
| 57 | + target_power, nss_delta, &max_power); |
| 58 | if (--cur > 0) |
| 59 | continue; |
| 60 | |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 61 | @@ -377,12 +378,16 @@ s8 mt76_get_rate_power_limits(struct mt76_phy *phy, |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 62 | char band; |
| 63 | size_t len; |
developer | c879603 | 2023-08-09 10:28:15 +0800 | [diff] [blame] | 64 | s8 max_power = -127; |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 65 | + s8 max_power_backoff = -127; |
| 66 | s8 txs_delta; |
developer | f9b0021 | 2023-07-31 12:27:06 +0800 | [diff] [blame] | 67 | + int n_chains = hweight16(phy->chainmask); |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 68 | + s8 target_power_combine = target_power + mt76_tx_power_nss_delta(n_chains); |
| 69 | |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 70 | if (!mcs_rates) |
| 71 | mcs_rates = 10; |
| 72 | |
| 73 | - memset(dest, target_power, sizeof(*dest)); |
| 74 | + memset(dest, target_power, sizeof(*dest) - sizeof(dest->path)); |
| 75 | + memset(&dest->path, 0, sizeof(dest->path)); |
| 76 | |
| 77 | if (!IS_ENABLED(CONFIG_OF)) |
| 78 | return target_power; |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 79 | @@ -428,14 +433,40 @@ s8 mt76_get_rate_power_limits(struct mt76_phy *phy, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 80 | val = mt76_get_of_array(np, "rates-mcs", &len, mcs_rates + 1); |
| 81 | mt76_apply_multi_array_limit(dest->mcs[0], ARRAY_SIZE(dest->mcs[0]), |
| 82 | ARRAY_SIZE(dest->mcs), val, len, |
| 83 | - target_power, txs_delta, &max_power); |
| 84 | + target_power, txs_delta); |
| 85 | |
| 86 | val = mt76_get_of_array(np, "rates-ru", &len, ru_rates + 1); |
| 87 | mt76_apply_multi_array_limit(dest->ru[0], ARRAY_SIZE(dest->ru[0]), |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 88 | ARRAY_SIZE(dest->ru), val, len, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 89 | - target_power, txs_delta, &max_power); |
| 90 | + target_power, txs_delta); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 91 | |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 92 | - return max_power; |
| 93 | + max_power_backoff = max_power; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 94 | + val = mt76_get_of_array(np, "paths-cck", &len, ARRAY_SIZE(dest->path.cck)); |
| 95 | + mt76_apply_array_limit(dest->path.cck, ARRAY_SIZE(dest->path.cck), val, |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 96 | + target_power_combine, txs_delta, &max_power_backoff); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 97 | + |
| 98 | + val = mt76_get_of_array(np, "paths-ofdm", &len, ARRAY_SIZE(dest->path.ofdm)); |
| 99 | + mt76_apply_array_limit(dest->path.ofdm, ARRAY_SIZE(dest->path.ofdm), val, |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 100 | + target_power_combine, txs_delta, &max_power_backoff); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 101 | + |
| 102 | + val = mt76_get_of_array(np, "paths-ofdm-bf", &len, ARRAY_SIZE(dest->path.ofdm_bf)); |
| 103 | + mt76_apply_array_limit(dest->path.ofdm_bf, ARRAY_SIZE(dest->path.ofdm_bf), val, |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 104 | + target_power_combine, txs_delta, &max_power_backoff); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 105 | + |
| 106 | + val = mt76_get_of_array(np, "paths-ru", &len, ARRAY_SIZE(dest->path.ru[0]) + 1); |
| 107 | + mt76_apply_multi_array_limit(dest->path.ru[0], ARRAY_SIZE(dest->path.ru[0]), |
| 108 | + ARRAY_SIZE(dest->path.ru), val, len, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 109 | + target_power_combine, txs_delta); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 110 | + |
| 111 | + val = mt76_get_of_array(np, "paths-ru-bf", &len, ARRAY_SIZE(dest->path.ru_bf[0]) + 1); |
| 112 | + mt76_apply_multi_array_limit(dest->path.ru_bf[0], ARRAY_SIZE(dest->path.ru_bf[0]), |
| 113 | + ARRAY_SIZE(dest->path.ru_bf), val, len, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 114 | + target_power_combine, txs_delta); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 115 | + |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 116 | + if (max_power_backoff == target_power_combine) |
| 117 | + return max_power; |
| 118 | + |
| 119 | + return max_power_backoff; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 120 | } |
| 121 | EXPORT_SYMBOL_GPL(mt76_get_rate_power_limits); |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 122 | |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 123 | diff --git a/mt76.h b/mt76.h |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 124 | index 48e98a3a..5c267154 100644 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 125 | --- a/mt76.h |
| 126 | +++ b/mt76.h |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 127 | @@ -1089,6 +1089,14 @@ struct mt76_power_limits { |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 128 | s8 mcs[4][10]; |
| 129 | s8 ru[7][12]; |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 130 | s8 eht[16][16]; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 131 | + |
| 132 | + struct { |
| 133 | + s8 cck[4]; |
| 134 | + s8 ofdm[4]; |
| 135 | + s8 ofdm_bf[4]; |
| 136 | + s8 ru[7][10]; |
| 137 | + s8 ru_bf[7][10]; |
| 138 | + } path; |
| 139 | }; |
| 140 | |
| 141 | struct mt76_ethtool_worker_info { |
| 142 | diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 143 | index 40a126fa..c7002ee0 100644 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 144 | --- a/mt7915/debugfs.c |
| 145 | +++ b/mt7915/debugfs.c |
developer | 47efbdb | 2023-06-29 20:33:22 +0800 | [diff] [blame] | 146 | @@ -1019,7 +1019,7 @@ mt7915_rate_txpower_get(struct file *file, char __user *user_buf, |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 147 | if (!buf) |
| 148 | return -ENOMEM; |
| 149 | |
| 150 | - ret = mt7915_mcu_get_txpower_sku(phy, txpwr, sizeof(txpwr)); |
| 151 | + ret = mt7915_mcu_get_txpower_sku(phy, txpwr, sizeof(txpwr), TX_POWER_INFO_RATE); |
| 152 | if (ret) |
| 153 | goto out; |
| 154 | |
developer | c879603 | 2023-08-09 10:28:15 +0800 | [diff] [blame] | 155 | @@ -1133,7 +1133,7 @@ mt7915_rate_txpower_set(struct file *file, const char __user *user_buf, |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 156 | |
| 157 | mutex_lock(&dev->mt76.mutex); |
| 158 | ret = mt7915_mcu_get_txpower_sku(phy, req.txpower_sku, |
| 159 | - sizeof(req.txpower_sku)); |
| 160 | + sizeof(req.txpower_sku), TX_POWER_INFO_RATE); |
| 161 | if (ret) |
| 162 | goto out; |
| 163 | |
developer | c879603 | 2023-08-09 10:28:15 +0800 | [diff] [blame] | 164 | @@ -1175,7 +1175,7 @@ out: |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 165 | return ret ? ret : count; |
| 166 | } |
| 167 | |
| 168 | -static const struct file_operations mt7915_rate_txpower_fops = { |
| 169 | +static const struct file_operations mt7915_txpower_fops = { |
| 170 | .write = mt7915_rate_txpower_set, |
| 171 | .read = mt7915_rate_txpower_get, |
| 172 | .open = simple_open, |
developer | c879603 | 2023-08-09 10:28:15 +0800 | [diff] [blame] | 173 | @@ -1183,6 +1183,69 @@ static const struct file_operations mt7915_rate_txpower_fops = { |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 174 | .llseek = default_llseek, |
| 175 | }; |
| 176 | |
| 177 | +static int |
| 178 | +mt7915_path_txpower_show(struct seq_file *file) |
| 179 | +{ |
| 180 | + struct mt7915_phy *phy = file->private; |
| 181 | + s8 txpower[MT7915_SKU_PATH_NUM], *buf = txpower; |
| 182 | + int ret; |
| 183 | + |
| 184 | +#define PATH_POWER_SHOW(_name, _len, _skip) do { \ |
| 185 | + if (_skip) { \ |
| 186 | + buf -= 1; \ |
| 187 | + *buf = 0; \ |
| 188 | + } \ |
| 189 | + mt76_seq_puts_array(file, _name, buf, _len); \ |
| 190 | + buf += _len; \ |
| 191 | + } while(0) |
| 192 | + |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 193 | + seq_printf(file, "\n%*c", 18, ' '); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 194 | + seq_printf(file, "1T1S/2T1S/3T1S/4T1S/2T2S/3T2S/4T2S/3T3S/4T3S/4T4S\n"); |
| 195 | + ret = mt7915_mcu_get_txpower_sku(phy, txpower, sizeof(txpower), |
| 196 | + TX_POWER_INFO_PATH); |
| 197 | + if (ret) |
| 198 | + return ret; |
| 199 | + |
| 200 | + PATH_POWER_SHOW("CCK", 4, 0); |
| 201 | + PATH_POWER_SHOW("OFDM", 4, 0); |
| 202 | + PATH_POWER_SHOW("BF-OFDM", 4, 1); |
| 203 | + |
developer | f9b0021 | 2023-07-31 12:27:06 +0800 | [diff] [blame] | 204 | + PATH_POWER_SHOW("HT/VHT20", 10, 0); |
| 205 | + PATH_POWER_SHOW("BF-HT/VHT20", 10, 1); |
| 206 | + PATH_POWER_SHOW("HT/VHT40", 10, 0); |
| 207 | + PATH_POWER_SHOW("BF-HT/VHT40", 10, 1); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 208 | + |
developer | f9b0021 | 2023-07-31 12:27:06 +0800 | [diff] [blame] | 209 | + PATH_POWER_SHOW("BW20/RU242", 10, 0); |
| 210 | + PATH_POWER_SHOW("BF-BW20/RU242", 10, 1); |
| 211 | + PATH_POWER_SHOW("BW40/RU484", 10, 0); |
| 212 | + PATH_POWER_SHOW("BF-BW40/RU484", 10, 1); |
| 213 | + PATH_POWER_SHOW("BW80/RU996", 10, 0); |
| 214 | + PATH_POWER_SHOW("BF-BW80/RU996", 10, 1); |
| 215 | + PATH_POWER_SHOW("BW160/RU2x996", 10, 0); |
| 216 | + PATH_POWER_SHOW("BF-BW160/RU2x996", 10, 1); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 217 | + PATH_POWER_SHOW("RU26", 10, 0); |
| 218 | + PATH_POWER_SHOW("BF-RU26", 10, 0); |
| 219 | + PATH_POWER_SHOW("RU52", 10, 0); |
| 220 | + PATH_POWER_SHOW("BF-RU52", 10, 0); |
| 221 | + PATH_POWER_SHOW("RU106", 10, 0); |
| 222 | + PATH_POWER_SHOW("BF-RU106", 10, 0); |
| 223 | +#undef PATH_POWER_SHOW |
| 224 | + |
| 225 | + return 0; |
| 226 | +} |
| 227 | + |
| 228 | +static int |
| 229 | +mt7915_txpower_path_show(struct seq_file *file, void *data) |
| 230 | +{ |
| 231 | + struct mt7915_phy *phy = file->private; |
| 232 | + |
| 233 | + seq_printf(file, "\nBand %d\n", phy != &phy->dev->phy); |
| 234 | + |
| 235 | + return mt7915_path_txpower_show(file); |
| 236 | +} |
| 237 | + |
| 238 | +DEFINE_SHOW_ATTRIBUTE(mt7915_txpower_path); |
| 239 | + |
| 240 | static int |
| 241 | mt7915_twt_stats(struct seq_file *s, void *data) |
| 242 | { |
developer | 753619c | 2024-02-22 13:42:45 +0800 | [diff] [blame] | 243 | @@ -1309,7 +1372,9 @@ int mt7915_init_debugfs(struct mt7915_phy *phy) |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 244 | debugfs_create_file("implicit_txbf", 0600, dir, dev, |
| 245 | &fops_implicit_txbf); |
| 246 | debugfs_create_file("txpower_sku", 0400, dir, phy, |
| 247 | - &mt7915_rate_txpower_fops); |
| 248 | + &mt7915_txpower_fops); |
| 249 | + debugfs_create_file("txpower_path", 0400, dir, phy, |
| 250 | + &mt7915_txpower_path_fops); |
| 251 | debugfs_create_devm_seqfile(dev->mt76.dev, "twt_stats", dir, |
| 252 | mt7915_twt_stats); |
| 253 | debugfs_create_file("rf_regval", 0600, dir, dev, &fops_rf_regval); |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 254 | diff --git a/mt7915/init.c b/mt7915/init.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 255 | index 83748da6..33e030f5 100644 |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 256 | --- a/mt7915/init.c |
| 257 | +++ b/mt7915/init.c |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 258 | @@ -284,6 +284,8 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 259 | int pwr_delta = mt7915_eeprom_get_power_delta(dev, sband->band); |
| 260 | struct mt76_power_limits limits; |
| 261 | |
| 262 | + phy->sku_limit_en = true; |
| 263 | + phy->sku_path_en = true; |
| 264 | for (i = 0; i < sband->n_channels; i++) { |
| 265 | struct ieee80211_channel *chan = &sband->channels[i]; |
| 266 | u32 target_power = 0; |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 267 | @@ -300,6 +302,11 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 268 | target_power = mt76_get_rate_power_limits(phy->mt76, chan, |
| 269 | &limits, |
| 270 | target_power); |
| 271 | + |
| 272 | + /* MT7915N can not enable Backoff table without setting value in dts */ |
| 273 | + if (!limits.path.ofdm[0]) |
| 274 | + phy->sku_path_en = false; |
| 275 | + |
| 276 | target_power += nss_delta; |
| 277 | target_power = DIV_ROUND_UP(target_power, 2); |
| 278 | chan->max_power = min_t(int, chan->max_reg_power, |
| 279 | diff --git a/mt7915/main.c b/mt7915/main.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 280 | index 9fafa162..da7a87bf 100644 |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 281 | --- a/mt7915/main.c |
| 282 | +++ b/mt7915/main.c |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 283 | @@ -73,11 +73,7 @@ int mt7915_run(struct ieee80211_hw *hw) |
| 284 | if (ret) |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 285 | goto out; |
| 286 | |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 287 | -#ifdef MTK_DEBUG |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 288 | - ret = mt7915_mcu_set_sku_en(phy, !dev->dbg.sku_disable); |
| 289 | -#else |
| 290 | - ret = mt7915_mcu_set_sku_en(phy, true); |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 291 | -#endif |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 292 | + ret = mt7915_mcu_set_sku_en(phy); |
| 293 | if (ret) |
| 294 | goto out; |
| 295 | |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 296 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 297 | index 12622068..eb7638b5 100644 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 298 | --- a/mt7915/mcu.c |
| 299 | +++ b/mt7915/mcu.c |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 300 | @@ -3422,7 +3422,8 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy, |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 301 | int ret; |
| 302 | s8 txpower_sku[MT7915_SKU_RATE_NUM]; |
| 303 | |
| 304 | - ret = mt7915_mcu_get_txpower_sku(phy, txpower_sku, sizeof(txpower_sku)); |
| 305 | + ret = mt7915_mcu_get_txpower_sku(phy, txpower_sku, sizeof(txpower_sku), |
| 306 | + TX_POWER_INFO_RATE); |
| 307 | if (ret) |
| 308 | return ret; |
| 309 | |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 310 | @@ -3462,53 +3463,139 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 311 | sizeof(req), true); |
| 312 | } |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 313 | |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 314 | +static void |
| 315 | +mt7915_update_txpower(struct mt7915_phy *phy, int tx_power) |
| 316 | +{ |
| 317 | + struct mt76_phy *mphy = phy->mt76; |
| 318 | + struct ieee80211_channel *chan = mphy->main_chan; |
| 319 | + int chain_idx, val, e2p_power_limit = 0; |
| 320 | + |
| 321 | + if (chan == NULL) { |
| 322 | + mphy->txpower_cur = tx_power; |
| 323 | + return; |
| 324 | + } |
| 325 | + |
| 326 | + for (chain_idx = 0; chain_idx < hweight16(mphy->chainmask); chain_idx++) { |
| 327 | + val = mt7915_eeprom_get_target_power(phy->dev, chan, chain_idx); |
| 328 | + val += mt7915_eeprom_get_power_delta(phy->dev, chan->band); |
| 329 | + |
| 330 | + e2p_power_limit = max_t(int, e2p_power_limit, val); |
| 331 | + } |
| 332 | + |
| 333 | + if (phy->sku_limit_en) |
| 334 | + mphy->txpower_cur = min_t(int, e2p_power_limit, tx_power); |
| 335 | + else |
| 336 | + mphy->txpower_cur = e2p_power_limit; |
| 337 | +} |
| 338 | + |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 339 | int mt7915_mcu_set_txpower_sku(struct mt7915_phy *phy) |
| 340 | { |
| 341 | +#define TX_POWER_LIMIT_TABLE_RATE 0 |
| 342 | +#define TX_POWER_LIMIT_TABLE_PATH 1 |
| 343 | struct mt7915_dev *dev = phy->dev; |
| 344 | struct mt76_phy *mphy = phy->mt76; |
| 345 | struct ieee80211_hw *hw = mphy->hw; |
| 346 | - struct mt7915_mcu_txpower_sku req = { |
| 347 | + struct mt7915_sku_val { |
| 348 | + u8 format_id; |
| 349 | + u8 limit_type; |
| 350 | + u8 band_idx; |
| 351 | + } __packed hdr = { |
| 352 | .format_id = TX_POWER_LIMIT_TABLE, |
| 353 | + .limit_type = TX_POWER_LIMIT_TABLE_RATE, |
| 354 | .band_idx = phy->mt76->band_idx, |
| 355 | }; |
| 356 | - struct mt76_power_limits limits_array; |
| 357 | - s8 *la = (s8 *)&limits_array; |
| 358 | - int i, idx; |
| 359 | - int tx_power; |
| 360 | + int i, ret, tx_power; |
| 361 | + const u8 *len = mt7915_sku_group_len; |
| 362 | + struct mt76_power_limits la = {}; |
| 363 | + struct sk_buff *skb; |
| 364 | |
| 365 | tx_power = mt7915_get_power_bound(phy, hw->conf.power_level); |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 366 | - tx_power = mt76_get_rate_power_limits(mphy, mphy->chandef.chan, |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 367 | - &limits_array, tx_power); |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 368 | - mphy->txpower_cur = tx_power; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 369 | |
| 370 | - for (i = 0, idx = 0; i < ARRAY_SIZE(mt7915_sku_group_len); i++) { |
| 371 | - u8 mcs_num, len = mt7915_sku_group_len[i]; |
| 372 | - int j; |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 373 | + if (phy->sku_limit_en) { |
| 374 | + tx_power = mt76_get_rate_power_limits(mphy, mphy->chandef.chan, |
| 375 | + &la, tx_power); |
| 376 | + mt7915_update_txpower(phy, tx_power); |
| 377 | + } else { |
| 378 | + mt7915_update_txpower(phy, tx_power); |
| 379 | + return 0; |
| 380 | + } |
| 381 | |
| 382 | - if (i >= SKU_HT_BW20 && i <= SKU_VHT_BW160) { |
| 383 | - mcs_num = 10; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 384 | + skb = mt76_mcu_msg_alloc(&dev->mt76, NULL, |
| 385 | + sizeof(hdr) + MT7915_SKU_RATE_NUM); |
| 386 | + if (!skb) |
| 387 | + return -ENOMEM; |
| 388 | |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 389 | - if (i == SKU_HT_BW20 || i == SKU_VHT_BW20) |
| 390 | - la = (s8 *)&limits_array + 12; |
| 391 | - } else { |
| 392 | - mcs_num = len; |
| 393 | - } |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 394 | + skb_put_data(skb, &hdr, sizeof(hdr)); |
| 395 | + skb_put_data(skb, &la.cck, len[SKU_CCK] + len[SKU_OFDM]); |
| 396 | + skb_put_data(skb, &la.mcs[0], len[SKU_HT_BW20]); |
| 397 | + skb_put_data(skb, &la.mcs[1], len[SKU_HT_BW40]); |
| 398 | + |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 399 | + /* vht */ |
| 400 | + for (i = 0; i < 4; i++) { |
| 401 | + skb_put_data(skb, &la.mcs[i], sizeof(la.mcs[i])); |
| 402 | + skb_put_zero(skb, 2); /* padding */ |
| 403 | + } |
developer | c5ce750 | 2022-12-19 11:33:22 +0800 | [diff] [blame] | 404 | |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 405 | - for (j = 0; j < min_t(u8, mcs_num, len); j++) |
| 406 | - req.txpower_sku[idx + j] = la[j]; |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 407 | + /* he */ |
| 408 | + skb_put_data(skb, &la.ru[0], sizeof(la.ru)); |
| 409 | |
| 410 | - la += mcs_num; |
| 411 | - idx += len; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 412 | + ret = mt76_mcu_skb_send_msg(&dev->mt76, skb, |
| 413 | + MCU_EXT_CMD(TX_POWER_FEATURE_CTRL), true); |
| 414 | + if (ret) |
| 415 | + return ret; |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 416 | + |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 417 | + /* only set per-path power table when it's configured */ |
| 418 | + if (!phy->sku_path_en) |
| 419 | + return 0; |
| 420 | + |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 421 | + skb = mt76_mcu_msg_alloc(&dev->mt76, NULL, |
| 422 | + sizeof(hdr) + MT7915_SKU_PATH_NUM); |
| 423 | + if (!skb) |
| 424 | + return -ENOMEM; |
developer | c5ce750 | 2022-12-19 11:33:22 +0800 | [diff] [blame] | 425 | + |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 426 | + hdr.limit_type = TX_POWER_LIMIT_TABLE_PATH; |
| 427 | + skb_put_data(skb, &hdr, sizeof(hdr)); |
| 428 | + skb_put_data(skb, &la.path.cck, sizeof(la.path.cck)); |
| 429 | + skb_put_data(skb, &la.path.ofdm, sizeof(la.path.ofdm)); |
| 430 | + skb_put_data(skb, &la.path.ofdm_bf[1], sizeof(la.path.ofdm_bf) - 1); |
| 431 | + |
| 432 | + /* HT20 and HT40 */ |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 433 | + skb_put_data(skb, &la.path.ru[3], sizeof(la.path.ru[3])); |
| 434 | + skb_put_data(skb, &la.path.ru_bf[3][1], sizeof(la.path.ru_bf[3]) - 1); |
| 435 | + skb_put_data(skb, &la.path.ru[4], sizeof(la.path.ru[4])); |
| 436 | + skb_put_data(skb, &la.path.ru_bf[4][1], sizeof(la.path.ru_bf[4]) - 1); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 437 | + |
| 438 | + /* start from non-bf and bf fields of |
| 439 | + * BW20/RU242, BW40/RU484, BW80/RU996, BW160/RU2x996, |
| 440 | + * RU26, RU52, and RU106 |
| 441 | + */ |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 442 | + |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 443 | + for (i = 0; i < 8; i++) { |
| 444 | + bool bf = i % 2; |
| 445 | + u8 idx = (i + 6) / 2; |
| 446 | + s8 *buf = bf ? la.path.ru_bf[idx] : la.path.ru[idx]; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 447 | + /* The non-bf fields of RU26 to RU106 are special cases */ |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 448 | + if (bf) |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 449 | + skb_put_data(skb, buf + 1, 9); |
| 450 | + else |
| 451 | + skb_put_data(skb, buf, 10); |
| 452 | } |
| 453 | |
| 454 | - return mt76_mcu_send_msg(&dev->mt76, |
| 455 | - MCU_EXT_CMD(TX_POWER_FEATURE_CTRL), &req, |
| 456 | - sizeof(req), true); |
developer | 327aa32 | 2023-07-10 13:49:56 +0800 | [diff] [blame] | 457 | + for (i = 0; i < 6; i++) { |
| 458 | + bool bf = i % 2; |
| 459 | + u8 idx = i / 2; |
| 460 | + s8 *buf = bf ? la.path.ru_bf[idx] : la.path.ru[idx]; |
| 461 | + |
| 462 | + skb_put_data(skb, buf, 10); |
| 463 | + } |
| 464 | + |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 465 | + return mt76_mcu_skb_send_msg(&dev->mt76, skb, |
developer | c5ce750 | 2022-12-19 11:33:22 +0800 | [diff] [blame] | 466 | + MCU_EXT_CMD(TX_POWER_FEATURE_CTRL), true); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 467 | } |
| 468 | |
| 469 | -int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len) |
| 470 | +int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len, |
| 471 | + u8 category) |
| 472 | { |
| 473 | -#define RATE_POWER_INFO 2 |
| 474 | struct mt7915_dev *dev = phy->dev; |
| 475 | struct { |
| 476 | u8 format_id; |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 477 | @@ -3517,10 +3604,9 @@ int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len) |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 478 | u8 _rsv; |
| 479 | } __packed req = { |
| 480 | .format_id = TX_POWER_LIMIT_INFO, |
| 481 | - .category = RATE_POWER_INFO, |
| 482 | + .category = category, |
| 483 | .band_idx = phy->mt76->band_idx, |
| 484 | }; |
| 485 | - s8 txpower_sku[MT7915_SKU_RATE_NUM][2]; |
| 486 | struct sk_buff *skb; |
| 487 | int ret, i; |
| 488 | |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 489 | @@ -3530,9 +3616,15 @@ int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len) |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 490 | if (ret) |
| 491 | return ret; |
| 492 | |
| 493 | - memcpy(txpower_sku, skb->data + 4, sizeof(txpower_sku)); |
| 494 | - for (i = 0; i < len; i++) |
| 495 | - txpower[i] = txpower_sku[i][req.band_idx]; |
| 496 | + if (category == TX_POWER_INFO_RATE) { |
| 497 | + s8 res[MT7915_SKU_RATE_NUM][2]; |
| 498 | + |
| 499 | + memcpy(res, skb->data + 4, sizeof(res)); |
| 500 | + for (i = 0; i < len; i++) |
| 501 | + txpower[i] = res[i][req.band_idx]; |
| 502 | + } else if (category == TX_POWER_INFO_PATH) { |
| 503 | + memcpy(txpower, skb->data + 4, len); |
| 504 | + } |
| 505 | |
| 506 | dev_kfree_skb(skb); |
| 507 | |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 508 | @@ -3561,7 +3653,7 @@ int mt7915_mcu_set_test_param(struct mt7915_dev *dev, u8 param, bool test_mode, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 509 | sizeof(req), false); |
| 510 | } |
| 511 | |
| 512 | -int mt7915_mcu_set_sku_en(struct mt7915_phy *phy, bool enable) |
| 513 | +int mt7915_mcu_set_sku_en(struct mt7915_phy *phy) |
| 514 | { |
| 515 | struct mt7915_dev *dev = phy->dev; |
| 516 | struct mt7915_sku { |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 517 | @@ -3572,10 +3664,24 @@ int mt7915_mcu_set_sku_en(struct mt7915_phy *phy, bool enable) |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 518 | } __packed req = { |
| 519 | .format_id = TX_POWER_LIMIT_ENABLE, |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 520 | .band_idx = phy->mt76->band_idx, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 521 | - .sku_enable = enable, |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 522 | }; |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 523 | + int ret, sku_disable = 0; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 524 | + |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 525 | +#ifdef MTK_DEBUG |
| 526 | + sku_disable = dev->dbg.sku_disable; |
| 527 | +#endif |
| 528 | + req.sku_enable = sku_disable ? 0 : phy->sku_limit_en; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 529 | + ret = mt76_mcu_send_msg(&dev->mt76, |
| 530 | + MCU_EXT_CMD(TX_POWER_FEATURE_CTRL), &req, |
| 531 | + sizeof(req), true); |
| 532 | + if (ret) |
| 533 | + return ret; |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 534 | + |
| 535 | + pr_info("%s: sku enable = %d, path enable = %d\n", __func__, |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 536 | + sku_disable ? 0 : phy->sku_limit_en, sku_disable ? 0 : phy->sku_path_en); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 537 | |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 538 | - pr_info("%s: enable = %d\n", __func__, enable); |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 539 | + req.sku_enable = sku_disable ? 0 : phy->sku_path_en; |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 540 | + req.format_id = TX_POWER_LIMIT_PATH_ENABLE; |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 541 | |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 542 | return mt76_mcu_send_msg(&dev->mt76, |
| 543 | MCU_EXT_CMD(TX_POWER_FEATURE_CTRL), &req, |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 544 | diff --git a/mt7915/mcu.h b/mt7915/mcu.h |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 545 | index 1b0bd06b..94eff268 100644 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 546 | --- a/mt7915/mcu.h |
| 547 | +++ b/mt7915/mcu.h |
developer | 753619c | 2024-02-22 13:42:45 +0800 | [diff] [blame] | 548 | @@ -517,12 +517,18 @@ enum { |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 549 | |
| 550 | enum { |
| 551 | TX_POWER_LIMIT_ENABLE, |
| 552 | + TX_POWER_LIMIT_PATH_ENABLE = 0x3, |
| 553 | TX_POWER_LIMIT_TABLE = 0x4, |
| 554 | TX_POWER_LIMIT_INFO = 0x7, |
| 555 | TX_POWER_LIMIT_FRAME = 0x11, |
| 556 | TX_POWER_LIMIT_FRAME_MIN = 0x12, |
| 557 | }; |
| 558 | |
| 559 | +enum { |
| 560 | + TX_POWER_INFO_PATH = 1, |
| 561 | + TX_POWER_INFO_RATE, |
| 562 | +}; |
| 563 | + |
| 564 | enum { |
| 565 | SPR_ENABLE = 0x1, |
| 566 | SPR_ENABLE_SD = 0x3, |
| 567 | diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 568 | index 1e5cd941..826682be 100644 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 569 | --- a/mt7915/mt7915.h |
| 570 | +++ b/mt7915/mt7915.h |
developer | 7af0f76 | 2023-05-22 15:16:16 +0800 | [diff] [blame] | 571 | @@ -72,6 +72,7 @@ |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 572 | #define MT7915_CDEV_THROTTLE_MAX 99 |
| 573 | |
| 574 | #define MT7915_SKU_RATE_NUM 161 |
| 575 | +#define MT7915_SKU_PATH_NUM 185 |
| 576 | |
| 577 | #define MT7915_MAX_TWT_AGRT 16 |
| 578 | #define MT7915_MAX_STA_TWT_AGRT 8 |
developer | eb15569 | 2024-01-11 14:08:37 +0800 | [diff] [blame] | 579 | @@ -300,6 +301,9 @@ struct mt7915_phy { |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 580 | struct list_head stats_list; |
| 581 | spinlock_t stats_lock; |
| 582 | |
| 583 | + bool sku_limit_en; |
| 584 | + bool sku_path_en; |
| 585 | + |
| 586 | #ifdef CONFIG_NL80211_TESTMODE |
| 587 | struct { |
| 588 | u32 *reg_backup; |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 589 | @@ -626,9 +630,10 @@ int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable, |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 590 | int mt7915_mcu_set_test_param(struct mt7915_dev *dev, u8 param, bool test_mode, |
| 591 | u8 en); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 592 | int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band); |
developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 593 | -int mt7915_mcu_set_sku_en(struct mt7915_phy *phy, bool enable); |
| 594 | +int mt7915_mcu_set_sku_en(struct mt7915_phy *phy); |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 595 | int mt7915_mcu_set_txpower_sku(struct mt7915_phy *phy); |
| 596 | -int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len); |
| 597 | +int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len, |
| 598 | + u8 category); |
| 599 | int mt7915_mcu_set_txpower_frame_min(struct mt7915_phy *phy, s8 txpower); |
| 600 | int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy, |
| 601 | struct ieee80211_vif *vif, |
| 602 | -- |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 603 | 2.18.0 |
developer | a16be1f | 2022-12-14 13:09:20 +0800 | [diff] [blame] | 604 | |