aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/init.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2012-08-29 10:10:25 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2012-10-24 04:49:48 -0400
commitede615d2f043539e23bc4022955dbe0c3ec70ca2 (patch)
treeddb2e2e09bf189314358b19e478a33bd48392f8f /drivers/net/wireless/ath/ath6kl/init.c
parent83685091acb878980711c3b28fe42e8959583e84 (diff)
ath6kl: Refactor ath6kl_init_hw_start() and ath6kl_init_hw_stop()
So that these functions will be used to re-initialize the fw upon detecting fw error. This refactoring moves ar->state setting out of core stop/start functionality. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/init.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/init.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index eb3677bd6e8f..be27ebec9052 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1546,7 +1546,7 @@ static const char *ath6kl_init_get_hif_name(enum ath6kl_hif_type type)
1546 return NULL; 1546 return NULL;
1547} 1547}
1548 1548
1549int ath6kl_init_hw_start(struct ath6kl *ar) 1549static int __ath6kl_init_hw_start(struct ath6kl *ar)
1550{ 1550{
1551 long timeleft; 1551 long timeleft;
1552 int ret, i; 1552 int ret, i;
@@ -1642,8 +1642,6 @@ int ath6kl_init_hw_start(struct ath6kl *ar)
1642 goto err_htc_stop; 1642 goto err_htc_stop;
1643 } 1643 }
1644 1644
1645 ar->state = ATH6KL_STATE_ON;
1646
1647 return 0; 1645 return 0;
1648 1646
1649err_htc_stop: 1647err_htc_stop:
@@ -1656,7 +1654,18 @@ err_power_off:
1656 return ret; 1654 return ret;
1657} 1655}
1658 1656
1659int ath6kl_init_hw_stop(struct ath6kl *ar) 1657int ath6kl_init_hw_start(struct ath6kl *ar)
1658{
1659 int err;
1660
1661 err = __ath6kl_init_hw_start(ar);
1662 if (err)
1663 return err;
1664 ar->state = ATH6KL_STATE_ON;
1665 return 0;
1666}
1667
1668static int __ath6kl_init_hw_stop(struct ath6kl *ar)
1660{ 1669{
1661 int ret; 1670 int ret;
1662 1671
@@ -1672,8 +1681,17 @@ int ath6kl_init_hw_stop(struct ath6kl *ar)
1672 if (ret) 1681 if (ret)
1673 ath6kl_warn("failed to power off hif: %d\n", ret); 1682 ath6kl_warn("failed to power off hif: %d\n", ret);
1674 1683
1675 ar->state = ATH6KL_STATE_OFF; 1684 return 0;
1685}
1676 1686
1687int ath6kl_init_hw_stop(struct ath6kl *ar)
1688{
1689 int err;
1690
1691 err = __ath6kl_init_hw_stop(ar);
1692 if (err)
1693 return err;
1694 ar->state = ATH6KL_STATE_OFF;
1677 return 0; 1695 return 0;
1678} 1696}
1679 1697