aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2013-03-09 05:01:35 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2013-03-18 07:37:46 -0400
commitec1461dc30feb422af65ee849137f56e7f87f55e (patch)
tree1584c29dd220906bdc3d217c6371d32f183d9d96
parente72c27464cce59be432e6322a407a4d94626f8df (diff)
ath6kl: cleanup ath6kl_reset_device()
Move it to init.c, make it static, remove all useless checks and force it to always do cold reset. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath6kl/core.h2
-rw-r--r--drivers/net/wireless/ath/ath6kl/init.c12
-rw-r--r--drivers/net/wireless/ath/ath6kl/main.c33
-rw-r--r--drivers/net/wireless/ath/ath6kl/target.h2
4 files changed, 10 insertions, 39 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 1c9ed40358d8..26b0f92424e1 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -935,8 +935,6 @@ void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid, u16 seq_no,
935 u8 win_sz); 935 u8 win_sz);
936void ath6kl_wakeup_event(void *dev); 936void ath6kl_wakeup_event(void *dev);
937 937
938void ath6kl_reset_device(struct ath6kl *ar, u32 target_type,
939 bool wait_fot_compltn, bool cold_reset);
940void ath6kl_init_control_info(struct ath6kl_vif *vif); 938void ath6kl_init_control_info(struct ath6kl_vif *vif);
941struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar); 939struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar);
942void ath6kl_cfg80211_vif_stop(struct ath6kl_vif *vif, bool wmi_ready); 940void ath6kl_cfg80211_vif_stop(struct ath6kl_vif *vif, bool wmi_ready);
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 3e45adc4a5c2..ae1e477ec0d2 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1619,6 +1619,14 @@ static void ath6kl_init_get_fwcaps(struct ath6kl *ar, char *buf, size_t buf_len)
1619 buf[len] = '\0'; 1619 buf[len] = '\0';
1620} 1620}
1621 1621
1622static int ath6kl_init_hw_reset(struct ath6kl *ar)
1623{
1624 ath6kl_dbg(ATH6KL_DBG_BOOT, "cold resetting the device");
1625
1626 return ath6kl_diag_write32(ar, RESET_CONTROL_ADDRESS,
1627 cpu_to_le32(RESET_CONTROL_COLD_RST));
1628}
1629
1622static int __ath6kl_init_hw_start(struct ath6kl *ar) 1630static int __ath6kl_init_hw_start(struct ath6kl *ar)
1623{ 1631{
1624 long timeleft; 1632 long timeleft;
@@ -1836,9 +1844,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
1836 * Try to reset the device if we can. The driver may have been 1844 * Try to reset the device if we can. The driver may have been
1837 * configure NOT to reset the target during a debug session. 1845 * configure NOT to reset the target during a debug session.
1838 */ 1846 */
1839 ath6kl_dbg(ATH6KL_DBG_TRC, 1847 ath6kl_init_hw_reset(ar);
1840 "attempting to reset target on instance destroy\n");
1841 ath6kl_reset_device(ar, ar->target_type, true, true);
1842 1848
1843 up(&ar->sem); 1849 up(&ar->sem);
1844} 1850}
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index bd50b6b7b492..bad62b3357b9 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -345,39 +345,6 @@ out:
345 return ret; 345 return ret;
346} 346}
347 347
348/* FIXME: move to a better place, target.h? */
349#define AR6003_RESET_CONTROL_ADDRESS 0x00004000
350#define AR6004_RESET_CONTROL_ADDRESS 0x00004000
351
352void ath6kl_reset_device(struct ath6kl *ar, u32 target_type,
353 bool wait_fot_compltn, bool cold_reset)
354{
355 int status = 0;
356 u32 address;
357 __le32 data;
358
359 if (target_type != TARGET_TYPE_AR6003 &&
360 target_type != TARGET_TYPE_AR6004)
361 return;
362
363 data = cold_reset ? cpu_to_le32(RESET_CONTROL_COLD_RST) :
364 cpu_to_le32(RESET_CONTROL_MBOX_RST);
365
366 switch (target_type) {
367 case TARGET_TYPE_AR6003:
368 address = AR6003_RESET_CONTROL_ADDRESS;
369 break;
370 case TARGET_TYPE_AR6004:
371 address = AR6004_RESET_CONTROL_ADDRESS;
372 break;
373 }
374
375 status = ath6kl_diag_write32(ar, address, data);
376
377 if (status)
378 ath6kl_err("failed to reset target\n");
379}
380
381static void ath6kl_install_static_wep_keys(struct ath6kl_vif *vif) 348static void ath6kl_install_static_wep_keys(struct ath6kl_vif *vif)
382{ 349{
383 u8 index; 350 u8 index;
diff --git a/drivers/net/wireless/ath/ath6kl/target.h b/drivers/net/wireless/ath/ath6kl/target.h
index a98c12ba70c1..a580a629a0da 100644
--- a/drivers/net/wireless/ath/ath6kl/target.h
+++ b/drivers/net/wireless/ath/ath6kl/target.h
@@ -25,7 +25,7 @@
25#define AR6004_BOARD_DATA_SZ 6144 25#define AR6004_BOARD_DATA_SZ 6144
26#define AR6004_BOARD_EXT_DATA_SZ 0 26#define AR6004_BOARD_EXT_DATA_SZ 0
27 27
28#define RESET_CONTROL_ADDRESS 0x00000000 28#define RESET_CONTROL_ADDRESS 0x00004000
29#define RESET_CONTROL_COLD_RST 0x00000100 29#define RESET_CONTROL_COLD_RST 0x00000100
30#define RESET_CONTROL_MBOX_RST 0x00000004 30#define RESET_CONTROL_MBOX_RST 0x00000004
31 31