在哪裡可以找到 8086:7560 的 wwan FCC 解鎖

在哪裡可以找到 8086:7560 的 wwan FCC 解鎖

Lenovo 為其 P16 第 2 代筆記型電腦(經過 Ubuntu Linux 認證)提供以下 wwan 卡:Intel MBIM [8086:7560]。數據機管理器看到wwan 數據機,但無法啟用它(錯誤訊息:** (modem-manager-gui:9178): WARNING **: 10:33:30.084: Modem Manager >= 0.7.0: GDBus.Error: org .freedesktop.ModemManager1.Error.Core.Retry:無效轉換

根據 Lenovo 說明(ThinkPad P16 Gen 2 Linux 使用者指南:應該「Go tohttps://support.lenovo.com並選擇您的計算機的條目。從產品支援頁面下載 wwan-linux-fcc-unlock 軟體包。請務必檢查自述文件,確認您的地理位置是否有任何限制,並取得有關如何安裝應用程式的說明。

但不幸的是,聯想網站上沒有這類文件。對於未能提供fcc解鎖文件的事件,聯想也沒有發表任何評論。

此連結似乎也是空的:https://www.lenovo.com/linux/wwan-enablement-on-Linux.pdf

除非有人知道上述 wwan 卡的 fcc ulock 檔案在哪裡可以找到,否則 P16 系列中的 wwan 數據機在 ubuntu 或 Linux 中無法使用。周圍有這方面的資訊嗎?

先致謝

答案1

對於 8086:7560 解鎖,我使用位於此處的腳本成功地在 ThinkPad X1 Yoga Gen 7 上解鎖:https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/751

您可以將腳本儲存為/etc/ModemManager/fcc-unlock.d/8086:7560並確保其可執行 ( chmod +x)。您還需要將標頭的 shebang 從 更改pythonpython3

將需要一些解決方法,特別是如果您使用掛起/休眠,因為調製解調器本身相當挑剔。

一個主要問題是,一旦調變解調器在 PCI 總線上斷電,它將無法再次通電,需要再次開啟。這會影響調變解調器本身及其所連接的匯流排。

您將需要以下 udev 規則:

/etc/udev/rules.d/99-modem-suspend.rules

# The modem fails to wake up ever again after suspend
SUBSYSTEM=="pci", ATTR{vendor}=="0x1cf8", ATTR{device}=="0x8653", ATTR{power/control}="on", GOTO="pci_pm_end"
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x7560", ATTR{power/control}="on", GOTO="pci_pm_end"
SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x51b8", ATTR{power/control}="on", GOTO="pci_pm_end"

# Use normal sleeping otherwise
SUBSYSTEM=="pci", ATTR{power/control}="auto"
LABEL="pci_pm_end"

然後,您將需要一個在啟動時運行的腳本來設定設備省電的一些初始屬性,以便數據機或 Linux 不會掛起設備,而是保持其始終通電。

/opt/keep-modem-awake.sh

#!/bin/sh

# Enable wakeups
## Bus the modem is on
if grep 'pci:0000:00:1c.0' < /proc/acpi/wakeup | grep disabled
then
        echo "Enabling wakeup for bus owning Modem..." > /dev/kmsg
        echo RP01 > /proc/acpi/wakeup
fi
## Modem
if grep 'pci:0000:08:00.0' < /proc/acpi/wakeup | grep disabled
then
        echo "Enabling wakeup for modem..." > /dev/kmsg
        echo PXSX > /proc/acpi/wakeup
fi

# Disable d3cold for the modem
# It is behind the bridge: 00:1c.0 PCI bridge: Intel Corporation Device 51b8 (rev 01)
# https://patchwork.kernel.org/project/linux-pci/patch/[email protected]/
echo "Disabling modem d3cold..." > /dev/kmsg
## The actual modem
echo 0 > /sys/bus/pci/devices/0000:08:00.0/d3cold_allowed
## The owning buses
echo 0 > /sys/devices/pci0000:00/0000:00:1c.0/d3cold_allowed
echo 0 > /sys/bus/acpi/devices/PNP0A08:00/device:4f/physical_node/d3cold_allowed
echo 0 > /sys/bus/acpi/devices/PNP0A08:00/device:4f/device:50/physical_node/d3cold_allowed

# Use ACPI to reset the PCI and not just power off and power on the device
echo "Setting modem reset method to ACPI..." > /dev/kmsg
echo acpi > /sys/bus/pci/devices/0000:08:00.0/reset_method

注意:您的系統可能有不同的設備路徑。例如,在 Lenovo ThinkPad Z16 Gen 1 上,數據機是0000:05:00.0,所屬匯流排是0000:00:01.3和 ACPI 設備PNP0A08:00/device:07/device:08。若要正確識別要使用的 ID,您可以執行下列操作:

  1. 使用命令識別您的數據機lspci。例如:
❯ lspci | grep Modem
05:00.0 Wireless controller [0d40]: Intel Corporation XMM7560 LTE Advanced Pro Modem (rev 01)

這給了我們一個設備路徑/sys/bus/pci/devices/0000:05:00.0

  1. 辨識所屬巴士:
❯ ls -l /sys/bus/pci/devices/0000:05:00.0
lrwxrwxrwx. 1 root root 0 Apr 14 10:24 /sys/bus/pci/devices/0000:05:00.0 -> ../../../devices/pci0000:00/0000:00:01.3/0000:05:00.0

給我們自己的巴士路線/sys/bus/pci/devices/0000:00:01.3

  1. 識別 ACPI 擁有的匯流排:
❯ find /sys/bus/acpi/devices/PNP0A08:00/ -type l -exec ls -l {} + | grep '05:00.0'

lrwxrwxrwx. 1 root root 0 Apr 14 14:25 /sys/bus/acpi/devices/PNP0A08:00/device:07/device:08/physical_node -> ../../../../../pci0000:00/0000:00:01.3/0000:05:00.0

給我們路徑/sys/bus/acpi/devices/PNP0A08:00/device:07/sys/bus/acpi/devices/PNP0A08:00/device:07/device:08

然後在啟動時運行腳本:

/etc/systemd/system/keep-modem-awake.service

[Unit]
Description="Keep modem awake for suspend."
After=ModemManager.service NetworkManager.service
Wants=ModemManager.service NetworkManager.service

[Service]
ExecStart=/opt/keep-modem-awake.sh

[Install]
WantedBy=multi-user.target

對於後面的腳本,您將需要一個可以找到數據機的腳本,因為當系統掛起和恢復時,數據機 ID 每次都會更改。

/opt/find-modem.sh

#!/bin/sh

# Make sure path is set
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

for __i in $(seq 1 10)
do
        __modem="$(/opt/find-modem-sub.sh | head -n 1)"
        if [ -z "$__modem" ]
        then
                sleep 0.5
        else
                break
        fi
done

if [ -z "$__modem" ]
then
        exit 1
fi

echo "$__modem"
exit 0

/opt/find-modem-sub.sh

#!/bin/sh

# Make sure path is set
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Read in commands
mmcli -L | grep '\/Modem\/' | while read __line
do
        echo "$__line" | sed 's/^.*\/Modem\/\([0-9]\{1,\}\).*$/\1/'
        exit 0
done

exit 1

然後,如果您打算使用掛起和休眠,則必須相應地設定腳本,以便它們在發生之前和之後運行:

/opt/suspend-modem.sh

#!/bin/sh

# Make sure path is correct
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Get modem ID
__modem="$(/opt/find-modem.sh)"

if [ "$1" = "0" ]
then
        echo "Telling NM to not use the modem..." > /dev/kmsg
        nmcli c down NetworkName

        # Make sure the connection is deactivated
        echo "Waiting for NM to show disconnected..." > /dev/kmsg
        while nmcli con show --active | grep NetworkName
        do
                sleep 0.5
        done

        # Deactivate the modem before suspend as the connection freezes and never comes back
        echo "Disabling modem..." > /dev/kmsg
        mmcli -m "$__modem" --disable
elif [ "$1" = "1" ]
then
        echo "Disabling modem after resume..." > /dev/kmsg
        mmcli -m "$__modem" --disable

        echo "Entering low power mode after disable..." > /dev/kmsg
        mmcli -m "$__modem" --set-power-state-low

        echo "Performing enabling loops..." > /dev/kmsg
        for __i in $(seq 1 5)
        do
                echo "Loop $__i..." > /dev/kmsg

                echo "Turning on modem and enabling..." 1>&2
                mmcli -m "$__modem" --set-power-state-on
                if mmcli -m "$__modem" --enable
                then
                        echo "Modem was enabled..." > /dev/kmsg
                        break
                else
                        echo "Did not enable modem..." > /dev/kmsg
                        sleep 0.5
                fi
        done

        echo "Telling NM to use the modem now..." > /dev/kmsg
        nmcli c up NetworkName
fi

然後相應地執行以下 systemd,這一個用於恢復:

rfkill-modem-resume.service

[Unit]
Description=Enable modem after wake-up
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
Type=simple
ExecStart=/opt/suspend-modem.sh 1

[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

這一個用於暫停:

rfkill-modem-suspend.service

[Unit]
Description=rfkill modem before sleep
Before=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
Type=simple
ExecStart=/opt/suspend-modem.sh 0

[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

透過這些腳本和其他腳本,我成功地在多次掛起和休眠後使調製解調器保持活動狀態。

另外,您可能還需要調整 NetworkManager 連接,使 DNS 和路由優先權低於主連接(較高值),以便將其用作後備連接。

答案2

還有一個待處理的合併請求使用基於 bash 的解鎖腳本。

我製造了一個修改版它也發送AT+XDNS=0,1命令,因為如果沒有它,連接就會不斷斷開。

相關內容