Browse Source

qcacmn: Update function name and remove redundant code

Rename scan_tx_ops_register for consistency
Remove redundant lines of code in tx_ops registration

Change-Id: I3ade89f7eeb1f506f75b5c859dd4bc4242414628
CRs-Fixed: 2127952
akosigi 7 years ago
parent
commit
6e19edc1e4

+ 1 - 4
target_if/core/src/target_if_main.c

@@ -377,7 +377,7 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 	wlan_lmac_if_umac_tx_ops_register(tx_ops);
 
 	/* Register scan tx ops */
-	target_if_register_scan_tx_ops(&tx_ops->scan);
+	target_if_scan_tx_ops_register(tx_ops);
 
 	target_if_atf_tx_ops_register(tx_ops);
 
@@ -422,9 +422,6 @@ QDF_STATUS target_if_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 	/* Converged UMAC components to register P2P TX-ops */
 	target_if_p2p_register_tx_ops(tx_ops);
 #endif
-#ifdef CONVERGED_TDLS_ENABLE
-	target_if_tdls_register_tx_ops(tx_ops);
-#endif
 
 	return QDF_STATUS_SUCCESS;
 }

+ 4 - 4
target_if/scan/inc/target_if_scan.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 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
@@ -108,15 +108,15 @@ target_if_scan_cancel(struct wlan_objmgr_psoc *psoc,
 		struct scan_cancel_param *req);
 
 /**
- * target_if_register_scan_tx_ops() - lmac handler to register scan tx_ops
+ * target_if_scan_tx_ops_register() - lmac handler to register scan tx_ops
  * callback functions
- * @scan: wlan_lmac_if_scan_tx_ops object
+ * @tx_ops: wlan_lmac_if_tx_ops object
  *
  * Return: QDF_STATUS
  */
 
 QDF_STATUS
-target_if_register_scan_tx_ops(struct wlan_lmac_if_scan_tx_ops *scan);
+target_if_scan_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops);
 
 /**
  * target_if_scan_set_max_active_scans() - lmac handler to set max active scans

+ 10 - 2
target_if/scan/src/target_if_scan.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 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
@@ -342,8 +342,16 @@ target_if_scan_cancel(struct wlan_objmgr_psoc *psoc,
 }
 
 QDF_STATUS
-target_if_register_scan_tx_ops(struct wlan_lmac_if_scan_tx_ops *scan)
+target_if_scan_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops)
 {
+	struct wlan_lmac_if_scan_tx_ops *scan;
+
+	scan = &tx_ops->scan;
+	if (!scan) {
+		target_if_err("Scan txops NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	scan->scan_start = target_if_scan_start;
 	scan->scan_cancel = target_if_scan_cancel;
 	scan->pno_start = target_if_pno_start;

+ 8 - 0
umac/scan/dispatcher/src/wlan_scan_tgt_api.c

@@ -45,6 +45,10 @@ wlan_vdev_get_scan_txops(struct wlan_objmgr_vdev *vdev)
 	struct wlan_objmgr_psoc *psoc = NULL;
 
 	psoc = wlan_vdev_get_psoc(vdev);
+	if (!psoc) {
+		scm_err("NULL psoc");
+		return NULL;
+	}
 
 	return wlan_psoc_get_scan_txops(psoc);
 }
@@ -55,6 +59,10 @@ wlan_vdev_get_scan_rxops(struct wlan_objmgr_vdev *vdev)
 	struct wlan_objmgr_psoc *psoc = NULL;
 
 	psoc = wlan_vdev_get_psoc(vdev);
+	if (!psoc) {
+		scm_err("NULL psoc");
+		return NULL;
+	}
 
 	return &((psoc->soc_cb.rx_ops.scan));
 }