xref: /wlan-dirver/qca-wifi-host-cmn/qdf/linux/src/i_qdf_net_types.h (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /*
2  * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: i_qdf_net_types
22  * This file provides OS dependent net types API's.
23  */
24 
25 #ifndef _I_QDF_NET_TYPES_H
26 #define _I_QDF_NET_TYPES_H
27 
28 #include <qdf_types.h>          /* uint8_t, etc. */
29 #include <asm/checksum.h>
30 #include <net/ip6_checksum.h>
31 #include <net/tcp.h>
32 
33 typedef struct in6_addr __in6_addr_t;
34 typedef __wsum __wsum_t;
35 
36 static inline  int32_t __qdf_csum_ipv6(const struct in6_addr *saddr,
37 				       const struct in6_addr *daddr,
38 				       __u32 len, unsigned short proto,
39 				       __wsum sum)
40 {
41 	return csum_ipv6_magic((struct in6_addr *)saddr,
42 			       (struct in6_addr *)daddr, len, proto, sum);
43 }
44 
45 static inline char *__qdf_netdev_get_devname(qdf_netdev_t dev)
46 {
47 	return dev->name;
48 }
49 
50 #define __QDF_TCPHDR_FIN TCPHDR_FIN
51 #define __QDF_TCPHDR_SYN TCPHDR_SYN
52 #define __QDF_TCPHDR_RST TCPHDR_RST
53 #define __QDF_TCPHDR_PSH TCPHDR_PSH
54 #define __QDF_TCPHDR_ACK TCPHDR_ACK
55 #define __QDF_TCPHDR_URG TCPHDR_URG
56 #define __QDF_TCPHDR_ECE TCPHDR_ECE
57 #define __QDF_TCPHDR_CWR TCPHDR_CWR
58 #endif /* _I_QDF_NET_TYPES_H */
59