1 /*
2  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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   * DOC: os_if_dp.h
20   *
21   *
22   */
23 #ifndef __OSIF_DP_H__
24 #define __OSIF_DP_H__
25 
26 #include "wlan_dp_public_struct.h"
27 #include <wlan_cfg80211.h>
28 
29 #ifdef WLAN_FEATURE_DYNAMIC_RX_AGGREGATION
30 /**
31  * enum qdisc_filter_status - QDISC filter status
32  * @QDISC_FILTER_RTNL_LOCK_FAIL: rtnl lock acquire failed
33  * @QDISC_FILTER_PRIO_MATCH: qdisc filter with priority match
34  * @QDISC_FILTER_PRIO_MISMATCH: no filter match with configured priority
35  */
36 enum qdisc_filter_status {
37 	QDISC_FILTER_RTNL_LOCK_FAIL,
38 	QDISC_FILTER_PRIO_MATCH,
39 	QDISC_FILTER_PRIO_MISMATCH,
40 };
41 #endif
42 
43 /**
44  * osif_dp_classify_pkt() - classify packet
45  * @skb: sk buff
46  *
47  * Return: None
48  */
49 void osif_dp_classify_pkt(struct sk_buff *skb);
50 
51 /**
52  * osif_dp_mark_pkt_type() - Mark pkt type in CB
53  * @skb: sk buff
54  *
55  * Return: None
56  */
57 void osif_dp_mark_pkt_type(struct sk_buff *skb);
58 
59 /* wait time for nud stats in milliseconds */
60 #define WLAN_WAIT_TIME_NUD_STATS 800
61 /* nud stats skb max length */
62 #define WLAN_NUD_STATS_LEN 800
63 /* ARP packet type for NUD debug stats */
64 #define WLAN_NUD_STATS_ARP_PKT_TYPE 1
65 
66 #define MAX_USER_COMMAND_SIZE 4096
67 #define DNS_DOMAIN_NAME_MAX_LEN 255
68 #define ICMPV6_ADDR_LEN 16
69 
70 #define CONNECTIVITY_CHECK_SET_ARP \
71 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_ARP
72 #define CONNECTIVITY_CHECK_SET_DNS \
73 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_DNS
74 #define CONNECTIVITY_CHECK_SET_TCP_HANDSHAKE \
75 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_TCP_HANDSHAKE
76 #define CONNECTIVITY_CHECK_SET_ICMPV4 \
77 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_ICMPV4
78 #define CONNECTIVITY_CHECK_SET_ICMPV6 \
79 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_ICMPV6
80 #define CONNECTIVITY_CHECK_SET_TCP_SYN \
81 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_TCP_SYN
82 #define CONNECTIVITY_CHECK_SET_TCP_SYN_ACK \
83 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_TCP_SYN_ACK
84 #define CONNECTIVITY_CHECK_SET_TCP_ACK \
85 	QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_TCP_ACK
86 
87 /**
88  * os_if_dp_register_txrx_callbacks() - Register TX/RX OSIF callbacks
89  * @cb_obj: Call back object pointer for ops registration
90  *
91  * Return: None
92  */
93 void os_if_dp_register_txrx_callbacks(struct wlan_dp_psoc_callbacks *cb_obj);
94 
95 /**
96  * os_if_dp_register_hdd_callbacks() - Register callback handlers
97  * @psoc: Pointer to psoc context
98  * @cb_obj: Callback object pointer
99  *
100  * Return: None
101  */
102 void os_if_dp_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
103 				     struct wlan_dp_psoc_callbacks *cb_obj);
104 
105 /**
106  * osif_dp_nud_register_netevent_notifier() - Register netevent notifier
107  * @psoc: Pointer to psoc context
108  *
109  * Return: 0 on success, error code on failure
110  */
111 int osif_dp_nud_register_netevent_notifier(struct wlan_objmgr_psoc *psoc);
112 
113 /**
114  * osif_dp_nud_unregister_netevent_notifier() - Unregister netevent notifier
115  * @psoc: Pointer to psoc context
116  *
117  * Return: None
118  */
119 void osif_dp_nud_unregister_netevent_notifier(struct wlan_objmgr_psoc *psoc);
120 
121 /**
122  * osif_dp_get_nud_stats() - get arp stats command to firmware
123  * @wiphy: pointer to wireless wiphy structure.
124  * @vdev: pointer to vdev context.
125  * @data: pointer to apfind configuration data.
126  * @data_len: the length in byte of apfind data.
127  *
128  * This is called when wlan driver needs to get arp stats to
129  * firmware.
130  *
131  * Return: An error code or 0 on success.
132  */
133 int osif_dp_get_nud_stats(struct wiphy *wiphy, struct wlan_objmgr_vdev *vdev,
134 			  const void *data, int data_len);
135 
136 /**
137  * osif_dp_set_nud_stats() - set arp stats command to firmware
138  * @wiphy: pointer to wireless wiphy structure.
139  * @vdev: pointer to wireless_dev structure.
140  * @data: pointer to apfind configuration data.
141  * @data_len: the length in byte of apfind data.
142  *
143  * This is called when wlan driver needs to send arp stats to
144  * firmware.
145  *
146  * Return: An error code or 0 on success.
147  */
148 int osif_dp_set_nud_stats(struct wiphy *wiphy, struct wlan_objmgr_vdev *vdev,
149 			  const void *data, int data_len);
150 #endif /* __OSIF_DP_H__ */
151