From 6e19edc1e487ef1f63408b90a6deb48503effc58 Mon Sep 17 00:00:00 2001 From: akosigi Date: Fri, 3 Nov 2017 11:36:32 +0530 Subject: [PATCH] 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 --- target_if/core/src/target_if_main.c | 5 +---- target_if/scan/inc/target_if_scan.h | 8 ++++---- target_if/scan/src/target_if_scan.c | 12 ++++++++++-- umac/scan/dispatcher/src/wlan_scan_tgt_api.c | 8 ++++++++ 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/target_if/core/src/target_if_main.c b/target_if/core/src/target_if_main.c index 12609053629e..3a8a924ab2aa 100644 --- a/target_if/core/src/target_if_main.c +++ b/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; } diff --git a/target_if/scan/inc/target_if_scan.h b/target_if/scan/inc/target_if_scan.h index 4662e67a5860..62f5186f1ac1 100644 --- a/target_if/scan/inc/target_if_scan.h +++ b/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 diff --git a/target_if/scan/src/target_if_scan.c b/target_if/scan/src/target_if_scan.c index 665d4f45af14..10813f02459c 100644 --- a/target_if/scan/src/target_if_scan.c +++ b/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; diff --git a/umac/scan/dispatcher/src/wlan_scan_tgt_api.c b/umac/scan/dispatcher/src/wlan_scan_tgt_api.c index ed19044bbb13..0b3077e7be60 100644 --- a/umac/scan/dispatcher/src/wlan_scan_tgt_api.c +++ b/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)); }