€•NdŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ)/translations/zh_CN/networking/regulatory”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/zh_TW/networking/regulatory”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/networking/regulatory”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/networking/regulatory”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/networking/regulatory”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/pt_BR/networking/regulatory”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/sp_SP/networking/regulatory”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒC/var/lib/git/docbuild/linux/Documentation/networking/regulatory.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ'Linux wireless regulatory documentation”h]”hŒ'Linux wireless regulatory documentation”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)”}”(hŒ_This document gives a brief review over how the Linux wireless regulatory infrastructure works.”h]”hŒ_This document gives a brief review over how the Linux wireless regulatory infrastructure works.”…””}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)”}”(hŒFMore up to date information can be obtained at the project's web page:”h]”hŒHMore up to date information can be obtained at the project’s web page:”…””}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhÞ)”}”(hŒ9https://wireless.wiki.kernel.org/en/developers/Regulatory”h]”hŒ reference”“”)”}”(hhýh]”hŒ9https://wireless.wiki.kernel.org/en/developers/Regulatory”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”hýuh1hÿhhûubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ'Keeping regulatory domains in userspace”h]”hŒ'Keeping regulatory domains in userspace”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KubhÞ)”}”(hŒõDue to the dynamic nature of regulatory domains we keep them in userspace and provide a framework for userspace to upload to the kernel one regulatory domain to be used as the central core regulatory domain all wireless devices should adhere to.”h]”hŒõDue to the dynamic nature of regulatory domains we keep them in userspace and provide a framework for userspace to upload to the kernel one regulatory domain to be used as the central core regulatory domain all wireless devices should adhere to.”…””}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjh²hubeh}”(h]”Œ'keeping-regulatory-domains-in-userspace”ah ]”h"]”Œ'keeping regulatory domains in userspace”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ+How to get regulatory domains to the kernel”h]”hŒ+How to get regulatory domains to the kernel”…””}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj<h²hh³hÇh´KubhÞ)”}”(hŒßWhen the regulatory domain is first set up, the kernel will request a database file (regulatory.db) containing all the regulatory rules. It will then use that database when it needs to look up the rules for a given country.”h]”hŒßWhen the regulatory domain is first set up, the kernel will request a database file (regulatory.db) containing all the regulatory rules. It will then use that database when it needs to look up the rules for a given country.”…””}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj<h²hubeh}”(h]”Œ+how-to-get-regulatory-domains-to-the-kernel”ah ]”h"]”Œ+how to get regulatory domains to the kernel”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ?How to get regulatory domains to the kernel (old CRDA solution)”h]”hŒ?How to get regulatory domains to the kernel (old CRDA solution)”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjch²hh³hÇh´KubhÞ)”}”(hŒ°Userspace gets a regulatory domain in the kernel by having a userspace agent build it and send it via nl80211. Only expected regulatory domains will be respected by the kernel.”h]”hŒ°Userspace gets a regulatory domain in the kernel by having a userspace agent build it and send it via nl80211. Only expected regulatory domains will be respected by the kernel.”…””}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K!hjch²hubhÞ)”}”(hŒA currently available userspace agent which can accomplish this is CRDA - central regulatory domain agent. Its documented here:”h]”hŒA currently available userspace agent which can accomplish this is CRDA - central regulatory domain agent. Its documented here:”…””}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K%hjch²hubhÞ)”}”(hŒ>https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA”h]”j)”}”(hj’h]”hŒ>https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA”…””}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j’uh1hÿhjubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K(hjch²hubhÞ)”}”(hŒÚEssentially the kernel will send a udev event when it knows it needs a new regulatory domain. A udev rule can be put in place to trigger crda to send the respective regulatory domain for a specific ISO/IEC 3166 alpha2.”h]”hŒÚEssentially the kernel will send a udev event when it knows it needs a new regulatory domain. A udev rule can be put in place to trigger crda to send the respective regulatory domain for a specific ISO/IEC 3166 alpha2.”…””}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K*hjch²hubhÞ)”}”(hŒ0Below is an example udev rule which can be used:”h]”hŒ0Below is an example udev rule which can be used:”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K/hjch²hubhÞ)”}”(hŒ•# Example file, should be put in /etc/udev/rules.d/regulatory.rules KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/crda"”h]”hŒ¥# Example file, should be put in /etc/udev/rules.d/regulatory.rules KERNEL==â€regulatory*â€, ACTION==â€changeâ€, SUBSYSTEM==â€platformâ€, RUN+=â€/sbin/crda—…””}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K1hjch²hubhÞ)”}”(hŒKThe alpha2 is passed as an environment variable under the variable COUNTRY.”h]”hŒKThe alpha2 is passed as an environment variable under the variable COUNTRY.”…””}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K4hjch²hubeh}”(h]”Œ=how-to-get-regulatory-domains-to-the-kernel-old-crda-solution”ah ]”h"]”Œ?how to get regulatory domains to the kernel (old crda solution)”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ Who asks for regulatory domains?”h]”hŒ Who asks for regulatory domains?”…””}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjèh²hh³hÇh´K7ubhŒ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒUsers ”h]”hÞ)”}”(hŒUsers”h]”hŒUsers”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K9hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jþhjûh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jùh³hÇh´K9hjèh²hubhÞ)”}”(hŒUsers can use iw:”h]”hŒUsers can use iw:”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K;hjèh²hubhÞ)”}”(hŒ:https://wireless.wiki.kernel.org/en/users/Documentation/iw”h]”j)”}”(hj0h]”hŒ:https://wireless.wiki.kernel.org/en/users/Documentation/iw”…””}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j0uh1hÿhj.ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K=hjèh²hubhÞ)”}”(hŒ An example::”h]”hŒ An example:”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K?hjèh²hubhŒ literal_block”“”)”}”(hŒ5# set regulatory domain to "Costa Rica" iw reg set CR”h]”hŒ5# set regulatory domain to "Costa Rica" iw reg set CR”…””}”hjVsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jTh³hÇh´KAhjèh²hubhÞ)”}”(hŒÖThis will request the kernel to set the regulatory domain to the specified alpha2. The kernel in turn will then ask userspace to provide a regulatory domain for the alpha2 specified by the user by sending a uevent.”h]”hŒÖThis will request the kernel to set the regulatory domain to the specified alpha2. The kernel in turn will then ask userspace to provide a regulatory domain for the alpha2 specified by the user by sending a uevent.”…””}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KDhjèh²hubjú)”}”(hhh]”jÿ)”}”(hŒ5Wireless subsystems for Country Information elements ”h]”hÞ)”}”(hŒ4Wireless subsystems for Country Information elements”h]”hŒ4Wireless subsystems for Country Information elements”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KIhjuubah}”(h]”h ]”h"]”h$]”h&]”uh1jþhjrh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”jjuh1jùh³hÇh´KIhjèh²hubhÞ)”}”(hŒŒThe kernel will send a uevent to inform userspace a new regulatory domain is required. More on this to be added as its integration is added.”h]”hŒŒThe kernel will send a uevent to inform userspace a new regulatory domain is required. More on this to be added as its integration is added.”…””}”(hj“h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KKhjèh²hubjú)”}”(hhh]”jÿ)”}”(hŒDrivers ”h]”hÞ)”}”(hŒDrivers”h]”hŒDrivers”…””}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KOhj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1jþhj¡h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”jjuh1jùh³hÇh´KOhjèh²hubhÞ)”}”(hXjIf drivers determine they need a specific regulatory domain set they can inform the wireless core using regulatory_hint(). They have two options -- they either provide an alpha2 so that crda can provide back a regulatory domain for that country or they can build their own regulatory domain based on internal custom knowledge so the wireless core can respect it.”h]”hXjIf drivers determine they need a specific regulatory domain set they can inform the wireless core using regulatory_hint(). They have two options -- they either provide an alpha2 so that crda can provide back a regulatory domain for that country or they can build their own regulatory domain based on internal custom knowledge so the wireless core can respect it.”…””}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KQhjèh²hubhÞ)”}”(hXà*Most* drivers will rely on the first mechanism of providing a regulatory hint with an alpha2. For these drivers there is an additional check that can be used to ensure compliance based on custom EEPROM regulatory data. This additional check can be used by drivers by registering on its struct wiphy a reg_notifier() callback. This notifier is called when the core's regulatory domain has been changed. The driver can use this to review the changes made and also review who made them (driver, user, country IE) and determine what to allow based on its internal EEPROM data. Devices drivers wishing to be capable of world roaming should use this callback. More on world roaming will be added to this document when its support is enabled.”h]”(hŒemphasis”“”)”}”(hŒ*Most*”h]”hŒMost”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔhjÐubhXÜ drivers will rely on the first mechanism of providing a regulatory hint with an alpha2. For these drivers there is an additional check that can be used to ensure compliance based on custom EEPROM regulatory data. This additional check can be used by drivers by registering on its struct wiphy a reg_notifier() callback. This notifier is called when the core’s regulatory domain has been changed. The driver can use this to review the changes made and also review who made them (driver, user, country IE) and determine what to allow based on its internal EEPROM data. Devices drivers wishing to be capable of world roaming should use this callback. More on world roaming will be added to this document when its support is enabled.”…””}”(hjÐh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KXhjèh²hubhÞ)”}”(hŒÔDevice drivers who provide their own built regulatory domain do not need a callback as the channels registered by them are the only ones that will be allowed and therefore *additional* channels cannot be enabled.”h]”(hŒ¬Device drivers who provide their own built regulatory domain do not need a callback as the channels registered by them are the only ones that will be allowed and therefore ”…””}”(hjîh²hh³Nh´NubjÕ)”}”(hŒ *additional*”h]”hŒ additional”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔhjîubhŒ channels cannot be enabled.”…””}”(hjîh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kdhjèh²hubeh}”(h]”Œwho-asks-for-regulatory-domains”ah ]”h"]”Œ who asks for regulatory domains?”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K7ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ)Example code - drivers hinting an alpha2:”h]”hŒ)Example code - drivers hinting an alpha2:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KjubhÞ)”}”(hŒ¯This example comes from the zd1211rw device driver. You can start by having a mapping of your device's EEPROM country/regulatory domain value to a specific alpha2 as follows::”h]”hŒ°This example comes from the zd1211rw device driver. You can start by having a mapping of your device’s EEPROM country/regulatory domain value to a specific alpha2 as follows:”…””}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Klhjh²hubjU)”}”(hXXstatic struct zd_reg_alpha2_map reg_alpha2_map[] = { { ZD_REGDOMAIN_FCC, "US" }, { ZD_REGDOMAIN_IC, "CA" }, { ZD_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */ { ZD_REGDOMAIN_JAPAN, "JP" }, { ZD_REGDOMAIN_JAPAN_ADD, "JP" }, { ZD_REGDOMAIN_SPAIN, "ES" }, { ZD_REGDOMAIN_FRANCE, "FR" },”h]”hXXstatic struct zd_reg_alpha2_map reg_alpha2_map[] = { { ZD_REGDOMAIN_FCC, "US" }, { ZD_REGDOMAIN_IC, "CA" }, { ZD_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */ { ZD_REGDOMAIN_JAPAN, "JP" }, { ZD_REGDOMAIN_JAPAN_ADD, "JP" }, { ZD_REGDOMAIN_SPAIN, "ES" }, { ZD_REGDOMAIN_FRANCE, "FR" },”…””}”hj5sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jTh³hÇh´Kphjh²hubhÞ)”}”(hŒVThen you can define a routine to map your read EEPROM value to an alpha2, as follows::”h]”hŒUThen you can define a routine to map your read EEPROM value to an alpha2, as follows:”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kyhjh²hubjU)”}”(hX×static int zd_reg2alpha2(u8 regdomain, char *alpha2) { unsigned int i; struct zd_reg_alpha2_map *reg_map; for (i = 0; i < ARRAY_SIZE(reg_alpha2_map); i++) { reg_map = ®_alpha2_map[i]; if (regdomain == reg_map->reg) { alpha2[0] = reg_map->alpha2[0]; alpha2[1] = reg_map->alpha2[1]; return 0; } } return 1; }”h]”hX×static int zd_reg2alpha2(u8 regdomain, char *alpha2) { unsigned int i; struct zd_reg_alpha2_map *reg_map; for (i = 0; i < ARRAY_SIZE(reg_alpha2_map); i++) { reg_map = ®_alpha2_map[i]; if (regdomain == reg_map->reg) { alpha2[0] = reg_map->alpha2[0]; alpha2[1] = reg_map->alpha2[1]; return 0; } } return 1; }”…””}”hjQsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jTh³hÇh´K|hjh²hubhÞ)”}”(hŒÃLastly, you can then hint to the core of your discovered alpha2, if a match was found. You need to do this after you have registered your wiphy. You are expected to do this during initialization.”h]”hŒÃLastly, you can then hint to the core of your discovered alpha2, if a match was found. You need to do this after you have registered your wiphy. You are expected to do this during initialization.”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K‹hjh²hubjU)”}”(hŒ^r = zd_reg2alpha2(mac->regdomain, alpha2); if (!r) regulatory_hint(hw->wiphy, alpha2);”h]”hŒ^r = zd_reg2alpha2(mac->regdomain, alpha2); if (!r) regulatory_hint(hw->wiphy, alpha2);”…””}”hjmsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jTh³hÇh´K‘hjh²hubeh}”(h]”Œ&example-code-drivers-hinting-an-alpha2”ah ]”h"]”Œ)example code - drivers hinting an alpha2:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KjubhÉ)”}”(hhh]”(hÎ)”}”(hŒ>Example code - drivers providing a built in regulatory domain:”h]”hŒ>Example code - drivers providing a built in regulatory domain:”…””}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjƒh²hh³hÇh´K–ubhÞ)”}”(hŒJ[NOTE: This API is not currently available, it can be added when required]”h]”hŒJ[NOTE: This API is not currently available, it can be added when required]”…””}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K˜hjƒh²hubhÞ)”}”(hXIf you have regulatory information you can obtain from your driver and you *need* to use this we let you build a regulatory domain structure and pass it to the wireless core. To do this you should kmalloc() a structure big enough to hold your regulatory domain structure and you should then fill it with your data. Finally you simply call regulatory_hint() with the regulatory domain structure in it.”h]”(hŒKIf you have regulatory information you can obtain from your driver and you ”…””}”(hj¢h²hh³Nh´NubjÕ)”}”(hŒ*need*”h]”hŒneed”…””}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔhj¢ubhX? to use this we let you build a regulatory domain structure and pass it to the wireless core. To do this you should kmalloc() a structure big enough to hold your regulatory domain structure and you should then fill it with your data. Finally you simply call regulatory_hint() with the regulatory domain structure in it.”…””}”(hj¢h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kšhjƒh²hubhÞ)”}”(hŒ’Below is a simple example, with a regulatory domain cached using the stack. Your implementation may vary (read EEPROM cache instead, for example).”h]”hŒ’Below is a simple example, with a regulatory domain cached using the stack. Your implementation may vary (read EEPROM cache instead, for example).”…””}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¡hjƒh²hubhÞ)”}”(hŒ)Example cache of some regulatory domain::”h]”hŒ(Example cache of some regulatory domain:”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¤hjƒh²hubjU)”}”(hXrstruct ieee80211_regdomain mydriver_jp_regdom = { .n_reg_rules = 3, .alpha2 = "JP", //.alpha2 = "99", /* If I have no alpha2 to map it to */ .reg_rules = { /* IEEE 802.11b/g, channels 1..14 */ REG_RULE(2412-10, 2484+10, 40, 6, 20, 0), /* IEEE 802.11a, channels 34..48 */ REG_RULE(5170-10, 5240+10, 40, 6, 20, NL80211_RRF_NO_IR), /* IEEE 802.11a, channels 52..64 */ REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_NO_IR| NL80211_RRF_DFS), } };”h]”hXrstruct ieee80211_regdomain mydriver_jp_regdom = { .n_reg_rules = 3, .alpha2 = "JP", //.alpha2 = "99", /* If I have no alpha2 to map it to */ .reg_rules = { /* IEEE 802.11b/g, channels 1..14 */ REG_RULE(2412-10, 2484+10, 40, 6, 20, 0), /* IEEE 802.11a, channels 34..48 */ REG_RULE(5170-10, 5240+10, 40, 6, 20, NL80211_RRF_NO_IR), /* IEEE 802.11a, channels 52..64 */ REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_NO_IR| NL80211_RRF_DFS), } };”…””}”hjÞsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jTh³hÇh´K¦hjƒh²hubhÞ)”}”(hŒEThen in some part of your code after your wiphy has been registered::”h]”hŒDThen in some part of your code after your wiphy has been registered:”…””}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K·hjƒh²hubjU)”}”(hX0struct ieee80211_regdomain *rd; int size_of_regd; int num_rules = mydriver_jp_regdom.n_reg_rules; unsigned int i; size_of_regd = sizeof(struct ieee80211_regdomain) + (num_rules * sizeof(struct ieee80211_reg_rule)); rd = kzalloc(size_of_regd, GFP_KERNEL); if (!rd) return -ENOMEM; memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain)); for (i=0; i < num_rules; i++) memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i], sizeof(struct ieee80211_reg_rule)); regulatory_struct_hint(rd);”h]”hX0struct ieee80211_regdomain *rd; int size_of_regd; int num_rules = mydriver_jp_regdom.n_reg_rules; unsigned int i; size_of_regd = sizeof(struct ieee80211_regdomain) + (num_rules * sizeof(struct ieee80211_reg_rule)); rd = kzalloc(size_of_regd, GFP_KERNEL); if (!rd) return -ENOMEM; memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain)); for (i=0; i < num_rules; i++) memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i], sizeof(struct ieee80211_reg_rule)); regulatory_struct_hint(rd);”…””}”hjúsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jTh³hÇh´K¹hjƒh²hubeh}”(h]”Œ;example-code-drivers-providing-a-built-in-regulatory-domain”ah ]”h"]”Œ>example code - drivers providing a built in regulatory domain:”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K–ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ'Statically compiled regulatory database”h]”hŒ'Statically compiled regulatory database”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KÎubhÞ)”}”(hŒ‰When a database should be fixed into the kernel, it can be provided as a firmware file at build time that is then linked into the kernel.”h]”hŒ‰When a database should be fixed into the kernel, it can be provided as a firmware file at build time that is then linked into the kernel.”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÐhjh²hubeh}”(h]”Œ'statically-compiled-regulatory-database”ah ]”h"]”Œ'statically compiled regulatory database”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KÎubeh}”(h]”Œ'linux-wireless-regulatory-documentation”ah ]”h"]”Œ'linux wireless regulatory documentation”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jbŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j<j9j9j6j`j]jåjâjjj€j}j j j4j1uŒ nametypes”}”(j<‰j9‰j`‰jå‰j‰j€‰j ‰j4‰uh}”(j9hÊj6jj]j<jâjcjjèj}jj jƒj1juŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.