qcacmn: Add QDF API for DRV support

Add QDF API to check platform capability if DRV is supported or not.
Then component enables wow support based on it.

Change-Id: I9045b1982acfc4ed4cdce724b48430cb20e03274
CRs-Fixed: 2722639
This commit is contained in:
Wu Gao 2020-07-01 10:12:10 +08:00 • committed by nshrivas
commit 7f96401451
2 changed files with 46 additions and 0 deletions

View file

@ -255,5 +255,31 @@ void qdf_register_drv_connected_callback(qdf_is_drv_connected_callback
*/
void qdf_check_state_before_panic(void);
/**
* qdf_is_drv_supported_callback() - callback to query if drv is supported
*
* Return: true if drv is supported else false
*/
typedef bool (*qdf_is_drv_supported_callback)(void);
/**
* qdf_is_drv_supported_callback() - API to check if drv is supported or not
*
* DRV is dynamic request voting using which fw can do page fault and
* bring in page back without apps wake up
*
* Return: true: if drv is supported
* false: if drv is not supported
*/
bool qdf_is_drv_supported(void);
/**
* qdf_register_drv_supported_callback() - API to register drv supported cb
* @is_drv_supported: callback to query if drv is supported or not
*
* Return: none
*/
void qdf_register_drv_supported_callback(qdf_is_drv_supported_callback
is_drv_supported);
#endif /*_QDF_PLATFORM_H*/

View file

@ -30,6 +30,7 @@ static qdf_is_driver_unloading_callback is_driver_unloading_cb;
static qdf_is_recovering_callback is_recovering_cb;
static qdf_is_drv_connected_callback is_drv_connected_cb;
static qdf_wmi_send_over_qmi_callback _wmi_send_recv_qmi_cb;
static qdf_is_drv_supported_callback is_drv_supported_cb;
void qdf_register_fw_down_callback(qdf_is_fw_down_callback is_fw_down)
{
@ -175,3 +176,22 @@ void qdf_check_state_before_panic(void)
qdf_export_symbol(qdf_check_state_before_panic);
void qdf_register_drv_supported_callback(qdf_is_drv_supported_callback
is_drv_supported)
{
is_drv_supported_cb = is_drv_supported;
}
qdf_export_symbol(qdf_register_drv_supported_callback);
bool qdf_is_drv_supported(void)
{
if (!is_drv_supported_cb) {
qdf_err("drv supported callback is not registered");
return false;
}
return is_drv_supported_cb();
}
qdf_export_symbol(qdf_is_drv_supported);