Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Marvell Wireless LAN device driver: major data structures and prototypes |
| 3 | * |
Xinming Hu | 65da33f | 2014-06-19 21:38:57 -0700 | [diff] [blame] | 4 | * Copyright (C) 2011-2014, Marvell International Ltd. |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 5 | * |
| 6 | * This software file (the "File") is distributed by Marvell International |
| 7 | * Ltd. under the terms of the GNU General Public License Version 2, June 1991 |
| 8 | * (the "License"). You may use, redistribute and/or modify this File in |
| 9 | * accordance with the terms and conditions of the License, a copy of which |
| 10 | * is available by writing to the Free Software Foundation, Inc., |
| 11 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the |
| 12 | * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. |
| 13 | * |
| 14 | * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE |
| 16 | * ARE EXPRESSLY DISCLAIMED. The License provides additional details about |
| 17 | * this warranty disclaimer. |
| 18 | */ |
| 19 | |
| 20 | #ifndef _MWIFIEX_MAIN_H_ |
| 21 | #define _MWIFIEX_MAIN_H_ |
| 22 | |
| 23 | #include <linux/kernel.h> |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/sched.h> |
| 26 | #include <linux/semaphore.h> |
| 27 | #include <linux/ip.h> |
| 28 | #include <linux/skbuff.h> |
| 29 | #include <linux/if_arp.h> |
| 30 | #include <linux/etherdevice.h> |
| 31 | #include <net/sock.h> |
| 32 | #include <net/lib80211.h> |
Amitkumar Karwar | 92c2538 | 2014-06-19 21:38:52 -0700 | [diff] [blame] | 33 | #include <linux/vmalloc.h> |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 34 | #include <linux/firmware.h> |
| 35 | #include <linux/ctype.h> |
Bing Zhao | 699b027 | 2013-12-13 18:33:01 -0800 | [diff] [blame] | 36 | #include <linux/of.h> |
Amitkumar Karwar | 808bbeb | 2014-11-25 06:43:05 -0800 | [diff] [blame] | 37 | #include <linux/idr.h> |
Maithili Hinge | b533be1 | 2015-03-12 00:38:39 -0700 | [diff] [blame] | 38 | #include <linux/inetdevice.h> |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 39 | |
| 40 | #include "decl.h" |
| 41 | #include "ioctl.h" |
| 42 | #include "util.h" |
| 43 | #include "fw.h" |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 44 | #include "pcie.h" |
Xinming Hu | 11cd07a | 2014-12-23 19:14:10 +0530 | [diff] [blame] | 45 | #include "usb.h" |
| 46 | #include "sdio.h" |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 47 | |
| 48 | extern const char driver_version[]; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 49 | |
| 50 | enum { |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 51 | MWIFIEX_ASYNC_CMD, |
| 52 | MWIFIEX_SYNC_CMD |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 53 | }; |
| 54 | |
Avinash Patil | 0013c7c | 2014-11-05 19:38:11 +0530 | [diff] [blame] | 55 | #define MWIFIEX_DRIVER_MODE_STA BIT(0) |
| 56 | #define MWIFIEX_DRIVER_MODE_UAP BIT(1) |
| 57 | #define MWIFIEX_DRIVER_MODE_P2P BIT(2) |
| 58 | #define MWIFIEX_DRIVER_MODE_BITMASK (BIT(0) | BIT(1) | BIT(2)) |
| 59 | |
Bing Zhao | 67a5003 | 2011-07-13 18:38:34 -0700 | [diff] [blame] | 60 | #define MWIFIEX_MAX_AP 64 |
| 61 | |
Zhaoyang Liu | e35000e | 2015-03-13 17:37:57 +0530 | [diff] [blame] | 62 | #define MWIFIEX_MAX_PKTS_TXQ 16 |
| 63 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 64 | #define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ) |
| 65 | |
| 66 | #define MWIFIEX_TIMER_10S 10000 |
| 67 | #define MWIFIEX_TIMER_1S 1000 |
| 68 | |
Marc Yang | 62a5b7d | 2011-05-16 19:17:53 -0700 | [diff] [blame] | 69 | #define MAX_TX_PENDING 100 |
| 70 | #define LOW_TX_PENDING 80 |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 71 | |
Avinash Patil | 6e25117 | 2014-09-12 20:08:59 +0530 | [diff] [blame] | 72 | #define HIGH_RX_PENDING 50 |
| 73 | #define LOW_RX_PENDING 20 |
| 74 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 75 | #define MWIFIEX_UPLD_SIZE (2312) |
| 76 | |
Amitkumar Karwar | 21f58d20 | 2014-02-11 18:39:56 -0800 | [diff] [blame] | 77 | #define MAX_EVENT_SIZE 2048 |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 78 | |
| 79 | #define ARP_FILTER_MAX_BUF_SIZE 68 |
| 80 | |
| 81 | #define MWIFIEX_KEY_BUFFER_SIZE 16 |
| 82 | #define MWIFIEX_DEFAULT_LISTEN_INTERVAL 10 |
| 83 | #define MWIFIEX_MAX_REGION_CODE 7 |
| 84 | |
| 85 | #define DEFAULT_BCN_AVG_FACTOR 8 |
| 86 | #define DEFAULT_DATA_AVG_FACTOR 8 |
| 87 | |
| 88 | #define FIRST_VALID_CHANNEL 0xff |
| 89 | #define DEFAULT_AD_HOC_CHANNEL 6 |
| 90 | #define DEFAULT_AD_HOC_CHANNEL_A 36 |
| 91 | |
| 92 | #define DEFAULT_BCN_MISS_TIMEOUT 5 |
| 93 | |
| 94 | #define MAX_SCAN_BEACON_BUFFER 8000 |
| 95 | |
| 96 | #define SCAN_BEACON_ENTRY_PAD 6 |
| 97 | |
Bing Zhao | 38e8b7d9 | 2012-06-06 21:12:40 -0700 | [diff] [blame] | 98 | #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110 |
| 99 | #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 30 |
| 100 | #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 30 |
Avinash Patil | cb91be8 | 2014-09-12 20:08:54 +0530 | [diff] [blame] | 101 | #define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50 |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 102 | |
| 103 | #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI))) |
| 104 | |
| 105 | #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S) |
| 106 | |
| 107 | #define RSN_GTK_OUI_OFFSET 2 |
| 108 | |
| 109 | #define MWIFIEX_OUI_NOT_PRESENT 0 |
| 110 | #define MWIFIEX_OUI_PRESENT 1 |
| 111 | |
Stone Piao | e39faa7 | 2012-09-25 20:23:32 -0700 | [diff] [blame] | 112 | #define PKT_TYPE_MGMT 0xE5 |
| 113 | |
Amitkumar Karwar | 4daffe3 | 2012-04-18 20:08:28 -0700 | [diff] [blame] | 114 | /* |
| 115 | * Do not check for data_received for USB, as data_received |
| 116 | * is handled in mwifiex_usb_recv for USB |
| 117 | */ |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 118 | #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \ |
Amitkumar Karwar | 4daffe3 | 2012-04-18 20:08:28 -0700 | [diff] [blame] | 119 | adapter->event_received || \ |
Avinash Patil | ec4a16b | 2014-11-05 17:04:27 +0530 | [diff] [blame] | 120 | adapter->data_received) |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 121 | |
| 122 | #define MWIFIEX_TYPE_CMD 1 |
| 123 | #define MWIFIEX_TYPE_DATA 0 |
Zhaoyang Liu | 92263a8 | 2015-03-13 17:37:58 +0530 | [diff] [blame^] | 124 | #define MWIFIEX_TYPE_AGGR_DATA 10 |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 125 | #define MWIFIEX_TYPE_EVENT 3 |
| 126 | |
Amitkumar Karwar | a0b7315a | 2014-03-07 19:41:27 -0800 | [diff] [blame] | 127 | #define MAX_BITMAP_RATES_SIZE 18 |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 128 | |
| 129 | #define MAX_CHANNEL_BAND_BG 14 |
Avinash Patil | a3c2c4f | 2012-08-27 20:32:53 -0700 | [diff] [blame] | 130 | #define MAX_CHANNEL_BAND_A 165 |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 131 | |
| 132 | #define MAX_FREQUENCY_BAND_BG 2484 |
| 133 | |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 134 | #define MWIFIEX_EVENT_HEADER_LEN 4 |
Avinash Patil | e568634 | 2012-05-08 18:30:25 -0700 | [diff] [blame] | 135 | #define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2 |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 136 | |
Amitkumar Karwar | 4daffe3 | 2012-04-18 20:08:28 -0700 | [diff] [blame] | 137 | #define MWIFIEX_TYPE_LEN 4 |
| 138 | #define MWIFIEX_USB_TYPE_CMD 0xF00DFACE |
| 139 | #define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE |
| 140 | #define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE |
| 141 | |
Ashok Nagarajan | 8908c7d | 2013-03-08 10:58:45 -0800 | [diff] [blame] | 142 | /* Threshold for tx_timeout_cnt before we trigger a card reset */ |
| 143 | #define TX_TIMEOUT_THRESHOLD 6 |
| 144 | |
Xinming Hu | 11cd07a | 2014-12-23 19:14:10 +0530 | [diff] [blame] | 145 | #define MWIFIEX_DRV_INFO_SIZE_MAX 0x40000 |
| 146 | |
Avinash Patil | 31def91 | 2015-02-13 17:41:08 +0530 | [diff] [blame] | 147 | /* Address alignment */ |
| 148 | #define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1)) |
| 149 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 150 | struct mwifiex_dbg { |
| 151 | u32 num_cmd_host_to_card_failure; |
| 152 | u32 num_cmd_sleep_cfm_host_to_card_failure; |
| 153 | u32 num_tx_host_to_card_failure; |
| 154 | u32 num_event_deauth; |
| 155 | u32 num_event_disassoc; |
| 156 | u32 num_event_link_lost; |
| 157 | u32 num_cmd_deauth; |
| 158 | u32 num_cmd_assoc_success; |
| 159 | u32 num_cmd_assoc_failure; |
| 160 | u32 num_tx_timeout; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 161 | u16 timeout_cmd_id; |
| 162 | u16 timeout_cmd_act; |
| 163 | u16 last_cmd_id[DBG_CMD_NUM]; |
| 164 | u16 last_cmd_act[DBG_CMD_NUM]; |
| 165 | u16 last_cmd_index; |
| 166 | u16 last_cmd_resp_id[DBG_CMD_NUM]; |
| 167 | u16 last_cmd_resp_index; |
| 168 | u16 last_event[DBG_CMD_NUM]; |
| 169 | u16 last_event_index; |
| 170 | }; |
| 171 | |
| 172 | enum MWIFIEX_HARDWARE_STATUS { |
| 173 | MWIFIEX_HW_STATUS_READY, |
| 174 | MWIFIEX_HW_STATUS_INITIALIZING, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 175 | MWIFIEX_HW_STATUS_INIT_DONE, |
| 176 | MWIFIEX_HW_STATUS_RESET, |
| 177 | MWIFIEX_HW_STATUS_CLOSING, |
| 178 | MWIFIEX_HW_STATUS_NOT_READY |
| 179 | }; |
| 180 | |
| 181 | enum MWIFIEX_802_11_POWER_MODE { |
| 182 | MWIFIEX_802_11_POWER_MODE_CAM, |
| 183 | MWIFIEX_802_11_POWER_MODE_PSP |
| 184 | }; |
| 185 | |
| 186 | struct mwifiex_tx_param { |
| 187 | u32 next_pkt_len; |
| 188 | }; |
| 189 | |
| 190 | enum MWIFIEX_PS_STATE { |
| 191 | PS_STATE_AWAKE, |
| 192 | PS_STATE_PRE_SLEEP, |
| 193 | PS_STATE_SLEEP_CFM, |
| 194 | PS_STATE_SLEEP |
| 195 | }; |
| 196 | |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 197 | enum mwifiex_iface_type { |
| 198 | MWIFIEX_SDIO, |
| 199 | MWIFIEX_PCIE, |
Amitkumar Karwar | 4daffe3 | 2012-04-18 20:08:28 -0700 | [diff] [blame] | 200 | MWIFIEX_USB |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 201 | }; |
| 202 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 203 | struct mwifiex_add_ba_param { |
| 204 | u32 tx_win_size; |
| 205 | u32 rx_win_size; |
| 206 | u32 timeout; |
Amitkumar Karwar | 4c9f9fb | 2014-03-07 19:41:31 -0800 | [diff] [blame] | 207 | u8 tx_amsdu; |
| 208 | u8 rx_amsdu; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 209 | }; |
| 210 | |
| 211 | struct mwifiex_tx_aggr { |
| 212 | u8 ampdu_user; |
| 213 | u8 ampdu_ap; |
| 214 | u8 amsdu; |
| 215 | }; |
| 216 | |
Zhaoyang Liu | 39df5e8 | 2015-03-13 17:37:55 +0530 | [diff] [blame] | 217 | enum mwifiex_ba_status { |
| 218 | BA_SETUP_NONE = 0, |
| 219 | BA_SETUP_INPROGRESS, |
| 220 | BA_SETUP_COMPLETE |
| 221 | }; |
| 222 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 223 | struct mwifiex_ra_list_tbl { |
| 224 | struct list_head list; |
| 225 | struct sk_buff_head skb_head; |
| 226 | u8 ra[ETH_ALEN]; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 227 | u32 is_11n_enabled; |
Avinash Patil | 5a009ad | 2012-08-03 18:06:10 -0700 | [diff] [blame] | 228 | u16 max_amsdu; |
Avinash Patil | f0cb84f | 2013-07-22 19:17:39 -0700 | [diff] [blame] | 229 | u16 ba_pkt_count; |
Avinash Patil | 5a009ad | 2012-08-03 18:06:10 -0700 | [diff] [blame] | 230 | u8 ba_packet_thr; |
Zhaoyang Liu | 39df5e8 | 2015-03-13 17:37:55 +0530 | [diff] [blame] | 231 | enum mwifiex_ba_status ba_status; |
| 232 | u8 amsdu_in_ampdu; |
Avinash Patil | c7d9ed9 | 2013-07-22 19:17:40 -0700 | [diff] [blame] | 233 | u16 total_pkt_count; |
Avinash Patil | daeb5bb | 2014-02-07 16:30:37 -0800 | [diff] [blame] | 234 | bool tdls_link; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 235 | }; |
| 236 | |
| 237 | struct mwifiex_tid_tbl { |
| 238 | struct list_head ra_list; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 239 | }; |
| 240 | |
| 241 | #define WMM_HIGHEST_PRIORITY 7 |
| 242 | #define HIGH_PRIO_TID 7 |
| 243 | #define LOW_PRIO_TID 0 |
| 244 | |
| 245 | struct mwifiex_wmm_desc { |
| 246 | struct mwifiex_tid_tbl tid_tbl_ptr[MAX_NUM_TID]; |
| 247 | u32 packets_out[MAX_NUM_TID]; |
| 248 | /* spin lock to protect ra_list */ |
| 249 | spinlock_t ra_list_spinlock; |
Johannes Berg | 99fec5d | 2012-03-27 14:07:59 +0200 | [diff] [blame] | 250 | struct mwifiex_wmm_ac_status ac_status[IEEE80211_NUM_ACS]; |
| 251 | enum mwifiex_wmm_ac_e ac_down_graded_vals[IEEE80211_NUM_ACS]; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 252 | u32 drv_pkt_delay_max; |
Johannes Berg | 99fec5d | 2012-03-27 14:07:59 +0200 | [diff] [blame] | 253 | u8 queue_priority[IEEE80211_NUM_ACS]; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 254 | u32 user_pri_pkt_tx_ctrl[WMM_HIGHEST_PRIORITY + 1]; /* UP: 0 to 7 */ |
Marc Yang | f699254 | 2011-05-16 19:17:49 -0700 | [diff] [blame] | 255 | /* Number of transmit packets queued */ |
| 256 | atomic_t tx_pkts_queued; |
Marc Yang | 49729ff | 2011-05-16 19:17:50 -0700 | [diff] [blame] | 257 | /* Tracks highest priority with a packet queued */ |
| 258 | atomic_t highest_queued_prio; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 259 | }; |
| 260 | |
| 261 | struct mwifiex_802_11_security { |
| 262 | u8 wpa_enabled; |
| 263 | u8 wpa2_enabled; |
| 264 | u8 wapi_enabled; |
| 265 | u8 wapi_key_on; |
Amitkumar Karwar | 5eb02e4 | 2012-02-24 21:36:04 -0800 | [diff] [blame] | 266 | u8 wep_enabled; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 267 | u32 authentication_mode; |
Amitkumar Karwar | a0f6d6c | 2012-02-24 21:36:05 -0800 | [diff] [blame] | 268 | u8 is_authtype_auto; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 269 | u32 encryption_mode; |
| 270 | }; |
| 271 | |
| 272 | struct ieee_types_header { |
| 273 | u8 element_id; |
| 274 | u8 len; |
| 275 | } __packed; |
| 276 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 277 | struct ieee_types_vendor_specific { |
| 278 | struct ieee_types_vendor_header vend_hdr; |
| 279 | u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)]; |
| 280 | } __packed; |
| 281 | |
| 282 | struct ieee_types_generic { |
| 283 | struct ieee_types_header ieee_hdr; |
| 284 | u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_header)]; |
| 285 | } __packed; |
| 286 | |
Avinash Patil | b23bce2 | 2014-02-07 16:27:32 -0800 | [diff] [blame] | 287 | struct ieee_types_bss_co_2040 { |
| 288 | struct ieee_types_header ieee_hdr; |
| 289 | u8 bss_2040co; |
| 290 | } __packed; |
| 291 | |
| 292 | struct ieee_types_extcap { |
| 293 | struct ieee_types_header ieee_hdr; |
| 294 | u8 ext_capab[8]; |
| 295 | } __packed; |
| 296 | |
Avinash Patil | 5f6d598 | 2014-02-07 16:30:39 -0800 | [diff] [blame] | 297 | struct ieee_types_vht_cap { |
| 298 | struct ieee_types_header ieee_hdr; |
| 299 | struct ieee80211_vht_cap vhtcap; |
| 300 | } __packed; |
| 301 | |
| 302 | struct ieee_types_vht_oper { |
| 303 | struct ieee_types_header ieee_hdr; |
| 304 | struct ieee80211_vht_operation vhtoper; |
| 305 | } __packed; |
| 306 | |
| 307 | struct ieee_types_aid { |
| 308 | struct ieee_types_header ieee_hdr; |
| 309 | u16 aid; |
| 310 | } __packed; |
| 311 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 312 | struct mwifiex_bssdescriptor { |
| 313 | u8 mac_address[ETH_ALEN]; |
Amitkumar Karwar | b9be5f3 | 2012-02-27 22:04:14 -0800 | [diff] [blame] | 314 | struct cfg80211_ssid ssid; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 315 | u32 privacy; |
| 316 | s32 rssi; |
| 317 | u32 channel; |
| 318 | u32 freq; |
| 319 | u16 beacon_period; |
| 320 | u8 erp_flags; |
| 321 | u32 bss_mode; |
| 322 | u8 supported_rates[MWIFIEX_SUPPORTED_RATES]; |
| 323 | u8 data_rates[MWIFIEX_SUPPORTED_RATES]; |
| 324 | /* Network band. |
| 325 | * BAND_B(0x01): 'b' band |
| 326 | * BAND_G(0x02): 'g' band |
| 327 | * BAND_A(0X04): 'a' band |
| 328 | */ |
| 329 | u16 bss_band; |
Amitkumar Karwar | b5abcf0 | 2012-04-16 21:36:52 -0700 | [diff] [blame] | 330 | u64 fw_tsf; |
| 331 | u64 timestamp; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 332 | union ieee_types_phy_param_set phy_param_set; |
| 333 | union ieee_types_ss_param_set ss_param_set; |
| 334 | u16 cap_info_bitmap; |
| 335 | struct ieee_types_wmm_parameter wmm_ie; |
| 336 | u8 disable_11n; |
| 337 | struct ieee80211_ht_cap *bcn_ht_cap; |
| 338 | u16 ht_cap_offset; |
Johannes Berg | 074d46d | 2012-03-15 19:45:16 +0100 | [diff] [blame] | 339 | struct ieee80211_ht_operation *bcn_ht_oper; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 340 | u16 ht_info_offset; |
| 341 | u8 *bcn_bss_co_2040; |
| 342 | u16 bss_co_2040_offset; |
| 343 | u8 *bcn_ext_cap; |
| 344 | u16 ext_cap_offset; |
Yogesh Ashok Powar | a5f3905 | 2013-02-15 21:44:30 -0800 | [diff] [blame] | 345 | struct ieee80211_vht_cap *bcn_vht_cap; |
| 346 | u16 vht_cap_offset; |
| 347 | struct ieee80211_vht_operation *bcn_vht_oper; |
| 348 | u16 vht_info_offset; |
| 349 | struct ieee_types_oper_mode_ntf *oper_mode; |
| 350 | u16 oper_mode_offset; |
| 351 | u8 disable_11ac; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 352 | struct ieee_types_vendor_specific *bcn_wpa_ie; |
| 353 | u16 wpa_offset; |
| 354 | struct ieee_types_generic *bcn_rsn_ie; |
| 355 | u16 rsn_offset; |
| 356 | struct ieee_types_generic *bcn_wapi_ie; |
| 357 | u16 wapi_offset; |
| 358 | u8 *beacon_buf; |
| 359 | u32 beacon_buf_size; |
Amitkumar Karwar | 2a7305c | 2013-06-19 08:49:05 -0700 | [diff] [blame] | 360 | u8 sensed_11h; |
| 361 | u8 local_constraint; |
| 362 | u8 chan_sw_ie_present; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 363 | }; |
| 364 | |
| 365 | struct mwifiex_current_bss_params { |
| 366 | struct mwifiex_bssdescriptor bss_descriptor; |
| 367 | u8 wmm_enabled; |
| 368 | u8 wmm_uapsd_enabled; |
| 369 | u8 band; |
| 370 | u32 num_of_rates; |
| 371 | u8 data_rates[MWIFIEX_SUPPORTED_RATES]; |
| 372 | }; |
| 373 | |
| 374 | struct mwifiex_sleep_params { |
| 375 | u16 sp_error; |
| 376 | u16 sp_offset; |
| 377 | u16 sp_stable_time; |
| 378 | u8 sp_cal_control; |
| 379 | u8 sp_ext_sleep_clk; |
| 380 | u16 sp_reserved; |
| 381 | }; |
| 382 | |
| 383 | struct mwifiex_sleep_period { |
| 384 | u16 period; |
| 385 | u16 reserved; |
| 386 | }; |
| 387 | |
| 388 | struct mwifiex_wep_key { |
| 389 | u32 length; |
| 390 | u32 key_index; |
| 391 | u32 key_length; |
| 392 | u8 key_material[MWIFIEX_KEY_BUFFER_SIZE]; |
| 393 | }; |
| 394 | |
| 395 | #define MAX_REGION_CHANNEL_NUM 2 |
| 396 | |
| 397 | struct mwifiex_chan_freq_power { |
| 398 | u16 channel; |
| 399 | u32 freq; |
| 400 | u16 max_tx_power; |
| 401 | u8 unsupported; |
| 402 | }; |
| 403 | |
| 404 | enum state_11d_t { |
| 405 | DISABLE_11D = 0, |
| 406 | ENABLE_11D = 1, |
| 407 | }; |
| 408 | |
| 409 | #define MWIFIEX_MAX_TRIPLET_802_11D 83 |
| 410 | |
| 411 | struct mwifiex_802_11d_domain_reg { |
| 412 | u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; |
| 413 | u8 no_of_triplet; |
| 414 | struct ieee80211_country_ie_triplet |
| 415 | triplet[MWIFIEX_MAX_TRIPLET_802_11D]; |
| 416 | }; |
| 417 | |
| 418 | struct mwifiex_vendor_spec_cfg_ie { |
| 419 | u16 mask; |
| 420 | u16 flag; |
| 421 | u8 ie[MWIFIEX_MAX_VSIE_LEN]; |
| 422 | }; |
| 423 | |
| 424 | struct wps { |
| 425 | u8 session_enable; |
| 426 | }; |
| 427 | |
Stone Piao | 7feb4c4 | 2012-09-25 20:23:36 -0700 | [diff] [blame] | 428 | struct mwifiex_roc_cfg { |
| 429 | u64 cookie; |
| 430 | struct ieee80211_channel chan; |
Stone Piao | 7feb4c4 | 2012-09-25 20:23:36 -0700 | [diff] [blame] | 431 | }; |
| 432 | |
Amitkumar Karwar | 92c2538 | 2014-06-19 21:38:52 -0700 | [diff] [blame] | 433 | #define MWIFIEX_FW_DUMP_IDX 0xff |
Xinming Hu | 11cd07a | 2014-12-23 19:14:10 +0530 | [diff] [blame] | 434 | #define MWIFIEX_DRV_INFO_IDX 20 |
Amitkumar Karwar | 92c2538 | 2014-06-19 21:38:52 -0700 | [diff] [blame] | 435 | #define FW_DUMP_MAX_NAME_LEN 8 |
| 436 | #define FW_DUMP_HOST_READY 0xEE |
| 437 | #define FW_DUMP_DONE 0xFF |
Amitkumar Karwar | 7e17483 | 2014-09-18 07:18:50 -0400 | [diff] [blame] | 438 | #define FW_DUMP_READ_DONE 0xFE |
Amitkumar Karwar | 92c2538 | 2014-06-19 21:38:52 -0700 | [diff] [blame] | 439 | |
| 440 | struct memory_type_mapping { |
| 441 | u8 mem_name[FW_DUMP_MAX_NAME_LEN]; |
| 442 | u8 *mem_ptr; |
| 443 | u32 mem_size; |
| 444 | u8 done_flag; |
| 445 | }; |
| 446 | |
| 447 | enum rdwr_status { |
| 448 | RDWR_STATUS_SUCCESS = 0, |
| 449 | RDWR_STATUS_FAILURE = 1, |
| 450 | RDWR_STATUS_DONE = 2 |
| 451 | }; |
| 452 | |
| 453 | enum mwifiex_iface_work_flags { |
| 454 | MWIFIEX_IFACE_WORK_FW_DUMP, |
Amitkumar Karwar | 8915d738 | 2014-06-19 21:38:53 -0700 | [diff] [blame] | 455 | MWIFIEX_IFACE_WORK_CARD_RESET, |
Amitkumar Karwar | 92c2538 | 2014-06-19 21:38:52 -0700 | [diff] [blame] | 456 | }; |
| 457 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 458 | struct mwifiex_adapter; |
| 459 | struct mwifiex_private; |
| 460 | |
| 461 | struct mwifiex_private { |
| 462 | struct mwifiex_adapter *adapter; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 463 | u8 bss_type; |
| 464 | u8 bss_role; |
| 465 | u8 bss_priority; |
| 466 | u8 bss_num; |
Avinash Patil | d6bffe8 | 2012-05-08 18:30:15 -0700 | [diff] [blame] | 467 | u8 bss_started; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 468 | u8 frame_type; |
| 469 | u8 curr_addr[ETH_ALEN]; |
| 470 | u8 media_connected; |
| 471 | u32 num_tx_timeout; |
Ashok Nagarajan | 8908c7d | 2013-03-08 10:58:45 -0800 | [diff] [blame] | 472 | /* track consecutive timeout */ |
| 473 | u8 tx_timeout_cnt; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 474 | struct net_device *netdev; |
| 475 | struct net_device_stats stats; |
| 476 | u16 curr_pkt_filter; |
| 477 | u32 bss_mode; |
| 478 | u32 pkt_tx_ctrl; |
| 479 | u16 tx_power_level; |
| 480 | u8 max_tx_power_level; |
| 481 | u8 min_tx_power_level; |
| 482 | u8 tx_rate; |
| 483 | u8 tx_htinfo; |
| 484 | u8 rxpd_htinfo; |
| 485 | u8 rxpd_rate; |
| 486 | u16 rate_bitmap; |
| 487 | u16 bitmap_rates[MAX_BITMAP_RATES_SIZE]; |
| 488 | u32 data_rate; |
| 489 | u8 is_data_rate_auto; |
| 490 | u16 bcn_avg_factor; |
| 491 | u16 data_avg_factor; |
| 492 | s16 data_rssi_last; |
| 493 | s16 data_nf_last; |
| 494 | s16 data_rssi_avg; |
| 495 | s16 data_nf_avg; |
| 496 | s16 bcn_rssi_last; |
| 497 | s16 bcn_nf_last; |
| 498 | s16 bcn_rssi_avg; |
| 499 | s16 bcn_nf_avg; |
| 500 | struct mwifiex_bssdescriptor *attempted_bss_desc; |
Amitkumar Karwar | b9be5f3 | 2012-02-27 22:04:14 -0800 | [diff] [blame] | 501 | struct cfg80211_ssid prev_ssid; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 502 | u8 prev_bssid[ETH_ALEN]; |
| 503 | struct mwifiex_current_bss_params curr_bss_params; |
| 504 | u16 beacon_period; |
Amitkumar Karwar | caf60a6 | 2012-02-02 20:48:58 -0800 | [diff] [blame] | 505 | u8 dtim_period; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 506 | u16 listen_interval; |
| 507 | u16 atim_window; |
| 508 | u8 adhoc_channel; |
| 509 | u8 adhoc_is_link_sensed; |
| 510 | u8 adhoc_state; |
| 511 | struct mwifiex_802_11_security sec_info; |
| 512 | struct mwifiex_wep_key wep_key[NUM_WEP_KEYS]; |
| 513 | u16 wep_key_curr_index; |
| 514 | u8 wpa_ie[256]; |
| 515 | u8 wpa_ie_len; |
| 516 | u8 wpa_is_gtk_set; |
| 517 | struct host_cmd_ds_802_11_key_material aes_key; |
Avinash Patil | e57f173 | 2014-02-07 16:32:35 -0800 | [diff] [blame] | 518 | struct host_cmd_ds_802_11_key_material_v2 aes_key_v2; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 519 | u8 wapi_ie[256]; |
| 520 | u8 wapi_ie_len; |
Avinash Patil | 13d7ba78 | 2012-04-09 20:06:56 -0700 | [diff] [blame] | 521 | u8 *wps_ie; |
| 522 | u8 wps_ie_len; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 523 | u8 wmm_required; |
| 524 | u8 wmm_enabled; |
| 525 | u8 wmm_qosinfo; |
| 526 | struct mwifiex_wmm_desc wmm; |
Avinash Patil | 47411a0 | 2012-11-01 18:44:16 -0700 | [diff] [blame] | 527 | atomic_t wmm_tx_pending[IEEE80211_NUM_ACS]; |
Avinash Patil | 017a92a | 2012-08-03 18:06:07 -0700 | [diff] [blame] | 528 | struct list_head sta_list; |
Avinash Patil | 9927baa | 2014-11-13 21:54:16 +0530 | [diff] [blame] | 529 | /* spin lock for associated station/TDLS peers list */ |
Avinash Patil | 017a92a | 2012-08-03 18:06:07 -0700 | [diff] [blame] | 530 | spinlock_t sta_list_spinlock; |
Avinash Patil | 9927baa | 2014-11-13 21:54:16 +0530 | [diff] [blame] | 531 | struct list_head auto_tdls_list; |
| 532 | /* spin lock for auto TDLS peer list */ |
| 533 | spinlock_t auto_tdls_lock; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 534 | struct list_head tx_ba_stream_tbl_ptr; |
| 535 | /* spin lock for tx_ba_stream_tbl_ptr queue */ |
| 536 | spinlock_t tx_ba_stream_tbl_lock; |
| 537 | struct mwifiex_tx_aggr aggr_prio_tbl[MAX_NUM_TID]; |
| 538 | struct mwifiex_add_ba_param add_ba_param; |
| 539 | u16 rx_seq[MAX_NUM_TID]; |
Avinash Patil | 41a24a2 | 2014-02-07 16:27:29 -0800 | [diff] [blame] | 540 | u8 tos_to_tid_inv[MAX_NUM_TID]; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 541 | struct list_head rx_reorder_tbl_ptr; |
| 542 | /* spin lock for rx_reorder_tbl_ptr queue */ |
| 543 | spinlock_t rx_reorder_tbl_lock; |
| 544 | /* spin lock for Rx packets */ |
| 545 | spinlock_t rx_pkt_lock; |
| 546 | |
| 547 | #define MWIFIEX_ASSOC_RSP_BUF_SIZE 500 |
| 548 | u8 assoc_rsp_buf[MWIFIEX_ASSOC_RSP_BUF_SIZE]; |
| 549 | u32 assoc_rsp_size; |
| 550 | |
| 551 | #define MWIFIEX_GENIE_BUF_SIZE 256 |
| 552 | u8 gen_ie_buf[MWIFIEX_GENIE_BUF_SIZE]; |
| 553 | u8 gen_ie_buf_len; |
| 554 | |
| 555 | struct mwifiex_vendor_spec_cfg_ie vs_ie[MWIFIEX_MAX_VSIE_NUM]; |
| 556 | |
| 557 | #define MWIFIEX_ASSOC_TLV_BUF_SIZE 256 |
| 558 | u8 assoc_tlv_buf[MWIFIEX_ASSOC_TLV_BUF_SIZE]; |
| 559 | u8 assoc_tlv_buf_len; |
| 560 | |
| 561 | u8 *curr_bcn_buf; |
| 562 | u32 curr_bcn_size; |
| 563 | /* spin lock for beacon buffer */ |
| 564 | spinlock_t curr_bcn_buf_lock; |
Avinash Patil | 4facc34 | 2015-01-28 15:42:00 +0530 | [diff] [blame] | 565 | struct wireless_dev wdev; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 566 | struct mwifiex_chan_freq_power cfp; |
| 567 | char version_str[128]; |
| 568 | #ifdef CONFIG_DEBUG_FS |
| 569 | struct dentry *dfs_dev_dir; |
| 570 | #endif |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 571 | u16 current_key_index; |
| 572 | struct semaphore async_sem; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 573 | struct cfg80211_scan_request *scan_request; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 574 | u8 cfg_bssid[6]; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 575 | struct wps wps; |
| 576 | u8 scan_block; |
Amitkumar Karwar | fa444bf | 2012-03-15 20:51:51 -0700 | [diff] [blame] | 577 | s32 cqm_rssi_thold; |
| 578 | u32 cqm_rssi_hyst; |
| 579 | u8 subsc_evt_rssi_state; |
Jeff Disher | 908fe11 | 2012-08-30 18:20:55 -0700 | [diff] [blame] | 580 | struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage; |
Avinash Patil | ede98bf | 2012-05-08 18:30:28 -0700 | [diff] [blame] | 581 | struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX]; |
Avinash Patil | f31acab | 2012-05-08 18:30:29 -0700 | [diff] [blame] | 582 | u16 beacon_idx; |
| 583 | u16 proberesp_idx; |
| 584 | u16 assocresp_idx; |
Avinash Patil | 2ade566 | 2015-01-28 15:54:20 +0530 | [diff] [blame] | 585 | u16 gen_idx; |
Avinash Patil | c825891 | 2012-08-03 18:06:05 -0700 | [diff] [blame] | 586 | u8 ap_11n_enabled; |
Yogesh Ashok Powar | a5f3905 | 2013-02-15 21:44:30 -0800 | [diff] [blame] | 587 | u8 ap_11ac_enabled; |
Stone Piao | 3cec687 | 2012-09-25 20:23:34 -0700 | [diff] [blame] | 588 | u32 mgmt_frame_mask; |
Stone Piao | 7feb4c4 | 2012-09-25 20:23:36 -0700 | [diff] [blame] | 589 | struct mwifiex_roc_cfg roc_cfg; |
Amitkumar Karwar | 75ab753 | 2013-05-17 17:50:20 -0700 | [diff] [blame] | 590 | bool scan_aborting; |
Amitkumar Karwar | b887664 | 2013-06-18 16:36:58 -0700 | [diff] [blame] | 591 | u8 csa_chan; |
| 592 | unsigned long csa_expire_time; |
Avinash Patil | 61c87304 | 2013-07-22 19:17:41 -0700 | [diff] [blame] | 593 | u8 del_list_idx; |
Avinash Patil | 587b36d | 2013-08-23 16:48:23 -0700 | [diff] [blame] | 594 | bool hs2_enabled; |
Avinash Patil | 35c739b | 2015-01-28 15:54:17 +0530 | [diff] [blame] | 595 | struct mwifiex_uap_bss_param bss_cfg; |
Avinash Patil | 1f4dfd8 | 2014-02-07 16:30:34 -0800 | [diff] [blame] | 596 | struct station_parameters *sta_params; |
Avinash Patil | 56bd24a | 2014-02-07 16:30:35 -0800 | [diff] [blame] | 597 | struct sk_buff_head tdls_txq; |
Avinash Patil | 9927baa | 2014-11-13 21:54:16 +0530 | [diff] [blame] | 598 | u8 check_tdls_tx; |
| 599 | struct timer_list auto_tdls_timer; |
| 600 | bool auto_tdls_timer_active; |
Amitkumar Karwar | 808bbeb | 2014-11-25 06:43:05 -0800 | [diff] [blame] | 601 | struct idr ack_status_frames; |
| 602 | /* spin lock for ack status */ |
| 603 | spinlock_t ack_status_lock; |
Xinming Hu | cbf6e05 | 2014-12-23 19:14:07 +0530 | [diff] [blame] | 604 | /** rx histogram data */ |
| 605 | struct mwifiex_histogram_data *hist_data; |
Avinash Patil | 85afb18 | 2015-01-28 15:54:21 +0530 | [diff] [blame] | 606 | struct cfg80211_chan_def dfs_chandef; |
| 607 | struct workqueue_struct *dfs_cac_workqueue; |
| 608 | struct delayed_work dfs_cac_work; |
Avinash Patil | 7d65203 | 2015-01-28 15:54:24 +0530 | [diff] [blame] | 609 | struct timer_list dfs_chan_switch_timer; |
| 610 | struct workqueue_struct *dfs_chan_sw_workqueue; |
| 611 | struct delayed_work dfs_chan_sw_work; |
| 612 | struct cfg80211_beacon_data beacon_after; |
Avinash Patil | cf075ea | 2015-01-28 15:54:25 +0530 | [diff] [blame] | 613 | struct mwifiex_11h_intf_state state_11h; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 614 | }; |
| 615 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 616 | |
| 617 | struct mwifiex_tx_ba_stream_tbl { |
| 618 | struct list_head list; |
| 619 | int tid; |
| 620 | u8 ra[ETH_ALEN]; |
| 621 | enum mwifiex_ba_status ba_status; |
Amitkumar Karwar | 4c9f9fb | 2014-03-07 19:41:31 -0800 | [diff] [blame] | 622 | u8 amsdu; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 623 | }; |
| 624 | |
| 625 | struct mwifiex_rx_reorder_tbl; |
| 626 | |
| 627 | struct reorder_tmr_cnxt { |
| 628 | struct timer_list timer; |
| 629 | struct mwifiex_rx_reorder_tbl *ptr; |
| 630 | struct mwifiex_private *priv; |
Marc Yang | 3a8fede1 | 2014-10-29 22:44:34 +0530 | [diff] [blame] | 631 | u8 timer_is_set; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 632 | }; |
| 633 | |
| 634 | struct mwifiex_rx_reorder_tbl { |
| 635 | struct list_head list; |
| 636 | int tid; |
| 637 | u8 ta[ETH_ALEN]; |
Paul Stewart | 8acbea6 | 2014-02-25 16:31:37 -0800 | [diff] [blame] | 638 | int init_win; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 639 | int start_win; |
| 640 | int win_size; |
| 641 | void **rx_reorder_ptr; |
| 642 | struct reorder_tmr_cnxt timer_context; |
Amitkumar Karwar | 4c9f9fb | 2014-03-07 19:41:31 -0800 | [diff] [blame] | 643 | u8 amsdu; |
Avinash Patil | 2db96c3 | 2012-09-27 19:00:10 -0700 | [diff] [blame] | 644 | u8 flags; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 645 | }; |
| 646 | |
| 647 | struct mwifiex_bss_prio_node { |
| 648 | struct list_head list; |
| 649 | struct mwifiex_private *priv; |
| 650 | }; |
| 651 | |
| 652 | struct mwifiex_bss_prio_tbl { |
| 653 | struct list_head bss_prio_head; |
| 654 | /* spin lock for bss priority */ |
| 655 | spinlock_t bss_prio_lock; |
| 656 | struct mwifiex_bss_prio_node *bss_prio_cur; |
| 657 | }; |
| 658 | |
| 659 | struct cmd_ctrl_node { |
| 660 | struct list_head list; |
| 661 | struct mwifiex_private *priv; |
| 662 | u32 cmd_oid; |
| 663 | u32 cmd_flag; |
| 664 | struct sk_buff *cmd_skb; |
| 665 | struct sk_buff *resp_skb; |
| 666 | void *data_buf; |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 667 | u32 wait_q_enabled; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 668 | struct sk_buff *skb; |
Amitkumar Karwar | efaaa8b | 2011-10-12 20:28:06 -0700 | [diff] [blame] | 669 | u8 *condition; |
| 670 | u8 cmd_wait_q_woken; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 671 | }; |
| 672 | |
Amitkumar Karwar | b5abcf0 | 2012-04-16 21:36:52 -0700 | [diff] [blame] | 673 | struct mwifiex_bss_priv { |
| 674 | u8 band; |
| 675 | u64 fw_tsf; |
| 676 | }; |
| 677 | |
Avinash Patil | 5f2caaf | 2014-02-07 16:27:33 -0800 | [diff] [blame] | 678 | struct mwifiex_tdls_capab { |
| 679 | __le16 capab; |
| 680 | u8 rates[32]; |
| 681 | u8 rates_len; |
| 682 | u8 qos_info; |
| 683 | u8 coex_2040; |
Avinash Patil | 5f6d598 | 2014-02-07 16:30:39 -0800 | [diff] [blame] | 684 | u16 aid; |
Avinash Patil | 5f2caaf | 2014-02-07 16:27:33 -0800 | [diff] [blame] | 685 | struct ieee80211_ht_cap ht_capb; |
| 686 | struct ieee80211_ht_operation ht_oper; |
| 687 | struct ieee_types_extcap extcap; |
| 688 | struct ieee_types_generic rsn_ie; |
Avinash Patil | 5f6d598 | 2014-02-07 16:30:39 -0800 | [diff] [blame] | 689 | struct ieee80211_vht_cap vhtcap; |
| 690 | struct ieee80211_vht_operation vhtoper; |
Avinash Patil | 5f2caaf | 2014-02-07 16:27:33 -0800 | [diff] [blame] | 691 | }; |
| 692 | |
| 693 | /* This is AP/TDLS specific structure which stores information |
| 694 | * about associated/peer STA |
Avinash Patil | 017a92a | 2012-08-03 18:06:07 -0700 | [diff] [blame] | 695 | */ |
| 696 | struct mwifiex_sta_node { |
| 697 | struct list_head list; |
| 698 | u8 mac_addr[ETH_ALEN]; |
| 699 | u8 is_wmm_enabled; |
| 700 | u8 is_11n_enabled; |
Avinash Patil | 5f6d598 | 2014-02-07 16:30:39 -0800 | [diff] [blame] | 701 | u8 is_11ac_enabled; |
Avinash Patil | 017a92a | 2012-08-03 18:06:07 -0700 | [diff] [blame] | 702 | u8 ampdu_sta[MAX_NUM_TID]; |
| 703 | u16 rx_seq[MAX_NUM_TID]; |
| 704 | u16 max_amsdu; |
Avinash Patil | 429d90d | 2014-02-07 16:27:34 -0800 | [diff] [blame] | 705 | u8 tdls_status; |
Avinash Patil | 5f2caaf | 2014-02-07 16:27:33 -0800 | [diff] [blame] | 706 | struct mwifiex_tdls_capab tdls_cap; |
Avinash Patil | 017a92a | 2012-08-03 18:06:07 -0700 | [diff] [blame] | 707 | }; |
| 708 | |
Avinash Patil | 9927baa | 2014-11-13 21:54:16 +0530 | [diff] [blame] | 709 | struct mwifiex_auto_tdls_peer { |
| 710 | struct list_head list; |
| 711 | u8 mac_addr[ETH_ALEN]; |
| 712 | u8 tdls_status; |
| 713 | int rssi; |
| 714 | long rssi_jiffies; |
| 715 | u8 failure_count; |
| 716 | u8 do_discover; |
| 717 | u8 do_setup; |
| 718 | }; |
| 719 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 720 | struct mwifiex_if_ops { |
| 721 | int (*init_if) (struct mwifiex_adapter *); |
| 722 | void (*cleanup_if) (struct mwifiex_adapter *); |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 723 | int (*check_fw_status) (struct mwifiex_adapter *, u32); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 724 | int (*prog_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); |
| 725 | int (*register_dev) (struct mwifiex_adapter *); |
| 726 | void (*unregister_dev) (struct mwifiex_adapter *); |
| 727 | int (*enable_int) (struct mwifiex_adapter *); |
Daniel Drake | 232fde0 | 2013-07-13 10:57:10 -0400 | [diff] [blame] | 728 | void (*disable_int) (struct mwifiex_adapter *); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 729 | int (*process_int_status) (struct mwifiex_adapter *); |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 730 | int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 731 | struct mwifiex_tx_param *); |
| 732 | int (*wakeup) (struct mwifiex_adapter *); |
| 733 | int (*wakeup_complete) (struct mwifiex_adapter *); |
| 734 | |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 735 | /* Interface specific functions */ |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 736 | void (*update_mp_end_port) (struct mwifiex_adapter *, u16); |
| 737 | void (*cleanup_mpa_buf) (struct mwifiex_adapter *); |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 738 | int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *); |
| 739 | int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *); |
Avinash Patil | c6d1d87 | 2013-01-03 21:21:29 -0800 | [diff] [blame] | 740 | int (*init_fw_port) (struct mwifiex_adapter *); |
Amitkumar Karwar | 4daffe3 | 2012-04-18 20:08:28 -0700 | [diff] [blame] | 741 | int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); |
Amitkumar Karwar | d31ab35 | 2012-11-01 18:44:14 -0700 | [diff] [blame] | 742 | void (*card_reset) (struct mwifiex_adapter *); |
Amitkumar Karwar | 1c09bf6 | 2014-04-17 11:46:59 -0700 | [diff] [blame] | 743 | void (*fw_dump)(struct mwifiex_adapter *); |
Xinming Hu | 809c6ea | 2014-12-23 19:14:11 +0530 | [diff] [blame] | 744 | int (*reg_dump)(struct mwifiex_adapter *, char *); |
Avinash Patil | fbd7e7a | 2013-01-03 21:21:31 -0800 | [diff] [blame] | 745 | int (*clean_pcie_ring) (struct mwifiex_adapter *adapter); |
Amitkumar Karwar | 92c2538 | 2014-06-19 21:38:52 -0700 | [diff] [blame] | 746 | void (*iface_work)(struct work_struct *work); |
Amitkumar Karwar | cf6a64f | 2014-11-05 17:04:29 +0530 | [diff] [blame] | 747 | void (*submit_rem_rx_urbs)(struct mwifiex_adapter *adapter); |
Zhaoyang Liu | 92263a8 | 2015-03-13 17:37:58 +0530 | [diff] [blame^] | 748 | void (*deaggr_pkt)(struct mwifiex_adapter *, struct sk_buff *); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 749 | }; |
| 750 | |
| 751 | struct mwifiex_adapter { |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 752 | u8 iface_type; |
Avinash Patil | cf05233 | 2015-01-28 15:42:03 +0530 | [diff] [blame] | 753 | struct mwifiex_iface_comb iface_limit; |
| 754 | struct mwifiex_iface_comb curr_iface_comb; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 755 | struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM]; |
| 756 | u8 priv_num; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 757 | const struct firmware *firmware; |
Amitkumar Karwar | 4a7f5db | 2011-05-23 18:00:17 -0700 | [diff] [blame] | 758 | char fw_name[32]; |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 759 | int winner; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 760 | struct device *dev; |
Avinash Patil | d6bffe8 | 2012-05-08 18:30:15 -0700 | [diff] [blame] | 761 | struct wiphy *wiphy; |
Avinash Patil | 8d05eb2 | 2015-01-28 15:42:01 +0530 | [diff] [blame] | 762 | u8 perm_addr[ETH_ALEN]; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 763 | bool surprise_removed; |
| 764 | u32 fw_release_number; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 765 | u16 init_wait_q_woken; |
| 766 | wait_queue_head_t init_wait_q; |
| 767 | void *card; |
| 768 | struct mwifiex_if_ops if_ops; |
| 769 | atomic_t rx_pending; |
| 770 | atomic_t tx_pending; |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 771 | atomic_t cmd_pending; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 772 | struct workqueue_struct *workqueue; |
| 773 | struct work_struct main_work; |
Avinash Patil | 6e25117 | 2014-09-12 20:08:59 +0530 | [diff] [blame] | 774 | struct workqueue_struct *rx_workqueue; |
| 775 | struct work_struct rx_work; |
Avinash Patil | 85afb18 | 2015-01-28 15:54:21 +0530 | [diff] [blame] | 776 | struct workqueue_struct *dfs_workqueue; |
| 777 | struct work_struct dfs_work; |
Avinash Patil | 6e25117 | 2014-09-12 20:08:59 +0530 | [diff] [blame] | 778 | bool rx_work_enabled; |
| 779 | bool rx_processing; |
| 780 | bool delay_main_work; |
| 781 | bool rx_locked; |
Avinash Patil | a9adbcb | 2015-03-13 17:37:51 +0530 | [diff] [blame] | 782 | bool main_locked; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 783 | struct mwifiex_bss_prio_tbl bss_prio_tbl[MWIFIEX_MAX_BSS_NUM]; |
| 784 | /* spin lock for init/shutdown */ |
| 785 | spinlock_t mwifiex_lock; |
| 786 | /* spin lock for main process */ |
| 787 | spinlock_t main_proc_lock; |
| 788 | u32 mwifiex_processing; |
Shengzhen Li | 04c7b36 | 2015-02-11 23:12:24 +0530 | [diff] [blame] | 789 | u8 more_task_flag; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 790 | u16 tx_buf_size; |
| 791 | u16 curr_tx_buf_size; |
Zhaoyang Liu | 92263a8 | 2015-03-13 17:37:58 +0530 | [diff] [blame^] | 792 | bool sdio_rx_aggr_enable; |
| 793 | u16 sdio_rx_block_size; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 794 | u32 ioport; |
| 795 | enum MWIFIEX_HARDWARE_STATUS hw_status; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 796 | u16 number_of_antenna; |
| 797 | u32 fw_cap_info; |
| 798 | /* spin lock for interrupt handling */ |
| 799 | spinlock_t int_lock; |
| 800 | u8 int_status; |
| 801 | u32 event_cause; |
| 802 | struct sk_buff *event_skb; |
| 803 | u8 upld_buf[MWIFIEX_UPLD_SIZE]; |
| 804 | u8 data_sent; |
| 805 | u8 cmd_sent; |
| 806 | u8 cmd_resp_received; |
| 807 | u8 event_received; |
| 808 | u8 data_received; |
| 809 | u16 seq_num; |
| 810 | struct cmd_ctrl_node *cmd_pool; |
| 811 | struct cmd_ctrl_node *curr_cmd; |
| 812 | /* spin lock for command */ |
| 813 | spinlock_t mwifiex_cmd_lock; |
Amitkumar Karwar | 0c9c4a0 | 2014-02-27 19:35:17 -0800 | [diff] [blame] | 814 | u8 is_cmd_timedout; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 815 | u16 last_init_cmd; |
| 816 | struct timer_list cmd_timer; |
| 817 | struct list_head cmd_free_q; |
| 818 | /* spin lock for cmd_free_q */ |
| 819 | spinlock_t cmd_free_q_lock; |
| 820 | struct list_head cmd_pending_q; |
| 821 | /* spin lock for cmd_pending_q */ |
| 822 | spinlock_t cmd_pending_q_lock; |
| 823 | struct list_head scan_pending_q; |
| 824 | /* spin lock for scan_pending_q */ |
| 825 | spinlock_t scan_pending_q_lock; |
Avinash Patil | 6e25117 | 2014-09-12 20:08:59 +0530 | [diff] [blame] | 826 | /* spin lock for RX processing routine */ |
| 827 | spinlock_t rx_proc_lock; |
Zhaoyang Liu | e35000e | 2015-03-13 17:37:57 +0530 | [diff] [blame] | 828 | struct sk_buff_head tx_data_q; |
| 829 | atomic_t tx_queued; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 830 | u32 scan_processing; |
| 831 | u16 region_code; |
| 832 | struct mwifiex_802_11d_domain_reg domain_reg; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 833 | u16 scan_probes; |
| 834 | u32 scan_mode; |
| 835 | u16 specific_scan_time; |
| 836 | u16 active_scan_time; |
| 837 | u16 passive_scan_time; |
Avinash Patil | cb91be8 | 2014-09-12 20:08:54 +0530 | [diff] [blame] | 838 | u16 scan_chan_gap_time; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 839 | u8 fw_bands; |
| 840 | u8 adhoc_start_band; |
| 841 | u8 config_bands; |
| 842 | struct mwifiex_chan_scan_param_set *scan_channels; |
| 843 | u8 tx_lock_flag; |
| 844 | struct mwifiex_sleep_params sleep_params; |
| 845 | struct mwifiex_sleep_period sleep_period; |
| 846 | u16 ps_mode; |
| 847 | u32 ps_state; |
| 848 | u8 need_to_wakeup; |
| 849 | u16 multiple_dtim; |
| 850 | u16 local_listen_interval; |
| 851 | u16 null_pkt_interval; |
| 852 | struct sk_buff *sleep_cfm; |
| 853 | u16 bcn_miss_time_out; |
| 854 | u16 adhoc_awake_period; |
| 855 | u8 is_deep_sleep; |
| 856 | u8 delay_null_pkt; |
| 857 | u16 delay_to_ps; |
| 858 | u16 enhanced_ps_mode; |
| 859 | u8 pm_wakeup_card_req; |
| 860 | u16 gen_null_pkt; |
| 861 | u16 pps_uapsd_mode; |
| 862 | u32 pm_wakeup_fw_try; |
Amitkumar Karwar | 4636187 | 2014-12-31 02:36:41 -0800 | [diff] [blame] | 863 | struct timer_list wakeup_timer; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 864 | u8 is_hs_configured; |
| 865 | struct mwifiex_hs_config_param hs_cfg; |
| 866 | u8 hs_activated; |
| 867 | u16 hs_activate_wait_q_woken; |
| 868 | wait_queue_head_t hs_activate_wait_q; |
| 869 | bool is_suspended; |
Amitkumar Karwar | c0dbba6 | 2014-03-25 19:01:20 -0700 | [diff] [blame] | 870 | bool hs_enabling; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 871 | u8 event_body[MAX_EVENT_SIZE]; |
| 872 | u32 hw_dot_11n_dev_cap; |
| 873 | u8 hw_dev_mcs_support; |
Amitkumar Karwar | a533391 | 2014-02-27 19:35:18 -0800 | [diff] [blame] | 874 | u8 user_dev_mcs_support; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 875 | u8 adhoc_11n_enabled; |
Amitkumar Karwar | 21c3ba3 | 2011-12-20 23:47:21 -0800 | [diff] [blame] | 876 | u8 sec_chan_offset; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 877 | struct mwifiex_dbg dbg; |
| 878 | u8 arp_filter[ARP_FILTER_MAX_BUF_SIZE]; |
| 879 | u32 arp_filter_size; |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 880 | struct mwifiex_wait_queue cmd_wait_q; |
Amitkumar Karwar | efaaa8b | 2011-10-12 20:28:06 -0700 | [diff] [blame] | 881 | u8 scan_wait_q_woken; |
Avinash Patil | bbea3bc | 2011-12-08 20:41:05 -0800 | [diff] [blame] | 882 | spinlock_t queue_lock; /* lock for tx queues */ |
Avinash Patil | 67fdf39 | 2012-05-08 18:30:17 -0700 | [diff] [blame] | 883 | u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; |
Avinash Patil | ede98bf | 2012-05-08 18:30:28 -0700 | [diff] [blame] | 884 | u16 max_mgmt_ie_index; |
Amitkumar Karwar | 388ec38 | 2013-05-17 17:50:25 -0700 | [diff] [blame] | 885 | const struct firmware *cal_data; |
Bing Zhao | 699b027 | 2013-12-13 18:33:01 -0800 | [diff] [blame] | 886 | struct device_node *dt_node; |
Yogesh Ashok Powar | a5f3905 | 2013-02-15 21:44:30 -0800 | [diff] [blame] | 887 | |
| 888 | /* 11AC */ |
| 889 | u32 is_hw_11ac_capable; |
| 890 | u32 hw_dot_11ac_dev_cap; |
| 891 | u32 hw_dot_11ac_mcs_support; |
| 892 | u32 usr_dot_11ac_dev_cap_bg; |
| 893 | u32 usr_dot_11ac_dev_cap_a; |
| 894 | u32 usr_dot_11ac_mcs_support; |
| 895 | |
Avinash Patil | 838e4f4 | 2012-08-03 18:06:08 -0700 | [diff] [blame] | 896 | atomic_t pending_bridged_pkts; |
Amitkumar Karwar | 6b41f94 | 2013-07-22 19:17:55 -0700 | [diff] [blame] | 897 | struct semaphore *card_sem; |
Amitkumar Karwar | 21f58d20 | 2014-02-11 18:39:56 -0800 | [diff] [blame] | 898 | bool ext_scan; |
Amitkumar Karwar | 8e17ea2 | 2014-03-07 19:41:26 -0800 | [diff] [blame] | 899 | u8 fw_api_ver; |
Amitkumar Karwar | 4b9fede | 2014-08-19 08:24:25 -0400 | [diff] [blame] | 900 | u8 key_api_major_ver, key_api_minor_ver; |
Amitkumar Karwar | 92c2538 | 2014-06-19 21:38:52 -0700 | [diff] [blame] | 901 | struct work_struct iface_work; |
| 902 | unsigned long iface_work_flags; |
| 903 | struct memory_type_mapping *mem_type_mapping_tbl; |
| 904 | u8 num_mem_types; |
| 905 | u8 curr_mem_idx; |
Xinming Hu | 11cd07a | 2014-12-23 19:14:10 +0530 | [diff] [blame] | 906 | void *drv_info_dump; |
| 907 | u32 drv_info_size; |
Avinash Patil | cb91be8 | 2014-09-12 20:08:54 +0530 | [diff] [blame] | 908 | bool scan_chan_gap_enabled; |
Avinash Patil | 6e25117 | 2014-09-12 20:08:59 +0530 | [diff] [blame] | 909 | struct sk_buff_head rx_data_q; |
Avinash Patil | bf35443 | 2014-10-31 16:08:26 +0530 | [diff] [blame] | 910 | struct mwifiex_chan_stats *chan_stats; |
| 911 | u32 num_in_chan_stats; |
| 912 | int survey_idx; |
Avinash Patil | 9927baa | 2014-11-13 21:54:16 +0530 | [diff] [blame] | 913 | bool auto_tdls; |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 914 | }; |
| 915 | |
Zhaoyang Liu | e35000e | 2015-03-13 17:37:57 +0530 | [diff] [blame] | 916 | void mwifiex_process_tx_queue(struct mwifiex_adapter *adapter); |
| 917 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 918 | int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 919 | |
Avinash Patil | bbea3bc | 2011-12-08 20:41:05 -0800 | [diff] [blame] | 920 | void mwifiex_set_trans_start(struct net_device *dev); |
| 921 | |
| 922 | void mwifiex_stop_net_dev_queue(struct net_device *netdev, |
| 923 | struct mwifiex_adapter *adapter); |
| 924 | |
| 925 | void mwifiex_wake_up_net_dev_queue(struct net_device *netdev, |
| 926 | struct mwifiex_adapter *adapter); |
| 927 | |
Stone Piao | 9197ab9 | 2012-09-25 20:23:42 -0700 | [diff] [blame] | 928 | int mwifiex_init_priv(struct mwifiex_private *priv); |
| 929 | void mwifiex_free_priv(struct mwifiex_private *priv); |
| 930 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 931 | int mwifiex_init_fw(struct mwifiex_adapter *adapter); |
| 932 | |
| 933 | int mwifiex_init_fw_complete(struct mwifiex_adapter *adapter); |
| 934 | |
| 935 | int mwifiex_shutdown_drv(struct mwifiex_adapter *adapter); |
| 936 | |
| 937 | int mwifiex_shutdown_fw_complete(struct mwifiex_adapter *adapter); |
| 938 | |
| 939 | int mwifiex_dnld_fw(struct mwifiex_adapter *, struct mwifiex_fw_image *); |
| 940 | |
Avinash Patil | f3b369e | 2012-10-19 19:19:21 -0700 | [diff] [blame] | 941 | int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 942 | |
Avinash Patil | f3b369e | 2012-10-19 19:19:21 -0700 | [diff] [blame] | 943 | int mwifiex_process_mgmt_packet(struct mwifiex_private *priv, |
Stone Piao | 2dbaf75 | 2012-09-25 20:23:35 -0700 | [diff] [blame] | 944 | struct sk_buff *skb); |
| 945 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 946 | int mwifiex_process_event(struct mwifiex_adapter *adapter); |
| 947 | |
Amitkumar Karwar | efaaa8b | 2011-10-12 20:28:06 -0700 | [diff] [blame] | 948 | int mwifiex_complete_cmd(struct mwifiex_adapter *adapter, |
| 949 | struct cmd_ctrl_node *cmd_node); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 950 | |
Bing Zhao | fa0ecbb | 2014-02-27 19:35:12 -0800 | [diff] [blame] | 951 | int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no, |
| 952 | u16 cmd_action, u32 cmd_oid, void *data_buf, bool sync); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 953 | |
| 954 | void mwifiex_cmd_timeout_func(unsigned long function_context); |
| 955 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 956 | int mwifiex_get_debug_info(struct mwifiex_private *, |
| 957 | struct mwifiex_debug_info *); |
| 958 | |
| 959 | int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter); |
| 960 | int mwifiex_free_cmd_buffer(struct mwifiex_adapter *adapter); |
| 961 | void mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter); |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 962 | void mwifiex_cancel_pending_ioctl(struct mwifiex_adapter *adapter); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 963 | |
| 964 | void mwifiex_insert_cmd_to_free_q(struct mwifiex_adapter *adapter, |
| 965 | struct cmd_ctrl_node *cmd_node); |
Bing Zhao | 9908b07 | 2013-04-01 12:44:46 -0700 | [diff] [blame] | 966 | void mwifiex_recycle_cmd_node(struct mwifiex_adapter *adapter, |
| 967 | struct cmd_ctrl_node *cmd_node); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 968 | |
| 969 | void mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter *adapter, |
| 970 | struct cmd_ctrl_node *cmd_node, |
| 971 | u32 addtail); |
| 972 | |
| 973 | int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter); |
| 974 | int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter); |
| 975 | int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, |
| 976 | struct sk_buff *skb); |
| 977 | int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, |
| 978 | struct mwifiex_tx_param *tx_param); |
| 979 | int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags); |
| 980 | int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, |
Avinash Patil | 47411a0 | 2012-11-01 18:44:16 -0700 | [diff] [blame] | 981 | struct sk_buff *skb, int aggr, int status); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 982 | void mwifiex_clean_txrx(struct mwifiex_private *priv); |
| 983 | u8 mwifiex_check_last_packet_indication(struct mwifiex_private *priv); |
| 984 | void mwifiex_check_ps_cond(struct mwifiex_adapter *adapter); |
| 985 | void mwifiex_process_sleep_confirm_resp(struct mwifiex_adapter *, u8 *, |
| 986 | u32); |
| 987 | int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv, |
| 988 | struct host_cmd_ds_command *cmd, |
| 989 | u16 cmd_action, uint16_t ps_bitmap, |
Amitkumar Karwar | a5ffddb | 2011-06-20 15:21:48 -0700 | [diff] [blame] | 990 | struct mwifiex_ds_auto_ds *auto_ds); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 991 | int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv, |
| 992 | struct host_cmd_ds_command *resp, |
Amitkumar Karwar | a5ffddb | 2011-06-20 15:21:48 -0700 | [diff] [blame] | 993 | struct mwifiex_ds_pm_cfg *pm_cfg); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 994 | void mwifiex_process_hs_config(struct mwifiex_adapter *adapter); |
| 995 | void mwifiex_hs_activated_event(struct mwifiex_private *priv, |
| 996 | u8 activated); |
Xinming Hu | 937a504 | 2014-06-19 21:38:56 -0700 | [diff] [blame] | 997 | int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, |
| 998 | int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 999 | int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, |
| 1000 | struct host_cmd_ds_command *resp); |
Avinash Patil | f3b369e | 2012-10-19 19:19:21 -0700 | [diff] [blame] | 1001 | int mwifiex_process_rx_packet(struct mwifiex_private *priv, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1002 | struct sk_buff *skb); |
| 1003 | int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no, |
| 1004 | u16 cmd_action, u32 cmd_oid, |
| 1005 | void *data_buf, void *cmd_buf); |
Avinash Patil | 40d0703 | 2012-05-08 18:30:19 -0700 | [diff] [blame] | 1006 | int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, |
| 1007 | u16 cmd_action, u32 cmd_oid, |
| 1008 | void *data_buf, void *cmd_buf); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1009 | int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no, |
Amitkumar Karwar | a5ffddb | 2011-06-20 15:21:48 -0700 | [diff] [blame] | 1010 | struct host_cmd_ds_command *resp); |
Avinash Patil | f3b369e | 2012-10-19 19:19:21 -0700 | [diff] [blame] | 1011 | int mwifiex_process_sta_rx_packet(struct mwifiex_private *, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1012 | struct sk_buff *skb); |
Avinash Patil | f3b369e | 2012-10-19 19:19:21 -0700 | [diff] [blame] | 1013 | int mwifiex_process_uap_rx_packet(struct mwifiex_private *priv, |
Avinash Patil | 838e4f4 | 2012-08-03 18:06:08 -0700 | [diff] [blame] | 1014 | struct sk_buff *skb); |
| 1015 | int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv, |
| 1016 | struct sk_buff *skb); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1017 | int mwifiex_process_sta_event(struct mwifiex_private *); |
Avinash Patil | 3d99d98 | 2012-08-03 18:06:06 -0700 | [diff] [blame] | 1018 | int mwifiex_process_uap_event(struct mwifiex_private *); |
Avinash Patil | 017a92a | 2012-08-03 18:06:07 -0700 | [diff] [blame] | 1019 | void mwifiex_delete_all_station_list(struct mwifiex_private *priv); |
Avinash Patil | 9817fff | 2014-12-05 23:23:40 +0530 | [diff] [blame] | 1020 | void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private *priv, |
| 1021 | const u8 *ra_addr); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1022 | void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); |
Avinash Patil | 4ac8764 | 2012-09-10 18:30:49 -0700 | [diff] [blame] | 1023 | void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb); |
Avinash Patil | 1247cc1 | 2015-01-28 15:42:02 +0530 | [diff] [blame] | 1024 | int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init); |
Amitkumar Karwar | 572e8f3 | 2011-04-13 17:27:08 -0700 | [diff] [blame] | 1025 | int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, |
Amitkumar Karwar | a5ffddb | 2011-06-20 15:21:48 -0700 | [diff] [blame] | 1026 | struct mwifiex_scan_cmd_config *scan_cfg); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1027 | void mwifiex_queue_scan_cmd(struct mwifiex_private *priv, |
| 1028 | struct cmd_ctrl_node *cmd_node); |
| 1029 | int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1030 | struct host_cmd_ds_command *resp); |
Amitkumar Karwar | b9be5f3 | 2012-02-27 22:04:14 -0800 | [diff] [blame] | 1031 | s32 mwifiex_ssid_cmp(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2); |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1032 | int mwifiex_associate(struct mwifiex_private *priv, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1033 | struct mwifiex_bssdescriptor *bss_desc); |
| 1034 | int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, |
Amitkumar Karwar | a5ffddb | 2011-06-20 15:21:48 -0700 | [diff] [blame] | 1035 | struct host_cmd_ds_command *cmd, |
| 1036 | struct mwifiex_bssdescriptor *bss_desc); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1037 | int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1038 | struct host_cmd_ds_command *resp); |
Amitkumar Karwar | 8cc1d52 | 2012-10-05 20:21:43 -0700 | [diff] [blame] | 1039 | void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1040 | u8 mwifiex_band_to_radio_type(u8 band); |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1041 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac); |
Amitkumar Karwar | 848819f | 2014-02-27 19:35:17 -0800 | [diff] [blame] | 1042 | void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter); |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1043 | int mwifiex_adhoc_start(struct mwifiex_private *priv, |
Amitkumar Karwar | b9be5f3 | 2012-02-27 22:04:14 -0800 | [diff] [blame] | 1044 | struct cfg80211_ssid *adhoc_ssid); |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1045 | int mwifiex_adhoc_join(struct mwifiex_private *priv, |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1046 | struct mwifiex_bssdescriptor *bss_desc); |
| 1047 | int mwifiex_cmd_802_11_ad_hoc_start(struct mwifiex_private *priv, |
| 1048 | struct host_cmd_ds_command *cmd, |
Amitkumar Karwar | b9be5f3 | 2012-02-27 22:04:14 -0800 | [diff] [blame] | 1049 | struct cfg80211_ssid *req_ssid); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1050 | int mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, |
| 1051 | struct host_cmd_ds_command *cmd, |
Amitkumar Karwar | a5ffddb | 2011-06-20 15:21:48 -0700 | [diff] [blame] | 1052 | struct mwifiex_bssdescriptor *bss_desc); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1053 | int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv, |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1054 | struct host_cmd_ds_command *resp); |
Amitkumar Karwar | 572e8f3 | 2011-04-13 17:27:08 -0700 | [diff] [blame] | 1055 | int mwifiex_cmd_802_11_bg_scan_query(struct host_cmd_ds_command *cmd); |
Yogesh Ashok Powar | 6685d10 | 2012-03-12 19:35:10 -0700 | [diff] [blame] | 1056 | struct mwifiex_chan_freq_power *mwifiex_get_cfp(struct mwifiex_private *priv, |
| 1057 | u8 band, u16 channel, u32 freq); |
Yogesh Ashok Powar | a5f3905 | 2013-02-15 21:44:30 -0800 | [diff] [blame] | 1058 | u32 mwifiex_index_to_data_rate(struct mwifiex_private *priv, |
| 1059 | u8 index, u8 ht_info); |
| 1060 | u32 mwifiex_index_to_acs_data_rate(struct mwifiex_private *priv, |
| 1061 | u8 index, u8 ht_info); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1062 | u32 mwifiex_find_freq_from_band_chan(u8, u8); |
| 1063 | int mwifiex_cmd_append_vsie_tlv(struct mwifiex_private *priv, u16 vsie_mask, |
| 1064 | u8 **buffer); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1065 | u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv, |
| 1066 | u8 *rates); |
| 1067 | u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates); |
Avinash Patil | 78dfca6 | 2013-07-30 17:18:56 -0700 | [diff] [blame] | 1068 | u32 mwifiex_get_rates_from_cfg80211(struct mwifiex_private *priv, |
| 1069 | u8 *rates, u8 radio_type); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1070 | u8 mwifiex_is_rate_auto(struct mwifiex_private *priv); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1071 | extern u16 region_code_index[MWIFIEX_MAX_REGION_CODE]; |
| 1072 | void mwifiex_save_curr_bcn(struct mwifiex_private *priv); |
| 1073 | void mwifiex_free_curr_bcn(struct mwifiex_private *priv); |
| 1074 | int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv, |
| 1075 | struct host_cmd_ds_command *cmd); |
| 1076 | int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, |
| 1077 | struct host_cmd_ds_command *resp); |
| 1078 | int is_command_pending(struct mwifiex_adapter *adapter); |
Yogesh Ashok Powar | 93a1df4 | 2011-09-26 20:37:26 -0700 | [diff] [blame] | 1079 | void mwifiex_init_priv_params(struct mwifiex_private *priv, |
| 1080 | struct net_device *dev); |
Avinash Patil | f752dcd | 2012-05-08 18:30:26 -0700 | [diff] [blame] | 1081 | int mwifiex_set_secure_params(struct mwifiex_private *priv, |
| 1082 | struct mwifiex_uap_bss_param *bss_config, |
| 1083 | struct cfg80211_ap_settings *params); |
Avinash Patil | 2228125 | 2012-06-15 12:21:53 -0700 | [diff] [blame] | 1084 | void mwifiex_set_ht_params(struct mwifiex_private *priv, |
| 1085 | struct mwifiex_uap_bss_param *bss_cfg, |
| 1086 | struct cfg80211_ap_settings *params); |
Yogesh Ashok Powar | 83c78da | 2013-03-18 20:06:03 -0700 | [diff] [blame] | 1087 | void mwifiex_set_vht_params(struct mwifiex_private *priv, |
| 1088 | struct mwifiex_uap_bss_param *bss_cfg, |
| 1089 | struct cfg80211_ap_settings *params); |
Avinash Patil | a3c2c4f | 2012-08-27 20:32:53 -0700 | [diff] [blame] | 1090 | void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, |
| 1091 | struct cfg80211_ap_settings *params); |
Yogesh Ashok Powar | 83c78da | 2013-03-18 20:06:03 -0700 | [diff] [blame] | 1092 | void mwifiex_set_vht_width(struct mwifiex_private *priv, |
| 1093 | enum nl80211_chan_width width, |
| 1094 | bool ap_11ac_disable); |
Avinash Patil | 54428c5 | 2013-01-02 16:56:01 -0800 | [diff] [blame] | 1095 | void |
| 1096 | mwifiex_set_wmm_params(struct mwifiex_private *priv, |
| 1097 | struct mwifiex_uap_bss_param *bss_cfg, |
| 1098 | struct cfg80211_ap_settings *params); |
Avinash Patil | 04abc0a | 2013-03-27 19:10:31 -0700 | [diff] [blame] | 1099 | void mwifiex_set_ba_params(struct mwifiex_private *priv); |
Avinash Patil | 2b6254d | 2013-03-27 19:10:32 -0700 | [diff] [blame] | 1100 | void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv); |
Amitkumar Karwar | 21f58d20 | 2014-02-11 18:39:56 -0800 | [diff] [blame] | 1101 | int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv, |
| 1102 | struct host_cmd_ds_command *cmd, |
| 1103 | void *data_buf); |
Avinash Patil | bf35443 | 2014-10-31 16:08:26 +0530 | [diff] [blame] | 1104 | int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv, |
| 1105 | struct host_cmd_ds_command *resp); |
Amitkumar Karwar | 21f58d20 | 2014-02-11 18:39:56 -0800 | [diff] [blame] | 1106 | int mwifiex_handle_event_ext_scan_report(struct mwifiex_private *priv, |
| 1107 | void *buf); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1108 | |
| 1109 | /* |
| 1110 | * This function checks if the queuing is RA based or not. |
| 1111 | */ |
| 1112 | static inline u8 |
| 1113 | mwifiex_queuing_ra_based(struct mwifiex_private *priv) |
| 1114 | { |
| 1115 | /* |
| 1116 | * Currently we assume if we are in Infra, then DA=RA. This might not be |
| 1117 | * true in the future |
| 1118 | */ |
Bing Zhao | eecd825 | 2011-03-28 17:55:41 -0700 | [diff] [blame] | 1119 | if ((priv->bss_mode == NL80211_IFTYPE_STATION) && |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1120 | (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)) |
| 1121 | return false; |
| 1122 | |
| 1123 | return true; |
| 1124 | } |
| 1125 | |
| 1126 | /* |
| 1127 | * This function copies rates. |
| 1128 | */ |
| 1129 | static inline u32 |
| 1130 | mwifiex_copy_rates(u8 *dest, u32 pos, u8 *src, int len) |
| 1131 | { |
| 1132 | int i; |
| 1133 | |
| 1134 | for (i = 0; i < len && src[i]; i++, pos++) { |
| 1135 | if (pos >= MWIFIEX_SUPPORTED_RATES) |
| 1136 | break; |
| 1137 | dest[pos] = src[i]; |
| 1138 | } |
| 1139 | |
| 1140 | return pos; |
| 1141 | } |
| 1142 | |
| 1143 | /* |
| 1144 | * This function returns the correct private structure pointer based |
| 1145 | * upon the BSS type and BSS number. |
| 1146 | */ |
| 1147 | static inline struct mwifiex_private * |
| 1148 | mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter, |
Amitkumar Karwar | 2be7859 | 2011-04-15 20:50:42 -0700 | [diff] [blame] | 1149 | u8 bss_num, u8 bss_type) |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1150 | { |
| 1151 | int i; |
| 1152 | |
| 1153 | for (i = 0; i < adapter->priv_num; i++) { |
| 1154 | if (adapter->priv[i]) { |
Yogesh Ashok Powar | f57c1ed | 2012-03-13 19:22:37 -0700 | [diff] [blame] | 1155 | if ((adapter->priv[i]->bss_num == bss_num) && |
| 1156 | (adapter->priv[i]->bss_type == bss_type)) |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1157 | break; |
| 1158 | } |
| 1159 | } |
| 1160 | return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); |
| 1161 | } |
| 1162 | |
| 1163 | /* |
| 1164 | * This function returns the first available private structure pointer |
| 1165 | * based upon the BSS role. |
| 1166 | */ |
| 1167 | static inline struct mwifiex_private * |
| 1168 | mwifiex_get_priv(struct mwifiex_adapter *adapter, |
| 1169 | enum mwifiex_bss_role bss_role) |
| 1170 | { |
| 1171 | int i; |
| 1172 | |
| 1173 | for (i = 0; i < adapter->priv_num; i++) { |
| 1174 | if (adapter->priv[i]) { |
| 1175 | if (bss_role == MWIFIEX_BSS_ROLE_ANY || |
| 1176 | GET_BSS_ROLE(adapter->priv[i]) == bss_role) |
| 1177 | break; |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); |
| 1182 | } |
| 1183 | |
| 1184 | /* |
Avinash Patil | cf05233 | 2015-01-28 15:42:03 +0530 | [diff] [blame] | 1185 | * This function returns the first available unused private structure pointer. |
| 1186 | */ |
| 1187 | static inline struct mwifiex_private * |
| 1188 | mwifiex_get_unused_priv(struct mwifiex_adapter *adapter) |
| 1189 | { |
| 1190 | int i; |
| 1191 | |
| 1192 | for (i = 0; i < adapter->priv_num; i++) { |
| 1193 | if (adapter->priv[i]) { |
| 1194 | if (adapter->priv[i]->bss_mode == |
| 1195 | NL80211_IFTYPE_UNSPECIFIED) |
| 1196 | break; |
| 1197 | } |
| 1198 | } |
| 1199 | |
| 1200 | return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); |
| 1201 | } |
| 1202 | |
| 1203 | /* |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1204 | * This function returns the driver private structure of a network device. |
| 1205 | */ |
| 1206 | static inline struct mwifiex_private * |
| 1207 | mwifiex_netdev_get_priv(struct net_device *dev) |
| 1208 | { |
| 1209 | return (struct mwifiex_private *) (*(unsigned long *) netdev_priv(dev)); |
| 1210 | } |
| 1211 | |
Stone Piao | e39faa7 | 2012-09-25 20:23:32 -0700 | [diff] [blame] | 1212 | /* |
| 1213 | * This function checks if a skb holds a management frame. |
| 1214 | */ |
| 1215 | static inline bool mwifiex_is_skb_mgmt_frame(struct sk_buff *skb) |
| 1216 | { |
Tobias Waldekranz | cfcd926 | 2013-08-26 09:18:06 +0200 | [diff] [blame] | 1217 | return (le32_to_cpu(*(__le32 *)skb->data) == PKT_TYPE_MGMT); |
Stone Piao | e39faa7 | 2012-09-25 20:23:32 -0700 | [diff] [blame] | 1218 | } |
| 1219 | |
Amitkumar Karwar | b887664 | 2013-06-18 16:36:58 -0700 | [diff] [blame] | 1220 | /* This function retrieves channel closed for operation by Channel |
| 1221 | * Switch Announcement. |
| 1222 | */ |
| 1223 | static inline u8 |
| 1224 | mwifiex_11h_get_csa_closed_channel(struct mwifiex_private *priv) |
| 1225 | { |
| 1226 | if (!priv->csa_chan) |
| 1227 | return 0; |
| 1228 | |
| 1229 | /* Clear csa channel, if DFS channel move time has passed */ |
Manuel Schölling | 55fdb85 | 2014-05-25 19:59:36 +0200 | [diff] [blame] | 1230 | if (time_after(jiffies, priv->csa_expire_time)) { |
Amitkumar Karwar | b887664 | 2013-06-18 16:36:58 -0700 | [diff] [blame] | 1231 | priv->csa_chan = 0; |
| 1232 | priv->csa_expire_time = 0; |
| 1233 | } |
| 1234 | |
| 1235 | return priv->csa_chan; |
| 1236 | } |
| 1237 | |
Avinash Patil | cb91be8 | 2014-09-12 20:08:54 +0530 | [diff] [blame] | 1238 | static inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv) |
| 1239 | { |
| 1240 | struct mwifiex_private *priv_num; |
| 1241 | int i; |
| 1242 | |
| 1243 | for (i = 0; i < priv->adapter->priv_num; i++) { |
| 1244 | priv_num = priv->adapter->priv[i]; |
| 1245 | if (priv_num) { |
| 1246 | if ((GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_UAP && |
| 1247 | priv_num->bss_started) || |
| 1248 | (GET_BSS_ROLE(priv_num) == MWIFIEX_BSS_ROLE_STA && |
| 1249 | priv_num->media_connected)) |
| 1250 | return 1; |
| 1251 | } |
| 1252 | } |
| 1253 | |
| 1254 | return 0; |
| 1255 | } |
| 1256 | |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1257 | int mwifiex_init_shutdown_fw(struct mwifiex_private *priv, |
| 1258 | u32 func_init_shutdown); |
Amitkumar Karwar | d930fae | 2011-10-11 17:41:21 -0700 | [diff] [blame] | 1259 | int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1260 | int mwifiex_remove_card(struct mwifiex_adapter *, struct semaphore *); |
| 1261 | |
| 1262 | void mwifiex_get_version(struct mwifiex_adapter *adapter, char *version, |
| 1263 | int maxlen); |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1264 | int mwifiex_request_set_multicast_list(struct mwifiex_private *priv, |
| 1265 | struct mwifiex_multicast_list *mcast_list); |
| 1266 | int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, |
| 1267 | struct net_device *dev); |
Amitkumar Karwar | 00d7ea1 | 2013-03-15 18:47:05 -0700 | [diff] [blame] | 1268 | int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter, |
| 1269 | struct cmd_ctrl_node *cmd_queued); |
Amitkumar Karwar | 7c6fa2a | 2011-08-10 18:53:57 -0700 | [diff] [blame] | 1270 | int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, |
Amitkumar Karwar | b9be5f3 | 2012-02-27 22:04:14 -0800 | [diff] [blame] | 1271 | struct cfg80211_ssid *req_ssid); |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1272 | int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1273 | int mwifiex_enable_hs(struct mwifiex_adapter *adapter); |
Amitkumar Karwar | a049093 | 2011-07-13 20:51:59 -0700 | [diff] [blame] | 1274 | int mwifiex_disable_auto_ds(struct mwifiex_private *priv); |
Amitkumar Karwar | 006606c | 2012-07-13 20:09:31 -0700 | [diff] [blame] | 1275 | int mwifiex_drv_get_data_rate(struct mwifiex_private *priv, u32 *rate); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1276 | int mwifiex_request_scan(struct mwifiex_private *priv, |
Amitkumar Karwar | b9be5f3 | 2012-02-27 22:04:14 -0800 | [diff] [blame] | 1277 | struct cfg80211_ssid *req_ssid); |
Amitkumar Karwar | 1a1fb97 | 2012-06-27 19:57:56 -0700 | [diff] [blame] | 1278 | int mwifiex_scan_networks(struct mwifiex_private *priv, |
| 1279 | const struct mwifiex_user_scan_cfg *user_scan_in); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1280 | int mwifiex_set_radio(struct mwifiex_private *priv, u8 option); |
| 1281 | |
Ying Luo | 53b1123 | 2012-08-03 18:06:13 -0700 | [diff] [blame] | 1282 | int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp, |
| 1283 | const u8 *key, int key_len, u8 key_index, |
| 1284 | const u8 *mac_addr, int disable); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1285 | |
Johannes Berg | 4b5800f | 2014-01-15 14:55:59 +0100 | [diff] [blame] | 1286 | int mwifiex_set_gen_ie(struct mwifiex_private *priv, const u8 *ie, int ie_len); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1287 | |
| 1288 | int mwifiex_get_ver_ext(struct mwifiex_private *priv); |
| 1289 | |
Stone Piao | 7feb4c4 | 2012-09-25 20:23:36 -0700 | [diff] [blame] | 1290 | int mwifiex_remain_on_chan_cfg(struct mwifiex_private *priv, u16 action, |
| 1291 | struct ieee80211_channel *chan, |
Stone Piao | 7feb4c4 | 2012-09-25 20:23:36 -0700 | [diff] [blame] | 1292 | unsigned int duration); |
| 1293 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1294 | int mwifiex_get_stats_info(struct mwifiex_private *priv, |
| 1295 | struct mwifiex_ds_get_stats *log); |
| 1296 | |
| 1297 | int mwifiex_reg_write(struct mwifiex_private *priv, u32 reg_type, |
| 1298 | u32 reg_offset, u32 reg_value); |
| 1299 | |
| 1300 | int mwifiex_reg_read(struct mwifiex_private *priv, u32 reg_type, |
| 1301 | u32 reg_offset, u32 *value); |
| 1302 | |
| 1303 | int mwifiex_eeprom_read(struct mwifiex_private *priv, u16 offset, u16 bytes, |
| 1304 | u8 *value); |
| 1305 | |
| 1306 | int mwifiex_set_11n_httx_cfg(struct mwifiex_private *priv, int data); |
| 1307 | |
| 1308 | int mwifiex_get_11n_httx_cfg(struct mwifiex_private *priv, int *data); |
| 1309 | |
| 1310 | int mwifiex_set_tx_rate_cfg(struct mwifiex_private *priv, int tx_rate_index); |
| 1311 | |
| 1312 | int mwifiex_get_tx_rate_cfg(struct mwifiex_private *priv, int *tx_rate_index); |
| 1313 | |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1314 | int mwifiex_drv_set_power(struct mwifiex_private *priv, u32 *ps_mode); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1315 | |
| 1316 | int mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, |
| 1317 | char *version, int max_len); |
| 1318 | |
Amitkumar Karwar | 600f5d9 | 2011-04-13 17:27:06 -0700 | [diff] [blame] | 1319 | int mwifiex_set_tx_power(struct mwifiex_private *priv, |
| 1320 | struct mwifiex_power_cfg *power_cfg); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1321 | |
| 1322 | int mwifiex_main_process(struct mwifiex_adapter *); |
| 1323 | |
Stone Piao | e39faa7 | 2012-09-25 20:23:32 -0700 | [diff] [blame] | 1324 | int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, struct sk_buff *skb); |
| 1325 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1326 | int mwifiex_get_bss_info(struct mwifiex_private *, |
| 1327 | struct mwifiex_bss_info *); |
Amitkumar Karwar | 7c6fa2a | 2011-08-10 18:53:57 -0700 | [diff] [blame] | 1328 | int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, |
Amitkumar Karwar | 9558a40 | 2012-04-16 21:36:51 -0700 | [diff] [blame] | 1329 | struct cfg80211_bss *bss, |
Amitkumar Karwar | 7c6fa2a | 2011-08-10 18:53:57 -0700 | [diff] [blame] | 1330 | struct mwifiex_bssdescriptor *bss_desc); |
| 1331 | int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, |
Amitkumar Karwar | 9558a40 | 2012-04-16 21:36:51 -0700 | [diff] [blame] | 1332 | struct mwifiex_bssdescriptor *bss_entry); |
Amitkumar Karwar | 7c6fa2a | 2011-08-10 18:53:57 -0700 | [diff] [blame] | 1333 | int mwifiex_check_network_compatibility(struct mwifiex_private *priv, |
| 1334 | struct mwifiex_bssdescriptor *bss_desc); |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1335 | |
Stone Piao | 7feb4c4 | 2012-09-25 20:23:36 -0700 | [diff] [blame] | 1336 | u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type); |
| 1337 | |
Johannes Berg | 84efbb8 | 2012-06-16 00:00:26 +0200 | [diff] [blame] | 1338 | struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, |
Johannes Berg | 552bff0 | 2012-09-19 09:26:06 +0200 | [diff] [blame] | 1339 | const char *name, |
Johannes Berg | 84efbb8 | 2012-06-16 00:00:26 +0200 | [diff] [blame] | 1340 | enum nl80211_iftype type, |
| 1341 | u32 *flags, |
| 1342 | struct vif_params *params); |
| 1343 | int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev); |
Yogesh Ashok Powar | 93a1df4 | 2011-09-26 20:37:26 -0700 | [diff] [blame] | 1344 | |
Avinash Patil | 9b930ea | 2012-05-08 18:30:23 -0700 | [diff] [blame] | 1345 | void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config); |
| 1346 | |
Amitkumar Karwar | 7da060c | 2013-03-04 16:27:59 -0800 | [diff] [blame] | 1347 | int mwifiex_add_wowlan_magic_pkt_filter(struct mwifiex_adapter *adapter); |
| 1348 | |
Avinash Patil | f31acab | 2012-05-08 18:30:29 -0700 | [diff] [blame] | 1349 | int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, |
Avinash Patil | adb6ed0 | 2012-06-28 20:30:25 -0700 | [diff] [blame] | 1350 | struct cfg80211_beacon_data *data); |
Avinash Patil | 40bbc21 | 2012-05-08 18:30:30 -0700 | [diff] [blame] | 1351 | int mwifiex_del_mgmt_ies(struct mwifiex_private *priv); |
Amitkumar Karwar | 9e04a7c | 2012-04-09 20:06:54 -0700 | [diff] [blame] | 1352 | u8 *mwifiex_11d_code_2_region(u8 code); |
Avinash Patil | b654ca1 | 2015-01-28 15:54:19 +0530 | [diff] [blame] | 1353 | void mwifiex_uap_set_channel(struct mwifiex_uap_bss_param *bss_cfg, |
| 1354 | struct cfg80211_chan_def chandef); |
| 1355 | int mwifiex_config_start_uap(struct mwifiex_private *priv, |
| 1356 | struct mwifiex_uap_bss_param *bss_cfg); |
Avinash Patil | 0f9e9b8 | 2013-05-17 17:50:23 -0700 | [diff] [blame] | 1357 | void mwifiex_uap_del_sta_data(struct mwifiex_private *priv, |
| 1358 | struct mwifiex_sta_node *node); |
Yogesh Ashok Powar | 93a1df4 | 2011-09-26 20:37:26 -0700 | [diff] [blame] | 1359 | |
Avinash Patil | cf075ea | 2015-01-28 15:54:25 +0530 | [diff] [blame] | 1360 | void mwifiex_init_11h_params(struct mwifiex_private *priv); |
| 1361 | int mwifiex_is_11h_active(struct mwifiex_private *priv); |
| 1362 | int mwifiex_11h_activate(struct mwifiex_private *priv, bool flag); |
| 1363 | |
Amitkumar Karwar | 2a7305c | 2013-06-19 08:49:05 -0700 | [diff] [blame] | 1364 | void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer, |
| 1365 | struct mwifiex_bssdescriptor *bss_desc); |
| 1366 | int mwifiex_11h_handle_event_chanswann(struct mwifiex_private *priv); |
Bing Zhao | 82efa16 | 2013-12-13 18:33:02 -0800 | [diff] [blame] | 1367 | int mwifiex_dnld_dt_cfgdata(struct mwifiex_private *priv, |
| 1368 | struct device_node *node, const char *prefix); |
Bing Zhao | b58df44 | 2014-01-08 15:45:57 -0800 | [diff] [blame] | 1369 | void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv); |
Amitkumar Karwar | 2a7305c | 2013-06-19 08:49:05 -0700 | [diff] [blame] | 1370 | |
Amitkumar Karwar | 0d7f53e | 2013-03-04 16:27:58 -0800 | [diff] [blame] | 1371 | extern const struct ethtool_ops mwifiex_ethtool_ops; |
| 1372 | |
Avinash Patil | 4bcf93d | 2014-02-07 16:27:30 -0800 | [diff] [blame] | 1373 | void mwifiex_del_all_sta_list(struct mwifiex_private *priv); |
Johannes Berg | 3b3a016 | 2014-05-19 17:19:31 +0200 | [diff] [blame] | 1374 | void mwifiex_del_sta_entry(struct mwifiex_private *priv, const u8 *mac); |
Avinash Patil | 4bcf93d | 2014-02-07 16:27:30 -0800 | [diff] [blame] | 1375 | void |
| 1376 | mwifiex_set_sta_ht_cap(struct mwifiex_private *priv, const u8 *ies, |
| 1377 | int ies_len, struct mwifiex_sta_node *node); |
| 1378 | struct mwifiex_sta_node * |
Johannes Berg | 3b3a016 | 2014-05-19 17:19:31 +0200 | [diff] [blame] | 1379 | mwifiex_add_sta_entry(struct mwifiex_private *priv, const u8 *mac); |
Avinash Patil | 4bcf93d | 2014-02-07 16:27:30 -0800 | [diff] [blame] | 1380 | struct mwifiex_sta_node * |
Johannes Berg | 3b3a016 | 2014-05-19 17:19:31 +0200 | [diff] [blame] | 1381 | mwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac); |
| 1382 | int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *peer, |
Avinash Patil | b23bce2 | 2014-02-07 16:27:32 -0800 | [diff] [blame] | 1383 | u8 action_code, u8 dialog_token, |
| 1384 | u16 status_code, const u8 *extra_ies, |
| 1385 | size_t extra_ies_len); |
Johannes Berg | 3b3a016 | 2014-05-19 17:19:31 +0200 | [diff] [blame] | 1386 | int mwifiex_send_tdls_action_frame(struct mwifiex_private *priv, const u8 *peer, |
| 1387 | u8 action_code, u8 dialog_token, |
| 1388 | u16 status_code, const u8 *extra_ies, |
| 1389 | size_t extra_ies_len); |
Avinash Patil | 5f2caaf | 2014-02-07 16:27:33 -0800 | [diff] [blame] | 1390 | void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv, |
| 1391 | u8 *buf, int len); |
Johannes Berg | 3b3a016 | 2014-05-19 17:19:31 +0200 | [diff] [blame] | 1392 | int mwifiex_tdls_oper(struct mwifiex_private *priv, const u8 *peer, u8 action); |
| 1393 | int mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac); |
Xinming Hu | 72df631 | 2014-12-23 19:14:05 +0530 | [diff] [blame] | 1394 | int mwifiex_get_tdls_list(struct mwifiex_private *priv, |
| 1395 | struct tdls_peer_info *buf); |
Avinash Patil | be104b9 | 2014-02-07 16:30:41 -0800 | [diff] [blame] | 1396 | void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv); |
Avinash Patil | 5f6d598 | 2014-02-07 16:30:39 -0800 | [diff] [blame] | 1397 | bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv); |
| 1398 | u8 mwifiex_get_center_freq_index(struct mwifiex_private *priv, u8 band, |
| 1399 | u32 pri_chan, u8 chan_bw); |
Avinash Patil | cb91be8 | 2014-09-12 20:08:54 +0530 | [diff] [blame] | 1400 | int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter); |
Avinash Patil | 4bcf93d | 2014-02-07 16:27:30 -0800 | [diff] [blame] | 1401 | |
Avinash Patil | 9927baa | 2014-11-13 21:54:16 +0530 | [diff] [blame] | 1402 | int mwifiex_tdls_check_tx(struct mwifiex_private *priv, struct sk_buff *skb); |
| 1403 | void mwifiex_flush_auto_tdls_list(struct mwifiex_private *priv); |
| 1404 | void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv, |
| 1405 | const u8 *mac, u8 link_status); |
| 1406 | void mwifiex_auto_tdls_update_peer_signal(struct mwifiex_private *priv, |
| 1407 | u8 *mac, s8 snr, s8 nflr); |
| 1408 | void mwifiex_check_auto_tdls(unsigned long context); |
| 1409 | void mwifiex_add_auto_tdls_peer(struct mwifiex_private *priv, const u8 *mac); |
| 1410 | void mwifiex_setup_auto_tdls_timer(struct mwifiex_private *priv); |
| 1411 | void mwifiex_clean_auto_tdls(struct mwifiex_private *priv); |
Avinash Patil | 85afb18 | 2015-01-28 15:54:21 +0530 | [diff] [blame] | 1412 | int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv, |
| 1413 | struct host_cmd_ds_command *cmd, |
| 1414 | void *data_buf); |
Avinash Patil | 0a694d6 | 2015-01-28 15:54:22 +0530 | [diff] [blame] | 1415 | int mwifiex_11h_handle_chanrpt_ready(struct mwifiex_private *priv, |
| 1416 | struct sk_buff *skb); |
Avinash Patil | 9927baa | 2014-11-13 21:54:16 +0530 | [diff] [blame] | 1417 | |
Amitkumar Karwar | 808bbeb | 2014-11-25 06:43:05 -0800 | [diff] [blame] | 1418 | void mwifiex_parse_tx_status_event(struct mwifiex_private *priv, |
| 1419 | void *event_body); |
| 1420 | |
Amitkumar Karwar | 18ca438 | 2014-11-25 06:43:06 -0800 | [diff] [blame] | 1421 | struct sk_buff * |
| 1422 | mwifiex_clone_skb_for_tx_status(struct mwifiex_private *priv, |
| 1423 | struct sk_buff *skb, u8 flag, u64 *cookie); |
Avinash Patil | 85afb18 | 2015-01-28 15:54:21 +0530 | [diff] [blame] | 1424 | void mwifiex_dfs_cac_work_queue(struct work_struct *work); |
Avinash Patil | 7d65203 | 2015-01-28 15:54:24 +0530 | [diff] [blame] | 1425 | void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work); |
Avinash Patil | 85afb18 | 2015-01-28 15:54:21 +0530 | [diff] [blame] | 1426 | void mwifiex_abort_cac(struct mwifiex_private *priv); |
Avinash Patil | 3b57c1a | 2015-01-28 15:54:23 +0530 | [diff] [blame] | 1427 | int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv, |
| 1428 | struct sk_buff *skb); |
Amitkumar Karwar | 18ca438 | 2014-11-25 06:43:06 -0800 | [diff] [blame] | 1429 | |
Xinming Hu | cbf6e05 | 2014-12-23 19:14:07 +0530 | [diff] [blame] | 1430 | void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr, |
| 1431 | s8 nflr); |
| 1432 | void mwifiex_hist_data_reset(struct mwifiex_private *priv); |
| 1433 | void mwifiex_hist_data_add(struct mwifiex_private *priv, |
| 1434 | u8 rx_rate, s8 snr, s8 nflr); |
| 1435 | u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv, |
| 1436 | u8 rx_rate, u8 ht_info); |
| 1437 | |
Xinming Hu | 11cd07a | 2014-12-23 19:14:10 +0530 | [diff] [blame] | 1438 | void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter); |
Avinash Patil | 6215994 | 2015-03-13 17:37:52 +0530 | [diff] [blame] | 1439 | void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags); |
Shengzhen Li | b2713f6 | 2015-03-13 17:37:54 +0530 | [diff] [blame] | 1440 | void mwifiex_queue_main_work(struct mwifiex_adapter *adapter); |
Xinming Hu | 11cd07a | 2014-12-23 19:14:10 +0530 | [diff] [blame] | 1441 | |
Bing Zhao | 5e6e3a9 | 2011-03-21 18:00:50 -0700 | [diff] [blame] | 1442 | #ifdef CONFIG_DEBUG_FS |
| 1443 | void mwifiex_debugfs_init(void); |
| 1444 | void mwifiex_debugfs_remove(void); |
| 1445 | |
| 1446 | void mwifiex_dev_debugfs_init(struct mwifiex_private *priv); |
| 1447 | void mwifiex_dev_debugfs_remove(struct mwifiex_private *priv); |
| 1448 | #endif |
| 1449 | #endif /* !_MWIFIEX_MAIN_H_ */ |