diff mbox series

USB: serial: option: add Quectel EM05G module support with product ID 0x030e

Message ID AM0PR04MB576480684AA0896B32D32975973FA@AM0PR04MB5764.eurprd04.prod.outlook.com
State New
Headers show
Series USB: serial: option: add Quectel EM05G module support with product ID 0x030e | expand

Commit Message

Martin Kohn July 21, 2023, 6:26 p.m. UTC
Add Quectel EM05G with product ID 0x030e

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  8 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=030e Rev= 3.18
S:  Manufacturer=Quectel
S:  Product=Quectel EM05-G
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms


Signed-off-by: Martin Kohn <m.kohn@welotec.com>
---
 drivers/usb/serial/option.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Martin Kohn July 24, 2023, 9:24 a.m. UTC | #1
Hello Lars,

a little background: We are just a company that uses the Quectel modems in our products. So far, I was not able to get more information from Quectel apart from
that it is the same module with a different product ID. Unfortunately, they will stick to the new product ID. 

So, my approach was to clone to entry for EM05-G with the old id. With these changes it is working.

But you are right. I removed RSVP(6) option entirely and it also works fine. 
I currently trying to get on hold of a module with the old product ID (might be difficult), because I think the driver for the old revision might then also have the same issue. 

Please provide any feedback you can, it would be greatly appreciated, our customers are eager to have the modem working in Linux again. 

Greetings,
Martin Kohn

-----Original Message-----
From: Lars Melin <larsm17@gmail.com> 
Sent: Saturday, July 22, 2023 2:32 AM
To: Martin Kohn <m.kohn@welotec.com>; linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB: serial: option: add Quectel EM05G module support with product ID 0x030e

On 7/22/2023 1:26, Martin Kohn wrote:
> Add Quectel EM05G with product ID 0x030e
> 
> T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  8 Spd=480  MxCh= 0
> D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
> P:  Vendor=2c7c ProdID=030e Rev= 3.18
> S:  Manufacturer=Quectel
> S:  Product=Quectel EM05-G
> C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
> I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
> E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
> E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
> E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
> E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
> E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
> E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
> E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
> E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> 
> 
> Signed-off-by: Martin Kohn <m.kohn@welotec.com>
> ---
>   drivers/usb/serial/option.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c 
> index 288a96a74266..cbe35c3db45a 100644
> --- a/drivers/usb/serial/option.c
> +++ b/drivers/usb/serial/option.c
> @@ -256,6 +256,7 @@ static void option_instat_callback(struct urb *urb);
>   #define QUECTEL_PRODUCT_BG96			0x0296
>   #define QUECTEL_PRODUCT_EP06			0x0306
>   #define QUECTEL_PRODUCT_EM05G			0x030a
> +#define QUECTEL_PRODUCT_EM05GV2			0x030e
>   #define QUECTEL_PRODUCT_EM060K			0x030b
>   #define QUECTEL_PRODUCT_EM05G_CS		0x030c
>   #define QUECTEL_PRODUCT_EM05CN_SG		0x0310
> @@ -1186,6 +1187,8 @@ static const struct usb_device_id option_ids[] = {
>   	  .driver_info = RSVD(6) | ZLP },
>   	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
>   	  .driver_info = RSVD(6) | ZLP },
> +	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05GV2, 0xff),
> +	  .driver_info = RSVD(6) | ZLP },
>   	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_CS, 0xff),
>   	  .driver_info = RSVD(6) | ZLP },
>   	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, 
> QUECTEL_PRODUCT_EM05G_GR, 0xff),


That doesn't look right to me for many reasons, one of them being that you let the option driver bind to the qmi net interface.
You have also reserved interface 6 but there is no interface with that number in EM05GV2.

Thanks
Lars
Lars Melin July 25, 2023, 4:42 a.m. UTC | #2
On 7/24/2023 16:24, Martin Kohn wrote:
> Hello Lars,
> 
> a little background: We are just a company that uses the Quectel modems in our products. So far, I was not able to get more information from Quectel apart from
> that it is the same module with a different product ID. Unfortunately, they will stick to the new product ID.
>
Yes it is the same module but with a different interface layout so you 
can not just copy and paste the option driver entry for the old device.

> So, my approach was to clone to entry for EM05-G with the old id. With these changes it is working.
> 
It does work as ppp dialup modem which limits its bandwidth to 30-50Mbps 
(host dependent) but this is a LTE CAT4 device which is able to transfer 
150Mbps down and 50Mbs up, they always have some kind of direct net 
interface.
On the EM05Gv2 that is interface #4 which should be reserved in the 
option driver and added in the qmi_wwan driver.
The older EM05G  had qmi_wwan on interface #6 which is why that 
interface was reserved in the option driver.
If you let the option driver bind to the net interface then the net 
driver can not bind to that interface, that's why the net interface must 
be declared as reserved (RSVD) in the option driver.

> But you are right. I removed RSVP(6) option entirely and it also works fine.
> I currently trying to get on hold of a module with the old product ID (might be difficult), because I think the driver for the old revision might then also have the same issue.
> 
> Please provide any feedback you can, it would be greatly appreciated, our customers are eager to have the modem working in Linux again.
>
Any changes from your initial patch should have a revision number in the 
email header and there should be an explanation in the email body below 
the tear line what has changed from revision to revision. Since you did 
not revision your previous patches then your next attempt should be a v2 
patch.

> Greetings,
> Martin Kohn
diff mbox series

Patch

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 288a96a74266..cbe35c3db45a 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -256,6 +256,7 @@  static void option_instat_callback(struct urb *urb);
 #define QUECTEL_PRODUCT_BG96			0x0296
 #define QUECTEL_PRODUCT_EP06			0x0306
 #define QUECTEL_PRODUCT_EM05G			0x030a
+#define QUECTEL_PRODUCT_EM05GV2			0x030e
 #define QUECTEL_PRODUCT_EM060K			0x030b
 #define QUECTEL_PRODUCT_EM05G_CS		0x030c
 #define QUECTEL_PRODUCT_EM05CN_SG		0x0310
@@ -1186,6 +1187,8 @@  static const struct usb_device_id option_ids[] = {
 	  .driver_info = RSVD(6) | ZLP },
 	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
 	  .driver_info = RSVD(6) | ZLP },
+	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05GV2, 0xff),
+	  .driver_info = RSVD(6) | ZLP },
 	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_CS, 0xff),
 	  .driver_info = RSVD(6) | ZLP },
 	{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_GR, 0xff),