From cd49ec74b53c815ce754168a8ccdddc932996c50 Mon Sep 17 00:00:00 2001 From: jiad Date: Tue, 5 Dec 2017 13:33:11 +0800 Subject: [PATCH] qcacld-3.0: indicate tkip mic error to protocol layer Currently tkip mic countermeasure is not supported for Napier. Fix is to indicate tkip mic error indication to protocol layer so that errors can be propogated to supplicant. Change-Id: I8ee94343e76040e360f0887a826c07f98545f71f CRs-Fixed: 2151984 --- core/cds/src/cds_api.c | 3 ++- core/wma/inc/wma.h | 13 +++++++++++++ core/wma/src/wma_data.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 39561b396cd4..2dacf70f35bb 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -82,7 +82,8 @@ static struct ol_if_ops dp_ol_if_ops = { .peer_rx_reorder_queue_setup = wma_peer_rx_reorder_queue_setup, .peer_rx_reorder_queue_remove = wma_peer_rx_reorder_queue_remove, .is_hw_dbs_2x2_capable = policy_mgr_is_hw_dbs_2x2_capable, - .lro_hash_config = wma_lro_config_cmd + .lro_hash_config = wma_lro_config_cmd, + .rx_mic_error = wma_rx_mic_error_ind /* TODO: Add any other control path calls required to OL_IF/WMA layer */ }; diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 5c3bec6e3f4b..87126c4199b1 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -2220,6 +2220,19 @@ void wma_indicate_err(enum ol_rx_err_type err_type, struct ol_error_info *err_info); +/** + * wma_rx_mic_error_ind() - indicate mic error to the protocol stack + * @scn_handle: pdev handle from osif layer + * @vdev_id: vdev id + * @wh: pointer to ieee80211_frame structure + * + * This function indicates TKIP MIC errors encountered in the RX data path + * to the protocol stack + * + * Return: none + */ +void wma_rx_mic_error_ind(void *scn_handle, uint16_t vdev_id, void *wh); + QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma_handle, int32_t vdev_id); diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c index e315e626a95d..5dfdc303a6ae 100644 --- a/core/wma/src/wma_data.c +++ b/core/wma/src/wma_data.c @@ -3121,3 +3121,31 @@ wma_indicate_err( } } } + +void wma_rx_mic_error_ind(void *scn_handle, uint16_t vdev_id, void *wh) +{ + struct ieee80211_frame *w = (struct ieee80211_frame *)wh; + struct ol_error_info err_info; + + err_info.u.mic_err.vdev_id = vdev_id; + qdf_mem_copy(err_info.u.mic_err.da, w->i_addr1, OL_TXRX_MAC_ADDR_LEN); + qdf_mem_copy(err_info.u.mic_err.ta, w->i_addr2, OL_TXRX_MAC_ADDR_LEN); + + WMA_LOGD("MIC vdev_id %d\n", vdev_id); + WMA_LOGD("MIC DA: %02x:%02x:%02x:%02x:%02x:%02x\n", + err_info.u.mic_err.da[0], + err_info.u.mic_err.da[1], + err_info.u.mic_err.da[2], + err_info.u.mic_err.da[3], + err_info.u.mic_err.da[4], + err_info.u.mic_err.da[5]); + WMA_LOGD("MIC TA: %02x:%02x:%02x:%02x:%02x:%02x\n", + err_info.u.mic_err.ta[0], + err_info.u.mic_err.ta[1], + err_info.u.mic_err.ta[2], + err_info.u.mic_err.ta[3], + err_info.u.mic_err.ta[4], + err_info.u.mic_err.ta[5]); + + wma_indicate_err(OL_RX_ERR_TKIP_MIC, &err_info); +}