Skip to content

net: extend eth_platform_get_mac_address()

Bartosz Golaszewski linux-arm-kernel linux-omap lkml netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 2 repliesIn review
  2. v23 patches 7 repliesSuperseded
  3. v15 patches 23 repliesSuperseded

Changes in v3 from the cover letter

- in patch 1: split the function into subroutines in preparation for nvmem and MTD support
- modify patches 2 & 3 so that they have a separate function for each new MAC address source

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: split eth_platform_get_mac_address() into subroutinesnet/ethernet/eth.c+37 -110 replies
2/3net: add support for nvmem to eth_platform_get_mac_address()net/ethernet/eth.c+38 -00 replies
3/3net: add MTD support to eth_platform_get_mac_address()net/ethernet/eth.c+32 -11 reply

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDan Carpenter
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] net: extend eth_platform_get_mac_address()

This is a follow-up to a series I posted a while ago the goal of which was to replace the at24 platform data with device properties. To do so we need to somehow remove reading the MAC address from relevant board files.

In my patches I used nvmem and MTD to read the MAC address from within the davinci emac driver. It was suggested that we generalize it further but since MTD doesn't support nvmem yet, the best we can do is to move this code over to net core code.

The following patches modify the eth_platform_get_mac_address() function which seems to be the best candidate for this code.

The first patch splits the function into two subroutines.

The last two patches add nvmem and MTD support to the function. In order to stay compatible with existing users, nvmem and MTD will be tried last - after device tree and arch-specific callback.

If this series gets accepted I will modify my previous patches to use it instead of handcoding the same operations in davinci_emac.

v1 -> v2:
- dropped patches 1 & 2
- improved the MAC address verification and fixed a potential buffer overflow in patch 2/3

v2 -> v3:
- in patch 1: split the function into subroutines in preparation for nvmem and MTD support
- modify patches 2 & 3 so that they have a separate function for each new MAC address source

Bartosz Golaszewski (3):
net: split eth_platform_get_mac_address() into subroutines
net: add support for nvmem to eth_platform_get_mac_address()
net: add MTD support to eth_platform_get_mac_address()

 net/ethernet/eth.c | 117 ++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 106 insertions(+), 11 deletions(-)
Signature · 1 line
2.17.1