Coder Social home page Coder Social logo

xmm7360-usb-modeswitch's Introduction

No longer maintained

Now that I am releasing a native PCI driver, I am no longer maintaining this project.

What

This repo currently contains a small tool for flipping an M.2 XMM7360 modem, like the Fibocom L850-GL, from PCIe into USB mode. This allows you to talk to it with mbimcli, ModemManager etc.

This only works on some machines: specifically, those that have USB lines routed to the M.2 slot, and enabled. Quite a lot of L850-GL laptops do not have this (eg. Thinkpad T495), so this may not work.

Dependencies (package names for ubuntu)

Usage

You can build and install it like this:

git clone https://github.com/mkottman/acpi_call.git
cd acpi_call
make && sudo make install

Then, you can simply run this script:

sudo ./xmm2usb

After 5-10 seconds, your new USB device should appear.

MBIM Switch

My modem came up initially as a 3x ACM + 3x NCM USB device. To switch to MBIM mode I ran:

sudo screen /dev/ttyACM0

and issued

AT+GTUSBMODE?
AT+GTUSBMODE=7
AT+CFUN=15

This change is permanent; you do not need to do this again after the first time.

Take note of the USB mode reported after the first command in case you want to put it back later...!

(There is an old L8 family AT command doc floating around saying that mode 2 is MBIM. It does not apply to this modem.)

How does it work?

According to the modem docs, the chipset tries talking via PCIe first, then goes to USB if it doesn't succeed. Luckily for us, we have two moving parts here we can use: we can talk to the upstream PCI Express port to disable the link, and then we can use ACPI to hit the modem's reset line so that it starts looking anew. That's all this script does.

The modem seems to happily stay in USB mode across a suspend/resume, but the PCIe link needs to be disabled on each resume. It'd be cute to have a PCI stub driver to do this, I suppose.

"FCC Lock"

My modem, in my Thinkpad T490, initially seems to be stuck in flight mode (AT+CFUN? returns +CFUN: 4,0 and can't be changed).

This turns out to be a mechanism the authors call "FCC Lock". This prevents the radio from being enabled until it is unlocked; this is the purpose of the ModemAuthenticator.exe which comes with the driver in Windows. This has the effect of tying the modem to particular machines: the unlock key is stored in the system's SMBIOS.

This looks very much like it has been done for regulatory purposes: these days you have to test the software, radio, and antennas together in the final product to meet regulatory requirements. You need a lot of equipment, time, and people who know what they are doing, so this is expensive. Also, porting a PCI driver for this thing would suck, because it's actually quite complicated to talk to. Thus Lenovo only tested the Windows configuration, and possibly implemented this locking mechanism to maintain compliance.

It's also possible, again as a regulatory matter, that these systems actually use dynamic power reduction. This is a feature where, when human body parts are detected near the antennas, the output power is reduced. This allows quite a powerful radio to be used without exceeding the regulatory limits for irradiating people. The modem certainly seems to support such features, though I am yet to see evidence that they are in use here. Nonetheless, this is good reason for caution at this point: bypassing this mechanism may cause body SAR to exceed regulatory limits.

Regulation is a good thing here - this is why we so rarely have problems with interference, and tries to make sure we don't get cooked. Please consider this carefully before you decide to unlock your modem.

I carefully reverse engineered the unlock challenge/response sequence before realising that you can permanently bypass it with just a couple of AT commands.

This should not brick your device, but I make no guarantees. Here be dragons!

Note: as of newer firmware version 18500.5001.00.02.24.09, this appears to cause a reboot loop of the modem. See this issue. I do not recommend performing this at present unless you understand the implications - wait a couple of months for a PCI driver.

You can unlock the modem by issuing

at@nvm:fix_cat_fcclock.fcclock_mode=0

(The default mode, at least on my modem, is 2.)

This will work until the modem is next power cycled or reset. To make the change permanent, issue:

at@store_nvm(fix_cat_fcclock)

The modem will then power up with radio enabled in future.

PCI

I did start doing some reverse engineering and writing a PCI driver, just for fun.

I aim to release something early in 2020 which should be usable for most.

Device status

Tested and working on:

  • ThinkPad T490, 20N2CTO1WW
  • ThinkPad T490s, 20NXCTO1WW
  • ThinkPad X1 Yoga 4th, 20QFCTO1WW
  • Thinkpad P43s, 20RHCTO1WW

Reports of not working on:

  • ThinkPad P52
  • ThinkPad P52s
  • Thinkpad P53
  • ThinkPad T480, 20L5CTO1WW
  • Thinkpad T495

xmm7360-usb-modeswitch's People

Contributors

abrasive avatar gottox avatar heysora avatar leegarrett avatar mbernasocchi avatar rush avatar tgxn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xmm7360-usb-modeswitch's Issues

working fine on X1 Carbon Gen6

just a little update for README.md:

The script worked fine on a Lenovo ThinkPad X1 Carbon 6th Generation (20KH006JGE) running Ubuntu 19.10.
(comes with acpi_call module preinstalled, so no other dependencies required)

Thank you very much for the good work!

What are the problems with this "fix"

Hi,

this might be the wrong channel for this question but i am planning on buying a X1C7 with WAN and i read that this "fix" is quite promising…

I am curious what potential problems that could occur. I read that i could brick my new laptop? Is that right? Why and how? Is it likely?
Thanks in advanced!

Cheers!

Kick the modem into USB mode without ACPI

I used the ACPI reset on my laptop to get the modem to reboot itself and come up in USB mode. That probably won't work on all machines, because ACPI.

Writing a full PCI driver is impossible, because the device doesn't accept MBIM commands over PCI; instead they seem to go through a complicated translation layer into a much more compact, ASN.1 BER-ish RPC format. Very unpleasant.
But we do understand enough to send AT commands, which is all we need to enable the USB interface.

So one could build a tool that brings up the PCI interface and sends those commands.

Revert back to PCI mode

Hi,

how is it possible to revert back to PCI mode?
Is the modem working within Windows in USB mode?

Kind Regards

Using gammu

I allow my self to ask to this community if you are able to send SMS from command line.

I am on Debian 10 and I am using mmcli v1.10.0

I have modem manager gui installed and it can send and receive SMS using my Fibocom L850GL wwan card using a GUI.

I want to send SMS from command line, I have tried to use mmcli, but also gammu, both with failure.

I have this when sending message:

dka@dka:[~]: mmcli -m 0 --messaging-create-sms="text='Hello world',number='+336********"
Successfully created new SMS: /org/freedesktop/ModemManager1/SMS/0
dka@dka:[~]: mmcli -s 0 --send -v
[28 Nov 2019, 03:46:12] [Debug] Assuming '0' is the SMS index
[28 Nov 2019, 03:46:12] [Debug] ModemManager process found at ':1.8'
[28 Nov 2019, 03:46:12] [Debug] Sms found at '/org/freedesktop/ModemManager1/SMS/0'

error: couldn't send the SMS: 'GDBus.Error:org.freedesktop.libmbim.Error.Status.Failure: Couldn't send SMS part: Failure'

I have been trying to communicate with the card but I keep having timeout.

According to this comment

The Failure message is being returned by the modem itself, and don't really know why that happens I'm afraid.
You say that sending SMS succeeds when using modemmanager-gui, but that program should really be using the same API as mmcli, so no real idea either. Could you maybe retry to grab MM debug logs (NM logs not needed) when sending a SMS through modemmanager-gui?

I just did with mmcli -G DEBUG as stated in mmcli documentation, this is the log:


Dec  1 16:33:19 dka ModemManager[843]: [/dev/cdc-wdm0] Received message...#012>>>>>> RAW:#012>>>>>>   length = 52#012>>>>>>   data   = 07:00:00:80:34:00:00:00:00:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:05:00:00:00:08:00:00:00:02:00:00:00:01:00:00:00
Dec  1 16:33:19 dka ModemManager[843]: [/dev/cdc-wdm0] Received message (translated)...#012>>>>>> Header:#012>>>>>>   length      = 52#012>>>>>>   type        = indicate-status (0x80000007)#012>>>>>>   transaction = 0#012>>>>>> Fragment header:#012>>>>>>   total   = 1#012>>>>>>   current = 0#012>>>>>> Contents:#012>>>>>>   service = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)#012>>>>>>   cid     = 'message-store-status' (0x00000005)#012>>>>>> Fields:#012>>>>>>   Flag = 'new-message'#012>>>>>>   MessageIndex = '1'
Dec  1 16:33:19 dka ModemManager[843]: <debug> Received notification (service 'sms', command 'message-store-status')
Dec  1 16:33:19 dka ModemManager[843]: <debug> Received SMS store status update: 'new-message'
Dec  1 16:33:19 dka ModemManager[843]: <debug> Reading new SMS at index '1'
Dec  1 16:33:19 dka ModemManager[843]: [/dev/cdc-wdm0] Sent message...#012<<<<<< RAW:#012<<<<<<   length = 60#012<<<<<<   data   = 03:00:00:00:3C:00:00:00:32:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:02:00:00:00:00:00:00:00:0C:00:00:00:00:00:00:00:01:00:00:00:01:00:00:00
Dec  1 16:33:19 dka ModemManager[843]: [/dev/cdc-wdm0] Sent message (translated)...#012<<<<<< Header:#012<<<<<<   length      = 60#012<<<<<<   type        = command (0x00000003)#012<<<<<<   transaction = 50#012<<<<<< Fragment header:#012<<<<<<   total   = 1#012<<<<<<   current = 0#012<<<<<< Contents:#012<<<<<<   service = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)#012<<<<<<   cid     = 'read' (0x00000002)#012<<<<<<   type    = 'query' (0x00000000)#012<<<<<< Fields:#012<<<<<<   Format = 'pdu'#012<<<<<<   Flag = 'index'#012<<<<<<   MessageIndex = '1'
Dec  1 16:33:19 dka ModemManager[843]: [/dev/cdc-wdm0] Received message...#012>>>>>> RAW:#012>>>>>>   length = 112#012>>>>>>   data   = 03:00:00:80:70:00:00:00:32:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:02:00:00:00:00:00:00:00:40:00:00:00:00:00:00:00:01:00:00:00:10:00:00:00:30:00:00:00:01:00:00:00:00:00:00:00:10:00:00:00:20:00:00:00:07:91:33:96:05:00:56:F4:20:0B:91:33:96:85:62:87:F9:00:00:91:21:10:61:33:81:40:05:F4:F2:9C:2E:03
Dec  1 16:33:19 dka ModemManager[843]: [/dev/cdc-wdm0] Received message (translated)...#012>>>>>> Header:#012>>>>>>   length      = 112#012>>>>>>   type        = command-done (0x80000003)#012>>>>>>   transaction = 50#012>>>>>> Fragment header:#012>>>>>>   total   = 1#012>>>>>>   current = 0#012>>>>>> Contents:#012>>>>>>   status error = 'None' (0x00000000)#012>>>>>>   service      = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)#012>>>>>>   cid          = 'read' (0x00000002)#012>>>>>> Fields:#012>>>>>>   Format = '0'#012>>>>>>   MessagesCount = '1'#012>>>>>>   PduMessages = '{#012>>>>>>     [0] = {#012>>>>>>           MessageIndex = '1'#012>>>>>>           MessageStatus = '0'#012>>>>>>           PduData = '07:91:33:96:05:00:56:f4:20:0b:91:33:96:85:62:87:f9:00:00:91:21:10:61:33:81:40:05:f4:f2:9c:2e:03'#012>>>>>>     },#012>>>>>>   }'#012>>>>>>   CdmaMessages = 
Dec  1 16:33:19 dka ModemManager[843]: <debug> Parsing PDU (1)...
Dec  1 16:33:19 dka ModemManager[843]: <debug>   SMSC address parsed: '+3369500****'
Dec  1 16:33:19 dka ModemManager[843]: <debug>   Deliver type PDU detected
Dec  1 16:33:19 dka ModemManager[843]: <debug>   Number parsed: '+336********'
Dec  1 16:33:19 dka ModemManager[843]: <debug>   PID: 0
Dec  1 16:33:19 dka ModemManager[843]: <debug>   user data encoding is GSM7
Dec  1 16:33:19 dka ModemManager[843]: <debug>   user data length: 5 elements
Dec  1 16:33:19 dka ModemManager[843]: <debug>   user data length: 5 bytes
Dec  1 16:33:19 dka ModemManager[843]: <debug> Decoding SMS text with '5' elements
Dec  1 16:33:19 dka ModemManager[843]: <debug> Converting SMS part text from GSM-7 to UTF-8...
Dec  1 16:33:19 dka ModemManager[843]: <debug>    Got UTF-8 text: 'test2'
Dec  1 16:33:19 dka ModemManager[843]: <debug> Correctly parsed PDU (1)
Dec  1 16:33:19 dka ModemManager[843]: <debug> SMS part at 'mt/1' is from a singlepart SMS
Dec  1 16:33:19 dka ModemManager[843]: <debug> Added received SMS at '/org/freedesktop/ModemManager1/SMS/3'



Dec  1 16:33:20 dka ModemManager[843]: <debug> (ttyACM2): <-- '<CR><LF><CR><LF>$GPGGA,153320.000,,,,,0,0,,,M,,M,,*4E<CR><LF>$GNGGA,153320.000,,,,,0,0,,,M,,M,,*50<CR><LF>$GPGSA,A,1,,,,,,,,,,,,,,,*1E<CR><LF>$GNGSA,A,1,,,,,,,,,,,,,,,,1*1D<CR><LF>$GPGSV,1,1,01,15,,,30,1*62<CR><LF>$GPRMC,153320.000,V,,,,,,,011219,,,N,V*3B<CR><LF>$GNRMC,153320.000,V,,,,,,,011219,,,N,V*25<CR><LF>$GPVTG,,T,,M,,N,,K,N*2C<CR><LF>$GNVTG,,T,,M,,N,,K,N*32<CR><LF><CR><LF><CR><LF>OK<CR><LF>'
Dec  1 16:33:20 dka ModemManager[843]: [/dev/cdc-wdm0] Sent message...#012<<<<<< RAW:#012<<<<<<   length = 56#012<<<<<<   data   = 03:00:00:00:38:00:00:00:33:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:04:00:00:00:01:00:00:00:08:00:00:00:01:00:00:00:01:00:00:00
Dec  1 16:33:20 dka ModemManager[843]: [/dev/cdc-wdm0] Sent message (translated)...#012<<<<<< Header:#012<<<<<<   length      = 56#012<<<<<<   type        = command (0x00000003)#012<<<<<<   transaction = 51#012<<<<<< Fragment header:#012<<<<<<   total   = 1#012<<<<<<   current = 0#012<<<<<< Contents:#012<<<<<<   service = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)#012<<<<<<   cid     = 'delete' (0x00000004)#012<<<<<<   type    = 'set' (0x00000001)#012<<<<<< Fields:#012<<<<<<   Flag = 'index'#012<<<<<<   MessageIndex = '1'
Dec  1 16:33:20 dka ModemManager[843]: [/dev/cdc-wdm0] Received message...#012>>>>>> RAW:#012>>>>>>   length = 48#012>>>>>>   data   = 03:00:00:80:30:00:00:00:33:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:04:00:00:00:00:00:00:00:00:00:00:00
Dec  1 16:33:20 dka ModemManager[843]: [/dev/cdc-wdm0] Received message (translated)...#012>>>>>> Header:#012>>>>>>   length      = 48#012>>>>>>   type        = command-done (0x80000003)#012>>>>>>   transaction = 51#012>>>>>> Fragment header:#012>>>>>>   total   = 1#012>>>>>>   current = 0#012>>>>>> Contents:#012>>>>>>   status error = 'None' (0x00000000)#012>>>>>>   service      = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)#012>>>>>>   cid          = 'delete' (0x00000004)
Dec  1 16:33:20 dka ModemManager[843]: <debug> Deleted SMS at '/org/freedesktop/ModemManager1/SMS/3'
Dec  1 16:33:21 dka ModemManager[843]: <debug> (ttyACM2): <-- '<CR><LF><CR><LF>$GPGGA,153321.000,,,,,0,0,,,M,,M,,*4F<CR><LF>$GNGGA,153321.000,,,,,0,0,,,M,,M,,*51<CR><LF>$GPGSA,A,1,,,,,,,,,,,,,,,*1E<CR><LF>$GNGSA,A,1,,,,,,,,,,,,,,,,1*1D<CR><LF>$GPGSV,1,1,01,15,,,30,1*62<CR><LF>$GPRMC,153321.000,V,,,,,,,011219,,,N,V*3A<CR><LF>$GNRMC,153321.000,V,,,,,,,011219,,,N,V*24<CR><LF>$GPVTG,,T,,M,,N,,K,N*2C<CR><LF>$GNVTG,,T,,M,,N,,K,N*32<CR><LF><CR><LF><CR><LF>OK<CR><LF>'
Dec  1 16:33:22 dka ModemManager[843]: <debug> (ttyACM2): <-- '<CR><LF><CR><LF>$GPGGA,153322.000,,,,,0,0,,,M,,M,,*4C<CR><LF>$GNGGA,153322.000,,,,,0,0,,,M,,M,,*52<CR><LF>$GPGSA,A,1,,,,,,,,,,,,,,,*1E<CR><LF>$GNGSA,A,1,,,,,,,,,,,,,,,,1*1D<CR><LF>$GPGSV,1,1,01,15,,,31,1*63<CR><LF>$GPRMC,153322.000,V,,,,,,,011219,,,N,V*39<CR><LF>$GNRMC,153322.000,V,,,,,,,011219,,,N,V*27<CR><LF>$GPVTG,,T,,M,,N,,K,N*2C<CR><LF>$GNVTG,,T,,M,,N,,K,N*32<CR><LF><CR><LF><CR><LF>OK<CR><LF>'
Dec  1 16:33:23 dka ModemManager[843]: <debug> (ttyACM2): <-- '<CR><LF><CR><LF>$GPGGA,15332

It says : that the command is message-store-status, how can I see the mmcli command?

Related issue;

How to build on kernel 5

Hi and merry xmas!
In order to get the microphone and the finger print reader, I needed to upgrade the kernel of my Debian Buster to kernel v5 or over.

After installing the new kernel, I noticed that my mmbim device was not showing up anymore in modem-manager-gui.

I wanted to rebuild the xmm7360 driver, but the make command now fail:

dka@dka:[~/workspace/github.com/juhovh/xmm7360_usb (master)]: make
make -C /lib/modules/5.3.0-0.bpo.2-amd64/build M=/home/dka/workspace/github.com/juhovh/xmm7360_usb modules
make[1]: *** /lib/modules/5.3.0-0.bpo.2-amd64/build: No such file or directory. Stop.
make: *** [Makefile:8: default] Error 2

It seems that /lib/modules/4.19.0-6-amd64/build is providing tooling from linux-kbuild-4.19:

dka@dka:[/lib/modules/4.19.0-6-amd64/build]: ll
total 1552
lrwxrwxrwx 1 root root 33 Sep 20 12:51 tools -> ../../lib/linux-kbuild-4.19/tools
lrwxrwxrwx 1 root root 35 Sep 20 12:51 scripts -> ../../lib/linux-kbuild-4.19/scripts
drwxr-xr-x 3 root root 4096 Oct 29 19:36 arch
drwxr-xr-x 4 root root 4096 Oct 29 19:36 include
lrwxrwxrwx 1 root root 42 Oct 30 18:25 Kconfig -> /lib/modules/4.19.0-6-amd64/build/Makefile
-rw-r--r-- 1 root root 1353400 Nov 11 01:30 Module.symvers
-rw-r--r-- 1 root root 306 Nov 11 01:30 Makefile
-rw-r--r-- 1 root root 243 Nov 11 01:30 .kernelvariables
-rw-r--r-- 1 root root 206361 Nov 11 01:30 .config
drwxr-xr-x 4 root root 4096 Nov 26 01:20 .

Those tool are not within /lib/modules/5.3.0-0.bpo.2-amd64/build which is not created directory.

Because the kernel v4.19 had some symlink to ../../lib/linux-kbuild-4.19/tools, I figure out that I needed to install linux-kbuild-5.3.

After installing it, I still do not have the symlink. Why? I am not able to build the driver and use the Fibocom device.

How can I fix the build environment in the new kernel? Or how can I restore the driver?

thanks for the help and best!

Offer of help in reverse-engineering the PCI driver

Dear @abrasive,

Would you please share your work reverse-engineering the PCI driver so that I can start from where you stopped?

Any test code you wrote or IDA Pro idb/i64 files would be really appreciated. Is it already published anywhere in GitHub?

In case you don't want to publish stuff, you can reach me to share privately by email (please see my GitHub profile) or through Telegram or Keybase (same nickname as my GitHub account).

Thank you!

Constant modem reboots on Thinkpad X1 Gen7 ( 20QES01M00 )

Hi,

thanks for the work!. I was able to put my modem into USB mode:

[root@arch xmm7360]# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 04f2:b67c Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 081: ID 2cb7:0007 Fibocom MBIM + 3 CDC-ACM
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

However, it is still not usable. The Modem seems to be stuck in a reboot loop. Here's what I can see in dmesg:

[Mon Dec 16 13:38:26 2019] usb 1-7: USB disconnect, device number 60
[Mon Dec 16 13:38:26 2019] cdc_mbim 1-7:1.0 wwp0s20f0u7: unregister 'cdc_mbim' usb-0000:00:14.0-7, CDC MBIM
[Mon Dec 16 13:38:26 2019] usb 1-7: new high-speed USB device number 61 using xhci_hcd
[Mon Dec 16 13:38:26 2019] usb 1-7: New USB device found, idVendor=2cb7, idProduct=0007, bcdDevice= 3.33
[Mon Dec 16 13:38:26 2019] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Mon Dec 16 13:38:26 2019] usb 1-7: Product: MBIM + 3 CDC-ACM
[Mon Dec 16 13:38:26 2019] usb 1-7: Manufacturer: Fibocom
[Mon Dec 16 13:38:26 2019] usb 1-7: SerialNumber: 004999010640000
[Mon Dec 16 13:38:26 2019] cdc_mbim 1-7:1.0: setting rx_max = 16384
[Mon Dec 16 13:38:26 2019] cdc_mbim 1-7:1.0: cdc-wdm0: USB WDM device
[Mon Dec 16 13:38:26 2019] cdc_mbim 1-7:1.0 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-7, CDC MBIM, 02:de:4b:3e:d8:34
[Mon Dec 16 13:38:26 2019] cdc_acm 1-7:1.2: ttyACM0: USB ACM device
[Mon Dec 16 13:38:26 2019] cdc_acm 1-7:1.4: ttyACM1: USB ACM device
[Mon Dec 16 13:38:26 2019] cdc_acm 1-7:1.6: ttyACM2: USB ACM device
[Mon Dec 16 13:38:27 2019] cdc_mbim 1-7:1.0 wwp0s20f0u7: renamed from wwan0
[Mon Dec 16 13:38:29 2019] usb 1-7: USB disconnect, device number 61
[Mon Dec 16 13:38:29 2019] cdc_mbim 1-7:1.0 wwp0s20f0u7: unregister 'cdc_mbim' usb-0000:00:14.0-7, CDC MBIM
[Mon Dec 16 13:38:29 2019] usb 1-7: new high-speed USB device number 62 using xhci_hcd
[Mon Dec 16 13:38:29 2019] usb 1-7: New USB device found, idVendor=2cb7, idProduct=0007, bcdDevice= 3.33
[Mon Dec 16 13:38:29 2019] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Mon Dec 16 13:38:29 2019] usb 1-7: Product: MBIM + 3 CDC-ACM
[Mon Dec 16 13:38:29 2019] usb 1-7: Manufacturer: Fibocom
[Mon Dec 16 13:38:29 2019] usb 1-7: SerialNumber: 004999010640000
[Mon Dec 16 13:38:29 2019] cdc_mbim 1-7:1.0: setting rx_max = 16384
[Mon Dec 16 13:38:30 2019] cdc_mbim 1-7:1.0: cdc-wdm0: USB WDM device
[Mon Dec 16 13:38:30 2019] cdc_mbim 1-7:1.0 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-7, CDC MBIM, 02:de:4b:3e:d8:34
[Mon Dec 16 13:38:30 2019] cdc_acm 1-7:1.2: ttyACM0: USB ACM device
[Mon Dec 16 13:38:30 2019] cdc_acm 1-7:1.4: ttyACM1: USB ACM device
[Mon Dec 16 13:38:30 2019] cdc_acm 1-7:1.6: ttyACM2: USB ACM device
[Mon Dec 16 13:38:30 2019] cdc_mbim 1-7:1.0 wwp0s20f0u7: renamed from wwan0
[Mon Dec 16 13:38:37 2019] usb 1-7: USB disconnect, device number 62

These messages repeat over and over again.

Any ideas?

Regards,

Robert

xmm7560 with usb only

Hi guys.

Is there a chance that HP based fibocom L860-GL will work under linux/windows in usb mode only with no pci using usb-to-m2 adapter?

X1 Carbon Gen 7 fail with Fibocom L850-GL 4G LTE CAT9

Dear @abrasive,

Thanks for all the work you have done here.
I am a Debian user and X1 user.

I started on X1 Carbon Gen 1 and I have ordered a X1 Carbon Gen 7 with all features including the Fibocom L850-GL 4G LTE CAT9.

I bought it on purpose and I expect to use it on Debian, after reading a few thread on lenovo forum it seems that this isn't really working. I haven't tried yet but I'd like to get your opinion since you dived into it.

Can the Fibocom L850-GL work on Debian?

Hint needed; cannot register...

Hey,

i know that this repo will no longer be developed. But i would like to get it working on my x1g7 before i try the pci driver....

You would realy make me very happy if one of you could help me get it working...

I got the modem up...

mmcli -m 0                                                                                       :(
  -----------------------------
  General  |         dbus path: /org/freedesktop/ModemManager1/Modem/0
           |         device id: 084d438dc60a2ec7c5077d6f1972556482b805e9
  -----------------------------
  Hardware |      manufacturer: Fibocom
           |             model: MBIM + 3 CDC-ACM
           | firmware revision: 18500.5001.00.01.20.75
           |      h/w revision: V1.0.4
           |         supported: gsm-umts, lte
           |           current: gsm-umts, lte
           |      equipment id: 015550001073334
  -----------------------------
  System   |            device: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-7
           |           drivers: cdc_mbim
           |            plugin: Fibocom
           |      primary port: cdc-wdm0
           |             ports: cdc-wdm0 (mbim), wwp0s20f0u7 (net)
...
-----------------------------
  Status   |    unlock retries: sim-pin2 (3)
           |             state: enabled
           |       power state: on
           |    signal quality: 0% (cached)
  -----------------------------
  Modes    |         supported: allowed: 3g, 4g; preferred: none
           |           current: allowed: 3g, 4g; preferred: none
  -----------------------------
  IP       |         supported: ipv4, ipv6, ipv4v6
  -----------------------------
  3GPP     |              imei: <IMEI>
           |     enabled locks: sim, fixed-dialing
           |      registration: idle
  -----------------------------
  SIM      |         dbus path: /org/freedesktop/ModemManager1/SIM/0

if i run

mmcli -m 0 --3gpp-scan

i get:

error: couldn't scan networks in the modem: 'GDBus.Error:org.freedesktop.libmbim.Error.Status.Busy: Busy'

If i run ModemManager in debugging and try connect i see this:

odemManager[5395]: <debug> [1581889376.369376] User request to connect modem
ModemManager[5395]: <info>  [1581889376.370868] Simple connect started...
ModemManager[5395]: <debug> [1581889376.370890]    PIN: unspecified
ModemManager[5395]: <debug> [1581889376.370899]    Operator ID: unspecified
ModemManager[5395]: <debug> [1581889376.370905]    Allowed roaming: yes
ModemManager[5395]: <debug> [1581889376.370911]    APN: internet.eplus.de
ModemManager[5395]: <debug> [1581889376.370918]    IP family: ipv4
ModemManager[5395]: <debug> [1581889376.370925]    Allowed authentication: none, pap, chap, mschap, mschapv2, eap
ModemManager[5395]: <debug> [1581889376.370930]    User: eplus
ModemManager[5395]: <debug> [1581889376.370934]    Password: gprs
ModemManager[5395]: <info>  [1581889376.370938] Simple connect state (4/8): Wait to get fully enabled
ModemManager[5395]: <info>  [1581889376.370973] Simple connect state (5/8): Register
ModemManager[5395]: <debug> [1581889376.370994] Launching automatic network registration...
ModemManager[5395]: [/dev/cdc-wdm0] Sent message...
<<<<<< RAW:
<<<<<<   length = 64
<<<<<<   data   = 03:00:00:00:40:00:00:00:29:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:09:00:00:00:01:00:00:00:10:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
ModemManager[5395]: [/dev/cdc-wdm0] Sent message (translated)...
<<<<<< Header:
<<<<<<   length      = 64
<<<<<<   type        = command (0x00000003)
<<<<<<   transaction = 41
<<<<<< Fragment header:
<<<<<<   total   = 1
<<<<<<   current = 0
<<<<<< Contents:
<<<<<<   service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
<<<<<<   cid     = 'register-state' (0x00000009)
<<<<<<   type    = 'set' (0x00000001)
<<<<<< Fields:
<<<<<<   ProviderId = '(null)'
<<<<<<   RegisterAction = 'automatic'
<<<<<<   DataClass = '(null)'
ModemManager[5395]: [/dev/cdc-wdm0] Received message...
>>>>>> RAW:
>>>>>>   length = 96
>>>>>>   data   = 03:00:00:80:60:00:00:00:29:00:00:00:01:00:00:00:00:00:00:00:A2:89:CC:33:BC:BB:8B:4F:B6:B0:13:3E:C2:AA:E6:DF:09:00:00:00:07:00:00:00:30:00:00:00:00:00:00:00:01:00:00:00:01:00:00:00:00:00:00:00:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:02:00:00:00
ModemManager[5395]: [/dev/cdc-wdm0] Received message (translated)...
>>>>>> Header:
>>>>>>   length      = 96
>>>>>>   type        = command-done (0x80000003)
>>>>>>   transaction = 41
>>>>>> Fragment header:
>>>>>>   total   = 1
>>>>>>   current = 0
>>>>>> Contents:
>>>>>>   status error = 'NotRegistered' (0x00000007)
>>>>>>   service      = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df)
>>>>>>   cid          = 'register-state' (0x00000009)
ModemManager[5395]: <debug> [1581889376.486033] building consolidated registration state: cs 'idle', ps 'idle', eps 'idle' --> 'idle'
ModemManager[5395]: <debug> [1581889376.486062] building consolidated registration state: cs 'idle', ps 'idle', eps 'idle' --> 'idle'
ModemManager[5395]: <debug> [1581889376.486082] building consolidated registration state: cs 'idle', ps 'idle', eps 'idle' --> 'idle'
ModemManager[5395]: <debug> [1581889376.494667] User request to disconnect modem (all bearers)
ModemManager[5395]: <debug> [1581889376.500733] User request to disconnect modem (all bearers)

usb modem missing after resume from suspend

Before suspend, lsusb:
2cb7:0007 Fibocom L850-GL

After resume it is missing from lsusb. And it is also missing from lspci.

Any idea how to recover it without restarting the computer?

I have also noticed that if when I start the computer I leave the modem in PCI mode, it is still there after suspend and resume, and I can do the switch to USB and it works.

Any idea on how to revert from USB mode to PCI mode, to do it before suspending?

Ues setpci, which is not available with a lockdown kernel

The current script uses setpci, which doesn't work with a default Debian setup using Secure Boot. The reason for this is that the kernel uses the lockdown feature, which is automatically enabled on a secure boot system. In lockdown mode, setpci cannot be used.

However I don't see a good way how to fix this. The only thing that is allowed is loading signed kernel modules, so when you could re-implement what setpci does in a custom kernel module, then you could circumvent this restriction and use the script on a system with a kernel lockdown mode.

Not working on HP EliteBook 840 G5

Hi,

I'm using this notebook with Ubuntu 19.10, but still have no luck with the WWAN card.

I installed acpi-call-dkms via apt since I were not able to compile it.

$ lspci      
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)
00:15.1 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #1 (rev 21)
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #4 (rev f1)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)
00:1c.6 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #7 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point LPC Controller/eSPI Controller (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (4) I219-V (rev 21)
01:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)
02:00.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
03:00.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
03:01.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
03:02.0 PCI bridge: Intel Corporation JHL6340 Thunderbolt 3 Bridge (C step) [Alpine Ridge 2C 2016] (rev 02)
04:00.0 System peripheral: Intel Corporation JHL6340 Thunderbolt 3 NHI (C step) [Alpine Ridge 2C 2016] (rev 02)
3a:00.0 USB controller: Intel Corporation JHL6340 Thunderbolt 3 USB 3.1 Controller (C step) [Alpine Ridge 2C 2016] (rev 02)
3b:00.0 Wireless controller [0d40]: Intel Corporation XMM7360 LTE Advanced Modem (rev 01)
3c:00.0 Non-Volatile memory controller: Toshiba America Info Systems Device 0116

Here is my USB tree:

$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 1: Dev 4, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 1: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 1: Dev 4, If 3, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 1: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 8, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 4: Dev 8, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 7: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 7: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M
    |__ Port 8: Dev 5, If 0, Class=Vendor Specific Class, Driver=, 12M
    |__ Port 9: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
    |__ Port 9: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 9: Dev 6, If 2, Class=Video, Driver=uvcvideo, 480M
    |__ Port 9: Dev 6, If 3, Class=Video, Driver=uvcvideo, 480M

If I run the command:

$ sudo ./xmm2usb 
Found XMM7360 modem at 0000:3b:00.0 (\_SB_.PCI0.RP07.PXSX)
Parent port is at 0000:00:1c.6
Disabling PCIe link...
OK!

and wait some time I get an unchanged USB tree. What can I do to use this modem (besides booting to Windows)?

Here is how to do it without the acpi_call kernel module

Under Fedora 40 (kernel 6.9.6) running on a ThinkPad X1 Carbon (7th generation), I found that the use of acpi_call can be replaced by using the following line:

        echo "1" > "${path}/reset" || \
		die "Could not reset PCI"

instead of

	printf "%s" "${acpi_path}._RST" > /proc/acpi/call || \
		die "Could not reset PCI"

Obviously, you can then also skip the lines with modprobe acpi_call and you don't need to extract the $acpi_path.

Do not work on Lenovo P52 with Ubuntu 18.04

Hello,

here is the output of the command:

ar@reinhards-P52:/xmm7360$ sudo ./xmm2usb
Found XMM7360 modem at 0000:03:00.0 (_SB_.PCI0.RP21.PXSX)
Parent port is at 0000:00:1b.4
Disabling PCIe link...
Resetting modem...
OK!
ar@reinhards-P52:
/xmm7360$

Here is, what dmesg -w says:

[ 110.188938] No Local Variables are initialized for Method [_PLD]
[ 110.188940] No Arguments are initialized for method [_PLD]
[ 110.188943] ACPI Error: Method parse/execution failed _SB.UBTC.CR01.PLD, AE_NOT_FOUND (20170831/psparse-550)
[ 110.188953] ACPI Error: Method parse/execution failed _SB.UBTC.RUCC, AE_NOT_FOUND (20170831/psparse-550)
[ 110.188962] ACPI Error: Method parse/execution failed _SB.PCI0.RP01.PXSX.TBDU.XHC.RHUB.FPCP, AE_NOT_FOUND (20170831/psparse-550)
[ 110.188972] ACPI Error: Method parse/execution failed _SB.PCI0.RP01.PXSX.TBDU.XHC.RHUB.SS01.PLD, AE_NOT_FOUND (20170831/psparse-550)
[ 110.189274] ACPI Error: [_SB
.PCI0.XHC
.RHUB.HS07._PLD] Namespace lookup failure, AE_NOT_FOUND (20170831/psargs-364)
[ 110.189292] No Local Variables are initialized for Method [_PLD]
[ 110.189295] No Arguments are initialized for method [_PLD]
[ 110.189298] ACPI Error: Method parse/execution failed _SB.UBTC.CR02._PLD, AE_NOT_FOUND (20170831/psparse-550)
[ 110.189310] ACPI Error: Method parse/execution failed _SB.UBTC.RUCC, AE_NOT_FOUND (20170831/psparse-550)
[ 110.189324] ACPI Error: Method parse/execution failed _SB.PCI0.RP01.PXSX.TBDU.XHC.RHUB.FPCP, AE_NOT_FOUND (20170831/psparse-550)
[ 110.189338] ACPI Error: Method parse/execution failed _SB.PCI0.RP01.PXSX.TBDU.XHC.RHUB.SS02._PLD, AE_NOT_FOUND (20170831/psparse-550)
[ 110.326655] pci_bus 0000:05: Allocating resources
[ 150.198278] dpc 0000:00:1c.0:pcie010: DPC containment event, status:0x1f00 source:0x0000
[ 150.198283] pciehp 0000:00:1c.0:pcie004: Slot(0-1): Link Down
[ 150.198996] xhci_hcd 0000:3b:00.0: remove, state 4
[ 150.199001] usb usb4: USB disconnect, device number 1
[ 150.199200] xhci_hcd 0000:3b:00.0: USB bus 4 deregistered
[ 150.199212] xhci_hcd 0000:3b:00.0: xHCI host controller not responding, assume dead
[ 150.199214] xhci_hcd 0000:3b:00.0: remove, state 4
[ 150.199217] usb usb3: USB disconnect, device number 1
[ 150.199363] xhci_hcd 0000:3b:00.0: Host halt failed, -19
[ 150.199364] xhci_hcd 0000:3b:00.0: Host not accessible, reset failed.
[ 150.199424] xhci_hcd 0000:3b:00.0: USB bus 3 deregistered
[ 150.699990] thunderbolt 0000:06:00.0: stopping RX ring 0
[ 150.700003] thunderbolt 0000:06:00.0: disabling interrupt at register 0x38200 bit 12 (0xffffffff -> 0xffffefff)
[ 150.700011] thunderbolt 0000:06:00.0: stopping TX ring 0
[ 150.700029] thunderbolt 0000:06:00.0: disabling interrupt at register 0x38200 bit 0 (0xffffffff -> 0xfffffffe)
[ 150.700032] thunderbolt 0000:06:00.0: control channel stopped
[ 150.700095] thunderbolt 0000:06:00.0: freeing RX ring 0
[ 150.700104] thunderbolt 0000:06:00.0: freeing TX ring 0
[ 150.700111] thunderbolt 0000:06:00.0: shutdown
[ 150.700560] pci_bus 0000:06: busn_res: [bus 06] is released
[ 150.700603] pci_bus 0000:07: busn_res: [bus 07-3a] is released
[ 150.714204] pci_bus 0000:3b: busn_res: [bus 3b] is released
[ 150.714303] pci_bus 0000:3c: busn_res: [bus 3c-6e] is released
[ 150.714368] pci_bus 0000:05: busn_res: [bus 05-6e] is released

Bypass BIOS whitelist

Hi, thank you for your work.
By any chances do you know how to change the ID of a dell card into a Lenovo ? Similar to this ?

PCIe link fails with operation not permitted

After running xmm2usb as root on a fresh install on Ubuntu 19.10 (Lenovo T480s):

Disabling PCIe link...
pcilib: sysfs_write: write failed: Operation not permitted

Any ideas?

Modem disappears from PCI, doesn't appear as USB device on Lenovo T495

Testing on a new T495, I get the expected output, as I understand it:

Found XMM7360 modem at 0000:04:00.0 (\_SB_.PCI0.GPP4.L850)
Parent port is at 0000:00:01.5
Disabling PCIe link...
OK!

But after this point, while the entry in lspci -k is gone, nothing is added to lsusb -v -t that I recognize, and no new /dev/tty* entry like the expected /dev/ttyACM0

lspci -k output for this modem before running the command:

04:00.0 Wireless controller [0d40]: Intel Corporation XMM7360 LTE Advanced Modem (rev 01)
	Subsystem: Intel Corporation XMM7360 LTE Advanced Modem

Full lsusb -t -v output, in case I missed it:

$ lsusb -t -v
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 1, Class=Wireless, Driver=btusb, 12M
        ID 8087:0025 Intel Corp. 
    |__ Port 1: Dev 2, If 0, Class=Wireless, Driver=btusb, 12M
        ID 8087:0025 Intel Corp. 
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 05e3:0610 Genesys Logic, Inc. 4-port hub
        |__ Port 1: Dev 4, If 0, Class=Video, Driver=uvcvideo, 480M
            ID 5986:2113 Acer, Inc 
        |__ Port 1: Dev 4, If 1, Class=Video, Driver=uvcvideo, 480M
            ID 5986:2113 Acer, Inc 
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub

The modem is functional in Windows 10.

Can communicate with modem via USB but cannot get connection

Thanks again @abrasive for your great hack to switch the modem to USB mode!

In my case the modem does respond properly to AT commands.
BTW, do I need the command at+gtusbmode=7 you gave? At least it worked.

Yet for some reason the ModemManager still cannot use the modem properly:
nmcli connection up UMTS (using my connection UMTS) yields

Error: Connection activation failed: The base network connection was interrupted

and on /var/log/messages I obtain

Oct 19 13:14:06 tpx390 NetworkManager[740]: <info>  [1571483646.4585] modem["cdc-wdm0"]: modem state changed, 'disabled' --> 'enabling' (reason: user-requested)
Oct 19 13:14:06 tpx390 NetworkManager[740]: <info>  [1571483646.5789] modem["cdc-wdm0"]: modem state changed, 'enabling' --> 'disabled' (reason: unknown)

The output of mmcli -m 0 is

  --------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: 540a42c89ae64dddcf63cad03e99d042bbf306b1
  --------------------------------
  Hardware |         manufacturer: Fibocom
           |                model: MBIM + 3 CDC-ACM
           |             revision: 18500.5001.03.01.20.85
           |         h/w revision: V1.0.4
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: 015184009731485
  --------------------------------
  System   |               device: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-7
           |              drivers: cdc_acm, cdc_mbim
           |               plugin: Fibocom
           |         primary port: cdc-wdm0
           |                ports: cdc-wdm0 (mbim), ttyACM1 (unknown), wwp0s20f0u7 (net), 
           |                       ttyACM2 (at)
  --------------------------------
  Status   |       unlock retries: sim-pin2 (3)
           |                state: disabled
           |          power state: low
           |       signal quality: 0% (cached)
  --------------------------------
  Modes    |            supported: allowed: 3g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 3g, 4g; preferred: none
           |                       allowed: 3g, 4g; preferred: 3g
           |                       allowed: 3g, 4g; preferred: 4g
           |              current: allowed: 3g, 4g; preferred: 4g
  --------------------------------
  Bands    |            supported: utran-1, utran-4, utran-5, utran-8, utran-2, eutran-1, 
           |                       eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8, 
           |                       eutran-12, eutran-13, eutran-17, eutran-18, eutran-19, eutran-20, 
           |                       eutran-26, eutran-28, eutran-29, eutran-30, eutran-41, eutran-66
           |              current: utran-1, utran-4, utran-5, utran-8, utran-2, eutran-1, 
           |                       eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8, 
           |                       eutran-12, eutran-13, eutran-17, eutran-18, eutran-19, eutran-20, 
           |                       eutran-26, eutran-28, eutran-29, eutran-30, eutran-41, eutran-66
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 015184009731485
           |        enabled locks: fixed-dialing
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0

Lenovo T490s error: passing argument 4 of ‘proc_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]

I am trying with Fedora 33 and Lenovo T490S

[ealcaniz@ealcaniz acpi_call]$ make && sudo make install
make -C /lib/modules/5.10.22-200.fc33.x86_64/build M=/home/ealcaniz/git/acpi_call modules
make[1]: Entering directory '/usr/src/kernels/5.10.22-200.fc33.x86_64'
CC [M] /home/ealcaniz/git/acpi_call/acpi_call.o
/home/ealcaniz/git/acpi_call/acpi_call.c: In function ‘init_acpi_call’:
/home/ealcaniz/git/acpi_call/acpi_call.c:355:53: error: passing argument 4 of ‘proc_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
355 | &proc_acpi_operations);
| ^~~~~~~~~~~~~~~~~~~~~
| |
| struct file_operations *
In file included from /home/ealcaniz/git/acpi_call/acpi_call.c:6:
./include/linux/proc_fs.h:109:122: note: expected ‘const struct proc_ops *’ but argument is of type ‘struct file_operations *’
109 | struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct proc_ops *proc_ops);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:279: /home/ealcaniz/git/acpi_call/acpi_call.o] Error 1
make[1]: *** [Makefile:1802: /home/ealcaniz/git/acpi_call] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.10.22-200.fc33.x86_64'
make: *** [Makefile:8: default] Error 2

Any ideas?

Figure out how to get the modem to boot in USB mode

At the moment this hack works by disabling the PCIe link and resetting the modem. This relies on ACPI, requires the acpi_call module, and may not survive suspend/resume. It'd be nicer if we could disable PCIe semipermanently.

There are clearly NVM variables in the modem that control PCIe operation. These are probably the obvious place to look.

XMM7560 Fibocom L860-GL

Hi,

Will it work for a Fibocom L860-GL with an XMM7560 especially the steps for switching to MBIM mode?

Thanks,
Janver

Working Laptop/Modems

Hi all,

Not sure if helpful for anyone

I can confirm that this currently works on: Carbon X1 Gen 6 20KH-CT01WW (Fibocom L850-GL)
Running Arch, just followed readme (except acpi_call was in repos, so just installed from there)

Not working on ThinkPad P52s

Hi,
it seems that is doesn't work on ThinkPad P52s (under Arch). dmesg do not print any output but lspci changes to:

sudo lspci -vvv -d 8086:7360

03:00.0 Wireless controller [0d40]: Intel Corporation XMM7360 LTE Advanced Modem (rev ff) (prog
-if ff)
        !!! Unknown header type 7f

Thanks for your work!

Not working on ThinkPad A285

First of all, thank for the great work so far. It's a pitty that it doesn't work for me though.

I've got a Lenovo ThinkPad A285 for work a few months ago, I flashed the BIOS to v1.41 today.
LTE is working fine under Windows 10, I can surf the internet there.

I'm on Linux Mint 19.2 Cinnamon with a 5.0.0-36 kernel

$ uname -a
Linux bolle 5.0.0-36-generic #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I installed acpi_call_dkms via apt. This is my output before executing the script:

$ lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15d0
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Device 15d1
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe Dummy Host Bridge
00:01.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:01.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:01.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:01.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:01.5 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15d3
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15db
00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 15dc
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 61)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15e8
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15e9
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ea
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15eb
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ec
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ed
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ee
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 15ef
01:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS522A PCI Express Card Reader (rev 01)
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822BE 802.11a/b/g/n/ac WiFi adapter
03:00.0 Non-Volatile memory controller: Lenovo Device 0006
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0e)
04:00.1 Serial controller: Realtek Semiconductor Co., Ltd. Device 816a (rev 0e)
04:00.2 Serial controller: Realtek Semiconductor Co., Ltd. Device 816b (rev 0e)
04:00.3 IPMI Interface: Realtek Semiconductor Co., Ltd. Device 816c (rev 0e)
04:00.4 USB controller: Realtek Semiconductor Co., Ltd. Device 816d (rev 0e)
05:00.0 Wireless controller [0d40]: Intel Corporation Device 7360 (rev 01)
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] (rev d0)
06:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device 15de
06:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Device 15df
06:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15e0
06:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15e1
06:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Device 15e3
07:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 61)
$ lsusb
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 10000M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 12M
        |__ Port 4: Dev 5, If 0, Class=Chip/SmartCard, Driver=, 12M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 1: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 3: Dev 11, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 4: Dev 12, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 12, If 1, Class=Video, Driver=uvcvideo, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/1p, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 1: Dev 2, If 0, Class=, Driver=, 12M
    |__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 8, If 3, Class=Human Interface Device, Driver=usbhid, 480M
            |__ Port 4: Dev 8, If 1, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 8, If 0, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 3: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/1p, 480M

I know from previous attempts that it is 05:00.0

$ sudo lspci -v -s 05:00
05:00.0 Wireless controller [0d40]: Intel Corporation Device 7360 (rev 01)
        Subsystem: Intel Corporation Device 0020
        Flags: fast devsel, IRQ 255
        Memory at c0700000 (64-bit, non-prefetchable) [disabled] [size=4K]
        Memory at c0701000 (64-bit, non-prefetchable) [disabled] [size=1K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/4 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [148] Latency Tolerance Reporting
        Capabilities: [150] L1 PM Substates

No modems are found so far. This is the output when executing the xmm7360 script:

$ sudo ./xmm2usb 
Found XMM7360 modem at 0000:05:00.0 (\_SB_.PCI0.GPP4.L850)
Parent port is at 0000:00:01.5
Disabling PCIe link...
OK!

So far, so good, the PCI device 05:00.0 is gone, but no new USB device appears

/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 10000M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 12M
        |__ Port 4: Dev 5, If 0, Class=Chip/SmartCard, Driver=, 12M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 1: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 3: Dev 11, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 4: Dev 12, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 12, If 1, Class=Video, Driver=uvcvideo, 480M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/1p, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 1: Dev 2, If 0, Class=, Driver=, 12M
    |__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 8, If 3, Class=Human Interface Device, Driver=usbhid, 480M
            |__ Port 4: Dev 8, If 1, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 8, If 0, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 12M
                |__ Port 1: Dev 7, If 1, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 3: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/1p, 480M

Is there anything else I can try?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.