Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-12 Thread Jonas Gorski
On Tue, Aug 12, 2014 at 9:59 AM, Marcel Holtmann wrote: > Hi Daniel, > >>> the way I read the nl80211 code is that the NL80211_CMD_NEW_INTERFACE >>> requires a wiphy device to be specified. And that is actually just a >>> number. So I have no idea what the MAC has to here. >>> >> OpenWrt finds a w

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-12 Thread Marcel Holtmann
Hi Daniel, >> the way I read the nl80211 code is that the NL80211_CMD_NEW_INTERFACE >> requires a wiphy device to be specified. And that is actually just a >> number. So I have no idea what the MAC has to here. >> > OpenWrt finds a wiphy by its MAC. maybe that is the first problem right there. I

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Daniel Gimpelevich
On Mon, 2014-08-11 at 16:56 -0700, Marcel Holtmann wrote: > the way I read the nl80211 code is that the NL80211_CMD_NEW_INTERFACE > requires a wiphy device to be specified. And that is actually just a > number. So I have no idea what the MAC has to here. > OpenWrt finds a wiphy by its MAC. > Why

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Marcel Holtmann
Hi Daniel, >> Internally it might do that, but I do not see it exposing the >> NL80211_ATTR_MAC when you get the attributes for wiphy. > > When wlan0 is created, it can be created with its own MAC irrespective > of the wiphy MAC. In OpenWrt, the wlan0 MAC can be supplied and assigned > to a netde

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Daniel Gimpelevich
On Mon, 2014-08-11 at 15:41 -0700, Marcel Holtmann wrote: > what kind of hardware are you actually using here? > It's ath9k on MIPS under OpenWrt. > > Internally it might do that, but I do not see it exposing the > NL80211_ATTR_MAC when you get the attributes for wiphy. When wlan0 is created, it

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Marcel Holtmann
Hi Daniel, >> The initial wlan0 can be removed as every other netdev attached to the >> wiphy. It can also be as easily re-created. >> >> Since the wiphy does not have a valid MAC address, my proposal here >> would be to just not create the wlan0 in the first place. This means >> that the wiphy c

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Daniel Gimpelevich
On Mon, 2014-08-11 at 13:56 -0700, Marcel Holtmann wrote: > The initial wlan0 can be removed as every other netdev attached to the > wiphy. It can also be as easily re-created. > > Since the wiphy does not have a valid MAC address, my proposal here > would be to just not create the wlan0 in the fi

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Marcel Holtmann
Hi Daniel, >> isn't this dangerous to just allow writing to wiphy.perm_addr via >> sysfs. We ran into the same issue with Bluetooth and ROM only devices >> that have to unique address. Doing this via sysfs seems the wrong >> approach. It is messy and full of potential race conditions. I clearly >>

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Daniel Gimpelevich
On Mon, 2014-08-11 at 13:25 -0700, Marcel Holtmann wrote: > isn't this dangerous to just allow writing to wiphy.perm_addr via > sysfs. We ran into the same issue with Bluetooth and ROM only devices > that have to unique address. Doing this via sysfs seems the wrong > approach. It is messy and full

Re: [PATCH] allow setting wiphy.perm_addr after driver probe

2014-08-11 Thread Marcel Holtmann
Hi Daniel, > On embedded devices, often the BSSID of an access point must be set from > userspace during the boot process. This provides a relatively clean way > of doing that without major side effects. > > Signed-off-by: Daniel Gimpelevich > --- > --- a/net/wireless/sysfs.c2014-04-19 08:3