Re: Fwd: 3 more broken Zaurii - SL-5600, A300, C700

From: Ross Maynard
Date: Sat Jul 08 2023 - 08:34:06 EST


I applied my patch then recompiled the kernel, and the 3 devices can now connect via USB:

[  268.872485] usb 3-2: New USB device found, idVendor=04dd, idProduct=8005, bcdDevice= 0.00
[  268.872498] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  268.872502] usb 3-2: Product: SL-A300
[  268.872505] usb 3-2: Manufacturer: Sharp
[  268.876526] zaurus 3-2:1.0 usb0: register 'zaurus' at usb-0000:00:14.0-2, pseudo-MDLM (BLAN) device, fa:0f:0f:08:2b:59

[  595.541549] usb 3-2: New USB device found, idVendor=04dd, idProduct=8006, bcdDevice= 0.00
[  595.541562] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  595.541566] usb 3-2: Product: SL-5600
[  595.541569] usb 3-2: Manufacturer: Sharp
[  595.545148] zaurus 3-2:1.0 usb0: register 'zaurus' at usb-0000:00:14.0-2, pseudo-MDLM (BLAN) device, fa:0f:0f:08:2b:59

[  446.954583] usb 3-2: New USB device found, idVendor=04dd, idProduct=8007, bcdDevice= 0.00
[  446.954596] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  446.954600] usb 3-2: Product: SL-C700
[  446.954603] usb 3-2: Manufacturer: Sharp
[  446.957871] zaurus 3-2:1.0 usb0: register 'zaurus' at usb-0000:00:14.0-2, pseudo-MDLM (BLAN) device, fa:0f:0f:08:2b:59

Could someone please submit the patch for me?

Thanks.

Ross

On 7/7/23 10:28 pm, Ross Maynard wrote:
Hi,

I am not a kernel developer, but I think the attached patch would work.

Ross

On 7/7/23 2:41 am, Dave Jones wrote:
On Thu, Jul 06, 2023 at 01:45:57PM +0200, Thorsten Leemhuis wrote:
  > On 06.07.23 05:08, Bagas Sanjaya wrote:
  > >>
  > >> I notice a regression report on Bugzilla [1]. Quoting from it:
  > >>
  > >>> The following patch broke support of 3 more Zaurus models: SL-5600, A300 and C700
  > >>>
  > >>> [16adf5d07987d93675945f3cecf0e33706566005] usbnet: Remove over-broad module alias from zaurus
  >
  > ...
  > He sometimes shows up on Linux kernel lists, but I doubt he cares about
  > that change after all these years. And I would not blame him at all.

That's about the size of it.  This is pretty near the bottom of my ever-shrinking
list of kernel drivers I care about.

  > Yes, we have the "no regressions" rule, but contributing a change to the
  > kernel OTOH should not mean that you are responsible for all regressions
  > it causes for your whole life. :-)

That said, 12 years later, 16adf5d07987d93675945f3cecf0e33706566005
is still the right thing to do. Adding actual matches for the devices
rather than matching by class will prevent this getting loaded where it
doesn't need to be.

If someone actually cares to get this working, cargo-culting Oliver's
change to add the extra id is likely the way forward.

    Dave

diff -urpN a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
--- a/drivers/net/usb/cdc_ether.c 2023-07-07 17:48:27.991833366 +1000
+++ b/drivers/net/usb/cdc_ether.c 2023-07-07 21:53:11.556198087 +1000
@@ -616,6 +616,13 @@ static const struct usb_device_id produc
}, {
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE,
+ .idVendor = 0x04DD,
+ .idProduct = 0x8005, /* A-300 */
+ ZAURUS_FAKE_INTERFACE,
+ .driver_info = 0,
+}, {
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
+ | USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x04DD,
.idProduct = 0x8006, /* B-500/SL-5600 */
ZAURUS_MASTER_INTERFACE,
@@ -623,12 +630,26 @@ static const struct usb_device_id produc
}, {
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE,
+ .idVendor = 0x04DD,
+ .idProduct = 0x8006, /* B-500/SL-5600 */
+ ZAURUS_FAKE_INTERFACE,
+ .driver_info = 0,
+}, {
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
+ | USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x04DD,
.idProduct = 0x8007, /* C-700 */
ZAURUS_MASTER_INTERFACE,
.driver_info = 0,
}, {
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
+ | USB_DEVICE_ID_MATCH_DEVICE,
+ .idVendor = 0x04DD,
+ .idProduct = 0x8007, /* C-700 */
+ ZAURUS_FAKE_INTERFACE,
+ .driver_info = 0,
+}, {
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x04DD,
.idProduct = 0x9031, /* C-750 C-760 */
diff -urpN a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
--- a/drivers/net/usb/zaurus.c 2023-07-07 17:48:28.043849110 +1000
+++ b/drivers/net/usb/zaurus.c 2023-07-07 22:06:49.267699853 +1000
@@ -289,11 +289,25 @@ static const struct usb_device_id produc
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x04DD,
+ .idProduct = 0x8005, /* A-300 */
+ ZAURUS_FAKE_INTERFACE,
+ .driver_info = (unsigned long) &bogus_mdlm_info,
+}, {
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
+ | USB_DEVICE_ID_MATCH_DEVICE,
+ .idVendor = 0x04DD,
.idProduct = 0x8006, /* B-500/SL-5600 */
ZAURUS_MASTER_INTERFACE,
.driver_info = ZAURUS_PXA_INFO,
}, {
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
+ | USB_DEVICE_ID_MATCH_DEVICE,
+ .idVendor = 0x04DD,
+ .idProduct = 0x8006, /* B-500/SL-5600 */
+ ZAURUS_FAKE_INTERFACE,
+ .driver_info = (unsigned long) &bogus_mdlm_info,
+}, {
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x04DD,
.idProduct = 0x8007, /* C-700 */
@@ -301,6 +315,13 @@ static const struct usb_device_id produc
.driver_info = ZAURUS_PXA_INFO,
}, {
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO
+ | USB_DEVICE_ID_MATCH_DEVICE,
+ .idVendor = 0x04DD,
+ .idProduct = 0x8007, /* C-700 */
+ ZAURUS_FAKE_INTERFACE,
+ .driver_info = (unsigned long) &bogus_mdlm_info,
+}, {
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x04DD,
.idProduct = 0x9031, /* C-750 C-760 */