0044-wifi-ath11k-add-support-to-parse-new-WMI-event-for-6.patch 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. From 91fa00fa69224aae5afb720c5e68b22e4c4f7333 Mon Sep 17 00:00:00 2001
  2. From: Aditya Kumar Singh <quic_adisi@quicinc.com>
  3. Date: Wed, 1 Mar 2023 16:20:59 +0200
  4. Subject: [PATCH] wifi: ath11k: add support to parse new WMI event for 6 GHz
  5. In order to support different power levels of 6 GHz AP and client,
  6. new WMI event for regulatory - WMI_REG_CHAN_LIST_CC_EXT_EVENTID is
  7. added in firmware. This event provides new parameters required for
  8. 6 GHz regulatory rules.
  9. Add support for parsing 2.4 GHz, 5 GHz and 6 GHz reg rules and other
  10. parameters from WMI_REG_CHAN_LIST_CC_EXT_EVENTID.
  11. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
  12. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
  13. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
  14. Signed-off-by: Lavanya Suresh <quic_lavaks@quicinc.com>
  15. Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
  16. Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
  17. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  18. Link: https://lore.kernel.org/r/20230110121024.14051-3-quic_adisi@quicinc.com
  19. ---
  20. drivers/net/wireless/ath/ath11k/reg.c | 37 ++-
  21. drivers/net/wireless/ath/ath11k/wmi.c | 418 +++++++++++++++++++++++++-
  22. drivers/net/wireless/ath/ath11k/wmi.h | 163 +++++++++-
  23. 3 files changed, 584 insertions(+), 34 deletions(-)
  24. --- a/drivers/net/wireless/ath/ath11k/reg.c
  25. +++ b/drivers/net/wireless/ath/ath11k/reg.c
  26. @@ -613,7 +613,7 @@ ath11k_reg_build_regd(struct ath11k_base
  27. {
  28. struct ieee80211_regdomain *tmp_regd, *default_regd, *new_regd = NULL;
  29. struct cur_reg_rule *reg_rule;
  30. - u8 i = 0, j = 0;
  31. + u8 i = 0, j = 0, k = 0;
  32. u8 num_rules;
  33. u16 max_bw;
  34. u32 flags;
  35. @@ -621,6 +621,12 @@ ath11k_reg_build_regd(struct ath11k_base
  36. num_rules = reg_info->num_5ghz_reg_rules + reg_info->num_2ghz_reg_rules;
  37. + /* FIXME: Currently taking reg rules for 6 GHz only from Indoor AP mode list.
  38. + * This can be updated after complete 6 GHz regulatory support is added.
  39. + */
  40. + if (reg_info->is_ext_reg_event)
  41. + num_rules += reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP];
  42. +
  43. if (!num_rules)
  44. goto ret;
  45. @@ -666,6 +672,14 @@ ath11k_reg_build_regd(struct ath11k_base
  46. * per other BW rule flags we pass from here
  47. */
  48. flags = NL80211_RRF_AUTO_BW;
  49. + } else if (reg_info->is_ext_reg_event &&
  50. + reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] &&
  51. + (k < reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP])) {
  52. + reg_rule = reg_info->reg_rules_6ghz_ap_ptr[WMI_REG_INDOOR_AP] +
  53. + k++;
  54. + max_bw = min_t(u16, reg_rule->max_bw,
  55. + reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP]);
  56. + flags = NL80211_RRF_AUTO_BW;
  57. } else {
  58. break;
  59. }
  60. @@ -693,12 +707,21 @@ ath11k_reg_build_regd(struct ath11k_base
  61. continue;
  62. }
  63. - ath11k_dbg(ab, ATH11K_DBG_REG,
  64. - "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
  65. - i + 1, reg_rule->start_freq, reg_rule->end_freq,
  66. - max_bw, reg_rule->ant_gain, reg_rule->reg_power,
  67. - tmp_regd->reg_rules[i].dfs_cac_ms,
  68. - flags);
  69. + if (reg_info->is_ext_reg_event) {
  70. + ath11k_dbg(ab, ATH11K_DBG_REG,
  71. + "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n",
  72. + i + 1, reg_rule->start_freq, reg_rule->end_freq,
  73. + max_bw, reg_rule->ant_gain, reg_rule->reg_power,
  74. + tmp_regd->reg_rules[i].dfs_cac_ms, flags,
  75. + reg_rule->psd_flag, reg_rule->psd_eirp);
  76. + } else {
  77. + ath11k_dbg(ab, ATH11K_DBG_REG,
  78. + "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d)\n",
  79. + i + 1, reg_rule->start_freq, reg_rule->end_freq,
  80. + max_bw, reg_rule->ant_gain, reg_rule->reg_power,
  81. + tmp_regd->reg_rules[i].dfs_cac_ms,
  82. + flags);
  83. + }
  84. }
  85. tmp_regd->n_reg_rules = i;
  86. --- a/drivers/net/wireless/ath/ath11k/wmi.c
  87. +++ b/drivers/net/wireless/ath/ath11k/wmi.c
  88. @@ -105,6 +105,8 @@ static const struct wmi_tlv_policy wmi_t
  89. = { .min_len = sizeof(struct wmi_vdev_stopped_event) },
  90. [WMI_TAG_REG_CHAN_LIST_CC_EVENT]
  91. = { .min_len = sizeof(struct wmi_reg_chan_list_cc_event) },
  92. + [WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT]
  93. + = { .min_len = sizeof(struct wmi_reg_chan_list_cc_ext_event) },
  94. [WMI_TAG_MGMT_RX_HDR]
  95. = { .min_len = sizeof(struct wmi_mgmt_rx_hdr) },
  96. [WMI_TAG_MGMT_TX_COMPL_EVENT]
  97. @@ -3974,6 +3976,10 @@ ath11k_wmi_copy_resource_config(struct w
  98. wmi_cfg->sched_params = tg_cfg->sched_params;
  99. wmi_cfg->twt_ap_pdev_count = tg_cfg->twt_ap_pdev_count;
  100. wmi_cfg->twt_ap_sta_count = tg_cfg->twt_ap_sta_count;
  101. + wmi_cfg->host_service_flags &=
  102. + ~(1 << WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
  103. + wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported <<
  104. + WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
  105. }
  106. static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
  107. @@ -4192,6 +4198,10 @@ int ath11k_wmi_cmd_init(struct ath11k_ba
  108. ab->hw_params.hw_ops->wmi_init_config(ab, &config);
  109. + if (test_bit(WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT,
  110. + ab->wmi_ab.svc_map))
  111. + config.is_reg_cc_ext_event_supported = 1;
  112. +
  113. memcpy(&wmi_sc->wlan_resource_config, &config, sizeof(config));
  114. init_param.res_cfg = &wmi_sc->wlan_resource_config;
  115. @@ -4995,18 +5005,11 @@ static int ath11k_pull_reg_chan_list_upd
  116. reg_info->phy_id = chan_list_event_hdr->phy_id;
  117. reg_info->ctry_code = chan_list_event_hdr->country_id;
  118. reg_info->reg_dmn_pair = chan_list_event_hdr->domain_code;
  119. - if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_PASS)
  120. - reg_info->status_code = REG_SET_CC_STATUS_PASS;
  121. - else if (chan_list_event_hdr->status_code == WMI_REG_CURRENT_ALPHA2_NOT_FOUND)
  122. - reg_info->status_code = REG_CURRENT_ALPHA2_NOT_FOUND;
  123. - else if (chan_list_event_hdr->status_code == WMI_REG_INIT_ALPHA2_NOT_FOUND)
  124. - reg_info->status_code = REG_INIT_ALPHA2_NOT_FOUND;
  125. - else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_CHANGE_NOT_ALLOWED)
  126. - reg_info->status_code = REG_SET_CC_CHANGE_NOT_ALLOWED;
  127. - else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_NO_MEMORY)
  128. - reg_info->status_code = REG_SET_CC_STATUS_NO_MEMORY;
  129. - else if (chan_list_event_hdr->status_code == WMI_REG_SET_CC_STATUS_FAIL)
  130. - reg_info->status_code = REG_SET_CC_STATUS_FAIL;
  131. +
  132. + reg_info->status_code =
  133. + ath11k_wmi_cc_setting_code_to_reg(chan_list_event_hdr->status_code);
  134. +
  135. + reg_info->is_ext_reg_event = false;
  136. reg_info->min_bw_2ghz = chan_list_event_hdr->min_bw_2ghz;
  137. reg_info->max_bw_2ghz = chan_list_event_hdr->max_bw_2ghz;
  138. @@ -5060,6 +5063,372 @@ static int ath11k_pull_reg_chan_list_upd
  139. return 0;
  140. }
  141. +static struct cur_reg_rule
  142. +*create_ext_reg_rules_from_wmi(u32 num_reg_rules,
  143. + struct wmi_regulatory_ext_rule *wmi_reg_rule)
  144. +{
  145. + struct cur_reg_rule *reg_rule_ptr;
  146. + u32 count;
  147. +
  148. + reg_rule_ptr = kcalloc(num_reg_rules, sizeof(*reg_rule_ptr), GFP_ATOMIC);
  149. +
  150. + if (!reg_rule_ptr)
  151. + return NULL;
  152. +
  153. + for (count = 0; count < num_reg_rules; count++) {
  154. + reg_rule_ptr[count].start_freq =
  155. + u32_get_bits(wmi_reg_rule[count].freq_info,
  156. + REG_RULE_START_FREQ);
  157. + reg_rule_ptr[count].end_freq =
  158. + u32_get_bits(wmi_reg_rule[count].freq_info,
  159. + REG_RULE_END_FREQ);
  160. + reg_rule_ptr[count].max_bw =
  161. + u32_get_bits(wmi_reg_rule[count].bw_pwr_info,
  162. + REG_RULE_MAX_BW);
  163. + reg_rule_ptr[count].reg_power =
  164. + u32_get_bits(wmi_reg_rule[count].bw_pwr_info,
  165. + REG_RULE_REG_PWR);
  166. + reg_rule_ptr[count].ant_gain =
  167. + u32_get_bits(wmi_reg_rule[count].bw_pwr_info,
  168. + REG_RULE_ANT_GAIN);
  169. + reg_rule_ptr[count].flags =
  170. + u32_get_bits(wmi_reg_rule[count].flag_info,
  171. + REG_RULE_FLAGS);
  172. + reg_rule_ptr[count].psd_flag =
  173. + u32_get_bits(wmi_reg_rule[count].psd_power_info,
  174. + REG_RULE_PSD_INFO);
  175. + reg_rule_ptr[count].psd_eirp =
  176. + u32_get_bits(wmi_reg_rule[count].psd_power_info,
  177. + REG_RULE_PSD_EIRP);
  178. + }
  179. +
  180. + return reg_rule_ptr;
  181. +}
  182. +
  183. +static u8
  184. +ath11k_invalid_5ghz_reg_ext_rules_from_wmi(u32 num_reg_rules,
  185. + const struct wmi_regulatory_ext_rule *rule)
  186. +{
  187. + u8 num_invalid_5ghz_rules = 0;
  188. + u32 count, start_freq;
  189. +
  190. + for (count = 0; count < num_reg_rules; count++) {
  191. + start_freq = u32_get_bits(rule[count].freq_info,
  192. + REG_RULE_START_FREQ);
  193. +
  194. + if (start_freq >= ATH11K_MIN_6G_FREQ)
  195. + num_invalid_5ghz_rules++;
  196. + }
  197. +
  198. + return num_invalid_5ghz_rules;
  199. +}
  200. +
  201. +static int ath11k_pull_reg_chan_list_ext_update_ev(struct ath11k_base *ab,
  202. + struct sk_buff *skb,
  203. + struct cur_regulatory_info *reg_info)
  204. +{
  205. + const void **tb;
  206. + const struct wmi_reg_chan_list_cc_ext_event *ext_chan_list_event_hdr;
  207. + struct wmi_regulatory_ext_rule *ext_wmi_reg_rule;
  208. + u32 num_2ghz_reg_rules, num_5ghz_reg_rules;
  209. + u32 num_6ghz_reg_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
  210. + u32 num_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
  211. + u32 total_reg_rules = 0;
  212. + int ret, i, j, num_invalid_5ghz_ext_rules = 0;
  213. +
  214. + ath11k_dbg(ab, ATH11K_DBG_WMI, "processing regulatory ext channel list\n");
  215. +
  216. + tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC);
  217. + if (IS_ERR(tb)) {
  218. + ret = PTR_ERR(tb);
  219. + ath11k_warn(ab, "failed to parse tlv: %d\n", ret);
  220. + return ret;
  221. + }
  222. +
  223. + ext_chan_list_event_hdr = tb[WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT];
  224. + if (!ext_chan_list_event_hdr) {
  225. + ath11k_warn(ab, "failed to fetch reg chan list ext update ev\n");
  226. + kfree(tb);
  227. + return -EPROTO;
  228. + }
  229. +
  230. + reg_info->num_2ghz_reg_rules =
  231. + ext_chan_list_event_hdr->num_2ghz_reg_rules;
  232. + reg_info->num_5ghz_reg_rules =
  233. + ext_chan_list_event_hdr->num_5ghz_reg_rules;
  234. + reg_info->num_6ghz_rules_ap[WMI_REG_INDOOR_AP] =
  235. + ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_lpi;
  236. + reg_info->num_6ghz_rules_ap[WMI_REG_STANDARD_POWER_AP] =
  237. + ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_sp;
  238. + reg_info->num_6ghz_rules_ap[WMI_REG_VERY_LOW_POWER_AP] =
  239. + ext_chan_list_event_hdr->num_6ghz_reg_rules_ap_vlp;
  240. +
  241. + for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
  242. + reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i] =
  243. + ext_chan_list_event_hdr->num_6ghz_reg_rules_client_lpi[i];
  244. + reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i] =
  245. + ext_chan_list_event_hdr->num_6ghz_reg_rules_client_sp[i];
  246. + reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i] =
  247. + ext_chan_list_event_hdr->num_6ghz_reg_rules_client_vlp[i];
  248. + }
  249. +
  250. + num_2ghz_reg_rules = reg_info->num_2ghz_reg_rules;
  251. + num_5ghz_reg_rules = reg_info->num_5ghz_reg_rules;
  252. +
  253. + total_reg_rules += num_2ghz_reg_rules;
  254. + total_reg_rules += num_5ghz_reg_rules;
  255. +
  256. + if ((num_2ghz_reg_rules > MAX_REG_RULES) ||
  257. + (num_5ghz_reg_rules > MAX_REG_RULES)) {
  258. + ath11k_warn(ab, "Num reg rules for 2.4 GHz/5 GHz exceeds max limit (num_2ghz_reg_rules: %d num_5ghz_reg_rules: %d max_rules: %d)\n",
  259. + num_2ghz_reg_rules, num_5ghz_reg_rules, MAX_REG_RULES);
  260. + kfree(tb);
  261. + return -EINVAL;
  262. + }
  263. +
  264. + for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) {
  265. + num_6ghz_reg_rules_ap[i] = reg_info->num_6ghz_rules_ap[i];
  266. +
  267. + if (num_6ghz_reg_rules_ap[i] > MAX_6GHZ_REG_RULES) {
  268. + ath11k_warn(ab, "Num 6 GHz reg rules for AP mode(%d) exceeds max limit (num_6ghz_reg_rules_ap: %d, max_rules: %d)\n",
  269. + i, num_6ghz_reg_rules_ap[i], MAX_6GHZ_REG_RULES);
  270. + kfree(tb);
  271. + return -EINVAL;
  272. + }
  273. +
  274. + total_reg_rules += num_6ghz_reg_rules_ap[i];
  275. + }
  276. +
  277. + for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
  278. + num_6ghz_client[WMI_REG_INDOOR_AP][i] =
  279. + reg_info->num_6ghz_rules_client[WMI_REG_INDOOR_AP][i];
  280. + total_reg_rules += num_6ghz_client[WMI_REG_INDOOR_AP][i];
  281. +
  282. + num_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
  283. + reg_info->num_6ghz_rules_client[WMI_REG_STANDARD_POWER_AP][i];
  284. + total_reg_rules += num_6ghz_client[WMI_REG_STANDARD_POWER_AP][i];
  285. +
  286. + num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
  287. + reg_info->num_6ghz_rules_client[WMI_REG_VERY_LOW_POWER_AP][i];
  288. + total_reg_rules += num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i];
  289. +
  290. + if ((num_6ghz_client[WMI_REG_INDOOR_AP][i] > MAX_6GHZ_REG_RULES) ||
  291. + (num_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] >
  292. + MAX_6GHZ_REG_RULES) ||
  293. + (num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] >
  294. + MAX_6GHZ_REG_RULES)) {
  295. + ath11k_warn(ab,
  296. + "Num 6 GHz client reg rules exceeds max limit, for client(type: %d)\n",
  297. + i);
  298. + kfree(tb);
  299. + return -EINVAL;
  300. + }
  301. + }
  302. +
  303. + if (!total_reg_rules) {
  304. + ath11k_warn(ab, "No reg rules available\n");
  305. + kfree(tb);
  306. + return -EINVAL;
  307. + }
  308. +
  309. + memcpy(reg_info->alpha2, &ext_chan_list_event_hdr->alpha2,
  310. + REG_ALPHA2_LEN);
  311. +
  312. + reg_info->dfs_region = ext_chan_list_event_hdr->dfs_region;
  313. + reg_info->phybitmap = ext_chan_list_event_hdr->phybitmap;
  314. + reg_info->num_phy = ext_chan_list_event_hdr->num_phy;
  315. + reg_info->phy_id = ext_chan_list_event_hdr->phy_id;
  316. + reg_info->ctry_code = ext_chan_list_event_hdr->country_id;
  317. + reg_info->reg_dmn_pair = ext_chan_list_event_hdr->domain_code;
  318. +
  319. + reg_info->status_code =
  320. + ath11k_wmi_cc_setting_code_to_reg(ext_chan_list_event_hdr->status_code);
  321. +
  322. + reg_info->is_ext_reg_event = true;
  323. +
  324. + reg_info->min_bw_2ghz = ext_chan_list_event_hdr->min_bw_2ghz;
  325. + reg_info->max_bw_2ghz = ext_chan_list_event_hdr->max_bw_2ghz;
  326. + reg_info->min_bw_5ghz = ext_chan_list_event_hdr->min_bw_5ghz;
  327. + reg_info->max_bw_5ghz = ext_chan_list_event_hdr->max_bw_5ghz;
  328. +
  329. + reg_info->min_bw_6ghz_ap[WMI_REG_INDOOR_AP] =
  330. + ext_chan_list_event_hdr->min_bw_6ghz_ap_lpi;
  331. + reg_info->max_bw_6ghz_ap[WMI_REG_INDOOR_AP] =
  332. + ext_chan_list_event_hdr->max_bw_6ghz_ap_lpi;
  333. + reg_info->min_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
  334. + ext_chan_list_event_hdr->min_bw_6ghz_ap_sp;
  335. + reg_info->max_bw_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
  336. + ext_chan_list_event_hdr->max_bw_6ghz_ap_sp;
  337. + reg_info->min_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
  338. + ext_chan_list_event_hdr->min_bw_6ghz_ap_vlp;
  339. + reg_info->max_bw_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
  340. + ext_chan_list_event_hdr->max_bw_6ghz_ap_vlp;
  341. +
  342. + for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
  343. + reg_info->min_bw_6ghz_client[WMI_REG_INDOOR_AP][i] =
  344. + ext_chan_list_event_hdr->min_bw_6ghz_client_lpi[i];
  345. + reg_info->max_bw_6ghz_client[WMI_REG_INDOOR_AP][i] =
  346. + ext_chan_list_event_hdr->max_bw_6ghz_client_lpi[i];
  347. + reg_info->min_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
  348. + ext_chan_list_event_hdr->min_bw_6ghz_client_sp[i];
  349. + reg_info->max_bw_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
  350. + ext_chan_list_event_hdr->max_bw_6ghz_client_sp[i];
  351. + reg_info->min_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
  352. + ext_chan_list_event_hdr->min_bw_6ghz_client_vlp[i];
  353. + reg_info->max_bw_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
  354. + ext_chan_list_event_hdr->max_bw_6ghz_client_vlp[i];
  355. + }
  356. +
  357. + ath11k_dbg(ab, ATH11K_DBG_WMI,
  358. + "%s:cc_ext %s dsf %d BW: min_2ghz %d max_2ghz %d min_5ghz %d max_5ghz %d",
  359. + __func__, reg_info->alpha2, reg_info->dfs_region,
  360. + reg_info->min_bw_2ghz, reg_info->max_bw_2ghz,
  361. + reg_info->min_bw_5ghz, reg_info->max_bw_5ghz);
  362. +
  363. + ath11k_dbg(ab, ATH11K_DBG_WMI,
  364. + "num_2ghz_reg_rules %d num_5ghz_reg_rules %d",
  365. + num_2ghz_reg_rules, num_5ghz_reg_rules);
  366. +
  367. + ath11k_dbg(ab, ATH11K_DBG_WMI,
  368. + "num_6ghz_reg_rules_ap_lpi: %d num_6ghz_reg_rules_ap_sp: %d num_6ghz_reg_rules_ap_vlp: %d",
  369. + num_6ghz_reg_rules_ap[WMI_REG_INDOOR_AP],
  370. + num_6ghz_reg_rules_ap[WMI_REG_STANDARD_POWER_AP],
  371. + num_6ghz_reg_rules_ap[WMI_REG_VERY_LOW_POWER_AP]);
  372. +
  373. + j = WMI_REG_DEFAULT_CLIENT;
  374. + ath11k_dbg(ab, ATH11K_DBG_WMI,
  375. + "6 GHz Regular client: num_6ghz_reg_rules_lpi: %d num_6ghz_reg_rules_sp: %d num_6ghz_reg_rules_vlp: %d",
  376. + num_6ghz_client[WMI_REG_INDOOR_AP][j],
  377. + num_6ghz_client[WMI_REG_STANDARD_POWER_AP][j],
  378. + num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][j]);
  379. +
  380. + j = WMI_REG_SUBORDINATE_CLIENT;
  381. + ath11k_dbg(ab, ATH11K_DBG_WMI,
  382. + "6 GHz Subordinate client: num_6ghz_reg_rules_lpi: %d num_6ghz_reg_rules_sp: %d num_6ghz_reg_rules_vlp: %d",
  383. + num_6ghz_client[WMI_REG_INDOOR_AP][j],
  384. + num_6ghz_client[WMI_REG_STANDARD_POWER_AP][j],
  385. + num_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][j]);
  386. +
  387. + ext_wmi_reg_rule =
  388. + (struct wmi_regulatory_ext_rule *)((u8 *)ext_chan_list_event_hdr
  389. + + sizeof(*ext_chan_list_event_hdr)
  390. + + sizeof(struct wmi_tlv));
  391. + if (num_2ghz_reg_rules) {
  392. + reg_info->reg_rules_2ghz_ptr =
  393. + create_ext_reg_rules_from_wmi(num_2ghz_reg_rules,
  394. + ext_wmi_reg_rule);
  395. +
  396. + if (!reg_info->reg_rules_2ghz_ptr) {
  397. + kfree(tb);
  398. + ath11k_warn(ab, "Unable to Allocate memory for 2 GHz rules\n");
  399. + return -ENOMEM;
  400. + }
  401. + }
  402. +
  403. + ext_wmi_reg_rule += num_2ghz_reg_rules;
  404. +
  405. + /* Firmware might include 6 GHz reg rule in 5 GHz rule list
  406. + * for few countries along with separate 6 GHz rule.
  407. + * Having same 6 GHz reg rule in 5 GHz and 6 GHz rules list
  408. + * causes intersect check to be true, and same rules will be
  409. + * shown multiple times in iw cmd.
  410. + * Hence, avoid parsing 6 GHz rule from 5 GHz reg rule list
  411. + */
  412. + num_invalid_5ghz_ext_rules =
  413. + ath11k_invalid_5ghz_reg_ext_rules_from_wmi(num_5ghz_reg_rules,
  414. + ext_wmi_reg_rule);
  415. +
  416. + if (num_invalid_5ghz_ext_rules) {
  417. + ath11k_dbg(ab, ATH11K_DBG_WMI,
  418. + "CC: %s 5 GHz reg rules number %d from fw, %d number of invalid 5 GHz rules",
  419. + reg_info->alpha2, reg_info->num_5ghz_reg_rules,
  420. + num_invalid_5ghz_ext_rules);
  421. +
  422. + num_5ghz_reg_rules = num_5ghz_reg_rules - num_invalid_5ghz_ext_rules;
  423. + reg_info->num_5ghz_reg_rules = num_5ghz_reg_rules;
  424. + }
  425. +
  426. + if (num_5ghz_reg_rules) {
  427. + reg_info->reg_rules_5ghz_ptr =
  428. + create_ext_reg_rules_from_wmi(num_5ghz_reg_rules,
  429. + ext_wmi_reg_rule);
  430. +
  431. + if (!reg_info->reg_rules_5ghz_ptr) {
  432. + kfree(tb);
  433. + ath11k_warn(ab, "Unable to Allocate memory for 5 GHz rules\n");
  434. + return -ENOMEM;
  435. + }
  436. + }
  437. +
  438. + /* We have adjusted the number of 5 GHz reg rules above. But still those
  439. + * many rules needs to be adjusted in ext_wmi_reg_rule.
  440. + *
  441. + * NOTE: num_invalid_5ghz_ext_rules will be 0 for rest other cases.
  442. + */
  443. + ext_wmi_reg_rule += (num_5ghz_reg_rules + num_invalid_5ghz_ext_rules);
  444. +
  445. + for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) {
  446. + reg_info->reg_rules_6ghz_ap_ptr[i] =
  447. + create_ext_reg_rules_from_wmi(num_6ghz_reg_rules_ap[i],
  448. + ext_wmi_reg_rule);
  449. +
  450. + if (!reg_info->reg_rules_6ghz_ap_ptr[i]) {
  451. + kfree(tb);
  452. + ath11k_warn(ab, "Unable to Allocate memory for 6 GHz AP rules\n");
  453. + return -ENOMEM;
  454. + }
  455. +
  456. + ext_wmi_reg_rule += num_6ghz_reg_rules_ap[i];
  457. + }
  458. +
  459. + for (j = 0; j < WMI_REG_CURRENT_MAX_AP_TYPE; j++) {
  460. + for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
  461. + reg_info->reg_rules_6ghz_client_ptr[j][i] =
  462. + create_ext_reg_rules_from_wmi(num_6ghz_client[j][i],
  463. + ext_wmi_reg_rule);
  464. +
  465. + if (!reg_info->reg_rules_6ghz_client_ptr[j][i]) {
  466. + kfree(tb);
  467. + ath11k_warn(ab, "Unable to Allocate memory for 6 GHz client rules\n");
  468. + return -ENOMEM;
  469. + }
  470. +
  471. + ext_wmi_reg_rule += num_6ghz_client[j][i];
  472. + }
  473. + }
  474. +
  475. + reg_info->client_type = ext_chan_list_event_hdr->client_type;
  476. + reg_info->rnr_tpe_usable = ext_chan_list_event_hdr->rnr_tpe_usable;
  477. + reg_info->unspecified_ap_usable =
  478. + ext_chan_list_event_hdr->unspecified_ap_usable;
  479. + reg_info->domain_code_6ghz_ap[WMI_REG_INDOOR_AP] =
  480. + ext_chan_list_event_hdr->domain_code_6ghz_ap_lpi;
  481. + reg_info->domain_code_6ghz_ap[WMI_REG_STANDARD_POWER_AP] =
  482. + ext_chan_list_event_hdr->domain_code_6ghz_ap_sp;
  483. + reg_info->domain_code_6ghz_ap[WMI_REG_VERY_LOW_POWER_AP] =
  484. + ext_chan_list_event_hdr->domain_code_6ghz_ap_vlp;
  485. +
  486. + for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++) {
  487. + reg_info->domain_code_6ghz_client[WMI_REG_INDOOR_AP][i] =
  488. + ext_chan_list_event_hdr->domain_code_6ghz_client_lpi[i];
  489. + reg_info->domain_code_6ghz_client[WMI_REG_STANDARD_POWER_AP][i] =
  490. + ext_chan_list_event_hdr->domain_code_6ghz_client_sp[i];
  491. + reg_info->domain_code_6ghz_client[WMI_REG_VERY_LOW_POWER_AP][i] =
  492. + ext_chan_list_event_hdr->domain_code_6ghz_client_vlp[i];
  493. + }
  494. +
  495. + reg_info->domain_code_6ghz_super_id =
  496. + ext_chan_list_event_hdr->domain_code_6ghz_super_id;
  497. +
  498. + ath11k_dbg(ab, ATH11K_DBG_WMI, "6 GHz client_type: %d domain_code_6ghz_super_id: %d",
  499. + reg_info->client_type, reg_info->domain_code_6ghz_super_id);
  500. +
  501. + ath11k_dbg(ab, ATH11K_DBG_WMI, "processed regulatory ext channel list\n");
  502. +
  503. + kfree(tb);
  504. + return 0;
  505. +}
  506. +
  507. static int ath11k_pull_peer_del_resp_ev(struct ath11k_base *ab, struct sk_buff *skb,
  508. struct wmi_peer_delete_resp_event *peer_del_resp)
  509. {
  510. @@ -6507,12 +6876,14 @@ static bool ath11k_reg_is_world_alpha(ch
  511. return false;
  512. }
  513. -static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *skb)
  514. +static int ath11k_reg_chan_list_event(struct ath11k_base *ab,
  515. + struct sk_buff *skb,
  516. + enum wmi_reg_chan_list_cmd_type id)
  517. {
  518. struct cur_regulatory_info *reg_info = NULL;
  519. struct ieee80211_regdomain *regd = NULL;
  520. bool intersect = false;
  521. - int ret = 0, pdev_idx;
  522. + int ret = 0, pdev_idx, i, j;
  523. struct ath11k *ar;
  524. reg_info = kzalloc(sizeof(*reg_info), GFP_ATOMIC);
  525. @@ -6521,7 +6892,11 @@ static int ath11k_reg_chan_list_event(st
  526. goto fallback;
  527. }
  528. - ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info);
  529. + if (id == WMI_REG_CHAN_LIST_CC_ID)
  530. + ret = ath11k_pull_reg_chan_list_update_ev(ab, skb, reg_info);
  531. + else
  532. + ret = ath11k_pull_reg_chan_list_ext_update_ev(ab, skb, reg_info);
  533. +
  534. if (ret) {
  535. ath11k_warn(ab, "failed to extract regulatory info from received event\n");
  536. goto fallback;
  537. @@ -6623,6 +6998,14 @@ mem_free:
  538. if (reg_info) {
  539. kfree(reg_info->reg_rules_2ghz_ptr);
  540. kfree(reg_info->reg_rules_5ghz_ptr);
  541. + if (reg_info->is_ext_reg_event) {
  542. + for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++)
  543. + kfree(reg_info->reg_rules_6ghz_ap_ptr[i]);
  544. +
  545. + for (j = 0; j < WMI_REG_CURRENT_MAX_AP_TYPE; j++)
  546. + for (i = 0; i < WMI_REG_MAX_CLIENT_TYPE; i++)
  547. + kfree(reg_info->reg_rules_6ghz_client_ptr[j][i]);
  548. + }
  549. kfree(reg_info);
  550. }
  551. return ret;
  552. @@ -8054,7 +8437,10 @@ static void ath11k_wmi_tlv_op_rx(struct
  553. ath11k_service_ready_ext2_event(ab, skb);
  554. break;
  555. case WMI_REG_CHAN_LIST_CC_EVENTID:
  556. - ath11k_reg_chan_list_event(ab, skb);
  557. + ath11k_reg_chan_list_event(ab, skb, WMI_REG_CHAN_LIST_CC_ID);
  558. + break;
  559. + case WMI_REG_CHAN_LIST_CC_EXT_EVENTID:
  560. + ath11k_reg_chan_list_event(ab, skb, WMI_REG_CHAN_LIST_CC_EXT_ID);
  561. break;
  562. case WMI_READY_EVENTID:
  563. ath11k_ready_event(ab, skb);
  564. --- a/drivers/net/wireless/ath/ath11k/wmi.h
  565. +++ b/drivers/net/wireless/ath/ath11k/wmi.h
  566. @@ -797,6 +797,7 @@ enum wmi_tlv_event_id {
  567. WMI_RMC_NEW_LEADER_EVENTID = WMI_TLV_CMD(WMI_GRP_RMC),
  568. WMI_REG_CHAN_LIST_CC_EVENTID = WMI_TLV_CMD(WMI_GRP_REGULATORY),
  569. WMI_11D_NEW_COUNTRY_EVENTID,
  570. + WMI_REG_CHAN_LIST_CC_EXT_EVENTID,
  571. WMI_NDI_CAP_RSP_EVENTID = WMI_TLV_CMD(WMI_GRP_PROTOTYPE),
  572. WMI_NDP_INITIATOR_RSP_EVENTID,
  573. WMI_NDP_RESPONDER_RSP_EVENTID,
  574. @@ -1865,6 +1866,8 @@ enum wmi_tlv_tag {
  575. WMI_TAG_PDEV_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD,
  576. WMI_TAG_PDEV_NON_SRG_OBSS_COLOR_ENABLE_BITMAP_CMD,
  577. WMI_TAG_PDEV_NON_SRG_OBSS_BSSID_ENABLE_BITMAP_CMD,
  578. + WMI_TAG_REGULATORY_RULE_EXT_STRUCT = 0x3A9,
  579. + WMI_TAG_REG_CHAN_LIST_CC_EXT_EVENT,
  580. WMI_TAG_PDEV_SET_BIOS_SAR_TABLE_CMD = 0x3D8,
  581. WMI_TAG_PDEV_SET_BIOS_GEO_TABLE_CMD,
  582. WMI_TAG_MAX
  583. @@ -2097,6 +2100,7 @@ enum wmi_tlv_service {
  584. /* The second 128 bits */
  585. WMI_MAX_EXT_SERVICE = 256,
  586. + WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT = 281,
  587. WMI_TLV_SERVICE_BIOS_SAR_SUPPORT = 326,
  588. /* The third 128 bits */
  589. @@ -2313,6 +2317,8 @@ struct wmi_init_cmd {
  590. #define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5)
  591. #define WMI_RSRC_CFG_FLAG1_ACK_RSSI BIT(18)
  592. +#define WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT 4
  593. +
  594. struct wmi_resource_config {
  595. u32 tlv_header;
  596. u32 num_vdevs;
  597. @@ -2372,6 +2378,15 @@ struct wmi_resource_config {
  598. u32 sched_params;
  599. u32 twt_ap_pdev_count;
  600. u32 twt_ap_sta_count;
  601. + u32 max_nlo_ssids;
  602. + u32 num_pkt_filters;
  603. + u32 num_max_sta_vdevs;
  604. + u32 max_bssid_indicator;
  605. + u32 ul_resp_config;
  606. + u32 msdu_flow_override_config0;
  607. + u32 msdu_flow_override_config1;
  608. + u32 flags2;
  609. + u32 host_service_flags;
  610. } __packed;
  611. struct wmi_service_ready_event {
  612. @@ -2854,6 +2869,8 @@ struct rx_reorder_queue_remove_params {
  613. #define REG_RULE_MAX_BW 0x0000ffff
  614. #define REG_RULE_REG_PWR 0x00ff0000
  615. #define REG_RULE_ANT_GAIN 0xff000000
  616. +#define REG_RULE_PSD_INFO BIT(0)
  617. +#define REG_RULE_PSD_EIRP 0xff0000
  618. #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
  619. #define WMI_VDEV_PARAM_TXBF_MU_TX_BFEE BIT(1)
  620. @@ -4049,6 +4066,7 @@ struct wmi_he_rate_set {
  621. #define MAX_REG_RULES 10
  622. #define REG_ALPHA2_LEN 2
  623. +#define MAX_6GHZ_REG_RULES 5
  624. enum wmi_start_event_param {
  625. WMI_VDEV_START_RESP_EVENT = 0,
  626. @@ -4079,16 +4097,6 @@ enum wmi_vdev_start_resp_status_code {
  627. WMI_VDEV_START_RESPONSE_INVALID_REGDOMAIN = 4,
  628. };
  629. -;
  630. -enum cc_setting_code {
  631. - REG_SET_CC_STATUS_PASS = 0,
  632. - REG_CURRENT_ALPHA2_NOT_FOUND = 1,
  633. - REG_INIT_ALPHA2_NOT_FOUND = 2,
  634. - REG_SET_CC_CHANGE_NOT_ALLOWED = 3,
  635. - REG_SET_CC_STATUS_NO_MEMORY = 4,
  636. - REG_SET_CC_STATUS_FAIL = 5,
  637. -};
  638. -
  639. /* Regaulatory Rule Flags Passed by FW */
  640. #define REGULATORY_CHAN_DISABLED BIT(0)
  641. #define REGULATORY_CHAN_NO_IR BIT(1)
  642. @@ -4102,13 +4110,72 @@ enum cc_setting_code {
  643. #define REGULATORY_CHAN_NO_20MHZ BIT(11)
  644. #define REGULATORY_CHAN_NO_10MHZ BIT(12)
  645. -enum {
  646. +enum wmi_reg_chan_list_cmd_type {
  647. + WMI_REG_CHAN_LIST_CC_ID = 0,
  648. + WMI_REG_CHAN_LIST_CC_EXT_ID = 1,
  649. +};
  650. +
  651. +enum wmi_reg_cc_setting_code {
  652. WMI_REG_SET_CC_STATUS_PASS = 0,
  653. WMI_REG_CURRENT_ALPHA2_NOT_FOUND = 1,
  654. WMI_REG_INIT_ALPHA2_NOT_FOUND = 2,
  655. WMI_REG_SET_CC_CHANGE_NOT_ALLOWED = 3,
  656. WMI_REG_SET_CC_STATUS_NO_MEMORY = 4,
  657. WMI_REG_SET_CC_STATUS_FAIL = 5,
  658. +
  659. + /* add new setting code above, update in
  660. + * @enum cc_setting_code as well.
  661. + * Also handle it in ath11k_wmi_cc_setting_code_to_reg()
  662. + */
  663. +};
  664. +
  665. +enum cc_setting_code {
  666. + REG_SET_CC_STATUS_PASS = 0,
  667. + REG_CURRENT_ALPHA2_NOT_FOUND = 1,
  668. + REG_INIT_ALPHA2_NOT_FOUND = 2,
  669. + REG_SET_CC_CHANGE_NOT_ALLOWED = 3,
  670. + REG_SET_CC_STATUS_NO_MEMORY = 4,
  671. + REG_SET_CC_STATUS_FAIL = 5,
  672. +
  673. + /* add new setting code above, update in
  674. + * @enum wmi_reg_cc_setting_code as well.
  675. + */
  676. +};
  677. +
  678. +static inline enum cc_setting_code
  679. +ath11k_wmi_cc_setting_code_to_reg(enum wmi_reg_cc_setting_code status_code)
  680. +{
  681. + switch (status_code) {
  682. + case WMI_REG_SET_CC_STATUS_PASS:
  683. + return REG_SET_CC_STATUS_PASS;
  684. + case WMI_REG_CURRENT_ALPHA2_NOT_FOUND:
  685. + return REG_CURRENT_ALPHA2_NOT_FOUND;
  686. + case WMI_REG_INIT_ALPHA2_NOT_FOUND:
  687. + return REG_INIT_ALPHA2_NOT_FOUND;
  688. + case WMI_REG_SET_CC_CHANGE_NOT_ALLOWED:
  689. + return REG_SET_CC_CHANGE_NOT_ALLOWED;
  690. + case WMI_REG_SET_CC_STATUS_NO_MEMORY:
  691. + return REG_SET_CC_STATUS_NO_MEMORY;
  692. + case WMI_REG_SET_CC_STATUS_FAIL:
  693. + return REG_SET_CC_STATUS_FAIL;
  694. + }
  695. +
  696. + return REG_SET_CC_STATUS_FAIL;
  697. +}
  698. +
  699. +enum wmi_reg_6ghz_ap_type {
  700. + WMI_REG_INDOOR_AP = 0,
  701. + WMI_REG_STANDARD_POWER_AP = 1,
  702. + WMI_REG_VERY_LOW_POWER_AP = 2,
  703. +
  704. + WMI_REG_CURRENT_MAX_AP_TYPE,
  705. + WMI_REG_MAX_AP_TYPE = 7,
  706. +};
  707. +
  708. +enum wmi_reg_6ghz_client_type {
  709. + WMI_REG_DEFAULT_CLIENT = 0,
  710. + WMI_REG_SUBORDINATE_CLIENT = 1,
  711. + WMI_REG_MAX_CLIENT_TYPE = 2,
  712. };
  713. struct cur_reg_rule {
  714. @@ -4118,6 +4185,8 @@ struct cur_reg_rule {
  715. u8 reg_power;
  716. u8 ant_gain;
  717. u16 flags;
  718. + bool psd_flag;
  719. + s8 psd_eirp;
  720. };
  721. struct cur_regulatory_info {
  722. @@ -4137,6 +4206,22 @@ struct cur_regulatory_info {
  723. u32 num_5ghz_reg_rules;
  724. struct cur_reg_rule *reg_rules_2ghz_ptr;
  725. struct cur_reg_rule *reg_rules_5ghz_ptr;
  726. + bool is_ext_reg_event;
  727. + enum wmi_reg_6ghz_client_type client_type;
  728. + bool rnr_tpe_usable;
  729. + bool unspecified_ap_usable;
  730. + u8 domain_code_6ghz_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
  731. + u8 domain_code_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
  732. + u32 domain_code_6ghz_super_id;
  733. + u32 min_bw_6ghz_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
  734. + u32 max_bw_6ghz_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
  735. + u32 min_bw_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
  736. + u32 max_bw_6ghz_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
  737. + u32 num_6ghz_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE];
  738. + u32 num_6ghz_rules_client[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
  739. + struct cur_reg_rule *reg_rules_6ghz_ap_ptr[WMI_REG_CURRENT_MAX_AP_TYPE];
  740. + struct cur_reg_rule *reg_rules_6ghz_client_ptr
  741. + [WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE];
  742. };
  743. struct wmi_reg_chan_list_cc_event {
  744. @@ -4163,6 +4248,61 @@ struct wmi_regulatory_rule_struct {
  745. u32 flag_info;
  746. };
  747. +#define WMI_REG_CLIENT_MAX 4
  748. +
  749. +struct wmi_reg_chan_list_cc_ext_event {
  750. + u32 status_code;
  751. + u32 phy_id;
  752. + u32 alpha2;
  753. + u32 num_phy;
  754. + u32 country_id;
  755. + u32 domain_code;
  756. + u32 dfs_region;
  757. + u32 phybitmap;
  758. + u32 min_bw_2ghz;
  759. + u32 max_bw_2ghz;
  760. + u32 min_bw_5ghz;
  761. + u32 max_bw_5ghz;
  762. + u32 num_2ghz_reg_rules;
  763. + u32 num_5ghz_reg_rules;
  764. + u32 client_type;
  765. + u32 rnr_tpe_usable;
  766. + u32 unspecified_ap_usable;
  767. + u32 domain_code_6ghz_ap_lpi;
  768. + u32 domain_code_6ghz_ap_sp;
  769. + u32 domain_code_6ghz_ap_vlp;
  770. + u32 domain_code_6ghz_client_lpi[WMI_REG_CLIENT_MAX];
  771. + u32 domain_code_6ghz_client_sp[WMI_REG_CLIENT_MAX];
  772. + u32 domain_code_6ghz_client_vlp[WMI_REG_CLIENT_MAX];
  773. + u32 domain_code_6ghz_super_id;
  774. + u32 min_bw_6ghz_ap_sp;
  775. + u32 max_bw_6ghz_ap_sp;
  776. + u32 min_bw_6ghz_ap_lpi;
  777. + u32 max_bw_6ghz_ap_lpi;
  778. + u32 min_bw_6ghz_ap_vlp;
  779. + u32 max_bw_6ghz_ap_vlp;
  780. + u32 min_bw_6ghz_client_sp[WMI_REG_CLIENT_MAX];
  781. + u32 max_bw_6ghz_client_sp[WMI_REG_CLIENT_MAX];
  782. + u32 min_bw_6ghz_client_lpi[WMI_REG_CLIENT_MAX];
  783. + u32 max_bw_6ghz_client_lpi[WMI_REG_CLIENT_MAX];
  784. + u32 min_bw_6ghz_client_vlp[WMI_REG_CLIENT_MAX];
  785. + u32 max_bw_6ghz_client_vlp[WMI_REG_CLIENT_MAX];
  786. + u32 num_6ghz_reg_rules_ap_sp;
  787. + u32 num_6ghz_reg_rules_ap_lpi;
  788. + u32 num_6ghz_reg_rules_ap_vlp;
  789. + u32 num_6ghz_reg_rules_client_sp[WMI_REG_CLIENT_MAX];
  790. + u32 num_6ghz_reg_rules_client_lpi[WMI_REG_CLIENT_MAX];
  791. + u32 num_6ghz_reg_rules_client_vlp[WMI_REG_CLIENT_MAX];
  792. +} __packed;
  793. +
  794. +struct wmi_regulatory_ext_rule {
  795. + u32 tlv_header;
  796. + u32 freq_info;
  797. + u32 bw_pwr_info;
  798. + u32 flag_info;
  799. + u32 psd_power_info;
  800. +} __packed;
  801. +
  802. struct wmi_vdev_delete_resp_event {
  803. u32 vdev_id;
  804. } __packed;
  805. @@ -5358,6 +5498,7 @@ struct target_resource_config {
  806. u32 sched_params;
  807. u32 twt_ap_pdev_count;
  808. u32 twt_ap_sta_count;
  809. + u8 is_reg_cc_ext_event_supported;
  810. };
  811. enum wmi_debug_log_param {