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


Groups > linux.kernel > #1475074 > unrolled thread

[Patch v5 0/2] net: ethernet: xilinx: mac addr and mips

Started byZubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
First post2016-09-02 13:50 +0200
Last post2016-09-05 14:10 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-09-02 13:50 +0200
    [Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-09-02 13:50 +0200
    Re: [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips David Miller <davem@davemloft.net> - 2016-09-04 20:50 +0200
      Re: [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-09-05 14:10 +0200

#1475074 — [Patch v5 0/2] net: ethernet: xilinx: mac addr and mips

FromZubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Date2016-09-02 13:50 +0200
Subject[Patch v5 0/2] net: ethernet: xilinx: mac addr and mips
Message-ID<scV8S-7oO-5@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1475075 — [Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found

FromZubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Date2016-09-02 13:50 +0200
Subject[Patch v5 1/2] net: ethernet: xilinx: Generate random mac if none found
Message-ID<scV8S-7oO-25@gated-at.bofh.it>
In reply to#1475074
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

[toc] | [prev] | [next] | [standalone]


#1475994

FromDavid Miller <davem@davemloft.net>
Date2016-09-04 20:50 +0200
Message-ID<sdKEq-137-27@gated-at.bofh.it>
In reply to#1475074
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.

[toc] | [prev] | [next] | [standalone]


#1476355

FromZubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Date2016-09-05 14:10 +0200
Message-ID<se0SS-3yt-7@gated-at.bofh.it>
In reply to#1475994

On 09/04/2016 07:45 PM, David Miller wrote:
> 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.
>

:)

Looks like there is an identical patch by someone else already in net-next.

https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/drivers/net/ethernet/xilinx/xilinx_emaclite.c?id=5575cf133cf7f564da991595c6bc9344afa7d89a

Regards,
ZubairLK

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web