瀏覽代碼

qcacld-3.0: Introduce sap_get_mac_context()

Currently the macro CDS_GET_HAL_CB() is used throughout the SAP to
retrieve an opaque handle for the MAC context. This name is an
anachronism given that the HAL layer was moved to firmware many
generations ago. In addition, since the SAP module is internal to the
UMAC, it should normally not be dealing with the opaque handle but
should instead be dealing directly with the MAC context. Finally, per
the coding style, "inline functions are preferable to macros
resembling functions."

To address these issues introduce sap_get_mac_context(), a new inline
function, to replace the current usage of CDS_GET_HAL_CB().

Subsequent changes will actually perform the replacement.

Change-Id: I53160f7f5a315516f5348baea8cc7945483431bd
CRs-Fixed: 2346181
Jeff Johnson 6 年之前
父節點
當前提交
03d1e2c428
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      core/sap/src/sap_internal.h

+ 12 - 0
core/sap/src/sap_internal.h

@@ -279,6 +279,18 @@ typedef struct sWLAN_SAPEvent {
 /*----------------------------------------------------------------------------
  * Function Declarations and Documentation
  * -------------------------------------------------------------------------*/
+
+/**
+ * sap_get_mac_context() - Get a pointer to the global MAC context
+ *
+ * Return: pointer to the global MAC context, or NULL if the MAC
+ *         context is no longer registered
+ */
+static inline struct mac_context *sap_get_mac_context(void)
+{
+	return cds_get_context(QDF_MODULE_ID_PE);
+}
+
 QDF_STATUS wlansap_context_get(struct sap_context *ctx);
 void wlansap_context_put(struct sap_context *ctx);