From: David Miller <davem@davemloft.net> Date: 2016-01-06 21:33:11
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
Currently this is done with a call to of_get_mac_address() and then
some ifdef'd stuff for SPARC.
Consolidate this into a portable routine, and provide the
arch_get_platform_mac_address() weak function hook for all
architectures to implement if they want.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
As promised back in November, I'm commiting this into net-next
now. I'd work on the conversions of existing drivers, but I'd
rather someone with access to the hardware to so.
arch/sparc/kernel/idprom.c | 7 +++++++
include/linux/etherdevice.h | 3 +++
net/ethernet/eth.c | 31 +++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+)
@@ -60,6 +61,12 @@ static void __init display_system_type(unsigned char machtype){}#endif++unsignedchar*arch_get_platform_mac_address(void)+{+returnidprom->id_ethaddr;+}+/* Calculate the IDPROM checksum (xor of the data bytes). */staticunsignedchar__initcalc_idprom_cksum(structidprom*idprom){
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Sowmini Varadhan <redacted>
As promised back in November, I'm commiting this into net-next
now. I'd work on the conversions of existing drivers, but I'd
rather someone with access to the hardware to so.
From: Joe Perches <joe@perches.com> Date: 2016-01-06 23:12:49
On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
quoted
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
That would prevent a driver from using this with additional fallback
methods. For what reason?
I don't have a specific usecase, but I can imagine drivers falling back
to e.g a random address without wanting to be noisy about it.
Bjørn
From: Joe Perches <joe@perches.com> Date: 2016-01-06 23:32:27
On Thu, 2016-01-07 at 00:26 +0100, Bjørn Mork wrote:
Joe Perches [off-list ref] writes:
quoted
On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
quoted
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
That would prevent a driver from using this with additional fallback
methods. For what reason?
It's declared __weak and should be overridden by
an arch specific function.
A NULL address would cause a fault when using
a function like copy_ether_addr.
I don't have a specific usecase, but I can imagine drivers falling back
to e.g a random address without wanting to be noisy about it.
On Thu, 2016-01-07 at 00:26 +0100, Bjørn Mork wrote:
quoted
Joe Perches [off-list ref] writes:
quoted
On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
quoted
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
From: David Miller <davem@davemloft.net> Date: 2016-01-07 00:01:16
From: Joe Perches <joe@perches.com>
Date: Wed, 06 Jan 2016 15:32:24 -0800
On Thu, 2016-01-07 at 00:26 +0100, Bjørn Mork wrote:
quoted
Joe Perches [off-list ref] writes:
quoted
On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
quoted
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
That would prevent a driver from using this with additional fallback
methods. For what reason?
It's declared __weak and should be overridden by
an arch specific function.
A NULL address would cause a fault when using
a function like copy_ether_addr.
The caller checks for NULL, and this is the default implementation
doing precisely what it is meant to do.
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
:
Consolidate this into a portable routine, and provide the
arch_get_platform_mac_address() weak function hook for all
architectures to implement if they want.
:
As promised back in November, I'm commiting this into net-next
now. I'd work on the conversions of existing drivers, but I'd
rather someone with access to the hardware to so.
I finally have all the ducks lined up for ixgbe/i40e around this.
Should I go ahead and send this off (I think it first gets staged
through Jeff's repo?) or is it better to wait for net-next to be
open again?
--Sowmini
From: Kirsher, Jeffrey T <hidden> Date: 2016-01-13 00:59:02
On Jan 12, 2016, at 16:49, Sowmini Varadhan [off-list ref] wrote:
quoted
On (01/06/16 16:33), David Miller wrote:
A repeating pattern in drivers has become to use OF node information
and, if not found, platform specific host information to extract the
ethernet address for a given device.
:
quoted
Consolidate this into a portable routine, and provide the
arch_get_platform_mac_address() weak function hook for all
architectures to implement if they want.
:
quoted
As promised back in November, I'm commiting this into net-next
now. I'd work on the conversions of existing drivers, but I'd
rather someone with access to the hardware to so.
I finally have all the ducks lined up for ixgbe/i40e around this.
Should I go ahead and send this off (I think it first gets staged
through Jeff's repo?) or is it better to wait for net-next to be
open again?
please go ahead and send it to intel-wired-lan@lists.osuosl.org so we can review and test the driver parts so when net-next opens it should be ready to push upstream.
I finally have all the ducks lined up for ixgbe/i40e around this.
Should I go ahead and send this off (I think it first gets staged
through Jeff's repo?) or is it better to wait for net-next to be
open again?
If you want to send it to Jeff and the Intel folks for them to
queue it up there, that's fine.