Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Rajeev Kumar | 229f1d3 | 2017-01-21 16:05:19 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | #ifndef TXRX_H |
| 20 | #define TXRX_H |
| 21 | |
| 22 | #include "cds_api.h" |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 23 | #include "qdf_nbuf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 24 | #include "csr_api.h" |
| 25 | #include "sap_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 26 | #include "ol_txrx_osif_api.h" |
| 27 | |
| 28 | /* wait on peer deletion timeout value in milliseconds */ |
| 29 | #define PEER_DELETION_TIMEOUT 500 |
| 30 | |
| 31 | enum txrx_wmm_ac { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 32 | TXRX_WMM_AC_BE, |
hqu | c7f560c | 2017-06-26 17:14:37 +0800 | [diff] [blame] | 33 | TXRX_WMM_AC_BK, |
| 34 | TXRX_WMM_AC_VI, |
| 35 | TXRX_WMM_AC_VO, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 36 | |
| 37 | TXRX_NUM_WMM_AC |
| 38 | }; |
| 39 | |
| 40 | struct txrx_rx_metainfo { |
| 41 | u8 up; |
| 42 | u16 dest_staid; |
| 43 | }; |
| 44 | |
| 45 | enum 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 | |
| 65 | enum 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 | |
| 76 | enum wlan_sta_state { |
| 77 | /* Transition in this state made upon creation */ |
| 78 | WLAN_STA_INIT = 0, |
| 79 | |
Yun Park | 1239b22 | 2017-04-06 22:31:56 -0700 | [diff] [blame] | 80 | /* |
| 81 | * Transition happens after Assoc success if second level authentication |
| 82 | * is needed |
| 83 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | WLAN_STA_CONNECTED, |
| 85 | |
Yun Park | 1239b22 | 2017-04-06 22:31:56 -0700 | [diff] [blame] | 86 | /* |
| 87 | * Transition happens when second level auth is successful and keys are |
| 88 | * properly installed |
| 89 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 90 | WLAN_STA_AUTHENTICATED, |
| 91 | |
| 92 | /* Transition happens when connectivity is lost */ |
| 93 | WLAN_STA_DISCONNECTED, |
| 94 | |
| 95 | WLAN_STA_MAX_STATE |
| 96 | }; |
| 97 | |
| 98 | struct wlan_txrx_stats { |
| 99 | /* Define various txrx stats here */ |
| 100 | }; |
| 101 | |
| 102 | struct ol_txrx_vdev_t; |
| 103 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 104 | QDF_STATUS wlan_register_mgmt_client(void *pdev_txrx, |
| 105 | QDF_STATUS (*rx_mgmt)(void *g_cdsctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 106 | void *buf)); |
| 107 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 108 | /* If RSSI realm is changed, send notification to Clients, SME, HDD */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 109 | typedef QDF_STATUS (*wlan_txrx_rssi_cross_thresh)(void *adapter, u8 rssi, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 110 | void *usr_ctx, |
| 111 | int8_t avg_rssi); |
| 112 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 113 | /* Rx callback registered with txrx */ |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 114 | typedef int (*wlan_txrx_cb_type)(void *g_cdsctx, qdf_nbuf_t buf, u8 sta_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 115 | struct txrx_rx_metainfo *rx_meta_info); |
| 116 | |
| 117 | static inline int wlan_txrx_get_rssi(void *g_cdsctx, u8 sta_id, int8_t *rssi) |
| 118 | { |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | static 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 | |
| 130 | static 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 | |
| 136 | static inline int wlan_change_sta_state(void *g_cdsctx, u8 sta_id, |
| 137 | enum wlan_sta_state state) |
| 138 | { |
| 139 | return 0; |
| 140 | } |
| 141 | |
| 142 | static inline int wlan_deregister_mgmt_client(void *g_cdsctx) |
| 143 | { |
| 144 | return 0; |
| 145 | } |
| 146 | |
| 147 | static inline void wlan_assoc_failed(u8 staid) |
| 148 | { |
| 149 | } |
| 150 | |
| 151 | static inline int wlan_get_ap_stats(void *g_cdsctx, tSap_SoftapStats *buf, |
| 152 | bool reset) |
| 153 | { |
| 154 | return 0; |
| 155 | } |
| 156 | |
| 157 | static inline int wlan_get_txrx_stats(void *g_cdsctx, |
| 158 | struct wlan_txrx_stats *stats, u8 sta_id) |
| 159 | { |
| 160 | return 0; |
| 161 | } |
| 162 | |
| 163 | static inline int wlan_txrx_update_rssi_bmps(void *g_cdsctx, u8 sta_id, |
| 164 | int8_t rssi) |
| 165 | { |
| 166 | return 0; |
| 167 | } |
| 168 | |
| 169 | static 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 | |
| 178 | static 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 Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 187 | #endif |