Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of wl1271 |
| 3 | * |
| 4 | * Copyright (C) 1998-2009 Texas Instruments. All rights reserved. |
| 5 | * Copyright (C) 2009 Nokia Corporation |
| 6 | * |
| 7 | * Contact: Luciano Coelho <luciano.coelho@nokia.com> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License |
| 11 | * version 2 as published by the Free Software Foundation. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, but |
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 21 | * 02110-1301 USA |
| 22 | * |
| 23 | */ |
| 24 | |
Shahar Levi | 00d2010 | 2010-11-08 11:20:10 +0000 | [diff] [blame] | 25 | #ifndef __CMD_H__ |
| 26 | #define __CMD_H__ |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 27 | |
Shahar Levi | 00d2010 | 2010-11-08 11:20:10 +0000 | [diff] [blame] | 28 | #include "wl12xx.h" |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 29 | |
| 30 | struct acx_header; |
| 31 | |
Juuso Oikarinen | fa867e7 | 2009-11-02 20:22:13 +0200 | [diff] [blame] | 32 | int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len, |
| 33 | size_t res_len); |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 34 | int wl1271_cmd_general_parms(struct wl1271 *wl); |
Shahar Levi | 49d750ca | 2011-03-06 16:32:09 +0200 | [diff] [blame] | 35 | int wl128x_cmd_general_parms(struct wl1271 *wl); |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 36 | int wl1271_cmd_radio_parms(struct wl1271 *wl); |
Shahar Levi | 49d750ca | 2011-03-06 16:32:09 +0200 | [diff] [blame] | 37 | int wl128x_cmd_radio_parms(struct wl1271 *wl); |
Juuso Oikarinen | 644a486 | 2010-10-05 13:11:56 +0200 | [diff] [blame] | 38 | int wl1271_cmd_ext_radio_parms(struct wl1271 *wl); |
Juuso Oikarinen | 1530549 | 2010-02-22 08:38:32 +0200 | [diff] [blame] | 39 | int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 40 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); |
| 41 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); |
| 42 | int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); |
Luciano Coelho | 9421089 | 2009-12-11 15:40:55 +0200 | [diff] [blame] | 43 | int wl1271_cmd_data_path(struct wl1271 *wl, bool enable); |
Eliad Peller | c8bde24 | 2011-02-02 09:59:35 +0200 | [diff] [blame] | 44 | int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode); |
Juuso Oikarinen | 65cddbf | 2010-08-24 06:28:03 +0300 | [diff] [blame] | 45 | int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, |
| 46 | size_t len); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 47 | int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, |
Juuso Oikarinen | 606c148 | 2010-04-01 11:38:21 +0300 | [diff] [blame] | 48 | void *buf, size_t buf_len, int index, u32 rates); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 49 | int wl1271_cmd_build_null_data(struct wl1271 *wl); |
| 50 | int wl1271_cmd_build_ps_poll(struct wl1271 *wl, u16 aid); |
Kalle Valo | 818e306 | 2010-03-18 12:26:35 +0200 | [diff] [blame] | 51 | int wl1271_cmd_build_probe_req(struct wl1271 *wl, |
| 52 | const u8 *ssid, size_t ssid_len, |
| 53 | const u8 *ie, size_t ie_len, u8 band); |
Juuso Oikarinen | 2f6724b | 2010-11-24 08:16:57 +0200 | [diff] [blame] | 54 | struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl, |
| 55 | struct sk_buff *skb); |
Eliad Peller | c531277 | 2010-12-09 11:31:27 +0200 | [diff] [blame] | 56 | int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr); |
Kalle Valo | 023e082 | 2010-03-18 12:26:36 +0200 | [diff] [blame] | 57 | int wl1271_build_qos_null_data(struct wl1271 *wl); |
Juuso Oikarinen | bfb24c9 | 2010-03-26 12:53:31 +0200 | [diff] [blame] | 58 | int wl1271_cmd_build_klv_null_data(struct wl1271 *wl); |
Arik Nemtsov | 98bdaab | 2010-10-16 18:08:58 +0200 | [diff] [blame] | 59 | int wl1271_cmd_set_sta_default_wep_key(struct wl1271 *wl, u8 id); |
| 60 | int wl1271_cmd_set_ap_default_wep_key(struct wl1271 *wl, u8 id); |
| 61 | int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
| 62 | u8 key_size, const u8 *key, const u8 *addr, |
| 63 | u32 tx_seq_32, u16 tx_seq_16); |
| 64 | int wl1271_cmd_set_ap_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
| 65 | u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32, |
| 66 | u16 tx_seq_16); |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 67 | int wl1271_cmd_disconnect(struct wl1271 *wl); |
Juuso Oikarinen | be86cbe | 2010-05-27 12:53:01 +0300 | [diff] [blame] | 68 | int wl1271_cmd_set_sta_state(struct wl1271 *wl); |
Arik Nemtsov | 98bdaab | 2010-10-16 18:08:58 +0200 | [diff] [blame] | 69 | int wl1271_cmd_start_bss(struct wl1271 *wl); |
| 70 | int wl1271_cmd_stop_bss(struct wl1271 *wl); |
| 71 | int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid); |
| 72 | int wl1271_cmd_remove_sta(struct wl1271 *wl, u8 hlid); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 73 | |
| 74 | enum wl1271_commands { |
| 75 | CMD_INTERROGATE = 1, /*use this to read information elements*/ |
| 76 | CMD_CONFIGURE = 2, /*use this to write information elements*/ |
| 77 | CMD_ENABLE_RX = 3, |
| 78 | CMD_ENABLE_TX = 4, |
| 79 | CMD_DISABLE_RX = 5, |
| 80 | CMD_DISABLE_TX = 6, |
| 81 | CMD_SCAN = 8, |
| 82 | CMD_STOP_SCAN = 9, |
| 83 | CMD_START_JOIN = 11, |
| 84 | CMD_SET_KEYS = 12, |
| 85 | CMD_READ_MEMORY = 13, |
| 86 | CMD_WRITE_MEMORY = 14, |
| 87 | CMD_SET_TEMPLATE = 19, |
| 88 | CMD_TEST = 23, |
| 89 | CMD_NOISE_HIST = 28, |
| 90 | CMD_LNA_CONTROL = 32, |
| 91 | CMD_SET_BCN_MODE = 33, |
| 92 | CMD_MEASUREMENT = 34, |
| 93 | CMD_STOP_MEASUREMENT = 35, |
| 94 | CMD_DISCONNECT = 36, |
| 95 | CMD_SET_PS_MODE = 37, |
| 96 | CMD_CHANNEL_SWITCH = 38, |
| 97 | CMD_STOP_CHANNEL_SWICTH = 39, |
| 98 | CMD_AP_DISCOVERY = 40, |
| 99 | CMD_STOP_AP_DISCOVERY = 41, |
| 100 | CMD_SPS_SCAN = 42, |
| 101 | CMD_STOP_SPS_SCAN = 43, |
| 102 | CMD_HEALTH_CHECK = 45, |
| 103 | CMD_DEBUG = 46, |
| 104 | CMD_TRIGGER_SCAN_TO = 47, |
| 105 | CMD_CONNECTION_SCAN_CFG = 48, |
| 106 | CMD_CONNECTION_SCAN_SSID_CFG = 49, |
| 107 | CMD_START_PERIODIC_SCAN = 50, |
| 108 | CMD_STOP_PERIODIC_SCAN = 51, |
| 109 | CMD_SET_STA_STATE = 52, |
| 110 | |
Arik Nemtsov | 98bdaab | 2010-10-16 18:08:58 +0200 | [diff] [blame] | 111 | /* AP mode commands */ |
| 112 | CMD_BSS_START = 60, |
| 113 | CMD_BSS_STOP = 61, |
| 114 | CMD_ADD_STA = 62, |
| 115 | CMD_REMOVE_STA = 63, |
| 116 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 117 | NUM_COMMANDS, |
| 118 | MAX_COMMAND_ID = 0xFFFF, |
| 119 | }; |
| 120 | |
| 121 | #define MAX_CMD_PARAMS 572 |
| 122 | |
Juuso Oikarinen | bfb24c9 | 2010-03-26 12:53:31 +0200 | [diff] [blame] | 123 | enum { |
| 124 | CMD_TEMPL_KLV_IDX_NULL_DATA = 0, |
| 125 | CMD_TEMPL_KLV_IDX_MAX = 4 |
| 126 | }; |
| 127 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 128 | enum cmd_templ { |
| 129 | CMD_TEMPL_NULL_DATA = 0, |
| 130 | CMD_TEMPL_BEACON, |
| 131 | CMD_TEMPL_CFG_PROBE_REQ_2_4, |
| 132 | CMD_TEMPL_CFG_PROBE_REQ_5, |
| 133 | CMD_TEMPL_PROBE_RESPONSE, |
| 134 | CMD_TEMPL_QOS_NULL_DATA, |
| 135 | CMD_TEMPL_PS_POLL, |
| 136 | CMD_TEMPL_KLV, |
| 137 | CMD_TEMPL_DISCONNECT, |
| 138 | CMD_TEMPL_PROBE_REQ_2_4, /* for firmware internal use only */ |
| 139 | CMD_TEMPL_PROBE_REQ_5, /* for firmware internal use only */ |
| 140 | CMD_TEMPL_BAR, /* for firmware internal use only */ |
| 141 | CMD_TEMPL_CTS, /* |
| 142 | * For CTS-to-self (FastCTS) mechanism |
| 143 | * for BT/WLAN coexistence (SoftGemini). */ |
Eliad Peller | c531277 | 2010-12-09 11:31:27 +0200 | [diff] [blame] | 144 | CMD_TEMPL_ARP_RSP, |
Eliad Peller | c8bde24 | 2011-02-02 09:59:35 +0200 | [diff] [blame] | 145 | CMD_TEMPL_LINK_MEASUREMENT_REPORT, |
Arik Nemtsov | e0fe371 | 2010-10-16 18:19:53 +0200 | [diff] [blame] | 146 | |
| 147 | /* AP-mode specific */ |
| 148 | CMD_TEMPL_AP_BEACON = 13, |
| 149 | CMD_TEMPL_AP_PROBE_RESPONSE, |
| 150 | CMD_TEMPL_AP_ARP_RSP, |
| 151 | CMD_TEMPL_DEAUTH_AP, |
| 152 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 153 | CMD_TEMPL_MAX = 0xff |
| 154 | }; |
| 155 | |
| 156 | /* unit ms */ |
| 157 | #define WL1271_COMMAND_TIMEOUT 2000 |
| 158 | #define WL1271_CMD_TEMPL_MAX_SIZE 252 |
Teemu Paasikivi | 0cbb103 | 2010-05-07 11:39:01 +0300 | [diff] [blame] | 159 | #define WL1271_EVENT_TIMEOUT 750 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 160 | |
| 161 | struct wl1271_cmd_header { |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 162 | __le16 id; |
| 163 | __le16 status; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 164 | /* payload */ |
| 165 | u8 data[0]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 166 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 167 | |
| 168 | #define WL1271_CMD_MAX_PARAMS 572 |
| 169 | |
| 170 | struct wl1271_command { |
| 171 | struct wl1271_cmd_header header; |
| 172 | u8 parameters[WL1271_CMD_MAX_PARAMS]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 173 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 174 | |
| 175 | enum { |
| 176 | CMD_MAILBOX_IDLE = 0, |
| 177 | CMD_STATUS_SUCCESS = 1, |
| 178 | CMD_STATUS_UNKNOWN_CMD = 2, |
| 179 | CMD_STATUS_UNKNOWN_IE = 3, |
| 180 | CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11, |
| 181 | CMD_STATUS_RX_BUSY = 13, |
| 182 | CMD_STATUS_INVALID_PARAM = 14, |
| 183 | CMD_STATUS_TEMPLATE_TOO_LARGE = 15, |
| 184 | CMD_STATUS_OUT_OF_MEMORY = 16, |
| 185 | CMD_STATUS_STA_TABLE_FULL = 17, |
| 186 | CMD_STATUS_RADIO_ERROR = 18, |
| 187 | CMD_STATUS_WRONG_NESTING = 19, |
| 188 | CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/ |
| 189 | CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/ |
| 190 | MAX_COMMAND_STATUS = 0xff |
| 191 | }; |
| 192 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 193 | #define CMDMBOX_HEADER_LEN 4 |
| 194 | #define CMDMBOX_INFO_ELEM_HEADER_LEN 4 |
| 195 | |
| 196 | enum { |
| 197 | BSS_TYPE_IBSS = 0, |
| 198 | BSS_TYPE_STA_BSS = 2, |
| 199 | BSS_TYPE_AP_BSS = 3, |
| 200 | MAX_BSS_TYPE = 0xFF |
| 201 | }; |
| 202 | |
| 203 | #define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */ |
| 204 | #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 |
Teemu Paasikivi | a410264 | 2009-10-13 12:47:51 +0300 | [diff] [blame] | 205 | #define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 206 | |
| 207 | struct wl1271_cmd_join { |
| 208 | struct wl1271_cmd_header header; |
| 209 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 210 | __le32 bssid_lsb; |
| 211 | __le16 bssid_msb; |
| 212 | __le16 beacon_interval; /* in TBTTs */ |
| 213 | __le32 rx_config_options; |
| 214 | __le32 rx_filter_options; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 215 | |
| 216 | /* |
| 217 | * The target uses this field to determine the rate at |
| 218 | * which to transmit control frame responses (such as |
| 219 | * ACK or CTS frames). |
| 220 | */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 221 | __le32 basic_rate_set; |
Eliad Peller | c8bde24 | 2011-02-02 09:59:35 +0200 | [diff] [blame] | 222 | __le32 supported_rate_set; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 223 | u8 dtim_interval; |
| 224 | /* |
| 225 | * bits 0-2: This bitwise field specifies the type |
| 226 | * of BSS to start or join (BSS_TYPE_*). |
| 227 | * bit 4: Band - The radio band in which to join |
| 228 | * or start. |
| 229 | * 0 - 2.4GHz band |
| 230 | * 1 - 5GHz band |
| 231 | * bits 3, 5-7: Reserved |
| 232 | */ |
| 233 | u8 bss_type; |
| 234 | u8 channel; |
| 235 | u8 ssid_len; |
| 236 | u8 ssid[IW_ESSID_MAX_SIZE]; |
| 237 | u8 ctrl; /* JOIN_CMD_CTRL_* */ |
| 238 | u8 reserved[3]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 239 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 240 | |
| 241 | struct cmd_enabledisable_path { |
| 242 | struct wl1271_cmd_header header; |
| 243 | |
| 244 | u8 channel; |
| 245 | u8 padding[3]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 246 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 247 | |
Juuso Oikarinen | 606c148 | 2010-04-01 11:38:21 +0300 | [diff] [blame] | 248 | #define WL1271_RATE_AUTOMATIC 0 |
| 249 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 250 | struct wl1271_cmd_template_set { |
| 251 | struct wl1271_cmd_header header; |
| 252 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 253 | __le16 len; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 254 | u8 template_type; |
| 255 | u8 index; /* relevant only for KLV_TEMPLATE type */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 256 | __le32 enabled_rates; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 257 | u8 short_retry_limit; |
| 258 | u8 long_retry_limit; |
| 259 | u8 aflags; |
| 260 | u8 reserved; |
| 261 | u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 262 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 263 | |
| 264 | #define TIM_ELE_ID 5 |
| 265 | #define PARTIAL_VBM_MAX 251 |
| 266 | |
| 267 | struct wl1271_tim { |
| 268 | u8 identity; |
| 269 | u8 length; |
| 270 | u8 dtim_count; |
| 271 | u8 dtim_period; |
| 272 | u8 bitmap_ctrl; |
| 273 | u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 274 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 275 | |
| 276 | enum wl1271_cmd_ps_mode { |
| 277 | STATION_ACTIVE_MODE, |
| 278 | STATION_POWER_SAVE_MODE |
| 279 | }; |
| 280 | |
| 281 | struct wl1271_cmd_ps_params { |
| 282 | struct wl1271_cmd_header header; |
| 283 | |
| 284 | u8 ps_mode; /* STATION_* */ |
Eliad Peller | c8bde24 | 2011-02-02 09:59:35 +0200 | [diff] [blame] | 285 | u8 padding[3]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 286 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 287 | |
| 288 | /* HW encryption keys */ |
| 289 | #define NUM_ACCESS_CATEGORIES_COPY 4 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 290 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 291 | enum wl1271_cmd_key_action { |
| 292 | KEY_ADD_OR_REPLACE = 1, |
| 293 | KEY_REMOVE = 2, |
| 294 | KEY_SET_ID = 3, |
| 295 | MAX_KEY_ACTION = 0xffff, |
| 296 | }; |
| 297 | |
| 298 | enum wl1271_cmd_key_type { |
| 299 | KEY_NONE = 0, |
| 300 | KEY_WEP = 1, |
| 301 | KEY_TKIP = 2, |
| 302 | KEY_AES = 3, |
Juuso Oikarinen | 7a55724 | 2010-09-27 12:42:07 +0200 | [diff] [blame] | 303 | KEY_GEM = 4, |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 304 | }; |
| 305 | |
| 306 | /* FIXME: Add description for key-types */ |
| 307 | |
Arik Nemtsov | 98bdaab | 2010-10-16 18:08:58 +0200 | [diff] [blame] | 308 | struct wl1271_cmd_set_sta_keys { |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 309 | struct wl1271_cmd_header header; |
| 310 | |
| 311 | /* Ignored for default WEP key */ |
| 312 | u8 addr[ETH_ALEN]; |
| 313 | |
| 314 | /* key_action_e */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 315 | __le16 key_action; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 316 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 317 | __le16 reserved_1; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 318 | |
| 319 | /* key size in bytes */ |
| 320 | u8 key_size; |
| 321 | |
| 322 | /* key_type_e */ |
| 323 | u8 key_type; |
| 324 | u8 ssid_profile; |
| 325 | |
| 326 | /* |
| 327 | * TKIP, AES: frame's key id field. |
| 328 | * For WEP default key: key id; |
| 329 | */ |
| 330 | u8 id; |
| 331 | u8 reserved_2[6]; |
| 332 | u8 key[MAX_KEY_SIZE]; |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 333 | __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; |
| 334 | __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 335 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 336 | |
Arik Nemtsov | 98bdaab | 2010-10-16 18:08:58 +0200 | [diff] [blame] | 337 | enum wl1271_cmd_lid_key_type { |
| 338 | UNICAST_LID_TYPE = 0, |
| 339 | BROADCAST_LID_TYPE = 1, |
| 340 | WEP_DEFAULT_LID_TYPE = 2 |
| 341 | }; |
| 342 | |
| 343 | struct wl1271_cmd_set_ap_keys { |
| 344 | struct wl1271_cmd_header header; |
| 345 | |
| 346 | /* |
| 347 | * Indicates whether the HLID is a unicast key set |
| 348 | * or broadcast key set. A special value 0xFF is |
| 349 | * used to indicate that the HLID is on WEP-default |
| 350 | * (multi-hlids). of type wl1271_cmd_lid_key_type. |
| 351 | */ |
| 352 | u8 hlid; |
| 353 | |
| 354 | /* |
| 355 | * In WEP-default network (hlid == 0xFF) used to |
| 356 | * indicate which network STA/IBSS/AP role should be |
| 357 | * changed |
| 358 | */ |
| 359 | u8 lid_key_type; |
| 360 | |
| 361 | /* |
| 362 | * Key ID - For TKIP and AES key types, this field |
| 363 | * indicates the value that should be inserted into |
| 364 | * the KeyID field of frames transmitted using this |
| 365 | * key entry. For broadcast keys the index use as a |
| 366 | * marker for TX/RX key. |
| 367 | * For WEP default network (HLID=0xFF), this field |
| 368 | * indicates the ID of the key to add or remove. |
| 369 | */ |
| 370 | u8 key_id; |
| 371 | u8 reserved_1; |
| 372 | |
| 373 | /* key_action_e */ |
| 374 | __le16 key_action; |
| 375 | |
| 376 | /* key size in bytes */ |
| 377 | u8 key_size; |
| 378 | |
| 379 | /* key_type_e */ |
| 380 | u8 key_type; |
| 381 | |
| 382 | /* This field holds the security key data to add to the STA table */ |
| 383 | u8 key[MAX_KEY_SIZE]; |
| 384 | __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; |
| 385 | __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; |
| 386 | } __packed; |
| 387 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 388 | struct wl1271_cmd_test_header { |
| 389 | u8 id; |
| 390 | u8 padding[3]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 391 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 392 | |
| 393 | enum wl1271_channel_tune_bands { |
| 394 | WL1271_CHANNEL_TUNE_BAND_2_4, |
| 395 | WL1271_CHANNEL_TUNE_BAND_5, |
| 396 | WL1271_CHANNEL_TUNE_BAND_4_9 |
| 397 | }; |
| 398 | |
Juuso Oikarinen | 644a486 | 2010-10-05 13:11:56 +0200 | [diff] [blame] | 399 | #define WL1271_PD_REFERENCE_POINT_BAND_B_G 0 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 400 | |
Juuso Oikarinen | 644a486 | 2010-10-05 13:11:56 +0200 | [diff] [blame] | 401 | #define TEST_CMD_INI_FILE_RADIO_PARAM 0x19 |
| 402 | #define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E |
| 403 | #define TEST_CMD_INI_FILE_RF_EXTENDED_PARAM 0x26 |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 404 | |
| 405 | struct wl1271_general_parms_cmd { |
| 406 | struct wl1271_cmd_header header; |
| 407 | |
| 408 | struct wl1271_cmd_test_header test; |
| 409 | |
Juuso Oikarinen | eb70eb7 | 2010-05-14 10:46:22 +0300 | [diff] [blame] | 410 | struct wl1271_ini_general_params general_params; |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 411 | |
Juuso Oikarinen | eb70eb7 | 2010-05-14 10:46:22 +0300 | [diff] [blame] | 412 | u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM]; |
| 413 | u8 sr_sen_n_p; |
| 414 | u8 sr_sen_n_p_gain; |
| 415 | u8 sr_sen_nrn; |
| 416 | u8 sr_sen_prn; |
| 417 | u8 padding[3]; |
David S. Miller | 14599f1 | 2010-06-11 11:34:06 -0700 | [diff] [blame] | 418 | } __packed; |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 419 | |
Shahar Levi | 49d750ca | 2011-03-06 16:32:09 +0200 | [diff] [blame] | 420 | struct wl128x_general_parms_cmd { |
| 421 | struct wl1271_cmd_header header; |
| 422 | |
| 423 | struct wl1271_cmd_test_header test; |
| 424 | |
| 425 | struct wl128x_ini_general_params general_params; |
| 426 | |
| 427 | u8 sr_debug_table[WL1271_INI_MAX_SMART_REFLEX_PARAM]; |
| 428 | u8 sr_sen_n_p; |
| 429 | u8 sr_sen_n_p_gain; |
| 430 | u8 sr_sen_nrn; |
| 431 | u8 sr_sen_prn; |
| 432 | u8 padding[3]; |
| 433 | } __packed; |
| 434 | |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 435 | struct wl1271_radio_parms_cmd { |
| 436 | struct wl1271_cmd_header header; |
| 437 | |
| 438 | struct wl1271_cmd_test_header test; |
| 439 | |
Juuso Oikarinen | eb70eb7 | 2010-05-14 10:46:22 +0300 | [diff] [blame] | 440 | /* Static radio parameters */ |
| 441 | struct wl1271_ini_band_params_2 static_params_2; |
| 442 | struct wl1271_ini_band_params_5 static_params_5; |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 443 | |
Juuso Oikarinen | eb70eb7 | 2010-05-14 10:46:22 +0300 | [diff] [blame] | 444 | /* Dynamic radio parameters */ |
| 445 | struct wl1271_ini_fem_params_2 dyn_params_2; |
| 446 | u8 padding2; |
| 447 | struct wl1271_ini_fem_params_5 dyn_params_5; |
| 448 | u8 padding3[2]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 449 | } __packed; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 450 | |
Shahar Levi | 49d750ca | 2011-03-06 16:32:09 +0200 | [diff] [blame] | 451 | struct wl128x_radio_parms_cmd { |
| 452 | struct wl1271_cmd_header header; |
| 453 | |
| 454 | struct wl1271_cmd_test_header test; |
| 455 | |
| 456 | /* Static radio parameters */ |
| 457 | struct wl128x_ini_band_params_2 static_params_2; |
| 458 | struct wl128x_ini_band_params_5 static_params_5; |
| 459 | |
| 460 | u8 fem_vendor_and_options; |
| 461 | |
| 462 | /* Dynamic radio parameters */ |
| 463 | struct wl128x_ini_fem_params_2 dyn_params_2; |
| 464 | u8 padding2; |
| 465 | struct wl128x_ini_fem_params_5 dyn_params_5; |
| 466 | } __packed; |
| 467 | |
Juuso Oikarinen | 644a486 | 2010-10-05 13:11:56 +0200 | [diff] [blame] | 468 | struct wl1271_ext_radio_parms_cmd { |
| 469 | struct wl1271_cmd_header header; |
| 470 | |
| 471 | struct wl1271_cmd_test_header test; |
| 472 | |
| 473 | u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2]; |
| 474 | u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5]; |
| 475 | u8 padding[3]; |
| 476 | } __packed; |
| 477 | |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 478 | /* |
| 479 | * There are three types of disconnections: |
| 480 | * |
| 481 | * DISCONNECT_IMMEDIATE: the fw doesn't send any frames |
| 482 | * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason |
| 483 | * we have passed |
| 484 | * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason |
| 485 | * we have passed |
| 486 | */ |
| 487 | enum wl1271_disconnect_type { |
| 488 | DISCONNECT_IMMEDIATE, |
| 489 | DISCONNECT_DEAUTH, |
| 490 | DISCONNECT_DISASSOC |
| 491 | }; |
| 492 | |
| 493 | struct wl1271_cmd_disconnect { |
Luciano Coelho | 1ed9538 | 2010-04-01 11:38:18 +0300 | [diff] [blame] | 494 | struct wl1271_cmd_header header; |
| 495 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 496 | __le32 rx_config_options; |
| 497 | __le32 rx_filter_options; |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 498 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 499 | __le16 reason; |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 500 | u8 type; |
| 501 | |
| 502 | u8 padding; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 503 | } __packed; |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 504 | |
Juuso Oikarinen | be86cbe | 2010-05-27 12:53:01 +0300 | [diff] [blame] | 505 | #define WL1271_CMD_STA_STATE_CONNECTED 1 |
| 506 | |
| 507 | struct wl1271_cmd_set_sta_state { |
| 508 | struct wl1271_cmd_header header; |
| 509 | |
| 510 | u8 state; |
| 511 | u8 padding[3]; |
Luciano Coelho | 5082b82 | 2010-10-05 14:58:49 +0300 | [diff] [blame] | 512 | } __packed; |
Juuso Oikarinen | be86cbe | 2010-05-27 12:53:01 +0300 | [diff] [blame] | 513 | |
Arik Nemtsov | 98bdaab | 2010-10-16 18:08:58 +0200 | [diff] [blame] | 514 | enum wl1271_ssid_type { |
| 515 | SSID_TYPE_PUBLIC = 0, |
| 516 | SSID_TYPE_HIDDEN = 1 |
| 517 | }; |
| 518 | |
| 519 | struct wl1271_cmd_bss_start { |
| 520 | struct wl1271_cmd_header header; |
| 521 | |
| 522 | /* wl1271_ssid_type */ |
| 523 | u8 ssid_type; |
| 524 | u8 ssid_len; |
| 525 | u8 ssid[IW_ESSID_MAX_SIZE]; |
| 526 | u8 padding_1[2]; |
| 527 | |
| 528 | /* Basic rate set */ |
| 529 | __le32 basic_rate_set; |
| 530 | /* Aging period in seconds*/ |
| 531 | __le16 aging_period; |
| 532 | |
| 533 | /* |
| 534 | * This field specifies the time between target beacon |
| 535 | * transmission times (TBTTs), in time units (TUs). |
| 536 | * Valid values are 1 to 1024. |
| 537 | */ |
| 538 | __le16 beacon_interval; |
| 539 | u8 bssid[ETH_ALEN]; |
| 540 | u8 bss_index; |
| 541 | /* Radio band */ |
| 542 | u8 band; |
| 543 | u8 channel; |
| 544 | /* The host link id for the AP's global queue */ |
| 545 | u8 global_hlid; |
| 546 | /* The host link id for the AP's broadcast queue */ |
| 547 | u8 broadcast_hlid; |
| 548 | /* DTIM count */ |
| 549 | u8 dtim_interval; |
| 550 | /* Beacon expiry time in ms */ |
| 551 | u8 beacon_expiry; |
| 552 | u8 padding_2[3]; |
| 553 | } __packed; |
| 554 | |
| 555 | struct wl1271_cmd_add_sta { |
| 556 | struct wl1271_cmd_header header; |
| 557 | |
| 558 | u8 addr[ETH_ALEN]; |
| 559 | u8 hlid; |
| 560 | u8 aid; |
| 561 | u8 psd_type[NUM_ACCESS_CATEGORIES_COPY]; |
| 562 | __le32 supported_rates; |
| 563 | u8 bss_index; |
| 564 | u8 sp_len; |
| 565 | u8 wmm; |
| 566 | u8 padding1; |
| 567 | } __packed; |
| 568 | |
| 569 | struct wl1271_cmd_remove_sta { |
| 570 | struct wl1271_cmd_header header; |
| 571 | |
| 572 | u8 hlid; |
| 573 | u8 reason_opcode; |
| 574 | u8 send_deauth_flag; |
| 575 | u8 padding1; |
| 576 | } __packed; |
| 577 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 578 | #endif /* __WL1271_CMD_H__ */ |