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 | |
| 25 | #ifndef __WL1271_CMD_H__ |
| 26 | #define __WL1271_CMD_H__ |
| 27 | |
| 28 | #include "wl1271.h" |
| 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); |
| 35 | int wl1271_cmd_radio_parms(struct wl1271 *wl); |
Juuso Oikarinen | 1530549 | 2010-02-22 08:38:32 +0200 | [diff] [blame] | 36 | int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 37 | int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); |
| 38 | int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); |
| 39 | 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] | 40 | int wl1271_cmd_data_path(struct wl1271 *wl, bool enable); |
Juuso Oikarinen | d8c42c0 | 2010-02-18 13:25:36 +0200 | [diff] [blame] | 41 | int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode, bool send); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 42 | int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer, |
| 43 | size_t len); |
Kalle Valo | 818e306 | 2010-03-18 12:26:35 +0200 | [diff] [blame] | 44 | int wl1271_cmd_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, |
| 45 | const u8 *ie, size_t ie_len, u8 active_scan, |
| 46 | u8 high_prio, u8 band, u8 probe_requests); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 47 | int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id, |
| 48 | void *buf, size_t buf_len); |
| 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); |
Kalle Valo | 023e082 | 2010-03-18 12:26:36 +0200 | [diff] [blame^] | 54 | int wl1271_build_qos_null_data(struct wl1271 *wl); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 55 | int wl1271_cmd_set_default_wep_key(struct wl1271 *wl, u8 id); |
| 56 | int wl1271_cmd_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type, |
Juuso Oikarinen | ac4e4ce | 2009-10-08 21:56:19 +0300 | [diff] [blame] | 57 | u8 key_size, const u8 *key, const u8 *addr, |
| 58 | u32 tx_seq_32, u16 tx_seq_16); |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 59 | int wl1271_cmd_disconnect(struct wl1271 *wl); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 60 | |
| 61 | enum wl1271_commands { |
| 62 | CMD_INTERROGATE = 1, /*use this to read information elements*/ |
| 63 | CMD_CONFIGURE = 2, /*use this to write information elements*/ |
| 64 | CMD_ENABLE_RX = 3, |
| 65 | CMD_ENABLE_TX = 4, |
| 66 | CMD_DISABLE_RX = 5, |
| 67 | CMD_DISABLE_TX = 6, |
| 68 | CMD_SCAN = 8, |
| 69 | CMD_STOP_SCAN = 9, |
| 70 | CMD_START_JOIN = 11, |
| 71 | CMD_SET_KEYS = 12, |
| 72 | CMD_READ_MEMORY = 13, |
| 73 | CMD_WRITE_MEMORY = 14, |
| 74 | CMD_SET_TEMPLATE = 19, |
| 75 | CMD_TEST = 23, |
| 76 | CMD_NOISE_HIST = 28, |
| 77 | CMD_LNA_CONTROL = 32, |
| 78 | CMD_SET_BCN_MODE = 33, |
| 79 | CMD_MEASUREMENT = 34, |
| 80 | CMD_STOP_MEASUREMENT = 35, |
| 81 | CMD_DISCONNECT = 36, |
| 82 | CMD_SET_PS_MODE = 37, |
| 83 | CMD_CHANNEL_SWITCH = 38, |
| 84 | CMD_STOP_CHANNEL_SWICTH = 39, |
| 85 | CMD_AP_DISCOVERY = 40, |
| 86 | CMD_STOP_AP_DISCOVERY = 41, |
| 87 | CMD_SPS_SCAN = 42, |
| 88 | CMD_STOP_SPS_SCAN = 43, |
| 89 | CMD_HEALTH_CHECK = 45, |
| 90 | CMD_DEBUG = 46, |
| 91 | CMD_TRIGGER_SCAN_TO = 47, |
| 92 | CMD_CONNECTION_SCAN_CFG = 48, |
| 93 | CMD_CONNECTION_SCAN_SSID_CFG = 49, |
| 94 | CMD_START_PERIODIC_SCAN = 50, |
| 95 | CMD_STOP_PERIODIC_SCAN = 51, |
| 96 | CMD_SET_STA_STATE = 52, |
| 97 | |
| 98 | NUM_COMMANDS, |
| 99 | MAX_COMMAND_ID = 0xFFFF, |
| 100 | }; |
| 101 | |
| 102 | #define MAX_CMD_PARAMS 572 |
| 103 | |
| 104 | enum cmd_templ { |
| 105 | CMD_TEMPL_NULL_DATA = 0, |
| 106 | CMD_TEMPL_BEACON, |
| 107 | CMD_TEMPL_CFG_PROBE_REQ_2_4, |
| 108 | CMD_TEMPL_CFG_PROBE_REQ_5, |
| 109 | CMD_TEMPL_PROBE_RESPONSE, |
| 110 | CMD_TEMPL_QOS_NULL_DATA, |
| 111 | CMD_TEMPL_PS_POLL, |
| 112 | CMD_TEMPL_KLV, |
| 113 | CMD_TEMPL_DISCONNECT, |
| 114 | CMD_TEMPL_PROBE_REQ_2_4, /* for firmware internal use only */ |
| 115 | CMD_TEMPL_PROBE_REQ_5, /* for firmware internal use only */ |
| 116 | CMD_TEMPL_BAR, /* for firmware internal use only */ |
| 117 | CMD_TEMPL_CTS, /* |
| 118 | * For CTS-to-self (FastCTS) mechanism |
| 119 | * for BT/WLAN coexistence (SoftGemini). */ |
| 120 | CMD_TEMPL_MAX = 0xff |
| 121 | }; |
| 122 | |
| 123 | /* unit ms */ |
| 124 | #define WL1271_COMMAND_TIMEOUT 2000 |
| 125 | #define WL1271_CMD_TEMPL_MAX_SIZE 252 |
| 126 | |
| 127 | struct wl1271_cmd_header { |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 128 | __le16 id; |
| 129 | __le16 status; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 130 | /* payload */ |
| 131 | u8 data[0]; |
| 132 | } __attribute__ ((packed)); |
| 133 | |
| 134 | #define WL1271_CMD_MAX_PARAMS 572 |
| 135 | |
| 136 | struct wl1271_command { |
| 137 | struct wl1271_cmd_header header; |
| 138 | u8 parameters[WL1271_CMD_MAX_PARAMS]; |
| 139 | } __attribute__ ((packed)); |
| 140 | |
| 141 | enum { |
| 142 | CMD_MAILBOX_IDLE = 0, |
| 143 | CMD_STATUS_SUCCESS = 1, |
| 144 | CMD_STATUS_UNKNOWN_CMD = 2, |
| 145 | CMD_STATUS_UNKNOWN_IE = 3, |
| 146 | CMD_STATUS_REJECT_MEAS_SG_ACTIVE = 11, |
| 147 | CMD_STATUS_RX_BUSY = 13, |
| 148 | CMD_STATUS_INVALID_PARAM = 14, |
| 149 | CMD_STATUS_TEMPLATE_TOO_LARGE = 15, |
| 150 | CMD_STATUS_OUT_OF_MEMORY = 16, |
| 151 | CMD_STATUS_STA_TABLE_FULL = 17, |
| 152 | CMD_STATUS_RADIO_ERROR = 18, |
| 153 | CMD_STATUS_WRONG_NESTING = 19, |
| 154 | CMD_STATUS_TIMEOUT = 21, /* Driver internal use.*/ |
| 155 | CMD_STATUS_FW_RESET = 22, /* Driver internal use.*/ |
| 156 | MAX_COMMAND_STATUS = 0xff |
| 157 | }; |
| 158 | |
| 159 | |
| 160 | /* |
| 161 | * CMD_READ_MEMORY |
| 162 | * |
| 163 | * The host issues this command to read the WiLink device memory/registers. |
| 164 | * |
| 165 | * Note: The Base Band address has special handling (16 bits registers and |
| 166 | * addresses). For more information, see the hardware specification. |
| 167 | */ |
| 168 | /* |
| 169 | * CMD_WRITE_MEMORY |
| 170 | * |
| 171 | * The host issues this command to write the WiLink device memory/registers. |
| 172 | * |
| 173 | * The Base Band address has special handling (16 bits registers and |
| 174 | * addresses). For more information, see the hardware specification. |
| 175 | */ |
| 176 | #define MAX_READ_SIZE 256 |
| 177 | |
| 178 | struct cmd_read_write_memory { |
| 179 | struct wl1271_cmd_header header; |
| 180 | |
| 181 | /* The address of the memory to read from or write to.*/ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 182 | __le32 addr; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 183 | |
| 184 | /* The amount of data in bytes to read from or write to the WiLink |
| 185 | * device.*/ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 186 | __le32 size; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 187 | |
| 188 | /* The actual value read from or written to the Wilink. The source |
| 189 | of this field is the Host in WRITE command or the Wilink in READ |
| 190 | command. */ |
| 191 | u8 value[MAX_READ_SIZE]; |
Luciano Coelho | fb46f26 | 2009-10-15 10:33:30 +0300 | [diff] [blame] | 192 | } __attribute__ ((packed)); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 193 | |
| 194 | #define CMDMBOX_HEADER_LEN 4 |
| 195 | #define CMDMBOX_INFO_ELEM_HEADER_LEN 4 |
| 196 | |
| 197 | enum { |
| 198 | BSS_TYPE_IBSS = 0, |
| 199 | BSS_TYPE_STA_BSS = 2, |
| 200 | BSS_TYPE_AP_BSS = 3, |
| 201 | MAX_BSS_TYPE = 0xFF |
| 202 | }; |
| 203 | |
| 204 | #define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */ |
| 205 | #define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 |
Teemu Paasikivi | a410264 | 2009-10-13 12:47:51 +0300 | [diff] [blame] | 206 | #define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 207 | |
| 208 | struct wl1271_cmd_join { |
| 209 | struct wl1271_cmd_header header; |
| 210 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 211 | __le32 bssid_lsb; |
| 212 | __le16 bssid_msb; |
| 213 | __le16 beacon_interval; /* in TBTTs */ |
| 214 | __le32 rx_config_options; |
| 215 | __le32 rx_filter_options; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 216 | |
| 217 | /* |
| 218 | * The target uses this field to determine the rate at |
| 219 | * which to transmit control frame responses (such as |
| 220 | * ACK or CTS frames). |
| 221 | */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 222 | __le32 basic_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]; |
| 239 | } __attribute__ ((packed)); |
| 240 | |
| 241 | struct cmd_enabledisable_path { |
| 242 | struct wl1271_cmd_header header; |
| 243 | |
| 244 | u8 channel; |
| 245 | u8 padding[3]; |
| 246 | } __attribute__ ((packed)); |
| 247 | |
| 248 | struct wl1271_cmd_template_set { |
| 249 | struct wl1271_cmd_header header; |
| 250 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 251 | __le16 len; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 252 | u8 template_type; |
| 253 | u8 index; /* relevant only for KLV_TEMPLATE type */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 254 | __le32 enabled_rates; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 255 | u8 short_retry_limit; |
| 256 | u8 long_retry_limit; |
| 257 | u8 aflags; |
| 258 | u8 reserved; |
| 259 | u8 template_data[WL1271_CMD_TEMPL_MAX_SIZE]; |
| 260 | } __attribute__ ((packed)); |
| 261 | |
| 262 | #define TIM_ELE_ID 5 |
| 263 | #define PARTIAL_VBM_MAX 251 |
| 264 | |
| 265 | struct wl1271_tim { |
| 266 | u8 identity; |
| 267 | u8 length; |
| 268 | u8 dtim_count; |
| 269 | u8 dtim_period; |
| 270 | u8 bitmap_ctrl; |
| 271 | u8 pvb_field[PARTIAL_VBM_MAX]; /* Partial Virtual Bitmap */ |
| 272 | } __attribute__ ((packed)); |
| 273 | |
| 274 | enum wl1271_cmd_ps_mode { |
| 275 | STATION_ACTIVE_MODE, |
| 276 | STATION_POWER_SAVE_MODE |
| 277 | }; |
| 278 | |
| 279 | struct wl1271_cmd_ps_params { |
| 280 | struct wl1271_cmd_header header; |
| 281 | |
| 282 | u8 ps_mode; /* STATION_* */ |
| 283 | u8 send_null_data; /* Do we have to send NULL data packet ? */ |
| 284 | u8 retries; /* Number of retires for the initial NULL data packet */ |
| 285 | |
| 286 | /* |
| 287 | * TUs during which the target stays awake after switching |
| 288 | * to power save mode. |
| 289 | */ |
| 290 | u8 hang_over_period; |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 291 | __le32 null_data_rate; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 292 | } __attribute__ ((packed)); |
| 293 | |
| 294 | /* HW encryption keys */ |
| 295 | #define NUM_ACCESS_CATEGORIES_COPY 4 |
| 296 | #define MAX_KEY_SIZE 32 |
| 297 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 298 | enum wl1271_cmd_key_action { |
| 299 | KEY_ADD_OR_REPLACE = 1, |
| 300 | KEY_REMOVE = 2, |
| 301 | KEY_SET_ID = 3, |
| 302 | MAX_KEY_ACTION = 0xffff, |
| 303 | }; |
| 304 | |
| 305 | enum wl1271_cmd_key_type { |
| 306 | KEY_NONE = 0, |
| 307 | KEY_WEP = 1, |
| 308 | KEY_TKIP = 2, |
| 309 | KEY_AES = 3, |
| 310 | KEY_GEM = 4 |
| 311 | }; |
| 312 | |
| 313 | /* FIXME: Add description for key-types */ |
| 314 | |
| 315 | struct wl1271_cmd_set_keys { |
| 316 | struct wl1271_cmd_header header; |
| 317 | |
| 318 | /* Ignored for default WEP key */ |
| 319 | u8 addr[ETH_ALEN]; |
| 320 | |
| 321 | /* key_action_e */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 322 | __le16 key_action; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 323 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 324 | __le16 reserved_1; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 325 | |
| 326 | /* key size in bytes */ |
| 327 | u8 key_size; |
| 328 | |
| 329 | /* key_type_e */ |
| 330 | u8 key_type; |
| 331 | u8 ssid_profile; |
| 332 | |
| 333 | /* |
| 334 | * TKIP, AES: frame's key id field. |
| 335 | * For WEP default key: key id; |
| 336 | */ |
| 337 | u8 id; |
| 338 | u8 reserved_2[6]; |
| 339 | u8 key[MAX_KEY_SIZE]; |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 340 | __le16 ac_seq_num16[NUM_ACCESS_CATEGORIES_COPY]; |
| 341 | __le32 ac_seq_num32[NUM_ACCESS_CATEGORIES_COPY]; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 342 | } __attribute__ ((packed)); |
| 343 | |
| 344 | |
| 345 | #define WL1271_SCAN_MAX_CHANNELS 24 |
| 346 | #define WL1271_SCAN_DEFAULT_TAG 1 |
| 347 | #define WL1271_SCAN_CURRENT_TX_PWR 0 |
| 348 | #define WL1271_SCAN_OPT_ACTIVE 0 |
| 349 | #define WL1271_SCAN_OPT_PASSIVE 1 |
| 350 | #define WL1271_SCAN_OPT_PRIORITY_HIGH 4 |
| 351 | #define WL1271_SCAN_CHAN_MIN_DURATION 30000 /* TU */ |
| 352 | #define WL1271_SCAN_CHAN_MAX_DURATION 60000 /* TU */ |
Teemu Paasikivi | abb0b3b | 2009-10-13 12:47:50 +0300 | [diff] [blame] | 353 | #define WL1271_SCAN_BAND_2_4_GHZ 0 |
| 354 | #define WL1271_SCAN_BAND_5_GHZ 1 |
| 355 | #define WL1271_SCAN_BAND_DUAL 2 |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 356 | |
| 357 | struct basic_scan_params { |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 358 | __le32 rx_config_options; |
| 359 | __le32 rx_filter_options; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 360 | /* Scan option flags (WL1271_SCAN_OPT_*) */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 361 | __le16 scan_options; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 362 | /* Number of scan channels in the list (maximum 30) */ |
| 363 | u8 num_channels; |
| 364 | /* This field indicates the number of probe requests to send |
| 365 | per channel for an active scan */ |
| 366 | u8 num_probe_requests; |
| 367 | /* Rate bit field for sending the probes */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 368 | __le32 tx_rate; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 369 | u8 tid_trigger; |
| 370 | u8 ssid_len; |
| 371 | /* in order to align */ |
| 372 | u8 padding1[2]; |
| 373 | u8 ssid[IW_ESSID_MAX_SIZE]; |
| 374 | /* Band to scan */ |
| 375 | u8 band; |
| 376 | u8 use_ssid_list; |
| 377 | u8 scan_tag; |
| 378 | u8 padding2; |
| 379 | } __attribute__ ((packed)); |
| 380 | |
| 381 | struct basic_scan_channel_params { |
| 382 | /* Duration in TU to wait for frames on a channel for active scan */ |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 383 | __le32 min_duration; |
| 384 | __le32 max_duration; |
| 385 | __le32 bssid_lsb; |
| 386 | __le16 bssid_msb; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 387 | u8 early_termination; |
| 388 | u8 tx_power_att; |
| 389 | u8 channel; |
| 390 | /* FW internal use only! */ |
| 391 | u8 dfs_candidate; |
| 392 | u8 activity_detected; |
| 393 | u8 pad; |
| 394 | } __attribute__ ((packed)); |
| 395 | |
| 396 | struct wl1271_cmd_scan { |
| 397 | struct wl1271_cmd_header header; |
| 398 | |
| 399 | struct basic_scan_params params; |
| 400 | struct basic_scan_channel_params channels[WL1271_SCAN_MAX_CHANNELS]; |
| 401 | } __attribute__ ((packed)); |
| 402 | |
| 403 | struct wl1271_cmd_trigger_scan_to { |
| 404 | struct wl1271_cmd_header header; |
| 405 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 406 | __le32 timeout; |
Luciano Coelho | fb46f26 | 2009-10-15 10:33:30 +0300 | [diff] [blame] | 407 | } __attribute__ ((packed)); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 408 | |
| 409 | struct wl1271_cmd_test_header { |
| 410 | u8 id; |
| 411 | u8 padding[3]; |
Luciano Coelho | fb46f26 | 2009-10-15 10:33:30 +0300 | [diff] [blame] | 412 | } __attribute__ ((packed)); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 413 | |
| 414 | enum wl1271_channel_tune_bands { |
| 415 | WL1271_CHANNEL_TUNE_BAND_2_4, |
| 416 | WL1271_CHANNEL_TUNE_BAND_5, |
| 417 | WL1271_CHANNEL_TUNE_BAND_4_9 |
| 418 | }; |
| 419 | |
| 420 | #define WL1271_PD_REFERENCE_POINT_BAND_B_G 0 |
| 421 | |
| 422 | #define TEST_CMD_P2G_CAL 0x02 |
| 423 | #define TEST_CMD_CHANNEL_TUNE 0x0d |
| 424 | #define TEST_CMD_UPDATE_PD_REFERENCE_POINT 0x1d |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 425 | #define TEST_CMD_INI_FILE_RADIO_PARAM 0x19 |
| 426 | #define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E |
| 427 | |
| 428 | struct wl1271_general_parms_cmd { |
| 429 | struct wl1271_cmd_header header; |
| 430 | |
| 431 | struct wl1271_cmd_test_header test; |
| 432 | |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 433 | u8 params[WL1271_NVS_GENERAL_PARAMS_SIZE]; |
| 434 | s8 reserved[23]; |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 435 | } __attribute__ ((packed)); |
| 436 | |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 437 | #define WL1271_STAT_RADIO_PARAMS_5_SIZE 29 |
| 438 | #define WL1271_DYN_RADIO_PARAMS_5_SIZE 104 |
| 439 | |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 440 | struct wl1271_radio_parms_cmd { |
| 441 | struct wl1271_cmd_header header; |
| 442 | |
| 443 | struct wl1271_cmd_test_header test; |
| 444 | |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 445 | u8 stat_radio_params[WL1271_NVS_STAT_RADIO_PARAMS_SIZE]; |
| 446 | u8 stat_radio_params_5[WL1271_STAT_RADIO_PARAMS_5_SIZE]; |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 447 | |
Juuso Oikarinen | 152ee6e | 2010-02-18 13:25:42 +0200 | [diff] [blame] | 448 | u8 dyn_radio_params[WL1271_NVS_DYN_RADIO_PARAMS_SIZE]; |
| 449 | u8 reserved; |
| 450 | u8 dyn_radio_params_5[WL1271_DYN_RADIO_PARAMS_5_SIZE]; |
Luciano Coelho | 98b5dd5 | 2009-11-23 23:22:17 +0200 | [diff] [blame] | 451 | } __attribute__ ((packed)); |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 452 | |
| 453 | struct wl1271_cmd_cal_channel_tune { |
| 454 | struct wl1271_cmd_header header; |
| 455 | |
| 456 | struct wl1271_cmd_test_header test; |
| 457 | |
| 458 | u8 band; |
| 459 | u8 channel; |
| 460 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 461 | __le16 radio_status; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 462 | } __attribute__ ((packed)); |
| 463 | |
| 464 | struct wl1271_cmd_cal_update_ref_point { |
| 465 | struct wl1271_cmd_header header; |
| 466 | |
| 467 | struct wl1271_cmd_test_header test; |
| 468 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 469 | __le32 ref_power; |
| 470 | __le32 ref_detector; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 471 | u8 sub_band; |
| 472 | u8 padding[3]; |
| 473 | } __attribute__ ((packed)); |
| 474 | |
| 475 | #define MAX_TLV_LENGTH 400 |
| 476 | #define MAX_NVS_VERSION_LENGTH 12 |
| 477 | |
| 478 | #define WL1271_CAL_P2G_BAND_B_G BIT(0) |
| 479 | |
| 480 | struct wl1271_cmd_cal_p2g { |
| 481 | struct wl1271_cmd_header header; |
| 482 | |
| 483 | struct wl1271_cmd_test_header test; |
| 484 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 485 | __le16 len; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 486 | u8 buf[MAX_TLV_LENGTH]; |
| 487 | u8 type; |
| 488 | u8 padding; |
| 489 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 490 | __le16 radio_status; |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 491 | u8 nvs_version[MAX_NVS_VERSION_LENGTH]; |
| 492 | |
| 493 | u8 sub_band_mask; |
| 494 | u8 padding2; |
| 495 | } __attribute__ ((packed)); |
| 496 | |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 497 | |
| 498 | /* |
| 499 | * There are three types of disconnections: |
| 500 | * |
| 501 | * DISCONNECT_IMMEDIATE: the fw doesn't send any frames |
| 502 | * DISCONNECT_DEAUTH: the fw generates a DEAUTH request with the reason |
| 503 | * we have passed |
| 504 | * DISCONNECT_DISASSOC: the fw generates a DESASSOC request with the reason |
| 505 | * we have passed |
| 506 | */ |
| 507 | enum wl1271_disconnect_type { |
| 508 | DISCONNECT_IMMEDIATE, |
| 509 | DISCONNECT_DEAUTH, |
| 510 | DISCONNECT_DISASSOC |
| 511 | }; |
| 512 | |
| 513 | struct wl1271_cmd_disconnect { |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 514 | __le32 rx_config_options; |
| 515 | __le32 rx_filter_options; |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 516 | |
Luciano Coelho | d0f63b2 | 2009-10-15 10:33:29 +0300 | [diff] [blame] | 517 | __le16 reason; |
Luciano Coelho | 25a7dc6 | 2009-10-12 15:08:42 +0300 | [diff] [blame] | 518 | u8 type; |
| 519 | |
| 520 | u8 padding; |
| 521 | } __attribute__ ((packed)); |
| 522 | |
Luciano Coelho | f5fc0f8 | 2009-08-06 16:25:28 +0300 | [diff] [blame] | 523 | #endif /* __WL1271_CMD_H__ */ |