diff options
author | Shayne Chen <shayne.chen@mediatek.com> | 2021-01-05 13:41:24 +0800 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-01-26 20:07:48 +0100 |
commit | fdc9c18eb44dc3fb8f4f5ba4b2e387087ea642c7 (patch) | |
tree | 3b078bd8d705df274b3c72e72f12b04f712af81c /drivers/net/wireless/mediatek/mt76/mt7915 | |
parent | 1fdcc310ff4c751154726ddf9601feecafe1b6ca (diff) | |
download | linux-fdc9c18eb44dc3fb8f4f5ba4b2e387087ea642c7.tar.bz2 |
mt76: testmode: add support to set user-defined spe index
Add spatial extension (spe) index as a configurable parameter in testmode.
This is used for specifically configuring TX path, such as different
WF TX priority, number of antennas and spatial streams.
If spe_idx is not set, TX path depends on tx_antenna_mask; otherwise,
both spe_idx and tx_antenna_mask are referenced to decide TX path.
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7915')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/testmode.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c index 06353de2e762..6ad1c3b49bfe 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c @@ -205,6 +205,7 @@ mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en) { static const u8 spe_idx_map[] = {0, 0, 1, 0, 3, 2, 4, 0, 9, 8, 6, 10, 16, 12, 18, 0}; + struct mt76_testmode_data *td = &phy->mt76->test; struct sk_buff *skb = phy->mt76->test.tx_skb; struct mt7915_dev *dev = phy->dev; struct ieee80211_tx_info *info; @@ -212,17 +213,21 @@ mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en) mt7915_tm_set_trx(phy, TM_MAC_RX_RXV, false); if (en) { - u8 tx_ant = phy->mt76->test.tx_antenna_mask; - mutex_unlock(&dev->mt76.mutex); mt7915_set_channel(phy); mutex_lock(&dev->mt76.mutex); mt7915_mcu_set_chan_info(phy, MCU_EXT_CMD_SET_RX_PATH); - if (phy != &dev->phy) - tx_ant >>= 2; - phy->test.spe_idx = spe_idx_map[tx_ant]; + if (td->tx_spe_idx) { + phy->test.spe_idx = td->tx_spe_idx; + } else { + u8 tx_ant = td->tx_antenna_mask; + + if (phy != &dev->phy) + tx_ant >>= 2; + phy->test.spe_idx = spe_idx_map[tx_ant]; + } } mt7915_tm_set_trx(phy, TM_MAC_TX, en); |