summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
diff options
context:
space:
mode:
authorPeter Chiu <chui-hao.chiu@mediatek.com>2022-09-30 23:13:11 +0800
committerFelix Fietkau <nbd@nbd.name>2022-12-01 17:29:12 +0100
commitee0863aecdecbd9035cf45acb8017bce67fc835c (patch)
tree6a2769d9f8e6774e64d5c97e2218536e33cfe4d4 /drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
parenta7ec8bcf00034ce84d4c9a15dffd7577fbed4db2 (diff)
wifi: mt76: mt7915: deal with special variant of mt7916
A variant of mt7916 supports up to 3 tx/rx paths but with only 2 spatial streams. An example usage of the 3rd path is to server as an auxiliary for beamforming. In order to deal with this case, this patch reworks some parts to correctly use paths or streams. Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> 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/mcu.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7915/mcu.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 1b9f3da8ae96..b9ad24b1935a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -485,7 +485,7 @@ static void
mt7915_mcu_bss_ra_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
struct mt7915_phy *phy)
{
- int max_nss = hweight8(phy->mt76->chainmask);
+ int max_nss = hweight8(phy->mt76->antenna_mask);
struct bss_info_ra *ra;
struct tlv *tlv;
@@ -2617,8 +2617,8 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
u8 control_ch;
u8 center_ch;
u8 bw;
- u8 tx_streams_num;
- u8 rx_streams; /* mask or num */
+ u8 tx_path_num;
+ u8 rx_path; /* mask or num */
u8 switch_reason;
u8 band_idx;
u8 center_ch2; /* for 80+80 only */
@@ -2634,8 +2634,8 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
.control_ch = chandef->chan->hw_value,
.center_ch = ieee80211_frequency_to_channel(freq1),
.bw = mt76_connac_chan_bw(chandef),
- .tx_streams_num = hweight8(phy->mt76->antenna_mask),
- .rx_streams = phy->mt76->antenna_mask,
+ .tx_path_num = hweight16(phy->mt76->chainmask),
+ .rx_path = phy->mt76->chainmask >> (dev->chainshift * phy->band_idx),
.band_idx = phy->band_idx,
.channel_band = ch_band[chandef->chan->band],
};
@@ -2645,8 +2645,8 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
(phy->mt76->test.state == MT76_TM_STATE_TX_FRAMES ||
phy->mt76->test.state == MT76_TM_STATE_RX_FRAMES ||
phy->mt76->test.state == MT76_TM_STATE_TX_CONT)) {
- req.tx_streams_num = fls(phy->mt76->test.tx_antenna_mask);
- req.rx_streams = phy->mt76->test.tx_antenna_mask;
+ req.tx_path_num = fls(phy->mt76->test.tx_antenna_mask);
+ req.rx_path = phy->mt76->test.tx_antenna_mask;
if (phy != &dev->phy)
req.rx_streams >>= dev->chainshift;
@@ -2665,7 +2665,7 @@ int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
req.switch_reason = CH_SWITCH_NORMAL;
if (cmd == MCU_EXT_CMD(CHANNEL_SWITCH))
- req.rx_streams = hweight8(req.rx_streams);
+ req.rx_path = hweight8(req.rx_path);
if (chandef->width == NL80211_CHAN_WIDTH_80P80) {
int freq2 = chandef->center_freq2;