aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-06-02 06:23:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-04 16:00:39 -0400
commit6267dc709c6ef1c0926e18ff2859238992dea658 (patch)
treeded0552c1e4587151e1a389110d5db3bb130db26 /drivers
parentea46e644e80bd4ac778964afd998df4f666486d4 (diff)
ath9k_htc: Configure credit size for AR7010
For non-AR9271 chips, the credit size is different and has to be configured appropriately. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c30
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_hst.c3
2 files changed, 28 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index cda30410d5ee..7339439f0bef 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -179,7 +179,7 @@ static inline int ath9k_htc_connect_svc(struct ath9k_htc_priv *priv,
179 return htc_connect_service(priv->htc, &req, ep_id); 179 return htc_connect_service(priv->htc, &req, ep_id);
180} 180}
181 181
182static int ath9k_init_htc_services(struct ath9k_htc_priv *priv) 182static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid)
183{ 183{
184 int ret; 184 int ret;
185 185
@@ -237,10 +237,33 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv)
237 if (ret) 237 if (ret)
238 goto err; 238 goto err;
239 239
240 /*
241 * Setup required credits before initializing HTC.
242 * This is a bit hacky, but, since queuing is done in
243 * the HIF layer, shouldn't matter much.
244 */
245
246 switch(devid) {
247 case 0x9271:
248 case 0x1006:
249 priv->htc->credits = 33;
250 break;
251 case 0x7010:
252 priv->htc->credits = 45;
253 break;
254 default:
255 dev_err(priv->dev, "ath9k_htc: Unsupported device id: 0x%x\n",
256 devid);
257 goto err;
258 }
259
240 ret = htc_init(priv->htc); 260 ret = htc_init(priv->htc);
241 if (ret) 261 if (ret)
242 goto err; 262 goto err;
243 263
264 dev_info(priv->dev, "ath9k_htc: HTC initialized with %d credits\n",
265 priv->htc->credits);
266
244 return 0; 267 return 0;
245 268
246err: 269err:
@@ -842,7 +865,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
842 goto err_free; 865 goto err_free;
843 } 866 }
844 867
845 ret = ath9k_init_htc_services(priv); 868 ret = ath9k_init_htc_services(priv, devid);
846 if (ret) 869 if (ret)
847 goto err_init; 870 goto err_init;
848 871
@@ -885,7 +908,8 @@ int ath9k_htc_resume(struct htc_target *htc_handle)
885 if (ret) 908 if (ret)
886 return ret; 909 return ret;
887 910
888 ret = ath9k_init_htc_services(htc_handle->drv_priv); 911 ret = ath9k_init_htc_services(htc_handle->drv_priv,
912 htc_handle->drv_priv->ah->hw_version.devid);
889 return ret; 913 return ret;
890} 914}
891#endif 915#endif
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 217319627160..705c0f342e1c 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -89,7 +89,6 @@ static void htc_process_target_rdy(struct htc_target *target,
89 struct htc_endpoint *endpoint; 89 struct htc_endpoint *endpoint;
90 struct htc_ready_msg *htc_ready_msg = (struct htc_ready_msg *) buf; 90 struct htc_ready_msg *htc_ready_msg = (struct htc_ready_msg *) buf;
91 91
92 target->credits = be16_to_cpu(htc_ready_msg->credits);
93 target->credit_size = be16_to_cpu(htc_ready_msg->credit_size); 92 target->credit_size = be16_to_cpu(htc_ready_msg->credit_size);
94 93
95 endpoint = &target->endpoint[ENDPOINT0]; 94 endpoint = &target->endpoint[ENDPOINT0];
@@ -159,7 +158,7 @@ static int htc_config_pipe_credits(struct htc_target *target)
159 158
160 cp_msg->message_id = cpu_to_be16(HTC_MSG_CONFIG_PIPE_ID); 159 cp_msg->message_id = cpu_to_be16(HTC_MSG_CONFIG_PIPE_ID);
161 cp_msg->pipe_id = USB_WLAN_TX_PIPE; 160 cp_msg->pipe_id = USB_WLAN_TX_PIPE;
162 cp_msg->credits = 33; 161 cp_msg->credits = target->credits;
163 162
164 target->htc_flags |= HTC_OP_CONFIG_PIPE_CREDITS; 163 target->htc_flags |= HTC_OP_CONFIG_PIPE_CREDITS;
165 164