xref: /wlan-dirver/qca-wifi-host-cmn/qdf/inc/i_qdf_nbuf_api_w.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_w.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_W_H
29 #define _QDF_NBUF_W_H
30 
31 static inline void *qdf_nbuf_get_tx_fctx(qdf_nbuf_t buf)
32 {
33 	return  __qdf_nbuf_get_tx_fctx(buf);
34 }
35 
36 static inline void *qdf_nbuf_get_rx_fctx(qdf_nbuf_t buf)
37 {
38 	return  __qdf_nbuf_get_rx_fctx(buf);
39 }
40 
41 
42 static inline void
43 qdf_nbuf_set_tx_fctx_type(qdf_nbuf_t buf, void *ctx, uint8_t type)
44 {
45 	__qdf_nbuf_set_tx_fctx_type(buf, ctx, type);
46 }
47 
48 static inline void
49 qdf_nbuf_set_rx_fctx_type(qdf_nbuf_t buf, void *ctx, uint8_t type)
50 {
51 	__qdf_nbuf_set_rx_fctx_type(buf, ctx, type);
52 }
53 
54 
55 static inline void *
56 qdf_nbuf_get_ext_cb(qdf_nbuf_t buf)
57 {
58 	return  __qdf_nbuf_get_ext_cb(buf);
59 }
60 
61 static inline void
62 qdf_nbuf_set_ext_cb(qdf_nbuf_t buf, void *ref)
63 {
64 	__qdf_nbuf_set_ext_cb(buf, ref);
65 }
66 
67 /**
68  * qdf_nbuf_set_rx_protocol_tag() - set given value in protocol_tag
69  * field of buf(skb->cb)
70  * @buf: Network buffer
71  * @val: Value to be set in the nbuf
72  * Return: None
73  */
74 static inline void qdf_nbuf_set_rx_protocol_tag(qdf_nbuf_t buf, uint16_t val)
75 {
76 	__qdf_nbuf_set_rx_protocol_tag(buf, val);
77 }
78 
79 /**
80  * qdf_nbuf_get_rx_protocol_tag() - Get the value of protocol_tag
81  * field of buf(skb->cb)
82  * @buf: Network buffer
83  * Return: Value of Rx protocol tag in the nbuf
84  */
85 static inline uint16_t qdf_nbuf_get_rx_protocol_tag(qdf_nbuf_t buf)
86 {
87 	return __qdf_nbuf_get_rx_protocol_tag(buf);
88 }
89 
90 /**
91  * qdf_nbuf_set_rx_flow_tag() - set given value in flow tag field
92  * of buf(skb->cb)
93  * @buf: Network buffer
94  * @val: Value of Rx flow tag to be set in the nbuf
95  * Return: None
96  */
97 static inline void qdf_nbuf_set_rx_flow_tag(qdf_nbuf_t buf, uint16_t val)
98 {
99 	__qdf_nbuf_set_rx_flow_tag(buf, val);
100 }
101 
102 /**
103  * qdf_nbuf_get_rx_flow_tag() - Get the value of flow_tag
104  * field of buf(skb->cb)
105  * @buf: Network buffer
106  * Return: Value of the Rx flow tag in the nbuf
107  */
108 static inline uint16_t qdf_nbuf_get_rx_flow_tag(qdf_nbuf_t buf)
109 {
110 	return __qdf_nbuf_get_rx_flow_tag(buf);
111 }
112 
113 /**
114  * qdf_nbuf_set_exc_frame() - set exception frame flag
115  * @buf: Network buffer whose cb is to set exception frame flag
116  * @value: exception frame flag, value 0 or 1.
117  *
118  * Return: none
119  */
120 static inline void qdf_nbuf_set_exc_frame(qdf_nbuf_t buf, uint8_t value)
121 {
122 }
123 #endif /* _QDF_NBUF_W_H */
124