Skip to contentSkip to conversation

iwlwifi scan question

DISCUSSION Johannes Berg 3 participants 6 messages Sep 26, 2007 – Sep 29, 2007

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 3 lines · Johannes Berg

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

Quoted 3 lines

johannes

#2 lore raw
Quoted 6 lines · Tomas Winkler
Quoted 3 lines · Johannes Berg

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.

Quoted 1 line

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

#3 lore raw
Quoted 5 lines · Johannes Berg
Quoted 4 lines · Tomas Winkler
Quoted 3 lines · Johannes Berg

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?

Quoted 8 lines
Quoted 2 lines

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.

Quoted 9 lines
Quoted 1 line

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

#4 lore raw
In reply to Johannes Berg
Quoted 4 lines · Johannes Berg

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.

origin/iwl3945-base.c +1 -1
index 90ad47f..0cdfbd7 100644
@@ -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);
origin/iwl4965-base.c +1 -1
index e40c159..c3d0845 100644
@@ -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);
#5 lore raw
Quoted 2 lines · Ian Schram

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.

Quoted 2 lines

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