qcacmn: Add debug log to print link vote id
Add debug log to print details about the link vote id. Change-Id: I2e89a3d6f06a0f3ec38ea9e8345d854553dbe86d CRs-Fixed: 2964961
Этот коммит содержится в:

коммит произвёл
Madan Koyyalamudi

родитель
1dd538e4b9
Коммит
75c2cf25ab
102
htc/htc.c
102
htc/htc.c
@@ -322,6 +322,70 @@ void htc_update_rx_bundle_stats(void *ctx, uint8_t no_of_pkt_in_bundle)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_DEBUG_LINK_VOTE
|
||||
static qdf_atomic_t htc_link_vote_ids[HTC_LINK_VOTE_INVALID_MAX_USER_ID];
|
||||
|
||||
static void htc_init_link_vote_ids(void)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
for (i = HTC_LINK_VOTE_INVALID_MIN_USER_ID;
|
||||
i < HTC_LINK_VOTE_INVALID_MAX_USER_ID; i++)
|
||||
qdf_atomic_init(&htc_link_vote_ids[i]);
|
||||
}
|
||||
|
||||
void htc_log_link_user_votes(void)
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t link_vote;
|
||||
|
||||
for (i = HTC_LINK_VOTE_INVALID_MIN_USER_ID + 1;
|
||||
i < HTC_LINK_VOTE_INVALID_MAX_USER_ID; i++) {
|
||||
link_vote = qdf_atomic_read(&htc_link_vote_ids[i]);
|
||||
if (link_vote)
|
||||
HTC_NOFL_INFO("Link vote %d user id: %d",
|
||||
link_vote, i);
|
||||
}
|
||||
}
|
||||
|
||||
void htc_vote_link_down(HTC_HANDLE htc_handle, enum htc_link_vote_user_id id)
|
||||
{
|
||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
|
||||
|
||||
if (!target->hif_dev)
|
||||
return;
|
||||
if (id >= HTC_LINK_VOTE_INVALID_MAX_USER_ID ||
|
||||
id <= HTC_LINK_VOTE_INVALID_MIN_USER_ID) {
|
||||
HTC_ERROR("invalid id: %d", id);
|
||||
return;
|
||||
}
|
||||
|
||||
hif_vote_link_down(target->hif_dev);
|
||||
qdf_atomic_dec(&htc_link_vote_ids[id]);
|
||||
}
|
||||
|
||||
void htc_vote_link_up(HTC_HANDLE htc_handle, enum htc_link_vote_user_id id)
|
||||
{
|
||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
|
||||
|
||||
if (!target->hif_dev)
|
||||
return;
|
||||
if (id >= HTC_LINK_VOTE_INVALID_MAX_USER_ID ||
|
||||
id <= HTC_LINK_VOTE_INVALID_MIN_USER_ID) {
|
||||
HTC_ERROR("invalid link vote user id: %d", id);
|
||||
return;
|
||||
}
|
||||
|
||||
hif_vote_link_up(target->hif_dev);
|
||||
qdf_atomic_inc(&htc_link_vote_ids[id]);
|
||||
}
|
||||
#else
|
||||
static inline
|
||||
void htc_init_link_vote_ids(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/* registered target arrival callback from the HIF layer */
|
||||
HTC_HANDLE htc_create(void *ol_sc, struct htc_init_info *pInfo,
|
||||
qdf_device_t osdev, uint32_t con_mode)
|
||||
@@ -421,6 +485,8 @@ HTC_HANDLE htc_create(void *ol_sc, struct htc_init_info *pInfo,
|
||||
|
||||
htc_hang_event_notifier_register(target);
|
||||
|
||||
htc_init_link_vote_ids();
|
||||
|
||||
return (HTC_HANDLE) target;
|
||||
}
|
||||
|
||||
@@ -1126,42 +1192,6 @@ void htc_clear_bundle_stats(HTC_HANDLE HTCHandle)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* htc_vote_link_down - API to vote for link down
|
||||
* @htc_handle: HTC handle
|
||||
*
|
||||
* API for upper layers to call HIF to vote for link down
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void htc_vote_link_down(HTC_HANDLE htc_handle)
|
||||
{
|
||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
|
||||
|
||||
if (!target->hif_dev)
|
||||
return;
|
||||
|
||||
hif_vote_link_down(target->hif_dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* htc_vote_link_up - API to vote for link up
|
||||
* @htc_handle: HTC Handle
|
||||
*
|
||||
* API for upper layers to call HIF to vote for link up
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void htc_vote_link_up(HTC_HANDLE htc_handle)
|
||||
{
|
||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
|
||||
|
||||
if (!target->hif_dev)
|
||||
return;
|
||||
|
||||
hif_vote_link_up(target->hif_dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* htc_can_suspend_link - API to query HIF for link status
|
||||
* @htc_handle: HTC Handle
|
||||
|
Ссылка в новой задаче
Block a user