Forráskód Böngészése

qcacmn: Replace void * wmi_hdl with abstract type (10/10)

Replace void * wmi handle with abstract type handles
provided by wmi component

Change-Id: Iaf3de67d4933998ac4540ac280d716d534777e7f
CRs-Fixed: 2482647
Himanshu Batra 5 éve
szülő
commit
39d27ed230
2 módosított fájl, 70 hozzáadás és 70 törlés
  1. 40 28
      wmi/inc/wmi_unified_twt_api.h
  2. 30 42
      wmi/src/wmi_unified_twt_api.c

+ 40 - 28
wmi/inc/wmi_unified_twt_api.h

@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 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
@@ -28,87 +28,95 @@
 
 /**
  * wmi_unified_twt_enable_cmd() - Send WMI command to Enable TWT
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @params: Parameters to be configured
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_unified_twt_enable_cmd(void *wmi_hdl,
-			struct wmi_twt_enable_param *params);
+QDF_STATUS
+wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,
+			   struct wmi_twt_enable_param *params);
 
 /**
  * wmi_unified_twt_disable_cmd() - Send WMI command to disable TWT
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @params: Parameters to be configured
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_unified_twt_disable_cmd(void *wmi_hdl,
-			struct wmi_twt_disable_param *params);
+QDF_STATUS
+wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,
+			    struct wmi_twt_disable_param *params);
 
 /**
  * wmi_unified_twt_add_dialog_cmd() - Send WMI command to add TWT dialog
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @params: Parameters to be configured
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_unified_twt_add_dialog_cmd(void *wmi_hdl,
-			struct wmi_twt_add_dialog_param *params);
+QDF_STATUS
+wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,
+			       struct wmi_twt_add_dialog_param *params);
 
 /**
  * wmi_unified_twt_del_dialog_cmd() - Send WMI command to delete TWT dialog
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @params: Parameters to be configured
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_unified_twt_del_dialog_cmd(void *wmi_hdl,
-			struct wmi_twt_del_dialog_param *params);
+QDF_STATUS
+wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,
+			       struct wmi_twt_del_dialog_param *params);
 
 /**
  * wmi_unified_twt_pause_dialog_cmd() - Send WMI command to pause TWT dialog
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @params: Parameters to be configured
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_unified_twt_pause_dialog_cmd(void *wmi_hdl,
-			struct wmi_twt_pause_dialog_cmd_param *params);
+QDF_STATUS
+wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,
+				 struct wmi_twt_pause_dialog_cmd_param *params);
 
 /**
  * wmi_unified_twt_resume_dialog_cmd() - Send WMI command to resume TWT dialog
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @params: Parameters to be configured
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_unified_twt_resume_dialog_cmd(void *wmi_hdl,
+QDF_STATUS wmi_unified_twt_resume_dialog_cmd(
+			wmi_unified_t wmi_handle,
 			struct wmi_twt_resume_dialog_cmd_param *params);
 
 /**
  * wmi_extract_twt_enable_comp_event() - Extract WMI event params for TWT enable
  *                               completion event
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @evt_buf: Pointer event buffer
  * @params: Parameters to extract
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_extract_twt_enable_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_enable_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_enable_complete_event_param *params);
 
 /**
  * wmi_extract_twt_disable_comp_event() - Extract WMI event params for TWT
  *                               disable completion event
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @evt_buf: Pointer event buffer
  * @params: Parameters to extract
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_extract_twt_disable_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_disable_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_disable_complete_event *params);
 
@@ -121,7 +129,8 @@ QDF_STATUS wmi_extract_twt_disable_comp_event(void *wmi_hdl,
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_extract_twt_add_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_add_dialog_complete_event_param *params);
 
@@ -134,33 +143,36 @@ QDF_STATUS wmi_extract_twt_add_dialog_comp_event(void *wmi_hdl,
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_extract_twt_del_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_del_dialog_complete_event_param *params);
 
 /**
  * wmi_extract_twt_pause_dialog_comp_event() - Extract WMI event params for TWT
  *                               pause dialog completion event
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @evt_buf: Pointer event buffer
  * @params: Parameters to extract
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_pause_dialog_complete_event_param *params);
 
 /**
  * wmi_extract_twt_resume_dialog_comp_event() - Extract WMI event params for TWT
  *                               resume dialog completion event
- * @wmi_hdl: wmi handle
+ * @wmi_handle: wmi handle
  * @evt_buf: Pointer event buffer
  * @params: Parameters to extract
  *
  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  */
-QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_resume_dialog_complete_event_param *params);
 

+ 30 - 42
wmi/src/wmi_unified_twt_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 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,11 +23,10 @@
 #include "wmi_unified_twt_api.h"
 
 
-QDF_STATUS wmi_unified_twt_enable_cmd(void *wmi_hdl,
-			struct wmi_twt_enable_param *params)
+QDF_STATUS
+wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,
+			   struct wmi_twt_enable_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->send_twt_enable_cmd)
 		return wmi_handle->ops->send_twt_enable_cmd(
 				wmi_handle, params);
@@ -35,11 +34,10 @@ QDF_STATUS wmi_unified_twt_enable_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_unified_twt_disable_cmd(void *wmi_hdl,
-			struct wmi_twt_disable_param *params)
+QDF_STATUS
+wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,
+			    struct wmi_twt_disable_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->send_twt_disable_cmd)
 		return wmi_handle->ops->send_twt_disable_cmd(
 				wmi_handle, params);
@@ -47,11 +45,10 @@ QDF_STATUS wmi_unified_twt_disable_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_unified_twt_add_dialog_cmd(void *wmi_hdl,
-			struct wmi_twt_add_dialog_param *params)
+QDF_STATUS
+wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,
+			       struct wmi_twt_add_dialog_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->send_twt_add_dialog_cmd)
 		return wmi_handle->ops->send_twt_add_dialog_cmd(
 				wmi_handle, params);
@@ -59,11 +56,10 @@ QDF_STATUS wmi_unified_twt_add_dialog_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_unified_twt_del_dialog_cmd(void *wmi_hdl,
-			struct wmi_twt_del_dialog_param *params)
+QDF_STATUS
+wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,
+			       struct wmi_twt_del_dialog_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->send_twt_del_dialog_cmd)
 		return wmi_handle->ops->send_twt_del_dialog_cmd(
 				wmi_handle, params);
@@ -71,11 +67,10 @@ QDF_STATUS wmi_unified_twt_del_dialog_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_unified_twt_pause_dialog_cmd(void *wmi_hdl,
-			struct wmi_twt_pause_dialog_cmd_param *params)
+QDF_STATUS
+wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,
+				 struct wmi_twt_pause_dialog_cmd_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->send_twt_pause_dialog_cmd)
 		return wmi_handle->ops->send_twt_pause_dialog_cmd(
 				wmi_handle, params);
@@ -83,11 +78,10 @@ QDF_STATUS wmi_unified_twt_pause_dialog_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_unified_twt_resume_dialog_cmd(void *wmi_hdl,
+QDF_STATUS wmi_unified_twt_resume_dialog_cmd(
+			wmi_unified_t wmi_handle,
 			struct wmi_twt_resume_dialog_cmd_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->send_twt_resume_dialog_cmd)
 		return wmi_handle->ops->send_twt_resume_dialog_cmd(
 				wmi_handle, params);
@@ -95,12 +89,11 @@ QDF_STATUS wmi_unified_twt_resume_dialog_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_extract_twt_enable_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_enable_comp_event(
+			wmi_unified_t wmi_handle,
 			uint8_t *evt_buf,
 			struct wmi_twt_enable_complete_event_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->extract_twt_enable_comp_event)
 		return wmi_handle->ops->extract_twt_enable_comp_event(
 				wmi_handle, evt_buf, params);
@@ -108,12 +101,11 @@ QDF_STATUS wmi_extract_twt_enable_comp_event(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_extract_twt_disable_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_disable_comp_event(
+			wmi_unified_t wmi_handle,
 			uint8_t *evt_buf,
 			struct wmi_twt_disable_complete_event *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->extract_twt_disable_comp_event)
 		return wmi_handle->ops->extract_twt_disable_comp_event(
 				wmi_handle, evt_buf, params);
@@ -121,12 +113,11 @@ QDF_STATUS wmi_extract_twt_disable_comp_event(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_extract_twt_add_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
+			wmi_unified_t wmi_handle,
 			uint8_t *evt_buf,
 			struct wmi_twt_add_dialog_complete_event_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->extract_twt_add_dialog_comp_event)
 		return wmi_handle->ops->extract_twt_add_dialog_comp_event(
 				wmi_handle, evt_buf, params);
@@ -134,12 +125,11 @@ QDF_STATUS wmi_extract_twt_add_dialog_comp_event(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_extract_twt_del_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_del_dialog_complete_event_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->extract_twt_del_dialog_comp_event)
 		return wmi_handle->ops->extract_twt_del_dialog_comp_event(
 				wmi_handle, evt_buf, params);
@@ -147,12 +137,11 @@ QDF_STATUS wmi_extract_twt_del_dialog_comp_event(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_pause_dialog_complete_event_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->extract_twt_pause_dialog_comp_event)
 		return wmi_handle->ops->extract_twt_pause_dialog_comp_event(
 				wmi_handle, evt_buf, params);
@@ -160,12 +149,11 @@ QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(void *wmi_hdl,
+QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(
+		wmi_unified_t wmi_handle,
 		uint8_t *evt_buf,
 		struct wmi_twt_resume_dialog_complete_event_param *params)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
 	if (wmi_handle->ops->extract_twt_resume_dialog_comp_event)
 		return wmi_handle->ops->extract_twt_resume_dialog_comp_event(
 				wmi_handle, evt_buf, params);