Эх сурвалжийг харах

qcacld-3.0: Refine sme_send_flush_logs_cmd_to_fw prototype()

There are currently multiple issues with sme_send_flush_logs_cmd_to_fw()
- Although this is an SME API the prototype is exposed in a CDS header
  file
- The API is defined to take a mac context parameter which is unused
- Although the function returns QDF_STATUS, the only caller treats the
  return value as an int errno

To address these issues
- Relocate the prototype to SME
- Remove the unused parameter
- Properly treat the return value as QDF_STATUS

Change-Id: Ia511565ee0b77148ee7cb1bf221e99a5b26ed446
CRs-Fixed: 2353530
Jeff Johnson 6 жил өмнө
parent
commit
40894141cb

+ 0 - 1
core/cds/inc/cds_utils.h

@@ -160,7 +160,6 @@ bool cds_is_gmac_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm,
 uint8_t cds_get_gmac_mmie_size(void);
 
 #endif /* WLAN_FEATURE_11W */
-QDF_STATUS sme_send_flush_logs_cmd_to_fw(tpAniSirGlobal pMac);
 static inline void cds_host_diag_log_work(qdf_wake_lock_t *lock, uint32_t msec,
 			    uint32_t reason) {
 	if (((cds_get_ring_log_level(RING_ID_WAKELOCK) >= WLAN_LOG_LEVEL_ACTIVE)

+ 2 - 3
core/cds/src/cds_api.c

@@ -2343,7 +2343,6 @@ QDF_STATUS cds_flush_logs(uint32_t is_fatal,
 		bool dump_mac_trace,
 		bool recovery_needed)
 {
-	uint32_t ret;
 	QDF_STATUS status;
 
 	struct cds_context *p_cds_context;
@@ -2387,8 +2386,8 @@ QDF_STATUS cds_flush_logs(uint32_t is_fatal,
 		return QDF_STATUS_SUCCESS;
 	}
 
-	ret = sme_send_flush_logs_cmd_to_fw(p_cds_context->mac_context);
-	if (0 != ret) {
+	status = sme_send_flush_logs_cmd_to_fw();
+	if (QDF_IS_STATUS_ERROR(status)) {
 		cds_err("Failed to send flush FW log");
 		cds_init_log_completion();
 		return QDF_STATUS_E_FAILURE;

+ 14 - 2
core/sme/inc/sme_api.h

@@ -1368,16 +1368,28 @@ QDF_STATUS sme_wifi_start_logger(mac_handle_t mac_handle,
 bool sme_neighbor_middle_of_roaming(mac_handle_t mac_handle,
 				    uint8_t sessionId);
 
-/*
+/**
  * sme_is_any_session_in_middle_of_roaming() - check if roaming is in progress
  * @mac_handle: MAC Handle
  *
  * Checks if any SME session is in middle of roaming
  *
- * Return : true if roaming is in progress else false
+ * Return: true if roaming is in progress else false
  */
 bool sme_is_any_session_in_middle_of_roaming(mac_handle_t mac_handle);
 
+/**
+ * sme_send_flush_logs_cmd_to_fw() - Initiate command to FW to flush logs
+ *
+ * This function will initiate a command to firmware to flush their logs.
+ * This should normally be done in response to an anomaly detected by the
+ * host.
+ *
+ * Return: QDF_STATUS_SUCCESS if the command was sent, otherwise an
+ *         appropriate QDF_STATUS error
+ */
+QDF_STATUS sme_send_flush_logs_cmd_to_fw(void);
+
 /**
  * sme_enable_uapsd_for_ac() - enable uapsd for access category request to WMA
  * @sta_id: station id

+ 1 - 2
core/sme/src/common/sme_api.c

@@ -12759,14 +12759,13 @@ bool sme_is_any_session_in_middle_of_roaming(mac_handle_t mac_handle)
 
 /*
  * sme_send_flush_logs_cmd_to_fw() - Flush FW logs
- * @mac: MAC handle
  *
  * This function is used to send the command that will
  * be used to flush the logs in the firmware
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sme_send_flush_logs_cmd_to_fw(tpAniSirGlobal mac)
+QDF_STATUS sme_send_flush_logs_cmd_to_fw(void)
 {
 	QDF_STATUS status;
 	struct scheduler_msg message = {0};