summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/htc_hst.c
diff options
context:
space:
mode:
authorSujith.Manoharan@atheros.com <Sujith.Manoharan@atheros.com>2010-05-11 14:54:41 +0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-13 00:39:06 +0400
commit47fce026d5de5d11e161da73208171e9c91b659a (patch)
treeb63ac53195fd7d069a4bc79c5ec49d32a2c57e5d /drivers/net/wireless/ath/ath9k/htc_hst.c
parent1d8af8caccceab91ba65b7f659678b92093f9203 (diff)
downloadlinux-47fce026d5de5d11e161da73208171e9c91b659a.tar.xz
ath9k_htc: Reorder HTC initialization
The HTC state has to be setup before initializing the target because the ready message could possibly come before the control endpoints in HTC have been identified. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_hst.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_hst.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 7bf6ce1e7e2e..2c8006ae2786 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -425,29 +425,19 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
}
}
-struct htc_target *ath9k_htc_hw_alloc(void *hif_handle)
+struct htc_target *ath9k_htc_hw_alloc(void *hif_handle,
+ struct ath9k_htc_hif *hif,
+ struct device *dev)
{
+ struct htc_endpoint *endpoint;
struct htc_target *target;
target = kzalloc(sizeof(struct htc_target), GFP_KERNEL);
- if (!target)
+ if (!target) {
printk(KERN_ERR "Unable to allocate memory for"
"target device\n");
-
- return target;
-}
-
-void ath9k_htc_hw_free(struct htc_target *htc)
-{
- kfree(htc);
-}
-
-int ath9k_htc_hw_init(struct ath9k_htc_hif *hif, struct htc_target *target,
- void *hif_handle, struct device *dev, u16 devid,
- enum ath9k_hif_transports transport)
-{
- struct htc_endpoint *endpoint;
- int err = 0;
+ return NULL;
+ }
init_completion(&target->target_wait);
init_completion(&target->cmd_wait);
@@ -461,8 +451,18 @@ int ath9k_htc_hw_init(struct ath9k_htc_hif *hif, struct htc_target *target,
endpoint->ul_pipeid = hif->control_ul_pipe;
endpoint->dl_pipeid = hif->control_dl_pipe;
- err = ath9k_htc_probe_device(target, dev, devid);
- if (err) {
+ return target;
+}
+
+void ath9k_htc_hw_free(struct htc_target *htc)
+{
+ kfree(htc);
+}
+
+int ath9k_htc_hw_init(struct htc_target *target,
+ struct device *dev, u16 devid)
+{
+ if (ath9k_htc_probe_device(target, dev, devid)) {
printk(KERN_ERR "Failed to initialize the device\n");
return -ENODEV;
}