WOL对高通Atheros QCA8171在Linux上无法正常工作


2

我根本无法使用wake-on-lan在我的机器上工作。我是Linux的新手,所以我可能错过了一些东西。在我的配置下面。任何输入都非常感谢。谢谢。

我的HW配置:

AsRock FM2A88X-ITX+
AMD A10-7800
Running Linux Mint 17.3 64bits

BIOS configured for wake-on-lan:
    Boot From Onboard LAN: Enabled
    PCIE Device Power On: Enabled

我的系统配置:

$ uname -a
Linux home-server 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


$ lspci -nnk | grep -i net -A2
01:00.0 Network controller [0280]: Qualcomm Atheros AR9462 Wireless Network 
Adapter [168c:0034] (rev 01)
        Subsystem: AzureWave Device [1a3b:2110]
        Kernel driver in use: ath9k
        03:00.0 Ethernet controller [0200]: Qualcomm Atheros QCA8171 Gigabit Ethernet [1969:10a1] (rev 10)
        Subsystem: ASRock Incorporation Device [1849:10a1]
        Kernel driver in use: alx


$ modinfo alx
filename:       /lib/modules/3.19.0-32-generic/kernel/drivers/net/ethernet/atheros/alx/alx.ko
license:        GPL
description:    Qualcomm Atheros(R) AR816x/AR817x PCI-E Ethernet Network Driver
author:         Qualcomm Corporation, <nic-devel@qualcomm.com>
author:         Johannes Berg <johannes@sipsolutions.net>
srcversion:     1917D292620190CB7319BDE
alias:          pci:v00001969d000010A0sv*sd*bc*sc*i*
alias:          pci:v00001969d000010A1sv*sd*bc*sc*i*
alias:          pci:v00001969d00001090sv*sd*bc*sc*i*
alias:          pci:v00001969d0000E091sv*sd*bc*sc*i*
alias:          pci:v00001969d00001091sv*sd*bc*sc*i*
depends:        mdio
intree:         Y
vermagic:       3.19.0-32-generic SMP mod_unload modversions
signer:         Magrathea: Glacier signing key
sig_key:        0C:8B:EF:E0:C1:E2:89:E4:D8:99:09:26:11:7A:DA:3B:DF:EB:41:9C
sig_hashalgo:   sha512


$ sudo ethtool eth0
    Settings for eth0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: Unknown
    Current message level: 0x000060e4 (24804)
                           link ifup rx_err tx_err hw wol
    Link detected: yes


$ cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
PB21      S4    *disabled
PB22      S4    *disabled
PB31      S4    *disabled  pci:0000:00:03.1
PB32      S4    *disabled
PB33      S4    *disabled
PB34      S4    *disabled
SBAZ      S4    *disabled  pci:0000:00:14.2
ECIR      S4    *disabled
PS2K      S4    *disabled
PS2M      S4    *disabled
P0PC      S4    *disabled  pci:0000:00:14.4
OHC1      S4    *enabled   pci:0000:00:12.0
EHC1      S4    *enabled   pci:0000:00:12.2
OHC2      S4    *enabled   pci:0000:00:13.0
EHC2      S4    *enabled   pci:0000:00:13.2
OHC3      S4    *disabled
EHC3      S4    *disabled
OHC4      S4    *enabled   pci:0000:00:14.5
XHC0      S4    *enabled   pci:0000:00:10.0
XHC1      S4    *enabled   pci:0000:00:10.1
PE20      S4    *disabled  pci:0000:00:15.0
PE21      S4    *disabled
PE22      S4    *disabled
PE23      S4    *disabled


$ ifconfig
eth0      Link encap:Ethernet  HWaddr ------HAVE_DELETED_THAT_MYSELF-----
          inet addr:192.168.1.98  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::d250:99ff:fe85:92e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17749 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10035 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22733189 (22.7 MB)  TX bytes:846896 (846.8 KB)
          Interrupt:16


$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback


$ sudo ethtool -s eth0 wol g
Cannot get current wake-on-lan settings: Operation not supported
  not setting wol

2016年1月22日后的更多信息@ MariusMatutiae 很棒的投入:

我得到了最新的 3.19.8内核 并且只有Atheros alx驱动程序(我之后能够做到这一点) 这些说明 ):

$ tar xf linux-3.19.8.tar.xz linux-3.19.8/drivers/net/ethernet/atheros/alx
$ cd linux-3.19.8/drivers/net/ethernet/atheros/alx
$ make -C /lib/modules/`uname -r`/build M=`pwd` modules
$ sudo cp /lib/modules/3.19.0-32-generic/kernel/drivers/net/ethernet/atheros/alx/alx.ko /lib/modules/3.19.0-32-generic/kernel/drivers/net/ethernet/atheros/alx/alx.ko.old
$ sudo cp alx.ko /lib/modules/3.19.0-32-generic/kernel/drivers/net/ethernet/atheros/alx/alx.ko
$ sudo reboot

该内核上的alx驱动程序返回了WOL设置(我注意到的唯一区别是驱动器上缺少签名密钥 - 比较上面的'modinfo alx'和下面的输出),但再次没有运气! !我仍然无法在我的机器上运行WOL。我检查并重新检查了BIOS设置中的所有内容。我甚至可以使用USB键盘唤醒它,但不能通过WOL唤醒它。

$ sudo modinfo alx
filename:       /lib/modules/3.19.0-32-generic/kernel/drivers/net/ethernet/atheros/alx/alx.ko
license:        GPL
description:    Qualcomm Atheros(R) AR816x/AR817x PCI-E Ethernet Network     Driver
author:         Qualcomm Corporation, <nic-devel@qualcomm.com>
author:         Johannes Berg <johannes@sipsolutions.net>
srcversion:     1917D292620190CB7319BDE
alias:          pci:v00001969d000010A0sv*sd*bc*sc*i*
alias:          pci:v00001969d000010A1sv*sd*bc*sc*i*
alias:          pci:v00001969d00001090sv*sd*bc*sc*i*
alias:          pci:v00001969d0000E091sv*sd*bc*sc*i*
alias:          pci:v00001969d00001091sv*sd*bc*sc*i*
depends:        mdio
vermagic:       3.19.0-32-generic SMP mod_unload modversions

2016年1月30日的其他信息

仍然没有运气。我能够设置WoWLAN功能,但我的Linux无法从掉电,休眠或挂起模式唤醒。我试过通过LAN中的路由器和其他计算机唤醒它。

$ sudo iw phy0 wowlan enable magic-packet
$ sudo iw phy0 wowlan show
  WoWLAN is enabled:
   * wake up on magic packet

帮助我上班的人将获得250克最好的巴西咖啡:)


LAN唤醒由固件而不是操作系统处理。
a CVn

谢谢迈克尔,但那不是我的问题。你有什么建议让它起作用吗?
Italo Nesi

什么是输出 ethtool eth0,现在?
MariusMatutiae

嗨马吕斯,再次感谢你。它仍然与上面相同。我做了一些其他的改变,但没有运气。我所做的是安装完整的内核3.19.8,但在我的显卡驱动器和一些应用程序无法正常工作之后,我又回到了3.19.0。我猜Linux Mint 17.3附带3.19.0是有原因的。巴西咖啡奖还在增加;)
Italo Nesi

Answers:


5

最后有些进展,但仍然不够。正如我在内核“3.19.0-32-generic”上我从kernel.org下载了alx驱动的源代码,编辑了文件以应用补丁( 点击这里查看补丁 )正如@MariusMatutiae所建议的那样,然后编译并用新的修补程序替换了驱动程序。现在我终于可以在ethtool命令的输出中看到“支持唤醒:pg”,但是我无法唤醒机器(shutdown,hibernate,suspend)。尝试过我的路由器(包括aiCloud功能和路由器的本地唤醒)和另一个linux盒子的etherwake。我会继续挖掘,现在看下面我做了什么。另一件事是,在启动之后,alx驱动程序将无法加载,因此我在rc.local上创建了一个脚本来加载它。我可能以最糟糕的方式做到这一点,但我会到达那里。

下载内核(我目前使用的内核)

cd ~/Downloads
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.tar.gz

仅解压缩alx驱动程序文件

tar xf linux-3.19.tar.gz linux-3.19/drivers/net/ethernet/atheros/alx

转到包含源代码的文件夹

cd linux-3.19/drivers/net/ethernet/atheros/alx

重要 :这里需要编辑alx源代码文件 https://bugzilla.kernel.org/attachment.cgi?id=156751&action=diff

sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install

删除alx驱动程序(如果你是远程/ ssh,你的连接将丢失,需要直接登录到该机器)

sudo rmmod alx

重新插入alx驱动程序

sudo insmod alx.ko

删除并复制alx.ko文件

sudo cp /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/atheros/alx/alx.ko /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/atheros/alx/alx.ko.good
sudo rm /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/atheros/alx/alx.ko
sudo cp alx.ko /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/atheros/alx/alx.ko

在这一刻,如果你尝试“ethtool -s eth0 wol pg”它应该可以工作,但是在你再次启动之前不会持续。所以我必须将以下内容添加到我的/etc/rc.local文件中(请注意创建的文件'alx.ko'我已将其移至/Drivers/alx.ko):

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#
exec 2> /tmp/rc.local.log
exec 1>&2
set -x
####################################################
# Enable WOL on eth0 at start-up
rmmod alx
insmod /Drivers/alx.ko
rm /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/atheros/alx/alx.ko
cp /Drivers/alx.ko /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/atheros/alx/alx.ko
ethtool -s eth0 wol pg
iw phy0 wowlan enable magic-packet
# End
####################################################

exit 0

1
我猜我昨晚太累了。以上就是诀窍! Powerdown和Hibernate之后我可以唤醒机器。暂停不起作用,但我对最终结果感到满意。
Italo Nesi

如果我可以多次投票,我会的。这也适用于e2200。
harveyslash
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.