mbox series

[v2,0/6] wifi: wilc1000: fix default mac address

Message ID 20240514-mac_addr_at_probe-v2-0-afef09f1cd10@bootlin.com
Headers show
Series wifi: wilc1000: fix default mac address | expand

Message

Alexis Lothoré May 14, 2024, 3:51 p.m. UTC
This series aims to fix invalid mac address issue raised by Heiko Thiery 
([1]). WILC1000 mac address is currently not set until device is opened, at
which point firmware is loaded and started. This results in default mac
address being 00:00:00:00:00:00.

This series, based on an initial patch from Ajay, reads the MAC address
from chip eFuse whenever we set the first interface (at probe time). To do
so, we need to ensure that any bus communication is properly initialized,
so the first commits slightly rearrange/fix initialization/registration
order to allow to read MAC address properly.
Based on the tests I did during this series adjustments, there are still a
few corner cased not properly handled, especially when dealing with two
interfaces on top of the same wphy, but it fixes at least the user-facing
mac address for those interfaces so user space network managers are not
confused anymore.

[1] https://lore.kernel.org/netdev/CAEyMn7aV-B4OEhHR4Ad0LM3sKCz1-nDqSb9uZNmRWR-hMZ=z+A@mail.gmail.com/

---
Changes in v2:
- add missing symbols export
- declare new nv mac read helper at the bottom of file
- collected Tested-By tag
- Link to v1: https://lore.kernel.org/r/20240417-mac_addr_at_probe-v1-0-67d6c9b3bc2b@bootlin.com

---
Ajay Singh (1):
      wifi: wilc1000: read MAC address from fuse at probe

Alexis Lothoré (5):
      wifi: wilc1000: set net device registration as last step during interface creation
      wifi: wilc1000: register net device only after bus being fully initialized
      wifi: wilc1000: set wilc_set_mac_address parameter as const
      wifi: wilc1000: add function to read mac address from eFuse
      wifi: wilc1000: make sdio deinit function really deinit the sdio card

 drivers/net/wireless/microchip/wilc1000/cfg80211.c | 10 ---
 drivers/net/wireless/microchip/wilc1000/fw.h       | 13 ++++
 drivers/net/wireless/microchip/wilc1000/hif.c      |  4 +-
 drivers/net/wireless/microchip/wilc1000/hif.h      |  2 +-
 drivers/net/wireless/microchip/wilc1000/netdev.c   | 72 ++++++++++++----------
 drivers/net/wireless/microchip/wilc1000/netdev.h   |  2 +
 drivers/net/wireless/microchip/wilc1000/sdio.c     | 71 ++++++++++++++++++++-
 drivers/net/wireless/microchip/wilc1000/spi.c      | 17 ++++-
 drivers/net/wireless/microchip/wilc1000/wlan.c     | 49 +++++++++++++++
 drivers/net/wireless/microchip/wilc1000/wlan.h     |  1 +
 10 files changed, 193 insertions(+), 48 deletions(-)
---
base-commit: cd546c1dc7164096520a97fbcaca0a063ef1d0a7
change-id: 20231221-mac_addr_at_probe-3cb6044b251d

Best regards,