Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1473679 > unrolled thread
| Started by | Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> |
|---|---|
| First post | 2016-08-31 18:40 +0200 |
| Last post | 2016-09-01 17:40 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[Patch v3 08/11] net: ethernet: xilinx: Generate random mac if none found Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-08-31 18:40 +0200
Re: [Patch v3 08/11] net: ethernet: xilinx: Generate random mac if none found Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-09-01 13:00 +0200
Re: [Patch v3 08/11] net: ethernet: xilinx: Generate random mac if none found Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> - 2016-09-01 17:40 +0200
| From | Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> |
|---|---|
| Date | 2016-08-31 18:40 +0200 |
| Subject | [Patch v3 08/11] net: ethernet: xilinx: Generate random mac if none found |
| Message-ID | <scgIr-4Kp-51@gated-at.bofh.it> |
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>
---
V2 -> V3
No change
V1 -> V2
New patch
---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 3cee84a..22e5a5a 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1134,8 +1134,10 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
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] | [next] | [standalone]
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Date | 2016-09-01 13:00 +0200 |
| Subject | Re: [Patch v3 08/11] net: ethernet: xilinx: Generate random mac if none found |
| Message-ID | <scxSW-H2-27@gated-at.bofh.it> |
| In reply to | #1473679 |
Hello.
On 8/31/2016 7:35 PM, Zubair Lutfullah Kakakhel wrote:
> 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>
[...]
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> index 3cee84a..22e5a5a 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> @@ -1134,8 +1134,10 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
> 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);
> + }
All branches of the *if* statement should have {} if at least one has
them, see Documentation/CodingStyle, chaoter 3.
[...]
MBR, Sergei
[toc] | [prev] | [next] | [standalone]
| From | Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com> |
|---|---|
| Date | 2016-09-01 17:40 +0200 |
| Subject | Re: [Patch v3 08/11] net: ethernet: xilinx: Generate random mac if none found |
| Message-ID | <scCfT-3EJ-7@gated-at.bofh.it> |
| In reply to | #1474277 |
On 09/01/2016 11:52 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 8/31/2016 7:35 PM, Zubair Lutfullah Kakakhel wrote:
>
>> 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>
> [...]
>
>> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
>> index 3cee84a..22e5a5a 100644
>> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
>> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
>> @@ -1134,8 +1134,10 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
>> 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);
>> + }
>
> All branches of the *if* statement should have {} if at least one has them, see Documentation/CodingStyle, chaoter 3.
Спасибо
ZubairLK
>
> [...]
>
> MBR, Sergei
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web