diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index af20008aa4..d7360d7ab3 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -91,7 +91,6 @@ static struct ol_if_ops dp_ol_if_ops = { .peer_rx_reorder_queue_remove = target_if_peer_rx_reorder_queue_remove, .is_hw_dbs_2x2_capable = policy_mgr_is_hw_dbs_2x2_capable, .lro_hash_config = target_if_lro_hash_config, - .rx_mic_error = wma_rx_mic_error_ind, .rx_invalid_peer = wma_rx_invalid_peer_ind, .is_roam_inprogress = wma_is_roam_in_progress /* TODO: Add any other control path calls required to OL_IF/WMA layer */ diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index 240fb2d420..dc504d80ec 100644 --- a/core/dp/htt/htt_t2h.c +++ b/core/dp/htt/htt_t2h.c @@ -31,6 +31,7 @@ #include /* HTT_T2H_MSG_TYPE, etc. */ #include /* qdf_nbuf_t */ +#include #include #include #include /* htt_tx_status */ @@ -591,9 +592,10 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, switch (HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(*msg_word)) { case HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR: { - struct ol_error_info err_info; struct ol_txrx_vdev_t *vdev; struct ol_txrx_peer_t *peer; + uint64_t pn; + uint32_t key_id; uint16_t peer_id = HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET (*(msg_word + 1)); @@ -606,22 +608,14 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, break; } vdev = peer->vdev; - err_info.u.mic_err.vdev_id = vdev->vdev_id; - err_info.u.mic_err.key_id = - HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET + key_id = HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET (*(msg_word + 1)); - qdf_mem_copy(err_info.u.mic_err.da, - (uint8_t *)(msg_word + 2), - QDF_MAC_ADDR_SIZE); - qdf_mem_copy(err_info.u.mic_err.sa, - (uint8_t *)(msg_word + 4), - QDF_MAC_ADDR_SIZE); - qdf_mem_copy(&err_info.u.mic_err.pn, - (uint8_t *)(msg_word + 6), 6); - qdf_mem_copy(err_info.u.mic_err.ta, - peer->mac_addr.raw, QDF_MAC_ADDR_SIZE); + qdf_mem_copy(&pn, (uint8_t *)(msg_word + 6), 6); - wma_indicate_err(OL_RX_ERR_TKIP_MIC, &err_info); + ol_rx_send_mic_err_ind(vdev->pdev, vdev->vdev_id, + peer->mac_addr.raw, 0, 0, + OL_RX_ERR_TKIP_MIC, htt_t2h_msg, + &pn, key_id); break; } default: diff --git a/core/dp/txrx/ol_rx.c b/core/dp/txrx/ol_rx.c index 746da744f3..10e3d8f4d0 100644 --- a/core/dp/txrx/ol_rx.c +++ b/core/dp/txrx/ol_rx.c @@ -723,13 +723,14 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev, pdev->htt_pdev, msdu), &key_id) == true) { - ol_rx_err(pdev->ctrl_pdev, - vdev->vdev_id, - peer->mac_addr.raw, - tid, 0, - OL_RX_ERR_TKIP_MIC, - msdu, &pn.pn48, - key_id); + ol_rx_send_mic_err_ind( + vdev->pdev, + vdev->vdev_id, + peer->mac_addr.raw, + tid, 0, + OL_RX_ERR_TKIP_MIC, + msdu, &pn.pn48, + key_id); } } @@ -945,6 +946,42 @@ ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev, htt_rx_msdu_buff_replenish(htt_pdev); } +void +ol_rx_send_mic_err_ind(struct ol_txrx_pdev_t *pdev, uint8_t vdev_id, + uint8_t *peer_mac_addr, int tid, uint32_t tsf32, + enum ol_rx_err_type err_type, qdf_nbuf_t rx_frame, + uint64_t *pn, uint8_t key_id) +{ + struct cdp_rx_mic_err_info mic_failure_info; + qdf_ether_header_t *eth_hdr; + struct ol_if_ops *tops = NULL; + ol_txrx_soc_handle ol_txrx_soc = cds_get_context(QDF_MODULE_ID_SOC); + + if (err_type != OL_RX_ERR_TKIP_MIC) + return; + + if (qdf_nbuf_len(rx_frame) < sizeof(*eth_hdr)) + return; + + eth_hdr = (qdf_ether_header_t *)qdf_nbuf_data(rx_frame); + + qdf_copy_macaddr((struct qdf_mac_addr *)&mic_failure_info.ta_mac_addr, + (struct qdf_mac_addr *)peer_mac_addr); + qdf_copy_macaddr((struct qdf_mac_addr *)&mic_failure_info.da_mac_addr, + (struct qdf_mac_addr *)eth_hdr->ether_dhost); + mic_failure_info.key_id = key_id; + mic_failure_info.multicast = + IEEE80211_IS_MULTICAST(eth_hdr->ether_dhost); + qdf_mem_copy(mic_failure_info.tsc, pn, SIR_CIPHER_SEQ_CTR_SIZE); + mic_failure_info.frame_type = cdp_rx_frame_type_802_3; + mic_failure_info.data = NULL; + mic_failure_info.vdev_id = vdev_id; + + tops = ol_txrx_soc->ol_ops; + if (tops->rx_mic_error) + tops->rx_mic_error(pdev->control_pdev, &mic_failure_info); +} + void ol_rx_mic_error_handler( ol_txrx_pdev_handle pdev, @@ -971,11 +1008,11 @@ ol_rx_mic_error_handler( if (htt_rx_msdu_desc_key_id( vdev->pdev->htt_pdev, msdu_desc, &key_id) == true) { - ol_rx_err(vdev->pdev->ctrl_pdev, - vdev->vdev_id, - peer->mac_addr.raw, tid, 0, - OL_RX_ERR_TKIP_MIC, msdu, - &pn.pn48, key_id); + ol_rx_send_mic_err_ind(vdev->pdev, + vdev->vdev_id, + peer->mac_addr.raw, tid, 0, + OL_RX_ERR_TKIP_MIC, msdu, + &pn.pn48, key_id); } } } diff --git a/core/dp/txrx/ol_rx.h b/core/dp/txrx/ol_rx.h index a44213f2b0..933dab0e5a 100644 --- a/core/dp/txrx/ol_rx.h +++ b/core/dp/txrx/ol_rx.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 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 @@ -42,6 +42,28 @@ ol_rx_discard(struct ol_txrx_vdev_t *vdev, struct ol_txrx_peer_t *peer, unsigned int tid, qdf_nbuf_t head_msdu); +/** + * ol_rx_send_mic_err_ind() - ol rx mic err handler + * @pdev: ol pdev + * @vdev_id: vdev id + * @peer_mac_addr: peer mac address + * @tid: TID + * @tsf32: TSF + * @err_type: error type + * @rx_frame: rx frame + * @pn: PN Number + * @key_id: key id + * + * This function handles rx error and send MIC error failure to HDD + * + * Return: none + */ +void +ol_rx_send_mic_err_ind(struct ol_txrx_pdev_t *pdev, uint8_t vdev_id, + uint8_t *peer_mac_addr, int tid, uint32_t tsf32, + enum ol_rx_err_type err_type, qdf_nbuf_t rx_frame, + uint64_t *pn, uint8_t key_id); + void ol_rx_frames_free(htt_pdev_handle htt_pdev, qdf_nbuf_t frames); void ol_rx_peer_init(struct ol_txrx_pdev_t *pdev, struct ol_txrx_peer_t *peer); diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 633d772d6a..01eca72a17 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -5313,6 +5313,22 @@ struct cdp_vdev *ol_txrx_wrapper_get_vdev_from_vdev_id(struct cdp_pdev *ppdev, return ol_txrx_get_vdev_from_vdev_id(vdev_id); } +/** + * ol_txrx_pdev_set_ctrl_pdev() - set ctrl pdev handle in txrx pdev + * @txrx_pdev: txrx pdev handle + * @ctrl_pdev: UMAC ctrl pdev handle + * + * Return: void + */ +static void +ol_txrx_pdev_set_ctrl_pdev(struct cdp_pdev *txrx_pdev, + struct cdp_ctrl_objmgr_pdev *ctrl_pdev) +{ + struct ol_txrx_pdev_t *pdev = (struct ol_txrx_pdev_t *)txrx_pdev; + + pdev->control_pdev = ctrl_pdev; +} + /** * ol_txrx_wrapper_register_peer() - register peer * @pdev: pdev handle @@ -5612,6 +5628,7 @@ static struct cdp_cmn_ops ol_ops_cmn = { .txrx_fw_stats_get = ol_txrx_fw_stats_get, .display_stats = ol_txrx_display_stats, .txrx_get_cfg = ol_txrx_get_cfg, + .txrx_pdev_set_ctrl_pdev = ol_txrx_pdev_set_ctrl_pdev, /* TODO: Add other functions */ }; @@ -5875,6 +5892,7 @@ struct cdp_soc_t *ol_txrx_soc_attach(void *scn_handle, return NULL; soc->ops = &ol_txrx_ops; + soc->ol_ops = dp_ol_if_ops; return soc; } diff --git a/core/dp/txrx/ol_txrx_types.h b/core/dp/txrx/ol_txrx_types.h index 3aa0311bee..3e4069832c 100644 --- a/core/dp/txrx/ol_txrx_types.h +++ b/core/dp/txrx/ol_txrx_types.h @@ -626,6 +626,8 @@ struct ol_txrx_pdev_t { /* ctrl_pdev - handle for querying config info */ struct cdp_cfg *ctrl_pdev; + struct cdp_ctrl_objmgr_pdev *control_pdev; + /* osdev - handle for mem alloc / free, map / unmap */ qdf_device_t osdev;