2024-03-06 02:14:03

by Bolan Wang(Bolan)

[permalink] [raw]
Subject: [PATCH] USB: serial: option: add Fibocom FM135-GL variants

Update the USB serial option driver support for the Fibocom
FM135-GL
LTE modules as there are actually several different variants.
- VID:PID 2cb7:01a1, FM135-GL are laptop M.2 cards (with
MBIM interfaces for /Linux/Chrome OS)
- VID:PID 2cb7:0115, FM135-GL for laptop debug M.2 cards(with adb
interface for /Linux/Chrome OS)

0x01a1: mbim
0x0115: mbim, diag, at, pipe, adb

Signed-off-by: bolan wang <[email protected]>
---
drivers/usb/serial/option.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 2ae124c49d44..0981b8d8020c 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2267,7 +2267,9 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
{ USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */
+ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0115, 0xff) }, /* Fibocom FM135 (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
+ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a1, 0xff) }, /* Fibocom FM135-GL (MBIM mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a3, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */
--
2.34.1



2024-03-06 05:56:03

by Lars Melin

[permalink] [raw]
Subject: Re: [PATCH] USB: serial: option: add Fibocom FM135-GL variants

On 2024-03-06 09:13, bolan wang wrote:
> Update the USB serial option driver support for the Fibocom
> FM135-GL
> LTE modules as there are actually several different variants.
> - VID:PID 2cb7:01a1, FM135-GL are laptop M.2 cards (with
> MBIM interfaces for /Linux/Chrome OS)
> - VID:PID 2cb7:0115, FM135-GL for laptop debug M.2 cards(with adb
> interface for /Linux/Chrome OS)
>
> 0x01a1: mbim
> 0x0115: mbim, diag, at, pipe, adb
>
> Signed-off-by: bolan wang <[email protected]>
> ---
> drivers/usb/serial/option.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
> index 2ae124c49d44..0981b8d8020c 100644
> --- a/drivers/usb/serial/option.c
> +++ b/drivers/usb/serial/option.c
> @@ -2267,7 +2267,9 @@ static const struct usb_device_id option_ids[] = {
> { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
> { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
> { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */
> + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0115, 0xff) }, /* Fibocom FM135 (laptop MBIM) */
> { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
> + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a1, 0xff) }, /* Fibocom FM135-GL (MBIM mode) */
> { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
> { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a3, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
> { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */

If the device with pid 0x01a1 only has an mbim interface as you have
indicated then why do you add it to the option serial driver?

thanks
Lars

2024-03-06 06:18:48

by Bolan Wang(Bolan)

[permalink] [raw]
Subject: Re: [PATCH] USB: serial: option: add Fibocom FM135-GL variants

> If the device with pid 0x01a1 only has an mbim interface as you have indicated then why do you add it to the option serial driver?

Hi Lars:
The pid 0x01a1 may include at, diag ports in different usb modes. Currently, only has the mbim interface.

thanks
bolan

2024-03-06 06:40:16

by Lars Melin

[permalink] [raw]
Subject: Re: [PATCH] USB: serial: option: add Fibocom FM135-GL variants

On 2024-03-06 13:18, Bolan Wang(Bolan) wrote:
>> If the device with pid 0x01a1 only has an mbim interface as you have indicated then why do you add it to the option serial driver?
>
> Hi Lars:
> The pid 0x01a1 may include at, diag ports in different usb modes. Currently, only has the mbim interface.
>
> thanks
> bolan

Hi Bolan,
so you already know that other versions of the card will have the pid
0x01a1 and the serial interfaces will be of class ff but you don't
know what those interfaces will be used for?
You shall only add driver support for what you know today and not for
something that might or might not be implemented in the future.

For the device with pid 0x0115 you have listed an adb interface and adb
interfaces should not be in the option driver.

thanks
Lars



2024-03-06 08:30:14

by Lars Melin

[permalink] [raw]
Subject: Re: [PATCH] USB: serial: option: add Fibocom FM135-GL variants

On 2024-03-06 14:41, Bolan Wang(Bolan) wrote:
>> Hi Bolan,
>> so you already know that other versions of the card will have the pid
>> 0x01a1 and the serial interfaces will be of class ff but you don't know what those interfaces will be used for?
>> You shall only add driver support for what you know today and not for something that might or might not be implemented in the future.
>
>> For the device with pid 0x0115 you have listed an adb interface and adb interfaces should not be in the option driver.
>
> Hi Lars:
>
> Ok, I will remove 0x01a1 from option serial driver. And the adb listed in pid 0x0115 will also be removed.
> Actually adb interface info with pid 0x0115 is: Class_ff&SubClass_42&Prot_01, the option driver will not bind it?
> I will resubmit a new patch, please help review and abandon this.
>
> thanks
> bolan
>
>

The option driver will bind because you have matched only on Class ff
"{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a1, 0xff) }"
There are other macros that you could possibly use but I can't tell you
which since you have not shown an usb-device listing for the device.
You can also blacklist an interface (RSV). The option driver source is
full of examples of macro use and combinations.

thanks
Lars

2024-03-06 10:07:25

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH] USB: serial: option: add Fibocom FM135-GL variants

On Wed, Mar 06, 2024 at 05:35:33PM +0800, bolan wang wrote:
> Update the USB serial option driver support for the Fibocom
> FM135-GL LTE modules.
> - VID:PID 2cb7:0115, FM135-GL for laptop debug M.2 cards(with MBIM
> interface for /Linux/Chrome OS)
>
> 0x0115: mbim, diag, at, pipe

Please include the output of usb-devices for this device here in the
commit message.

> Signed-off-by: bolan wang <[email protected]>
> ---

Also, this is v3 of this patch and this needs to be indicated in the
patch summary ("PATCH v3") and by including a short changelog here after
the '---' line.

Please fix in a v4.

Johan