我遇到了一个问题,我的 wifi 恢复后无法工作。
我已经在谷歌上尝试了很多解决方案。
我目前拥有的:
猫/etc/pm/sleep.d/wakenet.sh
#!/bin/bash
case "$1" in
thaw|resume)
nmcli nm sleep false
pkill -f wpa_supplicant
;;
*)
;;
esac
exit $?
猫/etc/pm/config.d/config
SUSPEND_MODULES="ath10k_pci"
恢复后的错误日志:
ath10k_pci 0000:04:00.0: Refused to change power state, currently in D3
[ 52.941724] ath10k_pci 0000:04:00.0: failed to wake target for write32 of 0x00000000 at 0x00034400: -110
[ 52.952859] ath10k_pci 0000:04:00.0: failed to wake target for write32 of 0x00000000 at 0x00034404: -110
[ 52.963313] ath10k_pci 0000:04:00.0: failed to wake target for read32 at 0x00034410: -110
[ 52.973762] ath10k_pci 0000:04:00.0: failed to wake target for write32 of 0xffff0000 at 0x00034410: -110
[ 52.984213] ath10k_pci 0000:04:00.0: failed to wake target for read32 at 0x0003444c: -110
[ 52.994663] ath10k_pci 0000:04:00.0: failed to wake target for write32 of 0xffff0000 at 0x0003444c: -110
[ 53.005114] ath10k_pci 0000:04:00.0: failed to wake target for write32 of 0x00000000 at 0x00034408: -110
[ 53.015563] ath10k_pci 0000:04:00.0: failed to wake target for write32 of 0x00000000 at 0x0003440c: -110
[ 53.026037] ath10k_pci 0000:04:00.0: failed to wake target for read32 at 0x00034450: -110
[ 53.036495] ath10k_pci 0000:04:00.0: failed to wake target for write32 of 0xffff0000 at 0x00034450: -110
[ 54.332051] ath10k_pci 0000:04:00.0: pci irq legacy interrupts 0 irq_mode 0 reset_mode 0
[ 57.467798] ath10k_pci 0000:04:00.0: failed to read device register, device is gone
[ 57.467809] ath10k_pci 0000:04:00.0: failed to reset chip: -5
[ 57.478781] ath10k_pci: probe of 0000:04:00.0 failed with error -5
uname -a
Linux sahal 4.4.0-18-generic #34~14.04.1-Ubuntu SMP 星期四 4 月 7 日 18:31:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
我现在真的需要帮助。谢谢!
答案1
我用了奥维斯·隆的回答类似问题启用我的笔记本电脑(Dell Precision)16.04 LTS 版本挂起后自动恢复 wifi 的功能。
像 Owais 一样,我创建了 /etc/pm/sleep.d/10_resume_wifi:
#!/bin/sh
case "${1}" in
resume|thaw)
nmcli radio wifi off && nmcli radio wifi on;;
esac
后面跟着一个sudo chmod +x /etc/pm/sleep.d/10_resume_wifi
。
如果你像我一样对双分号或单括号感到疑惑,请参阅http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_03.html—— 这就是 case 语法的工作方式。
答案2
我终于找到了解决方案!只需编写此脚本即可在挂起之前删除模块,然后重新加载。