Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: networking: convert regulatory.txt to ReST

- add SPDX header;
- adjust title markup;
- mark code blocks and literals as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mauro Carvalho Chehab and committed by
David S. Miller
98661e0c bad5b6e2

+19 -13
+1
Documentation/networking/index.rst
··· 98 98 radiotap-headers 99 99 ray_cs 100 100 rds 101 + regulatory 101 102 102 103 .. only:: subproject and html 103 104
+17 -12
Documentation/networking/regulatory.txt Documentation/networking/regulatory.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ======================================= 1 4 Linux wireless regulatory documentation 2 - --------------------------------------- 5 + ======================================= 3 6 4 7 This document gives a brief review over how the Linux wireless 5 8 regulatory infrastructure works. ··· 60 57 61 58 http://wireless.kernel.org/en/users/Documentation/iw 62 59 63 - An example: 60 + An example:: 64 61 65 62 # set regulatory domain to "Costa Rica" 66 63 iw reg set CR ··· 107 104 108 105 This example comes from the zd1211rw device driver. You can start 109 106 by having a mapping of your device's EEPROM country/regulatory 110 - domain value to a specific alpha2 as follows: 107 + domain value to a specific alpha2 as follows:: 111 108 112 - static struct zd_reg_alpha2_map reg_alpha2_map[] = { 109 + static struct zd_reg_alpha2_map reg_alpha2_map[] = { 113 110 { ZD_REGDOMAIN_FCC, "US" }, 114 111 { ZD_REGDOMAIN_IC, "CA" }, 115 112 { ZD_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */ ··· 119 116 { ZD_REGDOMAIN_FRANCE, "FR" }, 120 117 121 118 Then you can define a routine to map your read EEPROM value to an alpha2, 122 - as follows: 119 + as follows:: 123 120 124 - static int zd_reg2alpha2(u8 regdomain, char *alpha2) 125 - { 121 + static int zd_reg2alpha2(u8 regdomain, char *alpha2) 122 + { 126 123 unsigned int i; 127 124 struct zd_reg_alpha2_map *reg_map; 128 125 for (i = 0; i < ARRAY_SIZE(reg_alpha2_map); i++) { ··· 134 131 } 135 132 } 136 133 return 1; 137 - } 134 + } 138 135 139 136 Lastly, you can then hint to the core of your discovered alpha2, if a match 140 137 was found. You need to do this after you have registered your wiphy. You 141 138 are expected to do this during initialization. 139 + 140 + :: 142 141 143 142 r = zd_reg2alpha2(mac->regdomain, alpha2); 144 143 if (!r) ··· 161 156 Bellow is a simple example, with a regulatory domain cached using the stack. 162 157 Your implementation may vary (read EEPROM cache instead, for example). 163 158 164 - Example cache of some regulatory domain 159 + Example cache of some regulatory domain:: 165 160 166 - struct ieee80211_regdomain mydriver_jp_regdom = { 161 + struct ieee80211_regdomain mydriver_jp_regdom = { 167 162 .n_reg_rules = 3, 168 163 .alpha2 = "JP", 169 164 //.alpha2 = "99", /* If I have no alpha2 to map it to */ ··· 178 173 NL80211_RRF_NO_IR| 179 174 NL80211_RRF_DFS), 180 175 } 181 - }; 176 + }; 182 177 183 - Then in some part of your code after your wiphy has been registered: 178 + Then in some part of your code after your wiphy has been registered:: 184 179 185 180 struct ieee80211_regdomain *rd; 186 181 int size_of_regd;
+1 -1
MAINTAINERS
··· 193 193 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git 194 194 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 195 195 F: Documentation/driver-api/80211/cfg80211.rst 196 - F: Documentation/networking/regulatory.txt 196 + F: Documentation/networking/regulatory.rst 197 197 F: include/linux/ieee80211.h 198 198 F: include/net/cfg80211.h 199 199 F: include/net/ieee80211_radiotap.h