net: cnss: add PM QoS support for dual WiFi
PM QoS adds support to improve the wlan throughput. The cnss platform driver export PM QoS API to wlan host driver. Refactor PM QoS wrapper APIs to avoid the name space collision in cnss platform driver compilation in dual WiFi mode. CRs-Fixed: 983653 Change-Id: Id7a486f2f111476e73d5707eba36611a3530e9cf Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
This commit is contained in:
parent
ebca83b30e
commit
b29bc2ad43
3 changed files with 115 additions and 0 deletions
|
@ -2810,6 +2810,72 @@ void cnss_remove_pm_qos(void)
|
|||
}
|
||||
EXPORT_SYMBOL(cnss_remove_pm_qos);
|
||||
|
||||
void cnss_pci_request_pm_qos_type(int latency_type, u32 qos_val)
|
||||
{
|
||||
if (!penv) {
|
||||
pr_err("%s: penv is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
pm_qos_add_request(&penv->qos_request, latency_type, qos_val);
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_pci_request_pm_qos_type);
|
||||
|
||||
void cnss_pci_request_pm_qos(u32 qos_val)
|
||||
{
|
||||
if (!penv) {
|
||||
pr_err("%s: penv is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
pm_qos_add_request(&penv->qos_request, PM_QOS_CPU_DMA_LATENCY, qos_val);
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_pci_request_pm_qos);
|
||||
|
||||
void cnss_pci_remove_pm_qos(void)
|
||||
{
|
||||
if (!penv) {
|
||||
pr_err("%s: penv is NULL\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
pm_qos_remove_request(&penv->qos_request);
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_pci_remove_pm_qos);
|
||||
|
||||
int cnss_pci_request_bus_bandwidth(int bandwidth)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (!penv)
|
||||
return -ENODEV;
|
||||
|
||||
if (!penv->bus_client)
|
||||
return -ENOSYS;
|
||||
|
||||
switch (bandwidth) {
|
||||
case CNSS_BUS_WIDTH_NONE:
|
||||
case CNSS_BUS_WIDTH_LOW:
|
||||
case CNSS_BUS_WIDTH_MEDIUM:
|
||||
case CNSS_BUS_WIDTH_HIGH:
|
||||
ret = msm_bus_scale_client_update_request(
|
||||
penv->bus_client, bandwidth);
|
||||
if (!ret) {
|
||||
penv->current_bandwidth_vote = bandwidth;
|
||||
} else {
|
||||
pr_err("%s: could not set bus bandwidth %d, ret = %d\n",
|
||||
__func__, bandwidth, ret);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
pr_err("%s: Invalid request %d", __func__, bandwidth);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_pci_request_bus_bandwidth);
|
||||
|
||||
int cnss_request_bus_bandwidth(int bandwidth)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
@ -125,6 +125,44 @@ static const struct sdio_device_id ar6k_id_table[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(sdio, ar6k_id_table);
|
||||
|
||||
void cnss_sdio_request_pm_qos_type(int latency_type, u32 qos_val)
|
||||
{
|
||||
if (!cnss_pdata)
|
||||
return;
|
||||
|
||||
pr_debug("%s: PM QoS value: %d\n", __func__, qos_val);
|
||||
pm_qos_add_request(&cnss_pdata->qos_request, latency_type, qos_val);
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_sdio_request_pm_qos_type);
|
||||
|
||||
int cnss_sdio_request_bus_bandwidth(int bandwidth)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_sdio_request_bus_bandwidth);
|
||||
|
||||
void cnss_sdio_request_pm_qos(u32 qos_val)
|
||||
{
|
||||
if (!cnss_pdata)
|
||||
return;
|
||||
|
||||
pr_debug("%s: PM QoS value: %d\n", __func__, qos_val);
|
||||
pm_qos_add_request(
|
||||
&cnss_pdata->qos_request,
|
||||
PM_QOS_CPU_DMA_LATENCY, qos_val);
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_sdio_request_pm_qos);
|
||||
|
||||
void cnss_sdio_remove_pm_qos(void)
|
||||
{
|
||||
if (!cnss_pdata)
|
||||
return;
|
||||
|
||||
pm_qos_remove_request(&cnss_pdata->qos_request);
|
||||
pr_debug("%s: PM QoS removed\n", __func__);
|
||||
}
|
||||
EXPORT_SYMBOL(cnss_sdio_remove_pm_qos);
|
||||
|
||||
int cnss_request_bus_bandwidth(int bandwidth)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -122,6 +122,8 @@ extern void cnss_wlan_unregister_driver(struct cnss_wlan_driver *driver);
|
|||
extern int cnss_get_fw_files(struct cnss_fw_files *pfw_files);
|
||||
extern int cnss_get_fw_files_for_target(struct cnss_fw_files *pfw_files,
|
||||
u32 target_type, u32 target_version);
|
||||
extern int cnss_pci_request_bus_bandwidth(int bandwidth);
|
||||
extern int cnss_sdio_request_bus_bandwidth(int bandwidth);
|
||||
extern int cnss_request_bus_bandwidth(int bandwidth);
|
||||
|
||||
extern int cnss_get_sha_hash(const u8 *data, u32 data_len,
|
||||
|
@ -140,6 +142,15 @@ extern void cnss_release_pm_sem(void);
|
|||
extern void cnss_request_pm_qos_type(int latency_type, u32 qos_val);
|
||||
extern void cnss_request_pm_qos(u32 qos_val);
|
||||
extern void cnss_remove_pm_qos(void);
|
||||
|
||||
extern void cnss_pci_request_pm_qos_type(int latency_type, u32 qos_val);
|
||||
extern void cnss_pci_request_pm_qos(u32 qos_val);
|
||||
extern void cnss_pci_remove_pm_qos(void);
|
||||
|
||||
extern void cnss_sdio_request_pm_qos_type(int latency_type, u32 qos_val);
|
||||
extern void cnss_sdio_request_pm_qos(u32 qos_val);
|
||||
extern void cnss_sdio_remove_pm_qos(void);
|
||||
|
||||
extern int cnss_get_platform_cap(struct cnss_platform_cap *cap);
|
||||
extern void cnss_set_driver_status(enum cnss_driver_status driver_status);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue