Browse Source

qcacmn: Callback to get current bandwidth level

Add HIF callbacks to get current bandwidth level from upper layers.

Change-Id: I18524558296f4b7d684f18b0e6615b2a0516b6d2
CRs-Fixed: 2602029
Mohit Khanna 5 years ago
parent
commit
b34654bd55
3 changed files with 24 additions and 1 deletions
  1. 2 1
      hif/inc/hif.h
  2. 13 0
      hif/src/hif_main.c
  3. 9 0
      hif/src/hif_main.h

+ 2 - 1
hif/inc/hif.h

@@ -537,7 +537,7 @@ struct htc_callbacks {
  * @is_recovery_in_progress: Query if driver state is recovery in progress
  * @is_recovery_in_progress: Query if driver state is recovery in progress
  * @is_load_unload_in_progress: Query if driver state Load/Unload in Progress
  * @is_load_unload_in_progress: Query if driver state Load/Unload in Progress
  * @is_driver_unloading: Query if driver is unloading.
  * @is_driver_unloading: Query if driver is unloading.
- *
+ * @get_bandwidth_level: Query current bandwidth level for the driver
  * This Structure provides callback pointer for HIF to query hdd for driver
  * This Structure provides callback pointer for HIF to query hdd for driver
  * states.
  * states.
  */
  */
@@ -548,6 +548,7 @@ struct hif_driver_state_callbacks {
 	bool (*is_load_unload_in_progress)(void *context);
 	bool (*is_load_unload_in_progress)(void *context);
 	bool (*is_driver_unloading)(void *context);
 	bool (*is_driver_unloading)(void *context);
 	bool (*is_target_ready)(void *context);
 	bool (*is_target_ready)(void *context);
+	int (*get_bandwidth_level)(void *context);
 };
 };
 
 
 /* This API detaches the HTC layer from the HIF device */
 /* This API detaches the HTC layer from the HIF device */

+ 13 - 0
hif/src/hif_main.c

@@ -1219,6 +1219,19 @@ bool hif_is_target_ready(struct hif_softc *scn)
 }
 }
 qdf_export_symbol(hif_is_target_ready);
 qdf_export_symbol(hif_is_target_ready);
 
 
+int hif_get_bandwidth_level(struct hif_opaque_softc *hif_handle)
+{
+	struct hif_softc *scn = HIF_GET_SOFTC(hif_handle);
+	struct hif_driver_state_callbacks *cbk = hif_get_callbacks_handle(scn);
+
+	if (cbk && cbk->get_bandwidth_level)
+		return cbk->get_bandwidth_level(cbk->context);
+
+	return 0;
+}
+
+qdf_export_symbol(hif_get_bandwidth_level);
+
 /**
 /**
  * hif_batch_send() - API to access hif specific function
  * hif_batch_send() - API to access hif specific function
  * ce_batch_send.
  * ce_batch_send.

+ 9 - 0
hif/src/hif_main.h

@@ -324,6 +324,15 @@ bool hif_is_driver_unloading(struct hif_softc *scn);
 bool hif_is_load_or_unload_in_progress(struct hif_softc *scn);
 bool hif_is_load_or_unload_in_progress(struct hif_softc *scn);
 bool hif_is_recovery_in_progress(struct hif_softc *scn);
 bool hif_is_recovery_in_progress(struct hif_softc *scn);
 bool hif_is_target_ready(struct hif_softc *scn);
 bool hif_is_target_ready(struct hif_softc *scn);
+
+/**
+ * hif_get_bandwidth_level() - API to get the current bandwidth level
+ * @scn: HIF Context
+ *
+ * Return: PLD bandwidth level
+ */
+int hif_get_bandwidth_level(struct hif_opaque_softc *hif_handle);
+
 void hif_wlan_disable(struct hif_softc *scn);
 void hif_wlan_disable(struct hif_softc *scn);
 int hif_target_sleep_state_adjust(struct hif_softc *scn,
 int hif_target_sleep_state_adjust(struct hif_softc *scn,
 					 bool sleep_ok,
 					 bool sleep_ok,