diff options
author | Eliad Peller <eliad@wizery.com> | 2012-11-22 11:06:19 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-11-27 03:49:29 -0500 |
commit | c50a282515dc7092f7318708a0f3ae7ca7342b9f (patch) | |
tree | 1e0f6973d6382a00c88f5a544f8672e1e50dc148 /drivers/net/wireless/ti/wl18xx/main.c | |
parent | fcab189027cdd68df7f97474d1419aaa4a82130c (diff) |
wlcore: update events enum/struct to new fw api
The event mailbox in wl18xx has a different
(non-compatible) structure.
Create common functions in wlcore to handle the
events, and call them from the chip-specific
event mailbox parsers.
This way, each driver (wl12xx/wl18xx) extracts
the event mailbox by itself according to its
own structure, and then calls the common
wlcore functions to handle it.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 2e54a3ea813c..0895ffaad5a9 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "wl18xx.h" | 40 | #include "wl18xx.h" |
41 | #include "io.h" | 41 | #include "io.h" |
42 | #include "scan.h" | 42 | #include "scan.h" |
43 | #include "event.h" | ||
43 | #include "debugfs.h" | 44 | #include "debugfs.h" |
44 | 45 | ||
45 | #define WL18XX_RX_CHECKSUM_MASK 0x40 | 46 | #define WL18XX_RX_CHECKSUM_MASK 0x40 |
@@ -851,6 +852,18 @@ static int wl18xx_boot(struct wl1271 *wl) | |||
851 | if (ret < 0) | 852 | if (ret < 0) |
852 | goto out; | 853 | goto out; |
853 | 854 | ||
855 | wl->event_mask = BSS_LOSS_EVENT_ID | | ||
856 | SCAN_COMPLETE_EVENT_ID | | ||
857 | RSSI_SNR_TRIGGER_0_EVENT_ID | | ||
858 | PERIODIC_SCAN_COMPLETE_EVENT_ID | | ||
859 | DUMMY_PACKET_EVENT_ID | | ||
860 | PEER_REMOVE_COMPLETE_EVENT_ID | | ||
861 | BA_SESSION_RX_CONSTRAINT_EVENT_ID | | ||
862 | REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID | | ||
863 | INACTIVE_STA_EVENT_ID | | ||
864 | MAX_TX_FAILURE_EVENT_ID | | ||
865 | CHANNEL_SWITCH_COMPLETE_EVENT_ID; | ||
866 | |||
854 | ret = wlcore_boot_run_firmware(wl); | 867 | ret = wlcore_boot_run_firmware(wl); |
855 | if (ret < 0) | 868 | if (ret < 0) |
856 | goto out; | 869 | goto out; |
@@ -1313,6 +1326,8 @@ static struct wlcore_ops wl18xx_ops = { | |||
1313 | .plt_init = wl18xx_plt_init, | 1326 | .plt_init = wl18xx_plt_init, |
1314 | .trigger_cmd = wl18xx_trigger_cmd, | 1327 | .trigger_cmd = wl18xx_trigger_cmd, |
1315 | .ack_event = wl18xx_ack_event, | 1328 | .ack_event = wl18xx_ack_event, |
1329 | .wait_for_event = wl18xx_wait_for_event, | ||
1330 | .process_mailbox_events = wl18xx_process_mailbox_events, | ||
1316 | .calc_tx_blocks = wl18xx_calc_tx_blocks, | 1331 | .calc_tx_blocks = wl18xx_calc_tx_blocks, |
1317 | .set_tx_desc_blocks = wl18xx_set_tx_desc_blocks, | 1332 | .set_tx_desc_blocks = wl18xx_set_tx_desc_blocks, |
1318 | .set_tx_desc_data_len = wl18xx_set_tx_desc_data_len, | 1333 | .set_tx_desc_data_len = wl18xx_set_tx_desc_data_len, |
@@ -1330,7 +1345,6 @@ static struct wlcore_ops wl18xx_ops = { | |||
1330 | .debugfs_init = wl18xx_debugfs_add_files, | 1345 | .debugfs_init = wl18xx_debugfs_add_files, |
1331 | .scan_start = wl18xx_scan_start, | 1346 | .scan_start = wl18xx_scan_start, |
1332 | .scan_stop = wl18xx_scan_stop, | 1347 | .scan_stop = wl18xx_scan_stop, |
1333 | .scan_completed = wl18xx_scan_completed, | ||
1334 | .sched_scan_start = wl18xx_sched_scan_start, | 1348 | .sched_scan_start = wl18xx_sched_scan_start, |
1335 | .sched_scan_stop = wl18xx_scan_sched_scan_stop, | 1349 | .sched_scan_stop = wl18xx_scan_sched_scan_stop, |
1336 | .handle_static_data = wl18xx_handle_static_data, | 1350 | .handle_static_data = wl18xx_handle_static_data, |
@@ -1524,7 +1538,8 @@ static int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1524 | int ret; | 1538 | int ret; |
1525 | 1539 | ||
1526 | hw = wlcore_alloc_hw(sizeof(struct wl18xx_priv), | 1540 | hw = wlcore_alloc_hw(sizeof(struct wl18xx_priv), |
1527 | WL18XX_AGGR_BUFFER_SIZE); | 1541 | WL18XX_AGGR_BUFFER_SIZE, |
1542 | sizeof(struct wl18xx_event_mailbox)); | ||
1528 | if (IS_ERR(hw)) { | 1543 | if (IS_ERR(hw)) { |
1529 | wl1271_error("can't allocate hw"); | 1544 | wl1271_error("can't allocate hw"); |
1530 | ret = PTR_ERR(hw); | 1545 | ret = PTR_ERR(hw); |