linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Denis Kenzior <denkenz@gmail.com>,
	James Prestwood <prestwoj@gmail.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] mac80211: Support LIVE_ADDRESS_CHANGE feature
Date: Tue, 08 Oct 2019 17:52:46 +0200	[thread overview]
Message-ID: <6530a6b06176790c5a6949d6ffccf37b506975bd.camel@sipsolutions.net> (raw)
In-Reply-To: <6fa34e4c-5c81-4875-da29-cada1a078e2c@gmail.com> (sfid-20191008_174756_354544_4F2B93CF)

Hi,

> > You could have two interfaces, one which is scanning right now, right?
> > And then theoretically you don't care about the other one - it *should*
> > be OK to remove/re-add (with new MAC address) the one that *isn't*
> > scanning, right?
> 
> Actually, I don't think you can?  Unless I'm missing something?  All the 
> scan state is stored on struct ieee80211_local, so if that struct is 
> allocated per phy as you point out below, then what you suggest is 
> currently not possible?

?

The scan_req struct contains a reference to which interface is scanning,
so it should very well be possible to have

phy0:
 wlan0: IFF_UP & scanning
 wlan1: IFF_UP & change MAC address all the time

just like it's possible to change the MAC address when wlan1 *isn't*
IFF_UP even if wlan0 is scanning, right?

> > But we don't have that granularity here for anything - you're just
> > checking "sdata->local->something", and by going from sdata to local
> > you've now checked the whole NIC, not just a single interface on that
> > NIC.
> 
> Right.  But that seems to be a limitation of mac80211 actually.  We 
> can't run two scans concurrently on different interfaces.  This is 
> rather unintuitive given that scan requests require an ifindex/wdev.
> 
> Can this be changed / fixed in mac80211 actually?  I would expect that 
> if a card supports p2p and station simultaneously, then it can scan / go 
> offchannel on two interfaces simultaneously? Or not?  What can iwlwifi 
> do for example?

No, this typically cannot be fixed, and it doesn't really make sense.
The NIC cannot possibly do two scans at a time since it has only a
single radio resource :-)

> > But it's also completely confusing to do it this way because you go from
> > "sdata" to "local", and at that point the data that you're working on is
> > no longer specific to that one interface, it's actually for the whole
> > NIC.
> 
> I agree its confusing, but that seems to be how mac80211 works?

See above.

> Given the above, I'm not sure I see anything wrong?  The switch/case can 
> probably be gotten rid of, but it actually makes things clear that only 
> station/p2p_device and adhoc are handled specially.

I just don't think they *should* be handled specially.

Given your code now, you can have

phy0:
 wlan0: STATION, IFF_UP & something is doing remain-on-channel
 wlan1: STATION, IFF_UP

--> cannot change wlan1 MAC address

phy0:
 wlan0: STATION, IFF_UP & something is doing remain-on-channel

wlan1: AP, IFF_UP

--> *can* change wlan1 MAC address

This doesn't really make much sense?

johannes


  reply	other threads:[~2019-10-08 15:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 19:59 [PATCH 1/2] nl80211: Add LIVE_ADDR_CHANGE feature James Prestwood
2019-09-13 19:59 ` [PATCH 2/2] mac80211: Support LIVE_ADDRESS_CHANGE feature James Prestwood
2019-10-04 11:56   ` Johannes Berg
2019-10-04 16:25     ` James Prestwood
2019-10-04 16:42       ` James Prestwood
2019-10-07 21:16         ` Johannes Berg
2019-10-08 15:37           ` Denis Kenzior
2019-10-08 15:52             ` Johannes Berg [this message]
2019-10-08 15:53               ` Denis Kenzior
2019-10-08 16:24                 ` Johannes Berg
2019-10-08 16:23                   ` Denis Kenzior
2019-10-08 17:08                     ` Johannes Berg
2019-10-08 18:50                       ` Denis Kenzior
2019-10-08 20:16                         ` Johannes Berg
2019-10-08 20:55                           ` Denis Kenzior
2019-10-10 15:18                             ` Johannes Berg
2019-10-07 21:11       ` Johannes Berg
2019-10-08 15:28         ` Denis Kenzior
2019-10-08 15:49           ` Johannes Berg
2019-09-13 20:48 ` [PATCH 1/2] nl80211: Add LIVE_ADDR_CHANGE feature Johannes Berg
2019-09-13 20:56   ` James Prestwood
2019-09-13 21:01     ` Johannes Berg
2019-09-13 21:14       ` James Prestwood
2019-09-17 20:09         ` James Prestwood
2019-10-01  9:14         ` Johannes Berg
2019-10-08 22:13           ` James Prestwood

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=6530a6b06176790c5a6949d6ffccf37b506975bd.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=denkenz@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=prestwoj@gmail.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;
as well as URLs for NNTP newsgroup(s).