Re: usbserial option driver newid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2015-03-05 10:00, Rick Farina wrote:
On 03/04/15 13:01, Greg KH wrote:
And again, a kernel patch is the real way to fix it for everyone.

Okay, got a lot of things figured out and have everything working now.
Glad I spent the extra time because I found some neat things on the device.

I've made the following changes:
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index f0c0c53..9d11676 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -80,11 +80,13 @@ static void option_instat_callback(struct urb *urb);
  #define OPTION_PRODUCT_GTM380_MODEM            0x7201

  #define HUAWEI_VENDOR_ID                       0x12D1
+#define HUAWEI_PRODUCT_E3276_HILINK            0X1001
  #define HUAWEI_PRODUCT_E173                    0x140C
  #define HUAWEI_PRODUCT_E1750                   0x1406
  #define HUAWEI_PRODUCT_K4505                   0x1464
  #define HUAWEI_PRODUCT_K3765                   0x1465
  #define HUAWEI_PRODUCT_K4605                   0x14C6
+#define HUAWEI_PRODUCT_E3276_HILINK_DEBUG      0x1566
  #define HUAWEI_PRODUCT_E173S6                  0x1C07

  #define QUANTA_VENDOR_ID                       0x0408

However, there is a bunch of code that looks like this below the code
block I added to:
         { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID,
HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
                 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
         { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x14ac, 0xff,
0xff, 0xff),    /* Huawei E1820 */
                 .driver_info = (kernel_ulong_t) &net_intf1_blacklist },

I assume that I don't need to add anything like this since just echoing
the usbid into new_id seems to work fine?  I've tested using it as a
serial interface to send direct AT commands to the modem as well as
actually dialing up with the modem and establishing connections.
Everything seems to be working so it is safe to assume that the only
change I need to make is the one I made in the diff above?

I am a little confused in that my older e3276 (before the switch to
"hilink") seems to be supported by the option driver, however, it's
usbid is not seen anywhere in the serial folder:

Bus 002 Device 010: ID 12d1:1506 Huawei Technologies Co., Ltd.
Modem/Networkcard


[374876.873580] usb 2-6: new high-speed USB device number 10 using xhci_hcd
[374877.043245] option 2-6:1.0: GSM modem (1-port) converter detected
[374877.043338] usb 2-6: GSM modem (1-port) converter now attached to
ttyUSB0
[374877.043432] option 2-6:1.1: GSM modem (1-port) converter detected
[374877.043507] usb 2-6: GSM modem (1-port) converter now attached to
ttyUSB1

The closest I can find in the code is this line, but it doesn't make
sense because if this line does match 0x1506 then one of the lines above
it should have matched 0x1001 and it clearly doesn't.

         { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06,
0x15) },

Looking at commit ee6f827d I am adding it wrong, but I don't understand
how to add the new product ids correctly.  Any pointers?

Thanks,
Zero
---


Your patch is only a definition binding a name to a number, it does not add support for 12d1:1566 as it is. The define is the least important part of a patch and should in my opinion be avoided if it is not absolutely needed, option.c is not some kind of look-up table between product names vs usb id's. The current defines in option.c are partially wrong, there are lots of devices with same product name but different usb id
and there are lots of usb id's which has multiple product names.
Most of the defines in option.c is nothing else than babbling..

So with that said my question is why did you define a product name for 12d1:1001? No version of E3276 has ever switched into 12d1:1001 when using Huawei official modeswitch messages, 12d1:1001 is the very first Huawei usb id being used years before E3276 was invented and if it had needed any define then that would most likely been HUAWEI_PRODUCT_E150 Show me a lsusb -v -d 12d1:1001 for your E3276, I am sure that it is already supported in option by its interface attributes.


12d1:1566 is a usb id used in debug mode for many Huawei devices, it is an id that normal users wont get, you got it by sending a
non-official switch msg to the dongle.
There is already support in option for a few other Huawei dongles with the same type of interface attributes and that is the right place
for adding 12d1:1556

Here is the relevant part of option.c :

645 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c05, USB_CLASS_COMM, 0x02, 0xff) }, 646 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c1f, USB_CLASS_COMM, 0x02, 0xff) }, 647 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) },

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux