diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251.h')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251.h | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251.h b/drivers/net/wireless/wl12xx/wl1251.h index 665aca02bea9..998e4b6252bd 100644 --- a/drivers/net/wireless/wl12xx/wl1251.h +++ b/drivers/net/wireless/wl12xx/wl1251.h | |||
@@ -143,35 +143,6 @@ struct wl1251_partition_set { | |||
143 | 143 | ||
144 | struct wl1251; | 144 | struct wl1251; |
145 | 145 | ||
146 | /* FIXME: I'm not sure about this structure name */ | ||
147 | struct wl1251_chip { | ||
148 | u32 id; | ||
149 | |||
150 | const char *fw_filename; | ||
151 | const char *nvs_filename; | ||
152 | |||
153 | char fw_ver[21]; | ||
154 | |||
155 | unsigned int power_on_sleep; | ||
156 | int intr_cmd_complete; | ||
157 | int intr_init_complete; | ||
158 | |||
159 | int (*op_upload_fw)(struct wl1251 *wl); | ||
160 | int (*op_upload_nvs)(struct wl1251 *wl); | ||
161 | int (*op_boot)(struct wl1251 *wl); | ||
162 | void (*op_set_ecpu_ctrl)(struct wl1251 *wl, u32 flag); | ||
163 | void (*op_target_enable_interrupts)(struct wl1251 *wl); | ||
164 | int (*op_hw_init)(struct wl1251 *wl); | ||
165 | int (*op_plt_init)(struct wl1251 *wl); | ||
166 | void (*op_tx_flush)(struct wl1251 *wl); | ||
167 | void (*op_fw_version)(struct wl1251 *wl); | ||
168 | int (*op_cmd_join)(struct wl1251 *wl, u8 bss_type, u8 dtim_interval, | ||
169 | u16 beacon_interval, u8 wait); | ||
170 | |||
171 | struct wl1251_partition_set *p_table; | ||
172 | enum wl12xx_acx_int_reg *acx_reg_table; | ||
173 | }; | ||
174 | |||
175 | struct wl1251_stats { | 146 | struct wl1251_stats { |
176 | struct acx_statistics *fw_stats; | 147 | struct acx_statistics *fw_stats; |
177 | unsigned long fw_stats_update; | 148 | unsigned long fw_stats_update; |
@@ -281,11 +252,20 @@ struct wl1251_debugfs { | |||
281 | struct dentry *excessive_retries; | 252 | struct dentry *excessive_retries; |
282 | }; | 253 | }; |
283 | 254 | ||
255 | struct wl1251_if_operations { | ||
256 | void (*read)(struct wl1251 *wl, int addr, void *buf, size_t len); | ||
257 | void (*write)(struct wl1251 *wl, int addr, void *buf, size_t len); | ||
258 | void (*reset)(struct wl1251 *wl); | ||
259 | void (*enable_irq)(struct wl1251 *wl); | ||
260 | void (*disable_irq)(struct wl1251 *wl); | ||
261 | }; | ||
262 | |||
284 | struct wl1251 { | 263 | struct wl1251 { |
285 | struct ieee80211_hw *hw; | 264 | struct ieee80211_hw *hw; |
286 | bool mac80211_registered; | 265 | bool mac80211_registered; |
287 | 266 | ||
288 | struct spi_device *spi; | 267 | void *if_priv; |
268 | const struct wl1251_if_operations *if_ops; | ||
289 | 269 | ||
290 | void (*set_power)(bool enable); | 270 | void (*set_power)(bool enable); |
291 | int irq; | 271 | int irq; |
@@ -298,8 +278,6 @@ struct wl1251 { | |||
298 | int virtual_mem_addr; | 278 | int virtual_mem_addr; |
299 | int virtual_reg_addr; | 279 | int virtual_reg_addr; |
300 | 280 | ||
301 | struct wl1251_chip chip; | ||
302 | |||
303 | int cmd_box_addr; | 281 | int cmd_box_addr; |
304 | int event_box_addr; | 282 | int event_box_addr; |
305 | struct boot_attr boot_attr; | 283 | struct boot_attr boot_attr; |
@@ -382,6 +360,9 @@ struct wl1251 { | |||
382 | /* PSM mode requested */ | 360 | /* PSM mode requested */ |
383 | bool psm_requested; | 361 | bool psm_requested; |
384 | 362 | ||
363 | u16 beacon_int; | ||
364 | u8 dtim_period; | ||
365 | |||
385 | /* in dBm */ | 366 | /* in dBm */ |
386 | int power_level; | 367 | int power_level; |
387 | 368 | ||
@@ -392,11 +373,20 @@ struct wl1251 { | |||
392 | u32 buffer_cmd; | 373 | u32 buffer_cmd; |
393 | u8 buffer_busyword[WL1251_BUSY_WORD_LEN]; | 374 | u8 buffer_busyword[WL1251_BUSY_WORD_LEN]; |
394 | struct wl1251_rx_descriptor *rx_descriptor; | 375 | struct wl1251_rx_descriptor *rx_descriptor; |
376 | |||
377 | u32 chip_id; | ||
378 | char fw_ver[21]; | ||
395 | }; | 379 | }; |
396 | 380 | ||
397 | int wl1251_plt_start(struct wl1251 *wl); | 381 | int wl1251_plt_start(struct wl1251 *wl); |
398 | int wl1251_plt_stop(struct wl1251 *wl); | 382 | int wl1251_plt_stop(struct wl1251 *wl); |
399 | 383 | ||
384 | struct ieee80211_hw *wl1251_alloc_hw(void); | ||
385 | int wl1251_free_hw(struct wl1251 *wl); | ||
386 | int wl1251_init_ieee80211(struct wl1251 *wl); | ||
387 | void wl1251_enable_interrupts(struct wl1251 *wl); | ||
388 | void wl1251_disable_interrupts(struct wl1251 *wl); | ||
389 | |||
400 | #define DEFAULT_HW_GEN_MODULATION_TYPE CCK_LONG /* Long Preamble */ | 390 | #define DEFAULT_HW_GEN_MODULATION_TYPE CCK_LONG /* Long Preamble */ |
401 | #define DEFAULT_HW_GEN_TX_RATE RATE_2MBPS | 391 | #define DEFAULT_HW_GEN_TX_RATE RATE_2MBPS |
402 | #define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */ | 392 | #define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */ |
@@ -405,11 +395,10 @@ int wl1251_plt_stop(struct wl1251 *wl); | |||
405 | 395 | ||
406 | #define WL1251_TX_QUEUE_MAX_LENGTH 20 | 396 | #define WL1251_TX_QUEUE_MAX_LENGTH 20 |
407 | 397 | ||
408 | /* Different chips need different sleep times after power on. WL1271 needs | 398 | #define WL1251_DEFAULT_BEACON_INT 100 |
409 | * 200ms, WL1251 needs only 10ms. By default we use 200ms, but as soon as we | 399 | #define WL1251_DEFAULT_DTIM_PERIOD 1 |
410 | * know the chip ID, we change the sleep value in the wl1251 chip structure, | 400 | |
411 | * so in subsequent power ons, we don't waste more time then needed. */ | 401 | #define WL1251_DEFAULT_CHANNEL 0 |
412 | #define WL1251_DEFAULT_POWER_ON_SLEEP 200 | ||
413 | 402 | ||
414 | #define CHIP_ID_1251_PG10 (0x7010101) | 403 | #define CHIP_ID_1251_PG10 (0x7010101) |
415 | #define CHIP_ID_1251_PG11 (0x7020101) | 404 | #define CHIP_ID_1251_PG11 (0x7020101) |
@@ -417,4 +406,19 @@ int wl1251_plt_stop(struct wl1251 *wl); | |||
417 | #define CHIP_ID_1271_PG10 (0x4030101) | 406 | #define CHIP_ID_1271_PG10 (0x4030101) |
418 | #define CHIP_ID_1271_PG20 (0x4030111) | 407 | #define CHIP_ID_1271_PG20 (0x4030111) |
419 | 408 | ||
409 | #define WL1251_FW_NAME "wl1251-fw.bin" | ||
410 | #define WL1251_NVS_NAME "wl1251-nvs.bin" | ||
411 | |||
412 | #define WL1251_POWER_ON_SLEEP 10 /* in miliseconds */ | ||
413 | |||
414 | #define WL1251_PART_DOWN_MEM_START 0x0 | ||
415 | #define WL1251_PART_DOWN_MEM_SIZE 0x16800 | ||
416 | #define WL1251_PART_DOWN_REG_START REGISTERS_BASE | ||
417 | #define WL1251_PART_DOWN_REG_SIZE REGISTERS_DOWN_SIZE | ||
418 | |||
419 | #define WL1251_PART_WORK_MEM_START 0x28000 | ||
420 | #define WL1251_PART_WORK_MEM_SIZE 0x14000 | ||
421 | #define WL1251_PART_WORK_REG_START REGISTERS_BASE | ||
422 | #define WL1251_PART_WORK_REG_SIZE REGISTERS_WORK_SIZE | ||
423 | |||
420 | #endif | 424 | #endif |