> On Thu, Oct 18, 2018 at 11:13:36AM +0200, Lorenzo Bianconi wrote: > > > static void mt76x0_phy_ant_select(struct mt76x02_dev *dev) > > > { > > > - struct ieee80211_channel *chan = dev->mt76.chandef.chan; > > > - > > > - /* single antenna mode */ > > > - if (chan->band == NL80211_BAND_2GHZ) { > > > - mt76_rmw(dev, MT_COEXCFG3, > > > - BIT(5) | BIT(4) | BIT(3) | BIT(2), BIT(1)); > > > - mt76_rmw(dev, MT_WLAN_FUN_CTRL, BIT(5), BIT(6)); > > > + u16 ee_ant = mt76x02_eeprom_get(dev, MT_EE_ANTENNA); > > > + u16 nic_conf2 = mt76x02_eeprom_get(dev, MT_EE_NIC_CONF_2); > > > + u32 wlan, coex3, cmb; > > > + bool ant_div; > > > + > > > + wlan = mt76_rr(dev, MT_WLAN_FUN_CTRL); > > > + cmb = mt76_rr(dev, MT_CMB_CTRL); > > > + coex3 = mt76_rr(dev, MT_COEXCFG3); > > > + > > > + cmb &= ~(BIT(15) | BIT(12)); > > > > I guess should be BIT(14) here (at least for single antenna mode) > > Yes , I will fix it. > > > > + coex3 &= ~GENMASK(5, 1); > > > > according to vendor sdk BIT(1) should not cleared if device supports 5GHz band > > (signle antenna mode) > > It is set below for that case: it is set just if the device does not support 5GHz band but it is cleared in the other case (and sdk driver does not clear it in that case, do not know if it does a real difference) Lorenzo > > > > + if (dev->mt76.cap.has_5ghz) { > > > + coex3 |= BIT(3) | BIT(4); > > > + } else { > > > + wlan |= BIT(6); > > > + coex3 |= BIT(1); > > > + } > > > Thanks > Stanislaw