mirror_ubuntu-kernels/drivers/net/can/usb
Marc Kleine-Budde 0f2211f1cf can: gs_usb: gs_usb_set_phys_id(): return with error if identify is not supported
Until commit 409c188c57 ("can: tree-wide: advertise software
timestamping capabilities") the ethtool_ops was only assigned for
devices which support the GS_CAN_FEATURE_IDENTIFY feature. That commit
assigns ethtool_ops unconditionally.

This results on controllers without GS_CAN_FEATURE_IDENTIFY support
for the following ethtool error:

| $ ethtool -p can0 1
| Cannot identify NIC: Broken pipe

Restore the correct error value by checking for
GS_CAN_FEATURE_IDENTIFY in the gs_usb_set_phys_id() function.

| $ ethtool -p can0 1
| Cannot identify NIC: Operation not supported

While there use the variable "netdev" for the "struct net_device"
pointer and "dev" for the "struct gs_can" pointer as in the rest of
the driver.

Fixes: 409c188c57 ("can: tree-wide: advertise software timestamping capabilities")
Link: http://lore.kernel.org/all/20220818143853.2671854-1-mkl@pengutronix.de
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-09-21 09:48:52 +02:00
..
etas_es58x can: etas_es58x: remove useless calls to usb_fill_bulk_urb() 2022-07-29 10:14:53 +02:00
kvaser_usb can: kvaser_usb: advertise timestamping capabilities and add ioctl support 2022-07-28 11:44:31 +02:00
peak_usb can: peak_usb: advertise timestamping capabilities and add ioctl support 2022-07-28 11:44:31 +02:00
ems_usb.c can: ems_usb: fix clang's -Wunaligned-access warning 2022-08-09 09:05:06 +02:00
esd_usb.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
gs_usb.c can: gs_usb: gs_usb_set_phys_id(): return with error if identify is not supported 2022-09-21 09:48:52 +02:00
Kconfig can/esd_usb2: Rename esd_usb2.c to esd_usb.c 2022-06-25 13:05:26 +02:00
Makefile can/esd_usb2: Rename esd_usb2.c to esd_usb.c 2022-06-25 13:05:26 +02:00
mcba_usb.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
ucan.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00
usb_8dev.c can: tree-wide: advertise software timestamping capabilities 2022-07-28 11:44:01 +02:00