From 2972a24c5540761d831a7373566642af7b9183f0 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Fri, 12 Apr 2019 12:33:51 +0530 Subject: [PATCH] qcacmn: Ignore raw frame if is not of type Data Non raw traffic gets enqueued to VAP in raw mode and incorrect fc.type causes HW fault. Lets proceed only if raw frame is of type data. Change-Id: I9f0d608cd1b319feb9af642969b258aab813645f CRs-Fixed: 2434391 --- dp/inc/cdp_txrx_stats_struct.h | 1 + dp/wifi3.0/dp_stats.c | 2 ++ dp/wifi3.0/dp_tx.c | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 21151191cbbf..806fe8f9eec2 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -679,6 +679,7 @@ struct cdp_tx_ingress_stats { struct { struct cdp_pkt_info raw_pkt; uint32_t dma_map_error; + uint32_t invalid_raw_pkt_datatype; } raw; /* TSO packets info */ diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index b7dfb03d4ad1..cd7c4021547d 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -5298,6 +5298,8 @@ dp_print_pdev_tx_stats(struct dp_pdev *pdev) pdev->stats.tx_i.raw.raw_pkt.bytes); DP_PRINT_STATS(" DMA map error = %d", pdev->stats.tx_i.raw.dma_map_error); + DP_PRINT_STATS(" RAW pkt type[!data] error = %d", + pdev->stats.tx_i.raw.invalid_raw_pkt_datatype); DP_PRINT_STATS("Reinjected:"); DP_PRINT_STATS(" Packets = %d", pdev->stats.tx_i.reinject_pkts.num); diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 7e1f09e56c74..e73b3d9a4919 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -936,6 +936,13 @@ static qdf_nbuf_t dp_tx_prepare_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf, DP_STATS_INC_PKT(vdev, tx_i.raw.raw_pkt, 1, qdf_nbuf_len(nbuf)); + /* Continue only if frames are of DATA type */ + if (!DP_FRAME_IS_DATA(qos_wh)) { + DP_STATS_INC(vdev, tx_i.raw.invalid_raw_pkt_datatype, 1); + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, + "Pkt. recd is of not data type"); + goto error; + } /* SWAR for HW: Enable WEP bit in the AMSDU frames for RAW mode */ if (vdev->raw_mode_war && (qos_wh->i_fc[0] & QDF_IEEE80211_FC0_SUBTYPE_QOS) &&