Commit db7aa188 authored by Felix Fietkau's avatar Felix Fietkau

mt76: move chainmask back to driver specific structs

Nothing in the core uses it
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 011849e0
...@@ -524,7 +524,6 @@ struct mt76_dev { ...@@ -524,7 +524,6 @@ struct mt76_dev {
u32 aggr_stats[32]; u32 aggr_stats[32];
u8 antenna_mask; u8 antenna_mask;
u16 chainmask;
struct tasklet_struct pre_tbtt_tasklet; struct tasklet_struct pre_tbtt_tasklet;
int beacon_int; int beacon_int;
......
...@@ -125,7 +125,7 @@ static void mt7615_eeprom_parse_hw_cap(struct mt7615_dev *dev) ...@@ -125,7 +125,7 @@ static void mt7615_eeprom_parse_hw_cap(struct mt7615_dev *dev)
if (!tx_mask || tx_mask > max_nss) if (!tx_mask || tx_mask > max_nss)
tx_mask = max_nss; tx_mask = max_nss;
dev->mt76.chainmask = tx_mask << 8 | rx_mask; dev->chainmask = tx_mask << 8 | rx_mask;
dev->mt76.antenna_mask = BIT(tx_mask) - 1; dev->mt76.antenna_mask = BIT(tx_mask) - 1;
} }
......
...@@ -1299,7 +1299,7 @@ int mt7615_mcu_set_channel(struct mt7615_dev *dev) ...@@ -1299,7 +1299,7 @@ int mt7615_mcu_set_channel(struct mt7615_dev *dev)
} req = { } req = {
.control_chan = chandef->chan->hw_value, .control_chan = chandef->chan->hw_value,
.center_chan = ieee80211_frequency_to_channel(freq1), .center_chan = ieee80211_frequency_to_channel(freq1),
.tx_streams = (dev->mt76.chainmask >> 8) & 0xf, .tx_streams = (dev->chainmask >> 8) & 0xf,
.rx_streams_mask = dev->mt76.antenna_mask, .rx_streams_mask = dev->mt76.antenna_mask,
.center_chan2 = ieee80211_frequency_to_channel(freq2), .center_chan2 = ieee80211_frequency_to_channel(freq2),
}; };
......
...@@ -85,6 +85,7 @@ struct mt7615_dev { ...@@ -85,6 +85,7 @@ struct mt7615_dev {
struct mt76_phy mphy; struct mt76_phy mphy;
}; };
u16 chainmask;
u32 vif_mask; u32 vif_mask;
u32 omac_mask; u32 omac_mask;
......
...@@ -80,6 +80,7 @@ struct mt76x02_dev { ...@@ -80,6 +80,7 @@ struct mt76x02_dev {
struct mutex phy_mutex; struct mutex phy_mutex;
u16 vif_mask; u16 vif_mask;
u16 chainmask;
u8 txdone_seq; u8 txdone_seq;
DECLARE_KFIFO_PTR(txstatus_fifo, struct mt76x02_tx_status); DECLARE_KFIFO_PTR(txstatus_fifo, struct mt76x02_tx_status);
......
...@@ -344,7 +344,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi, ...@@ -344,7 +344,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
u16 txwi_flags = 0; u16 txwi_flags = 0;
u8 nss; u8 nss;
s8 txpwr_adj, max_txpwr_adj; s8 txpwr_adj, max_txpwr_adj;
u8 ccmp_pn[8], nstreams = dev->mt76.chainmask & 0xf; u8 ccmp_pn[8], nstreams = dev->chainmask & 0xf;
memset(txwi, 0, sizeof(*txwi)); memset(txwi, 0, sizeof(*txwi));
...@@ -679,7 +679,7 @@ mt76x02_mac_process_rate(struct mt76x02_dev *dev, ...@@ -679,7 +679,7 @@ mt76x02_mac_process_rate(struct mt76x02_dev *dev,
status->rate_idx = idx; status->rate_idx = idx;
break; break;
case MT_PHY_TYPE_VHT: { case MT_PHY_TYPE_VHT: {
u8 n_rxstream = dev->mt76.chainmask & 0xf; u8 n_rxstream = dev->chainmask & 0xf;
status->encoding = RX_ENC_VHT; status->encoding = RX_ENC_VHT;
status->rate_idx = FIELD_GET(MT_RATE_INDEX_VHT_IDX, idx); status->rate_idx = FIELD_GET(MT_RATE_INDEX_VHT_IDX, idx);
...@@ -769,7 +769,7 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb, ...@@ -769,7 +769,7 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,
u16 rate = le16_to_cpu(rxwi->rate); u16 rate = le16_to_cpu(rxwi->rate);
u16 tid_sn = le16_to_cpu(rxwi->tid_sn); u16 tid_sn = le16_to_cpu(rxwi->tid_sn);
bool unicast = rxwi->rxinfo & cpu_to_le32(MT_RXINFO_UNICAST); bool unicast = rxwi->rxinfo & cpu_to_le32(MT_RXINFO_UNICAST);
int pad_len = 0, nstreams = dev->mt76.chainmask & 0xf; int pad_len = 0, nstreams = dev->chainmask & 0xf;
s8 signal; s8 signal;
u8 pn_len; u8 pn_len;
u8 wcid; u8 wcid;
......
...@@ -16,7 +16,7 @@ void mt76x02_phy_set_rxpath(struct mt76x02_dev *dev) ...@@ -16,7 +16,7 @@ void mt76x02_phy_set_rxpath(struct mt76x02_dev *dev)
val = mt76_rr(dev, MT_BBP(AGC, 0)); val = mt76_rr(dev, MT_BBP(AGC, 0));
val &= ~BIT(4); val &= ~BIT(4);
switch (dev->mt76.chainmask & 0xf) { switch (dev->chainmask & 0xf) {
case 2: case 2:
val |= BIT(3); val |= BIT(3);
break; break;
...@@ -35,7 +35,7 @@ void mt76x02_phy_set_txdac(struct mt76x02_dev *dev) ...@@ -35,7 +35,7 @@ void mt76x02_phy_set_txdac(struct mt76x02_dev *dev)
{ {
int txpath; int txpath;
txpath = (dev->mt76.chainmask >> 8) & 0xf; txpath = (dev->chainmask >> 8) & 0xf;
switch (txpath) { switch (txpath) {
case 2: case 2:
mt76_set(dev, MT_BBP(TXBE, 5), 0x3); mt76_set(dev, MT_BBP(TXBE, 5), 0x3);
......
...@@ -192,10 +192,10 @@ void mt76x02_init_device(struct mt76x02_dev *dev) ...@@ -192,10 +192,10 @@ void mt76x02_init_device(struct mt76x02_dev *dev)
IEEE80211_HT_CAP_LDPC_CODING; IEEE80211_HT_CAP_LDPC_CODING;
dev->mphy.sband_5g.sband.ht_cap.cap |= dev->mphy.sband_5g.sband.ht_cap.cap |=
IEEE80211_HT_CAP_LDPC_CODING; IEEE80211_HT_CAP_LDPC_CODING;
dev->mt76.chainmask = 0x202; dev->chainmask = 0x202;
dev->mt76.antenna_mask = 3; dev->mt76.antenna_mask = 3;
} else { } else {
dev->mt76.chainmask = 0x101; dev->chainmask = 0x101;
dev->mt76.antenna_mask = 1; dev->mt76.antenna_mask = 1;
} }
} }
......
...@@ -29,7 +29,7 @@ int mt76x2_mcu_set_channel(struct mt76x02_dev *dev, u8 channel, u8 bw, ...@@ -29,7 +29,7 @@ int mt76x2_mcu_set_channel(struct mt76x02_dev *dev, u8 channel, u8 bw,
.idx = channel, .idx = channel,
.scan = scan, .scan = scan,
.bw = bw, .bw = bw,
.chainmask = cpu_to_le16(dev->mt76.chainmask), .chainmask = cpu_to_le16(dev->chainmask),
}; };
/* first set the channel without the extension channel info */ /* first set the channel without the extension channel info */
......
...@@ -124,7 +124,7 @@ static int mt76x2_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, ...@@ -124,7 +124,7 @@ static int mt76x2_set_antenna(struct ieee80211_hw *hw, u32 tx_ant,
mutex_lock(&dev->mt76.mutex); mutex_lock(&dev->mt76.mutex);
dev->mt76.chainmask = (tx_ant == 3) ? 0x202 : 0x101; dev->chainmask = (tx_ant == 3) ? 0x202 : 0x101;
dev->mt76.antenna_mask = tx_ant; dev->mt76.antenna_mask = tx_ant;
mt76_set_stream_caps(&dev->mt76, true); mt76_set_stream_caps(&dev->mt76, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment