Sfoglia il codice sorgente

qcacmn: Fix compilation error when DIRECT_BUF_RX is disabled

Fix compilation errors when DIRECT_BUF_RX_ENABLE compile-time flag is
disabled.

Change-Id: I2bbce6eb8838ecab02b6462c1c0ee28877accdb4
CRs-Fixed: 2883310
Shashikala Prabhu 4 anni fa
parent
commit
6dac66bcbf

+ 0 - 2
target_if/cfr/src/target_if_cfr_enh.c

@@ -25,9 +25,7 @@
 #include <wlan_osif_priv.h>
 #include <init_deinit_lmac.h>
 #include <wlan_cfr_utils_api.h>
-#ifdef DIRECT_BUF_RX_ENABLE
 #include <target_if_direct_buf_rx_api.h>
-#endif
 #include <target_if_cfr_enh.h>
 #include "cdp_txrx_ctrl.h"
 

+ 48 - 13
target_if/direct_buf_rx/inc/target_if_direct_buf_rx_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -23,6 +23,19 @@
 #include "qdf_atomic.h"
 #include "wmi_unified_api.h"
 
+/**
+ * enum DBR_MODULE - Enum containing the modules supporting direct buf rx
+ * @DBR_MODULE_SPECTRAL: Module ID for Spectral
+ * @DBR_MODULE_CFR: Module ID for CFR
+ * @DBR_MODULE_MAX: Max module ID
+ */
+enum DBR_MODULE {
+	DBR_MODULE_SPECTRAL = 0,
+	DBR_MODULE_CFR      = 1,
+	DBR_MODULE_MAX,
+};
+
+#ifdef DIRECT_BUF_RX_ENABLE
 #ifdef WLAN_DEBUGFS
 #ifdef DIRECT_BUF_RX_DEBUG
 /* Base debugfs entry for DBR module */
@@ -63,18 +76,6 @@ extern qdf_dentry_t dbr_debugfs_entry;
 struct wlan_objmgr_psoc;
 struct wlan_lmac_if_tx_ops;
 
-/**
- * enum DBR_MODULE - Enum containing the modules supporting direct buf rx
- * @DBR_MODULE_SPECTRAL: Module ID for Spectral
- * @DBR_MODULE_CFR: Module ID for CFR
- * @DBR_MODULE_MAX: Max module ID
- */
-enum DBR_MODULE {
-	DBR_MODULE_SPECTRAL = 0,
-	DBR_MODULE_CFR      = 1,
-	DBR_MODULE_MAX,
-};
-
 #ifdef WMI_DBR_SUPPORT
 /**
  * struct direct_buf_rx_data - direct buffer rx data
@@ -169,4 +170,38 @@ QDF_STATUS target_if_dbr_cookie_lookup(struct wlan_objmgr_pdev *pdev,
 QDF_STATUS target_if_dbr_buf_release(struct wlan_objmgr_pdev *pdev,
 				     uint8_t mod_id, qdf_dma_addr_t paddr,
 				     uint32_t cookie, uint8_t srng_id);
+
+/**
+ * target_if_dbr_update_pdev_for_hw_mode_change() - Update DBR object in pdev
+ * structure for hw mode change
+ * @pdev: pointer to pdev object
+ * @phy_idx: Phy index
+ */
+QDF_STATUS target_if_dbr_update_pdev_for_hw_mode_change(
+		struct wlan_objmgr_pdev *pdev, int phy_idx);
+#else /* DIRECT_BUF_RX_ENABLE*/
+
+static inline QDF_STATUS
+target_if_dbr_cookie_lookup(struct wlan_objmgr_pdev *pdev,
+			    uint8_t mod_id, qdf_dma_addr_t paddr,
+			    uint32_t *cookie, uint8_t srng_id)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+target_if_dbr_buf_release(struct wlan_objmgr_pdev *pdev,
+			  uint8_t mod_id, qdf_dma_addr_t paddr,
+			  uint32_t cookie, uint8_t srng_id)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+target_if_dbr_update_pdev_for_hw_mode_change(
+		struct wlan_objmgr_pdev *pdev, int phy_idx)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* DIRECT_BUF_RX_ENABLE */
 #endif /* _TARGET_IF_DIRECT_BUF_RX_API_H_ */

+ 27 - 1
target_if/direct_buf_rx/src/target_if_direct_buf_rx_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -240,3 +240,29 @@ void target_if_direct_buf_rx_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 	target_if_direct_buf_rx_debug_register_tx_ops(tx_ops);
 }
 qdf_export_symbol(target_if_direct_buf_rx_register_tx_ops);
+
+QDF_STATUS target_if_dbr_update_pdev_for_hw_mode_change(
+		struct wlan_objmgr_pdev *pdev, int phy_idx)
+{
+	struct wlan_objmgr_psoc *psoc;
+	struct direct_buf_rx_psoc_obj *dbr_psoc_obj;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		direct_buf_rx_err("psoc is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	dbr_psoc_obj = wlan_objmgr_psoc_get_comp_private_obj(
+			psoc, WLAN_TARGET_IF_COMP_DIRECT_BUF_RX);
+	if (!dbr_psoc_obj) {
+		direct_buf_rx_err("dir buf rx psoc object is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	/* Update DBR object in pdev */
+	pdev->pdev_comp_priv_obj[WLAN_TARGET_IF_COMP_DIRECT_BUF_RX] =
+		(void *)dbr_psoc_obj->dbr_pdev_obj[phy_idx];
+
+	return QDF_STATUS_SUCCESS;
+}