RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-03 Thread Mario_Limonciello
..@vger.kernel.org; pali.ro...@gmail.com; anthony.w...@canonical.com > Subject: RE: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > mario_limoncie...@dell.com [mailto:mario_limoncie...@dell.com] > > Sent: Friday, June 03, 2016 12:58 AM > [.

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-03 Thread Hayes Wang
mario_limoncie...@dell.com [mailto:mario_limoncie...@dell.com] > Sent: Friday, June 03, 2016 12:58 AM [...] > > Why generate a random one and not just use the one that the network > > controler already provides? > > That's how the flow works in r8152 already and I'm not overriding it. > Again,

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Mario_Limonciello
> I have some other questions which answers should we know: > > 1) Is that AUX MAC address implemented only in customized windows Dell > driver? Or also in "upstream" windows Realtek driver and all users of > Realtek hw can install it (or update via next driver update)? > I don't have the

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Pali Rohár
oundation.org; hayesw...@realtek.com; linux- > > ker...@vger.kernel.org; netdev@vger.kernel.org; linux- > > u...@vger.kernel.org; pali.ro...@gmail.com; > > anthony.w...@canonical.com Subject: Re: [PATCH] r8152: Add support > > for setting MAC to system's Auxiliary MAC addr

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Pali Rohár
On Thursday 02 June 2016 20:04:02 Bjørn Mork wrote: > writes: > >> > 2) Track whether this is the first or second USB NIC plugged in. > >> > Only offer it > >> > >> on the first NIC detected by r8152. When the second NIC is > >> plugged in don't match from ACPI. >

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Mario_Limonciello
r.kernel.org; linux- > u...@vger.kernel.org; pali.ro...@gmail.com; anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > <mario_limoncie...@dell.com> writes: > > >> > 2) Track whether t

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Bjørn Mork
writes: >> > 2) Track whether this is the first or second USB NIC plugged in. Only >> > offer it >> on the first NIC detected by r8152. When the second NIC is plugged in don't >> match from ACPI. >> > There would be a question of what to do if the first NIC is

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Mario_Limonciello
11:09 AM > To: Limonciello, Mario <mario_limoncie...@dell.com> > Cc: hayesw...@realtek.com; linux-ker...@vger.kernel.org; > netdev@vger.kernel.org; linux-...@vger.kernel.org; pali.ro...@gmail.com; > anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting M

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Greg KH
On Thu, Jun 02, 2016 at 03:46:41PM +, mario_limoncie...@dell.com wrote: > > > > > > This isn't something part of ACPI - it's been added specifically for a > > > selection of Dell machines. > > > > Ah, but isn't ACPI supposed to be a "standard"? :) > > > > Heh. > It's also possible to get

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Mario_Limonciello
> > > > This isn't something part of ACPI - it's been added specifically for a > > selection of Dell machines. > > Ah, but isn't ACPI supposed to be a "standard"? :) > Heh. It's also possible to get this from an SMM routine. Lesser of two evils to fetch the information this way, right? :) >

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Greg KH
> Cc: hayesw...@realtek.com; LKML <linux-ker...@vger.kernel.org>; Netdev > > <netdev@vger.kernel.org>; Linux USB <linux-...@vger.kernel.org>; > > pali.ro...@gmail.com; anthony.w...@canonical.com > > Subject: Re: [PATCH] r8152: Add support for setting MAC to system

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Mario_Limonciello
r.kernel.org; linux- > u...@vger.kernel.org; anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > > > > > > > + pr_info("r8152: Using system auxiliary MAC address"); > &

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Andrew Lunn
> > > > > + pr_info("r8152: Using system auxiliary MAC address"); > > > > It would be great to write also mac address into that pr_info And since there could be multiple r8152 in the system, it would be good to indicate which of them is having its MAC changed. So netdev_info() or

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Mario_Limonciello
...@realtek.com; LKML <linux-ker...@vger.kernel.org>; Netdev > <netdev@vger.kernel.org>; Linux USB <linux-...@vger.kernel.org>; > anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > Hi! As ACPI

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Mario_Limonciello
r.kernel.org; linux- > u...@vger.kernel.org; pali.ro...@gmail.com; anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > <mario_limoncie...@dell.com> writes: > > >> > +static

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Bjørn Mork
writes: >> > +static u8 amac_ascii_to_hex(int c) >> > +{ >> > + if (c <= 0x39) >> > + return (u8)(c - 0x30); >> > + else if (c <= 0x46) >> > + return (u8)(c - 0x37); >> > + return (u8)(c - 0x57); >> > +} >> > > Sorry forgot to address this. >

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Pali Rohár
Hi! As ACPI bytecode is untrusted for me and also for running kernel, we should not expect that it does not contain any bugs or other problems. So I would propose these checks to prevent something wrong... On Wednesday 01 June 2016 16:50:44 Mario Limonciello wrote: > +static void

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Bjørn Mork
Greg KH writes: > And finally, this seems odd overall given that a MAC address should be > associated with the specific network device, not the overall system. Definitely. I wonder if this isn't a perfect candidate for an x86 arch_get_platform_mac_address()

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-02 Thread Hayes Wang
Mario Limonciello [mailto:mario_limoncie...@dell.com] [...] > static int set_ethernet_addr(struct r8152 *tp) > { > struct net_device *dev = tp->netdev; > @@ -1041,6 +1075,9 @@ static int set_ethernet_addr(struct r8152 *tp) > else > ret = pla_ocp_read(tp, PLA_BACKUP, 8,

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Mario_Limonciello
> > +static u8 amac_ascii_to_hex(int c) > > +{ > > + if (c <= 0x39) > > + return (u8)(c - 0x30); > > + else if (c <= 0x46) > > + return (u8)(c - 0x37); > > + return (u8)(c - 0x57); > > +} > Sorry forgot to address this. > We really don't have such a function

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Mario_Limonciello
ger.kernel.org>; Linux USB <linux-...@vger.kernel.org>; > pali.ro...@gmail.com; anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary > MAC address > > On Wed, Jun 01, 2016 at 04:50:44PM -0500, Mario Limonciello wrote: > &g

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Mario_Limonciello
v@vger.kernel.org; linux-...@vger.kernel.org; pali.ro...@gmail.com; > anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary > MAC address > > On Wed, Jun 01, 2016 at 10:31:52PM +, mario_limoncie...@dell.com > wrote: > > >

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Greg KH
yesw...@realtek.com; LKML <linux-ker...@vger.kernel.org>; Netdev > > <netdev@vger.kernel.org>; Linux USB <linux-...@vger.kernel.org>; > > pali.ro...@gmail.com; anthony.w...@canonical.com > > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's >

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Greg KH
On Wed, Jun 01, 2016 at 04:50:44PM -0500, Mario Limonciello wrote: > Dell systems with Type-C ports have support for a persistent system > specific MAC address when used with Dell Type-C docks and dongles. > This means a dock plugged into two different systems will show different > (but

RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Mario_Limonciello
ger.kernel.org>; Linux USB <linux-...@vger.kernel.org>; > pali.ro...@gmail.com; anthony.w...@canonical.com > Subject: Re: [PATCH] r8152: Add support for setting MAC to system's > Auxiliary MAC address > > On Wed, Jun 01, 2016 at 04:50:44PM -0500, Mario Limonciello wrote: > > Dell

Re: [PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Andrew Lunn
On Wed, Jun 01, 2016 at 04:50:44PM -0500, Mario Limonciello wrote: > Dell systems with Type-C ports have support for a persistent system > specific MAC address when used with Dell Type-C docks and dongles. > This means a dock plugged into two different systems will show different > (but

[PATCH] r8152: Add support for setting MAC to system's Auxiliary MAC address

2016-06-01 Thread Mario Limonciello
Dell systems with Type-C ports have support for a persistent system specific MAC address when used with Dell Type-C docks and dongles. This means a dock plugged into two different systems will show different (but persistent) MAC addresses. Dell Type-C docks and dongles use the r8152 driver. This