From f40ae2631e8df2d4f9a9d114ebb9c5bcc4b33e77 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Fri, 14 Dec 2018 18:55:58 +0530 Subject: [PATCH] qcacmn: Send 11d country to firmware When regulatory offload is enabled, firmware sends 11d new country code event. Now, to get master channel list for this new country send SET_CURRENT_COUNTRY command to firmware. Change-Id: Iac4d38ed488984ad2b3739ec8052813b7cc945c1 CRs-Fixed: 2367335 --- umac/regulatory/core/src/reg_services.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index afc0ad0853ac..a152cab392f9 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -4850,6 +4850,8 @@ QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc, uint8_t *country) { struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; + struct wlan_lmac_if_reg_tx_ops *tx_ops; + struct set_country country_code; uint8_t pdev_id; psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, @@ -4863,6 +4865,19 @@ QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc, pdev_id = psoc_priv_obj->def_pdev_id; psoc_priv_obj->new_11d_ctry_pending[pdev_id] = true; + qdf_mem_copy(country_code.country, country, REG_ALPHA2_LEN + 1); + country_code.pdev_id = pdev_id; + + if (psoc_priv_obj->offload_enabled) { + tx_ops = reg_get_psoc_tx_ops(psoc); + if (tx_ops->set_country_code) { + tx_ops->set_country_code(psoc, &country_code); + } else { + reg_err("country set handler is not present"); + psoc_priv_obj->new_11d_ctry_pending[pdev_id] = false; + return QDF_STATUS_E_FAULT; + } + } return QDF_STATUS_SUCCESS; }