Commit 50745af7 authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by Kalle Valo

ath6kl: Move scatter information from ath6kl_device to htc_target

Signed-off-by: default avatarVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 5be8824f
...@@ -53,10 +53,9 @@ static inline void hif_scatter_req_add(struct ath6kl *ar, ...@@ -53,10 +53,9 @@ static inline void hif_scatter_req_add(struct ath6kl *ar,
return ar->hif_ops->scatter_req_add(ar, s_req); return ar->hif_ops->scatter_req_add(ar, s_req);
} }
static inline int ath6kl_hif_enable_scatter(struct ath6kl *ar, static inline int ath6kl_hif_enable_scatter(struct ath6kl *ar)
struct hif_dev_scat_sup_info *info)
{ {
return ar->hif_ops->enable_scatter(ar, info); return ar->hif_ops->enable_scatter(ar);
} }
static inline int ath6kl_hif_scat_req_rw(struct ath6kl *ar, static inline int ath6kl_hif_scat_req_rw(struct ath6kl *ar,
......
...@@ -186,11 +186,6 @@ struct hif_scatter_req { ...@@ -186,11 +186,6 @@ struct hif_scatter_req {
struct hif_scatter_item scat_list[1]; struct hif_scatter_item scat_list[1];
}; };
struct hif_dev_scat_sup_info {
int max_scat_entries;
int max_xfer_szper_scatreq;
};
struct ath6kl_hif_ops { struct ath6kl_hif_ops {
int (*read_write_sync)(struct ath6kl *ar, u32 addr, u8 *buf, int (*read_write_sync)(struct ath6kl *ar, u32 addr, u8 *buf,
u32 len, u32 request); u32 len, u32 request);
...@@ -203,8 +198,7 @@ struct ath6kl_hif_ops { ...@@ -203,8 +198,7 @@ struct ath6kl_hif_ops {
struct hif_scatter_req *(*scatter_req_get)(struct ath6kl *ar); struct hif_scatter_req *(*scatter_req_get)(struct ath6kl *ar);
void (*scatter_req_add)(struct ath6kl *ar, void (*scatter_req_add)(struct ath6kl *ar,
struct hif_scatter_req *s_req); struct hif_scatter_req *s_req);
int (*enable_scatter)(struct ath6kl *ar, int (*enable_scatter)(struct ath6kl *ar);
struct hif_dev_scat_sup_info *info);
int (*scat_req_rw) (struct ath6kl *ar, int (*scat_req_rw) (struct ath6kl *ar,
struct hif_scatter_req *scat_req); struct hif_scatter_req *scat_req);
void (*cleanup_scatter)(struct ath6kl *ar); void (*cleanup_scatter)(struct ath6kl *ar);
......
...@@ -432,11 +432,8 @@ static void htc_issue_send_bundle(struct htc_endpoint *endpoint, ...@@ -432,11 +432,8 @@ static void htc_issue_send_bundle(struct htc_endpoint *endpoint,
{ {
struct htc_target *target = endpoint->target; struct htc_target *target = endpoint->target;
struct hif_scatter_req *scat_req = NULL; struct hif_scatter_req *scat_req = NULL;
struct hif_dev_scat_sup_info hif_info;
int n_scat, n_sent_bundle = 0, tot_pkts_bundle = 0; int n_scat, n_sent_bundle = 0, tot_pkts_bundle = 0;
hif_info = target->dev->hif_scat_info;
while (true) { while (true) {
n_scat = get_queue_depth(queue); n_scat = get_queue_depth(queue);
n_scat = min(n_scat, target->msg_per_bndl_max); n_scat = min(n_scat, target->msg_per_bndl_max);
...@@ -2168,19 +2165,17 @@ int htc_get_rxbuf_num(struct htc_target *target, enum htc_endpoint_id endpoint) ...@@ -2168,19 +2165,17 @@ int htc_get_rxbuf_num(struct htc_target *target, enum htc_endpoint_id endpoint)
static void htc_setup_msg_bndl(struct htc_target *target) static void htc_setup_msg_bndl(struct htc_target *target)
{ {
struct hif_dev_scat_sup_info *scat_info = &target->dev->hif_scat_info;
/* limit what HTC can handle */ /* limit what HTC can handle */
target->msg_per_bndl_max = min(HTC_HOST_MAX_MSG_PER_BUNDLE, target->msg_per_bndl_max = min(HTC_HOST_MAX_MSG_PER_BUNDLE,
target->msg_per_bndl_max); target->msg_per_bndl_max);
if (ath6kl_hif_enable_scatter(target->dev->ar, scat_info)) { if (ath6kl_hif_enable_scatter(target->dev->ar)) {
target->msg_per_bndl_max = 0; target->msg_per_bndl_max = 0;
return; return;
} }
/* limit bundle what the device layer can handle */ /* limit bundle what the device layer can handle */
target->msg_per_bndl_max = min(scat_info->max_scat_entries, target->msg_per_bndl_max = min(target->max_scat_entries,
target->msg_per_bndl_max); target->msg_per_bndl_max);
ath6kl_dbg(ATH6KL_DBG_TRC, ath6kl_dbg(ATH6KL_DBG_TRC,
...@@ -2188,10 +2183,10 @@ static void htc_setup_msg_bndl(struct htc_target *target) ...@@ -2188,10 +2183,10 @@ static void htc_setup_msg_bndl(struct htc_target *target)
target->msg_per_bndl_max); target->msg_per_bndl_max);
/* Max rx bundle size is limited by the max tx bundle size */ /* Max rx bundle size is limited by the max tx bundle size */
target->max_rx_bndl_sz = scat_info->max_xfer_szper_scatreq; target->max_rx_bndl_sz = target->max_xfer_szper_scatreq;
/* Max tx bundle size if limited by the extended mbox address range */ /* Max tx bundle size if limited by the extended mbox address range */
target->max_tx_bndl_sz = min(HIF_MBOX0_EXT_WIDTH, target->max_tx_bndl_sz = min(HIF_MBOX0_EXT_WIDTH,
scat_info->max_xfer_szper_scatreq); target->max_xfer_szper_scatreq);
ath6kl_dbg(ATH6KL_DBG_ANY, "max recv: %d max send: %d\n", ath6kl_dbg(ATH6KL_DBG_ANY, "max recv: %d max send: %d\n",
target->max_rx_bndl_sz, target->max_tx_bndl_sz); target->max_rx_bndl_sz, target->max_tx_bndl_sz);
......
...@@ -533,6 +533,9 @@ struct htc_target { ...@@ -533,6 +533,9 @@ struct htc_target {
u32 block_sz; u32 block_sz;
u32 block_mask; u32 block_mask;
int max_scat_entries;
int max_xfer_szper_scatreq;
}; };
void *htc_create(struct ath6kl *ar); void *htc_create(struct ath6kl *ar);
......
...@@ -80,7 +80,6 @@ struct ath6kl_device { ...@@ -80,7 +80,6 @@ struct ath6kl_device {
struct ath6kl_irq_enable_reg irq_en_reg; struct ath6kl_irq_enable_reg irq_en_reg;
u8 pad3[A_CACHE_LINE_PAD]; u8 pad3[A_CACHE_LINE_PAD];
struct htc_target *htc_cnxt; struct htc_target *htc_cnxt;
struct hif_dev_scat_sup_info hif_scat_info;
int chk_irq_status_cnt; int chk_irq_status_cnt;
struct ath6kl *ar; struct ath6kl *ar;
}; };
......
...@@ -663,10 +663,10 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar) ...@@ -663,10 +663,10 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
} }
/* setup of HIF scatter resources */ /* setup of HIF scatter resources */
static int ath6kl_sdio_enable_scatter(struct ath6kl *ar, static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
struct hif_dev_scat_sup_info *pinfo)
{ {
struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
struct htc_target *target = ar->htc_target;
int ret; int ret;
bool virt_scat = false; bool virt_scat = false;
...@@ -689,8 +689,8 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar, ...@@ -689,8 +689,8 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar,
MAX_SCATTER_REQUESTS, MAX_SCATTER_REQUESTS,
MAX_SCATTER_ENTRIES_PER_REQ); MAX_SCATTER_ENTRIES_PER_REQ);
pinfo->max_scat_entries = MAX_SCATTER_ENTRIES_PER_REQ; target->max_scat_entries = MAX_SCATTER_ENTRIES_PER_REQ;
pinfo->max_xfer_szper_scatreq = target->max_xfer_szper_scatreq =
MAX_SCATTER_REQ_TRANSFER_SIZE; MAX_SCATTER_REQ_TRANSFER_SIZE;
} else { } else {
ath6kl_sdio_cleanup_scatter(ar); ath6kl_sdio_cleanup_scatter(ar);
...@@ -713,8 +713,8 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar, ...@@ -713,8 +713,8 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar,
"Vitual scatter enabled, max_scat_req:%d, entries:%d\n", "Vitual scatter enabled, max_scat_req:%d, entries:%d\n",
ATH6KL_SCATTER_REQS, ATH6KL_SCATTER_ENTRIES_PER_REQ); ATH6KL_SCATTER_REQS, ATH6KL_SCATTER_ENTRIES_PER_REQ);
pinfo->max_scat_entries = ATH6KL_SCATTER_ENTRIES_PER_REQ; target->max_scat_entries = ATH6KL_SCATTER_ENTRIES_PER_REQ;
pinfo->max_xfer_szper_scatreq = target->max_xfer_szper_scatreq =
ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER; ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment