qcacmn: Cleanup unused TWT APIs & validation checks

PSOC null sanity check is done in caller, but again done in few
callee APIs.

Remove the duplicate sanity checks and unused TWT API.

Change-Id: Iac485bdce27be41c0d7152de1c86626edb534d11
CRs-Fixed: 3402622
This commit is contained in:
Pragaspathi Thilagaraj
2023-02-10 12:04:29 +05:30
zatwierdzone przez Madan Koyyalamudi
rodzic fadf69f0d9
commit 28a0436d35
7 zmienionych plików z 15 dodań i 169 usunięć

Wyświetl plik

@@ -31,11 +31,6 @@ target_if_twt_register_events(struct wlan_objmgr_psoc *psoc)
QDF_STATUS status; QDF_STATUS status;
struct wmi_unified *wmi_handle; struct wmi_unified *wmi_handle;
if (!psoc) {
target_if_err("psoc obj is null!");
return QDF_STATUS_E_NULL_VALUE;
}
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
if (!wmi_handle) { if (!wmi_handle) {
target_if_err("wmi_handle is null!"); target_if_err("wmi_handle is null!");
@@ -151,15 +146,8 @@ QDF_STATUS
target_if_twt_set_twt_ack_support(struct wlan_objmgr_psoc *psoc, target_if_twt_set_twt_ack_support(struct wlan_objmgr_psoc *psoc,
bool val) bool val)
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc =
wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_TWT);
if (!psoc) {
target_if_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
target_if_err("null twt psoc priv obj"); target_if_err("null twt psoc priv obj");
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;

Wyświetl plik

@@ -30,11 +30,6 @@ wlan_twt_tgt_caps_get_responder(struct wlan_objmgr_psoc *psoc, bool *val)
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -46,39 +41,12 @@ wlan_twt_tgt_caps_get_responder(struct wlan_objmgr_psoc *psoc, bool *val)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
QDF_STATUS
wlan_twt_tgt_caps_get_legacy_bcast_support(struct wlan_objmgr_psoc *psoc,
bool *val)
{
struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT);
if (!twt_psoc) {
twt_err("null twt psoc priv obj");
return QDF_STATUS_E_FAILURE;
}
*val = twt_psoc->twt_caps.legacy_bcast_twt_support;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS QDF_STATUS
wlan_twt_tgt_caps_get_nudge_enabled(struct wlan_objmgr_psoc *psoc, wlan_twt_tgt_caps_get_nudge_enabled(struct wlan_objmgr_psoc *psoc,
bool *val) bool *val)
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -96,11 +64,6 @@ wlan_twt_tgt_caps_get_all_twt_enabled(struct wlan_objmgr_psoc *psoc,
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -118,11 +81,6 @@ wlan_twt_tgt_caps_get_stats_enabled(struct wlan_objmgr_psoc *psoc,
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -161,12 +119,6 @@ wlan_twt_tgt_caps_get_ack_supported(struct wlan_objmgr_psoc *psoc,
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
*val = false;
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -208,11 +160,6 @@ wlan_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -239,11 +186,6 @@ wlan_twt_responder_disable(struct wlan_objmgr_psoc *psoc,
{ {
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -271,11 +213,6 @@ wlan_twt_requestor_enable(struct wlan_objmgr_psoc *psoc,
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
bool requestor_en = false, twt_bcast_requestor = false; bool requestor_en = false, twt_bcast_requestor = false;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -317,11 +254,6 @@ wlan_twt_responder_enable(struct wlan_objmgr_psoc *psoc,
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
bool responder_en = false, twt_bcast_responder = false; bool responder_en = false, twt_bcast_responder = false;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -429,11 +361,6 @@ wlan_twt_enable_event_handler(struct wlan_objmgr_psoc *psoc,
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
struct twt_en_dis_context *twt_context; struct twt_en_dis_context *twt_context;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {
@@ -473,11 +400,6 @@ wlan_twt_disable_event_handler(struct wlan_objmgr_psoc *psoc,
struct twt_psoc_priv_obj *twt_psoc; struct twt_psoc_priv_obj *twt_psoc;
struct twt_en_dis_context *twt_context; struct twt_en_dis_context *twt_context;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_FAILURE;
}
twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, twt_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TWT); WLAN_UMAC_COMP_TWT);
if (!twt_psoc) { if (!twt_psoc) {

Wyświetl plik

@@ -31,17 +31,6 @@
QDF_STATUS QDF_STATUS
wlan_twt_tgt_caps_get_responder(struct wlan_objmgr_psoc *psoc, bool *val); wlan_twt_tgt_caps_get_responder(struct wlan_objmgr_psoc *psoc, bool *val);
/**
* wlan_twt_tgt_caps_get_legacy_bcast_support() - get legacy bcast support
* @psoc: psoc handle
* @val: pointer to the output variable
*
* return: QDF_STATUS
*/
QDF_STATUS
wlan_twt_tgt_caps_get_legacy_bcast_support(struct wlan_objmgr_psoc *psoc,
bool *val);
/** /**
* wlan_twt_tgt_caps_get_bcast_req_support() - get bcast requestor support * wlan_twt_tgt_caps_get_bcast_req_support() - get bcast requestor support
* @psoc: psoc handle * @psoc: psoc handle

Wyświetl plik

@@ -36,17 +36,6 @@
QDF_STATUS QDF_STATUS
ucfg_twt_get_responder(struct wlan_objmgr_psoc *psoc, bool *val); ucfg_twt_get_responder(struct wlan_objmgr_psoc *psoc, bool *val);
/**
* ucfg_twt_get_legacy_bcast_twt_support() - get legacy bcast support
* @psoc: psoc handle
* @val: pointer to the output variable
*
* return: QDF_STATUS
*/
QDF_STATUS
ucfg_twt_get_legacy_bcast_twt_support(struct wlan_objmgr_psoc *psoc,
bool *val);
/** /**
* ucfg_twt_get_twt_nudge_enabled() - get twt nudge enabled * ucfg_twt_get_twt_nudge_enabled() - get twt nudge enabled
* @psoc: psoc handle * @psoc: psoc handle

Wyświetl plik

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -28,11 +28,6 @@ wlan_twt_get_tx_ops(struct wlan_objmgr_psoc *psoc)
{ {
struct wlan_lmac_if_tx_ops *tx_ops; struct wlan_lmac_if_tx_ops *tx_ops;
if (!psoc) {
twt_err("psoc is null");
return NULL;
}
tx_ops = wlan_psoc_get_lmac_if_txops(psoc); tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
if (!tx_ops) { if (!tx_ops) {
twt_err("tx_ops is NULL"); twt_err("tx_ops is NULL");
@@ -47,11 +42,6 @@ wlan_twt_get_rx_ops(struct wlan_objmgr_psoc *psoc)
{ {
struct wlan_lmac_if_rx_ops *rx_ops; struct wlan_lmac_if_rx_ops *rx_ops;
if (!psoc) {
twt_err("psoc is null");
return NULL;
}
rx_ops = wlan_psoc_get_lmac_if_rxops(psoc); rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
if (!rx_ops) { if (!rx_ops) {
twt_err("rx_ops is NULL"); twt_err("rx_ops is NULL");
@@ -220,18 +210,14 @@ QDF_STATUS twt_psoc_enable(struct wlan_objmgr_psoc *psoc)
struct wlan_lmac_if_twt_tx_ops *tx_ops; struct wlan_lmac_if_twt_tx_ops *tx_ops;
tx_ops = wlan_twt_get_tx_ops(psoc); tx_ops = wlan_twt_get_tx_ops(psoc);
if (!tx_ops) { if (!tx_ops || !tx_ops->register_events) {
twt_err("tx_ops is null"); twt_err("%s is null", !tx_ops ? "tx_ops" : "register_events");
return QDF_STATUS_E_NULL_VALUE; return QDF_STATUS_E_NULL_VALUE;
} }
if (tx_ops->register_events) { status = tx_ops->register_events(psoc);
status = tx_ops->register_events(psoc); if (QDF_IS_STATUS_ERROR(status))
twt_err("twt_register_events failed (status=%d)", status);
if (QDF_IS_STATUS_ERROR(status))
twt_err("twt_register_events failed (status=%d)",
status);
}
return status; return status;
} }
@@ -242,18 +228,16 @@ QDF_STATUS twt_psoc_disable(struct wlan_objmgr_psoc *psoc)
struct wlan_lmac_if_twt_tx_ops *tx_ops; struct wlan_lmac_if_twt_tx_ops *tx_ops;
tx_ops = wlan_twt_get_tx_ops(psoc); tx_ops = wlan_twt_get_tx_ops(psoc);
if (!tx_ops) { if (!tx_ops || !tx_ops->deregister_events) {
twt_err("tx_ops is null"); twt_err("%s is null", !tx_ops ? "tx_ops" : "deregister_events");
return QDF_STATUS_E_NULL_VALUE; return QDF_STATUS_E_NULL_VALUE;
} }
if (tx_ops->deregister_events) { status = tx_ops->deregister_events(psoc);
status = tx_ops->deregister_events(psoc); if (QDF_IS_STATUS_ERROR(status))
twt_err("twt_deregister_events failed (status=%d)",
status);
if (QDF_IS_STATUS_ERROR(status))
twt_err("twt_deregister_events failed (status=%d)",
status);
}
return status; return status;
} }

Wyświetl plik

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -35,16 +35,6 @@ tgt_twt_enable_req_send(struct wlan_objmgr_psoc *psoc,
struct wlan_lmac_if_twt_tx_ops *tx_ops; struct wlan_lmac_if_twt_tx_ops *tx_ops;
QDF_STATUS status; QDF_STATUS status;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_INVAL;
}
if (!req) {
twt_err("Invalid input");
return QDF_STATUS_E_INVAL;
}
tx_ops = wlan_twt_get_tx_ops(psoc); tx_ops = wlan_twt_get_tx_ops(psoc);
if (!tx_ops || !tx_ops->enable_req) { if (!tx_ops || !tx_ops->enable_req) {
twt_err("twt enable_req tx_ops is null"); twt_err("twt enable_req tx_ops is null");
@@ -67,16 +57,6 @@ tgt_twt_disable_req_send(struct wlan_objmgr_psoc *psoc,
struct wlan_lmac_if_twt_tx_ops *tx_ops; struct wlan_lmac_if_twt_tx_ops *tx_ops;
QDF_STATUS status; QDF_STATUS status;
if (!psoc) {
twt_err("null psoc");
return QDF_STATUS_E_INVAL;
}
if (!req) {
twt_err("Invalid input");
return QDF_STATUS_E_INVAL;
}
tx_ops = wlan_twt_get_tx_ops(psoc); tx_ops = wlan_twt_get_tx_ops(psoc);
if (!tx_ops || !tx_ops->disable_req) { if (!tx_ops || !tx_ops->disable_req) {
twt_err("twt disable_req tx_ops is null"); twt_err("twt disable_req tx_ops is null");

Wyświetl plik

@@ -26,12 +26,6 @@ QDF_STATUS ucfg_twt_get_responder(struct wlan_objmgr_psoc *psoc, bool *val)
return wlan_twt_tgt_caps_get_responder(psoc, val); return wlan_twt_tgt_caps_get_responder(psoc, val);
} }
QDF_STATUS ucfg_twt_get_legacy_bcast_twt_support(struct wlan_objmgr_psoc *psoc,
bool *val)
{
return wlan_twt_tgt_caps_get_legacy_bcast_support(psoc, val);
}
QDF_STATUS ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_twt_get_twt_nudge_enabled(struct wlan_objmgr_psoc *psoc,
bool *val) bool *val)
{ {