Patch Request of option.c module to support Olicard-300 (2020:4000)

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

 



Hi all!

I'm a simple linux user, not a developer, but I just
added a new record to source of "option" usb serial
module (option.c) to add support for a usb internet
dongle: Olivetti Olicard-300.

Hope this is the right place to submit my changes so
that kernel developers can apply to next versions of
"option" driver.

Here we have usb-devices output:
----------------------------------------
# usb-devices |grep -B2 -A11 2020.*4000
T:  Bus=01 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2020 ProdID=4000 Rev=03.00
S:  Manufacturer=Network Connect
S:  Product=MT6225 
C:  #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option
I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 6 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
-------------------------------------------------------------------------

As you can see it has 7 interfaces...
Ifs: 2,3,4,5 are related to HSPA modem functions. We
can obtain this info also by looking to Windows verbose
description of the interfaces and is taken from the
windows driver pack for the dongle:
----------------------------------------------
MI_00 Network Connect Mobile Broadband Device
MI_01 Network Connect Mobile Broadband Device 
MI_02 Network Connect HSPA Plus Modem
MI_03 Network Connect HSPA Plus Application Interface
MI_04 Network Connect HSPA Plus Speech Port
MI_05 Network Connect HSPA Plus Debug Port
MI_06 USB Mass Storage Device
------------------------------

After talking about this dongle with usb_modeswitch
developers seems all these interfaces having Class
"ff" (vendor defined) has to be proper bound exactly
by "option" module. So I edited "opition.c" source as
follow:
----------------------------------------------
$ grep OLICARD300 drivers/usb/serial/option.c
        { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) },  /* OLICARD300 - 
MT6225 */
----------------------------------------------------------------------------------------

Hope the last line will not be cutted by your mail
client due to its leinght...

Anyway I tested this new version of option module
and seems to work properly: when I plug the dongle
in usb_modeswitch changes product id from "0002" to
"4000".
Then option module binds right interfaces only, letting
cdc_mbim and usb-storage manage theirs properly.

I've also created a patch as follows:
-------------------------------------
$ diff -up linux/drivers/usb/serial/option.c{.orig,} > \
                     olivetti-olicard300-2020_4000.patch

$ cat olivetti-olicard300-2020_4000.patch 
--- linux/drivers/usb/serial/option.c.orig      2015-06-05 00:27:28.000000000 
+0200
+++ linux/drivers/usb/serial/option.c   2015-06-05 00:37:08.522933592 +0200
@@ -1678,6 +1678,7 @@ static const struct usb_device_id option
                .driver_info = (kernel_ulong_t)&net_intf6_blacklist },
        { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500),
                .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+       { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) },  /* OLICARD300 - 
MT6225 */
        { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 
450 1xEVDO modem */
        { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 
SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-
B3730 LTE USB modem.*/
        { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
-----------------------------------------------------------

I'll attach it to this message, hope it is a good
choice..

Any comments are greatly appreciated, it's my first
patch request! :)
Bye.
--- linux/drivers/usb/serial/option.c.orig	2015-06-05 00:27:28.000000000 +0200
+++ linux/drivers/usb/serial/option.c	2015-06-05 00:37:08.522933592 +0200
@@ -1678,6 +1678,7 @@ static const struct usb_device_id option
 		.driver_info = (kernel_ulong_t)&net_intf6_blacklist },
 	{ USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500),
 		.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
+	{ USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) },  /* OLICARD300 - MT6225 */
 	{ USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
 	{ USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
 	{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },

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

  Powered by Linux