Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Driver for KeyStream wireless LAN |
| 3 | * |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 4 | * Copyright (c) 2005-2008 KeyStream Corp. |
| 5 | * Copyright (C) 2009 Renesas Technology Corp. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
Wolfram Sang | c5d9a03 | 2016-05-31 12:56:43 +0200 | [diff] [blame] | 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #ifndef _KS_HOSTIF_H_ |
| 13 | #define _KS_HOSTIF_H_ |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 14 | |
| 15 | #include <linux/compiler.h> |
| 16 | |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 17 | /* |
| 18 | * HOST-MAC I/F events |
| 19 | */ |
| 20 | #define HIF_DATA_REQ 0xE001 |
| 21 | #define HIF_DATA_IND 0xE801 |
| 22 | #define HIF_MIB_GET_REQ 0xE002 |
| 23 | #define HIF_MIB_GET_CONF 0xE802 |
| 24 | #define HIF_MIB_SET_REQ 0xE003 |
| 25 | #define HIF_MIB_SET_CONF 0xE803 |
| 26 | #define HIF_POWERMGT_REQ 0xE004 |
| 27 | #define HIF_POWERMGT_CONF 0xE804 |
| 28 | #define HIF_START_REQ 0xE005 |
| 29 | #define HIF_START_CONF 0xE805 |
| 30 | #define HIF_CONNECT_IND 0xE806 |
| 31 | #define HIF_STOP_REQ 0xE006 |
| 32 | #define HIF_STOP_CONF 0xE807 |
| 33 | #define HIF_PS_ADH_SET_REQ 0xE007 |
| 34 | #define HIF_PS_ADH_SET_CONF 0xE808 |
| 35 | #define HIF_INFRA_SET_REQ 0xE008 |
| 36 | #define HIF_INFRA_SET_CONF 0xE809 |
| 37 | #define HIF_ADH_SET_REQ 0xE009 |
| 38 | #define HIF_ADH_SET_CONF 0xE80A |
| 39 | #define HIF_AP_SET_REQ 0xE00A |
| 40 | #define HIF_AP_SET_CONF 0xE80B |
| 41 | #define HIF_ASSOC_INFO_IND 0xE80C |
| 42 | #define HIF_MIC_FAILURE_REQ 0xE00B |
| 43 | #define HIF_MIC_FAILURE_CONF 0xE80D |
| 44 | #define HIF_SCAN_REQ 0xE00C |
| 45 | #define HIF_SCAN_CONF 0xE80E |
| 46 | #define HIF_PHY_INFO_REQ 0xE00D |
| 47 | #define HIF_PHY_INFO_CONF 0xE80F |
| 48 | #define HIF_SLEEP_REQ 0xE00E |
| 49 | #define HIF_SLEEP_CONF 0xE810 |
| 50 | #define HIF_PHY_INFO_IND 0xE811 |
| 51 | #define HIF_SCAN_IND 0xE812 |
| 52 | #define HIF_INFRA_SET2_REQ 0xE00F |
| 53 | #define HIF_INFRA_SET2_CONF 0xE813 |
| 54 | #define HIF_ADH_SET2_REQ 0xE010 |
| 55 | #define HIF_ADH_SET2_CONF 0xE814 |
| 56 | |
| 57 | #define HIF_REQ_MAX 0xE010 |
| 58 | |
| 59 | /* |
| 60 | * HOST-MAC I/F data structure |
| 61 | * Byte alignmet Little Endian |
| 62 | */ |
| 63 | |
| 64 | struct hostif_hdr { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 65 | uint16_t size; |
| 66 | uint16_t event; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 67 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 68 | |
| 69 | struct hostif_data_request_t { |
| 70 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 71 | uint16_t auth_type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 72 | #define TYPE_DATA 0x0000 |
| 73 | #define TYPE_AUTH 0x0001 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 74 | uint16_t reserved; |
| 75 | uint8_t data[0]; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 76 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 77 | |
| 78 | struct hostif_data_indication_t { |
| 79 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 80 | uint16_t auth_type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 81 | /* #define TYPE_DATA 0x0000 */ |
| 82 | #define TYPE_PMK1 0x0001 |
| 83 | #define TYPE_GMK1 0x0002 |
| 84 | #define TYPE_GMK2 0x0003 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 85 | uint16_t reserved; |
| 86 | uint8_t data[0]; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 87 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 88 | |
| 89 | #define CHANNEL_LIST_MAX_SIZE 14 |
| 90 | struct channel_list_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 91 | uint8_t size; |
| 92 | uint8_t body[CHANNEL_LIST_MAX_SIZE]; |
| 93 | uint8_t pad; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 94 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 95 | |
| 96 | /* MIB Attribute */ |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 97 | #define DOT11_MAC_ADDRESS 0x21010100 /* MAC Address (R) */ |
| 98 | #define DOT11_PRODUCT_VERSION 0x31024100 /* FirmWare Version (R) */ |
| 99 | #define DOT11_RTS_THRESHOLD 0x21020100 /* RTS Threshold (R/W) */ |
| 100 | #define DOT11_FRAGMENTATION_THRESHOLD 0x21050100 /* Fragment Threshold (R/W) */ |
| 101 | #define DOT11_PRIVACY_INVOKED 0x15010100 /* WEP ON/OFF (W) */ |
| 102 | #define DOT11_WEP_DEFAULT_KEY_ID 0x15020100 /* WEP Index (W) */ |
| 103 | #define DOT11_WEP_DEFAULT_KEY_VALUE1 0x13020101 /* WEP Key#1(TKIP AES: PairwiseTemporalKey) (W) */ |
| 104 | #define DOT11_WEP_DEFAULT_KEY_VALUE2 0x13020102 /* WEP Key#2(TKIP AES: GroupKey1) (W) */ |
| 105 | #define DOT11_WEP_DEFAULT_KEY_VALUE3 0x13020103 /* WEP Key#3(TKIP AES: GroupKey2) (W) */ |
| 106 | #define DOT11_WEP_DEFAULT_KEY_VALUE4 0x13020104 /* WEP Key#4 (W) */ |
| 107 | #define DOT11_WEP_LIST 0x13020100 /* WEP LIST */ |
| 108 | #define DOT11_DESIRED_SSID 0x11090100 /* SSID */ |
| 109 | #define DOT11_CURRENT_CHANNEL 0x45010100 /* channel set */ |
| 110 | #define DOT11_OPERATION_RATE_SET 0x11110100 /* rate set */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 111 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 112 | #define LOCAL_AP_SEARCH_INTEAVAL 0xF1010100 /* AP search interval (R/W) */ |
| 113 | #define LOCAL_CURRENTADDRESS 0xF1050100 /* MAC Adress change (W) */ |
| 114 | #define LOCAL_MULTICAST_ADDRESS 0xF1060100 /* Multicast Adress (W) */ |
| 115 | #define LOCAL_MULTICAST_FILTER 0xF1060200 /* Multicast Adress Filter enable/disable (W) */ |
| 116 | #define LOCAL_SEARCHED_AP_LIST 0xF1030100 /* AP list (R) */ |
| 117 | #define LOCAL_LINK_AP_STATUS 0xF1040100 /* Link AP status (R) */ |
| 118 | #define LOCAL_PACKET_STATISTICS 0xF1020100 /* tx,rx packets statistics */ |
| 119 | #define LOCAL_AP_SCAN_LIST_TYPE_SET 0xF1030200 /* AP_SCAN_LIST_TYPE */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 120 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 121 | #define DOT11_RSN_ENABLED 0x15070100 /* WPA enable/disable (W) */ |
| 122 | #define LOCAL_RSN_MODE 0x56010100 /* RSN mode WPA/WPA2 (W) */ |
| 123 | #define DOT11_RSN_CONFIG_MULTICAST_CIPHER 0x51040100 /* GroupKeyCipherSuite (W) */ |
| 124 | #define DOT11_RSN_CONFIG_UNICAST_CIPHER 0x52020100 /* PairwiseKeyCipherSuite (W) */ |
| 125 | #define DOT11_RSN_CONFIG_AUTH_SUITE 0x53020100 /* AuthenticationKeyManagementSuite (W) */ |
| 126 | #define DOT11_RSN_CONFIG_VERSION 0x51020100 /* RSN version (W) */ |
| 127 | #define LOCAL_RSN_CONFIG_ALL 0x5F010100 /* RSN CONFIG ALL (W) */ |
| 128 | #define DOT11_PMK_TSC 0x55010100 /* PMK_TSC (W) */ |
| 129 | #define DOT11_GMK1_TSC 0x55010101 /* GMK1_TSC (W) */ |
| 130 | #define DOT11_GMK2_TSC 0x55010102 /* GMK2_TSC (W) */ |
| 131 | #define DOT11_GMK3_TSC 0x55010103 /* GMK3_TSC */ |
| 132 | #define LOCAL_PMK 0x58010100 /* Pairwise Master Key cache (W) */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 133 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 134 | #define LOCAL_REGION 0xF10A0100 /* Region setting */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 135 | |
| 136 | #ifdef WPS |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 137 | #define LOCAL_WPS_ENABLE 0xF10B0100 /* WiFi Protected Setup */ |
| 138 | #define LOCAL_WPS_PROBE_REQ 0xF10C0100 /* WPS Probe Request */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 139 | #endif /* WPS */ |
| 140 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 141 | #define LOCAL_GAIN 0xF10D0100 /* Carrer sense threshold for demo ato show */ |
| 142 | #define LOCAL_EEPROM_SUM 0xF10E0100 /* EEPROM checksum information */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 143 | |
| 144 | struct hostif_mib_get_request_t { |
| 145 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 146 | uint32_t mib_attribute; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 147 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 148 | |
| 149 | struct hostif_mib_value_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 150 | uint16_t size; |
| 151 | uint16_t type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 152 | #define MIB_VALUE_TYPE_NULL 0 |
| 153 | #define MIB_VALUE_TYPE_INT 1 |
| 154 | #define MIB_VALUE_TYPE_BOOL 2 |
| 155 | #define MIB_VALUE_TYPE_COUNT32 3 |
| 156 | #define MIB_VALUE_TYPE_OSTRING 4 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 157 | uint8_t body[0]; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 158 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 159 | |
| 160 | struct hostif_mib_get_confirm_t { |
| 161 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 162 | uint32_t mib_status; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 163 | #define MIB_SUCCESS 0 |
| 164 | #define MIB_INVALID 1 |
| 165 | #define MIB_READ_ONLY 2 |
| 166 | #define MIB_WRITE_ONLY 3 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 167 | uint32_t mib_attribute; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 168 | struct hostif_mib_value_t mib_value; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 169 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 170 | |
| 171 | struct hostif_mib_set_request_t { |
| 172 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 173 | uint32_t mib_attribute; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 174 | struct hostif_mib_value_t mib_value; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 175 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 176 | |
| 177 | struct hostif_mib_set_confirm_t { |
| 178 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 179 | uint32_t mib_status; |
| 180 | uint32_t mib_attribute; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 181 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 182 | |
| 183 | struct hostif_power_mngmt_request_t { |
| 184 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 185 | uint32_t mode; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 186 | #define POWER_ACTIVE 1 |
| 187 | #define POWER_SAVE 2 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 188 | uint32_t wake_up; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 189 | #define SLEEP_FALSE 0 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 190 | #define SLEEP_TRUE 1 /* not used */ |
| 191 | uint32_t receiveDTIMs; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 192 | #define DTIM_FALSE 0 |
| 193 | #define DTIM_TRUE 1 |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 194 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 195 | |
| 196 | /* power management mode */ |
| 197 | enum { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 198 | POWMGT_ACTIVE_MODE = 0, |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 199 | POWMGT_SAVE1_MODE, |
| 200 | POWMGT_SAVE2_MODE |
| 201 | }; |
| 202 | |
| 203 | #define RESULT_SUCCESS 0 |
| 204 | #define RESULT_INVALID_PARAMETERS 1 |
| 205 | #define RESULT_NOT_SUPPORTED 2 |
| 206 | /* #define RESULT_ALREADY_RUNNING 3 */ |
| 207 | #define RESULT_ALREADY_RUNNING 7 |
| 208 | |
| 209 | struct hostif_power_mngmt_confirm_t { |
| 210 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 211 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 212 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 213 | |
| 214 | struct hostif_start_request_t { |
| 215 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 216 | uint16_t mode; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 217 | #define MODE_PSEUDO_ADHOC 0 |
| 218 | #define MODE_INFRASTRUCTURE 1 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 219 | #define MODE_AP 2 /* not used */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 220 | #define MODE_ADHOC 3 |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 221 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 222 | |
| 223 | struct hostif_start_confirm_t { |
| 224 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 225 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 226 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 227 | |
| 228 | #define SSID_MAX_SIZE 32 |
| 229 | struct ssid_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 230 | uint8_t size; |
| 231 | uint8_t body[SSID_MAX_SIZE]; |
| 232 | uint8_t ssid_pad; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 233 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 234 | |
| 235 | #define RATE_SET_MAX_SIZE 16 |
| 236 | struct rate_set8_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 237 | uint8_t size; |
| 238 | uint8_t body[8]; |
| 239 | uint8_t rate_pad; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 240 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 241 | |
| 242 | struct FhParms_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 243 | uint16_t dwellTime; |
| 244 | uint8_t hopSet; |
| 245 | uint8_t hopPattern; |
| 246 | uint8_t hopIndex; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 247 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 248 | |
| 249 | struct DsParms_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 250 | uint8_t channel; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 251 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 252 | |
| 253 | struct CfParms_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 254 | uint8_t count; |
| 255 | uint8_t period; |
| 256 | uint16_t maxDuration; |
| 257 | uint16_t durRemaining; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 258 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 259 | |
| 260 | struct IbssParms_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 261 | uint16_t atimWindow; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 262 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 263 | |
| 264 | struct rsn_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 265 | uint8_t size; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 266 | #define RSN_BODY_SIZE 64 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 267 | uint8_t body[RSN_BODY_SIZE]; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 268 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 269 | |
| 270 | struct ErpParams_t { |
| 271 | uint8_t erp_info; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 272 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 273 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 274 | struct rate_set16_t { |
| 275 | uint8_t size; |
| 276 | uint8_t body[16]; |
| 277 | uint8_t rate_pad; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 278 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 279 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 280 | struct ap_info_t { |
| 281 | uint8_t bssid[6]; /* +00 */ |
| 282 | uint8_t rssi; /* +06 */ |
| 283 | uint8_t sq; /* +07 */ |
| 284 | uint8_t noise; /* +08 */ |
| 285 | uint8_t pad0; /* +09 */ |
| 286 | uint16_t beacon_period; /* +10 */ |
| 287 | uint16_t capability; /* +12 */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 288 | #define BSS_CAP_ESS (1<<0) |
| 289 | #define BSS_CAP_IBSS (1<<1) |
| 290 | #define BSS_CAP_CF_POLABLE (1<<2) |
| 291 | #define BSS_CAP_CF_POLL_REQ (1<<3) |
| 292 | #define BSS_CAP_PRIVACY (1<<4) |
| 293 | #define BSS_CAP_SHORT_PREAMBLE (1<<5) |
| 294 | #define BSS_CAP_PBCC (1<<6) |
| 295 | #define BSS_CAP_CHANNEL_AGILITY (1<<7) |
| 296 | #define BSS_CAP_SHORT_SLOT_TIME (1<<10) |
| 297 | #define BSS_CAP_DSSS_OFDM (1<<13) |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 298 | uint8_t frame_type; /* +14 */ |
| 299 | uint8_t ch_info; /* +15 */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 300 | #define FRAME_TYPE_BEACON 0x80 |
| 301 | #define FRAME_TYPE_PROBE_RESP 0x50 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 302 | uint16_t body_size; /* +16 */ |
| 303 | uint8_t body[1024]; /* +18 */ |
| 304 | /* +1032 */ |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 305 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 306 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 307 | struct link_ap_info_t { |
| 308 | uint8_t bssid[6]; /* +00 */ |
| 309 | uint8_t rssi; /* +06 */ |
| 310 | uint8_t sq; /* +07 */ |
| 311 | uint8_t noise; /* +08 */ |
| 312 | uint8_t pad0; /* +09 */ |
| 313 | uint16_t beacon_period; /* +10 */ |
| 314 | uint16_t capability; /* +12 */ |
| 315 | struct rate_set8_t rate_set; /* +14 */ |
| 316 | struct FhParms_t fh_parameter; /* +24 */ |
| 317 | struct DsParms_t ds_parameter; /* +29 */ |
| 318 | struct CfParms_t cf_parameter; /* +30 */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 319 | struct IbssParms_t ibss_parameter; /* +36 */ |
| 320 | struct ErpParams_t erp_parameter; /* +38 */ |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 321 | uint8_t pad1; /* +39 */ |
| 322 | struct rate_set8_t ext_rate_set; /* +40 */ |
| 323 | uint8_t DTIM_period; /* +50 */ |
| 324 | uint8_t rsn_mode; /* +51 */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 325 | #define RSN_MODE_NONE 0 |
| 326 | #define RSN_MODE_WPA 1 |
| 327 | #define RSN_MODE_WPA2 2 |
| 328 | struct { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 329 | uint8_t size; /* +52 */ |
| 330 | uint8_t body[128]; /* +53 */ |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 331 | } __packed rsn; |
| 332 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 333 | |
| 334 | struct hostif_connect_indication_t { |
| 335 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 336 | uint16_t connect_code; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 337 | #define RESULT_CONNECT 0 |
| 338 | #define RESULT_DISCONNECT 1 |
| 339 | struct link_ap_info_t link_ap_info; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 340 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 341 | |
| 342 | struct hostif_stop_request_t { |
| 343 | struct hostif_hdr header; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 344 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 345 | |
| 346 | struct hostif_stop_confirm_t { |
| 347 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 348 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 349 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 350 | |
| 351 | struct hostif_ps_adhoc_set_request_t { |
| 352 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 353 | uint16_t phy_type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 354 | #define D_11B_ONLY_MODE 0 |
| 355 | #define D_11G_ONLY_MODE 1 |
| 356 | #define D_11BG_COMPATIBLE_MODE 2 |
| 357 | #define D_11A_ONLY_MODE 3 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 358 | uint16_t cts_mode; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 359 | #define CTS_MODE_FALSE 0 |
| 360 | #define CTS_MODE_TRUE 1 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 361 | uint16_t channel; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 362 | struct rate_set16_t rate_set; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 363 | uint16_t capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 |
| 364 | * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */ |
| 365 | uint16_t scan_type; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 366 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 367 | |
| 368 | struct hostif_ps_adhoc_set_confirm_t { |
| 369 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 370 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 371 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 372 | |
| 373 | struct hostif_infrastructure_set_request_t { |
| 374 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 375 | uint16_t phy_type; |
| 376 | uint16_t cts_mode; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 377 | struct rate_set16_t rate_set; |
| 378 | struct ssid_t ssid; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 379 | uint16_t capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 |
| 380 | * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */ |
| 381 | uint16_t beacon_lost_count; |
| 382 | uint16_t auth_type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 383 | #define AUTH_TYPE_OPEN_SYSTEM 0 |
| 384 | #define AUTH_TYPE_SHARED_KEY 1 |
| 385 | struct channel_list_t channel_list; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 386 | uint16_t scan_type; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 387 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 388 | |
| 389 | struct hostif_infrastructure_set2_request_t { |
| 390 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 391 | uint16_t phy_type; |
| 392 | uint16_t cts_mode; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 393 | struct rate_set16_t rate_set; |
| 394 | struct ssid_t ssid; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 395 | uint16_t capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 |
| 396 | * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */ |
| 397 | uint16_t beacon_lost_count; |
| 398 | uint16_t auth_type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 399 | #define AUTH_TYPE_OPEN_SYSTEM 0 |
| 400 | #define AUTH_TYPE_SHARED_KEY 1 |
| 401 | struct channel_list_t channel_list; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 402 | uint16_t scan_type; |
| 403 | uint8_t bssid[ETH_ALEN]; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 404 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 405 | |
| 406 | struct hostif_infrastructure_set_confirm_t { |
| 407 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 408 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 409 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 410 | |
| 411 | struct hostif_adhoc_set_request_t { |
| 412 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 413 | uint16_t phy_type; |
| 414 | uint16_t cts_mode; |
| 415 | uint16_t channel; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 416 | struct rate_set16_t rate_set; |
| 417 | struct ssid_t ssid; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 418 | uint16_t capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 |
| 419 | * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */ |
| 420 | uint16_t scan_type; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 421 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 422 | |
| 423 | struct hostif_adhoc_set2_request_t { |
| 424 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 425 | uint16_t phy_type; |
| 426 | uint16_t cts_mode; |
| 427 | uint16_t reserved; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 428 | struct rate_set16_t rate_set; |
| 429 | struct ssid_t ssid; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 430 | uint16_t capability; /* bit5:preamble bit6:pbcc pbcc not supported always 0 |
| 431 | * bit10:ShortSlotTime bit13:DSSS-OFDM DSSS-OFDM not supported always 0 */ |
| 432 | uint16_t scan_type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 433 | struct channel_list_t channel_list; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 434 | uint8_t bssid[ETH_ALEN]; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 435 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 436 | |
| 437 | struct hostif_adhoc_set_confirm_t { |
| 438 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 439 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 440 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 441 | |
| 442 | struct last_associate_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 443 | uint8_t type; |
| 444 | uint8_t status; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 445 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 446 | |
| 447 | struct association_request_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 448 | uint8_t type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 449 | #define FRAME_TYPE_ASSOC_REQ 0x00 |
| 450 | #define FRAME_TYPE_REASSOC_REQ 0x20 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 451 | uint8_t pad; |
| 452 | uint16_t capability; |
| 453 | uint16_t listen_interval; |
| 454 | uint8_t ap_address[6]; |
| 455 | uint16_t reqIEs_size; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 456 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 457 | |
| 458 | struct association_response_t { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 459 | uint8_t type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 460 | #define FRAME_TYPE_ASSOC_RESP 0x10 |
| 461 | #define FRAME_TYPE_REASSOC_RESP 0x30 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 462 | uint8_t pad; |
| 463 | uint16_t capability; |
| 464 | uint16_t status; |
| 465 | uint16_t association_id; |
| 466 | uint16_t respIEs_size; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 467 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 468 | |
| 469 | struct hostif_associate_indication_t { |
| 470 | struct hostif_hdr header; |
| 471 | struct association_request_t assoc_req; |
| 472 | struct association_response_t assoc_resp; |
| 473 | /* followed by (reqIEs_size + respIEs_size) octets of data */ |
| 474 | /* reqIEs data *//* respIEs data */ |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 475 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 476 | |
| 477 | struct hostif_bss_scan_request_t { |
| 478 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 479 | uint8_t scan_type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 480 | #define ACTIVE_SCAN 0 |
| 481 | #define PASSIVE_SCAN 1 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 482 | uint8_t pad[3]; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 483 | uint32_t ch_time_min; |
| 484 | uint32_t ch_time_max; |
| 485 | struct channel_list_t channel_list; |
| 486 | struct ssid_t ssid; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 487 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 488 | |
| 489 | struct hostif_bss_scan_confirm_t { |
| 490 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 491 | uint16_t result_code; |
| 492 | uint16_t reserved; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 493 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 494 | |
| 495 | struct hostif_phy_information_request_t { |
| 496 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 497 | uint16_t type; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 498 | #define NORMAL_TYPE 0 |
| 499 | #define TIME_TYPE 1 |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 500 | uint16_t time; /* unit 100ms */ |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 501 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 502 | |
| 503 | struct hostif_phy_information_confirm_t { |
| 504 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 505 | uint8_t rssi; |
| 506 | uint8_t sq; |
| 507 | uint8_t noise; |
| 508 | uint8_t link_speed; |
| 509 | uint32_t tx_frame; |
| 510 | uint32_t rx_frame; |
| 511 | uint32_t tx_error; |
| 512 | uint32_t rx_error; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 513 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 514 | |
| 515 | /* sleep mode */ |
| 516 | #define SLP_ACTIVE 0 |
| 517 | #define SLP_SLEEP 1 |
| 518 | struct hostif_sleep_request_t { |
| 519 | struct hostif_hdr header; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 520 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 521 | |
| 522 | struct hostif_sleep_confirm_t { |
| 523 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 524 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 525 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 526 | |
| 527 | struct hostif_mic_failure_request_t { |
| 528 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 529 | uint16_t failure_count; |
| 530 | uint16_t timer; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 531 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 532 | |
| 533 | struct hostif_mic_failure_confirm_t { |
| 534 | struct hostif_hdr header; |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 535 | uint16_t result_code; |
Matt Kilgore | 2460563 | 2016-09-27 02:05:44 -0400 | [diff] [blame] | 536 | } __packed; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 537 | |
| 538 | #define BASIC_RATE 0x80 |
| 539 | #define RATE_MASK 0x7F |
| 540 | |
| 541 | #define TX_RATE_AUTO 0xff |
| 542 | #define TX_RATE_1M_FIXED 0 |
| 543 | #define TX_RATE_2M_FIXED 1 |
| 544 | #define TX_RATE_1_2M_AUTO 2 |
| 545 | #define TX_RATE_5M_FIXED 3 |
| 546 | #define TX_RATE_11M_FIXED 4 |
| 547 | |
| 548 | #define TX_RATE_FULL_AUTO 0 |
| 549 | #define TX_RATE_11_AUTO 1 |
| 550 | #define TX_RATE_11B_AUTO 2 |
| 551 | #define TX_RATE_11BG_AUTO 3 |
| 552 | #define TX_RATE_MANUAL_AUTO 4 |
| 553 | #define TX_RATE_FIXED 5 |
| 554 | |
| 555 | /* 11b rate */ |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 556 | #define TX_RATE_1M (uint8_t)(10/5) /* 11b 11g basic rate */ |
| 557 | #define TX_RATE_2M (uint8_t)(20/5) /* 11b 11g basic rate */ |
| 558 | #define TX_RATE_5M (uint8_t)(55/5) /* 11g basic rate */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 559 | #define TX_RATE_11M (uint8_t)(110/5) /* 11g basic rate */ |
| 560 | |
| 561 | /* 11g rate */ |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 562 | #define TX_RATE_6M (uint8_t)(60/5) /* 11g basic rate */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 563 | #define TX_RATE_12M (uint8_t)(120/5) /* 11g basic rate */ |
| 564 | #define TX_RATE_24M (uint8_t)(240/5) /* 11g basic rate */ |
| 565 | #define TX_RATE_9M (uint8_t)(90/5) |
| 566 | #define TX_RATE_18M (uint8_t)(180/5) |
| 567 | #define TX_RATE_36M (uint8_t)(360/5) |
| 568 | #define TX_RATE_48M (uint8_t)(480/5) |
| 569 | #define TX_RATE_54M (uint8_t)(540/5) |
| 570 | |
| 571 | #define IS_11B_RATE(A) (((A&RATE_MASK)==TX_RATE_1M)||((A&RATE_MASK)==TX_RATE_2M)||\ |
| 572 | ((A&RATE_MASK)==TX_RATE_5M)||((A&RATE_MASK)==TX_RATE_11M)) |
| 573 | |
| 574 | #define IS_OFDM_RATE(A) (((A&RATE_MASK)==TX_RATE_6M)||((A&RATE_MASK)==TX_RATE_12M)||\ |
| 575 | ((A&RATE_MASK)==TX_RATE_24M)||((A&RATE_MASK)==TX_RATE_9M)||\ |
| 576 | ((A&RATE_MASK)==TX_RATE_18M)||((A&RATE_MASK)==TX_RATE_36M)||\ |
| 577 | ((A&RATE_MASK)==TX_RATE_48M)||((A&RATE_MASK)==TX_RATE_54M)) |
| 578 | |
| 579 | #define IS_11BG_RATE(A) (IS_11B_RATE(A)||IS_OFDM_RATE(A)) |
| 580 | |
| 581 | #define IS_OFDM_EXT_RATE(A) (((A&RATE_MASK)==TX_RATE_9M)||((A&RATE_MASK)==TX_RATE_18M)||\ |
| 582 | ((A&RATE_MASK)==TX_RATE_36M)||((A&RATE_MASK)==TX_RATE_48M)||\ |
| 583 | ((A&RATE_MASK)==TX_RATE_54M)) |
| 584 | |
| 585 | enum { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 586 | CONNECT_STATUS = 0, |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 587 | DISCONNECT_STATUS |
| 588 | }; |
| 589 | |
| 590 | /* preamble type */ |
| 591 | enum { |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 592 | LONG_PREAMBLE = 0, |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 593 | SHORT_PREAMBLE |
| 594 | }; |
| 595 | |
| 596 | /* multicast filter */ |
| 597 | #define MCAST_FILTER_MCAST 0 |
| 598 | #define MCAST_FILTER_MCASTALL 1 |
| 599 | #define MCAST_FILTER_PROMISC 2 |
| 600 | |
| 601 | #define NIC_MAX_MCAST_LIST 32 |
| 602 | |
| 603 | /* macro function */ |
| 604 | #define HIF_EVENT_MASK 0xE800 |
| 605 | #define IS_HIF_IND(_EVENT) ((_EVENT&HIF_EVENT_MASK)==0xE800 && \ |
| 606 | ((_EVENT&~HIF_EVENT_MASK)==0x0001 || \ |
| 607 | (_EVENT&~HIF_EVENT_MASK)==0x0006 || \ |
| 608 | (_EVENT&~HIF_EVENT_MASK)==0x000C || \ |
| 609 | (_EVENT&~HIF_EVENT_MASK)==0x0011 || \ |
| 610 | (_EVENT&~HIF_EVENT_MASK)==0x0012)) |
| 611 | |
| 612 | #define IS_HIF_CONF(_EVENT) ((_EVENT&HIF_EVENT_MASK)==0xE800 && \ |
| 613 | (_EVENT&~HIF_EVENT_MASK)>0x0000 && \ |
| 614 | (_EVENT&~HIF_EVENT_MASK)<0x0012 && \ |
| 615 | !IS_HIF_IND(_EVENT) ) |
| 616 | |
| 617 | #ifdef __KERNEL__ |
| 618 | |
| 619 | #include "ks_wlan.h" |
| 620 | |
| 621 | /* function prototype */ |
Bhumika Goyal | 2751bc9 | 2016-09-17 13:09:13 +0530 | [diff] [blame] | 622 | int hostif_data_request(struct ks_wlan_private *priv, |
| 623 | struct sk_buff *packet); |
| 624 | void hostif_receive(struct ks_wlan_private *priv, unsigned char *p, |
| 625 | unsigned int size); |
| 626 | void hostif_sme_enqueue(struct ks_wlan_private *priv, uint16_t event); |
| 627 | int hostif_init(struct ks_wlan_private *priv); |
| 628 | void hostif_exit(struct ks_wlan_private *priv); |
| 629 | int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, |
| 630 | unsigned long size, |
| 631 | void (*complete_handler) (void *arg1, void *arg2), |
| 632 | void *arg1, void *arg2); |
| 633 | void send_packet_complete(void *, void *); |
| 634 | |
| 635 | void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv); |
| 636 | int ks_wlan_hw_power_save(struct ks_wlan_private *priv); |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 637 | |
| 638 | static |
| 639 | inline int hif_align_size(int size) |
| 640 | { |
| 641 | #ifdef KS_ATOM |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 642 | if (size < 1024) |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 643 | size = 1024; |
| 644 | #endif |
| 645 | #ifdef DEVICE_ALIGNMENT |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 646 | return (size % DEVICE_ALIGNMENT) ? size + DEVICE_ALIGNMENT - |
| 647 | (size % DEVICE_ALIGNMENT) : size; |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 648 | #else |
| 649 | return size; |
| 650 | #endif |
| 651 | } |
| 652 | |
Wolfram Sang | e3d7482 | 2016-05-31 12:56:31 +0200 | [diff] [blame] | 653 | #endif /* __KERNEL__ */ |
Wolfram Sang | 13a9930 | 2016-05-31 12:56:13 +0200 | [diff] [blame] | 654 | |
| 655 | #endif /* _KS_HOSTIF_H_ */ |