From 87251ccfa6942c8e48fe00f134bcb36fea6b973b Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Wed, 16 Aug 2017 18:23:48 +0800 Subject: [PATCH] qcacld-3.0: Don't check MIC fail if SA is self MAC When DUT connects to specific AP, it receives the frame whose SA is self MAC and MIC failure flag is set at the same time. This will cause disconnection with the AP because MIC failure. To fix this unexpected disconnection issue, do not check MIC failure if discard flag is set by fw. Change-Id: I9029da9d329679bf0fd61be234690c764cceb57c CRs-Fixed: 2090575 --- core/dp/htt/htt_rx.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index ac6bcf29ad..1e6bd0b009 100644 --- a/core/dp/htt/htt_rx.c +++ b/core/dp/htt/htt_rx.c @@ -2114,6 +2114,11 @@ uint32_t htt_rx_amsdu_rx_in_order_get_pktlog(qdf_nbuf_t rx_ind_msg) } /* Return values: 1 - success, 0 - failure */ +#define RX_DESC_DISCARD_IS_SET ((*((u_int8_t *) &rx_desc->fw_desc.u.val)) & \ + FW_RX_DESC_DISCARD_M) +#define RX_DESC_MIC_ERR_IS_SET ((*((u_int8_t *) &rx_desc->fw_desc.u.val)) & \ + FW_RX_DESC_ANY_ERR_M) + static int htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg, @@ -2223,15 +2228,16 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, /* calling callback function for packet logging */ if (pdev->rx_pkt_dump_cb) { - if (qdf_unlikely((*((u_int8_t *) - &rx_desc->fw_desc.u.val)) & - FW_RX_DESC_ANY_ERR_M)) + if (qdf_unlikely(RX_DESC_MIC_ERR_IS_SET && + !RX_DESC_DISCARD_IS_SET)) status = RX_PKT_FATE_FW_DROP_INVALID; pdev->rx_pkt_dump_cb(msdu, peer_id, status); } - - if (qdf_unlikely((*((u_int8_t *) &rx_desc->fw_desc.u.val)) & - FW_RX_DESC_ANY_ERR_M)) { + /* if discard flag is set (SA is self MAC), then + * don't check mic failure. + */ + if (qdf_unlikely(RX_DESC_MIC_ERR_IS_SET && + !RX_DESC_DISCARD_IS_SET)) { uint8_t tid = HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET( *(u_int32_t *)rx_ind_data);