lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080725090530.GA4318@fluff.org.uk>
Date:	Fri, 25 Jul 2008 10:05:30 +0100
From:	Ben Dooks <ben-linux@...ff.org>
To:	Laurent Pinchart <laurentp@...-semaphore.com>
Cc:	netdev@...r.kernel.org, Ben Dooks <ben-linux@...ff.org>
Subject: Re: [PATCH] dm9000: Support MAC address setting through platform
	data.

On Wed, Jul 23, 2008 at 05:41:52PM +0200, Laurent Pinchart wrote:
> The dm9000 driver reads the chip's MAC address from the attached EEPROM. When
> no EEPROM is present, or when the MAC address is invalid, it falls back to
> reading the address from the chip.
> 
> This patch lets platform code set the desired MAC address through platform
> data.

I belive we've had discussions about this before on the subject
as this is generally down to broken boot-loader behaviour.

Would people have objections to passing the mac address in on the
command line and having the driver initialise it from there? Are
there any other ethernet drivers out there with the same problem?

I've added some notes on the patch anyway.
 
> Signed-off-by: Laurent Pinchart <laurentp@...-semaphore.com>
> ---
>  drivers/net/dm9000.c   |    3 +++
>  include/linux/dm9000.h |    1 +
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
> index 864295e..6bc8924 100644
> --- a/drivers/net/dm9000.c
> +++ b/drivers/net/dm9000.c
> @@ -716,6 +716,11 @@ dm9000_probe(struct platform_device *pdev)
>  	for (i = 0; i < 6; i += 2)
>  		dm9000_read_eeprom(db, i / 2, ndev->dev_addr+i);
>  
> +	if (!is_valid_ether_addr(ndev->dev_addr) && pdata != NULL) {
> +		mac_src = "platform data";
> +		memcpy(ndev->dev_addr, pdata->dev_addr, 6);
> +	}
> +
>  	if (!is_valid_ether_addr(ndev->dev_addr)) {
>  		/* try reading from mac */
>  		
> diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
> index a375046..4fb49a4 100644
> --- a/include/linux/dm9000.h
> +++ b/include/linux/dm9000.h
> @@ -26,6 +26,7 @@
>  
>  struct dm9000_plat_data {
>  	unsigned int	flags;
> +	unsigned char	dev_addr[6];

how about unsigned char *mac_addr, so that you can detect
if the address has not been passed in easily. dev_addr is
not really descriptive enough as a name.

-- 
Ben (ben@...ff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ