diff mbox series

USB: serial: option: add Fibocom FM350-GL

Message ID 20240626133223.2316555-1-bjorn@mork.no (mailing list archive)
State Accepted
Commit 2604e08ff251dba330e16b65e80074c9c540aad7
Headers show
Series USB: serial: option: add Fibocom FM350-GL | expand

Commit Message

Bjørn Mork June 26, 2024, 1:32 p.m. UTC
FM350-GL is 5G Sub-6 WWAN module which uses M.2 form factor interface.
It is based on Mediatek's MTK T700 CPU. The module supports PCIe Gen3
x1 and USB 2.0 and 3.0 interfaces.

The manufacturer states that USB is "for debug" but it has been
confirmed to be fully functional, except for modem-control requests on
some of the interfaces.

USB device composition is controlled by AT+GTUSBMODE=<mode> command.
Two values are currently supported for the <mode>:

40: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB
41: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB+AP(LOG)+AP(META)(default value)

Mode 40 corresponds to:

T:  Bus=03 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 22 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0e8d ProdID=7126 Rev= 0.01
S:  Manufacturer=Fibocom Wireless Inc.
S:  Product=FM350-GL
C:* #Ifs= 8 Cfg#= 1 Atr=a0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host
E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=125us
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Mode 41 corresponds to:

T:  Bus=03 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  7 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0e8d ProdID=7127 Rev= 0.01
S:  Manufacturer=Fibocom Wireless Inc.
S:  Product=FM350-GL
C:* #Ifs=10 Cfg#= 1 Atr=a0 MxPwr=500mA
A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host
E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=125us
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=8a(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Cc: stable@vger.kernel.org
Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 drivers/usb/serial/option.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Johan Hovold June 27, 2024, 7:35 a.m. UTC | #1
On Wed, Jun 26, 2024 at 03:32:23PM +0200, Bjørn Mork wrote:
> FM350-GL is 5G Sub-6 WWAN module which uses M.2 form factor interface.
> It is based on Mediatek's MTK T700 CPU. The module supports PCIe Gen3
> x1 and USB 2.0 and 3.0 interfaces.
> 
> The manufacturer states that USB is "for debug" but it has been
> confirmed to be fully functional, except for modem-control requests on
> some of the interfaces.
> 
> USB device composition is controlled by AT+GTUSBMODE=<mode> command.
> Two values are currently supported for the <mode>:
> 
> 40: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB
> 41: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB+AP(LOG)+AP(META)(default value)

The order here does not seem to match the usb-devices output below (e.g.
with ADB as interface 3 and 5, respectively). 

Could you just update these two lines so we the interface mapping right?

Johan
Bjørn Mork June 27, 2024, 8:09 a.m. UTC | #2
Johan Hovold <johan@kernel.org> writes:
> On Wed, Jun 26, 2024 at 03:32:23PM +0200, Bjørn Mork wrote:
>> FM350-GL is 5G Sub-6 WWAN module which uses M.2 form factor interface.
>> It is based on Mediatek's MTK T700 CPU. The module supports PCIe Gen3
>> x1 and USB 2.0 and 3.0 interfaces.
>> 
>> The manufacturer states that USB is "for debug" but it has been
>> confirmed to be fully functional, except for modem-control requests on
>> some of the interfaces.
>> 
>> USB device composition is controlled by AT+GTUSBMODE=<mode> command.
>> Two values are currently supported for the <mode>:
>> 
>> 40: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB
>> 41: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB+AP(LOG)+AP(META)(default value)
>
> The order here does not seem to match the usb-devices output below (e.g.
> with ADB as interface 3 and 5, respectively). 
>
> Could you just update these two lines so we the interface mapping right?

Thanks, I didn't notice that.

This part was copied from the Fibocom AT+GTUSBMODE documentation and
seems to list supported functions independently of the resulting USB
interface order.

I'm afraid I can't verify the actual order since I don't have access to
this module myself, and there is no way to tell the AT, GNSS, META,
DEBUG, NPT and LOG functons from eacohother based on USB descriptors.

The best I can do is dropping these two lines. Is that better?



Bjørn
Johan Hovold June 27, 2024, 8:21 a.m. UTC | #3
On Thu, Jun 27, 2024 at 10:09:31AM +0200, Bjørn Mork wrote:
> Johan Hovold <johan@kernel.org> writes:
> > On Wed, Jun 26, 2024 at 03:32:23PM +0200, Bjørn Mork wrote:
> >> FM350-GL is 5G Sub-6 WWAN module which uses M.2 form factor interface.
> >> It is based on Mediatek's MTK T700 CPU. The module supports PCIe Gen3
> >> x1 and USB 2.0 and 3.0 interfaces.
> >> 
> >> The manufacturer states that USB is "for debug" but it has been
> >> confirmed to be fully functional, except for modem-control requests on
> >> some of the interfaces.
> >> 
> >> USB device composition is controlled by AT+GTUSBMODE=<mode> command.
> >> Two values are currently supported for the <mode>:
> >> 
> >> 40: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB
> >> 41: RNDIS+AT+AP(GNSS)+META+DEBUG+NPT+ADB+AP(LOG)+AP(META)(default value)
> >
> > The order here does not seem to match the usb-devices output below (e.g.
> > with ADB as interface 3 and 5, respectively). 
> >
> > Could you just update these two lines so we the interface mapping right?
> 
> Thanks, I didn't notice that.
> 
> This part was copied from the Fibocom AT+GTUSBMODE documentation and
> seems to list supported functions independently of the resulting USB
> interface order.
> 
> I'm afraid I can't verify the actual order since I don't have access to
> this module myself, and there is no way to tell the AT, GNSS, META,
> DEBUG, NPT and LOG functons from eacohother based on USB descriptors.
> 
> The best I can do is dropping these two lines. Is that better?

No, I'll just amend the commit message to clarify that the order is
unspecified. Thanks.

Johan
diff mbox series

Patch

diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 8a5846d4adf6..599439bddfb7 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2224,6 +2224,10 @@  static const struct usb_device_id option_ids[] = {
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7106_2COM, 0x02, 0x02, 0x01) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
 	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x7126, 0xff, 0x00, 0x00),
+	  .driver_info = NCTRL(2) },
+	{ USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, 0x7127, 0xff, 0x00, 0x00),
+	  .driver_info = NCTRL(2) | NCTRL(3) | NCTRL(4) },
 	{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
 	{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200),
 	  .driver_info = RSVD(1) | RSVD(4) },