Search Linux Wireless

Re: [PATCH] mt76x0: antenna select corrections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 18, 2018 at 11:28:19AM +0200, Lorenzo Bianconi wrote:
> > 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)

On GPL realeased driver for MT7610U ( mt7610u_wifi_sta_v3002_dpo_2013091 )
it's like this:

        CoexCfg3 &= ~(BIT5 | BIT4 | BIT3 | BIT2 | BIT1);

	<snip>

        {
                if (WMODE_CAP_5G(pAd->CommonCfg.PhyMode))
                {
                        CoexCfg3 |= (BIT3 | BIT4); /* 0x4C[3]=1, 0x4C[4]=1 */
                }
                else
                {
                        WlanFunCtrl |= BIT6; /* 0x80[6]=1 */
                        CoexCfg3 |= BIT1; /* 0x4C[1]=1 */
                }
                DBGPRINT(RT_DEBUG_ERROR, ("%s - Single antenna mode\n", __FUNCTION__));
        }

Which I belive is reflected in my patch in this parts:

	coex3 &= ~GENMASK(5, 1);

	<snip>

	if (dev->mt76.cap.has_5ghz) {
		coex3 |= BIT(3) | BIT(4);
	} else {
		wlan |= BIT(6);
		coex3 |= BIT(1);
	}

Does your SDK do something diffrent ?

Thanks
Stanislaw



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux