1 /* 2 * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /** 20 * DOC: reg_services_public_struct.h 21 * This file contains regulatory data structures 22 */ 23 24 #ifndef __REG_SERVICES_PUBLIC_STRUCT_H_ 25 #define __REG_SERVICES_PUBLIC_STRUCT_H_ 26 27 #define REG_SBS_SEPARATION_THRESHOLD 100 28 29 #ifdef CONFIG_BAND_6GHZ 30 #define REG_MAX_CHANNELS_PER_OPERATING_CLASS 70 31 /* 32 * These tx-power macros are present till the 6G regdomains are defined to 33 * support tx-power values for various client types. 34 */ 35 #define REG_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT (-1) /* dBm */ 36 #define REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 5 /* dBm */ 37 #define REG_EIRP_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 24 /* dBm */ 38 #else 39 #define REG_MAX_CHANNELS_PER_OPERATING_CLASS 28 40 #endif 41 42 #define REG_MAX_SUPP_OPER_CLASSES 32 43 #define REG_MAX_CHAN_CHANGE_CBKS 30 44 #define REG_INVALID_TXPOWER 255 45 #define MAX_STA_VDEV_CNT 4 46 #define INVALID_VDEV_ID 0xFF 47 #define INVALID_CHANNEL_NUM 0x0 48 #define CH_AVOID_MAX_RANGE 4 49 #define REG_ALPHA2_LEN 2 50 #define MAX_REG_RULES 10 51 52 #define REGULATORY_CHAN_DISABLED BIT(0) 53 #define REGULATORY_CHAN_NO_IR BIT(1) 54 #define REGULATORY_CHAN_RADAR BIT(3) 55 #define REGULATORY_CHAN_NO_OFDM BIT(6) 56 #define REGULATORY_CHAN_INDOOR_ONLY BIT(9) 57 #define REGULATORY_CHAN_AFC BIT(13) 58 59 #define REGULATORY_CHAN_NO_HT40 BIT(4) 60 #define REGULATORY_CHAN_NO_80MHZ BIT(7) 61 #define REGULATORY_CHAN_NO_160MHZ BIT(8) 62 #define REGULATORY_CHAN_NO_20MHZ BIT(11) 63 #define REGULATORY_CHAN_NO_10MHZ BIT(12) 64 #define REGULATORY_CHAN_INVALID BIT(14) 65 66 #define REGULATORY_PHYMODE_NO11A BIT(0) 67 #define REGULATORY_PHYMODE_NO11B BIT(1) 68 #define REGULATORY_PHYMODE_NO11G BIT(2) 69 #define REGULATORY_CHAN_NO11N BIT(3) 70 #define REGULATORY_PHYMODE_NO11AC BIT(4) 71 #define REGULATORY_PHYMODE_NO11AX BIT(5) 72 73 #define BW_5_MHZ 5 74 #define BW_10_MHZ 10 75 #define BW_20_MHZ 20 76 #define BW_25_MHZ 25 77 #define BW_40_MHZ 40 78 #define BW_80_MHZ 80 79 #define BW_160_MHZ 160 80 #define BW_40_MHZ 40 81 82 /** 83 * enum dfs_reg - DFS region 84 * @DFS_UNINIT_REGION: un-initialized region 85 * @DFS_FCC_REGION: FCC region 86 * @DFS_ETSI_REGION: ETSI region 87 * @DFS_MKK_REGION: MKK region 88 * @DFS_CN_REGION: China region 89 * @DFS_KR_REGION: Korea region 90 * @DFS_MKK_REGION: MKKN region 91 * that supports updated W53 RADAR pattern 92 * detection. 93 * @DFS_UNDEF_REGION: Undefined region 94 */ 95 96 enum dfs_reg { 97 DFS_UNINIT_REGION = 0, 98 DFS_FCC_REGION = 1, 99 DFS_ETSI_REGION = 2, 100 DFS_MKK_REGION = 3, 101 DFS_CN_REGION = 4, 102 DFS_KR_REGION = 5, 103 DFS_MKKN_REGION = 6, 104 DFS_UNDEF_REGION = 0xFFFF, 105 }; 106 107 /** enum op_class_table_num 108 * OP_CLASS_US- Class corresponds to US 109 * OP_CLASS_EU- Class corresponds to EU 110 * OP_CLASS_JAPAN- Class corresponds to JAPAN 111 * OP_CLASS_GLOBAL- Class corresponds to GLOBAL 112 * OP_CLASS_CHINA- Class corresponds to CHINA 113 */ 114 enum op_class_table_num { 115 OP_CLASS_US = 1, 116 OP_CLASS_EU, 117 OP_CLASS_JAPAN, 118 OP_CLASS_GLOBAL, 119 OP_CLASS_CHINA 120 }; 121 122 /** 123 * enum channel_enum - channel enumeration 124 * @CHAN_ENUM_2412: channel with freq 2412 125 * @CHAN_ENUM_2417: channel with freq 2417 126 * @CHAN_ENUM_2422: channel with freq 2422 127 * @CHAN_ENUM_2427: channel with freq 2427 128 * @CHAN_ENUM_2432: channel with freq 2432 129 * @CHAN_ENUM_2437: channel with freq 2437 130 * @CHAN_ENUM_2442: channel with freq 2442 131 * @CHAN_ENUM_2447: channel with freq 2447 132 * @CHAN_ENUM_2452: channel with freq 2452 133 * @CHAN_ENUM_2457: channel with freq 2457 134 * @CHAN_ENUM_2462: channel with freq 2462 135 * @CHAN_ENUM_2467: channel with freq 2467 136 * @CHAN_ENUM_2472: channel with freq 2472 137 * @CHAN_ENUM_2484: channel with freq 2484 138 * @CHAN_ENUM_4912: channel with freq 4912 139 * @CHAN_ENUM_4915: channel with freq 4915 140 * @CHAN_ENUM_4917: channel with freq 4917 141 * @CHAN_ENUM_4920: channel with freq 4920 142 * @CHAN_ENUM_4922: channel with freq 4922 143 * @CHAN_ENUM_4925: channel with freq 4925 144 * @CHAN_ENUM_4927: channel with freq 4927 145 * @CHAN_ENUM_4932: channel with freq 4932 146 * @CHAN_ENUM_4935: channel with freq 4935 147 * @CHAN_ENUM_4937: channel with freq 4937 148 * @CHAN_ENUM_4940: channel with freq 4940 149 * @CHAN_ENUM_4942: channel with freq 4942 150 * @CHAN_ENUM_4945: channel with freq 4945 151 * @CHAN_ENUM_4947: channel with freq 4947 152 * @CHAN_ENUM_4950: channel with freq 4950 153 * @CHAN_ENUM_4952: channel with freq 4952 154 * @CHAN_ENUM_4955: channel with freq 4955 155 * @CHAN_ENUM_4957: channel with freq 4957 156 * @CHAN_ENUM_4960: channel with freq 4960 157 * @CHAN_ENUM_4962: channel with freq 4962 158 * @CHAN_ENUM_4965: channel with freq 4965 159 * @CHAN_ENUM_4967: channel with freq 4967 160 * @CHAN_ENUM_4970: channel with freq 4970 161 * @CHAN_ENUM_4972: channel with freq 4972 162 * @CHAN_ENUM_4975: channel with freq 4975 163 * @CHAN_ENUM_4977: channel with freq 4977 164 * @CHAN_ENUM_4980: channel with freq 4980 165 * @CHAN_ENUM_4982: channel with freq 4982 166 * @CHAN_ENUM_4985: channel with freq 4985 167 * @CHAN_ENUM_4987: channel with freq 4987 168 * @CHAN_ENUM_5032: channel with freq 5032 169 * @CHAN_ENUM_5035: channel with freq 5035 170 * @CHAN_ENUM_5037: channel with freq 5037 171 * @CHAN_ENUM_5040: channel with freq 5040 172 * @CHAN_ENUM_5042: channel with freq 5042 173 * @CHAN_ENUM_5045: channel with freq 5045 174 * @CHAN_ENUM_5047: channel with freq 5047 175 * @CHAN_ENUM_5052: channel with freq 5052 176 * @CHAN_ENUM_5055: channel with freq 5055 177 * @CHAN_ENUM_5057: channel with freq 5057 178 * @CHAN_ENUM_5060: channel with freq 5060 179 * @CHAN_ENUM_5080: channel with freq 5080 180 * @CHAN_ENUM_5180: channel with freq 5180 181 * @CHAN_ENUM_5200: channel with freq 5200 182 * @CHAN_ENUM_5220: channel with freq 5220 183 * @CHAN_ENUM_5240: channel with freq 5240 184 * @CHAN_ENUM_5260: channel with freq 5260 185 * @CHAN_ENUM_5280: channel with freq 5280 186 * @CHAN_ENUM_5300: channel with freq 5300 187 * @CHAN_ENUM_5320: channel with freq 5320 188 * @CHAN_ENUM_5500: channel with freq 5500 189 * @CHAN_ENUM_5520: channel with freq 5520 190 * @CHAN_ENUM_5540: channel with freq 5540 191 * @CHAN_ENUM_5560: channel with freq 5560 192 * @CHAN_ENUM_5580: channel with freq 5580 193 * @CHAN_ENUM_5600: channel with freq 5600 194 * @CHAN_ENUM_5620: channel with freq 5620 195 * @CHAN_ENUM_5640: channel with freq 5640 196 * @CHAN_ENUM_5660: channel with freq 5660 197 * @CHAN_ENUM_5680: channel with freq 5680 198 * @CHAN_ENUM_5700: channel with freq 5700 199 * @CHAN_ENUM_5720: channel with freq 5720 200 * @CHAN_ENUM_5745: channel with freq 5745 201 * @CHAN_ENUM_5765: channel with freq 5765 202 * @CHAN_ENUM_5785: channel with freq 5785 203 * @CHAN_ENUM_5805: channel with freq 5805 204 * @CHAN_ENUM_5825: channel with freq 5825 205 * @CHAN_ENUM_5845: channel with freq 5845 206 * @CHAN_ENUM_5850: channel with freq 5850 207 * @CHAN_ENUM_5855: channel with freq 5855 208 * @CHAN_ENUM_5860: channel with freq 5860 209 * @CHAN_ENUM_5865: channel with freq 5865 210 * @CHAN_ENUM_5870: channel with freq 5870 211 * @CHAN_ENUM_5875: channel with freq 5875 212 * @CHAN_ENUM_5880: channel with freq 5880 213 * @CHAN_ENUM_5885: channel with freq 5885 214 * @CHAN_ENUM_5890: channel with freq 5890 215 * @CHAN_ENUM_5895: channel with freq 5895 216 * @CHAN_ENUM_5900: channel with freq 5900 217 * @CHAN_ENUM_5905: channel with freq 5905 218 * @CHAN_ENUM_5910: channel with freq 5910 219 * @CHAN_ENUM_5915: channel with freq 5915 220 * @CHAN_ENUM_5920: channel with freq 5920 221 * @CHAN_ENUM_5935: channel with freq 5935 222 * @CHAN_ENUM_5955: channel with freq 5955 223 * @CHAN_ENUM_5975: channel with freq 5975 224 * @CHAN_ENUM_5995: channel with freq 5995 225 * @CHAN_ENUM_6015: channel with freq 6015 226 * @CHAN_ENUM_6035: channel with freq 6035 227 * @CHAN_ENUM_6055: channel with freq 6055 228 * @CHAN_ENUM_6075: channel with freq 6075 229 * @CHAN_ENUM_6095: channel with freq 6095 230 * @CHAN_ENUM_6115: channel with freq 6115 231 * @CHAN_ENUM_6135: channel with freq 6135 232 * @CHAN_ENUM_6155: channel with freq 6155 233 * @CHAN_ENUM_6175: channel with freq 6175 234 * @CHAN_ENUM_6195: channel with freq 6195 235 * @CHAN_ENUM_6215: channel with freq 6215 236 * @CHAN_ENUM_6235: channel with freq 6235 237 * @CHAN_ENUM_6255: channel with freq 6255 238 * @CHAN_ENUM_6275: channel with freq 6275 239 * @CHAN_ENUM_6295: channel with freq 6295 240 * @CHAN_ENUM_6315: channel with freq 6315 241 * @CHAN_ENUM_6335: channel with freq 6335 242 * @CHAN_ENUM_6355: channel with freq 6355 243 * @CHAN_ENUM_6375: channel with freq 6375 244 * @CHAN_ENUM_6395: channel with freq 6395 245 * @CHAN_ENUM_6415: channel with freq 6415 246 * @CHAN_ENUM_6435: channel with freq 6435 247 * @CHAN_ENUM_6455: channel with freq 6455 248 * @CHAN_ENUM_6475: channel with freq 6475 249 * @CHAN_ENUM_6495: channel with freq 6495 250 * @CHAN_ENUM_6515: channel with freq 6515 251 * @CHAN_ENUM_6535: channel with freq 6535 252 * @CHAN_ENUM_6555: channel with freq 6555 253 * @CHAN_ENUM_6575: channel with freq 6575 254 * @CHAN_ENUM_6595: channel with freq 6595 255 * @CHAN_ENUM_6615: channel with freq 6615 256 * @CHAN_ENUM_6635: channel with freq 6635 257 * @CHAN_ENUM_6655: channel with freq 6655 258 * @CHAN_ENUM_6675: channel with freq 6675 259 * @CHAN_ENUM_6695: channel with freq 6695 260 * @CHAN_ENUM_6715: channel with freq 6715 261 * @CHAN_ENUM_6735: channel with freq 6735 262 * @CHAN_ENUM_6755: channel with freq 6755 263 * @CHAN_ENUM_6775: channel with freq 6775 264 * @CHAN_ENUM_6795: channel with freq 6795 265 * @CHAN_ENUM_6815: channel with freq 6815 266 * @CHAN_ENUM_6835: channel with freq 6835 267 * @CHAN_ENUM_6855: channel with freq 6855 268 * @CHAN_ENUM_6875: channel with freq 6875 269 * @CHAN_ENUM_6895: channel with freq 6895 270 * @CHAN_ENUM_6915: channel with freq 6915 271 * @CHAN_ENUM_6935: channel with freq 6935 272 * @CHAN_ENUM_6955: channel with freq 6955 273 * @CHAN_ENUM_6975: channel with freq 6975 274 * @CHAN_ENUM_6995: channel with freq 6995 275 * @CHAN_ENUM_7015: channel with freq 7015 276 * @CHAN_ENUM_7035: channel with freq 7035 277 * @CHAN_ENUM_7055: channel with freq 7055 278 * @CHAN_ENUM_7075: channel with freq 7075 279 * @CHAN_ENUM_7095: channel with freq 7095 280 * @CHAN_ENUM_7115: channel with freq 7115 281 */ 282 enum channel_enum { 283 CHAN_ENUM_2412, 284 CHAN_ENUM_2417, 285 CHAN_ENUM_2422, 286 CHAN_ENUM_2427, 287 CHAN_ENUM_2432, 288 CHAN_ENUM_2437, 289 CHAN_ENUM_2442, 290 CHAN_ENUM_2447, 291 CHAN_ENUM_2452, 292 CHAN_ENUM_2457, 293 CHAN_ENUM_2462, 294 CHAN_ENUM_2467, 295 CHAN_ENUM_2472, 296 CHAN_ENUM_2484, 297 #ifdef CONFIG_49GHZ_CHAN 298 CHAN_ENUM_4912, 299 CHAN_ENUM_4915, 300 CHAN_ENUM_4917, 301 CHAN_ENUM_4920, 302 CHAN_ENUM_4922, 303 CHAN_ENUM_4925, 304 CHAN_ENUM_4927, 305 CHAN_ENUM_4932, 306 CHAN_ENUM_4935, 307 CHAN_ENUM_4937, 308 CHAN_ENUM_4940, 309 CHAN_ENUM_4942, 310 CHAN_ENUM_4945, 311 CHAN_ENUM_4947, 312 CHAN_ENUM_4950, 313 CHAN_ENUM_4952, 314 CHAN_ENUM_4955, 315 CHAN_ENUM_4957, 316 CHAN_ENUM_4960, 317 CHAN_ENUM_4962, 318 CHAN_ENUM_4965, 319 CHAN_ENUM_4967, 320 CHAN_ENUM_4970, 321 CHAN_ENUM_4972, 322 CHAN_ENUM_4975, 323 CHAN_ENUM_4977, 324 CHAN_ENUM_4980, 325 CHAN_ENUM_4982, 326 CHAN_ENUM_4985, 327 CHAN_ENUM_4987, 328 CHAN_ENUM_5032, 329 CHAN_ENUM_5035, 330 CHAN_ENUM_5037, 331 CHAN_ENUM_5040, 332 CHAN_ENUM_5042, 333 CHAN_ENUM_5045, 334 CHAN_ENUM_5047, 335 CHAN_ENUM_5052, 336 CHAN_ENUM_5055, 337 CHAN_ENUM_5057, 338 CHAN_ENUM_5060, 339 CHAN_ENUM_5080, 340 #endif /* CONFIG_49GHZ_CHAN */ 341 CHAN_ENUM_5180, 342 CHAN_ENUM_5200, 343 CHAN_ENUM_5220, 344 CHAN_ENUM_5240, 345 CHAN_ENUM_5260, 346 CHAN_ENUM_5280, 347 CHAN_ENUM_5300, 348 CHAN_ENUM_5320, 349 CHAN_ENUM_5500, 350 CHAN_ENUM_5520, 351 CHAN_ENUM_5540, 352 CHAN_ENUM_5560, 353 CHAN_ENUM_5580, 354 CHAN_ENUM_5600, 355 CHAN_ENUM_5620, 356 CHAN_ENUM_5640, 357 CHAN_ENUM_5660, 358 CHAN_ENUM_5680, 359 CHAN_ENUM_5700, 360 CHAN_ENUM_5720, 361 CHAN_ENUM_5745, 362 CHAN_ENUM_5765, 363 CHAN_ENUM_5785, 364 CHAN_ENUM_5805, 365 CHAN_ENUM_5825, 366 CHAN_ENUM_5845, 367 #ifdef WLAN_FEATURE_DSRC 368 CHAN_ENUM_5850, 369 CHAN_ENUM_5855, 370 CHAN_ENUM_5860, 371 #endif 372 CHAN_ENUM_5865, 373 #ifdef WLAN_FEATURE_DSRC 374 CHAN_ENUM_5870, 375 CHAN_ENUM_5875, 376 CHAN_ENUM_5880, 377 #endif 378 CHAN_ENUM_5885, 379 #ifdef WLAN_FEATURE_DSRC 380 CHAN_ENUM_5890, 381 CHAN_ENUM_5895, 382 CHAN_ENUM_5900, 383 CHAN_ENUM_5905, 384 CHAN_ENUM_5910, 385 CHAN_ENUM_5915, 386 CHAN_ENUM_5920, 387 #endif /* WLAN_FEATURE_DSRC */ 388 #ifdef CONFIG_BAND_6GHZ 389 CHAN_ENUM_5935, 390 CHAN_ENUM_5955, 391 CHAN_ENUM_5975, 392 CHAN_ENUM_5995, 393 CHAN_ENUM_6015, 394 CHAN_ENUM_6035, 395 CHAN_ENUM_6055, 396 CHAN_ENUM_6075, 397 CHAN_ENUM_6095, 398 CHAN_ENUM_6115, 399 CHAN_ENUM_6135, 400 CHAN_ENUM_6155, 401 CHAN_ENUM_6175, 402 CHAN_ENUM_6195, 403 CHAN_ENUM_6215, 404 CHAN_ENUM_6235, 405 CHAN_ENUM_6255, 406 CHAN_ENUM_6275, 407 CHAN_ENUM_6295, 408 CHAN_ENUM_6315, 409 CHAN_ENUM_6335, 410 CHAN_ENUM_6355, 411 CHAN_ENUM_6375, 412 CHAN_ENUM_6395, 413 CHAN_ENUM_6415, 414 CHAN_ENUM_6435, 415 CHAN_ENUM_6455, 416 CHAN_ENUM_6475, 417 CHAN_ENUM_6495, 418 CHAN_ENUM_6515, 419 CHAN_ENUM_6535, 420 CHAN_ENUM_6555, 421 CHAN_ENUM_6575, 422 CHAN_ENUM_6595, 423 CHAN_ENUM_6615, 424 CHAN_ENUM_6635, 425 CHAN_ENUM_6655, 426 CHAN_ENUM_6675, 427 CHAN_ENUM_6695, 428 CHAN_ENUM_6715, 429 CHAN_ENUM_6735, 430 CHAN_ENUM_6755, 431 CHAN_ENUM_6775, 432 CHAN_ENUM_6795, 433 CHAN_ENUM_6815, 434 CHAN_ENUM_6835, 435 CHAN_ENUM_6855, 436 CHAN_ENUM_6875, 437 CHAN_ENUM_6895, 438 CHAN_ENUM_6915, 439 CHAN_ENUM_6935, 440 CHAN_ENUM_6955, 441 CHAN_ENUM_6975, 442 CHAN_ENUM_6995, 443 CHAN_ENUM_7015, 444 CHAN_ENUM_7035, 445 CHAN_ENUM_7055, 446 CHAN_ENUM_7075, 447 CHAN_ENUM_7095, 448 CHAN_ENUM_7115, 449 #endif /* CONFIG_BAND_6GHZ */ 450 451 NUM_CHANNELS, 452 453 MIN_CHANNEL = CHAN_ENUM_2412, 454 MAX_CHANNEL = (NUM_CHANNELS - 1), 455 456 MIN_24GHZ_CHANNEL = CHAN_ENUM_2412, 457 MAX_24GHZ_CHANNEL = CHAN_ENUM_2484, 458 NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1), 459 460 INVALID_CHANNEL = 0xBAD, 461 462 #ifdef CONFIG_49GHZ_CHAN 463 MIN_49GHZ_CHANNEL = CHAN_ENUM_4912, 464 MAX_49GHZ_CHANNEL = CHAN_ENUM_5080, 465 NUM_49GHZ_CHANNELS = (MAX_49GHZ_CHANNEL - MIN_49GHZ_CHANNEL + 1), 466 #else 467 MIN_49GHZ_CHANNEL = INVALID_CHANNEL, 468 MAX_49GHZ_CHANNEL = INVALID_CHANNEL, 469 NUM_49GHZ_CHANNELS = 0, 470 #endif /* CONFIG_49GHZ_CHAN */ 471 472 MIN_5GHZ_CHANNEL = CHAN_ENUM_5180, 473 MAX_5GHZ_CHANNEL = CHAN_ENUM_5885, 474 NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1), 475 476 #ifdef WLAN_FEATURE_DSRC 477 MIN_5GHZ_CHANNEL = CHAN_ENUM_5180, 478 MAX_5GHZ_CHANNEL = CHAN_ENUM_5920, 479 NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1), 480 481 MIN_DSRC_CHANNEL = CHAN_ENUM_5850, 482 MAX_DSRC_CHANNEL = CHAN_ENUM_5920, 483 NUM_DSRC_CHANNELS = (MAX_DSRC_CHANNEL - MIN_DSRC_CHANNEL + 1), 484 #endif 485 486 MIN_5DOT9_CHANNEL = CHAN_ENUM_5845, 487 MAX_5DOT9_CHANNEL = CHAN_ENUM_5885, 488 NUM_5DOT9_CHANNELS = (MAX_5DOT9_CHANNEL - MIN_5DOT9_CHANNEL + 1), 489 490 #ifdef CONFIG_49GHZ_CHAN 491 #define BAND_5GHZ_START_CHANNEL MIN_49GHZ_CHANNEL 492 #else 493 #define BAND_5GHZ_START_CHANNEL MIN_5GHZ_CHANNEL 494 #endif /* CONFIG_49GHZ_CHAN */ 495 496 #ifdef DISABLE_UNII_SHARED_BANDS 497 MIN_UNII_1_BAND_CHANNEL = CHAN_ENUM_5180, 498 MAX_UNII_1_BAND_CHANNEL = CHAN_ENUM_5240, 499 NUM_UNII_1_BAND_CHANNELS = (MAX_UNII_1_BAND_CHANNEL - 500 MIN_UNII_1_BAND_CHANNEL + 1), 501 502 MIN_UNII_2A_BAND_CHANNEL = CHAN_ENUM_5260, 503 MAX_UNII_2A_BAND_CHANNEL = CHAN_ENUM_5320, 504 NUM_UNII_2A_BAND_CHANNELS = (MAX_UNII_2A_BAND_CHANNEL - 505 MIN_UNII_2A_BAND_CHANNEL + 1), 506 #endif 507 508 #ifdef CONFIG_BAND_6GHZ 509 MIN_6GHZ_CHANNEL = CHAN_ENUM_5935, 510 MAX_6GHZ_CHANNEL = CHAN_ENUM_7115, 511 NUM_6GHZ_CHANNELS = (MAX_6GHZ_CHANNEL - MIN_6GHZ_CHANNEL + 1), 512 MIN_6GHZ_NON_ORPHAN_CHANNEL = CHAN_ENUM_5955, 513 #else 514 MIN_6GHZ_CHANNEL = INVALID_CHANNEL, 515 MAX_6GHZ_CHANNEL = INVALID_CHANNEL, 516 NUM_6GHZ_CHANNELS = 0, 517 MIN_6GHZ_NON_ORPHAN_CHANNEL = INVALID_CHANNEL, 518 #endif /* CONFIG_BAND_6GHZ */ 519 }; 520 521 /** 522 * enum channel_state - channel state 523 * @CHANNEL_STATE_DISABLE: disabled state 524 * @CHANNEL_STATE_PASSIVE: passive state 525 * @CHANNEL_STATE_DFS: dfs state 526 * @CHANNEL_STATE_ENABLE: enabled state 527 * @CHANNEL_STATE_INVALID: invalid state 528 */ 529 enum channel_state { 530 CHANNEL_STATE_DISABLE, 531 CHANNEL_STATE_PASSIVE, 532 CHANNEL_STATE_DFS, 533 CHANNEL_STATE_ENABLE, 534 CHANNEL_STATE_INVALID, 535 }; 536 537 /** 538 * enum reg_6g_ap_type - Regulatory AP type for regulatory info subfield. 539 * @REG_INDOOR_AP: Indoor AP 540 * @REG_STANDARD_POWER_AP: Standard Power AP 541 * @REG_MAX_SUPP_AP_TYPE: Current maximum AP power typer supported in the IEEE 542 * standard. 543 * @REG_MAX_AP_TYPE: Maximum value possible for (3 bits) regulatory info 544 * sub-field in the 6G HE Operation IE 545 */ 546 enum reg_6g_ap_type { 547 REG_INDOOR_AP = 0, 548 REG_STANDARD_POWER_AP = 1, 549 REG_MAX_SUPP_AP_TYPE = REG_STANDARD_POWER_AP, 550 REG_MAX_AP_TYPE = 7, 551 }; 552 553 /** 554 * enum reg_6g_client_type - Regulatory client type for max tx-power category 555 * @REG_DEFAULT_CLIENT: Default client 556 * @REG_SUBORDINATE_CLIENT: Subordinate client 557 * @REG_MAX_CLIENT_TYPE: Maximum value possible for max tx-power category 558 * (2 bits) sub-field in the TPE (Transmit Power Envelope) IE 559 */ 560 enum reg_6g_client_type { 561 REG_DEFAULT_CLIENT = 0, 562 REG_SUBORDINATE_CLIENT = 1, 563 REG_MAX_CLIENT_TYPE = 3, 564 }; 565 566 /** 567 * enum reg_domain: reg domain 568 * @REGDOMAIN_FCC: FCC domain 569 * @REGDOMAIN_ETSI: ETSI domain 570 * @REGDOMAIN_JAPAN: JAPAN domain 571 * @REGDOMAIN_WORLD: WORLD domain 572 * @REGDOMAIN_COUNT: Max domain 573 */ 574 typedef enum { 575 REGDOMAIN_FCC, 576 REGDOMAIN_ETSI, 577 REGDOMAIN_JAPAN, 578 REGDOMAIN_WORLD, 579 REGDOMAIN_COUNT 580 } v_REGDOMAIN_t; 581 582 /** 583 * enum ctl_value - CTL value 584 * @CTL_FCC: CTL FCC 585 * @CTL_MKK: CTL MKK 586 * @CTL_ETSI: CTL ETSI 587 * @CTL_KOR: CTL KOR 588 * @CTL_CHN: CTL CHINA 589 * @CTL_USER_DEF: CTL USER_DEF 590 * @CTL_NONE: CTL NONE 591 */ 592 enum ctl_value { 593 CTL_FCC = 0x10, 594 CTL_ETSI = 0x30, 595 CTL_MKK = 0x40, 596 CTL_KOR = 0x50, 597 CTL_CHN = 0x60, 598 CTL_USER_DEF = 0x70, 599 CTL_NONE = 0xff 600 }; 601 602 /** 603 * struct ch_params 604 * @ch_width: channel width 605 * @sec_ch_offset: secondary channel offset 606 * @center_freq_seg0: channel number for segment 0 607 * @center_freq_seg1: channel number segment 1 608 * @mhz_freq_seg0: Center frequency for segment 0 609 * @mhz_freq_seg1: Center frequency for segment 1 610 */ 611 struct ch_params { 612 enum phy_ch_width ch_width; 613 uint8_t sec_ch_offset; 614 uint8_t center_freq_seg0; 615 uint8_t center_freq_seg1; 616 qdf_freq_t mhz_freq_seg0; 617 qdf_freq_t mhz_freq_seg1; 618 }; 619 620 /** 621 * struct channel_power 622 * @center_freq: Channel Center Frequency 623 * @chan_num: channel number 624 * @tx_power: TX power 625 */ 626 struct channel_power { 627 qdf_freq_t center_freq; 628 uint8_t chan_num; 629 uint32_t tx_power; 630 }; 631 632 /** 633 * enum offset_t: channel offset 634 * @BW20: 20 mhz channel 635 * @BW40_LOW_PRIMARY: lower channel in 40 mhz 636 * @BW40_HIGH_PRIMARY: higher channel in 40 mhz 637 * @BW80: 80 mhz channel 638 * @BWALL: unknown bandwidth 639 */ 640 enum offset_t { 641 BW20 = 0, 642 BW40_LOW_PRIMARY = 1, 643 BW40_HIGH_PRIMARY = 3, 644 BW80, 645 BWALL, 646 BW_INVALID = 0xFF 647 }; 648 649 /** 650 * enum behav_limit - behavior limit 651 * @BEHAV_NONE: none 652 * @BEHAV_BW40_LOW_PRIMARY: BW40 low primary 653 * @BEHAV_BW40_HIGH_PRIMARY: BW40 high primary 654 * @BEHAV_BW80_PLUS: BW 80 plus 655 * @BEHAV_INVALID: invalid behavior 656 */ 657 enum behav_limit { 658 BEHAV_NONE, 659 BEHAV_BW40_LOW_PRIMARY, 660 BEHAV_BW40_HIGH_PRIMARY, 661 BEHAV_BW80_PLUS, 662 BEHAV_INVALID = 0xFF 663 }; 664 665 /** 666 * struct reg_dmn_op_class_map_t: operating class 667 * @op_class: operating class number 668 * @chan_spacing: channel spacing 669 * @offset: offset 670 * @behav_limit: OR of bitmaps of enum behav_limit 671 * @start_freq: starting frequency 672 * @channels: channel set 673 */ 674 struct reg_dmn_op_class_map_t { 675 uint8_t op_class; 676 uint8_t chan_spacing; 677 enum offset_t offset; 678 uint16_t behav_limit; 679 qdf_freq_t start_freq; 680 uint8_t channels[REG_MAX_CHANNELS_PER_OPERATING_CLASS]; 681 }; 682 683 /** 684 * struct regdmn_ap_cap_opclass_t: AP Cap operation class table 685 * @op_class: operating class number 686 * @ch_width: channel width in MHz 687 * @start_freq: Starting Frequency in MHz 688 * @behav_limit: OR of bitmaps of enum behav_limit 689 * @max_tx_pwr_dbm: Maximum tx power in dbm 690 * @num_supported_chan: Number of supported channels 691 * @num_non_supported_chan: Number of non-supported channels 692 * @sup_chan_list: Array of supported channel numbers 693 * @non_sup_chan_list: Array of non supported channel numbers 694 */ 695 struct regdmn_ap_cap_opclass_t { 696 uint8_t op_class; 697 uint8_t ch_width; 698 qdf_freq_t start_freq; 699 uint16_t behav_limit; 700 uint8_t max_tx_pwr_dbm; 701 uint8_t num_supported_chan; 702 uint8_t num_non_supported_chan; 703 uint8_t sup_chan_list[REG_MAX_CHANNELS_PER_OPERATING_CLASS]; 704 uint8_t non_sup_chan_list[REG_MAX_CHANNELS_PER_OPERATING_CLASS]; 705 }; 706 707 /** 708 * struct reg_dmn_supp_op_classes: operating classes 709 * @num_classes: number of classes 710 * @classes: classes 711 */ 712 struct reg_dmn_supp_op_classes { 713 uint8_t num_classes; 714 uint8_t classes[REG_MAX_SUPP_OPER_CLASSES]; 715 }; 716 717 /** 718 * struct reg_start_11d_scan_req: start 11d scan request 719 * @vdev_id: vdev id 720 * @scan_period_msec: scan duration in milli-seconds 721 * @start_interval_msec: offset duration to start the scan in milli-seconds 722 */ 723 struct reg_start_11d_scan_req { 724 uint8_t vdev_id; 725 uint32_t scan_period_msec; 726 uint32_t start_interval_msec; 727 }; 728 729 /** 730 * struct reg_11d_scan_msg: 11d scan message structure 731 * @psoc: pointer to psoc object 732 * @enable_11d_supp: enable 11d scan or disable 11d scan 733 */ 734 struct reg_11d_scan_msg { 735 struct wlan_objmgr_psoc *psoc; 736 bool enable_11d_supp; 737 }; 738 /** 739 * struct reg_stop_11d_scan_req: stop 11d scan request 740 * @vdev_id: vdev id 741 */ 742 struct reg_stop_11d_scan_req { 743 uint8_t vdev_id; 744 }; 745 746 /** 747 * struct reg_11d_new_country: regulatory 11d new coutry code 748 * @alpha2: new 11d alpha2 749 */ 750 struct reg_11d_new_country { 751 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 752 }; 753 754 /** 755 * enum country_src: country source 756 * @SOURCE_QUERY: source query 757 * @SOURCE_CORE: source regulatory core 758 * @SOURCE_DRIVER: source driver 759 * @SOURCE_USERSPACE: source userspace 760 * @SOURCE_11D: source 11D 761 */ 762 enum country_src { 763 SOURCE_UNKNOWN, 764 SOURCE_QUERY, 765 SOURCE_CORE, 766 SOURCE_DRIVER, 767 SOURCE_USERSPACE, 768 SOURCE_11D 769 }; 770 771 /** 772 * struct regulatory_channel 773 * @center_freq: center frequency 774 * @chan_num: channel number 775 * @state: channel state 776 * @chan_flags: channel flags 777 * @tx_power: TX powers 778 * @min_bw: min bandwidth 779 * @max_bw: max bandwidth 780 * @nol_chan: whether channel is nol 781 * @nol_history: Set NOL-History when STA vap detects RADAR. 782 */ 783 struct regulatory_channel { 784 qdf_freq_t center_freq; 785 uint8_t chan_num; 786 enum channel_state state; 787 uint32_t chan_flags; 788 uint32_t tx_power; 789 uint16_t min_bw; 790 uint16_t max_bw; 791 uint8_t ant_gain; 792 bool nol_chan; 793 bool nol_history; 794 }; 795 796 /** 797 * struct regulatory: regulatory information 798 * @reg_domain: regulatory domain pair 799 * @eeprom_rd_ext: eeprom value 800 * @country_code: current country in integer 801 * @alpha2: current alpha2 802 * @def_country: default country alpha2 803 * @def_region: DFS region 804 * @ctl_2g: 2G CTL value 805 * @ctl_5g: 5G CTL value 806 * @reg_pair: pointer to regulatory pair 807 * @cc_src: country code src 808 * @reg_flags: kernel regulatory flags 809 */ 810 struct regulatory { 811 uint32_t reg_domain; 812 uint32_t eeprom_rd_ext; 813 uint16_t country_code; 814 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 815 uint8_t ctl_2g; 816 uint8_t ctl_5g; 817 const void *regpair; 818 enum country_src cc_src; 819 uint32_t reg_flags; 820 }; 821 822 /** 823 * struct chan_map 824 * @center_freq: center freq in mhz 825 * @chan_num: channel number 826 * @min_bw: min bw 827 * @max_bw: max bw 828 */ 829 struct chan_map { 830 qdf_freq_t center_freq; 831 uint8_t chan_num; 832 uint16_t min_bw; 833 uint16_t max_bw; 834 }; 835 836 /** 837 * struct bonded_channel 838 * @start_ch: start channel 839 * @end_ch: end channel 840 */ 841 struct bonded_channel { 842 uint8_t start_ch; 843 uint8_t end_ch; 844 }; 845 846 /** 847 * struct bonded_channel_freq 848 * @start_freq: start channel frequency 849 * @end_freq: end channel frequency 850 */ 851 struct bonded_channel_freq { 852 uint16_t start_freq; 853 uint16_t end_freq; 854 }; 855 856 struct set_country { 857 uint8_t country[REG_ALPHA2_LEN + 1]; 858 uint8_t pdev_id; 859 }; 860 /** 861 * enum ht_sec_ch_offset 862 * @NO_SEC_CH: no secondary 863 * @LOW_PRIMARY_CH: low primary 864 * @HIGH_PRIMARY_CH: high primary 865 */ 866 enum ht_sec_ch_offset { 867 NO_SEC_CH = 0, 868 LOW_PRIMARY_CH = 1, 869 HIGH_PRIMARY_CH = 3, 870 }; 871 872 enum cc_setting_code { 873 REG_SET_CC_STATUS_PASS = 0, 874 REG_CURRENT_ALPHA2_NOT_FOUND = 1, 875 REG_INIT_ALPHA2_NOT_FOUND = 2, 876 REG_SET_CC_CHANGE_NOT_ALLOWED = 3, 877 REG_SET_CC_STATUS_NO_MEMORY = 4, 878 REG_SET_CC_STATUS_FAIL = 5, 879 }; 880 881 /** 882 * struct cur_reg_rule 883 * @start_freq: start frequency 884 * @end_freq: end frequency 885 * @max_bw: maximum bandwidth 886 * @reg_power: regulatory power 887 * @ant_gain: antenna gain 888 * @flags: regulatory flags 889 */ 890 struct cur_reg_rule { 891 uint16_t start_freq; 892 uint16_t end_freq; 893 uint16_t max_bw; 894 uint8_t reg_power; 895 uint8_t ant_gain; 896 uint16_t flags; 897 }; 898 899 /** 900 * struct cur_regulatory_info 901 * @psoc: psoc ptr 902 * @status_code: status value 903 * @num_phy: number of phy 904 * @phy_id: phy id 905 * @reg_dmn_pair: reg domain pair 906 * @reg_6g_superid: 6G super domain id 907 * @ctry_code: country code 908 * @alpha2: country alpha2 909 * @offload_enabled: offload enabled 910 * @dfs_reg: dfs region 911 * @phybitmap: phy bit map 912 * @min_bw_2g: minimum 2G bw 913 * @max_bw_2g: maximum 2G bw 914 * @min_bw_5g: minimum 5G bw 915 * @max_bw_5g: maximum 5G bw 916 * @num_2g_reg_rules: number 2G reg rules 917 * @num_5g_reg_rules: number 5G and 6G reg rules 918 * @reg_rules_2g_ptr: ptr to 2G reg rules 919 * @reg_rules_5g_ptr: ptr to 5G reg rules 920 */ 921 struct cur_regulatory_info { 922 struct wlan_objmgr_psoc *psoc; 923 enum cc_setting_code status_code; 924 uint8_t num_phy; 925 uint8_t phy_id; 926 uint16_t reg_dmn_pair; 927 uint16_t reg_6g_superid; 928 uint16_t ctry_code; 929 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 930 bool offload_enabled; 931 enum dfs_reg dfs_region; 932 uint32_t phybitmap; 933 uint32_t min_bw_2g; 934 uint32_t max_bw_2g; 935 uint32_t min_bw_5g; 936 uint32_t max_bw_5g; 937 uint32_t num_2g_reg_rules; 938 uint32_t num_5g_reg_rules; 939 struct cur_reg_rule *reg_rules_2g_ptr; 940 struct cur_reg_rule *reg_rules_5g_ptr; 941 }; 942 943 /** 944 * struct reg_rule_info 945 * @alpha2: alpha2 of reg rules 946 * @dfs_region: dfs region 947 * @num_of_reg_rules: number of reg rules 948 * @reg_rules: regulatory rules array 949 */ 950 struct reg_rule_info { 951 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 952 enum dfs_reg dfs_region; 953 uint8_t num_of_reg_rules; 954 struct cur_reg_rule reg_rules[MAX_REG_RULES]; 955 }; 956 957 /** 958 * enum reg_reg_wifi_band 959 * @REG_BAND_2G: 2G band 960 * @REG_BAND_5G: 5G band 961 * @REG_BAND_6G: 6G band 962 * @REG_BAND_UNKNOWN: Unsupported band 963 */ 964 enum reg_wifi_band { 965 REG_BAND_2G, 966 REG_BAND_5G, 967 REG_BAND_6G, 968 REG_BAND_UNKNOWN 969 }; 970 971 #ifdef DISABLE_UNII_SHARED_BANDS 972 /** 973 * enum reg_unii_band 974 * @REG_UNII_BAND_1: Disable UNII-1 band channels 975 * @REG_UNII_BAND_2A: Disable UNII-2A band channels 976 */ 977 enum reg_unii_band { 978 REG_UNII_BAND_1 = 0x0, 979 REG_UNII_BAND_2A = 0x1, 980 }; 981 #endif 982 983 #define REG_BAND_MASK_ALL (BIT(REG_BAND_2G) | BIT(REG_BAND_5G) \ 984 | BIT(REG_BAND_6G)) 985 986 /* Avoid the use of band_info as it does not support 6GHz band. Use 987 * reg_wifi_band, as it supports the 6GHz band 988 */ 989 /** 990 * enum band_info 991 * @BAND_ALL:all bands 992 * @BAND_2G: 2G band 993 * @BAND_5G: 5G band 994 * @BAND_UNKNOWN: Unsupported band 995 */ 996 enum band_info { 997 BAND_ALL, 998 BAND_2G, 999 BAND_5G, 1000 BAND_UNKNOWN 1001 }; 1002 1003 /** 1004 * enum restart_beaconing_on_ch_avoid_rule: control the beaconing entity to 1005 * move away from active LTE channels 1006 * @CH_AVOID_RULE_DO_NOT_RESTART: Do not move from active LTE 1007 * channels 1008 * @CH_AVOID_RULE_RESTART: Move from active LTE channels 1009 * @CH_AVOID_RULE_RESTART_24G_ONLY: move from 2.4G active LTE 1010 * channels only 1011 */ 1012 enum restart_beaconing_on_ch_avoid_rule { 1013 CH_AVOID_RULE_DO_NOT_RESTART, 1014 CH_AVOID_RULE_RESTART, 1015 CH_AVOID_RULE_RESTART_24G_ONLY, 1016 }; 1017 1018 /** 1019 * struct reg_config_vars 1020 * @enable_11d_support: enable 11d support 1021 * @scan_11d_interval: 11d scan interval in ms 1022 * @userspace_ctry_priority: user priority 1023 * @band_capability: band capability 1024 * @dfs_disable: dfs disabled 1025 * @indoor_channel_support: indoor channel support 1026 * @force_ssc_disable_indoor_channel: Disable indoor channel on sap start 1027 * @restart_beaconing: control the beaconing entity to move 1028 * away from active LTE channels 1029 * @enable_srd_chan_in_master_mode: SRD channel support in master mode 1030 * @enable_11d_in_world_mode: enable 11d in world mode 1031 * @enable_5dot9_ghz_chan_in_master_mode: 5.9 GHz channel support in 1032 * master mode 1033 * @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain. 1034 */ 1035 struct reg_config_vars { 1036 uint32_t enable_11d_support; 1037 uint32_t scan_11d_interval; 1038 uint32_t userspace_ctry_priority; 1039 uint32_t band_capability; 1040 uint32_t dfs_enabled; 1041 uint32_t indoor_chan_enabled; 1042 uint32_t force_ssc_disable_indoor_channel; 1043 enum restart_beaconing_on_ch_avoid_rule restart_beaconing; 1044 uint8_t enable_srd_chan_in_master_mode; 1045 bool enable_11d_in_world_mode; 1046 bool enable_5dot9_ghz_chan_in_master_mode; 1047 bool retain_nol_across_regdmn_update; 1048 }; 1049 1050 /** 1051 * struct reg_freq_range 1052 * @low_freq: low frequency 1053 * @high_freq: high frequency 1054 */ 1055 struct reg_freq_range { 1056 uint32_t low_freq; 1057 uint32_t high_freq; 1058 }; 1059 1060 /** 1061 * struct reg_sched_payload 1062 * @psoc: psoc ptr 1063 * @pdev: pdev ptr 1064 */ 1065 struct reg_sched_payload { 1066 struct wlan_objmgr_psoc *psoc; 1067 struct wlan_objmgr_pdev *pdev; 1068 }; 1069 1070 /** 1071 * enum direction 1072 * @NORTHBOUND: northbound 1073 * @SOUTHBOUND: southbound 1074 */ 1075 enum direction { 1076 NORTHBOUND, 1077 SOUTHBOUND, 1078 }; 1079 1080 /** 1081 * struct mas_chan_params 1082 * @dfs_region: dfs region 1083 * @phybitmap: phybitmap 1084 * @mas_chan_list: master chan list 1085 * @default_country: default country 1086 * @current_country: current country 1087 * @def_region_domain: default reg domain 1088 * @def_country_code: default country code 1089 * @reg_dmn_pair: reg domain pair 1090 * @ctry_code: country code 1091 * @reg_rules: regulatory rules 1092 */ 1093 struct mas_chan_params { 1094 enum dfs_reg dfs_region; 1095 uint32_t phybitmap; 1096 struct regulatory_channel mas_chan_list[NUM_CHANNELS]; 1097 char default_country[REG_ALPHA2_LEN + 1]; 1098 char current_country[REG_ALPHA2_LEN + 1]; 1099 uint16_t def_region_domain; 1100 uint16_t def_country_code; 1101 uint32_t reg_dmn_pair; 1102 uint16_t ctry_code; 1103 struct reg_rule_info reg_rules; 1104 }; 1105 1106 /** 1107 * enum cc_regdmn_flag: Regdomain flags 1108 * @INVALID: Invalid flag 1109 * @CC_IS_SET: Country code is set 1110 * @REGDMN_IS_SET: Regdomain ID is set 1111 * @ALPHA_IS_SET: Country ISO is set 1112 */ 1113 enum cc_regdmn_flag { 1114 INVALID_CC, 1115 CC_IS_SET, 1116 REGDMN_IS_SET, 1117 ALPHA_IS_SET, 1118 }; 1119 1120 /** 1121 * struct cc_regdmn_s: User country code or regdomain 1122 * @country_code: Country code 1123 * @reg_2g_5g_pair_id: Regdomain pair ID (2Ghz + 5Ghz domain pair) 1124 * @sixg_superdmn_id: 6Ghz super domain id 1125 * @alpha: Country ISO 1126 * @flags: Regdomain flags 1127 */ 1128 struct cc_regdmn_s { 1129 union { 1130 uint16_t country_code; 1131 struct { 1132 uint16_t reg_2g_5g_pair_id; 1133 uint16_t sixg_superdmn_id; 1134 } regdmn; 1135 uint8_t alpha[REG_ALPHA2_LEN + 1]; 1136 } cc; 1137 uint8_t flags; 1138 }; 1139 1140 /** 1141 * struct cur_regdmn_info: Current regulatory info 1142 * @regdmn_pair_id: Current regdomain pair ID 1143 * @dmn_id_2g: 2GHz regdomain ID 1144 * @dmn_id_5g: 5GHz regdomain ID 1145 * @ctl_2g: 2GHz CTL value 1146 * @ctl_5g: 5GHzCTL value 1147 * @dfs_region: dfs region 1148 */ 1149 struct cur_regdmn_info { 1150 uint16_t regdmn_pair_id; 1151 uint16_t dmn_id_2g; 1152 uint16_t dmn_id_5g; 1153 uint8_t ctl_2g; 1154 uint8_t ctl_5g; 1155 uint8_t dfs_region; 1156 }; 1157 1158 /** 1159 * struct ch_avoid_freq_type 1160 * @start_freq: start freq 1161 * @end_freq: end freq 1162 */ 1163 struct ch_avoid_freq_type { 1164 qdf_freq_t start_freq; 1165 qdf_freq_t end_freq; 1166 }; 1167 1168 /** 1169 * struct ch_avoid_ind_type 1170 * @ch_avoid_range_cnt: count 1171 * @avoid_freq_range: avoid freq range array 1172 */ 1173 struct ch_avoid_ind_type { 1174 uint32_t ch_avoid_range_cnt; 1175 struct ch_avoid_freq_type avoid_freq_range[CH_AVOID_MAX_RANGE]; 1176 }; 1177 1178 /** 1179 * struct unsafe_ch_list 1180 * @chan_cnt: no.of channels 1181 * @chan_freq_list: channel frequency list 1182 */ 1183 struct unsafe_ch_list { 1184 uint16_t chan_cnt; 1185 uint16_t chan_freq_list[NUM_CHANNELS]; 1186 }; 1187 1188 /** 1189 * struct avoid_freq_ind_data 1190 * @freq_list: frequency list 1191 * @chan_list: channel list 1192 */ 1193 struct avoid_freq_ind_data { 1194 struct ch_avoid_ind_type freq_list; 1195 struct unsafe_ch_list chan_list; 1196 }; 1197 1198 #define FIVEG_STARTING_FREQ 5000 1199 #define TWOG_STARTING_FREQ 2407 1200 #define TWOG_CHAN_14_IN_MHZ 2484 1201 #define TWOG_CHAN_1_IN_MHZ 2412 1202 #define TWOG_CHAN_5_IN_MHZ 2432 1203 #define TWOG_CHAN_6_IN_MHZ 2437 1204 #define TWOG_CHAN_13_IN_MHZ 2472 1205 1206 /** 1207 * struct reg_ctl_params - reg ctl and regd info 1208 * @regd: regdomain pair 1209 * @regd_2g: 2g sub domain code 1210 * @regd_5g: 5g sub domain code 1211 * @ctl_2g: 2g ctl info 1212 * @ctl_5g: 5g ctl info 1213 */ 1214 struct reg_ctl_params { 1215 uint32_t regd; 1216 uint16_t regd_2g; 1217 uint16_t regd_5g; 1218 uint8_t ctl_2g; 1219 uint8_t ctl_5g; 1220 }; 1221 1222 /** 1223 * enum reg_phymode - Regulatory phymode 1224 * @REG_PHYMODE_INVALID: Invalid phymode 1225 * @REG_PHYMODE_11B: 802.11b phymode 1226 * @REG_PHYMODE_11G: 802.11g phymode 1227 * @REG_PHYMODE_11A: 802.11a phymode 1228 * @REG_PHYMODE_11N: 802.11n phymode 1229 * @REG_PHYMODE_11AC: 802.11ac phymode 1230 * @REG_PHYMODE_11AX: 802.11ax phymode 1231 * @REG_PHYMODE_MAX: placeholder for future phymodes 1232 */ 1233 enum reg_phymode { 1234 REG_PHYMODE_INVALID, 1235 REG_PHYMODE_11B, 1236 REG_PHYMODE_11G, 1237 REG_PHYMODE_11A, 1238 REG_PHYMODE_11N, 1239 REG_PHYMODE_11AC, 1240 REG_PHYMODE_11AX, 1241 REG_PHYMODE_MAX, 1242 }; 1243 1244 #endif 1245