qcacmn: Remove cds_get_context in HIF

Refactor Transport Layer from cds_get_context and pass the hif context
to all the API's to operate.

Change-Id: I1dedda76357f844e08fd422bf9eb15af70587eae
CRs-Fixed: 967765
This commit is contained in:
Komal Seelam 2016-02-02 18:17:13 +05:30
commit f8600687ad
14 changed files with 217 additions and 153 deletions

View file

@ -879,3 +879,57 @@ void htc_ipa_get_ce_resource(HTC_HANDLE htc_handle,
}
}
#endif /* IPA_OFFLOAD */
/**
* 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
*
* API for upper layers to call HIF to query if the link can suspend
*
* Return: void
*/
bool htc_can_suspend_link(HTC_HANDLE htc_handle)
{
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
if (!target->hif_dev)
return false;
return hif_can_suspend_link(target->hif_dev);
}

View file

@ -702,8 +702,10 @@ int htc_runtime_suspend(void);
int htc_runtime_resume(void);
/* Disable ASPM : Disable PCIe low power */
void htc_disable_aspm(void);
void htc_disable_aspm(HTC_HANDLE HTCHandle);
bool htc_can_suspend_link(HTC_HANDLE HTCHandle);
void htc_vote_link_down(HTC_HANDLE HTCHandle);
void htc_vote_link_up(HTC_HANDLE HTCHandle);
#ifdef IPA_OFFLOAD
void htc_ipa_get_ce_resource(HTC_HANDLE htc_handle,
cdf_dma_addr_t *ce_sr_base_paddr,

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@ -36,6 +36,24 @@ unsigned int htc_credit_flow = 1;
#define DEBUG_CREDIT 0
#endif
/**
* htc_update_htc_htt_config - API to update HIF with the HTT endpoint info
* @target: HTC handle
* @endpoint: Endpoint on which HTT messages flow
*
* Return: void
*/
#ifdef HIF_PCI
void htc_update_htc_htt_config(HTC_TARGET *target, int endpoint)
{
hif_save_htc_htt_config_endpoint(target->hif_dev, endpoint);
}
#else
void htc_update_htc_htt_config(HTC_TARGET *target, int endpoint)
{
}
#endif
A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
HTC_SERVICE_CONNECT_REQ *pConnectReq,
HTC_SERVICE_CONNECT_RESP *pConnectResp)
@ -335,7 +353,10 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
} while (false);
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-htc_connect_service \n"));
if (HTT_SERVICE_GROUP == (pConnectReq->service_id >> 8))
htc_update_htc_htt_config(target, assignedEndpoint);
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-htc_connect_service\n"));
return status;
}
@ -363,7 +384,12 @@ void htc_fw_event_handler(void *context, CDF_STATUS status)
}
/* Disable ASPM : disable PCIe low power */
void htc_disable_aspm(void)
void htc_disable_aspm(HTC_HANDLE HTCHandle)
{
hif_disable_aspm();
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
if (!target->hif_dev)
return;
hif_disable_aspm(target->hif_dev);
}