From 0fe3ebdd3b6db32e4ec6361eb9254c6fe978d0d3 Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Fri, 7 Feb 2020 12:26:30 -0800 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_driver_ops.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 6bcb216cbb24..dce63ee05b0d 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -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 *