* [U-Boot] [PATCH 1/2][v3] driver: net: ldpaa_eth: Set MAC address during interface open
@ 2015-10-07 10:59 Prabhakar Kushwaha
2015-10-30 16:16 ` York Sun
0 siblings, 1 reply; 2+ messages in thread
From: Prabhakar Kushwaha @ 2015-10-07 10:59 UTC (permalink / raw)
To: u-boot
Currently ldpaa ethernet driver rely on DPL file to statically configure
mac address for the DPNIs. It is not a correct approach.
Add support setting MAC address from env variable or Random MAC address.
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
Changs for v2: Sending as it is
Changs for v3: Sending as it is
drivers/net/ldpaa_eth/ldpaa_eth.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c b/drivers/net/ldpaa_eth/ldpaa_eth.c
index 4de7586..99acb7a 100644
--- a/drivers/net/ldpaa_eth/ldpaa_eth.c
+++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
@@ -220,7 +220,6 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
{
struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
struct dpni_queue_attr rx_queue_attr;
- uint8_t mac_addr[6];
int err;
if (net_dev->state == ETH_STATE_ACTIVE)
@@ -240,21 +239,13 @@ static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
if (err)
goto err_bind;
- err = dpni_get_primary_mac_addr(dflt_mc_io, MC_CMD_NO_FLAGS,
- priv->dpni_handle, mac_addr);
+ err = dpni_add_mac_addr(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle, net_dev->enetaddr);
if (err) {
- printf("dpni_get_primary_mac_addr() failed\n");
+ printf("dpni_add_mac_addr() failed\n");
return err;
}
- memcpy(net_dev->enetaddr, mac_addr, 0x6);
-
- /* setup the MAC address */
- if (net_dev->enetaddr[0] & 0x01) {
- printf("%s: MacAddress is multcast address\n", __func__);
- return 1;
- }
-
#ifdef CONFIG_PHYLIB
/* TODO Check this path */
err = phy_startup(priv->phydev);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH 1/2][v3] driver: net: ldpaa_eth: Set MAC address during interface open
2015-10-07 10:59 [U-Boot] [PATCH 1/2][v3] driver: net: ldpaa_eth: Set MAC address during interface open Prabhakar Kushwaha
@ 2015-10-30 16:16 ` York Sun
0 siblings, 0 replies; 2+ messages in thread
From: York Sun @ 2015-10-30 16:16 UTC (permalink / raw)
To: u-boot
On 10/07/2015 03:59 AM, Prabhakar Kushwaha wrote:
> Currently ldpaa ethernet driver rely on DPL file to statically configure
> mac address for the DPNIs. It is not a correct approach.
>
> Add support setting MAC address from env variable or Random MAC address.
>
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> ---
> Changs for v2: Sending as it is
> Changs for v3: Sending as it is
>
Applied to u-boot-fsl-qoriq. Awaiting upstream. Thanks.
York
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-30 16:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 10:59 [U-Boot] [PATCH 1/2][v3] driver: net: ldpaa_eth: Set MAC address during interface open Prabhakar Kushwaha
2015-10-30 16:16 ` York Sun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox