Also rename cred_dist_cntxt to credit_info in struct htc_target.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
struct htc_endpoint_credit_dist;
struct ath6kl;
enum htc_credit_dist_reason;
-struct htc_credit_state_info;
+struct ath6kl_htc_credit_info;
int ath6kl_setup_credit_dist(void *htc_handle,
- struct htc_credit_state_info *cred_info);
-void ath6kl_credit_distribute(struct htc_credit_state_info *cred_inf,
+ struct ath6kl_htc_credit_info *cred_info);
+void ath6kl_credit_distribute(struct ath6kl_htc_credit_info *cred_inf,
struct list_head *epdist_list,
enum htc_credit_dist_reason reason);
-void ath6kl_credit_init(struct htc_credit_state_info *cred_inf,
+void ath6kl_credit_init(struct ath6kl_htc_credit_info *cred_inf,
struct list_head *ep_list,
int tot_credits);
-void ath6kl_seek_credits(struct htc_credit_state_info *cred_inf,
+void ath6kl_seek_credits(struct ath6kl_htc_credit_info *cred_inf,
struct htc_endpoint_credit_dist *ep_dist);
struct ath6kl *ath6kl_core_alloc(struct device *sdev);
int ath6kl_core_init(struct ath6kl *ar);
u8 hiac_stream_active_pri;
u8 ep2ac_map[ENDPOINT_MAX];
enum htc_endpoint_id ctrl_ep;
- struct htc_credit_state_info credit_state_info;
+ struct ath6kl_htc_credit_info credit_state_info;
u32 connect_ctrl_flags;
u32 user_key_ctrl;
u8 usr_bss_filter;
return ((struct ath6kl_vif *) netdev_priv(dev))->ar;
}
-static inline void ath6kl_deposit_credit_to_ep(struct htc_credit_state_info
+static inline void ath6kl_deposit_credit_to_ep(struct ath6kl_htc_credit_info
*cred_info,
struct htc_endpoint_credit_dist
*ep_dist, int credits)
dump_cred_dist(ep_list);
ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:%p dist:%p\n",
- target->cred_dist_cntxt, NULL);
+ target->credit_info, NULL);
ath6kl_dbg(ATH6KL_DBG_HTC,
"credit distribution, total : %d, free : %d\n",
- target->cred_dist_cntxt->total_avail_credits,
- target->cred_dist_cntxt->cur_free_credits);
+ target->credit_info->total_avail_credits,
+ target->credit_info->cur_free_credits);
}
static int ath6kl_debugfs_open(struct inode *inode, struct file *file)
len += scnprintf(buf + len, buf_len - len, "%25s%5d\n",
"Total Avail Credits: ",
- target->cred_dist_cntxt->total_avail_credits);
+ target->credit_info->total_avail_credits);
len += scnprintf(buf + len, buf_len - len, "%25s%5d\n",
"Free credits :",
- target->cred_dist_cntxt->cur_free_credits);
+ target->credit_info->cur_free_credits);
len += scnprintf(buf + len, buf_len - len,
" Epid Flags Cred_norm Cred_min Credits Cred_assngd"
endpoint->cred_dist.txq_depth = get_queue_depth(&endpoint->txq);
ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx ctxt 0x%p dist 0x%p\n",
- target->cred_dist_cntxt, &target->cred_dist_list);
+ target->credit_info, &target->cred_dist_list);
- ath6kl_credit_distribute(target->cred_dist_cntxt,
- &target->cred_dist_list,
- HTC_CREDIT_DIST_SEND_COMPLETE);
+ ath6kl_credit_distribute(target->credit_info,
+ &target->cred_dist_list,
+ HTC_CREDIT_DIST_SEND_COMPLETE);
spin_unlock_bh(&target->tx_lock);
}
ep->cred_dist.seek_cred = *req_cred - ep->cred_dist.credits;
ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds ctxt 0x%p dist 0x%p\n",
- target->cred_dist_cntxt, &ep->cred_dist);
+ target->credit_info, &ep->cred_dist);
- ath6kl_seek_credits(target->cred_dist_cntxt, &ep->cred_dist);
+ ath6kl_seek_credits(target->credit_info, &ep->cred_dist);
ep->cred_dist.seek_cred = 0;
ep->cred_dist.cred_per_msg - ep->cred_dist.credits;
ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds ctxt 0x%p dist 0x%p\n",
- target->cred_dist_cntxt, &ep->cred_dist);
+ target->credit_info, &ep->cred_dist);
- ath6kl_seek_credits(target->cred_dist_cntxt, &ep->cred_dist);
+ ath6kl_seek_credits(target->credit_info, &ep->cred_dist);
/* see if we were successful in getting more */
if (ep->cred_dist.credits < ep->cred_dist.cred_per_msg) {
}
void ath6kl_htc_set_credit_dist(struct htc_target *target,
- struct htc_credit_state_info *cred_dist_cntxt,
+ struct ath6kl_htc_credit_info *credit_info,
u16 srvc_pri_order[], int list_len)
{
struct htc_endpoint *endpoint;
int i, ep;
- target->cred_dist_cntxt = cred_dist_cntxt;
+ target->credit_info = credit_info;
list_add_tail(&target->endpoint[ENDPOINT_0].cred_dist.list,
&target->cred_dist_list);
ath6kl_dbg(ATH6KL_DBG_HTC,
"htc tx activity ctxt 0x%p dist 0x%p\n",
- target->cred_dist_cntxt, &target->cred_dist_list);
+ target->credit_info, &target->cred_dist_list);
- ath6kl_credit_distribute(target->cred_dist_cntxt,
+ ath6kl_credit_distribute(target->credit_info,
&target->cred_dist_list,
HTC_CREDIT_DIST_ACTIVITY_CHANGE);
}
* operations note, this is done with the lock held
*/
ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds ctxt 0x%p dist 0x%p\n",
- target->cred_dist_cntxt, &target->cred_dist_list);
+ target->credit_info, &target->cred_dist_list);
- ath6kl_credit_distribute(target->cred_dist_cntxt,
+ ath6kl_credit_distribute(target->credit_info,
&target->cred_dist_list,
HTC_CREDIT_DIST_SEND_COMPLETE);
}
}
/* reset distribution list */
+ /* FIXME: free existing entries */
INIT_LIST_HEAD(&target->cred_dist_list);
}
}
/* NOTE: the first entry in the distribution list is ENDPOINT_0 */
- ath6kl_credit_init(target->cred_dist_cntxt, &target->cred_dist_list,
+ ath6kl_credit_init(target->credit_info, &target->cred_dist_list,
target->tgt_creds);
dump_cred_dist_stats(target);
HTC_CREDIT_DIST_SEEK_CREDITS,
};
-struct htc_credit_state_info {
+struct ath6kl_htc_credit_info {
int total_avail_credits;
int cur_free_credits;
+
+ /* list of lowest priority endpoints */
struct list_head lowestpri_ep_dist;
};
/* our HTC target state */
struct htc_target {
struct htc_endpoint endpoint[ENDPOINT_MAX];
+
+ /* contains struct htc_endpoint_credit_dist */
struct list_head cred_dist_list;
+
struct list_head free_ctrl_txbuf;
struct list_head free_ctrl_rxbuf;
- struct htc_credit_state_info *cred_dist_cntxt;
+ struct ath6kl_htc_credit_info *credit_info;
int tgt_creds;
unsigned int tgt_cred_sz;
spinlock_t htc_lock;
void *ath6kl_htc_create(struct ath6kl *ar);
void ath6kl_htc_set_credit_dist(struct htc_target *target,
- struct htc_credit_state_info *cred_info,
+ struct ath6kl_htc_credit_info *cred_info,
u16 svc_pri_order[], int len);
int ath6kl_htc_wait_target(struct htc_target *target);
int ath6kl_htc_start(struct htc_target *target);
}
/* Functions for Tx credit handling */
-void ath6kl_credit_init(struct htc_credit_state_info *cred_info,
+void ath6kl_credit_init(struct ath6kl_htc_credit_info *cred_info,
struct list_head *ep_list,
int tot_credits)
{
cur_ep_dist->dist_flags |= HTC_EP_ACTIVE;
} else if (cur_ep_dist->svc_id == WMI_DATA_BK_SVC)
/* this is the lowest priority data endpoint */
+ /* FIXME: this looks fishy, check */
cred_info->lowestpri_ep_dist = cur_ep_dist->list;
/*
/* initialize and setup credit distribution */
int ath6kl_setup_credit_dist(void *htc_handle,
- struct htc_credit_state_info *cred_info)
+ struct ath6kl_htc_credit_info *cred_info)
{
u16 servicepriority[5];
- memset(cred_info, 0, sizeof(struct htc_credit_state_info));
+ memset(cred_info, 0, sizeof(struct ath6kl_htc_credit_info));
servicepriority[0] = WMI_CONTROL_SVC; /* highest */
servicepriority[1] = WMI_DATA_VO_SVC;
}
/* reduce an ep's credits back to a set limit */
-static void ath6kl_reduce_credits(struct htc_credit_state_info *cred_info,
+static void ath6kl_reduce_credits(struct ath6kl_htc_credit_info *cred_info,
struct htc_endpoint_credit_dist *ep_dist,
int limit)
{
cred_info->cur_free_credits += credits;
}
-static void ath6kl_credit_update(struct htc_credit_state_info *cred_info,
+static void ath6kl_credit_update(struct ath6kl_htc_credit_info *cred_info,
struct list_head *epdist_list)
{
struct htc_endpoint_credit_dist *cur_dist_list;
* HTC has an endpoint that needs credits, ep_dist is the endpoint in
* question.
*/
-void ath6kl_seek_credits(struct htc_credit_state_info *cred_info,
+void ath6kl_seek_credits(struct ath6kl_htc_credit_info *cred_info,
struct htc_endpoint_credit_dist *ep_dist)
{
struct htc_endpoint_credit_dist *curdist_list;
}
/* redistribute credits based on activity change */
-static void ath6kl_redistribute_credits(struct htc_credit_state_info *info,
+static void ath6kl_redistribute_credits(struct ath6kl_htc_credit_info *info,
struct list_head *ep_dist_list)
{
struct htc_endpoint_credit_dist *curdist_list;
* structures in prioritized order as defined by the call to the
* htc_set_credit_dist() api.
*/
-void ath6kl_credit_distribute(struct htc_credit_state_info *cred_info,
+void ath6kl_credit_distribute(struct ath6kl_htc_credit_info *cred_info,
struct list_head *ep_dist_list,
enum htc_credit_dist_reason reason)
{