From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46022 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631Ab3LJRsl (ORCPT ); Tue, 10 Dec 2013 12:48:41 -0500 Message-ID: <1386697762.30202.6.camel@dcbw.foobar.com> (sfid-20131210_184846_602798_3BE77166) Subject: Re: [PATCH v2 15/16] wl1251: Add sysfs file address for setting permanent mac address From: Dan Williams To: Pali =?ISO-8859-1?Q?Roh=E1r?= Cc: Kalle Valo , Luciano Coelho , "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, freemangordon@abv.bg, aaro.koskinen@iki.fi, pavel@ucw.cz, sre@ring0.de, joni.lapilainen@gmail.com, Johannes Berg , Felipe Contreras Date: Tue, 10 Dec 2013 11:49:22 -0600 In-Reply-To: <201312101814.35112@pali> References: <1382819655-30430-1-git-send-email-pali.rohar@gmail.com> <87txegpuyk.fsf@purkki.adurom.net> <201312101710.51015@pali> <201312101814.35112@pali> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 2013-12-10 at 18:14 +0100, Pali Rohár wrote: > On Tuesday 10 December 2013 17:10:50 Pali Rohár wrote: > > On Tuesday 10 December 2013 16:49:23 Kalle Valo wrote: > > > Pali Rohár writes: > > > > Driver wl1251 generating mac address randomly at startup > > > > and there is no way to set permanent mac address via > > > > SET_IEEE80211_PERM_ADDR. This patch export sysfs file > > > > which can set permanent mac address by userspace helper > > > > program. Patch is needed for devices which do not store > > > > mac address in internal wl1251 eeprom. > > > > > > > > Signed-off-by: Pali Rohár > > > > > > We have ioctl() command for setting the mac address. > > > > Really? Is there ioctl for setting permanent mac address? > > Can you show me it? > > Now I looked at it again and I did not found any ioctl for it. > There is only ioctl cmd for getting address, not setting it. > > #define SIOCETHTOOL 0x8946 > > /* Get permanent hardware address */ > #define ETHTOOL_GPERMADDR 0x00000020 Yeah, because it's supposed to be permanent and unchanging. Which means if there was an ioctl for it, that would be contrary to the purpose of a permanent MAC address. I realize the N900 stores the WiFi MAC address completely differently than many other systems, and that's why this sysfs file was created. I don't really have a great converged solution for that, other than what you've currently got, or perhaps adding SPERMADDR to ethtool. One thing I *would* like though, is a restriction on the sysfs file such that if the permanent MAC is already set, it cannot be set again. Otherwise the permanent MAC address isn't permanent at all. Dan From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: Re: [PATCH v2 15/16] wl1251: Add sysfs file address for setting permanent mac address Date: Tue, 10 Dec 2013 11:49:22 -0600 Message-ID: <1386697762.30202.6.camel@dcbw.foobar.com> References: <1382819655-30430-1-git-send-email-pali.rohar@gmail.com> <87txegpuyk.fsf@purkki.adurom.net> <201312101710.51015@pali> <201312101814.35112@pali> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Kalle Valo , Luciano Coelho , "John W. Linville" , linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, freemangordon-uiMcrn6V0Vs@public.gmane.org, aaro.koskinen-X3B1VOXEql0@public.gmane.org, pavel-+ZI9xUNit7I@public.gmane.org, sre-GFxCN5SEZAc@public.gmane.org, joni.lapilainen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Johannes Berg , Felipe Contreras To: Pali =?ISO-8859-1?Q?Roh=E1r?= Return-path: In-Reply-To: <201312101814.35112@pali> Sender: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Tue, 2013-12-10 at 18:14 +0100, Pali Roh=C3=A1r wrote: > On Tuesday 10 December 2013 17:10:50 Pali Roh=C3=A1r wrote: > > On Tuesday 10 December 2013 16:49:23 Kalle Valo wrote: > > > Pali Roh=C3=A1r writes: > > > > Driver wl1251 generating mac address randomly at startup > > > > and there is no way to set permanent mac address via > > > > SET_IEEE80211_PERM_ADDR. This patch export sysfs file > > > > which can set permanent mac address by userspace helper > > > > program. Patch is needed for devices which do not store > > > > mac address in internal wl1251 eeprom. > > > >=20 > > > > Signed-off-by: Pali Roh=C3=A1r > > >=20 > > > We have ioctl() command for setting the mac address. > >=20 > > Really? Is there ioctl for setting permanent mac address? > > Can you show me it? >=20 > Now I looked at it again and I did not found any ioctl for it.=20 > There is only ioctl cmd for getting address, not setting it. >=20 > #define SIOCETHTOOL 0x8946 >=20 > /* Get permanent hardware address */ > #define ETHTOOL_GPERMADDR 0x00000020 Yeah, because it's supposed to be permanent and unchanging. Which mean= s if there was an ioctl for it, that would be contrary to the purpose of = a permanent MAC address. I realize the N900 stores the WiFi MAC address completely differently than many other systems, and that's why this sysfs file was created. I don't really have a great converged solution for that, other than what you've currently got, or perhaps adding SPERMADDR to ethtool. One thin= g I *would* like though, is a restriction on the sysfs file such that if the permanent MAC is already set, it cannot be set again. Otherwise th= e permanent MAC address isn't permanent at all. Dan -- To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html