2012-06-12 13:11:27

by Peter Wu

[permalink] [raw]
Subject: Why "iwlwifi: read multiple MAC addresses"?

Hi Wey-Yi,

I wonder what the following commit is used for:
commit c6fa17ed3fadaf056173c409c0877df428a152ec
Author: Wey-Yi Guy <[email protected]>
Date: Thu Jul 15 05:58:30 2010 -0700

iwlwifi: read multiple MAC addresses

Some devices may have multiple MAC
addresses in their EEPROM, read them
and advertise them to cfg80211.

I was trying to debug wireless issues, and noticed that I had two MAC
addresses with only the last bit being different:

$ cat /sys/class/ieee80211/phy0/addresses
00:23:14:xx:xx:x8
00:23:14:xx:xx:x9

Looking at a dump provided by /sys/kernel/debug/cfg80211/phy0/iwlwifi/data/nvm,
I see that the 16-bit word at 0x98 contains the value 4. What does this mean?
Can this break something?

If you are interested, the wireless card I own is a Centrino Advanced-N 6200
(device ID 422c, rev 35). I can reproduce this behaviour on Linux 3.4.2, 3.5-
rc1 (the wireless testing tree from 2012-06-11) and 3.3.5.

Regards,
Peter


2012-06-13 06:02:42

by Johannes Berg

[permalink] [raw]
Subject: Re: Why "iwlwifi: read multiple MAC addresses"?

On Tue, 2012-06-12 at 22:07 +0200, Lekensteyn wrote:
> On Tuesday 12 June 2012 21:58:51 Johannes Berg wrote:
> > On Tue, 2012-06-12 at 15:11 +0200, Lekensteyn wrote:
> > > Looking at a dump provided by
> > > /sys/kernel/debug/cfg80211/phy0/iwlwifi/data/nvm, I see that the 16-bit
> > > word at 0x98 contains the value 4. What does this mean?
> > The 4 actually means that there are 4 addresses assigned to this device,
> > for use in P2P scenarios etc. We only support 2 virtual interfaces in
> > Linux today, so we don't expose 4 (though we probably could.)
> >
> > > Can this break something?
> >
> > No.
>
> Okay, thanks for your quick answer. I have noticed that the first address is
> stored at 0x3A while the second one is stored at 0x92. Did you make an
> assumption that this address is other address + 1?

That's how it was specified.

johannes


2012-06-12 19:58:58

by Johannes Berg

[permalink] [raw]
Subject: Re: Why "iwlwifi: read multiple MAC addresses"?

On Tue, 2012-06-12 at 15:11 +0200, Lekensteyn wrote:

> I wonder what the following commit is used for:
> commit c6fa17ed3fadaf056173c409c0877df428a152ec
> Author: Wey-Yi Guy <[email protected]>
> Date: Thu Jul 15 05:58:30 2010 -0700
>
> iwlwifi: read multiple MAC addresses

That commit is so that you see this:

> I was trying to debug wireless issues, and noticed that I had two MAC
> addresses with only the last bit being different:
>
> $ cat /sys/class/ieee80211/phy0/addresses
> 00:23:14:xx:xx:x8
> 00:23:14:xx:xx:x9
>
> Looking at a dump provided by /sys/kernel/debug/cfg80211/phy0/iwlwifi/data/nvm,
> I see that the 16-bit word at 0x98 contains the value 4. What does this mean?

The 4 actually means that there are 4 addresses assigned to this device,
for use in P2P scenarios etc. We only support 2 virtual interfaces in
Linux today, so we don't expose 4 (though we probably could.)

> Can this break something?

No.

johannes


2012-06-12 20:07:34

by Peter Wu

[permalink] [raw]
Subject: Re: Why "iwlwifi: read multiple MAC addresses"?

On Tuesday 12 June 2012 21:58:51 Johannes Berg wrote:
> On Tue, 2012-06-12 at 15:11 +0200, Lekensteyn wrote:
> > Looking at a dump provided by
> > /sys/kernel/debug/cfg80211/phy0/iwlwifi/data/nvm, I see that the 16-bit
> > word at 0x98 contains the value 4. What does this mean?
> The 4 actually means that there are 4 addresses assigned to this device,
> for use in P2P scenarios etc. We only support 2 virtual interfaces in
> Linux today, so we don't expose 4 (though we probably could.)
>
> > Can this break something?
>
> No.

Okay, thanks for your quick answer. I have noticed that the first address is
stored at 0x3A while the second one is stored at 0x92. Did you make an
assumption that this address is other address + 1?

Regards,
Peter