Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195245
b: refs/heads/master
c: d8c49ff
h: refs/heads/master
i:
  195243: 8773f3e
v: v3
  • Loading branch information
Sujith.Manoharan@atheros.com authored and John W. Linville committed May 12, 2010
1 parent 596c717 commit 3d57127
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47fce026d5de5d11e161da73208171e9c91b659a
refs/heads/master: d8c49ffb2e2a47b23fec7f469435e7b112e2e569
7 changes: 7 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/htc_drv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,20 @@ static int ath9k_htc_wait_for_target(struct ath9k_htc_priv *priv)
{
int time_left;

if (atomic_read(&priv->htc->tgt_ready) > 0) {
atomic_dec(&priv->htc->tgt_ready);
return 0;
}

/* Firmware can take up to 50ms to get ready, to be safe use 1 second */
time_left = wait_for_completion_timeout(&priv->htc->target_wait, HZ);
if (!time_left) {
dev_err(priv->dev, "ath9k_htc: Target is unresponsive\n");
return -ETIMEDOUT;
}

atomic_dec(&priv->htc->tgt_ready);

return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/htc_hst.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ static void htc_process_target_rdy(struct htc_target *target,
endpoint = &target->endpoint[ENDPOINT0];
endpoint->service_id = HTC_CTRL_RSVD_SVC;
endpoint->max_msglen = HTC_MAX_CONTROL_MESSAGE_LENGTH;
atomic_inc(&target->tgt_ready);
complete(&target->target_wait);
}

Expand Down Expand Up @@ -451,6 +452,8 @@ struct htc_target *ath9k_htc_hw_alloc(void *hif_handle,
endpoint->ul_pipeid = hif->control_ul_pipe;
endpoint->dl_pipeid = hif->control_dl_pipe;

atomic_set(&target->tgt_ready, 0);

return target;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/htc_hst.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ struct htc_target {
u16 credits;
u16 credit_size;
u8 htc_flags;
atomic_t tgt_ready;
};

enum htc_msg_id {
Expand Down

0 comments on commit 3d57127

Please sign in to comment.