Prechádzať zdrojové kódy

qcacmn: Add QDF API for DRV feature support

Add QDF API to check if DRV is connected or not such that
proper decision can be taken during wow enable request.

Change-Id: Ic128882d564b5717b6dc749c6fe229a6dbb86c8f
CRs-Fixed: 2457065
Rajeev Kumar 5 rokov pred
rodič
commit
e386d8bcbc
2 zmenil súbory, kde vykonal 45 pridanie a 0 odobranie
  1. 27 0
      qdf/inc/qdf_platform.h
  2. 18 0
      qdf/src/qdf_platform.c

+ 27 - 0
qdf/inc/qdf_platform.h

@@ -147,5 +147,32 @@ void __qdf_op_unprotect(struct qdf_op_sync *sync, const char *func);
 void qdf_op_callbacks_register(qdf_op_protect_cb on_protect,
 			       qdf_op_unprotect_cb on_unprotect);
 
+/**
+ * qdf_is_drv_connected_callback() - callback to query if drv is connected
+ *
+ * Return: true if drv is connected else false
+ */
+typedef bool (*qdf_is_drv_connected_callback)(void);
+
+/**
+ * qdf_is_drv_connected() - API to check if drv is connected 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 connected
+ *	   false: if drv is not connected
+ */
+bool qdf_is_drv_connected(void);
+
+/**
+ * qdf_register_drv_connected_callback() - API to register drv connected cb
+ * @is_drv_connected: callback to query if drv is connected or not
+ *
+ * Return: none
+ */
+void qdf_register_drv_connected_callback(qdf_is_drv_connected_callback
+					 is_drv_connected);
+
 #endif /*_QDF_PLATFORM_H*/
 

+ 18 - 0
qdf/src/qdf_platform.c

@@ -27,6 +27,7 @@
 static qdf_self_recovery_callback	self_recovery_cb;
 static qdf_is_fw_down_callback		is_fw_down_cb;
 static qdf_is_recovering_callback	is_recovering_cb;
+static qdf_is_drv_connected_callback    is_drv_connected_cb;
 
 void qdf_register_fw_down_callback(qdf_is_fw_down_callback is_fw_down)
 {
@@ -108,3 +109,20 @@ void __qdf_op_unprotect(struct qdf_op_sync *sync, const char *func)
 }
 qdf_export_symbol(__qdf_op_unprotect);
 
+void qdf_register_drv_connected_callback(qdf_is_drv_connected_callback
+					 is_drv_connected)
+{
+	is_drv_connected_cb = is_drv_connected;
+}
+qdf_export_symbol(qdf_register_drv_connected_callback);
+
+bool qdf_is_drv_connected(void)
+{
+	if (!is_drv_connected_cb) {
+		qdf_err("drv connected callback is not registered");
+		return false;
+	}
+
+	return is_drv_connected_cb();
+}
+qdf_export_symbol(qdf_is_drv_connected);