Thread (4 messages) 4 messages, 2 authors, 4d ago

Re: [PATCH 1/1] net: usb: aqc111: fix set_mac_address return value for bonding

From: Hanson Wang <hidden>
Date: 2026-07-04 08:43:44
Also in: linux-usb

Hi Andrew,

Thanks for the review. You are right that this is not bonding-specific -
any caller of ndo_set_mac_address() (including netif_set_mac_address()
and "ip link set address") expects 0 on success and treats any non-zero
return value as failure.

I audited all drivers under drivers/net/usb/ that implement a custom
ndo_set_mac_address callback:

  aqc111.c        - BUG: returns usb_control_msg byte count (6) [this patch]
  ax88179_178a.c  - OK: returns 0 after ax_write_cmd()
  asix_common.c   - OK: returns 0 (async write to hardware)
  ch397.c         - OK: returns 0
  dm9601.c        - OK: returns 0 (async write)
  lan78xx.c       - OK: returns 0
  mcs7830.c       - OK: returns 0
  qmi_wwan.c      - OK: returns 0
  r8152.c/r8157.c - OK: returns 0 on success (via usb_autopm_get_interface)
  rtl8150.c       - OK: returns 0
  sr9700.c        - OK: returns 0 (async write)
  sr9800.c        - OK: returns 0 (async write)

Drivers that use eth_mac_addr as ndo_set_mac_address (smsc95xx,
smsc75xx, cdc_ncm, rndis, pegasus, usbnet default, etc.) always
return 0 from the netdev op.

As far as I can tell, aqc111 is the only driver that directly returns
the result of a USB control write without normalizing success to 0.

Please let me know if you would like any further changes to this patch.

Best regards,
Hanson Wang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help