diff options
author | sheenam monga <shebala@codeaurora.org> | 2021-01-15 18:52:11 +0530 |
---|---|---|
committer | Victor Hsu <hsuvictor@google.com> | 2021-02-05 08:45:52 +0000 |
commit | 50b4982f60ab8784e82c1cd779cdd50dd1ebbebe (patch) | |
tree | 00e608ef283e3d82eff86a126ec7d88aaea42b23 | |
parent | 13e3775ec017b2fe8555b32484b1d4a72001a83c (diff) | |
download | qcacld-50b4982f60ab8784e82c1cd779cdd50dd1ebbebe.tar.gz |
qcacld-3.0: Dump blacklist bssids
Add dump to print blacklisted bssids
with reason code and source.
Bug: 163096808
Change-Id: I85734ad5aea0c8088e3f8ed2bdbb31971457942d
CRs-Fixed: 2849487
Signed-off-by: Victor Hsu <hsuvictor@google.com>
9 files changed, 126 insertions, 9 deletions
diff --git a/components/blacklist_mgr/core/inc/wlan_blm_core.h b/components/blacklist_mgr/core/inc/wlan_blm_core.h index a89c8e5457..6dba887634 100644 --- a/components/blacklist_mgr/core/inc/wlan_blm_core.h +++ b/components/blacklist_mgr/core/inc/wlan_blm_core.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2021 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 @@ -265,6 +265,14 @@ blm_get_bssid_reject_list(struct wlan_objmgr_pdev *pdev, enum blm_reject_ap_type reject_ap_type); /** + * blm_dump_blacklist_bssid - Dump blacklisted bssids + * @pdev: pdev object + * + * Return: None + */ +void blm_dump_blacklist_bssid(struct wlan_objmgr_pdev *pdev); + +/** * blm_get_rssi_blacklist_threshold() - Get rssi blacklist threshold value * @pdev: pdev object * diff --git a/components/blacklist_mgr/core/inc/wlan_blm_main.h b/components/blacklist_mgr/core/inc/wlan_blm_main.h index 7a290c06ec..d046eeecff 100644 --- a/components/blacklist_mgr/core/inc/wlan_blm_main.h +++ b/components/blacklist_mgr/core/inc/wlan_blm_main.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 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 @@ -37,6 +37,8 @@ QDF_TRACE_INFO(QDF_MODULE_ID_BLACKLIST_MGR, params) #define blm_debug(params...)\ QDF_TRACE_DEBUG(QDF_MODULE_ID_BLACKLIST_MGR, params) +#define blm_nofl_debug(params...)\ + QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_BLACKLIST_MGR, params) /** * struct blm_pdev_priv_obj - Pdev priv struct to store list of blacklist mgr. diff --git a/components/blacklist_mgr/core/src/wlan_blm_core.c b/components/blacklist_mgr/core/src/wlan_blm_core.c index 06a0011c6f..6066a07e3a 100644 --- a/components/blacklist_mgr/core/src/wlan_blm_core.c +++ b/components/blacklist_mgr/core/src/wlan_blm_core.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2021 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 @@ -617,6 +617,77 @@ blm_remove_lowest_delta_entry(qdf_list_t *reject_ap_list, return QDF_STATUS_E_FAILURE; } +static enum blm_reject_ap_type +blm_get_reject_ap_type(struct blm_reject_ap *blm_entry) +{ + if (BLM_IS_AP_AVOIDED_BY_USERSPACE(blm_entry)) + return USERSPACE_AVOID_TYPE; + if (BLM_IS_AP_BLACKLISTED_BY_USERSPACE(blm_entry)) + return USERSPACE_BLACKLIST_TYPE; + if (BLM_IS_AP_AVOIDED_BY_DRIVER(blm_entry)) + return DRIVER_AVOID_TYPE; + if (BLM_IS_AP_BLACKLISTED_BY_DRIVER(blm_entry)) + return DRIVER_BLACKLIST_TYPE; + if (BLM_IS_AP_IN_RSSI_REJECT_LIST(blm_entry)) + return DRIVER_RSSI_REJECT_TYPE; + if (BLM_IS_AP_IN_MONITOR_LIST(blm_entry)) + return DRIVER_MONITOR_TYPE; + + return REJECT_REASON_UNKNOWN; +} + +void blm_dump_blacklist_bssid(struct wlan_objmgr_pdev *pdev) +{ + struct blm_reject_ap *blm_entry = NULL; + qdf_list_node_t *cur_node = NULL, *next_node = NULL; + struct blm_pdev_priv_obj *blm_ctx; + struct blm_psoc_priv_obj *blm_psoc_obj; + uint32_t reject_duration; + enum blm_reject_ap_type reject_ap_type; + qdf_list_t *reject_db_list; + QDF_STATUS status; + + blm_ctx = blm_get_pdev_obj(pdev); + blm_psoc_obj = blm_get_psoc_obj(wlan_pdev_get_psoc(pdev)); + + if (!blm_ctx || !blm_psoc_obj) { + blm_err("blm_ctx or blm_psoc_obj is NULL"); + return; + } + + status = qdf_mutex_acquire(&blm_ctx->reject_ap_list_lock); + if (QDF_IS_STATUS_ERROR(status)) { + blm_err("failed to acquire reject_ap_list_lock"); + return; + } + + reject_db_list = &blm_ctx->reject_ap_list; + qdf_list_peek_front(reject_db_list, &cur_node); + while (cur_node) { + qdf_list_peek_next(reject_db_list, cur_node, &next_node); + + blm_entry = qdf_container_of(cur_node, struct blm_reject_ap, + node); + + reject_ap_type = blm_get_reject_ap_type(blm_entry); + + reject_duration = blm_get_delta_of_bssid( + reject_ap_type, blm_entry, + &blm_psoc_obj->blm_cfg); + + blm_nofl_debug("BLACKLIST BSSID %pM type %d retry delay %d expected RSSI %d", + blm_entry->bssid.bytes, + reject_ap_type, + reject_duration, + blm_entry->rssi_reject_params.expected_rssi); + + cur_node = next_node; + next_node = NULL; + } + + qdf_mutex_release(&blm_ctx->reject_ap_list_lock); +} + static void blm_fill_reject_list(qdf_list_t *reject_db_list, struct reject_ap_config_params *reject_list, uint8_t *num_of_reject_bssid, diff --git a/components/blacklist_mgr/dispatcher/inc/wlan_blm_api.h b/components/blacklist_mgr/dispatcher/inc/wlan_blm_api.h index 75ba78d04e..16149a5c15 100644 --- a/components/blacklist_mgr/dispatcher/inc/wlan_blm_api.h +++ b/components/blacklist_mgr/dispatcher/inc/wlan_blm_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 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 @@ -104,6 +104,18 @@ wlan_blm_get_bssid_reject_list(struct wlan_objmgr_pdev *pdev, } /** + * wlan_blm_dump_blcklist_bssid() - dump the blacklisted BSSIDs from BLM + * @pdev: pdev object + * + * Return: None + */ +static inline void +wlan_blm_dump_blcklist_bssid(struct wlan_objmgr_pdev *pdev) +{ + return blm_dump_blacklist_bssid(pdev); +} + +/** * wlan_blm_get_rssi_blacklist_threshold() - Get the RSSI blacklist threshold * @pdev: pdev object * diff --git a/components/blacklist_mgr/dispatcher/inc/wlan_blm_public_struct.h b/components/blacklist_mgr/dispatcher/inc/wlan_blm_public_struct.h index 6bc2b052ae..f6b8b044e3 100644 --- a/components/blacklist_mgr/dispatcher/inc/wlan_blm_public_struct.h +++ b/components/blacklist_mgr/dispatcher/inc/wlan_blm_public_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 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 @@ -46,6 +46,7 @@ struct blm_rssi_disallow_params { * @DRIVER_BLACKLIST_TYPE: driver wants the AP to be blacklisted. * @DRIVER_RSSI_REJECT_TYPE: driver wants the AP to be in driver rssi reject. * @DRIVER_MONITOR_TYPE: driver wants the AP to be in monitor list. + * @REJECT_REASON_UNKNOWN: Rejection reason unknown */ enum blm_reject_ap_type { USERSPACE_AVOID_TYPE = 0, @@ -53,7 +54,8 @@ enum blm_reject_ap_type { DRIVER_AVOID_TYPE = 2, DRIVER_BLACKLIST_TYPE = 3, DRIVER_RSSI_REJECT_TYPE = 4, - DRIVER_MONITOR_TYPE = 5 + DRIVER_MONITOR_TYPE = 5, + REJECT_REASON_UNKNOWN = 6, }; /** diff --git a/components/blacklist_mgr/dispatcher/inc/wlan_blm_ucfg_api.h b/components/blacklist_mgr/dispatcher/inc/wlan_blm_ucfg_api.h index a6cd763531..b4c9d6118f 100644 --- a/components/blacklist_mgr/dispatcher/inc/wlan_blm_ucfg_api.h +++ b/components/blacklist_mgr/dispatcher/inc/wlan_blm_ucfg_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 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 @@ -84,6 +84,16 @@ ucfg_blm_add_userspace_black_list(struct wlan_objmgr_pdev *pdev, uint8_t num_of_bssid); /** + * ucfg_blm_dump_black_list_ap() - get blacklisted bssid. + * @pdev: pdev object + * + * This API dumps blacklist ap + * + * Return: None + */ +void ucfg_blm_dump_black_list_ap(struct wlan_objmgr_pdev *pdev); + +/** * ucfg_blm_update_bssid_connect_params() - Inform the BLM about connect or * disconnect with the current AP. * @pdev: pdev object @@ -154,6 +164,10 @@ QDF_STATUS ucfg_blm_psoc_close(struct wlan_objmgr_psoc *psoc) } static inline +void ucfg_blm_dump_black_list_ap(struct wlan_objmgr_pdev *pdev) +{} + +static inline QDF_STATUS ucfg_blm_add_bssid_to_reject_list(struct wlan_objmgr_pdev *pdev, struct reject_ap_info *ap_info) diff --git a/components/blacklist_mgr/dispatcher/src/wlan_blm_ucfg_api.c b/components/blacklist_mgr/dispatcher/src/wlan_blm_ucfg_api.c index b53d5f3ddb..22cded7a44 100644 --- a/components/blacklist_mgr/dispatcher/src/wlan_blm_ucfg_api.c +++ b/components/blacklist_mgr/dispatcher/src/wlan_blm_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 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 @@ -133,6 +133,12 @@ ucfg_blm_add_userspace_black_list(struct wlan_objmgr_pdev *pdev, } void +ucfg_blm_dump_black_list_ap(struct wlan_objmgr_pdev *pdev) +{ + return wlan_blm_dump_blcklist_bssid(pdev); +} + +void ucfg_blm_update_bssid_connect_params(struct wlan_objmgr_pdev *pdev, struct qdf_mac_addr bssid, enum blm_connection_state con_state) diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index a3372078a5..91dfd10c36 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021 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 diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 26e609747e..c35867e2be 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -19949,6 +19949,8 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, else if (bssid_hint) bssid = bssid_hint; + ucfg_blm_dump_black_list_ap(hdd_ctx->pdev); + if (bssid && hdd_get_adapter_by_macaddr(hdd_ctx, (uint8_t *)bssid)) { hdd_err("adapter exist with same mac address " QDF_MAC_ADDR_STR, QDF_MAC_ADDR_ARRAY(bssid)); |