mt7603: add support for detecting MT7688 and single stream devices

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2018-11-28 14:34:05 +01:00
parent 00e03b990f
commit c3efb5d899
3 changed files with 10 additions and 12 deletions
+7 -7
View File
@@ -140,8 +140,8 @@ mt7603_dma_sched_init(struct mt7603_dev *dev)
static void
mt7603_phy_init(struct mt7603_dev *dev)
{
int rx_chains = BIT(dev->rx_chains) - 1;
int tx_chains = dev->tx_chains - 1;
int rx_chains = dev->mt76.antenna_mask;
int tx_chains = __sw_hweight8(rx_chains) - 1;
mt76_rmw(dev, MT_WF_RMAC_RMCR,
(MT_WF_RMAC_RMCR_SMPS_MODE |
@@ -476,8 +476,11 @@ int mt7603_register_device(struct mt7603_dev *dev)
tasklet_init(&dev->pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet,
(unsigned long)dev);
dev->rx_chains = 2;
dev->tx_chains = 2;
/* Check for 7688, which only has 1SS */
dev->mt76.antenna_mask = 3;
if (mt76_rr(dev, MT_EFUSE_BASE + 0x64) & BIT(4))
dev->mt76.antenna_mask = 1;
dev->slottime = 9;
ret = mt7603_init_hardware(dev);
@@ -501,9 +504,6 @@ int mt7603_register_device(struct mt7603_dev *dev)
dev->mt76.led_cdev.brightness_set = mt7603_led_set_brightness;
dev->mt76.led_cdev.blink_set = mt7603_led_set_blink;
/* init antenna configuration */
dev->mt76.antenna_mask = 3;
wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP) |
+3 -2
View File
@@ -481,6 +481,7 @@ static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev)
int mt7603_mcu_set_channel(struct mt7603_dev *dev)
{
struct cfg80211_chan_def *chandef = &dev->mt76.chandef;
int n_chains = __sw_hweight8(dev->mt76.antenna_mask);
struct {
u8 control_chan;
u8 center_chan;
@@ -494,8 +495,8 @@ int mt7603_mcu_set_channel(struct mt7603_dev *dev)
.control_chan = chandef->chan->hw_value,
.center_chan = chandef->chan->hw_value,
.bw = MT_BW_20,
.tx_streams = dev->tx_chains,
.rx_streams = dev->rx_chains,
.tx_streams = n_chains,
.rx_streams = n_chains,
};
struct sk_buff *skb;
int ret;
-3
View File
@@ -109,9 +109,6 @@ struct mt7603_dev {
struct mt7603_sta global_sta;
u8 rx_chains;
u8 tx_chains;
u8 rssi_offset[3];
u8 slottime;