linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: <Charles.Hyde@dellteam.com>
Cc: <linux-usb@vger.kernel.org>, <linux-acpi@vger.kernel.org>,
	<gregkh@linuxfoundation.org>, <Mario.Limonciello@dell.com>,
	<oliver@neukum.org>, <netdev@vger.kernel.org>,
	<nic_swsd@realtek.com>
Subject: Re: [RFC 4/4] net: cdc_ncm: Add ACPI MAC address pass through functionality
Date: Sat, 24 Aug 2019 12:43:38 +0200	[thread overview]
Message-ID: <877e722691.fsf@miraculix.mork.no> (raw)
In-Reply-To: <ec7435e0529243a99f6949ee9efbede5@AUSX13MPS303.AMER.DELL.COM> (Charles Hyde's message of "Tue, 20 Aug 2019 22:23:15 +0000")

<Charles.Hyde@dellteam.com> writes:

> @@ -930,11 +931,18 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
>  	usb_set_intfdata(ctx->control, dev);
>  
>  	if (ctx->ether_desc) {
> +		struct sockaddr sa;
> +
>  		temp = usbnet_get_ethernet_addr(dev, ctx->ether_desc->iMACAddress);
>  		if (temp) {
>  			dev_dbg(&intf->dev, "failed to get mac address\n");
>  			goto error2;
>  		}
> +		if (get_acpi_mac_passthru(&intf->dev, &sa) == 0) {
> +			memcpy(dev->net->dev_addr, sa.sa_data, ETH_ALEN);
> +			if (usbnet_set_ethernet_addr(dev) < 0)
> +				usbnet_get_ethernet_addr(dev, ctx->ether_desc->iMACAddress);
> +		}
>  		dev_info(&intf->dev, "MAC-Address: %pM\n", dev->net->dev_addr);
>  	}

So you want to run a Dell specific ACPI method every time anyone plugs
some NCM class device into a host supporing ACPI?  That's going to annoy
the hell out of 99.9997% of the x86, ia64 and arm64 users of this
driver.

Call ACPI once when the driver loads, and only if running on an actual
Dell system where this method is supported.  There must be some ACPI
device ID you can match on to know if this method is supported or not?


Bjørn

  reply	other threads:[~2019-08-24 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 22:23 [RFC 4/4] net: cdc_ncm: Add ACPI MAC address pass through functionality Charles.Hyde
2019-08-24 10:43 ` Bjørn Mork [this message]
2019-08-24 13:26   ` Mario.Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877e722691.fsf@miraculix.mork.no \
    --to=bjorn@mork.no \
    --cc=Charles.Hyde@dellteam.com \
    --cc=Mario.Limonciello@dell.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=oliver@neukum.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).