From f0a94adf46c531dbd3dee799c1822dd1412a569b Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Mon, 27 Nov 2017 15:20:00 -0800 Subject: [PATCH] qcacld-3.0: print the source of country code Country code can be set by multiple sources. Print the source of country code for debug purposes. Change-Id: I54f8237de540d7a0d01671148109130a28516670 CRs-Fixed: 2149684 --- core/sme/src/common/sme_api.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 94087e37c303..18a7b6c45857 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -5818,11 +5818,34 @@ QDF_STATUS sme_get_cfg_valid_channels(uint8_t *aValidChannels, return status; } +static uint8_t *sme_reg_hint_to_str(const enum country_src src) +{ + switch (src) { + case SOURCE_CORE: + return "WORLD MODE"; + + case SOURCE_DRIVER: + return "BDF file"; + + case SOURCE_USERSPACE: + return "user-space"; + + case SOURCE_11D: + return "802.11D IEs in beacons"; + + default: + return "unknown"; + } +} + void sme_set_cc_src(tHalHandle hHal, enum country_src cc_src) { tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal); mac_ctx->reg_hint_src = cc_src; + + sme_debug("Country source is %s", + sme_reg_hint_to_str(cc_src)); } /* * sme_handle_change_country_code() -