ath9k_htc wifiは起動するたびにプラグを抜いて再接続する必要があります。

ath9k_htc wifiは起動するたびにプラグを抜いて再接続する必要があります。

状況に合わせてyoctoで作成した独自のLinuxイメージを実行し、SDカードから起動するstm32mp135d odysseyボードがあります。安いath9k Wi-Fi USBドングルを接続しましたが、ドングルを抜いて再接続するまでWi-Fiインターフェイスが表示されないという迷惑な問題に直面しました。

再起動後のトラブルシューティングに役立ついくつかの結果が表示されます。

場合に備えてカーネル情報が重要です。

root@stm32mp1:~# uname -a
Linux stm32mp1 5.15.67 #1 SMP PREEMPT Fri Mar 15 01:01:46 UTC 2024 armv7l GNU/Linux

lsusb出力。

root@stm32mp1:~# lsusb -v

Bus 002 Device 002: ID 040d:3801 VIA Technologies, Inc. VIA USB2.0 WLAN
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0        64
  idVendor           0x040d VIA Technologies, Inc.
  idProduct          0x3801
  bcdDevice            1.08
  iManufacturer          16 VIA TECH
  iProduct               32 VIA USB2.0 WLAN
  iSerial                48 12345
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x003c
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           6
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass       255 Vendor Specific Subclass
  bDeviceProtocol       255 Vendor Specific Protocol
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

インターフェイスが表示されない

root@stm32mp1:~# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: end0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether aa:ce:65:8a:8d:22 brd ff:ff:ff:ff:ff:ff
3: end1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 62:7b:ce:1d:79:c4 brd ff:ff:ff:ff:ff:ff
4: usb0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 96:9d:05:79:2b:95 brd ff:ff:ff:ff:ff:ff

dmesg 出力に ath9k ファームウェアのロードに失敗したことが表示されます。

root@stm32mp1:~# dmesg | grep -i "ath9k"
[    0.351901] usbcore: registered new interface driver ath9k_htc
[    4.369966] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[    4.387041] usb 2-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[    4.401769] usb 2-1: ath9k_htc: Firmware htc_9271.fw requested
[    4.421233] usb 2-1: ath9k_htc: Failed to get firmware htc_9271.fw
[    4.427899] usb 2-1: ath9k_htc: USB layer deinitialized

後ろにモジュールを取り外して再接続しましたが、dmesgに次のメッセージが表示されました。

[  467.033794] usb 2-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[  467.334719] usb 2-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[  467.585338] ath9k_htc 2-1:1.0: ath9k_htc: HTC initialized with 33 credits
[  467.854226] ath9k_htc 2-1:1.0: ath9k_htc: FW Version: 1.4
[  467.858250] ath9k_htc 2-1:1.0: FW RMW support: On
[  468.025043] ath9k_htc 2-1:1.0 wlu1: renamed from wlan0

インターフェイスが表示されます

5: wlu1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:12:7b:21:6f:39 brd ff:ff:ff:ff:ff:ff

この時点では、問題なくインターフェイスで Hostapd と wpa_supplicant を使用できます。最初は手動でリセットしてください。これが組み込みデバイスであることを考えると、最終製品ではこれを実行したくありません。 dmesgの出力によれば、起動プロセスの初期にath9kファームウェアをロードしようとすると失敗する可能性があるため、遅延を必要とするか、Linuxの起動後に自動的にリセットする方法が必要です。これを行うためにudevルールを使用して何かをすることができるという漠然とした考えはありますか?しかし、よくわかりません。

私が試したこと

  1. 示されているようにプログラム的にUSBデバイスをリセットします。ここ
  2. modprobe ath9k
  3. modprobe ath9k_htc

ベストアンサー1

この質問に自分で答えてください。

私の解決策は、起動が完了した後にUSBデバイスをリセットすることで、私にはうまくいきました。これ郵便はがき。

そこにユーザーがこれを

sudo sh -c "echo 0 > /sys/bus/usb/devices/1-4.6/authorized"
sudo sh -c "echo 1 > /sys/bus/usb/devices/1-4.6/authorized"

このスクリプト(または他の方法)を使用して、リセットしたいWi-Fiデバイスの/ sysパスを見つけることができます。

for X in /sys/bus/usb/devices/*; do 
    echo "$X"
    cat "$X/idVendor" 2>/dev/null 
    cat "$X/idProduct" 2>/dev/null
    echo
done

よりエレガントな解決策があるかもしれませんが、私の目的にはこれが効果的です。

おすすめ記事