mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7603: add more phy initialization for setting channels
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -105,6 +105,7 @@ static inline void mt7603_irq_disable(struct mt7603_dev *dev, u32 mask)
|
||||
mt7603_set_irq_mask(dev, mask, 0);
|
||||
}
|
||||
|
||||
int mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def);
|
||||
int mt7603_mcu_set_channel(struct mt7603_dev *dev);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -73,3 +73,20 @@ u32 mt7603_reg_map(struct mt7603_dev *dev, u32 addr)
|
||||
|
||||
return MT_PCIE_REMAP_BASE_2 + offset;
|
||||
}
|
||||
|
||||
int mt7603_set_channel(struct mt7603_dev *dev, struct cfg80211_chan_def *def)
|
||||
{
|
||||
int ret;
|
||||
|
||||
u8 bw = MT_BW_20;
|
||||
|
||||
dev->chandef = *def;
|
||||
mt76_rmw_field(dev, MT_AGG_BWCR, MT_AGG_BWCR_BW, bw);
|
||||
ret = mt7603_mcu_set_channel(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
mt76_set(dev, MT_WF_RMAC_CH_FREQ, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-2
@@ -51,8 +51,7 @@ mt7603_config(struct ieee80211_hw *hw, u32 changed)
|
||||
mutex_lock(&dev->mutex);
|
||||
|
||||
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
|
||||
dev->chandef = hw->conf.chandef;
|
||||
ret = mt7603_mcu_set_channel(dev);
|
||||
ret = mt7603_set_channel(dev, &hw->conf.chandef);
|
||||
}
|
||||
|
||||
mutex_unlock(&dev->mutex);
|
||||
|
||||
@@ -126,6 +126,9 @@
|
||||
|
||||
#define MT_AGG_TMP MT_WF_AGG(0x0d8)
|
||||
|
||||
#define MT_AGG_BWCR MT_WF_AGG(0x0ec)
|
||||
#define MT_AGG_BWCR_BW GENMASK(3, 2)
|
||||
|
||||
|
||||
#define MT_WF_DMA_BASE 0x21c00
|
||||
#define MT_WF_DMA(ofs) (MT_WF_DMA_BASE + (ofs))
|
||||
@@ -207,6 +210,7 @@
|
||||
#define MT_WF_RMAC_RMCR_RX_STREAMS GENMASK(24, 22)
|
||||
#define MT_WF_RMAC_RMCR_SMPS_RTS BIT(25)
|
||||
|
||||
#define MT_WF_RMAC_CH_FREQ MT_WF_RMAC(0x090)
|
||||
#define MT_WF_RMAC_MAXMINLEN MT_WF_RMAC(0x098)
|
||||
#define MT_WF_RFCR1 MT_WF_RMAC(0x0a4)
|
||||
#define MT_WF_RMAC_TMR_PA MT_WF_RMAC(0x0e0)
|
||||
|
||||
Reference in New Issue
Block a user