diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-07-17 01:11:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:38:08 -0400 |
commit | 2ec610cb6d57032cdab89781e37ed3e442c73367 (patch) | |
tree | b8c01e22685c65e82480520aad590711471a3ce5 /drivers/net/wireless/mwl8k.c | |
parent | 618952a7b19b796fce98364fb26551cbe3e16a75 (diff) |
mwl8k: get rid of mwl8k_start() workqueue use
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 105 |
1 files changed, 27 insertions, 78 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 93b92680d070..7b7007da873f 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -2489,104 +2489,53 @@ static int mwl8k_queue_work(struct ieee80211_hw *hw, | |||
2489 | return rc; | 2489 | return rc; |
2490 | } | 2490 | } |
2491 | 2491 | ||
2492 | struct mwl8k_start_worker { | ||
2493 | struct mwl8k_work_struct header; | ||
2494 | }; | ||
2495 | |||
2496 | static int mwl8k_start_wt(struct work_struct *wt) | ||
2497 | { | ||
2498 | struct mwl8k_start_worker *worker = (struct mwl8k_start_worker *)wt; | ||
2499 | struct ieee80211_hw *hw = worker->header.hw; | ||
2500 | struct mwl8k_priv *priv = hw->priv; | ||
2501 | int rc = 0; | ||
2502 | |||
2503 | if (priv->vif != NULL) { | ||
2504 | rc = -EIO; | ||
2505 | goto mwl8k_start_exit; | ||
2506 | } | ||
2507 | |||
2508 | /* Turn on radio */ | ||
2509 | if (mwl8k_cmd_802_11_radio_enable(hw)) { | ||
2510 | rc = -EIO; | ||
2511 | goto mwl8k_start_exit; | ||
2512 | } | ||
2513 | |||
2514 | /* Purge TX/RX HW queues */ | ||
2515 | if (mwl8k_cmd_set_pre_scan(hw)) { | ||
2516 | rc = -EIO; | ||
2517 | goto mwl8k_start_exit; | ||
2518 | } | ||
2519 | |||
2520 | if (mwl8k_cmd_set_post_scan(hw, "\x00\x00\x00\x00\x00\x00")) { | ||
2521 | rc = -EIO; | ||
2522 | goto mwl8k_start_exit; | ||
2523 | } | ||
2524 | |||
2525 | /* Enable firmware rate adaptation */ | ||
2526 | if (mwl8k_cmd_setrateadaptmode(hw, 0)) { | ||
2527 | rc = -EIO; | ||
2528 | goto mwl8k_start_exit; | ||
2529 | } | ||
2530 | |||
2531 | /* Disable WMM. WMM gets enabled when stack sends WMM parms */ | ||
2532 | if (mwl8k_set_wmm(hw, 0)) { | ||
2533 | rc = -EIO; | ||
2534 | goto mwl8k_start_exit; | ||
2535 | } | ||
2536 | |||
2537 | /* Disable sniffer mode */ | ||
2538 | if (mwl8k_enable_sniffer(hw, 0)) | ||
2539 | rc = -EIO; | ||
2540 | |||
2541 | mwl8k_start_exit: | ||
2542 | return rc; | ||
2543 | } | ||
2544 | |||
2545 | static int mwl8k_start(struct ieee80211_hw *hw) | 2492 | static int mwl8k_start(struct ieee80211_hw *hw) |
2546 | { | 2493 | { |
2547 | struct mwl8k_start_worker *worker; | ||
2548 | struct mwl8k_priv *priv = hw->priv; | 2494 | struct mwl8k_priv *priv = hw->priv; |
2549 | int rc; | 2495 | int rc; |
2550 | 2496 | ||
2551 | /* Enable tx reclaim tasklet */ | ||
2552 | tasklet_enable(&priv->tx_reclaim_task); | ||
2553 | |||
2554 | rc = request_irq(priv->pdev->irq, &mwl8k_interrupt, | 2497 | rc = request_irq(priv->pdev->irq, &mwl8k_interrupt, |
2555 | IRQF_SHARED, MWL8K_NAME, hw); | 2498 | IRQF_SHARED, MWL8K_NAME, hw); |
2556 | if (rc) { | 2499 | if (rc) { |
2557 | printk(KERN_ERR "%s: failed to register IRQ handler\n", | 2500 | printk(KERN_ERR "%s: failed to register IRQ handler\n", |
2558 | priv->name); | 2501 | priv->name); |
2559 | rc = -EIO; | 2502 | return -EIO; |
2560 | goto mwl8k_start_disable_tasklet; | ||
2561 | } | 2503 | } |
2562 | 2504 | ||
2505 | /* Enable tx reclaim tasklet */ | ||
2506 | tasklet_enable(&priv->tx_reclaim_task); | ||
2507 | |||
2563 | /* Enable interrupts */ | 2508 | /* Enable interrupts */ |
2564 | iowrite32(MWL8K_A2H_EVENTS, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); | 2509 | iowrite32(MWL8K_A2H_EVENTS, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); |
2565 | 2510 | ||
2566 | worker = kzalloc(sizeof(*worker), GFP_KERNEL); | 2511 | rc = mwl8k_fw_lock(hw); |
2567 | if (worker == NULL) { | 2512 | if (!rc) { |
2568 | rc = -ENOMEM; | 2513 | rc = mwl8k_cmd_802_11_radio_enable(hw); |
2569 | goto mwl8k_start_disable_irq; | ||
2570 | } | ||
2571 | 2514 | ||
2572 | rc = mwl8k_queue_work(hw, &worker->header, mwl8k_start_wt); | 2515 | if (!rc) |
2573 | kfree(worker); | 2516 | rc = mwl8k_cmd_set_pre_scan(hw); |
2574 | if (!rc) | ||
2575 | return rc; | ||
2576 | 2517 | ||
2577 | if (rc == -ETIMEDOUT) | 2518 | if (!rc) |
2578 | printk(KERN_ERR "%s() timed out\n", __func__); | 2519 | rc = mwl8k_cmd_set_post_scan(hw, |
2520 | "\x00\x00\x00\x00\x00\x00"); | ||
2579 | 2521 | ||
2580 | rc = -EIO; | 2522 | if (!rc) |
2523 | rc = mwl8k_cmd_setrateadaptmode(hw, 0); | ||
2581 | 2524 | ||
2582 | mwl8k_start_disable_irq: | 2525 | if (!rc) |
2583 | spin_lock_irq(&priv->tx_lock); | 2526 | rc = mwl8k_set_wmm(hw, 0); |
2584 | iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); | ||
2585 | spin_unlock_irq(&priv->tx_lock); | ||
2586 | free_irq(priv->pdev->irq, hw); | ||
2587 | 2527 | ||
2588 | mwl8k_start_disable_tasklet: | 2528 | if (!rc) |
2589 | tasklet_disable(&priv->tx_reclaim_task); | 2529 | rc = mwl8k_enable_sniffer(hw, 0); |
2530 | |||
2531 | mwl8k_fw_unlock(hw); | ||
2532 | } | ||
2533 | |||
2534 | if (rc) { | ||
2535 | iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); | ||
2536 | free_irq(priv->pdev->irq, hw); | ||
2537 | tasklet_disable(&priv->tx_reclaim_task); | ||
2538 | } | ||
2590 | 2539 | ||
2591 | return rc; | 2540 | return rc; |
2592 | } | 2541 | } |