Commit 689def90 authored by Kalle Valo's avatar Kalle Valo

ath6kl: unify rx function naming in htc.c

Similarly like with the tx path, unify naming in htc rx path. No functional
changes.
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent dfa0104c
...@@ -861,7 +861,7 @@ void ath6kl_htc_indicate_activity_change(struct htc_target *target, ...@@ -861,7 +861,7 @@ void ath6kl_htc_indicate_activity_change(struct htc_target *target,
/* HTC Rx */ /* HTC Rx */
static inline void htc_update_rx_stats(struct htc_endpoint *endpoint, static inline void ath6kl_htc_rx_update_stats(struct htc_endpoint *endpoint,
int n_look_ahds) int n_look_ahds)
{ {
endpoint->ep_st.rx_pkts++; endpoint->ep_st.rx_pkts++;
...@@ -909,7 +909,8 @@ static void reclaim_rx_ctrl_buf(struct htc_target *target, ...@@ -909,7 +909,8 @@ static void reclaim_rx_ctrl_buf(struct htc_target *target,
spin_unlock_bh(&target->htc_lock); spin_unlock_bh(&target->htc_lock);
} }
static int dev_rx_pkt(struct htc_target *target, struct htc_packet *packet, static int ath6kl_htc_rx_packet(struct htc_target *target,
struct htc_packet *packet,
u32 rx_len) u32 rx_len)
{ {
struct ath6kl_device *dev = target->dev; struct ath6kl_device *dev = target->dev;
...@@ -944,7 +945,7 @@ static int dev_rx_pkt(struct htc_target *target, struct htc_packet *packet, ...@@ -944,7 +945,7 @@ static int dev_rx_pkt(struct htc_target *target, struct htc_packet *packet,
* "hint" that there are more single-packets to fetch * "hint" that there are more single-packets to fetch
* on this endpoint. * on this endpoint.
*/ */
static void set_rxpkt_indication_flag(u32 lk_ahd, static void ath6kl_htc_rx_set_indicate(u32 lk_ahd,
struct htc_endpoint *endpoint, struct htc_endpoint *endpoint,
struct htc_packet *packet) struct htc_packet *packet)
{ {
...@@ -957,7 +958,7 @@ static void set_rxpkt_indication_flag(u32 lk_ahd, ...@@ -957,7 +958,7 @@ static void set_rxpkt_indication_flag(u32 lk_ahd,
} }
} }
static void chk_rx_water_mark(struct htc_endpoint *endpoint) static void ath6kl_htc_rx_chk_water_mark(struct htc_endpoint *endpoint)
{ {
struct htc_ep_callbacks ep_cb = endpoint->ep_cb; struct htc_ep_callbacks ep_cb = endpoint->ep_cb;
...@@ -974,7 +975,8 @@ static void chk_rx_water_mark(struct htc_endpoint *endpoint) ...@@ -974,7 +975,8 @@ static void chk_rx_water_mark(struct htc_endpoint *endpoint)
} }
/* This function is called with rx_lock held */ /* This function is called with rx_lock held */
static int htc_setup_rxpkts(struct htc_target *target, struct htc_endpoint *ep, static int ath6kl_htc_rx_setup(struct htc_target *target,
struct htc_endpoint *ep,
u32 *lk_ahds, struct list_head *queue, int n_msg) u32 *lk_ahds, struct list_head *queue, int n_msg)
{ {
struct htc_packet *packet; struct htc_packet *packet;
...@@ -1075,7 +1077,7 @@ static int htc_setup_rxpkts(struct htc_target *target, struct htc_endpoint *ep, ...@@ -1075,7 +1077,7 @@ static int htc_setup_rxpkts(struct htc_target *target, struct htc_endpoint *ep,
return status; return status;
} }
static int alloc_and_prep_rxpkts(struct htc_target *target, static int ath6kl_htc_rx_alloc(struct htc_target *target,
u32 lk_ahds[], int msg, u32 lk_ahds[], int msg,
struct htc_endpoint *endpoint, struct htc_endpoint *endpoint,
struct list_head *queue) struct list_head *queue)
...@@ -1144,8 +1146,8 @@ static int alloc_and_prep_rxpkts(struct htc_target *target, ...@@ -1144,8 +1146,8 @@ static int alloc_and_prep_rxpkts(struct htc_target *target,
n_msg = 1; n_msg = 1;
/* Setup packet buffers for each message */ /* Setup packet buffers for each message */
status = htc_setup_rxpkts(target, endpoint, &lk_ahds[i], queue, status = ath6kl_htc_rx_setup(target, endpoint, &lk_ahds[i],
n_msg); queue, n_msg);
/* /*
* This is due to unavailabilty of buffers to rx entire data. * This is due to unavailabilty of buffers to rx entire data.
...@@ -1422,7 +1424,7 @@ static int htc_proc_trailer(struct htc_target *target, ...@@ -1422,7 +1424,7 @@ static int htc_proc_trailer(struct htc_target *target,
return status; return status;
} }
static int htc_proc_rxhdr(struct htc_target *target, static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
struct htc_packet *packet, struct htc_packet *packet,
u32 *next_lkahds, int *n_lkahds) u32 *next_lkahds, int *n_lkahds)
{ {
...@@ -1476,8 +1478,8 @@ static int htc_proc_rxhdr(struct htc_target *target, ...@@ -1476,8 +1478,8 @@ static int htc_proc_rxhdr(struct htc_target *target,
} }
if (lk_ahd != packet->info.rx.exp_hdr) { if (lk_ahd != packet->info.rx.exp_hdr) {
ath6kl_err("htc_proc_rxhdr, lk_ahd mismatch! (pPkt:0x%p flags:0x%X)\n", ath6kl_err("%s(): lk_ahd mismatch! (pPkt:0x%p flags:0x%X)\n",
packet, packet->info.rx.rx_flags); __func__, packet, packet->info.rx.rx_flags);
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Expected Message lk_ahd", ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Expected Message lk_ahd",
&packet->info.rx.exp_hdr, 4); &packet->info.rx.exp_hdr, 4);
ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Current Frame Header", ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Current Frame Header",
...@@ -1489,8 +1491,8 @@ static int htc_proc_rxhdr(struct htc_target *target, ...@@ -1489,8 +1491,8 @@ static int htc_proc_rxhdr(struct htc_target *target,
if (htc_hdr->flags & HTC_FLG_RX_TRAILER) { if (htc_hdr->flags & HTC_FLG_RX_TRAILER) {
if (htc_hdr->ctrl[0] < sizeof(struct htc_record_hdr) || if (htc_hdr->ctrl[0] < sizeof(struct htc_record_hdr) ||
htc_hdr->ctrl[0] > payload_len) { htc_hdr->ctrl[0] > payload_len) {
ath6kl_err("htc_proc_rxhdr, invalid hdr (payload len should be :%d, CB[0] is:%d)\n", ath6kl_err("%s(): invalid hdr (payload len should be :%d, CB[0] is:%d)\n",
payload_len, htc_hdr->ctrl[0]); __func__, payload_len, htc_hdr->ctrl[0]);
status = -ENOMEM; status = -ENOMEM;
goto fail_rx; goto fail_rx;
} }
...@@ -1529,7 +1531,7 @@ static int htc_proc_rxhdr(struct htc_target *target, ...@@ -1529,7 +1531,7 @@ static int htc_proc_rxhdr(struct htc_target *target,
return status; return status;
} }
static void do_rx_completion(struct htc_endpoint *endpoint, static void ath6kl_htc_rx_complete(struct htc_endpoint *endpoint,
struct htc_packet *packet) struct htc_packet *packet)
{ {
ath6kl_dbg(ATH6KL_DBG_HTC_RECV, ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
...@@ -1538,7 +1540,7 @@ static void do_rx_completion(struct htc_endpoint *endpoint, ...@@ -1538,7 +1540,7 @@ static void do_rx_completion(struct htc_endpoint *endpoint,
endpoint->ep_cb.rx(endpoint->target, packet); endpoint->ep_cb.rx(endpoint->target, packet);
} }
static int htc_issue_rxpkt_bundle(struct htc_target *target, static int ath6kl_htc_rx_bundle(struct htc_target *target,
struct list_head *rxq, struct list_head *rxq,
struct list_head *sync_compq, struct list_head *sync_compq,
int *n_pkt_fetched, bool part_bundle) int *n_pkt_fetched, bool part_bundle)
...@@ -1563,15 +1565,15 @@ static int htc_issue_rxpkt_bundle(struct htc_target *target, ...@@ -1563,15 +1565,15 @@ static int htc_issue_rxpkt_bundle(struct htc_target *target,
* This would only happen if the target ignored our max * This would only happen if the target ignored our max
* bundle limit. * bundle limit.
*/ */
ath6kl_warn("htc_issue_rxpkt_bundle : partial bundle detected num:%d , %d\n", ath6kl_warn("%s(): partial bundle detected num:%d , %d\n",
get_queue_depth(rxq), n_scat_pkt); __func__, get_queue_depth(rxq), n_scat_pkt);
} }
len = 0; len = 0;
ath6kl_dbg(ATH6KL_DBG_HTC_RECV, ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
"htc_issue_rxpkt_bundle (numpackets: %d , actual : %d)\n", "%s(): (numpackets: %d , actual : %d)\n",
get_queue_depth(rxq), n_scat_pkt); __func__, get_queue_depth(rxq), n_scat_pkt);
scat_req = hif_scatter_req_get(target->dev->ar); scat_req = hif_scatter_req_get(target->dev->ar);
...@@ -1631,8 +1633,9 @@ static int htc_issue_rxpkt_bundle(struct htc_target *target, ...@@ -1631,8 +1633,9 @@ static int htc_issue_rxpkt_bundle(struct htc_target *target,
return status; return status;
} }
static int htc_proc_fetched_rxpkts(struct htc_target *target, static int ath6kl_htc_rx_process_packets(struct htc_target *target,
struct list_head *comp_pktq, u32 lk_ahds[], struct list_head *comp_pktq,
u32 lk_ahds[],
int *n_lk_ahd) int *n_lk_ahd)
{ {
struct htc_packet *packet, *tmp_pkt; struct htc_packet *packet, *tmp_pkt;
...@@ -1644,7 +1647,8 @@ static int htc_proc_fetched_rxpkts(struct htc_target *target, ...@@ -1644,7 +1647,8 @@ static int htc_proc_fetched_rxpkts(struct htc_target *target,
ep = &target->endpoint[packet->endpoint]; ep = &target->endpoint[packet->endpoint];
/* process header for each of the recv packet */ /* process header for each of the recv packet */
status = htc_proc_rxhdr(target, packet, lk_ahds, n_lk_ahd); status = ath6kl_htc_rx_process_hdr(target, packet, lk_ahds,
n_lk_ahd);
if (status) if (status)
return status; return status;
...@@ -1654,7 +1658,7 @@ static int htc_proc_fetched_rxpkts(struct htc_target *target, ...@@ -1654,7 +1658,7 @@ static int htc_proc_fetched_rxpkts(struct htc_target *target,
* based on the lookahead. * based on the lookahead.
*/ */
if (*n_lk_ahd > 0) if (*n_lk_ahd > 0)
set_rxpkt_indication_flag(lk_ahds[0], ath6kl_htc_rx_set_indicate(lk_ahds[0],
ep, packet); ep, packet);
} else } else
/* /*
...@@ -1664,18 +1668,18 @@ static int htc_proc_fetched_rxpkts(struct htc_target *target, ...@@ -1664,18 +1668,18 @@ static int htc_proc_fetched_rxpkts(struct htc_target *target,
packet->info.rx.indicat_flags |= packet->info.rx.indicat_flags |=
HTC_RX_FLAGS_INDICATE_MORE_PKTS; HTC_RX_FLAGS_INDICATE_MORE_PKTS;
htc_update_rx_stats(ep, *n_lk_ahd); ath6kl_htc_rx_update_stats(ep, *n_lk_ahd);
if (packet->info.rx.rx_flags & HTC_RX_PKT_PART_OF_BUNDLE) if (packet->info.rx.rx_flags & HTC_RX_PKT_PART_OF_BUNDLE)
ep->ep_st.rx_bundl += 1; ep->ep_st.rx_bundl += 1;
do_rx_completion(ep, packet); ath6kl_htc_rx_complete(ep, packet);
} }
return status; return status;
} }
static int htc_fetch_rxpkts(struct htc_target *target, static int ath6kl_htc_rx_fetch(struct htc_target *target,
struct list_head *rx_pktq, struct list_head *rx_pktq,
struct list_head *comp_pktq) struct list_head *comp_pktq)
{ {
...@@ -1693,7 +1697,7 @@ static int htc_fetch_rxpkts(struct htc_target *target, ...@@ -1693,7 +1697,7 @@ static int htc_fetch_rxpkts(struct htc_target *target,
* bundle transfer and recv bundling is * bundle transfer and recv bundling is
* allowed. * allowed.
*/ */
status = htc_issue_rxpkt_bundle(target, rx_pktq, status = ath6kl_htc_rx_bundle(target, rx_pktq,
comp_pktq, comp_pktq,
&fetched_pkts, &fetched_pkts,
part_bundle); part_bundle);
...@@ -1725,7 +1729,8 @@ static int htc_fetch_rxpkts(struct htc_target *target, ...@@ -1725,7 +1729,8 @@ static int htc_fetch_rxpkts(struct htc_target *target,
HTC_RX_PKT_IGNORE_LOOKAHEAD; HTC_RX_PKT_IGNORE_LOOKAHEAD;
/* go fetch the packet */ /* go fetch the packet */
status = dev_rx_pkt(target, packet, packet->act_len); status = ath6kl_htc_rx_packet(target, packet,
packet->act_len);
if (status) if (status)
return status; return status;
...@@ -1779,7 +1784,7 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target, ...@@ -1779,7 +1784,7 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target,
* Try to allocate as many HTC RX packets indicated by the * Try to allocate as many HTC RX packets indicated by the
* look_aheads. * look_aheads.
*/ */
status = alloc_and_prep_rxpkts(target, look_aheads, status = ath6kl_htc_rx_alloc(target, look_aheads,
num_look_ahead, endpoint, num_look_ahead, endpoint,
&rx_pktq); &rx_pktq);
if (status) if (status)
...@@ -1796,14 +1801,15 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target, ...@@ -1796,14 +1801,15 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target,
num_look_ahead = 0; num_look_ahead = 0;
status = htc_fetch_rxpkts(target, &rx_pktq, &comp_pktq); status = ath6kl_htc_rx_fetch(target, &rx_pktq, &comp_pktq);
if (!status) if (!status)
chk_rx_water_mark(endpoint); ath6kl_htc_rx_chk_water_mark(endpoint);
/* Process fetched packets */ /* Process fetched packets */
status = htc_proc_fetched_rxpkts(target, &comp_pktq, status = ath6kl_htc_rx_process_packets(target, &comp_pktq,
look_aheads, &num_look_ahead); look_aheads,
&num_look_ahead);
if (!num_look_ahead || status) if (!num_look_ahead || status)
break; break;
...@@ -1896,14 +1902,14 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target) ...@@ -1896,14 +1902,14 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target)
packet->completion = NULL; packet->completion = NULL;
/* get the message from the device, this will block */ /* get the message from the device, this will block */
if (dev_rx_pkt(target, packet, packet->act_len)) if (ath6kl_htc_rx_packet(target, packet, packet->act_len))
goto fail_ctrl_rx; goto fail_ctrl_rx;
/* process receive header */ /* process receive header */
packet->status = htc_proc_rxhdr(target, packet, NULL, NULL); packet->status = ath6kl_htc_rx_process_hdr(target, packet, NULL, NULL);
if (packet->status) { if (packet->status) {
ath6kl_err("htc_wait_for_ctrl_msg, htc_proc_rxhdr failed (status = %d)\n", ath6kl_err("htc_wait_for_ctrl_msg, ath6kl_htc_rx_process_hdr failed (status = %d)\n",
packet->status); packet->status);
goto fail_ctrl_rx; goto fail_ctrl_rx;
} }
...@@ -1950,7 +1956,7 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target, ...@@ -1950,7 +1956,7 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target,
list_for_each_entry_safe(packet, tmp_pkt, pkt_queue, list) { list_for_each_entry_safe(packet, tmp_pkt, pkt_queue, list) {
packet->status = -ECANCELED; packet->status = -ECANCELED;
list_del(&packet->list); list_del(&packet->list);
do_rx_completion(endpoint, packet); ath6kl_htc_rx_complete(endpoint, packet);
} }
return status; return status;
......
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