Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1528818

Re: wl1251 & mac address & calibration data

From Pali Rohár <pali.rohar@gmail.com>
Newsgroups linux.kernel
Subject Re: wl1251 & mac address & calibration data
Date 2016-11-23 23:50 +0100
Message-ID <sGOwy-2sG-7@gated-at.bofh.it> (permalink)
References <sCnOh-7dZ-17@gated-at.bofh.it> <sGnG3-2it-53@gated-at.bofh.it> <sGOdb-2lV-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wednesday 23 November 2016 23:23:35 Pavel Machek wrote:
> Hi!
> 
> > > > As wl1251.ko does not accept mac_address as module parameter,
> > > > such modprobe hook does not help -- as there is absolutely no
> > > > way from userspace to set or change (permanent) mac address.
> > > 
> > > Quoting modprobe.d manual:
> > > >       install modulename command...
> > > >       
> > > >           This command instructs modprobe to run your
> > > >           command instead of inserting the module in the
> > > >           kernel as normal. The command can be any shell
> > > >           command: this allows you to do any kind of
> > > >           complex processing you might wish. [...]
> > 
> > I know. But this do not allow me to send mac address to kernel --
> > as kernel does not support such command yet (reason for my first
> > question).
> 
> Plus, this does not really work for cases where wl1251 is not a
> module.

Yes, this is another problem.

> > > You can hook up a script that cooks up wl1251-nvs.bin (caldata,
> > > macaddr) and then insmod the actual wl1251.ko module. Or you can
> > > just cook up the nvs on first device boot and store it in
> > > /lib/firmware (possibly overwriting the "generic" wl1251 from
> > > linux-firmware).
> > 
> > This is what I would like to prevent -- overwriting (possible
> > readonly) system files with some device specific. It is really bad
> > idea!
> 
> Agreed.
> 
> "ifconfig hw ether XX" normally sets the address. I guess that's
> ioctl?

This sets temporary address and it is ioctl. IIRC same as what ethtool 
uses. (ifconfig is already deprecated).

> And I guess we should use similar mechanism for permanent
> address.

I'm not sure here... Above ioctl ↑↑↑ is for changing temporary mac 
address. But here we do not want to change permanent mac address. We 
want to tell kernel driver current permanent mac address which is stored 
in permanent mac address storage (in N900 case in mtd). Just like 
userspace helper as kernel driver do not have code which can read 
permanent mac address.

-- 
Pali Rohár
pali.rohar@gmail.com

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-21 17:00 +0100
  Re: wl1251 & mac address & calibration data Michal Kazior <michal.kazior@tieto.com> - 2016-11-22 16:30 +0100
    Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-22 16:40 +0100
      Re: wl1251 & mac address & calibration data Michal Kazior <michal.kazior@tieto.com> - 2016-11-22 17:30 +0100
        Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-22 19:10 +0100
          Re: wl1251 & mac address & calibration data Arend Van Spriel <arend.vanspriel@broadcom.com> - 2016-11-23 09:30 +0100
          Re: wl1251 & mac address & calibration data Pavel Machek <pavel@ucw.cz> - 2016-11-23 23:30 +0100
            Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-23 23:50 +0100
              Re: wl1251 & mac address & calibration data Pavel Machek <pavel@ucw.cz> - 2016-11-24 09:00 +0100
                Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-24 09:40 +0100
                Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-24 16:30 +0100
                Re: wl1251 & mac address & calibration data Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> - 2016-11-24 16:40 +0100
                Re: wl1251 & mac address & calibration data Sebastian Reichel <sre@kernel.org> - 2016-11-24 17:10 +0100
                Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-24 17:50 +0100
                Re: wl1251 & mac address & calibration data Sebastian Reichel <sre@kernel.org> - 2016-11-24 19:20 +0100
                Re: wl1251 & mac address & calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-11-24 19:40 +0100
                Re: wl1251 & mac address & calibration data Aaro Koskinen <aaro.koskinen@iki.fi> - 2016-11-24 20:10 +0100
                Re: wl1251 & mac address & calibration data Sebastian Reichel <sre@kernel.org> - 2016-11-24 16:30 +0100

csiph-web