diff options
| author | Bala Shanmugam <bkamatch@qti.qualcomm.com> | 2013-10-10 15:02:43 +0530 |
|---|---|---|
| committer | Madan Mohan Koyyalamudi <mkoyyala@qca.qualcomm.com> | 2013-10-23 20:06:14 -0700 |
| commit | 49d26104cb6ce572920fe20b702d042c32e23f6c (patch) | |
| tree | 8c3c29ca4bc670a82f09612f5a5fbcc405f0a99e | |
| parent | 17a3b66d9279e2f7214e2215f62351e160166476 (diff) | |
cld: wma: Update country code information
Change in country code is not updated to SME which
results in new channel list not being updated to firmware.
Update new country code to SME when there is change
in country code through regulatory notification.
CRs-Fixed: 551603
Change-Id: Iaf06861f3f2450934c949dd2dcfb9e972c1ff302
| -rw-r--r-- | CORE/SERVICES/COMMON/wma_api.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 19 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 1 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma_stub.h | 4 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_nvitem.c | 24 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 6 |
6 files changed, 39 insertions, 17 deletions
diff --git a/CORE/SERVICES/COMMON/wma_api.h b/CORE/SERVICES/COMMON/wma_api.h index edfcfdb37df1..a88533e3f01a 100644 --- a/CORE/SERVICES/COMMON/wma_api.h +++ b/CORE/SERVICES/COMMON/wma_api.h @@ -109,6 +109,8 @@ VOS_STATUS wma_wait_for_ready_event(WMA_HANDLE handle); int wma_cli_get_command(void *wmapvosContext, int vdev_id, int param_id, int vpdev); eHalStatus wma_set_htconfig(tANI_U8 vdev_id, tANI_U16 ht_capab, int value); +eHalStatus WMA_SetCountryCode(v_VOID_t *client_ctx, tANI_U8 *countrycode); +eHalStatus WMA_SetRegDomain(void * clientCtxt, v_REGDOMAIN_t regId); #ifndef QCA_WIFI_ISOC int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr); diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index ca9e079fc5e5..ed008ba79c13 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -9179,6 +9179,25 @@ eHalStatus wma_set_htconfig(tANI_U8 vdev_id, tANI_U16 ht_capab, int value) return (ret)? eHAL_STATUS_FAILURE : eHAL_STATUS_SUCCESS; } +eHalStatus WMA_SetRegDomain(void * clientCtxt, v_REGDOMAIN_t regId) +{ + if(VOS_STATUS_SUCCESS != vos_nv_setRegDomain(clientCtxt, regId)) + return eHAL_STATUS_INVALID_PARAMETER; + + return eHAL_STATUS_SUCCESS; +} + +eHalStatus WMA_SetCountryCode(v_VOID_t *client_ctx, tANI_U8 *countrycode) +{ + int32_t regdmn; + regdmn = regdmn_get_regdmn_for_country(countrycode); + if (regdmn < 0) + return eHAL_STATUS_FAILURE; + + wma_set_regdomain(regdmn); + return eHAL_STATUS_SUCCESS; +} + tANI_U8 wma_getFwWlanFeatCaps(tANI_U8 featEnumValue) { return gFwWlanFeatCaps & featEnumValue; diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 42b48f1eaf11..1e9713376971 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -903,6 +903,7 @@ VOS_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, u_int8_t vdev_id, int regdmn_get_country_alpha2(u_int16_t rd, u_int8_t *alpha2); void regdmn_get_ctl_info(u_int32_t reg_dmn, u_int32_t modesAvail, u_int32_t modeSelect); +int32_t regdmn_get_regdmn_for_country(u_int8_t *alpha2); #endif #define WMA_FW_PHY_STATS 0x1 diff --git a/CORE/SERVICES/WMA/wma_stub.h b/CORE/SERVICES/WMA/wma_stub.h index 2c2589ceb50f..d92d674a0500 100644 --- a/CORE/SERVICES/WMA/wma_stub.h +++ b/CORE/SERVICES/WMA/wma_stub.h @@ -88,10 +88,6 @@ static inline void WMA_UpdateRssiBmps(v_PVOID_t pvosGCtx, v_U8_t staId, v_S7_t rssi) { } -static inline eHalStatus WMA_SetRegDomain(v_VOID_t *client_ctx, v_REGDOMAIN_t regId) -{ - return eHAL_STATUS_SUCCESS; -} #endif diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c index c9685501a73f..2b80ab3022b7 100644 --- a/CORE/VOSS/src/vos_nvitem.c +++ b/CORE/VOSS/src/vos_nvitem.c @@ -1930,7 +1930,7 @@ static int create_crda_regulatory_entry(struct wiphy *wiphy, if (wiphy->bands[i] == NULL) { pr_info("error: wiphy->bands[i] is NULL, i = %d\n", i); - return -1; + continue; } // internal channels[] is one continous array for both 2G and 5G bands // m is internal starting channel index for each band @@ -2294,36 +2294,34 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, if (request->initiator == NL80211_REGDOM_SET_BY_USER) { wiphy_dbg(wiphy, "info: set by user\n"); - if (create_crda_regulatory_entry(wiphy, request, pHddCtx->cfg_ini->nBandCapability) != 0) + if (create_crda_regulatory_entry(wiphy, request, pHddCtx->cfg_ini->nBandCapability) != 0) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) return; #else return 0; #endif - // ToDo - /* Don't change default country code to CRDA country code by user req */ + } /* Shouldcall sme_ChangeCountryCode to send a message to trigger read regd for new country settings */ - //sme_ChangeCountryCode(pHddCtx->hHal, NULL, - // &country_code[0], pAdapter, pHddCtx->pvosContext); + sme_ChangeCountryCode(pHddCtx->hHal, NULL, + &request->alpha2[0], NULL, pHddCtx->pvosContext); } else if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { wiphy_dbg(wiphy, "info: set by country IE\n"); - if (create_crda_regulatory_entry(wiphy, request, pHddCtx->cfg_ini->nBandCapability) != 0) + if (create_crda_regulatory_entry(wiphy, request, pHddCtx->cfg_ini->nBandCapability) != 0) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) return; #else return 0; #endif - // ToDo - /* Intersect of 11d and crda settings */ + } - /* Don't change default country code to CRDA country code by 11d req */ - /* for every adapter call sme_ChangeCountryCode to trigger read regd + /* Intersect of 11d and crda settings */ + /* call sme_ChangeCountryCode to trigger read regd for intersected new country settings */ - // sme_ChangeCountryCode(pHddCtx->hHal, NULL, - // &country_code[0], pAdapter, pHddCtx->pvosContext); + sme_ChangeCountryCode(pHddCtx->hHal, NULL, + &request->alpha2[0], NULL, pHddCtx->pvosContext); } else if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER) { diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index acf3aee1cb8e..f383d5fc35e6 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -1252,6 +1252,7 @@ tSirRetStatus wdaPostCtrlMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg); #ifdef QCA_WIFI_2_0 #define WDA_SetRegDomain WMA_SetRegDomain +#define WDA_SetCountryCode WMA_SetCountryCode #define WDA_SetHTConfig wma_set_htconfig #define WDA_UpdateRssiBmps WMA_UpdateRssiBmps @@ -1263,6 +1264,11 @@ static int WDA_SetHTConfig(tANI_U8 sessionId, tANI_U16 htCapab, int value) return 0; } +static inline eHalStatus WDA_SetCountryCode(v_VOID_t *client_ctx, tANI_U8 *countrycode) +{ + return eHAL_STATUS_SUCCESS; +} + /* ----------------------------------------------------------------- WDA data path API's for TL -------------------------------------------------------------------*/ |
