<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Thanks for the feedback!</div><div dir="ltr"><div><br></div><div>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:</div><div><a href="https://lkml.org/lkml/2021/5/9/67" target="_blank">https://lkml.org/lkml/2021/5/9/67</a><br></div><div>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..</div><div><br></div><div>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. </div><div><br></div><div>After that i could run:</div><div><div>$ sudo qmicli -p -d /dev/wwan0p2MBIM --device-open-mbim --dms-dell-cuskit-unlock=00</div><div>[11 maj 2021, 23:42:36] -Warning ** [/dev/wwan0p2MBIM] couldn't detect transport type of port: couldn't detect device driver</div><div>[11 maj 2021, 23:42:36] -Warning ** [/dev/wwan0p2MBIM] requested MBIM mode but unexpected transport type found</div><div>[/dev/wwan0p2MBIM] Successfully run Dell cuskit unlock</div></div><div><br></div><div>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.. </div><div>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?)</div><div><br></div><div>I have tried adding a GSM connection:</div><div>$ nmcli conn add type gsm ifname mhi_mbim0 con-name wwan gsm.apn <a href="http://data.tre.se">data.tre.se</a> gsm.pin 7470<br></div><div><br></div><div>But when i try to set it up I get:</div><div><div>$ nmcli conn up wwan</div><div>Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).</div></div><div><br></div><div>NM Logs:</div><div><div>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</div><div>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)."</div></div><div><br></div><div>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)</div><div><br></div><div>/Oskar</div><div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 11 May 2021 at 09:35, Aleksander Morgado <<a href="mailto:aleksander@aleksander.es" target="_blank">aleksander@aleksander.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey,<br>
<br>
Comments inline below.<br>
<br>
><br>
> I'm trying to get the modem running on my Thinkpad X1 Nano which i ordered with the Snapdragon X55 / 5G Modem.<br>
><br>
> 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: <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/bus/mhi/pci_generic.c?id=aac426562f568520b674f0d5ae3929977be9f1c0" rel="noreferrer" target="_blank">https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/bus/mhi/pci_generic.c?id=aac426562f568520b674f0d5ae3929977be9f1c0</a><br>
> 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.<br>
><br>
> Here's a loose translation of what Bjørn mentioned:<br>
><br>
> ---------------------<br>
> This problem might be specific to Lenovo/Thinkpad, the only thing you might need could be to actually turn on the radio:<br>
><br>
> >>>>>> HwRadioState = 'on'<br>
> >>>>>> SwRadioState = 'off'<br>
><br>
> HwRadioState indicates that the input-signal to the module (W_DISABLE#) is OK.<br>
> SwRadioState indicates that the radio is put in airplane mode through software. Either BIOS or it might be the default of the modem-firmware.<br>
><br>
> 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".<br>
><br>
> <<<<<< QMUX:<br>
> <<<<<< length = 19<br>
> <<<<<< flags = 0x80<br>
> <<<<<< service = "dms"<br>
> <<<<<< client = 1<br>
> <<<<<< QMI:<br>
> <<<<<< flags = "response"<br>
> <<<<<< transaction = 5<br>
> <<<<<< tlv_length = 7<br>
> <<<<<< message = "Set FCC Authentication" (0x555F)<br>
> <<<<<< TLV:<br>
> <<<<<< type = "Result" (0x02)<br>
> <<<<<< length = 4<br>
> <<<<<< value = 01:00:11:00<br>
> <<<<<< translated = FAILURE: MissingArgument<br>
><br>
><br>
> '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.<br>
><br>
<br>
I've seen different vendors adding this kind of message codes for<br>
different purposes, so I think any of those assumptions could be<br>
valid.<br>
<br>
> 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?<br>
><br>
> 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.<br>
><br>
> 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.<br>
> ---------------------<br>
><br>
> Does anyone have any idea / some other input for how to get further?<br>
><br>
<br>
So, my assumption is that Lenovo should have a tool to "unlock" this<br>
module; something equivalent to the Set FCC authentication in Sierra<br>
modules. Maybe something equivalent to this Dell custkit tool for the<br>
Foxconn SDX20 module?<br>
<a href="https://gitlab.freedesktop.org/aleksm/libqmi/-/tree/aleksander/dell-cuskit" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/aleksm/libqmi/-/tree/aleksander/dell-cuskit</a><br>
<br>
If that tool does what I think it does, it would "validate" that the<br>
module is running in a certified Dell laptop, and if so, send a<br>
specific magic QMI command to the module. And if so, there should be<br>
nothing preventing us from doing the same, unless the magic command<br>
requires some additional logic to pass a magic value computed from<br>
imei or whatever, that would be a bit more complex.<br>
<br>
I have a draft setup to test the commands provided in the custkit<br>
tool, but never made it work I'm afraid:<br>
<a href="https://gitlab.freedesktop.org/aleksm/libqmi/-/tree/aleksander/dell-cuskit" rel="noreferrer" target="_blank">https://gitlab.freedesktop.org/aleksm/libqmi/-/tree/aleksander/dell-cuskit</a><br>
<br>
That branch introduces a new qmicli --dms-dell-cuskit-unlock=[XX]<br>
command, where XX is a uint8 value (00-255). I was able to play with a<br>
locked SDX20 with that command but could never make it work. Don't<br>
know if you'll be able to do the same?<br>
<br>
But all this said, hey, you bought an X1 with a SDX55 module, Lenovo<br>
should give you a way to unlock the mode rightfully. It's not like you<br>
bought the SDX55 in ebay and you're trying to use it elsewhere.<br>
<br>
My assumption, given the good relationship between Ubuntu and Lenovo,<br>
is that the Ubuntu shipped in those laptops will include that magic<br>
tool, maybe embedded in some other program or just "hidden in the<br>
public" and we just need to look for that. This may not be a bad idea<br>
to investigate I think.<br>
<br>
<br>
<br>
--<br>
Aleksander<br>
<a href="https://aleksander.es" rel="noreferrer" target="_blank">https://aleksander.es</a><br>
</blockquote></div>