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. ISO Country Code - 标准国家码

    英文地址:http://dev.maxmind.com/geoip/legacy/codes/iso3166/ A1,"Anonymous Proxy" A2,"Sate ...

最新文章

  1. 构建插件式的应用程序框架(六)----通讯机制(ZT)
  2. php 文件结尾 ?> 可以省略的情况
  3. java boolean是什么_java中的boolean与Boolean有什么不同
  4. oracle查看物化视图的索引,oracle – 物化视图中的域索引返回零行
  5. iOS 将16进制字符串转换成UIColor
  6. linux anaconda搜索路径,Anaconda安装及虚拟环境搭建教程(linux)
  7. C#基于RabbitMQ实现客户端之间消息通讯实战演练
  8. 疯狂的程序员 1-10
  9. 【转】【CN五一装机版】GhostXP_SP3电脑公司通用版v19.2装机版NTFS
  10. 焕然一新的 Vue 3 中文文档来了,附送50张学习思维图
  11. 什么?你连个三色渐变圆角按钮都需要UI切图?
  12. MatlabR2014a安装工具包
  13. win10下MySQL无法运行问题
  14. spry菜单栏(一)
  15. c语言stdlib函数库,C语言函数库——stdlib.h
  16. 回归分析详解:一文说清回归、线性回归、非线性回归、Logistic回归
  17. java连接SQL Sever数据库(超详细!)
  18. Win 7 家庭普通版系统升级密钥
  19. sg11 mysql7.1_服务器安装SG11扩展多版本(宝塔+通用版本)详细教程
  20. java caeser_IDEA配置SSM(Spring-Spring MVC-MyBatis)环境(maven)教程-实现一个简单的API

热门文章

  1. windows10专业版命令激活、学生电脑左下角图标点了没反应
  2. 【转载】旅行商问题(华为笔试蜜蜂采蜜问题)
  3. keil编写的程序一直在startup_XXXX.s中等待,进不到main函数。有效的解决办法
  4. [转载]流程图画法总结
  5. 由爱而生,由生而爱,生生不息
  6. RapidShare的下载方法
  7. java 信使服务_1.简单化-信使messenger+集合型参数(collecting parameter)
  8. 海思HI35xx CPU温度监测
  9. 短视频如何制作?简单三步来帮忙,打好基础是关键
  10. Flash AllowScriptAccess 参数