<charles.h...@dellteam.com> writes: > +static int cdc_ncm_resume (struct usb_interface *intf) > +{ > + struct usbnet *dev = usb_get_intfdata(intf); > + struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; > + int ret; > + > + ret = usbnet_resume(intf); > + if (ret != 0) > + goto error2; > + > + if (ctx->ether_desc) { > + struct sockaddr sa; > + > + if (cdc_ncm_get_ethernet_address(dev, ctx)) { > + dev_dbg(&intf->dev, "failed to get mac address\n"); > + goto error2; > + } > + if (get_acpi_mac_passthru(&intf->dev, &sa) == 0) { > + if (memcmp(dev->net->dev_addr, sa.sa_data, ETH_ALEN) != > 0) { > + if (cdc_ncm_set_ethernet_address(dev, &sa) == > 0) { > + memcpy(dev->net->dev_addr, sa.sa_data, > ETH_ALEN); > + } > + } > + } > + dev_info(&intf->dev, "MAC-Address: %pM\n", dev->net->dev_addr); > + } > + > +error2: > + return ret; > +}
This is wrong. dev->net->dev_addr will hold the correct address, and it does not have to match any USB descriptor or ACPI table entry. It's a user managed address. You should simply make sure the device is syncronized with the dev->net->dev_addr field. But you probably want to avoid doing that if it failed initially. There is no need to issue control requests you know will fail. Why the dev_info()? It logs info the user can retrieve with a simple "ip link" or similar. Seems pretty useless even as a debug statement? Bjørn