Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * This file function prototypes, data structure |
| 3 | * and definitions for all the host/station commands |
| 4 | */ |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 5 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 6 | #ifndef _LBS_HOST_H_ |
| 7 | #define _LBS_HOST_H_ |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 8 | |
Holger Schurig | f4228b4 | 2009-10-22 15:30:46 +0200 | [diff] [blame] | 9 | #include "types.h" |
| 10 | #include "defs.h" |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 11 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 12 | #define DEFAULT_AD_HOC_CHANNEL 6 |
| 13 | |
| 14 | #define CMD_OPTION_WAITFORRSP 0x0002 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 15 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 16 | /* Host command IDs */ |
Holger Schurig | 6b63cd0 | 2007-08-02 11:53:36 -0400 | [diff] [blame] | 17 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 18 | /* |
| 19 | * Return command are almost always the same as the host command, but with |
Holger Schurig | 6b63cd0 | 2007-08-02 11:53:36 -0400 | [diff] [blame] | 20 | * bit 15 set high. There are a few exceptions, though... |
| 21 | */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 22 | #define CMD_RET(cmd) (0x8000 | cmd) |
Holger Schurig | 6b63cd0 | 2007-08-02 11:53:36 -0400 | [diff] [blame] | 23 | |
| 24 | /* Return command convention exceptions: */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 25 | #define CMD_RET_802_11_ASSOCIATE 0x8012 |
Holger Schurig | 6b63cd0 | 2007-08-02 11:53:36 -0400 | [diff] [blame] | 26 | |
| 27 | /* Command codes */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 28 | #define CMD_GET_HW_SPEC 0x0003 |
| 29 | #define CMD_EEPROM_UPDATE 0x0004 |
| 30 | #define CMD_802_11_RESET 0x0005 |
| 31 | #define CMD_802_11_SCAN 0x0006 |
| 32 | #define CMD_802_11_GET_LOG 0x000b |
| 33 | #define CMD_MAC_MULTICAST_ADR 0x0010 |
| 34 | #define CMD_802_11_AUTHENTICATE 0x0011 |
| 35 | #define CMD_802_11_EEPROM_ACCESS 0x0059 |
| 36 | #define CMD_802_11_ASSOCIATE 0x0050 |
| 37 | #define CMD_802_11_SET_WEP 0x0013 |
| 38 | #define CMD_802_11_GET_STAT 0x0014 |
| 39 | #define CMD_802_3_GET_STAT 0x0015 |
| 40 | #define CMD_802_11_SNMP_MIB 0x0016 |
| 41 | #define CMD_MAC_REG_MAP 0x0017 |
| 42 | #define CMD_BBP_REG_MAP 0x0018 |
| 43 | #define CMD_MAC_REG_ACCESS 0x0019 |
| 44 | #define CMD_BBP_REG_ACCESS 0x001a |
| 45 | #define CMD_RF_REG_ACCESS 0x001b |
| 46 | #define CMD_802_11_RADIO_CONTROL 0x001c |
| 47 | #define CMD_802_11_RF_CHANNEL 0x001d |
| 48 | #define CMD_802_11_RF_TX_POWER 0x001e |
| 49 | #define CMD_802_11_RSSI 0x001f |
| 50 | #define CMD_802_11_RF_ANTENNA 0x0020 |
| 51 | #define CMD_802_11_PS_MODE 0x0021 |
| 52 | #define CMD_802_11_DATA_RATE 0x0022 |
| 53 | #define CMD_RF_REG_MAP 0x0023 |
| 54 | #define CMD_802_11_DEAUTHENTICATE 0x0024 |
| 55 | #define CMD_802_11_REASSOCIATE 0x0025 |
| 56 | #define CMD_MAC_CONTROL 0x0028 |
| 57 | #define CMD_802_11_AD_HOC_START 0x002b |
| 58 | #define CMD_802_11_AD_HOC_JOIN 0x002c |
| 59 | #define CMD_802_11_QUERY_TKIP_REPLY_CNTRS 0x002e |
| 60 | #define CMD_802_11_ENABLE_RSN 0x002f |
| 61 | #define CMD_802_11_SET_AFC 0x003c |
| 62 | #define CMD_802_11_GET_AFC 0x003d |
| 63 | #define CMD_802_11_DEEP_SLEEP 0x003e |
| 64 | #define CMD_802_11_AD_HOC_STOP 0x0040 |
| 65 | #define CMD_802_11_HOST_SLEEP_CFG 0x0043 |
| 66 | #define CMD_802_11_WAKEUP_CONFIRM 0x0044 |
| 67 | #define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045 |
| 68 | #define CMD_802_11_BEACON_STOP 0x0049 |
| 69 | #define CMD_802_11_MAC_ADDRESS 0x004d |
| 70 | #define CMD_802_11_LED_GPIO_CTRL 0x004e |
| 71 | #define CMD_802_11_EEPROM_ACCESS 0x0059 |
| 72 | #define CMD_802_11_BAND_CONFIG 0x0058 |
| 73 | #define CMD_GSPI_BUS_CONFIG 0x005a |
| 74 | #define CMD_802_11D_DOMAIN_INFO 0x005b |
| 75 | #define CMD_802_11_KEY_MATERIAL 0x005e |
| 76 | #define CMD_802_11_SLEEP_PARAMS 0x0066 |
| 77 | #define CMD_802_11_INACTIVITY_TIMEOUT 0x0067 |
| 78 | #define CMD_802_11_SLEEP_PERIOD 0x0068 |
| 79 | #define CMD_802_11_TPC_CFG 0x0072 |
| 80 | #define CMD_802_11_PA_CFG 0x0073 |
| 81 | #define CMD_802_11_FW_WAKE_METHOD 0x0074 |
| 82 | #define CMD_802_11_SUBSCRIBE_EVENT 0x0075 |
| 83 | #define CMD_802_11_RATE_ADAPT_RATESET 0x0076 |
| 84 | #define CMD_802_11_TX_RATE_QUERY 0x007f |
| 85 | #define CMD_GET_TSF 0x0080 |
| 86 | #define CMD_BT_ACCESS 0x0087 |
| 87 | #define CMD_FWT_ACCESS 0x0095 |
| 88 | #define CMD_802_11_MONITOR_MODE 0x0098 |
| 89 | #define CMD_MESH_ACCESS 0x009b |
| 90 | #define CMD_MESH_CONFIG_OLD 0x00a3 |
| 91 | #define CMD_MESH_CONFIG 0x00ac |
| 92 | #define CMD_SET_BOOT2_VER 0x00a5 |
| 93 | #define CMD_FUNC_INIT 0x00a9 |
| 94 | #define CMD_FUNC_SHUTDOWN 0x00aa |
| 95 | #define CMD_802_11_BEACON_CTRL 0x00b0 |
Brajesh Dave | 96287ac | 2007-11-20 17:44:28 -0500 | [diff] [blame] | 96 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 97 | /* For the IEEE Power Save */ |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 98 | #define PS_MODE_ACTION_ENTER_PS 0x0030 |
| 99 | #define PS_MODE_ACTION_EXIT_PS 0x0031 |
| 100 | #define PS_MODE_ACTION_SLEEP_CONFIRMED 0x0034 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 101 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 102 | #define CMD_ENABLE_RSN 0x0001 |
| 103 | #define CMD_DISABLE_RSN 0x0000 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 104 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 105 | #define CMD_ACT_GET 0x0000 |
| 106 | #define CMD_ACT_SET 0x0001 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 107 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 108 | /* Define action or option for CMD_802_11_SET_WEP */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 109 | #define CMD_ACT_ADD 0x0002 |
| 110 | #define CMD_ACT_REMOVE 0x0004 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 111 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 112 | #define CMD_TYPE_WEP_40_BIT 0x01 |
| 113 | #define CMD_TYPE_WEP_104_BIT 0x02 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 114 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 115 | #define CMD_NUM_OF_WEP_KEYS 4 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 116 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 117 | #define CMD_WEP_KEY_INDEX_MASK 0x3fff |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 118 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 119 | /* Define action or option for CMD_802_11_SCAN */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 120 | #define CMD_BSS_TYPE_BSS 0x0001 |
| 121 | #define CMD_BSS_TYPE_IBSS 0x0002 |
| 122 | #define CMD_BSS_TYPE_ANY 0x0003 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 123 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 124 | /* Define action or option for CMD_802_11_SCAN */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 125 | #define CMD_SCAN_TYPE_ACTIVE 0x0000 |
| 126 | #define CMD_SCAN_TYPE_PASSIVE 0x0001 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 127 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 128 | #define CMD_SCAN_RADIO_TYPE_BG 0 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 129 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 130 | #define CMD_SCAN_PROBE_DELAY_TIME 0 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 131 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 132 | /* Define action or option for CMD_MAC_CONTROL */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 133 | #define CMD_ACT_MAC_RX_ON 0x0001 |
| 134 | #define CMD_ACT_MAC_TX_ON 0x0002 |
| 135 | #define CMD_ACT_MAC_LOOPBACK_ON 0x0004 |
| 136 | #define CMD_ACT_MAC_WEP_ENABLE 0x0008 |
| 137 | #define CMD_ACT_MAC_INT_ENABLE 0x0010 |
| 138 | #define CMD_ACT_MAC_MULTICAST_ENABLE 0x0020 |
| 139 | #define CMD_ACT_MAC_BROADCAST_ENABLE 0x0040 |
| 140 | #define CMD_ACT_MAC_PROMISCUOUS_ENABLE 0x0080 |
| 141 | #define CMD_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100 |
| 142 | #define CMD_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 143 | |
Holger Schurig | 3a18864 | 2007-11-26 10:07:14 +0100 | [diff] [blame] | 144 | /* Event flags for CMD_802_11_SUBSCRIBE_EVENT */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 145 | #define CMD_SUBSCRIBE_RSSI_LOW 0x0001 |
| 146 | #define CMD_SUBSCRIBE_SNR_LOW 0x0002 |
| 147 | #define CMD_SUBSCRIBE_FAILCOUNT 0x0004 |
| 148 | #define CMD_SUBSCRIBE_BCNMISS 0x0008 |
| 149 | #define CMD_SUBSCRIBE_RSSI_HIGH 0x0010 |
| 150 | #define CMD_SUBSCRIBE_SNR_HIGH 0x0020 |
Holger Schurig | 3a18864 | 2007-11-26 10:07:14 +0100 | [diff] [blame] | 151 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 152 | #define RADIO_PREAMBLE_LONG 0x00 |
| 153 | #define RADIO_PREAMBLE_SHORT 0x02 |
| 154 | #define RADIO_PREAMBLE_AUTO 0x04 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 155 | |
| 156 | /* Define action or option for CMD_802_11_RF_CHANNEL */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 157 | #define CMD_OPT_802_11_RF_CHANNEL_GET 0x00 |
| 158 | #define CMD_OPT_802_11_RF_CHANNEL_SET 0x01 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 159 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 160 | /* Define action or option for CMD_802_11_DATA_RATE */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 161 | #define CMD_ACT_SET_TX_AUTO 0x0000 |
| 162 | #define CMD_ACT_SET_TX_FIX_RATE 0x0001 |
| 163 | #define CMD_ACT_GET_TX_RATE 0x0002 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 164 | |
David Woodhouse | b2c57ee | 2007-12-17 14:41:13 -0500 | [diff] [blame] | 165 | /* Options for CMD_802_11_FW_WAKE_METHOD */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 166 | #define CMD_WAKE_METHOD_UNCHANGED 0x0000 |
| 167 | #define CMD_WAKE_METHOD_COMMAND_INT 0x0001 |
| 168 | #define CMD_WAKE_METHOD_GPIO 0x0002 |
David Woodhouse | b2c57ee | 2007-12-17 14:41:13 -0500 | [diff] [blame] | 169 | |
Dan Williams | 39fcf7a | 2008-09-10 12:49:00 -0400 | [diff] [blame] | 170 | /* Object IDs for CMD_802_11_SNMP_MIB */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 171 | #define SNMP_MIB_OID_BSS_TYPE 0x0000 |
| 172 | #define SNMP_MIB_OID_OP_RATE_SET 0x0001 |
| 173 | #define SNMP_MIB_OID_BEACON_PERIOD 0x0002 /* Reserved on v9+ */ |
| 174 | #define SNMP_MIB_OID_DTIM_PERIOD 0x0003 /* Reserved on v9+ */ |
| 175 | #define SNMP_MIB_OID_ASSOC_TIMEOUT 0x0004 /* Reserved on v9+ */ |
| 176 | #define SNMP_MIB_OID_RTS_THRESHOLD 0x0005 |
| 177 | #define SNMP_MIB_OID_SHORT_RETRY_LIMIT 0x0006 |
| 178 | #define SNMP_MIB_OID_LONG_RETRY_LIMIT 0x0007 |
| 179 | #define SNMP_MIB_OID_FRAG_THRESHOLD 0x0008 |
| 180 | #define SNMP_MIB_OID_11D_ENABLE 0x0009 |
| 181 | #define SNMP_MIB_OID_11H_ENABLE 0x000A |
Dan Williams | 39fcf7a | 2008-09-10 12:49:00 -0400 | [diff] [blame] | 182 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 183 | /* Define action or option for CMD_BT_ACCESS */ |
Dan Williams | ffcae95 | 2007-08-02 11:35:46 -0400 | [diff] [blame] | 184 | enum cmd_bt_access_opts { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 185 | /* The bt commands start at 5 instead of 1 because the old dft commands |
| 186 | * are mapped to 1-4. These old commands are no longer maintained and |
| 187 | * should not be called. |
| 188 | */ |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 189 | CMD_ACT_BT_ACCESS_ADD = 5, |
| 190 | CMD_ACT_BT_ACCESS_DEL, |
| 191 | CMD_ACT_BT_ACCESS_LIST, |
| 192 | CMD_ACT_BT_ACCESS_RESET, |
| 193 | CMD_ACT_BT_ACCESS_SET_INVERT, |
| 194 | CMD_ACT_BT_ACCESS_GET_INVERT |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 195 | }; |
| 196 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 197 | /* Define action or option for CMD_FWT_ACCESS */ |
Dan Williams | ffcae95 | 2007-08-02 11:35:46 -0400 | [diff] [blame] | 198 | enum cmd_fwt_access_opts { |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 199 | CMD_ACT_FWT_ACCESS_ADD = 1, |
| 200 | CMD_ACT_FWT_ACCESS_DEL, |
| 201 | CMD_ACT_FWT_ACCESS_LOOKUP, |
| 202 | CMD_ACT_FWT_ACCESS_LIST, |
Dan Williams | 79a9a37 | 2007-12-11 15:29:10 -0500 | [diff] [blame] | 203 | CMD_ACT_FWT_ACCESS_LIST_ROUTE, |
| 204 | CMD_ACT_FWT_ACCESS_LIST_NEIGHBOR, |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 205 | CMD_ACT_FWT_ACCESS_RESET, |
| 206 | CMD_ACT_FWT_ACCESS_CLEANUP, |
| 207 | CMD_ACT_FWT_ACCESS_TIME, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 208 | }; |
| 209 | |
Anna Neal | 582c1b5 | 2008-10-20 16:46:56 -0700 | [diff] [blame] | 210 | /* Define action or option for CMD_802_11_HOST_SLEEP_CFG */ |
| 211 | enum cmd_wol_cfg_opts { |
| 212 | CMD_ACT_ACTION_NONE = 0, |
| 213 | CMD_ACT_SET_WOL_RULE, |
| 214 | CMD_ACT_GET_WOL_RULE, |
| 215 | CMD_ACT_RESET_WOL_RULE, |
| 216 | }; |
| 217 | |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 218 | /* Define action or option for CMD_MESH_ACCESS */ |
Dan Williams | ffcae95 | 2007-08-02 11:35:46 -0400 | [diff] [blame] | 219 | enum cmd_mesh_access_opts { |
Dan Williams | 0aef64d | 2007-08-02 11:31:18 -0400 | [diff] [blame] | 220 | CMD_ACT_MESH_GET_TTL = 1, |
| 221 | CMD_ACT_MESH_SET_TTL, |
| 222 | CMD_ACT_MESH_GET_STATS, |
| 223 | CMD_ACT_MESH_GET_ANYCAST, |
| 224 | CMD_ACT_MESH_SET_ANYCAST, |
Dan Williams | 276c015 | 2007-08-02 11:34:24 -0400 | [diff] [blame] | 225 | CMD_ACT_MESH_SET_LINK_COSTS, |
| 226 | CMD_ACT_MESH_GET_LINK_COSTS, |
| 227 | CMD_ACT_MESH_SET_BCAST_RATE, |
| 228 | CMD_ACT_MESH_GET_BCAST_RATE, |
| 229 | CMD_ACT_MESH_SET_RREQ_DELAY, |
| 230 | CMD_ACT_MESH_GET_RREQ_DELAY, |
| 231 | CMD_ACT_MESH_SET_ROUTE_EXP, |
| 232 | CMD_ACT_MESH_GET_ROUTE_EXP, |
Luis Carlos Cobo | a9f38d0 | 2007-08-02 11:52:29 -0400 | [diff] [blame] | 233 | CMD_ACT_MESH_SET_AUTOSTART_ENABLED, |
| 234 | CMD_ACT_MESH_GET_AUTOSTART_ENABLED, |
Anna Neal | 6fb5325 | 2008-12-09 13:23:45 -0800 | [diff] [blame] | 235 | CMD_ACT_MESH_SET_GET_PRB_RSP_LIMIT = 17, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 236 | }; |
| 237 | |
Javier Cardona | edaea5c | 2008-05-17 00:55:10 -0700 | [diff] [blame] | 238 | /* Define actions and types for CMD_MESH_CONFIG */ |
| 239 | enum cmd_mesh_config_actions { |
| 240 | CMD_ACT_MESH_CONFIG_STOP = 0, |
| 241 | CMD_ACT_MESH_CONFIG_START, |
| 242 | CMD_ACT_MESH_CONFIG_SET, |
| 243 | CMD_ACT_MESH_CONFIG_GET, |
| 244 | }; |
| 245 | |
| 246 | enum cmd_mesh_config_types { |
| 247 | CMD_TYPE_MESH_SET_BOOTFLAG = 1, |
| 248 | CMD_TYPE_MESH_SET_BOOTTIME, |
| 249 | CMD_TYPE_MESH_SET_DEF_CHANNEL, |
| 250 | CMD_TYPE_MESH_SET_MESH_IE, |
| 251 | CMD_TYPE_MESH_GET_DEFAULTS, |
| 252 | CMD_TYPE_MESH_GET_MESH_IE, /* GET_DEFAULTS is superset of GET_MESHIE */ |
| 253 | }; |
| 254 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 255 | /* Card Event definition */ |
David Woodhouse | 387a1f0 | 2007-12-11 18:53:20 -0500 | [diff] [blame] | 256 | #define MACREG_INT_CODE_TX_PPA_FREE 0 |
| 257 | #define MACREG_INT_CODE_TX_DMA_DONE 1 |
| 258 | #define MACREG_INT_CODE_LINK_LOST_W_SCAN 2 |
| 259 | #define MACREG_INT_CODE_LINK_LOST_NO_SCAN 3 |
| 260 | #define MACREG_INT_CODE_LINK_SENSED 4 |
| 261 | #define MACREG_INT_CODE_CMD_FINISHED 5 |
| 262 | #define MACREG_INT_CODE_MIB_CHANGED 6 |
| 263 | #define MACREG_INT_CODE_INIT_DONE 7 |
| 264 | #define MACREG_INT_CODE_DEAUTHENTICATED 8 |
| 265 | #define MACREG_INT_CODE_DISASSOCIATED 9 |
| 266 | #define MACREG_INT_CODE_PS_AWAKE 10 |
| 267 | #define MACREG_INT_CODE_PS_SLEEP 11 |
| 268 | #define MACREG_INT_CODE_MIC_ERR_MULTICAST 13 |
| 269 | #define MACREG_INT_CODE_MIC_ERR_UNICAST 14 |
| 270 | #define MACREG_INT_CODE_WM_AWAKE 15 |
| 271 | #define MACREG_INT_CODE_DEEP_SLEEP_AWAKE 16 |
| 272 | #define MACREG_INT_CODE_ADHOC_BCN_LOST 17 |
| 273 | #define MACREG_INT_CODE_HOST_AWAKE 18 |
| 274 | #define MACREG_INT_CODE_STOP_TX 19 |
| 275 | #define MACREG_INT_CODE_START_TX 20 |
| 276 | #define MACREG_INT_CODE_CHANNEL_SWITCH 21 |
| 277 | #define MACREG_INT_CODE_MEASUREMENT_RDY 22 |
| 278 | #define MACREG_INT_CODE_WMM_CHANGE 23 |
| 279 | #define MACREG_INT_CODE_BG_SCAN_REPORT 24 |
| 280 | #define MACREG_INT_CODE_RSSI_LOW 25 |
| 281 | #define MACREG_INT_CODE_SNR_LOW 26 |
| 282 | #define MACREG_INT_CODE_MAX_FAIL 27 |
| 283 | #define MACREG_INT_CODE_RSSI_HIGH 28 |
| 284 | #define MACREG_INT_CODE_SNR_HIGH 29 |
| 285 | #define MACREG_INT_CODE_MESH_AUTO_STARTED 35 |
| 286 | #define MACREG_INT_CODE_FIRMWARE_READY 48 |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 287 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 288 | |
| 289 | /* 802.11-related definitions */ |
| 290 | |
| 291 | /* TxPD descriptor */ |
| 292 | struct txpd { |
| 293 | /* union to cope up with later FW revisions */ |
| 294 | union { |
| 295 | /* Current Tx packet status */ |
| 296 | __le32 tx_status; |
| 297 | struct { |
| 298 | /* BSS type: client, AP, etc. */ |
| 299 | u8 bss_type; |
| 300 | /* BSS number */ |
| 301 | u8 bss_num; |
| 302 | /* Reserved */ |
| 303 | __le16 reserved; |
| 304 | } bss; |
| 305 | } u; |
| 306 | /* Tx control */ |
| 307 | __le32 tx_control; |
| 308 | __le32 tx_packet_location; |
| 309 | /* Tx packet length */ |
| 310 | __le16 tx_packet_length; |
| 311 | /* First 2 byte of destination MAC address */ |
| 312 | u8 tx_dest_addr_high[2]; |
| 313 | /* Last 4 byte of destination MAC address */ |
| 314 | u8 tx_dest_addr_low[4]; |
| 315 | /* Pkt Priority */ |
| 316 | u8 priority; |
| 317 | /* Pkt Trasnit Power control */ |
| 318 | u8 powermgmt; |
| 319 | /* Amount of time the packet has been queued (units = 2ms) */ |
| 320 | u8 pktdelay_2ms; |
| 321 | /* reserved */ |
| 322 | u8 reserved1; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 323 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 324 | |
| 325 | /* RxPD Descriptor */ |
| 326 | struct rxpd { |
| 327 | /* union to cope up with later FW revisions */ |
| 328 | union { |
| 329 | /* Current Rx packet status */ |
| 330 | __le16 status; |
| 331 | struct { |
| 332 | /* BSS type: client, AP, etc. */ |
| 333 | u8 bss_type; |
| 334 | /* BSS number */ |
| 335 | u8 bss_num; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 336 | } __packed bss; |
| 337 | } __packed u; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 338 | |
| 339 | /* SNR */ |
| 340 | u8 snr; |
| 341 | |
| 342 | /* Tx control */ |
| 343 | u8 rx_control; |
| 344 | |
| 345 | /* Pkt length */ |
| 346 | __le16 pkt_len; |
| 347 | |
| 348 | /* Noise Floor */ |
| 349 | u8 nf; |
| 350 | |
| 351 | /* Rx Packet Rate */ |
| 352 | u8 rx_rate; |
| 353 | |
| 354 | /* Pkt addr */ |
| 355 | __le32 pkt_ptr; |
| 356 | |
| 357 | /* Next Rx RxPD addr */ |
| 358 | __le32 next_rxpd_ptr; |
| 359 | |
| 360 | /* Pkt Priority */ |
| 361 | u8 priority; |
| 362 | u8 reserved[3]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 363 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 364 | |
| 365 | struct cmd_header { |
| 366 | __le16 command; |
| 367 | __le16 size; |
| 368 | __le16 seqnum; |
| 369 | __le16 result; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 370 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 371 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 372 | /* Generic structure to hold all key types. */ |
| 373 | struct enc_key { |
| 374 | u16 len; |
| 375 | u16 flags; /* KEY_INFO_* from defs.h */ |
| 376 | u16 type; /* KEY_TYPE_* from defs.h */ |
| 377 | u8 key[32]; |
| 378 | }; |
| 379 | |
| 380 | /* lbs_offset_value */ |
| 381 | struct lbs_offset_value { |
| 382 | u32 offset; |
| 383 | u32 value; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 384 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 385 | |
Dan Williams | cc4b9d3 | 2010-07-27 12:56:05 -0700 | [diff] [blame] | 386 | #define MAX_11D_TRIPLETS 83 |
Kiran Divekar | 1047d5e | 2010-06-04 23:20:42 -0700 | [diff] [blame] | 387 | |
| 388 | struct mrvl_ie_domain_param_set { |
| 389 | struct mrvl_ie_header header; |
| 390 | |
Bing Zhao | 80751e2 | 2011-03-07 11:14:23 -0800 | [diff] [blame] | 391 | u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; |
Dan Williams | cc4b9d3 | 2010-07-27 12:56:05 -0700 | [diff] [blame] | 392 | struct ieee80211_country_ie_triplet triplet[MAX_11D_TRIPLETS]; |
John W. Linville | beabe91 | 2010-07-14 10:37:03 -0400 | [diff] [blame] | 393 | } __packed; |
Kiran Divekar | 1047d5e | 2010-06-04 23:20:42 -0700 | [diff] [blame] | 394 | |
| 395 | struct cmd_ds_802_11d_domain_info { |
Dan Williams | cc4b9d3 | 2010-07-27 12:56:05 -0700 | [diff] [blame] | 396 | struct cmd_header hdr; |
| 397 | |
Kiran Divekar | 1047d5e | 2010-06-04 23:20:42 -0700 | [diff] [blame] | 398 | __le16 action; |
| 399 | struct mrvl_ie_domain_param_set domain; |
John W. Linville | beabe91 | 2010-07-14 10:37:03 -0400 | [diff] [blame] | 400 | } __packed; |
Kiran Divekar | 1047d5e | 2010-06-04 23:20:42 -0700 | [diff] [blame] | 401 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 402 | /* |
| 403 | * Define data structure for CMD_GET_HW_SPEC |
| 404 | * This structure defines the response for the GET_HW_SPEC command |
| 405 | */ |
| 406 | struct cmd_ds_get_hw_spec { |
| 407 | struct cmd_header hdr; |
| 408 | |
| 409 | /* HW Interface version number */ |
| 410 | __le16 hwifversion; |
| 411 | /* HW version number */ |
| 412 | __le16 version; |
| 413 | /* Max number of TxPD FW can handle */ |
| 414 | __le16 nr_txpd; |
| 415 | /* Max no of Multicast address */ |
| 416 | __le16 nr_mcast_adr; |
| 417 | /* MAC address */ |
| 418 | u8 permanentaddr[6]; |
| 419 | |
| 420 | /* region Code */ |
| 421 | __le16 regioncode; |
| 422 | |
| 423 | /* Number of antenna used */ |
| 424 | __le16 nr_antenna; |
| 425 | |
| 426 | /* FW release number, example 0x01030304 = 2.3.4p1 */ |
| 427 | __le32 fwrelease; |
| 428 | |
| 429 | /* Base Address of TxPD queue */ |
| 430 | __le32 wcb_base; |
| 431 | /* Read Pointer of RxPd queue */ |
| 432 | __le32 rxpd_rdptr; |
| 433 | |
| 434 | /* Write Pointer of RxPd queue */ |
| 435 | __le32 rxpd_wrptr; |
| 436 | |
| 437 | /*FW/HW capability */ |
| 438 | __le32 fwcapinfo; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 439 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 440 | |
| 441 | struct cmd_ds_802_11_subscribe_event { |
| 442 | struct cmd_header hdr; |
| 443 | |
| 444 | __le16 action; |
| 445 | __le16 events; |
| 446 | |
| 447 | /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a |
| 448 | * number of TLVs. From the v5.1 manual, those TLVs would add up to |
| 449 | * 40 bytes. However, future firmware might add additional TLVs, so I |
| 450 | * bump this up a bit. |
| 451 | */ |
| 452 | uint8_t tlv[128]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 453 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 454 | |
| 455 | /* |
| 456 | * This scan handle Country Information IE(802.11d compliant) |
| 457 | * Define data structure for CMD_802_11_SCAN |
| 458 | */ |
| 459 | struct cmd_ds_802_11_scan { |
| 460 | struct cmd_header hdr; |
| 461 | |
| 462 | uint8_t bsstype; |
| 463 | uint8_t bssid[ETH_ALEN]; |
| 464 | uint8_t tlvbuffer[0]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 465 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 466 | |
| 467 | struct cmd_ds_802_11_scan_rsp { |
| 468 | struct cmd_header hdr; |
| 469 | |
| 470 | __le16 bssdescriptsize; |
| 471 | uint8_t nr_sets; |
| 472 | uint8_t bssdesc_and_tlvbuffer[0]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 473 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 474 | |
| 475 | struct cmd_ds_802_11_get_log { |
| 476 | struct cmd_header hdr; |
| 477 | |
| 478 | __le32 mcasttxframe; |
| 479 | __le32 failed; |
| 480 | __le32 retry; |
| 481 | __le32 multiretry; |
| 482 | __le32 framedup; |
| 483 | __le32 rtssuccess; |
| 484 | __le32 rtsfailure; |
| 485 | __le32 ackfailure; |
| 486 | __le32 rxfrag; |
| 487 | __le32 mcastrxframe; |
| 488 | __le32 fcserror; |
| 489 | __le32 txframe; |
| 490 | __le32 wepundecryptable; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 491 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 492 | |
| 493 | struct cmd_ds_mac_control { |
| 494 | struct cmd_header hdr; |
| 495 | __le16 action; |
| 496 | u16 reserved; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 497 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 498 | |
| 499 | struct cmd_ds_mac_multicast_adr { |
| 500 | struct cmd_header hdr; |
| 501 | __le16 action; |
| 502 | __le16 nr_of_adrs; |
| 503 | u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 504 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 505 | |
| 506 | struct cmd_ds_802_11_authenticate { |
| 507 | struct cmd_header hdr; |
| 508 | |
| 509 | u8 bssid[ETH_ALEN]; |
| 510 | u8 authtype; |
| 511 | u8 reserved[10]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 512 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 513 | |
| 514 | struct cmd_ds_802_11_deauthenticate { |
| 515 | struct cmd_header hdr; |
| 516 | |
| 517 | u8 macaddr[ETH_ALEN]; |
| 518 | __le16 reasoncode; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 519 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 520 | |
| 521 | struct cmd_ds_802_11_associate { |
| 522 | struct cmd_header hdr; |
| 523 | |
| 524 | u8 bssid[6]; |
| 525 | __le16 capability; |
| 526 | __le16 listeninterval; |
| 527 | __le16 bcnperiod; |
| 528 | u8 dtimperiod; |
| 529 | u8 iebuf[512]; /* Enough for required and most optional IEs */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 530 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 531 | |
| 532 | struct cmd_ds_802_11_associate_response { |
| 533 | struct cmd_header hdr; |
| 534 | |
| 535 | __le16 capability; |
| 536 | __le16 statuscode; |
| 537 | __le16 aid; |
| 538 | u8 iebuf[512]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 539 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 540 | |
| 541 | struct cmd_ds_802_11_set_wep { |
| 542 | struct cmd_header hdr; |
| 543 | |
| 544 | /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */ |
| 545 | __le16 action; |
| 546 | |
| 547 | /* key Index selected for Tx */ |
| 548 | __le16 keyindex; |
| 549 | |
| 550 | /* 40, 128bit or TXWEP */ |
| 551 | uint8_t keytype[4]; |
| 552 | uint8_t keymaterial[4][16]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 553 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 554 | |
| 555 | struct cmd_ds_802_11_snmp_mib { |
| 556 | struct cmd_header hdr; |
| 557 | |
| 558 | __le16 action; |
| 559 | __le16 oid; |
| 560 | __le16 bufsize; |
| 561 | u8 value[128]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 562 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 563 | |
Dan Williams | 4c7c6e00 | 2010-07-27 13:01:07 -0700 | [diff] [blame] | 564 | struct cmd_ds_reg_access { |
| 565 | struct cmd_header hdr; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 566 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 567 | __le16 action; |
| 568 | __le16 offset; |
Dan Williams | 4c7c6e00 | 2010-07-27 13:01:07 -0700 | [diff] [blame] | 569 | union { |
| 570 | u8 bbp_rf; /* for BBP and RF registers */ |
| 571 | __le32 mac; /* for MAC registers */ |
| 572 | } value; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 573 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 574 | |
| 575 | struct cmd_ds_802_11_radio_control { |
| 576 | struct cmd_header hdr; |
| 577 | |
| 578 | __le16 action; |
| 579 | __le16 control; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 580 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 581 | |
| 582 | struct cmd_ds_802_11_beacon_control { |
Dan Williams | d6541c7 | 2010-07-27 12:58:08 -0700 | [diff] [blame] | 583 | struct cmd_header hdr; |
| 584 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 585 | __le16 action; |
| 586 | __le16 beacon_enable; |
| 587 | __le16 beacon_period; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 588 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 589 | |
| 590 | struct cmd_ds_802_11_sleep_params { |
| 591 | struct cmd_header hdr; |
| 592 | |
| 593 | /* ACT_GET/ACT_SET */ |
| 594 | __le16 action; |
| 595 | |
| 596 | /* Sleep clock error in ppm */ |
| 597 | __le16 error; |
| 598 | |
| 599 | /* Wakeup offset in usec */ |
| 600 | __le16 offset; |
| 601 | |
| 602 | /* Clock stabilization time in usec */ |
| 603 | __le16 stabletime; |
| 604 | |
| 605 | /* control periodic calibration */ |
| 606 | uint8_t calcontrol; |
| 607 | |
| 608 | /* control the use of external sleep clock */ |
| 609 | uint8_t externalsleepclk; |
| 610 | |
| 611 | /* reserved field, should be set to zero */ |
| 612 | __le16 reserved; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 613 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 614 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 615 | struct cmd_ds_802_11_rf_channel { |
| 616 | struct cmd_header hdr; |
| 617 | |
| 618 | __le16 action; |
| 619 | __le16 channel; |
| 620 | __le16 rftype; /* unused */ |
| 621 | __le16 reserved; /* unused */ |
| 622 | u8 channellist[32]; /* unused */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 623 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 624 | |
| 625 | struct cmd_ds_802_11_rssi { |
Dan Williams | 9fb7663 | 2010-07-27 12:55:21 -0700 | [diff] [blame] | 626 | struct cmd_header hdr; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 627 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 628 | /* |
| 629 | * request: number of beacons (N) to average the SNR and NF over |
Dan Williams | 9fb7663 | 2010-07-27 12:55:21 -0700 | [diff] [blame] | 630 | * response: SNR of most recent beacon |
| 631 | */ |
| 632 | __le16 n_or_snr; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 633 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 634 | /* |
| 635 | * The following fields are only set in the response. |
Dan Williams | 9fb7663 | 2010-07-27 12:55:21 -0700 | [diff] [blame] | 636 | * In the request these are reserved and should be set to 0. |
| 637 | */ |
| 638 | __le16 nf; /* most recent beacon noise floor */ |
| 639 | __le16 avg_snr; /* average SNR weighted by N from request */ |
| 640 | __le16 avg_nf; /* average noise floor weighted by N from request */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 641 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 642 | |
| 643 | struct cmd_ds_802_11_mac_address { |
| 644 | struct cmd_header hdr; |
| 645 | |
| 646 | __le16 action; |
| 647 | u8 macadd[ETH_ALEN]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 648 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 649 | |
| 650 | struct cmd_ds_802_11_rf_tx_power { |
| 651 | struct cmd_header hdr; |
| 652 | |
| 653 | __le16 action; |
| 654 | __le16 curlevel; |
| 655 | s8 maxlevel; |
| 656 | s8 minlevel; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 657 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 658 | |
Dan Williams | a45b6f4 | 2010-07-27 12:54:34 -0700 | [diff] [blame] | 659 | /* MONITOR_MODE only exists in OLPC v5 firmware */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 660 | struct cmd_ds_802_11_monitor_mode { |
Dan Williams | a45b6f4 | 2010-07-27 12:54:34 -0700 | [diff] [blame] | 661 | struct cmd_header hdr; |
| 662 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 663 | __le16 action; |
| 664 | __le16 mode; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 665 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 666 | |
| 667 | struct cmd_ds_set_boot2_ver { |
| 668 | struct cmd_header hdr; |
| 669 | |
| 670 | __le16 action; |
| 671 | __le16 version; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 672 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 673 | |
| 674 | struct cmd_ds_802_11_fw_wake_method { |
| 675 | struct cmd_header hdr; |
| 676 | |
| 677 | __le16 action; |
| 678 | __le16 method; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 679 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 680 | |
| 681 | struct cmd_ds_802_11_ps_mode { |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 682 | struct cmd_header hdr; |
| 683 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 684 | __le16 action; |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 685 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 686 | /* |
| 687 | * Interval for keepalive in PS mode: |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 688 | * 0x0000 = don't change |
| 689 | * 0x001E = firmware default |
| 690 | * 0xFFFF = disable |
| 691 | */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 692 | __le16 nullpktinterval; |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 693 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 694 | /* |
| 695 | * Number of DTIM intervals to wake up for: |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 696 | * 0 = don't change |
| 697 | * 1 = firmware default |
| 698 | * 5 = max |
| 699 | */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 700 | __le16 multipledtim; |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 701 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 702 | __le16 reserved; |
| 703 | __le16 locallisteninterval; |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 704 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 705 | /* |
| 706 | * AdHoc awake period (FW v9+ only): |
Dan Williams | 0bb6408 | 2010-07-27 13:08:08 -0700 | [diff] [blame] | 707 | * 0 = don't change |
| 708 | * 1 = always awake (IEEE standard behavior) |
| 709 | * 2 - 31 = sleep for (n - 1) periods and awake for 1 period |
| 710 | * 32 - 254 = invalid |
| 711 | * 255 = sleep at each ATIM |
| 712 | */ |
| 713 | __le16 adhoc_awake_period; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 714 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 715 | |
| 716 | struct cmd_confirm_sleep { |
| 717 | struct cmd_header hdr; |
| 718 | |
| 719 | __le16 action; |
| 720 | __le16 nullpktinterval; |
| 721 | __le16 multipledtim; |
| 722 | __le16 reserved; |
| 723 | __le16 locallisteninterval; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 724 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 725 | |
| 726 | struct cmd_ds_802_11_data_rate { |
| 727 | struct cmd_header hdr; |
| 728 | |
| 729 | __le16 action; |
| 730 | __le16 reserved; |
| 731 | u8 rates[MAX_RATES]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 732 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 733 | |
| 734 | struct cmd_ds_802_11_rate_adapt_rateset { |
| 735 | struct cmd_header hdr; |
| 736 | __le16 action; |
| 737 | __le16 enablehwauto; |
| 738 | __le16 bitmap; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 739 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 740 | |
| 741 | struct cmd_ds_802_11_ad_hoc_start { |
| 742 | struct cmd_header hdr; |
| 743 | |
Holger Schurig | 243e84e | 2009-10-22 15:30:47 +0200 | [diff] [blame] | 744 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 745 | u8 bsstype; |
| 746 | __le16 beaconperiod; |
| 747 | u8 dtimperiod; /* Reserved on v9 and later */ |
| 748 | struct ieee_ie_ibss_param_set ibss; |
| 749 | u8 reserved1[4]; |
| 750 | struct ieee_ie_ds_param_set ds; |
| 751 | u8 reserved2[4]; |
| 752 | __le16 probedelay; /* Reserved on v9 and later */ |
| 753 | __le16 capability; |
| 754 | u8 rates[MAX_RATES]; |
| 755 | u8 tlv_memory_size_pad[100]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 756 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 757 | |
| 758 | struct cmd_ds_802_11_ad_hoc_result { |
| 759 | struct cmd_header hdr; |
| 760 | |
| 761 | u8 pad[3]; |
| 762 | u8 bssid[ETH_ALEN]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 763 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 764 | |
| 765 | struct adhoc_bssdesc { |
| 766 | u8 bssid[ETH_ALEN]; |
Holger Schurig | 243e84e | 2009-10-22 15:30:47 +0200 | [diff] [blame] | 767 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 768 | u8 type; |
| 769 | __le16 beaconperiod; |
| 770 | u8 dtimperiod; |
| 771 | __le64 timestamp; |
| 772 | __le64 localtime; |
| 773 | struct ieee_ie_ds_param_set ds; |
| 774 | u8 reserved1[4]; |
| 775 | struct ieee_ie_ibss_param_set ibss; |
| 776 | u8 reserved2[4]; |
| 777 | __le16 capability; |
| 778 | u8 rates[MAX_RATES]; |
| 779 | |
Randy Dunlap | 8973a6e | 2011-04-26 15:25:29 -0700 | [diff] [blame^] | 780 | /* |
| 781 | * DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 782 | * Adhoc join command and will cause a binary layout mismatch with |
| 783 | * the firmware |
| 784 | */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 785 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 786 | |
| 787 | struct cmd_ds_802_11_ad_hoc_join { |
| 788 | struct cmd_header hdr; |
| 789 | |
| 790 | struct adhoc_bssdesc bss; |
| 791 | __le16 failtimeout; /* Reserved on v9 and later */ |
| 792 | __le16 probedelay; /* Reserved on v9 and later */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 793 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 794 | |
| 795 | struct cmd_ds_802_11_ad_hoc_stop { |
| 796 | struct cmd_header hdr; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 797 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 798 | |
| 799 | struct cmd_ds_802_11_enable_rsn { |
| 800 | struct cmd_header hdr; |
| 801 | |
| 802 | __le16 action; |
| 803 | __le16 enable; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 804 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 805 | |
| 806 | struct MrvlIEtype_keyParamSet { |
| 807 | /* type ID */ |
| 808 | __le16 type; |
| 809 | |
| 810 | /* length of Payload */ |
| 811 | __le16 length; |
| 812 | |
| 813 | /* type of key: WEP=0, TKIP=1, AES=2 */ |
| 814 | __le16 keytypeid; |
| 815 | |
| 816 | /* key control Info specific to a keytypeid */ |
| 817 | __le16 keyinfo; |
| 818 | |
| 819 | /* length of key */ |
| 820 | __le16 keylen; |
| 821 | |
| 822 | /* key material of size keylen */ |
| 823 | u8 key[32]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 824 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 825 | |
| 826 | #define MAX_WOL_RULES 16 |
| 827 | |
| 828 | struct host_wol_rule { |
| 829 | uint8_t rule_no; |
| 830 | uint8_t rule_ops; |
| 831 | __le16 sig_offset; |
| 832 | __le16 sig_length; |
| 833 | __le16 reserve; |
| 834 | __be32 sig_mask; |
| 835 | __be32 signature; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 836 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 837 | |
| 838 | struct wol_config { |
| 839 | uint8_t action; |
| 840 | uint8_t pattern; |
| 841 | uint8_t no_rules_in_cmd; |
| 842 | uint8_t result; |
| 843 | struct host_wol_rule rule[MAX_WOL_RULES]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 844 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 845 | |
| 846 | struct cmd_ds_host_sleep { |
| 847 | struct cmd_header hdr; |
| 848 | __le32 criteria; |
| 849 | uint8_t gpio; |
| 850 | uint16_t gap; |
| 851 | struct wol_config wol_conf; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 852 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 853 | |
| 854 | |
| 855 | |
| 856 | struct cmd_ds_802_11_key_material { |
| 857 | struct cmd_header hdr; |
| 858 | |
| 859 | __le16 action; |
| 860 | struct MrvlIEtype_keyParamSet keyParamSet[2]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 861 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 862 | |
| 863 | struct cmd_ds_802_11_eeprom_access { |
| 864 | struct cmd_header hdr; |
| 865 | __le16 action; |
| 866 | __le16 offset; |
| 867 | __le16 len; |
| 868 | /* firmware says it returns a maximum of 20 bytes */ |
| 869 | #define LBS_EEPROM_READ_LEN 20 |
| 870 | u8 value[LBS_EEPROM_READ_LEN]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 871 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 872 | |
| 873 | struct cmd_ds_802_11_tpc_cfg { |
| 874 | struct cmd_header hdr; |
| 875 | |
| 876 | __le16 action; |
| 877 | uint8_t enable; |
| 878 | int8_t P0; |
| 879 | int8_t P1; |
| 880 | int8_t P2; |
| 881 | uint8_t usesnr; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 882 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 883 | |
| 884 | |
| 885 | struct cmd_ds_802_11_pa_cfg { |
| 886 | struct cmd_header hdr; |
| 887 | |
| 888 | __le16 action; |
| 889 | uint8_t enable; |
| 890 | int8_t P0; |
| 891 | int8_t P1; |
| 892 | int8_t P2; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 893 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 894 | |
| 895 | |
| 896 | struct cmd_ds_802_11_led_ctrl { |
Dan Williams | 85dfbfe | 2010-07-27 12:59:44 -0700 | [diff] [blame] | 897 | struct cmd_header hdr; |
| 898 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 899 | __le16 action; |
| 900 | __le16 numled; |
| 901 | u8 data[256]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 902 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 903 | |
Dan Williams | db08006 | 2010-07-27 12:57:27 -0700 | [diff] [blame] | 904 | /* Automatic Frequency Control */ |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 905 | struct cmd_ds_802_11_afc { |
Dan Williams | db08006 | 2010-07-27 12:57:27 -0700 | [diff] [blame] | 906 | struct cmd_header hdr; |
| 907 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 908 | __le16 afc_auto; |
| 909 | union { |
| 910 | struct { |
| 911 | __le16 threshold; |
| 912 | __le16 period; |
| 913 | }; |
| 914 | struct { |
| 915 | __le16 timing_offset; /* signed */ |
| 916 | __le16 carrier_offset; /* signed */ |
| 917 | }; |
| 918 | }; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 919 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 920 | |
| 921 | struct cmd_tx_rate_query { |
| 922 | __le16 txrate; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 923 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 924 | |
| 925 | struct cmd_ds_get_tsf { |
| 926 | __le64 tsfvalue; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 927 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 928 | |
| 929 | struct cmd_ds_bt_access { |
Dan Williams | 5214865 | 2010-07-27 13:01:47 -0700 | [diff] [blame] | 930 | struct cmd_header hdr; |
| 931 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 932 | __le16 action; |
| 933 | __le32 id; |
| 934 | u8 addr1[ETH_ALEN]; |
| 935 | u8 addr2[ETH_ALEN]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 936 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 937 | |
| 938 | struct cmd_ds_fwt_access { |
Dan Williams | a6bb1bc | 2010-07-27 13:03:46 -0700 | [diff] [blame] | 939 | struct cmd_header hdr; |
| 940 | |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 941 | __le16 action; |
| 942 | __le32 id; |
| 943 | u8 valid; |
| 944 | u8 da[ETH_ALEN]; |
| 945 | u8 dir; |
| 946 | u8 ra[ETH_ALEN]; |
| 947 | __le32 ssn; |
| 948 | __le32 dsn; |
| 949 | __le32 metric; |
| 950 | u8 rate; |
| 951 | u8 hopcount; |
| 952 | u8 ttl; |
| 953 | __le32 expiration; |
| 954 | u8 sleepmode; |
| 955 | __le32 snr; |
| 956 | __le32 references; |
| 957 | u8 prec[ETH_ALEN]; |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 958 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 959 | |
| 960 | struct cmd_ds_mesh_config { |
| 961 | struct cmd_header hdr; |
| 962 | |
| 963 | __le16 action; |
| 964 | __le16 channel; |
| 965 | __le16 type; |
| 966 | __le16 length; |
| 967 | u8 data[128]; /* last position reserved */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 968 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 969 | |
| 970 | struct cmd_ds_mesh_access { |
| 971 | struct cmd_header hdr; |
| 972 | |
| 973 | __le16 action; |
| 974 | __le32 data[32]; /* last position reserved */ |
Eric Dumazet | ba2d358 | 2010-06-02 18:10:09 +0000 | [diff] [blame] | 975 | } __packed; |
Holger Schurig | 9e66e70 | 2009-10-16 17:32:16 +0200 | [diff] [blame] | 976 | |
| 977 | /* Number of stats counters returned by the firmware */ |
| 978 | #define MESH_STATS_NUM 8 |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 979 | #endif |