radxa-pkg / aic8800

Aicsemi aic8800 Wi-Fi driver
19 stars 15 forks source link

How to suppress rather exhaustive kernel logging #15

Open CT1IQI opened 2 weeks ago

CT1IQI commented 2 weeks ago

please in the documentation mention how to suppress the rather extensive logging. Somewhat confusing is that the kernel module names are identical for different interfaces, but the kernel module filename have the _ extension. E.g. for a Rock 5C in /etc/modprobe.d/ add a file .conf with contents options aic8800_fdrv_usb aicwf_dbg_level=1 options aic_load_fw_usb aicwf_dbg_level=1 # level is a mask composed of levels: ERROR 0x0001 + INFO 0x0002 + TRACE 0x0004 + DEBUG 0x0008 + DATA 0x0010

RadxaYuntian commented 2 weeks ago

Kernel module names are identical because they are really identical. But identically named drivers cannot be installed side by side, so we renamed them during installation.

RadxaYuntian commented 2 weeks ago

Does lsmod show you the real name?

CT1IQI commented 2 weeks ago

No, lsmod shows the module name as it is internally called when operational. That is the confusing bit. I think it is convention to make filename prefix before the .ko identical to name coded in. When it is not yet loaded the filename comes in, and that now needs the _usb. With _usb is what depmod needs.

@.***:~# lsmod | grep aic aic_btusb 53248 0 aic8800_fdrv 417792 0 cfg80211 819200 1 aic8800_fdrv aic_load_fw 53248 1 aic8800_fdrv

On Thu, 2024-06-20 at 19:45 -0700, ZHANG Yuntian wrote:

Does lsmod show you the real name? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

RadxaYuntian commented 2 weeks ago

Can you check if you can load both USB and SDIO variant of aic8800_fdrv driver? Currently the module is just renamed by dkms.

CT1IQI commented 2 weeks ago

No, currently only the three _usb drivers are present in the updates/dkms folder. Apparently when compiling it is being figured out which version is needed. Here am using the Rock 5C board. Don't know whether that would see the AIC's WiFi via SDIO anyway.

On Thu, 2024-06-20 at 23:26 -0700, ZHANG Yuntian wrote:

Can you check if you can load both USB and SDIO variant of aic8800_fdrv driver? Currently the module is just renamed by dkms. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

RadxaYuntian commented 2 weeks ago

You will need to install aic8800-sdio-dkms package for it to be available in your system. This is provided in our apt repo for our official systems. You can also download directly from GitHub Releases.

Joshua-Riek commented 2 weeks ago

@CT1IQI I removed LOGINFO|LOGDEBUG|LOGTRACE from the aicwf_dbg_level variable to suppress the excessive kernel logging. I'm not sure if there is an interface to adjust the logging level without compiling the driver.

Here is the patch I use:

From 0c48b5823a20f50d4732e41be5552540059ca80d Mon Sep 17 00:00:00 2001
From: Joshua Riek <jjriek@verizon.net>
Date: Tue, 4 Jun 2024 16:59:46 -0400
Subject: [PATCH] disable debug info

---
 src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c      | 2 +-
 src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c      | 2 +-
 .../mod/vendor/wifi_driver/aic/aic8800/aic8800_fdrv/rwnx_main.c | 2 +-
 .../net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c | 2 +-
 .../net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c | 2 +-
 src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.c      | 2 +-
 .../driver_fw/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c  | 2 +-
 .../drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c       | 2 +-
 .../net/wireless/aic8800/aic_load_fw/aic_bluetooth_main.c       | 2 +-
 .../wifi/drv/usb_aic8800d/aic8800/aic8800_fdrv/rwnx_main.c      | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
index a787214..5123584 100644
--- a/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/PCIE/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
@@ -509,7 +509,7 @@ static const int rwnx_hwq2uapsd[NL80211_NUM_ACS] = {
 #endif

 extern uint8_t scanning;
-int aicwf_dbg_level = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);
 int testmode = 0;
 int adap_test = 0;
diff --git a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
index dc8bc5a..29f86da 100644
--- a/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/SDIO/driver_fw/driver/aic8800/aic8800_fdrv/rwnx_main.c
@@ -503,7 +503,7 @@ static const int rwnx_hwq2uapsd[NL80211_NUM_ACS] = {

 extern uint8_t scanning;
-int aicwf_dbg_level = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);
 int testmode = 0;
 char aic_fw_path[200];
diff --git a/src/SDIO/patch/for_Amlogic/905x4/Android11/mod/vendor/wifi_driver/aic/aic8800/aic8800_fdrv/rwnx_main.c b/src/SDIO/patch/for_Amlogic/905x4/Android11/mod/vendor/wifi_driver/aic/aic8800/aic8800_fdrv/rwnx_main.c
index a5a1a04..bc6ad4f 100644
--- a/src/SDIO/patch/for_Amlogic/905x4/Android11/mod/vendor/wifi_driver/aic/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/SDIO/patch/for_Amlogic/905x4/Android11/mod/vendor/wifi_driver/aic/aic8800/aic8800_fdrv/rwnx_main.c
@@ -489,7 +489,7 @@ static const int rwnx_hwq2uapsd[NL80211_NUM_ACS] = {
 };

 extern uint8_t scanning;
-int aicwf_dbg_level = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);
 int testmode = 0;
 char aic_fw_path[200];
diff --git a/src/SDIO/patch/for_Rockchip/3128/Android4_4/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c b/src/SDIO/patch/for_Rockchip/3128/Android4_4/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c
index 88e549b..4a27ed2 100644
--- a/src/SDIO/patch/for_Rockchip/3128/Android4_4/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/SDIO/patch/for_Rockchip/3128/Android4_4/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c
@@ -502,7 +502,7 @@ static const int rwnx_hwq2uapsd[NL80211_NUM_ACS] = {

 extern uint8_t scanning;
-int aicwf_dbg_level = LOGERROR|LOGINFO;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);
 int testmode = 0;
 char aic_fw_path[200];
diff --git a/src/SDIO/patch/for_Rockchip/3326/Android8/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c b/src/SDIO/patch/for_Rockchip/3326/Android8/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c
index 3323d35..78616aa 100644
--- a/src/SDIO/patch/for_Rockchip/3326/Android8/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/SDIO/patch/for_Rockchip/3326/Android8/mod/kernel/drivers/net/wireless/rockchip_wlan/aic8800/aic8800_fdrv/rwnx_main.c
@@ -502,7 +502,7 @@ static const int rwnx_hwq2uapsd[NL80211_NUM_ACS] = {

 extern uint8_t scanning;
-int aicwf_dbg_level = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);
 int testmode = 0;
 char aic_fw_path[200];
diff --git a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.c b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.c
index ea11b22..f2994af 100644
--- a/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic8800_fdrv/rwnx_main.c
@@ -521,7 +521,7 @@ extern uint8_t p2p_working;
 struct semaphore aicwf_deinit_sem;
 atomic_t aicwf_deinit_atomic;

-int aicwf_dbg_level = LOGERROR|LOGINFO;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);

 int testmode = 0;
diff --git a/src/USB/driver_fw/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c b/src/USB/driver_fw/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c
index be05052..69f23f0 100644
--- a/src/USB/driver_fw/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c
+++ b/src/USB/driver_fw/drivers/aic8800/aic_load_fw/aic_bluetooth_main.c
@@ -20,7 +20,7 @@ int adap_test = 0;
 char paringid[100];
 int n_para = 1;
 int ble_scan_wakeup_reboot_time = 1000;
-int aicwf_dbg_level = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
+int aicwf_dbg_level = LOGERROR;
 int flash_erase_len = 0x400000;
 uint32_t ad_data_filter_mask = 0;
 uint32_t gpio_num = 2;//default select gpiob2 for fw_wakeup_host
diff --git a/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c b/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c
index 1750604..974d1ae 100644
--- a/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_main.c
@@ -528,7 +528,7 @@ extern uint8_t p2p_working;
 struct semaphore aicwf_deinit_sem;
 atomic_t aicwf_deinit_atomic;

-int aicwf_dbg_level = LOGERROR|LOGINFO;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);

 int testmode = 0;
diff --git a/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic_load_fw/aic_bluetooth_main.c b/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic_load_fw/aic_bluetooth_main.c
index 3062147..f8ae667 100644
--- a/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic_load_fw/aic_bluetooth_main.c
+++ b/src/USB/patch/for_Allwinner/A40/Android7/patch/mod/lichee/linux-3.10/drivers/net/wireless/aic8800/aic_load_fw/aic_bluetooth_main.c
@@ -18,7 +18,7 @@ int adap_test = 0;
 char paringid[100];
 int n_para = 1;
 int ble_scan_wakeup_reboot_time = 1000;
-int aicwf_dbg_level = LOGERROR|LOGINFO|LOGDEBUG|LOGTRACE;
+int aicwf_dbg_level = LOGERROR;
 uint32_t ad_data_filter_mask = 0;

 module_param(aicwf_dbg_level, int, 0660);
diff --git a/src/USB/patch/for_Hi/352/Android9/mod/device/hisilicon/bigfish/sdk/source/component/wifi/drv/usb_aic8800d/aic8800/aic8800_fdrv/rwnx_main.c b/src/USB/patch/for_Hi/352/Android9/mod/device/hisilicon/bigfish/sdk/source/component/wifi/drv/usb_aic8800d/aic8800/aic8800_fdrv/rwnx_main.c
index 91f681a..ba1a468 100644
--- a/src/USB/patch/for_Hi/352/Android9/mod/device/hisilicon/bigfish/sdk/source/component/wifi/drv/usb_aic8800d/aic8800/aic8800_fdrv/rwnx_main.c
+++ b/src/USB/patch/for_Hi/352/Android9/mod/device/hisilicon/bigfish/sdk/source/component/wifi/drv/usb_aic8800d/aic8800/aic8800_fdrv/rwnx_main.c
@@ -497,7 +497,7 @@ extern uint8_t p2p_working;
 struct semaphore aicwf_deinit_sem;
 atomic_t aicwf_deinit_atomic;

-int aicwf_dbg_level = LOGERROR|LOGINFO;
+int aicwf_dbg_level = LOGERROR;
 module_param(aicwf_dbg_level, int, 0660);
 int testmode = 0;
 char aic_fw_path[200];
-- 
2.25.1
CT1IQI commented 2 weeks ago

@Joshua-Riek Thanks. Actually figured out, with initial help of Radxa' Yuntian, that the logging can be suppressed without recompiling, but it is not intuitive. The loading of a kernel driver with parameters can be set in a .conf file in /etc/modprobe.d. Tried that and it had no effect whatsoever initially. It turned out to be because the driver name, as used and shown in lsusb, rmmod etc. is not the name part of the driver file .ko. The aic8800 package has the same basic drivers for different interfaces. Via the dkms system a suffix is appended to the driver filename name part: like _usb.ko in case of the USB interface present on the Rock 5C board that I use. Setting the aicwf_dbg_level=0 for the drivers with filenames aic8800_fdrv_usb, aic_load_fw_usb in a .conf file does work! It is still an open issue. We'll see if this way of naming drivers will stay or be altered. Personally find it very confusing to find that a driver with name X is not loaded from a file with name X.ko.