diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl12xx.h')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 88 |
1 files changed, 83 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index 9050dd9b62d2..d1de13fe7d9a 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -38,6 +38,13 @@ | |||
38 | #define DRIVER_NAME "wl1271" | 38 | #define DRIVER_NAME "wl1271" |
39 | #define DRIVER_PREFIX DRIVER_NAME ": " | 39 | #define DRIVER_PREFIX DRIVER_NAME ": " |
40 | 40 | ||
41 | /* | ||
42 | * FW versions support BA 11n | ||
43 | * versions marks x.x.x.50-60.x | ||
44 | */ | ||
45 | #define WL12XX_BA_SUPPORT_FW_COST_VER2_START 50 | ||
46 | #define WL12XX_BA_SUPPORT_FW_COST_VER2_END 60 | ||
47 | |||
41 | enum { | 48 | enum { |
42 | DEBUG_NONE = 0, | 49 | DEBUG_NONE = 0, |
43 | DEBUG_IRQ = BIT(0), | 50 | DEBUG_IRQ = BIT(0), |
@@ -57,6 +64,8 @@ enum { | |||
57 | DEBUG_SDIO = BIT(14), | 64 | DEBUG_SDIO = BIT(14), |
58 | DEBUG_FILTERS = BIT(15), | 65 | DEBUG_FILTERS = BIT(15), |
59 | DEBUG_ADHOC = BIT(16), | 66 | DEBUG_ADHOC = BIT(16), |
67 | DEBUG_AP = BIT(17), | ||
68 | DEBUG_MASTER = (DEBUG_ADHOC | DEBUG_AP), | ||
60 | DEBUG_ALL = ~0, | 69 | DEBUG_ALL = ~0, |
61 | }; | 70 | }; |
62 | 71 | ||
@@ -103,16 +112,27 @@ extern u32 wl12xx_debug_level; | |||
103 | true); \ | 112 | true); \ |
104 | } while (0) | 113 | } while (0) |
105 | 114 | ||
106 | #define WL1271_DEFAULT_RX_CONFIG (CFG_UNI_FILTER_EN | \ | 115 | #define WL1271_DEFAULT_STA_RX_CONFIG (CFG_UNI_FILTER_EN | \ |
107 | CFG_BSSID_FILTER_EN | \ | 116 | CFG_BSSID_FILTER_EN | \ |
108 | CFG_MC_FILTER_EN) | 117 | CFG_MC_FILTER_EN) |
109 | 118 | ||
110 | #define WL1271_DEFAULT_RX_FILTER (CFG_RX_RCTS_ACK | CFG_RX_PRSP_EN | \ | 119 | #define WL1271_DEFAULT_STA_RX_FILTER (CFG_RX_RCTS_ACK | CFG_RX_PRSP_EN | \ |
111 | CFG_RX_MGMT_EN | CFG_RX_DATA_EN | \ | 120 | CFG_RX_MGMT_EN | CFG_RX_DATA_EN | \ |
112 | CFG_RX_CTL_EN | CFG_RX_BCN_EN | \ | 121 | CFG_RX_CTL_EN | CFG_RX_BCN_EN | \ |
113 | CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN) | 122 | CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN) |
114 | 123 | ||
124 | #define WL1271_DEFAULT_AP_RX_CONFIG 0 | ||
125 | |||
126 | #define WL1271_DEFAULT_AP_RX_FILTER (CFG_RX_RCTS_ACK | CFG_RX_PREQ_EN | \ | ||
127 | CFG_RX_MGMT_EN | CFG_RX_DATA_EN | \ | ||
128 | CFG_RX_CTL_EN | CFG_RX_AUTH_EN | \ | ||
129 | CFG_RX_ASSOC_EN) | ||
130 | |||
131 | |||
132 | |||
115 | #define WL1271_FW_NAME "wl1271-fw.bin" | 133 | #define WL1271_FW_NAME "wl1271-fw.bin" |
134 | #define WL1271_AP_FW_NAME "wl1271-fw-ap.bin" | ||
135 | |||
116 | #define WL1271_NVS_NAME "wl1271-nvs.bin" | 136 | #define WL1271_NVS_NAME "wl1271-nvs.bin" |
117 | 137 | ||
118 | #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff)) | 138 | #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff)) |
@@ -129,6 +149,14 @@ extern u32 wl12xx_debug_level; | |||
129 | #define WL1271_DEFAULT_BEACON_INT 100 | 149 | #define WL1271_DEFAULT_BEACON_INT 100 |
130 | #define WL1271_DEFAULT_DTIM_PERIOD 1 | 150 | #define WL1271_DEFAULT_DTIM_PERIOD 1 |
131 | 151 | ||
152 | #define WL1271_AP_GLOBAL_HLID 0 | ||
153 | #define WL1271_AP_BROADCAST_HLID 1 | ||
154 | #define WL1271_AP_STA_HLID_START 2 | ||
155 | |||
156 | #define WL1271_AP_BSS_INDEX 0 | ||
157 | #define WL1271_AP_DEF_INACTIV_SEC 300 | ||
158 | #define WL1271_AP_DEF_BEACON_EXP 20 | ||
159 | |||
132 | #define ACX_TX_DESCRIPTORS 32 | 160 | #define ACX_TX_DESCRIPTORS 32 |
133 | 161 | ||
134 | #define WL1271_AGGR_BUFFER_SIZE (4 * PAGE_SIZE) | 162 | #define WL1271_AGGR_BUFFER_SIZE (4 * PAGE_SIZE) |
@@ -161,10 +189,13 @@ struct wl1271_partition_set { | |||
161 | 189 | ||
162 | struct wl1271; | 190 | struct wl1271; |
163 | 191 | ||
192 | #define WL12XX_NUM_FW_VER 5 | ||
193 | |||
164 | /* FIXME: I'm not sure about this structure name */ | 194 | /* FIXME: I'm not sure about this structure name */ |
165 | struct wl1271_chip { | 195 | struct wl1271_chip { |
166 | u32 id; | 196 | u32 id; |
167 | char fw_ver[21]; | 197 | char fw_ver_str[ETHTOOL_BUSINFO_LEN]; |
198 | unsigned int fw_ver[WL12XX_NUM_FW_VER]; | ||
168 | }; | 199 | }; |
169 | 200 | ||
170 | struct wl1271_stats { | 201 | struct wl1271_stats { |
@@ -178,6 +209,11 @@ struct wl1271_stats { | |||
178 | #define NUM_TX_QUEUES 4 | 209 | #define NUM_TX_QUEUES 4 |
179 | #define NUM_RX_PKT_DESC 8 | 210 | #define NUM_RX_PKT_DESC 8 |
180 | 211 | ||
212 | #define AP_MAX_STATIONS 5 | ||
213 | |||
214 | /* Broadcast and Global links + links to stations */ | ||
215 | #define AP_MAX_LINKS (AP_MAX_STATIONS + 2) | ||
216 | |||
181 | /* FW status registers */ | 217 | /* FW status registers */ |
182 | struct wl1271_fw_status { | 218 | struct wl1271_fw_status { |
183 | __le32 intr; | 219 | __le32 intr; |
@@ -188,7 +224,18 @@ struct wl1271_fw_status { | |||
188 | __le32 rx_pkt_descs[NUM_RX_PKT_DESC]; | 224 | __le32 rx_pkt_descs[NUM_RX_PKT_DESC]; |
189 | __le32 tx_released_blks[NUM_TX_QUEUES]; | 225 | __le32 tx_released_blks[NUM_TX_QUEUES]; |
190 | __le32 fw_localtime; | 226 | __le32 fw_localtime; |
191 | __le32 padding[2]; | 227 | |
228 | /* Next fields valid only in AP FW */ | ||
229 | |||
230 | /* | ||
231 | * A bitmap (where each bit represents a single HLID) | ||
232 | * to indicate if the station is in PS mode. | ||
233 | */ | ||
234 | __le32 link_ps_bitmap; | ||
235 | |||
236 | /* Number of freed MBs per HLID */ | ||
237 | u8 tx_lnk_free_blks[AP_MAX_LINKS]; | ||
238 | u8 padding_1[1]; | ||
192 | } __packed; | 239 | } __packed; |
193 | 240 | ||
194 | struct wl1271_rx_mem_pool_addr { | 241 | struct wl1271_rx_mem_pool_addr { |
@@ -218,6 +265,19 @@ struct wl1271_if_operations { | |||
218 | void (*disable_irq)(struct wl1271 *wl); | 265 | void (*disable_irq)(struct wl1271 *wl); |
219 | }; | 266 | }; |
220 | 267 | ||
268 | #define MAX_NUM_KEYS 14 | ||
269 | #define MAX_KEY_SIZE 32 | ||
270 | |||
271 | struct wl1271_ap_key { | ||
272 | u8 id; | ||
273 | u8 key_type; | ||
274 | u8 key_size; | ||
275 | u8 key[MAX_KEY_SIZE]; | ||
276 | u8 hlid; | ||
277 | u32 tx_seq_32; | ||
278 | u16 tx_seq_16; | ||
279 | }; | ||
280 | |||
221 | struct wl1271 { | 281 | struct wl1271 { |
222 | struct platform_device *plat_dev; | 282 | struct platform_device *plat_dev; |
223 | struct ieee80211_hw *hw; | 283 | struct ieee80211_hw *hw; |
@@ -251,6 +311,7 @@ struct wl1271 { | |||
251 | #define WL1271_FLAG_PSPOLL_FAILURE (12) | 311 | #define WL1271_FLAG_PSPOLL_FAILURE (12) |
252 | #define WL1271_FLAG_STA_STATE_SENT (13) | 312 | #define WL1271_FLAG_STA_STATE_SENT (13) |
253 | #define WL1271_FLAG_FW_TX_BUSY (14) | 313 | #define WL1271_FLAG_FW_TX_BUSY (14) |
314 | #define WL1271_FLAG_AP_STARTED (15) | ||
254 | unsigned long flags; | 315 | unsigned long flags; |
255 | 316 | ||
256 | struct wl1271_partition_set part; | 317 | struct wl1271_partition_set part; |
@@ -262,6 +323,7 @@ struct wl1271 { | |||
262 | 323 | ||
263 | u8 *fw; | 324 | u8 *fw; |
264 | size_t fw_len; | 325 | size_t fw_len; |
326 | u8 fw_bss_type; | ||
265 | struct wl1271_nvs_file *nvs; | 327 | struct wl1271_nvs_file *nvs; |
266 | size_t nvs_len; | 328 | size_t nvs_len; |
267 | 329 | ||
@@ -378,7 +440,6 @@ struct wl1271 { | |||
378 | int last_rssi_event; | 440 | int last_rssi_event; |
379 | 441 | ||
380 | struct wl1271_stats stats; | 442 | struct wl1271_stats stats; |
381 | struct dentry *rootdir; | ||
382 | 443 | ||
383 | __le32 buffer_32; | 444 | __le32 buffer_32; |
384 | u32 buffer_cmd; | 445 | u32 buffer_cmd; |
@@ -400,6 +461,23 @@ struct wl1271 { | |||
400 | 461 | ||
401 | /* Most recently reported noise in dBm */ | 462 | /* Most recently reported noise in dBm */ |
402 | s8 noise; | 463 | s8 noise; |
464 | |||
465 | /* map for HLIDs of associated stations - when operating in AP mode */ | ||
466 | unsigned long ap_hlid_map[BITS_TO_LONGS(AP_MAX_STATIONS)]; | ||
467 | |||
468 | /* recoreded keys for AP-mode - set here before AP startup */ | ||
469 | struct wl1271_ap_key *recorded_ap_keys[MAX_NUM_KEYS]; | ||
470 | |||
471 | /* bands supported by this instance of wl12xx */ | ||
472 | struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; | ||
473 | |||
474 | /* RX BA constraint value */ | ||
475 | bool ba_support; | ||
476 | u8 ba_rx_bitmap; | ||
477 | }; | ||
478 | |||
479 | struct wl1271_station { | ||
480 | u8 hlid; | ||
403 | }; | 481 | }; |
404 | 482 | ||
405 | int wl1271_plt_start(struct wl1271 *wl); | 483 | int wl1271_plt_start(struct wl1271 *wl); |