blob: 5b2da4f58ad8cf1a50a15188556f8be76e822b07 [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 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef TXRX_H
29#define TXRX_H
30
31#include "cds_api.h"
Nirav Shahcbc6d722016-03-01 16:24:53 +053032#include "qdf_nbuf.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080033#include "csr_api.h"
34#include "sap_api.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080035#include "ol_txrx_osif_api.h"
36
37/* wait on peer deletion timeout value in milliseconds */
38#define PEER_DELETION_TIMEOUT 500
39
40enum txrx_wmm_ac {
41 TXRX_WMM_AC_VO,
42 TXRX_WMM_AC_VI,
43 TXRX_WMM_AC_BK,
44 TXRX_WMM_AC_BE,
45
46 TXRX_NUM_WMM_AC
47};
48
49struct txrx_rx_metainfo {
50 u8 up;
51 u16 dest_staid;
52};
53
54enum bt_frame_type {
55 /* BT-AMP packet of type data */
56 TXRX_BT_AMP_TYPE_DATA = 0x0001,
57
58 /* BT-AMP packet of type activity report */
59 TXRX_BT_AMP_TYPE_AR = 0x0002,
60
61 /* BT-AMP packet of type security frame */
62 TXRX_BT_AMP_TYPE_SEC = 0x0003,
63
64 /* BT-AMP packet of type Link Supervision request frame */
65 TXRX_BT_AMP_TYPE_LS_REQ = 0x0004,
66
67 /* BT-AMP packet of type Link Supervision reply frame */
68 TXRX_BT_AMP_TYPE_LS_REP = 0x0005,
69
70 /* Invalid Frame */
71 TXRX_BAP_INVALID_FRAME
72};
73
74enum wlan_ts_direction {
75 /* uplink */
76 WLAN_TX_DIR = 0,
77
78 /* downlink */
79 WLAN_RX_DIR = 1,
80
81 /*bidirectional */
82 WLAN_BI_DIR = 2,
83};
84
85enum wlan_sta_state {
86 /* Transition in this state made upon creation */
87 WLAN_STA_INIT = 0,
88
89 /* Transition happens after Assoc success if second level authentication
90 is needed */
91 WLAN_STA_CONNECTED,
92
93 /* Transition happens when second level auth is successful and keys are
94 properly installed */
95 WLAN_STA_AUTHENTICATED,
96
97 /* Transition happens when connectivity is lost */
98 WLAN_STA_DISCONNECTED,
99
100 WLAN_STA_MAX_STATE
101};
102
103struct wlan_txrx_stats {
104 /* Define various txrx stats here */
105};
106
107struct ol_txrx_vdev_t;
108
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530109QDF_STATUS wlan_register_mgmt_client(void *pdev_txrx,
110 QDF_STATUS (*rx_mgmt)(void *g_cdsctx,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800111 void *buf));
112
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800113/* If RSSI realm is changed, send notification to Clients, SME, HDD */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530114typedef QDF_STATUS (*wlan_txrx_rssi_cross_thresh)(void *adapter, u8 rssi,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800115 void *usr_ctx,
116 int8_t avg_rssi);
117
118struct wlan_txrx_ind_req {
119 u16 msgType; /* message type is same as the request type */
120 u16 msgLen; /* length of the entire request */
121 u8 sessionId; /* sme Session Id */
122 u8 rssiNotification;
123 u8 avgRssi;
124 void *tlCallback;
125 void *pAdapter;
126 void *pUserCtxt;
127};
128
129
130/* Rx callback registered with txrx */
Nirav Shahcbc6d722016-03-01 16:24:53 +0530131typedef int (*wlan_txrx_cb_type)(void *g_cdsctx, qdf_nbuf_t buf, u8 sta_id,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800132 struct txrx_rx_metainfo *rx_meta_info);
133
134static inline int wlan_txrx_get_rssi(void *g_cdsctx, u8 sta_id, int8_t *rssi)
135{
136 return 0;
137}
138
139static inline int wlan_txrx_enable_uapsd_ac(void *g_cdsctx, u8 sta_id,
140 enum txrx_wmm_ac ac, u8 tid, u8 up,
141 u32 srv_int, u32 suspend_int,
142 enum wlan_ts_direction ts_dir)
143{
144 return 0;
145}
146
147static inline int wlan_txrx_disable_uapsd_ac(void *g_cdsctx, u8 sta_id,
148 enum txrx_wmm_ac ac)
149{
150 return 0;
151}
152
153static inline int wlan_change_sta_state(void *g_cdsctx, u8 sta_id,
154 enum wlan_sta_state state)
155{
156 return 0;
157}
158
159static inline int wlan_deregister_mgmt_client(void *g_cdsctx)
160{
161 return 0;
162}
163
164static inline void wlan_assoc_failed(u8 staid)
165{
166}
167
168static inline int wlan_get_ap_stats(void *g_cdsctx, tSap_SoftapStats *buf,
169 bool reset)
170{
171 return 0;
172}
173
174static inline int wlan_get_txrx_stats(void *g_cdsctx,
175 struct wlan_txrx_stats *stats, u8 sta_id)
176{
177 return 0;
178}
179
180static inline int wlan_txrx_update_rssi_bmps(void *g_cdsctx, u8 sta_id,
181 int8_t rssi)
182{
183 return 0;
184}
185
186static inline int wlan_txrx_deregister_rssi_indcb(void *g_cdsctx,
187 int8_t rssi_val,
188 u8 trigger_event,
189 wlan_txrx_rssi_cross_thresh
190 cb, int mod_id)
191{
192 return 0;
193}
194
195static inline int wlan_txrx_register_rssi_indcb(void *g_cdsctx,
196 int8_t rssi_val,
197 u8 trigger_event,
198 wlan_txrx_rssi_cross_thresh cb,
199 int mod_id, void *usr_ctx)
200{
201 return 0;
202}
203
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800204#endif