HSIAO-YANG CHEN 发布的文章

最近莫名其妙系统能正常上网,但显示无Internet,且无法登录Onedrive和Office。尝试网上的方法都不行。后来在这里https://www.chenlongyu.com/article/id/58找到了灵感,使用WindowsSpyBlocker测试,发现原来是dns.msftncsi.com测试不过,导致系统显示无Internet。
微信图片_20250414232211.png
解决方法:参照注册表里的这四项值,直接在本地计算机C:\Windows\System32\drivers\etc目录下,修改hosts文件,强制指定域名对应的IP地址。

微信图片_20250414233825.png
自动化修改脚本:Fix_No_Internet.zip

解决无法访问匿名共享文件,CMD代码如下:

@echo off
Color A
Title 解决WIN10无法访问匿名共享盘
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"

rem 启用不安全的来宾登录-解决网盘无法访问
rem 将Everyone权限应用于匿名用户
echo --------------------------------------------------------------------------
echo 启用不安全的来宾登录-解决网盘无法访问
reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AllowInsecureGuestAuth" /t "REG_DWORD" /d "1" /f
echo --------------------------------------------------------------------------
echo 将Everyone权限应用于匿名用户
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "EveryoneIncludesAnonymous" /t "REG_DWORD" /d "1" /f
echo --------------------------------------------------------------------------
echo 重新启动计算机,完成设置应用!
echo --------------------------------------------------------------------------
@pause

下载地址:
解决WIN10无法访问匿名共享盘.zip

ath9K驱动使用客户端模式连接热点,出现ctrl-event-beacon-loss异常,导致无线断流。
经搜索,发现此patch补丁可以修复此问题:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bddac7c1e02ba47f0570e494c9289acea3062cc1
但不适用于openwrt 19.06(kernel 4.14) ,经参照修改,在MT7621A架构下运行良好。将补丁文件保存到./target/linux/ramips/patches-4.14目录下,重新编译,即可生成打过补丁的固件。

--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -601,7 +601,7 @@
     for (i = 0; i < nslots; i++)
         io_tlb_orig_addr[index+i] = orig_addr + (i << IO_TLB_SHIFT);
     if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC) &&
-        (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL))
+        (!(attrs & DMA_ATTR_OVERWRITE) || dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL))
         swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE);
 
     return tlb_addr;

 
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -70,6 +70,14 @@
  */
 #define DMA_ATTR_PRIVILEGED        (1UL << 9)
 
+ /*
+ * This is a hint to the DMA-mapping subsystem that the device is expected
+ * to overwrite the entire mapped size, thus the caller does not require any
+ * of the previous buffer contents to be preserved. This allows
+ * bounce-buffering implementations to optimise DMA_FROM_DEVICE transfers.
+ */
+#define DMA_ATTR_OVERWRITE        (1UL << 10)
+
 /*
  * A dma_addr_t can hold any valid DMA or bus address for the platform.
  * It can be given to a device to use as a DMA source or target.  A CPU cannot

下载地址:999-Revert-swiotlb-rework-DMA_FROM_DEVICE.zip

修复backports-4.19驱动bug,运行中随机出现“SWBA overrun on vdev 0, skipped old beacon”异常,导致无线断流。
backports新版本已经修复此问题:
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git/commit/?id=d79749f7716d9dc32fa2d5075f6ec29aac63c76d
但新驱动不适用于4.14的内核,参照这个commit修改4.19版本。
以下是 patch补丁内容:

--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1869,8 +1869,19 @@
         return ret;
     }
 
-    if (!uart_print)
+    if (!uart_print) {
+        if (true) {
+            ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin,
+                         ar->hw_params.uart_pin);
+            if (ret) {
+                ath10k_warn(ar, "failed to set UART TX pin: %d",
+                        ret);
+                return ret;
+            }
+        }
+
         return 0;
+    }
 
     ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, ar->hw_params.uart_pin);
     if (ret) {

将内容保存为999-ath10k-skipped-old-beacon.patch保存到package/kernel/mac80211/patches/ath/目录下,再编译,完成bug修补。
补丁下载:999-ath10k-skipped-old-beacon.zip

Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "asyncio\events.py", line 80, in _run
File "asyncio\proactor_events.py", line 165, in _call_connection_lost
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

运行facefusion经常性随机出现以上错误信息,尝试网络上的几种修改方式,问题一直解决不了,后来尝试把asyncio\windows_events.py里面的

DefaultEventLoopPolicy = WindowsProactorEventLoopPolicy

改成

DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy

后,运行了多次,未再出现错误信息。