xref: /wlan-dirver/qca-wifi-host-cmn/qdf/inc/i_qdf_nbuf_api_m.h (revision a86b23ee68a2491aede2e03991f3fb37046f4e41)
1 /*
2  * Copyright (c) 2014-2017,2019-2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: i_qdf_nbuf_api_m.h
21  *
22  * Platform specific qdf_nbuf_public network buffer API
23  * This file defines the network buffer abstraction.
24  * Included by qdf_nbuf.h and should not be included
25  * directly from other files.
26  */
27 
28 #ifndef _QDF_NBUF_M_H
29 #define _QDF_NBUF_M_H
30 
31 static inline int qdf_nbuf_ipa_owned_get(qdf_nbuf_t buf)
32 {
33 	return __qdf_nbuf_ipa_owned_get(buf);
34 }
35 
36 static inline void qdf_nbuf_ipa_owned_set(qdf_nbuf_t buf)
37 {
38 	__qdf_nbuf_ipa_owned_set(buf);
39 }
40 
41 static inline void qdf_nbuf_ipa_owned_clear(qdf_nbuf_t buf)
42 {
43 	__qdf_nbuf_ipa_owned_clear(buf);
44 }
45 
46 static inline int qdf_nbuf_ipa_priv_get(qdf_nbuf_t buf)
47 {
48 	return __qdf_nbuf_ipa_priv_get(buf);
49 }
50 
51 static inline void qdf_nbuf_ipa_priv_set(qdf_nbuf_t buf, uint32_t priv)
52 {
53 
54 	QDF_BUG(!(priv & QDF_NBUF_IPA_CHECK_MASK));
55 	__qdf_nbuf_ipa_priv_set(buf, priv);
56 }
57 
58 /**
59  * qdf_nbuf_set_rx_protocol_tag()
60  * @buf: Network buffer
61  * @val: Value to be set in the nbuf
62  * Return: None
63  */
64 static inline void qdf_nbuf_set_rx_protocol_tag(qdf_nbuf_t buf, uint16_t val)
65 {
66 }
67 
68 /**
69  * qdf_nbuf_get_rx_protocol_tag()
70  * @buf: Network buffer
71  * Return: Value of rx protocol tag, here 0
72  */
73 static inline uint16_t qdf_nbuf_get_rx_protocol_tag(qdf_nbuf_t buf)
74 {
75 	return 0;
76 }
77 
78 /**
79  * qdf_nbuf_set_rx_flow_tag() - set given value in flow tag field
80  * of buf(skb->cb)
81  * @buf: Network buffer
82  * @val: Rx Flow Tag to be set in the nbuf
83  * Return: None
84  */
85 static inline void qdf_nbuf_set_rx_flow_tag(qdf_nbuf_t buf, uint16_t val)
86 {
87 }
88 
89 /**
90  * qdf_nbuf_get_rx_flow_tag() - Get the value of flow_tag
91  * field of buf(skb->cb)
92  * @buf: Network buffer
93  * Return: Value of rx flow tag, here 0
94  */
95 static inline uint16_t qdf_nbuf_get_rx_flow_tag(qdf_nbuf_t buf)
96 {
97 	return 0;
98 }
99 
100 /**
101  * qdf_nbuf_set_exc_frame() - set exception frame flag
102  * @buf: Network buffer whose cb is to set exception frame flag
103  * @value: exception frame flag, value 0 or 1.
104  *
105  * Return: none
106  */
107 static inline void qdf_nbuf_set_exc_frame(qdf_nbuf_t buf, uint8_t value)
108 {
109 	QDF_NBUF_CB_RX_PACKET_EXC_FRAME(buf) = value;
110 }
111 
112 /**
113  * qdf_nbuf_is_exc_frame() - check exception frame flag bit
114  * @buf: Network buffer to get exception flag
115  *
116  * Return: 0 or 1
117  */
118 static inline uint8_t qdf_nbuf_is_exc_frame(qdf_nbuf_t buf)
119 {
120 	return QDF_NBUF_CB_RX_PACKET_EXC_FRAME(buf);
121 }
122 #endif /* _QDF_NBUF_M_H */
123