* [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips
@ 2016-09-02 11:39 Zubair Lutfullah Kakakhel
2016-09-02 11:39 ` [Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found Zubair Lutfullah Kakakhel
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2016-09-02 11:39 UTC (permalink / raw)
To: davem, michal.simek, soren.brinkmann
Cc: linux-kernel, netdev, Zubair.Kakakhel
Hi,
A couple of simple patches to generate the random mac address
if none is found. And enabling the driver for mips.
Based on v4.8-rc4.
These were part of a larger series but that series is growing
wildly. Splitting and submitting the net subsystem patches separately.
Hence the v5.
Regards,
ZubairLK
Zubair Lutfullah Kakakhel (2):
net: ethernet: xilinx: Generate random mac if none found
net: ethernet: xilinx: Enable emaclite for MIPS
drivers/net/ethernet/xilinx/Kconfig | 4 ++--
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found
2016-09-02 11:39 [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips Zubair Lutfullah Kakakhel
@ 2016-09-02 11:39 ` Zubair Lutfullah Kakakhel
2016-09-02 11:39 ` [Patch v5 2/2] net: ethernet: xilinx: Enable emaclite for MIPS Zubair Lutfullah Kakakhel
2016-09-04 18:45 ` [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips David Miller
2 siblings, 0 replies; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2016-09-02 11:39 UTC (permalink / raw)
To: davem, michal.simek, soren.brinkmann
Cc: linux-kernel, netdev, Zubair.Kakakhel
At the moment, if the emaclite device doesn't find a mac address
from any source, it simply uses 0x0 with a warning printed.
Instead of using a 0x0 mac address, use a randomly generated one.
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
V3 -> V4
Curly braces after if check for correct styling
V2 -> V3
No change
V1 -> V2
New patch
---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 3cee84a..efc8d2e 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1131,11 +1131,13 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
lp->rx_ping_pong = get_bool(ofdev, "xlnx,rx-ping-pong");
mac_address = of_get_mac_address(ofdev->dev.of_node);
- if (mac_address)
+ if (mac_address) {
/* Set the MAC address. */
memcpy(ndev->dev_addr, mac_address, ETH_ALEN);
- else
- dev_warn(dev, "No MAC address found\n");
+ } else {
+ dev_warn(dev, "No MAC address found. Generating Random one\n");
+ eth_hw_addr_random(ndev);
+ }
/* Clear the Tx CSR's in case this is a restart */
__raw_writel(0, lp->base_addr + XEL_TSR_OFFSET);
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Patch v5 2/2] net: ethernet: xilinx: Enable emaclite for MIPS
2016-09-02 11:39 [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips Zubair Lutfullah Kakakhel
2016-09-02 11:39 ` [Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found Zubair Lutfullah Kakakhel
@ 2016-09-02 11:39 ` Zubair Lutfullah Kakakhel
2016-09-04 18:45 ` [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips David Miller
2 siblings, 0 replies; 5+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2016-09-02 11:39 UTC (permalink / raw)
To: davem, michal.simek, soren.brinkmann
Cc: linux-kernel, netdev, Zubair.Kakakhel
The MIPS based xilfpga platform uses this driver.
Enable it for MIPS
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
V3 -> V4
Removed unnecesary braces
V2 -> V3
No change
V1 -> V2
No change
---
drivers/net/ethernet/xilinx/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/Kconfig b/drivers/net/ethernet/xilinx/Kconfig
index 4f5c024..6d68c8a 100644
--- a/drivers/net/ethernet/xilinx/Kconfig
+++ b/drivers/net/ethernet/xilinx/Kconfig
@@ -5,7 +5,7 @@
config NET_VENDOR_XILINX
bool "Xilinx devices"
default y
- depends on PPC || PPC32 || MICROBLAZE || ARCH_ZYNQ
+ depends on PPC || PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS
---help---
If you have a network (Ethernet) card belonging to this class, say Y.
@@ -18,7 +18,7 @@ if NET_VENDOR_XILINX
config XILINX_EMACLITE
tristate "Xilinx 10/100 Ethernet Lite support"
- depends on (PPC32 || MICROBLAZE || ARCH_ZYNQ)
+ depends on PPC32 || MICROBLAZE || ARCH_ZYNQ || MIPS
select PHYLIB
---help---
This driver supports the 10/100 Ethernet Lite from Xilinx.
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips
2016-09-02 11:39 [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips Zubair Lutfullah Kakakhel
2016-09-02 11:39 ` [Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found Zubair Lutfullah Kakakhel
2016-09-02 11:39 ` [Patch v5 2/2] net: ethernet: xilinx: Enable emaclite for MIPS Zubair Lutfullah Kakakhel
@ 2016-09-04 18:45 ` David Miller
2016-09-05 12:06 ` Zubair Lutfullah Kakakhel
2 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2016-09-04 18:45 UTC (permalink / raw)
To: Zubair.Kakakhel; +Cc: michal.simek, soren.brinkmann, linux-kernel, netdev
From: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Date: Fri, 2 Sep 2016 12:39:24 +0100
> A couple of simple patches to generate the random mac address
> if none is found. And enabling the driver for mips.
>
> Based on v4.8-rc4.
>
> These were part of a larger series but that series is growing
> wildly. Splitting and submitting the net subsystem patches separately.
> Hence the v5.
This doesn't apply cleanly to any of my trees.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-09-05 12:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-02 11:39 [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips Zubair Lutfullah Kakakhel
2016-09-02 11:39 ` [Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found Zubair Lutfullah Kakakhel
2016-09-02 11:39 ` [Patch v5 2/2] net: ethernet: xilinx: Enable emaclite for MIPS Zubair Lutfullah Kakakhel
2016-09-04 18:45 ` [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips David Miller
2016-09-05 12:06 ` Zubair Lutfullah Kakakhel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).