From 6dc1a9658a6342baede9dcc3d8eb3b6f882e1a2a Mon Sep 17 00:00:00 2001 From: Prakash Manjunathappa Date: Thu, 5 May 2016 19:32:53 -0700 Subject: [PATCH] qcacld-3.0: Fix crash on WMA path During a recent merge, a frame type was being set to a similar looking value (ol_tx_spec_no_free instead of ol_tx_frm_no_free) and this is causing crashes on tx-completion. Also capitalize the constants. This is a stability CR. Change-Id: Ic86dafc5baa80ae634c5267794f3add0e06d076f Acked-by: Orhan K AKYILDIZ CRs-fixed: 1010581 --- core/dp/txrx/ol_tx.c | 8 ++++---- core/dp/txrx/ol_tx_desc.c | 10 +++++----- core/dp/txrx/ol_tx_send.c | 6 +++--- core/dp/txrx/ol_txrx_types.h | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/core/dp/txrx/ol_tx.c b/core/dp/txrx/ol_tx.c index e8b5e9b7d2c0..b258790f570b 100644 --- a/core/dp/txrx/ol_tx.c +++ b/core/dp/txrx/ol_tx.c @@ -384,10 +384,10 @@ ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev, tx_desc->netbuf = msdu; if (msdu_info->tso_info.is_tso) { tx_desc->tso_desc = msdu_info->tso_info.curr_seg; - tx_desc->pkt_type = ol_tx_frm_tso; + tx_desc->pkt_type = OL_TX_FRM_TSO; TXRX_STATS_MSDU_INCR(pdev, tx.tso.tso_pkts, msdu); } else { - tx_desc->pkt_type = ol_tx_frm_std; + tx_desc->pkt_type = OL_TX_FRM_STD; } htt_tx_desc = tx_desc->htt_tx_desc; @@ -1049,9 +1049,9 @@ ol_tx_non_std_ll(ol_txrx_vdev_handle vdev, if (tx_spec != OL_TX_SPEC_STD) { if (tx_spec & OL_TX_SPEC_NO_FREE) { - tx_desc->pkt_type = OL_TX_SPEC_NO_FREE; + tx_desc->pkt_type = OL_TX_FRM_NO_FREE; } else if (tx_spec & OL_TX_SPEC_TSO) { - tx_desc->pkt_type = OL_TX_SPEC_TSO; + tx_desc->pkt_type = OL_TX_FRM_TSO; } else if (tx_spec & OL_TX_SPEC_NWIFI_NO_ENCRYPT) { uint8_t sub_type = ol_txrx_tx_raw_subtype(tx_spec); diff --git a/core/dp/txrx/ol_tx_desc.c b/core/dp/txrx/ol_tx_desc.c index cfba71b28dc5..470846125af2 100644 --- a/core/dp/txrx/ol_tx_desc.c +++ b/core/dp/txrx/ol_tx_desc.c @@ -230,7 +230,7 @@ void ol_tx_desc_free(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *tx_desc) { qdf_spin_lock_bh(&pdev->tx_mutex); - if (tx_desc->pkt_type == ol_tx_frm_tso) { + if (tx_desc->pkt_type == OL_TX_FRM_TSO) { if (qdf_unlikely(tx_desc->tso_desc == NULL)) { qdf_print("%s %d TSO desc is NULL!\n", __func__, __LINE__); @@ -259,7 +259,7 @@ void ol_tx_desc_free(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *tx_desc) struct ol_tx_flow_pool_t *pool = tx_desc->pool; #if defined(FEATURE_TSO) - if (tx_desc->pkt_type == ol_tx_frm_tso) { + if (tx_desc->pkt_type == OL_TX_FRM_TSO) { if (qdf_unlikely(tx_desc->tso_desc == NULL)) qdf_print("%s %d TSO desc is NULL!\n", __func__, __LINE__); @@ -359,10 +359,10 @@ struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev, if (msdu_info->tso_info.is_tso) { tx_desc->tso_desc = msdu_info->tso_info.curr_seg; - tx_desc->pkt_type = ol_tx_frm_tso; + tx_desc->pkt_type = OL_TX_FRM_TSO; TXRX_STATS_MSDU_INCR(pdev, tx.tso.tso_pkts, netbuf); } else { - tx_desc->pkt_type = ol_tx_frm_std; + tx_desc->pkt_type = OL_TX_FRM_STD; } /* initialize the HW tx descriptor */ @@ -472,7 +472,7 @@ void ol_tx_desc_frame_free_nonstd(struct ol_txrx_pdev_t *pdev, #endif trace_str = (had_error) ? "OT:C:F:" : "OT:C:S:"; qdf_nbuf_trace_update(tx_desc->netbuf, trace_str); - if (tx_desc->pkt_type == ol_tx_frm_no_free) { + if (tx_desc->pkt_type == OL_TX_FRM_NO_FREE) { /* free the tx desc but don't unmap or free the frame */ if (pdev->tx_data_callback.func) { qdf_nbuf_set_next(tx_desc->netbuf, NULL); diff --git a/core/dp/txrx/ol_tx_send.c b/core/dp/txrx/ol_tx_send.c index c09d1091022a..a67a57097e1c 100644 --- a/core/dp/txrx/ol_tx_send.c +++ b/core/dp/txrx/ol_tx_send.c @@ -311,7 +311,7 @@ ol_tx_download_done_hl_free(void *txrx_pdev, ol_tx_download_done_base(pdev, status, msdu, msdu_id); - if ((tx_desc->pkt_type != ol_tx_frm_no_free) && + if ((tx_desc->pkt_type != OL_TX_FRM_NO_FREE) && (tx_desc->pkt_type < OL_TXRX_MGMT_TYPE_BASE)) { qdf_atomic_add(1, &pdev->tx_queue.rsrc_cnt); ol_tx_desc_frame_free_nonstd(pdev, tx_desc, status != A_OK); @@ -406,7 +406,7 @@ ol_tx_delay_compute(struct ol_txrx_pdev_t *pdev, _netbuf, _lcl_freelist, \ _tx_desc_last, _status) \ do { \ - if (qdf_likely((_tx_desc)->pkt_type == ol_tx_frm_std)) { \ + if (qdf_likely((_tx_desc)->pkt_type == OL_TX_FRM_STD)) { \ ol_tx_msdu_complete_single((_pdev), (_tx_desc),\ (_netbuf), (_lcl_freelist), \ (_tx_desc_last)); \ @@ -428,7 +428,7 @@ ol_tx_delay_compute(struct ol_txrx_pdev_t *pdev, _netbuf, _lcl_freelist, \ _tx_desc_last, _status) \ do { \ - if (qdf_likely((_tx_desc)->pkt_type == ol_tx_frm_std)) { \ + if (qdf_likely((_tx_desc)->pkt_type == OL_TX_FRM_STD)) { \ ol_tx_msdu_complete_batch((_pdev), (_tx_desc), \ (_tx_descs), (_status)); \ } else { \ diff --git a/core/dp/txrx/ol_txrx_types.h b/core/dp/txrx/ol_txrx_types.h index 42d7b368427b..87e4ac886821 100644 --- a/core/dp/txrx/ol_txrx_types.h +++ b/core/dp/txrx/ol_txrx_types.h @@ -117,10 +117,10 @@ struct privacy_exemption { }; enum ol_tx_frm_type { - ol_tx_frm_std = 0, /* regular frame - no added header fragments */ - ol_tx_frm_tso, /* TSO segment, with a modified IP header added */ - ol_tx_frm_audio, /* audio frames, with a custom LLC/SNAP hdr added */ - ol_tx_frm_no_free, /* frame requires special tx completion callback */ + OL_TX_FRM_STD = 0, /* regular frame - no added header fragments */ + OL_TX_FRM_TSO, /* TSO segment, with a modified IP header added */ + OL_TX_FRM_AUDIO, /* audio frames, with a custom LLC/SNAP hdr added */ + OL_TX_FRM_NO_FREE, /* frame requires special tx completion callback */ }; struct ol_tx_desc_t {