diff options
author | Sujith.Manoharan@atheros.com <Sujith.Manoharan@atheros.com> | 2010-05-11 06:54:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-05-12 16:39:06 -0400 |
commit | 47fce026d5de5d11e161da73208171e9c91b659a (patch) | |
tree | b63ac53195fd7d069a4bc79c5ec49d32a2c57e5d /drivers/net/wireless/ath/ath9k/htc_hst.c | |
parent | 1d8af8caccceab91ba65b7f659678b92093f9203 (diff) |
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.c | 38 |
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, | |||
425 | } | 425 | } |
426 | } | 426 | } |
427 | 427 | ||
428 | struct htc_target *ath9k_htc_hw_alloc(void *hif_handle) | 428 | struct htc_target *ath9k_htc_hw_alloc(void *hif_handle, |
429 | struct ath9k_htc_hif *hif, | ||
430 | struct device *dev) | ||
429 | { | 431 | { |
432 | struct htc_endpoint *endpoint; | ||
430 | struct htc_target *target; | 433 | struct htc_target *target; |
431 | 434 | ||
432 | target = kzalloc(sizeof(struct htc_target), GFP_KERNEL); | 435 | target = kzalloc(sizeof(struct htc_target), GFP_KERNEL); |
433 | if (!target) | 436 | if (!target) { |
434 | printk(KERN_ERR "Unable to allocate memory for" | 437 | printk(KERN_ERR "Unable to allocate memory for" |
435 | "target device\n"); | 438 | "target device\n"); |
436 | 439 | return NULL; | |
437 | return target; | 440 | } |
438 | } | ||
439 | |||
440 | void ath9k_htc_hw_free(struct htc_target *htc) | ||
441 | { | ||
442 | kfree(htc); | ||
443 | } | ||
444 | |||
445 | int ath9k_htc_hw_init(struct ath9k_htc_hif *hif, struct htc_target *target, | ||
446 | void *hif_handle, struct device *dev, u16 devid, | ||
447 | enum ath9k_hif_transports transport) | ||
448 | { | ||
449 | struct htc_endpoint *endpoint; | ||
450 | int err = 0; | ||
451 | 441 | ||
452 | init_completion(&target->target_wait); | 442 | init_completion(&target->target_wait); |
453 | init_completion(&target->cmd_wait); | 443 | init_completion(&target->cmd_wait); |
@@ -461,8 +451,18 @@ int ath9k_htc_hw_init(struct ath9k_htc_hif *hif, struct htc_target *target, | |||
461 | endpoint->ul_pipeid = hif->control_ul_pipe; | 451 | endpoint->ul_pipeid = hif->control_ul_pipe; |
462 | endpoint->dl_pipeid = hif->control_dl_pipe; | 452 | endpoint->dl_pipeid = hif->control_dl_pipe; |
463 | 453 | ||
464 | err = ath9k_htc_probe_device(target, dev, devid); | 454 | return target; |
465 | if (err) { | 455 | } |
456 | |||
457 | void ath9k_htc_hw_free(struct htc_target *htc) | ||
458 | { | ||
459 | kfree(htc); | ||
460 | } | ||
461 | |||
462 | int ath9k_htc_hw_init(struct htc_target *target, | ||
463 | struct device *dev, u16 devid) | ||
464 | { | ||
465 | if (ath9k_htc_probe_device(target, dev, devid)) { | ||
466 | printk(KERN_ERR "Failed to initialize the device\n"); | 466 | printk(KERN_ERR "Failed to initialize the device\n"); |
467 | return -ENODEV; | 467 | return -ENODEV; |
468 | } | 468 | } |