Snapdragon X55 (Thinkpad X1 Nano w/5G Modem)
Oskar Stenman
oskar at cetex.se
Tue May 11 22:06:18 UTC 2021
Thanks for the feedback!
I tried compiling that cuskit patch, but my laptop crashed and no matter
what i did i ended up with segfaults. Apparently i've been hit by a
kernel-bug which sidetracked me about 10 hours:
https://lkml.org/lkml/2021/5/9/67
No wonder the produced binaries were throwing segfaults and my browser
suddenly bailed out.. When inspecting stuff manually lots of the data
written recently was just utter garbage..
With that sorted (reverted the mentioned commit, cloned git repos again) I
patched mainline libqmi with the two commits you had, compiled and
installed everything into default prefix /usr/local.
After that i could run:
$ sudo qmicli -p -d /dev/wwan0p2MBIM --device-open-mbim
--dms-dell-cuskit-unlock=00
[11 maj 2021, 23:42:36] -Warning ** [/dev/wwan0p2MBIM] couldn't detect
transport type of port: couldn't detect device driver
[11 maj 2021, 23:42:36] -Warning ** [/dev/wwan0p2MBIM] requested MBIM mode
but unexpected transport type found
[/dev/wwan0p2MBIM] Successfully run Dell cuskit unlock
I've attached the log from ModemManager and i can see a ton of stuff
happening after i send that command with cuskit, but i haven't had time to
go through it in detail yet. I did see "registered" in the logs though so
i'm hoping we're making progress, although I don't know for sure..
For some reason NetworkManager isn't detecting the interface so i can't
test it. (I tried simple-connect with modem-manager but that failed, seems
like simple-connect isn't supported by the card?)
I have tried adding a GSM connection:
$ nmcli conn add type gsm ifname mhi_mbim0 con-name wwan gsm.apn data.tre.se
gsm.pin 7470
But when i try to set it up I get:
$ nmcli conn up wwan
Error: Connection activation failed: No suitable device found for this
connection (device lo not available because device is strictly unmanaged).
NM Logs:
maj 11 23:56:25 oskar-ThinkPad-X1-Nano-Gen-1 NetworkManager[6819]: <info>
[1620770185.8352] agent-manager:
agent[f39cf2afba99de1f,:1.157/nmcli-connect/1000]: agent registered
maj 11 23:56:25 oskar-ThinkPad-X1-Nano-Gen-1 NetworkManager[6819]: <info>
[1620770185.8369] audit: op="connection-activate"
uuid="e4abc9b5-fe8d-420b-923a-3e5184c5746b" name="wwan" result="fail"
reason="No suitable device found for this connection (device lo not
available because device is strictly unmanaged)."
I'm not sure why NetworkManager isn't detecting the interface.. Maybe some
issue with where plugins are installed? (I assume there's a new plugin
somewhere)
/Oskar
On Tue, 11 May 2021 at 09:35, Aleksander Morgado <aleksander at aleksander.es>
wrote:
> Hey,
>
> Comments inline below.
>
> >
> > I'm trying to get the modem running on my Thinkpad X1 Nano which i
> ordered with the Snapdragon X55 / 5G Modem.
> >
> > I contacted Bjørn Mork who seems to be the author for some other kernel
> modules for usb-devices and we've been digging a bit. He informed me that
> you're already working on this chip here:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/bus/mhi/pci_generic.c?id=aac426562f568520b674f0d5ae3929977be9f1c0
> > I'm on ubuntu 21.04 (if it matters) and have built my kernel from
> mainline git (as well as bleeding-edge modemmanager, libqmi, libmbim as of
> may 7th) and now ModemManager detects the modem but but something is still
> failing when trying to enable it.
> >
> > Here's a loose translation of what Bjørn mentioned:
> >
> > ---------------------
> > This problem might be specific to Lenovo/Thinkpad, the only thing you
> might need could be to actually turn on the radio:
> >
> > >>>>>>
> HwRadioState = 'on'
> > >>>>>>
> SwRadioState = 'off'
> >
> > HwRadioState indicates that the input-signal to the module (W_DISABLE#)
> is OK.
> > SwRadioState indicates that the radio is put in airplane mode through
> software. Either BIOS or it might be the default of the modem-firmware.
> >
> > Lenovo has earlier (EM7455) required that the driver sends a magic "Set
> FCC Authentication" request on startup to enable the radio. You can also
> see it in your log since MM tries it when the radio-state returns
> "OperationNotAllowed".
> >
> > <<<<<<
> QMUX:
> > <<<<<<
> length = 19
> > <<<<<<
> flags = 0x80
> > <<<<<<
> service = "dms"
> > <<<<<<
> client = 1
> > <<<<<<
> QMI:
> > <<<<<<
> flags = "response"
> > <<<<<<
> transaction = 5
> > <<<<<<
> tlv_length = 7
> > <<<<<<
> message = "Set FCC Authentication" (0x555F)
> > <<<<<<
> TLV:
> > <<<<<<
> type = "Result" (0x02)
> > <<<<<<
> length = 4
> > <<<<<<
> value = 01:00:11:00
> > <<<<<<
> translated = FAILURE: MissingArgument
> >
> >
> > 'MissingArgument' is also interesting. It means that the request ID
> exists and since this is a vendor-specific code (as far as i know) it oculd
> mean that it's specified by Lenovo, not by Sierra Wireless as i've
> previously thought.
> >
>
> I've seen different vendors adding this kind of message codes for
> different purposes, so I think any of those assumptions could be
> valid.
>
> > That could mean that this is the correct method to enable the radio, but
> that they require an input-argument. Maybe a code? or something else?
> >
> > It could also just mean that QMI_DMS request 0x555F is something else
> entirely in this Foxconn modem and is completley unrelated to radio on/off.
> >
> > The problem we have now is that we no longer have a simple solution to
> snoop the trafic from windows. It was simple with USB but I have no idea
> how to do that with PCIe. I've never worked with PCI-drivers.
> > ---------------------
> >
> > Does anyone have any idea / some other input for how to get further?
> >
>
> So, my assumption is that Lenovo should have a tool to "unlock" this
> module; something equivalent to the Set FCC authentication in Sierra
> modules. Maybe something equivalent to this Dell custkit tool for the
> Foxconn SDX20 module?
> https://gitlab.freedesktop.org/aleksm/libqmi/-/tree/aleksander/dell-cuskit
>
> If that tool does what I think it does, it would "validate" that the
> module is running in a certified Dell laptop, and if so, send a
> specific magic QMI command to the module. And if so, there should be
> nothing preventing us from doing the same, unless the magic command
> requires some additional logic to pass a magic value computed from
> imei or whatever, that would be a bit more complex.
>
> I have a draft setup to test the commands provided in the custkit
> tool, but never made it work I'm afraid:
> https://gitlab.freedesktop.org/aleksm/libqmi/-/tree/aleksander/dell-cuskit
>
> That branch introduces a new qmicli --dms-dell-cuskit-unlock=[XX]
> command, where XX is a uint8 value (00-255). I was able to play with a
> locked SDX20 with that command but could never make it work. Don't
> know if you'll be able to do the same?
>
> But all this said, hey, you bought an X1 with a SDX55 module, Lenovo
> should give you a way to unlock the mode rightfully. It's not like you
> bought the SDX55 in ebay and you're trying to use it elsewhere.
>
> My assumption, given the good relationship between Ubuntu and Lenovo,
> is that the Ubuntu shipped in those laptops will include that magic
> tool, maybe embedded in some other program or just "hidden in the
> public" and we just need to look for that. This may not be a bad idea
> to investigate I think.
>
>
>
> --
> Aleksander
> https://aleksander.es
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20210512/821fc198/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ModemManager-cuskit-unlock.log
Type: text/x-log
Size: 51565 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20210512/821fc198/attachment-0001.bin>
More information about the ModemManager-devel
mailing list