[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0809210100020.16838@wrl-59.cs.helsinki.fi>
Date: Sun, 21 Sep 2008 01:04:54 +0300 (EEST)
From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To: Ivan Vecera <ivecera@...hat.com>
cc: Francois Romieu <romieu@...zoreil.com>,
Netdev <netdev@...r.kernel.org>,
Edward Hsu <edward_hsu@...ltek.com.tw>
Subject: Re: [PATCH] r8169: read MAC address from EEPROM on init
On Fri, 19 Sep 2008, Ivan Vecera wrote:
> ---
> drivers/net/r8169.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 73 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
> index befc927..cff8dd6 100644
> --- a/drivers/net/r8169.c
> +++ b/drivers/net/r8169.c
> + /* MAC address is stored in EEPROM at offset 0x0e
> + * Realtek says: "The VPD address does not have to be a DWORD-aligned
> + * address as defined in the PCI 2.2 Specifications, but the VPD data
> + * is always consecutive 4-byte data starting from the VPD address
> + * specified."
> + */
> + if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 ||
> + rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) {
> + dprintk("Reading MAC address from EEPROM failed\n");
> + return;
> + }
> +
> + dprintk("MAC address found in EEPROM: "
> + "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
> + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], mac[6]);
Aa, one more thing here, there's nowadays print_mac() and
DECLARE_MAC_BUF() for printing MAC-addresses using %s. Since this is
not perf-critical in anyway here, it will save some bytes when used in
kernel-wide scale.
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
--
i.
Powered by blists - more mailing lists