Country code defined in ISO-3166 alpha2 (two-character format) is commonly used to abbreviate country names in the world.

一、Country Code

Country Code information can be given to driver from:

  1. DefaultCountryTable field in WCNSS_qcom_wlan_nv.bin - read during driver initialization
  2. gStaCountryCode parameter in WCNSS_qcom_cfg.ini – read during driver initialization to replace default country code in WCNSS_qcom_wlan_nv.bin
  3. Country IE from AP defined by 802.11d – information given by AP
  4. “iw reg set” command – set from userspace application over cfg80211 interface
  5. Private IOCTL with “COUNTRY” command – set from userspace app

gCountryCodePriority
gCountryCodePriority is a flag that can be defined in WCNSS_qcom_cfg.ini
to decide the preferred priority of Country Code information between userspace commands
(either over cfg80211 interface or wext interface) and 802.11d; the value can be 1 or 0.

1 – Country Code information from userspace commands takes priority
Overall priority would be userspace commands > 802.11d > gStaCountryCode in WCNSS_qcom_cfg.ini >
DefaultCountryTable in WCNSS_qcom_wlan_nv.bin

0 – Country Code information from 802.11d takes priority
Overall priority would be 802.11d > userspace commands > gStaCountryCode in WCNSS_qcom_cfg.ini >
DefaultCountryTable in WCNSS_qcom_wlan_nv.bin

二、Country Code Configuration

1. WCNSS_qcom_wlan_nv.bin
Country code is saved in CountryCode attribute of DefaultCountryTable field and considered as default country code of the device

<DefaultCountryTable><RegulatoryDomain Map="0:FCC,1:ETSI,2:JAPAN,3:WORLD,4:N_AMER_EXC_FCC,5:APAC,6:KOREA,7:HI_5GHZ,8:NO_5GHZ">3</RegulatoryDomain><CountryCode><Value>48</Value> // 48=0x30=‘0’<Value>48</Value> // 48=0x30=‘0’<Value>73</Value> // 73=0x49=‘I’ for indoor</CountryCode>
</DefaultCountryTable>
or
<defaultCountryTable><regDomain>0</regDomain><countryCode><countryCode_value Index="0">67</countryCode_value><countryCode_value Index="1">78</countryCode_value><countryCode_value Index="2">73</countryCode_value></countryCode>
</defaultCountryTable>
// 67 = 0x43 = ‘C’
// 78 = 0x4E = ‘N’
// 73 = 0x49 = ‘I’ for indoor

## Third character is optional and valid characters can be ‘O’ for outdoor, ‘I’ for Indoor, or ’ ’ (space)

2. WCNSS_qcom_cfg.ini
gStaCountryCode = 000

If gStaCountryCode parameter in WCNSS_qcom_cfg.ini is configured and not the same as “000”, the country code set in gStaCountryCode parameter will replace the default country code in WCNSS_qcom_wlan_nv.bin during driver initialization

3. Country Code from Country IE from AP Defined by 802.11d
As defined by 802.11d, AP would bring Country Information Element with country code, channel and power limit information

g11dSupportEnabled is the flag in WCNSS_qcom_cfg.ini to enable 802.11d support in WCN driver.
If the value is set to 1 (enable), driver will internally trigger scan request with passive scan during driver initialization to look for country
information; default value is 1

gEnableBypass11d flag in WCNSS_qcom_cfg.ini can be set to bypass triggering driver internal 802.11d passive scan during initialization.
With the value set to 1, WCN driver would do active scan based on the allowable regulatory channels
without doing passive scan. It can improve the initial scan time; default value is 1

4. Country Code from NL80211 Command
iw set reg <CountryCode> is the command to test NL80211 interface setting country code information

5. IW Tool ( iwpriv/iwlist )
For iwpriv/iwlist, they are open-souce tools known as wirelesss tool.
How to get it ? ====> Please see link: https://blog.csdn.net/Ciellee/article/details/88046465

三、User Space Command

here are some command for usre space to set or get Country Code

iw reg set           //such as "iw reg set CN"
iw reg get          //will get current country code and channel info. /kernel/net/wireless/db.txt
iwpriv wlan0 getChannelList         //this command will print all of the channel you support now;
wpa_cli -i wlan0 driver COUNTRY CN  //change to CN
  • 四、ISO 3166

    ISO 3166 is the International Standard for country codes and codes for their subdivisions.
    Example:

    See the links below for details:
    https://baike.baidu.com/item/ISO 3166-1/5269555?fr=aladdin

    五、Other cfg80211’s algorithm

    more detail,Please see link:
    https://wireless.wiki.kernel.org/en/developers/Regulatory/processing_rules#Country_definition

Article from [80-Y0476-2 Rev. J]

[转载]Qualcomm Wlan Country Code相关推荐

  1. Qualcomm Wlan Country Code

    Country code defined in ISO-3166 alpha2 (two-character format) is commonly used to abbreviate countr ...

  2. wlan源码中Country Code 与 regDomain的对应关系表

    Country Code 与 regDomain 的对应关系表在文件中wlan/hal/ah_regdomain_common.h中的数组ahCmnAllCountries[] 中第一个是成员是Cou ...

  3. MCC 移动设备国家代码 (Mobile country code) 概述 MCC 国家/地区代码 注释 概述 移动设备国家代码 ( Mobile country code / MCC ) 定义于国际

    MCC 移动设备国家代码 (Mobile country code) 概述 MCC 国家/地区代码 注释 概述 移动设备国家代码 ( Mobile country code / MCC ) 定义于国际 ...

  4. js智能截取带前缀手机号的country code

    手机号的解析引用了Google的两个工具包,项目地址: https://github.com/google/closure-library https://github.com/google/libp ...

  5. 修改country code定制wifi支持的channel

    在mcu\custom\drv\wifi\project name\wndrv_configure.c中 #define COUNTRY_CODE_EU (((kal_uint16) 'E' < ...

  6. camera country code, sale code

    sale code  和 country code 结合判断 1. shutter sound private static final String PERSIST_SALES_CODE = Sys ...

  7. 手机定位技术术语收录之-MCC(Mobile Country Code,移动国家号码)

    MCC(Mobile Country Code,移动国家号码),用于唯一地标识移动客户属于的国家.它由三位十进制数组成(000-999),例如我国的MCC为460.

  8. 树莓派4b与Manjaro,安装、配置、修复WiFi频段5G和Country Code

    树莓派4b与Manjaro,安装.配置.修复WiFi频段5G和Country Code 安装Manjaro到树莓派4b 下载Manjaro 烧录系统到SD卡并启动 修复无线网络5G频段 更新软件仓库 ...

  9. [转载]Android Wi-Fi 设置country code的调用流程(博通芯片为base)

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/xiaoxiangyuhai/artic ...

最新文章

  1. python录入学生信息网_干货满满 | Python趣味编程教学实践
  2. ionic3实战之—Radio传值
  3. Div+CSS布局入门教程(一) 页面布局与规划
  4. 监听器Listener
  5. mysql查询语句内连接、左连接、右连接以及全连接查询
  6. SQL笔试经典50题及答案解析(题目41-50)
  7. 操作 神通数据库_神通大型通用数据库
  8. 江苏计算机一级考试操作题题库,江苏省计算机一级考试填空题题库
  9. 无为而无不为——论老子哲学的深度悖论(转载)
  10. linux发行版本号列举,查看Linux发行版的名称及其版本号
  11. Python excel转成html页面 excel 在线预览
  12. ps国画效果案例制作教程和思路介绍
  13. 如何找回OneNote 误删、丢失的笔记
  14. Spring AOP源码分析二
  15. 关于卸载流氓软件的通用办法
  16. 格雷希尔GripSeal外螺纹快速连接器的优点和注意事项
  17. 复星医药2020年实现营业收入人民币303亿元,同比增长6%
  18. 90.网络安全渗透测试—[常规漏洞挖掘与利用篇6]—[文件包含-PHP封装伪协议详解实战示例]
  19. Vue项目 .env .env.development .env.production 配置说明
  20. 计算机图形学基础—坐标系

热门文章

  1. 一个无知oier的娱乐——我的游戏开发经历
  2. [龙讯4号]龙芯图谋你的客厅
  3. python excel处理重复行并统计个数_懂Excel就能轻松入门Python数据分析包pandas(五):重复值处理...
  4. 天创速盈:运营核心之测图测款, 拼多多测图测款怎么操作?
  5. 自学 Python后端开发 到什么程度可以找工作
  6. InitialContext和lookup(转)
  7. 向日葵开机棒使用教程
  8. nginx php 开启伪静态,nginx网站伪静态设置
  9. 记一次完整的RPG Maker MV游戏逆向过程(准备阶段)
  10. listbox 表头自动换行_WPF让ListView或ListBox中的WrapPanel 自动换行