diff options
| author | Masti, Narayanraddi <nmasti@codeaurora.org> | 2016-08-04 11:59:11 +0530 |
|---|---|---|
| committer | Vishwajith Upendra <vishwaji@codeaurora.org> | 2016-08-17 11:21:47 -0700 |
| commit | ab712a7a638ee107ed6fcf07db6bb0f25f2bee07 (patch) | |
| tree | 675851ebabe4212d6d415f523ddf4169c2df780c | |
| parent | 142a2c8fd8e7b8907a222554ee22873d7acef868 (diff) | |
qcacld-3.0: Fix to encrypt broadcast frames
qcacld-2.0 to qcacld-3.0 propagation
Currently, In SAP mode due to incorrect wep key
index broadcast frames are not encrypted.
Fix is to make sure to update default index for
BSS(group) key.
Change-Id: I328855decbad20dbd88b48022e466e4f78f5d722
CRs-Fixed: 932749
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 5 | ||||
| -rw-r--r-- | core/mac/src/include/sir_params.h | 1 | ||||
| -rw-r--r-- | core/sme/inc/csr_api.h | 13 | ||||
| -rw-r--r-- | core/sme/inc/sme_api.h | 2 | ||||
| -rw-r--r-- | core/sme/src/common/sme_api.c | 44 | ||||
| -rw-r--r-- | core/wma/inc/wma.h | 2 | ||||
| -rw-r--r-- | core/wma/inc/wma_types.h | 1 | ||||
| -rw-r--r-- | core/wma/src/wma_main.c | 24 | ||||
| -rw-r--r-- | core/wma/src/wma_mgmt.c | 5 |
9 files changed, 97 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c9a8879d760b..5274ff9cdf1f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9242,6 +9242,11 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy, WLAN_HDD_GET_AP_CTX_PTR(pAdapter); pAPCtx->wepKey[key_index].keyDirection = eSIR_TX_DEFAULT; + hdd_info("key index passed for sme_roam_set_default_key_index %d", + key_index); + sme_roam_set_default_key_index( + WLAN_HDD_GET_HAL_CTX(pAdapter), + pAdapter->sessionId, key_index); } } diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index cde2bd73a830..650c2aab942e 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -628,6 +628,7 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_NDP_INDICATION (SIR_HAL_ITC_MSG_TYPES_BEGIN + 355) #define SIR_HAL_NDP_CONFIRM (SIR_HAL_ITC_MSG_TYPES_BEGIN + 356) #define SIR_HAL_NDP_END_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 357) +#define SIR_HAL_UPDATE_WEP_DEFAULT_KEY (SIR_HAL_ITC_MSG_TYPES_BEGIN + 358) #define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 347) diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 8cfbff20ba66..bbef6cad952f 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1599,6 +1599,19 @@ struct tagCsrDelStaParams { uint8_t subtype; }; +/** + * struct wep_update_default_key_idx: wep default key index structure + * @session_id: session ID for the connection session + * @default_idx: default key index for wep + * + * structure includes sesssion id for connection and default key + * index used for wep + */ +struct wep_update_default_key_idx { + uint8_t session_id; + uint8_t default_idx; +}; + /* * NOTE: p2 is the second context pass in for the caller * NOTE: what if callback is called before requester gets the scanId?? diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 366f52a1e754..d906cdeba772 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1154,4 +1154,6 @@ QDF_STATUS sme_process_mac_pwr_dbg_cmd(tHalHandle hal, uint32_t session_id, void sme_get_vdev_type_nss(tHalHandle hal, enum tQDF_ADAPTER_MODE dev_mode, uint8_t *nss_2g, uint8_t *nss_5g); +QDF_STATUS sme_roam_set_default_key_index(tHalHandle hal, uint8_t session_id, + uint8_t default_idx); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 47c3a85c4104..a9e35d20e8c1 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -5096,6 +5096,50 @@ QDF_STATUS sme_roam_set_key(tHalHandle hal, uint8_t session_id, return status; } +/** + * sme_roam_set_default_key_index - To set default wep key idx + * @hal: pointer to hal handler + * @session_id: session id + * @default_idx: default wep key index + * + * This function prepares a message and post to WMA to set wep default + * key index + * + * Return: Success:QDF_STATUS_SUCCESS Failure: Error value + */ +QDF_STATUS sme_roam_set_default_key_index(tHalHandle hal, uint8_t session_id, + uint8_t default_idx) +{ + cds_msg_t msg; + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + struct wep_update_default_key_idx *update_key; + + update_key = qdf_mem_malloc(sizeof(*update_key)); + if (!update_key) { + sms_log(mac_ctx, LOGE, + FL("Failed to allocate memory for update key")); + return QDF_STATUS_E_NOMEM; + } + + update_key->session_id = session_id; + update_key->default_idx = default_idx; + + msg.type = WMA_UPDATE_WEP_DEFAULT_KEY; + msg.reserved = 0; + msg.bodyptr = (void *)update_key; + + if (QDF_STATUS_SUCCESS != + cds_mq_post_message(QDF_MODULE_ID_WMA, &msg)) { + sms_log(mac_ctx, LOGE, + FL("Failed to post WMA_UPDATE_WEP_DEFAULT_KEY to WMA")); + qdf_mem_free(update_key); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + + /* --------------------------------------------------------------------------- \fn sme_get_rssi \brief a wrapper function that client calls to register a callback to get diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 3895465b921f..3e1d6115d7ed 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -864,6 +864,7 @@ typedef struct { * @rx_streams: number of rx streams can be used by the vdev * @chain_mask: chain mask can be used by the vdev * @mac_id: the mac on which vdev is on + * @wep_default_key_idx: wep default index for group key * * It stores parameters per vdev in wma. */ @@ -940,6 +941,7 @@ struct wma_txrx_node { uint8_t nss_2g; uint8_t nss_5g; bool p2p_lo_in_progress; + uint8_t wep_default_key_idx; }; #if defined(QCA_WIFI_FTM) diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 7bb5ecaa9a26..a49ad83552f3 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -471,6 +471,7 @@ #define WDA_BPF_SET_INSTRUCTIONS_REQ SIR_HAL_BPF_SET_INSTRUCTIONS_REQ #define WMA_SET_PDEV_IE_REQ SIR_HAL_SET_PDEV_IE_REQ +#define WMA_UPDATE_WEP_DEFAULT_KEY SIR_HAL_UPDATE_WEP_DEFAULT_KEY /* Bit 6 will be used to control BD rate for Management frames */ #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index f61b13b3011d..6e1695f4313f 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -5217,6 +5217,25 @@ void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle) } /** + * wma_update_wep_default_key - To update default key id + * @wma: pointer to wma handler + * @update_def_key: pointer to wep_update_default_key_idx + * + * This function makes a copy of default key index to txrx node + * + * Return: Success + */ +static QDF_STATUS wma_update_wep_default_key(tp_wma_handle wma, + struct wep_update_default_key_idx *update_def_key) +{ + struct wma_txrx_node *iface = + &wma->interfaces[update_def_key->session_id]; + iface->wep_default_key_idx = update_def_key->default_idx; + + return QDF_STATUS_SUCCESS; +} + +/** * wma_mc_process_msg() - process wma messages and call appropriate function. * @cds_context: cds context * @msg: message @@ -6010,6 +6029,11 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) msg->bodyptr); qdf_mem_free(msg->bodyptr); break; + case WMA_UPDATE_WEP_DEFAULT_KEY: + wma_update_wep_default_key(wma_handle, + (struct wep_update_default_key_idx *)msg->bodyptr); + qdf_mem_free(msg->bodyptr); + break; default: WMA_LOGD("unknow msg type %x", msg->type); /* Do Nothing? MSG Body should be freed at here */ diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 13d5ff3bd232..d001d5005720 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -1766,6 +1766,11 @@ static void wma_set_ibsskey_helper(tp_wma_handle wma_handle, key_info->encType == eSIR_ED_WEP104)) { wma_read_cfg_wepkey(wma_handle, key_info->key, &def_key_idx, &key_info->numKeys); + } else if ((key_info->encType == eSIR_ED_WEP40) || + (key_info->encType == eSIR_ED_WEP104)) { + struct wma_txrx_node *intf = + &wma_handle->interfaces[key_info->smesessionId]; + key_params.def_key_idx = intf->wep_default_key_idx; } for (i = 0; i < key_info->numKeys; i++) { |
