回复: [PATCH] USB: serial: option: add Quectel EM05-G modem

From: 谭 永林
Date: Mon Jun 20 2022 - 21:35:39 EST


Dear Johan,

The interface 6 is fixed to QMI WWAN in EM05-G modem. If I don't reserve it, it will matches the option driver, it's not correct.

I'll change the comments.

-----邮件原件-----
发件人: Johan Hovold <johan@xxxxxxxxxx>
发送时间: 2022年6月20日 20:57
收件人: Yonglin Tan <yonglin.tan@xxxxxxxxxxx>
抄送: linux-usb@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
主题: Re: [PATCH] USB: serial: option: add Quectel EM05-G modem

On Mon, Jun 20, 2022 at 08:16:53PM +0800, Yonglin Tan wrote:
> Add a device-id entry for the Quectel EM05-G module.
>
> T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0
> D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
> P: Vendor=2c7c ProdID=030a Rev= 3.18
> S: Manufacturer=Quectel
> S: Product=Quectel EM05-G
> C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
> A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
> I:* If#= 3 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#= 4 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#= 5 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#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
> E: Ad=89(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
> I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
> I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
> E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Are there any further configurations for this device that you need to consider?

You reserve interface 6 below which doesn't even exist in the above configuration.

Can you say something more about what the individual interfaces are used for, for example, as was done here:

https://lore.kernel.org/all/TYZPR06MB4270D3394B8E3E0301738F6B86D09@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/

> Signed-off-by: Yonglin Tan <yonglin.tan@xxxxxxxxxxx>
> ---
> drivers/usb/serial/option.c | 2 ++
> 1 file changed, 2 insertions(+)
> mode change 100644 => 100755 drivers/usb/serial/option.c
>
> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
> old mode 100644 new mode 100755 index ed1e50d..05fc322
> --- a/drivers/usb/serial/option.c
> +++ b/drivers/usb/serial/option.c
> @@ -1147,6 +1147,8 @@ static const struct usb_device_id option_ids[] = {
> .driver_info = ZLP },
> { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
> { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID,
> QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
> + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, 0x030a, 0xff),
> + .driver_info = RSVD(6) | ZLP }, /* EM05-G */

As mentioned above RSVD(6) looks wrong here.

Please move the comment to the first line of the entry, and move the entry to the other Quectel entries using numerical PIDs (i.e. before EM160R-GL).

> { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
> { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },

Johan