2007-09-26 13:59:15

by Johannes Berg

[permalink] [raw]
Subject: iwlwifi scan question

When iwlwifi scans in firmware, which MAC address does it use? What if
you've added multiple virtual interfaces as you said you could support?

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-09-28 11:41:04

by Tomas Winkler

[permalink] [raw]
Subject: Re: iwlwifi scan question

On 9/26/07, Johannes Berg <[email protected]> wrote:
> When iwlwifi scans in firmware, which MAC address does it use? What if
> you've added multiple virtual interfaces as you said you could support?
>
Scanning is STA feature so only one MAC address is used in that case.
namely iwl_rxon_cmd.node_addr
Do you know any use case to support STA with multiple MAC addresses?
Tomas

> johannes
>
>

2007-09-28 11:49:00

by Johannes Berg

[permalink] [raw]
Subject: Re: iwlwifi scan question

On Fri, 2007-09-28 at 13:41 +0200, Tomas Winkler wrote:
> On 9/26/07, Johannes Berg <[email protected]> wrote:
> > When iwlwifi scans in firmware, which MAC address does it use? What if
> > you've added multiple virtual interfaces as you said you could support?
> >
> Scanning is STA feature so only one MAC address is used in that case.
> namely iwl_rxon_cmd.node_addr

Whichever address that will be, ok :)

Though, actually, scanning is not just a STA feature is it? APs will
sometimes want to do a quick background scan too, I think.

> Do you know any use case to support STA with multiple MAC addresses?

Not really, unless you can implement a TSF adoption per local MAC
address. I guess you could turn off powersave and do the backoff
algorithm a bit out of spec and get by with just one timer too.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-09-29 13:08:34

by Ian Schram

[permalink] [raw]
Subject: Re: iwlwifi scan question



Johannes Berg wrote:
> When iwlwifi scans in firmware, which MAC address does it use? What if
> you've added multiple virtual interfaces as you said you could support?
>
> johannes

I couldn't follow all the rest of this thread but i think the patch below
is what you were initially after.
I'll also send this patch to ipw3945-devel mailinglist, so it can take the
same route as my other patches.


Signed-off-by: Ian Schram <[email protected]>

diff --git a/origin/iwl3945-base.c b/origin/iwl3945-base.c
index 90ad47f..0cdfbd7 100644
--- a/origin/iwl3945-base.c
+++ b/origin/iwl3945-base.c
@@ -6915,7 +6915,7 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,

spin_lock_irqsave(&priv->lock, flags);
priv->interface_id = conf->if_id;
-
+ memcpy(priv->mac_addr,conf->mac_addr, ETH_ALEN);
spin_unlock_irqrestore(&priv->lock, flags);

mutex_lock(&priv->mutex);
diff --git a/origin/iwl4965-base.c b/origin/iwl4965-base.c
index e40c159..c3d0845 100644
--- a/origin/iwl4965-base.c
+++ b/origin/iwl4965-base.c
@@ -7305,7 +7305,7 @@ static int iwl_mac_add_interface(struct ieee80211_hw *hw,

spin_lock_irqsave(&priv->lock, flags);
priv->interface_id = conf->if_id;
-
+ memcpy(priv->mac_addr,conf->mac_addr, ETH_ALEN);
spin_unlock_irqrestore(&priv->lock, flags);

mutex_lock(&priv->mutex);

2007-09-29 13:11:58

by Johannes Berg

[permalink] [raw]
Subject: Re: iwlwifi scan question

On Sat, 2007-09-29 at 15:08 +0200, Ian Schram wrote:

> I couldn't follow all the rest of this thread but i think the patch below
> is what you were initially after.

Not in this thread really, I was just curious here because I was
thinking of disentangling the scan and sta state machines.

> I'll also send this patch to ipw3945-devel mailinglist, so it can take the
> same route as my other patches.

If it works you only need to fix the whitespace issue:

+ memcpy(priv->mac_addr,conf->mac_addr, ETH_ALEN);
^ missing space

and sign it off and that might address one of the points I pointed out.
However, when the interface is removed again you should also clear the
MAC address in the hardware or set the hardware to monitor mode so it no
longer acknowledges packets when in pure monitor mode.

Also, a full filter flags implementation would be good.

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part

2007-09-28 21:20:23

by Tomas Winkler

[permalink] [raw]
Subject: Re: iwlwifi scan question

On 9/28/07, Johannes Berg <[email protected]> wrote:
> On Fri, 2007-09-28 at 13:41 +0200, Tomas Winkler wrote:
> > On 9/26/07, Johannes Berg <[email protected]> wrote:
> > > When iwlwifi scans in firmware, which MAC address does it use? What if
> > > you've added multiple virtual interfaces as you said you could support?
> > >
> > Scanning is STA feature so only one MAC address is used in that case.
> > namely iwl_rxon_cmd.node_addr
>
> Whichever address that will be, ok :)
>
> Though, actually, scanning is not just a STA feature is it? APs will
> sometimes want to do a quick background scan too, I think.
>

We do monitor beacons on the same channels or channels for 11n
coexistence issues but I don't think protocol wise in AP mode it is
possible to stop listening on the channel. But I'm not the expert on
this issues WDS etc.
There are some other cases when you mix STA and AP mode but that's
another story.

> > Do you know any use case to support STA with multiple MAC addresses?
>
> Not really, unless you can implement a TSF adoption per local MAC
> address. I guess you could turn off powersave and do the backoff
> algorithm a bit out of spec and get by with just one timer too.
>
> johannes
>
>