diff options
author | Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> | 2011-07-16 10:59:05 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-08-09 12:45:18 -0400 |
commit | f74a7361b8affcd76ffe1e2baa5748af4d63bcea (patch) | |
tree | c0d5cb1246f8e0350fb1e6890307fb464892516e /drivers/net/wireless/ath/ath6kl | |
parent | bdcd81707973cf8aa9305337166f8ee842a050d4 (diff) |
ath6kl: cleanup callbacks for different scatter gather method
Define a hook in ath6kl_hif_ops for hif scatter gather mechanism.
When virtual scatter gather is used, call the respective function
directly.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/hif-ops.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/hif.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/htc_hif.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/sdio.c | 7 |
4 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/hif-ops.h b/drivers/net/wireless/ath/ath6kl/hif-ops.h index ad4966917e84..32890cd530be 100644 --- a/drivers/net/wireless/ath/ath6kl/hif-ops.h +++ b/drivers/net/wireless/ath/ath6kl/hif-ops.h | |||
@@ -59,6 +59,12 @@ static inline int ath6kl_hif_enable_scatter(struct ath6kl *ar, | |||
59 | return ar->hif_ops->enable_scatter(ar, info); | 59 | return ar->hif_ops->enable_scatter(ar, info); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline int ath6kl_hif_scat_req_rw(struct ath6kl *ar, | ||
63 | struct hif_scatter_req *scat_req) | ||
64 | { | ||
65 | return ar->hif_ops->scat_req_rw(ar, scat_req); | ||
66 | } | ||
67 | |||
62 | static inline void ath6kl_hif_cleanup_scatter(struct ath6kl *ar) | 68 | static inline void ath6kl_hif_cleanup_scatter(struct ath6kl *ar) |
63 | { | 69 | { |
64 | return ar->hif_ops->cleanup_scatter(ar); | 70 | return ar->hif_ops->cleanup_scatter(ar); |
diff --git a/drivers/net/wireless/ath/ath6kl/hif.h b/drivers/net/wireless/ath/ath6kl/hif.h index 7d39c1769fe4..ca401041abfb 100644 --- a/drivers/net/wireless/ath/ath6kl/hif.h +++ b/drivers/net/wireless/ath/ath6kl/hif.h | |||
@@ -186,7 +186,6 @@ struct hif_scatter_req { | |||
186 | }; | 186 | }; |
187 | 187 | ||
188 | struct hif_dev_scat_sup_info { | 188 | struct hif_dev_scat_sup_info { |
189 | int (*rw_scat_func) (struct ath6kl *ar, struct hif_scatter_req *); | ||
190 | int max_scat_entries; | 189 | int max_scat_entries; |
191 | int max_xfer_szper_scatreq; | 190 | int max_xfer_szper_scatreq; |
192 | }; | 191 | }; |
@@ -210,6 +209,8 @@ struct ath6kl_hif_ops { | |||
210 | struct hif_scatter_req *s_req); | 209 | struct hif_scatter_req *s_req); |
211 | int (*enable_scatter)(struct ath6kl *ar, | 210 | int (*enable_scatter)(struct ath6kl *ar, |
212 | struct hif_dev_scat_sup_info *info); | 211 | struct hif_dev_scat_sup_info *info); |
212 | int (*scat_req_rw) (struct ath6kl *ar, | ||
213 | struct hif_scatter_req *scat_req); | ||
213 | void (*cleanup_scatter)(struct ath6kl *ar); | 214 | void (*cleanup_scatter)(struct ath6kl *ar); |
214 | }; | 215 | }; |
215 | 216 | ||
diff --git a/drivers/net/wireless/ath/ath6kl/htc_hif.c b/drivers/net/wireless/ath/ath6kl/htc_hif.c index 1bcaaec579c5..df904d8c48c0 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_hif.c +++ b/drivers/net/wireless/ath/ath6kl/htc_hif.c | |||
@@ -285,7 +285,10 @@ int ath6kldev_submit_scat_req(struct ath6kl_device *dev, | |||
285 | return status; | 285 | return status; |
286 | } | 286 | } |
287 | 287 | ||
288 | status = dev->hif_scat_info.rw_scat_func(dev->ar, scat_req); | 288 | if (dev->virt_scat) |
289 | status = ath6kldev_rw_scatter(dev->ar, scat_req); | ||
290 | else | ||
291 | status = ath6kl_hif_scat_req_rw(dev->ar, scat_req); | ||
289 | 292 | ||
290 | if (read) { | 293 | if (read) { |
291 | /* in sync mode, we can touch the scatter request */ | 294 | /* in sync mode, we can touch the scatter request */ |
@@ -340,7 +343,6 @@ static int ath6kldev_setup_virt_scat_sup(struct ath6kl_device *dev) | |||
340 | if (status) | 343 | if (status) |
341 | ath6kl_hif_cleanup_scatter(dev->ar); | 344 | ath6kl_hif_cleanup_scatter(dev->ar); |
342 | else { | 345 | else { |
343 | dev->hif_scat_info.rw_scat_func = ath6kldev_rw_scatter; | ||
344 | dev->hif_scat_info.max_scat_entries = | 346 | dev->hif_scat_info.max_scat_entries = |
345 | ATH6KL_SCATTER_ENTRIES_PER_REQ; | 347 | ATH6KL_SCATTER_ENTRIES_PER_REQ; |
346 | dev->hif_scat_info.max_xfer_szper_scatreq = | 348 | dev->hif_scat_info.max_xfer_szper_scatreq = |
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index b38732aaf41a..d217f1c642b3 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c | |||
@@ -271,9 +271,9 @@ static int ath6kl_sdio_scat_rw(struct ath6kl_sdio *ar_sdio, | |||
271 | } | 271 | } |
272 | 272 | ||
273 | 273 | ||
274 | /* callback to issue a read-write scatter request */ | 274 | /* scatter gather read write request */ |
275 | static int ath6kl_sdio_async_rw_scatter(struct ath6kl *ar, | 275 | static int ath6kl_sdio_async_rw_scatter(struct ath6kl *ar, |
276 | struct hif_scatter_req *scat_req) | 276 | struct hif_scatter_req *scat_req) |
277 | { | 277 | { |
278 | struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); | 278 | struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); |
279 | struct hif_scatter_req_priv *req_priv = scat_req->req_priv; | 279 | struct hif_scatter_req_priv *req_priv = scat_req->req_priv; |
@@ -379,8 +379,6 @@ static int ath6kl_sdio_setup_scat_resource(struct ath6kl_sdio *ar_sdio, | |||
379 | hif_scatter_req_add(ar_sdio->ar, s_req); | 379 | hif_scatter_req_add(ar_sdio->ar, s_req); |
380 | } | 380 | } |
381 | 381 | ||
382 | /* set scatter function pointers */ | ||
383 | pinfo->rw_scat_func = ath6kl_sdio_async_rw_scatter; | ||
384 | pinfo->max_scat_entries = MAX_SCATTER_ENTRIES_PER_REQ; | 382 | pinfo->max_scat_entries = MAX_SCATTER_ENTRIES_PER_REQ; |
385 | pinfo->max_xfer_szper_scatreq = MAX_SCATTER_REQ_TRANSFER_SIZE; | 383 | pinfo->max_xfer_szper_scatreq = MAX_SCATTER_REQ_TRANSFER_SIZE; |
386 | 384 | ||
@@ -671,6 +669,7 @@ static const struct ath6kl_hif_ops ath6kl_sdio_ops = { | |||
671 | .scatter_req_get = ath6kl_sdio_scatter_req_get, | 669 | .scatter_req_get = ath6kl_sdio_scatter_req_get, |
672 | .scatter_req_add = ath6kl_sdio_scatter_req_add, | 670 | .scatter_req_add = ath6kl_sdio_scatter_req_add, |
673 | .enable_scatter = ath6kl_sdio_enable_scatter, | 671 | .enable_scatter = ath6kl_sdio_enable_scatter, |
672 | .scat_req_rw = ath6kl_sdio_async_rw_scatter, | ||
674 | .cleanup_scatter = ath6kl_sdio_cleanup_scatter, | 673 | .cleanup_scatter = ath6kl_sdio_cleanup_scatter, |
675 | }; | 674 | }; |
676 | 675 | ||