From 0be39b748ca6cedbaa46f6001d2e9895e3d89c9a Mon Sep 17 00:00:00 2001 From: Nirav Shah Date: Mon, 26 Nov 2018 11:07:26 +0530 Subject: [PATCH] qcacmn: Make ipa_owned bit common for TX and RX control block Make ipa_owned bit common for TX and RX control block union for MCL as it is used in qdf_nbuf_free API, which is used in both TX and RX path to free skbs. Change-Id: I3a4279d528a1b8a72a1ec307f1672efae84d2745 CRs-Fixed: 2353137 --- qdf/linux/src/i_qdf_nbuf.h | 20 +++++++++++++++++--- qdf/linux/src/i_qdf_nbuf_m.h | 2 +- qdf/linux/src/i_qdf_nbuf_w.h | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/qdf/linux/src/i_qdf_nbuf.h b/qdf/linux/src/i_qdf_nbuf.h index 1292f128e8fd..8091c3c856a6 100644 --- a/qdf/linux/src/i_qdf_nbuf.h +++ b/qdf/linux/src/i_qdf_nbuf.h @@ -91,6 +91,9 @@ typedef union { * 5. "ext_cb_pt" must be the first member in both TX and RX unions * for the priv_cb_w since it must be at same offset for both * TX and RX union + * 6. "ipa.owned" bit must be first member in both TX and RX unions + * for the priv_cb_m since it must be at same offset for both + * TX and RX union. * * @paddr : physical addressed retrieved by dma_map of nbuf->data * @@ -104,6 +107,7 @@ typedef union { * @rx.dev.priv_cb_m.lro_ctx: LRO context * @rx.dev.priv_cb_m.map_index: * @rx.dev.priv_cb_m.peer_local_id: peer_local_id for RX pkt + * @rx.dev.priv_cb_m.ipa_owned: packet owned by IPA * * @rx.lro_eligible: flag to indicate whether the MSDU is LRO eligible * @rx.peer_cached_buf_frm: peer cached buffer @@ -196,11 +200,17 @@ struct qdf_nbuf_cb { uint32_t reserved2; } priv_cb_w; struct { + /* ipa_owned bit is common between rx + * control block and tx control block. + * Do not change location of this bit. + */ + uint32_t ipa_owned:1, + reserved:15, + peer_local_id:16; uint32_t tcp_seq_num; uint32_t tcp_ack_num; - unsigned char *lro_ctx; uint32_t map_index; - uint32_t peer_local_id; + unsigned char *lro_ctx; } priv_cb_m; } dev; uint32_t lro_eligible:1, @@ -239,11 +249,15 @@ struct qdf_nbuf_cb { void *fctx; } priv_cb_w; struct { - uint32_t data_attr; + /* ipa_owned bit is common between rx + * control block and tx control block. + * Do not change location of this bit. + */ struct { uint32_t owned:1, priv:31; } ipa; + uint32_t data_attr; uint16_t desc_id; uint16_t mgmt_desc_id; struct { diff --git a/qdf/linux/src/i_qdf_nbuf_m.h b/qdf/linux/src/i_qdf_nbuf_m.h index ac8ffdcd4303..3b3096c3fedf 100644 --- a/qdf/linux/src/i_qdf_nbuf_m.h +++ b/qdf/linux/src/i_qdf_nbuf_m.h @@ -72,7 +72,7 @@ * Return: void */ static inline void qdf_nbuf_cb_update_peer_local_id(struct sk_buff *skb, - uint32_t peer_local_id) + uint16_t peer_local_id) { QDF_NBUF_CB_RX_PEER_LOCAL_ID(skb) = peer_local_id; } diff --git a/qdf/linux/src/i_qdf_nbuf_w.h b/qdf/linux/src/i_qdf_nbuf_w.h index f7c6570db7d9..5d34b1c80b29 100644 --- a/qdf/linux/src/i_qdf_nbuf_w.h +++ b/qdf/linux/src/i_qdf_nbuf_w.h @@ -74,7 +74,7 @@ * Return: void */ static inline void qdf_nbuf_cb_update_peer_local_id(struct sk_buff *skb, - uint32_t peer_local_id) + uint16_t peer_local_id) { /* Does not apply to WIN */ }