qcacld-3.0: Add HIF callback API to get BW level

Expose API in HDD, so HIF can callback to get the current bandwidth
level.

Change-Id: If65533a99e5d30ab66c4be20c8eb13b1bd1f033b
CRs-Fixed: 2618015
This commit is contained in:
Mohit Khanna 2020-02-07 12:26:30 -08:00 • committed by nshrivas
commit 0fe3ebdd3b

View file

@ -74,6 +74,19 @@ static inline void hdd_remove_pm_qos(struct device *dev)
pld_remove_pm_qos(dev);
}
/**
* hdd_get_bandwidth_level() - get current bandwidth level
* @data: Context
*
* Return: current bandwidth level
*/
static int hdd_get_bandwidth_level(void *data)
{
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
return hdd_get_current_throughput_level(hdd_ctx);
}
/**
* hdd_set_recovery_in_progress() - API to set recovery in progress
* @data: Context
@ -150,6 +163,7 @@ static void hdd_hif_init_driver_state_callbacks(void *data,
cbk->is_load_unload_in_progress = hdd_is_load_or_unload_in_progress;
cbk->is_driver_unloading = hdd_is_driver_unloading;
cbk->is_target_ready = hdd_is_target_ready;
cbk->get_bandwidth_level = hdd_get_bandwidth_level;
}
#ifdef FORCE_WAKE
@ -161,6 +175,7 @@ void hdd_set_hif_init_phase(struct hif_opaque_softc *hif_ctx,
#endif /* FORCE_WAKE */
/**
* hdd_hif_set_attribute() - API to set CE attribute if memory is limited
* @hif_ctx: hif context
*