Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202852
b: refs/heads/master
c: 6267dc7
h: refs/heads/master
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Jun 4, 2010
1 parent 8cacaa4 commit 38dd8d4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea46e644e80bd4ac778964afd998df4f666486d4
refs/heads/master: 6267dc709c6ef1c0926e18ff2859238992dea658
30 changes: 27 additions & 3 deletions trunk/drivers/net/wireless/ath/ath9k/htc_drv_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static inline int ath9k_htc_connect_svc(struct ath9k_htc_priv *priv,
return htc_connect_service(priv->htc, &req, ep_id);
}

static int ath9k_init_htc_services(struct ath9k_htc_priv *priv)
static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid)
{
int ret;

Expand Down Expand Up @@ -237,10 +237,33 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv)
if (ret)
goto err;

/*
* Setup required credits before initializing HTC.
* This is a bit hacky, but, since queuing is done in
* the HIF layer, shouldn't matter much.
*/

switch(devid) {
case 0x9271:
case 0x1006:
priv->htc->credits = 33;
break;
case 0x7010:
priv->htc->credits = 45;
break;
default:
dev_err(priv->dev, "ath9k_htc: Unsupported device id: 0x%x\n",
devid);
goto err;
}

ret = htc_init(priv->htc);
if (ret)
goto err;

dev_info(priv->dev, "ath9k_htc: HTC initialized with %d credits\n",
priv->htc->credits);

return 0;

err:
Expand Down Expand Up @@ -842,7 +865,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
goto err_free;
}

ret = ath9k_init_htc_services(priv);
ret = ath9k_init_htc_services(priv, devid);
if (ret)
goto err_init;

Expand Down Expand Up @@ -885,7 +908,8 @@ int ath9k_htc_resume(struct htc_target *htc_handle)
if (ret)
return ret;

ret = ath9k_init_htc_services(htc_handle->drv_priv);
ret = ath9k_init_htc_services(htc_handle->drv_priv,
htc_handle->drv_priv->ah->hw_version.devid);
return ret;
}
#endif
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/ath/ath9k/htc_hst.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ static void htc_process_target_rdy(struct htc_target *target,
struct htc_endpoint *endpoint;
struct htc_ready_msg *htc_ready_msg = (struct htc_ready_msg *) buf;

target->credits = be16_to_cpu(htc_ready_msg->credits);
target->credit_size = be16_to_cpu(htc_ready_msg->credit_size);

endpoint = &target->endpoint[ENDPOINT0];
Expand Down Expand Up @@ -159,7 +158,7 @@ static int htc_config_pipe_credits(struct htc_target *target)

cp_msg->message_id = cpu_to_be16(HTC_MSG_CONFIG_PIPE_ID);
cp_msg->pipe_id = USB_WLAN_TX_PIPE;
cp_msg->credits = 33;
cp_msg->credits = target->credits;

target->htc_flags |= HTC_OP_CONFIG_PIPE_CREDITS;

Expand Down

0 comments on commit 38dd8d4

Please sign in to comment.