Linux wireless drivers development
 help / color / mirror / Atom feed
From: Deren Wu <deren.wu@mediatek.com>
To: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Cc: Felix Fietkau <nbd@nbd.name>, Sean Wang <sean.wang@mediatek.com>,
	"Soul Huang" <Soul.Huang@mediatek.com>,
	YN Chen <YN.Chen@mediatek.com>, Leon Yen <Leon.Yen@mediatek.com>,
	Eric-SY Chang <Eric-SY.Chang@mediatek.com>,
	KM Lin <km.lin@mediatek.com>,
	Robin Chiu <robin.chiu@mediatek.com>,
	CH Yeh <ch.yeh@mediatek.com>, Posh Sun <posh.sun@mediatek.com>,
	Eric Liang <Eric.Liang@mediatek.com>,
	Stella Chang <Stella.Chang@mediatek.com>, <jemele@google.com>,
	<yenlinlai@google.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-mediatek <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH] mt76: mt7921: enable random mac address during sched_scan
Date: Tue, 1 Jun 2021 00:50:36 +0800	[thread overview]
Message-ID: <6188b37ca5f9aa74c7403c999c74540fe462a174.camel@mediatek.com> (raw)
In-Reply-To: <YLUQqIqbojUNRZVA@lore-desk>

On Mon, 2021-05-31 at 18:36 +0200, Lorenzo Bianconi wrote:
> > From: Deren Wu <deren.wu@mediatek.com>
> > 
> > Enable src address randomization during scheduled scanning
> > 
> > Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
> 
> Here we are missing my SoB, it should be:
> 
> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

Hi Lore,

Sorry for typo. I will update a new verion.


Regards,
Deren

> 
> > Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> > ---
> >  .../net/wireless/mediatek/mt76/mt76_connac_mcu.c   | 14 ++++++++
> > ------
> >  .../net/wireless/mediatek/mt76/mt76_connac_mcu.h   |  4 +++-
> >  drivers/net/wireless/mediatek/mt76/mt7921/init.c   |  3 ++-
> >  3 files changed, 13 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > index 73359defa176..b155e7b8d89d 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
> > @@ -1515,14 +1515,16 @@ int mt76_connac_mcu_sched_scan_req(struct
> > mt76_phy *phy,
> >  	req->version = 1;
> >  	req->seq_num = mvif->scan_seq_num | ext_phy << 7;
> >  
> > -	if (is_mt7663(phy->dev) &&
> > -	    (sreq->flags & NL80211_SCAN_FLAG_RANDOM_ADDR)) {
> > -		get_random_mask_addr(req->mt7663.random_mac, sreq-
> > >mac_addr,
> > -				     sreq->mac_addr_mask);
> > +	if (sreq->flags & NL80211_SCAN_FLAG_RANDOM_ADDR) {
> > +		u8 *addr = is_mt7663(phy->dev) ? req->mt7663.random_mac
> > +					       : req-
> > >mt7921.random_mac;
> > +
> >  		req->scan_func = 1;
> > -	} else if (is_mt7921(phy->dev)) {
> > -		req->mt7921.bss_idx = mvif->idx;
> > +		get_random_mask_addr(addr, sreq->mac_addr,
> > +				     sreq->mac_addr_mask);
> >  	}
> > +	if (is_mt7921(phy->dev))
> > +		req->mt7921.bss_idx = mvif->idx;
> >  
> >  	req->ssids_num = sreq->n_ssids;
> >  	for (i = 0; i < req->ssids_num; i++) {
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
> > b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
> > index d64b8058b744..3076417ead5f 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
> > +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
> > @@ -779,7 +779,9 @@ struct mt76_connac_sched_scan_req {
> >  		} mt7663;
> >  		struct {
> >  			u8 bss_idx;
> > -			u8 pad2[63];
> > +			u8 pad2[19];
> > +			u8 random_mac[ETH_ALEN];
> > +			u8 pad3[38];
> >  		} mt7921;
> >  	};
> >  } __packed;
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > index 59da29032645..19ce9ca72542 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
> > @@ -76,7 +76,8 @@ mt7921_init_wiphy(struct ieee80211_hw *hw)
> >  	wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
> >  	wiphy->reg_notifier = mt7921_regd_notifier;
> >  
> > -	wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
> > +	wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |
> > +			   NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
> >  	wiphy_ext_feature_set(wiphy,
> > NL80211_EXT_FEATURE_SET_SCAN_DWELL);
> >  
> >  	ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);
> > -- 
> > 2.18.0
> > 

      reply	other threads:[~2021-05-31 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 16:28 [PATCH] mt76: mt7921: enable random mac address during sched_scan Deren Wu
2021-05-31 16:36 ` Lorenzo Bianconi
2021-05-31 16:50   ` Deren Wu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6188b37ca5f9aa74c7403c999c74540fe462a174.camel@mediatek.com \
    --to=deren.wu@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=jemele@google.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=yenlinlai@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox