[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19ff919663a2454a82645b9b0f4146dd@ausx13mpc124.AMER.DELL.COM>
Date: Thu, 2 Jun 2016 14:29:41 +0000
From: <Mario_Limonciello@...l.com>
To: <bjorn@...k.no>
CC: <gregkh@...uxfoundation.org>, <hayeswang@...ltek.com>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-usb@...r.kernel.org>, <pali.rohar@...il.com>,
<anthony.wong@...onical.com>
Subject: RE: [PATCH] r8152: Add support for setting MAC to system's Auxiliary
MAC address
> -----Original Message-----
> From: Bjørn Mork [mailto:bjorn@...k.no]
> Sent: Thursday, June 2, 2016 3:11 AM
> To: Limonciello, Mario <Mario_Limonciello@...l.com>
> Cc: gregkh@...uxfoundation.org; hayeswang@...ltek.com; linux-
> kernel@...r.kernel.org; netdev@...r.kernel.org; linux-
> usb@...r.kernel.org; pali.rohar@...il.com; anthony.wong@...onical.com
> Subject: Re: [PATCH] r8152: Add support for setting MAC to system's
> Auxiliary MAC address
>
> <Mario_Limonciello@...l.com> 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.
> >
> >> We really don't have such a function somewhere in the kernel already?
> >
> > There is a function in acpi/acpica/uthex.c that does this, but it
> > doesn't seem to be used by anything outside of acpica so far. Would it be
> OK style wise to #include " ../../acpi/acpica/acutils.h" from r8152.c?
>
> Makes me wonder where you looked.... You have hex_to_bin() and
> hex2bin() in include/linux/kernel.h
>
Thank you, I completely missed that. I wasn't looking for literals in my grepping. I'll use this instead.
> You could look at usbnet_get_ethernet_addr() for an example of how to do
> this properly. It's pretty close to this driver in the tree, and should be a
> natural starting point before reinventing the wheel...
>
OK will do.
Powered by blists - more mailing lists