All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Bur <cyrilbur@gmail.com>
To: miltonm@us.ibm.com
Cc: OpenBMC Patches <openbmc-patches@stwcx.xyz>, openbmc@lists.ozlabs.org
Subject: Re: [PATCH u-boot 1/5] net: aspeednic: Create aspeed_write_hwaddr from set_mac_address
Date: Tue, 15 Mar 2016 11:12:52 +1100	[thread overview]
Message-ID: <20160315111252.61bdea22@camb691> (raw)
In-Reply-To: <1457721644-29871-2-git-send-email-openbmc-patches@stwcx.xyz>

On Fri, 11 Mar 2016 12:40:40 -0600
OpenBMC Patches <openbmc-patches@stwcx.xyz> wrote:

> From: "Milton D. Miller II" <miltonm@us.ibm.com>
> 
> Tell the ethernet framework how to set the MAC address on the
> aspeed nic so it can be set at the expected points in the code.
> 
> Rename set_mac_address to aspeed_write_hwaddr.  Drop the unused
> argument, change the prototype to int, and return 0.
> 
> Assign the device write_hwaddr method to this new function.
> 
> Signed-off-by: Milton Miller <miltonm@us.ibm.com>

Reviewed-by: Cyril Bur <cyrilbur@gmail.com>

> ---
>  drivers/net/aspeednic.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/aspeednic.c b/drivers/net/aspeednic.c
> index d70c7ab..b8ce24c 100644
> --- a/drivers/net/aspeednic.c
> +++ b/drivers/net/aspeednic.c
> @@ -411,7 +411,7 @@ static int   aspeednic_init(struct eth_device* dev, bd_t* bis);
>  static int   aspeednic_send(struct eth_device* dev, volatile void *packet, int length);
>  static int   aspeednic_recv(struct eth_device* dev);
>  static void  aspeednic_halt(struct eth_device* dev);
> -static void  set_mac_address (struct eth_device* dev, bd_t* bis);
> +static int   aspeednic_write_hwaddr(struct eth_device* dev);
>  static void  phy_write_register (struct eth_device* dev, u8 PHY_Register, u8 PHY_Address, u16 PHY_Data);
>  static u16   phy_read_register (struct eth_device* dev, u8 PHY_Register, u8 PHY_Address);
>  #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
> @@ -564,6 +564,7 @@ int aspeednic_initialize(bd_t *bis)
>    dev->halt   = aspeednic_halt;
>    dev->send   = aspeednic_send;
>    dev->recv   = aspeednic_recv;
> +  dev->write_hwaddr = aspeednic_write_hwaddr;
>  
>    /* Ensure we're not sleeping. */
>    if (CONFIG_ASPEED_MAC_PHY_SETTING >= 1) {
> @@ -1157,7 +1158,7 @@ static int aspeednic_init(struct eth_device* dev, bd_t* bis)
>  
>    aspeednic_probe_phy(dev);
>  
> -  set_mac_address (dev, bis);
> +  aspeednic_write_hwaddr(dev);
>    set_mac_control_register (dev);
>  
>    for (i = 0; i < NUM_RX_DESC; i++) {
> @@ -1362,7 +1363,7 @@ static void aspeednic_halt(struct eth_device* dev)
>    STOP_MAC(dev);
>  }
>  
> -static void set_mac_address (struct eth_device* dev, bd_t* bis)
> +static int aspeednic_write_hwaddr(struct eth_device* dev)
>  {
>    if (!eth_getenv_enetaddr_by_index("eth", 0, dev->enetaddr)) {
>      eth_random_enetaddr(dev->enetaddr);
> @@ -1374,6 +1375,8 @@ static void set_mac_address (struct eth_device* dev, bd_t* bis)
>    if (CONFIG_ASPEED_MAC_PHY_SETTING >= 1) {
>      memcpy(NCSI_Request.SA, dev->enetaddr, 6);
>    }
> +
> +  return 0;
>  }
>  
>  static u16 phy_read_register (struct eth_device* dev, u8 PHY_Register, u8 PHY_Address)

  reply	other threads:[~2016-03-15  0:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 18:40 [PATCH u-boot 0/5] Only call aspeednic_init when preparing to use network OpenBMC Patches
2016-03-11 18:40 ` [PATCH u-boot 1/5] net: aspeednic: Create aspeed_write_hwaddr from set_mac_address OpenBMC Patches
2016-03-15  0:12   ` Cyril Bur [this message]
2016-03-11 18:40 ` [PATCH u-boot 2/5] net: aspeednic: Do not start hardware in initialize OpenBMC Patches
2016-03-15  0:14   ` Cyril Bur
2016-03-11 18:40 ` [PATCH u-boot 3/5] net: aspeednic: Remove extra spaces before assignments OpenBMC Patches
2016-03-15  0:15   ` Cyril Bur
2016-03-11 18:40 ` [PATCH u-boot 4/5] net: Implement random ethaddr fallback in eth.c OpenBMC Patches
2016-03-15  0:21   ` Cyril Bur
2016-03-11 18:40 ` [PATCH u-boot 5/5] net: aspeednic: Do not fill in a random MAC address OpenBMC Patches
2016-03-15  0:11   ` Cyril Bur
2016-03-15 22:37     ` Milton Miller II

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160315111252.61bdea22@camb691 \
    --to=cyrilbur@gmail.com \
    --cc=miltonm@us.ibm.com \
    --cc=openbmc-patches@stwcx.xyz \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.