Hello NXP Team,
We have successfully integrated the "SD-WLAN-SD-BT-8997-U16-MMC-W16.68.10.p162-16.26.10.p162-C4X16693_V4-MGPL" driver into Android 12 Linux 4.9.178 on our custom BG5CT-based platform. With this updated driver integrated into our image, we aimed to test Wi-Fi connections on specific channels using the country code=FR on the client side.
To achieve this, we added the parameter "reg_alpha2=FR" to the script responsible for loading the drivers. After making these changes, we conducted testing under various conditions.
Condition 1:
Condition 2:
According to condition 1 When no AP is connected and Wi-Fi is OFF command "$iw reg get" should result in "Country US: DFS-FCC."
Our requirement: We want the Country code set as FR for all times irrespective of whether the wifi is ON or OFF and AP connected or NOT connected.
Question: After adding the "reg_alpha2=FR" Parameter to the script do we need to add any other parameter or make changes to the business logic of the code?
During our debugging, we found one IOCTL file named: /mlinux/moal_ioctl.c with a default condition in a function to set the region as the "US".
Hi, @virti_choksi
Hope you are doing well and thanks for choosing NXP products.
If I am correct, you prefer to use 88W8997 in STA mode.
In connection state: the country code will be decided by the AP which 88W8997 connected to.
If you want to set the country code and keep it valid even Wi-Fi off or Not connect to any AP, you can set it when insmod driver, like below:
insmod cfg80211.ko ieee80211_regdom=US
In this way, you need to compile cfg80211 to separate .ko and insmod it separately. The country code will be written into cfg80211 database.
Please let me know if you still have any other queries.
Best regards,
Christine.
Hello Christine,
I hope you're doing well too, and thank you for your assistance with NXP products.
Yes, you are correct; I prefer using the 88W8997 in STA mode. Your explanation about the country code in the connection state makes sense. However, I do have a couple of questions regarding setting the country code:
- I want to set the country code with the reg_alpha2 parameter through the script which is responsible for loading the driver how can I set it with that parameter?
Thank you for your assistance, and I appreciate your prompt response.
Best regards,
Virti Choksi
Hi, @virti_choksi
Thanks for your feedback.
Yes, In common you can use reg_alpha2 parameter to set regulatory domain when load Wi-Fi driver as you are using reg_alpha2=FR. But this commands has complex code logic, like different Linux kernel version, cntry_txpwr, NL80211_REGDOM_SET_BY_DRIVER and something else.
Usually we don't suggest to use reg_alpha2, but with iw commands to set country code.
iw reg set FR
Best regards,
Christine.
Hello @Christine_Li,
Thank you for the response.
We attempted to set the country code using the "iw" command.
We identified a parameter, "country_ie_ignore," with the following options:
We added the "country_ie_ignore=1" parameter to the script responsible for loading the drivers. Subsequently, we attempted to set the country code using the "iw" utility. After making these changes, we followed a couple of steps to verify the applied modifications:
Method 1: Without setting the country code.
Method 2: Setting the country code with the commands:
However, the setting is sustained for the particular session only, and we need to set the country code every time after the device is rebooted.
Question: How can we set the country code permanently?
Hi, @virti_choksi
Thanks for your trying.
But we don't suggest you to set country code permanently because after 88W8997 connected to one AP, it should follow the AP's settings.
Hope my explanation be helpful for you.
Best regards,
Christine.
Hi, @virti_choksi
Anything I can do for you on this case?
I am not sure whether I misunderstood your meaning, if you mean only set permanently before connected to AP. You can use the method I mentioned before:
insmod cfg80211.ko ieee80211_regdom=FR
In this way, you need to compile cfg80211 to separate .ko and insmod it separately. The country code will be written into cfg80211 database.
For Android, the default cfg80211.ko file will be built into:
out/target/product/your host product/obj/KERNEL_OBJ/net/wireless/
Please let me know if you still have any other queries.
Best regards,
Christine.
Hello @Christine_Li,
Thank you for your response.
Sorry for the late reply. I am working on your suggestion.
I will be testing it next week and let you know.
Best Regards,
Virti Choksi
Hello @Christine_Li,
I apologize for the delay in my response.
I was successfully able to insert the cfg80211.ko module, but unfortunately, I am unable to scan the WiFi SSID on UI as well as through command line.
Here are the steps I followed:
1. I changed the module setting to loadable using "make menuconfig."
2. I added the module to the "atv_s_9344727/device/synaptics/sequoia/BoardConfig.mk" file.
3. I also added the module to the script responsible for loading the modules.
4. Then, I triggered the build and flashed the image to the DUT.
5. Upon flashing the image, I verified that the inserted modules were present.
6. Then, using the wpa_cli utility, I attempted to scan the SSID, but I could not initiate a scan.
Here is the content of the wpa_supplicant.conf file.
My question is: Is there a specific sequence to follow while inserting the module, or did we miss any steps during the module insertion process?
I have also attached the log file below
Hi, @virti_choksi
Thanks for your feedback.
I checked your logs, and seems that Wi-Fi driver wasn't loaded successfully.
And I saw your menuconfig that have compiled cfg80211 into a module and you have built it into a cfg80211.ko file. After that insmod the ko to your board, but could you please insmod Wi-Fi driver(8997mlan.ko and sd8997.ko and bt driver:bt8xxx.ko )later after the board is ready to have a try?
Actually, I didn't meet this kind of issue before.
Or you can have a try with copy the cfg80211.ko,8997mlan.ko ,sd8997.ko and bt driver:bt8xxx.ko to /lib/modules/?
Then check the /lib/firmware/nxp/ whether has related FW.
I am so sorry to let you know that we will start our National vacation from 29th/Sep-7th/Oct.
We will be back to office 8th/Oct.
Once case is closed automatically, please feel free to reopen it.
We could not reply you very frequently during vacation but we will try to answer back to you as quickly as we can, please help to understand that.
Best regards,
Christine.
Hello @Christine_Li ,
We attempted to insert the drivers after the board was ready, but the issue still persists.
All the .ko files are at /vendor/lib/modules/.
I also checked for the driver firmware binary at /vendor/firmware/nxp/.
Can we set the parameter "ieee80211_regdom=FR" if the cfg80211 module is built as a kernel module instead of a loadable module? if yes how can we set it in the source code?
On the DUT we also observed that "ieee80211_regdom" is READ-ONLY.
Best Regards,
Virit Choksi
Hi, @virti_choksi
Have you load Wi-Fi driver successfully?
If you load Wi-Fi driver with ieee80211_regdom=FR, then it will be written into /sys/module/cfg80211/parameters/ieee80211_regdom.
Yes, this file is Read-only in default.
If you want to change to another country code, you may need to rmmod and insmod Wi-Fi driver again with the new country code.
Best regards,
Christine.
Hi, @virti_choksi
I did a local test on 88W9098 instead of 88W8997 for you. I believe the working method should be same with 88W8997.
Please refer to my test steps and test results in the attachment.
Hope my test can help you somehow.
I also tested the scan function and connected to AP, it can work well.
Best regards,
Christine.
Hi, @virti_choksi
Does it work well on your side refer to my test steps?
Hope it can help you somehow.
If still need further support, please let me know.
Best regards,
Christine.
Hi, @virti_choksi
Anything else I can help you on this case?
If no, this thread will be closed automatically.
Best regards,
Christine.
Hello, @Christine_Li,
As you suggested in the document you shared, I attempted to run the wpa_supplicant manually. It partially worked because I could scan the SSID through the command line. However, I encountered an issue where I couldn't scan the SSID from the UI.
Here is the content of the wpa_supplicant.conf file.
Additionally, I'd like to know if there is a way to scan the SSID automatically without having to enable the wpa_supplicant utility manually, as it was working before we loaded the cfg80211.ko module at runtime?
Best Regards,
Virti Choksi
Hi, @virti_choksi
1. Can you please check whether you have changed the boot.img after compiling the cfg80211 into module?
2. Please check and make sure you add the cfg80211.ko to load driver script, should be init.insmod.sh
3.Please make sure only start one wpa_supplicant service. Android will start this service automatically when device booted, if you start one time in the command line, then please reboot your device and try to scan in UI.
4.After above checking, if the issue is still exist, please help to provide related logcat.log, then I will check it further.
Best regards,
Christine.
Hi, @virti_choksi
You can also have a try with below method:
Edit file:vendor/nxp-opensource/kernel_imx/net/wireless/reg.c:
static char *ieee80211_regdom = "00";
to:
static char *ieee80211_regdom = "FR";
In this way, it is not necessary to compile cfg80211 to module, keep it compile into kernel.
Try this way, please!
Best regards,
Christine.
Hi, @virti_choksi
How about re-enable Wi-Fi on the UI after disable it?
After re-enable, still can not scan SSID?
Let me have a try with Android platform tomorrow and let you know the result.
I tested it on Linux before, It worked fine as my test result attached to you.
Best regards,
Christine.