1 /* 2 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /** 21 * DOC: reg_services_public_struct.h 22 * This file contains regulatory data structures 23 */ 24 25 #ifndef __REG_SERVICES_PUBLIC_STRUCT_H_ 26 #define __REG_SERVICES_PUBLIC_STRUCT_H_ 27 28 #ifdef CONFIG_AFC_SUPPORT 29 #include <wlan_reg_afc.h> 30 #endif 31 32 #ifdef CONFIG_BAND_6GHZ 33 #define REG_MAX_CHANNELS_PER_OPERATING_CLASS 70 34 /* 35 * These tx-power macros are present till the 6G regdomains are defined to 36 * support tx-power values for various client types. 37 */ 38 #define REG_PSD_MAX_TXPOWER_FOR_DEFAULT_CLIENT (-1) /* dBm */ 39 #define REG_PSD_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 5 /* dBm */ 40 #define REG_EIRP_MAX_TXPOWER_FOR_SUBORDINATE_CLIENT 24 /* dBm */ 41 #else 42 #define REG_MAX_CHANNELS_PER_OPERATING_CLASS 28 43 #endif 44 45 #define REG_MAX_SUPP_OPER_CLASSES 32 46 #define REG_MAX_CHAN_CHANGE_CBKS 30 47 #define REG_INVALID_TXPOWER 255 48 #define MAX_STA_VDEV_CNT 4 49 #define INVALID_VDEV_ID 0xFF 50 #define INVALID_CHANNEL_NUM 0x0 51 #define CH_AVOID_MAX_RANGE (NUM_5GHZ_CHANNELS + NUM_24GHZ_CHANNELS) 52 #define REG_ALPHA2_LEN 2 53 #define MAX_REG_RULES 10 54 #define MAX_6G_REG_RULES 5 55 56 #define REGULATORY_CHAN_DISABLED BIT(0) 57 #define REGULATORY_CHAN_NO_IR BIT(1) 58 #define REGULATORY_CHAN_RADAR BIT(3) 59 #define REGULATORY_CHAN_NO_OFDM BIT(6) 60 #define REGULATORY_CHAN_INDOOR_ONLY BIT(9) 61 #define REGULATORY_CHAN_AFC BIT(13) 62 #define REGULATORY_CHAN_AFC_NOT_DONE BIT(16) 63 64 #define REGULATORY_CHAN_NO_HT40 BIT(4) 65 #define REGULATORY_CHAN_NO_80MHZ BIT(7) 66 #define REGULATORY_CHAN_NO_160MHZ BIT(8) 67 #define REGULATORY_CHAN_NO_20MHZ BIT(11) 68 #define REGULATORY_CHAN_NO_10MHZ BIT(12) 69 #define REGULATORY_CHAN_INVALID BIT(14) 70 71 #define REGULATORY_PHYMODE_NO11A BIT(0) 72 #define REGULATORY_PHYMODE_NO11B BIT(1) 73 #define REGULATORY_PHYMODE_NO11G BIT(2) 74 #define REGULATORY_CHAN_NO11N BIT(3) 75 #define REGULATORY_PHYMODE_NO11AC BIT(4) 76 #define REGULATORY_PHYMODE_NO11AX BIT(5) 77 #ifdef WLAN_FEATURE_11BE 78 #define REGULATORY_PHYMODE_NO11BE BIT(6) 79 #endif 80 81 #define BW_5_MHZ 5 82 #define BW_10_MHZ 10 83 #define BW_20_MHZ 20 84 #define BW_25_MHZ 25 85 #define BW_40_MHZ 40 86 #define BW_80_MHZ 80 87 #define BW_160_MHZ 160 88 #ifdef WLAN_FEATURE_11BE 89 #define BW_320_MHZ 320 90 #endif 91 #define BW_40_MHZ 40 92 93 #define MAX_NUM_PWR_LEVEL 16 94 95 #ifdef CONFIG_REG_CLIENT 96 #define MAX_NUM_FCC_RULES 2 97 #endif 98 99 /* no subchannels punctured */ 100 #define NO_SCHANS_PUNC 0x0000 101 102 /** 103 * enum dfs_reg - DFS region 104 * @DFS_UNINIT_REGION: un-initialized region 105 * @DFS_FCC_REGION: FCC region 106 * @DFS_ETSI_REGION: ETSI region 107 * @DFS_MKK_REGION: MKK region 108 * @DFS_CN_REGION: China region 109 * @DFS_KR_REGION: Korea region 110 * @DFS_MKK_REGION: MKKN region 111 * that supports updated W53 RADAR pattern 112 * detection. 113 * @DFS_UNDEF_REGION: Undefined region 114 */ 115 116 enum dfs_reg { 117 DFS_UNINIT_REGION = 0, 118 DFS_FCC_REGION = 1, 119 DFS_ETSI_REGION = 2, 120 DFS_MKK_REGION = 3, 121 DFS_CN_REGION = 4, 122 DFS_KR_REGION = 5, 123 DFS_MKKN_REGION = 6, 124 DFS_UNDEF_REGION = 0xFFFF, 125 }; 126 127 /** enum op_class_table_num 128 * OP_CLASS_US- Class corresponds to US 129 * OP_CLASS_EU- Class corresponds to EU 130 * OP_CLASS_JAPAN- Class corresponds to JAPAN 131 * OP_CLASS_GLOBAL- Class corresponds to GLOBAL 132 * OP_CLASS_CHINA- Class corresponds to CHINA 133 */ 134 enum op_class_table_num { 135 OP_CLASS_US = 1, 136 OP_CLASS_EU, 137 OP_CLASS_JAPAN, 138 OP_CLASS_GLOBAL, 139 OP_CLASS_CHINA 140 }; 141 142 /** 143 * enum channel_enum - channel enumeration 144 * @CHAN_ENUM_2412: channel with freq 2412 145 * @CHAN_ENUM_2417: channel with freq 2417 146 * @CHAN_ENUM_2422: channel with freq 2422 147 * @CHAN_ENUM_2427: channel with freq 2427 148 * @CHAN_ENUM_2432: channel with freq 2432 149 * @CHAN_ENUM_2437: channel with freq 2437 150 * @CHAN_ENUM_2442: channel with freq 2442 151 * @CHAN_ENUM_2447: channel with freq 2447 152 * @CHAN_ENUM_2452: channel with freq 2452 153 * @CHAN_ENUM_2457: channel with freq 2457 154 * @CHAN_ENUM_2462: channel with freq 2462 155 * @CHAN_ENUM_2467: channel with freq 2467 156 * @CHAN_ENUM_2472: channel with freq 2472 157 * @CHAN_ENUM_2484: channel with freq 2484 158 * @CHAN_ENUM_4912: channel with freq 4912 159 * @CHAN_ENUM_4915: channel with freq 4915 160 * @CHAN_ENUM_4917: channel with freq 4917 161 * @CHAN_ENUM_4920: channel with freq 4920 162 * @CHAN_ENUM_4922: channel with freq 4922 163 * @CHAN_ENUM_4925: channel with freq 4925 164 * @CHAN_ENUM_4927: channel with freq 4927 165 * @CHAN_ENUM_4932: channel with freq 4932 166 * @CHAN_ENUM_4935: channel with freq 4935 167 * @CHAN_ENUM_4937: channel with freq 4937 168 * @CHAN_ENUM_4940: channel with freq 4940 169 * @CHAN_ENUM_4942: channel with freq 4942 170 * @CHAN_ENUM_4945: channel with freq 4945 171 * @CHAN_ENUM_4947: channel with freq 4947 172 * @CHAN_ENUM_4950: channel with freq 4950 173 * @CHAN_ENUM_4952: channel with freq 4952 174 * @CHAN_ENUM_4955: channel with freq 4955 175 * @CHAN_ENUM_4957: channel with freq 4957 176 * @CHAN_ENUM_4960: channel with freq 4960 177 * @CHAN_ENUM_4962: channel with freq 4962 178 * @CHAN_ENUM_4965: channel with freq 4965 179 * @CHAN_ENUM_4967: channel with freq 4967 180 * @CHAN_ENUM_4970: channel with freq 4970 181 * @CHAN_ENUM_4972: channel with freq 4972 182 * @CHAN_ENUM_4975: channel with freq 4975 183 * @CHAN_ENUM_4977: channel with freq 4977 184 * @CHAN_ENUM_4980: channel with freq 4980 185 * @CHAN_ENUM_4982: channel with freq 4982 186 * @CHAN_ENUM_4985: channel with freq 4985 187 * @CHAN_ENUM_4987: channel with freq 4987 188 * @CHAN_ENUM_5032: channel with freq 5032 189 * @CHAN_ENUM_5035: channel with freq 5035 190 * @CHAN_ENUM_5037: channel with freq 5037 191 * @CHAN_ENUM_5040: channel with freq 5040 192 * @CHAN_ENUM_5042: channel with freq 5042 193 * @CHAN_ENUM_5045: channel with freq 5045 194 * @CHAN_ENUM_5047: channel with freq 5047 195 * @CHAN_ENUM_5052: channel with freq 5052 196 * @CHAN_ENUM_5055: channel with freq 5055 197 * @CHAN_ENUM_5057: channel with freq 5057 198 * @CHAN_ENUM_5060: channel with freq 5060 199 * @CHAN_ENUM_5080: channel with freq 5080 200 * @CHAN_ENUM_5180: channel with freq 5180 201 * @CHAN_ENUM_5200: channel with freq 5200 202 * @CHAN_ENUM_5220: channel with freq 5220 203 * @CHAN_ENUM_5240: channel with freq 5240 204 * @CHAN_ENUM_5260: channel with freq 5260 205 * @CHAN_ENUM_5280: channel with freq 5280 206 * @CHAN_ENUM_5300: channel with freq 5300 207 * @CHAN_ENUM_5320: channel with freq 5320 208 * @CHAN_ENUM_5500: channel with freq 5500 209 * @CHAN_ENUM_5520: channel with freq 5520 210 * @CHAN_ENUM_5540: channel with freq 5540 211 * @CHAN_ENUM_5560: channel with freq 5560 212 * @CHAN_ENUM_5580: channel with freq 5580 213 * @CHAN_ENUM_5600: channel with freq 5600 214 * @CHAN_ENUM_5620: channel with freq 5620 215 * @CHAN_ENUM_5640: channel with freq 5640 216 * @CHAN_ENUM_5660: channel with freq 5660 217 * @CHAN_ENUM_5680: channel with freq 5680 218 * @CHAN_ENUM_5700: channel with freq 5700 219 * @CHAN_ENUM_5720: channel with freq 5720 220 * @CHAN_ENUM_5745: channel with freq 5745 221 * @CHAN_ENUM_5765: channel with freq 5765 222 * @CHAN_ENUM_5785: channel with freq 5785 223 * @CHAN_ENUM_5805: channel with freq 5805 224 * @CHAN_ENUM_5825: channel with freq 5825 225 * @CHAN_ENUM_5845: channel with freq 5845 226 * @CHAN_ENUM_5850: channel with freq 5850 227 * @CHAN_ENUM_5855: channel with freq 5855 228 * @CHAN_ENUM_5860: channel with freq 5860 229 * @CHAN_ENUM_5865: channel with freq 5865 230 * @CHAN_ENUM_5870: channel with freq 5870 231 * @CHAN_ENUM_5875: channel with freq 5875 232 * @CHAN_ENUM_5880: channel with freq 5880 233 * @CHAN_ENUM_5885: channel with freq 5885 234 * @CHAN_ENUM_5890: channel with freq 5890 235 * @CHAN_ENUM_5895: channel with freq 5895 236 * @CHAN_ENUM_5900: channel with freq 5900 237 * @CHAN_ENUM_5905: channel with freq 5905 238 * @CHAN_ENUM_5910: channel with freq 5910 239 * @CHAN_ENUM_5915: channel with freq 5915 240 * @CHAN_ENUM_5920: channel with freq 5920 241 * @CHAN_ENUM_5935: channel with freq 5935 242 * @CHAN_ENUM_5955: channel with freq 5955 243 * @CHAN_ENUM_5975: channel with freq 5975 244 * @CHAN_ENUM_5995: channel with freq 5995 245 * @CHAN_ENUM_6015: channel with freq 6015 246 * @CHAN_ENUM_6035: channel with freq 6035 247 * @CHAN_ENUM_6055: channel with freq 6055 248 * @CHAN_ENUM_6075: channel with freq 6075 249 * @CHAN_ENUM_6095: channel with freq 6095 250 * @CHAN_ENUM_6115: channel with freq 6115 251 * @CHAN_ENUM_6135: channel with freq 6135 252 * @CHAN_ENUM_6155: channel with freq 6155 253 * @CHAN_ENUM_6175: channel with freq 6175 254 * @CHAN_ENUM_6195: channel with freq 6195 255 * @CHAN_ENUM_6215: channel with freq 6215 256 * @CHAN_ENUM_6235: channel with freq 6235 257 * @CHAN_ENUM_6255: channel with freq 6255 258 * @CHAN_ENUM_6275: channel with freq 6275 259 * @CHAN_ENUM_6295: channel with freq 6295 260 * @CHAN_ENUM_6315: channel with freq 6315 261 * @CHAN_ENUM_6335: channel with freq 6335 262 * @CHAN_ENUM_6355: channel with freq 6355 263 * @CHAN_ENUM_6375: channel with freq 6375 264 * @CHAN_ENUM_6395: channel with freq 6395 265 * @CHAN_ENUM_6415: channel with freq 6415 266 * @CHAN_ENUM_6435: channel with freq 6435 267 * @CHAN_ENUM_6455: channel with freq 6455 268 * @CHAN_ENUM_6475: channel with freq 6475 269 * @CHAN_ENUM_6495: channel with freq 6495 270 * @CHAN_ENUM_6515: channel with freq 6515 271 * @CHAN_ENUM_6535: channel with freq 6535 272 * @CHAN_ENUM_6555: channel with freq 6555 273 * @CHAN_ENUM_6575: channel with freq 6575 274 * @CHAN_ENUM_6595: channel with freq 6595 275 * @CHAN_ENUM_6615: channel with freq 6615 276 * @CHAN_ENUM_6635: channel with freq 6635 277 * @CHAN_ENUM_6655: channel with freq 6655 278 * @CHAN_ENUM_6675: channel with freq 6675 279 * @CHAN_ENUM_6695: channel with freq 6695 280 * @CHAN_ENUM_6715: channel with freq 6715 281 * @CHAN_ENUM_6735: channel with freq 6735 282 * @CHAN_ENUM_6755: channel with freq 6755 283 * @CHAN_ENUM_6775: channel with freq 6775 284 * @CHAN_ENUM_6795: channel with freq 6795 285 * @CHAN_ENUM_6815: channel with freq 6815 286 * @CHAN_ENUM_6835: channel with freq 6835 287 * @CHAN_ENUM_6855: channel with freq 6855 288 * @CHAN_ENUM_6875: channel with freq 6875 289 * @CHAN_ENUM_6895: channel with freq 6895 290 * @CHAN_ENUM_6915: channel with freq 6915 291 * @CHAN_ENUM_6935: channel with freq 6935 292 * @CHAN_ENUM_6955: channel with freq 6955 293 * @CHAN_ENUM_6975: channel with freq 6975 294 * @CHAN_ENUM_6995: channel with freq 6995 295 * @CHAN_ENUM_7015: channel with freq 7015 296 * @CHAN_ENUM_7035: channel with freq 7035 297 * @CHAN_ENUM_7055: channel with freq 7055 298 * @CHAN_ENUM_7075: channel with freq 7075 299 * @CHAN_ENUM_7095: channel with freq 7095 300 * @CHAN_ENUM_7115: channel with freq 7115 301 */ 302 enum channel_enum { 303 CHAN_ENUM_2412, 304 CHAN_ENUM_2417, 305 CHAN_ENUM_2422, 306 CHAN_ENUM_2427, 307 CHAN_ENUM_2432, 308 CHAN_ENUM_2437, 309 CHAN_ENUM_2442, 310 CHAN_ENUM_2447, 311 CHAN_ENUM_2452, 312 CHAN_ENUM_2457, 313 CHAN_ENUM_2462, 314 CHAN_ENUM_2467, 315 CHAN_ENUM_2472, 316 CHAN_ENUM_2484, 317 #ifdef CONFIG_49GHZ_CHAN 318 CHAN_ENUM_4912, 319 CHAN_ENUM_4915, 320 CHAN_ENUM_4917, 321 CHAN_ENUM_4920, 322 CHAN_ENUM_4922, 323 CHAN_ENUM_4925, 324 CHAN_ENUM_4927, 325 CHAN_ENUM_4932, 326 CHAN_ENUM_4935, 327 CHAN_ENUM_4937, 328 CHAN_ENUM_4940, 329 CHAN_ENUM_4942, 330 CHAN_ENUM_4945, 331 CHAN_ENUM_4947, 332 CHAN_ENUM_4950, 333 CHAN_ENUM_4952, 334 CHAN_ENUM_4955, 335 CHAN_ENUM_4957, 336 CHAN_ENUM_4960, 337 CHAN_ENUM_4962, 338 CHAN_ENUM_4965, 339 CHAN_ENUM_4967, 340 CHAN_ENUM_4970, 341 CHAN_ENUM_4972, 342 CHAN_ENUM_4975, 343 CHAN_ENUM_4977, 344 CHAN_ENUM_4980, 345 CHAN_ENUM_4982, 346 CHAN_ENUM_4985, 347 CHAN_ENUM_4987, 348 CHAN_ENUM_5032, 349 CHAN_ENUM_5035, 350 CHAN_ENUM_5037, 351 CHAN_ENUM_5040, 352 CHAN_ENUM_5042, 353 CHAN_ENUM_5045, 354 CHAN_ENUM_5047, 355 CHAN_ENUM_5052, 356 CHAN_ENUM_5055, 357 CHAN_ENUM_5057, 358 CHAN_ENUM_5060, 359 CHAN_ENUM_5080, 360 #endif /* CONFIG_49GHZ_CHAN */ 361 CHAN_ENUM_5180, 362 CHAN_ENUM_5200, 363 CHAN_ENUM_5220, 364 CHAN_ENUM_5240, 365 CHAN_ENUM_5260, 366 CHAN_ENUM_5280, 367 CHAN_ENUM_5300, 368 CHAN_ENUM_5320, 369 CHAN_ENUM_5500, 370 CHAN_ENUM_5520, 371 CHAN_ENUM_5540, 372 CHAN_ENUM_5560, 373 CHAN_ENUM_5580, 374 CHAN_ENUM_5600, 375 CHAN_ENUM_5620, 376 CHAN_ENUM_5640, 377 CHAN_ENUM_5660, 378 CHAN_ENUM_5680, 379 CHAN_ENUM_5700, 380 CHAN_ENUM_5720, 381 CHAN_ENUM_5745, 382 CHAN_ENUM_5765, 383 CHAN_ENUM_5785, 384 CHAN_ENUM_5805, 385 CHAN_ENUM_5825, 386 CHAN_ENUM_5845, 387 #ifdef WLAN_FEATURE_DSRC 388 CHAN_ENUM_5850, 389 CHAN_ENUM_5855, 390 CHAN_ENUM_5860, 391 #endif 392 CHAN_ENUM_5865, 393 #ifdef WLAN_FEATURE_DSRC 394 CHAN_ENUM_5870, 395 CHAN_ENUM_5875, 396 CHAN_ENUM_5880, 397 #endif 398 CHAN_ENUM_5885, 399 #ifdef WLAN_FEATURE_DSRC 400 CHAN_ENUM_5890, 401 CHAN_ENUM_5895, 402 CHAN_ENUM_5900, 403 CHAN_ENUM_5905, 404 CHAN_ENUM_5910, 405 CHAN_ENUM_5915, 406 CHAN_ENUM_5920, 407 #endif /* WLAN_FEATURE_DSRC */ 408 #ifdef CONFIG_BAND_6GHZ 409 CHAN_ENUM_5935, 410 CHAN_ENUM_5955, 411 CHAN_ENUM_5975, 412 CHAN_ENUM_5995, 413 CHAN_ENUM_6015, 414 CHAN_ENUM_6035, 415 CHAN_ENUM_6055, 416 CHAN_ENUM_6075, 417 CHAN_ENUM_6095, 418 CHAN_ENUM_6115, 419 CHAN_ENUM_6135, 420 CHAN_ENUM_6155, 421 CHAN_ENUM_6175, 422 CHAN_ENUM_6195, 423 CHAN_ENUM_6215, 424 CHAN_ENUM_6235, 425 CHAN_ENUM_6255, 426 CHAN_ENUM_6275, 427 CHAN_ENUM_6295, 428 CHAN_ENUM_6315, 429 CHAN_ENUM_6335, 430 CHAN_ENUM_6355, 431 CHAN_ENUM_6375, 432 CHAN_ENUM_6395, 433 CHAN_ENUM_6415, 434 CHAN_ENUM_6435, 435 CHAN_ENUM_6455, 436 CHAN_ENUM_6475, 437 CHAN_ENUM_6495, 438 CHAN_ENUM_6515, 439 CHAN_ENUM_6535, 440 CHAN_ENUM_6555, 441 CHAN_ENUM_6575, 442 CHAN_ENUM_6595, 443 CHAN_ENUM_6615, 444 CHAN_ENUM_6635, 445 CHAN_ENUM_6655, 446 CHAN_ENUM_6675, 447 CHAN_ENUM_6695, 448 CHAN_ENUM_6715, 449 CHAN_ENUM_6735, 450 CHAN_ENUM_6755, 451 CHAN_ENUM_6775, 452 CHAN_ENUM_6795, 453 CHAN_ENUM_6815, 454 CHAN_ENUM_6835, 455 CHAN_ENUM_6855, 456 CHAN_ENUM_6875, 457 CHAN_ENUM_6895, 458 CHAN_ENUM_6915, 459 CHAN_ENUM_6935, 460 CHAN_ENUM_6955, 461 CHAN_ENUM_6975, 462 CHAN_ENUM_6995, 463 CHAN_ENUM_7015, 464 CHAN_ENUM_7035, 465 CHAN_ENUM_7055, 466 CHAN_ENUM_7075, 467 CHAN_ENUM_7095, 468 CHAN_ENUM_7115, 469 #endif /* CONFIG_BAND_6GHZ */ 470 471 NUM_CHANNELS, 472 473 MIN_CHANNEL = CHAN_ENUM_2412, 474 MAX_CHANNEL = (NUM_CHANNELS - 1), 475 476 MIN_24GHZ_CHANNEL = CHAN_ENUM_2412, 477 MAX_24GHZ_CHANNEL = CHAN_ENUM_2484, 478 NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1), 479 480 INVALID_CHANNEL = NUM_CHANNELS, 481 482 #ifdef CONFIG_49GHZ_CHAN 483 MIN_49GHZ_CHANNEL = CHAN_ENUM_4912, 484 MAX_49GHZ_CHANNEL = CHAN_ENUM_5080, 485 NUM_49GHZ_CHANNELS = (MAX_49GHZ_CHANNEL - MIN_49GHZ_CHANNEL + 1), 486 #else 487 MIN_49GHZ_CHANNEL = INVALID_CHANNEL, 488 MAX_49GHZ_CHANNEL = INVALID_CHANNEL, 489 NUM_49GHZ_CHANNELS = 0, 490 #endif /* CONFIG_49GHZ_CHAN */ 491 492 MIN_5GHZ_CHANNEL = CHAN_ENUM_5180, 493 #ifdef WLAN_FEATURE_DSRC 494 MAX_5GHZ_CHANNEL = CHAN_ENUM_5920, 495 #else 496 MAX_5GHZ_CHANNEL = CHAN_ENUM_5885, 497 #endif 498 NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1), 499 500 #ifdef WLAN_FEATURE_DSRC 501 MIN_DSRC_CHANNEL = CHAN_ENUM_5850, 502 MAX_DSRC_CHANNEL = CHAN_ENUM_5920, 503 NUM_DSRC_CHANNELS = (MAX_DSRC_CHANNEL - MIN_DSRC_CHANNEL + 1), 504 #endif 505 506 MIN_5DOT9_CHANNEL = CHAN_ENUM_5845, 507 MAX_5DOT9_CHANNEL = CHAN_ENUM_5885, 508 NUM_5DOT9_CHANNELS = (MAX_5DOT9_CHANNEL - MIN_5DOT9_CHANNEL + 1), 509 510 #ifdef CONFIG_49GHZ_CHAN 511 #define BAND_5GHZ_START_CHANNEL MIN_49GHZ_CHANNEL 512 #else 513 #define BAND_5GHZ_START_CHANNEL MIN_5GHZ_CHANNEL 514 #endif /* CONFIG_49GHZ_CHAN */ 515 516 #ifdef DISABLE_UNII_SHARED_BANDS 517 MIN_UNII_1_BAND_CHANNEL = CHAN_ENUM_5180, 518 MAX_UNII_1_BAND_CHANNEL = CHAN_ENUM_5240, 519 NUM_UNII_1_BAND_CHANNELS = (MAX_UNII_1_BAND_CHANNEL - 520 MIN_UNII_1_BAND_CHANNEL + 1), 521 522 MIN_UNII_2A_BAND_CHANNEL = CHAN_ENUM_5260, 523 MAX_UNII_2A_BAND_CHANNEL = CHAN_ENUM_5320, 524 NUM_UNII_2A_BAND_CHANNELS = (MAX_UNII_2A_BAND_CHANNEL - 525 MIN_UNII_2A_BAND_CHANNEL + 1), 526 #endif 527 528 #ifdef CONFIG_BAND_6GHZ 529 MIN_6GHZ_CHANNEL = CHAN_ENUM_5935, 530 MAX_6GHZ_CHANNEL = CHAN_ENUM_7115, 531 NUM_6GHZ_CHANNELS = (MAX_6GHZ_CHANNEL - MIN_6GHZ_CHANNEL + 1), 532 MIN_6GHZ_NON_ORPHAN_CHANNEL = CHAN_ENUM_5955, 533 #else 534 MIN_6GHZ_CHANNEL = INVALID_CHANNEL, 535 MAX_6GHZ_CHANNEL = INVALID_CHANNEL, 536 NUM_6GHZ_CHANNELS = 0, 537 MIN_6GHZ_NON_ORPHAN_CHANNEL = INVALID_CHANNEL, 538 #endif /* CONFIG_BAND_6GHZ */ 539 }; 540 541 /** 542 * enum channel_state - channel state 543 * @CHANNEL_STATE_DISABLE: disabled state 544 * @CHANNEL_STATE_PASSIVE: passive state 545 * @CHANNEL_STATE_DFS: dfs state 546 * @CHANNEL_STATE_ENABLE: enabled state 547 * @CHANNEL_STATE_INVALID: invalid state 548 */ 549 enum channel_state { 550 CHANNEL_STATE_DISABLE, 551 CHANNEL_STATE_PASSIVE, 552 CHANNEL_STATE_DFS, 553 CHANNEL_STATE_ENABLE, 554 CHANNEL_STATE_INVALID, 555 }; 556 557 /** 558 * enum reg_6g_ap_type - Regulatory AP type for regulatory info subfield. 559 * @REG_INDOOR_AP: Indoor AP 560 * @REG_STANDARD_POWER_AP: Standard Power AP 561 * @REG_VERY_LOW_POWER_AP: Very low power AP 562 * @REG_CURRENT_MAX_AP_TYPE: current maximum, used to determine array size 563 * @REG_MAX_SUPP_AP_TYPE: Current maximum AP power typer supported in the IEEE 564 * standard. 565 * @REG_MAX_AP_TYPE: Maximum value possible for (3 bits) regulatory info 566 * sub-field in the 6G HE Operation IE 567 */ 568 enum reg_6g_ap_type { 569 REG_INDOOR_AP = 0, 570 REG_STANDARD_POWER_AP = 1, 571 REG_VERY_LOW_POWER_AP = 2, 572 REG_CURRENT_MAX_AP_TYPE, 573 REG_MAX_SUPP_AP_TYPE = REG_VERY_LOW_POWER_AP, 574 REG_MAX_AP_TYPE = 7, 575 }; 576 577 /** 578 * enum reg_6g_client_type - Regulatory client type for max tx-power category 579 * @REG_DEFAULT_CLIENT: Default client 580 * @REG_SUBORDINATE_CLIENT: Subordinate client 581 * @REG_MAX_CLIENT_TYPE: Maximum value possible for max tx-power category 582 * (2 bits) sub-field in the TPE (Transmit Power Envelope) IE 583 * REG_INVALID_CLIENT_TYPE: Invalid client type 584 */ 585 enum reg_6g_client_type { 586 REG_DEFAULT_CLIENT = 0, 587 REG_SUBORDINATE_CLIENT = 1, 588 REG_MAX_CLIENT_TYPE = 2, 589 REG_INVALID_CLIENT_TYPE = REG_MAX_CLIENT_TYPE, 590 }; 591 592 /** 593 * enum reg_domain: reg domain 594 * @REGDOMAIN_FCC: FCC domain 595 * @REGDOMAIN_ETSI: ETSI domain 596 * @REGDOMAIN_JAPAN: JAPAN domain 597 * @REGDOMAIN_WORLD: WORLD domain 598 * @REGDOMAIN_COUNT: Max domain 599 */ 600 typedef enum { 601 REGDOMAIN_FCC, 602 REGDOMAIN_ETSI, 603 REGDOMAIN_JAPAN, 604 REGDOMAIN_WORLD, 605 REGDOMAIN_COUNT 606 } v_REGDOMAIN_t; 607 608 /** 609 * enum ctl_value - CTL value 610 * @CTL_FCC: CTL FCC 611 * @CTL_MKK: CTL MKK 612 * @CTL_ETSI: CTL ETSI 613 * @CTL_KOR: CTL KOR 614 * @CTL_CHN: CTL CHINA 615 * @CTL_USER_DEF: CTL USER_DEF 616 * @CTL_NONE: CTL NONE 617 */ 618 enum ctl_value { 619 CTL_FCC = 0x10, 620 CTL_ETSI = 0x30, 621 CTL_MKK = 0x40, 622 CTL_KOR = 0x50, 623 CTL_CHN = 0x60, 624 CTL_USER_DEF = 0x70, 625 CTL_NONE = 0xff 626 }; 627 628 /** 629 * struct freq_range: The range/band of frequencies, indicated by left and right 630 * edge frequencies. 631 * @left: Left edge frequency(inclusive) 632 * @right: Right edge frequency(inclusive) 633 */ 634 struct freq_range { 635 qdf_freq_t left; 636 qdf_freq_t right; 637 }; 638 639 /** 640 * struct ch_params 641 * @ch_width: channel width 642 * @sec_ch_offset: secondary channel offset 643 * @center_freq_seg0: channel number for segment 0 644 * @center_freq_seg1: channel number segment 1 645 * @mhz_freq_seg0: Center frequency for segment 0 646 * @mhz_freq_seg1: Center frequency for segment 1 647 * @reg_punc_bitmap: Output puncturing bitmap 648 * @is_create_punc_bitmap: Whether puncturing bitmap is to be created or not 649 * Parameter 'reg_punc_bitmap' is valid only if 650 * is_create_punc_bitmap is true 651 * @input_punc_bitmap: Input puncture bitmap. The channels which are indicated 652 * as punctured by this bitmap are not validated by the 653 * regulatory. 654 */ 655 struct ch_params { 656 enum phy_ch_width ch_width; 657 uint8_t sec_ch_offset; 658 uint8_t center_freq_seg0; 659 uint8_t center_freq_seg1; 660 qdf_freq_t mhz_freq_seg0; 661 qdf_freq_t mhz_freq_seg1; 662 #ifdef WLAN_FEATURE_11BE 663 uint16_t reg_punc_bitmap; 664 bool is_create_punc_bitmap; 665 uint16_t input_punc_bitmap; 666 #endif 667 }; 668 669 /** 670 * struct reg_channel_list 671 * @num_ch_params: Number of chan_param elements 672 * @chan_param: Object of type struct ch_params to hold channel params 673 * Currently chan_param is an array of 2 because maximum possible 320 674 * channels for a given primary channel is 2. This may be dynamically 675 * allocated in the future by the caller if num_ch_params is greater than 2. 676 * 677 */ 678 #ifdef WLAN_FEATURE_11BE 679 #define MAX_NUM_CHAN_PARAM 2 680 struct reg_channel_list { 681 uint8_t num_ch_params; 682 struct ch_params chan_param[MAX_NUM_CHAN_PARAM]; 683 }; 684 #endif 685 686 /** 687 * struct channel_power 688 * @center_freq: Channel Center Frequency 689 * @chan_num: channel number 690 * @tx_power: TX power 691 */ 692 struct channel_power { 693 qdf_freq_t center_freq; 694 uint8_t chan_num; 695 uint32_t tx_power; 696 }; 697 698 /** 699 * enum offset_t: channel offset 700 * @BW20: 20 mhz channel 701 * @BW40_LOW_PRIMARY: lower channel in 40 mhz 702 * @BW40_HIGH_PRIMARY: higher channel in 40 mhz 703 * @BW80: 80 mhz channel 704 * @BWALL: unknown bandwidth 705 */ 706 enum offset_t { 707 BW20 = 0, 708 BW40_LOW_PRIMARY = 1, 709 BW40_HIGH_PRIMARY = 3, 710 BW80, 711 BWALL, 712 BW_INVALID = 0xFF 713 }; 714 715 /** 716 * enum behav_limit - behavior limit 717 * @BEHAV_NONE: none 718 * @BEHAV_BW40_LOW_PRIMARY: BW40 low primary 719 * @BEHAV_BW40_HIGH_PRIMARY: BW40 high primary 720 * @BEHAV_BW80_PLUS: BW 80 plus 721 * @BEHAV_INVALID: invalid behavior 722 */ 723 enum behav_limit { 724 BEHAV_NONE, 725 BEHAV_BW40_LOW_PRIMARY, 726 BEHAV_BW40_HIGH_PRIMARY, 727 BEHAV_BW80_PLUS, 728 BEHAV_INVALID = 0xFF 729 }; 730 731 /** 732 * struct c_freq_lst: The list data structure for the center frequencies 733 * @num_cfis: Number of center frequencies 734 * @p_cfis_arr: Start address of the array of center frequency indices. Center 735 * for 40/80/160/320MHz band channel opclasses. For 20MHz the list 736 * is empty as it is already available in @channels variable. 737 */ 738 struct c_freq_lst { 739 uint8_t num_cfis; 740 const uint8_t *p_cfis_arr; 741 }; 742 743 /** 744 * struct reg_dmn_op_class_map_t: operating class 745 * @op_class: operating class number 746 * @chan_spacing: channel spacing 747 * @offset: offset 748 * @behav_limit: OR of bitmaps of enum behav_limit 749 * @start_freq: starting frequency 750 * @channels: channel set 751 * @p_cfi_lst_obj: Pointer to center frequency indices list 752 */ 753 struct reg_dmn_op_class_map_t { 754 uint8_t op_class; 755 uint16_t chan_spacing; 756 enum offset_t offset; 757 uint16_t behav_limit; 758 qdf_freq_t start_freq; 759 uint8_t channels[REG_MAX_CHANNELS_PER_OPERATING_CLASS]; 760 const struct c_freq_lst *p_cfi_lst_obj; 761 }; 762 763 /** 764 * enum opclass_config: Opclass configuration 765 * @OPCLASSES_SUPPORTED_BY_CUR_HWMODE: Retrieve opclasses that is supported 766 * by the current hw mode. 767 * @OPCLASSES_NOT_SUPPORTED_BY_CUR_HWMODE: Retrieve opclasses that are not 768 * supported by the current hw mode. 769 * OPCLASSES_SUPPORTED_BY_DOMAIN: Populate the opclass supported by the radio 770 * without considering the capability of current hwmode. 771 */ 772 enum opclass_config { 773 OPCLASSES_SUPPORTED_BY_CUR_HWMODE = 1, 774 OPCLASSES_NOT_SUPPORTED_BY_CUR_HWMODE = 2, 775 OPCLASSES_SUPPORTED_BY_DOMAIN = 3 776 }; 777 778 /** 779 * struct regdmn_ap_cap_opclass_t: AP Cap operation class table 780 * @op_class: operating class number 781 * @ch_width: channel width in MHz 782 * @start_freq: Starting Frequency in MHz 783 * @behav_limit: OR of bitmaps of enum behav_limit 784 * @max_tx_pwr_dbm: Maximum tx power in dbm 785 * @num_supported_chan: Number of supported channels 786 * @num_non_supported_chan: Number of non-supported channels 787 * @sup_chan_list: Array of supported channel numbers 788 * @non_sup_chan_list: Array of non supported channel numbers 789 */ 790 struct regdmn_ap_cap_opclass_t { 791 uint8_t op_class; 792 uint16_t ch_width; 793 qdf_freq_t start_freq; 794 uint16_t behav_limit; 795 uint8_t max_tx_pwr_dbm; 796 uint8_t num_supported_chan; 797 uint8_t num_non_supported_chan; 798 uint8_t sup_chan_list[REG_MAX_CHANNELS_PER_OPERATING_CLASS]; 799 uint8_t non_sup_chan_list[REG_MAX_CHANNELS_PER_OPERATING_CLASS]; 800 }; 801 802 /** 803 * struct reg_dmn_supp_op_classes: operating classes 804 * @num_classes: number of classes 805 * @classes: classes 806 */ 807 struct reg_dmn_supp_op_classes { 808 uint8_t num_classes; 809 uint8_t classes[REG_MAX_SUPP_OPER_CLASSES]; 810 }; 811 812 /** 813 * struct reg_start_11d_scan_req: start 11d scan request 814 * @vdev_id: vdev id 815 * @scan_period_msec: scan duration in milli-seconds 816 * @start_interval_msec: offset duration to start the scan in milli-seconds 817 */ 818 struct reg_start_11d_scan_req { 819 uint8_t vdev_id; 820 uint32_t scan_period_msec; 821 uint32_t start_interval_msec; 822 }; 823 824 /** 825 * struct reg_11d_scan_msg: 11d scan message structure 826 * @psoc: pointer to psoc object 827 * @enable_11d_supp: enable 11d scan or disable 11d scan 828 */ 829 struct reg_11d_scan_msg { 830 struct wlan_objmgr_psoc *psoc; 831 bool enable_11d_supp; 832 }; 833 /** 834 * struct reg_stop_11d_scan_req: stop 11d scan request 835 * @vdev_id: vdev id 836 */ 837 struct reg_stop_11d_scan_req { 838 uint8_t vdev_id; 839 }; 840 841 /** 842 * struct reg_11d_new_country: regulatory 11d new coutry code 843 * @alpha2: new 11d alpha2 844 */ 845 struct reg_11d_new_country { 846 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 847 }; 848 849 /** 850 * enum country_src: country source 851 * @SOURCE_QUERY: source query 852 * @SOURCE_CORE: source regulatory core 853 * @SOURCE_DRIVER: source driver 854 * @SOURCE_USERSPACE: source userspace 855 * @SOURCE_11D: source 11D 856 */ 857 enum country_src { 858 SOURCE_UNKNOWN, 859 SOURCE_QUERY, 860 SOURCE_CORE, 861 SOURCE_DRIVER, 862 SOURCE_USERSPACE, 863 SOURCE_11D 864 }; 865 866 #ifdef WLAN_FEATURE_GET_USABLE_CHAN_LIST 867 /** 868 * enum iftype - (virtual) interface types 869 * 870 * @IFTYPE_UNSPECIFIED: unspecified type, driver decides 871 * @IFTYPE_ADHOC: independent BSS member 872 * @IFTYPE_STATION: managed BSS member 873 * @IFTYPE_AP: access point 874 * @IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces 875 * are a bit special in that they must always be tied to a pre-existing 876 * AP type interface. 877 * @IFTYPE_WDS: wireless distribution interface 878 * @IFTYPE_MONITOR: monitor interface receiving all frames 879 * @IFTYPE_MESH_POINT: mesh point 880 * @IFTYPE_P2P_CLIENT: P2P client 881 * @IFTYPE_P2P_GO: P2P group owner 882 * @IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev 883 * and therefore can't be created in the normal ways, use the 884 * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE 885 * commands to create and destroy one 886 * @IF_TYPE_OCB: Outside Context of a BSS 887 * This mode corresponds to the MIB variable dot11OCBActivated=true 888 * @IF_TYPE_NAN: NAN mode 889 * @IFTYPE_MAX: highest interface type number currently defined 890 * @NUM_IFTYPES: number of defined interface types 891 * 892 * These values are used with the %NL80211_ATTR_IFTYPE 893 * to set the type of an interface. 894 * 895 */ 896 enum iftype { 897 IFTYPE_UNSPECIFIED, 898 IFTYPE_ADHOC, 899 IFTYPE_STATION, 900 IFTYPE_AP, 901 IFTYPE_AP_VLAN, 902 IFTYPE_WDS, 903 IFTYPE_MONITOR, 904 IFTYPE_MESH_POINT, 905 IFTYPE_P2P_CLIENT, 906 IFTYPE_P2P_GO, 907 IFTYPE_P2P_DEVICE, 908 IFTYPE_OCB, 909 IFTYPE_NAN, 910 911 /* keep last */ 912 NUM_IFTYPES, 913 IFTYPE_MAX = NUM_IFTYPES - 1 914 }; 915 916 /** 917 * usable_channels_filter - Filters to get usable channels 918 * FILTER_CELLULAR_COEX: Avoid lte coex channels 919 * FILTER_WLAN_CONCURRENCY: Avoid con channels 920 **/ 921 enum usable_channels_filter { 922 FILTER_CELLULAR_COEX = 0, 923 FILTER_WLAN_CONCURRENCY = 1, 924 }; 925 926 /** 927 * get_usable_chan_res_params - Usable channels resp params 928 * freq : center freq 929 * seg0_freq : seg0 freq 930 * seg1_freq: seg1 freq 931 * bw : bandwidth 932 * state: channel state 933 * iface_mode_mask: interface mode mask 934 **/ 935 struct get_usable_chan_res_params { 936 qdf_freq_t freq; 937 uint32_t seg0_freq; 938 uint32_t seg1_freq; 939 enum phy_ch_width bw; 940 uint32_t iface_mode_mask; 941 enum channel_state state; 942 }; 943 944 /** 945 * get_usable_chan_req_params - Usable channels req params 946 * band_mask : band mask 947 * iface_mode_mask: interface mode mask 948 * filter_mask: filter mask 949 **/ 950 struct get_usable_chan_req_params { 951 uint32_t band_mask; 952 uint32_t iface_mode_mask; 953 uint32_t filter_mask; 954 }; 955 #endif 956 957 /** 958 * struct regulatory_channel 959 * @center_freq: center frequency 960 * @chan_num: channel number 961 * @state: channel state 962 * @chan_flags: channel flags 963 * @tx_power: TX powers 964 * @min_bw: min bandwidth 965 * @max_bw: max bandwidth 966 * @nol_chan: whether channel is nol 967 * @nol_history: Set NOL-History when STA vap detects RADAR. 968 * @is_chan_hop_blocked: Whether channel is blocked for ACS hopping. 969 * @ht40intol_flags: Contains Flags to indicate whether the 40PLUS/40MINUS 970 * version of the channel is blocked by ACS due to 971 * intolerance. 972 * @psd_flag: is PSD channel or not 973 * @psd_eirp: PSD power level 974 * @is_static_punctured: is static punctured 975 */ 976 struct regulatory_channel { 977 qdf_freq_t center_freq; 978 uint8_t chan_num; 979 enum channel_state state; 980 uint32_t chan_flags; 981 uint32_t tx_power; 982 uint16_t min_bw; 983 uint16_t max_bw; 984 uint8_t ant_gain; 985 bool nol_chan; 986 bool nol_history; 987 #ifdef CONFIG_HOST_FIND_CHAN 988 bool is_chan_hop_blocked; 989 uint8_t ht40intol_flags; 990 #endif 991 #ifdef CONFIG_BAND_6GHZ 992 bool psd_flag; 993 uint16_t psd_eirp; 994 #endif 995 #ifdef CONFIG_REG_CLIENT 996 uint8_t is_static_punctured; 997 #endif 998 }; 999 1000 /** struct ap_cli_pwr_mode_info: AP and client power mode information 1001 * @is_mode_ap: Is it AP or CLIENT 1002 * @cli_type: Is the client a default or subordinate 1003 * @ap_pwr_mode: LPI, SP or VLP 1004 */ 1005 struct ap_cli_pwr_mode_info { 1006 bool is_mode_ap; 1007 enum reg_6g_client_type cli_type; 1008 enum reg_6g_ap_type ap_pwr_mode; 1009 }; 1010 1011 /** 1012 * enum supported_6g_pwr_types: 6G supported AP and Client power types 1013 * @REG_BEST_PWR_MODE: Best power mode 1014 * @REG_CURRENT_PWR_MODE: Current power mode 1015 * @REG_AP_LPI: LPI AP power mode 1016 * @REG_AP_SP: SP AP power mode 1017 * @REG_AP_VLP: VLP AP power mode 1018 * @REG_CLI_DEF_LPI: LPI default client mode 1019 * @REG_CLI_DEF_SP: SP default client mode 1020 * @REG_CLI_DEF_VLP: VLP default client mode 1021 * @REG_CLI_SUB_LPI: LPI subordinate client mode 1022 * @REG_CLI_SUB_SP: SP subordinate client mode 1023 * @REG_CLI_SUB_VLP: VLP subordinate client mode 1024 * @REG_INVALID_PWR_MODE: Invalid power mode 1025 */ 1026 enum supported_6g_pwr_types { 1027 REG_BEST_PWR_MODE = -1, 1028 REG_CURRENT_PWR_MODE = 0, 1029 REG_AP_LPI = 1, 1030 REG_AP_SP = 2, 1031 REG_AP_VLP = 3, 1032 REG_CLI_DEF_LPI = 4, 1033 REG_CLI_DEF_SP = 5, 1034 REG_CLI_DEF_VLP = 6, 1035 REG_CLI_SUB_LPI = 7, 1036 REG_CLI_SUB_SP = 8, 1037 REG_CLI_SUB_VLP = 9, 1038 REG_INVALID_PWR_MODE = 10, 1039 }; 1040 1041 #define MAX_PWR_TYPES 10 1042 /** 1043 * struct psd_val: Regulatory power information 1044 * @psd_flag: Boolean to indicate if PSD is supported or not 1045 * @psd_eirp: PSD power 1046 * @tx_power: Maximum EIRP 1047 */ 1048 struct psd_val { 1049 bool psd_flag; 1050 uint16_t psd_eirp; 1051 uint32_t tx_power; 1052 }; 1053 1054 /** 1055 * struct super_chan_info: Information of a 6G channel for every power 1056 * mode 1057 * @power_types: Bitmap whose bit positions indicate the power modes supported 1058 * by a channel 1059 * @best_power_mode: Best power mode of a channel 1060 * @min_bw: Array of minimum bandwidths per power mode 1061 * @max_bw: Array of maximum bandwidths per power mode 1062 * @chan_flags_arr: Array of channel flags 1063 * @reg_chan_pwr: Array of powers 1064 * @state_arr: Array of states 1065 */ 1066 struct super_chan_info { 1067 uint16_t power_types; 1068 enum supported_6g_pwr_types best_power_mode; 1069 uint16_t min_bw[MAX_PWR_TYPES]; 1070 uint16_t max_bw[MAX_PWR_TYPES]; 1071 uint32_t chan_flags_arr[MAX_PWR_TYPES]; 1072 struct psd_val reg_chan_pwr[MAX_PWR_TYPES]; 1073 enum channel_state state_arr[MAX_PWR_TYPES]; 1074 }; 1075 1076 /** 1077 * struct regulatory: regulatory information 1078 * @reg_domain: regulatory domain pair 1079 * @eeprom_rd_ext: eeprom value 1080 * @country_code: current country in integer 1081 * @alpha2: current alpha2 1082 * @def_country: default country alpha2 1083 * @def_region: DFS region 1084 * @ctl_2g: 2G CTL value 1085 * @ctl_5g: 5G CTL value 1086 * @reg_pair: pointer to regulatory pair 1087 * @cc_src: country code src 1088 * @reg_flags: kernel regulatory flags 1089 */ 1090 struct regulatory { 1091 uint32_t reg_domain; 1092 uint32_t eeprom_rd_ext; 1093 uint16_t country_code; 1094 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 1095 uint8_t ctl_2g; 1096 uint8_t ctl_5g; 1097 const void *regpair; 1098 enum country_src cc_src; 1099 uint32_t reg_flags; 1100 }; 1101 1102 /** 1103 * struct chan_map 1104 * @center_freq: center freq in mhz 1105 * @chan_num: channel number 1106 * @min_bw: min bw 1107 * @max_bw: max bw 1108 */ 1109 struct chan_map { 1110 qdf_freq_t center_freq; 1111 uint8_t chan_num; 1112 uint16_t min_bw; 1113 uint16_t max_bw; 1114 }; 1115 1116 /** 1117 * struct bonded_channel 1118 * @start_ch: start channel 1119 * @end_ch: end channel 1120 */ 1121 struct bonded_channel { 1122 uint8_t start_ch; 1123 uint8_t end_ch; 1124 }; 1125 1126 /** 1127 * struct bonded_channel_freq 1128 * @start_freq: start channel frequency 1129 * @end_freq: end channel frequency 1130 */ 1131 struct bonded_channel_freq { 1132 uint16_t start_freq; 1133 uint16_t end_freq; 1134 }; 1135 1136 struct set_country { 1137 uint8_t country[REG_ALPHA2_LEN + 1]; 1138 uint8_t pdev_id; 1139 }; 1140 /** 1141 * enum ht_sec_ch_offset 1142 * @NO_SEC_CH: no secondary 1143 * @LOW_PRIMARY_CH: low primary 1144 * @HIGH_PRIMARY_CH: high primary 1145 */ 1146 enum ht_sec_ch_offset { 1147 NO_SEC_CH = 0, 1148 LOW_PRIMARY_CH = 1, 1149 HIGH_PRIMARY_CH = 3, 1150 }; 1151 1152 enum cc_setting_code { 1153 REG_SET_CC_STATUS_PASS = 0, 1154 REG_CURRENT_ALPHA2_NOT_FOUND = 1, 1155 REG_INIT_ALPHA2_NOT_FOUND = 2, 1156 REG_SET_CC_CHANGE_NOT_ALLOWED = 3, 1157 REG_SET_CC_STATUS_NO_MEMORY = 4, 1158 REG_SET_CC_STATUS_FAIL = 5, 1159 }; 1160 1161 /** 1162 * struct cur_reg_rule 1163 * @start_freq: start frequency 1164 * @end_freq: end frequency 1165 * @max_bw: maximum bandwidth 1166 * @reg_power: regulatory power 1167 * @ant_gain: antenna gain 1168 * @flags: regulatory flags 1169 * @psd_flag: is PSD power used 1170 * @psd_eirp: maximum PSD EIRP value 1171 */ 1172 struct cur_reg_rule { 1173 uint16_t start_freq; 1174 uint16_t end_freq; 1175 uint16_t max_bw; 1176 uint8_t reg_power; 1177 uint8_t ant_gain; 1178 uint16_t flags; 1179 bool psd_flag; 1180 uint16_t psd_eirp; 1181 }; 1182 1183 #ifdef CONFIG_REG_CLIENT 1184 /** 1185 * struct cur_fcc_rule 1186 * @center_freq: center frequency 1187 * @tx_power: transmission power 1188 */ 1189 struct cur_fcc_rule { 1190 uint16_t center_freq; 1191 uint8_t tx_power; 1192 }; 1193 #endif 1194 1195 /** 1196 * struct cur_regulatory_info 1197 * @psoc: psoc ptr 1198 * @status_code: status value 1199 * @num_phy: number of phy 1200 * @phy_id: phy id 1201 * @reg_dmn_pair: reg domain pair 1202 * @ctry_code: country code 1203 * @alpha2: country alpha2 1204 * @offload_enabled: offload enabled 1205 * @dfs_reg: dfs region 1206 * @phybitmap: phy bit map 1207 * @min_bw_2g: minimum 2G bw 1208 * @max_bw_2g: maximum 2G bw 1209 * @min_bw_5g: minimum 5G bw 1210 * @max_bw_5g: maximum 5G bw 1211 * @num_2g_reg_rules: number 2G reg rules 1212 * @num_5g_reg_rules: number 5G and 6G reg rules 1213 * @reg_6g_thresh_priority_freq: All frequencies greater or equal will be given 1214 * priority during channel selection by upper layer 1215 * @reg_rules_2g_ptr: ptr to 2G reg rules 1216 * @reg_rules_5g_ptr: ptr to 5G reg rules 1217 * @client_type: type of client 1218 * @rnr_tpe_usable: if RNR TPE octet is usable for country 1219 * @unspecified_ap_usable: if not set, AP usable for country 1220 * @domain_code_6g_ap: domain code for 6G AP 1221 * @domain_code_6g_client: domain code for 6G client in SP mode 1222 * @domain_code_6g_super_id: 6G super domain ID 1223 * @min_bw_6g_ap: minimum 6G bw for AP 1224 * @max_bw_6g_ap: maximum 6G bw for AP 1225 * @min_bw_6g_client: list of minimum 6G bw for clients 1226 * @max_bw_6g_client: list of maximum 6G bw for clients 1227 * @num_6g_reg_rules_ap: number of 6G reg rules for AP 1228 * @num_6g_reg_rules_client: list of number of 6G reg rules for client 1229 * @reg_rules_6g_ap_ptr: ptr to 6G AP reg rules 1230 * @reg_rules_6g_client_ptr: list of ptr to 6G client reg rules 1231 * @fcc_rules_ptr: ptr to fcc rules 1232 * @num_fcc_rules: Number of fcc rules sent by firmware 1233 */ 1234 struct cur_regulatory_info { 1235 struct wlan_objmgr_psoc *psoc; 1236 enum cc_setting_code status_code; 1237 uint8_t num_phy; 1238 uint8_t phy_id; 1239 uint16_t reg_dmn_pair; 1240 uint16_t ctry_code; 1241 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 1242 bool offload_enabled; 1243 enum dfs_reg dfs_region; 1244 uint32_t phybitmap; 1245 uint32_t min_bw_2g; 1246 uint32_t max_bw_2g; 1247 uint32_t min_bw_5g; 1248 uint32_t max_bw_5g; 1249 uint32_t num_2g_reg_rules; 1250 uint32_t num_5g_reg_rules; 1251 qdf_freq_t reg_6g_thresh_priority_freq; 1252 struct cur_reg_rule *reg_rules_2g_ptr; 1253 struct cur_reg_rule *reg_rules_5g_ptr; 1254 enum reg_6g_client_type client_type; 1255 bool rnr_tpe_usable; 1256 bool unspecified_ap_usable; 1257 uint8_t domain_code_6g_ap[REG_CURRENT_MAX_AP_TYPE]; 1258 uint8_t domain_code_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE]; 1259 uint32_t domain_code_6g_super_id; 1260 uint32_t min_bw_6g_ap[REG_CURRENT_MAX_AP_TYPE]; 1261 uint32_t max_bw_6g_ap[REG_CURRENT_MAX_AP_TYPE]; 1262 uint32_t min_bw_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE]; 1263 uint32_t max_bw_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE]; 1264 uint32_t num_6g_reg_rules_ap[REG_CURRENT_MAX_AP_TYPE]; 1265 uint32_t num_6g_reg_rules_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE]; 1266 struct cur_reg_rule *reg_rules_6g_ap_ptr[REG_CURRENT_MAX_AP_TYPE]; 1267 struct cur_reg_rule *reg_rules_6g_client_ptr[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE]; 1268 #ifdef CONFIG_REG_CLIENT 1269 struct cur_fcc_rule *fcc_rules_ptr; 1270 uint32_t num_fcc_rules; 1271 #endif 1272 }; 1273 1274 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ) 1275 1276 /** 1277 * reg_afc_event_type indicates the type of AFC event sent from FW to host. 1278 * 1. For sending Power Info REG_AFC_EVENT_POWER_INFO event is used. 1279 * 2. For sending AFC expiry use REG_AFC_EVENT_TIMER_EXPIRY 1280 * This type can be expanded in future as per requirements. 1281 */ 1282 enum reg_afc_event_type { 1283 REG_AFC_EVENT_POWER_INFO = 1, 1284 REG_AFC_EVENT_TIMER_EXPIRY = 2, 1285 }; 1286 1287 /** 1288 * reg_afc_expiry_event_subtype indicates the subtype. 1289 * 1. At boot up AFC expiry will contain AFC start. 1290 * 2. If AFC timer expires AFC_RENEW status code will be sent to host 1291 * with expiry event. 1292 * 3. If AFC server is not responding to FW in specified time, FW will 1293 * indicate host to switch to LPI. 1294 */ 1295 enum reg_afc_expiry_event_subtype { 1296 REG_AFC_EXPIRY_EVENT_START = 1, 1297 REG_AFC_EXPIRY_EVENT_RENEW = 2, 1298 REG_AFC_EXPIRY_EVENT_SWITCH_TO_LPI = 3, 1299 REG_AFC_EXPIRY_EVENT_STOP_TX = 4, 1300 }; 1301 1302 /** 1303 * The following fw_status_code is mutually exclusive 1304 * and is used in power event. 1305 * 0. AFC power event is success. 1306 * 1. If Host does not indicate AFC indication cmd within certain time 1307 * of AFC expiry, REG_FW_AFC_POWER_EVENT_RESP_NOT_RECEIVED will be used. 1308 * 2. If FW is not able to parse afc_info, parsing_failure will be 1309 * indicated using REG_FW_AFC_POWER_EVENT_RESP_NOT_RECEIVED. 1310 * 3. If due to some local reason AFC event is failed, AFC event failure 1311 * is indicated using REG_FW_AFC_POWER_EVENT_FAILURE. 1312 */ 1313 enum reg_fw_afc_power_event_status_code { 1314 REG_FW_AFC_POWER_EVENT_SUCCESS = 0, 1315 REG_FW_AFC_POWER_EVENT_RESP_NOT_RECEIVED = 1, 1316 REG_FW_AFC_POWER_EVENT_RESP_PARSING_FAILURE = 2, 1317 REG_FW_AFC_POWER_EVENT_FAILURE = 3, 1318 }; 1319 1320 /** 1321 * The following reg_afc_server_resp_code is mutually exclusive. 1322 * This response code will be indicated to AFC server. 1323 * These codes are defined in WIFI spec doc for AFC as follows 1324 * -1: General Failure 1325 * 0: Success 1326 * 100 - 199: General errors related to the protocol 1327 * 300 - 399: Error events specific to message exchange for the 1328 * Available Spectrum Inquiry 1329 */ 1330 enum reg_afc_serv_resp_code { 1331 REG_AFC_SERV_RESP_GENERAL_FAILURE = -1, 1332 REG_AFC_SERV_RESP_SUCCESS = 0, 1333 REG_AFC_SERV_RESP_VERSION_NOT_SUPPORTED = 100, 1334 REG_AFC_SERV_RESP_DEVICE_UNALLOWED = 101, 1335 REG_AFC_SERV_RESP_MISSING_PARAM = 102, 1336 REG_AFC_SERV_RESP_INVALID_VALUE = 103, 1337 REG_AFC_SERV_RESP_UNEXPECTED_PARAM = 106, 1338 REG_AFC_SERV_RESP_UNSUPPORTED_SPECTRUM = 300, 1339 }; 1340 1341 /** 1342 * struct afc_freq_obj 1343 * @low_freq: Lower edge frequency 1344 * @high_freq: Upper edge frequency 1345 * @max_psd: Max PSD in 0.01 dBm/MHz units 1346 */ 1347 struct afc_freq_obj { 1348 qdf_freq_t low_freq; 1349 qdf_freq_t high_freq; 1350 int16_t max_psd; 1351 }; 1352 1353 /** 1354 * struct chan_eirp_obj 1355 * @cfi: Channel frequency index 1356 * @eirp_power: Max EIRP power in 0.01 dBm units 1357 */ 1358 struct chan_eirp_obj { 1359 uint8_t cfi; 1360 uint16_t eirp_power; 1361 }; 1362 1363 /** 1364 * struct afc_chan_obj 1365 * @global_opclass: Global Operating class 1366 * @num_chans: Number of channels 1367 * @chan_eirp_info: Pointer to afc channel EIRP object 1368 */ 1369 struct afc_chan_obj { 1370 uint8_t global_opclass; 1371 uint8_t num_chans; 1372 struct chan_eirp_obj *chan_eirp_info; 1373 }; 1374 1375 /** 1376 * struct reg_afc_expiry_event 1377 * @request_id: AFC request id generated by the firmware 1378 * @event_subtype: AFC expiry event subtype 1379 */ 1380 struct reg_afc_expiry_event { 1381 uint32_t request_id; 1382 enum reg_afc_expiry_event_subtype event_subtype; 1383 }; 1384 1385 /** 1386 * struct reg_fw_afc_power_event 1387 * @resp_id: AFC server response id 1388 * @fw_status_code: firmware status code 1389 * @serv_resp_code: AFC server response code 1390 * @afc_wfa_version: AFC version 1391 * @avail_exp_time_d: Expiry date of the AFC power info 1392 * @avail_exp_time_t: Time left for expiry of the AFC power info 1393 * @num_freq_objs: Number of freq objects 1394 * @num_chan_objs: Number of channel objects 1395 * @afc_freq_info: Pointer to AFC freq object 1396 * @afc_chan_info: Pointer to AFC channel object 1397 */ 1398 struct reg_fw_afc_power_event { 1399 uint32_t resp_id; 1400 enum reg_fw_afc_power_event_status_code fw_status_code; 1401 enum reg_afc_serv_resp_code serv_resp_code; 1402 uint32_t afc_wfa_version; 1403 uint32_t avail_exp_time_d; 1404 uint32_t avail_exp_time_t; 1405 uint8_t num_freq_objs; 1406 uint8_t num_chan_objs; 1407 struct afc_freq_obj *afc_freq_info; 1408 struct afc_chan_obj *afc_chan_info; 1409 }; 1410 1411 /** 1412 * struct afc_regulatory_info 1413 * @psoc: psoc ptr 1414 * @phy_id: phy id 1415 * @event_type: AFC event type 1416 * @expiry_info: pointer to information present in the AFC expiry event 1417 * @power_info: pointer to information present in the AFC power event 1418 */ 1419 struct afc_regulatory_info { 1420 struct wlan_objmgr_psoc *psoc; 1421 uint8_t phy_id; 1422 enum reg_afc_event_type event_type; 1423 union { 1424 struct reg_afc_expiry_event *expiry_info; 1425 struct reg_fw_afc_power_event *power_info; 1426 }; 1427 }; 1428 #endif 1429 1430 /** 1431 * struct reg_rule_info 1432 * @alpha2: alpha2 of reg rules 1433 * @dfs_region: dfs region 1434 * @num_of_reg_rules: number of reg rules 1435 * @reg_rules: regulatory rules array 1436 * @num_of_6g_client_reg_rules: number of 6g reg rules 1437 * @reg_rules_6g_client: reg rules for all 6g clients 1438 */ 1439 struct reg_rule_info { 1440 uint8_t alpha2[REG_ALPHA2_LEN + 1]; 1441 enum dfs_reg dfs_region; 1442 uint8_t num_of_reg_rules; 1443 struct cur_reg_rule reg_rules[MAX_REG_RULES]; 1444 #ifdef CONFIG_BAND_6GHZ 1445 uint8_t num_of_6g_ap_reg_rules[REG_CURRENT_MAX_AP_TYPE]; 1446 struct cur_reg_rule reg_rules_6g_ap[REG_CURRENT_MAX_AP_TYPE][MAX_6G_REG_RULES]; 1447 uint8_t num_of_6g_client_reg_rules[REG_CURRENT_MAX_AP_TYPE]; 1448 struct cur_reg_rule reg_rules_6g_client[REG_CURRENT_MAX_AP_TYPE][MAX_6G_REG_RULES]; 1449 #endif 1450 }; 1451 1452 /** 1453 * enum reg_reg_wifi_band 1454 * @REG_BAND_2G: 2G band 1455 * @REG_BAND_5G: 5G band 1456 * @REG_BAND_6G: 6G band 1457 * @REG_BAND_UNKNOWN: Unsupported band 1458 */ 1459 enum reg_wifi_band { 1460 REG_BAND_2G, 1461 REG_BAND_5G, 1462 REG_BAND_6G, 1463 REG_BAND_UNKNOWN 1464 }; 1465 1466 #ifdef DISABLE_UNII_SHARED_BANDS 1467 /** 1468 * enum reg_unii_band 1469 * @REG_UNII_BAND_1: Disable UNII-1 band channels 1470 * @REG_UNII_BAND_2A: Disable UNII-2A band channels 1471 */ 1472 enum reg_unii_band { 1473 REG_UNII_BAND_1 = 0x0, 1474 REG_UNII_BAND_2A = 0x1, 1475 }; 1476 #endif 1477 1478 #define REG_BAND_MASK_ALL (BIT(REG_BAND_2G) | BIT(REG_BAND_5G) \ 1479 | BIT(REG_BAND_6G)) 1480 1481 /* Avoid the use of band_info as it does not support 6GHz band. Use 1482 * reg_wifi_band, as it supports the 6GHz band 1483 */ 1484 /** 1485 * enum band_info 1486 * @BAND_ALL:all bands 1487 * @BAND_2G: 2G band 1488 * @BAND_5G: 5G band 1489 * @BAND_UNKNOWN: Unsupported band 1490 */ 1491 enum band_info { 1492 BAND_ALL, 1493 BAND_2G, 1494 BAND_5G, 1495 BAND_UNKNOWN 1496 }; 1497 1498 /** 1499 * enum restart_beaconing_on_ch_avoid_rule: control the beaconing entity to 1500 * move away from active LTE channels 1501 * @CH_AVOID_RULE_DO_NOT_RESTART: Do not move from active LTE 1502 * channels 1503 * @CH_AVOID_RULE_RESTART: Move from active LTE channels 1504 * @CH_AVOID_RULE_RESTART_24G_ONLY: move from 2.4G active LTE 1505 * channels only 1506 */ 1507 enum restart_beaconing_on_ch_avoid_rule { 1508 CH_AVOID_RULE_DO_NOT_RESTART, 1509 CH_AVOID_RULE_RESTART, 1510 CH_AVOID_RULE_RESTART_24G_ONLY, 1511 }; 1512 1513 /** 1514 * struct reg_config_vars 1515 * @enable_11d_support: enable 11d support 1516 * @scan_11d_interval: 11d scan interval in ms 1517 * @userspace_ctry_priority: user priority 1518 * @band_capability: band capability 1519 * @dfs_disable: dfs disabled 1520 * @indoor_channel_support: indoor channel support 1521 * @force_ssc_disable_indoor_channel: Disable indoor channel on sap start 1522 * @restart_beaconing: control the beaconing entity to move 1523 * away from active LTE channels 1524 * @enable_srd_chan_in_master_mode: SRD channel support in master mode 1525 * @enable_11d_in_world_mode: enable 11d in world mode 1526 * @enable_5dot9_ghz_chan_in_master_mode: 5.9 GHz channel support in 1527 * master mode 1528 * @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain. 1529 * @coex_unsafe_chan_nb_user_prefer: Honor coex unsafe chan cmd from firmware or 1530 * userspace 1531 * @coex_unsafe_chan_reg_disable: To disable reg channels for received coex 1532 * unsafe channels list 1533 * @enable_6ghz_sp_pwrmode_supp: Enable target 6 GHz Standard Power mode support 1534 * @afc_disable_timer_check: Disable target AFC timer check 1535 * @afc_disable_request_id_check: Disable target AFC request id check 1536 * @is_afc_reg_noaction: Whether no action to AFC power event 1537 * @sta_sap_scc_on_indoor_channel: Value of sap+sta scc on indoor support 1538 */ 1539 struct reg_config_vars { 1540 uint32_t enable_11d_support; 1541 uint32_t scan_11d_interval; 1542 uint32_t userspace_ctry_priority; 1543 uint32_t band_capability; 1544 uint32_t dfs_enabled; 1545 uint32_t indoor_chan_enabled; 1546 uint32_t force_ssc_disable_indoor_channel; 1547 enum restart_beaconing_on_ch_avoid_rule restart_beaconing; 1548 uint8_t enable_srd_chan_in_master_mode; 1549 bool enable_11d_in_world_mode; 1550 bool enable_5dot9_ghz_chan_in_master_mode; 1551 bool retain_nol_across_regdmn_update; 1552 #ifdef FEATURE_WLAN_CH_AVOID_EXT 1553 bool coex_unsafe_chan_nb_user_prefer; 1554 bool coex_unsafe_chan_reg_disable; 1555 #endif 1556 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ) 1557 bool enable_6ghz_sp_pwrmode_supp; 1558 bool afc_disable_timer_check; 1559 bool afc_disable_request_id_check; 1560 bool is_afc_reg_noaction; 1561 #endif 1562 bool sta_sap_scc_on_indoor_channel; 1563 }; 1564 1565 /** 1566 * struct reg_freq_range 1567 * @low_freq: low frequency 1568 * @high_freq: high frequency 1569 */ 1570 struct reg_freq_range { 1571 uint32_t low_freq; 1572 uint32_t high_freq; 1573 }; 1574 1575 /** 1576 * enum direction 1577 * @NORTHBOUND: northbound 1578 * @SOUTHBOUND: southbound 1579 */ 1580 enum direction { 1581 NORTHBOUND, 1582 SOUTHBOUND, 1583 }; 1584 1585 /** 1586 * struct mas_chan_params 1587 * @dfs_region: dfs region 1588 * @phybitmap: phybitmap 1589 * @mas_chan_list: master chan list for 2GHz and 5GHz channels 1590 * @is_6g_channel_list_populated: indicates the channel lists are populated 1591 * @mas_chan_list_6g_ap: master chan list for 6GHz AP channels 1592 * @mas_chan_list_6g_client: master chan list for 6GHz client 1593 * @is_6g_afc_power_event_received: indicates if the AFC event is received. 1594 * @mas_chan_list_6g_afc: master chan list for 6GHz AFC 1595 * @default_country: default country 1596 * @current_country: current country 1597 * @def_region_domain: default reg domain 1598 * @def_country_code: default country code 1599 * @reg_dmn_pair: reg domain pair 1600 * @reg_6g_superid: 6G super domain ID 1601 * @ctry_code: country code 1602 * @reg_rules: regulatory rules 1603 * @client_type: type of client 1604 * @rnr_tpe_usable: if RNR TPE octet is usable for country 1605 * @unspecified_ap_usable: if not set, AP usable for country 1606 * @max_bw_5g: Maximum 5g Bandwidth 1607 * @reg_6g_thresh_priority_freq: All frequencies greater or equal will be given 1608 * priority during channel selection by upper layer 1609 */ 1610 struct mas_chan_params { 1611 enum dfs_reg dfs_region; 1612 uint32_t phybitmap; 1613 struct regulatory_channel mas_chan_list[NUM_CHANNELS]; 1614 #ifdef CONFIG_BAND_6GHZ 1615 bool is_6g_channel_list_populated; 1616 struct regulatory_channel mas_chan_list_6g_ap[REG_CURRENT_MAX_AP_TYPE][NUM_6GHZ_CHANNELS]; 1617 struct regulatory_channel mas_chan_list_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE][NUM_6GHZ_CHANNELS]; 1618 #ifdef CONFIG_AFC_SUPPORT 1619 bool is_6g_afc_power_event_received; 1620 struct regulatory_channel mas_chan_list_6g_afc[NUM_6GHZ_CHANNELS]; 1621 #endif 1622 #endif 1623 char default_country[REG_ALPHA2_LEN + 1]; 1624 char current_country[REG_ALPHA2_LEN + 1]; 1625 uint16_t def_region_domain; 1626 uint16_t def_country_code; 1627 uint32_t reg_dmn_pair; 1628 uint16_t reg_6g_superid; 1629 uint16_t ctry_code; 1630 struct reg_rule_info reg_rules; 1631 #ifdef CONFIG_BAND_6GHZ 1632 enum reg_6g_ap_type ap_pwr_type; 1633 enum reg_6g_client_type client_type; 1634 bool rnr_tpe_usable; 1635 bool unspecified_ap_usable; 1636 qdf_freq_t reg_6g_thresh_priority_freq; 1637 #endif 1638 uint16_t max_bw_5g; 1639 }; 1640 1641 /** 1642 * enum cc_regdmn_flag: Regdomain flags 1643 * @INVALID: Invalid flag 1644 * @CC_IS_SET: Country code is set 1645 * @REGDMN_IS_SET: Regdomain ID is set 1646 * @ALPHA_IS_SET: Country ISO is set 1647 */ 1648 enum cc_regdmn_flag { 1649 INVALID_CC, 1650 CC_IS_SET, 1651 REGDMN_IS_SET, 1652 ALPHA_IS_SET, 1653 }; 1654 1655 /** 1656 * struct cc_regdmn_s: User country code or regdomain 1657 * @country_code: Country code 1658 * @reg_2g_5g_pair_id: Regdomain pair ID (2Ghz + 5Ghz domain pair) 1659 * @sixg_superdmn_id: 6Ghz super domain id 1660 * @alpha: Country ISO 1661 * @flags: Regdomain flags 1662 */ 1663 struct cc_regdmn_s { 1664 union { 1665 uint16_t country_code; 1666 struct { 1667 uint16_t reg_2g_5g_pair_id; 1668 uint16_t sixg_superdmn_id; 1669 } regdmn; 1670 uint8_t alpha[REG_ALPHA2_LEN + 1]; 1671 } cc; 1672 uint8_t flags; 1673 }; 1674 1675 /** 1676 * struct cur_regdmn_info: Current regulatory info 1677 * @regdmn_pair_id: Current regdomain pair ID 1678 * @dmn_id_2g: 2GHz regdomain ID 1679 * @dmn_id_5g: 5GHz regdomain ID 1680 * @ctl_2g: 2GHz CTL value 1681 * @ctl_5g: 5GHzCTL value 1682 * @dfs_region: dfs region 1683 */ 1684 struct cur_regdmn_info { 1685 uint16_t regdmn_pair_id; 1686 uint16_t dmn_id_2g; 1687 uint16_t dmn_id_5g; 1688 uint8_t ctl_2g; 1689 uint8_t ctl_5g; 1690 uint8_t dfs_region; 1691 }; 1692 1693 /** 1694 * struct ch_avoid_freq_type 1695 * @start_freq: start freq 1696 * @end_freq: end freq 1697 * @txpower: txpower 1698 */ 1699 struct ch_avoid_freq_type { 1700 qdf_freq_t start_freq; 1701 qdf_freq_t end_freq; 1702 int32_t txpower; 1703 bool is_valid_txpower; 1704 }; 1705 1706 /** 1707 * struct ch_avoid_ind_type 1708 * @ch_avoid_range_cnt: count 1709 * @avoid_freq_range: avoid freq range array 1710 * @restriction_mask: restriction mask to apply txpower 1711 */ 1712 struct ch_avoid_ind_type { 1713 uint32_t ch_avoid_range_cnt; 1714 struct ch_avoid_freq_type avoid_freq_range[CH_AVOID_MAX_RANGE]; 1715 uint32_t restriction_mask; 1716 }; 1717 1718 /** 1719 * struct unsafe_ch_list 1720 * @chan_cnt: no.of channels 1721 * @chan_freq_list: channel frequency list 1722 */ 1723 struct unsafe_ch_list { 1724 uint16_t chan_cnt; 1725 uint16_t chan_freq_list[NUM_CHANNELS]; 1726 int32_t txpower[NUM_CHANNELS]; 1727 bool is_valid_txpower[NUM_CHANNELS]; 1728 }; 1729 1730 /** 1731 * struct avoid_freq_ind_data 1732 * @freq_list: frequency list 1733 * @chan_list: channel list 1734 */ 1735 struct avoid_freq_ind_data { 1736 struct ch_avoid_ind_type freq_list; 1737 struct unsafe_ch_list chan_list; 1738 }; 1739 1740 /** 1741 * struct reg_sched_payload 1742 * @psoc: psoc ptr 1743 * @pdev: pdev ptr 1744 * @ch_avoid_ind: if avoidance event indicated 1745 * @avoid_info: chan avoid info if @ch_avoid_ind is true 1746 */ 1747 struct reg_sched_payload { 1748 struct wlan_objmgr_psoc *psoc; 1749 struct wlan_objmgr_pdev *pdev; 1750 bool ch_avoid_ind; 1751 struct avoid_freq_ind_data avoid_info; 1752 }; 1753 1754 #define FIVEG_STARTING_FREQ 5000 1755 #define TWOG_STARTING_FREQ 2407 1756 #define TWOG_CHAN_14_IN_MHZ 2484 1757 #define TWOG_CHAN_1_IN_MHZ 2412 1758 #define TWOG_CHAN_5_IN_MHZ 2432 1759 #define TWOG_CHAN_6_IN_MHZ 2437 1760 #define TWOG_CHAN_9_IN_MHZ 2452 1761 #define TWOG_CHAN_13_IN_MHZ 2472 1762 #define FIVEG_CHAN_36_IN_MHZ 5180 1763 #define FIVEG_CHAN_177_IN_MHZ 5885 1764 #define SIXG_CHAN_2_IN_MHZ 5935 1765 #define SIXG_CHAN_1_IN_MHZ 5955 1766 #define SIXG_CHAN_233_IN_MHZ 7115 1767 1768 #define HT40_SEC_OFFSET 20 1769 1770 #define IEEE_2GHZ_CH1 1 1771 #define IEEE_2GHZ_CH14 14 1772 #define IEEE_5GHZ_CH36 36 1773 #define IEEE_6GHZ_CH1 1 1774 #define IEEE_6GHZ_CH2 2 1775 #define IEEE_CH_SEP 5 1776 1777 /** 1778 * struct reg_ctl_params - reg ctl and regd info 1779 * @regd: regdomain pair 1780 * @regd_2g: 2g sub domain code 1781 * @regd_5g: 5g sub domain code 1782 * @ctl_2g: 2g ctl info 1783 * @ctl_5g: 5g ctl info 1784 */ 1785 struct reg_ctl_params { 1786 uint32_t regd; 1787 uint16_t regd_2g; 1788 uint16_t regd_5g; 1789 uint8_t ctl_2g; 1790 uint8_t ctl_5g; 1791 }; 1792 1793 /** 1794 * enum reg_phymode - Regulatory phymode 1795 * @REG_PHYMODE_INVALID: Invalid phymode 1796 * @REG_PHYMODE_11B: 802.11b phymode 1797 * @REG_PHYMODE_11G: 802.11g phymode 1798 * @REG_PHYMODE_11A: 802.11a phymode 1799 * @REG_PHYMODE_11N: 802.11n phymode 1800 * @REG_PHYMODE_11AC: 802.11ac phymode 1801 * @REG_PHYMODE_11AX: 802.11ax phymode 1802 * @REG_PHYMODE_11BE: 802.11be phymode 1803 * @REG_PHYMODE_MAX: placeholder for future phymodes 1804 */ 1805 enum reg_phymode { 1806 REG_PHYMODE_INVALID, 1807 REG_PHYMODE_11B, 1808 REG_PHYMODE_11G, 1809 REG_PHYMODE_11A, 1810 REG_PHYMODE_11N, 1811 REG_PHYMODE_11AC, 1812 REG_PHYMODE_11AX, 1813 #ifdef WLAN_FEATURE_11BE 1814 REG_PHYMODE_11BE, 1815 #endif 1816 REG_PHYMODE_MAX, 1817 }; 1818 1819 /** 1820 * struct chan_power_info - TPE containing power info per channel chunk 1821 * @chan_cfreq: channel center freq (MHz) 1822 * @tx_power: transmit power (dBm) 1823 */ 1824 struct chan_power_info { 1825 qdf_freq_t chan_cfreq; 1826 uint8_t tx_power; 1827 }; 1828 1829 /** 1830 * struct reg_tpc_power_info - regulatory TPC power info 1831 * @is_psd_power: is PSD power or not 1832 * @eirp_power: Maximum EIRP power (dBm), valid only if power is PSD 1833 * @power_type_6g: type of power (SP/LPI/VLP) 1834 * @num_pwr_levels: number of power levels 1835 * @reg_max: Array of maximum TX power (dBm) per PSD value 1836 * @ap_constraint_power: AP constraint power (dBm) 1837 * @frequency: Array of operating frequency 1838 * @tpe: TPE values processed from TPE IE 1839 * @chan_power_info: power info to send to FW 1840 */ 1841 struct reg_tpc_power_info { 1842 bool is_psd_power; 1843 uint8_t eirp_power; 1844 uint8_t power_type_6g; 1845 uint8_t num_pwr_levels; 1846 uint8_t reg_max[MAX_NUM_PWR_LEVEL]; 1847 uint8_t ap_constraint_power; 1848 qdf_freq_t frequency[MAX_NUM_PWR_LEVEL]; 1849 uint8_t tpe[MAX_NUM_PWR_LEVEL]; 1850 struct chan_power_info chan_power_info[MAX_NUM_PWR_LEVEL]; 1851 }; 1852 1853 #ifdef FEATURE_WLAN_CH_AVOID_EXT 1854 typedef struct unsafe_ch_list avoid_ch_ext_list; 1855 /** 1856 * struct chan_5g_center_freq 1857 * @center_freq_20: center frequency of max 200Mhz 1858 * @center_freq_40: center frequency of max 40Mhz 1859 * @center_freq_80: center frequency of max 80Mhz 1860 * @center_freq_160: center frequency of max 160Mhz 1861 */ 1862 struct chan_5g_center_freq { 1863 qdf_freq_t center_freq_20; 1864 qdf_freq_t center_freq_40; 1865 qdf_freq_t center_freq_80; 1866 qdf_freq_t center_freq_160; 1867 }; 1868 1869 #define INVALID_CENTER_FREQ 0 1870 /*MAX 5g channel numbers, not include dsrc*/ 1871 #define MAX_5G_CHAN_NUM 28 1872 1873 #endif 1874 1875 /** 1876 * enum HOST_REGDMN_MODE: 1877 * @HOST_REGDMN_MODE_11A: 11a channels 1878 * @HOST_REGDMN_MODE_TURBO: 11a turbo-only channels 1879 * @HOST_REGDMN_MODE_11B: 11b channels 1880 * @HOST_REGDMN_MODE_PUREG: 11g channels (OFDM only) 1881 * @HOST_REGDMN_MODE_11G: historical 1882 * @HOST_REGDMN_MODE_108G: 11g+Turbo channels 1883 * @HOST_REGDMN_MODE_108A: 11a+Turbo channels 1884 * @HOST_REGDMN_MODE_11AC_VHT20_2G: 2GHz, VHT20 1885 * @HOST_REGDMN_MODE_XR: XR channels 1886 * @HOST_REGDMN_MODE_11A_HALF_RATE: 11a half rate channels 1887 * @HOST_REGDMN_MODE_11A_QUARTER_RATE: 11a quarter rate channels 1888 * @HOST_REGDMN_MODE_11NG_HT20: 11ng HT20 channels 1889 * @HOST_REGDMN_MODE_11NA_HT20: 11na HT20 channels 1890 * @HOST_REGDMN_MODE_11NG_HT40PLUS: 11ng HT40+ channels 1891 * @HOST_REGDMN_MODE_11NG_HT40MINUS: 11ng HT40- channels 1892 * @HOST_REGDMN_MODE_11NA_HT40PLUS: 11na HT40+ channels 1893 * @HOST_REGDMN_MODE_11NA_HT40MINUS: 11na HT40- channels 1894 * @HOST_REGDMN_MODE_11AC_VHT20: 5GHz, VHT20 1895 * @HOST_REGDMN_MODE_11AC_VHT40PLUS: 5GHz, VHT40+ channels 1896 * @HOST_REGDMN_MODE_11AC_VHT40MINUS: 5GHz, VHT40- channels 1897 * @HOST_REGDMN_MODE_11AC_VHT80: 5GHz, VHT80 channels 1898 * @HOST_REGDMN_MODE_11AC_VHT160: 5GHz, VHT160 channels 1899 * @HOST_REGDMN_MODE_11AC_VHT80_80: 5GHz, VHT80+80 channels 1900 * @HOST_REGDMN_MODE_11AXG_HE20: 11ax 2.4GHz, HE20 channels 1901 * @HOST_REGDMN_MODE_11AXA_HE20: 11ax 5GHz, HE20 channels 1902 * @HOST_REGDMN_MODE_11AXG_HE40PLUS: 11ax 2.4GHz, HE40+ channels 1903 * @HOST_REGDMN_MODE_11AXG_HE40MINUS: 11ax 2.4GHz, HE40- channels 1904 * @HOST_REGDMN_MODE_11AXA_HE40PLUS: 11ax 5GHz, HE40+ channels 1905 * @HOST_REGDMN_MODE_11AXA_HE40MINUS: 11ax 5GHz, HE40- channels 1906 * @HOST_REGDMN_MODE_11AXA_HE80: 11ax 5GHz, HE80 channels 1907 * @HOST_REGDMN_MODE_11AXA_HE160: 11ax 5GHz, HE160 channels 1908 * @HOST_REGDMN_MODE_11AXA_HE80_80: 11ax 5GHz, HE80+80 channels 1909 * @HOST_REGDMN_MODE_11BEG_EHT20: 11be 2.4GHz, EHT20 channels 1910 * @HOST_REGDMN_MODE_11BEA_EHT20: 11be 5GHz, EHT20 channels 1911 * @HOST_REGDMN_MODE_11BEG_EHT40PLUS: 11be 2.4GHz, EHT40+ channels 1912 * @HOST_REGDMN_MODE_11BEG_EHT40MINUS: 11be 2.4GHz, EHT40- channels 1913 * @HOST_REGDMN_MODE_11BEA_EHT40PLUS: 11be 5GHz, EHT40+ channels 1914 * @HOST_REGDMN_MODE_11BEA_EHT40MINUS: 11be 5GHz, EHT40- channels 1915 * @HOST_REGDMN_MODE_11BEA_EHT80: 11be 5GHz, EHT80 channels 1916 * @HOST_REGDMN_MODE_11BEA_EHT160: 11be 5GHz, EHT160 channels 1917 * @HOST_REGDMN_MODE_11BEA_EHT320: 11be 5GHz, EHT320 channels 1918 */ 1919 enum { 1920 HOST_REGDMN_MODE_11A = 0x00000001, 1921 HOST_REGDMN_MODE_TURBO = 0x00000002, 1922 HOST_REGDMN_MODE_11B = 0x00000004, 1923 HOST_REGDMN_MODE_PUREG = 0x00000008, 1924 HOST_REGDMN_MODE_11G = 0x00000008, 1925 HOST_REGDMN_MODE_108G = 0x00000020, 1926 HOST_REGDMN_MODE_108A = 0x00000040, 1927 HOST_REGDMN_MODE_11AC_VHT20_2G = 0x00000080, 1928 HOST_REGDMN_MODE_XR = 0x00000100, 1929 HOST_REGDMN_MODE_11A_HALF_RATE = 0x00000200, 1930 HOST_REGDMN_MODE_11A_QUARTER_RATE = 0x00000400, 1931 HOST_REGDMN_MODE_11NG_HT20 = 0x00000800, 1932 HOST_REGDMN_MODE_11NA_HT20 = 0x00001000, 1933 HOST_REGDMN_MODE_11NG_HT40PLUS = 0x00002000, 1934 HOST_REGDMN_MODE_11NG_HT40MINUS = 0x00004000, 1935 HOST_REGDMN_MODE_11NA_HT40PLUS = 0x00008000, 1936 HOST_REGDMN_MODE_11NA_HT40MINUS = 0x00010000, 1937 HOST_REGDMN_MODE_11AC_VHT20 = 0x00020000, 1938 HOST_REGDMN_MODE_11AC_VHT40PLUS = 0x00040000, 1939 HOST_REGDMN_MODE_11AC_VHT40MINUS = 0x00080000, 1940 HOST_REGDMN_MODE_11AC_VHT80 = 0x00100000, 1941 HOST_REGDMN_MODE_11AC_VHT160 = 0x00200000, 1942 HOST_REGDMN_MODE_11AC_VHT80_80 = 0x00400000, 1943 HOST_REGDMN_MODE_11AXG_HE20 = 0x00800000, 1944 HOST_REGDMN_MODE_11AXA_HE20 = 0x01000000, 1945 HOST_REGDMN_MODE_11AXG_HE40PLUS = 0x02000000, 1946 HOST_REGDMN_MODE_11AXG_HE40MINUS = 0x04000000, 1947 HOST_REGDMN_MODE_11AXA_HE40PLUS = 0x08000000, 1948 HOST_REGDMN_MODE_11AXA_HE40MINUS = 0x10000000, 1949 HOST_REGDMN_MODE_11AXA_HE80 = 0x20000000, 1950 HOST_REGDMN_MODE_11AXA_HE160 = 0x40000000, 1951 HOST_REGDMN_MODE_11AXA_HE80_80 = 0x80000000, 1952 #ifdef WLAN_FEATURE_11BE 1953 HOST_REGDMN_MODE_11BEG_EHT20 = 0x0000000100000000, 1954 HOST_REGDMN_MODE_11BEA_EHT20 = 0x0000000200000000, 1955 HOST_REGDMN_MODE_11BEG_EHT40PLUS = 0x0000000400000000, 1956 HOST_REGDMN_MODE_11BEG_EHT40MINUS = 0x0000000800000000, 1957 HOST_REGDMN_MODE_11BEA_EHT40PLUS = 0x0000001000000000, 1958 HOST_REGDMN_MODE_11BEA_EHT40MINUS = 0x0000002000000000, 1959 HOST_REGDMN_MODE_11BEA_EHT80 = 0x0000004000000000, 1960 HOST_REGDMN_MODE_11BEA_EHT160 = 0x0000008000000000, 1961 HOST_REGDMN_MODE_11BEA_EHT320 = 0x0000010000000000, 1962 #endif 1963 HOST_REGDMN_MODE_ALL = 0xffffffffffffffff 1964 }; 1965 1966 #define WIRELESS_11AX_MODES (HOST_REGDMN_MODE_11AXG_HE20 \ 1967 | HOST_REGDMN_MODE_11AXG_HE40PLUS \ 1968 | HOST_REGDMN_MODE_11AXG_HE40MINUS \ 1969 | HOST_REGDMN_MODE_11AXA_HE20 \ 1970 | HOST_REGDMN_MODE_11AXA_HE40PLUS \ 1971 | HOST_REGDMN_MODE_11AXA_HE40MINUS \ 1972 | HOST_REGDMN_MODE_11AXA_HE80 \ 1973 | HOST_REGDMN_MODE_11AXA_HE160 \ 1974 | HOST_REGDMN_MODE_11AXA_HE80_80) 1975 1976 #ifdef WLAN_FEATURE_11BE 1977 #define WIRELESS_11BE_MODES (HOST_REGDMN_MODE_11BEG_EHT20 \ 1978 | HOST_REGDMN_MODE_11BEA_EHT20 \ 1979 | HOST_REGDMN_MODE_11BEG_EHT40PLUS \ 1980 | HOST_REGDMN_MODE_11BEG_EHT40MINUS \ 1981 | HOST_REGDMN_MODE_11BEA_EHT40PLUS \ 1982 | HOST_REGDMN_MODE_11BEA_EHT40MINUS \ 1983 | HOST_REGDMN_MODE_11BEA_EHT80 \ 1984 | HOST_REGDMN_MODE_11BEA_EHT160 \ 1985 | HOST_REGDMN_MODE_11BEA_EHT320) 1986 #endif 1987 1988 #define WIRELESS_11AC_MODES (HOST_REGDMN_MODE_11AC_VHT20 \ 1989 | HOST_REGDMN_MODE_11AC_VHT40PLUS \ 1990 | HOST_REGDMN_MODE_11AC_VHT40MINUS \ 1991 | HOST_REGDMN_MODE_11AC_VHT80 \ 1992 | HOST_REGDMN_MODE_11AC_VHT160 \ 1993 | HOST_REGDMN_MODE_11AC_VHT80_80) 1994 1995 #define WIRELESS_11N_MODES (HOST_REGDMN_MODE_11NG_HT20 \ 1996 | HOST_REGDMN_MODE_11NA_HT20 \ 1997 | HOST_REGDMN_MODE_11NG_HT40PLUS \ 1998 | HOST_REGDMN_MODE_11NG_HT40MINUS \ 1999 | HOST_REGDMN_MODE_11NA_HT40PLUS \ 2000 | HOST_REGDMN_MODE_11NA_HT40MINUS) 2001 2002 #define WIRELESS_11G_MODES (HOST_REGDMN_MODE_PUREG \ 2003 | HOST_REGDMN_MODE_11G \ 2004 | HOST_REGDMN_MODE_108G) 2005 2006 #define WIRELESS_11B_MODES (HOST_REGDMN_MODE_11B) 2007 2008 #define WIRELESS_11A_MODES (HOST_REGDMN_MODE_11A \ 2009 | HOST_REGDMN_MODE_TURBO \ 2010 | HOST_REGDMN_MODE_108A \ 2011 | HOST_REGDMN_MODE_11A_HALF_RATE \ 2012 | HOST_REGDMN_MODE_11A_QUARTER_RATE) 2013 2014 #ifdef WLAN_FEATURE_11BE 2015 #define WIRELESS_20_MODES (HOST_REGDMN_MODE_11A \ 2016 | HOST_REGDMN_MODE_TURBO \ 2017 | HOST_REGDMN_MODE_11B \ 2018 | HOST_REGDMN_MODE_PUREG \ 2019 | HOST_REGDMN_MODE_11G \ 2020 | HOST_REGDMN_MODE_11AC_VHT20_2G \ 2021 | HOST_REGDMN_MODE_11NG_HT20 \ 2022 | HOST_REGDMN_MODE_11NA_HT20 \ 2023 | HOST_REGDMN_MODE_11AC_VHT20 \ 2024 | HOST_REGDMN_MODE_11AXG_HE20 \ 2025 | HOST_REGDMN_MODE_11AXA_HE20 \ 2026 | HOST_REGDMN_MODE_11BEA_EHT20 \ 2027 | HOST_REGDMN_MODE_11BEG_EHT20) 2028 #else 2029 #define WIRELESS_20_MODES (HOST_REGDMN_MODE_11A \ 2030 | HOST_REGDMN_MODE_TURBO \ 2031 | HOST_REGDMN_MODE_11B \ 2032 | HOST_REGDMN_MODE_PUREG \ 2033 | HOST_REGDMN_MODE_11G \ 2034 | HOST_REGDMN_MODE_11AC_VHT20_2G \ 2035 | HOST_REGDMN_MODE_11NG_HT20 \ 2036 | HOST_REGDMN_MODE_11NA_HT20 \ 2037 | HOST_REGDMN_MODE_11AC_VHT20 \ 2038 | HOST_REGDMN_MODE_11AXG_HE20 \ 2039 | HOST_REGDMN_MODE_11AXA_HE20) 2040 #endif 2041 2042 #define WIRELESS_10_MODES (HOST_REGDMN_MODE_11A_HALF_RATE) 2043 #define WIRELESS_5_MODES (HOST_REGDMN_MODE_11A_QUARTER_RATE) 2044 2045 #ifdef WLAN_FEATURE_11BE 2046 #define WIRELESS_40_MODES (HOST_REGDMN_MODE_11NG_HT40PLUS \ 2047 | HOST_REGDMN_MODE_11NG_HT40MINUS \ 2048 | HOST_REGDMN_MODE_11NA_HT40PLUS \ 2049 | HOST_REGDMN_MODE_11NA_HT40MINUS \ 2050 | HOST_REGDMN_MODE_11AC_VHT40PLUS \ 2051 | HOST_REGDMN_MODE_11AC_VHT40MINUS \ 2052 | HOST_REGDMN_MODE_11AXG_HE40PLUS \ 2053 | HOST_REGDMN_MODE_11AXG_HE40MINUS \ 2054 | HOST_REGDMN_MODE_11AXA_HE40PLUS \ 2055 | HOST_REGDMN_MODE_11AXA_HE40MINUS \ 2056 | HOST_REGDMN_MODE_11BEA_EHT40PLUS \ 2057 | HOST_REGDMN_MODE_11BEA_EHT40MINUS \ 2058 | HOST_REGDMN_MODE_11BEG_EHT40PLUS \ 2059 | HOST_REGDMN_MODE_11BEG_EHT40MINUS) 2060 #else 2061 #define WIRELESS_40_MODES (HOST_REGDMN_MODE_11NG_HT40PLUS \ 2062 | HOST_REGDMN_MODE_11NG_HT40MINUS \ 2063 | HOST_REGDMN_MODE_11NA_HT40PLUS \ 2064 | HOST_REGDMN_MODE_11NA_HT40MINUS \ 2065 | HOST_REGDMN_MODE_11AC_VHT40PLUS \ 2066 | HOST_REGDMN_MODE_11AC_VHT40MINUS \ 2067 | HOST_REGDMN_MODE_11AXG_HE40PLUS \ 2068 | HOST_REGDMN_MODE_11AXG_HE40MINUS \ 2069 | HOST_REGDMN_MODE_11AXA_HE40PLUS \ 2070 | HOST_REGDMN_MODE_11AXA_HE40MINUS) 2071 #endif 2072 2073 #ifdef WLAN_FEATURE_11BE 2074 #define WIRELESS_80_MODES (HOST_REGDMN_MODE_11AC_VHT80 \ 2075 | HOST_REGDMN_MODE_11AXA_HE80 \ 2076 | HOST_REGDMN_MODE_11BEA_EHT80) 2077 #else 2078 #define WIRELESS_80_MODES (HOST_REGDMN_MODE_11AC_VHT80 \ 2079 | HOST_REGDMN_MODE_11AXA_HE80) 2080 #endif 2081 2082 #ifdef WLAN_FEATURE_11BE 2083 #define WIRELESS_160_MODES (HOST_REGDMN_MODE_11AC_VHT160 \ 2084 | HOST_REGDMN_MODE_11AXA_HE160 \ 2085 | HOST_REGDMN_MODE_11BEA_EHT160) 2086 #else 2087 #define WIRELESS_160_MODES (HOST_REGDMN_MODE_11AC_VHT160 \ 2088 | HOST_REGDMN_MODE_11AXA_HE160) 2089 #endif 2090 2091 #define WIRELESS_80P80_MODES (HOST_REGDMN_MODE_11AC_VHT80_80 \ 2092 | HOST_REGDMN_MODE_11AXA_HE80_80) 2093 2094 #ifdef WLAN_FEATURE_11BE 2095 #define WIRELESS_320_MODES (HOST_REGDMN_MODE_11BEA_EHT320) 2096 #endif 2097 2098 #ifdef WLAN_FEATURE_11BE 2099 #define WIRELESS_6G_MODES_11BE (HOST_REGDMN_MODE_11BEA_EHT20 \ 2100 | HOST_REGDMN_MODE_11BEA_EHT40PLUS \ 2101 | HOST_REGDMN_MODE_11BEA_EHT40MINUS \ 2102 | HOST_REGDMN_MODE_11BEA_EHT80 \ 2103 | HOST_REGDMN_MODE_11BEA_EHT160 \ 2104 | HOST_REGDMN_MODE_11BEA_EHT320) 2105 #else 2106 #define WIRELESS_6G_MODES_11BE 0 2107 #endif /* WLAN_FEATURE_11BE*/ 2108 2109 #ifdef WLAN_FEATURE_11BE 2110 #define WIRELESS_6G_MODES (HOST_REGDMN_MODE_11AXA_HE20 \ 2111 | HOST_REGDMN_MODE_11AXA_HE40PLUS \ 2112 | HOST_REGDMN_MODE_11AXA_HE40MINUS \ 2113 | HOST_REGDMN_MODE_11AXA_HE80 \ 2114 | HOST_REGDMN_MODE_11AXA_HE160 \ 2115 | HOST_REGDMN_MODE_11AXA_HE80_80 \ 2116 | HOST_REGDMN_MODE_11BEA_EHT20 \ 2117 | HOST_REGDMN_MODE_11BEA_EHT40PLUS \ 2118 | HOST_REGDMN_MODE_11BEA_EHT40MINUS \ 2119 | HOST_REGDMN_MODE_11BEA_EHT80 \ 2120 | HOST_REGDMN_MODE_11BEA_EHT160 \ 2121 | HOST_REGDMN_MODE_11BEA_EHT320) 2122 #else 2123 #define WIRELESS_6G_MODES (HOST_REGDMN_MODE_11AXA_HE20 \ 2124 | HOST_REGDMN_MODE_11AXA_HE40PLUS \ 2125 | HOST_REGDMN_MODE_11AXA_HE40MINUS \ 2126 | HOST_REGDMN_MODE_11AXA_HE80 \ 2127 | HOST_REGDMN_MODE_11AXA_HE160 \ 2128 | HOST_REGDMN_MODE_11AXA_HE80_80) 2129 #endif 2130 2131 #ifdef WLAN_FEATURE_11BE 2132 #define WIRELESS_5G_MODES_11BE (HOST_REGDMN_MODE_11BEA_EHT20 \ 2133 | HOST_REGDMN_MODE_11BEA_EHT40PLUS \ 2134 | HOST_REGDMN_MODE_11BEA_EHT40MINUS \ 2135 | HOST_REGDMN_MODE_11BEA_EHT80 \ 2136 | HOST_REGDMN_MODE_11BEA_EHT160 \ 2137 | HOST_REGDMN_MODE_11BEA_EHT320) 2138 #else 2139 #define WIRELESS_5G_MODES_11BE 0 2140 #endif /* WLAN_FEATURE_11BE*/ 2141 2142 #ifdef WLAN_FEATURE_11BE 2143 #define WIRELESS_5G_MODES (HOST_REGDMN_MODE_11BEA_EHT20 \ 2144 | HOST_REGDMN_MODE_11BEA_EHT40PLUS \ 2145 | HOST_REGDMN_MODE_11BEA_EHT40MINUS \ 2146 | HOST_REGDMN_MODE_11BEA_EHT80 \ 2147 | HOST_REGDMN_MODE_11BEA_EHT160 \ 2148 | HOST_REGDMN_MODE_11BEA_EHT320 \ 2149 | HOST_REGDMN_MODE_11AXA_HE20 \ 2150 | HOST_REGDMN_MODE_11AXA_HE40PLUS \ 2151 | HOST_REGDMN_MODE_11AXA_HE40MINUS \ 2152 | HOST_REGDMN_MODE_11AXA_HE80 \ 2153 | HOST_REGDMN_MODE_11AXA_HE160 \ 2154 | HOST_REGDMN_MODE_11AXA_HE80_80 \ 2155 | HOST_REGDMN_MODE_11AC_VHT20 \ 2156 | HOST_REGDMN_MODE_11AC_VHT40PLUS \ 2157 | HOST_REGDMN_MODE_11AC_VHT40MINUS \ 2158 | HOST_REGDMN_MODE_11AC_VHT80 \ 2159 | HOST_REGDMN_MODE_11AC_VHT160 \ 2160 | HOST_REGDMN_MODE_11AC_VHT80_80 \ 2161 | HOST_REGDMN_MODE_11NA_HT20 \ 2162 | HOST_REGDMN_MODE_11NA_HT40PLUS \ 2163 | HOST_REGDMN_MODE_11NA_HT40MINUS \ 2164 | HOST_REGDMN_MODE_11A \ 2165 | HOST_REGDMN_MODE_TURBO \ 2166 | HOST_REGDMN_MODE_108A \ 2167 | HOST_REGDMN_MODE_11A_HALF_RATE \ 2168 | HOST_REGDMN_MODE_11A_QUARTER_RATE) 2169 #else 2170 #define WIRELESS_5G_MODES (HOST_REGDMN_MODE_11AXA_HE20 \ 2171 | HOST_REGDMN_MODE_11AXA_HE40PLUS \ 2172 | HOST_REGDMN_MODE_11AXA_HE40MINUS \ 2173 | HOST_REGDMN_MODE_11AXA_HE80 \ 2174 | HOST_REGDMN_MODE_11AXA_HE160 \ 2175 | HOST_REGDMN_MODE_11AXA_HE80_80 \ 2176 | HOST_REGDMN_MODE_11AC_VHT20 \ 2177 | HOST_REGDMN_MODE_11AC_VHT40PLUS \ 2178 | HOST_REGDMN_MODE_11AC_VHT40MINUS \ 2179 | HOST_REGDMN_MODE_11AC_VHT80 \ 2180 | HOST_REGDMN_MODE_11AC_VHT160 \ 2181 | HOST_REGDMN_MODE_11AC_VHT80_80 \ 2182 | HOST_REGDMN_MODE_11NA_HT20 \ 2183 | HOST_REGDMN_MODE_11NA_HT40PLUS \ 2184 | HOST_REGDMN_MODE_11NA_HT40MINUS \ 2185 | HOST_REGDMN_MODE_11A \ 2186 | HOST_REGDMN_MODE_TURBO \ 2187 | HOST_REGDMN_MODE_108A \ 2188 | HOST_REGDMN_MODE_11A_HALF_RATE \ 2189 | HOST_REGDMN_MODE_11A_QUARTER_RATE) 2190 #endif 2191 2192 #define WIRELESS_49G_MODES (HOST_REGDMN_MODE_11A \ 2193 | HOST_REGDMN_MODE_11A_HALF_RATE \ 2194 | HOST_REGDMN_MODE_11A_QUARTER_RATE) 2195 #ifdef WLAN_FEATURE_11BE 2196 #define WIRELESS_2G_MODES_11BE (HOST_REGDMN_MODE_11BEG_EHT20 \ 2197 | HOST_REGDMN_MODE_11BEG_EHT40PLUS \ 2198 | HOST_REGDMN_MODE_11BEG_EHT40MINUS) 2199 #else 2200 #define WIRELESS_2G_MODES_11BE 0 2201 #endif /* WLAN_FEATURE_11BE*/ 2202 2203 #ifdef WLAN_FEATURE_11BE 2204 #define WIRELESS_2G_MODES (HOST_REGDMN_MODE_11BEG_EHT20 \ 2205 | HOST_REGDMN_MODE_11BEG_EHT40PLUS \ 2206 | HOST_REGDMN_MODE_11BEG_EHT40MINUS \ 2207 | HOST_REGDMN_MODE_11AXG_HE20 \ 2208 | HOST_REGDMN_MODE_11AXG_HE40PLUS \ 2209 | HOST_REGDMN_MODE_11AXG_HE40MINUS \ 2210 | HOST_REGDMN_MODE_11NG_HT20 \ 2211 | HOST_REGDMN_MODE_11NG_HT40PLUS \ 2212 | HOST_REGDMN_MODE_11NG_HT40MINUS \ 2213 | HOST_REGDMN_MODE_PUREG \ 2214 | HOST_REGDMN_MODE_11G \ 2215 | HOST_REGDMN_MODE_108G \ 2216 | HOST_REGDMN_MODE_11B) 2217 #else 2218 #define WIRELESS_2G_MODES (HOST_REGDMN_MODE_11AXG_HE20 \ 2219 | HOST_REGDMN_MODE_11AXG_HE40PLUS \ 2220 | HOST_REGDMN_MODE_11AXG_HE40MINUS \ 2221 | HOST_REGDMN_MODE_11NG_HT20 \ 2222 | HOST_REGDMN_MODE_11NG_HT40PLUS \ 2223 | HOST_REGDMN_MODE_11NG_HT40MINUS \ 2224 | HOST_REGDMN_MODE_PUREG \ 2225 | HOST_REGDMN_MODE_11G \ 2226 | HOST_REGDMN_MODE_108G \ 2227 | HOST_REGDMN_MODE_11B) 2228 #endif 2229 2230 #ifdef CONFIG_AFC_SUPPORT 2231 /* enum reg_afc_cmd_type - Type of AFC command sent to FW 2232 * @REG_AFC_CMD_SERV_RESP_READY : Server response is ready 2233 * @REG_AFC_CMD_RESET_AFC: Indicate the target to reset AFC 2234 */ 2235 enum reg_afc_cmd_type { 2236 REG_AFC_CMD_SERV_RESP_READY = 1, 2237 REG_AFC_CMD_RESET_AFC = 2, 2238 }; 2239 2240 /* enum reg_afc_serv_resp_format - Indicate the format in which afc_serv_format 2241 * is written in FW memory 2242 * @REG_AFC_SERV_RESP_FORMAT_JSON - Server response in JSON format 2243 * @REG_AFC_SERV_RESP_FORMAT_BINARY - Server response in BINARY format 2244 */ 2245 enum reg_afc_serv_resp_format { 2246 REG_AFC_SERV_RESP_FORMAT_JSON = 0, 2247 REG_AFC_SERV_RESP_FORMAT_BINARY = 1, 2248 }; 2249 2250 /** 2251 * struct reg_afc_resp_rx_ind_info - regulatory AFC indication info 2252 * @cmd_type: Type of AFC command send to FW 2253 * @serv_resp_format: AFC server response format 2254 */ 2255 struct reg_afc_resp_rx_ind_info { 2256 enum reg_afc_cmd_type cmd_type; 2257 enum reg_afc_serv_resp_format serv_resp_format; 2258 }; 2259 2260 /** 2261 * afc_req_rx_evt_handler() - Function prototype of AFC request received event 2262 * handler 2263 * @pdev: Pointer to pdev 2264 * @afc_par_req: Pointer to AFC partial request 2265 * @arg: Pointer to void (opaque) argument object 2266 * 2267 * Return: void 2268 */ 2269 typedef void (*afc_req_rx_evt_handler)(struct wlan_objmgr_pdev *pdev, 2270 struct wlan_afc_host_partial_request *afc_par_req, 2271 void *arg); 2272 2273 /** 2274 * afc_power_tx_evt_handler() - Function prototype of AFC power event sent 2275 * handler 2276 * @pdev: Pointer to pdev 2277 * @power_info: Pointer to AFC power event data 2278 * @arg: Pointer to void (opaque) argument object 2279 * 2280 * Return: void 2281 */ 2282 typedef void 2283 (*afc_power_tx_evt_handler)(struct wlan_objmgr_pdev *pdev, 2284 struct reg_fw_afc_power_event *power_info, 2285 void *arg); 2286 #endif 2287 2288 /** 2289 * reg_is_chan_enum_invalid() - Checks if the channel enum is invalid or not. 2290 * @chan_enum: Input channel enum. 2291 * 2292 * Return: true if channel enum is invalid else false. 2293 */ 2294 static inline bool reg_is_chan_enum_invalid(enum channel_enum chan_enum) 2295 { 2296 return chan_enum >= INVALID_CHANNEL; 2297 } 2298 #endif 2299