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]
Date:	Fri, 13 Mar 2009 12:16:34 +0100
From:	Jiri Pirko <jpirko@...hat.com>
To:	Ivan Vecera <ivecera@...hat.com>
Cc:	Michal Schmidt <mschmidt@...hat.com>, linux-kernel@...r.kernel.org,
	jgarzik@...ox.com, davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] 8139cp: allow to set mac address on running device

Fri, Mar 13, 2009 at 10:01:21AM CET, ivecera@...hat.com wrote:
>Jiri Pirko wrote:
>> Thu, Mar 12, 2009 at 06:11:21PM CET, mschmidt@...hat.com wrote:
>>> On Thu, 12 Mar 2009 17:27:31 +0100
>>> Jiri Pirko <jpirko@...hat.com> wrote:
>>>
>>>> +	cpw32_f(MAC0 + 0, le32_to_cpu (*(__le32 *) (dev->dev_addr +
>>>> 0)));
>>>> +	cpw32_f(MAC0 + 4, le32_to_cpu (*(__le32 *) (dev->dev_addr +
>>>> 4)));
>>> You're writing to the card, so using *_to_cpu looks suspicious.
>> Well, I'm using the same approach as it is already done in function
>> cp_init_hw(). Quote:
>> 
>>  /* Restore our idea of the MAC address. */
>>  cpw32_f (MAC0 + 0, le32_to_cpu (*(__le32 *) (dev->dev_addr + 0)));
>>  cpw32_f (MAC0 + 4, le32_to_cpu (*(__le32 *) (dev->dev_addr + 4)));
>> 
>Yes, that's right but I would use more cleaner approach:
>===
>u32 low, high;
>low  = addr[0] | (addr[1] << 8) | (addr[2] << 16) | (addr[3] << 24);
>high = addr[4] | (addr[5] << 8);
>cpw32_f(MAC0 + 0, low);
>cpw32_f(MAC0 + 4, high);
>===
Well, I have no problem with this (in fact I like this more). I just wanted to
stay consistent to existing code. Maybe it would be good to change this chunk
of code in cp_init_hw() too, don't you think?

Jirka
>
>Ivan
--
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