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


Groups > linux.kernel > #1547096

Re: [PATCH 6/6] wl1251: Set generated MAC address back to NVS data

From Pavel Machek <pavel@ucw.cz>
Newsgroups linux.kernel
Subject Re: [PATCH 6/6] wl1251: Set generated MAC address back to NVS data
Date 2016-12-24 19:20 +0100
Message-ID <sRZ5f-1UC-3@gated-at.bofh.it> (permalink)
References <sRXPQ-Xz-5@gated-at.bofh.it> <sRXZv-1gP-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Hi!

> In case there is no valid MAC address kernel generates random one. This
> patch propagate this generated MAC address back to NVS data which will be
> uploaded to wl1251 chip. So HW would have same MAC address as linux kernel
> uses.

>  	return 0;
>  }
>  
> +static int wl1251_write_nvs_mac(struct wl1251 *wl)
> +{

The name is quite confusing, this sounds like writing into
non-volatile storage.

> +	int i;
> +
> +	if (wl->nvs_len < 0x24)
> +		return -ENODATA;
> +
> +	/* length is 2 and data address is 0x546c (mask is 0xfffe) */

You don't actually check for the mask.

> +	if (wl->nvs[0x19] != 2 || wl->nvs[0x1a] != 0x6d || wl->nvs[0x1b] != 0x54)
> +		return -EINVAL;

You have two copies of these. Does it make sense to move it to helper
function?

Thanks,
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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


Thread

[PATCH 0/6] wl1251: Fix MAC address for Nokia N900 Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 18:00 +0100
  [PATCH 2/6] wl1251: Use request_firmware_prefer_user() for loading NVS calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 18:00 +0100
    Re: [PATCH 2/6] wl1251: Use request_firmware_prefer_user() for  loading NVS calibration data Arend Van Spriel <arend.vanspriel@broadcom.com> - 2016-12-25 21:20 +0100
      Re: [PATCH 2/6] wl1251: Use request_firmware_prefer_user() for loading NVS calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-12-25 21:50 +0100
        Re: [PATCH 2/6] wl1251: Use request_firmware_prefer_user() for  loading NVS calibration data Pavel Machek <pavel@ucw.cz> - 2016-12-26 16:50 +0100
          Re: [PATCH 2/6] wl1251: Use request_firmware_prefer_user() for loading NVS calibration data Pali Rohár <pali.rohar@gmail.com> - 2016-12-26 17:10 +0100
      Re: [PATCH 2/6] wl1251: Use request_firmware_prefer_user() for  loading NVS calibration data Pavel Machek <pavel@ucw.cz> - 2016-12-26 17:40 +0100
  [PATCH 1/6] firmware: Add request_firmware_prefer_user() function Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 18:00 +0100
  [PATCH 3/6] wl1251: Update wl->nvs_len after wl->nvs is valid Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 18:00 +0100
    Re: [PATCH 3/6] wl1251: Update wl->nvs_len after wl->nvs is valid Pavel Machek <pavel@ucw.cz> - 2016-12-24 19:10 +0100
  [PATCH 4/6] wl1251: Generate random MAC address only if driver does not have valid Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 18:10 +0100
    Re: [PATCH 4/6] wl1251: Generate random MAC address only if driver  does not have valid Pavel Machek <pavel@ucw.cz> - 2016-12-24 19:10 +0100
      Re: [PATCH 4/6] wl1251: Generate random MAC address only if driver does not have valid Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 19:40 +0100
  [PATCH 5/6] wl1251: Parse and use MAC address from supplied NVS data Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 18:10 +0100
    Re: [PATCH 5/6] wl1251: Parse and use MAC address from supplied NVS  data Pavel Machek <pavel@ucw.cz> - 2016-12-24 19:20 +0100
      Re: [PATCH 5/6] wl1251: Parse and use MAC address from supplied NVS data Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 19:50 +0100
  [PATCH 6/6] wl1251: Set generated MAC address back to NVS data Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 18:10 +0100
    Re: [PATCH 6/6] wl1251: Set generated MAC address back to NVS data Pavel Machek <pavel@ucw.cz> - 2016-12-24 19:20 +0100
      Re: [PATCH 6/6] wl1251: Set generated MAC address back to NVS data Pali Rohár <pali.rohar@gmail.com> - 2016-12-24 19:50 +0100

csiph-web