blob: 10a3f6a008ef412b5644d050c89d0f73b0a88478 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Rajeev Kumar229f1d32017-01-21 16:05:19 -08002 * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * 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
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#ifndef TXRX_H
20#define TXRX_H
21
22#include "cds_api.h"
Nirav Shahcbc6d722016-03-01 16:24:53 +053023#include "qdf_nbuf.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080024#include "csr_api.h"
25#include "sap_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080026#include "ol_txrx_osif_api.h"
27
28/* wait on peer deletion timeout value in milliseconds */
29#define PEER_DELETION_TIMEOUT 500
30
31enum txrx_wmm_ac {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080032 TXRX_WMM_AC_BE,
hquc7f560c2017-06-26 17:14:37 +080033 TXRX_WMM_AC_BK,
34 TXRX_WMM_AC_VI,
35 TXRX_WMM_AC_VO,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036
37 TXRX_NUM_WMM_AC
38};
39
40struct txrx_rx_metainfo {
41 u8 up;
42 u16 dest_staid;
43};
44
45enum bt_frame_type {
46 /* BT-AMP packet of type data */
47 TXRX_BT_AMP_TYPE_DATA = 0x0001,
48
49 /* BT-AMP packet of type activity report */
50 TXRX_BT_AMP_TYPE_AR = 0x0002,
51
52 /* BT-AMP packet of type security frame */
53 TXRX_BT_AMP_TYPE_SEC = 0x0003,
54
55 /* BT-AMP packet of type Link Supervision request frame */
56 TXRX_BT_AMP_TYPE_LS_REQ = 0x0004,
57
58 /* BT-AMP packet of type Link Supervision reply frame */
59 TXRX_BT_AMP_TYPE_LS_REP = 0x0005,
60
61 /* Invalid Frame */
62 TXRX_BAP_INVALID_FRAME
63};
64
65enum wlan_ts_direction {
66 /* uplink */
67 WLAN_TX_DIR = 0,
68
69 /* downlink */
70 WLAN_RX_DIR = 1,
71
72 /*bidirectional */
73 WLAN_BI_DIR = 2,
74};
75
76enum wlan_sta_state {
77 /* Transition in this state made upon creation */
78 WLAN_STA_INIT = 0,
79
Yun Park1239b222017-04-06 22:31:56 -070080 /*
81 * Transition happens after Assoc success if second level authentication
82 * is needed
83 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084 WLAN_STA_CONNECTED,
85
Yun Park1239b222017-04-06 22:31:56 -070086 /*
87 * Transition happens when second level auth is successful and keys are
88 * properly installed
89 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080090 WLAN_STA_AUTHENTICATED,
91
92 /* Transition happens when connectivity is lost */
93 WLAN_STA_DISCONNECTED,
94
95 WLAN_STA_MAX_STATE
96};
97
98struct wlan_txrx_stats {
99 /* Define various txrx stats here */
100};
101
102struct ol_txrx_vdev_t;
103
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530104QDF_STATUS wlan_register_mgmt_client(void *pdev_txrx,
105 QDF_STATUS (*rx_mgmt)(void *g_cdsctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800106 void *buf));
107
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800108/* If RSSI realm is changed, send notification to Clients, SME, HDD */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530109typedef QDF_STATUS (*wlan_txrx_rssi_cross_thresh)(void *adapter, u8 rssi,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800110 void *usr_ctx,
111 int8_t avg_rssi);
112
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800113/* Rx callback registered with txrx */
Nirav Shahcbc6d722016-03-01 16:24:53 +0530114typedef int (*wlan_txrx_cb_type)(void *g_cdsctx, qdf_nbuf_t buf, u8 sta_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800115 struct txrx_rx_metainfo *rx_meta_info);
116
117static inline int wlan_txrx_get_rssi(void *g_cdsctx, u8 sta_id, int8_t *rssi)
118{
119 return 0;
120}
121
122static inline int wlan_txrx_enable_uapsd_ac(void *g_cdsctx, u8 sta_id,
123 enum txrx_wmm_ac ac, u8 tid, u8 up,
124 u32 srv_int, u32 suspend_int,
125 enum wlan_ts_direction ts_dir)
126{
127 return 0;
128}
129
130static inline int wlan_txrx_disable_uapsd_ac(void *g_cdsctx, u8 sta_id,
131 enum txrx_wmm_ac ac)
132{
133 return 0;
134}
135
136static inline int wlan_change_sta_state(void *g_cdsctx, u8 sta_id,
137 enum wlan_sta_state state)
138{
139 return 0;
140}
141
142static inline int wlan_deregister_mgmt_client(void *g_cdsctx)
143{
144 return 0;
145}
146
147static inline void wlan_assoc_failed(u8 staid)
148{
149}
150
151static inline int wlan_get_ap_stats(void *g_cdsctx, tSap_SoftapStats *buf,
152 bool reset)
153{
154 return 0;
155}
156
157static inline int wlan_get_txrx_stats(void *g_cdsctx,
158 struct wlan_txrx_stats *stats, u8 sta_id)
159{
160 return 0;
161}
162
163static inline int wlan_txrx_update_rssi_bmps(void *g_cdsctx, u8 sta_id,
164 int8_t rssi)
165{
166 return 0;
167}
168
169static inline int wlan_txrx_deregister_rssi_indcb(void *g_cdsctx,
170 int8_t rssi_val,
171 u8 trigger_event,
172 wlan_txrx_rssi_cross_thresh
173 cb, int mod_id)
174{
175 return 0;
176}
177
178static inline int wlan_txrx_register_rssi_indcb(void *g_cdsctx,
179 int8_t rssi_val,
180 u8 trigger_event,
181 wlan_txrx_rssi_cross_thresh cb,
182 int mod_id, void *usr_ctx)
183{
184 return 0;
185}
186
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800187#endif