qcacld-3.0: Use new HDD callback for rx mic error

Post rx mic error information to HDD via new HDD mic
error callback(hdd_rx_mic_error_ind) registered to
.rx_mic_error member in dp_ol_if_ops.

Change-Id: Ia1e2b78a94dddba48937995ecf62fb5a7ae4139d
CRs-Fixed: 2488452
This commit is contained in:
Rakshith Suresh Patkar 2019-06-07 17:11:31 +05:30 • committed by nshrivas
commit 02f3d31c2f
6 changed files with 102 additions and 30 deletions

View file

@ -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 */

View file

@ -31,6 +31,7 @@
#include <htt.h> /* HTT_T2H_MSG_TYPE, etc. */
#include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_rx.h>
#include <ol_htt_rx_api.h>
#include <ol_htt_tx_api.h>
#include <ol_txrx_htt_api.h> /* 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:

View file

@ -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);
}
}
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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;