diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-05-29 02:12:20 -0600 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2018-05-29 02:12:20 -0600 |
| commit | 9f33afdb87f61a8ecb5cdcf1db0fd4921b7dd7ef (patch) | |
| tree | 3cf98f6cf34f38542ba5870a6e2bce9d8f07bcfc | |
| parent | 7f6d9e32b55553d1baadf0da238f7fddc9551026 (diff) | |
| parent | 32a974b2245697c36ce3cdd4df0475173f70e0e6 (diff) | |
Merge 32a974b2245697c36ce3cdd4df0475173f70e0e6 on remote branch
Change-Id: I575b0757bfc071ddfbb829f3ce473b36ae81d91f
441 files changed, 8070 insertions, 7720 deletions
@@ -59,7 +59,7 @@ ifeq ($(KERNEL_BUILD), 0) CONFIG_MOBILE_ROUTER := y endif - ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y) + ifeq ($(CONFIG_ARCH_SDX24), y) CONFIG_MOBILE_ROUTER := y endif @@ -71,7 +71,7 @@ ifeq ($(KERNEL_BUILD), 0) CONFIG_WLAN_DISABLE_EXPORT_SYMBOL := y endif - ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y) + ifeq ($(CONFIG_ARCH_SDX24), y) CONFIG_WLAN_DISABLE_EXPORT_SYMBOL := y endif diff --git a/core/bmi/inc/bmi.h b/core/bmi/inc/bmi.h index 2adae5d9d77a..920cb5eb34ae 100644 --- a/core/bmi/inc/bmi.h +++ b/core/bmi/inc/bmi.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* ================================================================ */ /* BMI declarations and prototypes */ /* */ diff --git a/core/bmi/inc/ol_fw.h b/core/bmi/inc/ol_fw.h index 5243228970cf..1d6db39a1831 100644 --- a/core/bmi/inc/ol_fw.h +++ b/core/bmi/inc/ol_fw.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_FW_H_ #define _OL_FW_H_ diff --git a/core/bmi/inc/ol_if_athvar.h b/core/bmi/inc/ol_if_athvar.h index afd143899ec2..9be3f6ed48e6 100644 --- a/core/bmi/inc/ol_if_athvar.h +++ b/core/bmi/inc/ol_if_athvar.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * Defintions for the Atheros Wireless LAN controller driver. */ #ifndef _DEV_OL_ATH_ATHVAR_H diff --git a/core/bmi/src/bmi.c b/core/bmi/src/bmi.c index c215e50a9be0..aeba859b2a34 100644 --- a/core/bmi/src/bmi.c +++ b/core/bmi/src/bmi.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "i_bmi.h" #include "cds_api.h" #include "hif.h" diff --git a/core/bmi/src/bmi_1.c b/core/bmi/src/bmi_1.c index 34e483a9c923..b7953eb47d0f 100644 --- a/core/bmi/src/bmi_1.c +++ b/core/bmi/src/bmi_1.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "i_bmi.h" #include "cds_api.h" diff --git a/core/bmi/src/i_ar6320v2_regtable.h b/core/bmi/src/i_ar6320v2_regtable.h index 3f7aa2a8521d..828711238dc4 100644 --- a/core/bmi/src/i_ar6320v2_regtable.h +++ b/core/bmi/src/i_ar6320v2_regtable.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014,2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _AR6320V2_DBG_REGTABLE_H_ #define _AR6320V2_DBG_REGTABLE_H_ diff --git a/core/bmi/src/i_bmi.h b/core/bmi/src/i_bmi.h index 47686aca4064..403a9bed2fe0 100644 --- a/core/bmi/src/i_bmi.h +++ b/core/bmi/src/i_bmi.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,11 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ /* =================================================================== * Internal BMI Header File */ diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index 7d181b290ad5..398b795c1bb7 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <linux/firmware.h> #include "ol_if_athvar.h" #include "targaddrs.h" diff --git a/core/bmi/src/ol_fw_common.c b/core/bmi/src/ol_fw_common.c index 2799ff0aee5a..a665b3bc40da 100644 --- a/core/bmi/src/ol_fw_common.c +++ b/core/bmi/src/ol_fw_common.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2014-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "ol_if_athvar.h" #include "targaddrs.h" #include "ol_cfg.h" @@ -44,6 +35,7 @@ #endif #include "i_bmi.h" #include "cds_api.h" +#include "cds_concurrency.h" #ifdef CONFIG_DISABLE_SLEEP_BMI_OPTION static inline void ol_sdio_disable_sleep(struct ol_context *ol_ctx) @@ -164,8 +156,11 @@ QDF_STATUS ol_sdio_extra_initialization(struct ol_context *ol_ctx) goto exit; } - param |= (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET | - HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE); + param |= HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; + + /* disable swap mailbox for FTM */ + if (cds_get_conparam() != QDF_GLOBAL_FTM_MODE) + param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; if (!cds_is_ptp_tx_opt_enabled()) param |= HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET; diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 97f244402fea..2f08babd8582 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,11 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* -* This file was originally distributed by Qualcomm Atheros, Inc. -* under proprietary terms before Copyright ownership was assigned -* to the Linux Foundation. -*/ #if !defined(__CDS_API_H) #define __CDS_API_H diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index b6361ed00013..61c5aa8610ec 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __CDS_CONCURRENCY_H #define __CDS_CONCURRENCY_H @@ -66,6 +57,8 @@ #define MAX_MAC 2 +struct hdd_adapter_s; + /** * enum hw_mode_ss_config - Possible spatial stream configuration * @SS_0x0: Unused Tx and Rx of MAC @@ -849,6 +842,13 @@ QDF_STATUS qdf_wait_for_connection_update(void); QDF_STATUS qdf_reset_connection_update(void); QDF_STATUS qdf_set_connection_update(void); QDF_STATUS qdf_init_connection_update(void); + +/** + * cds_stop_opportunistic_timer() - Stops opportunistic timer + * + * Return: QDF_STATUS + */ +QDF_STATUS cds_stop_opportunistic_timer(void); QDF_STATUS cds_restart_opportunistic_timer(bool check_state); QDF_STATUS cds_modify_sap_pcl_based_on_mandatory_channel(uint8_t *pcl_list_org, uint8_t *weight_list_org, @@ -865,7 +865,8 @@ QDF_STATUS cds_set_sap_mandatory_channels(uint8_t *channels, uint32_t len); QDF_STATUS cds_reset_sap_mandatory_channels(void); #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH QDF_STATUS cds_register_sap_restart_channel_switch_cb( - void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)); + void (*sap_restart_chan_switch_cb)(struct hdd_adapter_s *, + uint32_t, uint32_t)); QDF_STATUS cds_deregister_sap_restart_channel_switch_cb(void); #endif bool cds_is_any_mode_active_on_band_along_with_session(uint8_t session_id, diff --git a/core/cds/inc/cds_crypto.h b/core/cds/inc/cds_crypto.h index c3da63bca211..0d507be22bb4 100644 --- a/core/cds/inc/cds_crypto.h +++ b/core/cds/inc/cds_crypto.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,11 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ #if !defined(__CDS_CRYPTO_H) #define __CDS_CRYPTO_H diff --git a/core/cds/inc/cds_ieee80211_common.h b/core/cds/inc/cds_ieee80211_common.h index b3c036bea771..dfa19967205e 100644 --- a/core/cds/inc/cds_ieee80211_common.h +++ b/core/cds/inc/cds_ieee80211_common.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011,2014-2015, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef EXTERNAL_USE_ONLY #include "osdep.h" #endif /* EXTERNAL_USE_ONLY */ diff --git a/core/cds/inc/cds_ieee80211_defines.h b/core/cds/inc/cds_ieee80211_defines.h index 3b9be119dd29..f2a643cec5bb 100644 --- a/core/cds/inc/cds_ieee80211_defines.h +++ b/core/cds/inc/cds_ieee80211_defines.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2015, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef CDS_IEEE80211_DEFINES_H_ #define CDS_IEEE80211_DEFINES_H_ diff --git a/core/cds/inc/cds_if_upperproto.h b/core/cds/inc/cds_if_upperproto.h index cef7fc714b1d..26c723b64782 100644 --- a/core/cds/inc/cds_if_upperproto.h +++ b/core/cds/inc/cds_if_upperproto.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* #ifndef _NET_IF_ETHERSUBR_H_ */ /* #define _NET_IF_ETHERSUBR_H_ */ #ifndef _NET_IF_UPPERPROTO_H_ diff --git a/core/cds/inc/cds_mc_timer.h b/core/cds/inc/cds_mc_timer.h index e01937ab1652..83bc6325e97d 100644 --- a/core/cds/inc/cds_mc_timer.h +++ b/core/cds/inc/cds_mc_timer.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: cds_mc_timer.h * diff --git a/core/cds/inc/cds_mq.h b/core/cds/inc/cds_mq.h index 1ab827601e05..eac7aee14326 100644 --- a/core/cds/inc/cds_mq.h +++ b/core/cds/inc/cds_mq.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__CDS_MQ_H) #define __CDS_MQ_H diff --git a/core/cds/inc/cds_packet.h b/core/cds/inc/cds_packet.h index 87a2a7b3941a..07ac3a746a65 100644 --- a/core/cds/inc/cds_packet.h +++ b/core/cds/inc/cds_packet.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__CDS_PKT_H) #define __CDS_PKT_H diff --git a/core/cds/inc/cds_queue.h b/core/cds/inc/cds_queue.h index 030ff2536dde..0487edb355da 100644 --- a/core/cds/inc/cds_queue.h +++ b/core/cds/inc/cds_queue.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _CDS_QUEUE_H #define _CDS_QUEUE_H diff --git a/core/cds/inc/cds_reg_service.h b/core/cds/inc/cds_reg_service.h index b64d9d6763c4..22985ef5ff73 100644 --- a/core/cds/inc/cds_reg_service.h +++ b/core/cds/inc/cds_reg_service.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined __CDS_REG_SERVICE_H #define __CDS_REG_SERVICE_H diff --git a/core/cds/inc/cds_regdomain.h b/core/cds/inc/cds_regdomain.h index 36f077528f2b..d97c734506a4 100644 --- a/core/cds/inc/cds_regdomain.h +++ b/core/cds/inc/cds_regdomain.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * Notifications and licenses are retained for attribution purposes only. */ /* diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h index a5eaeb07a18e..84d7a90035c8 100644 --- a/core/cds/inc/cds_sched.h +++ b/core/cds/inc/cds_sched.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__CDS_SCHED_H) #define __CDS_SCHED_H @@ -248,6 +239,7 @@ typedef struct _cds_msg_wrapper { /* forward-declare hdd_context_s as it is used ina function type */ struct hdd_context_s; +struct hdd_adapter_s; typedef struct _cds_context_type { /* Messages buffers */ cds_msg_t aMsgBuffers[CDS_CORE_MAX_MESSAGES]; @@ -308,7 +300,8 @@ typedef struct _cds_context_type { qdf_mutex_t qdf_conc_list_lock; qdf_mc_timer_t dbs_opportunistic_timer; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH - void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t); + void (*sap_restart_chan_switch_cb)(struct hdd_adapter_s *, + uint32_t, uint32_t); #endif QDF_STATUS (*sme_get_valid_channels)(void*, uint16_t cfg_id, uint8_t *, uint32_t *); diff --git a/core/cds/inc/cds_utils.h b/core/cds/inc/cds_utils.h index 04b15b8ba6b1..00988a8d6562 100644 --- a/core/cds/inc/cds_utils.h +++ b/core/cds/inc/cds_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__CDS_UTILS_H) #define __CDS_UTILS_H diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index c5086b1ae806..a74a43464cda 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: cds_api.c * @@ -2217,6 +2208,9 @@ QDF_STATUS cds_set_log_completion(uint32_t is_fatal, p_cds_context->log_complete.recovery_needed = recovery_needed; p_cds_context->log_complete.is_report_in_progress = true; qdf_spinlock_release(&p_cds_context->bug_report_lock); + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG, + "%s: is_fatal %d ind %d reasn_code %d recovery needed %d", + __func__, is_fatal, indicator, reason_code, recovery_needed); return QDF_STATUS_SUCCESS; } @@ -2781,7 +2775,7 @@ uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context) QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR, "Magic cookie(%x) for adapter sanity verification is invalid", adapter->magic); - return QDF_STATUS_E_FAILURE; + return 0; } return adapter->pkt_type_bitmap; } diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 54d9dea47abc..46e856a5db13 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: cds_concurrency.c * @@ -2952,7 +2943,7 @@ bool cds_is_connection_in_progress(uint8_t *session_id, sme_neighbor_middle_of_roaming( WLAN_HDD_GET_HAL_CTX(adapter), adapter->sessionId)) || - hdd_is_roaming_in_progress(adapter)) { + hdd_is_roaming_in_progress(hdd_ctx)) { cds_debug("%pK(%d) Reassociation in progress", WLAN_HDD_GET_STATION_CTX_PTR(adapter), adapter->sessionId); @@ -3696,6 +3687,8 @@ void cds_set_tdls_ct_mode(hdd_context_t *hdd_ctx) if (hdd_ctx->config->fTDLSExternalControl) { if (hdd_ctx->tdls_external_peer_count) state = true; + else if (hdd_ctx->connected_peer_count >= 1) + state = true; else state = false; } @@ -3866,6 +3859,45 @@ static void cds_pdev_set_pcl(enum tQDF_ADAPTER_MODE mode) #endif /** + * cds_get_qdf_mode_from_cds - provides the + * type translation from policy manager type + * to generic connection mode type + * @device_mode: policy manager mode type + * + * + * This function provides the type translation + * + * Return: tQDF_ADAPTER_MODE enum + */ +static enum tQDF_ADAPTER_MODE cds_get_qdf_mode_from_cds( + enum cds_con_mode device_mode) +{ + enum tQDF_ADAPTER_MODE mode = QDF_MAX_NO_OF_MODE; + + switch (device_mode) { + case CDS_STA_MODE: + mode = QDF_STA_MODE; + break; + case CDS_SAP_MODE: + mode = QDF_SAP_MODE; + break; + case CDS_P2P_CLIENT_MODE: + mode = QDF_P2P_CLIENT_MODE; + break; + case CDS_P2P_GO_MODE: + mode = QDF_P2P_GO_MODE; + break; + case CDS_IBSS_MODE: + mode = QDF_IBSS_MODE; + break; + default: + cds_err("Unsupported cds mode (%d)", + device_mode); + } + return mode; +} + +/** * cds_set_pcl_for_existing_combo() - Set PCL for existing connection * @mode: Connection mode of type 'cds_con_mode' * @@ -3886,26 +3918,9 @@ static void cds_set_pcl_for_existing_combo(enum cds_con_mode mode) cds_err("Invalid CDS Context"); return; } - switch (mode) { - case CDS_STA_MODE: - pcl_mode = QDF_STA_MODE; - break; - case CDS_SAP_MODE: - pcl_mode = QDF_SAP_MODE; - break; - case CDS_P2P_CLIENT_MODE: - pcl_mode = QDF_P2P_CLIENT_MODE; - break; - case CDS_P2P_GO_MODE: - pcl_mode = QDF_P2P_GO_MODE; - break; - case CDS_IBSS_MODE: - pcl_mode = QDF_IBSS_MODE; - break; - default: - cds_err("Invalid mode to set PCL"); + pcl_mode = cds_get_qdf_mode_from_cds(mode); + if (pcl_mode == QDF_MAX_NO_OF_MODE) return; - }; qdf_mutex_acquire(&cds_ctx->qdf_conc_list_lock); if (cds_mode_specific_connection_count(mode, NULL) > 0) { /* Check, store and temp delete the mode's parameter */ @@ -5594,6 +5609,74 @@ uint8_t cds_get_channel(enum cds_con_mode mode, uint32_t *vdev_id) } /** + * cds_is_dbs_allowed_for_concurrency() - If dbs is allowed for current + * concurreny + * @new_conn_mode: new connection mode + * + * When a new connection is about to come up, check if dbs is allowed for + * STA+STA or STA+P2P + * + * Return: true if dbs is allowed for STA+STA or STA+P2P else false + */ +static bool cds_is_dbs_allowed_for_concurrency( + enum tQDF_ADAPTER_MODE new_conn_mode) +{ + hdd_context_t *hdd_ctx; + uint32_t count, dbs_for_sta_sta, dbs_for_sta_p2p; + bool ret = true; + + count = cds_get_connection_count(); + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + cds_err("HDD context is NULL"); + return ret; + } + + if (count != 1) + return ret; + + dbs_for_sta_sta = WMA_CHANNEL_SELECT_LOGIC_STA_STA_GET(hdd_ctx->config-> + channel_select_logic_conc); + dbs_for_sta_p2p = WMA_CHANNEL_SELECT_LOGIC_STA_P2P_GET(hdd_ctx->config-> + channel_select_logic_conc); + + switch (conc_connection_list[0].mode) { + case CDS_STA_MODE: + switch (new_conn_mode) { + case QDF_STA_MODE: + if (!dbs_for_sta_sta) + return false; + break; + case QDF_P2P_DEVICE_MODE: + case QDF_P2P_CLIENT_MODE: + case QDF_P2P_GO_MODE: + if (!dbs_for_sta_p2p) + return false; + break; + default: + break; + } + break; + case CDS_P2P_CLIENT_MODE: + case CDS_P2P_GO_MODE: + switch (new_conn_mode) { + case CDS_STA_MODE: + if (!dbs_for_sta_p2p) + return false; + break; + default: + break; + } + break; + default: + break; + } + + return ret; +} + +/** * cds_get_pcl() - provides the preferred channel list for * new connection * @mode: Device mode @@ -5622,12 +5705,22 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode mode, enum cds_conc_priority_mode conc_system_pref = 0; enum cds_conc_priority_mode cur_conc_system_pref = 0; hdd_context_t *hdd_ctx; + enum tQDF_ADAPTER_MODE qdf_mode; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { cds_err("HDD context is NULL"); return status; } + if ((mode < 0) || (mode >= CDS_MAX_NUM_OF_MODE)) { + cds_err("Incorrect concurrency mode:%d recieved", mode); + return status; + } + + if (mode >= CDS_MAX_NUM_OF_MODE) { + cds_err("requested mode:%d is not supported", mode); + return status; + } /* find the current connection state from conc_connection_list*/ num_connections = cds_get_connection_count(); @@ -5666,7 +5759,11 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode mode, cds_err("couldn't find index for 2nd connection pcl table"); return status; } - if (wma_is_hw_dbs_capable() == true) { + qdf_mode = cds_get_qdf_mode_from_cds(mode); + if (qdf_mode == QDF_MAX_NO_OF_MODE) + return QDF_STATUS_E_FAILURE; + if (wma_is_hw_dbs_capable() == true && + cds_is_dbs_allowed_for_concurrency(qdf_mode)) { pcl = second_connection_pcl_dbs_table [second_index][mode][conc_system_pref]; } else { @@ -5931,13 +6028,30 @@ bool cds_allow_sap_go_concurrency(enum cds_con_mode mode, uint8_t channel) if ((mode == CDS_SAP_MODE || mode == CDS_P2P_GO_MODE) && (sap_cnt || go_cnt)) { - if (!wma_is_dbs_enable()) { - /* Don't allow second SAP/GO interface if DBS is not - * supported */ - cds_debug("DBS is not supported, don't allow second SAP interface"); + if (wma_dual_beacon_on_single_mac_mcc_capable()) + return true; + if (wma_dual_beacon_on_single_mac_scc_capable()) { + for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; + id++) { + if (conc_connection_list[id].in_use) { + con_mode = + conc_connection_list[id].mode; + con_chan = + conc_connection_list[id].chan; + if (((con_mode == CDS_SAP_MODE) || + (con_mode == CDS_P2P_GO_MODE)) && + (channel != con_chan)) { + cds_debug("Scc is supported, but first SAP and second SAP are not in same channel, So don't allow second SAP interface"); + return false; + } + } + } + return true; + } + if (!wma_is_hw_dbs_capable()) { + cds_debug("DBS is not supported, mcc and scc are not supported too, don't allow second SAP interface"); return false; } - /* If DBS is supported then allow second SAP/GO session only if * the freq band of the second SAP/GO interface is different * than the first SAP/GO interface. @@ -6689,74 +6803,6 @@ QDF_STATUS cds_update_and_wait_for_connection_update(uint8_t session_id, } /** - * cds_is_dbs_allowed_for_concurrency() - If dbs is allowed for current - * concurreny - * @new_conn_mode: new connection mode - * - * When a new connection is about to come up, check if dbs is allowed for - * STA+STA or STA+P2P - * - * Return: true if dbs is allowed for STA+STA or STA+P2P else false - */ -static bool cds_is_dbs_allowed_for_concurrency( - enum tQDF_ADAPTER_MODE new_conn_mode) -{ - hdd_context_t *hdd_ctx; - uint32_t count, dbs_for_sta_sta, dbs_for_sta_p2p; - bool ret = true; - - count = cds_get_connection_count(); - - hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); - if (!hdd_ctx) { - cds_err("HDD context is NULL"); - return ret; - } - - if (count != 1) - return ret; - - dbs_for_sta_sta = WMA_CHANNEL_SELECT_LOGIC_STA_STA_GET(hdd_ctx->config-> - channel_select_logic_conc); - dbs_for_sta_p2p = WMA_CHANNEL_SELECT_LOGIC_STA_P2P_GET(hdd_ctx->config-> - channel_select_logic_conc); - - switch (conc_connection_list[0].mode) { - case CDS_STA_MODE: - switch (new_conn_mode) { - case QDF_STA_MODE: - if (!dbs_for_sta_sta) - return false; - break; - case QDF_P2P_DEVICE_MODE: - case QDF_P2P_CLIENT_MODE: - case QDF_P2P_GO_MODE: - if (!dbs_for_sta_p2p) - return false; - break; - default: - break; - } - break; - case CDS_P2P_CLIENT_MODE: - case CDS_P2P_GO_MODE: - switch (new_conn_mode) { - case CDS_STA_MODE: - if (!dbs_for_sta_p2p) - return false; - break; - default: - break; - } - break; - default: - break; - } - - return ret; -} - -/** * cds_current_connections_update() - initiates actions * needed on current connections once channel has been decided * for the new connection @@ -9340,6 +9386,23 @@ static enum cds_conc_next_action cds_get_current_pref_hw_mode(void) } +QDF_STATUS cds_stop_opportunistic_timer(void) +{ + p_cds_contextType cds_ctx; + + cds_ctx = cds_get_global_context(); + if (!cds_ctx) { + cds_err("Invalid CDS context"); + return QDF_STATUS_E_FAILURE; + } + + if (cds_ctx->dbs_opportunistic_timer.state != QDF_TIMER_STATE_RUNNING) + return QDF_STATUS_SUCCESS; + + qdf_mc_timer_stop(&cds_ctx->dbs_opportunistic_timer); + return QDF_STATUS_SUCCESS; +} + /** * cds_restart_opportunistic_timer() - Restarts opportunistic timer * @check_state: check timer state if this flag is set, else restart @@ -9393,7 +9456,8 @@ QDF_STATUS cds_restart_opportunistic_timer(bool check_state) * Return: QDF_STATUS */ QDF_STATUS cds_register_sap_restart_channel_switch_cb( - void (*sap_restart_chan_switch_cb)(void *, uint32_t, uint32_t)) + void (*sap_restart_chan_switch_cb)(struct hdd_adapter_s *, + uint32_t, uint32_t)) { p_cds_contextType cds_ctx; @@ -9651,27 +9715,9 @@ QDF_STATUS cds_get_nss_for_vdev(enum cds_con_mode mode, cds_context_type *cds_ctx; enum tQDF_ADAPTER_MODE dev_mode; - switch (mode) { - case CDS_STA_MODE: - dev_mode = QDF_STA_MODE; - break; - case CDS_SAP_MODE: - dev_mode = QDF_SAP_MODE; - break; - case CDS_P2P_CLIENT_MODE: - dev_mode = QDF_P2P_CLIENT_MODE; - break; - case CDS_P2P_GO_MODE: - dev_mode = QDF_P2P_GO_MODE; - break; - case CDS_IBSS_MODE: - dev_mode = QDF_IBSS_MODE; - break; - default: - cds_err("Invalid mode to get allowed NSS value"); + dev_mode = cds_get_qdf_mode_from_cds(mode); + if (dev_mode == QDF_MAX_NO_OF_MODE) return QDF_STATUS_E_FAILURE; - }; - hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { cds_err("HDD context is NULL"); @@ -10125,7 +10171,13 @@ QDF_STATUS cds_valid_sap_conc_channel_check(uint8_t *con_ch, uint8_t sap_ch) uint8_t channel = *con_ch; uint8_t temp_channel = 0; bool sta_sap_scc_on_dfs_chan; + hdd_context_t *hdd_ctx; + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + cds_err("HDD context is NULL"); + return QDF_STATUS_E_FAILURE; + } /* * if force SCC is set, Check if conc channel is DFS * or passive or part of LTE avoided channel list. @@ -10151,7 +10203,8 @@ QDF_STATUS cds_valid_sap_conc_channel_check(uint8_t *con_ch, uint8_t sap_ch) if (cds_valid_sta_channel_check(channel)) { if (CDS_IS_DFS_CH(channel) || CDS_IS_PASSIVE_OR_DISABLE_CH(channel) || - !cds_is_safe_channel(channel)) { + !(hdd_ctx->config->sta_sap_scc_on_lte_coex_chan || + cds_is_safe_channel(channel))) { if (wma_is_hw_dbs_capable()) { temp_channel = cds_get_alternate_channel_for_sap(); diff --git a/core/cds/src/cds_ieee80211_common_i.h b/core/cds/src/cds_ieee80211_common_i.h index 72d4f36e9122..e98374607ea6 100644 --- a/core/cds/src/cds_ieee80211_common_i.h +++ b/core/cds/src/cds_ieee80211_common_i.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef CDS_COMMON__IEEE80211_I_H_ #define CDS_COMMON__IEEE80211_I_H_ diff --git a/core/cds/src/cds_mc_timer.c b/core/cds/src/cds_mc_timer.c index 4ff88a61eb38..47d9ce0000df 100644 --- a/core/cds/src/cds_mc_timer.c +++ b/core/cds/src/cds_mc_timer.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: cds_mc_timer.c * Connectivity driver services timer APIs diff --git a/core/cds/src/cds_mq.c b/core/cds/src/cds_mq.c index 150b6eab115f..d571b0fd91da 100644 --- a/core/cds/src/cds_mq.c +++ b/core/cds/src/cds_mq.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: cds_mq.c * diff --git a/core/cds/src/cds_packet.c b/core/cds/src/cds_packet.c index b1d1191e513f..27ff8755f47e 100644 --- a/core/cds/src/cds_packet.c +++ b/core/cds/src/cds_packet.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \file cds_packet.c diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c index 5e8cc979950d..89dceffed3d8 100644 --- a/core/cds/src/cds_reg_service.c +++ b/core/cds/src/cds_reg_service.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*============================================================================ FILE: cds_reg_service.c OVERVIEW: This source file contains definitions for CDS regulatory APIs @@ -648,14 +639,20 @@ QDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr, hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, + "hdd_ctx is NULL"); + return QDF_STATUS_E_ENXIO; + } + if (cds_is_driver_unloading()) { hdd_err("Driver is unloading can not open the hdd"); - return -EBUSY; + return QDF_STATUS_E_BUSY; } if (cds_is_driver_recovering()) { hdd_err("WLAN is currently recovering; Please try again."); - return -EBUSY; + return QDF_STATUS_E_BUSY; } if (NULL == reg_domain_ptr) { diff --git a/core/cds/src/cds_regdomain.c b/core/cds/src/cds_regdomain.c index 5116f920572b..9fa18ced76d6 100644 --- a/core/cds/src/cds_regdomain.c +++ b/core/cds/src/cds_regdomain.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011,2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * Notifications and licenses are retained for attribution purposes only. */ /* diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index 5b9a8d765a6a..0846c27bfea0 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * File: cds_sched.c * @@ -619,7 +610,7 @@ static void cds_mc_thread_watchdog_notify(cds_msg_t *msg) } #ifdef CONFIG_SLUB_DEBUG_ON -static void cds_mc_thread_watchdog_timeout(void *arg) +static void cds_mc_thread_watchdog_timeout(unsigned long arg) { cds_msg_t *msg = *(cds_msg_t **)arg; @@ -639,7 +630,7 @@ static void cds_mc_thread_watchdog_timeout(void *arg) QDF_BUG(0); } #else -static inline void cds_mc_thread_watchdog_timeout(void *arg) +static inline void cds_mc_thread_watchdog_timeout(unsigned long arg) { cds_msg_t *msg = *(cds_msg_t **)arg; diff --git a/core/cds/src/cds_utils.c b/core/cds/src/cds_utils.c index cde0bb46c6c4..fdb9affec658 100644 --- a/core/cds/src/cds_utils.c +++ b/core/cds/src/cds_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*============================================================================ FILE: cds_utils.c @@ -607,7 +598,8 @@ bool cds_is_gmac_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, { struct ieee80211_mmie_16 *mmie; struct ieee80211_frame *wh; - uint8_t rx_ipn[6], aad[AAD_LEN], mic[IEEE80211_MMIE_GMAC_MICLEN]; + uint8_t rx_ipn[6], aad[AAD_LEN]; + uint8_t mic[IEEE80211_MMIE_GMAC_MICLEN] = {0}; uint16_t data_len; uint8_t gmac_nonce[GMAC_NONCE_LEN]; uint8_t iv[AES_BLOCK_SIZE] = {0}; diff --git a/core/cds/src/i_cds_packet.h b/core/cds/src/i_cds_packet.h index 2f338c6c9d0c..be71765b860d 100644 --- a/core/cds/src/i_cds_packet.h +++ b/core/cds/src/i_cds_packet.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016, 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__I_CDS_PACKET_H) #define __I_CDS_PACKET_H diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c index b717491c29c7..cc7af9396adf 100644 --- a/core/dp/htt/htt.c +++ b/core/dp/htt/htt.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file htt.c * @brief Provide functions to create+init and destroy a HTT instance. diff --git a/core/dp/htt/htt_fw_stats.c b/core/dp/htt/htt_fw_stats.c index 47d22a958e39..b2434f48c118 100644 --- a/core/dp/htt/htt_fw_stats.c +++ b/core/dp/htt/htt_fw_stats.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file htt_fw_stats.c * @brief Provide functions to process FW status retrieved from FW. @@ -841,14 +832,37 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr, { int i; int record_size; + int calculated_record_size; int num_records; - record_size = - sizeof(*record) + - hdr->mpdu_bytes_array_len * sizeof(uint16_t) + - hdr->mpdu_msdus_array_len * sizeof(uint8_t) + - hdr->msdu_bytes_array_len * sizeof(uint16_t); + record_size = sizeof(*record); + calculated_record_size = record_size + + hdr->mpdu_bytes_array_len * sizeof(uint16_t); + if (calculated_record_size < record_size) { + qdf_err("Overflow due to record and hdr->mpdu_bytes_array_len %u", + hdr->mpdu_bytes_array_len); + return; + } + record_size = calculated_record_size; + calculated_record_size += hdr->mpdu_msdus_array_len * sizeof(uint8_t); + if (calculated_record_size < record_size) { + qdf_err("Overflow due to hdr->mpdu_msdus_array_len %u", + hdr->mpdu_msdus_array_len); + return; + } + record_size = calculated_record_size; + calculated_record_size += hdr->msdu_bytes_array_len * sizeof(uint16_t); + if (calculated_record_size < record_size) { + qdf_err("Overflow due to hdr->msdu_bytes_array_len %u", + hdr->msdu_bytes_array_len); + return; + } + record_size = calculated_record_size; num_records = (length - sizeof(*hdr)) / record_size; + if (num_records < 0) { + qdf_err("Underflow due to length %d", length); + return; + } qdf_debug("Tx PPDU log elements: num_records %d", num_records); for (i = 0; i < num_records; i++) { @@ -880,6 +894,7 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr, #define BUF_SIZE 80 char buf[BUF_SIZE]; uint8_t *p8; + uint8_t *calculated_p8; time_enqueue_us = HTT_TICK_TO_USEC(record->timestamp_enqueue, @@ -951,7 +966,12 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr, } /* skip the regular msg fields to reach the tail area */ p8 = (uint8_t *) record; - p8 += sizeof(struct ol_fw_tx_dbg_ppdu_base); + calculated_p8 = p8 + sizeof(struct ol_fw_tx_dbg_ppdu_base); + if (calculated_p8 < p8) { + qdf_err("Overflow due to record %p", p8); + continue; + } + p8 = calculated_p8; if (hdr->mpdu_bytes_array_len) { htt_make_u16_list_str((uint32_t *) p8, buf, BUF_SIZE, @@ -959,14 +979,26 @@ htt_t2h_tx_ppdu_log_print(struct ol_fw_tx_dbg_ppdu_msg_hdr *hdr, mpdu_bytes_array_len); qdf_debug(" MPDU bytes: %s", buf); } - p8 += hdr->mpdu_bytes_array_len * sizeof(uint16_t); + calculated_p8 += hdr->mpdu_bytes_array_len * sizeof(uint16_t); + if (calculated_p8 < p8) { + qdf_err("Overflow due to hdr->mpdu_bytes_array_len %u", + hdr->mpdu_bytes_array_len); + continue; + } + p8 = calculated_p8; if (hdr->mpdu_msdus_array_len) { htt_make_u8_list_str((uint32_t *) p8, buf, BUF_SIZE, hdr->mpdu_msdus_array_len); qdf_debug(" MPDU MSDUs: %s", buf); } - p8 += hdr->mpdu_msdus_array_len * sizeof(uint8_t); + calculated_p8 += hdr->mpdu_msdus_array_len * sizeof(uint8_t); + if (calculated_p8 < p8) { + qdf_err("Overflow due to hdr->mpdu_msdus_array_len %u", + hdr->mpdu_msdus_array_len); + continue; + } + p8 = calculated_p8; if (hdr->msdu_bytes_array_len) { htt_make_u16_list_str((uint32_t *) p8, buf, BUF_SIZE, diff --git a/core/dp/htt/htt_h2t.c b/core/dp/htt/htt_h2t.c index ddbe9aac5d3e..90258509093f 100644 --- a/core/dp/htt/htt_h2t.c +++ b/core/dp/htt/htt_h2t.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file htt_h2t.c * @brief Provide functions to send host->target HTT messages. diff --git a/core/dp/htt/htt_internal.h b/core/dp/htt/htt_internal.h index 941f1373dc8c..c0d463b9693b 100644 --- a/core/dp/htt/htt_internal.h +++ b/core/dp/htt/htt_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _HTT_INTERNAL__H_ #define _HTT_INTERNAL__H_ diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index 56c2ca10427b..11ee196bdcbc 100644 --- a/core/dp/htt/htt_rx.c +++ b/core/dp/htt/htt_rx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file htt_rx.c * @brief Implement receive aspects of HTT. @@ -156,22 +147,15 @@ static void htt_rx_hash_deinit(struct htt_pdev_t *pdev) struct htt_rx_hash_entry *hash_entry; struct htt_rx_hash_bucket **hash_table; struct htt_list_node *list_iter = NULL; - qdf_mem_info_t *mem_map_table = NULL, *mem_info = NULL; - uint32_t num_unmapped = 0; + qdf_mem_info_t mem_map_table = {0}; + bool ipa_smmu = false; if (NULL == pdev->rx_ring.hash_table) return; - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { - mem_map_table = qdf_mem_map_table_alloc( - pdev->rx_ring.fill_level); - if (!mem_map_table) { - qdf_print("%s: Failed to allocate memory for mem map table\n", - __func__); - return; - } - mem_info = mem_map_table; - } + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled && + pdev->rx_ring.smmu_map) + ipa_smmu = true; qdf_spin_lock_bh(&(pdev->rx_ring.rx_hash_lock)); hash_table = pdev->rx_ring.hash_table; @@ -187,15 +171,15 @@ static void htt_rx_hash_deinit(struct htt_pdev_t *pdev) pdev->rx_ring. listnode_offset); if (hash_entry->netbuf) { - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && - pdev->is_ipa_uc_enabled) { + if (ipa_smmu) { qdf_update_mem_map_table(pdev->osdev, - mem_info, + &mem_map_table, QDF_NBUF_CB_PADDR( hash_entry->netbuf), HTT_RX_BUF_SIZE); - mem_info++; - num_unmapped++; + + cds_smmu_map_unmap(false, 1, + &mem_map_table); } #ifdef DEBUG_DMA_DONE qdf_nbuf_unmap(pdev->osdev, hash_entry->netbuf, @@ -219,13 +203,6 @@ static void htt_rx_hash_deinit(struct htt_pdev_t *pdev) qdf_mem_free(hash_table); qdf_spinlock_destroy(&(pdev->rx_ring.rx_hash_lock)); - - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { - if (num_unmapped) - cds_smmu_map_unmap(false, num_unmapped, - mem_map_table); - qdf_mem_free(mem_map_table); - } } #endif @@ -515,19 +492,14 @@ static int htt_rx_ring_fill_n(struct htt_pdev_t *pdev, int num) struct htt_host_rx_desc_base *rx_desc; int filled = 0; int debt_served = 0; - qdf_mem_info_t *mem_map_table = NULL, *mem_info = NULL; - int num_alloc = 0; + qdf_mem_info_t mem_map_table = {0}; + bool ipa_smmu = false; idx = *(pdev->rx_ring.alloc_idx.vaddr); - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { - mem_map_table = qdf_mem_map_table_alloc(num); - if (!mem_map_table) { - qdf_print("%s: Failed to allocate memory for mem map table\n", - __func__); - goto update_alloc_idx; - } - mem_info = mem_map_table; - } + + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled && + pdev->rx_ring.smmu_map) + ipa_smmu = true; moretofill: while (num > 0) { @@ -554,7 +526,7 @@ moretofill: qdf_timer_start( &pdev->rx_ring.refill_retry_timer, HTT_RX_RING_REFILL_RETRY_TIME_MS); - goto free_mem_map_table; + goto update_alloc_idx; } /* Clear rx_desc attention word before posting to Rx ring */ @@ -591,8 +563,9 @@ moretofill: #endif if (status != QDF_STATUS_SUCCESS) { qdf_nbuf_free(rx_netbuf); - goto free_mem_map_table; + goto update_alloc_idx; } + paddr = qdf_nbuf_get_frag_paddr(rx_netbuf, 0); paddr_marked = htt_rx_paddr_mark_high_bits(paddr); if (pdev->cfg.is_full_reorder_offload) { @@ -609,19 +582,17 @@ moretofill: QDF_DMA_FROM_DEVICE); #endif qdf_nbuf_free(rx_netbuf); - goto free_mem_map_table; + goto update_alloc_idx; } htt_rx_dbg_rxbuf_set(pdev, paddr_marked, rx_netbuf); } else { pdev->rx_ring.buf.netbufs_ring[idx] = rx_netbuf; } - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && - pdev->is_ipa_uc_enabled) { - qdf_update_mem_map_table(pdev->osdev, mem_info, + if (ipa_smmu) { + qdf_update_mem_map_table(pdev->osdev, &mem_map_table, paddr, HTT_RX_BUF_SIZE); - mem_info++; - num_alloc++; + cds_smmu_map_unmap(true, 1, &mem_map_table); } pdev->rx_ring.buf.paddrs_ring[idx] = paddr_marked; @@ -633,36 +604,12 @@ moretofill: idx &= pdev->rx_ring.size_mask; } - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { - cds_smmu_map_unmap(true, num_alloc, mem_map_table); - qdf_mem_free(mem_map_table); - } - - num_alloc = 0; if (debt_served < qdf_atomic_read(&pdev->rx_ring.refill_debt)) { num = qdf_atomic_read(&pdev->rx_ring.refill_debt); debt_served += num; - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && - pdev->is_ipa_uc_enabled) { - mem_map_table = qdf_mem_map_table_alloc(num); - if (!mem_map_table) { - qdf_print("%s: Failed to allocate memory for mem map table\n", - __func__); - goto update_alloc_idx; - } - mem_info = mem_map_table; - } goto moretofill; } - goto update_alloc_idx; - -free_mem_map_table: - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { - cds_smmu_map_unmap(true, num_alloc, mem_map_table); - qdf_mem_free(mem_map_table); - } - update_alloc_idx: /* * Make sure alloc index write is reflected correctly before FW polls @@ -733,7 +680,7 @@ static int htt_rx_ring_fill_level(struct htt_pdev_t *pdev) return size; } -static void htt_rx_ring_refill_retry(void *arg) +static void htt_rx_ring_refill_retry(unsigned long arg) { htt_pdev_handle pdev = (htt_pdev_handle) arg; int filled = 0; @@ -779,10 +726,16 @@ static inline unsigned int htt_rx_in_order_ring_elems(struct htt_pdev_t *pdev) void htt_rx_detach(struct htt_pdev_t *pdev) { + bool ipa_smmu = false; + qdf_timer_stop(&pdev->rx_ring.refill_retry_timer); qdf_timer_free(&pdev->rx_ring.refill_retry_timer); htt_rx_dbg_rxbuf_deinit(pdev); + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled && + pdev->rx_ring.smmu_map) + ipa_smmu = true; + if (pdev->cfg.is_full_reorder_offload) { qdf_mem_free_consistent(pdev->osdev, pdev->osdev->dev, sizeof(uint32_t), @@ -795,30 +748,18 @@ void htt_rx_detach(struct htt_pdev_t *pdev) htt_rx_hash_deinit(pdev); } else { int sw_rd_idx = pdev->rx_ring.sw_rd_idx.msdu_payld; - qdf_mem_info_t *mem_map_table = NULL, *mem_info = NULL; - uint32_t num_unmapped = 0; - - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && - pdev->is_ipa_uc_enabled) { - mem_map_table = qdf_mem_map_table_alloc( - pdev->rx_ring.fill_level); - if (!mem_map_table) { - qdf_print("%s: Failed to allocate memory for mem map table\n", - __func__); - return; - } - mem_info = mem_map_table; - } + qdf_mem_info_t mem_map_table = {0}; + while (sw_rd_idx != *(pdev->rx_ring.alloc_idx.vaddr)) { - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && - pdev->is_ipa_uc_enabled) { - qdf_update_mem_map_table(pdev->osdev, mem_info, + if (ipa_smmu) { + qdf_update_mem_map_table(pdev->osdev, + &mem_map_table, QDF_NBUF_CB_PADDR( pdev->rx_ring.buf.netbufs_ring[ sw_rd_idx]), HTT_RX_BUF_SIZE); - mem_info++; - num_unmapped++; + cds_smmu_map_unmap(false, 1, + &mem_map_table); } #ifdef DEBUG_DMA_DONE qdf_nbuf_unmap(pdev->osdev, @@ -838,13 +779,6 @@ void htt_rx_detach(struct htt_pdev_t *pdev) } qdf_mem_free(pdev->rx_ring.buf.netbufs_ring); - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && - pdev->is_ipa_uc_enabled) { - if (num_unmapped) - cds_smmu_map_unmap(false, num_unmapped, - mem_map_table); - qdf_mem_free(mem_map_table); - } } qdf_mem_free_consistent(pdev->osdev, pdev->osdev->dev, @@ -2418,9 +2352,9 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, struct htt_host_rx_desc_base *rx_desc; enum rx_pkt_fate status = RX_PKT_FATE_SUCCESS; qdf_dma_addr_t paddr; - qdf_mem_info_t *mem_map_table = NULL, *mem_info = NULL; - uint32_t num_unmapped = 0; + qdf_mem_info_t mem_map_table = {0}; int ret = 1; + bool ipa_smmu = false; HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0); @@ -2436,15 +2370,11 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, /* Get the total number of MSDUs */ msdu_count = HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(*(msg_word + 1)); HTT_RX_CHECK_MSDU_COUNT(msdu_count); - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { - mem_map_table = qdf_mem_map_table_alloc(msdu_count); - if (!mem_map_table) { - qdf_print("%s: Failed to allocate memory for mem map table\n", - __func__); - return 0; - } - mem_info = mem_map_table; - } + + if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled && + pdev->rx_ring.smmu_map) + ipa_smmu = true; + ol_rx_update_histogram_stats(msdu_count, frag_ind, offload_ind); htt_rx_dbg_rxbuf_httrxind(pdev, msdu_count); @@ -2455,7 +2385,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, msg_word); *head_msdu = *tail_msdu = NULL; ret = 0; - goto free_mem_map_table; + goto end; } paddr = htt_rx_in_ord_paddr_get(msg_word); @@ -2466,17 +2396,15 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, *tail_msdu = NULL; ret = 0; pdev->rx_ring.pop_fail_cnt++; - goto free_mem_map_table; + goto end; } while (msdu_count > 0) { - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && - pdev->is_ipa_uc_enabled) { - qdf_update_mem_map_table(pdev->osdev, mem_info, + if (ipa_smmu) { + qdf_update_mem_map_table(pdev->osdev, &mem_map_table, QDF_NBUF_CB_PADDR(msdu), HTT_RX_BUF_SIZE); - mem_info++; - num_unmapped++; + cds_smmu_map_unmap(false, 1, &mem_map_table); } /* @@ -2557,11 +2485,11 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, if (!prev) { *head_msdu = *tail_msdu = NULL; ret = 0; - goto free_mem_map_table; + goto end; } *tail_msdu = prev; qdf_nbuf_set_next(prev, NULL); - goto free_mem_map_table; + goto end; } else { /* if this is not the last msdu */ /* get the next msdu */ msg_word += HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS; @@ -2573,7 +2501,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, *tail_msdu = NULL; ret = 0; pdev->rx_ring.pop_fail_cnt++; - goto free_mem_map_table; + goto end; } /* if this is not the first msdu, update the @@ -2606,7 +2534,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, *tail_msdu = NULL; pdev->rx_ring.pop_fail_cnt++; ret = 0; - goto free_mem_map_table; + goto end; } qdf_nbuf_set_next(msdu, next); prev = msdu; @@ -2617,13 +2545,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, } } -free_mem_map_table: - if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { - if (num_unmapped) - cds_smmu_map_unmap(false, num_unmapped, - mem_map_table); - qdf_mem_free(mem_map_table); - } +end: return ret; } #endif @@ -4030,6 +3952,59 @@ int htt_rx_ipa_uc_detach(struct htt_pdev_t *pdev) htt_rx_ipa_uc_free_wdi2_rsc(pdev); return 0; } + +static int htt_rx_hash_smmu_map(bool map, struct htt_pdev_t *pdev) +{ + uint32_t i; + struct htt_rx_hash_entry *hash_entry; + struct htt_rx_hash_bucket **hash_table; + struct htt_list_node *list_iter = NULL; + qdf_mem_info_t mem_map_table = {0}; + + qdf_spin_lock_bh(&(pdev->rx_ring.rx_hash_lock)); + hash_table = pdev->rx_ring.hash_table; + + for (i = 0; i < RX_NUM_HASH_BUCKETS; i++) { + /* Free the hash entries in hash bucket i */ + list_iter = hash_table[i]->listhead.next; + while (list_iter != &hash_table[i]->listhead) { + hash_entry = + (struct htt_rx_hash_entry *)((char *)list_iter - + pdev->rx_ring. + listnode_offset); + if (hash_entry->netbuf) { + qdf_update_mem_map_table(pdev->osdev, + &mem_map_table, + QDF_NBUF_CB_PADDR( + hash_entry->netbuf), + HTT_RX_BUF_SIZE); + cds_smmu_map_unmap(map, 1, &mem_map_table); + } + list_iter = list_iter->next; + } + } + qdf_spin_unlock_bh(&(pdev->rx_ring.rx_hash_lock)); + + return 0; +} + +int htt_rx_hash_smmu_map_update(struct htt_pdev_t *pdev, bool map) +{ + int ret; + + if (NULL == pdev->rx_ring.hash_table) + return 0; + + if (!qdf_mem_smmu_s1_enabled(pdev->osdev) || !pdev->is_ipa_uc_enabled) + return 0; + + qdf_spin_lock_bh(&(pdev->rx_ring.refill_lock)); + pdev->rx_ring.smmu_map = map; + ret = htt_rx_hash_smmu_map(map, pdev); + qdf_spin_unlock_bh(&(pdev->rx_ring.refill_lock)); + + return ret; +} #endif /* IPA_OFFLOAD */ /** @@ -4082,4 +4057,3 @@ void htt_deregister_rx_pkt_dump_callback(struct htt_pdev_t *pdev) } pdev->rx_pkt_dump_cb = NULL; } - diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index f017192e93b1..017bf9991f7a 100644 --- a/core/dp/htt/htt_t2h.c +++ b/core/dp/htt/htt_t2h.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file htt_t2h.c * @brief Provide functions to process target->host HTT messages. @@ -212,6 +203,13 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, { uint16_t msdu_cnt; + if (!pdev->cfg.is_high_latency && + pdev->cfg.is_full_reorder_offload) { + qdf_print("HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND not "); + qdf_print("supported when full reorder offload is "); + qdf_print("enabled in the configuration.\n"); + break; + } msdu_cnt = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(*msg_word); ol_rx_offload_deliver_ind_handler(pdev->txrx_pdev, @@ -994,8 +992,10 @@ void htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, { unsigned int num_mpdu_ranges; unsigned int num_msdu_bytes; + unsigned int calculated_msg_len; u_int16_t peer_id; u_int8_t tid; + msg_len = qdf_nbuf_len(htt_t2h_msg); peer_id = HTT_RX_IND_PEER_ID_GET(*msg_word); tid = HTT_RX_IND_EXT_TID_GET(*msg_word); @@ -1005,7 +1005,6 @@ void htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, WARN_ON(1); break; } - num_msdu_bytes = HTT_RX_IND_FW_RX_DESC_BYTES_GET( *(msg_word + 2 + @@ -1025,6 +1024,34 @@ void htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, HTT_RX_IND_NUM_MPDU_RANGES_GET(*(msg_word + 1)); pdev->rx_ind_msdu_byte_idx = 0; + if (qdf_unlikely(pdev->rx_mpdu_range_offset_words > + msg_len)) { + qdf_print("HTT_T2H_MSG_TYPE_RX_IND, invalid rx_mpdu_range_offset_words %d\n", + pdev->rx_mpdu_range_offset_words); + WARN_ON(1); + break; + } + calculated_msg_len = pdev->rx_mpdu_range_offset_words + + (num_mpdu_ranges * + (int)sizeof(uint32_t)); + /* + * Check that the addition and multiplication + * do not cause integer overflow + */ + if (qdf_unlikely(calculated_msg_len < + pdev->rx_mpdu_range_offset_words)) { + qdf_print("HTT_T2H_MSG_TYPE_RX_IND, invalid mpdu_ranges %u\n", + (num_mpdu_ranges * + (int)sizeof(uint32_t))); + WARN_ON(1); + break; + } + if (qdf_unlikely(calculated_msg_len > msg_len)) { + qdf_print("HTT_T2H_MSG_TYPE_RX_IND, invalid offset_words + mpdu_ranges %u\n", + calculated_msg_len); + WARN_ON(1); + break; + } ol_rx_indication_handler(pdev->txrx_pdev, htt_t2h_msg, peer_id, tid, num_mpdu_ranges); break; diff --git a/core/dp/htt/htt_tx.c b/core/dp/htt/htt_tx.c index 1088d1648d47..2460b1fde197 100644 --- a/core/dp/htt/htt_tx.c +++ b/core/dp/htt/htt_tx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file htt_tx.c * @brief Implement transmit aspects of HTT. diff --git a/core/dp/htt/htt_types.h b/core/dp/htt/htt_types.h index d29b573418b5..f775379c8b69 100644 --- a/core/dp/htt/htt_types.h +++ b/core/dp/htt/htt_types.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011, 2014-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _HTT_TYPES__H_ #define _HTT_TYPES__H_ @@ -368,6 +359,8 @@ struct htt_pdev_t { qdf_spinlock_t rx_hash_lock; struct htt_rx_hash_bucket **hash_table; uint32_t listnode_offset; + + bool smmu_map; } rx_ring; #ifdef CONFIG_HL_SUPPORT int rx_desc_size_hl; diff --git a/core/dp/htt/rx_desc.h b/core/dp/htt/rx_desc.h index faf103dc2ca6..cd31a86a86df 100644 --- a/core/dp/htt/rx_desc.h +++ b/core/dp/htt/rx_desc.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2015, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _RX_DESC_H_ #define _RX_DESC_H_ diff --git a/core/dp/ol/inc/ol_cfg.h b/core/dp/ol/inc/ol_cfg.h index e68b8f249363..a99794dc5ca7 100644 --- a/core/dp/ol/inc/ol_cfg.h +++ b/core/dp/ol/inc/ol_cfg.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_CFG__H_ #define _OL_CFG__H_ diff --git a/core/dp/ol/inc/ol_ctrl_addba_api.h b/core/dp/ol/inc/ol_ctrl_addba_api.h index 31854e61086d..dabafdb802c1 100644 --- a/core/dp/ol/inc/ol_ctrl_addba_api.h +++ b/core/dp/ol/inc/ol_ctrl_addba_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_CTRL_ADDBA_API_H_ #define _OL_CTRL_ADDBA_API_H_ #define ol_ctrl_addba_attach(a, b, c, d, e) 0 diff --git a/core/dp/ol/inc/ol_htt_api.h b/core/dp/ol/inc/ol_htt_api.h index e597dc748b27..9d115e9a305c 100644 --- a/core/dp/ol/inc/ol_htt_api.h +++ b/core/dp/ol/inc/ol_htt_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_htt_api.h * @brief Specify the general HTT API functions called by the host data SW. diff --git a/core/dp/ol/inc/ol_htt_rx_api.h b/core/dp/ol/inc/ol_htt_rx_api.h index db84567056d1..61e7e9343ea1 100644 --- a/core/dp/ol/inc/ol_htt_rx_api.h +++ b/core/dp/ol/inc/ol_htt_rx_api.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_htt_rx_api.h * @brief Specify the rx HTT API functions called by the host data SW. @@ -898,4 +889,5 @@ htt_rx_offload_paddr_msdu_pop_ll(htt_pdev_handle pdev, uint32_t htt_rx_amsdu_rx_in_order_get_pktlog(qdf_nbuf_t rx_ind_msg); +int htt_rx_hash_smmu_map_update(struct htt_pdev_t *pdev, bool map); #endif /* _OL_HTT_RX_API__H_ */ diff --git a/core/dp/ol/inc/ol_htt_tx_api.h b/core/dp/ol/inc/ol_htt_tx_api.h index ef479240a0e4..a87b1228681c 100644 --- a/core/dp/ol/inc/ol_htt_tx_api.h +++ b/core/dp/ol/inc/ol_htt_tx_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_htt_tx_api.h * @brief Specify the tx HTT API functions called by the host data SW. diff --git a/core/dp/ol/inc/ol_params.h b/core/dp/ol/inc/ol_params.h index b2ca66318c2d..221fe43d38f9 100644 --- a/core/dp/ol/inc/ol_params.h +++ b/core/dp/ol/inc/ol_params.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2015, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * Defintions for the Atheros Wireless LAN controller driver. */ #ifndef _DEV_OL_PARAMS_H diff --git a/core/dp/ol/inc/ol_txrx_api.h b/core/dp/ol/inc/ol_txrx_api.h index 6182105ddd45..67adf2cd77d3 100644 --- a/core/dp/ol/inc/ol_txrx_api.h +++ b/core/dp/ol/inc/ol_txrx_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2014,2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_api.h * @brief Definitions used in multiple external interfaces to the txrx SW. diff --git a/core/dp/ol/inc/ol_txrx_ctrl_api.h b/core/dp/ol/inc/ol_txrx_ctrl_api.h index 2b57ac97171f..4b8d3dd95776 100644 --- a/core/dp/ol/inc/ol_txrx_ctrl_api.h +++ b/core/dp/ol/inc/ol_txrx_ctrl_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_ctrl_api.h * @brief Define the host data API functions called by the host control SW. diff --git a/core/dp/ol/inc/ol_txrx_dbg.h b/core/dp/ol/inc/ol_txrx_dbg.h index f52acc0adc07..b3e5b96a637f 100644 --- a/core/dp/ol/inc/ol_txrx_dbg.h +++ b/core/dp/ol/inc/ol_txrx_dbg.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_dbg.h * @brief Functions provided for visibility and debugging. diff --git a/core/dp/ol/inc/ol_txrx_htt_api.h b/core/dp/ol/inc/ol_txrx_htt_api.h index c1b995978c98..e2b477bd5044 100644 --- a/core/dp/ol/inc/ol_txrx_htt_api.h +++ b/core/dp/ol/inc/ol_txrx_htt_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_htt_api.h * @brief Define the host data API functions called by the host HTT SW. diff --git a/core/dp/ol/inc/ol_txrx_osif_api.h b/core/dp/ol/inc/ol_txrx_osif_api.h index e906442fe93a..fff4da3d1bda 100644 --- a/core/dp/ol/inc/ol_txrx_osif_api.h +++ b/core/dp/ol/inc/ol_txrx_osif_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_osif_api.h * @brief Define the host data API functions called by the host OS shim SW. diff --git a/core/dp/ol/inc/ol_txrx_stats.h b/core/dp/ol/inc/ol_txrx_stats.h index 7bda7ca44db2..4c2a073e0209 100644 --- a/core/dp/ol/inc/ol_txrx_stats.h +++ b/core/dp/ol/inc/ol_txrx_stats.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_status.h * @brief Functions provided for visibility and debugging. diff --git a/core/dp/ol/inc/ol_vowext_dbg_defs.h b/core/dp/ol/inc/ol_vowext_dbg_defs.h index 4a9d3db50014..c1470b8bcdb9 100644 --- a/core/dp/ol/inc/ol_vowext_dbg_defs.h +++ b/core/dp/ol/inc/ol_vowext_dbg_defs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _VOW_DEFINES__H_ #define _VOW_DEFINES__H_ diff --git a/core/dp/txrx/ipv6_defs.h b/core/dp/txrx/ipv6_defs.h index 6e17c5b48af1..ffdd6568afa2 100644 --- a/core/dp/txrx/ipv6_defs.h +++ b/core/dp/txrx/ipv6_defs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _IPV6__H_ #define _IPV6__H_ diff --git a/core/dp/txrx/ol_cfg.c b/core/dp/txrx/ol_cfg.c index 77aa2e28e02e..15cded77f702 100644 --- a/core/dp/txrx/ol_cfg.c +++ b/core/dp/txrx/ol_cfg.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <ol_cfg.h> #include <ol_if_athvar.h> #include <cdp_txrx_cfg.h> diff --git a/core/dp/txrx/ol_ctrl_txrx_api.h b/core/dp/txrx/ol_ctrl_txrx_api.h index 68342e3bf8f0..10d89a345a50 100644 --- a/core/dp/txrx/ol_ctrl_txrx_api.h +++ b/core/dp/txrx/ol_ctrl_txrx_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_ctrl_txrx_api.h * @brief Define the host control API functions called by the host data SW. diff --git a/core/dp/txrx/ol_osif_txrx_api.h b/core/dp/txrx/ol_osif_txrx_api.h index 979b258c0a43..ca40d9ca1c74 100644 --- a/core/dp/txrx/ol_osif_txrx_api.h +++ b/core/dp/txrx/ol_osif_txrx_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_osif_txrx_api.h * @brief Define the OS specific API functions called by txrx SW. diff --git a/core/dp/txrx/ol_rx.c b/core/dp/txrx/ol_rx.c index 7d443be064f4..ad843f8846af 100644 --- a/core/dp/txrx/ol_rx.c +++ b/core/dp/txrx/ol_rx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ #include <qdf_util.h> /* qdf_cpu_to_le64 */ #include <qdf_types.h> /* bool */ diff --git a/core/dp/txrx/ol_rx.h b/core/dp/txrx/ol_rx.h index f5b453a803f8..de715ce9dbf1 100644 --- a/core/dp/txrx/ol_rx.h +++ b/core/dp/txrx/ol_rx.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_RX__H_ #define _OL_RX__H_ diff --git a/core/dp/txrx/ol_rx_defrag.c b/core/dp/txrx/ol_rx_defrag.c index 4496b21eabbf..74e2e7b6a467 100644 --- a/core/dp/txrx/ol_rx_defrag.c +++ b/core/dp/txrx/ol_rx_defrag.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*- * Copyright (c) 2002-2007 Sam Leffler, Errno Consulting * All rights reserved. diff --git a/core/dp/txrx/ol_rx_defrag.h b/core/dp/txrx/ol_rx_defrag.h index f7ee2cf40e5d..66b672d62edb 100644 --- a/core/dp/txrx/ol_rx_defrag.h +++ b/core/dp/txrx/ol_rx_defrag.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_RX_DEFRAG_H_ #define _OL_RX_DEFRAG_H_ diff --git a/core/dp/txrx/ol_rx_fwd.c b/core/dp/txrx/ol_rx_fwd.c index 42f0aadd7309..f33db7424a81 100644 --- a/core/dp/txrx/ol_rx_fwd.c +++ b/core/dp/txrx/ol_rx_fwd.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* standard header files */ #include <qdf_nbuf.h> /* qdf_nbuf_map */ #include <qdf_mem.h> /* qdf_mem_cmp */ diff --git a/core/dp/txrx/ol_rx_fwd.h b/core/dp/txrx/ol_rx_fwd.h index ffe344d385f9..9fc63e7ff5bf 100644 --- a/core/dp/txrx/ol_rx_fwd.h +++ b/core/dp/txrx/ol_rx_fwd.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_RX_FWD_H_ #define _OL_RX_FWD_H_ diff --git a/core/dp/txrx/ol_rx_pn.c b/core/dp/txrx/ol_rx_pn.c index f7b39e190c54..dd09c3f50c71 100644 --- a/core/dp/txrx/ol_rx_pn.c +++ b/core/dp/txrx/ol_rx_pn.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <qdf_nbuf.h> /* qdf_nbuf_t */ #include <ol_htt_rx_api.h> /* htt_rx_pn_t, etc. */ diff --git a/core/dp/txrx/ol_rx_pn.h b/core/dp/txrx/ol_rx_pn.h index 9a7236c4b628..8e0c007b091d 100644 --- a/core/dp/txrx/ol_rx_pn.h +++ b/core/dp/txrx/ol_rx_pn.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_RX_PN_H_ #define _OL_RX_PN_H_ diff --git a/core/dp/txrx/ol_rx_reorder.c b/core/dp/txrx/ol_rx_reorder.c index 0718969d20f8..3fc22b72a126 100644 --- a/core/dp/txrx/ol_rx_reorder.c +++ b/core/dp/txrx/ol_rx_reorder.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=== header file includes ===*/ /* generic utilities */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ @@ -468,6 +459,11 @@ static void ol_rx_reorder_detect_hole(struct ol_txrx_peer_t *peer, { uint32_t win_sz_mask, next_rel_idx, hole_size; + if (tid >= OL_TXRX_NUM_EXT_TIDS) { + ol_txrx_err("%s: invalid tid, %u\n", __FUNCTION__, tid); + return; + } + if (peer->tids_next_rel_idx[tid] == INVALID_REORDER_INDEX) return; diff --git a/core/dp/txrx/ol_rx_reorder.h b/core/dp/txrx/ol_rx_reorder.h index b807adfe6a74..fa6401061675 100644 --- a/core/dp/txrx/ol_rx_reorder.h +++ b/core/dp/txrx/ol_rx_reorder.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_RX_REORDER__H_ #define _OL_RX_REORDER__H_ diff --git a/core/dp/txrx/ol_rx_reorder_timeout.c b/core/dp/txrx/ol_rx_reorder_timeout.c index 8eec306964ca..0656a1ae7b93 100644 --- a/core/dp/txrx/ol_rx_reorder_timeout.c +++ b/core/dp/txrx/ol_rx_reorder_timeout.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=== header file includes ===*/ /* generic utilities */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ @@ -124,7 +115,7 @@ void ol_rx_reorder_timeout_update(struct ol_txrx_peer_t *peer, uint8_t tid) ol_rx_reorder_timeout_add(peer, tid); } -static void ol_rx_reorder_timeout(void *arg) +static void ol_rx_reorder_timeout(unsigned long arg) { struct ol_txrx_pdev_t *pdev; struct ol_rx_reorder_timeout_list_elem_t *list_elem, *tmp; diff --git a/core/dp/txrx/ol_rx_reorder_timeout.h b/core/dp/txrx/ol_rx_reorder_timeout.h index 9213fedb10a9..9f095015eb22 100644 --- a/core/dp/txrx/ol_rx_reorder_timeout.h +++ b/core/dp/txrx/ol_rx_reorder_timeout.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014, 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_RX_REORDER_TIMEOUT__H_ #define _OL_RX_REORDER_TIMEOUT__H_ diff --git a/core/dp/txrx/ol_tx.c b/core/dp/txrx/ol_tx.c index c95550688f37..e08ebab8e82b 100644 --- a/core/dp/txrx/ol_tx.c +++ b/core/dp/txrx/ol_tx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* OS abstraction libraries */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ #include <qdf_atomic.h> /* qdf_atomic_read, etc. */ @@ -468,8 +459,6 @@ qdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list) msdu_info.tso_info.curr_seg->next; } - qdf_nbuf_reset_num_frags(msdu); - if (msdu_info.tso_info.is_tso) { TXRX_STATS_TSO_INC_SEG(vdev->pdev, tso_msdu_stats_idx); @@ -874,7 +863,6 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list) if (msdu_info.tso_info.is_tso) { - qdf_nbuf_reset_num_frags(msdu); TXRX_STATS_TSO_INC_SEG(vdev->pdev, tso_msdu_stats_idx); TXRX_STATS_TSO_INC_SEG_IDX(vdev->pdev, @@ -1302,7 +1290,7 @@ void ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev) } } -void ol_tx_vdev_ll_pause_queue_send(void *context) +void ol_tx_vdev_ll_pause_queue_send(unsigned long context) { struct ol_txrx_vdev_t *vdev = (struct ol_txrx_vdev_t *)context; struct ol_txrx_pdev_t *pdev = vdev->pdev; diff --git a/core/dp/txrx/ol_tx.h b/core/dp/txrx/ol_tx.h index 7f33cce6b99f..7eb71ea38eb2 100644 --- a/core/dp/txrx/ol_tx.h +++ b/core/dp/txrx/ol_tx.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_tx.h * @brief Internal definitions for the high-level tx module. @@ -60,10 +51,10 @@ qdf_nbuf_t ol_tx_ll_queue(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list); #endif #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL -void ol_tx_vdev_ll_pause_queue_send(void *context); +void ol_tx_vdev_ll_pause_queue_send(unsigned long context); void ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev); #else -static inline void ol_tx_vdev_ll_pause_queue_send(void *context) +static inline void ol_tx_vdev_ll_pause_queue_send(unsigned long context) { } static inline diff --git a/core/dp/txrx/ol_tx_classify.c b/core/dp/txrx/ol_tx_classify.c index baa2bae8d552..2abd72b77d96 100644 --- a/core/dp/txrx/ol_tx_classify.c +++ b/core/dp/txrx/ol_tx_classify.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ #include <htt.h> /* HTT_TX_EXT_TID_MGMT */ #include <ol_htt_tx_api.h> /* htt_tx_desc_tid */ diff --git a/core/dp/txrx/ol_tx_classify.h b/core/dp/txrx/ol_tx_classify.h index 159897ae5c42..b88f329476cd 100644 --- a/core/dp/txrx/ol_tx_classify.h +++ b/core/dp/txrx/ol_tx_classify.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014, 2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_tx_classify.h * @brief API definitions for the tx classify module within the data SW. diff --git a/core/dp/txrx/ol_tx_desc.c b/core/dp/txrx/ol_tx_desc.c index dd1324670062..e8e150536ff0 100644 --- a/core/dp/txrx/ol_tx_desc.c +++ b/core/dp/txrx/ol_tx_desc.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <qdf_net_types.h> /* QDF_NBUF_EXEMPT_NO_EXEMPTION, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ #include <qdf_util.h> /* qdf_assert */ @@ -740,7 +731,14 @@ void ol_tx_desc_frame_list_free(struct ol_txrx_pdev_t *pdev, /* restore original hdr offset */ OL_TX_RESTORE_HDR(tx_desc, msdu); #endif - if (qdf_nbuf_get_users(msdu) <= 1) + + /* + * In MCC IPA tx context, IPA driver provides skb with directly + * DMA mapped address. In such case, there's no need for WLAN + * driver to DMA unmap the skb. + */ + if ((qdf_nbuf_get_users(msdu) <= 1) && + !qdf_nbuf_ipa_owned_get(msdu)) qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_TO_DEVICE); /* free the tx desc */ diff --git a/core/dp/txrx/ol_tx_desc.h b/core/dp/txrx/ol_tx_desc.h index db84a0c915ee..6f920e4f0555 100644 --- a/core/dp/txrx/ol_tx_desc.h +++ b/core/dp/txrx/ol_tx_desc.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_tx_desc.h * @brief API definitions for the tx descriptor module within the data SW. diff --git a/core/dp/txrx/ol_tx_queue.c b/core/dp/txrx/ol_tx_queue.c index c2193b4c0e06..2816824e57b6 100644 --- a/core/dp/txrx/ol_tx_queue.c +++ b/core/dp/txrx/ol_tx_queue.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ #include <qdf_atomic.h> /* qdf_atomic_read, etc. */ #include <ol_cfg.h> /* ol_cfg_addba_retry */ @@ -857,7 +848,7 @@ ol_txrx_bad_peer_txctl_update_threshold(struct ol_txrx_pdev_t *pdev, * Return: None */ static void -ol_tx_pdev_peer_bal_timer(void *context) +ol_tx_pdev_peer_bal_timer(unsigned long context) { int i; struct ol_txrx_pdev_t *pdev = (struct ol_txrx_pdev_t *)context; @@ -1968,7 +1959,7 @@ void ol_txrx_thermal_unpause(struct ol_txrx_pdev_t *pdev) } #endif -static void ol_tx_pdev_throttle_phase_timer(void *context) +static void ol_tx_pdev_throttle_phase_timer(unsigned long context) { struct ol_txrx_pdev_t *pdev = (struct ol_txrx_pdev_t *)context; int ms; diff --git a/core/dp/txrx/ol_tx_queue.h b/core/dp/txrx/ol_tx_queue.h index 5171e2134fa0..54ea768589ff 100644 --- a/core/dp/txrx/ol_tx_queue.h +++ b/core/dp/txrx/ol_tx_queue.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_tx_queue.h * @brief API definitions for the tx frame queue module within the data SW. diff --git a/core/dp/txrx/ol_tx_sched.c b/core/dp/txrx/ol_tx_sched.c index 6650cabdc7a1..52f2df03ac97 100644 --- a/core/dp/txrx/ol_tx_sched.c +++ b/core/dp/txrx/ol_tx_sched.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ #include <htt.h> /* HTT_TX_EXT_TID_MGMT */ #include <ol_htt_tx_api.h> /* htt_tx_desc_tid */ diff --git a/core/dp/txrx/ol_tx_sched.h b/core/dp/txrx/ol_tx_sched.h index b3612fc2412e..27a9b841155b 100644 --- a/core/dp/txrx/ol_tx_sched.h +++ b/core/dp/txrx/ol_tx_sched.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2013, 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_tx_sched.h * @brief API definitions for the tx scheduler module within the data SW. diff --git a/core/dp/txrx/ol_tx_send.c b/core/dp/txrx/ol_tx_send.c index 3a47006af40b..9fcf10c9d9f0 100644 --- a/core/dp/txrx/ol_tx_send.c +++ b/core/dp/txrx/ol_tx_send.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <qdf_atomic.h> /* qdf_atomic_inc, etc. */ #include <qdf_lock.h> /* qdf_os_spinlock */ #include <qdf_time.h> /* qdf_system_ticks, etc. */ @@ -542,6 +533,46 @@ void ol_tx_credit_completion_handler(ol_txrx_pdev_handle pdev, int credits) /* UNPAUSE OS Q */ ol_tx_flow_ct_unpause_os_q(pdev); } +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 +/** + * ol_tx_flow_pool_lock() - take flow pool lock + * @tx_desc: tx desc + * + * Return: None + */ +static inline +void ol_tx_flow_pool_lock(struct ol_tx_desc_t *tx_desc) +{ + struct ol_tx_flow_pool_t *pool; + + pool = tx_desc->pool; + qdf_spin_lock_bh(&pool->flow_pool_lock); +} + +/** + * ol_tx_flow_pool_unlock() - release flow pool lock + * @tx_desc: tx desc + * + * Return: None + */ +static inline +void ol_tx_flow_pool_unlock(struct ol_tx_desc_t *tx_desc) +{ + struct ol_tx_flow_pool_t *pool; + + pool = tx_desc->pool; + qdf_spin_unlock_bh(&pool->flow_pool_lock); +} +#else +static inline +void ol_tx_flow_pool_lock(struct ol_tx_desc_t *tx_desc) +{ +} +static inline +void ol_tx_flow_pool_unlock(struct ol_tx_desc_t *tx_desc) +{ +} +#endif /** * ol_tx_update_connectivity_stats() - update connectivity stats @@ -557,14 +588,30 @@ static void ol_tx_update_connectivity_stats(struct ol_tx_desc_t *tx_desc, enum htt_tx_status status) { void *osif_dev; + uint32_t pkt_type_bitmap; ol_txrx_stats_rx_fp stats_rx = NULL; uint8_t pkt_type = 0; qdf_assert(tx_desc); + + ol_tx_flow_pool_lock(tx_desc); + /* + * In cases when vdev has gone down and tx completion + * are received, leads to NULL vdev access. + * So, check for NULL before dereferencing it. + */ + if (!tx_desc->vdev || + !tx_desc->vdev->osif_dev || + !tx_desc->vdev->stats_rx) { + ol_tx_flow_pool_unlock(tx_desc); + return; + } osif_dev = tx_desc->vdev->osif_dev; stats_rx = tx_desc->vdev->stats_rx; + pkt_type_bitmap = cds_get_connectivity_stats_pkt_bitmap(osif_dev); + ol_tx_flow_pool_unlock(tx_desc); - if (stats_rx) { + if (pkt_type_bitmap) { if (status != htt_tx_status_download_fail) stats_rx(netbuf, osif_dev, PKT_TYPE_TX_HOST_FW_SENT, &pkt_type); @@ -590,7 +637,15 @@ static void ol_tx_update_arp_stats(struct ol_tx_desc_t *tx_desc, uint32_t tgt_ip; qdf_assert(tx_desc); + + ol_tx_flow_pool_lock(tx_desc); + if (!tx_desc->vdev) { + ol_tx_flow_pool_unlock(tx_desc); + return; + } + tgt_ip = cds_get_arp_stats_gw_ip(tx_desc->vdev->osif_dev); + ol_tx_flow_pool_unlock(tx_desc); if (tgt_ip == qdf_nbuf_get_arp_tgt_ip(netbuf)) { if (status != htt_tx_status_download_fail) @@ -675,7 +730,6 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev, struct ol_tx_desc_t *tx_desc; uint32_t byte_cnt = 0; qdf_nbuf_t netbuf; - uint32_t pkt_type_bitmap; tp_ol_packetdump_cb packetdump_cb; uint32_t is_tx_desc_freed = 0; struct htt_tx_compl_ind_append_tx_tstamp *txtstamp_list = NULL; @@ -719,17 +773,14 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev, } /* track connectivity stats */ - pkt_type_bitmap = cds_get_connectivity_stats_pkt_bitmap( - tx_desc->vdev->osif_dev); - if (pkt_type_bitmap) - ol_tx_update_connectivity_stats(tx_desc, netbuf, - status); + ol_tx_update_connectivity_stats(tx_desc, netbuf, + status); if (tx_desc->pkt_type != OL_TX_FRM_TSO) { packetdump_cb = pdev->ol_tx_packetdump_cb; if (packetdump_cb) packetdump_cb(netbuf, status, - tx_desc->vdev->vdev_id, TX_DATA_PKT); + tx_desc->vdev_id, TX_DATA_PKT); } DPTRACE(qdf_dp_trace_ptr(netbuf, @@ -803,6 +854,11 @@ void ol_tx_desc_update_group_credit(ol_txrx_pdev_handle pdev, uint16_t vdev_id_mask; struct ol_tx_desc_t *tx_desc; + if (tx_desc_id >= pdev->tx_desc.pool_size) { + qdf_print("%s: Invalid desc id", __func__); + return; + } + tx_desc = ol_tx_desc_find(pdev, tx_desc_id); for (i = 0; i < OL_TX_MAX_TXQ_GROUPS; i++) { vdev_id_mask = diff --git a/core/dp/txrx/ol_tx_send.h b/core/dp/txrx/ol_tx_send.h index ae5013c1afcc..e0a344e54297 100644 --- a/core/dp/txrx/ol_tx_send.h +++ b/core/dp/txrx/ol_tx_send.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_tx_send.h * @brief API definitions for the tx sendriptor module within the data SW. diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 70a20725e86d..8b6adcd73bd4 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=== includes ===*/ /* header files for OS primitives */ #include <osdep.h> /* uint32_t, etc. */ @@ -2271,7 +2262,7 @@ static void ol_txrx_debugfs_exit(ol_txrx_pdev_handle pdev) */ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev) { - struct ol_txrx_stats_req_internal *req; + struct ol_txrx_stats_req_internal *req, *temp_req; int i = 0; /*checking to ensure txrx pdev structure is not NULL */ @@ -2287,7 +2278,7 @@ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev) "Warning: the txrx req list is not empty, depth=%d\n", pdev->req_list_depth ); - TAILQ_FOREACH(req, &pdev->req_list, req_list_elem) { + TAILQ_FOREACH_SAFE(req, &pdev->req_list, req_list_elem, temp_req) { TAILQ_REMOVE(&pdev->req_list, req, req_list_elem); pdev->req_list_depth--; ol_txrx_err( @@ -2523,7 +2514,7 @@ void ol_txrx_set_drop_unenc(ol_txrx_vdev_handle vdev, uint32_t val) vdev->drop_unenc = val; } -#if defined(CONFIG_HL_SUPPORT) +#if defined(CONFIG_HL_SUPPORT) || defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) static void ol_txrx_tx_desc_reset_vdev(ol_txrx_vdev_handle vdev) @@ -2542,14 +2533,31 @@ ol_txrx_tx_desc_reset_vdev(ol_txrx_vdev_handle vdev) } #else - -static void -ol_txrx_tx_desc_reset_vdev(ol_txrx_vdev_handle vdev) +#ifdef QCA_LL_TX_FLOW_CONTROL_V2 +static void ol_txrx_tx_desc_reset_vdev(ol_txrx_vdev_handle vdev) { + struct ol_txrx_pdev_t *pdev = vdev->pdev; + struct ol_tx_flow_pool_t *pool; + int i; + struct ol_tx_desc_t *tx_desc; -} + qdf_spin_lock_bh(&pdev->tx_desc.flow_pool_list_lock); + for (i = 0; i < pdev->tx_desc.pool_size; i++) { + tx_desc = ol_tx_desc_find(pdev, i); + if (!qdf_atomic_read(&tx_desc->ref_cnt)) + /* not in use */ + continue; -#endif + pool = tx_desc->pool; + qdf_spin_lock_bh(&pool->flow_pool_lock); + if (tx_desc->vdev == vdev) + tx_desc->vdev = NULL; + qdf_spin_unlock_bh(&pool->flow_pool_lock); + } + qdf_spin_unlock_bh(&pdev->tx_desc.flow_pool_list_lock); +} +#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */ +#endif /* CONFIG_HL_SUPPORT */ /** * ol_txrx_vdev_detach - Deallocate the specified data virtual @@ -3751,7 +3759,7 @@ QDF_STATUS ol_txrx_clear_peer(uint8_t sta_id) * * Return: none */ -void peer_unmap_timer_handler(void *data) +void peer_unmap_timer_handler(unsigned long data) { ol_txrx_peer_handle peer = (ol_txrx_peer_handle)data; @@ -5179,9 +5187,10 @@ static inline int ol_txrx_drop_nbuf_list(qdf_nbuf_t buf_list) * * Return: None */ -static void ol_rx_data_cb(struct ol_txrx_pdev_t *pdev, - qdf_nbuf_t buf_list, uint16_t staid) +static void ol_rx_data_cb(void *_pdev, void *_buf_list, uint16_t staid) { + struct ol_txrx_pdev_t *pdev = (struct ol_txrx_pdev_t *)_pdev; + qdf_nbuf_t buf_list = (qdf_nbuf_t)_buf_list; void *cds_ctx = cds_get_global_context(); void *osif_dev; uint8_t drop_count = 0; @@ -5381,8 +5390,7 @@ void ol_rx_data_process(struct ol_txrx_peer_t *peer, if (!pkt) goto drop_rx_buf; - pkt->callback = (cds_ol_rx_thread_cb) - ol_rx_data_cb; + pkt->callback = ol_rx_data_cb; pkt->context = (void *)pdev; pkt->Rxpkt = (void *)rx_buf_list; pkt->staId = peer->local_id; @@ -5949,3 +5957,8 @@ QDF_STATUS ol_txrx_set_wisa_mode(ol_txrx_vdev_handle vdev, bool enable) vdev->is_wisa_mode_enable = enable; return QDF_STATUS_SUCCESS; } + +int ol_txrx_rx_hash_smmu_map(ol_txrx_pdev_handle pdev, bool map) +{ + return htt_rx_hash_smmu_map_update(pdev->htt_pdev, map); +} diff --git a/core/dp/txrx/ol_txrx.h b/core/dp/txrx/ol_txrx.h index 27602d02356d..647ba3440e63 100644 --- a/core/dp/txrx/ol_txrx.h +++ b/core/dp/txrx/ol_txrx.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_TXRX__H_ #define _OL_TXRX__H_ @@ -194,6 +185,6 @@ QDF_STATUS ol_txrx_set_wisa_mode(ol_txrx_vdev_handle vdev, bool enable); void ol_txrx_update_mac_id(uint8_t vdev_id, uint8_t mac_id); void ol_txrx_peer_detach_force_delete(ol_txrx_peer_handle peer); -void peer_unmap_timer_handler(void *data); +void peer_unmap_timer_handler(unsigned long data); #endif /* _OL_TXRX__H_ */ diff --git a/core/dp/txrx/ol_txrx_encap.c b/core/dp/txrx/ol_txrx_encap.c index 8895aae731eb..992936da1edb 100644 --- a/core/dp/txrx/ol_txrx_encap.c +++ b/core/dp/txrx/ol_txrx_encap.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_encap.c * @brief Provide functions to encap/decap on txrx frames. diff --git a/core/dp/txrx/ol_txrx_encap.h b/core/dp/txrx/ol_txrx_encap.h index 932bdd342a45..ca6c3abffa63 100644 --- a/core/dp/txrx/ol_txrx_encap.h +++ b/core/dp/txrx/ol_txrx_encap.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_encap.h * @brief definitions for txrx encap/decap function and struct diff --git a/core/dp/txrx/ol_txrx_event.c b/core/dp/txrx/ol_txrx_event.c index 5141f2c3ad2b..c35b1737d173 100644 --- a/core/dp/txrx/ol_txrx_event.c +++ b/core/dp/txrx/ol_txrx_event.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "ol_txrx_types.h" #ifdef WDI_EVENT_ENABLE diff --git a/core/dp/txrx/ol_txrx_flow_control.c b/core/dp/txrx/ol_txrx_flow_control.c index 4ef5a2f6cca0..d2480040baa6 100644 --- a/core/dp/txrx/ol_txrx_flow_control.c +++ b/core/dp/txrx/ol_txrx_flow_control.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* OS abstraction libraries */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */ #include <qdf_atomic.h> /* qdf_atomic_read, etc. */ diff --git a/core/dp/txrx/ol_txrx_internal.h b/core/dp/txrx/ol_txrx_internal.h index d54da0041c92..ceedb2dceea3 100644 --- a/core/dp/txrx/ol_txrx_internal.h +++ b/core/dp/txrx/ol_txrx_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _OL_TXRX_INTERNAL__H_ #define _OL_TXRX_INTERNAL__H_ diff --git a/core/dp/txrx/ol_txrx_peer_find.c b/core/dp/txrx/ol_txrx_peer_find.c index 9c47a8b865e4..1a8da0598f34 100644 --- a/core/dp/txrx/ol_txrx_peer_find.c +++ b/core/dp/txrx/ol_txrx_peer_find.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=== includes ===*/ /* header files for OS primitives */ #include <osdep.h> /* uint32_t, etc. */ @@ -711,6 +702,14 @@ void ol_txrx_peer_remove_obj_map_entries(ol_txrx_pdev_handle pdev, } qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); + if (num_deleted_maps > qdf_atomic_read(&peer->ref_cnt)) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + FL("num_deleted_maps %d ref_cnt %d"), + num_deleted_maps, qdf_atomic_read(&peer->ref_cnt)); + QDF_BUG(0); + return; + } + while (num_deleted_maps-- > 0) OL_TXRX_PEER_UNREF_DELETE(peer); } diff --git a/core/dp/txrx/ol_txrx_peer_find.h b/core/dp/txrx/ol_txrx_peer_find.h index cc13cf3dda39..5cb266092d4b 100644 --- a/core/dp/txrx/ol_txrx_peer_find.h +++ b/core/dp/txrx/ol_txrx_peer_find.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_peer_find.h * @brief Define the API for the rx peer lookup datapath module. diff --git a/core/dp/txrx/ol_txrx_types.h b/core/dp/txrx/ol_txrx_types.h index 910a446de6cb..793a5e71d856 100644 --- a/core/dp/txrx/ol_txrx_types.h +++ b/core/dp/txrx/ol_txrx_types.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file ol_txrx_types.h * @brief Define the major data types used internally by the host datapath SW. diff --git a/core/dp/txrx/txrx.h b/core/dp/txrx/txrx.h index 4161b7b91f9a..3abf2ac7c150 100644 --- a/core/dp/txrx/txrx.h +++ b/core/dp/txrx/txrx.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef TXRX_H #define TXRX_H diff --git a/core/dp/txrx/wdi_event.h b/core/dp/txrx/wdi_event.h index 857f284d19be..3fd87ce43638 100644 --- a/core/dp/txrx/wdi_event.h +++ b/core/dp/txrx/wdi_event.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _WDI_EVENT_H_ #define _WDI_EVENT_H_ diff --git a/core/dp/txrx/wdi_event_api.h b/core/dp/txrx/wdi_event_api.h index 3b49c90ad37c..0c793a38964f 100644 --- a/core/dp/txrx/wdi_event_api.h +++ b/core/dp/txrx/wdi_event_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _WDI_EVENT_API_H_ #define _WDI_EVENT_API_H_ diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h index cb4cc4cf42e5..5ecc103ca449 100644 --- a/core/hdd/inc/qc_sap_ioctl.h +++ b/core/hdd/inc/qc_sap_ioctl.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _QC_SAP_IOCTL_H_ #define _QC_SAP_IOCTL_H_ @@ -114,10 +105,8 @@ struct channel_list_info { #define QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 15) #define WE_SET_WLAN_DBG 1 #define WE_SET_DP_TRACE 2 -#define WE_SET_SAP_CHANNELS 3 #define QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 16) #define WE_UNIT_TEST_CMD 7 -#define QCSAP_IOCTL_SET_CHANNEL_RANGE (SIOCIWFIRSTPRIV + 17) #define WE_P2P_NOA_CMD 2 @@ -194,7 +183,6 @@ enum { QCSAP_PARAM_CLR_ACL = 4, QCSAP_PARAM_ACL_MODE, QCSAP_PARAM_HIDE_SSID, - QCSAP_PARAM_AUTO_CHANNEL, QCSAP_PARAM_SET_MC_RATE, QCSAP_PARAM_SET_TXRX_FW_STATS, QCSAP_PARAM_SET_MCC_CHANNEL_LATENCY, diff --git a/core/hdd/inc/wlan_hdd_apf.h b/core/hdd/inc/wlan_hdd_apf.h index fe1e16df81d4..72bf24c49f49 100644 --- a/core/hdd/inc/wlan_hdd_apf.h +++ b/core/hdd/inc/wlan_hdd_apf.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_apf.h * @@ -49,30 +40,6 @@ #define WLAN_WAIT_TIME_APF_READ_MEM 10000 /** - * struct hdd_apf_context - hdd Context for apf - * @magic: magic number - * @qdf_apf_event: Completion variable for APF get operations - * @capability_response: capabilities response received from fw - * @apf_enabled: True: APF Interpreter enabled, False: Disabled - * @cmd_in_progress: Flag that indicates an APF command is in progress - * @buf: Buffer to accumulate read memory chunks - * @buf_len: Length of the read memory requested - * @offset: APF work memory offset to fetch from - * @lock: APF Context lock - */ -struct hdd_apf_context { - unsigned int magic; - qdf_event_t qdf_apf_event; - struct sir_apf_get_offload capability_response; - bool apf_enabled; - bool cmd_in_progress; - uint8_t *buf; - uint32_t buf_len; - uint32_t offset; - qdf_spinlock_t lock; -}; - -/** * hdd_apf_read_memory_callback - HDD Callback for the APF read memory * operation * @context: Hdd context @@ -90,14 +57,14 @@ hdd_apf_read_memory_callback(void *context, * * Return: None */ -void hdd_apf_context_init(void); +void hdd_apf_context_init(hdd_adapter_t *adapter); /** * hdd_apf_context_destroy - APF Context de-init operations * * Return: None */ -void hdd_apf_context_destroy(void); +void hdd_apf_context_destroy(hdd_adapter_t *adapter); /** * hdd_get_apf_capabilities_cb() - Callback function to get APF capabilities diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index f2e50a83a176..f6d8b8e05111 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_HDD_ASSOC_H__) #define WLAN_HDD_ASSOC_H__ @@ -217,6 +208,7 @@ typedef struct connection_info_s { eCsrAuthType last_auth_type; char auth_time[HDD_TIME_STRING_LEN]; char connect_time[HDD_TIME_STRING_LEN]; + enum phy_ch_width ch_width; } connection_info_t; /* Forward declarations */ diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 69e5b1709847..a89f2e615ae5 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(HDD_CONFIG_H__) #define HDD_CONFIG_H__ @@ -2208,6 +2199,53 @@ enum hdd_dot11_mode { /* * <ini> + * min_delay_btw_roam_scans - Min duration (in sec) allowed btw two + * consecutive roam scans + * @Min: 0 + * @Max: 60 + * @Default: 10 + * + * Roam scan is not allowed if duration between two consecutive + * roam scans is less than this time. + * + * Related: None + * + * Supported Feature: Roaming + * + * Usage: External + * + * </ini> + */ +#define CFG_MIN_DELAY_BTW_ROAM_SCAN_NAME "min_delay_btw_roam_scans" +#define CFG_MIN_DELAY_BTW_ROAM_SCAN_MIN (0) +#define CFG_MIN_DELAY_BTW_ROAM_SCAN_MAX (60) +#define CFG_MIN_DELAY_BTW_ROAM_SCAN_DEFAULT (10) + +/* + * <ini> + * roam_trigger_reason_bitmask - Contains roam_trigger_reasons + * @Min: 0 + * @Max: 0xFFFFFFFF + * @Default: 0xDA + * + * Bitmask containing roam_trigger_reasons for which + * min_delay_btw_roam_scans constraint should be applied. + * + * Related: None + * + * Supported Feature: Roaming + * + * Usage: External + * + * </ini> + */ +#define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_NAME "roam_trigger_reason_bitmask" +#define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_MIN (0) +#define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_MAX (0xFFFFFFFF) +#define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_DEFAULT (0xDA) + +/* + * <ini> * roam_bad_rssi_thresh_offset_2g - RSSI threshold offset for 2G to 5G roam * @Min: 0 * @Max: 86 @@ -2238,6 +2276,56 @@ enum hdd_dot11_mode { /* * <ini> + * ho_delay_for_rx - Delay Hand-off (In msec) by this duration to receive + * pending rx frames from current BSS + * @Min: 0 + * @Max: 200 + * @Default: 0 + * + * For LFR 3.0 roaming scenario, once roam candidate is found, firmware + * waits for minimum this much duration to receive pending rx frames from + * current BSS before switching to new channel for handoff to new AP. + * + * Related: None + * + * Supported Feature: Roaming + * + * Usage: External + * + * </ini> + */ +#define CFG_ROAM_HO_DELAY_FOR_RX_NAME "ho_delay_for_rx" +#define CFG_ROAM_HO_DELAY_FOR_RX_MIN (0) +#define CFG_ROAM_HO_DELAY_FOR_RX_MAX (200) +#define CFG_ROAM_HO_DELAY_FOR_RX_DEFAULT (0) + +/* + * <ini> + * roam_force_rssi_trigger - To set roam scan mode + * irrespective of channel list + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to set roam scan mode + * WMI_ROAM_SCAN_MODE_RSSI_CHANGE, irrespective of whether + * channel list type is CHANNEL_LIST_STATIC or not + * + * Related: None + * + * Supported Feature: Roaming + * + * Usage: External + * + * </ini> + */ +#define CFG_ROAM_FORCE_RSSI_TRIGGER_NAME "roam_force_rssi_trigger" +#define CFG_ROAM_FORCE_RSSI_TRIGGER_MIN (0) +#define CFG_ROAM_FORCE_RSSI_TRIGGER_MAX (1) +#define CFG_ROAM_FORCE_RSSI_TRIGGER_DEFAULT (1) + +/* + * <ini> * roamscan_adaptive_dwell_mode - Sets dwell time adaptive mode * @Min: 0 * @Max: 4 @@ -6088,30 +6176,6 @@ enum hdd_link_speed_rpt_type { #define CFG_VC_MODE_BITMAP_DEFAULT (0x00000005) /* - * Driver Force ACS is reintroduced for android SAP legacy configuration method. - * If Driver force acs is enabled, channel/ hw config from hostapd is ignored. - * Driver uses INI params dot11Mode, channel bonding mode and vht chan width - * to derive ACS HW mode and operating BW. - * - * Non android platforms shall not use force ACS method and rely on hostapd - * driven ACS method for concurrent SAP ACS configuration, OBSS etc. - */ -#define CFG_FORCE_SAP_ACS "gApAutoChannelSelection" -#define CFG_FORCE_SAP_ACS_MIN (0) -#define CFG_FORCE_SAP_ACS_MAX (1) -#define CFG_FORCE_SAP_ACS_DEFAULT (0) - -#define CFG_FORCE_SAP_ACS_START_CH "gAPChannelSelectStartChannel" -#define CFG_FORCE_SAP_ACS_START_CH_MIN (0) -#define CFG_FORCE_SAP_ACS_START_CH_MAX (0xFF) -#define CFG_FORCE_SAP_ACS_START_CH_DEFAULT (1) - -#define CFG_FORCE_SAP_ACS_END_CH "gAPChannelSelectEndChannel" -#define CFG_FORCE_SAP_ACS_END_CH_MIN (0) -#define CFG_FORCE_SAP_ACS_END_CH_MAX (0xFF) -#define CFG_FORCE_SAP_ACS_END_CH_DEFAULT (11) - -/* * <ini> * gEnableSAPManadatoryChanList - Enable SAP Mandatory channel list * Options. @@ -7260,6 +7324,32 @@ enum hdd_link_speed_rpt_type { #define CFG_TDLS_PEER_KICKOUT_THRESHOLD_MAX (5000) #define CFG_TDLS_PEER_KICKOUT_THRESHOLD_DEFAULT (96) +/* + * <ini> + * gTDLSDiscoveryWakeTimeout - TDLS discovery WAKE timeout in ms. + * @Min: 10 + * @Max: 5000 + * @Default: 96 + * + * DUT will wake until this timeout to receive TDLS discovery response + * from peer. If tdls_discovery_wake_timeout is 0x0, the DUT will + * choose autonomously what wake timeout value to use. + * + * + * Related: gEnableTDLSSupport. + * + * Supported Feature: TDLS + * + * Usage: External + * + * </ini> + */ +#define CFG_TDLS_DISCOVERY_WAKE_TIMEOUT "gTDLSDiscoveryWakeTimeout" +#define CFG_TDLS_DISCOVERY_WAKE_TIMEOUT_MIN (0) +#define CFG_TDLS_DISCOVERY_WAKE_TIMEOUT_MAX (2000) +#define CFG_TDLS_DISCOVERY_WAKE_TIMEOUT_DEFAULT (200) + + #endif /* @@ -8823,6 +8913,97 @@ enum hdd_link_speed_rpt_type { #define CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MAX (500) #define CFG_STA_MIRACAST_MCC_REST_TIME_VAL_DEFAULT (400) +/* + * <ini> + * sta_scan_burst_duration - Burst duration in case of split scan. + * @Min: 0 + * @Max: 180 + * @Default: 0 + * + * This ini is used to set burst duration of scan only when STA is active. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: External + * + * </ini> + */ +#define CFG_STA_SCAN_BURST_DURATION_VAL "sta_scan_burst_duration" +#define CFG_STA_SCAN_BURST_DURATION_VAL_MIN (0) +#define CFG_STA_SCAN_BURST_DURATION_VAL_MAX (180) +#define CFG_STA_SCAN_BURST_DURATION_VAL_DEFAULT (0) + +/* + * <ini> + * p2p_scan_burst_duration - Burst duration in case of split scan for p2p scan. + * @Min: 0 + * @Max: 180 + * @Default: 0 + * + * This ini is used to set burst duration of scan for p2p scan requests. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: External + * + * </ini> + */ +#define CFG_P2P_SCAN_BURST_DURATION_VAL "p2p_scan_burst_duration" +#define CFG_P2P_SCAN_BURST_DURATION_VAL_MIN (0) +#define CFG_P2P_SCAN_BURST_DURATION_VAL_MAX (180) +#define CFG_P2P_SCAN_BURST_DURATION_VAL_DEFAULT (0) + +/* + * <ini> + * go_scan_burst_duration - Burst duration in case of split scan when GO is + * active. + * @Min: 0 + * @Max: 180 + * @Default: 0 + * + * This ini is used to set burst duration of scan when GO is active. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: External + * + * </ini> + */ +#define CFG_GO_SCAN_BURST_DURATION_VAL "go_scan_burst_duration" +#define CFG_GO_SCAN_BURST_DURATION_VAL_MIN (0) +#define CFG_GO_SCAN_BURST_DURATION_VAL_MAX (180) +#define CFG_GO_SCAN_BURST_DURATION_VAL_DEFAULT (0) + +/* + * <ini> + * ap_scan_burst_duration - Burst duration in case of split scan when ap + * is active. + * @Min: 0 + * @Max: 32 + * @Default: 0 + * + * This ini is used to set burst duration of scan when SAP is active. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: External + * + * </ini> + */ +#define CFG_AP_SCAN_BURST_DURATION_VAL "ap_scan_burst_duration" +#define CFG_AP_SCAN_BURST_DURATION_VAL_MIN (0) +#define CFG_AP_SCAN_BURST_DURATION_VAL_MAX (32) +#define CFG_AP_SCAN_BURST_DURATION_VAL_DEFAULT (0) + + #ifdef FEATURE_AP_MCC_CH_AVOIDANCE /* * <ini> @@ -8846,21 +9027,44 @@ enum hdd_link_speed_rpt_type { #define CFG_SAP_MCC_CHANNEL_AVOIDANCE_MAX (1) #define CFG_SAP_MCC_CHANNEL_AVOIDANCE_DEFAULT (0) #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ + /* * <ini> - * gAP11ACOverride - Override 11AC when GO follow SAP channel + * gSAP11ACOverride - Override bw to 11ac for SAP + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable 11AC override for SAP. + * Android UI does not provide advanced configuration options + * for SoftAP for Android O and below. + * Default override disabled for android. Can be enabled from + * ini for Android O and below. + * + * + * Supported Feature: SAP + * + * + * Usage: Internal/External + * + * </ini> + */ +#define CFG_SAP_11AC_OVERRIDE_NAME "gSAP11ACOverride" +#define CFG_SAP_11AC_OVERRIDE_MIN (0) +#define CFG_SAP_11AC_OVERRIDE_MAX (1) +#define CFG_SAP_11AC_OVERRIDE_DEFAULT (0) + +/* + * <ini> + * gGO11ACOverride - Override bw to 11ac for P2P GO * @Min: 0 * @Max: 1 * @Default: 1 * - * This ini is used to enable/disable 11AC override. - * 1. P2P GO also follows start_bss and since p2p GO could not be - * configured to setup VHT channel width in wpa_supplicant, driver - * can override 11AC. - * 2. Android UI does not provide advanced configuration options - * for SoftAP - * Default override enabled for android. MDM shall - * disable it in ini + * This ini is used to enable/disable 11AC override for GO. + * P2P GO also follows start_bss and since P2P GO could not be + * configured to setup VHT channel width in wpa_supplicant, driver + * can override 11AC. * * * Supported Feature: P2P @@ -8870,10 +9074,10 @@ enum hdd_link_speed_rpt_type { * * </ini> */ -#define CFG_SAP_P2P_11AC_OVERRIDE_NAME "gAP11ACOverride" -#define CFG_SAP_P2P_11AC_OVERRIDE_MIN (0) -#define CFG_SAP_P2P_11AC_OVERRIDE_MAX (1) -#define CFG_SAP_P2P_11AC_OVERRIDE_DEFAULT (1) +#define CFG_GO_11AC_OVERRIDE_NAME "gGO11ACOverride" +#define CFG_GO_11AC_OVERRIDE_MIN (0) +#define CFG_GO_11AC_OVERRIDE_MAX (1) +#define CFG_GO_11AC_OVERRIDE_DEFAULT (1) #define CFG_SAP_DOT11MC "gSapDot11mc" #define CFG_SAP_DOT11MC_MIN (0) @@ -9175,6 +9379,110 @@ enum hdd_link_speed_rpt_type { /* * <ini> + * gTxAggregationSizeBE - To configure Tx aggregation size for BE queue + * in no of MPDUs + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggregationSizeBE gives an option to configure Tx aggregation size + * for BE queue in no of MPDUs.This can be useful in debugging + * throughput issues + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGREGATION_SIZEBE "gTxAggregationSizeBE" +#define CFG_TX_AGGREGATION_SIZEBE_MIN (0) +#define CFG_TX_AGGREGATION_SIZEBE_MAX (64) +#define CFG_TX_AGGREGATION_SIZEBE_DEFAULT (0) + +/* + * <ini> + * gTxAggregationSizeBK - To configure Tx aggregation size for BK queue + * in no of MPDUs + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggregationSizeBK gives an option to configure Tx aggregation size + * for BK queue in no of MPDUs.This can be useful in debugging + * throughput issues + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGREGATION_SIZEBK "gTxAggregationSizeBK" +#define CFG_TX_AGGREGATION_SIZEBK_MIN (0) +#define CFG_TX_AGGREGATION_SIZEBK_MAX (64) +#define CFG_TX_AGGREGATION_SIZEBK_DEFAULT (0) + +/* + * <ini> + * gTxAggregationSizeVI - To configure Tx aggregation size for VI queue + * in no of MPDUs + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggregationSizeVI gives an option to configure Tx aggregation size + * for VI queue in no of MPDUs.This can be useful in debugging + * throughput issues + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGREGATION_SIZEVI "gTxAggregationSizeVI" +#define CFG_TX_AGGREGATION_SIZEVI_MIN (0) +#define CFG_TX_AGGREGATION_SIZEVI_MAX (64) +#define CFG_TX_AGGREGATION_SIZEVI_DEFAULT (0) + +/* + * <ini> + * gTxAggregationSizeVO - To configure Tx aggregation size for VO queue + * in no of MPDUs + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggregationSizeVO gives an option to configure Tx aggregation size + * for BE queue in no of MPDUs.This can be useful in debugging + * throughput issues + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGREGATION_SIZEVO "gTxAggregationSizeVO" +#define CFG_TX_AGGREGATION_SIZEVO_MIN (0) +#define CFG_TX_AGGREGATION_SIZEVO_MAX (64) +#define CFG_TX_AGGREGATION_SIZEVO_DEFAULT (0) + +/* + * <ini> * gRxAggregationSize - Gives an option to configure Rx aggregation size * in no of MPDUs * @Min: 1 @@ -9199,6 +9507,102 @@ enum hdd_link_speed_rpt_type { #define CFG_RX_AGGREGATION_SIZE_DEFAULT (64) /* + * <ini> + * gTxAggSwRetryBE - Configure Tx aggregation sw retry for BE + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryBE gives an option to configure Tx aggregation sw + * retry for BE. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_BE "gTxAggSwRetryBE" +#define CFG_TX_AGGR_SW_RETRY_BE_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_BE_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_BE_DEFAULT (0) + +/* + * <ini> + * gTxAggSwRetryBK - Configure Tx aggregation sw retry for BK + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryBK gives an option to configure Tx aggregation sw + * retry for BK. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_BK "gTxAggSwRetryBK" +#define CFG_TX_AGGR_SW_RETRY_BK_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_BK_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_BK_DEFAULT (0) + +/* + * <ini> + * gTxAggSwRetryVI - Configure Tx aggregation sw retry for VI + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryVI gives an option to configure Tx aggregation sw + * retry for VI. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_VI "gTxAggSwRetryVI" +#define CFG_TX_AGGR_SW_RETRY_VI_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_VI_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_VI_DEFAULT (0) + +/* + * <ini> + * gTxAggSwRetryVO - Configure Tx aggregation sw retry for VO + * @Min: 0 + * @Max: 64 + * @Default: 0 + * + * gTxAggSwRetryVO gives an option to configure Tx aggregation sw + * retry for VO. This can be useful in debugging throughput issues. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal + * + * </ini> + */ + +#define CFG_TX_AGGR_SW_RETRY_VO "gTxAggSwRetryVO" +#define CFG_TX_AGGR_SW_RETRY_VO_MIN (0) +#define CFG_TX_AGGR_SW_RETRY_VO_MAX (64) +#define CFG_TX_AGGR_SW_RETRY_VO_DEFAULT (0) + +/* * fine timing measurement capability information * * <----- fine_time_meas_cap (in bits) -----> @@ -9383,6 +9787,30 @@ enum dot11p_mode { #define CFG_STA_SAP_SCC_ON_DFS_CHAN_DEFAULT (0) /* + * <ini> + * g_sta_sap_scc_on_lte_coex_chan - Allow STA+SAP SCC on LTE coex channel + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to allow STA+SAP SCC on LTE coex channel + * 0 - Disallow STA+SAP SCC on LTE coex channel + * 1 - Allow STA+SAP SCC on LTE coex channel + * + * Related: None. + * + * Supported Feature: Non-DBS, DBS + * + * Usage: Internal/External + * + * </ini> + */ +#define CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN "g_sta_sap_scc_on_lte_coex_chan" +#define CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN_MIN (0) +#define CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN_MAX (1) +#define CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN_DEFAULT (0) + +/* * gPNOChannelPrediction will allow user to enable/disable the * PNO channel prediction feature. * In current PNO implementation, scan is always done until all configured @@ -10334,7 +10762,7 @@ enum restart_beaconing_on_ch_avoid_rule { * fw_timeout_crash - Enable/Disable BUG ON * @Min: 0 * @Max: 1 - * @Default: 0 + * @Default: 1 * * This ini is used to Trigger host crash when firmware fails to send the * response to host @@ -10352,7 +10780,7 @@ enum restart_beaconing_on_ch_avoid_rule { #define CFG_CRASH_FW_TIMEOUT_NAME "fw_timeout_crash" #define CFG_CRASH_FW_TIMEOUT_DISABLE (0) #define CFG_CRASH_FW_TIMEOUT_ENABLE (1) -#define CFG_CRASH_FW_TIMEOUT_DEFAULT (0) +#define CFG_CRASH_FW_TIMEOUT_DEFAULT (1) /* Hold wakelock for unicast RX packets for the specified duration */ #define CFG_RX_WAKELOCK_TIMEOUT_NAME "rx_wakelock_timeout" @@ -10957,29 +11385,6 @@ enum restart_beaconing_on_ch_avoid_rule { /* * <ini> - * gBmpsModListenInterval - Set BMPS Moderate Listen Interval - * @Min: 1 - * @Max: 65535 - * @Default: 1 - * - * This ini is used to set BMPS Moderate Listen Interval. If gPowerUsage - * is set "Mod", this INI need to be set. - * - * Related: gEnableBmps, gPowerUsage - * - * Supported Feature: Power Save - * - * Usage: External - * - * </ini> - */ -#define CFG_BMPS_MODERATE_LI_NAME "gBmpsModListenInterval" -#define CFG_BMPS_MODERATE_LI_MIN (1) -#define CFG_BMPS_MODERATE_LI_MAX (65535) -#define CFG_BMPS_MODERATE_LI_DEFAULT (1) - -/* - * <ini> * gBmpsMaxListenInterval - Set BMPS Maximum Listen Interval * @Min: 1 * @Max: 65535 @@ -12168,14 +12573,51 @@ enum hw_filter_mode { #define CFG_ACTION_OUI_CCKM_1X1_NAME "gActionOUICCKM1X1" #define CFG_ACTION_OUI_CCKM_1X1_DEFAULT "" -/* End of action oui inis */ +/* + * <ini> + * gActionOUIITOAlternate - Used to specify action OUIs to have alternate ITO in + * weak RSSI state + * + * This ini is used to specify AP OUIs for which the stations will have + * alternate ITOs for the case when the RSSI is weak. + * + * Related: None + * + * Supported Feature: Action OUIs + * + * Usage: External + * + * </ini> + */ + #define CFG_ACTION_OUI_ITO_ALTERNATE_NAME "gActionOUIITOAlternate" + #define CFG_ACTION_OUI_ITO_ALTERNATE_DEFAULT "001018 06 0202001c0000 FC 01" + +/* + * <ini> + * gActionOUISwitchTo11nMode - Used to specify action OUIs for switching to 11n + * + * This ini is used to specify which AP for which the connection has to be + * made in 2x2 mode with HT capabilities only and not VHT. + * + * Related: None + * + * Supported Feature: Action OUIs + * + * Usage: External + * + * </ini> + */ +#define CFG_ACTION_OUI_SWITCH_TO_11N_MODE_NAME "gActionOUISwitchTo11nMode" +#define CFG_ACTION_OUI_SWITCH_TO_11N_MODE_DEFAULT "00904C 03 FFFFBF 20 21 40" + + /* End of action oui inis */ /* * <ini> * g_sap_chanswitch_beacon_cnt - channel switch beacon count * @Min: 1 - * @Max: 5 - * @Default: 5 + * @Max: 10 + * @Default: 10 * * This ini is used to configure channel switch beacon count * @@ -12188,7 +12630,7 @@ enum hw_filter_mode { #define CFG_SAP_CH_SWITCH_BEACON_CNT "g_sap_chanswitch_beacon_cnt" #define CFG_SAP_CH_SWITCH_BEACON_CNT_MIN (1) #define CFG_SAP_CH_SWITCH_BEACON_CNT_MAX (10) -#define CFG_SAP_CH_SWITCH_BEACON_CNT_DEFAULT (5) +#define CFG_SAP_CH_SWITCH_BEACON_CNT_DEFAULT (10) /* * <ini> @@ -12896,7 +13338,7 @@ enum hw_filter_mode { */ #define CFG_IS_SAE_ENABLED_NAME "sae_enabled" -#define CFG_IS_SAE_ENABLED_DEFAULT (0) +#define CFG_IS_SAE_ENABLED_DEFAULT (1) #define CFG_IS_SAE_ENABLED_MIN (0) #define CFG_IS_SAE_ENABLED_MAX (1) @@ -14120,7 +14562,7 @@ enum hw_filter_mode { #define CFG_ENABLE_GCMP_NAME "gcmp_enabled" #define CFG_ENABLE_GCMP_MIN (0) #define CFG_ENABLE_GCMP_MAX (1) -#define CFG_ENABLE_GCMP_DEFAULT (0) +#define CFG_ENABLE_GCMP_DEFAULT (1) /* * <ini> @@ -14355,7 +14797,7 @@ enum hw_filter_mode { * gTxSchDelay - Enable/Disable Tx sch delay * @Min: 0 * @Max: 5 - * @Default: 2 + * @Default: 0 * * Usage: Internal/External * @@ -14365,7 +14807,7 @@ enum hw_filter_mode { #define CFG_TX_SCH_DELAY_NAME "gTxSchDelay" #define CFG_TX_SCH_DELAY_MIN (0) #define CFG_TX_SCH_DELAY_MAX (5) -#define CFG_TX_SCH_DELAY_DEFAULT (2) +#define CFG_TX_SCH_DELAY_DEFAULT (0) /* * <ini> @@ -14383,6 +14825,48 @@ enum hw_filter_mode { #define CFG_ENABLE_RTT_MAC_RANDOMIZATION_MAX (1) #define CFG_ENABLE_RTT_MAC_RANDOMIZATION_DEFAULT (0) +/* + * <ini> + * gEnableUnitTestFramework - Enable/Disable unit test framework + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * Usage: Internal (only for dev and test team) + * + * </ini> + */ +#define CFG_ENABLE_UNIT_TEST_FRAMEWORK_NAME "gEnableUnitTestFramework" +#define CFG_ENABLE_UNIT_TEST_FRAMEWORK_MIN (0) +#define CFG_ENABLE_UNIT_TEST_FRAMEWORK_MAX (1) +#define CFG_ENABLE_UINT_TEST_FRAMEWORK_DEFAULT (0) + +/* + * <ini> + * gEnableSecondaryRate - Enable/Disable Secondary Retry Rate feature subset + * + * @Min: 0x0 + * @Max: 0x3F + * @Default: 0x18 + * + * It is a 32 bit value such that the various bits represent as below - + * Bit-0 : is Enable/Disable Control for "PPDU Secondary Retry Support" + * Bit-1 : is Enable/Disable Control for "RTS Black/White-listing Support" + * Bit-2 : is Enable/Disable Control for "Higher MCS retry restriction + * on XRETRY failures" + * Bit 3-5 : is "Xretry threshold" to use + * Bit 3~31 : reserved for future use. + * + * Usage: External + * + * </ini> + */ + +#define CFG_ENABLE_SECONDARY_RATE_NAME "gEnableSecondaryRate" +#define CFG_ENABLE_SECONDARY_RATE_MIN (0) +#define CFG_ENABLE_SECONDARY_RATE_MAX (0x3F) +#define CFG_ENABLE_SECONDARY_RATE_DEFAULT (0x18) + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -14407,7 +14891,6 @@ struct hdd_config { bool is_ps_enabled; uint32_t auto_bmps_timer_val; uint32_t icmp_disable_ps_val; - uint32_t nBmpsModListenInterval; uint32_t nBmpsMaxListenInterval; uint32_t nBmpsMinListenInterval; enum hdd_dot11_mode dot11Mode; @@ -14752,6 +15235,7 @@ struct hdd_config { uint8_t fTDLSPrefOffChanBandwidth; uint8_t enable_tdls_scan; uint32_t tdls_peer_kickout_threshold; + uint32_t tdls_discovery_wake_timeout; #endif #ifdef WLAN_SOFTAP_VSTA_FEATURE bool fEnableVSTASupport; @@ -14914,9 +15398,6 @@ struct hdd_config { #endif /* Flag to indicate crash inject enabled or not */ bool crash_inject_enabled; - uint8_t force_sap_acs; - uint8_t force_sap_acs_st_ch; - uint8_t force_sap_acs_end_ch; uint8_t enable_sap_mandatory_chan_list; int32_t dfsRadarPriMultiplier; uint8_t reorderOffloadSupport; @@ -14975,11 +15456,16 @@ struct hdd_config { uint8_t is_sta_connection_in_5gz_enabled; uint16_t p2p_listen_defer_interval; uint32_t sta_miracast_mcc_rest_time_val; + uint32_t sta_scan_burst_duration; + uint32_t p2p_scan_burst_duration; + uint32_t go_scan_burst_duration; + uint32_t ap_scan_burst_duration; bool is_ramdump_enabled; #ifdef FEATURE_AP_MCC_CH_AVOIDANCE bool sap_channel_avoidance; #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ - uint8_t sap_p2p_11ac_override; + uint8_t sap_11ac_override; + uint8_t go_11ac_override; uint8_t sap_dot11mc; uint8_t prefer_non_dfs_on_radar; bool ignore_peer_erp_info; @@ -15017,6 +15503,7 @@ struct hdd_config { uint32_t dual_mac_feature_disable; uint8_t dbs_scan_selection[CFG_DBS_SCAN_PARAM_LENGTH]; uint32_t sta_sap_scc_on_dfs_chan; + uint32_t sta_sap_scc_on_lte_coex_chan; bool tx_chain_mask_cck; uint8_t tx_chain_mask_1ss; bool smart_chainmask_enabled; @@ -15059,6 +15546,9 @@ struct hdd_config { uint32_t roam_dense_min_aps; int8_t roam_bg_scan_bad_rssi_thresh; uint8_t roam_bad_rssi_thresh_offset_2g; + uint32_t ho_delay_for_rx; + uint32_t min_delay_btw_roam_scans; + uint32_t roam_trigger_reason_bitmask; uint32_t roam_bg_scan_client_bitmap; bool enable_edca_params; uint32_t edca_vo_cwmin; @@ -15120,7 +15610,15 @@ struct hdd_config { bool goptimize_chan_avoid_event; bool enable_go_cts2self_for_sta; uint32_t tx_aggregation_size; + uint32_t tx_aggregation_size_be; + uint32_t tx_aggregation_size_bk; + uint32_t tx_aggregation_size_vi; + uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; bool sta_prefer_80MHz_over_160MHz; uint8_t sap_max_inactivity_override; bool fw_timeout_crash; @@ -15229,6 +15727,8 @@ struct hdd_config { uint8_t action_oui_connect_1x1[MAX_ACTION_OUI_STRING_LEN]; uint8_t action_oui_ito_extension[MAX_ACTION_OUI_STRING_LEN]; uint8_t action_oui_cckm_1x1[MAX_ACTION_OUI_STRING_LEN]; + uint8_t action_oui_ito_alternate[MAX_ACTION_OUI_STRING_LEN]; + uint8_t action_oui_switch_to_11n[MAX_ACTION_OUI_STRING_LEN]; uint8_t rssi_weightage; uint8_t ht_caps_weightage; uint8_t vht_caps_weightage; @@ -15295,6 +15795,9 @@ struct hdd_config { #endif bool enable_rtt_mac_randomization; bool enable_ftopen; + bool is_unit_test_framework_enabled; + uint32_t enable_secondary_rate; + bool roam_force_rssi_trigger; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/inc/wlan_hdd_conc_ut.h b/core/hdd/inc/wlan_hdd_conc_ut.h index 30740a143c4e..83052d69aec3 100644 --- a/core/hdd/inc/wlan_hdd_conc_ut.h +++ b/core/hdd/inc/wlan_hdd_conc_ut.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_CONC_UT_H #define __WLAN_HDD_CONC_UT_H diff --git a/core/hdd/inc/wlan_hdd_debugfs.h b/core/hdd/inc/wlan_hdd_debugfs.h index 2ac5a8f37090..463dcbf4630c 100644 --- a/core/hdd/inc/wlan_hdd_debugfs.h +++ b/core/hdd/inc/wlan_hdd_debugfs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _WLAN_HDD_DEBUGFS_H #define _WLAN_HDD_DEBUGFS_H diff --git a/core/hdd/inc/wlan_hdd_debugfs_csr.h b/core/hdd/inc/wlan_hdd_debugfs_csr.h index be4d77932c3c..77df23418952 100644 --- a/core/hdd/inc/wlan_hdd_debugfs_csr.h +++ b/core/hdd/inc/wlan_hdd_debugfs_csr.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_debugfs_csr.h * diff --git a/core/hdd/inc/wlan_hdd_debugfs_llstat.h b/core/hdd/inc/wlan_hdd_debugfs_llstat.h index a56fd608c733..f14869171d26 100644 --- a/core/hdd/inc/wlan_hdd_debugfs_llstat.h +++ b/core/hdd/inc/wlan_hdd_debugfs_llstat.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_debugfs_llstat.h * diff --git a/core/hdd/inc/wlan_hdd_driver_ops.h b/core/hdd/inc/wlan_hdd_driver_ops.h index b287cfa8ff83..1f2295b5ec3d 100644 --- a/core/hdd/inc/wlan_hdd_driver_ops.h +++ b/core/hdd/inc/wlan_hdd_driver_ops.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_DRIVER_OPS_H__ #define __WLAN_HDD_DRIVER_OPS_H__ diff --git a/core/hdd/inc/wlan_hdd_ether.h b/core/hdd/inc/wlan_hdd_ether.h index 3edc02b2896d..b7c156d6e5a7 100644 --- a/core/hdd/inc/wlan_hdd_ether.h +++ b/core/hdd/inc/wlan_hdd_ether.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _WLAN_HDD_ETHER_H #define _WLAN_HDD_ETHER_H /** diff --git a/core/hdd/inc/wlan_hdd_ftm.h b/core/hdd/inc/wlan_hdd_ftm.h index 6c0f1ab0ca4f..712ce872d4bf 100644 --- a/core/hdd/inc/wlan_hdd_ftm.h +++ b/core/hdd/inc/wlan_hdd_ftm.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WLAN_HDD_FTM_H #define WLAN_HDD_FTM_H diff --git a/core/hdd/inc/wlan_hdd_host_offload.h b/core/hdd/inc/wlan_hdd_host_offload.h index 52ae77fbba8f..b1a30dcd4f82 100644 --- a/core/hdd/inc/wlan_hdd_host_offload.h +++ b/core/hdd/inc/wlan_hdd_host_offload.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_HOST_OFFLOAD_H__ #define __WLAN_HDD_HOST_OFFLOAD_H__ diff --git a/core/hdd/inc/wlan_hdd_includes.h b/core/hdd/inc/wlan_hdd_includes.h index 1a89e405ace3..031ec7b87d4d 100644 --- a/core/hdd/inc/wlan_hdd_includes.h +++ b/core/hdd/inc/wlan_hdd_includes.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014, 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(HDD_INCLUDES_H__) #define HDD_INCLUDES_H__ diff --git a/core/hdd/inc/wlan_hdd_ipa.h b/core/hdd/inc/wlan_hdd_ipa.h index 14a34f1c49ee..54813cd7ca04 100644 --- a/core/hdd/inc/wlan_hdd_ipa.h +++ b/core/hdd/inc/wlan_hdd_ipa.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef HDD_IPA_H__ #define HDD_IPA_H__ @@ -32,7 +23,6 @@ * DOC: wlan_hdd_ipa.h * * WLAN IPA interface module headers - * Originally written by Qualcomm Atheros, Inc */ /** @@ -98,7 +88,7 @@ int hdd_ipa_resume(hdd_context_t *hdd_ctx); void hdd_ipa_uc_stat_query(hdd_context_t *hdd_ctx, uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff); void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx); -void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason); +void hdd_ipa_uc_stat_request(hdd_context_t *hdd_ctx, uint8_t reason); void hdd_ipa_uc_sharing_stats_request(hdd_adapter_t *adapter, uint8_t reset_stats); void hdd_ipa_uc_set_quota(hdd_adapter_t *adapter, uint8_t set_quota, diff --git a/core/hdd/inc/wlan_hdd_lro.h b/core/hdd/inc/wlan_hdd_lro.h index 99caa8666a39..c744c3b100d0 100644 --- a/core/hdd/inc/wlan_hdd_lro.h +++ b/core/hdd/inc/wlan_hdd_lro.h @@ -1,8 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -18,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_LRO_H__ #define __WLAN_HDD_LRO_H__ /** diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 6cf2fe2c27ea..11dcc65582f7 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_HDD_MAIN_H) #define WLAN_HDD_MAIN_H /** @@ -61,6 +52,7 @@ #include <cdp_txrx_peer_ops.h> #include "wlan_hdd_nan_datapath.h" #include "target_if_def_config.h" +#include "wlan_hdd_apf.h" /** Number of Tx Queues */ #ifdef QCA_LL_TX_FLOW_CONTROL_V2 @@ -411,24 +403,27 @@ struct statsContext { unsigned int magic; }; -struct linkspeedContext { - struct completion completion; - hdd_adapter_t *pAdapter; - unsigned int magic; -}; - /** - * struct random_mac_context - Context used with hdd_random_mac_callback - * @random_mac_completion: Event on which hdd_set_random_mac will wait - * @adapter: Pointer to adapter - * @magic: For valid context this is set to ACTION_FRAME_RANDOM_CONTEXT_MAGIC - * @set_random_addr: Status of random filter set + * struct hdd_apf_context - hdd Context for apf + * @magic: magic number + * @qdf_apf_event: Completion variable for APF get operations + * @capability_response: capabilities response received from fw + * @apf_enabled: True: APF Interpreter enabled, False: Disabled + * @cmd_in_progress: Flag that indicates an APF command is in progress + * @buf: Buffer to accumulate read memory chunks + * @buf_len: Length of the read memory requested + * @offset: APF work memory offset to fetch from + * @lock: APF Context lock */ -struct random_mac_context { - struct completion random_mac_completion; - hdd_adapter_t *adapter; +struct hdd_apf_context { unsigned int magic; - bool set_random_addr; + qdf_event_t qdf_apf_event; + bool apf_enabled; + bool cmd_in_progress; + uint8_t *buf; + uint32_t buf_len; + uint32_t offset; + qdf_spinlock_t lock; }; extern spinlock_t hdd_context_lock; @@ -438,12 +433,9 @@ extern struct mutex hdd_init_deinit_lock; #define PEER_INFO_CONTEXT_MAGIC 0x50494E46 /* PEER_INFO(PINF) */ #define POWER_CONTEXT_MAGIC 0x504F5752 /* POWR */ #define SNR_CONTEXT_MAGIC 0x534E5200 /* SNR */ -#define LINK_CONTEXT_MAGIC 0x4C494E4B /* LINKSPEED */ #define LINK_STATUS_MAGIC 0x4C4B5354 /* LINKSTATUS(LNST) */ -#define TEMP_CONTEXT_MAGIC 0x74656d70 /* TEMP (temperature) */ #define APF_CONTEXT_MAGIC 0x4575354 /* APF */ #define POWER_STATS_MAGIC 0x14111990 -#define RCPI_CONTEXT_MAGIC 0x7778888 /* RCPI */ #define ACTION_FRAME_RANDOM_CONTEXT_MAGIC 0x87878787 /* MAX OS Q block time value in msec @@ -1383,8 +1375,9 @@ struct hdd_adapter_s { struct net_device_stats stats; /** HDD statistics*/ hdd_stats_t hdd_stats; - /** linkspeed statistics */ - tSirLinkSpeedInfo ls_stats; + + /* estimated link speed */ + u32 estimated_linkspeed; /* SAP peer station info */ struct sir_peer_sta_info peer_sta_info; @@ -1553,14 +1546,8 @@ struct hdd_adapter_s { /* Time stamp for start RoC request */ uint64_t start_roc_ts; - /* State for synchronous OCB requests to WMI */ - struct sir_ocb_set_config_response ocb_set_config_resp; - struct sir_ocb_get_tsf_timer_response ocb_get_tsf_timer_resp; - struct sir_dcc_get_stats_response *dcc_get_stats_resp; - struct sir_dcc_update_ndl_response dcc_update_ndl_resp; - - /* MAC addresses used for OCB interfaces */ #ifdef WLAN_FEATURE_DSRC + /* MAC addresses used for OCB interfaces */ struct qdf_mac_addr ocb_mac_address[QDF_MAX_CONCURRENCY_PERSONA]; int ocb_mac_addr_count; #endif @@ -1617,7 +1604,7 @@ struct hdd_adapter_s { struct hdd_ns_offload_info ns_offload_info; qdf_mutex_t ns_offload_info_lock; #endif - bool apf_enabled; + struct hdd_apf_context apf_context; }; #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) @@ -1802,7 +1789,7 @@ struct suspend_resume_stats { * @response_event: NUD stats request wait event */ struct hdd_nud_stats_context { - struct completion response_event; + qdf_event_t response_event; }; /** @@ -2150,7 +2137,9 @@ struct hdd_context_s { struct completion set_antenna_mode_cmpl; /* Current number of TX X RX chains being used */ enum antenna_mode current_antenna_mode; - bool apf_enabled; + bool apf_supported; + bool apf_enabled_v2; + uint32_t apf_version; /* the radio index assigned by cnss_logger */ int radio_index; @@ -2233,6 +2222,10 @@ struct hdd_context_s { #endif struct hdd_cache_channels *original_channels; qdf_mutex_t cache_channel_lock; + + /* defining the board related information */ + uint32_t hw_bd_id; + struct board_info hw_bd_info; }; int hdd_validate_channel_and_bandwidth(hdd_adapter_t *adapter, @@ -2873,7 +2866,7 @@ static inline int wlan_hdd_validate_session_id(u8 session_id) return -EINVAL; } -bool hdd_is_roaming_in_progress(hdd_adapter_t *adapter); +bool hdd_is_roaming_in_progress(hdd_context_t *hdd_ctx); void hdd_set_roaming_in_progress(bool value); /** * hdd_check_for_opened_interfaces()- Check for interface up @@ -2896,7 +2889,9 @@ void hdd_set_rx_mode_rps(hdd_context_t *hdd_ctx, void *padapter, bool enable); */ static inline void hdd_init_nud_stats_ctx(hdd_context_t *hdd_ctx) { - init_completion(&hdd_ctx->nud_stats_context.response_event); + if (qdf_event_create(&hdd_ctx->nud_stats_context.response_event) != + QDF_STATUS_SUCCESS) + hdd_err("NUD stats response event init failed!"); } /** @@ -3076,7 +3071,7 @@ void hdd_pld_ipa_uc_shutdown_pipes(void); * * Return: None */ -void hdd_drv_ops_inactivity_handler(void); +void hdd_drv_ops_inactivity_handler(unsigned long arg); /** * hdd_start_driver_ops_timer() - Starts driver ops inactivity timer @@ -3125,4 +3120,32 @@ bool hdd_is_cli_iface_up(hdd_context_t *hdd_ctx); */ void wlan_hdd_free_cache_channels(hdd_context_t *hdd_ctx); +/** + * hdd_wlan_get_version() - Get version information + * @hdd_ctx: Global HDD context + * @version_len: length of the version buffer size + * @version: the buffer to the version string + * + * This function is used to get Wlan Driver, Firmware, Hardware Version + * & the Board related information. + * + * Return: the length of the version string + */ +uint32_t hdd_wlan_get_version(hdd_context_t *hdd_ctx, + const size_t version_len, uint8_t *version); + +/** + * hdd_update_hw_sw_info() - API to update the HW/SW information + * @hdd_ctx: Global HDD context + * + * API to update the HW and SW information in the driver + * + * Note: + * All the version/revision information would only be retrieved after + * firmware download + * + * Return: None + */ +void hdd_update_hw_sw_info(hdd_context_t *hdd_ctx); + #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/inc/wlan_hdd_misc.h b/core/hdd/inc/wlan_hdd_misc.h index 0ca4a05e25bb..609e07bb7a0d 100644 --- a/core/hdd/inc/wlan_hdd_misc.h +++ b/core/hdd/inc/wlan_hdd_misc.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2014,2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WLAN_HDD_MISC_H #define WLAN_HDD_MISC_H /* diff --git a/core/hdd/inc/wlan_hdd_nan.h b/core/hdd/inc/wlan_hdd_nan.h index 02947164e359..7e178bd6a1ae 100644 --- a/core/hdd/inc/wlan_hdd_nan.h +++ b/core/hdd/inc/wlan_hdd_nan.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_NAN_H #define __WLAN_HDD_NAN_H diff --git a/core/hdd/inc/wlan_hdd_napi.h b/core/hdd/inc/wlan_hdd_napi.h index ece8d0bb3ef0..d813a4388295 100644 --- a/core/hdd/inc/wlan_hdd_napi.h +++ b/core/hdd/inc/wlan_hdd_napi.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __HDD_NAPI_H__ #define __HDD_NAPI_H__ diff --git a/core/hdd/inc/wlan_hdd_oemdata.h b/core/hdd/inc/wlan_hdd_oemdata.h index ca580d60842d..c4d7eb948039 100644 --- a/core/hdd/inc/wlan_hdd_oemdata.h +++ b/core/hdd/inc/wlan_hdd_oemdata.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_oemdata.h * diff --git a/core/hdd/inc/wlan_hdd_p2p.h b/core/hdd/inc/wlan_hdd_p2p.h index 53d8954326fd..67e3bf5b699a 100644 --- a/core/hdd/inc/wlan_hdd_p2p.h +++ b/core/hdd/inc/wlan_hdd_p2p.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __P2P_H #define __P2P_H diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h index ecb062e9839d..f023536b9224 100644 --- a/core/hdd/inc/wlan_hdd_power.h +++ b/core/hdd/inc/wlan_hdd_power.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_POWER_H #define __WLAN_HDD_POWER_H diff --git a/core/hdd/inc/wlan_hdd_regulatory.h b/core/hdd/inc/wlan_hdd_regulatory.h index d914889ad095..ea973880b3cf 100644 --- a/core/hdd/inc/wlan_hdd_regulatory.h +++ b/core/hdd/inc/wlan_hdd_regulatory.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined __HDD_REGULATORY_H #define __HDD_REGULATORY_H diff --git a/core/hdd/inc/wlan_hdd_softap_tx_rx.h b/core/hdd/inc/wlan_hdd_softap_tx_rx.h index b8ca634f7483..73e2cab90f59 100644 --- a/core/hdd/inc/wlan_hdd_softap_tx_rx.h +++ b/core/hdd/inc/wlan_hdd_softap_tx_rx.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_HDD_SOFTAP_TX_RX_H) #define WLAN_HDD_SOFTAP_TX_RX_H @@ -38,7 +29,7 @@ #include <cdp_txrx_peer_ops.h> netdev_tx_t hdd_softap_hard_start_xmit(struct sk_buff *skb, - struct net_device *dev); + struct net_device *dev); void hdd_softap_tx_timeout(struct net_device *dev); QDF_STATUS hdd_softap_init_tx_rx(hdd_adapter_t *pAdapter); QDF_STATUS hdd_softap_deinit_tx_rx(hdd_adapter_t *pAdapter); diff --git a/core/hdd/inc/wlan_hdd_sysfs.h b/core/hdd/inc/wlan_hdd_sysfs.h index ca6b51d50ad0..3d34791dbc60 100644 --- a/core/hdd/inc/wlan_hdd_sysfs.h +++ b/core/hdd/inc/wlan_hdd_sysfs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index a8d691795ff8..4c6a12f85900 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __HDD_TDLS_H #define __HDD_TDLS_H /** @@ -496,6 +487,7 @@ typedef struct { uint32_t puapsd_rx_frame_threshold; uint32_t teardown_notification_ms; uint32_t tdls_peer_kickout_threshold; + uint32_t tdls_discovery_wake_timeout; } tdlsInfo_t; int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter); diff --git a/core/hdd/inc/wlan_hdd_trace.h b/core/hdd/inc/wlan_hdd_trace.h index 4066c48e5ea2..ecb97c8f730c 100644 --- a/core/hdd/inc/wlan_hdd_trace.h +++ b/core/hdd/inc/wlan_hdd_trace.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_TRACE_H__ #define __WLAN_HDD_TRACE_H__ diff --git a/core/hdd/inc/wlan_hdd_tsf.h b/core/hdd/inc/wlan_hdd_tsf.h index ee6d7a1eb694..2e9107d9a357 100644 --- a/core/hdd/inc/wlan_hdd_tsf.h +++ b/core/hdd/inc/wlan_hdd_tsf.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined WLAN_HDD_TSF_H #define WLAN_HDD_TSF_H diff --git a/core/hdd/inc/wlan_hdd_tx_rx.h b/core/hdd/inc/wlan_hdd_tx_rx.h index baaa1c28115a..b48f4959356f 100644 --- a/core/hdd/inc/wlan_hdd_tx_rx.h +++ b/core/hdd/inc/wlan_hdd_tx_rx.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_HDD_TX_RX_H) #define WLAN_HDD_TX_RX_H @@ -248,4 +239,22 @@ hdd_skb_fill_gso_size(struct net_device *dev, } } +#ifdef CONFIG_HL_SUPPORT +static inline QDF_STATUS +hdd_skb_nontso_linearize(struct sk_buff *skb) +{ + return QDF_STATUS_SUCCESS; +} +#else +static inline QDF_STATUS +hdd_skb_nontso_linearize(struct sk_buff *skb) +{ + if (qdf_nbuf_is_nonlinear(skb) && qdf_nbuf_is_tso(skb) == false) { + if (qdf_unlikely(skb_linearize(skb))) + return QDF_STATUS_E_NOMEM; + } + return QDF_STATUS_SUCCESS; +} +#endif + #endif /* end #if !defined(WLAN_HDD_TX_RX_H) */ diff --git a/core/hdd/inc/wlan_hdd_wext.h b/core/hdd/inc/wlan_hdd_wext.h index 7f20207947fa..3fc6d0f8d81a 100644 --- a/core/hdd/inc/wlan_hdd_wext.h +++ b/core/hdd/inc/wlan_hdd_wext.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WEXT_IW_H__ #define __WEXT_IW_H__ @@ -152,12 +143,6 @@ enum hdd_wlan_wmm_ts_info_ack_policy { HDD_WLAN_WMM_TS_INFO_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK = 1, }; -/* Source for peer rssi request */ -enum hdd_wlan_get_peer_rssi_source { - HDD_WLAN_GET_PEER_RSSI_SOURCE_USER = 0, - HDD_WLAN_GET_PEER_RSSI_SOURCE_DRIVER = 1, -}; - /** Maximum Length of WPA/RSN IE */ #define MAX_WPA_RSN_IE_LEN 255 @@ -331,9 +316,6 @@ extern int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter, extern int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter, union iwreq_data *wrqu); extern void hdd_display_stats_help(void); -extern void hdd_wlan_get_version(hdd_context_t *hdd_ctx, - union iwreq_data *wrqu, char *extra); - extern void hdd_wlan_get_stats(hdd_adapter_t *pAdapter, uint16_t *length, char *buffer, uint16_t buf_len); extern void hdd_wlan_list_fw_profile(uint16_t *length, @@ -374,8 +356,20 @@ extern int hdd_priv_get_data(struct iw_point *p_priv_data, extern void *mem_alloc_copy_from_user_helper(const void *wrqu_data, size_t len); -int wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *pAdapter, - struct qdf_mac_addr mac_address); +/** + * wlan_hdd_get_linkspeed_for_peermac() - Get link speed for a peer + * @adapter: adapter upon which the peer is active + * @mac_address: MAC address of the peer + * @linkspeed: pointer to memory where returned link speed is to be placed + * + * This function will send a query to SME for the linkspeed of the + * given peer, and then wait for the callback to be invoked. + * + * Return: 0 if linkspeed data is available, negative errno otherwise + */ +int wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *adapter, + struct qdf_mac_addr *mac_address, + uint32_t *linkspeed); void hdd_clear_roam_profile_ie(hdd_adapter_t *pAdapter); uint8_t *wlan_hdd_get_vendor_oui_ie_ptr(uint8_t *oui, uint8_t oui_size, @@ -409,14 +403,13 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed); * wlan_hdd_get_peer_rssi() - get station's rssi * @adapter: hostapd interface * @macaddress: peer sta mac address or ff:ff:ff:ff:ff:ff to query all peer - * @source : source of the request hdd_wlan_get_peer_rssi_source * * This function will call sme_get_peer_info to get rssi * * Return: 0 on success, otherwise error value */ int wlan_hdd_get_peer_rssi(hdd_adapter_t *adapter, - struct qdf_mac_addr *macaddress, int request_source); + struct qdf_mac_addr *macaddress); /** * wlan_hdd_set_mon_chan() - Set capture channel on the monitor mode interface. * @adapter: Handle to adapter diff --git a/core/hdd/inc/wlan_hdd_wmm.h b/core/hdd/inc/wlan_hdd_wmm.h index f0a55b1222ef..30a5b202192e 100644 --- a/core/hdd/inc/wlan_hdd_wmm.h +++ b/core/hdd/inc/wlan_hdd_wmm.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012,2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _WLAN_HDD_WMM_H #define _WLAN_HDD_WMM_H diff --git a/core/hdd/inc/wlan_hdd_wowl.h b/core/hdd/inc/wlan_hdd_wowl.h index 33373f1e2764..843267a73af5 100644 --- a/core/hdd/inc/wlan_hdd_wowl.h +++ b/core/hdd/inc/wlan_hdd_wowl.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _WLAN_HDD_WOWL_H #define _WLAN_HDD_WOWL_H diff --git a/core/hdd/src/wlan_hdd_apf.c b/core/hdd/src/wlan_hdd_apf.c index ad1a0b890471..c2db21fa7b89 100644 --- a/core/hdd/src/wlan_hdd_apf.c +++ b/core/hdd/src/wlan_hdd_apf.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,13 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - - /** * DOC: wlan_hdd_apf.c * @@ -34,8 +24,7 @@ #include "wlan_hdd_apf.h" #include "qca_vendor.h" - -struct hdd_apf_context apf_context; +#include "wlan_hdd_request_manager.h" /* * define short names for the global vendor params @@ -72,50 +61,46 @@ wlan_hdd_apf_offload_policy[APF_MAX + 1] = { [APF_PROG_LEN] = {.type = NLA_U32}, }; -void hdd_apf_context_init(void) +void hdd_apf_context_init(hdd_adapter_t *adapter) { - qdf_event_create(&apf_context.qdf_apf_event); - qdf_spinlock_create(&apf_context.lock); - apf_context.apf_enabled = true; + qdf_event_create(&adapter->apf_context.qdf_apf_event); + qdf_spinlock_create(&adapter->apf_context.lock); + adapter->apf_context.apf_enabled = true; } -void hdd_apf_context_destroy(void) +void hdd_apf_context_destroy(hdd_adapter_t *adapter) { - qdf_event_destroy(&apf_context.qdf_apf_event); - qdf_spinlock_destroy(&apf_context.lock); - qdf_mem_zero(&apf_context, sizeof(apf_context)); + qdf_event_destroy(&adapter->apf_context.qdf_apf_event); + qdf_spinlock_destroy(&adapter->apf_context.lock); + qdf_mem_zero(&adapter->apf_context, + sizeof(struct hdd_apf_context)); } -void hdd_get_apf_capabilities_cb(void *hdd_context, +void hdd_get_apf_capabilities_cb(void *cookie, struct sir_apf_get_offload *data) { - hdd_context_t *hdd_ctx = hdd_context; - struct hdd_apf_context *context = &apf_context; + struct sir_apf_get_offload *apf_caps_resp; + struct hdd_request *request; ENTER(); - if (wlan_hdd_validate_context(hdd_ctx) || !data) { - hdd_err("HDD context is invalid or data(%pK) is null", - data); + if (!data) { + hdd_err("Event response is NULL!"); return; } - qdf_spin_lock(&context->lock); - - /* The caller presumably timed out so there is nothing we can do */ - if (context->magic != APF_CONTEXT_MAGIC) { - qdf_spin_unlock(&context->lock); + request = hdd_request_get(cookie); + if (!request) { + hdd_debug("Obsolete request"); return; } - /* context is valid so caller is still waiting */ - /* paranoia: invalidate the magic */ - context->magic = 0; + apf_caps_resp = hdd_request_priv(request); + *apf_caps_resp = *data; + hdd_request_complete(request); + hdd_request_put(request); - context->capability_response = *data; - qdf_event_set(&context->qdf_apf_event); - - qdf_spin_unlock(&context->lock); + EXIT(); } /** @@ -145,6 +130,7 @@ hdd_post_get_apf_capabilities_rsp(hdd_context_t *hdd_ctx, return -ENOMEM; } + hdd_ctx->apf_version = apf_get_offload->apf_version; hdd_debug("APF Version: %u APF max bytes: %u", apf_get_offload->apf_version, apf_get_offload->max_bytes_for_apf_inst); @@ -173,39 +159,48 @@ nla_put_failure: */ static int hdd_get_apf_capabilities(hdd_context_t *hdd_ctx) { - static struct hdd_apf_context *context = &apf_context; + static struct sir_apf_get_offload *apf_caps_resp; + struct hdd_request *request; QDF_STATUS status; + void *cookie; int ret; + static const struct hdd_request_params params = { + .priv_size = sizeof(*apf_caps_resp), + .timeout_ms = WLAN_WAIT_TIME_APF_GET_CAPS, + }; ENTER(); - qdf_spin_lock(&context->lock); - context->magic = APF_CONTEXT_MAGIC; - qdf_event_reset(&context->qdf_apf_event); - qdf_spin_unlock(&context->lock); + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + + cookie = hdd_request_cookie(request); - status = sme_get_apf_capabilities(hdd_ctx->hHal); + status = sme_get_apf_capabilities(hdd_ctx->hHal, cookie); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Unable to retrieve APF caps"); - return -EINVAL; + ret = -EINVAL; + goto cleanup; } - /* request was sent -- wait for the response */ - status = qdf_wait_for_event_completion(&context->qdf_apf_event, - WLAN_WAIT_TIME_APF_GET_CAPS); - if (QDF_IS_STATUS_ERROR(status)) { - hdd_err("Target response timed out"); - qdf_spin_lock(&context->lock); - context->magic = 0; - qdf_spin_unlock(&context->lock); - return -ETIMEDOUT; + ret = hdd_request_wait_for_response(request); + if (ret) { + hdd_err("Target response timed out"); + goto cleanup; } - ret = hdd_post_get_apf_capabilities_rsp(hdd_ctx, - &apf_context.capability_response); + + apf_caps_resp = hdd_request_priv(request); + ret = hdd_post_get_apf_capabilities_rsp(hdd_ctx, apf_caps_resp); if (ret) hdd_err("Failed to post get apf capabilities"); +cleanup: + hdd_request_put(request); EXIT(); + return ret; } @@ -318,37 +313,35 @@ fail: qdf_mem_free(apf_set_offload->program); qdf_mem_free(apf_set_offload); - if (ret == 0) - adapter->apf_enabled = apf_enabled; + if (!ret) + hdd_ctx->apf_enabled_v2 = true; return ret; } /** * hdd_enable_disable_apf - Enable or Disable the APF interpreter - * @vdev_id: VDEV id - * @hdd_ctx: Hdd context + * @adapter: HDD Adapter * @apf_enable: true: Enable APF Int., false: disable APF Int. * * Return: 0 on success, errno on failure */ static int -hdd_enable_disable_apf(hdd_context_t *hdd_ctx, uint8_t vdev_id, bool apf_enable) +hdd_enable_disable_apf(hdd_adapter_t *adapter, bool apf_enable) { QDF_STATUS status; ENTER(); - status = sme_set_apf_enable_disable(hdd_ctx->hHal, vdev_id, apf_enable); + status = sme_set_apf_enable_disable(WLAN_HDD_GET_HAL_CTX(adapter), + adapter->sessionId, apf_enable); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Unable to post sme apf enable/disable message (status-%d)", status); return -EINVAL; } - qdf_spin_lock(&apf_context.lock); - apf_context.apf_enabled = apf_enable; - qdf_spin_unlock(&apf_context.lock); + adapter->apf_context.apf_enabled = apf_enable; EXIT(); return 0; @@ -366,23 +359,18 @@ hdd_enable_disable_apf(hdd_context_t *hdd_ctx, uint8_t vdev_id, bool apf_enable) * Return: 0 on success, errno on failure */ static int -hdd_apf_write_memory(hdd_context_t *hdd_ctx, struct nlattr **tb, - uint8_t session_id) +hdd_apf_write_memory(hdd_adapter_t *adapter, struct nlattr **tb) { struct wmi_apf_write_memory_params write_mem_params = {0}; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); QDF_STATUS status; int ret = 0; - bool apf_enabled; ENTER(); - write_mem_params.vdev_id = session_id; - - qdf_spin_lock(&apf_context.lock); - apf_enabled = apf_context.apf_enabled; - qdf_spin_unlock(&apf_context.lock); + write_mem_params.vdev_id = adapter->sessionId; - if (apf_enabled) { + if (adapter->apf_context.apf_enabled) { hdd_err("Cannot get/set when APF interpreter is enabled"); return -EINVAL; } @@ -422,10 +410,10 @@ hdd_apf_write_memory(hdd_context_t *hdd_ctx, struct nlattr **tb, nla_memcpy(write_mem_params.buf, tb[APF_PROGRAM], write_mem_params.length); - write_mem_params.apf_version = - apf_context.capability_response.apf_version; + write_mem_params.apf_version = hdd_ctx->apf_version; - status = sme_apf_write_work_memory(hdd_ctx->hHal, &write_mem_params); + status = sme_apf_write_work_memory(WLAN_HDD_GET_HAL_CTX(adapter), + &write_mem_params); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Unable to retrieve APF caps"); ret = -EINVAL; @@ -444,7 +432,8 @@ hdd_apf_read_memory_callback(void *hdd_context, *read_mem_evt) { hdd_context_t *hdd_ctx = hdd_context; - static struct hdd_apf_context *context = &apf_context; + hdd_adapter_t *adapter; + struct hdd_apf_context *context; uint8_t *buf_ptr; uint32_t pkt_offset; ENTER(); @@ -455,16 +444,19 @@ hdd_apf_read_memory_callback(void *hdd_context, return; } - qdf_spin_lock(&context->lock); + adapter = hdd_get_adapter_by_vdev(hdd_ctx, read_mem_evt->vdev_id); + if (hdd_validate_adapter(adapter)) { + hdd_err("Adapter is invalid"); + return; + } + context = &adapter->apf_context; + if (context->magic != APF_CONTEXT_MAGIC) { - /* The caller presumably timed out, nothing to do */ - qdf_spin_unlock(&context->lock); hdd_err("Caller timed out or corrupt magic, simply return"); return; } if (read_mem_evt->offset < context->offset) { - qdf_spin_unlock(&context->lock); hdd_err("Offset in read event(%d) smaller than offset in request(%d)!", read_mem_evt->offset, context->offset); return; @@ -478,7 +470,6 @@ hdd_apf_read_memory_callback(void *hdd_context, pkt_offset = read_mem_evt->offset - context->offset; if (context->buf_len < pkt_offset + read_mem_evt->length) { - qdf_spin_unlock(&context->lock); hdd_err("Read chunk exceeding allocated space"); return; } @@ -492,24 +483,21 @@ hdd_apf_read_memory_callback(void *hdd_context, qdf_event_set(&context->qdf_apf_event); } - qdf_spin_unlock(&context->lock); - EXIT(); } /** * hdd_apf_read_memory - Read part of the apf work memory - * @hdd_ctx: Hdd context + * @adapter: HDD Adapter * @tb: list of attributes - * @session_id: Session id * * Return: 0 on success, errno on failure */ -static int hdd_apf_read_memory(hdd_context_t *hdd_ctx, struct nlattr **tb, - uint8_t session_id) +static int hdd_apf_read_memory(hdd_adapter_t *adapter, struct nlattr **tb) { struct wmi_apf_read_memory_params read_mem_params = {0}; - static struct hdd_apf_context *context = &apf_context; + struct hdd_apf_context *context = &adapter->apf_context; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); QDF_STATUS status; unsigned long nl_buf_len = NLMSG_HDRLEN; int ret = 0; @@ -518,7 +506,7 @@ static int hdd_apf_read_memory(hdd_context_t *hdd_ctx, struct nlattr **tb, ENTER(); - read_mem_params.vdev_id = session_id; + read_mem_params.vdev_id = adapter->sessionId; /* Read APF work memory offset */ if (!tb[APF_CURRENT_OFFSET]) { @@ -543,9 +531,7 @@ static int hdd_apf_read_memory(hdd_context_t *hdd_ctx, struct nlattr **tb, return -ENOMEM; } - qdf_spin_lock(&context->lock); if (context->apf_enabled) { - qdf_spin_unlock(&context->lock); hdd_err("Cannot get/set while interpreter is enabled"); return -EINVAL; } @@ -556,9 +542,9 @@ static int hdd_apf_read_memory(hdd_context_t *hdd_ctx, struct nlattr **tb, context->buf = bufptr; context->buf_len = read_mem_params.length; context->magic = APF_CONTEXT_MAGIC; - qdf_spin_unlock(&context->lock); - status = sme_apf_read_work_memory(hdd_ctx->hHal, &read_mem_params); + status = sme_apf_read_work_memory(WLAN_HDD_GET_HAL_CTX(adapter), + &read_mem_params); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Unable to post sme APF read memory message (status-%d)", status); @@ -571,9 +557,7 @@ static int hdd_apf_read_memory(hdd_context_t *hdd_ctx, struct nlattr **tb, WLAN_WAIT_TIME_APF_READ_MEM); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Target response timed out"); - qdf_spin_lock(&context->lock); context->magic = 0; - qdf_spin_unlock(&context->lock); ret = -ETIMEDOUT; goto fail; } @@ -627,8 +611,7 @@ __wlan_hdd_cfg80211_apf_offload(struct wiphy *wiphy, hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct nlattr *tb[APF_MAX + 1]; int ret_val = 0, apf_subcmd; - uint8_t session_id = adapter->sessionId; - static struct hdd_apf_context *context = &apf_context; + struct hdd_apf_context *context = &adapter->apf_context; ENTER(); @@ -641,33 +624,34 @@ __wlan_hdd_cfg80211_apf_offload(struct wiphy *wiphy, return -EINVAL; } - if (!hdd_ctx->apf_enabled) { - hdd_err("APF offload is not supported/enabled"); + if (!hdd_ctx->apf_supported) { + hdd_err("APF is not supported or disabled through INI"); return -ENOTSUPP; } - if (hdd_nla_parse(tb, APF_MAX, data, data_len, - wlan_hdd_apf_offload_policy)) { - hdd_err("Invalid ATTR"); - return -EINVAL; - } - if (!(adapter->device_mode == QDF_STA_MODE || adapter->device_mode == QDF_P2P_CLIENT_MODE)) { hdd_err("APF only supported in STA or P2P CLI modes!"); return -ENOTSUPP; } + if (hdd_nla_parse(tb, APF_MAX, data, data_len, + wlan_hdd_apf_offload_policy)) { + hdd_err("Invalid ATTR"); + return -EINVAL; + } + if (!tb[APF_SUBCMD]) { hdd_err("attr apf sub-command failed"); return -EINVAL; } apf_subcmd = nla_get_u32(tb[APF_SUBCMD]); + /* Do not allow simultaneous new APF commands on the same adapter */ qdf_spin_lock(&context->lock); if (context->cmd_in_progress) { qdf_spin_unlock(&context->lock); - hdd_err("Another APF cmd in progress, try again later!"); + hdd_err("Another cmd in progress for same session!"); return -EAGAIN; } context->cmd_in_progress = true; @@ -685,24 +669,16 @@ __wlan_hdd_cfg80211_apf_offload(struct wiphy *wiphy, /* APF 3.0 sub-commands */ case QCA_WLAN_WRITE_PACKET_FILTER: - ret_val = hdd_apf_write_memory(hdd_ctx, tb, session_id); + ret_val = hdd_apf_write_memory(adapter, tb); break; case QCA_WLAN_READ_PACKET_FILTER: - ret_val = hdd_apf_read_memory(hdd_ctx, tb, session_id); + ret_val = hdd_apf_read_memory(adapter, tb); break; case QCA_WLAN_ENABLE_PACKET_FILTER: - ret_val = hdd_enable_disable_apf(hdd_ctx, - session_id, - true); - if (ret_val == 0) - adapter->apf_enabled = true; + ret_val = hdd_enable_disable_apf(adapter, true); break; case QCA_WLAN_DISABLE_PACKET_FILTER: - ret_val = hdd_enable_disable_apf(hdd_ctx, - session_id, - false); - if (ret_val == 0) - adapter->apf_enabled = false; + ret_val = hdd_enable_disable_apf(adapter, false); break; default: hdd_err("Unknown APF Sub-command: %d", apf_subcmd); diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index ad5d1029c3e5..98b481d7db5d 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_assoc.c * @@ -1044,6 +1035,9 @@ hdd_conn_save_connect_info(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, pHddStaCtx->conn_info.rate_flags = pRoamInfo->chan_info.rate_flags; + + pHddStaCtx->conn_info.ch_width = + pRoamInfo->chan_info.ch_width; } hdd_save_bss_info(pAdapter, pRoamInfo); } @@ -1366,7 +1360,7 @@ static void hdd_send_association_event(struct net_device *dev, if (eConnectionState_Associated == pHddStaCtx->conn_info.connState) { tSirSmeChanInfo chan_info; - if (!pCsrRoamInfo) { + if (!pCsrRoamInfo || !pCsrRoamInfo->pBssDesc) { hdd_warn("STA in associated state but pCsrRoamInfo is null"); return; } @@ -1660,7 +1654,8 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); - if (hdd_ipa_is_enabled(pHddCtx)) + if (hdd_ipa_is_enabled(pHddCtx) && + (pHddStaCtx->conn_info.staId[0] != HDD_WLAN_INVALID_STA_ID)) hdd_ipa_wlan_evt(pAdapter, pHddStaCtx->conn_info.staId[0], HDD_IPA_STA_DISCONNECT, pHddStaCtx->conn_info.bssId.bytes); @@ -1681,12 +1676,12 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, if ((eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) || (eConnectionState_NotConnected == + pHddStaCtx->conn_info.connState) || + (eConnectionState_Connecting == pHddStaCtx->conn_info.connState)) { hdd_debug("HDD has initiated a disconnect, no need to send disconnect indication to kernel"); sendDisconInd = false; - } - - if (pHddStaCtx->conn_info.connState != eConnectionState_Disconnecting) { + } else { INIT_COMPLETION(pAdapter->disconnect_comp_var); hdd_conn_set_connection_state(pAdapter, eConnectionState_Disconnecting); @@ -1818,7 +1813,15 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, } /* Clear saved connection information in HDD */ hdd_conn_remove_connect_info(pHddStaCtx); - hdd_conn_set_connection_state(pAdapter, eConnectionState_NotConnected); + /* + * eConnectionState_Connecting state mean that connection is in + * progress so no need to set state to eConnectionState_NotConnected + */ + if ((eConnectionState_Connecting != + pHddStaCtx->conn_info.connState)) { + hdd_conn_set_connection_state(pAdapter, + eConnectionState_NotConnected); + } #ifdef WLAN_FEATURE_GTK_OFFLOAD if ((QDF_STA_MODE == pAdapter->device_mode) || (QDF_P2P_CLIENT_MODE == pAdapter->device_mode)) { @@ -2183,7 +2186,8 @@ static void hdd_send_re_assoc_event(struct net_device *dev, hdd_err("Unable to allocate Assoc Req IE"); goto done; } - if (pCsrRoamInfo == NULL) { + + if (!pCsrRoamInfo || !pCsrRoamInfo->pBssDesc) { hdd_err("Invalid CSR roam info"); goto done; } @@ -2597,6 +2601,14 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, hdd_err("config is NULL"); return QDF_STATUS_E_NULL_VALUE; } + + /* + * Enable roaming on other STA iface except this one. + * Firmware dosent support connection on one STA iface while + * roaming on other STA iface + */ + wlan_hdd_enable_roaming(pAdapter); + /* HDD has initiated disconnect, do not send connect result indication * to kernel as it will be handled by __cfg80211_disconnect. */ diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 746a6ce9fd28..cebeb65c34d8 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_cfg.c * @@ -459,13 +450,6 @@ struct reg_table_entry g_registry_table[] = { CFG_BMPS_MAXIMUM_LI_MIN, CFG_BMPS_MAXIMUM_LI_MAX), - REG_VARIABLE(CFG_BMPS_MODERATE_LI_NAME, WLAN_PARAM_Integer, - struct hdd_config, nBmpsModListenInterval, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_BMPS_MODERATE_LI_DEFAULT, - CFG_BMPS_MODERATE_LI_MIN, - CFG_BMPS_MODERATE_LI_MAX), - REG_VARIABLE(CFG_DOT11_MODE_NAME, WLAN_PARAM_Integer, struct hdd_config, dot11Mode, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -605,92 +589,6 @@ struct reg_table_entry g_registry_table[] = { CFG_VC_MODE_BITMAP_MIN, CFG_VC_MODE_BITMAP_MAX), - -/* - * <ini> - * gApAutoChannelSelection - Force ACS from ini - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to set to enable force acs from driver. - * If enabled, channel/ hw config from hostapd is ignored. - * Driver uses INI params dot11Mode, channel bonding mode and vht chan width - * to derive ACS HW mode and operating BW. - * - * Non android platforms shall not use force ACS method and rely on hostapd - * driven ACS method for concurrent SAP ACS configuration, OBSS etc. - * - * Related: Only applicable if gCoalesingInIBSS is 0 - * - * Supported Feature: SAP - * - * Usage: Internal/External - * - * </ini> - */ - REG_VARIABLE(CFG_FORCE_SAP_ACS, WLAN_PARAM_Integer, - struct hdd_config, force_sap_acs, - VAR_FLAGS_DYNAMIC_CFG | - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_FORCE_SAP_ACS_DEFAULT, - CFG_FORCE_SAP_ACS_MIN, - CFG_FORCE_SAP_ACS_MAX), - -/* - * <ini> - * gAPChannelSelectStartChannel - start channel for ACS - * @Min: 0 - * @Max: 0xFF - * @Default: 1 - * - * This ini is used to set start channel for ACS. - * ACS scan will choose channel between force_sap_acs_st_ch - * and force_sap_acs_end_ch - * - * Related: Only applicable gAPChannelSelectEndChannel is set - * - * Supported Feature: SAP - * - * Usage: Internal/External - * - * </ini> - */ - REG_VARIABLE(CFG_FORCE_SAP_ACS_START_CH, WLAN_PARAM_Integer, - struct hdd_config, force_sap_acs_st_ch, - VAR_FLAGS_DYNAMIC_CFG | - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_FORCE_SAP_ACS_START_CH_DEFAULT, - CFG_FORCE_SAP_ACS_START_CH_MIN, - CFG_FORCE_SAP_ACS_START_CH_MAX), - -/* - * <ini> - * gAPChannelSelectEndChannel - end channel for ACS - * @Min: 0 - * @Max: 0xFF - * @Default: 11 - * - * This ini is used to set end channel for ACS. - * ACS scan will choose channel between force_sap_acs_st_ch - * and force_sap_acs_end_ch - * - * Related: Only applicable if gAPChannelSelectStartChannel is set - * - * Supported Feature: SAP - * - * Usage: Internal/External - * - * </ini> - */ - REG_VARIABLE(CFG_FORCE_SAP_ACS_END_CH, WLAN_PARAM_Integer, - struct hdd_config, force_sap_acs_end_ch, - VAR_FLAGS_DYNAMIC_CFG | - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_FORCE_SAP_ACS_END_CH_DEFAULT, - CFG_FORCE_SAP_ACS_END_CH_MIN, - CFG_FORCE_SAP_ACS_END_CH_MAX), - REG_VARIABLE(CFG_ENABLE_SAP_MANDATORY_CHAN_LIST, WLAN_PARAM_Integer, struct hdd_config, enable_sap_mandatory_chan_list, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -2521,6 +2419,13 @@ struct reg_table_entry g_registry_table[] = { CFG_TDLS_PEER_KICKOUT_THRESHOLD_MIN, CFG_TDLS_PEER_KICKOUT_THRESHOLD_MAX), + REG_VARIABLE(CFG_TDLS_DISCOVERY_WAKE_TIMEOUT, WLAN_PARAM_Integer, + struct hdd_config, tdls_discovery_wake_timeout, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TDLS_DISCOVERY_WAKE_TIMEOUT_DEFAULT, + CFG_TDLS_DISCOVERY_WAKE_TIMEOUT_MIN, + CFG_TDLS_DISCOVERY_WAKE_TIMEOUT_MAX), + #endif #ifdef WLAN_SOFTAP_VSTA_FEATURE @@ -3651,6 +3556,34 @@ struct reg_table_entry g_registry_table[] = { CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MIN, CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MAX), + REG_VARIABLE(CFG_STA_SCAN_BURST_DURATION_VAL, WLAN_PARAM_Integer, + struct hdd_config, sta_scan_burst_duration, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_STA_SCAN_BURST_DURATION_VAL_DEFAULT, + CFG_STA_SCAN_BURST_DURATION_VAL_MIN, + CFG_STA_SCAN_BURST_DURATION_VAL_MAX), + + REG_VARIABLE(CFG_P2P_SCAN_BURST_DURATION_VAL, WLAN_PARAM_Integer, + struct hdd_config, p2p_scan_burst_duration, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_P2P_SCAN_BURST_DURATION_VAL_DEFAULT, + CFG_P2P_SCAN_BURST_DURATION_VAL_MIN, + CFG_P2P_SCAN_BURST_DURATION_VAL_MAX), + + REG_VARIABLE(CFG_GO_SCAN_BURST_DURATION_VAL, WLAN_PARAM_Integer, + struct hdd_config, go_scan_burst_duration, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_GO_SCAN_BURST_DURATION_VAL_DEFAULT, + CFG_GO_SCAN_BURST_DURATION_VAL_MIN, + CFG_GO_SCAN_BURST_DURATION_VAL_MAX), + + REG_VARIABLE(CFG_AP_SCAN_BURST_DURATION_VAL, WLAN_PARAM_Integer, + struct hdd_config, ap_scan_burst_duration, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_AP_SCAN_BURST_DURATION_VAL_DEFAULT, + CFG_AP_SCAN_BURST_DURATION_VAL_MIN, + CFG_AP_SCAN_BURST_DURATION_VAL_MAX), + #ifdef FEATURE_AP_MCC_CH_AVOIDANCE REG_VARIABLE(CFG_SAP_MCC_CHANNEL_AVOIDANCE_NAME, WLAN_PARAM_Integer, @@ -3662,13 +3595,21 @@ struct reg_table_entry g_registry_table[] = { CFG_SAP_MCC_CHANNEL_AVOIDANCE_MAX), #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ - REG_VARIABLE(CFG_SAP_P2P_11AC_OVERRIDE_NAME, WLAN_PARAM_Integer, - struct hdd_config, sap_p2p_11ac_override, - VAR_FLAGS_OPTIONAL | - VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_SAP_P2P_11AC_OVERRIDE_DEFAULT, - CFG_SAP_P2P_11AC_OVERRIDE_MIN, - CFG_SAP_P2P_11AC_OVERRIDE_MAX), + REG_VARIABLE(CFG_SAP_11AC_OVERRIDE_NAME, WLAN_PARAM_Integer, + struct hdd_config, sap_11ac_override, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SAP_11AC_OVERRIDE_DEFAULT, + CFG_SAP_11AC_OVERRIDE_MIN, + CFG_SAP_11AC_OVERRIDE_MAX), + + REG_VARIABLE(CFG_GO_11AC_OVERRIDE_NAME, WLAN_PARAM_Integer, + struct hdd_config, go_11ac_override, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_GO_11AC_OVERRIDE_DEFAULT, + CFG_GO_11AC_OVERRIDE_MIN, + CFG_GO_11AC_OVERRIDE_MAX), REG_VARIABLE(CFG_ENABLE_RAMDUMP_COLLECTION, WLAN_PARAM_Integer, struct hdd_config, is_ramdump_enabled, @@ -3904,6 +3845,12 @@ struct reg_table_entry g_registry_table[] = { CFG_STA_SAP_SCC_ON_DFS_CHAN_MIN, CFG_STA_SAP_SCC_ON_DFS_CHAN_MAX), + REG_VARIABLE(CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN, WLAN_PARAM_HexInteger, + struct hdd_config, sta_sap_scc_on_lte_coex_chan, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN_DEFAULT, + CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN_MIN, + CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN_MAX), #ifdef FEATURE_WLAN_SCAN_PNO REG_VARIABLE(CFG_PNO_CHANNEL_PREDICTION_NAME, WLAN_PARAM_Integer, @@ -4126,6 +4073,30 @@ struct reg_table_entry g_registry_table[] = { CFG_ROAM_BG_SCAN_BAD_RSSI_OFFSET_2G_MIN, CFG_ROAM_BG_SCAN_BAD_RSSI_OFFSET_2G_MAX), + REG_VARIABLE(CFG_ROAM_HO_DELAY_FOR_RX_NAME, + WLAN_PARAM_Integer, struct hdd_config, + ho_delay_for_rx, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ROAM_HO_DELAY_FOR_RX_DEFAULT, + CFG_ROAM_HO_DELAY_FOR_RX_MIN, + CFG_ROAM_HO_DELAY_FOR_RX_MAX), + + REG_VARIABLE(CFG_MIN_DELAY_BTW_ROAM_SCAN_NAME, + WLAN_PARAM_Integer, struct hdd_config, + min_delay_btw_roam_scans, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MIN_DELAY_BTW_ROAM_SCAN_DEFAULT, + CFG_MIN_DELAY_BTW_ROAM_SCAN_MIN, + CFG_MIN_DELAY_BTW_ROAM_SCAN_MAX), + + REG_VARIABLE(CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_NAME, + WLAN_PARAM_HexInteger, struct hdd_config, + roam_trigger_reason_bitmask, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_DEFAULT, + CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_MIN, + CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_MAX), + REG_VARIABLE(CFG_ENABLE_FATAL_EVENT_TRIGGER, WLAN_PARAM_Integer, struct hdd_config, enable_fatal_event, VAR_FLAGS_OPTIONAL | @@ -4489,11 +4460,39 @@ struct reg_table_entry g_registry_table[] = { CFG_OPTIMIZE_CA_EVENT_ENABLE), REG_VARIABLE(CFG_TX_AGGREGATION_SIZE, WLAN_PARAM_Integer, - struct hdd_config, tx_aggregation_size, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_TX_AGGREGATION_SIZE_DEFAULT, - CFG_TX_AGGREGATION_SIZE_MIN, - CFG_TX_AGGREGATION_SIZE_MAX), + struct hdd_config, tx_aggregation_size, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGREGATION_SIZE_DEFAULT, + CFG_TX_AGGREGATION_SIZE_MIN, + CFG_TX_AGGREGATION_SIZE_MAX), + + REG_VARIABLE(CFG_TX_AGGREGATION_SIZEBE, WLAN_PARAM_Integer, + struct hdd_config, tx_aggregation_size_be, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGREGATION_SIZEBE_DEFAULT, + CFG_TX_AGGREGATION_SIZEBE_MIN, + CFG_TX_AGGREGATION_SIZEBE_MAX), + + REG_VARIABLE(CFG_TX_AGGREGATION_SIZEBK, WLAN_PARAM_Integer, + struct hdd_config, tx_aggregation_size_bk, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGREGATION_SIZEBK_DEFAULT, + CFG_TX_AGGREGATION_SIZEBK_MIN, + CFG_TX_AGGREGATION_SIZEBK_MAX), + + REG_VARIABLE(CFG_TX_AGGREGATION_SIZEVI, WLAN_PARAM_Integer, + struct hdd_config, tx_aggregation_size_vi, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGREGATION_SIZEVI_DEFAULT, + CFG_TX_AGGREGATION_SIZEVI_MIN, + CFG_TX_AGGREGATION_SIZEVI_MAX), + + REG_VARIABLE(CFG_TX_AGGREGATION_SIZEVO, WLAN_PARAM_Integer, + struct hdd_config, tx_aggregation_size_vo, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGREGATION_SIZEVO_DEFAULT, + CFG_TX_AGGREGATION_SIZEVO_MIN, + CFG_TX_AGGREGATION_SIZEVO_MAX), REG_VARIABLE(CFG_RX_AGGREGATION_SIZE, WLAN_PARAM_Integer, struct hdd_config, rx_aggregation_size, @@ -4501,6 +4500,35 @@ struct reg_table_entry g_registry_table[] = { CFG_RX_AGGREGATION_SIZE_DEFAULT, CFG_RX_AGGREGATION_SIZE_MIN, CFG_RX_AGGREGATION_SIZE_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_BE, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_be, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BE_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BE_MIN, + CFG_TX_AGGR_SW_RETRY_BE_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_BK, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_bk, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BK_DEFAULT, + CFG_TX_AGGR_SW_RETRY_BK_MIN, + CFG_TX_AGGR_SW_RETRY_BK_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_VI, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_vi, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VI_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VI_MIN, + CFG_TX_AGGR_SW_RETRY_VI_MAX), + + REG_VARIABLE(CFG_TX_AGGR_SW_RETRY_VO, WLAN_PARAM_Integer, + struct hdd_config, tx_aggr_sw_retry_threshold_vo, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VO_DEFAULT, + CFG_TX_AGGR_SW_RETRY_VO_MIN, + CFG_TX_AGGR_SW_RETRY_VO_MAX), + REG_VARIABLE(CFG_SAP_MAX_INACTIVITY_OVERRIDE_NAME, WLAN_PARAM_Integer, struct hdd_config, sap_max_inactivity_override, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -5055,6 +5083,17 @@ struct reg_table_entry g_registry_table[] = { VAR_FLAGS_OPTIONAL, (void *)CFG_ACTION_OUI_CCKM_1X1_DEFAULT), + REG_VARIABLE_STRING(CFG_ACTION_OUI_ITO_ALTERNATE_NAME, + WLAN_PARAM_String, + struct hdd_config, action_oui_ito_alternate, + VAR_FLAGS_OPTIONAL, + (void *)CFG_ACTION_OUI_ITO_ALTERNATE_DEFAULT), + REG_VARIABLE_STRING(CFG_ACTION_OUI_SWITCH_TO_11N_MODE_NAME, + WLAN_PARAM_String, + struct hdd_config, action_oui_switch_to_11n, + VAR_FLAGS_OPTIONAL, + (void *)CFG_ACTION_OUI_SWITCH_TO_11N_MODE_DEFAULT), + REG_VARIABLE(CFG_DTIM_1CHRX_ENABLE_NAME, WLAN_PARAM_Integer, struct hdd_config, enable_dtim_1chrx, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -5576,6 +5615,31 @@ struct reg_table_entry g_registry_table[] = { CFG_ENABLE_RTT_MAC_RANDOMIZATION_DEFAULT, CFG_ENABLE_RTT_MAC_RANDOMIZATION_MIN, CFG_ENABLE_RTT_MAC_RANDOMIZATION_MAX), + + REG_VARIABLE(CFG_ENABLE_UNIT_TEST_FRAMEWORK_NAME, + WLAN_PARAM_Integer, + struct hdd_config, is_unit_test_framework_enabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_UINT_TEST_FRAMEWORK_DEFAULT, + CFG_ENABLE_UNIT_TEST_FRAMEWORK_MIN, + CFG_ENABLE_UNIT_TEST_FRAMEWORK_MAX), + + REG_VARIABLE(CFG_ENABLE_SECONDARY_RATE_NAME, + WLAN_PARAM_HexInteger, + struct hdd_config, enable_secondary_rate, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_SECONDARY_RATE_DEFAULT, + CFG_ENABLE_SECONDARY_RATE_MIN, + CFG_ENABLE_SECONDARY_RATE_MAX), + + REG_VARIABLE(CFG_ROAM_FORCE_RSSI_TRIGGER_NAME, + WLAN_PARAM_Integer, struct hdd_config, + roam_force_rssi_trigger, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ROAM_FORCE_RSSI_TRIGGER_DEFAULT, + CFG_ROAM_FORCE_RSSI_TRIGGER_MIN, + CFG_ROAM_FORCE_RSSI_TRIGGER_MAX), + }; /** @@ -6326,8 +6390,6 @@ static void hdd_set_power_save_offload_config(hdd_context_t *pHddCtx) listenInterval = pConfig->nBmpsMinListenInterval; else if (strcmp(pConfig->PowerUsageControl, "Max") == 0) listenInterval = pConfig->nBmpsMaxListenInterval; - else if (strcmp(pConfig->PowerUsageControl, "Mod") == 0) - listenInterval = pConfig->nBmpsModListenInterval; /* * Based on Mode Set the LI @@ -6566,18 +6628,14 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) pHddCtx->config->apProtection); hdd_debug("Name = [gEnableApOBSSProt] value = [%u]", pHddCtx->config->apOBSSProtEnabled); - hdd_debug("Name = [%s] value = [%u]", CFG_FORCE_SAP_ACS, - pHddCtx->config->force_sap_acs); - hdd_debug("Name = [%s] value = [%u]", CFG_FORCE_SAP_ACS_START_CH, - pHddCtx->config->force_sap_acs_st_ch); - hdd_debug("Name = [%s] value = [%u]", CFG_FORCE_SAP_ACS_END_CH, - pHddCtx->config->force_sap_acs_end_ch); #ifdef FEATURE_AP_MCC_CH_AVOIDANCE hdd_debug("Name = [sap_channel_avoidance] value = [%u]", pHddCtx->config->sap_channel_avoidance); #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ - hdd_debug("Name = [%s] value = [%u]", CFG_SAP_P2P_11AC_OVERRIDE_NAME, - pHddCtx->config->sap_p2p_11ac_override); + hdd_debug("Name = [%s] value = [%u]", CFG_SAP_11AC_OVERRIDE_NAME, + pHddCtx->config->sap_11ac_override); + hdd_debug("Name = [%s] value = [%u]", CFG_GO_11AC_OVERRIDE_NAME, + pHddCtx->config->go_11ac_override); hdd_debug("Name = [ChannelBondingMode] Value = [%u]", pHddCtx->config->nChannelBondingMode24GHz); hdd_debug("Name = [%s] Value = [%u] ", @@ -7044,6 +7102,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_debug("Name = [%s] value = [%u]", CFG_STA_SAP_SCC_ON_DFS_CHAN, pHddCtx->config->sta_sap_scc_on_dfs_chan); + hdd_debug("Name = [%s] value = [%u]", + CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN, + pHddCtx->config->sta_sap_scc_on_lte_coex_chan); #ifdef FEATURE_WLAN_SCAN_PNO hdd_debug("Name = [%s] Value = [%u]", CFG_PNO_CHANNEL_PREDICTION_NAME, @@ -7114,6 +7175,15 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) CFG_ROAM_FT_OPEN_ENABLE_NAME, pHddCtx->config->enable_ftopen); hdd_debug("Name = [%s] Value = [%u]", + CFG_ROAM_HO_DELAY_FOR_RX_NAME, + pHddCtx->config->ho_delay_for_rx); + hdd_debug("Name = [%s] Value = [%u]", + CFG_MIN_DELAY_BTW_ROAM_SCAN_NAME, + pHddCtx->config->min_delay_btw_roam_scans); + hdd_debug("Name = [%s] Value = [%u]", + CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_NAME, + pHddCtx->config->roam_trigger_reason_bitmask); + hdd_debug("Name = [%s] Value = [%u]", CFG_MIN_REST_TIME_NAME, pHddCtx->config->min_rest_time_conc); hdd_debug("Name = [%s] Value = [%u]", @@ -7471,6 +7541,16 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) CFG_CHANNEL_SELECT_LOGIC_CONC_NAME, pHddCtx->config->channel_select_logic_conc); hdd_cfg_print_sae(pHddCtx); + hdd_debug("Name = [%s] value = [0x%x]", + CFG_ENABLE_UNIT_TEST_FRAMEWORK_NAME, + pHddCtx->config->is_unit_test_framework_enabled); + hdd_debug("Name = [%s] value = [0x%x]", + CFG_ENABLE_SECONDARY_RATE_NAME, + pHddCtx->config->enable_secondary_rate); + hdd_debug("Name = [%s] Value = [%u]", + CFG_ROAM_FORCE_RSSI_TRIGGER_NAME, + pHddCtx->config->roam_force_rssi_trigger); + } /** @@ -9412,7 +9492,6 @@ static void hdd_set_sme_action_oui(hdd_context_t *hdd_ctx, ini_len = qdf_str_len(ini_string); if (!ini_len) return; - oui_string = qdf_mem_malloc(ini_len + 1); if (!oui_string) { hdd_err("mem alloc failed for ini string of action oui: %u", @@ -9456,6 +9535,17 @@ void hdd_set_all_sme_action_ouis(hdd_context_t *hdd_ctx) ini_string[MAX_ACTION_OUI_STRING_LEN - 1] = '\0'; hdd_set_sme_action_oui(hdd_ctx, ini_string, WMI_ACTION_OUI_CCKM_1X1); + + ini_string = config->action_oui_ito_alternate; + ini_string[MAX_ACTION_OUI_STRING_LEN - 1] = '\0'; + hdd_set_sme_action_oui(hdd_ctx, ini_string, + WMI_ACTION_OUI_ITO_ALTERNATE); + + ini_string = config->action_oui_switch_to_11n; + ini_string[MAX_ACTION_OUI_STRING_LEN - 1] = '\0'; + hdd_set_sme_action_oui(hdd_ctx, ini_string, + WMI_ACTION_OUI_SWITCH_TO_11N_MODE); + } /* End of action oui functions */ @@ -9925,6 +10015,14 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) smeConfig->csrConfig.f_sta_miracast_mcc_rest_time_val = pHddCtx->config->sta_miracast_mcc_rest_time_val; + smeConfig->csrConfig.sta_scan_burst_duration = + pHddCtx->config->sta_scan_burst_duration; + smeConfig->csrConfig.p2p_scan_burst_duration = + pHddCtx->config->p2p_scan_burst_duration; + smeConfig->csrConfig.go_scan_burst_duration = + pHddCtx->config->go_scan_burst_duration; + smeConfig->csrConfig.ap_scan_burst_duration = + pHddCtx->config->ap_scan_burst_duration; #ifdef FEATURE_AP_MCC_CH_AVOIDANCE smeConfig->csrConfig.sap_channel_avoidance = pHddCtx->config->sap_channel_avoidance; @@ -9973,6 +10071,12 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) pHddCtx->config->roam_bad_rssi_thresh_offset_2g; smeConfig->csrConfig.enable_ftopen = pHddCtx->config->enable_ftopen; + smeConfig->csrConfig.ho_delay_for_rx = + pHddCtx->config->ho_delay_for_rx; + smeConfig->csrConfig.min_delay_btw_roam_scans = + pHddCtx->config->min_delay_btw_roam_scans; + smeConfig->csrConfig.roam_trigger_reason_bitmask = + pHddCtx->config->roam_trigger_reason_bitmask; smeConfig->csrConfig.obss_width_interval = pHddCtx->config->obss_width_trigger_interval; smeConfig->csrConfig.obss_active_dwelltime = @@ -9989,6 +10093,8 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) pHddCtx->config->scan_adaptive_dwell_mode_nc; smeConfig->csrConfig.roamscan_adaptive_dwell_mode = pHddCtx->config->roamscan_adaptive_dwell_mode; + smeConfig->csrConfig.roam_force_rssi_trigger = + pHddCtx->config->roam_force_rssi_trigger; hdd_update_per_config_to_sme(pHddCtx, smeConfig); @@ -10031,8 +10137,24 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) smeConfig->csrConfig.tx_aggregation_size = pHddCtx->config->tx_aggregation_size; + smeConfig->csrConfig.tx_aggregation_size_be = + pHddCtx->config->tx_aggregation_size_be; + smeConfig->csrConfig.tx_aggregation_size_bk = + pHddCtx->config->tx_aggregation_size_bk; + smeConfig->csrConfig.tx_aggregation_size_vi = + pHddCtx->config->tx_aggregation_size_vi; + smeConfig->csrConfig.tx_aggregation_size_vo = + pHddCtx->config->tx_aggregation_size_vo; smeConfig->csrConfig.rx_aggregation_size = pHddCtx->config->rx_aggregation_size; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_be = + pHddCtx->config->tx_aggr_sw_retry_threshold_be; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_bk = + pHddCtx->config->tx_aggr_sw_retry_threshold_bk; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_vi = + pHddCtx->config->tx_aggr_sw_retry_threshold_vi; + smeConfig->csrConfig.tx_aggr_sw_retry_threshold_vo = + pHddCtx->config->tx_aggr_sw_retry_threshold_vo; smeConfig->csrConfig.enable_bcast_probe_rsp = pHddCtx->config->enable_bcast_probe_rsp; smeConfig->csrConfig.is_fils_enabled = diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b4b96209afcc..d601f5d9f97b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_cfg80211.c * @@ -1622,19 +1613,21 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, return -EPERM; } - if (hdd_ctx->config->force_sap_acs) { - hdd_err("Hostapd ACS rejected as Driver ACS enabled"); - return -EPERM; - } - ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; + if (!((adapter->device_mode == QDF_SAP_MODE) || + (adapter->device_mode == QDF_P2P_GO_MODE))) { + hdd_err("Invalid device mode %d", adapter->device_mode); + return -EINVAL; + } + if (cds_is_sub_20_mhz_enabled()) { hdd_err("ACS not supported in sub 20 MHz ch wd."); return -EINVAL; } + if (qdf_atomic_read(&adapter->sessionCtx.ap.acs_in_progress) > 0) { hdd_err("ACS rejected as previous req already in progress"); return -EINVAL; @@ -1790,12 +1783,14 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, ht_enabled, vht_enabled); /* ACS override for android */ - if (hdd_ctx->config->sap_p2p_11ac_override && ht_enabled && + if (ht_enabled && sap_config->acs_cfg.end_ch >= CDS_CHANNEL_NUM(CHAN_ENUM_36) && - !(((adapter->device_mode == QDF_SAP_MODE) && - (hdd_ctx->config->sap_force_11n_for_11ac)) || - ((adapter->device_mode == QDF_P2P_GO_MODE) && - (hdd_ctx->config->go_force_11n_for_11ac)))) { + ((adapter->device_mode == QDF_SAP_MODE && + !hdd_ctx->config->sap_force_11n_for_11ac && + hdd_ctx->config->sap_11ac_override) || + (adapter->device_mode == QDF_P2P_GO_MODE && + !hdd_ctx->config->go_force_11n_for_11ac && + hdd_ctx->config->go_11ac_override))) { hdd_debug("ACS Config override for 11AC"); vht_enabled = 1; sap_config->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac; @@ -3998,6 +3993,10 @@ fail: return -EINVAL; } +struct peer_txrx_rate_priv { + struct sir_peer_info_ext peer_info_ext; +}; + /** * hdd_get_peer_txrx_rate_cb() - get station's txrx rate callback * @peer_info: pointer of peer information @@ -4009,66 +4008,33 @@ fail: static void hdd_get_peer_txrx_rate_cb(struct sir_peer_info_ext_resp *peer_info, void *context) { - struct statsContext *get_txrx_rate_context; - struct sir_peer_info_ext *txrx_rate; - hdd_adapter_t *adapter; - uint8_t staid; - - if ((peer_info == NULL) || (context == NULL)) { - hdd_err("Bad param, peer_info [%pK] context [%pK]", - peer_info, context); - return; - } + struct hdd_request *request; + struct peer_txrx_rate_priv *priv; - spin_lock(&hdd_context_lock); - /* - * there is a race condition that exists between this callback - * function and the caller since the caller could time out either - * before or while this code is executing. we use a spinlock to - * serialize these actions - */ - get_txrx_rate_context = context; - if (get_txrx_rate_context->magic != PEER_INFO_CONTEXT_MAGIC) { - /* - * the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, magic [%08x]", - get_txrx_rate_context->magic); + if (NULL == peer_info) { + hdd_err("Bad param, peer_info [%pK]", peer_info); return; } if (!peer_info->count) { - spin_unlock(&hdd_context_lock); hdd_err("Fail to get remote peer info"); return; } - adapter = get_txrx_rate_context->pAdapter; - txrx_rate = peer_info->info; - if (hdd_softap_get_sta_id(adapter, - &txrx_rate->peer_macaddr, - &staid) != QDF_STATUS_SUCCESS) { - spin_unlock(&hdd_context_lock); - hdd_err("Station MAC address does not matching"); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request"); return; } - adapter->aStaInfo[staid].tx_rate = txrx_rate->tx_rate; - adapter->aStaInfo[staid].rx_rate = txrx_rate->rx_rate; - hdd_debug("%pM txrate %u rxrate %u", - txrx_rate->peer_macaddr.bytes, - adapter->aStaInfo[staid].tx_rate, - adapter->aStaInfo[staid].rx_rate); - - get_txrx_rate_context->magic = 0; + priv = hdd_request_priv(request); - /* notify the caller */ - complete(&get_txrx_rate_context->completion); + qdf_mem_copy(&priv->peer_info_ext, + peer_info->info, + sizeof(peer_info->info[0])); - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } /** @@ -4085,17 +4051,30 @@ static int wlan_hdd_get_txrx_rate(hdd_adapter_t *adapter, { QDF_STATUS status; int ret; - static struct statsContext context; + uint8_t staid; + void *cookie; struct sir_peer_info_ext_req txrx_rate_req; + struct hdd_request *request; + struct peer_txrx_rate_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (adapter == NULL) { hdd_err("pAdapter is NULL"); return -EFAULT; } - init_completion(&context.completion); - context.magic = PEER_INFO_CONTEXT_MAGIC; - context.pAdapter = adapter; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("%s: Request allocation failure", + __func__); + return -ENOMEM; + } + + cookie = hdd_request_cookie(request); + priv = hdd_request_priv(request); qdf_mem_copy(&(txrx_rate_req.peer_macaddr), &macaddress, QDF_MAC_ADDR_SIZE); @@ -4103,36 +4082,38 @@ static int wlan_hdd_get_txrx_rate(hdd_adapter_t *adapter, txrx_rate_req.reset_after_request = 0; status = sme_get_peer_info_ext(WLAN_HDD_GET_HAL_CTX(adapter), &txrx_rate_req, - &context, + cookie, hdd_get_peer_txrx_rate_cb); if (status != QDF_STATUS_SUCCESS) { hdd_err("Unable to retrieve statistics for txrx_rate"); ret = -EFAULT; } else { - if (!wait_for_completion_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS))) { + ret = hdd_request_wait_for_response(request); + if (ret) { hdd_err("SME timed out while retrieving txrx_rate"); ret = -EFAULT; } else { - ret = 0; + if (hdd_softap_get_sta_id(adapter, + &priv->peer_info_ext.peer_macaddr, + &staid) != QDF_STATUS_SUCCESS) { + hdd_err("Station MAC address does not matching"); + ret = -EFAULT; + } else { + adapter->aStaInfo[staid].tx_rate = + priv->peer_info_ext.tx_rate; + adapter->aStaInfo[staid].rx_rate = + priv->peer_info_ext.rx_rate; + + hdd_info("%pM tx rate %u rx rate %u", + priv->peer_info_ext.peer_macaddr.bytes, + adapter->aStaInfo[staid].tx_rate, + adapter->aStaInfo[staid].rx_rate); + ret = 0; + } } } - /* - * either we never sent a request, we sent a request and received a - * response or we sent a request and timed out. if we never sent a - * request or if we sent a request and got a response, we want to - * clear the magic out of paranoia. if we timed out there is a - * race condition such that the callback function could be - * executing at the same time we are. of primary concern is if the - * callback function had already verified the "magic" but had not - * yet set the completion variable when a timeout occurred. we - * serialize these activities by invalidating the magic while - * holding a shared spinlock which will cause us to block if the - * callback is currently executing - */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + + hdd_request_put(request); return ret; } @@ -4980,6 +4961,12 @@ __wlan_hdd_cfg80211_get_wifi_info(struct wiphy *wiphy, count++; } + if (tb_vendor[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_RADIO_INDEX]) { + hdd_debug("Rcvd req for Radio index"); + skb_len += sizeof(uint32_t); + count++; + } + if (count == 0) { hdd_err("unknown attribute in get_wifi_info request"); return -EINVAL; @@ -5086,6 +5073,7 @@ __wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy, features |= WIFI_LOGGER_CONNECT_EVENT_SUPPORTED; features |= WIFI_LOGGER_WAKE_LOCK_SUPPORTED; features |= WIFI_LOGGER_DRIVER_DUMP_SUPPORTED; + features |= WIFI_LOGGER_PACKET_FATE_SUPPORTED; reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(uint32_t) + NLA_HDRLEN + NLMSG_HDRLEN); @@ -9879,6 +9867,9 @@ static int wlan_hdd_cfg80211_sar_convert_limit_set(u32 nl80211_value, case QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER: *wmi_value = WMI_SAR_FEATURE_ON_USER_DEFINED; break; + case QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0: + *wmi_value = WMI_SAR_FEATURE_ON_SAR_V2_0; + break; default: ret = -1; } @@ -9954,6 +9945,8 @@ static u32 hdd_sar_wmi_to_nl_enable(uint32_t wmi_value) return QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF4; case WMI_SAR_FEATURE_ON_USER_DEFINED: return QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER; + case WMI_SAR_FEATURE_ON_SAR_V2_0: + return QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0; } } @@ -9987,6 +9980,7 @@ sar_limits_policy[QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_CHAIN] = {.type = NLA_U32}, [QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_MODULATION] = {.type = NLA_U32}, [QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT] = {.type = NLA_U32}, + [QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX] = {.type = NLA_U32}, }; #define WLAN_WAIT_TIME_SAR 5000 @@ -10335,8 +10329,13 @@ static int __wlan_hdd_set_sar_power_limits(struct wiphy *wiphy, sar_limit_cmd.sar_limit_row_list[i].limit_value = nla_get_u32(sar_spec[ QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT]); + } else if (sar_spec[ + QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX]) { + sar_limit_cmd.sar_limit_row_list[i].limit_value = + nla_get_u32(sar_spec[ + QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX]); } else { - hdd_err("SAR Spec does not have power limit value"); + hdd_err("SAR Spec does not have power limit or index value"); goto fail; } @@ -11196,6 +11195,11 @@ static int __wlan_hdd_cfg80211_set_limit_offchan_param(struct wiphy *wiphy, } tos = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ACTIVE_TOS]); + if (tos >= HDD_MAX_AC) { + hdd_err("tos value %d exceeded Max value %d", + tos, HDD_MAX_AC); + goto fail; + } hdd_debug("tos %d", tos); if (!tb[QCA_WLAN_VENDOR_ATTR_ACTIVE_TOS_START]) { @@ -11609,7 +11613,6 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy, const void *data, int data_len) { int err = 0; - unsigned long rc; struct hdd_nud_stats_context *context; struct net_device *dev = wdev->netdev; hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -11644,7 +11647,7 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy, spin_lock(&hdd_context_lock); context = &hdd_ctx->nud_stats_context; - INIT_COMPLETION(context->response_event); + qdf_event_reset(&context->response_event); spin_unlock(&hdd_context_lock); pkt_type_bitmap = adapter->pkt_type_bitmap; @@ -11665,10 +11668,9 @@ static int __wlan_hdd_cfg80211_get_nud_stats(struct wiphy *wiphy, return -EINVAL; } - rc = wait_for_completion_timeout(&context->response_event, - msecs_to_jiffies( - WLAN_WAIT_TIME_NUD_STATS)); - if (!rc) { + if (qdf_wait_for_event_completion(&context->response_event, + WLAN_WAIT_TIME_NUD_STATS) != + QDF_STATUS_SUCCESS) { hdd_err("Target response timed out request "); return -ETIMEDOUT; } @@ -13808,7 +13810,8 @@ void wlan_hdd_update_11n_mode(struct hdd_config *cfg) if ((cfg->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) || (cfg->dot11Mode == eHDD_DOT11_MODE_11ac)) { cfg->dot11Mode = eHDD_DOT11_MODE_11n; - cfg->sap_p2p_11ac_override = 0; + cfg->sap_11ac_override = 0; + cfg->go_11ac_override = 0; } } } @@ -16516,6 +16519,11 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, goto ret_status; } + /* + * Disable roaming on all other adapters before connect start + */ + wlan_hdd_disable_roaming(pAdapter); + disable_fw_tdls_state = true; wlan_hdd_check_conc_and_update_tdls_state(pHddCtx, disable_fw_tdls_state); @@ -16726,7 +16734,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter, cds_handle_conc_rule1(pAdapter, pRoamProfile); if (true != cds_handle_conc_rule2( pAdapter, pRoamProfile, &roamId)) { - status = 0; + status = -EINVAL; goto conn_failure; } } @@ -16839,6 +16847,13 @@ ret_status: if (disable_fw_tdls_state) wlan_hdd_check_conc_and_update_tdls_state(pHddCtx, false); + /* + * Enable roaming on other STA adapter for failure case. + * For success case, it is enabled in assoc completion handler + */ + if (status) + wlan_hdd_enable_roaming(pAdapter); + EXIT(); return status; } @@ -17438,9 +17453,9 @@ static int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie, uint16_t remLen = ie_len; #ifdef FEATURE_WLAN_WAPI uint32_t akmsuite[MAX_NUM_AKM_SUITES]; - u16 *tmp; + uint8_t *tmp; uint16_t akmsuiteCount; - int *akmlist; + uint32_t *akmlist; #endif int status; @@ -17634,12 +17649,12 @@ static int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie, } break; case DOT11F_EID_RSN: - hdd_debug("Set RSN IE(len %d)", eLen + 2); - if (eLen > (MAX_WPA_RSN_IE_LEN - 2)) { + if (eLen > DOT11F_IE_RSN_MAX_LEN) { hdd_err("%s: Invalid WPA RSN IE length[%d]", - __func__, eLen); + __func__, eLen); return -EINVAL; } + hdd_debug("Set RSN IE(len %d)", eLen + 2); memset(pWextState->WPARSNIE, 0, MAX_WPA_RSN_IE_LEN); memcpy(pWextState->WPARSNIE, genie - 2, (eLen + 2)); @@ -17685,13 +17700,16 @@ static int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie, /* Setting WAPI Mode to ON=1 */ pAdapter->wapi_info.nWapiMode = 1; hdd_debug("WAPI MODE IS %u", pAdapter->wapi_info.nWapiMode); - tmp = (u16 *) ie; - tmp = tmp + 2; /* Skip element Id and Len, Version */ + tmp = (uint8_t *)ie; + tmp = tmp + 4; /* Skip element Id and Len, Version */ + /* Get the number of AKM suite */ akmsuiteCount = WPA_GET_LE16(tmp); - tmp = tmp + 1; - akmlist = (int *)(tmp); + /* Skip the number of AKM suite */ + tmp = tmp + 2; + /* AKM suite list, each OUI contains 4 bytes */ + akmlist = (uint32_t *)(tmp); if (akmsuiteCount <= MAX_NUM_AKM_SUITES) { - memcpy(akmsuite, akmlist, (4 * akmsuiteCount)); + memcpy(akmsuite, akmlist, akmsuiteCount); } else { hdd_err("Invalid akmSuite count: %u", akmsuiteCount); @@ -17948,9 +17966,11 @@ int wlan_hdd_try_disconnect(hdd_adapter_t *pAdapter) { unsigned long rc; hdd_station_ctx_t *pHddStaCtx; + hdd_context_t *hdd_ctx; int status, result = 0; tHalHandle hal; + hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); hal = WLAN_HDD_GET_HAL_CTX(pAdapter); if (pAdapter->device_mode == QDF_STA_MODE) { @@ -17964,7 +17984,7 @@ int wlan_hdd_try_disconnect(hdd_adapter_t *pAdapter) * */ INIT_COMPLETION(pAdapter->roaming_comp_var); - if (hdd_is_roaming_in_progress(pAdapter)) { + if (hdd_is_roaming_in_progress(hdd_ctx)) { rc = wait_for_completion_timeout( &pAdapter->roaming_comp_var, msecs_to_jiffies(WLAN_WAIT_TIME_STOP_ROAM)); @@ -18035,20 +18055,18 @@ disconnected: * wlan_hdd_reassoc_bssid_hint() - Start reassociation if bssid is present * @adapter: Pointer to the HDD adapter * @req: Pointer to the structure cfg_connect_params receieved from user space - * @status: out variable for status of reassoc request * * This function will start reassociation if prev_bssid is set and bssid/ * bssid_hint, channel/channel_hint parameters are present in connect request. * - * Return: true if connect was for ReAssociation, false otherwise + * Return: 0 if connect was for ReAssociation, non-zero error code otherwise */ #if defined(CFG80211_CONNECT_PREV_BSSID) || \ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) -static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, - struct cfg80211_connect_params *req, - int *status) +static int wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, + struct cfg80211_connect_params *req) { - bool reassoc = false; + int status = -EINVAL; const uint8_t *bssid = NULL; uint16_t channel = 0; hdd_wext_state_t *wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); @@ -18061,7 +18079,7 @@ static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, if (CSR_IS_AUTH_TYPE_FILS( wext_state->roamProfile.AuthType.authType[0])) { hdd_info("connection is FILS, dropping roaming.."); - return reassoc; + return status; } if (req->channel) @@ -18070,7 +18088,6 @@ static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, channel = req->channel_hint->hw_value; if (bssid && channel && req->prev_bssid) { - reassoc = true; hdd_debug(FL("REASSOC Attempt on channel %d to "MAC_ADDRESS_STR), channel, MAC_ADDR_ARRAY(bssid)); /* @@ -18082,18 +18099,17 @@ static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, qdf_mem_copy(wext_state->req_bssId.bytes, bssid, QDF_MAC_ADDR_SIZE); - *status = hdd_reassoc(adapter, bssid, channel, + status = hdd_reassoc(adapter, bssid, channel, CONNECT_CMD_USERSPACE); - hdd_debug("hdd_reassoc: status: %d", *status); + hdd_debug("hdd_reassoc: status: %d", status); } - return reassoc; + return status; } #else -static bool wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, - struct cfg80211_connect_params *req, - int *status) +static int wlan_hdd_reassoc_bssid_hint(hdd_adapter_t *adapter, + struct cfg80211_connect_params *req) { - return false; + return -EINVAL; } #endif @@ -18219,7 +18235,11 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, return -EINVAL; } - if (true == wlan_hdd_reassoc_bssid_hint(pAdapter, req, &status)) + /* + * Check if this is reassoc to same bssid, if reassoc is success, return + */ + status = wlan_hdd_reassoc_bssid_hint(pAdapter, req); + if (!status) return status; /* Try disconnecting if already in connected state */ @@ -18321,7 +18341,7 @@ int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason) * */ INIT_COMPLETION(pAdapter->roaming_comp_var); - if (hdd_is_roaming_in_progress(pAdapter)) { + if (hdd_is_roaming_in_progress(pHddCtx)) { rc = wait_for_completion_timeout( &pAdapter->roaming_comp_var, msecs_to_jiffies(WLAN_WAIT_TIME_STOP_ROAM)); @@ -18470,6 +18490,28 @@ static const char *hdd_ieee80211_reason_code_to_str(uint16_t reason) } /** + * hdd_print_netdev_txq_status() - print netdev tx queue status + * @dev: Pointer to network device + * + * This function is used to print netdev tx queue status + * + * Return: none + */ +static void hdd_print_netdev_txq_status(struct net_device *dev) +{ + unsigned int i; + + if (!dev) + return; + + for (i = 0; i < dev->num_tx_queues; i++) { + struct netdev_queue *txq = netdev_get_tx_queue(dev, i); + + hdd_info("netdev tx queue[%u] state: 0x%lx", i, txq->state); + } +} + +/** * __wlan_hdd_cfg80211_disconnect() - cfg80211 disconnect api * @wiphy: Pointer to wiphy * @dev: Pointer to network device @@ -18502,6 +18544,7 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy, MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_DISCONNECT, pAdapter->sessionId, reason)); + hdd_print_netdev_txq_status(dev); hdd_debug("Device_mode %s(%d) reason code(%d)", hdd_device_mode_to_string(pAdapter->device_mode), pAdapter->device_mode, reason); @@ -19592,8 +19635,7 @@ static void hdd_fill_pmksa_info(tPmkidCacheInfo *pmk_cache, qdf_mem_copy(pmk_cache->BSSID.bytes, pmksa->bssid, QDF_MAC_ADDR_SIZE); } else { - qdf_mem_copy(pmk_cache->ssid, pmksa->ssid, - SIR_MAC_MAX_SSID_LENGTH); + qdf_mem_copy(pmk_cache->ssid, pmksa->ssid, pmksa->ssid_len); qdf_mem_copy(pmk_cache->cache_id, pmksa->cache_id, CACHE_ID_LEN); pmk_cache->ssid_len = pmksa->ssid_len; diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 30259032470b..2e3dba7b8c29 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_cfg80211.h * diff --git a/core/hdd/src/wlan_hdd_conc_ut.c b/core/hdd/src/wlan_hdd_conc_ut.c index b9dfaa7a2437..6c8047102a1e 100644 --- a/core/hdd/src/wlan_hdd_conc_ut.c +++ b/core/hdd/src/wlan_hdd_conc_ut.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* Include files */ #include <wlan_hdd_includes.h> diff --git a/core/hdd/src/wlan_hdd_debugfs.c b/core/hdd/src/wlan_hdd_debugfs.c index e0a65be053c8..c757a6be00c0 100644 --- a/core/hdd/src/wlan_hdd_debugfs.c +++ b/core/hdd/src/wlan_hdd_debugfs.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_debugfs.c * diff --git a/core/hdd/src/wlan_hdd_debugfs_connect.c b/core/hdd/src/wlan_hdd_debugfs_connect.c index cf6c8ff02c91..f13029ea8673 100644 --- a/core/hdd/src/wlan_hdd_debugfs_connect.c +++ b/core/hdd/src/wlan_hdd_debugfs_connect.c @@ -2,9 +2,6 @@ /* * Copyright (c) 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -68,10 +65,20 @@ wlan_hdd_version_info_debugfs(hdd_context_t *hdd_ctx, uint8_t *buf, ret_val = scnprintf(buf + length, buf_avail_len - length, "Host Driver Version: %s\n" "Firmware Version: %d.%d.%d.%d.%d\n" - "Hardware Version: %s\n", + "Hardware Version: %s\n" + "Board version: %x\n" + "Ref design id: %x\n" + "Customer id: %x\n" + "Project id: %x\n" + "Board Data Rev: %x\n", QWLAN_VERSIONSTR, major_spid, minor_spid, siid, crmid, sub_id, - hdd_ctx->target_hw_name); + hdd_ctx->target_hw_name, + hdd_ctx->hw_bd_info.bdf_version, + hdd_ctx->hw_bd_info.ref_design_id, + hdd_ctx->hw_bd_info.customer_id, + hdd_ctx->hw_bd_info.project_id, + hdd_ctx->hw_bd_info.board_data_rev); if (ret_val <= 0) return length; @@ -81,6 +88,35 @@ wlan_hdd_version_info_debugfs(hdd_context_t *hdd_ctx, uint8_t *buf, } /** + * wlan_hdd_add_nss_info() - Populate NSS info + * @conn_info: station connection information + * @buf: output buffer to hold version info + * @buf_avail_len: available buffer length + * + * Return: No.of bytes populated by this function in buffer + */ +static ssize_t +wlan_hdd_add_nss_info(connection_info_t *conn_info, + uint8_t *buf, ssize_t buf_avail_len) +{ + ssize_t length = 0; + int ret_val; + + if (!conn_info->conn_flag.ht_present && + !conn_info->conn_flag.vht_present) + return length; + + ret_val = scnprintf(buf, buf_avail_len, + "nss = %u\n", + conn_info->txrate.nss); + if (ret_val <= 0) + return length; + + length = ret_val; + return length; +} + +/** * wlan_hdd_add_ht_cap_info() - Populate HT info * @conn_info: station connection information * @buf: output buffer to hold version info @@ -243,6 +279,39 @@ uint8_t *hdd_dot11_mode_str(uint32_t dot11mode) } /** + * hdd_ch_width_str() - Get string for channel width + * @ch_width: channel width from connect info + * + * Return: User readable string for channel width + */ +static +uint8_t *hdd_ch_width_str(enum phy_ch_width ch_width) +{ + switch (ch_width) { + case CH_WIDTH_20MHZ: + return "20MHz"; + case CH_WIDTH_40MHZ: + return "40MHz"; + case CH_WIDTH_80MHZ: + return "80MHz"; + case CH_WIDTH_160MHZ: + return "160MHz"; + case CH_WIDTH_80P80MHZ: + return "(80 + 80)MHz"; + case CH_WIDTH_5MHZ: + return "5MHz"; + case CH_WIDTH_10MHZ: + return "10MHz"; + case CH_WIDTH_INVALID: + /* Fallthrough */ + case CH_WIDTH_MAX: + /* Fallthrough */ + default: + return "UNKNOWN"; + } +} + +/** * wlan_hdd_connect_info_debugfs() - Populate connect info * @adapter: pointer to sta adapter for which connect info is required * @buf: output buffer to hold version info @@ -257,7 +326,7 @@ wlan_hdd_connect_info_debugfs(hdd_adapter_t *adapter, uint8_t *buf, ssize_t length = 0; hdd_station_ctx_t *hdd_sta_ctx; connection_info_t *conn_info; - uint32_t bit_rate, bit_rate_compat; + uint32_t bit_rate; int ret_val; hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); @@ -290,7 +359,6 @@ wlan_hdd_connect_info_debugfs(hdd_adapter_t *adapter, uint8_t *buf, conn_info = &hdd_sta_ctx->conn_info; bit_rate = cfg80211_calculate_bitrate(&conn_info->txrate); - bit_rate_compat = bit_rate < (1UL << 16) ? bit_rate : 0; if (length >= buf_avail_len) { hdd_err("No sufficient buf_avail_len"); @@ -302,11 +370,9 @@ wlan_hdd_connect_info_debugfs(hdd_adapter_t *adapter, uint8_t *buf, "connect_time = %s\n" "auth_time = %s\n" "freq = %u\n" - "noise = %ddBm\n" + "ch_width = %s\n" "signal = %ddBm\n" "bit_rate = %u\n" - "bit_rate_compat = %u\n" - "nss = %u\n" "last_auth_type = %s\n" "dot11Mode = %s\n", conn_info->last_ssid.SSID.ssId, @@ -314,11 +380,9 @@ wlan_hdd_connect_info_debugfs(hdd_adapter_t *adapter, uint8_t *buf, conn_info->connect_time, conn_info->auth_time, conn_info->freq, - (conn_info->noise + 100), - (conn_info->signal + 100), + hdd_ch_width_str(conn_info->ch_width), + conn_info->signal, bit_rate, - bit_rate_compat, - conn_info->txrate.nss, hdd_auth_type_str(conn_info->last_auth_type), hdd_dot11_mode_str(conn_info->dot11Mode)); @@ -330,6 +394,14 @@ wlan_hdd_connect_info_debugfs(hdd_adapter_t *adapter, uint8_t *buf, hdd_err("No sufficient buf_avail_len"); return buf_avail_len; } + length += wlan_hdd_add_nss_info(conn_info, buf + length, + buf_avail_len - length); + + if (length >= buf_avail_len) { + hdd_err("No sufficient buf_avail_len"); + return buf_avail_len; + } + length += wlan_hdd_add_ht_cap_info(conn_info, buf + length, buf_avail_len - length); diff --git a/core/hdd/src/wlan_hdd_debugfs_csr.c b/core/hdd/src/wlan_hdd_debugfs_csr.c index af1f579c2832..3e5ba3bac205 100644 --- a/core/hdd/src/wlan_hdd_debugfs_csr.c +++ b/core/hdd/src/wlan_hdd_debugfs_csr.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_debugfs_llstat.c b/core/hdd/src/wlan_hdd_debugfs_llstat.c index b9218d1c8912..fe2fb4f27bf5 100644 --- a/core/hdd/src/wlan_hdd_debugfs_llstat.c +++ b/core/hdd/src/wlan_hdd_debugfs_llstat.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_debugfs_offload.c b/core/hdd/src/wlan_hdd_debugfs_offload.c index a7044e11f0dd..fccf059cd6cb 100644 --- a/core/hdd/src/wlan_hdd_debugfs_offload.c +++ b/core/hdd/src/wlan_hdd_debugfs_offload.c @@ -2,9 +2,6 @@ /* * Copyright (c) 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -171,6 +168,30 @@ static void ipv6_addr_string(uint8_t *buffer, uint8_t *IPv6_addr) } /** + * hdd_ipv6_scope_str() - Get string for IPv6 Addr scope + * @scope: scope id from enum sir_ipv6_addr_scope + * + * Return: Meaningful string for enum sir_ipv6_addr_scope + */ +static uint8_t *hdd_ipv6_scope_str(enum sir_ipv6_addr_scope scope) +{ + switch (scope) { + case SIR_IPV6_ADDR_SCOPE_NODELOCAL: + return "Node Local"; + case SIR_IPV6_ADDR_SCOPE_LINKLOCAL: + return "Link Local"; + case SIR_IPV6_ADDR_SCOPE_SITELOCAL: + return "Site Local"; + case SIR_IPV6_ADDR_SCOPE_ORGLOCAL: + return "Org Local"; + case SIR_IPV6_ADDR_SCOPE_GLOBAL: + return "Global"; + default: + return "Invalid"; + } +} + +/** * wlan_hdd_ns_offload_info_debugfs() - Populate ns offload info * @hdd_ctx: pointer to hdd context * @adapter: pointer to adapter @@ -226,6 +247,7 @@ wlan_hdd_ns_offload_info_debugfs(hdd_context_t *hdd_ctx, for (i = 0; i < info.num_ns_offload_count; i++) { uint8_t ipv6_str[IPV6_MAC_ADDRESS_STR_LEN]; uint8_t cast_string[12]; + uint8_t *scope_string; if (length >= buf_avail_len) { hdd_err("No sufficient buf_avail_len"); @@ -233,6 +255,7 @@ wlan_hdd_ns_offload_info_debugfs(hdd_context_t *hdd_ctx, } ipv6_addr_string(ipv6_str, ns_info->targetIPv6Addr[i]); + scope_string = hdd_ipv6_scope_str(ns_info->scope[i]); if (ns_info->target_ipv6_addr_ac_type[i] == SIR_IPV6_ADDR_AC_TYPE) @@ -241,8 +264,9 @@ wlan_hdd_ns_offload_info_debugfs(hdd_context_t *hdd_ctx, strlcpy(cast_string, "(UNI CAST)", 12); ret_val = scnprintf(buf + length, buf_avail_len - length, - "%u. %s %s\n", - (i + 1), ipv6_str, cast_string); + "%u. %s %s and scope is: %s\n", + (i + 1), ipv6_str, cast_string, + scope_string); if (ret_val <= 0) return length; length += ret_val; @@ -287,7 +311,10 @@ wlan_hdd_apf_info_debugfs(hdd_context_t *hdd_ctx, int ret_val; bool apf_enabled; - apf_enabled = adapter->apf_enabled; + if (hdd_ctx->apf_version > 2) + apf_enabled = adapter->apf_context.apf_enabled; + else + apf_enabled = hdd_ctx->apf_enabled_v2; ret_val = scnprintf(buf, buf_avail_len, "\nAPF OFFLOAD DETAILS, offload_applied: %u\n\n", diff --git a/core/hdd/src/wlan_hdd_debugfs_roam.c b/core/hdd/src/wlan_hdd_debugfs_roam.c index 1955ed8ee766..b04b6ffa8c26 100644 --- a/core/hdd/src/wlan_hdd_debugfs_roam.c +++ b/core/hdd/src/wlan_hdd_debugfs_roam.c @@ -2,9 +2,6 @@ /* * Copyright (c) 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -182,12 +179,13 @@ cleanup: } /** - * roam_scan_trigger_to_str() - Get string for enum WMI_ROAM_TRIGGER_REASON_ID + * hdd_roam_scan_trigger_to_str() - Get string for + * enum WMI_ROAM_TRIGGER_REASON_ID * @roam_scan_trigger: roam scan trigger ID * * Return: Meaningful string from enum WMI_ROAM_TRIGGER_REASON_ID */ -static char *roam_scan_trigger_to_str(uint32_t roam_scan_trigger) +static char *hdd_roam_scan_trigger_to_str(uint32_t roam_scan_trigger) { switch (roam_scan_trigger) { case WMI_ROAM_TRIGGER_REASON_PER: @@ -219,6 +217,36 @@ static char *roam_scan_trigger_to_str(uint32_t roam_scan_trigger) } /** + * hdd_roam_scan_trigger_value_to_str() - Get trigger value string for + * enum WMI_ROAM_TRIGGER_REASON_ID + * @roam_scan_trigger: roam scan trigger ID + * @bool: output pointer to hold whether to print trigger value + * + * Return: Meaningful string from trigger value + */ +static char *hdd_roam_scan_trigger_value(uint32_t roam_scan_trigger, + bool *print) +{ + *print = true; + + switch (roam_scan_trigger) { + case WMI_ROAM_TRIGGER_REASON_PER: + return "percentage"; + case WMI_ROAM_TRIGGER_REASON_LOW_RSSI: + return "dB"; + case WMI_ROAM_TRIGGER_REASON_HIGH_RSSI: + return "dB"; + case WMI_ROAM_TRIGGER_REASON_PERIODIC: + return "ms"; + case WMI_ROAM_TRIGGER_REASON_DENSE: + return "(1 - Rx, 2 - Tx)"; + default: + *print = false; + return NULL; + } +} + +/** * hdd_client_id_to_str() - Helper func to get meaninful string from client id * @client_id: Id of the client which triggered roam scan in firmware * @@ -254,6 +282,95 @@ static char *hdd_client_id_to_str(uint32_t client_id) } /** + * hdd_roam_scan_trigger() - Print roam scan trigger info into buffer + * @scan: roam scan event data + * @buf: buffer to write roam scan trigger info + * @buf_avail_len: available buffer length + * + * Return: No.of bytes populated by this function in buffer + */ +static ssize_t +hdd_roam_scan_trigger(struct wmi_roam_scan_stats_params *scan, + uint8_t *buf, ssize_t buf_avail_len) +{ + ssize_t length = 0; + int ret_val; + char *str; + bool print_trigger_value; + + ret_val = scnprintf(buf, buf_avail_len, + "Trigger reason is %s\n", + hdd_roam_scan_trigger_to_str(scan->trigger_id)); + if (ret_val <= 0) + return length; + + length = ret_val; + + str = hdd_roam_scan_trigger_value(scan->trigger_id, + &print_trigger_value); + if (!print_trigger_value || !str) + return length; + + if (length >= buf_avail_len) { + hdd_err("No sufficient buf_avail_len"); + length = buf_avail_len; + return length; + } + + ret_val = scnprintf(buf + length, buf_avail_len - length, + "Trigger value is: %u %s\n", + scan->trigger_value, str); + if (ret_val <= 0) + return length; + + length += ret_val; + return length; +} + +/** + * hdd_roam_scan_chan() - Print roam scan chan freq info into buffer + * @scan: roam scan event data + * @buf: buffer to write roam scan freq info + * @buf_avail_len: available buffer length + * + * Return: No.of bytes populated by this function in buffer + */ +static ssize_t +hdd_roam_scan_chan(struct wmi_roam_scan_stats_params *scan, + uint8_t *buf, ssize_t buf_avail_len) +{ + ssize_t length = 0; + uint32_t i; + int ret_val; + + ret_val = scnprintf(buf, buf_avail_len, + "Num of scan channels: %u\n" + "scan channel list:", + scan->num_scan_chans); + if (ret_val <= 0) + return length; + + length = ret_val; + + for (i = 0; i < scan->num_scan_chans; i++) { + if (length >= buf_avail_len) { + hdd_err("No sufficient buf_avail_len"); + length = buf_avail_len; + return length; + } + + ret_val = scnprintf(buf + length, buf_avail_len - length, + "%u ", scan->scan_freqs[i]); + if (ret_val <= 0) + return length; + + length += ret_val; + } + + return length; +} + +/** * wlan_hdd_update_roam_stats() - Internal function to get roam scan stats * @hdd_ctx: hdd context * @adapter: pointer to adapter @@ -312,10 +429,8 @@ wlan_hdd_update_roam_stats(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, } ret_val = scnprintf(buf + length, buf_avail_len - length, - "This scan is triggered by \"%s\" scan client\n" - "Trigger reason is %s\n", - hdd_client_id_to_str(scan->client_id), - roam_scan_trigger_to_str(scan->trigger_id)); + "This scan is triggered by \"%s\" scan client\n", + hdd_client_id_to_str(scan->client_id)); if (ret_val <= 0) goto free_mem; @@ -327,17 +442,33 @@ wlan_hdd_update_roam_stats(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, goto free_mem; } + length += hdd_roam_scan_trigger(scan, buf + length, + buf_avail_len - length); + if (length >= buf_avail_len) { + hdd_err("No sufficient buf_avail_len"); + length = buf_avail_len; + goto free_mem; + } + + length += hdd_roam_scan_chan(scan, buf + length, + buf_avail_len - length); + if (length >= buf_avail_len) { + hdd_err("No sufficient buf_avail_len"); + length = buf_avail_len; + goto free_mem; + } + if (scan->is_roam_successful) { ret_val = scnprintf(buf + length, buf_avail_len - length, - "STA roamed from " MAC_ADDRESS_STR " to " + "\nSTA roamed from " MAC_ADDRESS_STR " to " MAC_ADDRESS_STR "\n", MAC_ADDR_ARRAY(scan->old_bssid), MAC_ADDR_ARRAY(scan->new_bssid)); } else { ret_val = scnprintf(buf + length, buf_avail_len - length, - "STA is connected to " MAC_ADDRESS_STR + "\nSTA is connected to " MAC_ADDRESS_STR " before and after scan, not roamed\n", MAC_ADDR_ARRAY(scan->old_bssid)); } diff --git a/core/hdd/src/wlan_hdd_disa.c b/core/hdd/src/wlan_hdd_disa.c index cf74913e1534..064f5526b718 100644 --- a/core/hdd/src/wlan_hdd_disa.c +++ b/core/hdd/src/wlan_hdd_disa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-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 @@ -480,6 +480,11 @@ static int __wlan_hdd_cfg80211_encrypt_decrypt_msg(struct wiphy *wiphy, adapter = WLAN_HDD_GET_PRIV_PTR(dev); + if (hdd_ctx->config->is_ps_enabled) { + hdd_debug("DISA is not supported when PS is enabled"); + return -EINVAL; + } + ret = hdd_encrypt_decrypt_msg(adapter, hdd_ctx, data, data_len); return ret; diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 893ce2e4050f..546009777711 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <linux/platform_device.h> #include <linux/pci.h> #include "cds_api.h" @@ -1402,7 +1393,6 @@ static void wlan_hdd_pld_uevent(struct device *dev, ENTER(); - mutex_lock(&hdd_init_deinit_lock); hdd_info("pld event %d", uevent->uevent); @@ -1416,8 +1406,10 @@ static void wlan_hdd_pld_uevent(struct device *dev, wlan_hdd_set_the_pld_uevent(uevent); + mutex_lock(&hdd_init_deinit_lock); switch (uevent->uevent) { case PLD_RECOVERY: + cds_set_target_ready(false); hdd_pld_ipa_uc_shutdown_pipes(); wlan_hdd_purge_notifier(); break; @@ -1425,9 +1417,9 @@ static void wlan_hdd_pld_uevent(struct device *dev, hdd_cleanup_on_fw_down(); break; } -uevent_not_allowed: mutex_unlock(&hdd_init_deinit_lock); +uevent_not_allowed: EXIT(); return; } diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index eee24657a1a6..dee8cb54cb6d 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_ext_scan.h b/core/hdd/src/wlan_hdd_ext_scan.h index 0772a67a940f..fb23942706d9 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.h +++ b/core/hdd/src/wlan_hdd_ext_scan.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c index daca6641c2dd..f87bc4029ed6 100644 --- a/core/hdd/src/wlan_hdd_ftm.c +++ b/core/hdd/src/wlan_hdd_ftm.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_ftm.c * diff --git a/core/hdd/src/wlan_hdd_green_ap.c b/core/hdd/src/wlan_hdd_green_ap.c index cbfca3c21586..6a95600cad1b 100644 --- a/core/hdd/src/wlan_hdd_green_ap.c +++ b/core/hdd/src/wlan_hdd_green_ap.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_green_ap.h b/core/hdd/src/wlan_hdd_green_ap.h index 6cadd71ff0ec..cc547aecb836 100644 --- a/core/hdd/src/wlan_hdd_green_ap.h +++ b/core/hdd/src/wlan_hdd_green_ap.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_GREEN_AP_H #define __WLAN_HDD_GREEN_AP_H diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index d3f32319367d..c5de344d4974 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_hostapd.c * @@ -573,6 +564,12 @@ static int __hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) qdf_mem_copy(&mac_addr, psta_mac_addr->sa_data, QDF_MAC_ADDR_SIZE); + if (hdd_get_adapter_by_macaddr(hdd_ctx, mac_addr.bytes)) { + hdd_err("adapter exist with same mac address " MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(mac_addr.bytes)); + return -EINVAL; + } + if (qdf_is_macaddr_zero(&mac_addr)) { hdd_err("MAC is all zero"); return -EINVAL; @@ -588,6 +585,9 @@ static int __hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) return -EINVAL; } + hdd_info("Changing MAC to " MAC_ADDRESS_STR " of interface %s ", + MAC_ADDR_ARRAY(mac_addr.bytes), + dev->name); memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN); EXIT(); return 0; @@ -1735,16 +1735,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, pHddApCtx->uBCStaId, HDD_IPA_AP_CONNECT, pHostapdAdapter->dev->dev_addr); - if (status) { + if (status) hdd_err("WLAN_AP_CONNECT event failed"); - /* - * Make sure to set the event before proceeding - * for error handling otherwise caller thread - * will wait till 10 secs and no other - * connection will go through before that. - */ - qdf_event_set(&pHostapdState->qdf_event); - } } if (0 != @@ -2217,16 +2209,21 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, &pSapEvent->sapevt.sapStationDisassocCompleteEvent; memcpy(wrqu.addr.sa_data, &disassoc_comp->staMac, QDF_MAC_ADDR_SIZE); - hdd_notice(" disassociated " MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(wrqu.addr.sa_data)); + stainfo = hdd_get_stainfo(pHostapdAdapter->cache_sta_info, disassoc_comp->staMac); - if (stainfo) { - stainfo->rssi = disassoc_comp->rssi; - stainfo->tx_rate = disassoc_comp->tx_rate; - stainfo->rx_rate = disassoc_comp->rx_rate; - stainfo->reason_code = disassoc_comp->reason_code; + if (!stainfo) { + hdd_err("peer " MAC_ADDRESS_STR " not found", + MAC_ADDR_ARRAY(wrqu.addr.sa_data)); + return -EINVAL; } + hdd_notice(" disassociated " MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(wrqu.addr.sa_data)); + + stainfo->rssi = disassoc_comp->rssi; + stainfo->tx_rate = disassoc_comp->tx_rate; + stainfo->rx_rate = disassoc_comp->rx_rate; + stainfo->reason_code = disassoc_comp->reason_code; qdf_status = qdf_event_set(&pHostapdState->qdf_sta_disassoc_event); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) @@ -2472,13 +2469,6 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, pHddApCtx->sapConfig.acs_cfg.ch_width = pSapEvent->sapevt.sap_ch_selected.ch_width; - /* Indicate operating channel change to hostapd - * only for non driver override acs - */ - if (pHostapdAdapter->device_mode == QDF_SAP_MODE && - pHddCtx->config->force_sap_acs) { - return QDF_STATUS_SUCCESS; - } sap_ch_param.ch_width = pSapEvent->sapevt.sap_ch_selected.ch_width; sap_ch_param.center_freq_seg0 = @@ -2567,9 +2557,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, pSapEvent->sapevt.sap_ch_selected.vht_seg1_center_ch; pHddApCtx->sapConfig.acs_cfg.ch_width = pSapEvent->sapevt.sap_ch_selected.ch_width; - /* send vendor event to hostapd only for hostapd based acs*/ - if (!pHddCtx->config->force_sap_acs) - wlan_hdd_cfg80211_acs_ch_select_evt(pHostapdAdapter); + wlan_hdd_cfg80211_acs_ch_select_evt(pHostapdAdapter); qdf_atomic_set( &pHostapdAdapter->sessionCtx.ap.acs_in_progress, 0); return QDF_STATUS_SUCCESS; @@ -2866,7 +2854,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel, status = wlansap_set_channel_change_with_csa( WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter), (uint32_t)target_channel, - target_bw, true); + target_bw, !(pHddCtx->config->sta_sap_scc_on_lte_coex_chan)); if (QDF_STATUS_SUCCESS != status) { hdd_err("SAP set channel failed for channel: %d, bw: %d", @@ -3248,14 +3236,6 @@ static __iw_softap_setparam(struct net_device *dev, ret = -EINVAL; } break; - case QCSAP_PARAM_AUTO_CHANNEL: - if (set_value == 0 || set_value == 1) - (WLAN_HDD_GET_CTX( - pHostapdAdapter))->config->force_sap_acs = - set_value; - else - ret = -EINVAL; - break; case QCSAP_PARAM_CONC_SYSTEM_PREF: hdd_debug("New preference: %d", set_value); if (!((set_value >= CFG_CONC_SYSTEM_PREF_MIN) && @@ -3699,6 +3679,7 @@ static __iw_softap_setparam(struct net_device *dev, ret = wma_cli_set_command(pHostapdAdapter->sessionId, WMI_PDEV_PARAM_TX_CHAIN_MASK, set_value, PDEV_CMD); + ret = hdd_set_antenna_mode(pHostapdAdapter, hdd_ctx, set_value); break; } @@ -3708,6 +3689,7 @@ static __iw_softap_setparam(struct net_device *dev, ret = wma_cli_set_command(pHostapdAdapter->sessionId, WMI_PDEV_PARAM_RX_CHAIN_MASK, set_value, PDEV_CMD); + ret = hdd_set_antenna_mode(pHostapdAdapter, hdd_ctx, set_value); break; } @@ -3819,7 +3801,6 @@ static __iw_softap_setparam(struct net_device *dev, (int)WMI_PDEV_PARAM_ENABLE_RTS_SIFS_BURSTING, set_value, PDEV_CMD); break; - default: hdd_err("Invalid setparam command %d value %d", sub_cmd, set_value); @@ -3937,11 +3918,6 @@ static __iw_softap_getparam(struct net_device *dev, } break; - case QCSAP_PARAM_AUTO_CHANNEL: - *value = (WLAN_HDD_GET_CTX - (pHostapdAdapter))->config->force_sap_acs; - break; - case QCSAP_PARAM_GET_WLAN_DBG: { qdf_trace_display(); @@ -4610,45 +4586,6 @@ static int iw_get_char_setnone(struct net_device *dev, return ret; } -static int wlan_hdd_set_force_acs_ch_range(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - hdd_adapter_t *adapter = (netdev_priv(dev)); - hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); - int *value = (int *)extra; - - ENTER_DEV(dev); - - if (!capable(CAP_NET_ADMIN)) { - hdd_err("permission check failed"); - return -EPERM; - } - - if (wlan_hdd_validate_operation_channel(adapter, value[0]) != - QDF_STATUS_SUCCESS || - wlan_hdd_validate_operation_channel(adapter, value[1]) != - QDF_STATUS_SUCCESS) { - return -EINVAL; - } - hdd_ctx->config->force_sap_acs_st_ch = value[0]; - hdd_ctx->config->force_sap_acs_end_ch = value[1]; - - return 0; -} - -static int iw_softap_set_force_acs_ch_range(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret; - - cds_ssr_protect(__func__); - ret = wlan_hdd_set_force_acs_ch_range(dev, info, wrqu, extra); - cds_ssr_unprotect(__func__); - return ret; -} - static int __iw_get_channel_list(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -5327,58 +5264,6 @@ static int iw_get_ap_freq(struct net_device *dev, return ret; } -/** - * __iw_get_mode() - get mode - * @dev - Pointer to the net device. - * @info - Pointer to the iw_request_info. - * @wrqu - Pointer to the iwreq_data. - * @extra - Pointer to the data. - * - * Return: 0 for success, non zero for failure. - */ -static int __iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) { - - hdd_adapter_t *adapter; - hdd_context_t *hdd_ctx; - int ret; - - ENTER_DEV(dev); - - adapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_ctx = WLAN_HDD_GET_CTX(adapter); - ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) - return ret; - - wrqu->mode = IW_MODE_MASTER; - - return ret; -} - -/** - * iw_get_mode() - Wrapper function to protect __iw_get_mode from the SSR. - * @dev - Pointer to the net device. - * @info - Pointer to the iw_request_info. - * @wrqu - Pointer to the iwreq_data. - * @extra - Pointer to the data. - * - * Return: 0 for success, non zero for failure. - */ -static int iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret; - - cds_ssr_protect(__func__); - ret = __iw_get_mode(dev, info, wrqu, extra); - cds_ssr_unprotect(__func__); - - return ret; -} - static int __iw_softap_stopbss(struct net_device *dev, struct iw_request_info *info, @@ -5452,7 +5337,8 @@ __iw_softap_version(struct net_device *dev, if (0 != ret) return ret; - hdd_wlan_get_version(hdd_ctx, wrqu, extra); + wrqu->data.length = hdd_wlan_get_version(hdd_ctx, WE_MAX_STR_LEN, + extra); EXIT(); return 0; } @@ -5712,15 +5598,13 @@ int __iw_get_softap_linkspeed(struct net_device *dev, hdd_err("Invalid peer macaddress"); return -EINVAL; } - errno = wlan_hdd_get_linkspeed_for_peermac(pHostapdAdapter, - macAddress); - if (errno) { + rc = wlan_hdd_get_linkspeed_for_peermac(pHostapdAdapter, &macAddress, + &link_speed); + if (rc) { hdd_err("Unable to retrieve SME linkspeed: %d", errno); - return errno; + return rc; } - link_speed = pHostapdAdapter->ls_stats.estLinkSpeed; - /* linkspeed in units of 500 kbps */ link_speed = link_speed / 500; wrqu->data.length = len; @@ -5803,8 +5687,7 @@ __iw_get_peer_rssi(struct net_device *dev, struct iw_request_info *info, hdd_err("String to Hex conversion Failed"); } - ret = wlan_hdd_get_peer_rssi(adapter, &macaddress, - HDD_WLAN_GET_PEER_RSSI_SOURCE_USER); + ret = wlan_hdd_get_peer_rssi(adapter, &macaddress); if (ret) { hdd_err("Unable to retrieve peer rssi: %d", ret); return ret; @@ -5870,7 +5753,7 @@ static const iw_handler hostapd_handler[] = { (iw_handler) NULL, /* SIOCSIWFREQ */ (iw_handler) iw_get_ap_freq, /* SIOCGIWFREQ */ (iw_handler) NULL, /* SIOCSIWMODE */ - (iw_handler) iw_get_mode, /* SIOCGIWMODE */ + (iw_handler) NULL, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ @@ -5962,10 +5845,6 @@ static const struct iw_priv_args hostapd_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setChanChange" }, { - QCSAP_PARAM_AUTO_CHANNEL, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, - "setAutoChannel" - }, { QCSAP_PARAM_CONC_SYSTEM_PREF, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setConcSysPref" @@ -6139,9 +6018,6 @@ static const struct iw_priv_args hostapd_private_args[] = { QCSAP_PARAM_GET_WLAN_DBG, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwlandbg" }, { - QCSAP_PARAM_AUTO_CHANNEL, 0, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getAutoChannel" - }, { QCSAP_GTX_BWMASK, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_gtxBWMask" }, { @@ -6280,9 +6156,6 @@ static const struct iw_priv_args hostapd_private_args[] = { { WE_SET_WLAN_DBG, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "setwlandbg" - }, { - WE_SET_SAP_CHANNELS, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "setsapchannels" } , /* handlers for sub-ioctl */ @@ -6433,8 +6306,6 @@ static const iw_handler hostapd_private[] = { [QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE - SIOCIWFIRSTPRIV] = iw_set_var_ints_getnone, - [QCSAP_IOCTL_SET_CHANNEL_RANGE - SIOCIWFIRSTPRIV] = - iw_softap_set_force_acs_ch_range, [QCSAP_IOCTL_MODIFY_ACL - SIOCIWFIRSTPRIV] = iw_softap_modify_acl, [QCSAP_IOCTL_GET_CHANNEL_LIST - SIOCIWFIRSTPRIV] = @@ -7661,10 +7532,6 @@ static int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) tsap_Config_t *sap_cfg = &ap_adapter->sessionCtx.ap.sapConfig; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); - if (ap_adapter->device_mode == QDF_SAP_MODE && - hdd_ctx->config->force_sap_acs) - goto setup_acs_overrides; - /* Fixed channel 11AC override: * 11AC override in qcacld is introduced for following reasons: * 1. P2P GO also follows start_bss and since p2p GO could not be @@ -7679,14 +7546,15 @@ static int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) * enable_sub_20_channel_width is non zero */ if (!hdd_ctx->config->enable_sub_20_channel_width && - hdd_ctx->config->sap_p2p_11ac_override && (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) && - !(((ap_adapter->device_mode == QDF_SAP_MODE) && - (hdd_ctx->config->sap_force_11n_for_11ac)) || - ((ap_adapter->device_mode == QDF_P2P_GO_MODE) && - (hdd_ctx->config->go_force_11n_for_11ac)))) { + ((ap_adapter->device_mode == QDF_SAP_MODE && + !hdd_ctx->config->sap_force_11n_for_11ac && + hdd_ctx->config->sap_11ac_override) || + (ap_adapter->device_mode == QDF_P2P_GO_MODE && + !hdd_ctx->config->go_force_11n_for_11ac && + hdd_ctx->config->go_11ac_override))) { hdd_debug("** Driver force 11AC override for SAP/Go **"); /* 11n only shall not be overridden since it may be on purpose*/ @@ -7716,82 +7584,6 @@ static int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) sap_cfg->sec_ch, &sap_cfg->ch_params); return 0; - -setup_acs_overrides: - hdd_debug("** Driver force ACS override **"); - - sap_cfg->channel = AUTO_CHANNEL_SELECT; - sap_cfg->acs_cfg.acs_mode = true; - sap_cfg->acs_cfg.start_ch = hdd_ctx->config->force_sap_acs_st_ch; - sap_cfg->acs_cfg.end_ch = hdd_ctx->config->force_sap_acs_end_ch; - - if (sap_cfg->acs_cfg.start_ch > sap_cfg->acs_cfg.end_ch) { - hdd_err("Driver force ACS start ch (%d) > end ch (%d)", - sap_cfg->acs_cfg.start_ch, sap_cfg->acs_cfg.end_ch); - return -EINVAL; - } - - /* Derive ACS HW mode */ - sap_cfg->SapHw_mode = hdd_cfg_xlate_to_csr_phy_mode( - hdd_ctx->config->dot11Mode); - if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_AUTO) - sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11ac; - - if (((ap_adapter->device_mode == QDF_SAP_MODE) && - (hdd_ctx->config->sap_force_11n_for_11ac)) || - ((ap_adapter->device_mode == QDF_P2P_GO_MODE) && - (hdd_ctx->config->go_force_11n_for_11ac))) { - if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac || - sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) - sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11n; - } - - if ((sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11b || - sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11g || - sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11g_ONLY) && - sap_cfg->acs_cfg.start_ch > 14) { - hdd_err("Invalid ACS HW Mode %d + CH range <%d - %d>", - sap_cfg->SapHw_mode, sap_cfg->acs_cfg.start_ch, - sap_cfg->acs_cfg.end_ch); - return -EINVAL; - } - sap_cfg->acs_cfg.hw_mode = sap_cfg->SapHw_mode; - - /* Derive ACS BW */ - sap_cfg->ch_width_orig = eHT_CHANNEL_WIDTH_20MHZ; - if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac || - sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) { - - sap_cfg->ch_width_orig = hdd_ctx->config->vhtChannelWidth; - /* VHT in 2.4G depends on gChannelBondingMode24GHz INI param */ - if (sap_cfg->acs_cfg.end_ch <= 14) - sap_cfg->ch_width_orig = - hdd_ctx->config->nChannelBondingMode24GHz ? - eHT_CHANNEL_WIDTH_40MHZ : - eHT_CHANNEL_WIDTH_20MHZ; - } - - if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n || - sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n_ONLY) { - if (sap_cfg->acs_cfg.end_ch <= 14) - sap_cfg->ch_width_orig = - hdd_ctx->config->nChannelBondingMode24GHz ? - eHT_CHANNEL_WIDTH_40MHZ : - eHT_CHANNEL_WIDTH_20MHZ; - else - sap_cfg->ch_width_orig = - hdd_ctx->config->nChannelBondingMode5GHz ? - eHT_CHANNEL_WIDTH_40MHZ : - eHT_CHANNEL_WIDTH_20MHZ; - } - sap_cfg->acs_cfg.ch_width = sap_cfg->ch_width_orig; - - hdd_debug("Force ACS Config: HW_MODE: %d ACS_BW: %d", - sap_cfg->acs_cfg.hw_mode, sap_cfg->acs_cfg.ch_width); - hdd_debug("Force ACS Config: ST_CH: %d END_CH: %d", - sap_cfg->acs_cfg.start_ch, sap_cfg->acs_cfg.end_ch); - - return 0; } #ifdef WLAN_FEATURE_UDP_RESPONSE_OFFLOAD @@ -8154,11 +7946,28 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, wlan_hdd_disconnect(sta_adapter, eCSR_DISCONNECT_REASON_DEAUTH); } + /* + * Reject start bss if reassoc in progress on any adapter. + * sme_is_any_session_in_middle_of_roaming is for LFR2 and + * hdd_is_roaming_in_progress is for LFR3 + */ + if (sme_is_any_session_in_middle_of_roaming(hHal) || + hdd_is_roaming_in_progress(pHddCtx)) { + hdd_info("Reassociation in progress"); + ret = -EINVAL; + goto ret_status; + } + + /* + * Disable Roaming on all adapters before starting bss + */ + wlan_hdd_disable_roaming(pHostapdAdapter); + sme_config = qdf_mem_malloc(sizeof(tSmeConfigParams)); if (!sme_config) { hdd_err("failed to allocate memory"); ret = -EINVAL; - goto ret_status; + goto enable_roaming; } iniConfig = pHddCtx->config; @@ -8168,7 +7977,8 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, clear_bit(ACS_IN_PROGRESS, &pHddCtx->g_event_flags); /* Mark the indoor channel (passive) to disable */ - if (iniConfig->disable_indoor_channel) { + if (iniConfig->disable_indoor_channel && + pHostapdAdapter->device_mode == QDF_SAP_MODE) { hdd_update_indoor_channel(pHddCtx, true); if (QDF_IS_STATUS_ERROR( sme_update_channel_list(pHddCtx->hHal))) { @@ -8568,8 +8378,7 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, acl_entry++; } } - if (!pHddCtx->config->force_sap_acs && - !(ssid && qdf_str_len(PRE_CAC_SSID) == ssid_len && + if (!(ssid && qdf_str_len(PRE_CAC_SSID) == ssid_len && (0 == qdf_mem_cmp(ssid, PRE_CAC_SSID, ssid_len)))) { pIe = wlan_hdd_cfg80211_get_ie_ptr( &pMgmt_frame->u.beacon.variable[0], @@ -8796,6 +8605,10 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, pHostapdState->bCommit = true; if (sme_config) qdf_mem_free(sme_config); + + /* Enable Roaming after start bss */ + wlan_hdd_enable_roaming(pHostapdAdapter); + EXIT(); return 0; @@ -8804,7 +8617,8 @@ error: if (pHostapdAdapter->device_mode == QDF_SAP_MODE) wlan_hdd_restore_channels(pHddCtx); /* Revert the indoor to passive marking if START BSS fails */ - if (iniConfig->disable_indoor_channel) { + if (iniConfig->disable_indoor_channel && + pHostapdAdapter->device_mode == QDF_SAP_MODE) { hdd_update_indoor_channel(pHddCtx, false); sme_update_channel_list(pHddCtx->hHal); } @@ -8815,9 +8629,14 @@ error: &pHostapdAdapter->sessionCtx.ap.acs_in_progress, 0); wlan_hdd_undo_acs(pHostapdAdapter); +enable_roaming: + /* Enable Roaming after start bss in case of failure */ + wlan_hdd_enable_roaming(pHostapdAdapter); + ret_status: if (disable_fw_tdls_state) wlan_hdd_check_conc_and_update_tdls_state(pHddCtx, false); + return ret; } @@ -9325,10 +9144,22 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("ERR: clear event failed"); + /* + * Stop opportunistic timer here if running as we are already doing + * hw mode change before vdev start based on the new concurrency + * situation. If timer is not stopped and if it gets triggered before + * VDEV_UP, it will reset the hw mode to some wrong value. + */ + status = cds_stop_opportunistic_timer(); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("Failed to stop DBS opportunistic timer"); + return -EINVAL; + } + status = cds_current_connections_update(pAdapter->sessionId, channel, SIR_UPDATE_REASON_START_AP); - if (QDF_STATUS_E_FAILURE == status) { + if (status == QDF_STATUS_E_FAILURE) { hdd_err("ERROR: connections update failed!!"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_hostapd.h b/core/hdd/src/wlan_hdd_hostapd.h index 6bff97de826e..a4c8c4b9b289 100644 --- a/core/hdd/src/wlan_hdd_hostapd.h +++ b/core/hdd/src/wlan_hdd_hostapd.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_HDD_HOSTAPD_H) #define WLAN_HDD_HOSTAPD_H diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 3cbd92566d33..93af2e7ef9b8 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* Include Files */ #include <wlan_hdd_includes.h> @@ -40,6 +31,7 @@ #include <linux/ctype.h> #include "wma.h" #include "wlan_hdd_napi.h" +#include "wlan_hdd_request_manager.h" #ifdef FEATURE_WLAN_ESE #include <sme_api.h> @@ -153,138 +145,83 @@ static int drv_cmd_validate(uint8_t *command, int len) } #ifdef FEATURE_WLAN_ESE +struct tsm_priv { + tAniTrafStrmMetrics tsm_metrics; +}; + static void hdd_get_tsm_stats_cb(tAniTrafStrmMetrics tsm_metrics, const uint32_t staId, void *context) { - struct statsContext *stats_context = NULL; - hdd_adapter_t *adapter = NULL; + struct hdd_request *request; + struct tsm_priv *priv; - if (NULL == context) { - hdd_err("Bad param, context [%pK]", context); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request"); return; } + priv = hdd_request_priv(request); + priv->tsm_metrics = tsm_metrics; + hdd_request_complete(request); + hdd_request_put(request); + EXIT(); - /* - * there is a race condition that exists between this callback - * function and the caller since the caller could time out either - * before or while this code is executing. we use a spinlock to - * serialize these actions - */ - spin_lock(&hdd_context_lock); - - stats_context = context; - adapter = stats_context->pAdapter; - if ((NULL == adapter) || - (STATS_CONTEXT_MAGIC != stats_context->magic)) { - /* - * the caller presumably timed out so there is - * nothing we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, adapter [%pK] magic [%08x]", - adapter, stats_context->magic); - return; - } - - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - stats_context->magic = 0; - - /* copy over the tsm stats */ - adapter->tsmStats.UplinkPktQueueDly = tsm_metrics.UplinkPktQueueDly; - qdf_mem_copy(adapter->tsmStats.UplinkPktQueueDlyHist, - tsm_metrics.UplinkPktQueueDlyHist, - sizeof(adapter->tsmStats.UplinkPktQueueDlyHist) / - sizeof(adapter->tsmStats.UplinkPktQueueDlyHist[0])); - adapter->tsmStats.UplinkPktTxDly = tsm_metrics.UplinkPktTxDly; - adapter->tsmStats.UplinkPktLoss = tsm_metrics.UplinkPktLoss; - adapter->tsmStats.UplinkPktCount = tsm_metrics.UplinkPktCount; - adapter->tsmStats.RoamingCount = tsm_metrics.RoamingCount; - adapter->tsmStats.RoamingDly = tsm_metrics.RoamingDly; - - /* notify the caller */ - complete(&stats_context->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); } -static -QDF_STATUS hdd_get_tsm_stats(hdd_adapter_t *adapter, +static int hdd_get_tsm_stats(hdd_adapter_t *adapter, const uint8_t tid, tAniTrafStrmMetrics *tsm_metrics) { - hdd_station_ctx_t *hdd_sta_ctx = NULL; - QDF_STATUS hstatus; - QDF_STATUS vstatus = QDF_STATUS_SUCCESS; - unsigned long rc; - static struct statsContext context; - hdd_context_t *hdd_ctx = NULL; + hdd_context_t *hdd_ctx; + hdd_station_ctx_t *hdd_sta_ctx; + QDF_STATUS status; + int ret; + void *cookie; + struct hdd_request *request; + struct tsm_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == adapter) { hdd_err("adapter is NULL"); - return QDF_STATUS_E_FAULT; + return -EINVAL; } hdd_ctx = WLAN_HDD_GET_CTX(adapter); hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - /* we are connected prepare our callback context */ - init_completion(&context.completion); - context.pAdapter = adapter; - context.magic = STATS_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + cookie = hdd_request_cookie(request); - /* query tsm stats */ - hstatus = sme_get_tsm_stats(hdd_ctx->hHal, hdd_get_tsm_stats_cb, - hdd_sta_ctx->conn_info.staId[0], - hdd_sta_ctx->conn_info.bssId, - &context, hdd_ctx->pcds_context, tid); - if (QDF_STATUS_SUCCESS != hstatus) { - hdd_err("Unable to retrieve statistics"); - vstatus = QDF_STATUS_E_FAULT; - } else { - /* request was sent -- wait for the response */ - rc = wait_for_completion_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (!rc) { - hdd_err("SME timed out while retrieving statistics"); - vstatus = QDF_STATUS_E_TIMEOUT; - } + status = sme_get_tsm_stats(hdd_ctx->hHal, hdd_get_tsm_stats_cb, + hdd_sta_ctx->conn_info.staId[0], + hdd_sta_ctx->conn_info.bssId, + cookie, hdd_ctx->pcds_context, tid); + if (QDF_STATUS_SUCCESS != status) { + hdd_err("Unable to retrieve tsm statistics"); + ret = qdf_status_to_os_return(status); + goto cleanup; } - /* - * either we never sent a request, we sent a request and received a - * response or we sent a request and timed out. if we never sent a - * request or if we sent a request and got a response, we want to - * clear the magic out of paranoia. if we timed out there is a - * race condition such that the callback function could be - * executing at the same time we are. of primary concern is if the - * callback function had already verified the "magic" but had not - * yet set the completion variable when a timeout occurred. we - * serialize these activities by invalidating the magic while - * holding a shared spinlock which will cause us to block if the - * callback is currently executing - */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + ret = hdd_request_wait_for_response(request); + if (ret) { + hdd_err("SME timed out while retrieving tsm statistics"); + goto cleanup; + } + + priv = hdd_request_priv(request); + *tsm_metrics = priv->tsm_metrics; - if (QDF_STATUS_SUCCESS == vstatus) { - tsm_metrics->UplinkPktQueueDly = - adapter->tsmStats.UplinkPktQueueDly; - qdf_mem_copy(tsm_metrics->UplinkPktQueueDlyHist, - adapter->tsmStats.UplinkPktQueueDlyHist, - sizeof(adapter->tsmStats.UplinkPktQueueDlyHist) / - sizeof(adapter->tsmStats. - UplinkPktQueueDlyHist[0])); - tsm_metrics->UplinkPktTxDly = adapter->tsmStats.UplinkPktTxDly; - tsm_metrics->UplinkPktLoss = adapter->tsmStats.UplinkPktLoss; - tsm_metrics->UplinkPktCount = adapter->tsmStats.UplinkPktCount; - tsm_metrics->RoamingCount = adapter->tsmStats.RoamingCount; - tsm_metrics->RoamingDly = adapter->tsmStats.RoamingDly; - } - return vstatus; + cleanup: + hdd_request_put(request); + + return ret; } #endif /*FEATURE_WLAN_ESE */ @@ -1514,6 +1451,13 @@ hdd_parse_set_roam_scan_channels_v1(hdd_adapter_t *adapter, goto exit; } + if (!sme_validate_channel_list(hdd_ctx->hHal, + channel_list, num_chan)) { + hdd_err("List contains invalid channel(s)"); + ret = -EINVAL; + goto exit; + } + status = sme_change_roam_scan_channel_list(hdd_ctx->hHal, adapter->sessionId, @@ -1575,6 +1519,13 @@ hdd_parse_set_roam_scan_channels_v2(hdd_adapter_t *adapter, for (i = 0; i < num_chan; i++) { channel = *value++; + if (!channel) { + hdd_err("Channels end at index %d, expected %d", + i, num_chan); + ret = -EINVAL; + goto exit; + } + if (channel > WNI_CFG_CURRENT_CHANNEL_STAMAX) { hdd_err("index %d invalid channel %d", i, channel); @@ -1583,6 +1534,14 @@ hdd_parse_set_roam_scan_channels_v2(hdd_adapter_t *adapter, } channel_list[i] = channel; } + + if (!sme_validate_channel_list(hdd_ctx->hHal, + channel_list, num_chan)) { + hdd_err("List contains invalid channel(s)"); + ret = -EINVAL; + goto exit; + } + status = sme_change_roam_scan_channel_list(hdd_ctx->hHal, adapter->sessionId, @@ -2395,6 +2354,131 @@ free: return retval; } +#ifdef WLAN_AP_STA_CONCURRENCY +/** + * hdd_conc_set_dwell_time() - Set Concurrent dwell time parameters + * @adapter: Adapter upon which the command was received + * @command: ASCII text command that is received + * + * Driver commands: + * wpa_cli DRIVER CONCSETDWELLTIME ACTIVE MAX <value> + * wpa_cli DRIVER CONCSETDWELLTIME ACTIVE MIN <value> + * wpa_cli DRIVER CONCSETDWELLTIME PASSIVE MAX <value> + * wpa_cli DRIVER CONCSETDWELLTIME PASSIVE MIN <value> + * + * Return: 0 for success non-zero for failure + */ +static int hdd_conc_set_dwell_time(hdd_context_t *hdd_ctx, uint8_t *command) +{ + tHalHandle hhal; + struct hdd_config *p_cfg; + u8 *value = command; + tSmeConfigParams *sme_config; + int val = 0, temp = 0; + int retval = 0; + + p_cfg = hdd_ctx->config; + hhal = hdd_ctx->hHal; + if (!p_cfg || !hhal) { + hdd_err("Argument passed for CONCSETDWELLTIME is incorrect"); + return -EINVAL; + } + + sme_config = qdf_mem_malloc(sizeof(*sme_config)); + if (!sme_config) { + hdd_err("Failed to allocate memory for sme_config"); + return -ENOMEM; + } + + qdf_mem_zero(sme_config, sizeof(*sme_config)); + sme_get_config_param(hhal, sme_config); + + if (strncmp(command, "CONCSETDWELLTIME ACTIVE MAX", 27) == 0) { + if (drv_cmd_validate(command, 27)) { + hdd_err("Invalid driver command"); + retval = -EINVAL; + goto sme_config_free; + } + + value = value + 28; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MIN || + val > CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MAX) { + hdd_err("Argument passed for CONCSETDWELLTIME ACTIVE MAX is incorrect"); + retval = -EFAULT; + goto sme_config_free; + } + + p_cfg->nActiveMaxChnTimeConc = val; + sme_config->csrConfig.nActiveMaxChnTimeConc = val; + sme_update_config(hhal, sme_config); + } else if (strncmp(command, "CONCSETDWELLTIME ACTIVE MIN", 27) == 0) { + if (drv_cmd_validate(command, 27)) { + hdd_err("Invalid driver command"); + retval = -EINVAL; + goto sme_config_free; + } + + value = value + 28; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MIN || + val > CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MAX) { + hdd_err("argument passed for CONCSETDWELLTIME ACTIVE MIN is incorrect"); + retval = -EFAULT; + goto sme_config_free; + } + + p_cfg->nActiveMinChnTimeConc = val; + sme_config->csrConfig.nActiveMinChnTimeConc = val; + sme_update_config(hhal, sme_config); + } else if (strncmp(command, "CONCSETDWELLTIME PASSIVE MAX", 28) == 0) { + if (drv_cmd_validate(command, 28)) { + hdd_err("Invalid driver command"); + retval = -EINVAL; + goto sme_config_free; + } + + value = value + 29; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MIN || + val > CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MAX) { + hdd_err("Argument passed for CONCSETDWELLTIME PASSIVE MAX is incorrect"); + retval = -EFAULT; + goto sme_config_free; + } + + p_cfg->nPassiveMaxChnTimeConc = val; + sme_config->csrConfig.nPassiveMaxChnTimeConc = val; + sme_update_config(hhal, sme_config); + } else if (strncmp(command, "CONCSETDWELLTIME PASSIVE MIN", 28) == 0) { + if (drv_cmd_validate(command, 28)) { + hdd_err("Invalid driver command"); + retval = -EINVAL; + goto sme_config_free; + } + + value = value + 29; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MIN || + val > CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MAX) { + hdd_err("argument passed for SETDWELLTIME PASSIVE MIN is incorrect"); + retval = -EFAULT; + goto sme_config_free; + } + + p_cfg->nPassiveMinChnTimeConc = val; + sme_config->csrConfig.nPassiveMinChnTimeConc = val; + sme_update_config(hhal, sme_config); + } else { + retval = -EINVAL; + } + +sme_config_free: + qdf_mem_free(sme_config); + return retval; +} +#endif + static void hdd_get_link_status_cb(uint8_t status, void *context) { struct statsContext *pLinkContext; @@ -2900,25 +2984,23 @@ static int drv_cmd_p2p_dev_addr(hdd_adapter_t *adapter, uint8_t command_len, hdd_priv_data_t *priv_data) { - int ret = 0; + struct qdf_mac_addr *addr = &hdd_ctx->p2pDeviceAddress; + size_t user_size = QDF_MIN(sizeof(addr->bytes), priv_data->total_len); MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_P2P_DEV_ADDR_IOCTL, adapter->sessionId, - (unsigned int)(*(hdd_ctx->p2pDeviceAddress.bytes + 2) - << 24 | *(hdd_ctx->p2pDeviceAddress.bytes - + 3) << 16 | *(hdd_ctx-> - p2pDeviceAddress.bytes + 4) << 8 | - *(hdd_ctx->p2pDeviceAddress.bytes + - 5)))); - - if (copy_to_user(priv_data->buf, hdd_ctx->p2pDeviceAddress.bytes, - sizeof(tSirMacAddr))) { + (unsigned int)(*(addr->bytes + 2) << 24 | + *(addr->bytes + 3) << 16 | + *(addr->bytes + 4) << 8 | + *(addr->bytes + 5)))); + + if (copy_to_user(priv_data->buf, addr->bytes, user_size)) { hdd_err("failed to copy data to user buffer"); - ret = -EFAULT; + return -EFAULT; } - return ret; + return 0; } /** @@ -4726,6 +4808,17 @@ static int drv_cmd_set_dwell_time(hdd_adapter_t *adapter, return hdd_set_dwell_time(adapter, command); } +#ifdef WLAN_AP_STA_CONCURRENCY +static int drv_cmd_conc_set_dwell_time(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, + u8 *command, + u8 command_len, + hdd_priv_data_t *priv_data) +{ + return hdd_conc_set_dwell_time(hdd_ctx, command); +} +#endif + static int drv_cmd_miracast(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx, uint8_t *command, @@ -5081,13 +5174,16 @@ static int drv_cmd_get_ibss_peer_info_all(hdd_adapter_t *adapter, /* Handle the command */ status = hdd_cfg80211_get_ibss_peer_info_all(adapter); if (QDF_STATUS_SUCCESS == status) { + size_t user_size = QDF_MIN(WLAN_MAX_BUF_SIZE, + priv_data->total_len); + /* * The variable extra needed to be allocated on the heap since * amount of memory required to copy the data for 32 devices * exceeds the size of 1024 bytes of default stack size. On * 64 bit devices, the default max stack size of 2048 bytes */ - extra = qdf_mem_malloc(WLAN_MAX_BUF_SIZE); + extra = qdf_mem_malloc(user_size); if (NULL == extra) { hdd_err("memory allocation failed"); @@ -5096,7 +5192,7 @@ static int drv_cmd_get_ibss_peer_info_all(hdd_adapter_t *adapter, } /* Copy number of stations */ - length = scnprintf(extra, WLAN_MAX_BUF_SIZE, "%d ", + length = scnprintf(extra, user_size, "%d ", pHddStaCtx->ibss_peer_info.numPeers); numOfBytestoPrint = length; for (idx = 0; idx < pHddStaCtx->ibss_peer_info.numPeers; @@ -5119,8 +5215,8 @@ static int drv_cmd_get_ibss_peer_info_all(hdd_adapter_t *adapter, rssi = pHddStaCtx->ibss_peer_info.peerInfoParams[idx]. rssi; - length += scnprintf((extra + length), - WLAN_MAX_BUF_SIZE - length, + length += scnprintf(extra + length, + user_size - length, "%02x:%02x:%02x:%02x:%02x:%02x %d %d ", mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5], @@ -5256,7 +5352,7 @@ static int drv_cmd_get_ibss_peer_info(hdd_adapter_t *adapter, } /* Success ! */ - hdd_debug("%s", priv_data->buf); + hdd_debug("%s", extra); ret = 0; exit: @@ -5392,6 +5488,14 @@ static int drv_cmd_set_ccx_roam_scan_channels(hdd_adapter_t *adapter, ret = -EINVAL; goto exit; } + + if (!sme_validate_channel_list(hdd_ctx->hHal, + ChannelList, numChannels)) { + hdd_err("List contains invalid channel(s)"); + ret = -EINVAL; + goto exit; + } + status = sme_set_ese_roam_scan_channel_list(hdd_ctx->hHal, adapter->sessionId, ChannelList, @@ -5418,7 +5522,7 @@ static int drv_cmd_get_tsm_stats(hdd_adapter_t *adapter, int len = 0; uint8_t tid = 0; hdd_station_ctx_t *pHddStaCtx; - tAniTrafStrmMetrics tsm_metrics; + tAniTrafStrmMetrics tsm_metrics = {0}; if ((QDF_STA_MODE != adapter->device_mode) && (QDF_P2P_CLIENT_MODE != adapter->device_mode)) { @@ -5461,10 +5565,9 @@ static int drv_cmd_get_tsm_stats(hdd_adapter_t *adapter, } hdd_debug("Received Command to get tsm stats tid = %d", tid); - if (QDF_STATUS_SUCCESS != - hdd_get_tsm_stats(adapter, tid, &tsm_metrics)) { + ret = hdd_get_tsm_stats(adapter, tid, &tsm_metrics); + if (ret) { hdd_err("failed to get tsm stats"); - ret = -EFAULT; goto exit; } hdd_debug( @@ -5557,7 +5660,7 @@ static int drv_cmd_ccx_beacon_req(hdd_adapter_t *adapter, { int ret; uint8_t *value = command; - tCsrEseBeaconReq eseBcnReq; + tCsrEseBeaconReq eseBcnReq = {0}; QDF_STATUS status = QDF_STATUS_SUCCESS; if (QDF_STA_MODE != adapter->device_mode) { @@ -5575,6 +5678,10 @@ static int drv_cmd_ccx_beacon_req(hdd_adapter_t *adapter, if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) { hdd_debug("Not associated"); + + if (!eseBcnReq.numBcnReqIe) + return -EINVAL; + hdd_indicate_ese_bcn_report_no_results(adapter, eseBcnReq.bcnReq[0].measurementToken, 0x02, /* BIT(1) set for measurement done */ @@ -5734,7 +5841,7 @@ static int drv_cmd_set_mc_rate(hdd_adapter_t *adapter, { int ret = 0; uint8_t *value = command; - int targetRate; + int targetRate = 0; /* input value is in units of hundred kbps */ @@ -6303,7 +6410,7 @@ static int hdd_driver_rxfilter_comand_handler(uint8_t *command, value = command + 13; ret = kstrtou8(value, 10, &type); if (ret < 0) { - hdd_err("kstrtou8 failed invalid input value %d", type); + hdd_err("kstrtou8 failed invalid input value"); return -EINVAL; } @@ -6491,46 +6598,16 @@ QDF_STATUS hdd_update_smps_antenna_mode(hdd_context_t *hdd_ctx, int mode) return QDF_STATUS_SUCCESS; } -/** - * drv_cmd_set_antenna_mode() - SET ANTENNA MODE driver command - * handler - * @adapter: Pointer to network adapter - * @hdd_ctx: Pointer to hdd context - * @command: Pointer to input command - * @command_len: Command length - * @priv_data: Pointer to private data in command - */ -static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, - hdd_context_t *hdd_ctx, - uint8_t *command, - uint8_t command_len, - hdd_priv_data_t *priv_data) +int hdd_set_antenna_mode(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, int mode) { + struct sir_antenna_mode_param params; QDF_STATUS status; int ret = 0; - int mode; - uint8_t *value = command; - - if (((1 << QDF_STA_MODE) != hdd_ctx->concurrency_mode) || - (hdd_ctx->no_of_active_sessions[QDF_STA_MODE] > 1)) { - hdd_err("Operation invalid in non sta or concurrent mode"); - ret = -EPERM; - goto exit; - } - - mode = hdd_parse_setantennamode_command(value); - if (mode < 0) { - hdd_err("Invalid SETANTENNA command"); - ret = mode; - goto exit; - } - - hdd_debug("Processing antenna mode switch to: %d", mode); if (hdd_ctx->current_antenna_mode == mode) { hdd_err("System already in the requested mode"); - ret = 0; goto exit; } @@ -6544,7 +6621,6 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, if ((HDD_ANTENNA_MODE_1X1 == mode) && hdd_is_supported_chain_mask_1x1(hdd_ctx)) { hdd_err("System only supports 1x1 mode"); - ret = 0; goto exit; } @@ -6581,7 +6657,7 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, INIT_COMPLETION(hdd_ctx->set_antenna_mode_cmpl); status = sme_soc_set_antenna_mode(hdd_ctx->hHal, ¶ms); - if (QDF_STATUS_SUCCESS != status) { + if (QDF_IS_STATUS_ERROR(status)) { hdd_err("set antenna mode failed status : %d", status); ret = -EFAULT; goto exit; @@ -6591,8 +6667,8 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, &hdd_ctx->set_antenna_mode_cmpl, msecs_to_jiffies(WLAN_WAIT_TIME_ANTENNA_MODE_REQ)); if (!ret) { - ret = -EFAULT; hdd_err("send set antenna mode timed out"); + ret = -EFAULT; goto exit; } @@ -6616,8 +6692,36 @@ exit: #endif hdd_debug("Set antenna status: %d current mode: %d", ret, hdd_ctx->current_antenna_mode); + return ret; +} +/** + * drv_cmd_set_antenna_mode() - SET ANTENNA MODE driver command + * handler + * @adapter: Pointer to network adapter + * @hdd_ctx: Pointer to hdd context + * @command: Pointer to input command + * @command_len: Command length + * @priv_data: Pointer to private data in command + */ +static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, + uint8_t *command, + uint8_t command_len, + hdd_priv_data_t *priv_data) +{ + int mode; + uint8_t *value = command; + mode = hdd_parse_setantennamode_command(value); + if (mode < 0) { + hdd_err("Invalid SETANTENNA command"); + return mode; + } + + hdd_debug("Processing antenna mode switch to: %d", mode); + + return hdd_set_antenna_mode(adapter, hdd_ctx, mode); } /** @@ -7177,8 +7281,6 @@ static const struct hdd_drv_cmd hdd_drv_cmds[] = { {"COUNTRY", drv_cmd_country, true}, {"SETSUSPENDMODE", drv_cmd_dummy, false}, {"SET_AP_WPS_P2P_IE", drv_cmd_dummy, false}, - {"BTCOEXSCAN", drv_cmd_dummy, false}, - {"RXFILTER", drv_cmd_dummy, false}, {"SETROAMTRIGGER", drv_cmd_set_roam_trigger, true}, {"GETROAMTRIGGER", drv_cmd_get_roam_trigger, false}, {"SETROAMSCANPERIOD", drv_cmd_set_roam_scan_period, true}, @@ -7231,6 +7333,9 @@ static const struct hdd_drv_cmd hdd_drv_cmds[] = { {"BTCOEXMODE", drv_cmd_bt_coex_mode, true}, {"SCAN-ACTIVE", drv_cmd_scan_active, false}, {"SCAN-PASSIVE", drv_cmd_scan_passive, false}, +#ifdef WLAN_AP_STA_CONCURRENCY + {"CONCSETDWELLTIME", drv_cmd_conc_set_dwell_time, true}, +#endif {"GETDWELLTIME", drv_cmd_get_dwell_time, false}, {"SETDWELLTIME", drv_cmd_set_dwell_time, true}, {"MIRACAST", drv_cmd_miracast, true}, @@ -7276,7 +7381,12 @@ static const struct hdd_drv_cmd hdd_drv_cmds[] = { {"GETANTENNAMODE", drv_cmd_get_antenna_mode, false}, {"SET_DISABLE_CHANNEL_LIST", drv_cmd_set_disable_chan_list, true}, {"GET_DISABLE_CHANNEL_LIST", drv_cmd_get_disable_chan_list, false}, + /* Deprecated commands */ {"STOP", drv_cmd_dummy, false}, + {"RXFILTER-START", drv_cmd_dummy, false}, + {"RXFILTER-STOP", drv_cmd_dummy, false}, + {"BTCOEXSCAN-START", drv_cmd_dummy, false}, + {"BTCOEXSCAN-STOP", drv_cmd_dummy, false}, }; /** diff --git a/core/hdd/src/wlan_hdd_ioctl.h b/core/hdd/src/wlan_hdd_ioctl.h index 013754fce504..38679f3c6362 100644 --- a/core/hdd/src/wlan_hdd_ioctl.h +++ b/core/hdd/src/wlan_hdd_ioctl.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2014, 2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-2014, 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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_HDD_IOCTL_H) #define WLAN_HDD_IOCTL_H @@ -47,5 +38,15 @@ int wlan_hdd_set_mc_rate(hdd_adapter_t *pAdapter, int targetRate); * Return: QDF_STATUS */ QDF_STATUS hdd_update_smps_antenna_mode(hdd_context_t *hdd_ctx, int mode); + +/** + * hdd_set_antenna_mode() - SET ANTENNA MODE command handler + * @adapter: Pointer to network adapter + * @hdd_ctx: Pointer to hdd context + * @mode: new anteena mode + */ +int hdd_set_antenna_mode(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, int mode); + #endif /* end #if !defined(WLAN_HDD_IOCTL_H) */ diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 00022a92d97c..036692af1dfd 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,17 +16,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_ipa.c * * WLAN HDD and ipa interface implementation - * Originally written by Qualcomm Atheros, Inc */ #ifdef IPA_OFFLOAD @@ -564,8 +554,6 @@ do { \ ipa_ctxt->ipa_resource.rx2_proc_done_idx->vaddr; \ } while (0) -#define HDD_IPA_CHECK_HW() ipa_uc_reg_rdyCB(NULL) - #define IPA_RESOURCE_READY(ipa_resource, osdev) \ ((0 == qdf_mem_get_dma_addr(osdev, &ipa_resource->ce_sr->mem_info)) || \ (0 == qdf_mem_get_dma_addr(osdev, &ipa_resource->tx_comp_ring->mem_info)) || \ @@ -574,7 +562,6 @@ do { \ #else /* Do nothing */ #define HDD_IPA_WDI2_SET(pipe_in, ipa_ctxt, osdev) -#define HDD_IPA_CHECK_HW() 0 #define IPA_RESOURCE_READY(ipa_resource, osdev) \ ((0 == qdf_mem_get_dma_addr(osdev, &ipa_resource->ce_sr->mem_info)) || \ @@ -654,6 +641,28 @@ static void hdd_ipa_uc_proc_pending_event(struct hdd_ipa_priv *hdd_ipa, bool is_loading); static int hdd_ipa_uc_enable_pipes(struct hdd_ipa_priv *hdd_ipa); static int hdd_ipa_wdi_init(struct hdd_ipa_priv *hdd_ipa); +static void hdd_ipa_send_pkt_to_tl(struct hdd_ipa_iface_context *iface_context, + struct ipa_rx_data *ipa_tx_desc); + +/** + * hdd_ipa_uc_get_db_paddr() - Get Doorbell physical address + * @db_paddr: Doorbell physical address given by IPA + * @client: IPA client type + * + * Query doorbell physical address from IPA + * IPA will give physical address for TX COMP and RX READY + * + * Return: None + */ +static void hdd_ipa_uc_get_db_paddr(qdf_dma_addr_t *db_paddr, + enum ipa_client_type client) +{ + struct ipa_wdi_db_params dbpa; + + dbpa.client = client; + ipa_uc_wdi_get_dbpa(&dbpa); + *db_paddr = dbpa.uc_door_bell_pa; +} /** * hdd_ipa_uc_loaded_uc_cb() - IPA UC loaded event callback @@ -676,13 +685,14 @@ static void hdd_ipa_uc_loaded_uc_cb(void *priv_ctxt) } hdd_ipa = (struct hdd_ipa_priv *)priv_ctxt; - hdd_ipa->uc_loaded = true; uc_op_work = &hdd_ipa->uc_op_work[HDD_IPA_UC_OPCODE_UC_READY]; - if (!list_empty(&uc_op_work->work.entry)) + if (!list_empty(&uc_op_work->work.entry)) { /* uc_op_work is not initialized yet */ + hdd_ipa->uc_loaded = true; return; + } msg = (struct op_msg_type *)qdf_mem_malloc(sizeof(*msg)); if (!msg) { @@ -901,9 +911,8 @@ static void __hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt, */ wdi_sap_stats = data; - if (!adapter) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "IPA uC share stats failed - no adapter"); + if (hdd_validate_adapter(adapter)) { + hdd_err("IPA uC share stats failed - invalid adapter"); wdi_sap_stats->stats_valid = 0; return; } @@ -957,9 +966,9 @@ static void __hdd_ipa_wdi_meter_notifier_cb(enum ipa_wdi_meter_evt_type evt, */ ipa_set_quota = data; - if (!adapter) { + if (hdd_validate_adapter(adapter)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "IPA uC set quota failed - no adapter"); + "IPA uC set quota failed - invalid adapter"); ipa_set_quota->set_valid = 0; return; } @@ -1347,12 +1356,26 @@ static int hdd_ipa_wdi_dereg_intf(struct hdd_ipa_priv *hdd_ipa, static int hdd_ipa_wdi_enable_pipes(struct hdd_ipa_priv *hdd_ipa) { + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); int ret; + /* Map IPA SMMU for all Rx hash table */ + ret = ol_txrx_rx_hash_smmu_map(pdev, true); + if (ret) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "IPA SMMU map failed ret=%d", ret); + return ret; + } + ret = ipa_wdi_enable_pipes(); if (ret) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "ipa_wdi_enable_pipes failed ret=%d", ret); + "ipa_wdi_enable_pipes failed ret=%d", ret); + + if (ol_txrx_rx_hash_smmu_map(pdev, false)) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "IPA SMMU unmap failed"); + } return ret; } @@ -1361,12 +1384,21 @@ static int hdd_ipa_wdi_enable_pipes(struct hdd_ipa_priv *hdd_ipa) static int hdd_ipa_wdi_disable_pipes(struct hdd_ipa_priv *hdd_ipa) { + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); int ret; ret = ipa_wdi_disable_pipes(); if (ret) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "ipa_wdi_disable_pipes failed ret=%d", ret); + "ipa_wdi_disable_pipes failed ret=%d", ret); + return ret; + } + + /* Unmap IPA SMMU for all Rx hash table */ + ret = ol_txrx_rx_hash_smmu_map(pdev, false); + if (ret) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "IPA SMMU unmap failed"); return ret; } @@ -1385,11 +1417,15 @@ static inline int hdd_ipa_wdi_teardown_sys_pipe(struct hdd_ipa_priv *hdd_ipa, return 0; } -static inline int hdd_ipa_wdi_rm_set_perf_profile(struct hdd_ipa_priv *hdd_ipa, - enum ipa_rm_resource_name resource_name, - struct ipa_rm_perf_profile *profile) +static int hdd_ipa_wdi_rm_set_perf_profile(struct hdd_ipa_priv *hdd_ipa, + int client, uint32_t max_supported_bw_mbps) { - return 0; + struct ipa_wdi_perf_profile profile; + + profile.client = client; + profile.max_supported_bw_mbps = max_supported_bw_mbps; + + return ipa_wdi_set_perf_profile(&profile); } static inline int hdd_ipa_wdi_rm_request_resource(struct hdd_ipa_priv *hdd_ipa, @@ -1429,6 +1465,72 @@ static inline int hdd_ipa_wdi_rm_notify_completion(enum ipa_rm_event event, { return 0; } + +static inline bool hdd_ipa_is_rm_released(struct hdd_ipa_priv *hdd_ipa) +{ + return true; +} + +/** + * hdd_ipa_pm_flush() - flush queued packets + * @work: pointer to the scheduled work + * + * Called during PM resume to send packets to TL which were queued + * while host was in the process of suspending. + * + * Return: None + */ +static void hdd_ipa_pm_flush(struct work_struct *work) +{ + struct hdd_ipa_priv *hdd_ipa = container_of(work, + struct hdd_ipa_priv, + pm_work); + struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL; + qdf_nbuf_t skb; + uint32_t dequeued = 0; + + qdf_spin_lock_bh(&hdd_ipa->pm_lock); + while (((skb = qdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) + != NULL)) { + qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + + pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; + dequeued++; + if (pm_tx_cb->exception) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, + "Flush Exception"); + if (pm_tx_cb->adapter->dev) + hdd_softap_hard_start_xmit(skb, + pm_tx_cb->adapter->dev); + else + ipa_free_skb(pm_tx_cb->ipa_tx_desc); + } else { + hdd_ipa_send_pkt_to_tl(pm_tx_cb->iface_context, + pm_tx_cb->ipa_tx_desc); + } + qdf_spin_lock_bh(&hdd_ipa->pm_lock); + } + qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + + hdd_ipa->stats.num_tx_dequeued += dequeued; + if (dequeued > hdd_ipa->stats.num_max_pm_queue) + hdd_ipa->stats.num_max_pm_queue = dequeued; +} + +int hdd_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr) +{ + if (!num_buf) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "No buffers to map/unmap"); + return 0; + } + + if (map) + return ipa_wdi_create_smmu_mapping(num_buf, + (struct ipa_wdi_buffer_info *)buf_arr); + else + return ipa_wdi_release_smmu_mapping(num_buf, + (struct ipa_wdi_buffer_info *)buf_arr); +} #else /* CONFIG_IPA_WDI_UNIFIED_API */ static inline void hdd_ipa_wdi_get_wdi_version(struct hdd_ipa_priv *hdd_ipa) { @@ -1498,6 +1600,14 @@ static int hdd_ipa_wdi_conn_pipes(struct hdd_ipa_priv *hdd_ipa, qdf_device_t osdev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); int ret; + if (qdf_unlikely(NULL == osdev)) { + QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR, + "%s: osdev is NULL", __func__); + stat = QDF_STATUS_E_FAILURE; + goto fail_return; + } + + qdf_mem_zero(&hdd_ipa->cons_pipe_in, sizeof(struct ipa_wdi_in_params)); qdf_mem_zero(&hdd_ipa->prod_pipe_in, sizeof(struct ipa_wdi_in_params)); qdf_mem_zero(&pipe_in, sizeof(struct ipa_wdi_in_params)); @@ -2047,7 +2157,8 @@ static int hdd_ipa_wdi_reg_intf(struct hdd_ipa_priv *hdd_ipa, ret = hdd_ipa_register_interface(hdd_ipa, iface_context); if (ret) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "ipa register interface failed ret=%d", ret); + "IPA WDI reg intf failed ret=%d", ret); + ret = -EFAULT; return ret; } @@ -2081,8 +2192,16 @@ static int hdd_ipa_wdi_dereg_intf(struct hdd_ipa_priv *hdd_ipa, static int hdd_ipa_wdi_enable_pipes(struct hdd_ipa_priv *hdd_ipa) { + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); int result; + /* Map IPA SMMU for all Rx hash table */ + result = ol_txrx_rx_hash_smmu_map(pdev, true); + if (result) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "IPA SMMU map failed ret=%d", result); + return result; + } /* ACTIVATE TX PIPE */ HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "Enable TX PIPE(tx_pipe_handle=%d)", @@ -2092,7 +2211,7 @@ static int hdd_ipa_wdi_enable_pipes(struct hdd_ipa_priv *hdd_ipa) HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Enable TX PIPE fail, code %d", result); - return result; + goto smmu_unmap; } result = ipa_resume_wdi_pipe(hdd_ipa->tx_pipe_handle); @@ -2100,7 +2219,7 @@ static int hdd_ipa_wdi_enable_pipes(struct hdd_ipa_priv *hdd_ipa) HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Resume TX PIPE fail, code %d", result); - return result; + goto smmu_unmap; } /* ACTIVATE RX PIPE */ @@ -2112,7 +2231,7 @@ static int hdd_ipa_wdi_enable_pipes(struct hdd_ipa_priv *hdd_ipa) HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Enable RX PIPE fail, code %d", result); - return result; + goto smmu_unmap; } result = ipa_resume_wdi_pipe(hdd_ipa->rx_pipe_handle); @@ -2120,14 +2239,23 @@ static int hdd_ipa_wdi_enable_pipes(struct hdd_ipa_priv *hdd_ipa) HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Resume RX PIPE fail, code %d", result); - return result; + goto smmu_unmap; } return 0; + +smmu_unmap: + if (ol_txrx_rx_hash_smmu_map(pdev, false)) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "IPA SMMU unmap failed"); + } + + return result; } static int hdd_ipa_wdi_disable_pipes(struct hdd_ipa_priv *hdd_ipa) { + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); int result; HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "Disable RX PIPE"); @@ -2160,6 +2288,14 @@ static int hdd_ipa_wdi_disable_pipes(struct hdd_ipa_priv *hdd_ipa) return result; } + /* Unmap IPA SMMU for all Rx hash table */ + result = ol_txrx_rx_hash_smmu_map(pdev, false); + if (result) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "IPA SMMU unmap failed"); + return result; + } + return 0; } @@ -2176,10 +2312,24 @@ static int hdd_ipa_wdi_teardown_sys_pipe(struct hdd_ipa_priv *hdd_ipa, } static int hdd_ipa_wdi_rm_set_perf_profile(struct hdd_ipa_priv *hdd_ipa, - enum ipa_rm_resource_name resource_name, - struct ipa_rm_perf_profile *profile) + int client, uint32_t max_supported_bw_mbps) { - return ipa_rm_set_perf_profile(resource_name, profile); + enum ipa_rm_resource_name resource_name; + struct ipa_rm_perf_profile profile; + + if (client == IPA_CLIENT_WLAN1_PROD) { + resource_name = IPA_RM_RESOURCE_WLAN_PROD; + } else if (client == IPA_CLIENT_WLAN1_CONS) { + resource_name = IPA_RM_RESOURCE_WLAN_CONS; + } else { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "not supported client: %d", client); + return -EINVAL; + } + + profile.max_supported_bandwidth_mbps = max_supported_bw_mbps; + + return ipa_rm_set_perf_profile(resource_name, &profile); } static int hdd_ipa_wdi_rm_request_resource(struct hdd_ipa_priv *hdd_ipa, @@ -2649,6 +2799,85 @@ static int hdd_ipa_wdi_rm_notify_completion(enum ipa_rm_event event, { return ipa_rm_notify_completion(event, resource_name); } + +static bool hdd_ipa_is_rm_released(struct hdd_ipa_priv *hdd_ipa) +{ + qdf_spin_lock_bh(&hdd_ipa->rm_lock); + + if (hdd_ipa->rm_state != HDD_IPA_RM_RELEASED) { + qdf_spin_unlock_bh(&hdd_ipa->rm_lock); + return false; + } + + qdf_spin_unlock_bh(&hdd_ipa->rm_lock); + + return true; +} + +/** + * hdd_ipa_pm_flush() - flush queued packets + * @work: pointer to the scheduled work + * + * Called during PM resume to send packets to TL which were queued + * while host was in the process of suspending. + * + * Return: None + */ +static void hdd_ipa_pm_flush(struct work_struct *work) +{ + struct hdd_ipa_priv *hdd_ipa = container_of(work, + struct hdd_ipa_priv, + pm_work); + struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL; + qdf_nbuf_t skb; + uint32_t dequeued = 0; + + qdf_wake_lock_acquire(&hdd_ipa->wake_lock, + WIFI_POWER_EVENT_WAKELOCK_IPA); + qdf_spin_lock_bh(&hdd_ipa->pm_lock); + while (((skb = qdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) + != NULL)) { + qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + + pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; + dequeued++; + if (pm_tx_cb->exception) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, + "Flush Exception"); + if (pm_tx_cb->adapter->dev) + hdd_softap_hard_start_xmit(skb, + pm_tx_cb->adapter->dev); + else + ipa_free_skb(pm_tx_cb->ipa_tx_desc); + } else { + hdd_ipa_send_pkt_to_tl(pm_tx_cb->iface_context, + pm_tx_cb->ipa_tx_desc); + } + qdf_spin_lock_bh(&hdd_ipa->pm_lock); + } + qdf_spin_unlock_bh(&hdd_ipa->pm_lock); + qdf_wake_lock_release(&hdd_ipa->wake_lock, + WIFI_POWER_EVENT_WAKELOCK_IPA); + + hdd_ipa->stats.num_tx_dequeued += dequeued; + if (dequeued > hdd_ipa->stats.num_max_pm_queue) + hdd_ipa->stats.num_max_pm_queue = dequeued; +} + +int hdd_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr) +{ + if (!num_buf) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "No buffers to map/unmap"); + return 0; + } + + if (map) + return ipa_create_wdi_mapping(num_buf, + (struct ipa_wdi_buffer_info *)buf_arr); + else + return ipa_release_wdi_mapping(num_buf, + (struct ipa_wdi_buffer_info *)buf_arr); +} #endif /* CONFIG_IPA_WDI_UNIFIED_API */ /** @@ -2801,7 +3030,7 @@ static void hdd_ipa_uc_rt_debug_handler(void *ctext) if (!dummy_ptr) { hdd_ipa_uc_rt_debug_host_dump(hdd_ctx); hdd_ipa_uc_stat_request( - hdd_get_adapter(hdd_ctx, QDF_SAP_MODE), + hdd_ctx, HDD_IPA_UC_STAT_REASON_DEBUG); } else { kfree(dummy_ptr); @@ -3259,21 +3488,15 @@ void hdd_ipa_uc_stat_query(hdd_context_t *hdd_ctx, /** * __hdd_ipa_uc_stat_request() - Get IPA stats from IPA. - * @adapter: network adapter + * @hdd_ctx: Global HDD context * @reason: STAT REQ Reason * * Return: None */ -static void __hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason) +static void __hdd_ipa_uc_stat_request(hdd_context_t *hdd_ctx, uint8_t reason) { - hdd_context_t *hdd_ctx; struct hdd_ipa_priv *hdd_ipa; - if (!adapter) - return; - - hdd_ctx = (hdd_context_t *)adapter->pHddCtx; - if (wlan_hdd_validate_context(hdd_ctx)) return; @@ -3288,8 +3511,7 @@ static void __hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason) (false == hdd_ipa->resource_loading)) { hdd_ipa->stat_req_reason = reason; qdf_mutex_release(&hdd_ipa->ipa_lock); - sme_ipa_uc_stat_request(WLAN_HDD_GET_HAL_CTX(adapter), - adapter->sessionId, + sme_ipa_uc_stat_request(hdd_ctx->hHal, 0, WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID, 0, VDEV_CMD); } else { @@ -3299,15 +3521,15 @@ static void __hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason) /** * hdd_ipa_uc_stat_request() - SSR wrapper for __hdd_ipa_uc_stat_request - * @adapter: network adapter + * @hdd_ctx: Global HDD context * @reason: STAT REQ Reason * * Return: None */ -void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason) +void hdd_ipa_uc_stat_request(hdd_context_t *hdd_ctx, uint8_t reason) { cds_ssr_protect(__func__); - __hdd_ipa_uc_stat_request(adapter, reason); + __hdd_ipa_uc_stat_request(hdd_ctx, reason); cds_ssr_unprotect(__func__); } @@ -3325,7 +3547,7 @@ void hdd_ipa_uc_sharing_stats_request(hdd_adapter_t *adapter, hdd_context_t *pHddCtx; struct hdd_ipa_priv *hdd_ipa; - if (!adapter) + if (hdd_validate_adapter(adapter)) return; pHddCtx = adapter->pHddCtx; @@ -3361,7 +3583,7 @@ void hdd_ipa_uc_set_quota(hdd_adapter_t *adapter, uint8_t set_quota, hdd_context_t *pHddCtx; struct hdd_ipa_priv *hdd_ipa; - if (!adapter) + if (hdd_validate_adapter(adapter)) return; pHddCtx = adapter->pHddCtx; @@ -3457,6 +3679,11 @@ static int hdd_ipa_uc_enable_pipes(struct hdd_ipa_priv *hdd_ipa) int result = 0; HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "enter"); + if (qdf_unlikely(NULL == pdev)) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "pdev is NULL"); + result = QDF_STATUS_E_FAILURE; + goto end; + } if (!hdd_ipa->ipa_pipes_down) { /* @@ -3707,8 +3934,6 @@ static void hdd_ipa_uc_loaded_handler(struct hdd_ipa_priv *ipa_ctxt) struct ol_txrx_ipa_resources *ipa_res = &ipa_ctxt->ipa_resource; qdf_device_t osdev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); struct ol_txrx_pdev_t *pdev; - uint32_t tx_comp_db_dmaaddr = 0; - uint32_t rx_rdy_db_dmaaddr = 0; int ret; HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "UC READY"); @@ -3717,6 +3942,8 @@ static void hdd_ipa_uc_loaded_handler(struct hdd_ipa_priv *ipa_ctxt) return; } + ipa_ctxt->uc_loaded = true; + if (!osdev) { HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "invalid qdf dev context"); return; @@ -3736,24 +3963,6 @@ static void hdd_ipa_uc_loaded_handler(struct hdd_ipa_priv *ipa_ctxt) return; } - if (hdd_ipa_wdi_is_smmu_enabled(ipa_ctxt, osdev)) { - pld_smmu_map(osdev->dev, - ipa_ctxt->tx_comp_doorbell_dmaaddr, - &tx_comp_db_dmaaddr, - sizeof(uint32_t)); - ipa_ctxt->tx_comp_doorbell_dmaaddr = tx_comp_db_dmaaddr; - - pld_smmu_map(osdev->dev, - ipa_ctxt->rx_ready_doorbell_dmaaddr, - &rx_rdy_db_dmaaddr, - sizeof(uint32_t)); - ipa_ctxt->rx_ready_doorbell_dmaaddr = rx_rdy_db_dmaaddr; - } - - ol_txrx_ipa_uc_set_doorbell_paddr(pdev, - ipa_ctxt->tx_comp_doorbell_dmaaddr, - ipa_ctxt->rx_ready_doorbell_dmaaddr); - /* If already any STA connected, enable IPA/FW PIPEs */ if (ipa_ctxt->sap_num_connected_sta) { HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, @@ -3812,50 +4021,26 @@ static void hdd_ipa_print_resource_info(struct hdd_ipa_priv *hdd_ipa) QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, "\n==== IPA RESOURCE INFO ====\n" - "CE RING BASE: %pad\n" "CE RING SIZE: %d\n" - "CE REG ADDR: %pad\n" - "TX COMP RING BASE: %pad\n" "TX COMP RING SIZE: %d\n" "TX NUM ALLOC BUF: %d\n" - "RX IND RING BASE: %pad\n" "RX IND RING SIZE: %d\n" - "RX PROC DONE IND ADDR: %pad\n" #if defined(QCA_WIFI_3_0) && defined(CONFIG_IPA3) - "RX2 IND RING BASE: %pad\n" "RX2 IND RING SIZE: %d\n" - "RX2 PROC DONE IND ADDR: %pad\n" #endif "PROD CLIENT: %d\n" "TX PIPE HDL: 0x%x\n" - "RX PIPE HDL: 0x%x\n" - "TX COMP RING DBELL: %pad\n" - "RX IND RING DBELL: %pad\n", - qdf_mem_get_dma_addr_ptr(osdev, - &res->ce_sr->mem_info), + "RX PIPE HDL: 0x%x\n", (int)res->ce_sr->mem_info.size, - &res->ce_reg_paddr, - qdf_mem_get_dma_addr_ptr(osdev, - &res->tx_comp_ring->mem_info), (int)res->tx_comp_ring->mem_info.size, res->tx_num_alloc_buffer, - qdf_mem_get_dma_addr_ptr(osdev, - &res->rx_rdy_ring->mem_info), (int)res->rx_rdy_ring->mem_info.size, - qdf_mem_get_dma_addr_ptr(osdev, - &res->rx_proc_done_idx->mem_info), #if defined(QCA_WIFI_3_0) && defined(CONFIG_IPA3) - qdf_mem_get_dma_addr_ptr(osdev, - &res->rx2_rdy_ring->mem_info), (int)res->rx2_rdy_ring->mem_info.size, - qdf_mem_get_dma_addr_ptr(osdev, - &res->rx2_proc_done_idx->mem_info), #endif hdd_ipa->prod_client, hdd_ipa->tx_pipe_handle, - hdd_ipa->rx_pipe_handle, - &hdd_ipa->tx_comp_doorbell_dmaaddr, - &hdd_ipa->rx_ready_doorbell_dmaaddr); + hdd_ipa->rx_pipe_handle); } /** @@ -4027,17 +4212,13 @@ static void hdd_ipa_print_fw_wdi_stats(struct hdd_ipa_priv *hdd_ipa, { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, "\n==== WLAN FW WDI TX STATS ====\n" - "COMP RING BASE: 0x%x\n" "COMP RING SIZE: %d\n" - "COMP RING DBELL : 0x%x\n" "COMP RING DBELL IND VAL : %d\n" "COMP RING DBELL CACHED VAL : %d\n" "PKTS ENQ : %d\n" "PKTS COMP : %d\n" "IS SUSPEND : %d\n", - uc_fw_stat->tx_comp_ring_base, uc_fw_stat->tx_comp_ring_size, - uc_fw_stat->tx_comp_ring_dbell_addr, uc_fw_stat->tx_comp_ring_dbell_ind_val, uc_fw_stat->tx_comp_ring_dbell_cached_val, uc_fw_stat->tx_pkts_enqueued, @@ -4046,12 +4227,9 @@ static void hdd_ipa_print_fw_wdi_stats(struct hdd_ipa_priv *hdd_ipa, QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_INFO, "\n==== WLAN FW WDI RX STATS ====\n" - "IND RING BASE: 0x%x\n" "IND RING SIZE: %d\n" - "IND RING DBELL : 0x%x\n" "IND RING DBELL IND VAL : %d\n" "IND RING DBELL CACHED VAL : %d\n" - "RDY IND ADDR : 0x%x\n" "RDY IND CACHE VAL : %d\n" "RFIL IND : %d\n" "NUM PKT INDICAT : %d\n" @@ -4059,12 +4237,9 @@ static void hdd_ipa_print_fw_wdi_stats(struct hdd_ipa_priv *hdd_ipa, "NUM DROP NO SPC : %d\n" "NUM DROP NO BUF : %d\n" "IS SUSPND : %d\n", - uc_fw_stat->rx_ind_ring_base, uc_fw_stat->rx_ind_ring_size, - uc_fw_stat->rx_ind_ring_dbell_addr, uc_fw_stat->rx_ind_ring_dbell_ind_val, uc_fw_stat->rx_ind_ring_dbell_ind_cached_val, - uc_fw_stat->rx_ind_ring_rdidx_addr, uc_fw_stat->rx_ind_ring_rd_idx_cached_val, uc_fw_stat->rx_refill_idx, uc_fw_stat->rx_num_pkts_indicated, @@ -4207,7 +4382,7 @@ void hdd_ipa_uc_stat(hdd_adapter_t *adapter) /* IPA WDI stats */ hdd_ipa_print_ipa_wdi_stats(hdd_ipa); /* WLAN FW WDI stats */ - hdd_ipa_uc_stat_request(adapter, HDD_IPA_UC_STAT_REASON_DEBUG); + hdd_ipa_uc_stat_request(hdd_ctx, HDD_IPA_UC_STAT_REASON_DEBUG); } /** @@ -4227,13 +4402,14 @@ static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); QDF_STATUS status = QDF_STATUS_SUCCESS; - if (!pdev) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "pdev is NULL"); + if (!op_msg) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "INVALID ARG"); return; } - if (!op_msg || !usr_ctxt) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "INVALID ARG"); + if (!pdev) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_FATAL, "pdev is NULL"); + qdf_mem_free(op_msg); return; } @@ -4364,7 +4540,7 @@ static void hdd_ipa_uc_offload_enable_disable(hdd_adapter_t *adapter, struct hdd_ipa_iface_context *iface_context = NULL; uint8_t session_id; - if (!adapter || !hdd_ipa) + if (hdd_validate_adapter(adapter) || !hdd_ipa) return; iface_context = adapter->ipa_context; @@ -4571,26 +4747,31 @@ QDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx) stat = QDF_STATUS_E_FAILURE; goto fail_return; } + } else { + hdd_ipa_uc_get_db_paddr(&ipa_ctxt->tx_comp_doorbell_dmaaddr, + IPA_CLIENT_WLAN1_CONS); + hdd_ipa_uc_get_db_paddr(&ipa_ctxt->rx_ready_doorbell_dmaaddr, + IPA_CLIENT_WLAN1_PROD); + } - if (hdd_ipa_wdi_is_smmu_enabled(ipa_ctxt, osdev)) { - pld_smmu_map(osdev->dev, - ipa_ctxt->tx_comp_doorbell_dmaaddr, - &tx_comp_db_dmaaddr, - sizeof(uint32_t)); - ipa_ctxt->tx_comp_doorbell_dmaaddr = tx_comp_db_dmaaddr; - - pld_smmu_map(osdev->dev, - ipa_ctxt->rx_ready_doorbell_dmaaddr, - &rx_rdy_db_dmaaddr, - sizeof(uint32_t)); - ipa_ctxt->rx_ready_doorbell_dmaaddr = rx_rdy_db_dmaaddr; - } - - ol_txrx_ipa_uc_set_doorbell_paddr(pdev, + if (hdd_ipa_wdi_is_smmu_enabled(ipa_ctxt, osdev)) { + pld_smmu_map(osdev->dev, ipa_ctxt->tx_comp_doorbell_dmaaddr, - ipa_ctxt->rx_ready_doorbell_dmaaddr); + &tx_comp_db_dmaaddr, + sizeof(uint32_t)); + ipa_ctxt->tx_comp_doorbell_dmaaddr = tx_comp_db_dmaaddr; + + pld_smmu_map(osdev->dev, + ipa_ctxt->rx_ready_doorbell_dmaaddr, + &rx_rdy_db_dmaaddr, + sizeof(uint32_t)); + ipa_ctxt->rx_ready_doorbell_dmaaddr = rx_rdy_db_dmaaddr; } + ol_txrx_ipa_uc_set_doorbell_paddr(pdev, + ipa_ctxt->tx_comp_doorbell_dmaaddr, + ipa_ctxt->rx_ready_doorbell_dmaaddr); + for (i = 0; i < HDD_IPA_UC_OPCODE_MAX; i++) { hdd_ipa_init_uc_op_work(&ipa_ctxt->uc_op_work[i].work, hdd_ipa_uc_fw_op_event_handler); @@ -5135,7 +5316,6 @@ static int __hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets, { uint32_t next_cons_bw, next_prod_bw; struct hdd_ipa_priv *hdd_ipa; - struct ipa_rm_perf_profile profile; int ret; if (wlan_hdd_validate_context(hdd_ctx)) @@ -5147,8 +5327,6 @@ static int __hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets, (!hdd_ipa_is_clk_scaling_enabled(hdd_ctx))) return 0; - memset(&profile, 0, sizeof(profile)); - if (tx_packets > (hdd_ctx->config->busBandwidthHighThreshold / 2)) next_cons_bw = hdd_ctx->config->IpaHighBandwidthMbps; else if (tx_packets > @@ -5175,9 +5353,8 @@ static int __hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets, if (hdd_ipa->curr_cons_bw != next_cons_bw) { hdd_debug("Requesting CONS perf curr: %d, next: %d", hdd_ipa->curr_cons_bw, next_cons_bw); - profile.max_supported_bandwidth_mbps = next_cons_bw; ret = hdd_ipa_wdi_rm_set_perf_profile(hdd_ipa, - IPA_RM_RESOURCE_WLAN_CONS, &profile); + IPA_CLIENT_WLAN1_CONS, next_cons_bw); if (ret) { hdd_err("RM CONS set perf profile failed: %d", ret); @@ -5190,9 +5367,8 @@ static int __hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets, if (hdd_ipa->curr_prod_bw != next_prod_bw) { hdd_debug("Requesting PROD perf curr: %d, next: %d", hdd_ipa->curr_prod_bw, next_prod_bw); - profile.max_supported_bandwidth_mbps = next_prod_bw; ret = hdd_ipa_wdi_rm_set_perf_profile(hdd_ipa, - IPA_RM_RESOURCE_WLAN_PROD, &profile); + IPA_CLIENT_WLAN1_PROD, next_prod_bw); if (ret) { hdd_err("RM PROD set perf profile failed: %d", ret); return ret; @@ -5311,7 +5487,7 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, unsigned int cpu_index; uint32_t enabled; - if (!adapter || adapter->magic != WLAN_HDD_ADAPTER_MAGIC) { + if (hdd_validate_adapter(adapter)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "Invalid adapter: 0x%pK", adapter); hdd_ipa->ipa_rx_internal_drop_count++; @@ -5341,8 +5517,15 @@ static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb, cpu_index = wlan_hdd_get_cpu(); ++adapter->hdd_stats.hddTxRxStats.rxPackets[cpu_index]; - ++adapter->stats.rx_packets; - adapter->stats.rx_bytes += skb->len; + + /* + * Update STA RX exception packet stats. + * For SAP as part of IPA HW stats are updated. + */ + if (adapter->device_mode == QDF_STA_MODE) { + ++adapter->stats.rx_packets; + adapter->stats.rx_bytes += skb->len; + } result = hdd_ipa_aggregated_rx_ind(skb); if (result == NET_RX_SUCCESS) @@ -5529,9 +5712,9 @@ static void __hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt, iface_context = &hdd_ipa->iface_context[iface_id]; adapter = iface_context->adapter; - if (!adapter) { + if (hdd_validate_adapter(adapter)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, - "IPA_RECEIVE: Adapter is NULL"); + "IPA_RECEIVE: Invalid adapter"); hdd_ipa->ipa_rx_internal_drop_count++; kfree_skb(skb); return; @@ -5658,7 +5841,7 @@ static void hdd_ipa_send_pkt_to_tl( qdf_spin_lock_bh(&iface_context->interface_lock); adapter = iface_context->adapter; - if (!adapter) { + if (hdd_validate_adapter(adapter)) { HDD_IPA_LOG(QDF_TRACE_LEVEL_WARN, "Interface Down"); ipa_free_skb(ipa_tx_desc); iface_context->stats.num_tx_drop++; @@ -5748,64 +5931,17 @@ static void hdd_ipa_send_pkt_to_tl( */ bool hdd_ipa_is_present(void) { - /* Check if ipa hw is enabled */ - if (HDD_IPA_CHECK_HW() != -EPERM) + /* + * Check if ipa hw is enabled + * TODO: Add support for WDI unified API + */ + if (ipa_uc_reg_rdyCB(NULL) != -EPERM) return true; else return false; } /** - * hdd_ipa_pm_flush() - flush queued packets - * @work: pointer to the scheduled work - * - * Called during PM resume to send packets to TL which were queued - * while host was in the process of suspending. - * - * Return: None - */ -static void hdd_ipa_pm_flush(struct work_struct *work) -{ - struct hdd_ipa_priv *hdd_ipa = container_of(work, - struct hdd_ipa_priv, - pm_work); - struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL; - qdf_nbuf_t skb; - uint32_t dequeued = 0; - - qdf_wake_lock_acquire(&hdd_ipa->wake_lock, - WIFI_POWER_EVENT_WAKELOCK_IPA); - qdf_spin_lock_bh(&hdd_ipa->pm_lock); - while (((skb = qdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) - != NULL)) { - qdf_spin_unlock_bh(&hdd_ipa->pm_lock); - - pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; - dequeued++; - if (pm_tx_cb->exception) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, - "Flush Exception"); - if (pm_tx_cb->adapter->dev) - hdd_softap_hard_start_xmit(skb, - pm_tx_cb->adapter->dev); - else - ipa_free_skb(pm_tx_cb->ipa_tx_desc); - } else { - hdd_ipa_send_pkt_to_tl(pm_tx_cb->iface_context, - pm_tx_cb->ipa_tx_desc); - } - qdf_spin_lock_bh(&hdd_ipa->pm_lock); - } - qdf_spin_unlock_bh(&hdd_ipa->pm_lock); - qdf_wake_lock_release(&hdd_ipa->wake_lock, - WIFI_POWER_EVENT_WAKELOCK_IPA); - - hdd_ipa->stats.num_tx_dequeued += dequeued; - if (dequeued > hdd_ipa->stats.num_max_pm_queue) - hdd_ipa->stats.num_max_pm_queue = dequeued; -} - -/** * __hdd_ipa_i2w_cb() - IPA to WLAN callback * @priv: pointer to private data registered with IPA (we register a * pointer to the interface-specific IPA context) @@ -5935,13 +6071,8 @@ static int __hdd_ipa_suspend(hdd_context_t *hdd_ctx) if (atomic_read(&hdd_ipa->tx_ref_cnt)) return -EAGAIN; - qdf_spin_lock_bh(&hdd_ipa->rm_lock); - - if (hdd_ipa->rm_state != HDD_IPA_RM_RELEASED) { - qdf_spin_unlock_bh(&hdd_ipa->rm_lock); + if (!hdd_ipa_is_rm_released(hdd_ipa)) return -EAGAIN; - } - qdf_spin_unlock_bh(&hdd_ipa->rm_lock); qdf_spin_lock_bh(&hdd_ipa->pm_lock); hdd_ipa->suspended = true; @@ -6235,15 +6366,11 @@ static void hdd_ipa_cleanup_iface(struct hdd_ipa_iface_context *iface_context) { HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "enter"); - if (iface_context == NULL || iface_context->adapter == NULL) - return; - if (iface_context->adapter->magic != WLAN_HDD_ADAPTER_MAGIC) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, - "bad adapter(%pK).magic(%d)!", - iface_context->adapter, - iface_context->adapter->magic); + if (iface_context == NULL) return; - } + if (hdd_validate_adapter(iface_context->adapter)) + HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "Invalid adapter: 0x%pK", + iface_context->adapter); hdd_ipa_wdi_dereg_intf(iface_context->hdd_ipa, iface_context->adapter->dev->name); @@ -6302,6 +6429,15 @@ static int hdd_ipa_setup_iface(struct hdd_ipa_priv *hdd_ipa, if (QDF_SAP_MODE == adapter->device_mode && adapter->ipa_context) return 0; + if (HDD_IPA_MAX_IFACE == hdd_ipa->num_iface) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, + "Max interface reached %d, Invalid", + HDD_IPA_MAX_IFACE); + ret = -EINVAL; + QDF_ASSERT(0); + goto end; + } + for (i = 0; i < HDD_IPA_MAX_IFACE; i++) { if (hdd_ipa->iface_context[i].adapter == NULL) { iface_context = &(hdd_ipa->iface_context[i]); @@ -6313,6 +6449,7 @@ static int hdd_ipa_setup_iface(struct hdd_ipa_priv *hdd_ipa, HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "All the IPA interfaces are in use"); ret = -ENOMEM; + QDF_ASSERT(0); goto end; } @@ -6538,6 +6675,12 @@ static int __hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id, struct ipa_wlan_msg_ex *msg_ex = NULL; int ret; + if (hdd_validate_adapter(adapter)) { + HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "Invalid adapter: 0x%pK", + adapter); + return -EINVAL; + } + HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: EVT: %s, MAC: %pM sta_id: %d", adapter->dev->name, hdd_ipa_wlan_event_to_str(type), mac_addr, sta_id); @@ -6622,6 +6765,11 @@ static int __hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id, qdf_mutex_release(&hdd_ipa->ipa_lock); + /* Cleanup interface */ + if (type == WLAN_STA_DISCONNECT || + type == WLAN_AP_DISCONNECT) + hdd_ipa_cleanup_iface(adapter->ipa_context); + return 0; } HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, @@ -7076,7 +7224,6 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx) int ret, i; struct hdd_ipa_iface_context *iface_context = NULL; struct ol_txrx_pdev_t *pdev = NULL; - struct ipa_rm_perf_profile profile; HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "enter"); @@ -7168,19 +7315,18 @@ static QDF_STATUS __hdd_ipa_init(hdd_context_t *hdd_ctx) /* When IPA clock scaling is disabled, initialze maximum clock */ if (!hdd_ipa_is_clk_scaling_enabled(hdd_ctx)) { - profile.max_supported_bandwidth_mbps = HDD_IPA_MAX_BANDWIDTH; hdd_debug("IPA clock scaling is disabled."); hdd_debug("Set initial CONS/PROD perf: %d", - profile.max_supported_bandwidth_mbps); + HDD_IPA_MAX_BANDWIDTH); ret = hdd_ipa_wdi_rm_set_perf_profile(hdd_ipa, - IPA_RM_RESOURCE_WLAN_CONS, &profile); + IPA_CLIENT_WLAN1_CONS, HDD_IPA_MAX_BANDWIDTH); if (ret) { hdd_err("RM CONS set perf profile failed: %d", ret); goto fail_create_sys_pipe; } ret = hdd_ipa_wdi_rm_set_perf_profile(hdd_ipa, - IPA_RM_RESOURCE_WLAN_PROD, &profile); + IPA_CLIENT_WLAN1_PROD, HDD_IPA_MAX_BANDWIDTH); if (ret) { hdd_err("RM PROD set perf profile failed: %d", ret); goto fail_create_sys_pipe; @@ -7346,21 +7492,6 @@ QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx) return ret; } -int hdd_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr) -{ - if (!num_buf) { - HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "No buffers to map/unmap"); - return 0; - } - - if (map) - return ipa_create_wdi_mapping(num_buf, - (struct ipa_wdi_buffer_info *)buf_arr); - else - return ipa_release_wdi_mapping(num_buf, - (struct ipa_wdi_buffer_info *)buf_arr); -} - void hdd_ipa_clean_adapter_iface(hdd_adapter_t *adapter) { struct hdd_ipa_iface_context *iface_ctx = adapter->ipa_context; diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 3ca4f5af27bc..64b7b6bcb7e0 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_lpass.c * diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index d4ac4d14245b..7387f229cdb2 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_HDD_LPASS_H) #define WLAN_HDD_LPASS_H diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index 0f095ec34263..fca8b5f86697 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -18,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_lro.c * diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7a5bd1ac3677..0a48b2b56d55 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_main.c * @@ -73,6 +64,7 @@ #include <linux/semaphore.h> #include <linux/ctype.h> #include <linux/compat.h> +#include <linux/reboot.h> #ifdef MSM_PLATFORM #include <soc/qcom/subsystem_restart.h> #endif @@ -146,6 +138,7 @@ #define PANIC_ON_BUG_STR "" #endif +bool g_is_system_reboot_triggered; int wlan_start_ret_val; static DECLARE_COMPLETION(wlan_start_comp); static unsigned int dev_num = 1; @@ -234,8 +227,8 @@ int limit_off_chan_tbl[HDD_MAX_AC][HDD_MAX_OFF_CHAN_ENTRIES] = { { HDD_AC_VO_BIT, HDD_MAX_OFF_CHAN_TIME_FOR_VO }, }; -/* internal function declaration */ struct notifier_block hdd_netdev_notifier; +struct notifier_block system_reboot_notifier; struct sock *cesium_nl_srv_sock; #ifdef FEATURE_WLAN_AUTO_SHUTDOWN @@ -418,6 +411,12 @@ static bool hdd_wait_for_recovery_completion(void) while (cds_is_driver_recovering()) { if (retry == HDD_MOD_EXIT_SSR_MAX_RETRIES/2) hdd_err("Recovery in progress; wait here!!!"); + + if (g_is_system_reboot_triggered) { + hdd_info("System Reboot happening ignore unload!!"); + return false; + } + msleep(1000); if (retry++ == HDD_MOD_EXIT_SSR_MAX_RETRIES) { hdd_err("SSR never completed, error"); @@ -436,6 +435,7 @@ static bool hdd_wait_for_recovery_completion(void) return true; } + static int __hdd_netdev_notifier_call(struct notifier_block *nb, unsigned long state, void *data) { @@ -563,6 +563,27 @@ struct notifier_block hdd_netdev_notifier = { .notifier_call = hdd_netdev_notifier_call, }; +static int system_reboot_notifier_call(struct notifier_block *nb, + unsigned long msg_type, void *_unused) +{ + switch (msg_type) { + case SYS_DOWN: + case SYS_HALT: + case SYS_POWER_OFF: + g_is_system_reboot_triggered = true; + hdd_info("reboot, reason: %ld", msg_type); + break; + default: + break; + } + + return NOTIFY_OK; +} + +struct notifier_block system_reboot_notifier = { + .notifier_call = system_reboot_notifier_call, +}; + /* variable to hold the insmod parameters */ static int con_mode; @@ -1209,7 +1230,8 @@ static void hdd_update_tgt_ht_cap(hdd_context_t *hdd_ctx, if (sme_cfg_get_str(hdd_ctx->hHal, WNI_CFG_SUPPORTED_MCS_SET, mcs_set, &value) == QDF_STATUS_SUCCESS) { hdd_debug("Read MCS rate set"); - + if (cfg->num_rf_chains > SIZE_OF_SUPPORTED_MCS_SET) + cfg->num_rf_chains = SIZE_OF_SUPPORTED_MCS_SET; if (pconfig->enable2x2) { for (value = 0; value < cfg->num_rf_chains; value++) mcs_set[value] = @@ -1239,6 +1261,7 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, uint32_t temp = 0; uint32_t ch_width = eHT_CHANNEL_WIDTH_80MHZ; uint32_t hw_rx_ldpc_enabled; + struct wma_caps_per_phy caps_per_phy; if (!band_5g) { hdd_debug("5GHz band disabled, skipping capability population"); @@ -1542,8 +1565,22 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, if (cfg->vht_short_gi_160 & WMI_VHT_CAP_SGI_160MHZ) band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_160; - if (cfg->vht_rx_ldpc & WMI_VHT_CAP_RX_LDPC) + if (cfg->vht_rx_ldpc & WMI_VHT_CAP_RX_LDPC) { band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXLDPC; + hdd_debug("VHT RxLDPC capability is set"); + } else { + /* + * Get the RX LDPC capability for the NON DBS + * hardware mode for 5G band + */ + status = wma_get_caps_for_phyidx_hwmode(&caps_per_phy, + HW_MODE_DBS_NONE, CDS_BAND_5GHZ); + if ((QDF_IS_STATUS_SUCCESS(status)) && + (caps_per_phy.vht_5g & WMI_VHT_CAP_RX_LDPC)) { + band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXLDPC; + hdd_debug("VHT RX LDPC capability is set"); + } + } if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ) band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_80; @@ -1689,6 +1726,10 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_ctx->target_fw_version = cfg->target_fw_version; hdd_ctx->target_fw_vers_ext = cfg->target_fw_vers_ext; + hdd_ctx->hw_bd_id = cfg->hw_bd_id; + qdf_mem_copy(&hdd_ctx->hw_bd_info, &cfg->hw_bd_info, + sizeof(cfg->hw_bd_info)); + hdd_ctx->max_intf_count = cfg->max_intf_count; hdd_lpass_target_config(hdd_ctx, cfg); @@ -1716,7 +1757,7 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_debug("Init current antenna mode: %d", hdd_ctx->current_antenna_mode); - hdd_ctx->apf_enabled = (cfg->apf_enabled && + hdd_ctx->apf_supported = (cfg->apf_enabled && hdd_ctx->config->apf_packet_filter_enable); hdd_ctx->rcpi_enabled = cfg->rcpi_enabled; hdd_update_ra_rate_limit(hdd_ctx, cfg); @@ -1742,11 +1783,12 @@ void hdd_update_tgt_cfg(void *context, void *param) */ hdd_update_wiphy_vhtcap(hdd_ctx); /* - * If APF is enabled, maxWowFilters set to WMA_STA_WOW_DEFAULT_PTRN_MAX - * because we need atleast WMA_STA_WOW_DEFAULT_PTRN_MAX free slots to - * configure the STA mode wow pattern. + * If APF is supported, maxWowFilters set to + * WMA_STA_WOW_DEFAULT_PTRN_MAX because we need atleast + * WMA_STA_WOW_DEFAULT_PTRN_MAX free slots to configure the STA mode + * wow pattern. */ - if (hdd_ctx->apf_enabled) + if (hdd_ctx->apf_supported) hdd_ctx->config->maxWoWFilters = WMA_STA_WOW_DEFAULT_PTRN_MAX; hdd_ctx->wmi_max_len = cfg->wmi_max_len; @@ -2027,18 +2069,13 @@ static void hdd_disable_power_management(void) hif_disable_power_management(hif_ctx); } -/** - * hdd_update_hw_sw_info() - API to update the HW/SW information - * - * API to update the HW and SW information in the driver - * - * Return: None - */ -static void hdd_update_hw_sw_info(hdd_context_t *hdd_ctx) +void hdd_update_hw_sw_info(hdd_context_t *hdd_ctx) { void *hif_sc; size_t target_hw_name_len; const char *target_hw_name; + uint8_t *buf; + uint32_t buf_len; hif_sc = cds_get_context(QDF_MODULE_ID_HIF); @@ -2047,10 +2084,6 @@ static void hdd_update_hw_sw_info(hdd_context_t *hdd_ctx) return; } - /* - * target hw version/revision would only be retrieved after firmware - * download - */ hif_get_hw_info(hif_sc, &hdd_ctx->target_hw_version, &hdd_ctx->target_hw_revision, &target_hw_name); @@ -2066,8 +2099,12 @@ static void hdd_update_hw_sw_info(hdd_context_t *hdd_ctx) qdf_mem_copy(hdd_ctx->target_hw_name, target_hw_name, target_hw_name_len); - /* Get the wlan hw/fw version */ - hdd_wlan_get_version(hdd_ctx, NULL, NULL); + buf = qdf_mem_malloc(WE_MAX_STR_LEN); + if (buf) { + buf_len = hdd_wlan_get_version(hdd_ctx, WE_MAX_STR_LEN, buf); + hdd_info("%s", buf); + qdf_mem_free(buf); + } } /** @@ -2092,6 +2129,42 @@ static void hdd_check_for_leaks(void) qdf_mem_check_for_leaks(); } +uint32_t hdd_wlan_get_version(hdd_context_t *hdd_ctx, + const size_t version_len, uint8_t *version) +{ + uint32_t size; + uint32_t msp_id = 0, mspid = 0, siid = 0, crmid = 0, sub_id = 0; + + if (!hdd_ctx) { + hdd_err("Invalid context, HDD context is null"); + return 0; + } + + if (!version || version_len == 0) { + hdd_err("Invalid buffer pointr or buffer len\n"); + return 0; + } + + msp_id = (hdd_ctx->target_fw_version & 0xf0000000) >> 28; + mspid = (hdd_ctx->target_fw_version & 0xf000000) >> 24; + siid = (hdd_ctx->target_fw_version & 0xf00000) >> 20; + crmid = hdd_ctx->target_fw_version & 0x7fff; + sub_id = (hdd_ctx->target_fw_vers_ext & 0xf0000000) >> 28; + + size = scnprintf(version, version_len, + "Host SW:%s, FW:%d.%d.%d.%d.%d, HW:%s, Board ver: %x Ref design id: %x, Customer id: %x, Project id: %x, Board Data Rev: %x", + QWLAN_VERSIONSTR, + msp_id, mspid, siid, crmid, sub_id, + hdd_ctx->target_hw_name, + hdd_ctx->hw_bd_info.bdf_version, + hdd_ctx->hw_bd_info.ref_design_id, + hdd_ctx->hw_bd_info.customer_id, + hdd_ctx->hw_bd_info.project_id, + hdd_ctx->hw_bd_info.board_data_rev); + + return size; +} + /** * hdd_wlan_start_modules() - Single driver state machine for starting modules * @hdd_ctx: HDD context @@ -2207,11 +2280,17 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, goto close; } + ret = hdd_register_cb(hdd_ctx); + if (ret) { + hdd_err("Failed to register HDD callbacks!"); + goto close; + } + status = cds_pre_enable(hdd_ctx->pcds_context); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to pre-enable CDS: %d", status); ret = (status == QDF_STATUS_E_NOMEM) ? -ENOMEM : -EINVAL; - goto close; + goto deregister_cb; } hdd_sysfs_create_version_interface(); @@ -2275,6 +2354,9 @@ post_disable: sme_destroy_config(hdd_ctx->hHal); cds_post_disable(); +deregister_cb: + hdd_deregister_cb(hdd_ctx); + close: hdd_ctx->driver_status = DRIVER_MODULES_CLOSED; cds_close(p_cds_context); @@ -2676,6 +2758,12 @@ static int __hdd_set_mac_address(struct net_device *dev, void *addr) qdf_mem_copy(&mac_addr, psta_mac_addr->sa_data, QDF_MAC_ADDR_SIZE); + if (hdd_get_adapter_by_macaddr(hdd_ctx, mac_addr.bytes)) { + hdd_err("adapter exist with same mac address " MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(mac_addr.bytes)); + return -EINVAL; + } + if (qdf_is_macaddr_zero(&mac_addr)) { hdd_err("MAC is all zero"); return -EINVAL; @@ -2690,6 +2778,8 @@ static int __hdd_set_mac_address(struct net_device *dev, void *addr) hdd_err("MAC is Multicast"); return -EINVAL; } + hdd_info("Changing MAC to " MAC_ADDRESS_STR " of the interface %s ", + MAC_ADDR_ARRAY(mac_addr.bytes), dev->name); memcpy(&adapter->macAddressCurrent, psta_mac_addr->sa_data, ETH_ALEN); memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN); @@ -3642,6 +3732,7 @@ static void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, wlan_hdd_debugfs_csr_deinit(adapter); qdf_mutex_destroy(&adapter->arp_offload_info_lock); hdd_ns_offload_info_lock_destroy(adapter); + hdd_apf_context_destroy(adapter); hdd_debugfs_exit(adapter); @@ -3962,6 +4053,16 @@ int hdd_set_fw_params(hdd_adapter_t *adapter) goto error; } + ret = sme_cli_set_command( + adapter->sessionId, + WMI_PDEV_PARAM_SECONDARY_RETRY_ENABLE, + hdd_ctx->config->enable_secondary_rate, + PDEV_CMD); + if (ret) { + hdd_err("Failed to set WMI_PDEV_PARAM_SECONDARY_RETRY_ENABLE"); + goto error; + } + if (adapter->device_mode == QDF_STA_MODE) { sme_set_smps_cfg(adapter->sessionId, HDD_STA_SMPS_PARAM_UPPER_BRSSI_THRESH, @@ -4320,6 +4421,7 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type, qdf_mutex_create(&adapter->arp_offload_info_lock); hdd_ns_offload_info_lock_create(adapter); + hdd_apf_context_init(adapter); if (adapter->device_mode == QDF_STA_MODE) wlan_hdd_debugfs_csr_init(adapter); @@ -4510,7 +4612,6 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, hdd_ndp_session_end_handler(adapter); sme_print_commands(hdd_ctx->hHal); clear_bit(SME_SESSION_OPENED, &adapter->event_flags); - return; } adapter->sessionId = HDD_SESSION_ID_INVALID; } @@ -4883,21 +4984,22 @@ QDF_STATUS hdd_reset_all_adapters(hdd_context_t *hdd_ctx) adapter = adapterNode->pAdapter; if ((adapter->device_mode == QDF_STA_MODE) || - (adapter->device_mode == QDF_P2P_CLIENT_MODE)) + (adapter->device_mode == QDF_P2P_CLIENT_MODE)) { /* Stop tdls timers */ hdd_tdls_timers_stop(adapter); + adapter->sessionCtx.station.hdd_ReassocScenario = false; + } hdd_info("Disabling queues"); + hdd_cleanup_actionframe(hdd_ctx, adapter); if (hdd_ctx->config->sap_internal_restart && adapter->device_mode == QDF_SAP_MODE) { wlan_hdd_netif_queue_control(adapter, WLAN_STOP_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH); if (test_bit(SOFTAP_BSS_STARTED, - &adapter->event_flags)) { + &adapter->event_flags)) hdd_sap_indicate_disconnect_for_sta(adapter); - hdd_cleanup_actionframe(hdd_ctx, adapter); - } if (test_bit(DEVICE_IFACE_OPENED, &adapter->event_flags)) hdd_sap_destroy_events(adapter); @@ -4907,7 +5009,6 @@ QDF_STATUS hdd_reset_all_adapters(hdd_context_t *hdd_ctx) WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); } - adapter->sessionCtx.station.hdd_ReassocScenario = false; /* Cleanup pending roc request */ wlan_hdd_cleanup_remain_on_channel_ctx(adapter); @@ -6277,8 +6378,6 @@ static int hdd_context_deinit(hdd_context_t *hdd_ctx) qdf_list_destroy(&hdd_ctx->hddAdapters); - hdd_apf_context_destroy(); - return 0; } @@ -6401,6 +6500,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) hdd_deinit_all_adapters(hdd_ctx, false); } + unregister_reboot_notifier(&system_reboot_notifier); unregister_netdevice_notifier(&hdd_netdev_notifier); /* Free up RoC request queue and flush workqueue */ @@ -7140,8 +7240,11 @@ static void hdd_bus_bw_work_handler(struct work_struct *work) tx_packets += (uint64_t)ipa_tx_packets; rx_packets += (uint64_t)ipa_rx_packets; + adapter->stats.tx_packets += ipa_tx_packets; + adapter->stats.rx_packets += ipa_rx_packets; + hdd_ipa_set_perf_level(hdd_ctx, tx_packets, rx_packets); - hdd_ipa_uc_stat_request(adapter, 2); + hdd_ipa_uc_stat_request(hdd_ctx, 2); } hdd_pld_request_bus_bandwidth(hdd_ctx, tx_packets, rx_packets); @@ -7179,10 +7282,10 @@ static void __hdd_bus_bw_cbk(void *arg) * * Return: None. */ -static void hdd_bus_bw_cbk(void *arg) +static void hdd_bus_bw_cbk(unsigned long arg) { cds_ssr_protect(__func__); - __hdd_bus_bw_cbk(arg); + __hdd_bus_bw_cbk((void *)arg); cds_ssr_unprotect(__func__); } @@ -8433,8 +8536,6 @@ static int hdd_context_init(hdd_context_t *hdd_ctx) init_completion(&hdd_ctx->mc_sus_event_var); init_completion(&hdd_ctx->ready_to_suspend); - hdd_apf_context_init(); - qdf_spinlock_create(&hdd_ctx->connection_status_lock); qdf_spinlock_create(&hdd_ctx->sta_update_info_lock); qdf_spinlock_create(&hdd_ctx->hdd_adapter_lock); @@ -9427,7 +9528,7 @@ QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void) QDF_STATUS status; status = cds_register_sap_restart_channel_switch_cb( - (void *)hdd_sap_restart_with_channel_switch); + hdd_sap_restart_with_channel_switch); if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("restart cb registration failed"); @@ -10170,22 +10271,17 @@ static int hdd_features_init(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) wlan_hdd_tsf_init(hdd_ctx); hdd_encrypt_decrypt_init(hdd_ctx); - ret = hdd_register_cb(hdd_ctx); - if (ret) { - hdd_err("Failed to register HDD callbacks!"); - goto deregister_frames; - } status = wlan_hdd_update_dbs_scan_and_fw_mode_config(hdd_ctx); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to set dbs scan and fw mode cfg"); - goto deregister_cb; + goto deregister_frames; } if (hdd_ctx->config->goptimize_chan_avoid_event) { status = sme_enable_disable_chanavoidind_event( hdd_ctx->hHal, 0); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("Failed to disable Chan Avoidance Indication"); - goto deregister_cb; + goto deregister_frames; } } @@ -10216,15 +10312,13 @@ static int hdd_features_init(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) ret = hdd_set_auto_shutdown_cb(hdd_ctx); if (ret) - goto deregister_cb; + goto deregister_frames; wlan_hdd_init_chan_info(hdd_ctx); EXIT(); return 0; -deregister_cb: - hdd_deregister_cb(hdd_ctx); deregister_frames: wlan_hdd_cfg80211_deregister_frames(adapter); out: @@ -10398,8 +10492,6 @@ static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) /* De-init features */ hdd_features_deinit(hdd_ctx); - /* De-register the SME callbacks */ - hdd_deregister_cb(hdd_ctx); hdd_encrypt_decrypt_deinit(hdd_ctx); sme_destroy_config(hdd_ctx->hHal); @@ -10549,6 +10641,9 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool ftm_mode) QDF_ASSERT(0); } + /* De-register the SME callbacks */ + hdd_deregister_cb(hdd_ctx); + hdd_runtime_suspend_context_deinit(hdd_ctx); qdf_status = cds_close(hdd_ctx->pcds_context); @@ -10826,7 +10921,8 @@ int hdd_wlan_startup(struct device *dev) if (hdd_ctx->config->enable_dp_trace) hdd_dp_trace_init(hdd_ctx->config); - if (hdd_ipa_init(hdd_ctx) == QDF_STATUS_E_FAILURE) + ret = hdd_ipa_init(hdd_ctx); + if (ret) goto err_wiphy_unregister; ret = hdd_initialize_mac_address(hdd_ctx); @@ -10841,6 +10937,12 @@ int hdd_wlan_startup(struct device *dev) goto err_ipa_cleanup; } + ret = register_reboot_notifier(&system_reboot_notifier); + if (ret) { + hdd_err("Failed to register reboot notifier: %d", ret); + goto err_unregister_netdev; + } + rtnl_held = hdd_hold_rtnl_lock(); ret = hdd_open_interfaces(hdd_ctx, rtnl_held); @@ -10886,9 +10988,11 @@ err_close_adapters: hdd_close_all_adapters(hdd_ctx, rtnl_held); err_release_rtnl_lock: + unregister_reboot_notifier(&system_reboot_notifier); if (rtnl_held) hdd_release_rtnl_lock(); +err_unregister_netdev: unregister_netdevice_notifier(&hdd_netdev_notifier); err_ipa_cleanup: @@ -11006,7 +11110,7 @@ static void hdd_get_nud_stats_cb(void *data, struct rsp_stats *rsp) spin_lock(&hdd_context_lock); context = &hdd_ctx->nud_stats_context; - complete(&context->response_event); + qdf_event_set(&context->response_event); spin_unlock(&hdd_context_lock); EXIT(); @@ -11025,6 +11129,11 @@ int hdd_register_cb(hdd_context_t *hdd_ctx) QDF_STATUS status; int ret = 0; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("in ftm mode, no need to register callbacks"); + return ret; + } + ENTER(); sme_register11d_scan_done_callback(hdd_ctx->hHal, hdd_11d_scan_done); @@ -11046,7 +11155,7 @@ int hdd_register_cb(hdd_context_t *hdd_ctx) wlan_hdd_cfg80211_extscan_callback); status = cds_register_sap_restart_channel_switch_cb( - (void *)hdd_sap_restart_with_channel_switch); + hdd_sap_restart_with_channel_switch); if (!QDF_IS_STATUS_SUCCESS(status)) { hdd_err("restart cb registration failed"); ret = -EINVAL; @@ -11123,6 +11232,11 @@ void hdd_deregister_cb(hdd_context_t *hdd_ctx) QDF_STATUS status; int ret; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("in ftm mode, no need to deregister callbacks"); + return; + } + ENTER(); status = sme_deregister_for_dcc_stats_event(hdd_ctx->hHal); @@ -11245,105 +11359,93 @@ QDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *hdd_ctx) /** * wlan_hdd_disable_roaming() - disable roaming on all STAs except the input one - * @adapter: HDD adapter pointer - * - * This function loop through each adapter and disable roaming on each STA - * device mode except the input adapter. + * @cur_adapter: Current HDD adapter passed from caller * - * Note: On the input adapter roaming is not enabled yet hence no need to - * disable. + * This function loops through all adapters and disables roaming on each STA + * mode adapter except the current adapter passed from the caller * * Return: None */ -void wlan_hdd_disable_roaming(hdd_adapter_t *adapter) +void wlan_hdd_disable_roaming(hdd_adapter_t *cur_adapter) { - hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); - hdd_adapter_t *adapterIdx = NULL; - hdd_adapter_list_node_t *adapterNode = NULL; - hdd_adapter_list_node_t *pNext = NULL; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(cur_adapter); + hdd_adapter_t *adapter = NULL; + hdd_adapter_list_node_t *adapter_node = NULL; + hdd_adapter_list_node_t *next = NULL; QDF_STATUS status; + hdd_wext_state_t *wext_state; + hdd_station_ctx_t *sta_ctx; + tCsrRoamProfile *roam_profile; - if (hdd_ctx->config->isFastRoamIniFeatureEnabled && - hdd_ctx->config->isRoamOffloadScanEnabled && - QDF_STA_MODE == adapter->device_mode && - cds_is_sta_active_connection_exists()) { - hdd_debug("Connect received on STA sessionId(%d)", - adapter->sessionId); - /* - * Loop through adapter and disable roaming for each STA device - * mode except the input adapter. - */ - status = hdd_get_front_adapter(hdd_ctx, &adapterNode); - - while (NULL != adapterNode && QDF_STATUS_SUCCESS == status) { - adapterIdx = adapterNode->pAdapter; - - if (QDF_STA_MODE == adapterIdx->device_mode - && adapter->sessionId != adapterIdx->sessionId) { - hdd_debug("Disable Roaming on sessionId(%d)", - adapterIdx->sessionId); - sme_stop_roaming(WLAN_HDD_GET_HAL_CTX - (adapterIdx), - adapterIdx->sessionId, 0); - } + if (!cds_is_sta_active_connection_exists()) { + hdd_debug("No active sta session"); + return; + } - status = hdd_get_next_adapter(hdd_ctx, - adapterNode, - &pNext); - adapterNode = pNext; + status = hdd_get_front_adapter(hdd_ctx, &adapter_node); + while (QDF_IS_STATUS_SUCCESS(status) && adapter_node) { + adapter = adapter_node->pAdapter; + wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + roam_profile = &wext_state->roamProfile; + + if (cur_adapter->sessionId != adapter->sessionId && + adapter->device_mode == QDF_STA_MODE && + hdd_conn_is_connected(sta_ctx)) { + hdd_debug("%d Disable roaming", + adapter->sessionId); + sme_stop_roaming(WLAN_HDD_GET_HAL_CTX(adapter), + adapter->sessionId, + eCsrDriverDisabled); } + status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next); + adapter_node = next; } } /** * wlan_hdd_enable_roaming() - enable roaming on all STAs except the input one - * @adapter: HDD adapter pointer + * @cur_adapter: Current HDD adapter passed from caller * - * This function loop through each adapter and enable roaming on each STA - * device mode except the input adapter. - * Note: On the input adapter no need to enable roaming because link got - * disconnected on this. + * This function loops through all adapters and enables roaming on each STA + * mode adapter except the current adapter passed from the caller * * Return: None */ -void wlan_hdd_enable_roaming(hdd_adapter_t *adapter) +void wlan_hdd_enable_roaming(hdd_adapter_t *cur_adapter) { - hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); - hdd_adapter_t *adapterIdx = NULL; - hdd_adapter_list_node_t *adapterNode = NULL; - hdd_adapter_list_node_t *pNext = NULL; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(cur_adapter); + hdd_adapter_t *adapter = NULL; + hdd_adapter_list_node_t *adapter_node = NULL; + hdd_adapter_list_node_t *next = NULL; QDF_STATUS status; + hdd_wext_state_t *wext_state; + hdd_station_ctx_t *sta_ctx; + tCsrRoamProfile *roam_profile; - if (hdd_ctx->config->isFastRoamIniFeatureEnabled && - hdd_ctx->config->isRoamOffloadScanEnabled && - QDF_STA_MODE == adapter->device_mode && - cds_is_sta_active_connection_exists()) { - hdd_debug("Disconnect received on STA sessionId(%d)", - adapter->sessionId); - /* - * Loop through adapter and enable roaming for each STA device - * mode except the input adapter. - */ - status = hdd_get_front_adapter(hdd_ctx, &adapterNode); - - while (NULL != adapterNode && QDF_STATUS_SUCCESS == status) { - adapterIdx = adapterNode->pAdapter; - - if (QDF_STA_MODE == adapterIdx->device_mode - && adapter->sessionId != adapterIdx->sessionId) { - hdd_debug("Enabling Roaming on sessionId(%d)", - adapterIdx->sessionId); - sme_start_roaming(WLAN_HDD_GET_HAL_CTX - (adapterIdx), - adapterIdx->sessionId, - REASON_CONNECT); - } + if (!cds_is_sta_active_connection_exists()) { + hdd_debug("No active sta session"); + return; + } - status = hdd_get_next_adapter(hdd_ctx, - adapterNode, - &pNext); - adapterNode = pNext; + status = hdd_get_front_adapter(hdd_ctx, &adapter_node); + while (QDF_IS_STATUS_SUCCESS(status) && adapter_node) { + adapter = adapter_node->pAdapter; + wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + roam_profile = &wext_state->roamProfile; + + if (cur_adapter->sessionId != adapter->sessionId && + adapter->device_mode == QDF_STA_MODE && + hdd_conn_is_connected(sta_ctx)) { + hdd_debug("%d Enable roaming", + adapter->sessionId); + sme_start_roaming(WLAN_HDD_GET_HAL_CTX(adapter), + adapter->sessionId, + REASON_DRIVER_ENABLED); } + status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next); + adapter_node = next; } } @@ -11993,7 +12095,7 @@ int hdd_init(void) #endif qdf_timer_init(NULL, &hdd_drv_ops_inactivity_timer, - (void *)hdd_drv_ops_inactivity_handler, NULL, + hdd_drv_ops_inactivity_handler, NULL, QDF_TIMER_TYPE_SW); hdd_trace_init(); @@ -12206,7 +12308,8 @@ static void __hdd_module_exit(void) pr_info("%s: Unloading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR); - hdd_wait_for_recovery_completion(); + if (!hdd_wait_for_recovery_completion()) + return; wlan_hdd_unregister_driver(); @@ -12461,6 +12564,7 @@ static void hdd_stop_present_mode(hdd_context_t *hdd_ctx, hdd_info("Release wakelock for monitor mode!"); qdf_wake_lock_release(&hdd_ctx->monitor_mode_wakelock, WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE); + /* fallthrough */ case QDF_GLOBAL_MISSION_MODE: case QDF_GLOBAL_FTM_MODE: hdd_abort_mac_scan_all_adapters(hdd_ctx); @@ -12899,25 +13003,22 @@ void hdd_set_roaming_in_progress(bool value) /** * hdd_is_roaming_in_progress() - check if roaming is in progress - * @adapter - HDD adapter + * @hdd_ctx - Global HDD context + * + * Checks if roaming is in progress on any of the adapters * - * Return: true if roaming is in progress for STA type, else false + * Return: true if roaming is in progress else false */ -bool hdd_is_roaming_in_progress(hdd_adapter_t *adapter) +bool hdd_is_roaming_in_progress(hdd_context_t *hdd_ctx) { - hdd_context_t *hdd_ctx; - bool ret_status = false; - - hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { hdd_err("HDD context is NULL"); - return ret_status; + return false; } - hdd_debug("dev mode = %d, roaming_in_progress = %d", - adapter->device_mode, hdd_ctx->roaming_in_progress); - ret_status = ((adapter->device_mode == QDF_STA_MODE) && - hdd_ctx->roaming_in_progress); - return ret_status; + + hdd_debug("roaming_in_progress = %d", hdd_ctx->roaming_in_progress); + + return hdd_ctx->roaming_in_progress; } hdd_adapter_t *hdd_get_adapter_by_rand_macaddr(hdd_context_t *hdd_ctx, @@ -13124,7 +13225,7 @@ void hdd_stop_driver_ops_timer(void) * * Return: None */ -void hdd_drv_ops_inactivity_handler(void) +void hdd_drv_ops_inactivity_handler(unsigned long arg) { hdd_err("%s: %d Sec timer expired while in .%s", __func__, HDD_OPS_INACTIVITY_TIMEOUT/1000, drv_ops_string); diff --git a/core/hdd/src/wlan_hdd_memdump.c b/core/hdd/src/wlan_hdd_memdump.c index 9f6be56bb7ba..ff048ba6be71 100644 --- a/core/hdd/src/wlan_hdd_memdump.c +++ b/core/hdd/src/wlan_hdd_memdump.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC : wlan_hdd_memdump.c * diff --git a/core/hdd/src/wlan_hdd_nan.c b/core/hdd/src/wlan_hdd_nan.c index 4cd7e5d30b63..47e28a8c39dc 100644 --- a/core/hdd/src/wlan_hdd_nan.c +++ b/core/hdd/src/wlan_hdd_nan.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c index 67b5bc8dccde..90a72a179bc8 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.c +++ b/core/hdd/src/wlan_hdd_nan_datapath.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -45,15 +43,14 @@ qca_wlan_vendor_ndp_policy[QCA_WLAN_VENDOR_ATTR_NDP_PARAMS_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_INSTANCE_ID] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_NDP_CHANNEL] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_NDP_PEER_DISCOVERY_MAC_ADDR] = { - .type = NLA_BINARY, + .type = NLA_UNSPEC, .len = QDF_MAC_ADDR_SIZE }, [QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_SECURITY] = { .type = NLA_U16 }, - [QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS] = { .type = NLA_BINARY, - .len = NDP_QOS_INFO_LEN }, + [QCA_WLAN_VENDOR_ATTR_NDP_CONFIG_QOS] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_NDP_APP_INFO] = { .type = NLA_BINARY, .len = NDP_APP_INFO_LEN }, [QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID] = { .type = NLA_U32 }, - [QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE] = { .type = NLA_U16 }, + [QCA_WLAN_VENDOR_ATTR_NDP_RESPONSE_CODE] = { .type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_NDP_NDI_MAC_ADDR] = { .type = NLA_BINARY, .len = QDF_MAC_ADDR_SIZE }, [QCA_WLAN_VENDOR_ATTR_NDP_INSTANCE_ID_ARRAY] = { .type = NLA_BINARY, @@ -454,8 +451,8 @@ static int hdd_ndi_create_req_handler(hdd_context_t *hdd_ctx, * does not have any such formal requests. The NDI create request * is responsible for starting the BSS as well. */ - if (op_channel != NAN_SOCIAL_CHANNEL_2_4GHZ || - op_channel != NAN_SOCIAL_CHANNEL_5GHZ_LOWER_BAND || + if (op_channel != NAN_SOCIAL_CHANNEL_2_4GHZ && + op_channel != NAN_SOCIAL_CHANNEL_5GHZ_LOWER_BAND && op_channel != NAN_SOCIAL_CHANNEL_5GHZ_UPPER_BAND) { /* start NDI on the default 2.4 GHz social channel */ op_channel = NAN_SOCIAL_CHANNEL_2_4GHZ; diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h index a6ee7fe760d6..3e9b85477303 100644 --- a/core/hdd/src/wlan_hdd_nan_datapath.h +++ b/core/hdd/src/wlan_hdd_nan_datapath.h @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -38,7 +36,6 @@ struct wireless_dev; #define NAN_SOCIAL_CHANNEL_5GHZ_UPPER_BAND 149 #define NDP_APP_INFO_LEN 255 -#define NDP_QOS_INFO_LEN 255 #define NDP_PMK_LEN 32 #define NDP_SCID_BUF_LEN 256 #define NDP_NUM_INSTANCE_ID 255 diff --git a/core/hdd/src/wlan_hdd_napi.c b/core/hdd/src/wlan_hdd_napi.c index 3591f201ba34..d318c7534ee2 100644 --- a/core/hdd/src/wlan_hdd_napi.c +++ b/core/hdd/src/wlan_hdd_napi.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_napi.c * diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index 2dab26bbbb1d..3abc9a87f6ff 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_ocb.c * @@ -36,6 +27,7 @@ #include "wlan_hdd_main.h" #include "wlan_hdd_ocb.h" #include "wlan_hdd_trace.h" +#include "wlan_hdd_request_manager.h" #include "target_if_def_config.h" #include "sch_api.h" #include "wma_api.h" @@ -50,20 +42,6 @@ /* Maximum time(ms) to wait for OCB operations */ #define WLAN_WAIT_TIME_OCB_CMD 1500 -#define HDD_OCB_MAGIC 0x489a154f - -/** - * struct hdd_ocb_ctxt - Context for OCB operations - * adapter: the ocb adapter - * completion_evt: the completion event - * status: status of the request - */ -struct hdd_ocb_ctxt { - uint32_t magic; - hdd_adapter_t *adapter; - struct completion completion_evt; - int status; -}; /** * hdd_set_dot11p_config() - Set 802.11p config flag @@ -348,6 +326,11 @@ fail: return NULL; } +struct hdd_ocb_set_config_priv { + int status; +}; + + /** * hdd_ocb_set_config_callback() - OCB set config callback function * @context_ptr: OCB call context @@ -358,47 +341,27 @@ fail: */ static void hdd_ocb_set_config_callback(void *context_ptr, void *response_ptr) { - struct hdd_ocb_ctxt *context = context_ptr; - struct sir_ocb_set_config_response *resp = response_ptr; + struct hdd_request *hdd_request; + struct hdd_ocb_set_config_priv *priv; + struct sir_ocb_set_config_response *response = response_ptr; - if (!context) + hdd_request = hdd_request_get(context_ptr); + if (!hdd_request) { + hdd_err("Obsolete request"); return; + } + priv = hdd_request_priv(hdd_request); - if (resp && resp->status) - hdd_warn("Operation failed: %d", resp->status); - - spin_lock(&hdd_context_lock); - if (context->magic == HDD_OCB_MAGIC) { - hdd_adapter_t *adapter = context->adapter; - - if (!resp) { - context->status = -EINVAL; - complete(&context->completion_evt); - spin_unlock(&hdd_context_lock); - return; - } + if (response && response->status) + hdd_warn("Operation failed: %d", response->status); - context->adapter->ocb_set_config_resp = *resp; - spin_unlock(&hdd_context_lock); - if (!resp->status) { - /* - * OCB set config command successful. - * Open the TX data path - */ - if (!hdd_ocb_register_sta(adapter)) { - wlan_hdd_netif_queue_control(adapter, - WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, - WLAN_CONTROL_PATH); - } - } + if (response && (0 == response->status)) + priv->status = 0; + else + priv->status = -EINVAL; - spin_lock(&hdd_context_lock); - if (context->magic == HDD_OCB_MAGIC) - complete(&context->completion_evt); - spin_unlock(&hdd_context_lock); - } else { - spin_unlock(&hdd_context_lock); - } + hdd_request_complete(hdd_request); + hdd_request_put(hdd_request); } /** @@ -412,59 +375,70 @@ static int hdd_ocb_set_config_req(hdd_adapter_t *adapter, struct sir_ocb_config *config) { int rc; - QDF_STATUS qdf_status; - struct hdd_ocb_ctxt context = {0}; + QDF_STATUS status; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + void *cookie; + struct hdd_request *hdd_request; + struct hdd_ocb_set_config_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_OCB_CMD, + }; if (hdd_ocb_validate_config(adapter, config)) { hdd_err("The configuration is invalid"); return -EINVAL; } - init_completion(&context.completion_evt); - context.adapter = adapter; - context.magic = HDD_OCB_MAGIC; + hdd_request = hdd_request_alloc(¶ms); + if (!hdd_request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + cookie = hdd_request_cookie(hdd_request); - hdd_info("Disabling queues"); + hdd_debug("Disabling queues"); wlan_hdd_netif_queue_control(adapter, WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); - /* Call the SME API to set the config */ - qdf_status = sme_ocb_set_config( - ((hdd_context_t *)adapter->pHddCtx)->hHal, &context, - hdd_ocb_set_config_callback, config); - if (qdf_status != QDF_STATUS_SUCCESS) { - hdd_err("Error calling SME function."); - /* Convert from qdf_status to errno */ - return -EINVAL; + status = sme_ocb_set_config(hdd_ctx->hHal, cookie, + hdd_ocb_set_config_callback, + config); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Failed to set channel config."); + /* Convert from eHalStatus to errno */ + rc = qdf_status_to_os_return(status); + goto end; } /* Wait for the function to complete. */ - rc = wait_for_completion_timeout(&context.completion_evt, - msecs_to_jiffies(WLAN_WAIT_TIME_OCB_CMD)); - if (rc == 0) { - rc = -ETIMEDOUT; + rc = hdd_request_wait_for_response(hdd_request); + if (rc) { + hdd_err("Operation timed out"); goto end; } - rc = 0; - if (context.status) { - rc = context.status; + priv = hdd_request_priv(hdd_request); + rc = priv->status; + if (rc) { + hdd_err("Operation failed: %d", rc); goto end; } - if (adapter->ocb_set_config_resp.status) { - rc = -EINVAL; - goto end; - } + /* + * OCB set config command successful. + * Open the TX data path + */ + if (!hdd_ocb_register_sta(adapter)) + wlan_hdd_netif_queue_control(adapter, + WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, + WLAN_CONTROL_PATH); /* fall through */ end: - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); - if (rc) - hdd_err("Operation failed: %d", rc); + hdd_request_put(hdd_request); + return rc; } @@ -1306,6 +1280,11 @@ int wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy, return ret; } +struct hdd_ocb_get_tsf_timer_priv { + struct sir_ocb_get_tsf_timer_response response; + int status; +}; + /** * hdd_ocb_get_tsf_timer_callback() - Callback to get TSF command * @context_ptr: request context @@ -1314,23 +1293,67 @@ int wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy, static void hdd_ocb_get_tsf_timer_callback(void *context_ptr, void *response_ptr) { - struct hdd_ocb_ctxt *context = context_ptr; + struct hdd_request *hdd_request; + struct hdd_ocb_get_tsf_timer_priv *priv; struct sir_ocb_get_tsf_timer_response *response = response_ptr; - if (!context) + hdd_request = hdd_request_get(context_ptr); + if (!hdd_request) { + hdd_err("Obsolete request"); return; + } - spin_lock(&hdd_context_lock); - if (context->magic == HDD_OCB_MAGIC) { - if (response) { - context->adapter->ocb_get_tsf_timer_resp = *response; - context->status = 0; - } else { - context->status = -EINVAL; - } - complete(&context->completion_evt); + if (response) { + priv->response = *response; + priv->status = 0; + } else { + priv->status = -EINVAL; } - spin_unlock(&hdd_context_lock); + hdd_request_complete(hdd_request); + hdd_request_put(hdd_request); +} + +static int +hdd_ocb_get_tsf_timer_reply(struct wiphy *wiphy, + struct sir_ocb_get_tsf_timer_response *response) +{ + uint32_t nl_buf_len; + struct sk_buff *nl_resp; + int rc; + + /* Allocate the buffer for the response. */ + nl_buf_len = NLMSG_HDRLEN; + nl_buf_len += 2 * (NLA_HDRLEN + sizeof(uint32_t)); + nl_resp = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, nl_buf_len); + if (!nl_resp) { + hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed"); + return -ENOMEM; + } + + /* Populate the response. */ + rc = nla_put_u32(nl_resp, + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_HIGH, + response->timer_high); + if (rc) + goto end; + rc = nla_put_u32(nl_resp, + QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_LOW, + response->timer_low); + if (rc) + goto end; + + /* Send the response. */ + rc = cfg80211_vendor_cmd_reply(nl_resp); + nl_resp = NULL; + if (rc) { + hdd_err("cfg80211_vendor_cmd_reply failed: %d", rc); + goto end; + } +end: + if (nl_resp) + kfree_skb(nl_resp); + + return rc; } /** @@ -1348,18 +1371,25 @@ __wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy, const void *data, int data_len) { - struct sk_buff *nl_resp = 0; hdd_context_t *hdd_ctx = wiphy_priv(wiphy); struct net_device *dev = wdev->netdev; hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); - int rc = -EINVAL; + int rc; struct sir_ocb_get_tsf_timer request = {0}; - struct hdd_ocb_ctxt context = {0}; + QDF_STATUS status; + void *cookie; + struct hdd_request *hdd_request; + struct hdd_ocb_get_tsf_timer_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_OCB_CMD, + }; ENTER_DEV(dev); - if (wlan_hdd_validate_context(hdd_ctx)) - return -EINVAL; + rc = wlan_hdd_validate_context(hdd_ctx); + if (rc) + return rc; if (adapter->device_mode != QDF_OCB_MODE) { hdd_err("Device not in OCB mode!"); @@ -1371,77 +1401,52 @@ __wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy, return -EINVAL; } - /* Initialize the callback context */ - init_completion(&context.completion_evt); - context.adapter = adapter; - context.magic = HDD_OCB_MAGIC; + hdd_request = hdd_request_alloc(¶ms); + if (!hdd_request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + cookie = hdd_request_cookie(hdd_request); request.vdev_id = adapter->sessionId; /* Call the SME function */ - rc = sme_ocb_get_tsf_timer(hdd_ctx->hHal, &context, - hdd_ocb_get_tsf_timer_callback, - &request); - if (rc) { - hdd_err("Error calling SME function"); - /* Need to convert from qdf_status to errno. */ - return -EINVAL; - } - - rc = wait_for_completion_timeout(&context.completion_evt, - msecs_to_jiffies(WLAN_WAIT_TIME_OCB_CMD)); - if (rc == 0) { - hdd_err("Operation timed out"); - rc = -ETIMEDOUT; + status = sme_ocb_get_tsf_timer(hdd_ctx->hHal, cookie, + hdd_ocb_get_tsf_timer_callback, + &request); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Failed to get tsf timer."); + rc = qdf_status_to_os_return(status); goto end; } - rc = 0; - if (context.status) { - hdd_err("Operation failed: %d", context.status); - rc = context.status; + rc = hdd_request_wait_for_response(hdd_request); + if (rc) { + hdd_err("Operation timed out"); goto end; } - /* Allocate the buffer for the response. */ - nl_resp = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, - 2 * sizeof(uint32_t) + NLMSG_HDRLEN); - - if (!nl_resp) { - hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed"); - rc = -ENOMEM; + priv = hdd_request_priv(hdd_request); + rc = priv->status; + if (rc) { + hdd_err("Operation failed: %d", rc); goto end; } hdd_debug("Got TSF timer response, high=%d, low=%d", - adapter->ocb_get_tsf_timer_resp.timer_high, - adapter->ocb_get_tsf_timer_resp.timer_low); - - /* Populate the response. */ - rc = nla_put_u32(nl_resp, - QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_HIGH, - adapter->ocb_get_tsf_timer_resp.timer_high); - if (rc) - goto end; - rc = nla_put_u32(nl_resp, - QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_LOW, - adapter->ocb_get_tsf_timer_resp.timer_low); - if (rc) - goto end; + priv->response.timer_high, + priv->response.timer_low); /* Send the response. */ - rc = cfg80211_vendor_cmd_reply(nl_resp); - nl_resp = NULL; + rc = hdd_ocb_get_tsf_timer_reply(wiphy, &priv->response); if (rc) { - hdd_err("cfg80211_vendor_cmd_reply failed: %d", rc); + hdd_err("hdd_ocb_get_tsf_timer_reply failed: %d", rc); goto end; } + /* fall through */ end: - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); - if (nl_resp) - kfree_skb(nl_resp); + hdd_request_put(hdd_request); + return rc; } @@ -1469,6 +1474,19 @@ int wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy, return ret; } +struct hdd_dcc_stats_priv { + struct sir_dcc_get_stats_response *response; + int status; +}; + +static void hdd_dcc_get_stats_dealloc(void *context_ptr) +{ + struct hdd_dcc_stats_priv *priv = context_ptr; + + qdf_mem_free(priv->response); + priv->response = NULL; +} + /** * hdd_dcc_get_stats_callback() - Callback to get stats command * @context_ptr: request context @@ -1476,46 +1494,86 @@ int wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy, */ static void hdd_dcc_get_stats_callback(void *context_ptr, void *response_ptr) { - struct hdd_ocb_ctxt *context = context_ptr; + struct hdd_request *hdd_request; + struct hdd_dcc_stats_priv *priv; struct sir_dcc_get_stats_response *response = response_ptr; struct sir_dcc_get_stats_response *hdd_resp; - if (!context) + hdd_request = hdd_request_get(context_ptr); + if (!hdd_request) { + hdd_err("Obsolete request"); return; + } - spin_lock(&hdd_context_lock); - if (context->magic == HDD_OCB_MAGIC) { - if (response) { - /* - * If the response is hanging around from the previous - * request, delete it - */ - if (context->adapter->dcc_get_stats_resp) { - qdf_mem_free( - context->adapter->dcc_get_stats_resp); - } - context->adapter->dcc_get_stats_resp = - qdf_mem_malloc(sizeof( - *context->adapter->dcc_get_stats_resp) + - response->channel_stats_array_len); - if (context->adapter->dcc_get_stats_resp) { - hdd_resp = context->adapter->dcc_get_stats_resp; - *hdd_resp = *response; - hdd_resp->channel_stats_array = - (void *)hdd_resp + sizeof(*hdd_resp); - qdf_mem_copy(hdd_resp->channel_stats_array, - response->channel_stats_array, - response->channel_stats_array_len); - context->status = 0; - } else { - context->status = -ENOMEM; - } - } else { - context->status = -EINVAL; - } - complete(&context->completion_evt); + priv = hdd_request_priv(hdd_request); + if (!response) { + priv->status = -EINVAL; + goto end; + } + + priv->response = qdf_mem_malloc(sizeof(*response) + + response->channel_stats_array_len); + if (!priv->response) { + priv->status = -ENOMEM; + goto end; } - spin_unlock(&hdd_context_lock); + + hdd_resp = priv->response; + *hdd_resp = *response; + hdd_resp->channel_stats_array = (void *)hdd_resp + sizeof(*hdd_resp); + qdf_mem_copy(hdd_resp->channel_stats_array, + response->channel_stats_array, + response->channel_stats_array_len); + priv->status = 0; + +end: + hdd_request_complete(hdd_request); + hdd_request_put(hdd_request); +} + +static int +hdd_dcc_get_stats_send_reply(struct wiphy *wiphy, + struct sir_dcc_get_stats_response *response) +{ + uint32_t nl_buf_len; + struct sk_buff *nl_resp; + int rc; + + /* Allocate the buffer for the response. */ + nl_buf_len = NLMSG_HDRLEN; + nl_buf_len += NLA_HDRLEN + sizeof(uint32_t); + nl_buf_len += NLA_HDRLEN + response->channel_stats_array_len; + nl_resp = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, nl_buf_len); + if (!nl_resp) { + hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed"); + return -ENOMEM; + } + + /* Populate the response. */ + rc = nla_put_u32(nl_resp, + QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_CHANNEL_COUNT, + response->num_channels); + if (rc) + goto end; + rc = nla_put(nl_resp, + QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_STATS_ARRAY, + response->channel_stats_array_len, + response->channel_stats_array); + if (rc) + goto end; + + /* Send the response. */ + rc = cfg80211_vendor_cmd_reply(nl_resp); + nl_resp = NULL; + if (rc) { + hdd_err("cfg80211_vendor_cmd_reply failed: %d", rc); + goto end; + } +end: + if (nl_resp) + kfree_skb(nl_resp); + + return rc; } /** @@ -1539,15 +1597,23 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy, struct net_device *dev = wdev->netdev; hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_MAX + 1]; - struct sk_buff *nl_resp = 0; - int rc = -EINVAL; + int rc; struct sir_dcc_get_stats request = {0}; - struct hdd_ocb_ctxt context = {0}; + QDF_STATUS status; + void *cookie; + struct hdd_request *hdd_request; + struct hdd_dcc_stats_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_OCB_CMD, + .dealloc = hdd_dcc_get_stats_dealloc, + }; ENTER_DEV(dev); - if (wlan_hdd_validate_context(hdd_ctx)) - return -EINVAL; + rc = wlan_hdd_validate_context(hdd_ctx); + if (rc) + return rc; if (adapter->device_mode != QDF_OCB_MODE) { hdd_err("Device not in OCB mode!"); @@ -1580,10 +1646,12 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy, request_array = nla_data( tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_REQUEST_ARRAY]); - /* Initialize the callback context */ - init_completion(&context.completion_evt); - context.adapter = adapter; - context.magic = HDD_OCB_MAGIC; + hdd_request = hdd_request_alloc(¶ms); + if (!hdd_request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + cookie = hdd_request_cookie(hdd_request); request.vdev_id = adapter->sessionId; request.channel_count = channel_count; @@ -1591,76 +1659,40 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy, request.request_array = request_array; /* Call the SME function. */ - rc = sme_dcc_get_stats(hdd_ctx->hHal, &context, - hdd_dcc_get_stats_callback, - &request); - if (rc) { - hdd_err("Error calling SME function"); - /* Need to convert from qdf_status to errno. */ - return -EINVAL; - } - - /* Wait for the function to complete. */ - rc = wait_for_completion_timeout(&context.completion_evt, - msecs_to_jiffies(WLAN_WAIT_TIME_OCB_CMD)); - if (rc == 0) { - hdd_err("Operation failed: %d", rc); - rc = -ETIMEDOUT; - goto end; - } - - if (context.status) { - hdd_err("There was error: %d", context.status); - rc = context.status; + status = sme_dcc_get_stats(hdd_ctx->hHal, cookie, + hdd_dcc_get_stats_callback, + &request); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Error calling SME function."); + rc = qdf_status_to_os_return(status); goto end; } - if (!adapter->dcc_get_stats_resp) { - hdd_err("The response was NULL"); - rc = -EINVAL; + /* Wait for the function to complete. */ + rc = hdd_request_wait_for_response(hdd_request); + if (rc) { + hdd_err("Operation timed out"); goto end; } - /* Allocate the buffer for the response. */ - nl_resp = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(uint32_t) + - adapter->dcc_get_stats_resp->channel_stats_array_len + - NLMSG_HDRLEN); - if (!nl_resp) { - hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed"); - rc = -ENOMEM; + priv = hdd_request_priv(hdd_request); + rc = priv->status; + if (rc) { + hdd_err("Operation failed: %d", rc); goto end; } - /* Populate the response. */ - rc = nla_put_u32(nl_resp, - QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_CHANNEL_COUNT, - adapter->dcc_get_stats_resp->num_channels); - if (rc) - goto end; - rc = nla_put(nl_resp, - QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_STATS_ARRAY, - adapter->dcc_get_stats_resp->channel_stats_array_len, - adapter->dcc_get_stats_resp->channel_stats_array); - if (rc) - goto end; - /* Send the response. */ - rc = cfg80211_vendor_cmd_reply(nl_resp); - nl_resp = NULL; + rc = hdd_dcc_get_stats_send_reply(wiphy, priv->response); if (rc) { - hdd_err("cfg80211_vendor_cmd_reply failed: %d", rc); + hdd_err("hdd_dcc_get_stats_send_reply failed: %d", rc); goto end; } /* fall through */ end: - spin_lock(&hdd_context_lock); - context.magic = 0; - qdf_mem_free(adapter->dcc_get_stats_resp); - adapter->dcc_get_stats_resp = NULL; - spin_unlock(&hdd_context_lock); - if (nl_resp) - kfree_skb(nl_resp); + hdd_request_put(hdd_request); + return rc; } @@ -1771,6 +1803,10 @@ int wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy, return ret; } +struct hdd_dcc_update_ndl_priv { + int status; +}; + /** * hdd_dcc_update_ndl_callback() - Callback to update NDL command * @context_ptr: request context @@ -1778,23 +1814,22 @@ int wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy, */ static void hdd_dcc_update_ndl_callback(void *context_ptr, void *response_ptr) { - struct hdd_ocb_ctxt *context = context_ptr; + struct hdd_request *hdd_request; + struct hdd_dcc_update_ndl_priv *priv; struct sir_dcc_update_ndl_response *response = response_ptr; - if (!context) + hdd_request = hdd_request_get(context_ptr); + if (!hdd_request) { + hdd_err("Obsolete request"); return; - - spin_lock(&hdd_context_lock); - if (context->magic == HDD_OCB_MAGIC) { - if (response) { - context->adapter->dcc_update_ndl_resp = *response; - context->status = 0; - } else { - context->status = -EINVAL; - } - complete(&context->completion_evt); } - spin_unlock(&hdd_context_lock); + priv = hdd_request_priv(hdd_request); + if (response && (0 == response->status)) + priv->status = 0; + else + priv->status = -EINVAL; + hdd_request_complete(hdd_request); + hdd_request_put(hdd_request); } /** @@ -1821,17 +1856,25 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, void *ndl_channel_array; uint32_t ndl_active_state_array_len; void *ndl_active_state_array; - int rc = -EINVAL; - struct hdd_ocb_ctxt context = {0}; + int rc; + QDF_STATUS status; + void *cookie; + struct hdd_request *hdd_request; + struct hdd_dcc_update_ndl_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_OCB_CMD, + }; ENTER_DEV(dev); - if (wlan_hdd_validate_context(hdd_ctx)) - goto end; + rc = wlan_hdd_validate_context(hdd_ctx); + if (rc) + return rc; if (adapter->device_mode != QDF_OCB_MODE) { hdd_err("Device not in OCB mode!"); - goto end; + return -EINVAL; } if (!wma_is_vdev_up(adapter->sessionId)) { @@ -1843,7 +1886,7 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, if (hdd_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX, data, data_len, qca_wlan_vendor_dcc_update_ndl)) { hdd_err("Invalid ATTR"); - goto end; + return -EINVAL; } /* Verify that the parameter is present */ @@ -1865,10 +1908,12 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, ndl_active_state_array = nla_data( tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY]); - /* Initialize the callback context */ - init_completion(&context.completion_evt); - context.adapter = adapter; - context.magic = HDD_OCB_MAGIC; + hdd_request = hdd_request_alloc(¶ms); + if (!hdd_request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + cookie = hdd_request_cookie(hdd_request); /* Copy the parameters to the request structure. */ request.vdev_id = adapter->sessionId; @@ -1879,43 +1924,33 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, request.dcc_ndl_active_state_list = ndl_active_state_array; /* Call the SME function */ - rc = sme_dcc_update_ndl(hdd_ctx->hHal, &context, - hdd_dcc_update_ndl_callback, - &request); - if (rc) { + status = sme_dcc_update_ndl(hdd_ctx->hHal, cookie, + hdd_dcc_update_ndl_callback, + &request); + if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Error calling SME function."); - /* Convert from qdf_status to errno */ - return -EINVAL; + rc = qdf_status_to_os_return(status); + goto end; } /* Wait for the function to complete. */ - rc = wait_for_completion_timeout(&context.completion_evt, - msecs_to_jiffies(WLAN_WAIT_TIME_OCB_CMD)); - if (rc == 0) { + rc = hdd_request_wait_for_response(hdd_request); + if (rc) { hdd_err("Operation timed out"); - rc = -ETIMEDOUT; goto end; } - rc = 0; - if (context.status) { - hdd_err("Operation failed: %d", context.status); - rc = context.status; - goto end; - } - - if (adapter->dcc_update_ndl_resp.status) { - hdd_err("Operation returned: %d", - adapter->dcc_update_ndl_resp.status); - rc = -EINVAL; + priv = hdd_request_priv(hdd_request); + rc = priv->status; + if (rc) { + hdd_err("Operation failed: %d", rc); goto end; } /* fall through */ end: - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(hdd_request); + return rc; } diff --git a/core/hdd/src/wlan_hdd_ocb.h b/core/hdd/src/wlan_hdd_ocb.h index 784017a4f61c..4ca5c61d00e5 100644 --- a/core/hdd/src/wlan_hdd_ocb.h +++ b/core/hdd/src/wlan_hdd_ocb.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_OCB_H #define __WLAN_HDD_OCB_H diff --git a/core/hdd/src/wlan_hdd_oemdata.c b/core/hdd/src/wlan_hdd_oemdata.c index 3cc2c0707b67..5e2d62ffb2da 100644 --- a/core/hdd/src/wlan_hdd_oemdata.c +++ b/core/hdd/src/wlan_hdd_oemdata.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifdef FEATURE_OEM_DATA_SUPPORT /** diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index fbcb9d3fff8f..c3ed24ebc7ce 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * * @file wlan_hdd_p2p.c @@ -53,6 +44,7 @@ #include "cds_sched.h" #include "cds_concurrency.h" #include "cds_utils.h" +#include "wlan_hdd_request_manager.h" /* Ms to Time Unit Micro Sec */ #define MS_TO_TU_MUS(x) ((x) * 1024) @@ -180,6 +172,10 @@ static bool hdd_is_p2p_go_cnf_frame(const u8 *buf, uint32_t len) return false; } +struct random_mac_priv { + bool set_random_addr; +}; + /** * hdd_random_mac_callback() - Callback invoked from wmi layer * @set_random_addr: Status of random mac filter set operation @@ -192,31 +188,20 @@ static bool hdd_is_p2p_go_cnf_frame(const u8 *buf, uint32_t len) */ static void hdd_random_mac_callback(bool set_random_addr, void *context) { - struct random_mac_context *rnd_ctx; - hdd_adapter_t *adapter; + struct hdd_request *request; + struct random_mac_priv *priv; - if (!context) { - hdd_err("Bad param, pContext"); + request = hdd_request_get(context); + if (!request) { + hdd_err("invalid request"); return; } - rnd_ctx = context; - adapter = rnd_ctx->adapter; - - spin_lock(&hdd_context_lock); - if ((!adapter) || - (rnd_ctx->magic != ACTION_FRAME_RANDOM_CONTEXT_MAGIC)) { - spin_unlock(&hdd_context_lock); - hdd_err("Invalid context, magic [%08x]", rnd_ctx->magic); - return; - } + priv = hdd_request_priv(request); + priv->set_random_addr = set_random_addr; - rnd_ctx->magic = 0; - if (set_random_addr) - rnd_ctx->set_random_addr = true; - - complete(&rnd_ctx->random_mac_completion); - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } /** @@ -231,11 +216,17 @@ static bool hdd_set_random_mac(hdd_adapter_t *adapter, uint8_t *random_mac_addr, uint32_t freq) { - struct random_mac_context context; hdd_context_t *hdd_ctx; QDF_STATUS sme_status; unsigned long rc; + void *cookie; bool status = false; + struct hdd_request *request; + struct random_mac_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_SET_RND, + }; ENTER(); hdd_ctx = WLAN_HDD_GET_CTX(adapter); @@ -244,30 +235,33 @@ static bool hdd_set_random_mac(hdd_adapter_t *adapter, return false; } - init_completion(&context.random_mac_completion); - context.adapter = adapter; - context.magic = ACTION_FRAME_RANDOM_CONTEXT_MAGIC; - context.set_random_addr = false; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return false; + } + + cookie = hdd_request_cookie(request); sme_status = sme_set_random_mac(hdd_ctx->hHal, hdd_random_mac_callback, adapter->sessionId, random_mac_addr, freq, - &context); + cookie); if (sme_status != QDF_STATUS_SUCCESS) { hdd_err("Unable to set random mac"); } else { - rc = wait_for_completion_timeout(&context.random_mac_completion, - msecs_to_jiffies(WLAN_WAIT_TIME_SET_RND)); - if (!rc) + rc = hdd_request_wait_for_response(request); + if (rc) { hdd_err("SME timed out while setting random mac"); + } else { + priv = hdd_request_priv(request); + status = priv->set_random_addr; + } } - spin_lock(&hdd_context_lock); - context.magic = 0; - status = context.set_random_addr; - spin_unlock(&hdd_context_lock); - + hdd_request_put(request); EXIT(); + return status; } @@ -2843,6 +2837,7 @@ wlan_hdd_allow_sap_add(hdd_context_t *hdd_ctx, adapter = adapter_node->pAdapter; if (adapter && adapter->device_mode == QDF_SAP_MODE && test_bit(NET_DEVICE_REGISTERED, &adapter->event_flags) && + adapter->dev && !strncmp(adapter->dev->name, name, IFNAMSIZ)) { beacon_data_t *beacon = adapter->sessionCtx.ap.beacon; @@ -2851,7 +2846,7 @@ wlan_hdd_allow_sap_add(hdd_context_t *hdd_ctx, adapter->sessionCtx.ap.beacon = NULL; qdf_mem_free(beacon); } - if (adapter->dev && adapter->dev->ieee80211_ptr) { + if (adapter->dev->ieee80211_ptr) { *sap_dev = adapter->dev->ieee80211_ptr; return false; } diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 1fa5285f6ca0..5004526df150 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_power.c * @@ -298,6 +289,7 @@ int wlan_hdd_ipv6_changed(struct notifier_block *nb, * @idev: pointer to net device * @ipv6addr: destination array to fill IPv6 addresses * @ipv6addr_type: IPv6 Address type + * @scope_array: IPv6 Address scope * @count: number of IPv6 addresses * * This is the IPv6 utility function to populate unicast addresses. @@ -306,7 +298,9 @@ int wlan_hdd_ipv6_changed(struct notifier_block *nb, */ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, uint8_t ipv6_uc_addr[][SIR_MAC_IPV6_ADDR_LEN], - uint8_t *ipv6addr_type, uint32_t *count) + uint8_t *ipv6addr_type, + enum sir_ipv6_addr_scope *scope_array, + uint32_t *count) { struct inet6_ifaddr *ifa; struct list_head *p; @@ -328,6 +322,7 @@ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, qdf_mem_copy(ipv6_uc_addr[*count], &ifa->addr.s6_addr, sizeof(ifa->addr.s6_addr)); ipv6addr_type[*count] = SIR_IPV6_ADDR_UC_TYPE; + scope_array[*count] = sir_get_ipv6_addr_scope(scope); hdd_debug("Index %d scope = %s UC-Address: %pI6", *count, (scope == IPV6_ADDR_SCOPE_LINKLOCAL) ? "LINK LOCAL" : "GLOBAL", ipv6_uc_addr[*count]); @@ -347,6 +342,7 @@ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, * @idev: pointer to net device * @ipv6addr: destination array to fill IPv6 addresses * @ipv6addr_type: IPv6 Address type + * @scope_array: IPv6 Address scope * @count: number of IPv6 addresses * * This is the IPv6 utility function to populate anycast addresses. @@ -355,7 +351,9 @@ static int hdd_fill_ipv6_uc_addr(struct inet6_dev *idev, */ static int hdd_fill_ipv6_ac_addr(struct inet6_dev *idev, uint8_t ipv6_ac_addr[][SIR_MAC_IPV6_ADDR_LEN], - uint8_t *ipv6addr_type, uint32_t *count) + uint8_t *ipv6addr_type, + enum sir_ipv6_addr_scope *scope_array, + uint32_t *count) { struct ifacaddr6 *ifaca; uint32_t scope; @@ -374,6 +372,7 @@ static int hdd_fill_ipv6_ac_addr(struct inet6_dev *idev, qdf_mem_copy(ipv6_ac_addr[*count], &ifaca->aca_addr, sizeof(ifaca->aca_addr)); ipv6addr_type[*count] = SIR_IPV6_ADDR_AC_TYPE; + scope_array[*count] = sir_get_ipv6_addr_scope(scope); hdd_debug("Index %d scope = %s AC-Address: %pI6", *count, (scope == IPV6_ADDR_SCOPE_LINKLOCAL) ? "LINK LOCAL" : "GLOBAL", ipv6_ac_addr[*count]); @@ -427,6 +426,7 @@ static void hdd_enable_ns_offload(hdd_adapter_t *adapter) uint8_t ipv6_addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA] [SIR_MAC_IPV6_ADDR_LEN] = { {0,} }; uint8_t ipv6_addr_type[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA] = { 0 }; + enum sir_ipv6_addr_scope scope[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; tSirHostOffloadReq offloadReq; QDF_STATUS status; uint32_t count = 0; @@ -438,8 +438,11 @@ static void hdd_enable_ns_offload(hdd_adapter_t *adapter) return; } + qdf_mem_zero(scope, sizeof(scope)); + /* Unicast Addresses */ - err = hdd_fill_ipv6_uc_addr(in6_dev, ipv6_addr, ipv6_addr_type, &count); + err = hdd_fill_ipv6_uc_addr(in6_dev, ipv6_addr, ipv6_addr_type, scope, + &count); if (err) { hdd_disable_ns_offload(adapter); hdd_debug("Max supported addresses: disabling NS offload"); @@ -447,7 +450,8 @@ static void hdd_enable_ns_offload(hdd_adapter_t *adapter) } /* Anycast Addresses */ - err = hdd_fill_ipv6_ac_addr(in6_dev, ipv6_addr, ipv6_addr_type, &count); + err = hdd_fill_ipv6_ac_addr(in6_dev, ipv6_addr, ipv6_addr_type, scope, + &count); if (err) { hdd_disable_ns_offload(adapter); hdd_debug("Max supported addresses: disabling NS offload"); @@ -484,6 +488,7 @@ static void hdd_enable_ns_offload(hdd_adapter_t *adapter) SIR_IPV6_ADDR_VALID; offloadReq.nsOffloadInfo.target_ipv6_addr_ac_type[i] = ipv6_addr_type[i]; + offloadReq.nsOffloadInfo.scope[i] = scope[i]; qdf_mem_copy(&offloadReq.params.hostIpv6Addr, &offloadReq.nsOffloadInfo.targetIPv6Addr[i], @@ -1310,7 +1315,8 @@ hdd_suspend_wlan(void (*callback)(void *callbackContext, bool suspended), pAdapter = pAdapterNode->pAdapter; /* stop all TX queues before suspend */ - hdd_info("Disabling queues"); + hdd_info("Disabling queues for dev mode %s", + hdd_device_mode_to_string(pAdapter->device_mode)); wlan_hdd_netif_queue_control(pAdapter, WLAN_STOP_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH); @@ -1370,7 +1376,8 @@ static void hdd_resume_wlan(void) pAdapter = pAdapterNode->pAdapter; /* wake the tx queues */ - hdd_info("Enabling queues"); + hdd_info("Enabling queues for dev mode %s", + hdd_device_mode_to_string(pAdapter->device_mode)); wlan_hdd_netif_queue_control(pAdapter, WLAN_WAKE_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH); @@ -1630,7 +1637,7 @@ QDF_STATUS hdd_wlan_re_init(void) goto err_re_init; } - hdd_wlan_get_version(pHddCtx, NULL, NULL); + hdd_update_hw_sw_info(pHddCtx); wlan_hdd_send_svc_nlink_msg(pHddCtx->radio_index, WLAN_SVC_FW_CRASHED_IND, NULL, 0); @@ -1980,7 +1987,7 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, pAdapter = pAdapterNode->pAdapter; if (wlan_hdd_validate_session_id(pAdapter->sessionId)) { - hdd_err("invalid session id: %d", pAdapter->sessionId); + hdd_debug("invalid session id: %d", pAdapter->sessionId); goto next_adapter; } diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 51948bf8a940..4015d855c7b1 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_regulatory.c * diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 948986339295..794a3fea1f70 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_scan.c * @@ -93,6 +84,8 @@ struct nla_policy scan_policy[QCA_WLAN_VENDOR_ATTR_SCAN_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS] = {.type = NLA_U32}, [QCA_WLAN_VENDOR_ATTR_SCAN_TX_NO_CCK_RATE] = {.type = NLA_FLAG}, [QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE] = {.type = NLA_U64}, + [QCA_WLAN_VENDOR_ATTR_SCAN_IE] = {.type = NLA_BINARY, + .len = MAX_DEFAULT_SCAN_IE_LEN}, }; /** @@ -753,9 +746,9 @@ static bool wlan_hdd_is_scan_pending(hdd_adapter_t *adapter) * * Return: void */ -static void hdd_scan_inactivity_timer_handler(void *scan_req) +static void hdd_scan_inactivity_timer_handler(unsigned long scan_req) { - struct hdd_scan_req *hdd_scan_req = scan_req; + struct hdd_scan_req *hdd_scan_req = (struct hdd_scan_req *)scan_req; hdd_debug("scan_id %d, enqueue timestamp %u, flags 0x%X", hdd_scan_req->scan_id, hdd_scan_req->timestamp, @@ -2700,7 +2693,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, enum nl80211_band band; uint32_t n_channels = 0, n_ssid = 0; uint32_t tmp, count, j; - size_t len, ie_len; + size_t len, ie_len = 0; struct ieee80211_channel *chan; hdd_context_t *hdd_ctx = wiphy_priv(wiphy); int ret; @@ -2743,8 +2736,6 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]) ie_len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]); - else - ie_len = 0; len = sizeof(*request) + (sizeof(*request->ssids) * n_ssid) + (sizeof(*request->channels) * n_channels) + ie_len; @@ -2762,6 +2753,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, request->ie = (void *)(request->channels + n_channels); } + request->ie_len = ie_len; count = 0; if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES]) { nla_for_each_nested(attr, @@ -2819,12 +2811,9 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, } } - if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]) { - request->ie_len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]); - memcpy((void *)request->ie, - nla_data(tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]), - request->ie_len); - } + if (ie_len) + nla_memcpy((void *)request->ie, + nla_data(tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]), ie_len); for (count = 0; count < HDD_NUM_NL80211_BANDS; count++) if (wiphy->bands[count]) diff --git a/core/hdd/src/wlan_hdd_scan.h b/core/hdd/src/wlan_hdd_scan.h index 518b0497bc63..4f20fdf17c8a 100644 --- a/core/hdd/src/wlan_hdd_scan.h +++ b/core/hdd/src/wlan_hdd_scan.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 44d19d64622a..af9affcda87c 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* Include files */ #include <linux/semaphore.h> #include <wlan_hdd_tx_rx.h> @@ -432,6 +423,16 @@ static netdev_tx_t __hdd_softap_hard_start_xmit(struct sk_buff *skb, qdf_nbuf_data_addr(skb), sizeof(qdf_nbuf_data(skb)), QDF_TX)); + /* check whether need to linearize skb, like non-linear udp data */ + if (hdd_skb_nontso_linearize(skb) != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_HDD_DATA, + QDF_TRACE_LEVEL_INFO_HIGH, + "%s: skb %pK linearize failed. drop the pkt", + __func__, skb); + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + goto drop_pkt_and_release_skb; + } + if (pAdapter->tx_fn(ol_txrx_get_vdev_by_sta_id(STAId), (qdf_nbuf_t) skb) != NULL) { QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_INFO_HIGH, @@ -1019,7 +1020,8 @@ QDF_STATUS hdd_softap_stop_bss(hdd_adapter_t *pAdapter) wlan_hdd_restore_channels(pHddCtx); /* Mark the indoor channel (passive) to enable */ - if (pHddCtx->config->disable_indoor_channel) { + if (pHddCtx->config->disable_indoor_channel && + pAdapter->device_mode == QDF_SAP_MODE) { hdd_update_indoor_channel(pHddCtx, false); sme_update_channel_list(pHddCtx->hHal); } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index d088bd9ce0e9..51e305c7630c 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -34,6 +31,7 @@ #include "hif.h" #include "wlan_hdd_hostapd.h" #include "wlan_hdd_debugfs_llstat.h" +#include "wlan_hdd_request_manager.h" #include "wma_api.h" #include "wma.h" @@ -3794,77 +3792,58 @@ static void wlan_hdd_fill_rate_info(hdd_ap_ctx_t *ap_ctx, flags); } +struct peer_info_priv { + struct sir_peer_sta_ext_info peer_sta_ext_info; +}; + /** * wlan_hdd_get_peer_info_cb() - get peer info callback * @sta_info: pointer of peer information * @context: get peer info callback context * - * This function will fill stats info of AP Context + * This function will fill stats info to peer info priv * */ static void wlan_hdd_get_peer_info_cb(struct sir_peer_info_ext_resp *sta_info, - void *context) + void *context) { - struct statsContext *get_peer_info_context; - struct sir_peer_info_ext *peer_info; - hdd_adapter_t *adapter; - hdd_ap_ctx_t *ap_ctx; + struct hdd_request *request; + struct peer_info_priv *priv; + uint8_t sta_num; - if ((sta_info == NULL) || (context == NULL)) { - hdd_err("Bad param, sta_info [%pK] context [%pK]", - sta_info, context); - return; - } - - spin_lock(&hdd_context_lock); - /* - * there is a race condition that exists between this callback - * function and the caller since the caller could time out either - * before or while this code is executing. we use a spinlock to - * serialize these actions - */ - get_peer_info_context = context; - if (PEER_INFO_CONTEXT_MAGIC != - get_peer_info_context->magic) { - /* - * the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, magic [%08x]", - get_peer_info_context->magic); + if (!sta_info) { + hdd_err("Bad param, sta_info [%pK]", + sta_info); return; } if (!sta_info->count) { - spin_unlock(&hdd_context_lock); hdd_err("Fail to get remote peer info"); return; } - adapter = get_peer_info_context->pAdapter; - ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter); - qdf_mem_zero(&ap_ctx->txrx_stats, - sizeof(ap_ctx->txrx_stats)); + if (sta_info->count > MAX_PEER_STA) { + hdd_warn("Exceed max peer number %d", sta_info->count); + sta_num = MAX_PEER_STA; + } else { + sta_num = sta_info->count; + } - peer_info = sta_info->info; - ap_ctx->txrx_stats.tx_packets = peer_info->tx_packets; - ap_ctx->txrx_stats.tx_bytes = peer_info->tx_bytes; - ap_ctx->txrx_stats.rx_packets = peer_info->rx_packets; - ap_ctx->txrx_stats.rx_bytes = peer_info->rx_bytes; - ap_ctx->txrx_stats.tx_retries = peer_info->tx_retries; - ap_ctx->txrx_stats.tx_failed = peer_info->tx_failed; - ap_ctx->txrx_stats.rssi = - peer_info->rssi + WLAN_HDD_TGT_NOISE_FLOOR_DBM; - wlan_hdd_fill_rate_info(ap_ctx, peer_info); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request"); + return; + } - get_peer_info_context->magic = 0; + priv = hdd_request_priv(request); - /* notify the caller */ - complete(&get_peer_info_context->completion); + priv->peer_sta_ext_info.sta_num = sta_num; + qdf_mem_copy(&priv->peer_sta_ext_info.info, + sta_info->info, + sta_num * sizeof(sta_info->info[0])); - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } /** @@ -3880,54 +3859,77 @@ static int wlan_hdd_get_peer_info(hdd_adapter_t *adapter, struct qdf_mac_addr macaddress) { QDF_STATUS status; + void *cookie; int ret; - static struct statsContext context; + hdd_ap_ctx_t *ap_ctx = NULL; struct sir_peer_info_ext_req peer_info_req; + struct hdd_request *request; + struct peer_info_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; - if (adapter == NULL) { - hdd_err("pAdapter is NULL"); + if (!adapter) { + hdd_err("adapter is NULL"); return -EFAULT; } - init_completion(&context.completion); - context.magic = PEER_INFO_CONTEXT_MAGIC; - context.pAdapter = adapter; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } - qdf_mem_copy(&(peer_info_req.peer_macaddr), &macaddress, - QDF_MAC_ADDR_SIZE); + cookie = hdd_request_cookie(request); + priv = hdd_request_priv(request); + + qdf_mem_copy(&peer_info_req.peer_macaddr, &macaddress, + QDF_MAC_ADDR_SIZE); peer_info_req.sessionid = adapter->sessionId; peer_info_req.reset_after_request = 0; status = sme_get_peer_info_ext(WLAN_HDD_GET_HAL_CTX(adapter), - &peer_info_req, - &context, - wlan_hdd_get_peer_info_cb); + &peer_info_req, + cookie, + wlan_hdd_get_peer_info_cb); if (status != QDF_STATUS_SUCCESS) { hdd_err("Unable to retrieve statistics for peer info"); ret = -EFAULT; } else { - if (!wait_for_completion_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS))) { + ret = hdd_request_wait_for_response(request); + if (ret) { hdd_err("SME timed out while retrieving peer info"); ret = -EFAULT; - } else + } else { + /* only support one peer by now */ + ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter); + qdf_mem_zero(&ap_ctx->txrx_stats, + sizeof(struct hdd_fw_txrx_stats)); + + ap_ctx->txrx_stats.tx_packets = + priv->peer_sta_ext_info.info[0].tx_packets; + ap_ctx->txrx_stats.tx_bytes = + priv->peer_sta_ext_info.info[0].tx_bytes; + ap_ctx->txrx_stats.rx_packets = + priv->peer_sta_ext_info.info[0].rx_packets; + ap_ctx->txrx_stats.rx_bytes = + priv->peer_sta_ext_info.info[0].rx_bytes; + ap_ctx->txrx_stats.tx_retries = + priv->peer_sta_ext_info.info[0].tx_retries; + ap_ctx->txrx_stats.tx_failed = + priv->peer_sta_ext_info.info[0].tx_failed; + ap_ctx->txrx_stats.rssi = + priv->peer_sta_ext_info.info[0].rssi + + WLAN_HDD_TGT_NOISE_FLOOR_DBM; + wlan_hdd_fill_rate_info(ap_ctx, + &priv->peer_sta_ext_info.info[0]); ret = 0; + + } } - /* - * either we never sent a request, we sent a request and received a - * response or we sent a request and timed out. if we never sent a - * request or if we sent a request and got a response, we want to - * clear the magic out of paranoia. if we timed out there is a - * race condition such that the callback function could be - * executing at the same time we are. of primary concern is if the - * callback function had already verified the "magic" but had not - * yet set the completion variable when a timeout occurred. we - * serialize these activities by invalidating the magic while - * holding a shared spinlock which will cause us to block if the - * callback is currently executing - */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + + hdd_request_put(request); + return ret; } @@ -4089,18 +4091,17 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, wlan_hdd_get_station_stats(pAdapter); - if (pAdapter->hdd_stats.summary_stat.rssi) - pAdapter->rssi = pAdapter->hdd_stats.summary_stat.rssi; + pAdapter->rssi = pAdapter->hdd_stats.summary_stat.rssi; + snr = pAdapter->hdd_stats.summary_stat.snr; /* for new connection there might be no valid previous RSSI */ if (!pAdapter->rssi) { hdd_get_rssi_snr_by_bssid(pAdapter, pHddStaCtx->conn_info.bssId.bytes, - &pAdapter->rssi, NULL); + &pAdapter->rssi, &snr); } sinfo->signal = pAdapter->rssi; - snr = pAdapter->hdd_stats.summary_stat.snr; hdd_debug("snr: %d, rssi: %d", pAdapter->hdd_stats.summary_stat.snr, pAdapter->hdd_stats.summary_stat.rssi); @@ -4944,59 +4945,37 @@ static bool hdd_is_rcpi_applicable(hdd_adapter_t *adapter, /** * wlan_hdd_get_rcpi_cb() - callback function for rcpi response - * @context: Pointer to rcpi context - * @rcpi_req: Pointer to rcpi response + * @context: used to refer cookie in hdd request manager + * @mac_addr: destination mac address for which RCPI is computed + * @rcpi: RCPI value from firmware + * @status: status of RCPI computation * * Return: None */ static void wlan_hdd_get_rcpi_cb(void *context, struct qdf_mac_addr mac_addr, int32_t rcpi, QDF_STATUS status) { - hdd_adapter_t *adapter; - struct statsContext *rcpi_context; + struct hdd_request *request; + struct rcpi_info *priv; - if (!context) { - hdd_err("No rcpi context"); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete RCPI request"); return; } - rcpi_context = context; - adapter = rcpi_context->pAdapter; - if (adapter->magic != WLAN_HDD_ADAPTER_MAGIC) { - hdd_err("Invalid adapter magic"); - return; - } + priv = hdd_request_priv(request); + priv->mac_addr = mac_addr; - /* - * there is a race condition that exists between this callback - * function and the caller since the caller could time out - * either before or while this code is executing. we use a - * spinlock to serialize these actions - */ - spin_lock(&hdd_context_lock); - if (rcpi_context->magic != RCPI_CONTEXT_MAGIC) { - /* - * the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid RCPI context magic"); - return; + if (!QDF_IS_STATUS_SUCCESS(status)) { + priv->rcpi = 0; + hdd_err("Error in computing RCPI"); + } else { + priv->rcpi = rcpi; } - rcpi_context->magic = 0; - adapter->rcpi.mac_addr = mac_addr; - if (status != QDF_STATUS_SUCCESS) - /* peer rcpi is not available for requested mac addr */ - adapter->rcpi.rcpi = 0; - else - adapter->rcpi.rcpi = rcpi; - - /* notify the caller */ - complete(&rcpi_context->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } /** @@ -5014,12 +4993,17 @@ static int __wlan_hdd_get_rcpi(hdd_adapter_t *adapter, enum rcpi_measurement_type measurement_type) { hdd_context_t *hdd_ctx; - static struct statsContext rcpi_context; - int status = 0; - unsigned long rc; + int status = 0, ret = 0; struct qdf_mac_addr mac_addr; QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; struct sme_rcpi_req *rcpi_req; + void *cookie; + struct rcpi_info *priv; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_RCPI, + }; bool reassoc; ENTER(); @@ -5065,48 +5049,52 @@ static int __wlan_hdd_get_rcpi(hdd_adapter_t *adapter, return -EINVAL; } - init_completion(&rcpi_context.completion); - rcpi_context.pAdapter = adapter; - rcpi_context.magic = RCPI_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + qdf_mem_free(rcpi_req); + return -ENOMEM; + } + cookie = hdd_request_cookie(request); rcpi_req->mac_addr = mac_addr; rcpi_req->session_id = adapter->sessionId; rcpi_req->measurement_type = measurement_type; rcpi_req->rcpi_callback = wlan_hdd_get_rcpi_cb; - rcpi_req->rcpi_context = &rcpi_context; + rcpi_req->rcpi_context = cookie; qdf_status = sme_get_rcpi(hdd_ctx->hHal, rcpi_req); - if (qdf_status != QDF_STATUS_SUCCESS) { + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_err("Unable to retrieve RCPI"); status = qdf_status_to_os_return(qdf_status); - } else { - /* request was sent -- wait for the response */ - rc = wait_for_completion_timeout(&rcpi_context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_RCPI)); - if (!rc) { - hdd_err("SME timed out while retrieving RCPI"); - status = -EINVAL; - } + goto out; } - qdf_mem_free(rcpi_req); - spin_lock(&hdd_context_lock); - rcpi_context.magic = 0; - spin_unlock(&hdd_context_lock); + /* request was sent -- wait for the response */ + ret = hdd_request_wait_for_response(request); + if (ret) { + hdd_err("SME timed out while retrieving RCPI"); + status = -EINVAL; + goto out; + } - if (status) { - hdd_err("rcpi computation is failed"); - } else { - if (qdf_mem_cmp(&mac_addr, &adapter->rcpi.mac_addr, - sizeof(mac_addr))) { - hdd_err("mac addr is not matching from call-back"); - status = -EINVAL; - } else { - *rcpi_value = adapter->rcpi.rcpi; - hdd_debug("RCPI = %d", *rcpi_value); - } + /* update the adapter with the fresh results */ + priv = hdd_request_priv(request); + adapter->rcpi.mac_addr = priv->mac_addr; + adapter->rcpi.rcpi = priv->rcpi; + + if (qdf_mem_cmp(&mac_addr, &priv->mac_addr, sizeof(mac_addr))) { + hdd_err("mis match of mac addr from call-back"); + status = -EINVAL; + goto out; } + *rcpi_value = adapter->rcpi.rcpi; + hdd_debug("RCPI = %d", *rcpi_value); +out: + qdf_mem_free(rcpi_req); + hdd_request_put(request); + EXIT(); return status; } diff --git a/core/hdd/src/wlan_hdd_stats.h b/core/hdd/src/wlan_hdd_stats.h index 06ede453e39c..45d805fdf48f 100644 --- a/core/hdd/src/wlan_hdd_stats.h +++ b/core/hdd/src/wlan_hdd_stats.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_subnet_detect.c b/core/hdd/src/wlan_hdd_subnet_detect.c index 05c627c02459..3098c1589117 100644 --- a/core/hdd/src/wlan_hdd_subnet_detect.c +++ b/core/hdd/src/wlan_hdd_subnet_detect.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/hdd/src/wlan_hdd_subnet_detect.h b/core/hdd/src/wlan_hdd_subnet_detect.h index ffab910884cb..2d832009bdc1 100644 --- a/core/hdd/src/wlan_hdd_subnet_detect.h +++ b/core/hdd/src/wlan_hdd_subnet_detect.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WLAN_HDD_SUBNET_DETECT_H #define __WLAN_HDD_SUBNET_DETECT_H diff --git a/core/hdd/src/wlan_hdd_sysfs.c b/core/hdd/src/wlan_hdd_sysfs.c index 1fddae5a24bd..564a947d4fe4 100644 --- a/core/hdd/src/wlan_hdd_sysfs.c +++ b/core/hdd/src/wlan_hdd_sysfs.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * 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 @@ -70,7 +67,6 @@ static ssize_t __show_fw_version(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { - const char *hw_version; uint32_t major_spid = 0, minor_spid = 0, siid = 0, crmid = 0; uint32_t sub_id = 0; hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); @@ -84,12 +80,16 @@ static ssize_t __show_fw_version(struct kobject *kobj, hdd_get_fw_version(hdd_ctx, &major_spid, &minor_spid, &siid, &crmid); sub_id = (hdd_ctx->target_fw_vers_ext & 0xf0000000) >> 28; - hw_version = hdd_ctx->target_hw_name; return scnprintf(buf, PAGE_SIZE, - "FW:%d.%d.%d.%d.%d HW:%s", major_spid, - minor_spid, siid, crmid, sub_id, - hw_version); + "FW:%d.%d.%d.%d.%d HW:%s Board version: %x Ref design id: %x Customer id: %x Project id: %x Board Data Rev: %x\n", + major_spid, minor_spid, siid, crmid, sub_id, + hdd_ctx->target_hw_name, + hdd_ctx->hw_bd_info.bdf_version, + hdd_ctx->hw_bd_info.ref_design_id, + hdd_ctx->hw_bd_info.customer_id, + hdd_ctx->hw_bd_info.project_id, + hdd_ctx->hw_bd_info.board_data_rev); } static ssize_t show_fw_version(struct kobject *kobj, diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index b4e2afa467db..351936082194 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_tdls.c * @@ -525,7 +516,7 @@ static void dump_tdls_state_param_setting(tdlsInfo_t *info) if (!info) return; - hdd_debug("Setting tdls state and param in fw: vdev_id: %d, tdls_state: %d, notification_interval_ms: %d, tx_discovery_threshold: %d, tx_teardown_threshold: %d, rssi_teardown_threshold: %d, rssi_delta: %d, tdls_options: 0x%x, peer_traffic_ind_window: %d, peer_traffic_response_timeout: %d, puapsd_mask: 0x%x, puapsd_inactivity_time: %d, puapsd_rx_frame_threshold: %d, teardown_notification_ms: %d, tdls_peer_kickout_threshold: %d", + hdd_debug("Setting tdls state and param in fw: vdev_id: %d, tdls_state: %d, notification_interval_ms: %d, tx_discovery_threshold: %d, tx_teardown_threshold: %d, rssi_teardown_threshold: %d, rssi_delta: %d, tdls_options: 0x%x, peer_traffic_ind_window: %d, peer_traffic_response_timeout: %d, puapsd_mask: 0x%x, puapsd_inactivity_time: %d, puapsd_rx_frame_threshold: %d, teardown_notification_ms: %d, tdls_peer_kickout_threshold: %d, tdls_discovery_wake_timeout: %d", info->vdev_id, info->tdls_state, info->notification_interval_ms, @@ -540,7 +531,8 @@ static void dump_tdls_state_param_setting(tdlsInfo_t *info) info->puapsd_inactivity_time, info->puapsd_rx_frame_threshold, info->teardown_notification_ms, - info->tdls_peer_kickout_threshold); + info->tdls_peer_kickout_threshold, + info->tdls_discovery_wake_timeout); } @@ -662,6 +654,12 @@ static void wlan_hdd_tdls_del_non_forced_peers(tdlsCtx_t *hdd_tdls_ctx) list_for_each_safe(pos, q, head) { peer = list_entry(pos, hddTdlsPeer_t, node); if (false == peer->isForcedPeer) { + if (peer->is_peer_idle_timer_initialised) { + hdd_debug(MAC_ADDRESS_STR ": destroy idle timer", + MAC_ADDR_ARRAY(peer->peerMac)); + qdf_mc_timer_destroy( + &peer->peer_idle_timer); + } list_del(pos); qdf_mem_free(peer); } else { @@ -1710,11 +1708,17 @@ static void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, switch (tdls_mode) { /* TDLS is already enabled hence clear source mask, return */ case eTDLS_SUPPORT_ENABLED: - case eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: case eTDLS_SUPPORT_EXTERNAL_CONTROL: clear_bit((unsigned long)source, &pHddCtx->tdls_source_bitmap); - hdd_debug("clear source mask:%d", source); + hdd_debug("clear source mask:%d tdls mode %d", + source, tdls_mode); + break; + case eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: + clear_bit((unsigned long)source, + &pHddCtx->tdls_source_bitmap); + hdd_debug("clear source mask:%d tdls mode %d", + source, tdls_mode); return; /* TDLS is already disabled hence set source mask, return */ case eTDLS_SUPPORT_DISABLED: @@ -1725,6 +1729,24 @@ static void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, default: return; } + + status = hdd_get_front_adapter(pHddCtx, &pAdapterNode); + while (pAdapterNode != NULL && status == QDF_STATUS_SUCCESS) { + pAdapter = pAdapterNode->pAdapter; + pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + if (pHddTdlsCtx != NULL && + !pHddCtx->tdls_source_bitmap && + (qdf_mc_timer_get_current_state(&pHddTdlsCtx-> + peer_update_timer) == QDF_TIMER_STATE_STOPPED)) { + hdd_debug("Start timer again,source bitmap:%lu", + pHddCtx->tdls_source_bitmap); + wlan_hdd_tdls_implicit_enable(pHddTdlsCtx); + } + status = hdd_get_next_adapter(pHddCtx, + pAdapterNode, &pNext); + pAdapterNode = pNext; + } + return; } status = hdd_get_front_adapter(pHddCtx, &pAdapterNode); @@ -1757,7 +1779,8 @@ static void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, = true; if (tdls_mode == eTDLS_SUPPORT_EXTERNAL_CONTROL - && !pHddCtx->tdls_external_peer_count) { + && !pHddCtx->tdls_external_peer_count + && !pHddCtx->connected_peer_count) { /* Disable connection tracker if tdls * mode is external and no force peers * were configured by application. @@ -1901,6 +1924,8 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, pHddCtx->config->tdls_idle_timeout; tdlsParams->tdls_peer_kickout_threshold = pHddCtx->config->tdls_peer_kickout_threshold; + tdlsParams->tdls_discovery_wake_timeout = + pHddCtx->config->tdls_discovery_wake_timeout; dump_tdls_state_param_setting(tdlsParams); @@ -2043,6 +2068,8 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, hdd_ctx->config->tdls_idle_timeout; tdls_param->tdls_peer_kickout_threshold = hdd_ctx->config->tdls_peer_kickout_threshold; + tdls_param->tdls_discovery_wake_timeout = + hdd_ctx->config->tdls_discovery_wake_timeout; dump_tdls_state_param_setting(tdls_param); @@ -4712,7 +4739,8 @@ int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter, cds_set_tdls_ct_mode(pHddCtx); mutex_lock(&pHddCtx->tdls_lock); - if (pHddCtx->enable_tdls_connection_tracker) + if (pHddCtx->enable_tdls_connection_tracker && + (!wlan_hdd_tdls_connected_peers(pAdapter))) wlan_hdd_tdls_implicit_disable(tdls_ctx); mutex_unlock(&pHddCtx->tdls_lock); @@ -4749,6 +4777,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, uint16_t peer_staid; uint8_t peer_offchannelsupp; int ret; + tdlsCtx_t *tdls_ctx; ENTER(); @@ -4777,10 +4806,16 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, pAdapter->sessionId, oper)); status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) return status; + tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + if (!tdls_ctx) { + QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, + "%s: Invalid tdls context", __func__); + return -EINVAL; + } + /* QCA 2.0 Discrete ANDs feature capability in HDD config with that * received from target, so HDD config gives combined intersected result */ @@ -5080,6 +5115,21 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, hdd_wlan_tdls_enable_link_event(peer, peer_offchannelsupp, 0, 0); + /* In external control mode, if external peer is not configured + * then enabling link without connection tracker running + * will act as explicit mode. Teardown will not happen unless + * teardown frame is received. + * Enable connection tracker for external mode, if connected + * peer present. + */ + if (pHddCtx->config->fTDLSExternalControl && + (!pHddCtx->tdls_external_peer_count)) { + mutex_lock(&pHddCtx->tdls_lock); + pHddCtx->enable_tdls_connection_tracker = true; + if (wlan_hdd_tdls_connected_peers(pAdapter) == 1) + wlan_hdd_tdls_implicit_enable(tdls_ctx); + mutex_unlock(&pHddCtx->tdls_lock); + } } break; case NL80211_TDLS_DISABLE_LINK: @@ -5157,6 +5207,18 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, "%s: TDLS Peer Station doesn't exist.", __func__); } + /* Disable the connection tracker for external control mode + * If no force and connected peer present. + */ + if (pHddCtx->config->fTDLSExternalControl && + (!pHddCtx->tdls_external_peer_count)) { + mutex_lock(&pHddCtx->tdls_lock); + if (!wlan_hdd_tdls_connected_peers(pAdapter)) { + wlan_hdd_tdls_implicit_disable(tdls_ctx); + pHddCtx->enable_tdls_connection_tracker = false; + } + mutex_unlock(&pHddCtx->tdls_lock); + } } break; case NL80211_TDLS_TEARDOWN: diff --git a/core/hdd/src/wlan_hdd_trace.c b/core/hdd/src/wlan_hdd_trace.c index 2c5cda6f8a95..22a2438499f6 100644 --- a/core/hdd/src/wlan_hdd_trace.c +++ b/core/hdd/src/wlan_hdd_trace.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifdef HDD_TRACE_RECORD /** diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index 5bacd90cf155..9287be13760a 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * wlan_hdd_tsf.c - WLAN Host Device Driver tsf related implementation */ @@ -282,9 +273,6 @@ static enum hdd_tsf_op_result hdd_indicate_tsf_internal( */ #define WLAN_HDD_CAPTURE_TSF_INTERVAL_SEC 10 #define WLAN_HDD_CAPTURE_TSF_INIT_INTERVAL_MS 100 -#define NORMAL_INTERVAL_TARGET \ - ((int64_t)((int64_t)WLAN_HDD_CAPTURE_TSF_INTERVAL_SEC * \ - NSEC_PER_SEC / HOST_TO_TARGET_TIME_RATIO)) #define OVERFLOW_INDICATOR32 (((int64_t)0x1) << 32) #define CAP_TSF_TIMER_FIX_SEC 1 @@ -553,6 +541,7 @@ static inline int32_t hdd_get_hosttime_from_targettime( int32_t ret = -EINVAL; int64_t delta32_target; bool in_cap_state; + int64_t normal_interval_target; in_cap_state = hdd_tsf_is_in_cap(adapter); @@ -567,11 +556,15 @@ static inline int32_t hdd_get_hosttime_from_targettime( delta32_target = (int64_t)((target_time & U32_MAX) - (adapter->last_target_time & U32_MAX)); + normal_interval_target = + qdf_do_div(WLAN_HDD_CAPTURE_TSF_INTERVAL_SEC * + NSEC_PER_SEC, HOST_TO_TARGET_TIME_RATIO); + if (delta32_target < - (NORMAL_INTERVAL_TARGET - OVERFLOW_INDICATOR32)) + (normal_interval_target - OVERFLOW_INDICATOR32)) delta32_target += OVERFLOW_INDICATOR32; else if (delta32_target > - (OVERFLOW_INDICATOR32 - NORMAL_INTERVAL_TARGET)) + (OVERFLOW_INDICATOR32 - normal_interval_target)) delta32_target -= OVERFLOW_INDICATOR32; ret = hdd_64bit_plus(adapter->last_host_time, diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 4a29abd36e83..b07a7aaec412 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_tx_rx.c * @@ -588,15 +579,13 @@ void hdd_tx_rx_collect_connectivity_stats_info(struct sk_buff *skb, uint8_t *pkt_type) { uint32_t pkt_type_bitmap; + int errno; hdd_adapter_t *adapter = NULL; adapter = (hdd_adapter_t *)context; - if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) { - QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR, - "Magic cookie(%x) for adapter sanity verification is invalid", - adapter->magic); + errno = hdd_validate_adapter(adapter); + if (errno) return; - } /* ARP tracking is done already. */ pkt_type_bitmap = adapter->pkt_type_bitmap; @@ -827,7 +816,12 @@ static inline bool hdd_is_tx_allowed(struct sk_buff *skb, uint8_t peer_id) void *pdev = cds_get_context(QDF_MODULE_ID_TXRX); void *peer; - QDF_ASSERT(pdev); + if (qdf_unlikely(NULL == pdev)) { + QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR, + "%s: pdev is NULL", __func__); + QDF_ASSERT(pdev); + return false; + } peer = ol_txrx_peer_find_by_local_id(pdev, peer_id); if (peer == NULL) { @@ -1055,6 +1049,16 @@ static netdev_tx_t __hdd_hard_start_xmit(struct sk_buff *skb, goto drop_pkt_and_release_skb; } + /* check whether need to linearize skb, like non-linear udp data */ + if (hdd_skb_nontso_linearize(skb) != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_HDD_DATA, + QDF_TRACE_LEVEL_INFO_HIGH, + "%s: skb %pK linearize failed. drop the pkt", + __func__, skb); + ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac]; + goto drop_pkt_and_release_skb; + } + /* * If a transmit function is not registered, drop packet */ @@ -1084,9 +1088,15 @@ drop_pkt_and_release_skb: drop_pkt: if (skb) { + /* track connectivity stats */ + if (pAdapter->pkt_type_bitmap) + hdd_tx_rx_collect_connectivity_stats_info(skb, pAdapter, + PKT_TYPE_TX_DROPPED, &pkt_type); + qdf_dp_trace_data_pkt(skb, QDF_DP_TRACE_DROP_PACKET_RECORD, 0, QDF_TX); kfree_skb(skb); + skb = NULL; } drop_pkt_accounting: @@ -1099,11 +1109,6 @@ drop_pkt_accounting: "%s : ARP packet dropped", __func__); } - /* track connectivity stats */ - if (pAdapter->pkt_type_bitmap) - hdd_tx_rx_collect_connectivity_stats_info(skb, pAdapter, - PKT_TYPE_TX_DROPPED, &pkt_type); - return NETDEV_TX_OK; } diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index f987db26b0ed..2d9ded6dd24f 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_hdd_wext.c * @@ -52,6 +43,7 @@ #include <wlan_hdd_wmm.h> #include "utils_api.h" #include "wlan_hdd_p2p.h" +#include "wlan_hdd_request_manager.h" #ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" #endif @@ -94,10 +86,12 @@ #include "wlan_hdd_lro.h" #include "cds_utils.h" #include "wlan_hdd_packet_filter_api.h" +#include "wlan_hdd_request_manager.h" #define HDD_FINISH_ULA_TIME_OUT 800 #define HDD_SET_MCBC_FILTERS_TO_FW 1 #define HDD_DELETE_MCBC_FILTERS_FROM_FW 0 +#define HDD_UT_SUSPEND_RESUME_LOG_RL (1024) /* To Validate Channel against the Frequency and Vice-Versa */ static const struct ccp_freq_chan_map freq_chan_map[] = { @@ -611,25 +605,7 @@ static const struct ccp_freq_chan_map freq_chan_map[] = { * </ioctl> */ #define WE_PPS_RSSI_CHECK 53 -/* - * <ioctl> - * setAutoChannel - set ACS enable/disable - * - * @INPUT: None - * - * @OUTPUT: None - * - * This IOCTL is used to set SAP ACS eanble/disable - * - * @E.g: iwpriv wlan0 setAutoChannel 0 - * - * Supported Feature: SAP - * - * Usage: Internal/External - * - * </ioctl> - */ -#define WE_SET_SAP_AUTO_CHANNEL_SELECTION 54 + /* * <ioctl> * htsmps - Sets the htsmps @@ -1071,11 +1047,8 @@ static const struct ccp_freq_chan_map freq_chan_map[] = { /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) #define WE_GET_11D_STATE 1 -#define WE_SET_SAP_CHANNELS 3 #define WE_GET_WLAN_DBG 4 #define WE_GET_MAX_ASSOC 6 -/* 7 is unused */ -#define WE_GET_SAP_AUTO_CHANNEL_SELECTION 8 /* * <ioctl> @@ -1780,7 +1753,6 @@ static const struct ccp_freq_chan_map freq_chan_map[] = { #define WLAN_PRIV_SET_THREE_INT_GET_NONE (SIOCIWFIRSTPRIV + 4) #define WE_SET_WLAN_DBG 1 #define WE_SET_DP_TRACE 2 -#define WE_SET_SAP_CHANNELS 3 #define WE_SET_FW_TEST 4 /* Private ioctls and their sub-ioctls */ @@ -3070,6 +3042,7 @@ int hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value) break; case WLAN_LRO_STATS: hdd_lro_display_stats(hdd_ctx); + break; case WLAN_NAPI_STATS: if (hdd_display_napi_stats()) { hdd_err("error displaying napi stats"); @@ -3093,60 +3066,6 @@ int hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value) } /** - * hdd_wlan_get_version() - Get driver version information - * @hdd_ctx: Global HDD context - * @wrqu: Pointer to IOCTL REQUEST Data. - * @extra: Pointer to destination buffer - * - * This function is used to get Wlan Driver, Firmware, & Hardware - * Version information. If @wrqu and @extra are specified, then the - * version string is returned. Otherwise it is simply printed to the - * kernel log. - * - * Return: none - */ -void hdd_wlan_get_version(hdd_context_t *hdd_ctx, union iwreq_data *wrqu, - char *extra) -{ - tSirVersionString wcnss_sw_version; - const char *swversion; - const char *hwversion; - uint32_t msp_id = 0, mspid = 0, siid = 0, crmid = 0, sub_id = 0; - - if (!hdd_ctx) { - hdd_err("Invalid context, HDD context is null"); - goto error; - } - - snprintf(wcnss_sw_version, sizeof(wcnss_sw_version), "%08x", - hdd_ctx->target_fw_version); - - swversion = wcnss_sw_version; - msp_id = (hdd_ctx->target_fw_version & 0xf0000000) >> 28; - mspid = (hdd_ctx->target_fw_version & 0xf000000) >> 24; - siid = (hdd_ctx->target_fw_version & 0xf00000) >> 20; - crmid = hdd_ctx->target_fw_version & 0x7fff; - sub_id = (hdd_ctx->target_fw_vers_ext & 0xf0000000) >> 28; - - hwversion = hdd_ctx->target_hw_name; - - if (wrqu && extra) { - wrqu->data.length = - scnprintf(extra, WE_MAX_STR_LEN, - "Host SW:%s, FW:%d.%d.%d.%d.%d, HW:%s", - QWLAN_VERSIONSTR, - msp_id, mspid, siid, crmid, - sub_id, hwversion); - } else { - pr_info("Host SW:%s, FW:%d.%d.%d.%d.%d, HW:%s\n", - QWLAN_VERSIONSTR, - msp_id, mspid, siid, crmid, sub_id, hwversion); - } -error: - return; -} - -/** * hdd_wlan_get_ibss_mac_addr_from_staid() - Get IBSS MAC address * @pAdapter: Adapter upon which the IBSS client is active * @staIdx: Station index of the IBSS peer @@ -3449,131 +3368,37 @@ static bool hdd_is_auth_type_rsn(eCsrAuthType authType) return rsnType; } +struct rssi_priv { + int8_t rssi; +}; + /** * hdd_get_rssi_cb() - "Get RSSI" callback function * @rssi: Current RSSI of the station - * @staId: ID of the station - * @pContext: opaque context originally passed to SME. HDD always passes + * @sta_id: ID of the station + * @context: opaque context originally passed to SME. HDD always passes * a &struct statsContext * * Return: None */ -static void hdd_get_rssi_cb(int8_t rssi, uint32_t staId, void *pContext) +static void hdd_get_rssi_cb(int8_t rssi, uint32_t sta_id, void *context) { - struct statsContext *pStatsContext; - hdd_adapter_t *pAdapter; - hdd_station_ctx_t *pHddStaCtx; - - if (NULL == pContext) { - hdd_err("Bad param"); - return; - } + struct hdd_request *request; + struct rssi_priv *priv; - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; + hdd_info("%s: rssi [%d] sta_id [%d] context [%pK]\n", + __func__, (int)rssi, (int)sta_id, context); - if (!pAdapter) { - hdd_err("Invalid pAdapter"); + request = hdd_request_get(context); + if (!request) { + hdd_err("%s: Obsolete request", __func__); return; } - pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - - /* update rssi only if its valid else return previous valid rssi */ - if (rssi) - pAdapter->rssi = rssi; - - /* for new connection there might be no valid previous RSSI - * Do not keep hdd_get_rssi_snr_by_bssid under spin_lock - * because it accesses scan cache in pMac which is mutex - * protected - */ - if (!pAdapter->rssi) - hdd_get_rssi_snr_by_bssid(pAdapter, - pHddStaCtx->conn_info.bssId.bytes, - &pAdapter->rssi, NULL); - - - /* there is a race condition that exists between this callback - * function and the caller since the caller could time out - * either before or while this code is executing. we use a - * spinlock to serialize these actions - */ - spin_lock(&hdd_context_lock); - - if (pStatsContext->magic != PEER_INFO_CONTEXT_MAGIC) { - /* the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, magic [%08x]", - pStatsContext->magic); - return; - } - - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; - /* notify the caller */ - complete(&pStatsContext->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); -} - -/** - * hdd_get_snr_cb() - "Get SNR" callback function - * @snr: Current SNR of the station - * @staId: ID of the station - * @pContext: opaque context originally passed to SME. HDD always passes - * a &struct statsContext - * - * Return: None - */ -static void hdd_get_snr_cb(int8_t snr, uint32_t staId, void *pContext) -{ - struct statsContext *pStatsContext; - hdd_adapter_t *pAdapter; - - if (NULL == pContext) { - hdd_err("Bad param"); - return; - } - - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - - /* there is a race condition that exists between this callback - * function and the caller since the caller could time out - * either before or while this code is executing. we use a - * spinlock to serialize these actions - */ - spin_lock(&hdd_context_lock); - - if ((NULL == pAdapter) || (SNR_CONTEXT_MAGIC != pStatsContext->magic)) { - /* the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, pAdapter [%pK] magic [%08x]", - pAdapter, pStatsContext->magic); - return; - } - - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; - - /* copy over the snr */ - pAdapter->snr = snr; - - /* notify the caller */ - complete(&pStatsContext->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + priv = hdd_request_priv(request); + priv->rssi = rssi; + hdd_request_complete(request); + hdd_request_put(request); } /** @@ -3585,11 +3410,17 @@ static void hdd_get_snr_cb(int8_t snr, uint32_t staId, void *pContext) */ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value) { - static struct statsContext context; hdd_context_t *pHddCtx; hdd_station_ctx_t *pHddStaCtx; QDF_STATUS hstatus; - unsigned long rc; + int ret; + void *cookie; + struct hdd_request *request; + struct rssi_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { hdd_err("Invalid context, pAdapter"); @@ -3619,44 +3450,52 @@ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value) return QDF_STATUS_SUCCESS; } - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = PEER_INFO_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("%s: Request allocation failure, return cached RSSI", + __func__); + *rssi_value = pAdapter->rssi; + return QDF_STATUS_SUCCESS; + } + cookie = hdd_request_cookie(request); hstatus = sme_get_rssi(pHddCtx->hHal, hdd_get_rssi_cb, pHddStaCtx->conn_info.staId[0], pHddStaCtx->conn_info.bssId, pAdapter->rssi, - &context, pHddCtx->pcds_context); + cookie, pHddCtx->pcds_context); if (QDF_STATUS_SUCCESS != hstatus) { hdd_err("Unable to retrieve RSSI"); /* we'll returned a cached value below */ } else { /* request was sent -- wait for the response */ - rc = wait_for_completion_timeout(&context.completion, - msecs_to_jiffies - (WLAN_WAIT_TIME_STATS)); - if (!rc) { - hdd_err("SME timed out while retrieving RSSI"); - /* we'll now returned a cached value below */ + ret = hdd_request_wait_for_response(request); + if (ret) { + hdd_warn("SME timed out while retrieving RSSI"); + /* we'll returned a cached value below */ + } else { + /* update the adapter with the fresh results */ + priv = hdd_request_priv(request); + + pAdapter->rssi = priv->rssi; + + /* + * for new connection there might be no valid previous + * RSSI. + */ + if (!pAdapter->rssi) { + hdd_get_rssi_snr_by_bssid(pAdapter, + pHddStaCtx->conn_info.bssId.bytes, + &pAdapter->rssi, NULL); + } } } - /* either we never sent a request, we sent a request and - * received a response or we sent a request and timed out. if - * we never sent a request or if we sent a request and got a - * response, we want to clear the magic out of paranoia. if - * we timed out there is a race condition such that the - * callback function could be executing at the same time we - * are. of primary concern is if the callback function had - * already verified the "magic" but had not yet set the - * completion variable when a timeout occurred. we serialize - * these activities by invalidating the magic while holding a - * shared spinlock which will cause us to block if the - * callback is currently executing + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * regardless we are done with the request. */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(request); *rssi_value = pAdapter->rssi; hdd_debug("RSSI = %d", *rssi_value); @@ -3664,6 +3503,40 @@ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value) return QDF_STATUS_SUCCESS; } +struct snr_priv { + int8_t snr; +}; + +/** + * hdd_get_snr_cb() - "Get SNR" callback function + * @snr: Current SNR of the station + * @sta_id: ID of the station + * @context: opaque context originally passed to SME. HDD always passes + * a cookie for the request context + * + * Return: None + */ +static void hdd_get_snr_cb(int8_t snr, uint32_t sta_id, void *context) +{ + struct hdd_request *request; + struct snr_priv *priv; + + hdd_info("%s: snr [%d] sta_id [%d] context [%pK]\n", + __func__, (int)snr, (int)sta_id, context); + + request = hdd_request_get(context); + if (!request) { + hdd_err("%s: Obsolete request", __func__); + return; + } + + /* propagate response back to requesting thread */ + priv = hdd_request_priv(request); + priv->snr = snr; + hdd_request_complete(request); + hdd_request_put(request); +} + /** * wlan_hdd_get_snr() - Get the current SNR * @pAdapter: adapter upon which the measurement is requested @@ -3673,12 +3546,18 @@ QDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value) */ QDF_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, int8_t *snr) { - static struct statsContext context; hdd_context_t *pHddCtx; hdd_station_ctx_t *pHddStaCtx; QDF_STATUS hstatus; - unsigned long rc; int valid; + int ret; + void *cookie; + struct hdd_request *request; + struct snr_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; ENTER(); @@ -3695,182 +3574,130 @@ QDF_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, int8_t *snr) pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = SNR_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("%s: Request allocation failure", __func__); + return QDF_STATUS_E_FAULT; + } + cookie = hdd_request_cookie(request); hstatus = sme_get_snr(pHddCtx->hHal, hdd_get_snr_cb, pHddStaCtx->conn_info.staId[0], - pHddStaCtx->conn_info.bssId, &context); + pHddStaCtx->conn_info.bssId, cookie); if (QDF_STATUS_SUCCESS != hstatus) { hdd_err("Unable to retrieve RSSI"); /* we'll returned a cached value below */ } else { /* request was sent -- wait for the response */ - rc = wait_for_completion_timeout(&context.completion, - msecs_to_jiffies - (WLAN_WAIT_TIME_STATS)); - if (!rc) { + ret = hdd_request_wait_for_response(request); + if (ret) { hdd_err("SME timed out while retrieving SNR"); /* we'll now returned a cached value below */ + } else { + /* update the adapter with the fresh results */ + priv = hdd_request_priv(request); + pAdapter->snr = priv->snr; } } - /* either we never sent a request, we sent a request and - * received a response or we sent a request and timed out. if - * we never sent a request or if we sent a request and got a - * response, we want to clear the magic out of paranoia. if - * we timed out there is a race condition such that the - * callback function could be executing at the same time we - * are. of primary concern is if the callback function had - * already verified the "magic" but had not yet set the - * completion variable when a timeout occurred. we serialize - * these activities by invalidating the magic while holding a - * shared spinlock which will cause us to block if the - * callback is currently executing + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * regardless we are done with the request. */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(request); *snr = pAdapter->snr; EXIT(); return QDF_STATUS_SUCCESS; } -/** - * hdd_get_link_speed_cb() - Get link speed callback function - * @pLinkSpeed: pointer to the link speed record - * @pContext: pointer to the user context passed to SME - * - * This function is passed as the callback function to - * sme_get_link_speed() by wlan_hdd_get_linkspeed_for_peermac(). By - * agreement a &struct linkspeedContext is passed as @pContext. If - * the context is valid, then the contents of @pLinkSpeed are copied - * into the adapter record referenced by @pContext where they can be - * subsequently retrieved. If the context is invalid, then this - * function does nothing since it is assumed the caller has already - * timed-out and destroyed the context. - * - * Return: None. - */ +struct linkspeed_priv { + tSirLinkSpeedInfo linkspeed_info; +}; + static void -hdd_get_link_speed_cb(tSirLinkSpeedInfo *pLinkSpeed, void *pContext) +hdd_get_link_speed_cb(tSirLinkSpeedInfo *linkspeed_info, void *context) { - struct linkspeedContext *pLinkSpeedContext; - hdd_adapter_t *pAdapter; + struct hdd_request *request; + struct linkspeed_priv *priv; - if ((NULL == pLinkSpeed) || (NULL == pContext)) { - hdd_err("Bad param, pLinkSpeed [%pK] pContext [%pK]", - pLinkSpeed, pContext); + if (!linkspeed_info) { + hdd_err("NULL linkspeed"); return; } - spin_lock(&hdd_context_lock); - pLinkSpeedContext = pContext; - pAdapter = pLinkSpeedContext->pAdapter; - - /* there is a race condition that exists between this callback - * function and the caller since the caller could time out either - * before or while this code is executing. we use a spinlock to - * serialize these actions - */ - if ((NULL == pAdapter) || - (LINK_CONTEXT_MAGIC != pLinkSpeedContext->magic)) { - /* the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, pAdapter [%pK] magic [%08x]", - pAdapter, pLinkSpeedContext->magic); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request"); return; } - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pLinkSpeedContext->magic = 0; - - /* copy over the stats. do so as a struct copy */ - pAdapter->ls_stats = *pLinkSpeed; - - /* notify the caller */ - complete(&pLinkSpeedContext->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + priv = hdd_request_priv(request); + priv->linkspeed_info = *linkspeed_info; + hdd_request_complete(request); + hdd_request_put(request); } -/** - * wlan_hdd_get_linkspeed_for_peermac() - Get link speed for a peer - * @pAdapter: adapter upon which the peer is active - * @macAddress: MAC address of the peer - * - * This function will send a query to SME for the linkspeed of the - * given peer, and then wait for the callback to be invoked. - * - * Return: Errno - */ -int wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *pAdapter, - struct qdf_mac_addr macAddress) +int wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *adapter, + struct qdf_mac_addr *mac_address, + uint32_t *linkspeed) { + int ret; QDF_STATUS status; - int errno; - unsigned long rc; - static struct linkspeedContext context; - tSirLinkSpeedInfo *linkspeed_req; - - if (NULL == pAdapter) { - hdd_err("pAdapter is NULL"); + void *cookie; + tSirLinkSpeedInfo *linkspeed_info; + struct hdd_request *request; + struct linkspeed_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; + + if ((!adapter) || (!linkspeed)) { + hdd_err("NULL argument"); return -EINVAL; } - linkspeed_req = qdf_mem_malloc(sizeof(*linkspeed_req)); - if (NULL == linkspeed_req) { - hdd_err("Request Buffer Alloc Fail"); - return -ENOMEM; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + ret = -ENOMEM; + goto return_cached_value; } - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = LINK_CONTEXT_MAGIC; + cookie = hdd_request_cookie(request); + priv = hdd_request_priv(request); - qdf_copy_macaddr(&linkspeed_req->peer_macaddr, &macAddress); - status = sme_get_link_speed(WLAN_HDD_GET_HAL_CTX(pAdapter), - linkspeed_req, - &context, hdd_get_link_speed_cb); - qdf_mem_free(linkspeed_req); - errno = qdf_status_to_os_return(status); - if (errno) { + linkspeed_info = &priv->linkspeed_info; + qdf_copy_macaddr(&linkspeed_info->peer_macaddr, mac_address); + status = sme_get_link_speed(WLAN_HDD_GET_HAL_CTX(adapter), + linkspeed_info, + cookie, hdd_get_link_speed_cb); + if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Unable to retrieve statistics for link speed"); - } else { - rc = wait_for_completion_timeout - (&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (!rc) { - hdd_err("SME timed out while retrieving link speed"); - errno = -ETIMEDOUT; - } - } - - /* either we never sent a request, we sent a request and - * received a response or we sent a request and timed out. if - * we never sent a request or if we sent a request and got a - * response, we want to clear the magic out of paranoia. if - * we timed out there is a race condition such that the - * callback function could be executing at the same time we - * are. of primary concern is if the callback function had - * already verified the "magic" but had not yet set the - * completion variable when a timeout occurred. we serialize - * these activities by invalidating the magic while holding a - * shared spinlock which will cause us to block if the - * callback is currently executing + ret = qdf_status_to_os_return(status); + goto cleanup; + } + ret = hdd_request_wait_for_response(request); + if (ret) { + hdd_err("SME timed out while retrieving link speed"); + goto cleanup; + } + adapter->estimated_linkspeed = linkspeed_info->estLinkSpeed; + +cleanup: + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * regardless we are done with the request. */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(request); + +return_cached_value: + *linkspeed = adapter->estimated_linkspeed; - return errno; + return ret; } /** @@ -3911,12 +3738,12 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed) qdf_copy_macaddr(&bssid, &hdd_stactx->conn_info.bssId); - errno = wlan_hdd_get_linkspeed_for_peermac(sta_adapter, bssid); + errno = wlan_hdd_get_linkspeed_for_peermac(sta_adapter, &bssid, + link_speed); if (errno) { hdd_err("Unable to retrieve SME linkspeed: %d", errno); return errno; } - *link_speed = sta_adapter->ls_stats.estLinkSpeed; /* linkspeed in units of 500 kbps */ *link_speed = (*link_speed) / 500; } @@ -3924,6 +3751,10 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed) return 0; } +struct peer_rssi_priv { + struct sir_peer_sta_info peer_sta_info; +}; + /** * hdd_get_peer_rssi_cb() - get peer station's rssi callback * @sta_rssi: pointer of peer information @@ -3936,121 +3767,94 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed) static void hdd_get_peer_rssi_cb(struct sir_peer_info_resp *sta_rssi, void *context) { - struct statsContext *get_rssi_context; + struct hdd_request *request; struct sir_peer_info *rssi_info; + struct peer_rssi_priv *priv; uint8_t peer_num; - hdd_adapter_t *padapter; - if ((sta_rssi == NULL) || (context == NULL)) { - hdd_err("Bad param, sta_rssi [%pK] context [%pK]", - sta_rssi, context); + if (sta_rssi == NULL) { + hdd_err("Bad param, sta_rssi [%pK]", sta_rssi); return; } - spin_lock(&hdd_context_lock); - /* - * there is a race condition that exists between this callback - * function and the caller since the caller could time out either - * before or while this code is executing. we use a spinlock to - * serialize these actions - */ - get_rssi_context = (struct statsContext *)context; - padapter = get_rssi_context->pAdapter; - if (get_rssi_context->magic != PEER_INFO_CONTEXT_MAGIC || - !padapter) { - /* - * the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, magic [%08x], adapter [%pK]", - get_rssi_context->magic, padapter); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request."); return; } + priv = hdd_request_priv(request); + peer_num = sta_rssi->count; rssi_info = sta_rssi->info; - get_rssi_context->magic = 0; hdd_debug("%d peers", peer_num); if (peer_num > MAX_PEER_STA) { - hdd_warn("Exceed max peer sta to handle one time %d", peer_num); + hdd_warn("Exceed max peer sta to handle one time %d", + peer_num); peer_num = MAX_PEER_STA; } - qdf_mem_copy(padapter->peer_sta_info.info, rssi_info, - peer_num * sizeof(*rssi_info)); - padapter->peer_sta_info.sta_num = peer_num; - - /* notify the caller */ - complete(&get_rssi_context->completion); + qdf_mem_copy(priv->peer_sta_info.info, rssi_info, + peer_num * sizeof(*rssi_info)); + priv->peer_sta_info.sta_num = peer_num; - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } int wlan_hdd_get_peer_rssi(hdd_adapter_t *adapter, - struct qdf_mac_addr *macaddress, - int request_source) + struct qdf_mac_addr *macaddress) { QDF_STATUS status; + void *cookie; int ret; - static struct statsContext context; struct sir_peer_info_req rssi_req; + struct hdd_request *request; + struct peer_rssi_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (!adapter || !macaddress) { - hdd_err("pAdapter [%pK], macaddress [%pK]", adapter, macaddress); + hdd_err("adapter [%pK], macaddress [%pK]", + adapter, macaddress); return -EFAULT; } - init_completion(&context.completion); - context.magic = PEER_INFO_CONTEXT_MAGIC; - context.pAdapter = adapter; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + + cookie = hdd_request_cookie(request); qdf_mem_copy(&(rssi_req.peer_macaddr), macaddress, - QDF_MAC_ADDR_SIZE); + QDF_MAC_ADDR_SIZE); rssi_req.sessionid = adapter->sessionId; status = sme_get_peer_info(WLAN_HDD_GET_HAL_CTX(adapter), - rssi_req, - &context, - hdd_get_peer_rssi_cb); + rssi_req, + cookie, + hdd_get_peer_rssi_cb); if (status != QDF_STATUS_SUCCESS) { hdd_err("Unable to retrieve statistics for rssi"); ret = -EFAULT; - } - - else if (request_source != HDD_WLAN_GET_PEER_RSSI_SOURCE_DRIVER) { - if (!wait_for_completion_timeout(&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS))) { + } else { + ret = hdd_request_wait_for_response(request); + if (ret) { hdd_err("SME timed out while retrieving rssi"); ret = -EFAULT; } else { + priv = hdd_request_priv(request); + adapter->peer_sta_info = priv->peer_sta_info; ret = 0; } - goto set_magic; - } else { - ret = 0; - return ret; } -set_magic: - /* - * either we never sent a request, we sent a request and received a - * response or we sent a request and timed out. if we never sent a - * request or if we sent a request and got a response, we want to - * clear the magic out of paranoia. if we timed out there is a - * race condition such that the callback function could be - * executing at the same time we are. of primary concern is if the - * callback function had already verified the "magic" but had not - * yet set the completion variable when a timeout occurred. we - * serialize these activities by invalidating the magic while - * holding a shared spinlock which will cause us to block if the - * callback is currently executing - */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(request); return ret; } @@ -4523,188 +4327,6 @@ static int iw_get_name(struct net_device *dev, } /** - * __iw_set_mode() - ioctl handler - * @dev: device upon which the ioctl was received - * @info: ioctl request information - * @wrqu: ioctl request data - * @extra: ioctl extra data - * - * Return: 0 on success, non-zero on error - */ -static int __iw_set_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *hdd_ctx; - tCsrRoamProfile *pRoamProfile; - eCsrRoamBssType LastBSSType; - struct hdd_config *pConfig; - struct wireless_dev *wdev; - int ret; - - ENTER_DEV(dev); - - hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); - ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) - return ret; - - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - wdev = dev->ieee80211_ptr; - pRoamProfile = &pWextState->roamProfile; - LastBSSType = pRoamProfile->BSSType; - - hdd_debug("Old Bss type = %d", LastBSSType); - - switch (wrqu->mode) { - case IW_MODE_ADHOC: - hdd_debug("Setting AP Mode as IW_MODE_ADHOC"); - pRoamProfile->BSSType = eCSR_BSS_TYPE_START_IBSS; - /* Set the phymode correctly for IBSS. */ - pConfig = (WLAN_HDD_GET_CTX(pAdapter))->config; - pWextState->roamProfile.phyMode = - hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode); - pAdapter->device_mode = QDF_IBSS_MODE; - wdev->iftype = NL80211_IFTYPE_ADHOC; - break; - case IW_MODE_INFRA: - hdd_debug("Setting AP Mode as IW_MODE_INFRA"); - pRoamProfile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE; - wdev->iftype = NL80211_IFTYPE_STATION; - break; - case IW_MODE_AUTO: - hdd_debug("Setting AP Mode as IW_MODE_AUTO"); - pRoamProfile->BSSType = eCSR_BSS_TYPE_ANY; - break; - default: - hdd_err("Unknown AP Mode value %d", wrqu->mode); - return -EOPNOTSUPP; - } - - if (LastBSSType != pRoamProfile->BSSType) { - /* the BSS mode changed. We need to issue disconnect - * if connected or in IBSS disconnect state - */ - if (hdd_conn_is_connected - (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter)) - || (eCSR_BSS_TYPE_START_IBSS == LastBSSType)) { - QDF_STATUS qdf_status; - /* need to issue a disconnect to CSR. */ - INIT_COMPLETION(pAdapter->disconnect_comp_var); - qdf_status = - sme_roam_disconnect(WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, - eCSR_DISCONNECT_REASON_IBSS_LEAVE); - if (QDF_STATUS_SUCCESS == qdf_status) { - unsigned long rc; - - rc = wait_for_completion_timeout(&pAdapter-> - disconnect_comp_var, - msecs_to_jiffies - (WLAN_WAIT_TIME_DISCONNECT)); - if (!rc) - hdd_err("disconnect_comp_var failed"); - } - } - } - - EXIT(); - return 0; -} - -/** - * iw_set_mode() - SSR wrapper for __iw_set_mode() - * @dev: pointer to net_device - * @info: pointer to iw_request_info - * @wrqu: pointer to iwreq_data - * @extra: pointer to extra ioctl payload - * - * Return: 0 on success, error number otherwise - */ -static int iw_set_mode(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret; - - cds_ssr_protect(__func__); - ret = __iw_set_mode(dev, info, wrqu, extra); - cds_ssr_unprotect(__func__); - - return ret; -} - -/** - * __iw_get_mode() - SIOCGIWMODE ioctl handler - * @dev: device upon which the ioctl was received - * @info: ioctl request information - * @wrqu: ioctl request data - * @extra: ioctl extra data - * - * Return: 0 on success, non-zero on error - */ -static int -__iw_get_mode(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *hdd_ctx; - int ret; - - ENTER_DEV(dev); - - hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); - ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) - return ret; - - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - - switch (pWextState->roamProfile.BSSType) { - case eCSR_BSS_TYPE_INFRASTRUCTURE: - hdd_debug("returns IW_MODE_INFRA"); - wrqu->mode = IW_MODE_INFRA; - break; - case eCSR_BSS_TYPE_IBSS: - case eCSR_BSS_TYPE_START_IBSS: - hdd_debug("returns IW_MODE_ADHOC"); - wrqu->mode = IW_MODE_ADHOC; - break; - case eCSR_BSS_TYPE_ANY: - default: - hdd_debug("returns IW_MODE_AUTO"); - wrqu->mode = IW_MODE_AUTO; - break; - } - - EXIT(); - return 0; -} - -/** - * iw_get_mode() - SSR wrapper for __iw_get_mode() - * @dev: pointer to net_device - * @info: pointer to iw_request_info - * @wrqu: pointer to iwreq_data - * @extra: pointer to extra ioctl payload - * - * Return: 0 on success, error number otherwise - */ -static int iw_get_mode(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret; - - cds_ssr_protect(__func__); - ret = __iw_get_mode(dev, info, wrqu, extra); - cds_ssr_unprotect(__func__); - - return ret; -} - -/** * __iw_set_freq() - SIOCSIWFREQ ioctl handler * @dev: device upon which the ioctl was received * @info: ioctl request information @@ -6076,60 +5698,42 @@ static int iw_get_range(struct net_device *dev, struct iw_request_info *info, return ret; } +struct class_a_stats { + tCsrGlobalClassAStatsInfo class_a_stats; +}; + /** * hdd_get_class_a_statistics_cb() - Get Class A stats callback function - * @pStats: pointer to Class A stats - * @pContext: user context originally registered with SME + * @stats: pointer to Class A stats + * @context: user context originally registered with SME (always the + * cookie from the request context) * * Return: None */ -static void hdd_get_class_a_statistics_cb(void *pStats, void *pContext) +static void hdd_get_class_a_statistics_cb(void *stats, void *context) { - struct statsContext *pStatsContext; - tCsrGlobalClassAStatsInfo *pClassAStats; - hdd_adapter_t *pAdapter; + struct hdd_request *request; + struct class_a_stats *priv; + tCsrGlobalClassAStatsInfo *returned_stats; - if ((NULL == pStats) || (NULL == pContext)) { - hdd_err("Bad param, pStats [%pK] pContext [%pK]", - pStats, pContext); + ENTER(); + if (NULL == stats) { + hdd_err("Bad param, stats"); return; } - pClassAStats = pStats; - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - - /* there is a race condition that exists between this callback - * function and the caller since the caller could time out - * either before or while this code is executing. we use a - * spinlock to serialize these actions - */ - spin_lock(&hdd_context_lock); - - if ((NULL == pAdapter) || - (STATS_CONTEXT_MAGIC != pStatsContext->magic)) { - /* the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, pAdapter [%pK] magic [%08x]", - pAdapter, pStatsContext->magic); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request"); return; } - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; - - /* copy over the stats. do so as a struct copy */ - pAdapter->hdd_stats.ClassA_stat = *pClassAStats; - - /* notify the caller */ - complete(&pStatsContext->completion); - - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + returned_stats = stats; + priv = hdd_request_priv(request); + priv->class_a_stats = *returned_stats; + hdd_request_complete(request); + hdd_request_put(request); + EXIT(); } /** @@ -6142,8 +5746,14 @@ QDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter) { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); QDF_STATUS hstatus; - unsigned long rc; - static struct statsContext context; + int ret; + void *cookie; + struct hdd_request *request; + struct class_a_stats *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { hdd_err("pAdapter is NULL"); @@ -6155,10 +5765,13 @@ QDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter) return QDF_STATUS_SUCCESS; } - /* we are connected so prepare our callback context */ - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = STATS_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return QDF_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); + /* query only for Class A statistics (which include link speed) */ hstatus = sme_get_statistics(WLAN_HDD_GET_HAL_CTX(pAdapter), eCSR_HDD, SME_GLOBAL_CLASSA_STATS, @@ -6166,100 +5779,79 @@ QDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter) 0, /* not periodic */ false, /* non-cached results */ pHddStaCtx->conn_info.staId[0], - &context, pAdapter->sessionId); + cookie, pAdapter->sessionId); if (QDF_STATUS_SUCCESS != hstatus) { hdd_debug("Unable to retrieve Class A statistics"); - /* we'll returned a cached value below */ - } else { - /* request was sent -- wait for the response */ - rc = wait_for_completion_timeout - (&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - if (!rc) - hdd_warn("SME timed out while retrieving Class A statistics"); - } - - /* either we never sent a request, we sent a request and - * received a response or we sent a request and timed out. if - * we never sent a request or if we sent a request and got a - * response, we want to clear the magic out of paranoia. if - * we timed out there is a race condition such that the - * callback function could be executing at the same time we - * are. of primary concern is if the callback function had - * already verified the "magic" but had not yet set the - * completion variable when a timeout occurred. we serialize - * these activities by invalidating the magic while holding a - * shared spinlock which will cause us to block if the - * callback is currently executing + goto return_cached_results; + } + /* request was sent -- wait for the response */ + ret = hdd_request_wait_for_response(request); + if (ret) { + hdd_warn("SME timed out while retrieving Class A statistics"); + goto return_cached_results; + } + + /* update the adapter with the fresh results */ + priv = hdd_request_priv(request); + pAdapter->hdd_stats.ClassA_stat = priv->class_a_stats; + +return_cached_results: + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * regardless we are done with the request. */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(request); - /* either callback updated pAdapter stats or it has cached data */ return QDF_STATUS_SUCCESS; } +struct station_stats { + tCsrSummaryStatsInfo summary_stats; + tCsrGlobalClassAStatsInfo class_a_stats; + struct csr_per_chain_rssi_stats_info per_chain_rssi_stats; +}; + /** * hdd_get_station_statistics_cb() - Get stats callback function - * @pStats: pointer to Class A stats - * @pContext: user context originally registered with SME + * @stats: pointer to combined station stats + * @context: user context originally registered with SME (always the + * cookie from the request context) * * Return: None */ -static void hdd_get_station_statistics_cb(void *pStats, void *pContext) +static void hdd_get_station_statistics_cb(void *stats, void *context) { - struct statsContext *pStatsContext; - tCsrSummaryStatsInfo *pSummaryStats; - tCsrGlobalClassAStatsInfo *pClassAStats; + struct hdd_request *request; + struct station_stats *priv; + tCsrSummaryStatsInfo *summary_stats; + tCsrGlobalClassAStatsInfo *class_a_stats; struct csr_per_chain_rssi_stats_info *per_chain_rssi_stats; - hdd_adapter_t *pAdapter; - if ((NULL == pStats) || (NULL == pContext)) { - hdd_err("Bad param, pStats [%pK] pContext [%pK]", - pStats, pContext); + if (NULL == stats) { + hdd_err("Bad param, pStats [%p]", stats); return; } - /* there is a race condition that exists between this callback - * function and the caller since the caller could time out - * either before or while this code is executing. we use a - * spinlock to serialize these actions - */ - spin_lock(&hdd_context_lock); - - pSummaryStats = (tCsrSummaryStatsInfo *) pStats; - pClassAStats = (tCsrGlobalClassAStatsInfo *) (pSummaryStats + 1); - per_chain_rssi_stats = (struct csr_per_chain_rssi_stats_info *) - (pClassAStats + 1); - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - if ((NULL == pAdapter) || - (STATS_CONTEXT_MAGIC != pStatsContext->magic)) { - /* the caller presumably timed out so there is nothing - * we can do - */ - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, pAdapter [%pK] magic [%08x]", - pAdapter, pStatsContext->magic); + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request"); return; } - /* context is valid so caller is still waiting */ - - /* paranoia: invalidate the magic */ - pStatsContext->magic = 0; + summary_stats = (tCsrSummaryStatsInfo *) stats; + class_a_stats = (tCsrGlobalClassAStatsInfo *) (summary_stats + 1); + per_chain_rssi_stats = (struct csr_per_chain_rssi_stats_info *) + (class_a_stats + 1); + priv = hdd_request_priv(request); /* copy over the stats. do so as a struct copy */ - pAdapter->hdd_stats.summary_stat = *pSummaryStats; - pAdapter->hdd_stats.ClassA_stat = *pClassAStats; - pAdapter->hdd_stats.per_chain_rssi_stats = *per_chain_rssi_stats; - - /* notify the caller */ - complete(&pStatsContext->completion); + priv->summary_stats = *summary_stats; + priv->class_a_stats = *class_a_stats; + priv->per_chain_rssi_stats = *per_chain_rssi_stats; - /* serialization is complete */ - spin_unlock(&hdd_context_lock); + hdd_request_complete(request); + hdd_request_put(request); } /** @@ -6272,18 +5864,26 @@ QDF_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter) { hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); QDF_STATUS hstatus; - unsigned long rc; - static struct statsContext context; + int ret; + void *cookie; + struct hdd_request *request; + struct station_stats *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; if (NULL == pAdapter) { hdd_err("pAdapter is NULL"); return QDF_STATUS_SUCCESS; } - /* we are connected so prepare our callback context */ - init_completion(&context.completion); - context.pAdapter = pAdapter; - context.magic = STATS_CONTEXT_MAGIC; + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return QDF_STATUS_E_NOMEM; + } + cookie = hdd_request_cookie(request); /* query only for Summary & Class A statistics */ hstatus = sme_get_statistics(WLAN_HDD_GET_HAL_CTX(pAdapter), @@ -6295,36 +5895,32 @@ QDF_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter) 0, /* not periodic */ false, /* non-cached results */ pHddStaCtx->conn_info.staId[0], - &context, pAdapter->sessionId); + cookie, pAdapter->sessionId); if (QDF_STATUS_SUCCESS != hstatus) { hdd_err("Unable to retrieve statistics"); /* we'll return with cached values */ } else { /* request was sent -- wait for the response */ - rc = wait_for_completion_timeout - (&context.completion, - msecs_to_jiffies(WLAN_WAIT_TIME_STATS)); - - if (!rc) - hdd_err("SME timed out while retrieving statistics"); - } - - /* either we never sent a request, we sent a request and - * received a response or we sent a request and timed out. if - * we never sent a request or if we sent a request and got a - * response, we want to clear the magic out of paranoia. if - * we timed out there is a race condition such that the - * callback function could be executing at the same time we - * are. of primary concern is if the callback function had - * already verified the "magic" but had not yet set the - * completion variable when a timeout occurred. we serialize - * these activities by invalidating the magic while holding a - * shared spinlock which will cause us to block if the - * callback is currently executing + ret = hdd_request_wait_for_response(request); + if (ret) { + hdd_warn("SME timed out while retrieving statistics"); + /* we'll returned a cached value below */ + } else { + /* update the adapter with the fresh results */ + priv = hdd_request_priv(request); + pAdapter->hdd_stats.summary_stat = priv->summary_stats; + pAdapter->hdd_stats.ClassA_stat = priv->class_a_stats; + pAdapter->hdd_stats.per_chain_rssi_stats = + priv->per_chain_rssi_stats; + } + } + + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * regardless we are done with the request. */ - spin_lock(&hdd_context_lock); - context.magic = 0; - spin_unlock(&hdd_context_lock); + hdd_request_put(request); /* either callback updated pAdapter stats or it has cached data */ return QDF_STATUS_SUCCESS; @@ -7576,10 +7172,14 @@ free: return retval; } +struct temperature_priv { + int temperature; +}; + /** * hdd_get_temperature_cb() - "Get Temperature" callback function * @temperature: measured temperature - * @pContext: callback context + * @context: callback context * * This function is passed to sme_get_temperature() as the callback * function to be invoked when the temperature measurement is @@ -7587,30 +7187,24 @@ free: * * Return: None */ -static void hdd_get_temperature_cb(int temperature, void *pContext) +static void hdd_get_temperature_cb(int temperature, void *context) { - struct statsContext *pTempContext; - hdd_adapter_t *pAdapter; + struct hdd_request *request; + struct temperature_priv *priv; ENTER(); - if (NULL == pContext) { - hdd_err("pContext is NULL"); - return; - } - pTempContext = pContext; - pAdapter = pTempContext->pAdapter; - spin_lock(&hdd_context_lock); - if ((NULL == pAdapter) || (TEMP_CONTEXT_MAGIC != pTempContext->magic)) { - spin_unlock(&hdd_context_lock); - hdd_warn("Invalid context, pAdapter [%pK] magic [%08x]", - pAdapter, pTempContext->magic); + + request = hdd_request_get(context); + if (!request) { + hdd_err("Obsolete request"); return; } - if (temperature != 0) - pAdapter->temperature = temperature; - complete(&pTempContext->completion); - spin_unlock(&hdd_context_lock); + priv = hdd_request_priv(request); + priv->temperature = temperature; + hdd_request_complete(request); + hdd_request_put(request); + EXIT(); } @@ -7623,35 +7217,54 @@ static void hdd_get_temperature_cb(int temperature, void *pContext) * returned, otherwise a negative errno is returned. * */ -int wlan_hdd_get_temperature(hdd_adapter_t *pAdapter, int *temperature) +int wlan_hdd_get_temperature(hdd_adapter_t *p_adapter, int *temperature) { QDF_STATUS status; - static struct statsContext tempContext; - unsigned long rc; + int ret; + void *cookie; + struct hdd_request *request; + struct temperature_priv *priv; + static const struct hdd_request_params params = { + .priv_size = sizeof(*priv), + .timeout_ms = WLAN_WAIT_TIME_STATS, + }; ENTER(); - if (NULL == pAdapter) { + if (!p_adapter) { hdd_err("pAdapter is NULL"); return -EPERM; } - init_completion(&tempContext.completion); - tempContext.pAdapter = pAdapter; - tempContext.magic = TEMP_CONTEXT_MAGIC; - status = sme_get_temperature(WLAN_HDD_GET_HAL_CTX(pAdapter), - &tempContext, hdd_get_temperature_cb); + + request = hdd_request_alloc(¶ms); + if (!request) { + hdd_err("Request allocation failure"); + return -ENOMEM; + } + cookie = hdd_request_cookie(request); + status = sme_get_temperature(WLAN_HDD_GET_HAL_CTX(p_adapter), + cookie, hdd_get_temperature_cb); if (QDF_STATUS_SUCCESS != status) { hdd_err("Unable to retrieve temperature"); } else { - rc = wait_for_completion_timeout(&tempContext.completion, - msecs_to_jiffies - (WLAN_WAIT_TIME_STATS)); - if (!rc) + ret = hdd_request_wait_for_response(request); + if (ret) { hdd_err("SME timed out while retrieving temperature"); + } else { + /* update the adapter with the fresh results */ + priv = hdd_request_priv(request); + if (priv->temperature) + p_adapter->temperature = priv->temperature; + } } - spin_lock(&hdd_context_lock); - tempContext.magic = 0; - spin_unlock(&hdd_context_lock); - *temperature = pAdapter->temperature; + + /* + * either we never sent a request, we sent a request and + * received a response or we sent a request and timed out. + * regardless we are done with the request. + */ + hdd_request_put(request); + + *temperature = p_adapter->temperature; EXIT(); return 0; } @@ -7799,14 +7412,6 @@ static int __iw_setint_getnone(struct net_device *dev, break; } - case WE_SET_SAP_AUTO_CHANNEL_SELECTION: - if (set_value == 0 || set_value == 1) - (WLAN_HDD_GET_CTX(pAdapter))->config->force_sap_acs = - set_value; - else - ret = -EINVAL; - break; - case WE_SET_DATA_INACTIVITY_TO: if (!hHal) { ret = -EINVAL; @@ -8381,6 +7986,7 @@ static int __iw_setint_getnone(struct net_device *dev, ret = wma_cli_set_command(pAdapter->sessionId, WMI_PDEV_PARAM_TX_CHAIN_MASK, set_value, PDEV_CMD); + ret = hdd_set_antenna_mode(pAdapter, hdd_ctx, set_value); break; } @@ -8391,6 +7997,7 @@ static int __iw_setint_getnone(struct net_device *dev, ret = wma_cli_set_command(pAdapter->sessionId, WMI_PDEV_PARAM_RX_CHAIN_MASK, set_value, PDEV_CMD); + ret = hdd_set_antenna_mode(pAdapter, hdd_ctx, set_value); break; } @@ -8910,7 +8517,8 @@ static int __iw_setint_getnone(struct net_device *dev, (set_value > CFG_ENABLE_MODULATED_DTIM_MAX)) { hdd_err("Invalid gEnableModuleDTIM value %d", set_value); - return -EINVAL; + ret = -EINVAL; + goto free; } else { hdd_ctx->config->enableModulatedDTIM = set_value; } @@ -9209,10 +8817,6 @@ static int __iw_setnone_getint(struct net_device *dev, } break; } - case WE_GET_SAP_AUTO_CHANNEL_SELECTION: - *value = (WLAN_HDD_GET_CTX( - pAdapter))->config->force_sap_acs; - break; case WE_GET_CONCURRENCY_MODE: { @@ -9740,21 +9344,6 @@ static int __iw_set_three_ints_getnone(struct net_device *dev, qdf_dp_trace_set_value(value[1], value[2], value[3]); break; - /* value[3] the acs band is not required as start and end channels are - * enough but this cmd is maintained under set three ints for historic - * reasons. - */ - case WE_SET_SAP_CHANNELS: - if (wlan_hdd_validate_operation_channel(pAdapter, value[1]) != - QDF_STATUS_SUCCESS || - wlan_hdd_validate_operation_channel(pAdapter, - value[2]) != QDF_STATUS_SUCCESS) { - ret = -EINVAL; - } else { - hdd_ctx->config->force_sap_acs_st_ch = value[1]; - hdd_ctx->config->force_sap_acs_end_ch = value[2]; - } - break; case WE_SET_DUAL_MAC_SCAN_CONFIG: hdd_debug("Ioctl to set dual mac scan config"); if (hdd_ctx->config->dual_mac_feature_disable == @@ -9852,7 +9441,8 @@ static int __iw_get_char_setnone(struct net_device *dev, switch (sub_cmd) { case WE_WLAN_VERSION: { - hdd_wlan_get_version(hdd_ctx, wrqu, extra); + wrqu->data.length = hdd_wlan_get_version(hdd_ctx, + WE_MAX_STR_LEN, extra); break; } @@ -10511,6 +10101,13 @@ static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx, case WE_POLICY_MANAGER_CLIST_CMD: { hdd_debug("<iwpriv wlan0 pm_clist> is called"); + if ((apps_args[0] < 0) || (apps_args[1] < 0) || + (apps_args[2] < 0) || (apps_args[3] < 0) || + (apps_args[4] < 0) || (apps_args[5] < 0) || + (apps_args[6] < 0) || (apps_args[7] < 0)) { + hdd_err("Invalid input params recieved for the IOCTL"); + return 0; + } cds_incr_connection_count_utfw(apps_args[0], apps_args[1], apps_args[2], apps_args[3], apps_args[4], apps_args[5], apps_args[6], @@ -10521,6 +10118,11 @@ static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx, case WE_POLICY_MANAGER_DLIST_CMD: { hdd_debug("<iwpriv wlan0 pm_dlist> is called"); + if ((apps_args[0] < 0) || (apps_args[1] < 0)) { + hdd_err("Invalid input params recieved for the IOCTL"); + return 0; + } + cds_decr_connection_count_utfw(apps_args[0], apps_args[1]); } @@ -10529,6 +10131,13 @@ static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx, case WE_POLICY_MANAGER_ULIST_CMD: { hdd_debug("<iwpriv wlan0 pm_ulist> is called"); + if ((apps_args[0] < 0) || (apps_args[1] < 0) || + (apps_args[2] < 0) || (apps_args[3] < 0) || + (apps_args[4] < 0) || (apps_args[5] < 0) || + (apps_args[6] < 0) || (apps_args[7] < 0)) { + hdd_err("Invalid input params recieved for the IOCTL"); + return 0; + } cds_update_connection_info_utfw(apps_args[0], apps_args[1], apps_args[2], apps_args[3], apps_args[4], apps_args[5], apps_args[6], @@ -10539,6 +10148,11 @@ static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx, case WE_POLICY_MANAGER_DBS_CMD: { hdd_debug("<iwpriv wlan0 pm_dbs> is called"); + if (apps_args[0] < 0) { + hdd_err("Invalid input param recieved for the IOCTL"); + return 0; + } + if (apps_args[0] == 0) wma_set_dbs_capability_ut(0); else @@ -10560,6 +10174,10 @@ static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx, hdd_debug("<iwpriv wlan0 pm_pcl> is called"); + if (apps_args[0] < 0) { + hdd_err("Invalid input param recieved for the IOCTL"); + return 0; + } cds_get_pcl(apps_args[0], pcl, &pcl_len, weight_list, QDF_ARRAY_SIZE(weight_list)); @@ -10603,6 +10221,11 @@ static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx, QDF_STATUS status; hdd_debug("<iwpriv wlan0 pm_query_action> is called"); + if (apps_args[0] < 0) { + hdd_err("Invalid input params recieved for the IOCTL"); + return 0; + } + status = cds_current_connections_update(adapter->sessionId, apps_args[0], SIR_UPDATE_REASON_UT); @@ -10615,6 +10238,11 @@ static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx, bool allow; hdd_debug("<iwpriv wlan0 pm_query_allow> is called"); + if ((apps_args[0] < 0) || (apps_args[1] < 0) || + (apps_args[2] < 0)) { + hdd_err("Invalid input params recieved for the IOCTL"); + return 0; + } allow = cds_allow_concurrency( apps_args[0], apps_args[1], apps_args[2]); pr_info("allow %d {0 = don't allow, 1 = allow}", allow); @@ -11791,7 +11419,8 @@ static int __iw_set_packet_filter_params(struct net_device *dev, return -EINVAL; } - if ((NULL == priv_data.pointer) || (0 == priv_data.length)) { + if ((NULL == priv_data.pointer) || (0 == priv_data.length) || + priv_data.length < sizeof(struct pkt_filter_cfg)) { hdd_err("invalid priv data %pK or invalid priv data length %d", priv_data.pointer, priv_data.length); return -EINVAL; @@ -12119,8 +11748,6 @@ static int __iw_set_pno(struct net_device *dev, if (ret) return ret; - hdd_debug("PNO data len %d data %s", wrqu->data.length, extra); - /* making sure argument string ends with '\0' */ len = (wrqu->data.length + 1); data = qdf_mem_malloc(len); @@ -12132,6 +11759,8 @@ static int __iw_set_pno(struct net_device *dev, qdf_mem_copy(data, extra, (len-1)); ptr = data; + hdd_debug("PNO data len %d data %s", wrqu->data.length, data); + request.enable = 0; request.ucNetworksCount = 0; @@ -12725,9 +12354,19 @@ static int __iw_set_two_ints_getnone(struct net_device *dev, ret = wlan_hdd_set_mon_chan(pAdapter, value[1], value[2]); break; case WE_SET_WLAN_SUSPEND: + if (!hdd_ctx->config->is_unit_test_framework_enabled) { + hdd_warn_ratelimited(HDD_UT_SUSPEND_RESUME_LOG_RL, + "UT suspend is disabled"); + return 0; + } ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev); break; case WE_SET_WLAN_RESUME: + if (!hdd_ctx->config->is_unit_test_framework_enabled) { + hdd_warn_ratelimited(HDD_UT_SUSPEND_RESUME_LOG_RL, + "UT resume is disabled"); + return 0; + } ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev); break; case WE_LOG_BUFFER: { @@ -12769,8 +12408,8 @@ static const iw_handler we_handler[] = { NULL, /* SIOCGIWNWID */ iw_set_freq, /* SIOCSIWFREQ */ iw_get_freq, /* SIOCGIWFREQ */ - iw_set_mode, /* SIOCSIWMODE */ - iw_get_mode, /* SIOCGIWMODE */ + NULL, /* SIOCSIWMODE */ + NULL, /* SIOCGIWMODE */ NULL, /* SIOCSIWSENS */ NULL, /* SIOCGIWSENS */ NULL, /* SIOCSIWRANGE */ @@ -12888,10 +12527,6 @@ static const struct iw_priv_args we_private_args[] = { 0, "setMaxAssoc"}, - {WE_SET_SAP_AUTO_CHANNEL_SELECTION, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, - "setAutoChannel" }, - {WE_SET_SCAN_DISABLE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, @@ -13323,10 +12958,6 @@ static const struct iw_priv_args we_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getMaxAssoc"}, - {WE_GET_SAP_AUTO_CHANNEL_SELECTION, - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - "getAutoChannel" }, - {WE_GET_CONCURRENCY_MODE, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, @@ -13607,11 +13238,6 @@ static const struct iw_priv_args we_private_args[] = { 0, "set_dp_trace"}, - {WE_SET_SAP_CHANNELS, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, - 0, - "setsapchannels"}, - {WE_SET_FW_TEST, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "fw_test"}, diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c index 41f0fddf851e..2e568294581f 100644 --- a/core/hdd/src/wlan_hdd_wmm.c +++ b/core/hdd/src/wlan_hdd_wmm.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: HDD WMM * @@ -63,7 +54,6 @@ #include <cds_sched.h> #include "sme_api.h" -#define WLAN_HDD_HIPRI_TOS 0xc0 #define WLAN_HDD_MAX_DSCP 0x3f #define HDD_WMM_UP_TO_AC_MAP_SIZE 8 @@ -331,7 +321,13 @@ static void hdd_wmm_inactivity_timer_cb(void *user_data) hdd_wlan_wmm_status_e status; QDF_STATUS qdf_status; uint32_t currentTrafficCnt = 0; - sme_ac_enum_type acType = pQosContext->acType; + sme_ac_enum_type acType; + + if (!pQosContext) { + hdd_err("invalid user data"); + return; + } + acType = pQosContext->acType; pAdapter = pQosContext->pAdapter; if ((NULL == pAdapter) || @@ -465,6 +461,13 @@ hdd_wmm_disable_inactivity_timer(struct hdd_wmm_qos_context *pQosContext) return qdf_status; } +#else + +static QDF_STATUS +hdd_wmm_disable_inactivity_timer(struct hdd_wmm_qos_context *pQosContext) +{ + return QDF_STATUS_SUCCESS; +} #endif /* FEATURE_WLAN_ESE */ /** @@ -590,6 +593,9 @@ static QDF_STATUS hdd_wmm_sme_callback(tHalHandle hHal, hdd_wmm_notify_app(pQosContext); } + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); + /* Setting up QoS Failed, QoS context can be released. * SME is releasing this flow information and if HDD * doesn't release this context, next time if @@ -757,6 +763,9 @@ static QDF_STATUS hdd_wmm_sme_callback(tHalHandle hHal, HDD_WLAN_WMM_STATUS_RELEASE_SUCCESS; hdd_wmm_notify_app(pQosContext); } + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); + /* we are done with this flow */ hdd_wmm_free_context(pQosContext); break; @@ -801,6 +810,9 @@ static QDF_STATUS hdd_wmm_sme_callback(tHalHandle hHal, hdd_wmm_notify_app(pQosContext); } + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); + /* we are done with this flow */ hdd_wmm_free_context(pQosContext); break; @@ -1201,6 +1213,9 @@ static void __hdd_wmm_do_implicit_qos(struct work_struct *work) break; case SME_QOS_STATUS_SETUP_FAILURE_RSP: + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); + /* we can't tell the difference between when a request * fails because AP rejected it versus when SME * encountered an internal error. in either case SME @@ -1362,9 +1377,9 @@ QDF_STATUS hdd_wmm_adapter_close(hdd_adapter_t *pAdapter) pQosContext = list_first_entry(&pAdapter->hddWmmStatus.wmmContextList, struct hdd_wmm_qos_context, node); -#ifdef FEATURE_WLAN_ESE + hdd_wmm_disable_inactivity_timer(pQosContext); -#endif + if (pQosContext->handle == HDD_WMM_HANDLE_IMPLICIT && pQosContext->magic == HDD_WMM_CTX_MAGIC) cds_flush_work(&pQosContext->wmmAcSetupImplicitQos); @@ -1375,22 +1390,6 @@ QDF_STATUS hdd_wmm_adapter_close(hdd_adapter_t *pAdapter) return QDF_STATUS_SUCCESS; } -static inline unsigned char hdd_wmm_check_ip_proto(unsigned char ip_proto, - unsigned char ip_tos, - bool *is_hipri) -{ - switch (ip_proto) { - case IPPROTO_ICMP: - case IPPROTO_ICMPV6: - *is_hipri = true; - return WLAN_HDD_HIPRI_TOS; - - default: - *is_hipri = false; - return ip_tos; - } -} - /** * hdd_wmm_classify_pkt() - Function which will classify an OS packet * into a WMM AC based on DSCP @@ -1398,7 +1397,7 @@ static inline unsigned char hdd_wmm_check_ip_proto(unsigned char ip_proto, * @adapter: adapter upon which the packet is being transmitted * @skb: pointer to network buffer * @user_pri: user priority of the OS packet - * @is_hipri: high priority packet flag + * @is_eapol: eapol packet flag * * Return: None */ @@ -1406,7 +1405,7 @@ static void hdd_wmm_classify_pkt(hdd_adapter_t *adapter, struct sk_buff *skb, sme_QosWmmUpType *user_pri, - bool *is_hipri) + bool *is_eapol) { unsigned char dscp; unsigned char tos; @@ -1433,16 +1432,14 @@ void hdd_wmm_classify_pkt(hdd_adapter_t *adapter, if (eth_hdr->eth_II.h_proto == htons(ETH_P_IP)) { /* case 1: Ethernet II IP packet */ ip_hdr = (struct iphdr *)&pkt[sizeof(eth_hdr->eth_II)]; - tos = hdd_wmm_check_ip_proto(ip_hdr->protocol, ip_hdr->tos, - is_hipri); + tos = ip_hdr->tos; #ifdef HDD_WMM_DEBUG hdd_info("Ethernet II IP Packet, tos is %d", tos); #endif /* HDD_WMM_DEBUG */ + } else if (eth_hdr->eth_II.h_proto == htons(ETH_P_IPV6)) { ipv6hdr = ipv6_hdr(skb); - tos = hdd_wmm_check_ip_proto( - ipv6hdr->nexthdr, ntohs(*(const __be16 *)ipv6hdr) >> 4, - is_hipri); + tos = ntohs(*(const __be16 *)ipv6hdr) >> 4; #ifdef HDD_WMM_DEBUG hdd_info("Ethernet II IPv6 Packet, tos is %d", tos); #endif /* HDD_WMM_DEBUG */ @@ -1453,8 +1450,7 @@ void hdd_wmm_classify_pkt(hdd_adapter_t *adapter, (eth_hdr->eth_8023.h_proto == htons(ETH_P_IP))) { /* case 2: 802.3 LLC/SNAP IP packet */ ip_hdr = (struct iphdr *)&pkt[sizeof(eth_hdr->eth_8023)]; - tos = hdd_wmm_check_ip_proto(ip_hdr->protocol, ip_hdr->tos, - is_hipri); + tos = ip_hdr->tos; #ifdef HDD_WMM_DEBUG hdd_info("802.3 LLC/SNAP IP Packet, tos is %d", tos); #endif /* HDD_WMM_DEBUG */ @@ -1467,8 +1463,7 @@ void hdd_wmm_classify_pkt(hdd_adapter_t *adapter, ip_hdr = (struct iphdr *) &pkt[sizeof(eth_hdr->eth_IIv)]; - tos = hdd_wmm_check_ip_proto(ip_hdr->protocol, - ip_hdr->tos, is_hipri); + tos = ip_hdr->tos; #ifdef HDD_WMM_DEBUG hdd_info("Ethernet II VLAN tagged IP Packet, tos is %d", tos); @@ -1488,39 +1483,30 @@ void hdd_wmm_classify_pkt(hdd_adapter_t *adapter, ip_hdr = (struct iphdr *) &pkt[sizeof(eth_hdr->eth_8023v)]; - tos = hdd_wmm_check_ip_proto(ip_hdr->protocol, - ip_hdr->tos, is_hipri); + tos = ip_hdr->tos; #ifdef HDD_WMM_DEBUG hdd_info("802.3 LLC/SNAP VLAN tagged IP Packet, tos is %d", tos); #endif /* HDD_WMM_DEBUG */ } else { /* default */ - *is_hipri = false; - tos = 0; #ifdef HDD_WMM_DEBUG hdd_warn("VLAN tagged Unhandled Protocol, using default tos"); #endif /* HDD_WMM_DEBUG */ + tos = 0; } - } else if (eth_hdr->eth_II.h_proto == htons(HDD_ETHERTYPE_802_1_X)) { - *is_hipri = true; - tos = WLAN_HDD_HIPRI_TOS; -#ifdef HDD_WMM_DEBUG - hdd_info("802.1x packet, tos is %d", tos); -#endif /* HDD_WMM_DEBUG */ - } else if (skb->protocol == htons(ETH_P_ARP)) { - *is_hipri = true; - tos = WLAN_HDD_HIPRI_TOS; -#ifdef HDD_WMM_DEBUG - hdd_info("ARP packet, tos is %d", tos); -#endif /* HDD_WMM_DEBUG */ } else { /* default */ - *is_hipri = false; - tos = 0; #ifdef HDD_WMM_DEBUG hdd_warn("Unhandled Protocol, using default tos"); #endif /* HDD_WMM_DEBUG */ + /* Give the highest priority to 802.1x packet */ + if (eth_hdr->eth_II.h_proto == + htons(HDD_ETHERTYPE_802_1_X)) { + tos = 0xC0; + *is_eapol = true; + } else + tos = 0; } dscp = (tos >> 2) & 0x3f; @@ -1548,20 +1534,20 @@ static uint16_t __hdd_get_queue_index(uint16_t up) /** * hdd_get_queue_index() - get queue index * @up: user priority - * @is_hipri: high priority packet flag + * @is_eapol: is_eapol flag * * Return: queue_index */ static -uint16_t hdd_get_queue_index(u16 up, bool is_hipri) +uint16_t hdd_get_queue_index(uint16_t up, bool is_eapol) { - if (qdf_unlikely(is_hipri)) + if (qdf_unlikely(is_eapol == true)) return HDD_LINUX_AC_HI_PRIO; return __hdd_get_queue_index(up); } #else static -uint16_t hdd_get_queue_index(u16 up, bool is_hipri) +uint16_t hdd_get_queue_index(uint16_t up, bool is_eapol) { return __hdd_get_queue_index(up); } @@ -1591,7 +1577,7 @@ uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb uint16_t queueIndex; hdd_adapter_t *adapter = (hdd_adapter_t *) netdev_priv(dev); hdd_context_t *hddctx = WLAN_HDD_GET_CTX(adapter); - bool is_hipri = false; + bool is_eapol = false; int status = 0; status = wlan_hdd_validate_context(hddctx); @@ -1602,9 +1588,9 @@ uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb } /* Get the user priority from IP header */ - hdd_wmm_classify_pkt(adapter, skb, &up, &is_hipri); + hdd_wmm_classify_pkt(adapter, skb, &up, &is_eapol); skb->priority = up; - queueIndex = hdd_get_queue_index(skb->priority, is_hipri); + queueIndex = hdd_get_queue_index(skb->priority, is_eapol); return queueIndex; } @@ -2219,9 +2205,13 @@ hdd_wlan_wmm_status_e hdd_wmm_addts(hdd_adapter_t *pAdapter, status = HDD_WLAN_WMM_STATUS_SETUP_PENDING; break; case SME_QOS_STATUS_SETUP_INVALID_PARAMS_RSP: + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); hdd_wmm_free_context(pQosContext); return HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM; case SME_QOS_STATUS_SETUP_FAILURE_RSP: + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); /* we can't tell the difference between when a request * fails because AP rejected it versus when SME * encounterd an internal error @@ -2229,9 +2219,13 @@ hdd_wlan_wmm_status_e hdd_wmm_addts(hdd_adapter_t *pAdapter, hdd_wmm_free_context(pQosContext); return HDD_WLAN_WMM_STATUS_SETUP_FAILED; case SME_QOS_STATUS_SETUP_NOT_QOS_AP_RSP: + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); hdd_wmm_free_context(pQosContext); return HDD_WLAN_WMM_STATUS_SETUP_FAILED_NO_WMM; default: + /* disable the inactivity timer */ + hdd_wmm_disable_inactivity_timer(pQosContext); /* we didn't get back one of the * SME_QOS_STATUS_SETUP_* status codes */ @@ -2315,10 +2309,9 @@ hdd_wlan_wmm_status_e hdd_wmm_delts(hdd_adapter_t *pAdapter, uint32_t handle) /* need to tell TL to stop trigger timer, etc */ hdd_wmm_disable_tl_uapsd(pQosContext); -#ifdef FEATURE_WLAN_ESE /* disable the inactivity timer */ hdd_wmm_disable_inactivity_timer(pQosContext); -#endif + /* we are done with this context */ hdd_wmm_free_context(pQosContext); diff --git a/core/hdd/src/wlan_hdd_wowl.c b/core/hdd/src/wlan_hdd_wowl.c index 23db7475a16b..b06a9182e11f 100644 --- a/core/hdd/src/wlan_hdd_wowl.c +++ b/core/hdd/src/wlan_hdd_wowl.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * @file wlan_hdd_wowl.c * diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index fdc6cf84cb27..e9a86b37142c 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _ANIGLOBAL_H #define _ANIGLOBAL_H @@ -985,6 +976,10 @@ typedef struct sAniSirGlobal { void *readyToExtWoWContext; #endif uint32_t f_sta_miracast_mcc_rest_time_val; + uint32_t sta_scan_burst_duration; + uint32_t p2p_scan_burst_duration; + uint32_t go_scan_burst_duration; + uint32_t ap_scan_burst_duration; uint8_t f_prefer_non_dfs_on_radar; hdd_ftm_msg_processor ftm_msg_processor_callback; uint32_t fine_time_meas_cap; diff --git a/core/mac/inc/ani_system_defs.h b/core/mac/inc/ani_system_defs.h index ac5f65c0cc4c..5e0b2b77ba12 100644 --- a/core/mac/inc/ani_system_defs.h +++ b/core/mac/inc/ani_system_defs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file ani_system_defs.h contains definitions used by * various ANI entities diff --git a/core/mac/inc/mac_init_api.h b/core/mac/inc/mac_init_api.h index 020261178bd5..2c4b34b6d580 100644 --- a/core/mac/inc/mac_init_api.h +++ b/core/mac/inc/mac_init_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * mac_init_api.c - Header file for mac level init functions * Author: Dinesh Upadhyay diff --git a/core/mac/inc/mac_trace.h b/core/mac/inc/mac_trace.h index 919b0f5bf96b..0a8184736432 100644 --- a/core/mac/inc/mac_trace.h +++ b/core/mac/inc/mac_trace.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= * \file mac_trace.h diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d76af685d152..ab2188edf863 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef QWLAN_VERSION_H #define QWLAN_VERSION_H /*=========================================================================== @@ -41,9 +32,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 1 -#define QWLAN_VERSION_EXTRA "R" -#define QWLAN_VERSION_BUILD 52 +#define QWLAN_VERSION_EXTRA "V" +#define QWLAN_VERSION_BUILD 57 -#define QWLAN_VERSIONSTR "5.1.1.52R" +#define QWLAN_VERSIONSTR "5.1.1.57V" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 4873e98b3a87..313dae998639 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file sir_api.h contains definitions exported by * Sirius software. * Author: Chandra Modumudi @@ -220,6 +211,18 @@ typedef enum { #endif +/* RSN capabilities structure */ + +struct rsn_caps { + uint16_t PreAuthSupported:1; + uint16_t NoPairwise:1; + uint16_t PTKSAReplayCounter:2; + uint16_t GTKSAReplayCounter:2; + uint16_t MFPRequired:1; + uint16_t MFPCapable:1; + uint16_t Reserved:8; +}; + /** * enum sir_roam_op_code - Operation to be done by the callback. * @SIR_ROAM_SYNCH_PROPAGATION: Propagate the new BSS info after roaming. @@ -1334,6 +1337,9 @@ typedef struct sSirSmeJoinReq { bool enable_bcast_probe_rsp; bool force_24ghz_in_ht20; bool force_rsne_override; + bool supported_nss_1x1; + uint8_t vdev_nss; + uint8_t nss; tSirBssDescription bssDescription; /* * WARNING: Pls make bssDescription as last variable in struct @@ -2902,6 +2908,24 @@ typedef struct sSirUpdateAPWPARSNIEsReq { #define SIR_OFFLOAD_ENABLE 1 #ifdef WLAN_NS_OFFLOAD +/** + * enum sir_ipv6_addr_scope - Internal identification of IPv6 addr scope + * @SIR_IPV6_ADDR_SCOPE_INVALID: invalid scope + * @SIR_IPV6_ADDR_SCOPE_NODELOCAL: node local scope + * @SIR_IPV6_ADDR_SCOPE_LINKLOCAL: link local scope + * @SIR_IPV6_ADDR_SCOPE_SITELOCAL: site local scope + * @SIR_IPV6_ADDR_SCOPE_ORGLOCAL: org local scope + * @SIR_IPV6_ADDR_SCOPE_GLOBAL: global scope + */ +enum sir_ipv6_addr_scope { + SIR_IPV6_ADDR_SCOPE_INVALID = 0, + SIR_IPV6_ADDR_SCOPE_NODELOCAL = 1, + SIR_IPV6_ADDR_SCOPE_LINKLOCAL = 2, + SIR_IPV6_ADDR_SCOPE_SITELOCAL = 3, + SIR_IPV6_ADDR_SCOPE_ORGLOCAL = 4, + SIR_IPV6_ADDR_SCOPE_GLOBAL = 5 +}; + typedef struct sSirNsOffloadReq { uint8_t srcIPv6Addr[SIR_MAC_IPV6_ADDR_LEN]; uint8_t selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN]; @@ -2911,7 +2935,35 @@ typedef struct sSirNsOffloadReq { uint8_t targetIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; uint8_t target_ipv6_addr_ac_type[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; uint8_t slotIdx; + enum sir_ipv6_addr_scope scope[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]; } tSirNsOffloadReq, *tpSirNsOffloadReq; + +/** + * sir_get_ipv6_addr_scope() - Convert linux specific IPv6 addr scope to + * WLAN driver specific value + * @scope: linux specific IPv6 addr scope + * + * Return: WLAN driver sepcific IPv6 addr scope + */ +static inline +enum sir_ipv6_addr_scope +sir_get_ipv6_addr_scope(uint32_t ipv6_scope) +{ + switch (ipv6_scope) { + case IPV6_ADDR_SCOPE_NODELOCAL: + return SIR_IPV6_ADDR_SCOPE_NODELOCAL; + case IPV6_ADDR_SCOPE_LINKLOCAL: + return SIR_IPV6_ADDR_SCOPE_LINKLOCAL; + case IPV6_ADDR_SCOPE_SITELOCAL: + return SIR_IPV6_ADDR_SCOPE_SITELOCAL; + case IPV6_ADDR_SCOPE_ORGLOCAL: + return SIR_IPV6_ADDR_SCOPE_ORGLOCAL; + case IPV6_ADDR_SCOPE_GLOBAL: + return SIR_IPV6_ADDR_SCOPE_GLOBAL; + default: + return SIR_IPV6_ADDR_SCOPE_INVALID; + } +} #endif /* WLAN_NS_OFFLOAD */ typedef struct sSirHostOffloadReq { @@ -3650,7 +3702,12 @@ typedef struct sSirRoamOffloadScanReq { struct roam_fils_params roam_fils_params; #endif struct scoring_param score_params; + struct rsn_caps rsn_caps; struct wmi_11k_offload_params offload_11k_params; + uint32_t ho_delay_for_rx; + uint32_t min_delay_btw_roam_scans; + uint32_t roam_trigger_reason_bitmask; + bool roam_force_rssi_trigger; } tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq; typedef struct sSirRoamOffloadScanRsp { @@ -4550,6 +4607,17 @@ struct sir_peer_sta_info { struct sir_peer_info info[MAX_PEER_STA]; }; +/** + * @sta_num: number of peer station which has valid info + * @info: peer extended information + * + * all SAP peer station's extended information retrieved + */ +struct sir_peer_sta_ext_info { + uint8_t sta_num; + struct sir_peer_info_ext info[MAX_PEER_STA]; +}; + typedef struct sSirAddPeriodicTxPtrn { /* MAC Address for the adapter */ struct qdf_mac_addr mac_address; @@ -7315,6 +7383,14 @@ struct sir_wake_lock_stats { * @pno_match: pno match wakeup count * @oem_response: oem response wakeup count * @pwr_save_fail_detected: pwr save fail detected wakeup count + * @mgmt_assoc: association request management frame + * @mgmt_disassoc: disassociation management frame + * @mgmt_assoc_resp: association response management frame + * @mgmt_reassoc: reassociate request management frame + * @mgmt_reassoc_resp: reassociate response management frame + * @mgmt_auth: authentication managament frame + * @mgmt_deauth: deauthentication management frame + * @mgmt_action: action managament frame */ struct sir_vdev_wow_stats { uint32_t ucast; @@ -7333,6 +7409,14 @@ struct sir_vdev_wow_stats { uint32_t pno_match; uint32_t oem_response; uint32_t pwr_save_fail_detected; + uint32_t mgmt_assoc; + uint32_t mgmt_disassoc; + uint32_t mgmt_assoc_resp; + uint32_t mgmt_reassoc; + uint32_t mgmt_reassoc_resp; + uint32_t mgmt_auth; + uint32_t mgmt_deauth; + uint32_t mgmt_action; }; /** @@ -7876,15 +7960,39 @@ struct sme_ndp_peer_ind { * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size * @vdev_id: vdev id of the session * @tx_aggregation_size: Tx aggregation size + * @tx_aggregation_size_be: Tx aggregation size for be queue + * @tx_aggregation_size_bk: Tx aggregation size for bk queue + * @tx_aggregation_size_vi: Tx aggregation size for vi queue + * @tx_aggregation_size_vo: Tx aggregation size for vo queue * @rx_aggregation_size: Rx aggregation size */ struct sir_set_tx_rx_aggregation_size { uint8_t vdev_id; uint32_t tx_aggregation_size; + uint32_t tx_aggregation_size_be; + uint32_t tx_aggregation_size_bk; + uint32_t tx_aggregation_size_vi; + uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; }; /** + * struct sir_set_tx_aggr_sw_retry_threshold - set sw retry threshold + * @vdev_id: vdev id of the session + * @tx_aggr_sw_retry_threshold_be: sw retry threshold for BE + * @tx_aggr_sw_retry_threshold_bk: sw retry threshold for BK + * @tx_aggr_sw_retry_threshold_vi: sw retry threshold for VI + * @tx_aggr_sw_retry_threshold_vo: sw retry threshold for VO + */ +struct sir_set_tx_aggr_sw_retry_threshold { + uint8_t vdev_id; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; +}; + +/** * struct sir_p2p_lo_start - p2p listen offload start * @vdev_id: vdev identifier * @ctl_flags: control flag diff --git a/core/mac/inc/sir_mac_prop_exts.h b/core/mac/inc/sir_mac_prop_exts.h index 260e081be46c..6f67f2c0a71b 100644 --- a/core/mac/inc/sir_mac_prop_exts.h +++ b/core/mac/inc/sir_mac_prop_exts.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file sir_mac_prop_exts.h contains the MAC protocol * extensions to support ANI feature set. diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 6613670b3700..f8d35c988654 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,13 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - - -/* * This file sir_mac_prot_def.h contains the MAC/PHY protocol * definitions used across various projects. */ @@ -1007,10 +997,10 @@ struct merged_mac_rate_set { uint8_t num_rates; uint8_t rate[2 * SIR_MAC_RATESET_EID_MAX]; }; - +/* Reserve 1 byte for NULL character in the SSID name field to print in %s */ typedef struct sSirMacSSid { uint8_t length; - uint8_t ssId[SIR_MAC_MAX_SSID_LENGTH]; + uint8_t ssId[SIR_MAC_MAX_SSID_LENGTH + 1]; } qdf_packed tSirMacSSid; typedef struct sSirMacWpaInfo { diff --git a/core/mac/inc/sir_types.h b/core/mac/inc/sir_types.h index 9580745ebb5f..81d0c8137e46 100644 --- a/core/mac/inc/sir_types.h +++ b/core/mac/inc/sir_types.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file sir_types.h contains the common types * diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index b0da05819a29..7177c5b1ea2d 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file wni_api.h contains message definitions exported by * Sirius software modules. * NOTE: See projects/sirius/include/sir_api.h for structure diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h index f60c7aed85d6..348995cdae84 100644 --- a/core/mac/inc/wni_cfg.h +++ b/core/mac/inc/wni_cfg.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WNICFG_H #define __WNICFG_H @@ -875,7 +866,7 @@ enum { #define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMIN 0 #define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMAX 8 -#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STADEF 8 +#define WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STADEF 4 /* * WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_FW_DEF + 1 is * assumed to be the default fw supported BF antennas, if fw diff --git a/core/mac/src/cfg/cfgUtil/cfg.txt b/core/mac/src/cfg/cfgUtil/cfg.txt index 04f5c095b69f..24aef950d09c 100644 --- a/core/mac/src/cfg/cfgUtil/cfg.txt +++ b/core/mac/src/cfg/cfgUtil/cfg.txt @@ -1,8 +1,5 @@ * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. * -* Previously licensed under the ISC license by Qualcomm Atheros, Inc. -* -* * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -16,11 +13,6 @@ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. - -* This file was originally distributed by Qualcomm Atheros, Inc. -* under proprietary terms before Copyright ownership was assigned -* to the Linux Foundation. - * * This is the data definition file for the CFG module. * Author: Kevin Nguyen diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index 3dddb39f6b6a..64748a7d5a38 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -1,9 +1,6 @@ /* * Copyright (c) 2006-2007, 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \file dot11f.frms * diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c index 84c74784bc5f..265b22779702 100644 --- a/core/mac/src/cfg/cfg_api.c +++ b/core/mac/src/cfg/cfg_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file contains the source code for CFG API functions. * diff --git a/core/mac/src/cfg/cfg_def.h b/core/mac/src/cfg/cfg_def.h index f3f5c49e0526..e521c6be8509 100644 --- a/core/mac/src/cfg/cfg_def.h +++ b/core/mac/src/cfg/cfg_def.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This is the private header file for CFG module. * diff --git a/core/mac/src/cfg/cfg_param_name.c b/core/mac/src/cfg/cfg_param_name.c index 2e88b4d755e7..be0063d7c847 100644 --- a/core/mac/src/cfg/cfg_param_name.c +++ b/core/mac/src/cfg/cfg_param_name.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/cfg/cfg_priv.h b/core/mac/src/cfg/cfg_priv.h index 78769f59c229..79fc0d7ce56e 100644 --- a/core/mac/src/cfg/cfg_priv.h +++ b/core/mac/src/cfg/cfg_priv.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This is the private header file for CFG module. * diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c index b653adb70b1c..33a92dd45862 100644 --- a/core/mac/src/cfg/cfg_proc_msg.c +++ b/core/mac/src/cfg/cfg_proc_msg.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file contains CFG functions for processing host messages. */ #include "cds_api.h" diff --git a/core/mac/src/cfg/cfg_send_msg.c b/core/mac/src/cfg/cfg_send_msg.c index ece9d3c029a3..9777d4d43f9b 100644 --- a/core/mac/src/cfg/cfg_send_msg.c +++ b/core/mac/src/cfg/cfg_send_msg.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file contains the source code for composing and sending messages * to host. * diff --git a/core/mac/src/dph/dph_hash_table.c b/core/mac/src/dph/dph_hash_table.c index 3fd4940a67db..e1f0d89af0f3 100644 --- a/core/mac/src/dph/dph_hash_table.c +++ b/core/mac/src/dph/dph_hash_table.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file dph_hash_table.cc implements the member functions of * DPH hash table class. diff --git a/core/mac/src/dph/dph_hash_table.h b/core/mac/src/dph/dph_hash_table.h index 5e666f0a1433..566144d54be4 100644 --- a/core/mac/src/dph/dph_hash_table.h +++ b/core/mac/src/dph/dph_hash_table.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2015, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file dph_hash_table.h contains the definition of the scheduler class. * diff --git a/core/mac/src/include/cfg_api.h b/core/mac/src/include/cfg_api.h index 6932d5071595..7d7d3f2433ea 100644 --- a/core/mac/src/include/cfg_api.h +++ b/core/mac/src/include/cfg_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * Author: Kevin Nguyen * Date: 04/09/02 diff --git a/core/mac/src/include/cfg_global.h b/core/mac/src/include/cfg_global.h index 960efac0bf5b..aea692245956 100644 --- a/core/mac/src/include/cfg_global.h +++ b/core/mac/src/include/cfg_global.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * Author: Sandesh Goel * Date: 02/09/03 diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 84604837f5bc..cdd8175a742b 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef DOT11F_H #define DOT11F_H /* @@ -35,7 +26,7 @@ * * * This file was automatically generated by 'framesc' - * Fri Feb 16 10:33:08 2018 from the following file(s): + * Thu May 10 17:00:57 2018 from the following file(s): * * dot11f.frms * @@ -57,6 +48,10 @@ typedef uint32_t tDOT11F_U64[2]; #define __must_check #endif +#if !defined unlikely +#define unlikely(x) (x) +#endif + /* * Frames Return Codes: * diff --git a/core/mac/src/include/dph_global.h b/core/mac/src/include/dph_global.h index d5e38e4293da..43272565fad9 100644 --- a/core/mac/src/include/dph_global.h +++ b/core/mac/src/include/dph_global.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index fdc879c9d77d..09fc3ad5472a 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file parser_api.h contains the definitions used * for parsing received 802.11 frames * Author: Chandra Modumudi diff --git a/core/mac/src/include/sir_common.h b/core/mac/src/include/sir_common.h index f6997725d52e..66078b9bcea7 100644 --- a/core/mac/src/include/sir_common.h +++ b/core/mac/src/include/sir_common.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file sir_common.h contains the common definitions used by all * Firmware modules. diff --git a/core/mac/src/include/sir_debug.h b/core/mac/src/include/sir_debug.h index af25ce0f3b84..06af332a1565 100644 --- a/core/mac/src/include/sir_debug.h +++ b/core/mac/src/include/sir_debug.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2015, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * Author: Sandesh Goel * Date: 02/25/02 */ diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index 9032e26cd6c2..6c6a3f8c5677 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file sir_params.h contains the common parameter definitions, which * are not dependent on threadX API. These can be used by all Firmware * modules. diff --git a/core/mac/src/include/sys_global.h b/core/mac/src/include/sys_global.h index b3c09d7911fe..97b61e7c8198 100644 --- a/core/mac/src/include/sys_global.h +++ b/core/mac/src/include/sys_global.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __SYS_GLOBAL_H__ #define __SYS_GLOBAL_H__ diff --git a/core/mac/src/include/utils_api.h b/core/mac/src/include/utils_api.h index 54f9e4b4da77..609b6ecad106 100644 --- a/core/mac/src/include/utils_api.h +++ b/core/mac/src/include/utils_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __UTILSAPI_H #define __UTILSAPI_H diff --git a/core/mac/src/pe/include/lim_admit_control.h b/core/mac/src/pe/include/lim_admit_control.h index 90eae86ee5f8..e49bf66f4666 100644 --- a/core/mac/src/pe/include/lim_admit_control.h +++ b/core/mac/src/pe/include/lim_admit_control.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * Author: Dinesh Upadhyay * Date: 10/24/06 diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 5994d95accee..f56056e8b0e9 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_api.h contains the definitions exported by * LIM module. diff --git a/core/mac/src/pe/include/lim_ft.h b/core/mac/src/pe/include/lim_ft.h index 645c53f44f39..596aac4b23ef 100644 --- a/core/mac/src/pe/include/lim_ft.h +++ b/core/mac/src/pe/include/lim_ft.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= Macros and Function prototypes FT and 802.11R purposes diff --git a/core/mac/src/pe/include/lim_ft_defs.h b/core/mac/src/pe/include/lim_ft_defs.h index 9ca4e83aa115..1602acf7e058 100644 --- a/core/mac/src/pe/include/lim_ft_defs.h +++ b/core/mac/src/pe/include/lim_ft_defs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= Macros and Function prototypes FT and 802.11R purposes diff --git a/core/mac/src/pe/include/lim_global.h b/core/mac/src/pe/include/lim_global.h index a5c12a2e1831..4bd7bdde5f5d 100644 --- a/core/mac/src/pe/include/lim_global.h +++ b/core/mac/src/pe/include/lim_global.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_global.h contains the definitions exported by * LIM module. diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index a8e8ca784bab..cafda29420c2 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__LIM_SESSION_H) #define __LIM_SESSION_H @@ -356,6 +347,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ uint32_t peerAIDBitmap[2]; bool tdls_prohibited; bool tdls_chan_swit_prohibited; + bool is_tdls_csa; #endif bool fWaitForProbeRsp; bool fIgnoreCapsChange; diff --git a/core/mac/src/pe/include/lim_trace.h b/core/mac/src/pe/include/lim_trace.h index 5b1d8248d3f7..e4228b071a01 100644 --- a/core/mac/src/pe/include/lim_trace.h +++ b/core/mac/src/pe/include/lim_trace.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2016, 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= * \file lim_trace.h diff --git a/core/mac/src/pe/include/rrm_api.h b/core/mac/src/pe/include/rrm_api.h index 7f599c3a2ca4..ea27c2fa0d25 100644 --- a/core/mac/src/pe/include/rrm_api.h +++ b/core/mac/src/pe/include/rrm_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \file rrm_api.h diff --git a/core/mac/src/pe/include/rrm_global.h b/core/mac/src/pe/include/rrm_global.h index e963ca276ed8..d5a56c11485b 100644 --- a/core/mac/src/pe/include/rrm_global.h +++ b/core/mac/src/pe/include/rrm_global.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__RRMGLOBAL_H) #define __RRMGLOBAL_H diff --git a/core/mac/src/pe/include/sch_api.h b/core/mac/src/pe/include/sch_api.h index 04db805e19f8..15451bcd54c4 100644 --- a/core/mac/src/pe/include/sch_api.h +++ b/core/mac/src/pe/include/sch_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * Author: Sandesh Goel * Date: 02/25/02 diff --git a/core/mac/src/pe/include/sch_global.h b/core/mac/src/pe/include/sch_global.h index baebe98f96de..d4245a00f58f 100644 --- a/core/mac/src/pe/include/sch_global.h +++ b/core/mac/src/pe/include/sch_global.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * * Author: Sandesh Goel diff --git a/core/mac/src/pe/include/wmm_apsd.h b/core/mac/src/pe/include/wmm_apsd.h index 9b5d5d4affd8..86f6017fb087 100644 --- a/core/mac/src/pe/include/wmm_apsd.h +++ b/core/mac/src/pe/include/wmm_apsd.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WMMAPSD_H__ #define __WMMAPSD_H__ diff --git a/core/mac/src/pe/lim/lim_admit_control.c b/core/mac/src/pe/lim/lim_admit_control.c index 7e5301eae679..557c41a108a7 100644 --- a/core/mac/src/pe/lim/lim_admit_control.c +++ b/core/mac/src/pe/lim/lim_admit_control.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file contains TSPEC and STA admit control related functions * NOTE: applies only to AP builds * diff --git a/core/mac/src/pe/lim/lim_aid_mgmt.c b/core/mac/src/pe/lim/lim_aid_mgmt.c index c1c0b48398d3..534277689ea7 100644 --- a/core/mac/src/pe/lim/lim_aid_mgmt.c +++ b/core/mac/src/pe/lim/lim_aid_mgmt.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_aid_mgmt.c contains the functions related to * AID pool management like initialization, assignment etc. diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 2d6f092bb19e..c71929ede3ac 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_api.cc contains the functions that are * exported by LIM to other modules. * @@ -1552,19 +1543,18 @@ lim_detect_change_in_ap_capabilities(tpAniSirGlobal pMac, * then send unicast probe request to AP and take decision after * receiving probe response */ if (true == psessionEntry->fIgnoreCapsChange) { - pe_warn("Ignoring the Capability change as it is false alarm"); + pe_debug("Ignoring the Capability change as it is false alarm"); return; } psessionEntry->fWaitForProbeRsp = true; pe_warn("AP capabilities are not matching, sending directed probe request"); status = lim_send_probe_req_mgmt_frame(pMac, &psessionEntry->ssId, - psessionEntry->bssId, - psessionEntry-> - currentOperChannel, - psessionEntry->selfMacAddr, - psessionEntry->dot11mode, - 0, NULL); + psessionEntry->bssId, + psessionEntry->currentOperChannel, + psessionEntry->selfMacAddr, + psessionEntry->dot11mode, + NULL, NULL); if (eSIR_SUCCESS != status) { pe_err("send ProbeReq failed"); @@ -2341,29 +2331,17 @@ tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(tpAniSirGlobal pMac, if ((subType == SIR_MAC_MGMT_BEACON) || (subType == SIR_MAC_MGMT_PROBE_RSP)) { if (lim_is_beacon_miss_scenario(pMac, pRxPacketInfo)) { - MTRACE(mac_trace - (pMac, TRACE_CODE_INFO_LOG, 0, - eLOG_NODROP_MISSED_BEACON_SCENARIO)); + MTRACE(mac_trace(pMac, TRACE_CODE_INFO_LOG, 0, + eLOG_NODROP_MISSED_BEACON_SCENARIO)); return eMGMT_DROP_NO_DROP; } - if (lim_is_system_in_scan_state(pMac)) { + if (lim_is_system_in_scan_state(pMac)) return eMGMT_DROP_NO_DROP; - } else if (WMA_IS_RX_IN_SCAN(pRxPacketInfo)) { + else if (WMA_IS_RX_IN_SCAN(pRxPacketInfo)) return eMGMT_DROP_SCAN_MODE_FRAME; - } else { - /* Beacons and probe responses can come in any time - * because of parallel scans. Don't drop them. - */ - return eMGMT_DROP_NO_DROP; - } - } - - framelen = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); - pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo); - /* Drop INFRA Beacons and Probe Responses in IBSS Mode */ - if ((subType == SIR_MAC_MGMT_BEACON) || - (subType == SIR_MAC_MGMT_PROBE_RSP)) { + framelen = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo); + pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo); /* drop the frame if length is less than 12 */ if (framelen < LIM_MIN_BCN_PR_LENGTH) return eMGMT_DROP_INVALID_SIZE; @@ -2377,14 +2355,17 @@ tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(tpAniSirGlobal pMac, if (!capabilityInfo.ibss) return eMGMT_DROP_NO_DROP; + /* Drop INFRA Beacons and Probe Responses in IBSS Mode */ /* This can be enhanced to even check the SSID before deciding to enque the frame. */ if (capabilityInfo.ess) return eMGMT_DROP_INFRA_BCN_IN_IBSS; + } else if ((subType == SIR_MAC_MGMT_PROBE_REQ) && (!WMA_GET_RX_BEACON_SENT(pRxPacketInfo))) { pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo); - psessionEntry = - pe_find_session_by_bssid(pMac, pHdr->bssId, &sessionId); + psessionEntry = pe_find_session_by_bssid(pMac, + pHdr->bssId, + &sessionId); if ((psessionEntry && !LIM_IS_IBSS_ROLE(psessionEntry)) || (!psessionEntry)) return eMGMT_DROP_NO_DROP; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 427252ee9c2d..5b62911dc988 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_assoc_utils.cc contains the utility functions * LIM uses while processing (Re) Association messages. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_assoc_utils.h b/core/mac/src/pe/lim/lim_assoc_utils.h index 8b656216de8f..dd342a3089a2 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.h +++ b/core/mac/src/pe/lim/lim_assoc_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_assoc_utils.h contains the utility definitions * LIM uses while processing Re/Association messages. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_ft.c b/core/mac/src/pe/lim/lim_ft.c index f13a8f257ffe..9965a8141500 100644 --- a/core/mac/src/pe/lim/lim_ft.c +++ b/core/mac/src/pe/lim/lim_ft.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \brief implementation for PE 11r VoWiFi FT Protocol diff --git a/core/mac/src/pe/lim/lim_ft_preauth.c b/core/mac/src/pe/lim/lim_ft_preauth.c index 503c9bf2bd2a..c8d1f5212e08 100644 --- a/core/mac/src/pe/lim/lim_ft_preauth.c +++ b/core/mac/src/pe/lim/lim_ft_preauth.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c index 28f1eb172ec1..4f2de438aa69 100644 --- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c +++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "cds_api.h" #include "ani_global.h" #include "sir_common.h" diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h index 8da04da30fb9..02d7cb2045f1 100644 --- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h +++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_ibss_peer_mgmt.h contains prototypes for * the utility functions LIM uses to maintain peers in IBSS. diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c index 5481502fe6c7..d438643f9a60 100644 --- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c +++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_link_monitoring_algo.cc contains the code for * Link monitoring algorithm on AP and heart beat failure * handling on STA. @@ -508,13 +499,13 @@ void lim_handle_heart_beat_failure(tpAniSirGlobal mac_ctx, session->bssId, curr_chan, session->selfMacAddr, session->dot11mode, - scan_ie->length, scan_ie->addIEdata); + &scan_ie->length, scan_ie->addIEdata); } else { lim_send_probe_req_mgmt_frame(mac_ctx, &session->ssId, session->bssId, curr_chan, session->selfMacAddr, - session->dot11mode, 0, NULL); + session->dot11mode, NULL, NULL); } } else { pe_debug("HB missed from AP on DFS chanel moving to passive"); diff --git a/core/mac/src/pe/lim/lim_p2p.c b/core/mac/src/pe/lim/lim_p2p.c index 2b58f5799caa..43351cd3ffa9 100644 --- a/core/mac/src/pe/lim/lim_p2p.c +++ b/core/mac/src/pe/lim/lim_p2p.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== L I M _ P 2 P . C diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 583d0542c655..8dce8b910d69 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_process_action_frame.cc contains the code * for processing Action Frame. * Author: Michael Lui diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index dfbe6cbc95ca..668196712b7f 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_process_assoc_req_frame.c contains the code * for processing Re/Association Request Frame. */ diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index adca3ffa06ee..83b5bb2999f2 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_process_assoc_rsp_frame.cc contains the code * for processing Re/Association Response Frame. diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c index 6c1a99e4b4af..884656ef2b2a 100644 --- a/core/mac/src/pe/lim/lim_process_auth_frame.c +++ b/core/mac/src/pe/lim/lim_process_auth_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_process_auth_frame.cc contains the code * for processing received Authentication Frame. @@ -1148,7 +1139,15 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, pe_session->limMlmState, MAC_ADDR_ARRAY(mac_hdr->bssId), (uint) abs((int8_t) WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info))); - if (pe_session->prev_auth_seq_num == curr_seq_num) { + /* + * IOT AP configured in WEP open type sends auth frame with + * same sequence number. DUT sends auth frame, first with auth + * algo as shared key and then as open system. Since, AP sends + * auth frame with same sequence number, DUT drops the second + * auth frame from AP which results in authentication failure. + */ + if (pe_session->prev_auth_seq_num == curr_seq_num && + mac_hdr->fc.retry) { pe_err("auth frame, seq num: %d is already processed, drop it", curr_seq_num); return; diff --git a/core/mac/src/pe/lim/lim_process_beacon_frame.c b/core/mac/src/pe/lim/lim_process_beacon_frame.c index 5a08faab99aa..84e19aadde21 100644 --- a/core/mac/src/pe/lim/lim_process_beacon_frame.c +++ b/core/mac/src/pe/lim/lim_process_beacon_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_process_beacon_frame.cc contains the code * for processing Received Beacon Frame. diff --git a/core/mac/src/pe/lim/lim_process_cfg_updates.c b/core/mac/src/pe/lim/lim_process_cfg_updates.c index 1a090044ce7a..85874e419d9c 100644 --- a/core/mac/src/pe/lim/lim_process_cfg_updates.c +++ b/core/mac/src/pe/lim/lim_process_cfg_updates.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_process_cfg_updates.cc contains the utility functions * to handle various CFG parameter update events * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_process_deauth_frame.c b/core/mac/src/pe/lim/lim_process_deauth_frame.c index 02837a61cf1e..ac38ecb88e00 100644 --- a/core/mac/src/pe/lim/lim_process_deauth_frame.c +++ b/core/mac/src/pe/lim/lim_process_deauth_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_process_deauth_frame.cc contains the code * for processing Deauthentication Frame. diff --git a/core/mac/src/pe/lim/lim_process_disassoc_frame.c b/core/mac/src/pe/lim/lim_process_disassoc_frame.c index c8ae79fc8618..8a5901174362 100644 --- a/core/mac/src/pe/lim/lim_process_disassoc_frame.c +++ b/core/mac/src/pe/lim/lim_process_disassoc_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_process_disassoc_frame.cc contains the code * for processing Disassocation Frame. diff --git a/core/mac/src/pe/lim/lim_process_fils.c b/core/mac/src/pe/lim/lim_process_fils.c index 57c26243abff..0056b5ab2876 100644 --- a/core/mac/src/pe/lim/lim_process_fils.c +++ b/core/mac/src/pe/lim/lim_process_fils.c @@ -862,7 +862,12 @@ static int lim_create_fils_wrapper_data(struct pe_fils_session *fils_info) uint8_t auth_tag[FILS_AUTH_TAG_MAX_LENGTH] = {0}; uint32_t length = 0; QDF_STATUS status; - int buf_len = + int buf_len; + + if (!fils_info) + return 0; + + buf_len = /* code + identifier */ sizeof(uint8_t) * 2 + /* length */ @@ -876,9 +881,6 @@ static int lim_create_fils_wrapper_data(struct pe_fils_session *fils_info) /* cryptosuite + auth_tag */ sizeof(uint8_t) + lim_get_auth_tag_len(HMAC_SHA256_128); - if (!fils_info) - return 0; - fils_info->fils_erp_reauth_pkt = qdf_mem_malloc(buf_len); if (!fils_info->fils_erp_reauth_pkt) { pe_err("failed to allocate memory"); @@ -1208,7 +1210,7 @@ uint32_t lim_create_fils_auth_data(tpAniSirGlobal mac_ctx, tpPESession session) { uint32_t frame_len = 0; - uint32_t wrapped_data_len; + int32_t wrapped_data_len; if (!session->fils_info) return 0; diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 15e8adff5950..3d956c86fee0 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim ProcessMessageQueue.cc contains the code * for processing LIM message Queue. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_process_mlm_host_roam.c b/core/mac/src/pe/lim/lim_process_mlm_host_roam.c index b7c637324acc..7d428bd4eb7d 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_host_roam.c +++ b/core/mac/src/pe/lim/lim_process_mlm_host_roam.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 78be544abc09..2ec5a8a8c658 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "cds_api.h" #include "wni_cfg.h" #include "ani_global.h" @@ -558,6 +549,12 @@ lim_mlm_add_bss(tpAniSirGlobal mac_ctx, mlm_start_req->cfParamSet.cfpDurRemaining; addbss_param->rateSet.numRates = mlm_start_req->rateSet.numRates; + if (addbss_param->rateSet.numRates > SIR_MAC_RATESET_EID_MAX) { + pe_warn("num of sup rates %d exceeding the limit %d, resetting", + addbss_param->rateSet.numRates, + SIR_MAC_RATESET_EID_MAX); + addbss_param->rateSet.numRates = SIR_MAC_RATESET_EID_MAX; + } qdf_mem_copy(addbss_param->rateSet.rate, mlm_start_req->rateSet.rate, mlm_start_req->rateSet.numRates); @@ -582,9 +579,16 @@ lim_mlm_add_bss(tpAniSirGlobal mac_ctx, addbss_param->sessionId = mlm_start_req->sessionId; /* Send the SSID to HAL to enable SSID matching for IBSS */ - qdf_mem_copy(&(addbss_param->ssId.ssId), - mlm_start_req->ssId.ssId, mlm_start_req->ssId.length); addbss_param->ssId.length = mlm_start_req->ssId.length; + if (addbss_param->ssId.length > SIR_MAC_MAX_SSID_LENGTH) { + pe_err("Invalid ssid length %d, max length allowed %d", + addbss_param->ssId.length, + SIR_MAC_MAX_SSID_LENGTH); + qdf_mem_free(addbss_param); + return eSIR_SME_INVALID_PARAMETERS; + } + qdf_mem_copy(addbss_param->ssId.ssId, + mlm_start_req->ssId.ssId, addbss_param->ssId.length); addbss_param->bHiddenSSIDEn = mlm_start_req->ssidHidden; pe_debug("TRYING TO HIDE SSID %d", addbss_param->bHiddenSSIDEn); /* CR309183. Disable Proxy Probe Rsp. Host handles Probe Requests. Until FW fixed. */ @@ -634,6 +638,14 @@ lim_mlm_add_bss(tpAniSirGlobal mac_ctx, addbss_param->nss_5g = mac_ctx->vdev_type_nss_5g.ibss; addbss_param->tx_aggregation_size = mac_ctx->roam.configParam.tx_aggregation_size; + addbss_param->tx_aggregation_size_be = + mac_ctx->roam.configParam.tx_aggregation_size_be; + addbss_param->tx_aggregation_size_bk = + mac_ctx->roam.configParam.tx_aggregation_size_bk; + addbss_param->tx_aggregation_size_vi = + mac_ctx->roam.configParam.tx_aggregation_size_vi; + addbss_param->tx_aggregation_size_vo = + mac_ctx->roam.configParam.tx_aggregation_size_vo; addbss_param->rx_aggregation_size = mac_ctx->roam.configParam.rx_aggregation_size; } @@ -1220,6 +1232,10 @@ static void lim_process_mlm_auth_req(tpAniSirGlobal mac_ctx, uint32_t *msg) goto end; } else { pe_debug("lim_process_mlm_auth_req_sae is successful"); + lim_diag_event_report(mac_ctx, + WLAN_PE_DIAG_AUTH_ALGO_NUM, + session, eSIR_SUCCESS, + eSIR_AUTH_TYPE_SAE); return; } } else @@ -1236,6 +1252,9 @@ static void lim_process_mlm_auth_req(tpAniSirGlobal mac_ctx, uint32_t *msg) auth_frame_body.authAlgoNumber = (uint8_t) mac_ctx->lim.gpLimMlmAuthReq->authType; } + lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_AUTH_ALGO_NUM, + session, eSIR_SUCCESS, + auth_frame_body.authAlgoNumber); /* Prepare & send Authentication frame */ auth_frame_body.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1; @@ -2277,7 +2296,7 @@ static void lim_process_periodic_probe_req_timer(tpAniSirGlobal mac_ctx) &mlm_scan_req->ssId[i], mlm_scan_req->bssId, channel_num, mac_ctx->lim.gSelfMacAddr, mlm_scan_req->dot11mode, - mlm_scan_req->uIEFieldLen, + &mlm_scan_req->uIEFieldLen, (uint8_t *) (mlm_scan_req) + mlm_scan_req->uIEFieldOffset); if (status != eSIR_SUCCESS) { @@ -2386,7 +2405,7 @@ static void lim_process_periodic_join_probe_req_timer(tpAniSirGlobal mac_ctx) session->pLimMlmJoinReq->bssDescription.bssId, session->currentOperChannel /*chanNum */, session->selfMacAddr, session->dot11mode, - session->pLimJoinReq->addIEScan.length, + &session->pLimJoinReq->addIEScan.length, session->pLimJoinReq->addIEScan.addIEdata); lim_deactivate_and_change_timer(mac_ctx, eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER); diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 32b666d73b79..34956ae44849 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "wni_api.h" #include "wni_cfg.h" #include "cfg_api.h" @@ -62,7 +53,7 @@ void lim_process_mlm_reassoc_ind(tpAniSirGlobal, uint32_t *); void lim_process_mlm_set_keys_cnf(tpAniSirGlobal, uint32_t *); void lim_process_mlm_disassoc_ind(tpAniSirGlobal, uint32_t *); void lim_process_mlm_disassoc_cnf(tpAniSirGlobal, uint32_t *); -void lim_process_mlm_deauth_ind(tpAniSirGlobal, uint32_t *); +static void lim_process_mlm_deauth_ind(tpAniSirGlobal, tLimMlmDeauthInd *); void lim_process_mlm_deauth_cnf(tpAniSirGlobal, uint32_t *); void lim_process_mlm_purge_sta_ind(tpAniSirGlobal, uint32_t *); void lim_get_session_info(tpAniSirGlobal pMac, uint8_t *, uint8_t *, @@ -128,7 +119,7 @@ lim_process_mlm_rsp_messages(tpAniSirGlobal pMac, uint32_t msgType, lim_process_mlm_deauth_cnf(pMac, pMsgBuf); break; case LIM_MLM_DEAUTH_IND: - lim_process_mlm_deauth_ind(pMac, pMsgBuf); + lim_process_mlm_deauth_ind(pMac, (tLimMlmDeauthInd *)pMsgBuf); break; case LIM_MLM_SETKEYS_CNF: lim_process_mlm_set_keys_cnf(pMac, pMsgBuf); @@ -1002,56 +993,43 @@ void lim_process_mlm_disassoc_cnf(tpAniSirGlobal mac_ctx, } /** - * lim_process_mlm_deauth_ind() + * lim_process_mlm_deauth_ind() - processes MLM_DEAUTH_IND + * @mac_ctx: global mac structure + * @deauth_ind: deauth indication * - ***FUNCTION: * This function is called to processes MLM_DEAUTH_IND * message from MLM State machine. * - ***LOGIC: - * - ***ASSUMPTIONS: - * - ***NOTE: - * - * @param pMac Pointer to Global MAC structure - * @param pMsgBuf A pointer to the MLM message buffer - * - * @return None + * Return: None */ -void lim_process_mlm_deauth_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf) +static void lim_process_mlm_deauth_ind(tpAniSirGlobal mac_ctx, + tLimMlmDeauthInd *deauth_ind) { - tLimMlmDeauthInd *pMlmDeauthInd; - tpPESession psessionEntry; - uint8_t sessionId; + tpPESession session; + uint8_t session_id; + enum eLimSystemRole role; - pMlmDeauthInd = (tLimMlmDeauthInd *) pMsgBuf; - psessionEntry = pe_find_session_by_bssid(pMac, - pMlmDeauthInd->peerMacAddr, &sessionId); - if (psessionEntry == NULL) { + if (!deauth_ind) { + pe_err("deauth_ind is null"); + return; + } + session = pe_find_session_by_bssid(mac_ctx, + deauth_ind->peerMacAddr, + &session_id); + if (!session) { pe_err("session does not exist for Addr:" MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(pMlmDeauthInd->peerMacAddr)); + MAC_ADDR_ARRAY(deauth_ind->peerMacAddr)); return; } - switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) { - case eLIM_STA_IN_IBSS_ROLE: - break; - case eLIM_STA_ROLE: - psessionEntry->limSmeState = eLIM_SME_WT_DEAUTH_STATE; - MTRACE(mac_trace - (pMac, TRACE_CODE_SME_STATE, psessionEntry->peSessionId, - psessionEntry->limSmeState)); - - default: /* eLIM_AP_ROLE */ - { - pe_debug("*** Received Deauthentication from staId=%d ***", - pMlmDeauthInd->aid); + role = GET_LIM_SYSTEM_ROLE(session); + pe_debug("*** Received Deauthentication from staId=%d role=%d***", + deauth_ind->aid, role); + if (role == eLIM_STA_ROLE) { + session->limSmeState = eLIM_SME_WT_DEAUTH_STATE; + MTRACE(mac_trace(mac_ctx, TRACE_CODE_SME_STATE, + session->peSessionId, session->limSmeState)); } - /* Send SME_DEAUTH_IND after Polaris cleanup */ - /* (after receiving LIM_MLM_PURGE_STA_IND) */ - break; - } /* end switch (GET_LIM_SYSTEM_ROLE(psessionEntry)) */ -} /*** end lim_process_mlm_deauth_ind() ***/ +} /** * lim_process_mlm_deauth_cnf() @@ -3066,7 +3044,7 @@ static void lim_process_switch_channel_join_req( session_entry->pLimMlmJoinReq->bssDescription.bssId, session_entry->currentOperChannel, session_entry->selfMacAddr, session_entry->dot11mode, - session_entry->pLimJoinReq->addIEScan.length, + &session_entry->pLimJoinReq->addIEScan.length, session_entry->pLimJoinReq->addIEScan.addIEdata); if (session_entry->pePersona == QDF_P2P_CLIENT_MODE) { @@ -3135,7 +3113,7 @@ void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *body) psessionEntry = pe_find_session_by_session_id(pMac, peSessionId); if (psessionEntry == NULL) { pe_err("session does not exist for given sessionId"); - return; + goto free; } psessionEntry->ch_switch_in_progress = false; /* HAL fills in the tx power used for mgmt frames in this field. */ @@ -3201,6 +3179,7 @@ void lim_process_switch_channel_rsp(tpAniSirGlobal pMac, void *body) default: break; } +free: qdf_mem_free(body); } diff --git a/core/mac/src/pe/lim/lim_process_probe_req_frame.c b/core/mac/src/pe/lim/lim_process_probe_req_frame.c index 60add74521c4..82961f0b025c 100644 --- a/core/mac/src/pe/lim/lim_process_probe_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_probe_req_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_process_probe_req_frame.cc contains the code * for processing Probe Request Frame. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c index 99d1211611f3..ca675bdfb7d4 100644 --- a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_process_probe_rsp_frame.cc contains the code * for processing Probe Response Frame. @@ -236,11 +227,14 @@ lim_process_probe_rsp_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_Packet_info, if (LIM_IS_STA_ROLE(session_entry) && !wma_is_csa_offload_enabled()) { if (probe_rsp->channelSwitchPresent) { +#ifdef FEATURE_WLAN_TDLS /* * on receiving channel switch announcement * from AP, delete all TDLS peers before * leaving BSS and proceed for channel switch */ + session_entry->is_tdls_csa = true; +#endif lim_delete_tdls_peers(mac_ctx, session_entry); lim_update_channel_switch(mac_ctx, diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index c3a1a96e030d..2d25981f30be 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_process_sme_req_messages.cc contains the code * for processing SME request messages. * Author: Chandra Modumudi @@ -1895,6 +1886,10 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) session->encryptType = sme_join_req->UCEncryptionType; + session->supported_nss_1x1 = sme_join_req->supported_nss_1x1; + session->vdev_nss = sme_join_req->vdev_nss; + session->nss = sme_join_req->nss; + mlm_join_req->bssDescription.length = session->pLimJoinReq->bssDescription.length; @@ -2148,6 +2143,10 @@ static void __lim_process_sme_reassoc_req(tpAniSirGlobal mac_ctx, pe_debug("vht su bformer [%d]", session_entry->vht_config.su_beam_former); } + session_entry->supported_nss_1x1 = reassoc_req->supported_nss_1x1; + session_entry->vdev_nss = reassoc_req->vdev_nss; + session_entry->nss = reassoc_req->nss; + pe_debug("vhtCapability: %d su_beam_formee: %d su_tx_bformer %d", session_entry->vhtCapability, session_entry->vht_config.su_beam_formee, @@ -2591,6 +2590,8 @@ static void __lim_process_sme_disassoc_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBu tpDphHashNode pStaDs; tpPESession psessionEntry; uint8_t sessionId; + uint32_t *msg = NULL; + QDF_STATUS status; qdf_mem_copy(&smeDisassocCnf, pMsgBuf, sizeof(struct sSirSmeDisassocCnf)); @@ -2600,11 +2601,26 @@ static void __lim_process_sme_disassoc_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBu &sessionId); if (psessionEntry == NULL) { pe_err("session does not exist for given bssId"); + status = lim_prepare_disconnect_done_ind(pMac, &msg, + CSR_SESSION_ID_INVALID, + eSIR_SME_INVALID_SESSION, + NULL); + if (QDF_IS_STATUS_SUCCESS(status)) + lim_send_sme_disassoc_deauth_ntf(pMac, + QDF_STATUS_SUCCESS, + (uint32_t *)msg); return; } if (!lim_is_sme_disassoc_cnf_valid(pMac, &smeDisassocCnf, psessionEntry)) { pe_err("received invalid SME_DISASSOC_CNF message"); + status = lim_prepare_disconnect_done_ind(pMac, &msg, sessionId, + eSIR_SME_INVALID_PARAMETERS, + &smeDisassocCnf.bssid.bytes[0]); + if (QDF_IS_STATUS_SUCCESS(status)) + lim_send_sme_disassoc_deauth_ntf(pMac, + QDF_STATUS_SUCCESS, + (uint32_t *)msg); return; } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ @@ -2628,6 +2644,15 @@ static void __lim_process_sme_disassoc_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBu psessionEntry->limSmeState); lim_print_sme_state(pMac, LOGE, psessionEntry->limSmeState); + status = lim_prepare_disconnect_done_ind(pMac, &msg, + sessionId, + eSIR_SME_INVALID_STATE, + &smeDisassocCnf.bssid. + bytes[0]); + if (QDF_IS_STATUS_SUCCESS(status)) + lim_send_sme_disassoc_deauth_ntf(pMac, + QDF_STATUS_SUCCESS, + (uint32_t *)msg); return; } break; @@ -2640,7 +2665,13 @@ static void __lim_process_sme_disassoc_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBu default: /* eLIM_UNKNOWN_ROLE */ pe_err("received unexpected SME_DISASSOC_CNF role %d", GET_LIM_SYSTEM_ROLE(psessionEntry)); - + status = lim_prepare_disconnect_done_ind(pMac, &msg, sessionId, + eSIR_SME_INVALID_STATE, + &smeDisassocCnf.bssid.bytes[0]); + if (QDF_IS_STATUS_SUCCESS(status)) + lim_send_sme_disassoc_deauth_ntf(pMac, + QDF_STATUS_SUCCESS, + (uint32_t *)msg); return; } @@ -2654,16 +2685,32 @@ static void __lim_process_sme_disassoc_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBu pe_err("DISASSOC_CNF for a STA with no context, addr= " MAC_ADDRESS_STR, MAC_ADDR_ARRAY(smeDisassocCnf.peer_macaddr.bytes)); + status = lim_prepare_disconnect_done_ind(pMac, &msg, + sessionId, + eSIR_SME_INVALID_PARAMETERS, + &smeDisassocCnf.bssid.bytes[0]); + if (QDF_IS_STATUS_SUCCESS(status)) + lim_send_sme_disassoc_deauth_ntf(pMac, + QDF_STATUS_SUCCESS, + (uint32_t *)msg); return; } if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) || (pStaDs->mlmStaContext.mlmState == - eLIM_MLM_WT_DEL_STA_RSP_STATE)) { + eLIM_MLM_WT_DEL_BSS_RSP_STATE)) { pe_err("No need of cleanup for addr:" MAC_ADDRESS_STR "as MLM state is %d", MAC_ADDR_ARRAY(smeDisassocCnf.peer_macaddr.bytes), pStaDs->mlmStaContext.mlmState); + status = lim_prepare_disconnect_done_ind(pMac, &msg, + CSR_SESSION_ID_INVALID, + eSIR_SME_SUCCESS, + NULL); + if (QDF_IS_STATUS_SUCCESS(status)) + lim_send_sme_disassoc_deauth_ntf(pMac, + QDF_STATUS_SUCCESS, + (uint32_t *)msg); return; } @@ -2749,6 +2796,7 @@ static void __lim_process_sme_deauth_req(tpAniSirGlobal mac_ctx, case eLIM_SME_LINK_EST_STATE: /* Delete all TDLS peers connected before leaving BSS */ lim_delete_tdls_peers(mac_ctx, session_entry); + /* fallthrough */ case eLIM_SME_WT_ASSOC_STATE: case eLIM_SME_JOIN_FAILURE_STATE: case eLIM_SME_IDLE_STATE: @@ -5049,7 +5097,7 @@ static void lim_process_sme_update_access_policy_vendor_ie( { struct sme_update_access_policy_vendor_ie *update_vendor_ie; struct sPESession *pe_session_entry; - uint8_t num_bytes; + uint16_t num_bytes; if (!msg) { pe_err("Buffer is Pointing to NULL"); diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index c789401a96aa..9d7b2897e39f 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== * lim_process_tdls.c * OVERVIEW: @@ -3310,7 +3301,7 @@ tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx, if (lim_is_roam_synch_in_progress(session_entry)) return eSIR_SUCCESS; - if (mac_ctx->lim.sme_msg_callback) { + if (!session_entry->is_tdls_csa && mac_ctx->lim.sme_msg_callback) { tdls_state_disable = qdf_mem_malloc( sizeof(*tdls_state_disable)); if (NULL == tdls_state_disable) { @@ -3324,6 +3315,10 @@ tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx, mac_ctx->lim.sme_msg_callback(mac_ctx, &msg); } + if (session_entry->is_tdls_csa) + /* reset the csa flag */ + session_entry->is_tdls_csa = false; + lim_send_sme_tdls_delete_all_peer_ind(mac_ctx, session_entry); pe_debug("Exit"); return eSIR_SUCCESS; diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index ffc699b28086..01dd4d88298a 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-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 @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_prop_exts_utils.cc contains the utility functions * to populate, parse proprietary extensions required to @@ -110,349 +101,6 @@ static inline void get_ese_version_ie_probe_response(tpAniSirGlobal mac_ctx, #endif /** - * lim_get_nss_supported_by_sta_and_ap() - finds out nss from session - * and beacon from AP - * @bcn: beacon structure pointer - * @session: pointer to pe session - * - * Return: number of nss advertised by beacon - */ -static uint8_t lim_get_nss_supported_by_sta_and_ap(tpSchBeaconStruct bcn, - tpPESession session) -{ - if (session->vhtCapability && bcn->VHTCaps.present) { - if ((bcn->VHTCaps.rxMCSMap & 0xC0) != 0xC0) - return 4; - - if ((bcn->VHTCaps.rxMCSMap & 0x30) != 0x30) - return 3; - - if ((bcn->VHTCaps.rxMCSMap & 0x0C) != 0x0C) - return 2; - } else if (session->htCapability && bcn->HTCaps.present) { - if (bcn->HTCaps.supportedMCSSet[3]) - return 4; - - if (bcn->HTCaps.supportedMCSSet[2]) - return 3; - - if (bcn->HTCaps.supportedMCSSet[1]) - return 2; - } - - return 1; -} - -/** - * lim_check_for_vendor_oui_data() - compares for vendor OUI data from IE - * and returns true if OUI data matches with the ini - * @extension: pointer to action oui extention data - * @oui_ptr: pointer to Vendor IE in the beacon - * - * Return: true or false - */ -static bool -lim_check_for_vendor_oui_data(struct wmi_action_oui_extension *extension, - uint8_t *oui_ptr) -{ - uint8_t *data, elem_len, data_len; - uint8_t i, j; - uint8_t data_mask = 0x80; - - elem_len = oui_ptr[1]; - data_len = elem_len - extension->oui_length; - - if (data_len != extension->data_length) - return false; - - data = &oui_ptr[2 + extension->oui_length]; - for (i = 0, j = 0; - (i < data_len && j < extension->data_mask_length); - i++) { - if ((extension->data_mask[j] & data_mask) && - !(extension->data[i] == data[i])) - return false; - data_mask = data_mask >> 1; - if (!data_mask) { - data_mask = 0x80; - j++; - } - } - - return true; -} - -/** - * lim_check_for_vendor_ap_mac() - compares for vendor AP MAC in the ini with - * bssid from the session and returns true if matches - * @extension: pointer to action oui extention data - * @bssid: bssid of the AP to which we are connecting - * - * Return: true or false - */ -static bool -lim_check_for_vendor_ap_mac(struct wmi_action_oui_extension *extension, - tSirMacAddr bssid) -{ - uint8_t i; - uint8_t mac_mask = 0x80; - - for (i = 0; i < QDF_MAC_ADDR_SIZE; i++) { - if ((*extension->mac_mask & mac_mask) && - !(extension->mac_addr[i] == bssid[i])) - return false; - mac_mask = mac_mask >> 1; - } - - return true; -} - -/** - * lim_check_for_vendor_ap_capabilities() - compares for various Vendor AP - * capabilities like NSS, HT, VHT, Band from the ini with the AP's capability - * from the beacon and returns true if all the capability matches - * @extension: pointer to action oui extention data - * @beacon_struct: pointer to the beacon structure - * @session: PE session - * - * Return: true or false - */ -static bool -lim_check_for_vendor_ap_capabilities(struct wmi_action_oui_extension *extension, - tSirProbeRespBeacon *beacon_struct, - tpPESession session) -{ - uint8_t nss = 0, nss_mask = 0; - - if (beacon_struct) { - nss = lim_get_nss_supported_by_sta_and_ap(beacon_struct, - session); - nss_mask = 1 << (nss - 1); - } - - if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_NSS) { - if (!((*extension->capability & - WMI_ACTION_OUI_CAPABILITY_NSS_MASK) & - nss_mask)) - return false; - } - - if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_HT && - beacon_struct) { - if (*extension->capability & - WMI_ACTION_OUI_CAPABILITY_HT_ENABLE_MASK) { - if (!beacon_struct->HTCaps.present) - return false; - } else { - if (beacon_struct->HTCaps.present) - return false; - } - } - - if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_VHT && - beacon_struct) { - if (*extension->capability & - WMI_ACTION_OUI_CAPABILITY_VHT_ENABLE_MASK) { - if (!beacon_struct->VHTCaps.present) - return false; - } else { - if (beacon_struct->VHTCaps.present) - return false; - } - } - - if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_BAND) { - if ((*extension->capability & - WMI_ACTION_OUI_CAPABILITY_2G_BAND_MASK) && - !(IS_24G_CH(session->currentOperChannel))) - return false; - if ((*extension->capability & - WMI_ACTION_CAPABILITY_5G_BAND_MASK) && - !(IS_5G_CH(session->currentOperChannel))) - return false; - } - - return true; -} - -/** - * lim_dump_vendor_ies() - Dumps all the vendor IEs - * @ie: ie buffer - * @ie_len: length of ie buffer - * - * This function dumps the vendor IEs present in the AP's IE buffer - * - * Return: none - */ -static -void lim_dump_vendor_ies(uint8_t *ie, uint16_t ie_len) -{ - int32_t left = ie_len; - uint8_t *ptr = ie; - uint8_t elem_id, elem_len; - - while (left >= 2) { - elem_id = ptr[0]; - elem_len = ptr[1]; - left -= 2; - if (elem_len > left) { - pe_err("Invalid IEs eid: %d elem_len: %d left: %d", - elem_id, elem_len, left); - return; - } - if (SIR_MAC_EID_VENDOR == elem_id) { - pe_debug("Dumping Vendor IE of len %d", elem_len); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, - QDF_TRACE_LEVEL_DEBUG, - &ptr[2], elem_len); - } - - left -= elem_len; - ptr += (elem_len + 2); - } -} - -bool -lim_check_vendor_ap_present(tpAniSirGlobal mac_ctx, - tSirProbeRespBeacon *beacon_struct, - tpPESession session, uint8_t *ie, uint16_t ie_len, - enum wmi_action_oui_id action_id) -{ - struct ani_action_oui *sme_action; - struct ani_action_oui_extension *sme_ext; - struct wmi_action_oui_extension *extension; - qdf_list_node_t *node = NULL; - qdf_list_node_t *next_node = NULL; - qdf_list_t *oui_ext_list; - QDF_STATUS qdf_status; - uint8_t *oui_ptr; - - if (action_id > WMI_ACTION_OUI_MAXIMUM_ID) { - pe_debug("Invalid OUI action ID"); - return false; - } - - if (!mac_ctx->oui_info) { - pe_debug("action oui support is disabled or oui info is empty"); - return false; - } - - sme_action = mac_ctx->oui_info->action_oui[action_id]; - if (!sme_action) { - pe_debug("action oui for id %d is empty", action_id); - return false; - } - - oui_ext_list = &sme_action->oui_ext_list; - - qdf_mutex_acquire(&sme_action->oui_ext_list_lock); - if (qdf_list_empty(oui_ext_list)) { - qdf_mutex_release(&sme_action->oui_ext_list_lock); - pe_debug("OUI List Empty"); - return false; - } - - lim_dump_vendor_ies(ie, ie_len); - - qdf_list_peek_front(oui_ext_list, &node); - while (node) { - sme_ext = qdf_container_of(node, - struct ani_action_oui_extension, - item); - - extension = &sme_ext->extension; - - if (!extension->oui_length) - goto next; - - oui_ptr = cfg_get_vendor_ie_ptr_from_oui(mac_ctx, - extension->oui, - extension->oui_length, - ie, ie_len); - if (!oui_ptr) { - pe_debug("No matching IE found for OUI"); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, - QDF_TRACE_LEVEL_DEBUG, - extension->oui, - extension->oui_length); - goto next; - } - - pe_debug("IE found for OUI"); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, - QDF_TRACE_LEVEL_DEBUG, - extension->oui, - extension->oui_length); - - if (extension->data_length && - !lim_check_for_vendor_oui_data(extension, oui_ptr)) { - pe_debug("Vendor IE Data mismatch"); - goto next; - } - - if ((extension->info_mask & WMI_ACTION_OUI_INFO_MAC_ADDRESS) && - !lim_check_for_vendor_ap_mac(extension, session->bssId)) { - pe_debug("Vendor IE MAC Mismatch"); - goto next; - } - - if (!lim_check_for_vendor_ap_capabilities(extension, - beacon_struct, - session)) { - pe_debug("Vendor IE capabilties mismatch"); - goto next; - } - - pe_debug("Vendor AP found for OUI"); - QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, - extension->oui, extension->oui_length); - qdf_mutex_release(&sme_action->oui_ext_list_lock); - return true; -next: - qdf_status = qdf_list_peek_next(oui_ext_list, - node, &next_node); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) - break; - - node = next_node; - next_node = NULL; - } - - qdf_mutex_release(&sme_action->oui_ext_list_lock); - return false; -} - -/** - * lim_check_vendor_ap_3_present() - Check if Vendor AP 3 is present - * @mac_ctx: Pointer to Global MAC structure - * @p_ie: Pointer to starting IE in Beacon/Probe Response - * @ie_len: Length of all IEs combined - * - * For Vendor AP 3, the condition is that Vendor AP 3 IE should be present - * and Vendor AP 4 IE should not be present. - * If Vendor AP 3 IE is present and Vendor AP 4 IE is also present, - * return false, else return true. - * - * Return: true or false - */ -static bool -lim_check_vendor_ap_3_present(tpAniSirGlobal mac_ctx, uint8_t *ie, - uint16_t ie_len) -{ - bool ret = true; - - if ((cfg_get_vendor_ie_ptr_from_oui(mac_ctx, SIR_MAC_VENDOR_AP_3_OUI, - SIR_MAC_VENDOR_AP_3_OUI_LEN, ie, ie_len)) && - (cfg_get_vendor_ie_ptr_from_oui(mac_ctx, SIR_MAC_VENDOR_AP_4_OUI, - SIR_MAC_VENDOR_AP_4_OUI_LEN, ie, ie_len))) { - pe_debug("Vendor OUI 3 and Vendor OUI 4 found"); - ret = false; - } - - return ret; -} - -/** * lim_extract_ap_capability() - extract AP's HCF/WME/WSM capability * @mac_ctx: Pointer to Global MAC structure * @p_ie: Pointer to starting IE in Beacon/Probe Response @@ -478,7 +126,6 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, tSirRetStatus cfg_get_status = eSIR_FAILURE; uint8_t ap_bcon_ch_width; bool new_ch_width_dfn = false; - bool is_vendor_ap_present; tDot11fIEVHTOperation *vht_op; uint8_t fw_vht_ch_wd; uint8_t vht_ch_wd; @@ -504,48 +151,6 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, return; } - is_vendor_ap_present = lim_check_vendor_ap_present(mac_ctx, - beacon_struct, session, - p_ie, ie_len, - WMI_ACTION_OUI_CONNECT_1X1); - - if (is_vendor_ap_present) { - is_vendor_ap_present = lim_check_vendor_ap_3_present(mac_ctx, - p_ie, ie_len); - } - - if (mac_ctx->roam.configParam.is_force_1x1 && - mac_ctx->lteCoexAntShare && - is_vendor_ap_present) { - session->supported_nss_1x1 = true; - session->vdev_nss = 1; - session->nss = 1; - pe_debug("For special ap, NSS: %d", session->nss); - } - - /* - * If CCK WAR is set for current AP, update to firmware via - * WMI_VDEV_PARAM_ABG_MODE_TX_CHAIN_NUM - */ - is_vendor_ap_present = lim_check_vendor_ap_present(mac_ctx, NULL, - session, p_ie, ie_len, WMI_ACTION_OUI_CCKM_1X1); - if (is_vendor_ap_present) { - pe_debug("vdev: %d WMI_VDEV_PARAM_ABG_MODE_TX_CHAIN_NUM 1", - session->smeSessionId); - wma_cli_set_command(session->smeSessionId, - (int)WMI_VDEV_PARAM_ABG_MODE_TX_CHAIN_NUM, 1, VDEV_CMD); - } - - if (session->nss > lim_get_nss_supported_by_sta_and_ap(beacon_struct, - session)) { - session->nss = lim_get_nss_supported_by_sta_and_ap( - beacon_struct, session); - session->vdev_nss = session->nss; - } - - if (session->nss == 1) - session->supported_nss_1x1 = true; - if (beacon_struct->wmeInfoPresent || beacon_struct->wmeEdcaPresent || beacon_struct->HTCaps.present) diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.h b/core/mac/src/pe/lim/lim_prop_exts_utils.h index a514f96dc29c..75ad3291c3fd 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.h +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2014, 2016-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-2014, 2016-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 @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_prop_exts_utils.h contains the definitions * used by all LIM modules to support proprietary features. @@ -52,28 +43,6 @@ void limCollectRSSI(tpAniSirGlobal); void limDeleteCurrentBssWdsNode(tpAniSirGlobal); uint32_t limComputeAvg(tpAniSirGlobal, uint32_t, uint32_t); -/** - * lim_check_vendor_ap_present() - checks if the Vendor OUIs are present - * in the IE buffer - * - * @mac_ctx: mac context. - * @beacon_struct: pointer to beacon structure - * @session: pointer to pe session - * @ie: ie buffer - * @ie_len: length of ie buffer - * @id: action oui id enum - * - * This function parses the IE buffer and finds if any of the vendor OUI - * is present in it. - * - * Return: true if the vendor OUI is present, else false - */ -bool lim_check_vendor_ap_present(tpAniSirGlobal mac_ctx, - tSirProbeRespBeacon *beacon_struct, - tpPESession session, - uint8_t *ie, uint16_t ie_len, - enum wmi_action_oui_id id); - /* / Function to extract AP's HCF capability from IE fields */ void lim_extract_ap_capability(tpAniSirGlobal, uint8_t *, uint16_t, uint8_t *, uint16_t *, uint8_t *, int8_t *, tpPESession); diff --git a/core/mac/src/pe/lim/lim_reassoc_utils.c b/core/mac/src/pe/lim/lim_reassoc_utils.c index d8fbc25e80cb..24090fa67667 100644 --- a/core/mac/src/pe/lim/lim_reassoc_utils.c +++ b/core/mac/src/pe/lim/lim_reassoc_utils.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/pe/lim/lim_roam_timer_utils.c b/core/mac/src/pe/lim/lim_roam_timer_utils.c index eb81a371eaf8..c4f4ff55bf78 100644 --- a/core/mac/src/pe/lim/lim_roam_timer_utils.c +++ b/core/mac/src/pe/lim/lim_roam_timer_utils.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/pe/lim/lim_scan_result_utils.c b/core/mac/src/pe/lim/lim_scan_result_utils.c index fa3ac3214522..3d69a5e0096a 100644 --- a/core/mac/src/pe/lim/lim_scan_result_utils.c +++ b/core/mac/src/pe/lim/lim_scan_result_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_scan_result_utils.cc contains the utility functions * LIM uses for maintaining and accessing scan results on STA. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_scan_result_utils.h b/core/mac/src/pe/lim/lim_scan_result_utils.h index 0b55f1741d97..4694f9112d30 100644 --- a/core/mac/src/pe/lim/lim_scan_result_utils.h +++ b/core/mac/src/pe/lim/lim_scan_result_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_scan_result_utils.h contains the utility definitions * LIM uses for maintaining and accessing scan results on STA. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_security_utils.c b/core/mac/src/pe/lim/lim_security_utils.c index 6e2c75e1c347..0dfea1845473 100644 --- a/core/mac/src/pe/lim/lim_security_utils.c +++ b/core/mac/src/pe/lim/lim_security_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_utils.cc contains the utility functions * LIM uses. diff --git a/core/mac/src/pe/lim/lim_security_utils.h b/core/mac/src/pe/lim/lim_security_utils.h index ee42580c1e96..b83a0df5a31d 100644 --- a/core/mac/src/pe/lim/lim_security_utils.h +++ b/core/mac/src/pe/lim/lim_security_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_security_utils.h contains the utility definitions * related to WEP encryption/decryption etc. diff --git a/core/mac/src/pe/lim/lim_send_frames_host_roam.c b/core/mac/src/pe/lim/lim_send_frames_host_roam.c index 3adca8ed9486..0c3313bd710b 100644 --- a/core/mac/src/pe/lim/lim_send_frames_host_roam.c +++ b/core/mac/src/pe/lim/lim_send_frames_host_roam.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 89ddca2b3ea2..55b87bfeed44 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \file lim_send_management_frames.c * @@ -209,7 +200,7 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx, uint8_t channel, tSirMacAddr self_macaddr, uint32_t dot11mode, - uint32_t additional_ielen, uint8_t *additional_ie) + uint16_t *additional_ielen, uint8_t *additional_ie) { tDot11fProbeRequest pr; uint32_t status, bytes, payload; @@ -223,12 +214,15 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx, uint8_t sme_sessionid = 0; bool is_vht_enabled = false; uint8_t txPower; - uint16_t addn_ielen = additional_ielen; + uint16_t addn_ielen = 0; bool extracted_ext_cap_flag = false; tDot11fIEExtCap extracted_ext_cap; tSirRetStatus sir_status; uint8_t *qcn_ie = NULL; + if (additional_ielen) + addn_ielen = *additional_ielen; + /* The probe req should not send 11ac capabilieties if band is 2.4GHz, * unless enableVhtFor24GHz is enabled in INI. So if enableVhtFor24GHz * is false and dot11mode is 11ac set it to 11n. @@ -368,6 +362,8 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx, (&extracted_ext_cap); extracted_ext_cap_flag = (extracted_ext_cap.num_bytes > 0); + if (additional_ielen) + *additional_ielen = addn_ielen; } qcn_ie = cfg_get_vendor_ie_ptr_from_oui(mac_ctx, SIR_MAC_QCN_OUI_TYPE, SIR_MAC_QCN_OUI_TYPE_SIZE, @@ -1961,8 +1957,6 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, assoc_cnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE; - cds_packet_free((void *)packet); - lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF, (uint32_t *) &assoc_cnf); diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c index 3a15d5dcfc6d..ddd81924f2f3 100644 --- a/core/mac/src/pe/lim/lim_send_messages.c +++ b/core/mac/src/pe/lim/lim_send_messages.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * lim_send_messages.c: Provides functions to send messages or Indications to HAL. * Author: Sunit Bhatia diff --git a/core/mac/src/pe/lim/lim_send_messages.h b/core/mac/src/pe/lim/lim_send_messages.h index c5c00d0e642f..883ff216da64 100644 --- a/core/mac/src/pe/lim/lim_send_messages.h +++ b/core/mac/src/pe/lim/lim_send_messages.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * lim_send_messages.h: Provides functions to send messages or Indications to HAL. * Author: Sunit Bhatia diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 854ec0a35ae9..2a7e43151dec 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_send_sme_rspMessages.cc contains the functions * for sending SME response/notification messages to applications * above MAC software. @@ -897,7 +888,7 @@ lim_send_sme_disassoc_ntf(tpAniSirGlobal pMac, tpPESession session = NULL; uint16_t i, assoc_id; tpDphHashNode sta_ds = NULL; - struct sir_sme_discon_done_ind *sir_sme_dis_ind; + QDF_STATUS status; pe_debug("Disassoc Ntf with trigger : %d reasonCode: %d", disassocTrigger, reasonCode); @@ -985,36 +976,13 @@ lim_send_sme_disassoc_ntf(tpAniSirGlobal pMac, case eLIM_PEER_ENTITY_DISASSOC: case eLIM_LINK_MONITORING_DISASSOC: - sir_sme_dis_ind = - qdf_mem_malloc(sizeof(*sir_sme_dis_ind)); - if (!sir_sme_dis_ind) { - pe_err("call to AllocateMemory failed for disconnect indication"); + status = lim_prepare_disconnect_done_ind(pMac, &pMsg, + smesessionId, + reasonCode, &peerMacAddr[0]); + if (!QDF_IS_STATUS_SUCCESS(status)) { + pe_err("Failed to prepare message"); return; } - - pe_debug("send eWNI_SME_DISCONNECT_DONE_IND with retCode: %d", - reasonCode); - - sir_sme_dis_ind->message_type = - eWNI_SME_DISCONNECT_DONE_IND; - sir_sme_dis_ind->length = - sizeof(*sir_sme_dis_ind); - qdf_mem_copy(sir_sme_dis_ind->peer_mac, peerMacAddr, - sizeof(tSirMacAddr)); - sir_sme_dis_ind->session_id = smesessionId; - sir_sme_dis_ind->reason_code = reasonCode; - /* - * Instead of sending deauth reason code as 505 which is - * internal value(eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) - * Send reason code as zero to Supplicant - */ - if (reasonCode == eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) - sir_sme_dis_ind->reason_code = 0; - else - sir_sme_dis_ind->reason_code = reasonCode; - - pMsg = (uint32_t *)sir_sme_dis_ind; - break; default: @@ -1371,6 +1339,45 @@ void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType, } #endif /* FEATURE_WLAN_TDLS */ +QDF_STATUS lim_prepare_disconnect_done_ind(tpAniSirGlobal mac_ctx, + uint32_t **msg, + uint8_t session_id, + tSirResultCodes reason_code, + uint8_t *peer_mac_addr) +{ + struct sir_sme_discon_done_ind *sir_sme_dis_ind; + + sir_sme_dis_ind = qdf_mem_malloc(sizeof(*sir_sme_dis_ind)); + if (!sir_sme_dis_ind) { + pe_err("Failed to allocate memory"); + return QDF_STATUS_E_FAILURE; + } + + pe_debug("Prepare eWNI_SME_DISCONNECT_DONE_IND withretCode: %d", + reason_code); + + sir_sme_dis_ind->message_type = eWNI_SME_DISCONNECT_DONE_IND; + sir_sme_dis_ind->length = sizeof(*sir_sme_dis_ind); + sir_sme_dis_ind->session_id = session_id; + if (peer_mac_addr) + qdf_mem_copy(&sir_sme_dis_ind->peer_mac, + &peer_mac_addr, ETH_ALEN); + + /* + * Instead of sending deauth reason code as 505 which is + * internal value(eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) + * Send reason code as zero to Supplicant + */ + if (reason_code == eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) + sir_sme_dis_ind->reason_code = 0; + else + sir_sme_dis_ind->reason_code = reason_code; + + *msg = (uint32_t *)sir_sme_dis_ind; + + return QDF_STATUS_SUCCESS; +} + /** * lim_send_sme_deauth_ntf() * @@ -1409,8 +1416,8 @@ lim_send_sme_deauth_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tSirSmeDeauthInd *pSirSmeDeauthInd; tpPESession psessionEntry; uint8_t sessionId; - uint32_t *pMsg; - struct sir_sme_discon_done_ind *sir_sme_dis_ind; + uint32_t *pMsg = NULL; + QDF_STATUS status; psessionEntry = pe_find_session_by_bssid(pMac, peerMacAddr, &sessionId); switch (deauthTrigger) { @@ -1446,38 +1453,14 @@ lim_send_sme_deauth_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, case eLIM_PEER_ENTITY_DEAUTH: case eLIM_LINK_MONITORING_DEAUTH: - sir_sme_dis_ind = - qdf_mem_malloc(sizeof(*sir_sme_dis_ind)); - if (!sir_sme_dis_ind) { - pe_err("call to AllocateMemory failed for disconnect indication"); + status = lim_prepare_disconnect_done_ind(pMac, &pMsg, + smesessionId, reasonCode, + &peerMacAddr[0]); + if (!QDF_IS_STATUS_SUCCESS(status)) { + pe_err("Failed to prepare message"); return; } - - pe_debug("send eWNI_SME_DISCONNECT_DONE_IND withretCode: %d", - reasonCode); - - sir_sme_dis_ind->message_type = - eWNI_SME_DISCONNECT_DONE_IND; - sir_sme_dis_ind->length = - sizeof(*sir_sme_dis_ind); - sir_sme_dis_ind->session_id = smesessionId; - sir_sme_dis_ind->reason_code = reasonCode; - qdf_mem_copy(sir_sme_dis_ind->peer_mac, peerMacAddr, - ETH_ALEN); - /* - * Instead of sending deauth reason code as 505 which is - * internal value(eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) - * Send reason code as zero to Supplicant - */ - if (reasonCode == eSIR_SME_LOST_LINK_WITH_PEER_RESULT_CODE) - sir_sme_dis_ind->reason_code = 0; - else - sir_sme_dis_ind->reason_code = reasonCode; - - pMsg = (uint32_t *)sir_sme_dis_ind; - break; - default: /** * Deauthentication indication due to Deauthentication @@ -1641,7 +1624,7 @@ lim_send_sme_set_context_rsp(tpAniSirGlobal pMac, tpPESession psessionEntry, uint8_t smesessionId, uint16_t smetransactionId) { - tSirMsgQ mmhMsg; + cds_msg_t msg; tSirSmeSetContextRsp *pSirSmeSetContextRsp; pSirSmeSetContextRsp = qdf_mem_malloc(sizeof(tSirSmeSetContextRsp)); @@ -1661,15 +1644,15 @@ lim_send_sme_set_context_rsp(tpAniSirGlobal pMac, pSirSmeSetContextRsp->sessionId = smesessionId; pSirSmeSetContextRsp->transactionId = smetransactionId; - mmhMsg.type = eWNI_SME_SETCONTEXT_RSP; - mmhMsg.bodyptr = pSirSmeSetContextRsp; - mmhMsg.bodyval = 0; + msg.type = eWNI_SME_SETCONTEXT_RSP; + msg.bodyptr = pSirSmeSetContextRsp; + msg.bodyval = 0; if (NULL == psessionEntry) { MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, - NO_SESSION, mmhMsg.type)); + NO_SESSION, msg.type)); } else { MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, - psessionEntry->peSessionId, mmhMsg.type)); + psessionEntry->peSessionId, msg.type)); } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ @@ -1677,7 +1660,7 @@ lim_send_sme_set_context_rsp(tpAniSirGlobal pMac, psessionEntry, (uint16_t) resultCode, 0); #endif /* FEATURE_WLAN_DIAG_SUPPORT */ - lim_sys_process_mmh_msg_api(pMac, &mmhMsg, ePROT); + pMac->lim.sme_msg_callback(pMac, &msg); } /*** end lim_send_sme_set_context_rsp() ***/ /** @@ -2244,10 +2227,13 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) goto err; } +#ifdef FEATURE_WLAN_TDLS /* * on receiving channel switch announcement from AP, delete all * TDLS peers before leaving BSS and proceed for channel switch */ + session_entry->is_tdls_csa = true; +#endif lim_delete_tdls_peers(mac_ctx, session_entry); lim_ch_switch = &session_entry->gLimChannelSwitch; diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h index 55a58ff0ee03..44c4e9bfe7a5 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-2016,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 @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_send_sme_rsp_messages.h contains the definitions for * sending SME response/notification messages to applications above * MAC software. @@ -58,6 +49,23 @@ void lim_post_sme_scan_rsp_message(tpAniSirGlobal, tSirResultCodes, void lim_send_sme_join_reassoc_rsp(tpAniSirGlobal, uint16_t, tSirResultCodes, uint16_t, tpPESession, uint8_t, uint16_t); + +/* + * lim_prepare_disconnect_done_ind() - Prepares the disconnect done ind message + * @mac_ctx: Global mac_ctx + * @session_id: PE session id + * @reason_code: Disconnect indication reason code + * @peer_mac_addr: MAC address of the peer + * + * Prepares the disconnect done indication message to be sent to the upper layer + * + * Return: QDF Status + */ +QDF_STATUS lim_prepare_disconnect_done_ind(tpAniSirGlobal mac_ctx, + uint32_t **msg, + uint8_t session_id, + tSirResultCodes reason_code, + uint8_t *peer_mac_addr); void lim_send_sme_disassoc_ntf(tpAniSirGlobal, tSirMacAddr, tSirResultCodes, uint16_t, uint16_t, uint8_t, uint16_t, tpPESession); void lim_send_sme_deauth_ntf(tpAniSirGlobal, tSirMacAddr, tSirResultCodes, uint16_t, diff --git a/core/mac/src/pe/lim/lim_ser_des_utils.c b/core/mac/src/pe/lim/lim_ser_des_utils.c index c60f3110d209..61b3bc470a48 100644 --- a/core/mac/src/pe/lim/lim_ser_des_utils.c +++ b/core/mac/src/pe/lim/lim_ser_des_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_ser_des_utils.cc contains the serializer/deserializer * utility functions LIM uses while communicating with upper layer diff --git a/core/mac/src/pe/lim/lim_ser_des_utils.h b/core/mac/src/pe/lim/lim_ser_des_utils.h index e2b52084c1a9..7fce33761ad7 100644 --- a/core/mac/src/pe/lim/lim_ser_des_utils.h +++ b/core/mac/src/pe/lim/lim_ser_des_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2015, 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_ser_des_utils.h contains the utility definitions * LIM uses while processing messages from upper layer software diff --git a/core/mac/src/pe/lim/lim_session.c b/core/mac/src/pe/lim/lim_session.c index 70865f2fa58b..1634560a0ba0 100644 --- a/core/mac/src/pe/lim/lim_session.c +++ b/core/mac/src/pe/lim/lim_session.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \file lim_session.c @@ -479,6 +470,7 @@ pe_create_session(tpAniSirGlobal pMac, uint8_t *bssid, uint8_t *sessionId, sizeof(session_ptr->peerAIDBitmap), 0); session_ptr->tdls_prohibited = false; session_ptr->tdls_chan_swit_prohibited = false; + session_ptr->is_tdls_csa = false; #endif session_ptr->fWaitForProbeRsp = 0; session_ptr->fIgnoreCapsChange = 0; diff --git a/core/mac/src/pe/lim/lim_session_utils.c b/core/mac/src/pe/lim/lim_session_utils.c index ecdc7e2af261..ab6b5396d104 100644 --- a/core/mac/src/pe/lim/lim_session_utils.c +++ b/core/mac/src/pe/lim/lim_session_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \file lim_session_utils.c diff --git a/core/mac/src/pe/lim/lim_session_utils.h b/core/mac/src/pe/lim/lim_session_utils.h index d1dd7d1c0370..9639d270a025 100644 --- a/core/mac/src/pe/lim/lim_session_utils.h +++ b/core/mac/src/pe/lim/lim_session_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__LIM_SESSION_UTILS_H) #define __LIM_SESSION_UTILS_H diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.c b/core/mac/src/pe/lim/lim_sme_req_utils.c index 98529fbde2c3..92ebc8141cc3 100644 --- a/core/mac/src/pe/lim/lim_sme_req_utils.c +++ b/core/mac/src/pe/lim/lim_sme_req_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_sme_req_utils.cc contains the utility functions * for processing SME request messages. diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.h b/core/mac/src/pe/lim/lim_sme_req_utils.h index 7e89373ad2e1..ba6a960085af 100644 --- a/core/mac/src/pe/lim/lim_sme_req_utils.h +++ b/core/mac/src/pe/lim/lim_sme_req_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012,2014-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_sme_req_utils.h contains the utility definitions * LIM uses while processing SME request messsages. diff --git a/core/mac/src/pe/lim/lim_sta_hash_api.c b/core/mac/src/pe/lim/lim_sta_hash_api.c index 9a192a892c04..4ed3539347b5 100644 --- a/core/mac/src/pe/lim/lim_sta_hash_api.c +++ b/core/mac/src/pe/lim/lim_sta_hash_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * lim_sta_hash_api.c: Provides access functions to get/set values of station hash entry fields. * Author: Sunit Bhatia diff --git a/core/mac/src/pe/lim/lim_sta_hash_api.h b/core/mac/src/pe/lim/lim_sta_hash_api.h index 9a34091ad39d..5f39bcc6daaf 100644 --- a/core/mac/src/pe/lim/lim_sta_hash_api.h +++ b/core/mac/src/pe/lim/lim_sta_hash_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_sta_hash_api.h contains the * function prototypes for accessing station hash entry fields. diff --git a/core/mac/src/pe/lim/lim_timer_utils.c b/core/mac/src/pe/lim/lim_timer_utils.c index 3f99f15b36c9..239b3e8d2667 100644 --- a/core/mac/src/pe/lim/lim_timer_utils.c +++ b/core/mac/src/pe/lim/lim_timer_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_timer_utils.cc contains the utility functions * LIM uses for handling various timers. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_timer_utils.h b/core/mac/src/pe/lim/lim_timer_utils.h index c03ff4b31999..89ca06071874 100644 --- a/core/mac/src/pe/lim/lim_timer_utils.h +++ b/core/mac/src/pe/lim/lim_timer_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2014, 2016, 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file lim_timer_utils.h contains the utility definitions * LIM uses for timer handling. diff --git a/core/mac/src/pe/lim/lim_trace.c b/core/mac/src/pe/lim/lim_trace.c index f4ab2e3e1fea..941dd977a46e 100644 --- a/core/mac/src/pe/lim/lim_trace.c +++ b/core/mac/src/pe/lim/lim_trace.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \file lim_trace.c diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 973666b60746..27e8f6d7ef80 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_types.h contains the definitions used by all * all LIM modules. * Author: Chandra Modumudi @@ -522,7 +513,7 @@ void lim_populate_mac_header(tpAniSirGlobal, uint8_t *, uint8_t, uint8_t, tSirMacAddr, tSirMacAddr); tSirRetStatus lim_send_probe_req_mgmt_frame(tpAniSirGlobal, tSirMacSSid *, tSirMacAddr, uint8_t, tSirMacAddr, - uint32_t, uint32_t, uint8_t *); + uint32_t, uint16_t *, uint8_t *); void lim_send_probe_rsp_mgmt_frame(tpAniSirGlobal, tSirMacAddr, tpAniSSID, short, uint8_t, tpPESession, uint8_t); void lim_send_auth_mgmt_frame(tpAniSirGlobal, tSirMacAuthFrameBody *, tSirMacAddr, diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 2a8ae34a39ae..fe29a7608056 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_utils.cc contains the utility functions * LIM uses. * Author: Chandra Modumudi diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 1d5a611cb9dd..46b2ea676d45 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file lim_utils.h contains the utility definitions * LIM uses. * Author: Chandra Modumudi @@ -597,6 +588,7 @@ typedef enum { WLAN_PE_DIAG_DISASSOC_FRAME_EVENT, WLAN_PE_DIAG_AUTH_ACK_EVENT, WLAN_PE_DIAG_ASSOC_ACK_EVENT, + WLAN_PE_DIAG_AUTH_ALGO_NUM, } WLAN_PE_DIAG_EVENT_TYPE; #ifdef FEATURE_WLAN_DIAG_SUPPORT diff --git a/core/mac/src/pe/nan/nan_datapath.c b/core/mac/src/pe/nan/nan_datapath.c index 6bf62c124dfd..6a38d72a050e 100644 --- a/core/mac/src/pe/nan/nan_datapath.c +++ b/core/mac/src/pe/nan/nan_datapath.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/pe/nan/nan_datapath.h b/core/mac/src/pe/nan/nan_datapath.h index 360a3e90dece..fc726f097e05 100644 --- a/core/mac/src/pe/nan/nan_datapath.h +++ b/core/mac/src/pe/nan/nan_datapath.h @@ -1,8 +1,6 @@ /* * Copyright (c) 2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c index 6c351e8d1367..f06bd2910582 100644 --- a/core/mac/src/pe/rrm/rrm_api.c +++ b/core/mac/src/pe/rrm/rrm_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \file rrm_api.c diff --git a/core/mac/src/pe/sch/sch_api.c b/core/mac/src/pe/sch/sch_api.c index e23ad89e68cc..8790226a02ee 100644 --- a/core/mac/src/pe/sch/sch_api.c +++ b/core/mac/src/pe/sch/sch_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file sch_api.cc contains functions related to the API exposed * by scheduler module diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c index f99ad43e52b5..2d9f20ba7a06 100644 --- a/core/mac/src/pe/sch/sch_beacon_gen.c +++ b/core/mac/src/pe/sch/sch_beacon_gen.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file sch_beacon_gen.cc contains beacon generation related * functions * @@ -338,14 +329,12 @@ sch_set_fixed_beacon_fields(tpAniSirGlobal mac_ctx, tpPESession session) * and SAP has instructed to announce channel switch IEs * in beacon and probe responses */ - if (!CHAN_HOP_ALL_BANDS_ENABLE) { - populate_dot11f_chan_switch_ann(mac_ctx, - &bcn_2->ChanSwitchAnn, session); - pe_debug("csa: mode:%d chan:%d count:%d", - bcn_2->ChanSwitchAnn.switchMode, - bcn_2->ChanSwitchAnn.newChannel, - bcn_2->ChanSwitchAnn.switchCount); - } + populate_dot11f_chan_switch_ann(mac_ctx, + &bcn_2->ChanSwitchAnn, session); + pe_debug("csa: mode:%d chan:%d count:%d", + bcn_2->ChanSwitchAnn.switchMode, + bcn_2->ChanSwitchAnn.newChannel, + bcn_2->ChanSwitchAnn.switchCount); /* * TODO: depending the CB mode, extended channel switch diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 5b18c8979a00..58a6e6095bb2 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file sch_beacon_process.cc contains beacon processing related * functions * @@ -793,8 +784,12 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx, * delete all TDLS peers before leaving BSS and proceed * for channel switch */ - if (LIM_IS_STA_ROLE(session)) + if (LIM_IS_STA_ROLE(session)) { +#ifdef FEATURE_WLAN_TDLS + session->is_tdls_csa = true; +#endif lim_delete_tdls_peers(mac_ctx, session); + } lim_update_channel_switch(mac_ctx, bcn, session); } else if (session->gLimSpecMgmt.dot11hChanSwState == @@ -860,7 +855,7 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx, if (sendProbeReq) lim_send_probe_req_mgmt_frame(mac_ctx, &session->ssId, session->bssId, session->currentOperChannel, - session->selfMacAddr, session->dot11mode, 0, NULL); + session->selfMacAddr, session->dot11mode, NULL, NULL); if ((false == mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running) && beaconParams.paramChangeBitmap) { @@ -906,8 +901,6 @@ sch_beacon_process(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, return; } - if (bcn.ssidPresent) - bcn.ssId.ssId[bcn.ssId.length] = 0; /* * First process the beacon in the context of any existing AP or BTAP * session. This takes cares of following two scenarios: diff --git a/core/mac/src/pe/sch/sch_message.c b/core/mac/src/pe/sch/sch_message.c index 65a40248a5f3..944bb1ba534f 100644 --- a/core/mac/src/pe/sch/sch_message.c +++ b/core/mac/src/pe/sch/sch_message.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "cds_api.h" #include "sir_common.h" diff --git a/core/mac/src/pe/sch/sch_sys_params.h b/core/mac/src/pe/sch/sch_sys_params.h index adf5c198277f..a02850e52c2a 100644 --- a/core/mac/src/pe/sch/sch_sys_params.h +++ b/core/mac/src/pe/sch/sch_sys_params.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file sch_sys_params.h contains scheduler parameter definitions * diff --git a/core/mac/src/sys/common/inc/wlan_qct_sys.h b/core/mac/src/sys/common/inc/wlan_qct_sys.h index 87dad898d5ca..dca6b76b0552 100644 --- a/core/mac/src/sys/common/inc/wlan_qct_sys.h +++ b/core/mac/src/sys/common/inc/wlan_qct_sys.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2013-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(WLAN_QCT_SYS_H__) #define WLAN_QCT_SYS_H__ @@ -72,6 +63,7 @@ typedef enum { SYS_MSG_ID_FTM_RSP, SYS_MSG_ID_QVIT, SYS_MSG_ID_DATA_STALL_MSG, + SYS_MSG_ID_CLEAN_VDEV_RSP_QUEUE, } SYS_MSG_ID; /*--------------------------------------------------------------------------- diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c index c224720d6507..daeed0ee6dd6 100644 --- a/core/mac/src/sys/common/src/wlan_qct_sys.c +++ b/core/mac/src/sys/common/src/wlan_qct_sys.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <wlan_qct_sys.h> #include <cds_api.h> #include <sir_types.h> /* needed for tSirRetStatus */ @@ -246,6 +237,9 @@ QDF_STATUS sys_mc_process_msg(v_CONTEXT_t p_cds_context, cds_msg_t *pMsg) data_stall_detect_callback(pMsg->bodyptr); qdf_mem_free(pMsg->bodyptr); break; + case SYS_MSG_ID_CLEAN_VDEV_RSP_QUEUE: + wma_cleanup_vdev_resp_and_hold_req(pMsg->bodyptr); + break; default: QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_ERROR, "Unknown message type msgType= %d [0x%08x]", diff --git a/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h b/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h index 68c4a0017940..5bc6eeb560f0 100644 --- a/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h +++ b/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * @file VossWrapper.h * * @brief This header file contains the various structure definitions and diff --git a/core/mac/src/sys/legacy/src/platform/src/sys_wrapper.c b/core/mac/src/sys/legacy/src/platform/src/sys_wrapper.c index c8496adabb9a..37c8931c5146 100644 --- a/core/mac/src/sys/legacy/src/platform/src/sys_wrapper.c +++ b/core/mac/src/sys/legacy/src/platform/src/sys_wrapper.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== @file VossWrapper.c diff --git a/core/mac/src/sys/legacy/src/system/inc/sys_def.h b/core/mac/src/sys/legacy/src/system/inc/sys_def.h index abdae33dc19c..2de3ae86c97e 100644 --- a/core/mac/src/sys/legacy/src/system/inc/sys_def.h +++ b/core/mac/src/sys/legacy/src/system/inc/sys_def.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file sys_def.h contains the common definitions used to bring up * Sirius system. diff --git a/core/mac/src/sys/legacy/src/system/inc/sys_entry_func.h b/core/mac/src/sys/legacy/src/system/inc/sys_entry_func.h index b44e0c62298a..cb029c639a5b 100644 --- a/core/mac/src/sys/legacy/src/system/inc/sys_entry_func.h +++ b/core/mac/src/sys/legacy/src/system/inc/sys_entry_func.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file sys_entry_func.h contains module entry functions definitions * Author: V. K. Kandarpa diff --git a/core/mac/src/sys/legacy/src/system/inc/sys_startup.h b/core/mac/src/sys/legacy/src/system/inc/sys_startup.h index e56bd6193dba..49107d867bcc 100644 --- a/core/mac/src/sys/legacy/src/system/inc/sys_startup.h +++ b/core/mac/src/sys/legacy/src/system/inc/sys_startup.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * sys_startup.h: System startup header file. * Author: V. K. Kandarpa diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c index 6cd18f4e5ead..1a5347d37dd1 100644 --- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c +++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * mac_init_api.c - This file has all the mac level init functions * for all the defined threads at system level. diff --git a/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c b/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c index 030221f92d97..69c6ac304fa7 100644 --- a/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c +++ b/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * sys_entry_func.cc - This file has all the system level entry functions * for all the defined threads at system level. * Author: V. K. Kandarpa diff --git a/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h b/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h index e1974bcdf60d..2e38267cc396 100644 --- a/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h +++ b/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef DOT11FDEFS_H_82A7B72E_C36C_465D_82A7_139EA5322582 #define DOT11FDEFS_H_82A7B72E_C36C_465D_82A7_139EA5322582 /** diff --git a/core/mac/src/sys/legacy/src/utils/inc/utils_parser.h b/core/mac/src/sys/legacy/src/utils/inc/utils_parser.h index 3b63a0df737e..f5302bbc7e60 100644 --- a/core/mac/src/sys/legacy/src/utils/inc/utils_parser.h +++ b/core/mac/src/sys/legacy/src/utils/inc/utils_parser.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file utils_parser.h contains the utility function protos * used internally by the parser diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index 5ca8a5607572..2f1f3549175d 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * \file dot11f.c * * \brief Structures, functions & definitions for @@ -33,7 +24,7 @@ * * * This file was automatically generated by 'framesc' - * Fri Feb 16 10:33:08 2018 from the following file(s): + * Thu May 10 17:00:57 2018 from the following file(s): * * dot11f.frms * @@ -306,7 +297,8 @@ static const tIEDefn *find_ie_defn(tpAniSirGlobal pCtx, while (0xff != pIe->eid || pIe->extn_eid) { if (*pBuf == pIe->eid) { if (pIe->eid == 0xff) { - if ((*(pBuf + 2)) == pIe->extn_eid) + if ((nBuf > 2) && + (*(pBuf + 2)) == pIe->extn_eid) return pIe; } else { if (0 == pIe->noui) @@ -823,6 +815,9 @@ uint32_t dot11f_unpack_tlv_authorized_ma_cs(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->mac, pBuf, 6); pBuf += 6; tlvlen -= (uint8_t)6; @@ -844,6 +839,9 @@ uint32_t dot11f_unpack_tlv_version2(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; uint8_t tmp5__; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp5__ = *pBuf; pBuf += 1; tlvlen -= 1; @@ -901,9 +899,15 @@ uint32_t dot11f_unpack_tlv_extended_listen_timing(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->availibilityPeriod, pBuf, 0); pBuf += 2; tlvlen -= (uint8_t)2; + if (unlikely(tlvlen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->availibilityInterval, pBuf, 0); pBuf += 2; tlvlen -= (uint8_t)2; @@ -921,12 +925,21 @@ uint32_t dot11f_unpack_tlv_listen_channel(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 3)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->countryString, pBuf, 3); pBuf += 3; tlvlen -= (uint8_t)3; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->regulatoryClass = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->channel = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; @@ -1016,9 +1029,15 @@ uint32_t dot11f_unpack_tlv_notice_of_absence(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->index = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->CTSWindowOppPS = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; @@ -1045,12 +1064,21 @@ uint32_t dot11f_unpack_tlv_operating_channel(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 3)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->countryString, pBuf, 3); pBuf += 3; tlvlen -= (uint8_t)3; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->regulatoryClass = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->channel = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; @@ -1068,9 +1096,15 @@ uint32_t dot11f_unpack_tlv_p2_p_capability(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->deviceCapability = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->groupCapability = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; @@ -1088,6 +1122,9 @@ uint32_t dot11f_unpack_tlv_p2_p_device_id(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->P2PDeviceAddress, pBuf, 6); pBuf += 6; tlvlen -= (uint8_t)6; @@ -1112,12 +1149,21 @@ uint32_t dot11f_unpack_tlv_p2_p_device_info(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->P2PDeviceAddress, pBuf, 6); pBuf += 6; tlvlen -= (uint8_t)6; + if (unlikely(tlvlen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->configMethod, pBuf, 0); pBuf += 2; tlvlen -= (uint8_t)2; + if (unlikely(tlvlen < 8)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->primaryDeviceType, pBuf, 8); pBuf += 8; tlvlen -= (uint8_t)8; @@ -1163,12 +1209,21 @@ uint32_t dot11f_unpack_tlv_primary_device_type(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; (void)pBuf; (void)tlvlen; /* Shutup the compiler */ pDst->present = 1; + if (unlikely(tlvlen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->primary_category, pBuf, 1); pBuf += 2; tlvlen -= (uint8_t)2; + if (unlikely(tlvlen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->oui, pBuf, 4); pBuf += 4; tlvlen -= (uint8_t)4; + if (unlikely(tlvlen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->sub_category, pBuf, 1); pBuf += 2; tlvlen -= (uint8_t)2; @@ -1189,12 +1244,21 @@ uint32_t dot11f_unpack_tlv_request_device_type(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->primary_category, pBuf, 1); pBuf += 2; tlvlen -= (uint8_t)2; + if (unlikely(tlvlen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->oui, pBuf, 4); pBuf += 4; tlvlen -= (uint8_t)4; + if (unlikely(tlvlen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->sub_category, pBuf, 1); pBuf += 2; tlvlen -= (uint8_t)2; @@ -1247,6 +1311,9 @@ uint32_t dot11f_unpack_tlv_uuid_e(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->uuid, pBuf, 16); pBuf += 16; tlvlen -= (uint8_t)16; @@ -1264,6 +1331,9 @@ uint32_t dot11f_unpack_tlv_uuid_r(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->uuid, pBuf, 16); pBuf += 16; tlvlen -= (uint8_t)16; @@ -1295,6 +1365,9 @@ uint32_t dot11f_unpack_tlv_vendor_extension(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 3)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->vendorId, pBuf, 3); pBuf += 3; tlvlen -= (uint8_t)3; @@ -1319,6 +1392,9 @@ uint32_t dot11f_unpack_tlv_version(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; uint8_t tmp6__; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp6__ = *pBuf; pBuf += 1; tlvlen -= 1; @@ -1356,6 +1432,9 @@ uint32_t dot11f_unpack_tlv_non_prefferd_chan_rep(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->oper_class = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; @@ -1383,6 +1462,9 @@ uint32_t dot11f_unpack_tlv_oce_cap(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; uint8_t tmp7__; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp7__ = *pBuf; pBuf += 1; tlvlen -= 1; @@ -1405,6 +1487,9 @@ uint32_t dot11f_unpack_tlv_reduced_wan_metrics(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; uint8_t tmp8__; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp8__ = *pBuf; pBuf += 1; tlvlen -= 1; @@ -1424,9 +1509,15 @@ uint32_t dot11f_unpack_tlv_rssi_assoc_rej(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->delta_rssi = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; + if (unlikely(tlvlen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->retry_delay = *pBuf; pBuf += 1; tlvlen -= (uint8_t)1; @@ -1450,6 +1541,9 @@ uint32_t dot11f_unpack_tlv_p2_p_interface(tpAniSirGlobal pCtx, { uint32_t status = DOT11F_PARSE_SUCCESS; pDst->present = 1; + if (unlikely(tlvlen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->P2PDeviceAddress, pBuf, 6); pBuf += 6; tlvlen -= (uint8_t)6; @@ -1475,14 +1569,23 @@ uint32_t dot11f_unpack_ie_gtk(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp9__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->keyId = tmp9__ >> 0 & 0x3; pDst->reserved = tmp9__ >> 2 & 0x3feb; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->keyLength = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->RSC, pBuf, 8); pBuf += 8; ielen -= (uint8_t)8; @@ -1511,15 +1614,27 @@ uint32_t dot11f_unpack_ie_igtk(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->keyID, pBuf, 2); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->IPN, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->keyLength = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 24)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->key, pBuf, 24); (void)pCtx; return status; @@ -1564,6 +1679,9 @@ uint32_t dot11f_unpack_ie_r1_kh_id(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->PMK_R1_ID, pBuf, 6); (void)pCtx; return status; @@ -1583,6 +1701,9 @@ uint32_t dot11f_unpack_ie_ap_channel_report(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->regulatoryClass = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -1611,6 +1732,9 @@ uint32_t dot11f_unpack_ie_bcn_reporting_detail(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->reportingDetail = *pBuf; (void)pCtx; return status; @@ -1655,9 +1779,15 @@ uint32_t dot11f_unpack_ie_beacon_reporting(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->reportingCondition = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->threshold = *pBuf; (void)pCtx; return status; @@ -1677,6 +1807,9 @@ uint32_t dot11f_unpack_ie_condensed_country_str(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->countryStr, pBuf, 2); (void)pCtx; return status; @@ -1696,6 +1829,9 @@ uint32_t dot11f_unpack_ie_measurement_pilot(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurementPilot = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -1719,6 +1855,9 @@ uint32_t dot11f_unpack_ie_multi_bssid(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->maxBSSIDIndicator = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -1742,12 +1881,21 @@ uint32_t dot11f_unpack_ie_ric_data(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->Identifier = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->resourceDescCount = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->statusCode, pBuf, 0); (void)pCtx; return status; @@ -1767,6 +1915,9 @@ uint32_t dot11f_unpack_ie_ric_descriptor(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->resourceType = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -1795,6 +1946,9 @@ uint32_t dot11f_unpack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp10__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1806,6 +1960,9 @@ uint32_t dot11f_unpack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, pDst->BeaconActive = tmp10__ >> 5 & 0x1; pDst->BeaconTable = tmp10__ >> 6 & 0x1; pDst->BeaconRepCond = tmp10__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp11__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1817,6 +1974,9 @@ uint32_t dot11f_unpack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, pDst->LCIAzimuth = tmp11__ >> 5 & 0x1; pDst->TCMCapability = tmp11__ >> 6 & 0x1; pDst->triggeredTCM = tmp11__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp12__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1824,6 +1984,9 @@ uint32_t dot11f_unpack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, pDst->RRMMIBEnabled = tmp12__ >> 1 & 0x1; pDst->operatingChanMax = tmp12__ >> 2 & 0x7; pDst->nonOperatinChanMax = tmp12__ >> 5 & 0x7; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp13__ = *pBuf; pBuf += 1; ielen -= 1; @@ -1833,6 +1996,9 @@ uint32_t dot11f_unpack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, pDst->RCPIMeasurement = tmp13__ >> 5 & 0x1; pDst->RSNIMeasurement = tmp13__ >> 6 & 0x1; pDst->BssAvgAccessDelay = tmp13__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp14__ = *pBuf; pDst->BSSAvailAdmission = tmp14__ >> 0 & 0x1; pDst->AntennaInformation = tmp14__ >> 1 & 0x1; @@ -1905,6 +2071,9 @@ uint32_t dot11f_unpack_ie_schedule(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp15__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -1912,15 +2081,27 @@ uint32_t dot11f_unpack_ie_schedule(tpAniSirGlobal pCtx, pDst->tsid = tmp15__ >> 1 & 0xf; pDst->direction = tmp15__ >> 5 & 0x3; pDst->reserved = tmp15__ >> 7 & 0x1ff; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->service_interval, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->max_service_dur, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->spec_interval, pBuf, 0); (void)pCtx; return status; @@ -1940,68 +2121,125 @@ uint32_t dot11f_unpack_ie_tclas(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->user_priority = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->classifier_type = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->classifier_mask = *pBuf; pBuf += 1; ielen -= (uint8_t)1; switch (pDst->classifier_type) { case 0: + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.source, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.dest, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.EthParams.type, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; break; case 1: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; switch (pDst->info.IpParams.version) { case 4: + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.source, pBuf, 4); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.dest, pBuf, 4); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.src_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.params.IpV4Params.DSCP = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.params.IpV4Params.proto = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.params.IpV4Params.reserved = *pBuf; pBuf += 1; ielen -= (uint8_t)1; break; case 6: + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.source, pBuf, 16); pBuf += 16; ielen -= (uint8_t)16; + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.dest, pBuf, 16); pBuf += 16; ielen -= (uint8_t)16; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.src_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 3)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.flow_label, pBuf, 3); pBuf += 3; ielen -= (uint8_t)3; @@ -2009,6 +2247,9 @@ uint32_t dot11f_unpack_ie_tclas(tpAniSirGlobal pCtx, } break; case 2: + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.Params8021dq.tag_type, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; @@ -2035,6 +2276,9 @@ uint32_t dot11f_unpack_ie_ts_delay(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->delay, pBuf, 0); (void)pCtx; return status; @@ -2054,9 +2298,15 @@ uint32_t dot11f_unpack_ie_tsf_info(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->TsfOffset, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->BeaconIntvl, pBuf, 0); (void)pCtx; return status; @@ -2079,6 +2329,9 @@ uint32_t dot11f_unpack_ie_tspec(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp16__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -2090,55 +2343,103 @@ uint32_t dot11f_unpack_ie_tspec(tpAniSirGlobal pCtx, pDst->psb = tmp16__ >> 10 & 0x1; pDst->user_priority = tmp16__ >> 11 & 0x7; pDst->tsinfo_ack_pol = tmp16__ >> 14 & 0x3; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp17__ = *pBuf; pBuf += 1; ielen -= 1; pDst->schedule = tmp17__ >> 0 & 0x1; pDst->unused = tmp17__ >> 1 & 0x7f; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp18__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->size = tmp18__ >> 0 & 0x7fff; pDst->fixed = tmp18__ >> 15 & 0x1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->max_msdu_size, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->min_service_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->max_service_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->inactivity_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->suspension_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->min_data_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->mean_data_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->peak_data_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->burst_size, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->delay_bound, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->min_phy_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->surplus_bw_allowance, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->medium_time, pBuf, 0); (void)pCtx; return status; @@ -2161,6 +2462,9 @@ uint32_t dot11f_unpack_ie_vht_caps(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &tmp19__, pBuf, 0); pBuf += 4; ielen -= 4; @@ -2184,17 +2488,29 @@ uint32_t dot11f_unpack_ie_vht_caps(tpAniSirGlobal pCtx, pDst->rxAntPattern = tmp19__ >> 28 & 0x1; pDst->txAntPattern = tmp19__ >> 29 & 0x1; pDst->reserved1 = tmp19__ >> 30 & 0x3; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->rxMCSMap, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp20__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->rxHighSupDataRate = tmp20__ >> 0 & 0x1fff; pDst->reserved2 = tmp20__ >> 13 & 0x7; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->txMCSMap, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp21__, pBuf, 0); pDst->txSupDataRate = tmp21__ >> 0 & 0x1fff; pDst->reserved3 = tmp21__ >> 13 & 0x7; @@ -2216,15 +2532,27 @@ uint32_t dot11f_unpack_ie_vht_operation(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->chanWidth = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->chanCenterFreqSeg1 = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->chanCenterFreqSeg2 = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->basicMCSSet, pBuf, 0); (void)pCtx; return status; @@ -2245,6 +2573,9 @@ uint32_t dot11f_unpack_ie_wmm_schedule(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -2252,6 +2583,9 @@ uint32_t dot11f_unpack_ie_wmm_schedule(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp22__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -2259,15 +2593,27 @@ uint32_t dot11f_unpack_ie_wmm_schedule(tpAniSirGlobal pCtx, pDst->tsid = tmp22__ >> 1 & 0xf; pDst->direction = tmp22__ >> 5 & 0x3; pDst->reserved = tmp22__ >> 7 & 0x1ff; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->service_interval, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->max_service_dur, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->spec_interval, pBuf, 0); (void)pCtx; return status; @@ -2287,6 +2633,9 @@ uint32_t dot11f_unpack_ie_wmmtclas(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -2294,68 +2643,125 @@ uint32_t dot11f_unpack_ie_wmmtclas(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->user_priority = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->classifier_type = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->classifier_mask = *pBuf; pBuf += 1; ielen -= (uint8_t)1; switch (pDst->classifier_type) { case 0: + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.source, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.EthParams.dest, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.EthParams.type, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; break; case 1: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; switch (pDst->info.IpParams.version) { case 4: + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.source, pBuf, 4); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.dest, pBuf, 4); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.src_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.params.IpV4Params.DSCP = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.params.IpV4Params.proto = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->info.IpParams.params.IpV4Params.reserved = *pBuf; pBuf += 1; ielen -= (uint8_t)1; break; case 6: + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.source, pBuf, 16); pBuf += 16; ielen -= (uint8_t)16; + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.dest, pBuf, 16); pBuf += 16; ielen -= (uint8_t)16; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.src_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.dest_port, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 3)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.flow_label, pBuf, 3); pBuf += 3; ielen -= (uint8_t)3; @@ -2363,6 +2769,9 @@ uint32_t dot11f_unpack_ie_wmmtclas(tpAniSirGlobal pCtx, } break; case 2: + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->info.Params8021dq.tag_type, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; @@ -2386,6 +2795,9 @@ uint32_t dot11f_unpack_ie_wmmtclasproc(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -2393,6 +2805,9 @@ uint32_t dot11f_unpack_ie_wmmtclasproc(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->processing = *pBuf; (void)pCtx; return status; @@ -2412,6 +2827,9 @@ uint32_t dot11f_unpack_ie_wmmts_delay(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -2419,6 +2837,9 @@ uint32_t dot11f_unpack_ie_wmmts_delay(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->delay, pBuf, 0); (void)pCtx; return status; @@ -2441,6 +2862,9 @@ uint32_t dot11f_unpack_ie_wmmtspec(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -2448,6 +2872,9 @@ uint32_t dot11f_unpack_ie_wmmtspec(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp23__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -2459,55 +2886,103 @@ uint32_t dot11f_unpack_ie_wmmtspec(tpAniSirGlobal pCtx, pDst->psb = tmp23__ >> 10 & 0x1; pDst->user_priority = tmp23__ >> 11 & 0x7; pDst->tsinfo_ack_pol = tmp23__ >> 14 & 0x3; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp24__ = *pBuf; pBuf += 1; ielen -= 1; pDst->tsinfo_rsvd = tmp24__ >> 0 & 0x7f; pDst->burst_size_defn = tmp24__ >> 7 & 0x1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp25__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->size = tmp25__ >> 0 & 0x7fff; pDst->fixed = tmp25__ >> 15 & 0x1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->max_msdu_size, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->min_service_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->max_service_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->inactivity_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->suspension_int, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->service_start_time, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->min_data_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->mean_data_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->peak_data_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->burst_size, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->delay_bound, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->min_phy_rate, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->surplus_bw_allowance, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->medium_time, pBuf, 0); (void)pCtx; return status; @@ -2527,12 +3002,21 @@ uint32_t dot11f_unpack_ie_wider_bw_chan_switch_ann(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->newChanWidth = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->newCenterChanFreq0 = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->newCenterChanFreq1 = *pBuf; (void)pCtx; return status; @@ -2552,6 +3036,9 @@ uint32_t dot11f_unpack_ie_azimuth_req(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->request = *pBuf; (void)pCtx; return status; @@ -2571,6 +3058,9 @@ uint32_t dot11f_unpack_ie_max_age(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->max_age, pBuf, 0); (void)pCtx; return status; @@ -2619,9 +3109,15 @@ uint32_t dot11f_unpack_ie_neighbor_rpt(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->bssid, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp26__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2632,6 +3128,9 @@ uint32_t dot11f_unpack_ie_neighbor_rpt(tpAniSirGlobal pCtx, pDst->QosCap = tmp26__ >> 5 & 0x1; pDst->apsd = tmp26__ >> 6 & 0x1; pDst->rrm = tmp26__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp27__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2639,15 +3138,27 @@ uint32_t dot11f_unpack_ie_neighbor_rpt(tpAniSirGlobal pCtx, pDst->ImmBA = tmp27__ >> 1 & 0x1; pDst->MobilityDomain = tmp27__ >> 2 & 0x1; pDst->reserved = tmp27__ >> 3 & 0x1f; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->reserved1, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->regulatoryClass = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->PhyType = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -2677,6 +3188,9 @@ uint32_t dot11f_unpack_ie_req_mac_addr(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->addr, pBuf, 6); (void)pCtx; return status; @@ -2696,6 +3210,9 @@ uint32_t dot11f_unpack_ie_tgt_mac_addr(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->addr, pBuf, 6); (void)pCtx; return status; @@ -2740,6 +3257,9 @@ uint32_t dot11f_unpack_ie_aid(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->assocId, pBuf, 0); (void)pCtx; return status; @@ -2759,15 +3279,27 @@ uint32_t dot11f_unpack_ie_cf_params(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->cfp_count = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->cfp_period = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->cfp_maxduration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->cfp_durremaining, pBuf, 0); (void)pCtx; return status; @@ -2812,12 +3344,21 @@ uint32_t dot11f_unpack_ie_chan_switch_ann(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->switchMode = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->newChannel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->switchCount = *pBuf; (void)pCtx; return status; @@ -2879,6 +3420,9 @@ uint32_t dot11f_unpack_ie_country(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 3)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->country, pBuf, 3); pBuf += 3; ielen -= (uint8_t)3; @@ -2923,12 +3467,21 @@ uint32_t dot11f_unpack_ie_edca_param_set(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->qos = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->reserved = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp28__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2936,14 +3489,23 @@ uint32_t dot11f_unpack_ie_edca_param_set(tpAniSirGlobal pCtx, pDst->acbe_acm = tmp28__ >> 4 & 0x1; pDst->acbe_aci = tmp28__ >> 5 & 0x3; pDst->unused1 = tmp28__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp29__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbe_acwmin = tmp29__ >> 0 & 0xf; pDst->acbe_acwmax = tmp29__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acbe_txoplimit, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp30__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2951,14 +3513,23 @@ uint32_t dot11f_unpack_ie_edca_param_set(tpAniSirGlobal pCtx, pDst->acbk_acm = tmp30__ >> 4 & 0x1; pDst->acbk_aci = tmp30__ >> 5 & 0x3; pDst->unused2 = tmp30__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp31__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbk_acwmin = tmp31__ >> 0 & 0xf; pDst->acbk_acwmax = tmp31__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acbk_txoplimit, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp32__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2966,14 +3537,23 @@ uint32_t dot11f_unpack_ie_edca_param_set(tpAniSirGlobal pCtx, pDst->acvi_acm = tmp32__ >> 4 & 0x1; pDst->acvi_aci = tmp32__ >> 5 & 0x3; pDst->unused3 = tmp32__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp33__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvi_acwmin = tmp33__ >> 0 & 0xf; pDst->acvi_acwmax = tmp33__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acvi_txoplimit, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp34__ = *pBuf; pBuf += 1; ielen -= 1; @@ -2981,11 +3561,17 @@ uint32_t dot11f_unpack_ie_edca_param_set(tpAniSirGlobal pCtx, pDst->acvo_acm = tmp34__ >> 4 & 0x1; pDst->acvo_aci = tmp34__ >> 5 & 0x3; pDst->unused4 = tmp34__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp35__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvo_acwmin = tmp35__ >> 0 & 0xf; pDst->acvo_acwmax = tmp35__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acvo_txoplimit, pBuf, 0); (void)pCtx; return status; @@ -3006,6 +3592,9 @@ uint32_t dot11f_unpack_ie_erp_info(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp36__ = *pBuf; pDst->non_erp_present = tmp36__ >> 0 & 0x1; pDst->use_prot = tmp36__ >> 1 & 0x1; @@ -3055,9 +3644,15 @@ uint32_t dot11f_unpack_ie_ese_rad_mgmt_cap(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->mgmt_state = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp37__ = *pBuf; pDst->mbssid_mask = tmp37__ >> 0 & 0x7; pDst->reserved = tmp37__ >> 3 & 0x1f; @@ -3079,12 +3674,21 @@ uint32_t dot11f_unpack_ie_ese_traf_strm_met(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->tsid = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->state = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->msmt_interval, pBuf, 0); (void)pCtx; return status; @@ -3104,6 +3708,9 @@ uint32_t dot11f_unpack_ie_ese_traf_strm_rate_set(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->tsid = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -3132,9 +3739,15 @@ uint32_t dot11f_unpack_ie_ese_txmit_power(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->power_limit = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->reserved = *pBuf; (void)pCtx; return status; @@ -3154,6 +3767,9 @@ uint32_t dot11f_unpack_ie_ese_version(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; (void)pCtx; return status; @@ -3261,15 +3877,27 @@ uint32_t dot11f_unpack_ie_fh_param_set(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->dwell_time, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->hop_set = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->hop_pattern = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->hop_index = *pBuf; (void)pCtx; return status; @@ -3289,9 +3917,15 @@ uint32_t dot11f_unpack_ie_fh_params(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->radix = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->nchannels = *pBuf; (void)pCtx; return status; @@ -3311,15 +3945,27 @@ uint32_t dot11f_unpack_ie_fh_patt_table(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->flag = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->nsets = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->modulus = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->offset = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -3368,17 +4014,29 @@ uint32_t dot11f_unpack_ie_ft_info(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp38__, pBuf, 0); pBuf += 2; ielen -= 2; pDst->reserved = tmp38__ >> 0 & 0xff; pDst->IECount = tmp38__ >> 8 & 0xff; + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->MIC, pBuf, 16); pBuf += 16; ielen -= (uint8_t)16; + if (unlikely(ielen < 32)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->Anonce, pBuf, 32); pBuf += 32; ielen -= (uint8_t)32; + if (unlikely(ielen < 32)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->Snonce, pBuf, 32); pBuf += 32; ielen -= (uint8_t)32; @@ -3413,6 +4071,9 @@ uint32_t dot11f_unpack_ie_ht_caps(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp39__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -3430,15 +4091,24 @@ uint32_t dot11f_unpack_ie_ht_caps(tpAniSirGlobal pCtx, pDst->psmp = tmp39__ >> 13 & 0x1; pDst->stbcControlFrame = tmp39__ >> 14 & 0x1; pDst->lsigTXOPProtection = tmp39__ >> 15 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp40__ = *pBuf; pBuf += 1; ielen -= 1; pDst->maxRxAMPDUFactor = tmp40__ >> 0 & 0x3; pDst->mpduDensity = tmp40__ >> 2 & 0x7; pDst->reserved1 = tmp40__ >> 5 & 0x7; + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->supportedMCSSet, pBuf, 16); pBuf += 16; ielen -= (uint8_t)16; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp41__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -3447,6 +4117,9 @@ uint32_t dot11f_unpack_ie_ht_caps(tpAniSirGlobal pCtx, pDst->reserved2 = tmp41__ >> 3 & 0x1f; pDst->mcsFeedback = tmp41__ >> 8 & 0x3; pDst->reserved3 = tmp41__ >> 10 & 0x3f; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &tmp42__, pBuf, 0); pBuf += 4; ielen -= 4; @@ -3466,6 +4139,9 @@ uint32_t dot11f_unpack_ie_ht_caps(tpAniSirGlobal pCtx, pDst->uncompressedSteeringMatrixBFAntennae = tmp42__ >> 21 & 0x3; pDst->compressedSteeringMatrixBFAntennae = tmp42__ >> 23 & 0x3; pDst->reserved4 = tmp42__ >> 25 & 0x7f; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp43__ = *pBuf; pBuf += 1; ielen -= 1; @@ -3505,9 +4181,15 @@ uint32_t dot11f_unpack_ie_ht_info(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->primaryChannel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp44__ = *pBuf; pBuf += 1; ielen -= 1; @@ -3516,6 +4198,9 @@ uint32_t dot11f_unpack_ie_ht_info(tpAniSirGlobal pCtx, pDst->rifsMode = tmp44__ >> 3 & 0x1; pDst->controlledAccessOnly = tmp44__ >> 4 & 0x1; pDst->serviceIntervalGranularity = tmp44__ >> 5 & 0x7; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp45__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -3524,6 +4209,9 @@ uint32_t dot11f_unpack_ie_ht_info(tpAniSirGlobal pCtx, pDst->transmitBurstLimit = tmp45__ >> 3 & 0x1; pDst->obssNonHTStaPresent = tmp45__ >> 4 & 0x1; pDst->reserved = tmp45__ >> 5 & 0x7ff; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp46__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -3534,6 +4222,9 @@ uint32_t dot11f_unpack_ie_ht_info(tpAniSirGlobal pCtx, pDst->pcoActive = tmp46__ >> 10 & 0x1; pDst->pcoPhase = tmp46__ >> 11 & 0x1; pDst->reserved2 = tmp46__ >> 12 & 0xf; + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->basicMCSSet, pBuf, 16); pBuf += 16; ielen -= (uint8_t)16; @@ -3562,6 +4253,9 @@ uint32_t dot11f_unpack_ie_ibss_params(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->atim, pBuf, 0); (void)pCtx; return status; @@ -3581,12 +4275,21 @@ uint32_t dot11f_unpack_ie_link_identifier(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->bssid, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->InitStaAddr, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->RespStaAddr, pBuf, 6); (void)pCtx; return status; @@ -3685,9 +4388,15 @@ uint32_t dot11f_unpack_ie_measurement_report(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->token = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp47__ = *pBuf; pBuf += 1; ielen -= 1; @@ -3695,6 +4404,9 @@ uint32_t dot11f_unpack_ie_measurement_report(tpAniSirGlobal pCtx, pDst->incapable = tmp47__ >> 1 & 0x1; pDst->refused = tmp47__ >> 2 & 0x1; pDst->unused = tmp47__ >> 3 & 0x1f; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->type = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -3703,15 +4415,27 @@ uint32_t dot11f_unpack_ie_measurement_report(tpAniSirGlobal pCtx, } else { switch (pDst->type) { case 0: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.Basic.channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + framesntohq(pCtx, &pDst->report.Basic.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (uint8_t)8; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->report.Basic.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp48__ = *pBuf; pBuf += 1; ielen -= 1; @@ -3723,84 +4447,159 @@ uint32_t dot11f_unpack_ie_measurement_report(tpAniSirGlobal pCtx, pDst->report.Basic.unused = tmp48__ >> 5 & 0x7; break; case 1: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.CCA.channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + framesntohq(pCtx, &pDst->report.CCA.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (uint8_t)8; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->report.CCA.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.CCA.cca_busy_fraction = *pBuf; pBuf += 1; ielen -= (uint8_t)1; break; case 2: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + framesntohq(pCtx, &pDst->report.RPIHistogram.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (uint8_t)8; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->report.RPIHistogram.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi0_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi1_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi2_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi3_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi4_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi5_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi6_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.RPIHistogram.rpi7_density = *pBuf; pBuf += 1; ielen -= (uint8_t)1; break; case 5: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.Beacon.regClass = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.Beacon.channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + framesntohq(pCtx, &pDst->report.Beacon.meas_start_time, pBuf, 0); pBuf += 8; ielen -= (uint8_t)8; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->report.Beacon.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp49__ = *pBuf; pBuf += 1; ielen -= 1; pDst->report.Beacon.condensed_PHY = tmp49__ >> 0 & 0x7f; pDst->report.Beacon.reported_frame_type = tmp49__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.Beacon.RCPI = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.Beacon.RSNI = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->report.Beacon.BSSID, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->report.Beacon.antenna_id = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->report.Beacon.parent_TSF, pBuf, 0); pBuf += 4; ielen -= (uint8_t)4; @@ -3903,9 +4702,15 @@ uint32_t dot11f_unpack_ie_measurement_request(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_token = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp50__ = *pBuf; pBuf += 1; ielen -= 1; @@ -3915,59 +4720,107 @@ uint32_t dot11f_unpack_ie_measurement_request(tpAniSirGlobal pCtx, pDst->report = tmp50__ >> 3 & 0x1; pDst->durationMandatory = tmp50__ >> 4 & 0x1; pDst->unused = tmp50__ >> 5 & 0x7; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_type = *pBuf; pBuf += 1; ielen -= (uint8_t)1; switch (pDst->measurement_type) { case 0: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.Basic.channel_no = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->measurement_request.Basic.meas_start_time, pBuf, 8); pBuf += 8; ielen -= (uint8_t)8; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->measurement_request.Basic.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; break; case 1: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.CCA.channel_no = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->measurement_request.CCA.meas_start_time, pBuf, 8); pBuf += 8; ielen -= (uint8_t)8; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->measurement_request.CCA.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; break; case 2: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.RPIHistogram.channel_no = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->measurement_request.RPIHistogram.meas_start_time, pBuf, 8); pBuf += 8; ielen -= (uint8_t)8; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->measurement_request.RPIHistogram.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; break; case 5: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.Beacon.regClass = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.Beacon.channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->measurement_request.Beacon.randomization, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->measurement_request.Beacon.meas_duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.Beacon.meas_mode = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->measurement_request.Beacon.BSSID, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; @@ -3980,6 +4833,9 @@ uint32_t dot11f_unpack_ie_measurement_request(tpAniSirGlobal pCtx, sizeof(*pDst), append_ie); break; case 8: + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.lci.loc_subject = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -3992,9 +4848,15 @@ uint32_t dot11f_unpack_ie_measurement_request(tpAniSirGlobal pCtx, sizeof(*pDst), append_ie); break; case 16: + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->measurement_request.ftmrr.random_interval, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->measurement_request.ftmrr.min_ap_count = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -4026,9 +4888,15 @@ uint32_t dot11f_unpack_ie_mobility_domain(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->MDID, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp51__ = *pBuf; pDst->overDSCap = tmp51__ >> 0 & 0x1; pDst->resourceReqCap = tmp51__ >> 1 & 0x1; @@ -4080,9 +4948,15 @@ uint32_t dot11f_unpack_ie_neighbor_report(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->bssid, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp52__ = *pBuf; pBuf += 1; ielen -= 1; @@ -4093,6 +4967,9 @@ uint32_t dot11f_unpack_ie_neighbor_report(tpAniSirGlobal pCtx, pDst->QosCap = tmp52__ >> 5 & 0x1; pDst->apsd = tmp52__ >> 6 & 0x1; pDst->rrm = tmp52__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp53__ = *pBuf; pBuf += 1; ielen -= 1; @@ -4100,15 +4977,27 @@ uint32_t dot11f_unpack_ie_neighbor_report(tpAniSirGlobal pCtx, pDst->ImmBA = tmp53__ >> 1 & 0x1; pDst->MobilityDomain = tmp53__ >> 2 & 0x1; pDst->reserved = tmp53__ >> 3 & 0x1f; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->reserved1, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->regulatoryClass = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->PhyType = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -4138,24 +5027,45 @@ uint32_t dot11f_unpack_ie_obss_scan_parameters(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->obssScanPassiveDwell, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->obssScanActiveDwell, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->bssChannelWidthTriggerScanInterval, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->obssScanPassiveTotalPerChannel, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->obssScanActiveTotalPerChannel, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->bssWidthChannelTransitionDelayFactor, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->obssScanActivityThreshold, pBuf, 0); (void)pCtx; return status; @@ -4176,6 +5086,9 @@ uint32_t dot11f_unpack_ie_operating_mode(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp54__ = *pBuf; pDst->chanWidth = tmp54__ >> 0 & 0x3; pDst->reserved = tmp54__ >> 2 & 0x3; @@ -4489,9 +5402,15 @@ uint32_t dot11f_unpack_ie_pti_control(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->tid = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->sequence_control, pBuf, 0); (void)pCtx; return status; @@ -4512,6 +5431,9 @@ uint32_t dot11f_unpack_ie_pu_buffer_status(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp55__ = *pBuf; pDst->ac_bk_traffic_aval = tmp55__ >> 0 & 0x1; pDst->ac_be_traffic_aval = tmp55__ >> 1 & 0x1; @@ -4536,9 +5458,15 @@ uint32_t dot11f_unpack_ie_power_caps(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->minTxPower = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->maxTxPower = *pBuf; (void)pCtx; return status; @@ -4558,6 +5486,9 @@ uint32_t dot11f_unpack_ie_power_constraints(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->localPowerConstraints = *pBuf; (void)pCtx; return status; @@ -4577,12 +5508,21 @@ uint32_t dot11f_unpack_ie_qbss_load(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->stacount, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->chautil = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->avail, pBuf, 0); (void)pCtx; return status; @@ -4602,6 +5542,9 @@ uint32_t dot11f_unpack_ie_QCN_IE(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->version, pBuf, 4); (void)pCtx; return status; @@ -4621,9 +5564,15 @@ uint32_t dot11f_unpack_ie_QComVendorIE(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->type = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->channel = *pBuf; (void)pCtx; return status; @@ -4644,6 +5593,9 @@ uint32_t dot11f_unpack_ie_qos_caps_ap(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp56__ = *pBuf; pDst->count = tmp56__ >> 0 & 0xf; pDst->qack = tmp56__ >> 4 & 0x1; @@ -4669,6 +5621,9 @@ uint32_t dot11f_unpack_ie_qos_caps_station(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp57__ = *pBuf; pDst->acvo_uapsd = tmp57__ >> 0 & 0x1; pDst->acvi_uapsd = tmp57__ >> 1 & 0x1; @@ -4720,15 +5675,27 @@ uint32_t dot11f_unpack_ie_quiet(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->count = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->period = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->duration, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->offset, pBuf, 0); (void)pCtx; return status; @@ -4748,6 +5715,9 @@ uint32_t dot11f_unpack_ie_rcpiie(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->rcpi = *pBuf; (void)pCtx; return status; @@ -4841,10 +5811,14 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; uint8_t def_cipher_suite[4] = {0x00, 0x0f, 0xac, 0x04}; uint8_t def_akm_suite[4] = {0x00, 0x0f, 0xac, 0x01}; + (void) pBuf; (void)ielen; /* Shutup the compiler */ if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->version, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; @@ -4866,6 +5840,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, return 0U; } else { pDst->gp_cipher_suite_present = 1; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + if (ielen < 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4886,6 +5863,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, pDst->pmkid_count = 0U; return 0U; } else { + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + if (ielen < 2) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4895,6 +5875,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, pBuf += 2; ielen -= (uint8_t)2; } + if (unlikely(ielen < pDst->pwise_cipher_suite_count * 4)) + return DOT11F_INCOMPLETE_IE; + if (!pDst->pwise_cipher_suite_count || pDst->pwise_cipher_suite_count > 6) { pDst->present = 0; @@ -4917,6 +5900,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, pDst->pmkid_count = 0U; return 0U; } else { + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + if (ielen < 2) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4926,6 +5912,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, pBuf += 2; ielen -= (uint8_t)2; } + if (unlikely(ielen < pDst->akm_suite_cnt * 4)) + return DOT11F_INCOMPLETE_IE; + if (!pDst->akm_suite_cnt || pDst->akm_suite_cnt > 6) { pDst->present = 0; @@ -4947,6 +5936,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, return 0U; } else { pDst->RSN_Cap_present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + if (ielen < 2) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4962,6 +5954,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, pDst->pmkid_count = 0U; return 0U; } else { + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + if (ielen < 2) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4971,6 +5966,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, pBuf += 2; ielen -= (uint8_t)2; } + if (unlikely(ielen < pDst->pmkid_count * 16)) + return DOT11F_INCOMPLETE_IE; + if (pDst->pmkid_count > 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -4988,6 +5986,9 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx, return 0U; } else { pDst->gp_mgmt_cipher_suite_present = 1; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + if (ielen < 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5013,6 +6014,9 @@ uint32_t dot11f_unpack_ie_rsniie(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->rsni = *pBuf; (void)pCtx; return status; @@ -5140,12 +6144,21 @@ uint32_t dot11f_unpack_ie_tim(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->dtim_count = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->dtim_period = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->bmpctl = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -5174,9 +6187,15 @@ uint32_t dot11f_unpack_ie_tpc_report(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->tx_power = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->link_margin = *pBuf; (void)pCtx; return status; @@ -5214,12 +6233,21 @@ uint32_t dot11f_unpack_ie_time_advertisement(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->timing_capabilities = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 10)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->time_value, pBuf, 10); pBuf += 10; ielen -= (uint8_t)10; + if (unlikely(ielen < 5)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->time_error, pBuf, 5); (void)pCtx; return status; @@ -5239,9 +6267,15 @@ uint32_t dot11f_unpack_ie_timeout_interval(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->timeoutType = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + framesntohl(pCtx, &pDst->timeoutValue, pBuf, 0); (void)pCtx; return status; @@ -5261,18 +6295,33 @@ uint32_t dot11f_unpack_ie_vht_ext_bss_load(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->muMIMOCapStaCount = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->ssUnderUtil = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->FortyMHzUtil = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->EightyMHzUtil = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->OneSixtyMHzUtil = *pBuf; (void)pCtx; return status; @@ -5329,6 +6378,9 @@ uint32_t dot11f_unpack_ie_wapi(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->version, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; @@ -5336,9 +6388,15 @@ uint32_t dot11f_unpack_ie_wapi(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->akm_suite_count, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < pDst->akm_suite_count * 4)) + return DOT11F_INCOMPLETE_IE; + if (pDst->akm_suite_count > 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5347,9 +6405,15 @@ uint32_t dot11f_unpack_ie_wapi(tpAniSirGlobal pCtx, DOT11F_MEMCPY(pCtx, pDst->akm_suites, pBuf, (pDst->akm_suite_count * 4)); pBuf += (pDst->akm_suite_count * 4); ielen -= (pDst->akm_suite_count * 4); + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->unicast_cipher_suite_count, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < pDst->unicast_cipher_suite_count * 4)) + return DOT11F_INCOMPLETE_IE; + if (pDst->unicast_cipher_suite_count > 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5358,9 +6422,15 @@ uint32_t dot11f_unpack_ie_wapi(tpAniSirGlobal pCtx, DOT11F_MEMCPY(pCtx, pDst->unicast_cipher_suites, pBuf, (pDst->unicast_cipher_suite_count * 4)); pBuf += (pDst->unicast_cipher_suite_count * 4); ielen -= (pDst->unicast_cipher_suite_count * 4); + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->multicast_cipher_suite, pBuf, 4); pBuf += 4; ielen -= (uint8_t)4; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp58__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -5370,10 +6440,16 @@ uint32_t dot11f_unpack_ie_wapi(tpAniSirGlobal pCtx, pDst->bkid_count = 0U; return 0U; } else { + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->bkid_count, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; } + if (unlikely(ielen < pDst->bkid_count * 16)) + return DOT11F_INCOMPLETE_IE; + if (pDst->bkid_count > 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5423,9 +6499,15 @@ uint32_t dot11f_unpack_ie_wfatpc(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->txPower = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->linkMargin = *pBuf; (void)pCtx; return status; @@ -5471,6 +6553,9 @@ uint32_t dot11f_unpack_ie_wmm_caps(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -5478,6 +6563,9 @@ uint32_t dot11f_unpack_ie_wmm_caps(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp59__ = *pBuf; pDst->reserved = tmp59__ >> 0 & 0xf; pDst->qack = tmp59__ >> 4 & 0x1; @@ -5503,9 +6591,15 @@ uint32_t dot11f_unpack_ie_wmm_info_ap(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp60__ = *pBuf; pDst->param_set_count = tmp60__ >> 0 & 0xf; pDst->reserved = tmp60__ >> 4 & 0x7; @@ -5529,9 +6623,15 @@ uint32_t dot11f_unpack_ie_wmm_info_station(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp61__ = *pBuf; pDst->acvo_uapsd = tmp61__ >> 0 & 0x1; pDst->acvi_uapsd = tmp61__ >> 1 & 0x1; @@ -5566,6 +6666,9 @@ uint32_t dot11f_unpack_ie_wmm_params(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->version = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -5573,12 +6676,21 @@ uint32_t dot11f_unpack_ie_wmm_params(tpAniSirGlobal pCtx, pDst->present = 0; return status | DOT11F_BAD_FIXED_VALUE; } + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->qosInfo = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->reserved2 = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp62__ = *pBuf; pBuf += 1; ielen -= 1; @@ -5586,14 +6698,23 @@ uint32_t dot11f_unpack_ie_wmm_params(tpAniSirGlobal pCtx, pDst->acbe_acm = tmp62__ >> 4 & 0x1; pDst->acbe_aci = tmp62__ >> 5 & 0x3; pDst->unused1 = tmp62__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp63__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbe_acwmin = tmp63__ >> 0 & 0xf; pDst->acbe_acwmax = tmp63__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acbe_txoplimit, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp64__ = *pBuf; pBuf += 1; ielen -= 1; @@ -5601,14 +6722,23 @@ uint32_t dot11f_unpack_ie_wmm_params(tpAniSirGlobal pCtx, pDst->acbk_acm = tmp64__ >> 4 & 0x1; pDst->acbk_aci = tmp64__ >> 5 & 0x3; pDst->unused2 = tmp64__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp65__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acbk_acwmin = tmp65__ >> 0 & 0xf; pDst->acbk_acwmax = tmp65__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acbk_txoplimit, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp66__ = *pBuf; pBuf += 1; ielen -= 1; @@ -5616,14 +6746,23 @@ uint32_t dot11f_unpack_ie_wmm_params(tpAniSirGlobal pCtx, pDst->acvi_acm = tmp66__ >> 4 & 0x1; pDst->acvi_aci = tmp66__ >> 5 & 0x3; pDst->unused3 = tmp66__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp67__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvi_acwmin = tmp67__ >> 0 & 0xf; pDst->acvi_acwmax = tmp67__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acvi_txoplimit, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp68__ = *pBuf; pBuf += 1; ielen -= 1; @@ -5631,11 +6770,17 @@ uint32_t dot11f_unpack_ie_wmm_params(tpAniSirGlobal pCtx, pDst->acvo_acm = tmp68__ >> 4 & 0x1; pDst->acvo_aci = tmp68__ >> 5 & 0x3; pDst->unused4 = tmp68__ >> 7 & 0x1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp69__ = *pBuf; pBuf += 1; ielen -= 1; pDst->acvo_acwmin = tmp69__ >> 0 & 0xf; pDst->acvo_acwmax = tmp69__ >> 4 & 0xf; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->acvo_txoplimit, pBuf, 0); (void)pCtx; return status; @@ -5655,6 +6800,9 @@ uint32_t dot11f_unpack_ie_wpa(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->version, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; @@ -5669,6 +6817,9 @@ uint32_t dot11f_unpack_ie_wpa(tpAniSirGlobal pCtx, return 0U; } else { pDst->multicast_cipher_present = 1U; + if (unlikely(ielen < 4)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->multicast_cipher, pBuf, 4); pBuf += 4; ielen -= (uint8_t)4; @@ -5678,10 +6829,16 @@ uint32_t dot11f_unpack_ie_wpa(tpAniSirGlobal pCtx, pDst->auth_suite_count = 0U; return 0U; } else { + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->unicast_cipher_count, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; } + if (unlikely(ielen < pDst->unicast_cipher_count * 4)) + return DOT11F_INCOMPLETE_IE; + if (pDst->unicast_cipher_count > 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5694,10 +6851,16 @@ uint32_t dot11f_unpack_ie_wpa(tpAniSirGlobal pCtx, pDst->auth_suite_count = 0U; return 0U; } else { + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->auth_suite_count, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; } + if (unlikely(ielen < pDst->auth_suite_count * 4)) + return DOT11F_INCOMPLETE_IE; + if (pDst->auth_suite_count > 4) { pDst->present = 0; return DOT11F_SKIPPED_BAD_IE; @@ -5709,6 +6872,9 @@ uint32_t dot11f_unpack_ie_wpa(tpAniSirGlobal pCtx, if (!ielen) { return 0U; } else { + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->caps, pBuf, 0); } (void)pCtx; @@ -6248,6 +7414,9 @@ uint32_t dot11f_unpack_ie_dh_parameter_element(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->group, pBuf, 2); pBuf += 2; ielen -= (uint8_t)2; @@ -6271,15 +7440,27 @@ uint32_t dot11f_unpack_ie_ext_chan_switch_ann(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->switch_mode = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->new_reg_class = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->new_channel = *pBuf; pBuf += 1; ielen -= (uint8_t)1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->switch_count = *pBuf; (void)pCtx; return status; @@ -6299,6 +7480,9 @@ uint32_t dot11f_unpack_ie_fils_assoc_delay_info(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->assoc_delay_info = *pBuf; (void)pCtx; return status; @@ -6318,9 +7502,15 @@ uint32_t dot11f_unpack_ie_fils_hlp_container(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->dest_mac, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; + if (unlikely(ielen < 6)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->src_mac, pBuf, 6); pBuf += 6; ielen -= (uint8_t)6; @@ -6345,6 +7535,9 @@ uint32_t dot11f_unpack_ie_fils_indication(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &tmp70__, pBuf, 0); pBuf += 2; ielen -= 2; @@ -6377,6 +7570,9 @@ uint32_t dot11f_unpack_ie_fils_kde(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->key_rsc, pBuf, 8); pBuf += 8; ielen -= (uint8_t)8; @@ -6420,6 +7616,9 @@ uint32_t dot11f_unpack_ie_fils_nonce(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 16)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->nonce, pBuf, 16); (void)pCtx; return status; @@ -6439,6 +7638,9 @@ uint32_t dot11f_unpack_ie_fils_public_key(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->key_type = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -6462,6 +7664,9 @@ uint32_t dot11f_unpack_ie_fils_session(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 8)) + return DOT11F_INCOMPLETE_IE; + DOT11F_MEMCPY(pCtx, pDst->session, pBuf, 8); (void)pCtx; return status; @@ -6522,6 +7727,9 @@ uint32_t dot11f_unpack_ie_hs20vendor_ie(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp71__ = *pBuf; pBuf += 1; ielen -= 1; @@ -6534,11 +7742,17 @@ uint32_t dot11f_unpack_ie_hs20vendor_ie(tpAniSirGlobal pCtx, } else { switch (pDst->hs_id_present) { case 1: + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->hs_id.pps_mo.pps_mo_id, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; break; case 2: + if (unlikely(ielen < 2)) + return DOT11F_INCOMPLETE_IE; + framesntohs(pCtx, &pDst->hs_id.anqp_domain.anqp_domain_id, pBuf, 0); pBuf += 2; ielen -= (uint8_t)2; @@ -6564,6 +7778,9 @@ uint32_t dot11f_unpack_ie_ht2040_bss_coexistence(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + tmp72__ = *pBuf; pDst->info_request = tmp72__ >> 0 & 0x1; pDst->forty_mhz_intolerant = tmp72__ >> 1 & 0x1; @@ -6589,6 +7806,9 @@ uint32_t dot11f_unpack_ie_ht2040_bss_intolerant_report(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->operating_class = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -6637,6 +7857,9 @@ uint32_t dot11f_unpack_ie_sec_chan_offset_ele(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->secondaryChannelOffset = *pBuf; (void)pCtx; return status; @@ -6671,6 +7894,9 @@ uint32_t dot11f_unpack_ie_vendor_vht_ie(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + if (unlikely(ielen < 1)) + return DOT11F_INCOMPLETE_IE; + pDst->sub_type = *pBuf; pBuf += 1; ielen -= (uint8_t)1; @@ -15063,6 +16289,9 @@ uint32_t dot11f_pack_tlv_version2(tpAniSirGlobal pCtx, tmp78__ = 0U; tmp78__ |= (pSrc->minor << 0); tmp78__ |= (pSrc->major << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp78__; *pnConsumed += 1; pBuf += 1; @@ -16032,6 +17261,9 @@ uint32_t dot11f_pack_tlv_version(tpAniSirGlobal pCtx, tmp79__ = 0U; tmp79__ |= (pSrc->minor << 0); tmp79__ |= (pSrc->major << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp79__; *pnConsumed += 1; pBuf += 1; @@ -16275,6 +17507,9 @@ uint32_t dot11f_pack_tlv_oce_cap(tpAniSirGlobal pCtx, tmp80__ |= (pSrc->is_sta_cfon << 3); tmp80__ |= (pSrc->non_oce_ap_present << 4); tmp80__ |= (pSrc->reserved << 5); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp80__; *pnConsumed += 1; pBuf += 1; @@ -16309,6 +17544,9 @@ uint32_t dot11f_pack_tlv_reduced_wan_metrics(tpAniSirGlobal pCtx, tmp81__ = 0U; tmp81__ |= (pSrc->downlink_av_cap << 0); tmp81__ |= (pSrc->uplink_av_cap << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp81__; *pnConsumed += 1; pBuf += 1; @@ -16491,6 +17729,9 @@ uint32_t dot11f_pack_ie_gtk(tpAniSirGlobal pCtx, tmp82__ = 0U; tmp82__ |= (pSrc->keyId << 0); tmp82__ |= (pSrc->reserved << 2); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp82__, 0); *pnConsumed += 2; pBuf += 2; @@ -16922,6 +18163,9 @@ uint32_t dot11f_pack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, tmp83__ |= (pSrc->BeaconActive << 5); tmp83__ |= (pSrc->BeaconTable << 6); tmp83__ |= (pSrc->BeaconRepCond << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp83__; *pnConsumed += 1; pBuf += 1; @@ -16935,6 +18179,9 @@ uint32_t dot11f_pack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, tmp84__ |= (pSrc->LCIAzimuth << 5); tmp84__ |= (pSrc->TCMCapability << 6); tmp84__ |= (pSrc->triggeredTCM << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp84__; *pnConsumed += 1; pBuf += 1; @@ -16944,6 +18191,9 @@ uint32_t dot11f_pack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, tmp85__ |= (pSrc->RRMMIBEnabled << 1); tmp85__ |= (pSrc->operatingChanMax << 2); tmp85__ |= (pSrc->nonOperatinChanMax << 5); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp85__; *pnConsumed += 1; pBuf += 1; @@ -16955,6 +18205,9 @@ uint32_t dot11f_pack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, tmp86__ |= (pSrc->RCPIMeasurement << 5); tmp86__ |= (pSrc->RSNIMeasurement << 6); tmp86__ |= (pSrc->BssAvgAccessDelay << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp86__; *pnConsumed += 1; pBuf += 1; @@ -16965,6 +18218,9 @@ uint32_t dot11f_pack_ie_rrm_enabled_cap(tpAniSirGlobal pCtx, tmp87__ |= (pSrc->fine_time_meas_rpt << 2); tmp87__ |= (pSrc->lci_capability << 3); tmp87__ |= (pSrc->reserved << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp87__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -17059,6 +18315,9 @@ uint32_t dot11f_pack_ie_schedule(tpAniSirGlobal pCtx, tmp88__ |= (pSrc->tsid << 1); tmp88__ |= (pSrc->direction << 5); tmp88__ |= (pSrc->reserved << 7); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp88__, 0); *pnConsumed += 2; pBuf += 2; @@ -17306,6 +18565,9 @@ uint32_t dot11f_pack_ie_tspec(tpAniSirGlobal pCtx, tmp89__ |= (pSrc->psb << 10); tmp89__ |= (pSrc->user_priority << 11); tmp89__ |= (pSrc->tsinfo_ack_pol << 14); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp89__, 0); *pnConsumed += 2; pBuf += 2; @@ -17313,6 +18575,9 @@ uint32_t dot11f_pack_ie_tspec(tpAniSirGlobal pCtx, tmp90__ = 0U; tmp90__ |= (pSrc->schedule << 0); tmp90__ |= (pSrc->unused << 1); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp90__; *pnConsumed += 1; pBuf += 1; @@ -17320,6 +18585,9 @@ uint32_t dot11f_pack_ie_tspec(tpAniSirGlobal pCtx, tmp91__ = 0U; tmp91__ |= (pSrc->size << 0); tmp91__ |= (pSrc->fixed << 15); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp91__, 0); *pnConsumed += 2; pBuf += 2; @@ -17416,6 +18684,9 @@ uint32_t dot11f_pack_ie_vht_caps(tpAniSirGlobal pCtx, tmp92__ |= (pSrc->rxAntPattern << 28); tmp92__ |= (pSrc->txAntPattern << 29); tmp92__ |= (pSrc->reserved1 << 30); + if (unlikely(nBuf < 4)) + return DOT11F_INCOMPLETE_IE; + frameshtonl(pCtx, pBuf, tmp92__, 0); *pnConsumed += 4; pBuf += 4; @@ -17426,6 +18697,9 @@ uint32_t dot11f_pack_ie_vht_caps(tpAniSirGlobal pCtx, tmp93__ = 0U; tmp93__ |= (pSrc->rxHighSupDataRate << 0); tmp93__ |= (pSrc->reserved2 << 13); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp93__, 0); *pnConsumed += 2; pBuf += 2; @@ -17436,6 +18710,9 @@ uint32_t dot11f_pack_ie_vht_caps(tpAniSirGlobal pCtx, tmp94__ = 0U; tmp94__ |= (pSrc->txSupDataRate << 0); tmp94__ |= (pSrc->reserved3 << 13); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp94__, 0); *pnConsumed += 2; /* fieldsEndFlag = 1 */ @@ -17523,6 +18800,9 @@ uint32_t dot11f_pack_ie_wmm_schedule(tpAniSirGlobal pCtx, tmp95__ |= (pSrc->tsid << 1); tmp95__ |= (pSrc->direction << 5); tmp95__ |= (pSrc->reserved << 7); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp95__, 0); *pnConsumed += 2; pBuf += 2; @@ -17790,6 +19070,9 @@ uint32_t dot11f_pack_ie_wmmtspec(tpAniSirGlobal pCtx, tmp96__ |= (pSrc->psb << 10); tmp96__ |= (pSrc->user_priority << 11); tmp96__ |= (pSrc->tsinfo_ack_pol << 14); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp96__, 0); *pnConsumed += 2; pBuf += 2; @@ -17797,6 +19080,9 @@ uint32_t dot11f_pack_ie_wmmtspec(tpAniSirGlobal pCtx, tmp97__ = 0U; tmp97__ |= (pSrc->tsinfo_rsvd << 0); tmp97__ |= (pSrc->burst_size_defn << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp97__; *pnConsumed += 1; pBuf += 1; @@ -17804,6 +19090,9 @@ uint32_t dot11f_pack_ie_wmmtspec(tpAniSirGlobal pCtx, tmp98__ = 0U; tmp98__ |= (pSrc->size << 0); tmp98__ |= (pSrc->fixed << 15); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp98__, 0); *pnConsumed += 2; pBuf += 2; @@ -17985,6 +19274,9 @@ uint32_t dot11f_pack_ie_neighbor_rpt(tpAniSirGlobal pCtx, tmp99__ |= (pSrc->QosCap << 5); tmp99__ |= (pSrc->apsd << 6); tmp99__ |= (pSrc->rrm << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp99__; *pnConsumed += 1; pBuf += 1; @@ -17994,6 +19286,9 @@ uint32_t dot11f_pack_ie_neighbor_rpt(tpAniSirGlobal pCtx, tmp100__ |= (pSrc->ImmBA << 1); tmp100__ |= (pSrc->MobilityDomain << 2); tmp100__ |= (pSrc->reserved << 3); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp100__; *pnConsumed += 1; pBuf += 1; @@ -18384,6 +19679,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp101__ |= (pSrc->acbe_acm << 4); tmp101__ |= (pSrc->acbe_aci << 5); tmp101__ |= (pSrc->unused1 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp101__; *pnConsumed += 1; pBuf += 1; @@ -18391,6 +19689,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp102__ = 0U; tmp102__ |= (pSrc->acbe_acwmin << 0); tmp102__ |= (pSrc->acbe_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp102__; *pnConsumed += 1; pBuf += 1; @@ -18403,6 +19704,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp103__ |= (pSrc->acbk_acm << 4); tmp103__ |= (pSrc->acbk_aci << 5); tmp103__ |= (pSrc->unused2 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp103__; *pnConsumed += 1; pBuf += 1; @@ -18410,6 +19714,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp104__ = 0U; tmp104__ |= (pSrc->acbk_acwmin << 0); tmp104__ |= (pSrc->acbk_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp104__; *pnConsumed += 1; pBuf += 1; @@ -18422,6 +19729,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp105__ |= (pSrc->acvi_acm << 4); tmp105__ |= (pSrc->acvi_aci << 5); tmp105__ |= (pSrc->unused3 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp105__; *pnConsumed += 1; pBuf += 1; @@ -18429,6 +19739,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp106__ = 0U; tmp106__ |= (pSrc->acvi_acwmin << 0); tmp106__ |= (pSrc->acvi_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp106__; *pnConsumed += 1; pBuf += 1; @@ -18441,6 +19754,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp107__ |= (pSrc->acvo_acm << 4); tmp107__ |= (pSrc->acvo_aci << 5); tmp107__ |= (pSrc->unused4 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp107__; *pnConsumed += 1; pBuf += 1; @@ -18448,6 +19764,9 @@ uint32_t dot11f_pack_ie_edca_param_set(tpAniSirGlobal pCtx, tmp108__ = 0U; tmp108__ |= (pSrc->acvo_acwmin << 0); tmp108__ |= (pSrc->acvo_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp108__; *pnConsumed += 1; pBuf += 1; @@ -18487,6 +19806,9 @@ uint32_t dot11f_pack_ie_erp_info(tpAniSirGlobal pCtx, tmp109__ |= (pSrc->use_prot << 1); tmp109__ |= (pSrc->barker_preamble << 2); tmp109__ |= (pSrc->unused << 3); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp109__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -18569,6 +19891,9 @@ uint32_t dot11f_pack_ie_ese_rad_mgmt_cap(tpAniSirGlobal pCtx, tmp110__ = 0U; tmp110__ |= (pSrc->mbssid_mask << 0); tmp110__ |= (pSrc->reserved << 3); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp110__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -18966,6 +20291,9 @@ uint32_t dot11f_pack_ie_ft_info(tpAniSirGlobal pCtx, tmp111__ = 0U; tmp111__ |= (pSrc->reserved << 0); tmp111__ |= (pSrc->IECount << 8); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp111__, 0); *pnConsumed += 2; pBuf += 2; @@ -19032,6 +20360,9 @@ uint32_t dot11f_pack_ie_ht_caps(tpAniSirGlobal pCtx, tmp112__ |= (pSrc->psmp << 13); tmp112__ |= (pSrc->stbcControlFrame << 14); tmp112__ |= (pSrc->lsigTXOPProtection << 15); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp112__, 0); *pnConsumed += 2; pBuf += 2; @@ -19040,6 +20371,9 @@ uint32_t dot11f_pack_ie_ht_caps(tpAniSirGlobal pCtx, tmp113__ |= (pSrc->maxRxAMPDUFactor << 0); tmp113__ |= (pSrc->mpduDensity << 2); tmp113__ |= (pSrc->reserved1 << 5); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp113__; *pnConsumed += 1; pBuf += 1; @@ -19053,6 +20387,9 @@ uint32_t dot11f_pack_ie_ht_caps(tpAniSirGlobal pCtx, tmp114__ |= (pSrc->reserved2 << 3); tmp114__ |= (pSrc->mcsFeedback << 8); tmp114__ |= (pSrc->reserved3 << 10); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp114__, 0); *pnConsumed += 2; pBuf += 2; @@ -19074,6 +20411,9 @@ uint32_t dot11f_pack_ie_ht_caps(tpAniSirGlobal pCtx, tmp115__ |= (pSrc->uncompressedSteeringMatrixBFAntennae << 21); tmp115__ |= (pSrc->compressedSteeringMatrixBFAntennae << 23); tmp115__ |= (pSrc->reserved4 << 25); + if (unlikely(nBuf < 4)) + return DOT11F_INCOMPLETE_IE; + frameshtonl(pCtx, pBuf, tmp115__, 0); *pnConsumed += 4; pBuf += 4; @@ -19087,6 +20427,9 @@ uint32_t dot11f_pack_ie_ht_caps(tpAniSirGlobal pCtx, tmp116__ |= (pSrc->rxAS << 5); tmp116__ |= (pSrc->txSoundingPPDUs << 6); tmp116__ |= (pSrc->reserved5 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp116__; *pnConsumed += 1; pBuf += 1; @@ -19132,6 +20475,9 @@ uint32_t dot11f_pack_ie_ht_info(tpAniSirGlobal pCtx, tmp117__ |= (pSrc->rifsMode << 3); tmp117__ |= (pSrc->controlledAccessOnly << 4); tmp117__ |= (pSrc->serviceIntervalGranularity << 5); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp117__; *pnConsumed += 1; pBuf += 1; @@ -19142,6 +20488,9 @@ uint32_t dot11f_pack_ie_ht_info(tpAniSirGlobal pCtx, tmp118__ |= (pSrc->transmitBurstLimit << 3); tmp118__ |= (pSrc->obssNonHTStaPresent << 4); tmp118__ |= (pSrc->reserved << 5); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp118__, 0); *pnConsumed += 2; pBuf += 2; @@ -19154,6 +20503,9 @@ uint32_t dot11f_pack_ie_ht_info(tpAniSirGlobal pCtx, tmp119__ |= (pSrc->pcoActive << 10); tmp119__ |= (pSrc->pcoPhase << 11); tmp119__ |= (pSrc->reserved2 << 12); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp119__, 0); *pnConsumed += 2; pBuf += 2; @@ -19316,6 +20668,9 @@ uint32_t dot11f_pack_ie_measurement_report(tpAniSirGlobal pCtx, tmp120__ |= (pSrc->incapable << 1); tmp120__ |= (pSrc->refused << 2); tmp120__ |= (pSrc->unused << 3); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp120__; *pnConsumed += 1; pBuf += 1; @@ -19342,6 +20697,9 @@ uint32_t dot11f_pack_ie_measurement_report(tpAniSirGlobal pCtx, tmp121__ |= (pSrc->report.Basic.rader << 3); tmp121__ |= (pSrc->report.Basic.unmeasured << 4); tmp121__ |= (pSrc->report.Basic.unused << 5); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp121__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -19412,6 +20770,9 @@ uint32_t dot11f_pack_ie_measurement_report(tpAniSirGlobal pCtx, tmp122__ = 0U; tmp122__ |= (pSrc->report.Beacon.condensed_PHY << 0); tmp122__ |= (pSrc->report.Beacon.reported_frame_type << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp122__; *pnConsumed += 1; pBuf += 1; @@ -19483,6 +20844,9 @@ uint32_t dot11f_pack_ie_measurement_request(tpAniSirGlobal pCtx, tmp123__ |= (pSrc->report << 3); tmp123__ |= (pSrc->durationMandatory << 4); tmp123__ |= (pSrc->unused << 5); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp123__; *pnConsumed += 1; pBuf += 1; @@ -19613,6 +20977,9 @@ uint32_t dot11f_pack_ie_mobility_domain(tpAniSirGlobal pCtx, tmp124__ |= (pSrc->overDSCap << 0); tmp124__ |= (pSrc->resourceReqCap << 1); tmp124__ |= (pSrc->reserved << 2); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp124__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -19659,6 +21026,9 @@ uint32_t dot11f_pack_ie_neighbor_report(tpAniSirGlobal pCtx, tmp125__ |= (pSrc->QosCap << 5); tmp125__ |= (pSrc->apsd << 6); tmp125__ |= (pSrc->rrm << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp125__; *pnConsumed += 1; pBuf += 1; @@ -19668,6 +21038,9 @@ uint32_t dot11f_pack_ie_neighbor_report(tpAniSirGlobal pCtx, tmp126__ |= (pSrc->ImmBA << 1); tmp126__ |= (pSrc->MobilityDomain << 2); tmp126__ |= (pSrc->reserved << 3); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp126__; *pnConsumed += 1; pBuf += 1; @@ -19770,6 +21143,9 @@ uint32_t dot11f_pack_ie_operating_mode(tpAniSirGlobal pCtx, tmp127__ |= (pSrc->reserved << 2); tmp127__ |= (pSrc->rxNSS << 4); tmp127__ |= (pSrc->rxNSSType << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp127__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -20260,6 +21636,9 @@ uint32_t dot11f_pack_ie_pu_buffer_status(tpAniSirGlobal pCtx, tmp128__ |= (pSrc->ac_vi_traffic_aval << 2); tmp128__ |= (pSrc->ac_vo_traffic_aval << 3); tmp128__ |= (pSrc->reserved << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp128__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -20468,6 +21847,9 @@ uint32_t dot11f_pack_ie_qos_caps_ap(tpAniSirGlobal pCtx, tmp129__ |= (pSrc->qreq << 5); tmp129__ |= (pSrc->txopreq << 6); tmp129__ |= (pSrc->reserved << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp129__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -20507,6 +21889,9 @@ uint32_t dot11f_pack_ie_qos_caps_station(tpAniSirGlobal pCtx, tmp130__ |= (pSrc->qack << 4); tmp130__ |= (pSrc->max_sp_length << 5); tmp130__ |= (pSrc->more_data_ack << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp130__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -21181,6 +22566,9 @@ uint32_t dot11f_pack_ie_wapi(tpAniSirGlobal pCtx, tmp131__ = 0U; tmp131__ |= (pSrc->preauth << 0); tmp131__ |= (pSrc->reserved << 1); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp131__, 0); *pnConsumed += 2; pBuf += 2; @@ -21349,6 +22737,9 @@ uint32_t dot11f_pack_ie_wmm_caps(tpAniSirGlobal pCtx, tmp132__ |= (pSrc->queue_request << 5); tmp132__ |= (pSrc->txop_request << 6); tmp132__ |= (pSrc->more_ack << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp132__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -21397,6 +22788,9 @@ uint32_t dot11f_pack_ie_wmm_info_ap(tpAniSirGlobal pCtx, tmp133__ |= (pSrc->param_set_count << 0); tmp133__ |= (pSrc->reserved << 4); tmp133__ |= (pSrc->uapsd << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp133__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -21449,6 +22843,9 @@ uint32_t dot11f_pack_ie_wmm_info_station(tpAniSirGlobal pCtx, tmp134__ |= (pSrc->reserved1 << 4); tmp134__ |= (pSrc->max_sp_length << 5); tmp134__ |= (pSrc->reserved2 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp134__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ @@ -21511,6 +22908,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp135__ |= (pSrc->acbe_acm << 4); tmp135__ |= (pSrc->acbe_aci << 5); tmp135__ |= (pSrc->unused1 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp135__; *pnConsumed += 1; pBuf += 1; @@ -21518,6 +22918,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp136__ = 0U; tmp136__ |= (pSrc->acbe_acwmin << 0); tmp136__ |= (pSrc->acbe_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp136__; *pnConsumed += 1; pBuf += 1; @@ -21530,6 +22933,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp137__ |= (pSrc->acbk_acm << 4); tmp137__ |= (pSrc->acbk_aci << 5); tmp137__ |= (pSrc->unused2 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp137__; *pnConsumed += 1; pBuf += 1; @@ -21537,6 +22943,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp138__ = 0U; tmp138__ |= (pSrc->acbk_acwmin << 0); tmp138__ |= (pSrc->acbk_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp138__; *pnConsumed += 1; pBuf += 1; @@ -21549,6 +22958,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp139__ |= (pSrc->acvi_acm << 4); tmp139__ |= (pSrc->acvi_aci << 5); tmp139__ |= (pSrc->unused3 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp139__; *pnConsumed += 1; pBuf += 1; @@ -21556,6 +22968,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp140__ = 0U; tmp140__ |= (pSrc->acvi_acwmin << 0); tmp140__ |= (pSrc->acvi_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp140__; *pnConsumed += 1; pBuf += 1; @@ -21568,6 +22983,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp141__ |= (pSrc->acvo_acm << 4); tmp141__ |= (pSrc->acvo_aci << 5); tmp141__ |= (pSrc->unused4 << 7); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp141__; *pnConsumed += 1; pBuf += 1; @@ -21575,6 +22993,9 @@ uint32_t dot11f_pack_ie_wmm_params(tpAniSirGlobal pCtx, tmp142__ = 0U; tmp142__ |= (pSrc->acvo_acwmin << 0); tmp142__ |= (pSrc->acvo_acwmax << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp142__; *pnConsumed += 1; pBuf += 1; @@ -22291,6 +23712,9 @@ uint32_t dot11f_pack_ie_fils_indication(tpAniSirGlobal pCtx, tmp143__ |= (pSrc->is_fils_sk_auth_pfs_supported << 10); tmp143__ |= (pSrc->is_pk_auth_supported << 11); tmp143__ |= (pSrc->reserved << 12); + if (unlikely(nBuf < 2)) + return DOT11F_INCOMPLETE_IE; + frameshtons(pCtx, pBuf, tmp143__, 0); *pnConsumed += 2; pBuf += 2; @@ -22562,6 +23986,9 @@ uint32_t dot11f_pack_ie_hs20vendor_ie(tpAniSirGlobal pCtx, tmp144__ |= (pSrc->hs_id_present << 1); tmp144__ |= (pSrc->reserved << 3); tmp144__ |= (pSrc->release_num << 4); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp144__; *pnConsumed += 1; pBuf += 1; @@ -22616,6 +24043,9 @@ uint32_t dot11f_pack_ie_ht2040_bss_coexistence(tpAniSirGlobal pCtx, tmp145__ |= (pSrc->obss_scan_exemption_req << 3); tmp145__ |= (pSrc->obss_scan_exemption_grant << 4); tmp145__ |= (pSrc->unused << 5); + if (unlikely(nBuf < 1)) + return DOT11F_INCOMPLETE_IE; + *pBuf = tmp145__; *pnConsumed += 1; /* fieldsEndFlag = 1 */ diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index d769d042e4c3..487e1db0f58a 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /**========================================================================= \file mac_trace.c diff --git a/core/mac/src/sys/legacy/src/utils/src/parse_mac_trace.cmm b/core/mac/src/sys/legacy/src/utils/src/parse_mac_trace.cmm index b54deda08b71..be649ea99d1e 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parse_mac_trace.cmm +++ b/core/mac/src/sys/legacy/src/utils/src/parse_mac_trace.cmm @@ -1,7 +1,5 @@ ;Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. -;Previously licensed under the ISC license by Qualcomm Atheros, Inc. - ;Permission to use, copy, modify, and/or distribute this software for ;any purpose with or without fee is hereby granted, provided that the ;above copyright notice and this permission notice appear in all @@ -16,10 +14,6 @@ ;TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ;PERFORMANCE OF THIS SOFTWARE. -;This file was originally distributed by Qualcomm Atheros, Inc. -;under proprietary terms before Copyright ownership was assigned -;to the Linux Foundation. - ;parsemactrace.cmm - This script parses MAC trace table in UMAC layer ;This script relies on message id's placed in interface header file. ;If some message ID's are changed later, since they do not use enum, this script diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 0d49d5e0de65..3dce90cd9ea5 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * This file parser_api.cc contains the code for parsing * 802.11 messages. * Author: Pierre Vandwalle @@ -1827,7 +1818,8 @@ tSirRetStatus populate_dot11f_tpc_report(tpAniSirGlobal pMac, tDot11fIETPCReport *pDot11f, tpPESession psessionEntry) { - uint16_t staid, txPower; + uint16_t staid; + uint8_t tx_power; tSirRetStatus nSirStatus; nSirStatus = lim_get_mgmt_staid(pMac, &staid, psessionEntry); @@ -1838,8 +1830,9 @@ populate_dot11f_tpc_report(tpAniSirGlobal pMac, } /* FramesToDo: This function was "misplaced" in the move to Gen4_TVM... */ /* txPower = halGetRateToPwrValue( pMac, staid, pMac->lim.gLimCurrentChannelId, isBeacon ); */ - txPower = 0; - pDot11f->tx_power = (uint8_t) txPower; + tx_power = cfg_get_regulatory_max_transmit_power(pMac, + psessionEntry->currentOperChannel); + pDot11f->tx_power = tx_power; pDot11f->link_margin = 0; pDot11f->present = 1; @@ -2224,7 +2217,7 @@ sir_validate_and_rectify_ies(tpAniSirGlobal mac_ctx, uint32_t *missing_rsn_bytes) { uint32_t length = SIZE_OF_FIXED_PARAM; - uint8_t *ref_frame; + uint8_t *ref_frame = NULL; /* Frame contains atleast one IE */ if (frame_bytes > (SIZE_OF_FIXED_PARAM + @@ -2244,7 +2237,7 @@ sir_validate_and_rectify_ies(tpAniSirGlobal mac_ctx, * Capability with junk value. To avoid this, add RSN * Capability value with default value. */ - if ((*ref_frame == RSNIEID) && + if (ref_frame && (*ref_frame == RSNIEID) && (length == (frame_bytes + RSNIE_CAPABILITY_LEN))) { /* Assume RSN Capability as 00 */ @@ -2379,6 +2372,7 @@ static void update_fils_data(struct sir_fils_indication *fils_ind, tDot11fIEfils_indication *fils_indication) { uint8_t *data; + uint8_t remaining_data = fils_indication->num_variable_data; data = fils_indication->variable_data; fils_ind->is_present = true; @@ -2391,18 +2385,37 @@ static void update_fils_data(struct sir_fils_indication *fils_ind, fils_ind->is_pk_auth_supported = fils_indication->is_pk_auth_supported; if (fils_indication->is_cache_id_present) { + if (remaining_data < SIR_CACHE_IDENTIFIER_LEN) { + pe_err("Failed to copy Cache Identifier, Invalid remaining data %d", + remaining_data); + return; + } fils_ind->cache_identifier.is_present = true; qdf_mem_copy(fils_ind->cache_identifier.identifier, data, SIR_CACHE_IDENTIFIER_LEN); data = data + SIR_CACHE_IDENTIFIER_LEN; + remaining_data = remaining_data - SIR_CACHE_IDENTIFIER_LEN; } if (fils_indication->is_hessid_present) { + if (remaining_data < SIR_HESSID_LEN) { + pe_err("Failed to copy HESSID, Invalid remaining data %d", + remaining_data); + return; + } fils_ind->hessid.is_present = true; qdf_mem_copy(fils_ind->hessid.hessid, data, SIR_HESSID_LEN); data = data + SIR_HESSID_LEN; + remaining_data = remaining_data - SIR_HESSID_LEN; } if (fils_indication->realm_identifiers_cnt) { + if (remaining_data < (fils_indication->realm_identifiers_cnt * + SIR_REALM_LEN)) { + pe_err("Failed to copy Realm Identifier, Invalid remaining data %d realm_cnt %d", + remaining_data, + fils_indication->realm_identifiers_cnt); + return; + } fils_ind->realm_identifier.is_present = true; fils_ind->realm_identifier.realm_cnt = fils_indication->realm_identifiers_cnt; diff --git a/core/mac/src/sys/legacy/src/utils/src/utils_parser.c b/core/mac/src/sys/legacy/src/utils/src/utils_parser.c index f8aa56592596..2064f19dacf8 100644 --- a/core/mac/src/sys/legacy/src/utils/src/utils_parser.c +++ b/core/mac/src/sys/legacy/src/utils/src/utils_parser.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-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 @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * This file utils_parser.cc contains the code for parsing * 802.11 messages. @@ -140,7 +131,7 @@ tSirRetStatus convert_wsc_opaque(tpAniSirGlobal pMac, { /* This is awful, I know, but the old code just rammed the IE into */ /* an opaque array. Note that we need to explicitly add the vendorIE and OUI ! */ - uint8_t curAddIELen = pOld->length; + uint16_t curAddIELen = pOld->length; pOld->length = curAddIELen + pNew->num_data + 6; pOld->addIEdata[curAddIELen++] = 0xdd; @@ -159,7 +150,7 @@ tSirRetStatus convert_p2p_opaque(tpAniSirGlobal pMac, { /* This is awful, I know, but the old code just rammed the IE into */ /* an opaque array. Note that we need to explicitly add the vendorIE and OUI ! */ - uint8_t curAddIELen = pOld->length; + uint16_t curAddIELen = pOld->length; pOld->length = curAddIELen + pNew->num_data + 6; pOld->addIEdata[curAddIELen++] = 0xdd; @@ -179,7 +170,7 @@ tSirRetStatus convert_wfd_opaque(tpAniSirGlobal pMac, { /* This is awful, I know, but the old code just rammed the IE into */ /* an opaque array. Note that we need to explicitly add the vendorIE and OUI ! */ - uint8_t curAddIELen = pOld->length; + uint16_t curAddIELen = pOld->length; pOld->length = curAddIELen + pNew->num_data + 6; pOld->addIEdata[curAddIELen++] = 0xdd; diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 240427278b92..8ac433861c47 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __PLD_COMMON_H__ #define __PLD_COMMON_H__ diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index b537d48558d2..b6ba52139082 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #define pr_fmt(fmt) "wlan_pld:%s:%d:: " fmt, __func__, __LINE__ #include <linux/printk.h> diff --git a/core/pld/src/pld_internal.h b/core/pld/src/pld_internal.h index 315fb6f07a67..833c1630772b 100644 --- a/core/pld/src/pld_internal.h +++ b/core/pld/src/pld_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __PLD_COMMON_I_H__ #define __PLD_COMMON_I_H__ diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c index 14c684d0f1a9..35c00821fd9b 100644 --- a/core/pld/src/pld_pcie.c +++ b/core/pld/src/pld_pcie.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <linux/platform_device.h> #include <linux/err.h> #include <linux/pci.h> diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h index abfc63953942..be565619694b 100644 --- a/core/pld/src/pld_pcie.h +++ b/core/pld/src/pld_pcie.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __PLD_PCIE_H__ #define __PLD_PCIE_H__ diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c index f11982d39b7d..b1d1ed25b740 100644 --- a/core/pld/src/pld_snoc.c +++ b/core/pld/src/pld_snoc.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include <linux/platform_device.h> #include <linux/err.h> #include <linux/list.h> diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h index e3b1bf7e574b..7efc785d01e3 100644 --- a/core/pld/src/pld_snoc.h +++ b/core/pld/src/pld_snoc.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __PLD_SNOC_H__ #define __PLD_SNOC_H__ diff --git a/core/sap/dfs/inc/ath_dfs_structs.h b/core/sap/dfs/inc/ath_dfs_structs.h index 1a046b28819b..efbefd06e2e9 100644 --- a/core/sap/dfs/inc/ath_dfs_structs.h +++ b/core/sap/dfs/inc/ath_dfs_structs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== ath_dfs_structs.h diff --git a/core/sap/dfs/inc/dfs.h b/core/sap/dfs/inc/dfs.h index 6353c7e8e769..f617be16a503 100644 --- a/core/sap/dfs/inc/dfs.h +++ b/core/sap/dfs/inc/dfs.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2005-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs.h diff --git a/core/sap/dfs/inc/dfs_interface.h b/core/sap/dfs/inc/dfs_interface.h index 92207a8d246c..df84b3c9de91 100644 --- a/core/sap/dfs/inc/dfs_interface.h +++ b/core/sap/dfs/inc/dfs_interface.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_interface.h diff --git a/core/sap/dfs/inc/radar_filters.h b/core/sap/dfs/inc/radar_filters.h index e2b014aa4629..b804fd62a135 100644 --- a/core/sap/dfs/inc/radar_filters.h +++ b/core/sap/dfs/inc/radar_filters.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== radar_filters.h diff --git a/core/sap/dfs/src/dfs.c b/core/sap/dfs/src/dfs.c index b0db7881d34f..e44760aa259e 100644 --- a/core/sap/dfs/src/dfs.c +++ b/core/sap/dfs/src/dfs.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs.c diff --git a/core/sap/dfs/src/dfs_bindetects.c b/core/sap/dfs/src/dfs_bindetects.c index f88c1e864728..1ca54d20745d 100644 --- a/core/sap/dfs/src/dfs_bindetects.c +++ b/core/sap/dfs/src/dfs_bindetects.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2014, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_bindetects.c diff --git a/core/sap/dfs/src/dfs_debug.c b/core/sap/dfs/src/dfs_debug.c index 1a5aa2be2e98..63792aa0caf3 100644 --- a/core/sap/dfs/src/dfs_debug.c +++ b/core/sap/dfs/src/dfs_debug.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_debug.c diff --git a/core/sap/dfs/src/dfs_fcc_bin5.c b/core/sap/dfs/src/dfs_fcc_bin5.c index ca8e1c15e2e3..420385871d2d 100644 --- a/core/sap/dfs/src/dfs_fcc_bin5.c +++ b/core/sap/dfs/src/dfs_fcc_bin5.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_fcc_bin5.c diff --git a/core/sap/dfs/src/dfs_init.c b/core/sap/dfs/src/dfs_init.c index 250f5cec1eed..89aa95a270a7 100644 --- a/core/sap/dfs/src/dfs_init.c +++ b/core/sap/dfs/src/dfs_init.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_init.c diff --git a/core/sap/dfs/src/dfs_ioctl.h b/core/sap/dfs/src/dfs_ioctl.h index abe6c0c8c75e..94b0faee5016 100644 --- a/core/sap/dfs/src/dfs_ioctl.h +++ b/core/sap/dfs/src/dfs_ioctl.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2010-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_ioctl.h diff --git a/core/sap/dfs/src/dfs_ioctl_private.h b/core/sap/dfs/src/dfs_ioctl_private.h index 6b268b713e86..de9e2fd8f9bf 100644 --- a/core/sap/dfs/src/dfs_ioctl_private.h +++ b/core/sap/dfs/src/dfs_ioctl_private.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2010-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_ioctl_private.h diff --git a/core/sap/dfs/src/dfs_misc.c b/core/sap/dfs/src/dfs_misc.c index 37b78bdf4e45..90e4da9c8305 100644 --- a/core/sap/dfs/src/dfs_misc.c +++ b/core/sap/dfs/src/dfs_misc.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_misc.c diff --git a/core/sap/dfs/src/dfs_nol.c b/core/sap/dfs/src/dfs_nol.c index 85810bcd2b05..fd244a2a2fd0 100644 --- a/core/sap/dfs/src/dfs_nol.c +++ b/core/sap/dfs/src/dfs_nol.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_nol.c diff --git a/core/sap/dfs/src/dfs_phyerr.h b/core/sap/dfs/src/dfs_phyerr.h index 22a900f2e060..86fafc2c5e8f 100644 --- a/core/sap/dfs/src/dfs_phyerr.h +++ b/core/sap/dfs/src/dfs_phyerr.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * dfs_phyerr.h * * OVERVIEW: diff --git a/core/sap/dfs/src/dfs_phyerr_tlv.c b/core/sap/dfs/src/dfs_phyerr_tlv.c index 32438fe41be2..a1a49f6c683f 100644 --- a/core/sap/dfs/src/dfs_phyerr_tlv.c +++ b/core/sap/dfs/src/dfs_phyerr_tlv.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "dfs.h" /* TO DO DFS #include <ieee80211_var.h> diff --git a/core/sap/dfs/src/dfs_phyerr_tlv.h b/core/sap/dfs/src/dfs_phyerr_tlv.h index aa3383302e22..6261b4509eb6 100644 --- a/core/sap/dfs/src/dfs_phyerr_tlv.h +++ b/core/sap/dfs/src/dfs_phyerr_tlv.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_phyerr_tlv.h diff --git a/core/sap/dfs/src/dfs_process_phyerr.c b/core/sap/dfs/src/dfs_process_phyerr.c index 5ee708b8f1a2..004d0d4ffd4d 100644 --- a/core/sap/dfs/src/dfs_process_phyerr.c +++ b/core/sap/dfs/src/dfs_process_phyerr.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "dfs.h" #include "dfs_phyerr.h" /* For chip-specific phyerr func declarations */ /* TO DO DFS diff --git a/core/sap/dfs/src/dfs_process_radarevent.c b/core/sap/dfs/src/dfs_process_radarevent.c index 9321720f27ef..56bb9612e237 100644 --- a/core/sap/dfs/src/dfs_process_radarevent.c +++ b/core/sap/dfs/src/dfs_process_radarevent.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_radarevent.c diff --git a/core/sap/dfs/src/dfs_staggered.c b/core/sap/dfs/src/dfs_staggered.c index cf00e741d1ad..bbe44f16a3ce 100644 --- a/core/sap/dfs/src/dfs_staggered.c +++ b/core/sap/dfs/src/dfs_staggered.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2002-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== dfs_staggered.c diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index cc6252caa65e..228f7e3afa81 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WLAN_QCT_WLANSAP_H #define WLAN_QCT_WLANSAP_H diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 38aa0694b1b3..a26567362648 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== s a p A p i L i n k C n t l . C @@ -984,10 +975,12 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId, break; case eCSR_ROAM_REMAIN_CHAN_READY: /* roamId contains scan identifier */ - sap_ctx->roc_ind_scan_id = csr_roam_info->roc_scan_id; - sap_signal_hdd_event(sap_ctx, csr_roam_info, - eSAP_REMAIN_CHAN_READY, - (void *) eSAP_STATUS_SUCCESS); + if (csr_roam_info) { + sap_ctx->roc_ind_scan_id = csr_roam_info->roc_scan_id; + sap_signal_hdd_event(sap_ctx, csr_roam_info, + eSAP_REMAIN_CHAN_READY, + (void *) eSAP_STATUS_SUCCESS); + } break; case eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS: sap_signal_hdd_event(sap_ctx, csr_roam_info, @@ -1011,7 +1004,13 @@ wlansap_roam_callback(void *ctx, tCsrRoamInfo *csr_roam_info, uint32_t roamId, FL("Ignore the Radar indication")); break; } - + if (sap_ctx->sapsMachine != eSAP_STARTED && + sap_ctx->sapsMachine != eSAP_DFS_CAC_WAIT) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, + FL("Ignore Radar event in sap state %d"), + sap_ctx->sapsMachine); + break; + } if (sap_ctx->is_pre_cac_on) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED, FL("sapdfs: Radar detect on pre cac:%d"), diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index f5048e8906d0..041f0de646aa 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== s a p C h S e l e c t . C diff --git a/core/sap/src/sap_ch_select.h b/core/sap/src/sap_ch_select.h index 4fb45aa0de3d..4d95d34a6f20 100644 --- a/core/sap/src/sap_ch_select.h +++ b/core/sap/src/sap_ch_select.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2015, 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SAP_CH_SELECT_H) #define __SAP_CH_SELECT_H diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 0f3483b955d2..da4ed69d8dd8 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== s a p F s m . C @@ -1294,6 +1285,8 @@ static bool sap_is_valid_acs_channel(ptSapContext sap_ctx, uint8_t channel) int i = 0; /* Check whether acs is enabled */ + if (!sap_ctx->acs_cfg) + return true; if (!sap_ctx->acs_cfg->acs_mode) return true; @@ -2302,6 +2295,13 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, tHalHandle h_hal; uint8_t con_ch; bool sta_sap_scc_on_dfs_chan; + hdd_context_t *hdd_ctx; + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + cds_err("HDD context is NULL"); + return QDF_STATUS_E_FAILURE; + } h_hal = cds_get_context(QDF_MODULE_ID_SME); if (NULL == h_hal) { @@ -2384,6 +2384,9 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, sap_context->channel, sap_context->csr_roamProfile.phyMode, sap_context->cc_switch_mode); + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, + FL("After check overlap: con_ch:%d"), + con_ch); if (QDF_IS_STATUS_ERROR( cds_valid_sap_conc_channel_check(&con_ch, sap_context->channel))) { @@ -2392,14 +2395,20 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context, FL("SAP can't start (no MCC)")); return QDF_STATUS_E_ABORTED; } - + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, + FL("After check concurrency: con_ch:%d"), + con_ch); sta_sap_scc_on_dfs_chan = cds_is_sta_sap_scc_allowed_on_dfs_channel(); - if (con_ch && cds_is_safe_channel(con_ch) && - (!CDS_IS_DFS_CH(con_ch) || - (CDS_IS_DFS_CH(con_ch) && - sta_sap_scc_on_dfs_chan))) { + if (con_ch && + (cds_is_safe_channel(con_ch) || + (!cds_is_safe_channel(con_ch) && + hdd_ctx->config->sta_sap_scc_on_lte_coex_chan) + ) && + (!CDS_IS_DFS_CH(con_ch) || + (CDS_IS_DFS_CH(con_ch) && + sta_sap_scc_on_dfs_chan))) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, @@ -3236,8 +3245,7 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx, sap_ctx->acs_cfg->pri_ch = sap_ctx->channel; sap_ctx->acs_cfg->ch_width = sap_ctx->csr_roamProfile.ch_params.ch_width; - sap_config_acs_result(hal, sap_ctx, - sap_ctx->csr_roamProfile.ch_params.sec_ch_offset); + sap_config_acs_result(hal, sap_ctx, sap_ctx->secondary_ch); sap_ap_event.sapHddEventCode = eSAP_CHANNEL_CHANGE_EVENT; diff --git a/core/sap/src/sap_fsm_ext.h b/core/sap/src/sap_fsm_ext.h index 170f1f5bd0a9..9bbfb43e1bbd 100644 --- a/core/sap/src/sap_fsm_ext.h +++ b/core/sap/src/sap_fsm_ext.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* This file is generated from btampFsm.cdd - do not edit manually*/ /* Generated on: Thu Oct 16 15:40:39 PDT 2008 */ diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index 24991f15502e..7a525d4cc944 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WLAN_QCT_WLANSAP_INTERNAL_H #define WLAN_QCT_WLANSAP_INTERNAL_H diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 2144cba81c50..3d8cc9248fea 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * =========================================================================== * sapModule.C @@ -853,6 +844,7 @@ QDF_STATUS wlansap_start_bss(void *pCtx, /* pwextCtx */ pSapCtx->pUsrContext = pUsrContext; pSapCtx->enableOverLapCh = pConfig->enOverLapCh; pSapCtx->acs_cfg = &pConfig->acs_cfg; + pSapCtx->secondary_ch = pConfig->sec_ch; pSapCtx->isCacEndNotified = false; pSapCtx->is_chan_change_inprogress = false; pSapCtx->stop_bss_in_progress = false; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 6b1530aad3e8..da137e2373cd 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \file csr_api.h * @@ -1009,6 +1000,7 @@ typedef struct tagCsrRoamProfile { struct qdf_mac_addr bssid_hint; bool force_24ghz_in_ht20; bool supplicant_disabled_roaming; + bool driver_disabled_roaming; #ifdef WLAN_FEATURE_FILS_SK bool fils_connection; uint8_t *hlp_ie; @@ -1311,6 +1303,9 @@ typedef struct tagCsrConfigParam { bool enable_vht20_mcs9; uint8_t max_amsdu_num; uint8_t nSelect5GHzMargin; + uint32_t ho_delay_for_rx; + uint32_t min_delay_btw_roam_scans; + uint32_t roam_trigger_reason_bitmask; uint8_t isCoalesingInIBSSAllowed; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH uint8_t cc_switch_mode; @@ -1345,6 +1340,10 @@ typedef struct tagCsrConfigParam { bool enable5gEBT; bool enableSelfRecovery; uint32_t f_sta_miracast_mcc_rest_time_val; + uint32_t sta_scan_burst_duration; + uint32_t p2p_scan_burst_duration; + uint32_t go_scan_burst_duration; + uint32_t ap_scan_burst_duration; #ifdef FEATURE_AP_MCC_CH_AVOIDANCE bool sap_channel_avoidance; #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */ @@ -1383,7 +1382,15 @@ typedef struct tagCsrConfigParam { enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; struct csr_sta_roam_policy_params sta_roam_policy_params; uint32_t tx_aggregation_size; + uint32_t tx_aggregation_size_be; + uint32_t tx_aggregation_size_bk; + uint32_t tx_aggregation_size_vi; + uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; struct wmi_per_roam_config per_roam_config; bool enable_bcast_probe_rsp; bool is_fils_enabled; @@ -1407,6 +1414,7 @@ typedef struct tagCsrConfigParam { uint32_t offload_11k_enable_bitmask; struct csr_neighbor_report_offload_params neighbor_report_offload; bool enable_ftopen; + bool roam_force_rssi_trigger; } tCsrConfigParam; /* Tush */ diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 62ed7329ee8e..9d9753c5a404 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \file csr_internal.h * @@ -175,6 +166,8 @@ typedef enum { eCsrLostLink1Abort, eCsrLostLink2Abort, eCsrLostLink3Abort, + /* Roaming disabled from driver during connect/start BSS */ + eCsrDriverDisabled, } eCsrRoamReason; typedef enum { @@ -612,6 +605,9 @@ typedef struct tagCsrConfig { bool enableHeartBeatOffload; uint8_t max_amsdu_num; uint8_t nSelect5GHzMargin; + uint32_t ho_delay_for_rx; + uint32_t min_delay_btw_roam_scans; + uint32_t roam_trigger_reason_bitmask; uint8_t isCoalesingInIBSSAllowed; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH uint8_t cc_switch_mode; @@ -661,7 +657,15 @@ typedef struct tagCsrConfig { enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; struct csr_sta_roam_policy_params sta_roam_policy; uint32_t tx_aggregation_size; + uint32_t tx_aggregation_size_be; + uint32_t tx_aggregation_size_bk; + uint32_t tx_aggregation_size_vi; + uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; struct wmi_per_roam_config per_roam_config; bool enable_bcast_probe_rsp; bool is_fils_enabled; @@ -685,6 +689,7 @@ typedef struct tagCsrConfig { uint32_t offload_11k_enable_bitmask; struct csr_neighbor_report_offload_params neighbor_report_offload; bool enable_ftopen; + bool roam_force_rssi_trigger; } tCsrConfig; typedef struct tagCsrChannelPowerInfo { @@ -1035,6 +1040,8 @@ typedef struct tagCsrRoamSession { bool ch_switch_in_progress; bool roam_synch_in_progress; bool supported_nss_1x1; + uint8_t vdev_nss; + uint8_t nss; bool disable_hi_rssi; bool dhcp_done; uint8_t disconnect_reason; @@ -1045,6 +1052,7 @@ typedef struct tagCsrRoamSession { bool ignore_assoc_disallowed; bool discon_in_progress; struct csr_disconnect_stats disconnect_stats; + struct rsn_caps rsn_caps; } tCsrRoamSession; typedef struct tagCsrRoamStruct { diff --git a/core/sme/inc/csr_link_list.h b/core/sme/inc/csr_link_list.h index 1944aceea2b5..370be7838deb 100644 --- a/core/sme/inc/csr_link_list.h +++ b/core/sme/inc/csr_link_list.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \file csr_link_list.h * diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h index 615812fcfb40..9c968e45c0e6 100644 --- a/core/sme/inc/csr_neighbor_roam.h +++ b/core/sme/inc/csr_neighbor_roam.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \file csr_neighbor_roam.h * @@ -333,6 +324,7 @@ void csr_roam_reset_roam_params(tpAniSirGlobal mac_ptr); #define REASON_CTX_INIT 40 #define REASON_FILS_PARAMS_CHANGED 41 #define REASON_SME_ISSUED 42 +#define REASON_DRIVER_ENABLED 43 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) QDF_STATUS csr_roam_offload_scan(tpAniSirGlobal pMac, uint8_t sessionId, diff --git a/core/sme/inc/csr_support.h b/core/sme/inc/csr_support.h index db47ec47c13f..046803fdca3b 100644 --- a/core/sme/inc/csr_support.h +++ b/core/sme/inc/csr_support.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \file csr_support.h * @@ -175,16 +166,6 @@ typedef struct tagCsrRSNAuthIe { } qdf_packed AuthOui[1]; } qdf_packed tCsrRSNAuthIe; -typedef struct tagCsrRSNCapabilities { - uint16_t PreAuthSupported:1; - uint16_t NoPairwise:1; - uint16_t PTKSAReplayCounter:2; - uint16_t GTKSAReplayCounter:2; - uint16_t MFPRequired:1; - uint16_t MFPCapable:1; - uint16_t Reserved:8; -} qdf_packed tCsrRSNCapabilities; - typedef struct tagCsrRSNPMKIe { uint16_t cPMKIDs; struct { diff --git a/core/sme/inc/nan_api.h b/core/sme/inc/nan_api.h index 759dd407849a..8ef30a0b5567 100644 --- a/core/sme/inc/nan_api.h +++ b/core/sme/inc/nan_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * * Name: nan_api.h diff --git a/core/sme/inc/p2p_api.h b/core/sme/inc/p2p_api.h index df3568694846..1ff3b8f26a35 100644 --- a/core/sme/inc/p2p_api.h +++ b/core/sme/inc/p2p_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * * Name: p2p_api.h diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 9a529d6ff54a..a9d44073ab86 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SME_API_H) #define __SME_API_H @@ -1145,6 +1136,16 @@ QDF_STATUS sme_wifi_start_logger(tHalHandle hal, bool sme_neighbor_middle_of_roaming(tHalHandle hHal, uint8_t sessionId); +/* + * sme_is_any_session_in_middle_of_roaming() - check if roaming is in progress + * @hal: HAL Handle + * + * Checks if any SME session is in middle of roaming + * + * Return : true if roaming is in progress else false + */ +bool sme_is_any_session_in_middle_of_roaming(tHalHandle hal); + QDF_STATUS sme_enable_uapsd_for_ac(void *cds_ctx, uint8_t sta_id, sme_ac_enum_type ac, uint8_t tid, uint8_t pri, uint32_t srvc_int, @@ -1421,12 +1422,13 @@ QDF_STATUS sme_apf_offload_deregister_callback(tHalHandle hal); /** * sme_get_apf_capabilities() - Get length for APF offload * @hal: Global HAL handle + * @context: Context pointer * * API to get APF version and max filter size. * * Return: QDF_STATUS enumeration */ -QDF_STATUS sme_get_apf_capabilities(tHalHandle hal); +QDF_STATUS sme_get_apf_capabilities(tHalHandle hal, void *context); /** * sme_set_apf_instructions() - Set APF apf filter instructions. @@ -2267,4 +2269,18 @@ QDF_STATUS sme_get_roam_scan_stats(tHalHandle hal, roam_scan_stats_cb cb, void *context, uint32_t vdev_id); +/* + * sme_validate_channel_list() - Validate the given channel list + * @hal: handle to global hal context + * @chan_list: Pointer to the channel list + * @num_channels: number of channels present in the chan_list + * + * Validates the given channel list with base channels in mac context + * + * Return: True if all channels in the list are valid, false otherwise + */ +bool sme_validate_channel_list(tHalHandle hal, + uint8_t *chan_list, + uint8_t num_channels); + #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/inc/sme_ft_api.h b/core/sme/inc/sme_ft_api.h index 3b0ff3aaf19c..b063c83a189a 100644 --- a/core/sme/inc/sme_ft_api.h +++ b/core/sme/inc/sme_ft_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SME_FTAPI_H) #define __SME_FTAPI_H diff --git a/core/sme/inc/sme_inside.h b/core/sme/inc/sme_inside.h index 9791d1a4a95c..9d641021ac07 100644 --- a/core/sme/inc/sme_inside.h +++ b/core/sme/inc/sme_inside.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SMEINSIDE_H) #define __SMEINSIDE_H @@ -256,6 +247,18 @@ QDF_STATUS csr_process_same_ap_reassoc_cmd(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd); QDF_STATUS csr_process_scan_command(tpAniSirGlobal pMac, tSmeCmd *pCommand); QDF_STATUS csr_roam_process_command(tpAniSirGlobal pMac, tSmeCmd *pCommand); + +/** + * csr_roam_wm_status_change_complete() - Remove WM status change command + * from SME active command list + * @mac_ctx: global mac context + * + * This API removes WM status change command from SME active command list + * if present. + * + * Return: void + */ +void csr_roam_wm_status_change_complete(tpAniSirGlobal mac_ctx); void csr_roam_process_wm_status_change_command(tpAniSirGlobal pMac, tSmeCmd *pCommand); void csr_reinit_roam_cmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); diff --git a/core/sme/inc/sme_internal.h b/core/sme/inc/sme_internal.h index 66f58c7eba18..00538791e003 100644 --- a/core/sme/inc/sme_internal.h +++ b/core/sme/inc/sme_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SMEINTERNAL_H) #define __SMEINTERNAL_H diff --git a/core/sme/inc/sme_nan_datapath.h b/core/sme/inc/sme_nan_datapath.h index ff3dee1e2ac1..da75ef3f6c87 100644 --- a/core/sme/inc/sme_nan_datapath.h +++ b/core/sme/inc/sme_nan_datapath.h @@ -1,8 +1,6 @@ /* * Copyright (c) 2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/sme/inc/sme_power_save.h b/core/sme/inc/sme_power_save.h index 793d0b0a63d9..c885c83d9436 100644 --- a/core/sme/inc/sme_power_save.h +++ b/core/sme/inc/sme_power_save.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SME_POWER_SAVE_H) #define __SME_POWER_SAVE_H #include "qdf_lock.h" diff --git a/core/sme/inc/sme_power_save_api.h b/core/sme/inc/sme_power_save_api.h index 509f3f929731..e5264e41be30 100644 --- a/core/sme/inc/sme_power_save_api.h +++ b/core/sme/inc/sme_power_save_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SME_POWER_SAVE_API_H) #define __SME_POWER_SAVE_API_H diff --git a/core/sme/inc/sme_qos_api.h b/core/sme/inc/sme_qos_api.h index 0dd9fbcdceff..b110f16c8448 100644 --- a/core/sme/inc/sme_qos_api.h +++ b/core/sme/inc/sme_qos_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SME_QOSAPI_H) #define __SME_QOSAPI_H diff --git a/core/sme/inc/sme_qos_internal.h b/core/sme/inc/sme_qos_internal.h index 9c66febfa6ea..9ffe2e1d0c44 100644 --- a/core/sme/inc/sme_qos_internal.h +++ b/core/sme/inc/sme_qos_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SMEQOSINTERNAL_H) #define __SMEQOSINTERNAL_H diff --git a/core/sme/inc/sme_rrm_api.h b/core/sme/inc/sme_rrm_api.h index 78820dc0923d..9c571d3aea39 100644 --- a/core/sme/inc/sme_rrm_api.h +++ b/core/sme/inc/sme_rrm_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SMERRMAPI_H) #define __SMERRMAPI_H diff --git a/core/sme/inc/sme_rrm_internal.h b/core/sme/inc/sme_rrm_internal.h index 48dc39b6ce2a..217f5c86c8b0 100644 --- a/core/sme/inc/sme_rrm_internal.h +++ b/core/sme/inc/sme_rrm_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2016, 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__SMERRMINTERNAL_H) #define __SMERRMINTERNAL_H diff --git a/core/sme/inc/sme_trace.h b/core/sme/inc/sme_trace.h index cbeddaaa381f..552667ee901f 100644 --- a/core/sme/inc/sme_trace.h +++ b/core/sme/inc/sme_trace.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2016, 2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * \sme_trace.h * diff --git a/core/sme/inc/wlan_ps_wow_diag.h b/core/sme/inc/wlan_ps_wow_diag.h index 3d1cbc3d2b91..4702eb2ce90e 100644 --- a/core/sme/inc/wlan_ps_wow_diag.h +++ b/core/sme/inc/wlan_ps_wow_diag.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _WLAN_PS_WOW_DIAG_H_ #define _WLAN_PS_WOW_DIAG_H_ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 7053a2e1c19d..0f8f5c47a097 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: smeApi.c * * Definitions for SME APIs @@ -1358,6 +1349,7 @@ void sme_update_fine_time_measurement_capab(tHalHandle hal, uint8_t session_id, uint32_t val) { tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + QDF_STATUS status; mac_ctx->fine_time_meas_cap = val; @@ -1372,9 +1364,15 @@ void sme_update_fine_time_measurement_capab(tHalHandle hal, uint8_t session_id, } /* Inform this RRM IE change to FW */ - csr_roam_offload_scan(mac_ctx, session_id, + status = sme_acquire_global_lock(&mac_ctx->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + csr_roam_offload_scan(mac_ctx, session_id, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CONNECT_IES_CHANGED); + sme_release_global_lock(&mac_ctx->sme); + } else { + sme_err("Failed to acquire SME lock"); + } } /** @@ -1485,6 +1483,7 @@ QDF_STATUS sme_update_roam_params(tHalHandle hal, { tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); struct roam_ext_params *roam_params_dst; + QDF_STATUS status; uint8_t i; roam_params_dst = &mac_ctx->roam.configParam.roam_params; @@ -1549,9 +1548,18 @@ QDF_STATUS sme_update_roam_params(tHalHandle hal, default: break; } - csr_roam_offload_scan(mac_ctx, session_id, ROAM_SCAN_OFFLOAD_UPDATE_CFG, - update_param); - return 0; + + status = sme_acquire_global_lock(&mac_ctx->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + csr_roam_offload_scan(mac_ctx, session_id, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + update_param); + sme_release_global_lock(&mac_ctx->sme); + } else { + sme_err("Failed to acquire SME lock"); + } + + return status; } #ifdef WLAN_FEATURE_GTK_OFFLOAD @@ -1940,6 +1948,7 @@ QDF_STATUS sme_update_is_ese_feature_enabled(tHalHandle hHal, uint8_t sessionId, const bool isEseIniFeatureEnabled) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + QDF_STATUS status; if (pMac->roam.configParam.isEseIniFeatureEnabled == isEseIniFeatureEnabled) { @@ -1962,11 +1971,18 @@ QDF_STATUS sme_update_is_ese_feature_enabled(tHalHandle hHal, if (true == isEseIniFeatureEnabled) sme_update_fast_transition_enabled(hHal, true); - if (pMac->roam.configParam.isRoamOffloadScanEnabled) - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_ESE_INI_CFG_CHANGED); - + if (pMac->roam.configParam.isRoamOffloadScanEnabled) { + status = sme_acquire_global_lock(&pMac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ESE_INI_CFG_CHANGED); + sme_release_global_lock(&pMac->sme); + } else { + sme_err("Failed to acquire SME lock"); + return status; + } + } return QDF_STATUS_SUCCESS; } @@ -2252,10 +2268,7 @@ QDF_STATUS sme_set_ese_roam_scan_channel_list(tHalHandle hHal, status = sme_acquire_global_lock(&pMac->sme); if (!QDF_IS_STATUS_SUCCESS(status)) { - if (pMac->roam.configParam.isRoamOffloadScanEnabled) - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_CHANNEL_LIST_CHANGED); + sme_err("Failed to acquire SME lock"); return status; } if (NULL != curchnl_list_info->ChannelList) { @@ -2282,11 +2295,13 @@ QDF_STATUS sme_set_ese_roam_scan_channel_list(tHalHandle hHal, newChannelList, oldChannelList, pNeighborRoamInfo->neighborRoamState); } - sme_release_global_lock(&pMac->sme); + if (pMac->roam.configParam.isRoamOffloadScanEnabled) csr_roam_offload_scan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); + + sme_release_global_lock(&pMac->sme); return status; } @@ -2989,6 +3004,7 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg) } else { sme_err("Empty message for: %d", pMsg->type); } + break; case eWNI_SME_SET_THERMAL_LEVEL_IND: if (pMac->sme.set_thermal_level_cb) pMac->sme.set_thermal_level_cb(pMac->hHdd, @@ -8675,13 +8691,14 @@ QDF_STATUS sme_update_roam_scan_n_probes(tHalHandle hHal, uint8_t sessionId, "%s: gRoamScanNProbes is changed from %d to %d", __func__, pMac->roam.configParam.nProbes, nProbes); pMac->roam.configParam.nProbes = nProbes; + + if (pMac->roam.configParam.isRoamOffloadScanEnabled) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_NPROBES_CHANGED); + } sme_release_global_lock(&pMac->sme); } - if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_NPROBES_CHANGED); - } return status; } @@ -8717,14 +8734,15 @@ QDF_STATUS sme_update_roam_scan_home_away_time(tHalHandle hHal, nRoamScanHomeAwayTime); pMac->roam.configParam.nRoamScanHomeAwayTime = nRoamScanHomeAwayTime; + + if (pMac->roam.configParam.isRoamOffloadScanEnabled && + bSendOffloadCmd) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_HOME_AWAY_TIME_CHANGED); + } sme_release_global_lock(&pMac->sme); } - if (pMac->roam.configParam.isRoamOffloadScanEnabled && - bSendOffloadCmd) { - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_HOME_AWAY_TIME_CHANGED); - } return status; } @@ -8848,13 +8866,14 @@ QDF_STATUS sme_update_roam_rssi_diff(tHalHandle hHal, uint8_t sessionId, [sessionId]. neighborRoamState)); pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; + + if (pMac->roam.configParam.isRoamOffloadScanEnabled) + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_RSSI_DIFF_CHANGED); + sme_release_global_lock(&pMac->sme); } - - if (pMac->roam.configParam.isRoamOffloadScanEnabled) - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_RSSI_DIFF_CHANGED); return status; } @@ -8887,10 +8906,16 @@ QDF_STATUS sme_update_fils_config(tHalHandle hal, uint8_t session_id, csr_update_fils_config(mac, session_id, src_profile); if (csr_roamIsRoamOffloadEnabled(mac)) { - sme_debug("Updating fils config to fw"); - csr_roam_offload_scan(mac, session_id, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_FILS_PARAMS_CHANGED); + status = sme_acquire_global_lock(&mac->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + sme_debug("Updating fils config to fw"); + csr_roam_offload_scan(mac, session_id, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_FILS_PARAMS_CHANGED); + sme_release_global_lock(&mac->sme); + } else { + sme_err("Failed to acquire SME lock"); + } } else { sme_info("LFR3 not enabled"); return QDF_STATUS_E_INVAL; @@ -9275,6 +9300,17 @@ QDF_STATUS sme_stop_roaming(tHalHandle hal, uint8_t session_id, uint8_t reason) session = CSR_GET_SESSION(mac_ctx, session_id); + /* + * set the driver_disabled_roaming flag to true even if roaming + * is not enabled on this session so that roam start requests for + * this session can be blocked until driver enables roaming + */ + if (reason == eCsrDriverDisabled && session->pCurRoamProfile) { + session->pCurRoamProfile->driver_disabled_roaming = true; + sme_debug("driver_disabled_roaming set for session %d", + session_id); + } + roam_info = &mac_ctx->roam.neighborRoamInfo[session_id]; if (!roam_info->b_roam_scan_offload_started) { sme_debug("Roaming already disabled for session %d", session_id); @@ -9287,10 +9323,12 @@ QDF_STATUS sme_stop_roaming(tHalHandle hal, uint8_t session_id, uint8_t reason) } req->Command = ROAM_SCAN_OFFLOAD_STOP; - if (reason == eCsrForcedDisassoc) + + if ((reason == eCsrForcedDisassoc) || (reason == eCsrDriverDisabled)) req->reason = REASON_ROAM_STOP_ALL; else req->reason = REASON_SME_ISSUED; + req->sessionId = session_id; if (csr_neighbor_middle_of_roaming(mac_ctx, session_id)) req->middle_of_roaming = 1; @@ -9795,13 +9833,14 @@ QDF_STATUS sme_set_neighbor_scan_refresh_period(tHalHandle hHal, pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod = neighborScanResultsRefreshPeriod; + if (pMac->roam.configParam.isRoamOffloadScanEnabled) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); + } sme_release_global_lock(&pMac->sme); } - if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); - } + return status; } @@ -9918,13 +9957,15 @@ QDF_STATUS sme_update_empty_scan_refresh_period(tHalHandle hHal, uint8_t nEmptyScanRefreshPeriod; pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; + + if (pMac->roam.configParam.isRoamOffloadScanEnabled) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); + } sme_release_global_lock(&pMac->sme); } - if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); - } + return status; } @@ -10024,13 +10065,14 @@ QDF_STATUS sme_set_neighbor_scan_max_chan_time(tHalHandle hHal, uint8_t nNeighborScanMaxChanTime; pNeighborRoamInfo->cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; + if (pMac->roam.configParam.isRoamOffloadScanEnabled) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_SCAN_CH_TIME_CHANGED); + } sme_release_global_lock(&pMac->sme); } - if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_SCAN_CH_TIME_CHANGED); - } + return status; } @@ -10251,13 +10293,14 @@ QDF_STATUS sme_set_neighbor_scan_period(tHalHandle hHal, uint8_t sessionId, nNeighborScanPeriod; pNeighborRoamInfo->cfgParams.neighborScanPeriod = nNeighborScanPeriod; + + if (pMac->roam.configParam.isRoamOffloadScanEnabled) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_SCAN_HOME_TIME_CHANGED); + } sme_release_global_lock(&pMac->sme); } - if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_SCAN_HOME_TIME_CHANGED); - } return status; } @@ -10382,10 +10425,7 @@ QDF_STATUS sme_change_roam_scan_channel_list(tHalHandle hHal, uint8_t sessionId, pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; status = sme_acquire_global_lock(&pMac->sme); if (!QDF_IS_STATUS_SUCCESS(status)) { - if (pMac->roam.configParam.isRoamOffloadScanEnabled) - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_CHANNEL_LIST_CHANGED); + sme_err("Failed to acquire SME lock"); return status; } chan_info = &pNeighborRoamInfo->cfgParams.channelInfo; @@ -10421,12 +10461,13 @@ QDF_STATUS sme_change_roam_scan_channel_list(tHalHandle hHal, uint8_t sessionId, "LFR set roam scan channels: %s, old: %s, state: %d", newChannelList, oldChannelList, pMac->roam.neighborRoamInfo[sessionId].neighborRoamState); - sme_release_global_lock(&pMac->sme); if (pMac->roam.configParam.isRoamOffloadScanEnabled) csr_roam_offload_scan(pMac, sessionId, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); + + sme_release_global_lock(&pMac->sme); return status; } @@ -11674,6 +11715,9 @@ QDF_STATUS sme_set_wlm_latency_level(tHalHandle hal, uint16_t session_id, struct wlm_latency_level_param params; void *wma = cds_get_context(QDF_MODULE_ID_WMA); + if (!wma) + return QDF_STATUS_E_FAILURE; + if (!mac_ctx->roam.configParam.wlm_latency_enable) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, "%s: WLM latency level setting is disabled", @@ -13739,13 +13783,14 @@ QDF_STATUS sme_update_dfs_scan_mode(tHalHandle hHal, uint8_t sessionId, neighborRoamState)); pMac->roam.configParam.allowDFSChannelRoam = allowDFSChannelRoam; + if (pMac->roam.configParam.isRoamOffloadScanEnabled) { + csr_roam_offload_scan(pMac, sessionId, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ROAM_DFS_SCAN_MODE_CHANGED); + } sme_release_global_lock(&pMac->sme); } - if (pMac->roam.configParam.isRoamOffloadScanEnabled) { - csr_roam_offload_scan(pMac, sessionId, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, - REASON_ROAM_DFS_SCAN_MODE_CHANGED); - } + return status; } @@ -15526,11 +15571,25 @@ bool sme_neighbor_middle_of_roaming(tHalHandle hHal, uint8_t sessionId) if (CSR_IS_SESSION_VALID(mac_ctx, sessionId)) val = csr_neighbor_middle_of_roaming(mac_ctx, sessionId); else - sme_err("Invalid Session: %d", sessionId); + sme_debug("Invalid Session: %d", sessionId); return val; } +bool sme_is_any_session_in_middle_of_roaming(tHalHandle hal) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + uint8_t session_id; + + for (session_id = 0; session_id < CSR_ROAM_SESSION_MAX; session_id++) { + if (CSR_IS_SESSION_VALID(mac_ctx, session_id) && + csr_neighbor_middle_of_roaming(mac_ctx, session_id)) + return true; + } + + return false; +} + /** * sme_send_flush_logs_cmd_to_fw() - Flush FW logs * @mac: MAC handle @@ -16374,13 +16433,14 @@ QDF_STATUS sme_update_roam_scan_hi_rssi_scan_params(tHalHandle hal_handle, status = QDF_STATUS_E_INVAL; break; } + + if (mac_ctx->roam.configParam.isRoamOffloadScanEnabled && + status == QDF_STATUS_SUCCESS) { + csr_roam_offload_scan(mac_ctx, session_id, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, reason); + } sme_release_global_lock(&mac_ctx->sme); } - if (mac_ctx->roam.configParam.isRoamOffloadScanEnabled && - status == QDF_STATUS_SUCCESS) { - csr_roam_offload_scan(mac_ctx, session_id, - ROAM_SCAN_OFFLOAD_UPDATE_CFG, reason); - } return status; } @@ -16780,7 +16840,7 @@ void sme_send_disassoc_req_frame(tHalHandle hal, uint8_t session_id, FL("cds_send_mb_message Failed")); } -QDF_STATUS sme_get_apf_capabilities(tHalHandle hal) +QDF_STATUS sme_get_apf_capabilities(tHalHandle hal, void *context) { QDF_STATUS status = QDF_STATUS_SUCCESS; tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); @@ -16791,7 +16851,7 @@ QDF_STATUS sme_get_apf_capabilities(tHalHandle hal) status = sme_acquire_global_lock(&mac_ctx->sme); if (QDF_STATUS_SUCCESS == status) { /* Serialize the req through MC thread */ - cds_msg.bodyptr = NULL; + cds_msg.bodyptr = context; cds_msg.type = WDA_APF_GET_CAPABILITIES_REQ; status = cds_mq_post_message(QDF_MODULE_ID_WMA, &cds_msg); if (!QDF_IS_STATUS_SUCCESS(status)) { @@ -17440,11 +17500,18 @@ QDF_STATUS sme_update_sta_roam_policy(tHalHandle hal_handle, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, FL("failed to update the supported channel list")); } - if (mac_ctx->roam.configParam.isRoamOffloadScanEnabled) - csr_roam_offload_scan(mac_ctx, session_id, + + if (mac_ctx->roam.configParam.isRoamOffloadScanEnabled) { + status = sme_acquire_global_lock(&mac_ctx->sme); + if (QDF_IS_STATUS_SUCCESS(status)) { + csr_roam_offload_scan(mac_ctx, session_id, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_ROAM_SCAN_STA_ROAM_POLICY_CHANGED); - + sme_release_global_lock(&mac_ctx->sme); + } else { + sme_err("Failed to acquire SME lock"); + } + } qdf_mem_free(sme_config); return status; } @@ -19365,3 +19432,37 @@ QDF_STATUS sme_handle_sae_msg(tHalHandle hal, uint8_t session_id, return qdf_status; } #endif + +bool sme_validate_channel_list(tHalHandle hal, + uint8_t *chan_list, + uint8_t num_channels) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + uint8_t i = 0; + uint8_t j; + bool found; + tCsrChannel *ch_lst_info = &mac_ctx->scan.base_channels; + + if (!chan_list || !num_channels) { + sme_err("Chan list empty %pK or num_channels is 0", chan_list); + return false; + } + + while (i < num_channels) { + found = false; + for (j = 0; j < ch_lst_info->numChannels; j++) { + if (ch_lst_info->channelList[j] == chan_list[i]) { + found = true; + break; + } + } + + if (!found) { + sme_debug("Invalid channel %d", chan_list[i]); + return false; + } + + i++; + } + return true; +} diff --git a/core/sme/src/common/sme_ft_api.c b/core/sme/src/common/sme_ft_api.c index bbfcaf1b1bd6..7a7913c23d7f 100644 --- a/core/sme/src/common/sme_ft_api.c +++ b/core/sme/src/common/sme_ft_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,11 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ #include <sir_common.h> #include <ani_global.h> #include <csr_inside_api.h> diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index fe49faab6eb7..42bf8316aea0 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "sme_power_save.h" #include "sme_power_save_api.h" #include <sir_common.h> diff --git a/core/sme/src/common/sme_trace.c b/core/sme/src/common/sme_trace.c index bc95c04cdd82..d80702f52853 100644 --- a/core/sme/src/common/sme_trace.c +++ b/core/sme/src/common/sme_trace.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: smeTrace.c * Implementation for trace related APIs * diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 10110443d77a..5d8a575274de 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_api_roam.c * * Implementation for the Common Roaming interfaces. @@ -2213,6 +2204,8 @@ csr_fetch_ch_lst_from_received_list(tpAniSirGlobal mac_ctx, } req_buf->ConnectedNetwork.ChannelCount = num_channels; req_buf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_UPDATE; + sme_debug("ChannelCacheType %dChannelCount %d", + req_buf->ChannelCacheType, num_channels); } /** @@ -2829,6 +2822,12 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pParam->max_amsdu_num; pMac->roam.configParam.nSelect5GHzMargin = pParam->nSelect5GHzMargin; + pMac->roam.configParam.ho_delay_for_rx = + pParam->ho_delay_for_rx; + pMac->roam.configParam.min_delay_btw_roam_scans = + pParam->min_delay_btw_roam_scans; + pMac->roam.configParam.roam_trigger_reason_bitmask = + pParam->roam_trigger_reason_bitmask; pMac->roam.configParam.isCoalesingInIBSSAllowed = pParam->isCoalesingInIBSSAllowed; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH @@ -2921,6 +2920,14 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->f_sta_miracast_mcc_rest_time_val = pParam->f_sta_miracast_mcc_rest_time_val; + pMac->sta_scan_burst_duration = + pParam->sta_scan_burst_duration; + pMac->p2p_scan_burst_duration = + pParam->p2p_scan_burst_duration; + pMac->go_scan_burst_duration = + pParam->go_scan_burst_duration; + pMac->ap_scan_burst_duration = + pParam->ap_scan_burst_duration; #ifdef FEATURE_AP_MCC_CH_AVOIDANCE pMac->sap.sap_channel_avoidance = pParam->sap_channel_avoidance; @@ -2976,8 +2983,24 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->roam.configParam.tx_aggregation_size = pParam->tx_aggregation_size; + pMac->roam.configParam.tx_aggregation_size_be = + pParam->tx_aggregation_size_be; + pMac->roam.configParam.tx_aggregation_size_bk = + pParam->tx_aggregation_size_bk; + pMac->roam.configParam.tx_aggregation_size_vi = + pParam->tx_aggregation_size_vi; + pMac->roam.configParam.tx_aggregation_size_vo = + pParam->tx_aggregation_size_vo; pMac->roam.configParam.rx_aggregation_size = pParam->rx_aggregation_size; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_be = + pParam->tx_aggr_sw_retry_threshold_be; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_bk = + pParam->tx_aggr_sw_retry_threshold_bk; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vi = + pParam->tx_aggr_sw_retry_threshold_vi; + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vo = + pParam->tx_aggr_sw_retry_threshold_vo; pMac->roam.configParam.enable_bcast_probe_rsp = pParam->enable_bcast_probe_rsp; pMac->roam.configParam.is_fils_enabled = @@ -3004,6 +3027,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, } pMac->roam.configParam.oce_feature_bitmap = pParam->oce_feature_bitmap; + pMac->roam.configParam.roam_force_rssi_trigger = + pParam->roam_force_rssi_trigger; qdf_mem_copy(&pMac->roam.configParam.bss_score_params, &pParam->bss_score_params, @@ -3167,6 +3192,10 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) cfg_params->rx_ldpc_support_for_2g; pParam->max_amsdu_num = cfg_params->max_amsdu_num; pParam->nSelect5GHzMargin = cfg_params->nSelect5GHzMargin; + pParam->ho_delay_for_rx = cfg_params->ho_delay_for_rx; + pParam->min_delay_btw_roam_scans = cfg_params->min_delay_btw_roam_scans; + pParam->roam_trigger_reason_bitmask = + cfg_params->roam_trigger_reason_bitmask; pParam->isCoalesingInIBSSAllowed = cfg_params->isCoalesingInIBSSAllowed; pParam->allowDFSChannelRoam = cfg_params->allowDFSChannelRoam; pParam->nInitialDwellTime = cfg_params->nInitialDwellTime; @@ -3251,6 +3280,14 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->enable5gEBT = pMac->enable5gEBT; pParam->f_sta_miracast_mcc_rest_time_val = pMac->f_sta_miracast_mcc_rest_time_val; + pParam->sta_scan_burst_duration = + pMac->sta_scan_burst_duration; + pParam->p2p_scan_burst_duration = + pMac->p2p_scan_burst_duration; + pParam->go_scan_burst_duration = + pMac->go_scan_burst_duration; + pParam->ap_scan_burst_duration = + pMac->ap_scan_burst_duration; sme_update_roam_pno_channel_prediction_config(pMac, pParam, ROAM_CONFIG_TO_SME_CONFIG); pParam->early_stop_scan_enable = @@ -3295,6 +3332,14 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pMac->roam.configParam.sta_roam_policy.skip_unsafe_channels; pParam->tx_aggregation_size = pMac->roam.configParam.tx_aggregation_size; + pParam->tx_aggregation_size_be = + pMac->roam.configParam.tx_aggregation_size_be; + pParam->tx_aggregation_size_bk = + pMac->roam.configParam.tx_aggregation_size_bk; + pParam->tx_aggregation_size_vi = + pMac->roam.configParam.tx_aggregation_size_vi; + pParam->tx_aggregation_size_vo = + pMac->roam.configParam.tx_aggregation_size_vo; pParam->rx_aggregation_size = pMac->roam.configParam.rx_aggregation_size; pParam->enable_bcast_probe_rsp = @@ -3315,6 +3360,7 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pMac->roam.configParam.num_disallowed_aps; pParam->oce_feature_bitmap = pMac->roam.configParam.oce_feature_bitmap; + pParam->roam_force_rssi_trigger = cfg_params->roam_force_rssi_trigger; qdf_mem_copy(&pParam->csr_mawc_config, &pMac->roam.configParam.csr_mawc_config, sizeof(pParam->csr_mawc_config)); @@ -3325,6 +3371,13 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) csr_get_11k_offload_config_param(&pMac->roam.configParam, pParam); + pParam->wlm_latency_enable = pMac->roam.configParam.wlm_latency_enable; + pParam->wlm_latency_level = pMac->roam.configParam.wlm_latency_level; + for (i = 0; i < CSR_NUM_WLM_LATENCY_LEVEL; i++) { + pParam->wlm_latency_flags[i] = + pMac->roam.configParam.wlm_latency_flags[i]; + } + return QDF_STATUS_SUCCESS; } @@ -3741,12 +3794,12 @@ static void csr_roam_remove_duplicate_cmd_from_list(tpAniSirGlobal mac_ctx, next_entry = csr_ll_next(list, entry, LL_ACCESS_NOLOCK); dup_cmd = GET_BASE_ADDR(entry, tSmeCmd, Link); /* - * Remove the previous command if.. - * - the new roam command is for the same RoamReason... - * - the new roam command is a NewProfileList. - * - the new roam command is a Forced Dissoc - * - the new roam command is from an 802.11 OID - * (OID_SSID or OID_BSSID). + * If pCommand is not NULL remove the similar duplicate cmd for + * same reason as pCommand. If pCommand is NULL then check if + * eRoamReason is eCsrForcedDisassoc (disconnect) and remove + * all roam command for the sessionId, else if eRoamReason is + * eCsrHddIssued (connect) remove all connect (non disconenct) + * commands. */ if ((command && (command->sessionId == dup_cmd->sessionId) && ((command->command == dup_cmd->command) && @@ -3769,7 +3822,8 @@ static void csr_roam_remove_duplicate_cmd_from_list(tpAniSirGlobal mac_ctx, ((session_id == dup_cmd->sessionId) && (eSmeCommandRoam == dup_cmd->command) && ((eCsrForcedDisassoc == roam_reason) || - (eCsrHddIssued == roam_reason)))) { + (eCsrHddIssued == roam_reason && + !CSR_IS_DISCONNECT_COMMAND(dup_cmd))))) { sme_debug("RoamReason: %d", dup_cmd->u.roamCmd.roamReason); /* Remove the roam command from the pending list */ @@ -3944,8 +3998,8 @@ QDF_STATUS csr_roam_call_callback(tpAniSirGlobal pMac, uint32_t sessionId, * failure, decrement bRefAssocStartCnt. */ pSession->bRefAssocStartCnt--; - } else if (u1 == eCSR_ROAM_SET_CHANNEL_RSP && u2 == - eCSR_ROAM_RESULT_CHANNEL_CHANGE_SUCCESS) + } else if (pRoamInfo && (u1 == eCSR_ROAM_SET_CHANNEL_RSP) + && (u2 == eCSR_ROAM_RESULT_CHANNEL_CHANGE_SUCCESS)) pSession->connectedProfile.operationChannel = pRoamInfo->channelChangeRespEvent->newChannelNumber; @@ -6198,11 +6252,6 @@ QDF_STATUS csr_roam_process_command(tpAniSirGlobal pMac, tSmeCmd *pCommand) switch (pCommand->u.roamCmd.roamReason) { case eCsrForcedDisassoc: - if (eCSR_ROAMING_STATE_IDLE == pMac->roam.curState[sessionId]) { - sme_err("Ignore eCsrForcedDisassoc cmd on roam state %d", - eCSR_ROAMING_STATE_IDLE); - return QDF_STATUS_E_FAILURE; - } status = csr_roam_process_disassoc_deauth(pMac, pCommand, true, false); csr_free_roam_profile(pMac, sessionId); @@ -7635,6 +7684,8 @@ static void csr_roam_process_join_res(tpAniSirGlobal mac_ctx, roam_info.chan_info.nss = join_rsp->nss; roam_info.chan_info.rate_flags = join_rsp->max_rate_flags; + roam_info.chan_info.ch_width = + join_rsp->vht_channel_width; #ifdef FEATURE_WLAN_TDLS roam_info.tdls_prohibited = join_rsp->tdls_prohibited; roam_info.tdls_chan_swit_prohibited = @@ -11628,6 +11679,12 @@ csr_roam_send_disconnect_done_indication(tpAniSirGlobal mac_ctx, tSirSmeRsp } else sme_err("Inactive session %d", discon_ind->session_id); + + /* + * Release WM status change command as eWNI_SME_DISCONNECT_DONE_IND + * has been sent to HDD and there is nothing else left to do. + */ + csr_roam_wm_status_change_complete(mac_ctx); } static void @@ -11922,9 +11979,10 @@ csr_roam_diag_joined_new_bss(tpAniSirGlobal mac_ctx, pIbssLog->eventId = WLAN_IBSS_EVENT_COALESCING; if (pNewBss) { qdf_copy_macaddr(&pIbssLog->bssid, &pNewBss->bssId); - if (pNewBss->ssId.length) - qdf_mem_copy(pIbssLog->ssid, pNewBss->ssId.ssId, - pNewBss->ssId.length); + if (pNewBss->ssId.length > HOST_LOG_MAX_SSID_SIZE) + pNewBss->ssId.length = HOST_LOG_MAX_SSID_SIZE; + qdf_mem_copy(pIbssLog->ssid, pNewBss->ssId.ssId, + pNewBss->ssId.length); pIbssLog->operatingChannel = pNewBss->channelNumber; } if (IS_SIR_STATUS_SUCCESS(wlan_cfg_get_int(mac_ctx, @@ -12977,7 +13035,7 @@ QDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId, } -static void csr_roam_wm_status_change_complete(tpAniSirGlobal pMac) +void csr_roam_wm_status_change_complete(tpAniSirGlobal pMac) { tListElem *pEntry; tSmeCmd *pCommand; @@ -13012,7 +13070,7 @@ void csr_roam_process_wm_status_change_command(tpAniSirGlobal pMac, if (!pSession) { sme_err("session %d not found", pCommand->sessionId); - return; + goto end; } sme_debug("session:%d, CmdType : %d", pCommand->sessionId, pCommand->u.wmStatusChangeCmd.Type); @@ -13039,10 +13097,15 @@ void csr_roam_process_wm_status_change_command(tpAniSirGlobal pMac, pCommand->u.wmStatusChangeCmd.Type); break; } - /* Lost Link just triggers a roaming sequence. We can complte the - * Lost Link command here since there is nothing else to do. - */ - csr_roam_wm_status_change_complete(pMac); + +end: + if (status != QDF_STATUS_SUCCESS) { + /* + * As status returned is not success, there is nothing else + * left to do so release WM status change command here. + */ + csr_roam_wm_status_change_complete(pMac); + } } @@ -15100,6 +15163,433 @@ static void csr_update_sae_config(tSirSmeJoinReq *csr_join_req, #endif /** + * csr_get_nss_supported_by_sta_and_ap() - finds out nss from session + * and beacon from AP + * @vht_caps: VHT capabilities + * @ht_caps: HT capabilities + * @dot11_mode: dot11 mode + * + * Return: number of nss advertised by beacon + */ +static uint8_t csr_get_nss_supported_by_sta_and_ap(tDot11fIEVHTCaps *vht_caps, + tDot11fIEHTCaps *ht_caps, + uint32_t dot11_mode) +{ + bool vht_capability, ht_capability; + + vht_capability = IS_DOT11_MODE_VHT(dot11_mode); + ht_capability = IS_DOT11_MODE_HT(dot11_mode); + + if (vht_capability && vht_caps->present) { + if ((vht_caps->rxMCSMap & 0xC0) != 0xC0) + return 4; + + if ((vht_caps->rxMCSMap & 0x30) != 0x30) + return 3; + + if ((vht_caps->rxMCSMap & 0x0C) != 0x0C) + return 2; + } else if (ht_capability && ht_caps->present) { + if (ht_caps->supportedMCSSet[3]) + return 4; + + if (ht_caps->supportedMCSSet[2]) + return 3; + + if (ht_caps->supportedMCSSet[1]) + return 2; + } + + return 1; +} + +/** + * csr_check_for_vendor_oui_data() - compares for vendor OUI data from IE + * and returns true if OUI data matches with the ini + * @extension: pointer to action oui extension data + * @oui_ptr: pointer to Vendor IE in the beacon + * + * Return: true or false + */ +static bool +csr_check_for_vendor_oui_data(struct wmi_action_oui_extension *extension, + uint8_t *oui_ptr) +{ + uint8_t *data, elem_len, data_len; + uint8_t i, j; + uint8_t data_mask = 0x80; + + elem_len = oui_ptr[1]; + data_len = elem_len - extension->oui_length; + + if (data_len < extension->data_length) + return false; + + data = &oui_ptr[2 + extension->oui_length]; + for (i = 0, j = 0; + (i < data_len && j < extension->data_mask_length); + i++) { + if ((extension->data_mask[j] & data_mask) && + !(extension->data[i] == data[i])) + return false; + data_mask = data_mask >> 1; + if (!data_mask) { + data_mask = 0x80; + j++; + } + } + + return true; +} + +/** + * csr_check_for_vendor_ap_mac() - compares for vendor AP MAC in the ini with + * bssid from the session and returns true if matches + * @extension: pointer to action oui extension data + * @bssid: bssid of the AP to which we are connecting + * + * Return: true or false + */ +static bool +csr_check_for_vendor_ap_mac(struct wmi_action_oui_extension *extension, + tSirMacAddr bssid) +{ + uint8_t i; + uint8_t mac_mask = 0x80; + + for (i = 0; i < QDF_MAC_ADDR_SIZE; i++) { + if ((*extension->mac_mask & mac_mask) && + !(extension->mac_addr[i] == bssid[i])) + return false; + mac_mask = mac_mask >> 1; + } + + return true; +} + +/** + * csr_check_for_vendor_ap_capabilities() - compares for various Vendor AP + * capabilities like NSS, HT, VHT, Band from the ini with the AP's capability + * from the beacon and returns true if all the capability matches + * @extension: pointer to action oui extension data + * @ie: pointer to beacon IE + * @bss_desc: BSS descriptor + * @dot11_mode: dot11 mode + * + * Return: true or false + */ +static bool +csr_check_for_vendor_ap_capabilities(struct wmi_action_oui_extension *extension, + tDot11fBeaconIEs *ie, + tSirBssDescription *bss_desc, + uint32_t dot11_mode) +{ + tDot11fIEVHTCaps *vht_caps; + tDot11fIEHTCaps *ht_caps; + uint8_t nss = 0, nss_mask = 0; + + if (ie) { + ht_caps = &ie->HTCaps; + if (ie->vendor_vht_ie.present) + vht_caps = &ie->vendor_vht_ie.VHTCaps; + else + vht_caps = &ie->VHTCaps; + } + + if (ie) { + nss = csr_get_nss_supported_by_sta_and_ap(vht_caps, ht_caps, + dot11_mode); + nss_mask = 1 << (nss - 1); + } + + if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_NSS) { + if (!((*extension->capability & + WMI_ACTION_OUI_CAPABILITY_NSS_MASK) & + nss_mask)) + return false; + } + + if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_HT && ie) { + if (*extension->capability & + WMI_ACTION_OUI_CAPABILITY_HT_ENABLE_MASK) { + if (!ht_caps->present) + return false; + } else { + if (ht_caps->present) + return false; + } + } + + if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_VHT && + ie) { + if (*extension->capability & + WMI_ACTION_OUI_CAPABILITY_VHT_ENABLE_MASK) { + if (!vht_caps->present) + return false; + } else { + if (vht_caps->present) + return false; + } + } + + if (extension->info_mask & WMI_ACTION_OUI_INFO_AP_CAPABILITY_BAND) { + if ((*extension->capability & + WMI_ACTION_OUI_CAPABILITY_2G_BAND_MASK) && + !(IS_24G_CH(bss_desc->channelId))) + return false; + if ((*extension->capability & + WMI_ACTION_CAPABILITY_5G_BAND_MASK) && + !(IS_5G_CH(bss_desc->channelId))) + return false; + } + + return true; +} + +/** + * csr_dump_vendor_ies() - Dumps all the vendor IEs + * @ie: ie buffer + * @ie_len: length of ie buffer + * + * This function dumps the vendor IEs present in the AP's IE buffer + * + * Return: none + */ +static +void csr_dump_vendor_ies(uint8_t *ie, uint16_t ie_len) +{ + int32_t left = ie_len; + uint8_t *ptr = ie; + uint8_t elem_id, elem_len; + + while (left >= 2) { + elem_id = ptr[0]; + elem_len = ptr[1]; + left -= 2; + if (elem_len > left) { + pe_err("Invalid IEs eid: %d elem_len: %d left: %d", + elem_id, elem_len, left); + return; + } + if (elem_id == SIR_MAC_EID_VENDOR) { + pe_debug("Dumping Vendor IE of len %d", elem_len); + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, + QDF_TRACE_LEVEL_DEBUG, + &ptr[2], elem_len); + } + + left -= elem_len; + ptr += (elem_len + 2); + } +} + +/** + * csr_check_vendor_ap_present() - checks if the Vendor OUIs are present + * in the IE buffer + * + * @mac_ctx: mac context. + * @bss_desc: pointer to BSS descriptor + * @dot11_mode: dot11 mode + * @ie: ie buffer + * @ie_len: length of ie buffer + * @action_id: action oui id enum + * + * This function parses the IE buffer and finds if any of the vendor OUI + * is present in it. + * + * Return: true if the vendor OUI is present, else false + */ +static bool +csr_check_vendor_ap_present(tpAniSirGlobal mac_ctx, + tSirBssDescription *bss_desc, + uint32_t dot11_mode, tDot11fBeaconIEs *ie, + uint16_t ie_len, enum wmi_action_oui_id action_id) +{ + struct ani_action_oui *sme_action; + struct ani_action_oui_extension *sme_ext; + struct wmi_action_oui_extension *extension; + qdf_list_node_t *node = NULL; + qdf_list_node_t *next_node = NULL; + qdf_list_t *oui_ext_list; + QDF_STATUS qdf_status; + uint8_t *oui_ptr; + uint8_t *ie_fields = (uint8_t *)bss_desc->ieFields; + + if (action_id > WMI_ACTION_OUI_MAXIMUM_ID) { + pe_debug("Invalid OUI action ID"); + return false; + } + + if (!mac_ctx->oui_info) { + pe_debug("action oui support is disabled or oui info is empty"); + return false; + } + + sme_action = mac_ctx->oui_info->action_oui[action_id]; + if (!sme_action) { + pe_debug("action oui for id %d is empty", action_id); + return false; + } + + oui_ext_list = &sme_action->oui_ext_list; + + qdf_mutex_acquire(&sme_action->oui_ext_list_lock); + if (qdf_list_empty(oui_ext_list)) { + qdf_mutex_release(&sme_action->oui_ext_list_lock); + pe_debug("OUI List Empty"); + return false; + } + + csr_dump_vendor_ies((uint8_t *)ie_fields, ie_len); + + qdf_list_peek_front(oui_ext_list, &node); + while (node) { + sme_ext = qdf_container_of(node, + struct ani_action_oui_extension, + item); + + extension = &sme_ext->extension; + + if (!extension->oui_length) + goto next; + + oui_ptr = cfg_get_vendor_ie_ptr_from_oui(mac_ctx, + extension->oui, + extension->oui_length, + (uint8_t *)ie_fields, + ie_len); + if (!oui_ptr) { + pe_debug("No matching IE found for OUI"); + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, + QDF_TRACE_LEVEL_DEBUG, + extension->oui, + extension->oui_length); + goto next; + } + + pe_debug("IE found for OUI"); + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, + QDF_TRACE_LEVEL_DEBUG, + extension->oui, + extension->oui_length); + + if (extension->data_length && + !csr_check_for_vendor_oui_data(extension, oui_ptr)) { + pe_debug("Vendor IE Data mismatch"); + goto next; + } + + if ((extension->info_mask & WMI_ACTION_OUI_INFO_MAC_ADDRESS) && + !csr_check_for_vendor_ap_mac(extension, bss_desc->bssId)) { + pe_debug("Vendor IE MAC Mismatch"); + goto next; + } + + if (!csr_check_for_vendor_ap_capabilities(extension, + ie, bss_desc, + dot11_mode)) { + pe_debug("Vendor IE capabilties mismatch"); + goto next; + } + + pe_debug("Vendor AP found for OUI"); + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, + extension->oui, extension->oui_length); + qdf_mutex_release(&sme_action->oui_ext_list_lock); + return true; +next: + qdf_status = qdf_list_peek_next(oui_ext_list, + node, &next_node); + if (!QDF_IS_STATUS_SUCCESS(qdf_status)) + break; + + node = next_node; + next_node = NULL; + } + + qdf_mutex_release(&sme_action->oui_ext_list_lock); + return false; +} + +/** + * csr_check_vendor_ap_3_present() - Check if Vendor AP 3 is present + * @mac_ctx: Pointer to Global MAC structure + * @ie: Pointer to starting IE in Beacon/Probe Response + * @ie_len: Length of all IEs combined + * + * For Vendor AP 3, the condition is that Vendor AP 3 IE should be present + * and Vendor AP 4 IE should not be present. + * If Vendor AP 3 IE is present and Vendor AP 4 IE is also present, + * return false, else return true. + * + * Return: true or false + */ +static bool +csr_check_vendor_ap_3_present(tpAniSirGlobal mac_ctx, uint8_t *ie, + uint16_t ie_len) +{ + bool ret = true; + + if ((cfg_get_vendor_ie_ptr_from_oui(mac_ctx, SIR_MAC_VENDOR_AP_3_OUI, + SIR_MAC_VENDOR_AP_3_OUI_LEN, ie, ie_len)) && + (cfg_get_vendor_ie_ptr_from_oui(mac_ctx, SIR_MAC_VENDOR_AP_4_OUI, + SIR_MAC_VENDOR_AP_4_OUI_LEN, ie, ie_len))) { + pe_debug("Vendor OUI 3 and Vendor OUI 4 found"); + ret = false; + } + + return ret; +} + +/** + * csr_get_ielen_from_bss_description() + * + ***FUNCTION: + * This function is called in various places to get IE length + * from tSirBssDescription structure + * number being scanned. + * + ***PARAMS: + * + ***LOGIC: + * + ***ASSUMPTIONS: + * NA + * + ***NOTE: + * NA + * + * @param pBssDescr + * @return Total IE length + */ +static inline uint16_t +csr_get_ielen_from_bss_description(tpSirBssDescription pBssDescr) +{ + uint16_t ielen; + + if (!pBssDescr) + return 0; + + /* + * Length of BSS desription is without length of + * length itself and length of pointer + * that holds ieFields + * + * <------------sizeof(tSirBssDescription)--------------------> + * +--------+---------------------------------+---------------+ + * | length | other fields | pointer to IEs| + * +--------+---------------------------------+---------------+ + * ^ + * ieFields + */ + + ielen = (uint16_t)(pBssDescr->length + sizeof(pBssDescr->length) - + GET_FIELD_OFFSET(tSirBssDescription, ieFields)); + + return ielen; +} + +/** * The communication between HDD and LIM is thru mailbox (MB). * Both sides will access the data structure "tSirSmeJoinReq". * The rule is, while the components of "tSirSmeJoinReq" can be accessed in the @@ -15136,6 +15626,7 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, QDF_STATUS packetdump_timer_status; enum hw_mode_dbs_capab hw_mode_to_use; tDot11fIEVHTCaps *vht_caps = NULL; + bool is_vendor_ap_present; if (!pSession) { sme_err("session %d not found", sessionId); @@ -15222,6 +15713,7 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, dwTmp = csr_translate_bsstype_to_mac_type (pProfile->BSSType); csr_join_req->bsstype = dwTmp; + /* dot11mode */ ucDot11Mode = csr_translate_to_wni_cfg_dot11_mode(pMac, @@ -15233,6 +15725,75 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, /* Need to disable VHT operation in 2.4 GHz band */ ucDot11Mode = WNI_CFG_DOT11_MODE_11N; } + + ieLen = csr_get_ielen_from_bss_description(pBssDescription); + is_vendor_ap_present = csr_check_vendor_ap_present( + pMac, pBssDescription, + ucDot11Mode, pIes, ieLen, + WMI_ACTION_OUI_CONNECT_1X1); + + if (is_vendor_ap_present) { + is_vendor_ap_present = csr_check_vendor_ap_3_present( + pMac, (uint8_t *)pIes, ieLen); + } + + if (pMac->roam.configParam.is_force_1x1 && + pMac->lteCoexAntShare && + is_vendor_ap_present) { + pSession->supported_nss_1x1 = true; + pSession->vdev_nss = 1; + pSession->nss = 1; + sme_debug("For special ap, NSS: %d", pSession->nss); + } + + /* + * If CCK WAR is set for current AP, update to firmware via + * WMI_VDEV_PARAM_ABG_MODE_TX_CHAIN_NUM + */ + is_vendor_ap_present = csr_check_vendor_ap_present( + pMac, pBssDescription, + ucDot11Mode, pIes, + ieLen, WMI_ACTION_OUI_CCKM_1X1); + if (is_vendor_ap_present) { + pe_debug("vdev: %d WMI_VDEV_PARAM_ABG_MODE_TX_CHAIN_NUM 1", + pSession->sessionId); + wma_cli_set_command( + pSession->sessionId, + (int)WMI_VDEV_PARAM_ABG_MODE_TX_CHAIN_NUM, 1, + VDEV_CMD); + } + + if (pSession->nss > csr_get_nss_supported_by_sta_and_ap( + &pIes->VHTCaps, + &pIes->HTCaps, ucDot11Mode)) { + pSession->nss = csr_get_nss_supported_by_sta_and_ap( + &pIes->VHTCaps, &pIes->HTCaps, + ucDot11Mode); + pSession->vdev_nss = pSession->nss; + } + + if (pSession->nss == 1) + pSession->supported_nss_1x1 = true; + + /* + * If Switch to 11N WAR is set for current AP, change dot11 + * mode to 11N. + */ + is_vendor_ap_present = csr_check_vendor_ap_present( + pMac, pBssDescription, + ucDot11Mode, pIes, ieLen, + WMI_ACTION_OUI_SWITCH_TO_11N_MODE); + if (pMac->roam.configParam.is_force_1x1 && + pMac->lteCoexAntShare && + is_vendor_ap_present && + (ucDot11Mode == WNI_CFG_DOT11_MODE_ALL || + ucDot11Mode == WNI_CFG_DOT11_MODE_11AC || + ucDot11Mode == WNI_CFG_DOT11_MODE_11AC_ONLY)) + ucDot11Mode = WNI_CFG_DOT11_MODE_11N; + + csr_join_req->supported_nss_1x1 = pSession->supported_nss_1x1; + csr_join_req->vdev_nss = pSession->vdev_nss; + csr_join_req->nss = pSession->nss; csr_join_req->dot11mode = (uint8_t) ucDot11Mode; sme_debug("dot11mode=%d, uCfgDot11Mode=%d", csr_join_req->dot11mode, @@ -16854,6 +17415,14 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, add_sta_self_req->nss_5g = nss_5g; add_sta_self_req->tx_aggregation_size = pMac->roam.configParam.tx_aggregation_size; + add_sta_self_req->tx_aggregation_size_be = + pMac->roam.configParam.tx_aggregation_size_be; + add_sta_self_req->tx_aggregation_size_bk = + pMac->roam.configParam.tx_aggregation_size_bk; + add_sta_self_req->tx_aggregation_size_vi = + pMac->roam.configParam.tx_aggregation_size_vi; + add_sta_self_req->tx_aggregation_size_vo = + pMac->roam.configParam.tx_aggregation_size_vo; add_sta_self_req->rx_aggregation_size = pMac->roam.configParam.rx_aggregation_size; add_sta_self_req->enable_bcast_probe_rsp = @@ -16864,6 +17433,14 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, pMac->roam.configParam.pkt_err_disconn_th; add_sta_self_req->oce_feature_bitmap = pMac->roam.configParam.oce_feature_bitmap; + add_sta_self_req->tx_aggr_sw_retry_threshold_be = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_be; + add_sta_self_req->tx_aggr_sw_retry_threshold_bk = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_bk; + add_sta_self_req->tx_aggr_sw_retry_threshold_vi = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vi; + add_sta_self_req->tx_aggr_sw_retry_threshold_vo = + pMac->roam.configParam.tx_aggr_sw_retry_threshold_vo; msg.type = WMA_ADD_STA_SELF_REQ; msg.reserved = 0; msg.bodyptr = add_sta_self_req; @@ -18335,6 +18912,14 @@ csr_update_roam_scan_offload_request(tpAniSirGlobal mac_ctx, req_buf->Prefer5GHz = mac_ctx->roam.configParam.nRoamPrefer5GHz; req_buf->RoamRssiCatGap = mac_ctx->roam.configParam.bCatRssiOffset; req_buf->Select5GHzMargin = mac_ctx->roam.configParam.nSelect5GHzMargin; + req_buf->ho_delay_for_rx = mac_ctx->roam.configParam.ho_delay_for_rx; + req_buf->min_delay_btw_roam_scans = + mac_ctx->roam.configParam.min_delay_btw_roam_scans; + req_buf->roam_trigger_reason_bitmask = + mac_ctx->roam.configParam.roam_trigger_reason_bitmask; + req_buf->roam_force_rssi_trigger = + mac_ctx->roam.configParam.roam_force_rssi_trigger; + if (wlan_cfg_get_int(mac_ctx, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, (uint32_t *) &req_buf->ReassocFailureTimeout) != eSIR_SUCCESS) { @@ -18468,6 +19053,8 @@ csr_fetch_ch_lst_from_ini(tpAniSirGlobal mac_ctx, } req_buf->ConnectedNetwork.ChannelCount = num_channels; req_buf->ChannelCacheType = CHANNEL_LIST_STATIC; + sme_debug("ChannelCacheType %dChannelCount %d", + req_buf->ChannelCacheType, num_channels); return QDF_STATUS_SUCCESS; } @@ -18568,6 +19155,8 @@ csr_fetch_ch_lst_from_occupied_lst(tpAniSirGlobal mac_ctx, else req_buf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_UPDATE; } + sme_debug("ChannelCacheType %dChannelCount %d", + req_buf->ChannelCacheType, num_channels); } /** @@ -18669,11 +19258,10 @@ csr_fetch_valid_ch_lst(tpAniSirGlobal mac_ctx, } req_buf->ValidChannelCount = num_channels; - if (CSR_IS_ROAM_INTRA_BAND_ENABLED(mac_ctx)) { - req_buf->ChannelCacheType = CHANNEL_LIST_STATIC; - req_buf->ConnectedNetwork.ChannelCount = num_channels; - } - + req_buf->ChannelCacheType = CHANNEL_LIST_DYNAMIC_UPDATE; + req_buf->ConnectedNetwork.ChannelCount = num_channels; + sme_debug("ChannelCacheType %dChannelCount %d", + req_buf->ChannelCacheType, num_channels); return status; } @@ -18791,6 +19379,7 @@ csr_create_roam_scan_offload_request(tpAniSirGlobal mac_ctx, roam_info->cfgParams.nRoamBmissFinalBcnt; req_buf->RoamBeaconRssiWeight = roam_info->cfgParams.nRoamBeaconRssiWeight; + req_buf->rsn_caps = session->rsn_caps; qdf_mem_copy(&req_buf->mawc_roam_params, &mac_ctx->roam.configParam.csr_mawc_config, sizeof(req_buf->mawc_roam_params)); @@ -19831,6 +20420,21 @@ csr_roam_offload_scan(tpAniSirGlobal mac_ctx, uint8_t session_id, return QDF_STATUS_E_FAILURE; } + if ((command == ROAM_SCAN_OFFLOAD_START) && + (session->pCurRoamProfile && + session->pCurRoamProfile->driver_disabled_roaming)) { + if (reason == REASON_DRIVER_ENABLED) { + session->pCurRoamProfile-> + driver_disabled_roaming = false; + sme_debug("driver_disabled_roaming reset for session %d", + session_id); + } else { + sme_debug("Roam start received for session %d on which driver has disabled roaming", + session_id); + return QDF_STATUS_E_FAILURE; + } + } + if (0 == csr_roam_is_roam_offload_scan_enabled(mac_ctx)) { sme_err("isRoamOffloadScanEnabled not set"); return QDF_STATUS_E_FAILURE; @@ -22036,6 +22640,8 @@ static QDF_STATUS csr_process_roam_sync_callback(tpAniSirGlobal mac_ctx, roam_info->chan_info.nss = roam_synch_data->join_rsp->nss; roam_info->chan_info.rate_flags = roam_synch_data->join_rsp->max_rate_flags; + roam_info->chan_info.ch_width = + roam_synch_data->join_rsp->vht_channel_width; csr_roam_fill_tdls_info(mac_ctx, roam_info, roam_synch_data->join_rsp); #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH src_profile = &roam_synch_data->join_rsp->HTProfile; diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 990b35a055b1..a948c0030a11 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_api_scan.c * * Implementation for the Common Scan interfaces. @@ -1663,12 +1654,16 @@ static void csr_scan_add_result(tpAniSirGlobal pMac, struct tag_csrscan_result *pResult, tDot11fBeaconIEs *pIes, uint32_t sessionId) { - tpCsrNeighborRoamControlInfo pNeighborRoamInfo = - &pMac->roam.neighborRoamInfo[sessionId]; - + tpCsrNeighborRoamControlInfo pNeighborRoamInfo; struct qdf_mac_addr bssid; uint8_t channel_id = pResult->Result.BssDescriptor.channelId; + if (!CSR_IS_SESSION_VALID(pMac, sessionId)) { + sme_err("Invalid session id: %d", sessionId); + return; + } + + pNeighborRoamInfo = &pMac->roam.neighborRoamInfo[sessionId]; qdf_mem_zero(&bssid.bytes, QDF_MAC_ADDR_SIZE); qdf_mem_copy(bssid.bytes, &pResult->Result.BssDescriptor.bssId, QDF_MAC_ADDR_SIZE); @@ -3849,12 +3844,10 @@ static struct tag_csrscan_result *csr_scan_save_bss_description(tpAniSirGlobal bssId)); qdf_mem_copy(&pCsrBssDescription->Result.BssDescriptor, pBSSDescription, cbBSSDesc); -#if defined(QDF_ENSBALED) if (NULL != pCsrBssDescription->Result.pvIes) { QDF_ASSERT(pCsrBssDescription->Result.pvIes == NULL); return NULL; } -#endif csr_scan_add_result(pMac, pCsrBssDescription, pIes, sessionId); } @@ -7861,6 +7854,13 @@ QDF_STATUS csr_scan_save_preferred_network_found(tpAniSirGlobal pMac, uLen = pPrefNetworkFoundInd->frameLength - (SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_SSID_OFFSET); } + + if (uLen > (UINT_MAX - sizeof(struct tag_csrscan_result))) { + sme_err("Incorrect len: %d, may leads to int overflow, uLen %d", + pPrefNetworkFoundInd->frameLength, uLen); + qdf_mem_free(parsed_frm); + return QDF_STATUS_E_FAILURE; + } pScanResult = qdf_mem_malloc(sizeof(struct tag_csrscan_result) + uLen); if (NULL == pScanResult) { sme_err("fail to allocate memory for frame"); diff --git a/core/sme/src/csr/csr_cmd_process.c b/core/sme/src/csr/csr_cmd_process.c index e433459082af..f118ffedc6b9 100644 --- a/core/sme/src/csr/csr_cmd_process.c +++ b/core/sme/src/csr/csr_cmd_process.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_cmd_process.c * * Implementation for processing various commands. diff --git a/core/sme/src/csr/csr_host_scan_roam.c b/core/sme/src/csr/csr_host_scan_roam.c index 38accfafc80a..83e4c92bed38 100644 --- a/core/sme/src/csr/csr_host_scan_roam.c +++ b/core/sme/src/csr/csr_host_scan_roam.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 34b5f2cb6db5..eff2123500d6 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_inside_api.h * * Define interface only used by CSR. diff --git a/core/sme/src/csr/csr_link_list.c b/core/sme/src/csr/csr_link_list.c index 520984f12bc8..692d35ce5134 100644 --- a/core/sme/src/csr/csr_link_list.c +++ b/core/sme/src/csr/csr_link_list.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2012, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_link_list.c * * Implementation for the Common link list interfaces. diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c index 0e6d736d18ab..92157e7a93d8 100644 --- a/core/sme/src/csr/csr_neighbor_roam.c +++ b/core/sme/src/csr/csr_neighbor_roam.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_neighbor_roam.c * * Implementation for the simple roaming algorithm for 802.11r Fast @@ -145,14 +136,20 @@ QDF_STATUS csr_neighbor_roam_update_fast_roaming_enabled(tpAniSirGlobal mac_ctx, switch (neighbor_roam_info->neighborRoamState) { case eCSR_NEIGHBOR_ROAM_STATE_CONNECTED: - if (fast_roam_enabled) { - csr_roam_offload_scan(mac_ctx, session_id, - ROAM_SCAN_OFFLOAD_START, - REASON_CONNECT); + qdf_status = sme_acquire_global_lock(&mac_ctx->sme); + if (QDF_IS_STATUS_SUCCESS(qdf_status)) { + if (fast_roam_enabled) { + csr_roam_offload_scan(mac_ctx, session_id, + ROAM_SCAN_OFFLOAD_START, + REASON_CONNECT); + } else { + csr_roam_offload_scan(mac_ctx, session_id, + ROAM_SCAN_OFFLOAD_STOP, + REASON_DISCONNECTED); + } + sme_release_global_lock(&mac_ctx->sme); } else { - csr_roam_offload_scan(mac_ctx, session_id, - ROAM_SCAN_OFFLOAD_STOP, - REASON_DISCONNECTED); + sme_err("Failed to acquire SME lock"); } break; case eCSR_NEIGHBOR_ROAM_STATE_INIT: diff --git a/core/sme/src/csr/csr_roam_preauth.c b/core/sme/src/csr/csr_roam_preauth.c index 04d437cecc29..902ab2c3c6a1 100644 --- a/core/sme/src/csr/csr_roam_preauth.c +++ b/core/sme/src/csr/csr_roam_preauth.c @@ -1,7 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. + * Copyright (c) 2016-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 @@ -383,11 +381,11 @@ ABORT_PREAUTH: if (csr_roam_is_roam_offload_scan_enabled(mac_ctx)) { if (neighbor_roam_info->uOsRequestedHandoff) { neighbor_roam_info->uOsRequestedHandoff = 0; - csr_roam_offload_scan(mac_ctx, 0, + csr_roam_offload_scan(mac_ctx, session_id, ROAM_SCAN_OFFLOAD_START, REASON_PREAUTH_FAILED_FOR_ALL); } else { - csr_roam_offload_scan(mac_ctx, 0, + csr_roam_offload_scan(mac_ctx, session_id, ROAM_SCAN_OFFLOAD_RESTART, REASON_PREAUTH_FAILED_FOR_ALL); } diff --git a/core/sme/src/csr/csr_tdls_process.c b/core/sme/src/csr/csr_tdls_process.c index 44527381c9e9..672f8d7b2d4f 100644 --- a/core/sme/src/csr/csr_tdls_process.c +++ b/core/sme/src/csr/csr_tdls_process.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_tdls_process.c * * Implementation for the TDLS interface to PE. diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 75c056a97da5..febf16cd208b 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: csr_util.c * * Implementation supporting routines for CSR. @@ -3105,7 +3096,7 @@ static bool csr_get_rsn_information(tHalHandle hal, tCsrAuthList *auth_type, tCsrEncryptionList *mc_encryption, tDot11fIERSN *rsn_ie, uint8_t *ucast_cipher, uint8_t *mcast_cipher, uint8_t *auth_suite, - tCsrRSNCapabilities *capabilities, + struct rsn_caps *capabilities, eCsrAuthType *negotiated_authtype, eCsrEncryptionType *negotiated_mccipher, uint8_t *gp_mgmt_cipher, @@ -3634,6 +3625,7 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, { uint32_t ret; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + tCsrRoamSession *session = CSR_GET_SESSION(pMac, sessionId); bool fRSNMatch; uint8_t cbRSNIe = 0; uint8_t UnicastCypher[CSR_RSN_OUI_SIZE]; @@ -3641,7 +3633,7 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, uint8_t gp_mgmt_cipher_suite[CSR_RSN_OUI_SIZE]; uint8_t AuthSuite[CSR_RSN_OUI_SIZE]; tCsrRSNAuthIe *pAuthSuite; - tCsrRSNCapabilities RSNCapabilities; + struct rsn_caps RSNCapabilities; tCsrRSNPMKIe *pPMK; tPmkidCacheInfo pmkid_cache; #ifdef WLAN_FEATURE_11W @@ -3651,6 +3643,8 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, eCsrAuthType negAuthType = eCSR_AUTH_TYPE_UNKNOWN; tDot11fIERSN rsn_ie = {0}; + if (!CSR_IS_SESSION_VALID(pMac, sessionId) || !session) + return 0; qdf_mem_zero(&pmkid_cache, sizeof(pmkid_cache)); do { if (!csr_is_profile_rsn(pProfile)) @@ -3736,7 +3730,8 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, pPMK = (tCsrRSNPMKIe *) (((uint8_t *) (&pAuthSuite->AuthOui[1])) + sizeof(uint16_t)); - + /* Store RSN capabilities in session */ + session->rsn_caps = RSNCapabilities; if (!csr_update_pmksa_for_cache_id(pSirBssDesc, pProfile, &pmkid_cache)) qdf_mem_copy(pmkid_cache.BSSID.bytes, @@ -3773,6 +3768,8 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, gp_mgmt_cipher_suite, CSR_RSN_OUI_SIZE); } #endif + host_log_rsn_info(UnicastCypher, MulticastCypher, + AuthSuite, gp_mgmt_cipher_suite); /* Add in the fixed fields plus 1 Unicast cypher, less the * IE Header length Add in the size of the Auth suite (count @@ -3783,7 +3780,7 @@ uint8_t csr_construct_rsn_ie(tHalHandle hHal, uint32_t sessionId, pRSNIe->IeHeader.Length = (uint8_t) (sizeof(*pRSNIe) - sizeof(pRSNIe->IeHeader) + sizeof(*pAuthSuite) + - sizeof(tCsrRSNCapabilities)); + sizeof(struct rsn_caps)); if (pPMK->cPMKIDs) pRSNIe->IeHeader.Length += (uint8_t) (sizeof(uint16_t) + (pPMK->cPMKIDs * diff --git a/core/sme/src/nan/nan_api.c b/core/sme/src/nan/nan_api.c index 06b08f0a2414..efc17b77aeb3 100644 --- a/core/sme/src/nan/nan_api.c +++ b/core/sme/src/nan/nan_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,11 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ #include <sir_common.h> #include <ani_global.h> #include "sme_api.h" diff --git a/core/sme/src/nan/nan_datapath_api.c b/core/sme/src/nan/nan_datapath_api.c index 49ac3f300d0d..be3d9d6c225f 100644 --- a/core/sme/src/nan/nan_datapath_api.c +++ b/core/sme/src/nan/nan_datapath_api.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -424,19 +422,17 @@ void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx, tCsrRoamProfile *roam_profile, tSirBssDescription *bssdesc) { - tCsrRoamSession *roam_session = NULL; - tCsrRoamConnectedProfile *connect_profile = NULL; + tCsrRoamSession *roam_session; + tCsrRoamConnectedProfile *connect_profile; roam_session = CSR_GET_SESSION(mac_ctx, session_id); - if (NULL == roam_session) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, - FL("session %d not found"), session_id); + if (!roam_session) { + sme_err("session %d not found", session_id); return; } connect_profile = &roam_session->connectedProfile; - qdf_mem_set(&roam_session->connectedProfile, - sizeof(connect_profile), 0); + qdf_mem_zero(connect_profile, sizeof(*connect_profile)); connect_profile->AuthType = roam_profile->negotiatedAuthType; connect_profile->AuthInfo = roam_profile->AuthType; connect_profile->EncryptionType = @@ -452,7 +448,7 @@ void csr_roam_save_ndi_connected_info(tpAniSirGlobal mac_ctx, connect_profile->operationChannel = bssdesc->channelId; connect_profile->beaconInterval = 0; qdf_mem_copy(&connect_profile->Keys, &roam_profile->Keys, - sizeof(roam_profile->Keys)); + sizeof(roam_profile->Keys)); csr_get_bss_id_bss_desc(mac_ctx, bssdesc, &connect_profile->bssid); connect_profile->SSID.length = 0; csr_free_connect_bss_desc(mac_ctx, session_id); diff --git a/core/sme/src/p2p/p2p_api.c b/core/sme/src/p2p/p2p_api.c index 6be57d16839e..361710bfceb7 100644 --- a/core/sme/src/p2p/p2p_api.c +++ b/core/sme/src/p2p/p2p_api.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "sme_api.h" #include <sir_common.h> #include <ani_global.h> diff --git a/core/sme/src/qos/sme_qos.c b/core/sme/src/qos/sme_qos.c index d9dd9ac9c2cc..3bd882426ca2 100644 --- a/core/sme/src/qos/sme_qos.c +++ b/core/sme/src/qos/sme_qos.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: sme_qos.c * * Implementation for SME QoS APIs @@ -4112,7 +4103,6 @@ static QDF_STATUS sme_qos_del_ts_req(tpAniSirGlobal pMac, struct sme_qos_acinfo *pACInfo; tSirDeltsReq *pMsg; sme_QosWmmTspecInfo *pTspecInfo; - QDF_STATUS status = QDF_STATUS_E_FAILURE; #ifdef FEATURE_WLAN_DIAG_SUPPORT WLAN_HOST_DIAG_EVENT_DEF(qos, host_event_wlan_qos_payload_type); @@ -4182,23 +4172,23 @@ static QDF_STATUS sme_qos_del_ts_req(tpAniSirGlobal pMac, pTspecInfo->ts_info.up, pTspecInfo->ts_info.tid); qdf_mem_zero(&pACInfo->curr_QoSInfo[tspec_mask - 1], sizeof(sme_QosWmmTspecInfo)); - if (QDF_IS_STATUS_SUCCESS(cds_send_mb_message_to_mac(pMsg))) { - status = QDF_STATUS_SUCCESS; - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, - "%s: %d: sme_qos_del_ts_req:Test: sent down a DELTS req to PE", - __func__, __LINE__); - /* event: EVENT_WLAN_QOS */ -#ifdef FEATURE_WLAN_DIAG_SUPPORT - qos.eventId = SME_QOS_DIAG_DELTS; - qos.reasonCode = SME_QOS_DIAG_USER_REQUESTED; - WLAN_HOST_DIAG_EVENT_REPORT(&qos, EVENT_WLAN_QOS); -#endif /* FEATURE_WLAN_DIAG_SUPPORT */ + + if (!QDF_IS_STATUS_SUCCESS(cds_send_mb_message_to_mac(pMsg))) { + sme_err("DELTS req to PE failed"); + return QDF_STATUS_E_FAILURE; } - sme_set_tspec_uapsd_mask_per_session(pMac, - &pMsg->req.tspec.tsinfo, - sessionId); - return status; + sme_debug("sent down a DELTS req to PE"); +#ifdef FEATURE_WLAN_DIAG_SUPPORT + qos.eventId = SME_QOS_DIAG_DELTS; + qos.reasonCode = SME_QOS_DIAG_USER_REQUESTED; + WLAN_HOST_DIAG_EVENT_REPORT(&qos, EVENT_WLAN_QOS); +#endif + + sme_set_tspec_uapsd_mask_per_session(pMac, &pMsg->req.tspec.tsinfo, + sessionId); + + return QDF_STATUS_SUCCESS; } /* @@ -7020,6 +7010,7 @@ static QDF_STATUS sme_qos_add_ts_failure_fnp(tpAniSirGlobal pMac, tListElem case SME_QOS_REASON_MODIFY: flow_info->reason = SME_QOS_REASON_REQ_SUCCESS; case SME_QOS_REASON_REQ_SUCCESS: + /* fallthrough */ default: inform_hdd = false; break; @@ -7210,6 +7201,7 @@ static QDF_STATUS sme_qos_add_ts_success_fnp(tpAniSirGlobal mac_ctx, case SME_QOS_REASON_REQ_SUCCESS: hdd_status = SME_QOS_STATUS_SETUP_MODIFIED_IND; inform_hdd = true; + /* fallthrough */ default: delete_entry = false; break; diff --git a/core/sme/src/rrm/sme_rrm.c b/core/sme/src/rrm/sme_rrm.c index 38b756042902..be4a6cd4f2f1 100644 --- a/core/sme/src/rrm/sme_rrm.c +++ b/core/sme/src/rrm/sme_rrm.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * DOC: sme_rrm.c * * Implementation for SME RRM APIs diff --git a/core/utils/epping/inc/epping_internal.h b/core/utils/epping/inc/epping_internal.h index a6bfda25db5f..662fec3600ff 100644 --- a/core/utils/epping/inc/epping_internal.h +++ b/core/utils/epping/inc/epping_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef EPPING_INTERNAL_H #define EPPING_INTERNAL_H /**=========================================================================== diff --git a/core/utils/epping/inc/epping_main.h b/core/utils/epping/inc/epping_main.h index 813109fecade..952adbd1c556 100644 --- a/core/utils/epping/inc/epping_main.h +++ b/core/utils/epping/inc/epping_main.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef EPPING_MAIN_H #define EPPING_MAIN_H /**=========================================================================== diff --git a/core/utils/epping/src/epping_helper.c b/core/utils/epping/src/epping_helper.c index b5389dba2a82..ea7d499d3835 100644 --- a/core/utils/epping/src/epping_helper.c +++ b/core/utils/epping/src/epping_helper.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*======================================================================== \file epping_main.c diff --git a/core/utils/epping/src/epping_main.c b/core/utils/epping/src/epping_main.c index 76562d7d8b79..a9f1d35f580d 100644 --- a/core/utils/epping/src/epping_main.c +++ b/core/utils/epping/src/epping_main.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*======================================================================== \file epping_main.c diff --git a/core/utils/epping/src/epping_rx.c b/core/utils/epping/src/epping_rx.c index 2f07d2b5cd5f..d6cde00b09d6 100644 --- a/core/utils/epping/src/epping_rx.c +++ b/core/utils/epping/src/epping_rx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*======================================================================== \file epping_main.c diff --git a/core/utils/epping/src/epping_tx.c b/core/utils/epping/src/epping_tx.c index 706544683ad4..2d592fc0a205 100644 --- a/core/utils/epping/src/epping_tx.c +++ b/core/utils/epping/src/epping_tx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*======================================================================== \file epping_main.c diff --git a/core/utils/epping/src/epping_txrx.c b/core/utils/epping/src/epping_txrx.c index e01ef23920ff..b5ecfd6b14e3 100644 --- a/core/utils/epping/src/epping_txrx.c +++ b/core/utils/epping/src/epping_txrx.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*======================================================================== \file epping_main.c @@ -54,7 +45,7 @@ static int epping_start_adapter(epping_adapter_t *pAdapter); static void epping_stop_adapter(epping_adapter_t *pAdapter); -static void epping_timer_expire(void *data) +static void epping_timer_expire(unsigned long data) { struct net_device *dev = (struct net_device *)data; epping_adapter_t *pAdapter; diff --git a/core/utils/fwlog/dbglog_host.c b/core/utils/fwlog/dbglog_host.c index d7bc16c7b709..04d92c3f0f00 100644 --- a/core/utils/fwlog/dbglog_host.c +++ b/core/utils/fwlog/dbglog_host.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* Host Debug log implementation */ #include "athdefs.h" @@ -1770,6 +1761,9 @@ send_diag_netlink_data(const uint8_t *buffer, A_UINT32 len, A_UINT32 cmd) slot->dropped = get_version; memcpy(slot->payload, buffer, len); + /* Need to pad each record to fixed length ATH6KL_FWLOG_PAYLOAD_SIZE */ + memset(slot->payload + len, 0, ATH6KL_FWLOG_PAYLOAD_SIZE - len); + res = nl_srv_bcast_fw_logs(skb_out); if ((res < 0) && (res != -ESRCH)) { AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1, @@ -1830,6 +1824,9 @@ dbglog_process_netlink_data(wmi_unified_t wmi_handle, const uint8_t *buffer, slot->dropped = cpu_to_le32(dropped); memcpy(slot->payload, buffer, len); + /* Need to pad each record to fixed length ATH6KL_FWLOG_PAYLOAD_SIZE */ + memset(slot->payload + len, 0, ATH6KL_FWLOG_PAYLOAD_SIZE - len); + res = nl_srv_bcast_fw_logs(skb_out); if ((res < 0) && (res != -ESRCH)) { AR_DEBUG_PRINTF(ATH_DEBUG_RSVD1, diff --git a/core/utils/fwlog/dbglog_host.h b/core/utils/fwlog/dbglog_host.h index 0dbe9d47aa66..fe4617acc2c4 100644 --- a/core/utils/fwlog/dbglog_host.h +++ b/core/utils/fwlog/dbglog_host.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _DBGLOG_HOST_H_ #define _DBGLOG_HOST_H_ diff --git a/core/utils/host_diag_log/inc/host_diag_core_event.h b/core/utils/host_diag_log/inc/host_diag_core_event.h index b3e9c7c62ba1..b1bd37354bf2 100644 --- a/core/utils/host_diag_log/inc/host_diag_core_event.h +++ b/core/utils/host_diag_log/inc/host_diag_core_event.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2014-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__HOST_DIAG_CORE_EVENT_H) #define __HOST_DIAG_CORE_EVENT_H @@ -54,6 +45,7 @@ extern "C" { #endif /* __cplusplus */ #define WAKE_LOCK_NAME_LEN 80 +#define RSN_OUI_SIZE 4 /*------------------------------------------------------------------------- Event ID: EVENT_WLAN_SECURITY @@ -317,6 +309,27 @@ enum resource_failure_type { }; /*------------------------------------------------------------------------- + Event ID: EVENT_WLAN_RSN_INFO + ------------------------------------------------------------------------- + */ +/** + * struct event_wlan_csr_rsn_info - Structure holding the + * RSN information for assoc request + * @akm_suite: Gives information about akm suites used in assoc request + * @ucast_cipher: Unicast cipher used in assoc request + * @mcast_cipher: Multicast cipher used in assoc request + * @group_mgmt: Requested group mgmt cipher suite + * + * This structure will hold the RSN information for assoc request + */ +struct event_wlan_csr_rsn_info { + uint8_t akm_suite[RSN_OUI_SIZE]; + uint8_t ucast_cipher[RSN_OUI_SIZE]; + uint8_t mcast_cipher[RSN_OUI_SIZE]; + uint8_t group_mgmt[RSN_OUI_SIZE]; +}; + +/*------------------------------------------------------------------------- Event ID: EVENT_WLAN_WAKE_LOCK ------------------------------------------------------------------------*/ /** diff --git a/core/utils/host_diag_log/inc/host_diag_core_log.h b/core/utils/host_diag_log/inc/host_diag_core_log.h index 8aad69f34264..8738f0d4938e 100644 --- a/core/utils/host_diag_log/inc/host_diag_core_log.h +++ b/core/utils/host_diag_log/inc/host_diag_core_log.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__HOST_DIAG_CORE_LOG_H) #define __HOST_DIAG_CORE_LOG_H diff --git a/core/utils/host_diag_log/inc/host_diag_event_defs.h b/core/utils/host_diag_log/inc/host_diag_event_defs.h index c29f36b0981a..fd0a5b61d159 100644 --- a/core/utils/host_diag_log/inc/host_diag_event_defs.h +++ b/core/utils/host_diag_log/inc/host_diag_event_defs.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2014-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef EVENT_DEFS_H #define EVENT_DEFS_H @@ -897,6 +888,25 @@ typedef enum { EVENT_WLAN_SSR_SHUTDOWN_SUBSYSTEM = 0xB3D, + /* + * <diag_event> + * EVENT_WLAN_RSN_INFO + * @akm_suite: Akm suites used in assoc request + * @ucast_cipher: Unicast cipher used in assoc request + * @mcast_cipher: Multicast cipher used in assoc request + * @group_mgmt: Requested group mgmt cipher suite + * + * This event is used to send RSN information used + * in assoc request. + * + * Supported Feature: STA + * + * </diag_event> + */ + + EVENT_WLAN_RSN_INFO = 0xC5B, + + EVENT_MAX_ID = 0x0FFF } event_id_enum_type; diff --git a/core/utils/host_diag_log/inc/log_codes.h b/core/utils/host_diag_log/inc/log_codes.h index 98fe903e20de..32ea9ffe5834 100644 --- a/core/utils/host_diag_log/inc/log_codes.h +++ b/core/utils/host_diag_log/inc/log_codes.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef LOG_CODES_H #define LOG_CODES_H diff --git a/core/utils/host_diag_log/src/host_diag_log.c b/core/utils/host_diag_log/src/host_diag_log.c index 3bd9a3f0f205..b497acf004c4 100644 --- a/core/utils/host_diag_log/src/host_diag_log.c +++ b/core/utils/host_diag_log/src/host_diag_log.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2014-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*============================================================================ FILE: host_diag_log.c @@ -283,6 +274,25 @@ void host_log_low_resource_failure(uint8_t event_sub_type) EVENT_WLAN_LOW_RESOURCE_FAILURE); } +void host_log_rsn_info(uint8_t *ucast_cipher, uint8_t *mcast_cipher, + uint8_t *akm_suite, uint8_t *group_mgmt) +{ + WLAN_HOST_DIAG_EVENT_DEF(wlan_diag_event, + struct event_wlan_csr_rsn_info); + + qdf_mem_copy(wlan_diag_event.ucast_cipher, ucast_cipher, + RSN_OUI_SIZE); + qdf_mem_copy(wlan_diag_event.mcast_cipher, mcast_cipher, + RSN_OUI_SIZE); + qdf_mem_copy(wlan_diag_event.akm_suite, akm_suite, + RSN_OUI_SIZE); + qdf_mem_copy(wlan_diag_event.group_mgmt, group_mgmt, + RSN_OUI_SIZE); + + WLAN_HOST_DIAG_EVENT_REPORT(&wlan_diag_event, + EVENT_WLAN_RSN_INFO); +} + #ifdef FEATURE_WLAN_DIAG_SUPPORT /** * qdf_wow_wakeup_host_event()- send wow wakeup event diff --git a/core/utils/host_diag_log/src/i_host_diag_core_event.h b/core/utils/host_diag_log/src/i_host_diag_core_event.h index b90bae7fd217..0dfe25d67dd5 100644 --- a/core/utils/host_diag_log/src/i_host_diag_core_event.h +++ b/core/utils/host_diag_log/src/i_host_diag_core_event.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2014-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__I_HOST_DIAG_CORE_EVENT_H) #define __I_HOST_DIAG_CORE_EVENT_H @@ -116,6 +107,32 @@ static inline void host_log_low_resource_failure(uint8_t event_sub_type) #endif /* FEATURE_WLAN_DIAG_SUPPORT */ #ifdef FEATURE_WLAN_DIAG_SUPPORT +/** + * host_log_rsn_info() - This function is used to send + * requested rsn info in assoc request + * @ucast_cipher: Unicast ciphers used in assoc request + * @mcast_cipher: Group ciphers used in assoc request + * @akm_suite: Gives information about akm suites used in assoc request + * @group_mgmt: Requested group mgmt cipher suite + * + * This function is used to send RSN info used in assoc req to user space + * + * Return: None + * + */ +void host_log_rsn_info(uint8_t *ucast_cipher, uint8_t *mcast_cipher, + uint8_t *auth_suite, uint8_t *gp_mgmt_cipher); +#else +static inline void host_log_rsn_info(uint8_t *ucast_cipher, + uint8_t *mcast_cipher, + uint8_t *auth_suite, + uint8_t *gp_mgmt_cipher); +{ + +} +#endif /* FEATURE_WLAN_DIAG_SUPPORT */ + +#ifdef FEATURE_WLAN_DIAG_SUPPORT void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause); #else static inline void qdf_wow_wakeup_host_event(uint8_t wow_wakeup_cause) diff --git a/core/utils/host_diag_log/src/i_host_diag_core_log.h b/core/utils/host_diag_log/src/i_host_diag_core_log.h index 9417837b8a34..14193c987445 100644 --- a/core/utils/host_diag_log/src/i_host_diag_core_log.h +++ b/core/utils/host_diag_log/src/i_host_diag_core_log.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #if !defined(__I_HOST_DIAG_CORE_LOG_H) #define __I_HOST_DIAG_CORE_LOG_H diff --git a/core/utils/logging/inc/wlan_logging_sock_svc.h b/core/utils/logging/inc/wlan_logging_sock_svc.h index c75ddcf01d90..a964cb91836c 100644 --- a/core/utils/logging/inc/wlan_logging_sock_svc.h +++ b/core/utils/logging/inc/wlan_logging_sock_svc.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /****************************************************************************** * wlan_logging_sock_svc.h * diff --git a/core/utils/logging/src/wlan_logging_sock_svc.c b/core/utils/logging/src/wlan_logging_sock_svc.c index cf366b1a7390..d93653764b74 100644 --- a/core/utils/logging/src/wlan_logging_sock_svc.c +++ b/core/utils/logging/src/wlan_logging_sock_svc.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2014-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /****************************************************************************** * wlan_logging_sock_svc.c * @@ -750,8 +741,8 @@ static void send_flush_completion_to_user(uint8_t ring_id) /* Error on purpose, so that it will get logged in the kmsg */ LOGGING_TRACE(QDF_TRACE_LEVEL_DEBUG, - "%s: Sending flush done to userspace, recovery: %d", - __func__, recovery_needed); + "%s: Sending flush done to userspace reson_code %d, recovery: %d", + __func__, reason_code, recovery_needed); wlan_report_log_completion(is_fatal, indicator, reason_code, ring_id); diff --git a/core/utils/nlink/inc/wlan_nlink_common.h b/core/utils/nlink/inc/wlan_nlink_common.h index 7bd47cf0ebf0..12add80eca1c 100644 --- a/core/utils/nlink/inc/wlan_nlink_common.h +++ b/core/utils/nlink/inc/wlan_nlink_common.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /*=========================================================================== \file wlan_nlink_common.h diff --git a/core/utils/nlink/inc/wlan_nlink_srv.h b/core/utils/nlink/inc/wlan_nlink_srv.h index 4f76a4171d01..9304f2b5a287 100644 --- a/core/utils/nlink/inc/wlan_nlink_srv.h +++ b/core/utils/nlink/inc/wlan_nlink_srv.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /****************************************************************************** * wlan_nlink_srv.h * diff --git a/core/utils/nlink/src/wlan_nlink_srv.c b/core/utils/nlink/src/wlan_nlink_srv.c index 1d3bb1b63725..3a08921c6ca8 100644 --- a/core/utils/nlink/src/wlan_nlink_srv.c +++ b/core/utils/nlink/src/wlan_nlink_srv.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /****************************************************************************** * wlan_nlink_srv.c * diff --git a/core/utils/pktlog/include/pktlog.h b/core/utils/pktlog/include/pktlog.h index cfbf221847a2..50cc0e2a4e0e 100644 --- a/core/utils/pktlog/include/pktlog.h +++ b/core/utils/pktlog/include/pktlog.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _PKTLOG_ #define _PKTLOG_ #ifndef REMOVE_PKT_LOG diff --git a/core/utils/pktlog/include/pktlog_ac.h b/core/utils/pktlog/include/pktlog_ac.h index e02af09e463d..7d79e62ab5c8 100644 --- a/core/utils/pktlog/include/pktlog_ac.h +++ b/core/utils/pktlog/include/pktlog_ac.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _PKTLOG_AC_H_ #define _PKTLOG_AC_H_ #ifndef REMOVE_PKT_LOG diff --git a/core/utils/pktlog/include/pktlog_ac_api.h b/core/utils/pktlog/include/pktlog_ac_api.h index 0106a4c2330f..21056fed07b9 100644 --- a/core/utils/pktlog/include/pktlog_ac_api.h +++ b/core/utils/pktlog/include/pktlog_ac_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * The file is used to define structures that are shared between * kernel space and user space pktlog application. */ diff --git a/core/utils/pktlog/include/pktlog_ac_i.h b/core/utils/pktlog/include/pktlog_ac_i.h index 15b83d35ce8b..35325b996823 100644 --- a/core/utils/pktlog/include/pktlog_ac_i.h +++ b/core/utils/pktlog/include/pktlog_ac_i.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _PKTLOG_AC_I_ #define _PKTLOG_AC_I_ #ifndef REMOVE_PKT_LOG diff --git a/core/utils/pktlog/linux_ac.c b/core/utils/pktlog/linux_ac.c index 05cd59d735be..b86adde68168 100644 --- a/core/utils/pktlog/linux_ac.c +++ b/core/utils/pktlog/linux_ac.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef REMOVE_PKT_LOG #ifndef EXPORT_SYMTAB #define EXPORT_SYMTAB diff --git a/core/utils/pktlog/pktlog_ac.c b/core/utils/pktlog/pktlog_ac.c index 2a62ee934efd..052b87bea2bf 100644 --- a/core/utils/pktlog/pktlog_ac.c +++ b/core/utils/pktlog/pktlog_ac.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/core/utils/pktlog/pktlog_internal.c b/core/utils/pktlog/pktlog_internal.c index 69bbf6baaf2b..aafddb42ef4e 100644 --- a/core/utils/pktlog/pktlog_internal.c +++ b/core/utils/pktlog/pktlog_internal.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -20,12 +17,6 @@ */ /* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -/* * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/core/utils/ptt/inc/wlan_ptt_sock_svc.h b/core/utils/ptt/inc/wlan_ptt_sock_svc.h index d031691574d8..0ff8e26d8137 100644 --- a/core/utils/ptt/inc/wlan_ptt_sock_svc.h +++ b/core/utils/ptt/inc/wlan_ptt_sock_svc.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /****************************************************************************** * wlan_ptt_sock_svc.c * diff --git a/core/utils/ptt/src/wlan_ptt_sock_svc.c b/core/utils/ptt/src/wlan_ptt_sock_svc.c index fca63510e75c..32b66cec0309 100644 --- a/core/utils/ptt/src/wlan_ptt_sock_svc.c +++ b/core/utils/ptt/src/wlan_ptt_sock_svc.c @@ -1,8 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2012-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /****************************************************************************** * wlan_ptt_sock_svc.c * @@ -140,7 +131,7 @@ int ptt_sock_send_msg_to_app(tAniHdr *wmsg, int radio, int src_mod, int pid) __func__, radio); return -EINVAL; } - payload_len = wmsg_length + sizeof(wnl->radio) + sizeof(*wmsg); + payload_len = wmsg_length + sizeof(wnl->radio); tot_msg_len = NLMSG_SPACE(payload_len); skb = dev_alloc_skb(tot_msg_len); if (skb == NULL) { @@ -296,18 +287,9 @@ static void ptt_cmd_handler(const void *data, int data_len, void *ctx, int pid) payload = (struct sptt_app_reg_req *)(nla_data(tb[CLD80211_ATTR_DATA])); length = be16_to_cpu(payload->wmsg.length); - if ((USHRT_MAX - length) < (sizeof(payload->radio) + sizeof(tAniHdr))) { - PTT_TRACE(QDF_TRACE_LEVEL_ERROR, - "u16 overflow length %d %zu %zu", - length, - sizeof(payload->radio), - sizeof(tAniHdr)); - return; - } if (nla_len(tb[CLD80211_ATTR_DATA]) < (length + - sizeof(payload->radio) + - sizeof(tAniHdr))) { + sizeof(payload->radio))) { PTT_TRACE(QDF_TRACE_LEVEL_ERROR, "ATTR_DATA len check failed"); return; } diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index 9c7256b39eb6..eee3f93f0ad2 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WMA_H #define WMA_H @@ -1359,6 +1350,7 @@ struct hw_mode_idx_to_mac_cap_idx { * @each_phy_cap_per_hwmode: PHY's caps for each hw mode * @num_phy_for_hal_reg_cap: number of phy for hal reg cap * @hw_mode_to_mac_cap_map: map between hw_mode to capabilities + * @sar_capability: supported SAR versions */ struct extended_caps { WMI_SOC_MAC_PHY_HW_MODE_CAPS num_hw_modes; @@ -1367,6 +1359,7 @@ struct extended_caps { WMI_SOC_HAL_REG_CAPABILITIES num_phy_for_hal_reg_cap; WMI_HAL_REG_CAPABILITIES_EXT *each_phy_hal_reg_cap; struct hw_mode_idx_to_mac_cap_idx *hw_mode_to_mac_cap_map; + WMI_SAR_CAPABILITIES sar_capability; }; /** @@ -2225,6 +2218,7 @@ typedef struct wma_tdls_params { uint32_t puapsd_rx_frame_threshold; uint32_t teardown_notification_ms; uint32_t tdls_peer_kickout_threshold; + uint32_t tdls_discovery_wake_timeout; } t_wma_tdls_params; /** @@ -2479,10 +2473,11 @@ int wma_get_apf_caps_event_handler(void *handle, /** * wma_get_apf_capabilities - Send get apf capability to firmware * @wma_handle: wma handle + * @context: APF context * * Return: QDF_STATUS enumeration. */ -QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma); +QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma, void *context); /** * wma_set_apf_instructions - Set apf instructions to firmware diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 3cf52cd91a02..43d99abe1093 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WMA_API_H #define WMA_API_H @@ -392,6 +383,27 @@ QDF_STATUS wma_set_tx_rx_aggregation_size (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size); /** + * wma_set_tx_rx_aggregation_size_per_ac() - set aggregation size per ac + * @tx_rx_aggregation_size: the parameter for aggregation size + * + * This function try to set the aggregation size per AC. + * + * Return: QDF_STATUS enumeration + */ +QDF_STATUS wma_set_tx_rx_aggregation_size_per_ac + (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size); +/** + * wma_set_sw_retry_threshold() - set sw retry threshold per AC for tx + * @tx_rx_aggregation_size: value needs to set to firmware + * + * This function sends WMI command to set the sw retry threshold per AC + * for Tx. + * + * Return: QDF_STATUS. + */ +QDF_STATUS wma_set_sw_retry_threshold + (struct sir_set_tx_aggr_sw_retry_threshold *tx_rx_aggregation_size); +/** * wma_get_sar_limit() - get SAR limits from the target * @handle: wma handle * @callback: Callback function to invoke with the results @@ -535,4 +547,29 @@ QDF_STATUS wma_wow_set_wake_time(WMA_HANDLE wma_handle, uint8_t vdev_id, */ void wma_wmi_stop(void); +/** + * wma_dual_beacon_on_single_mac_scc_capable() - get capability that whether + * Support dual beacon on same channel on single MAC + * + * Return: bool: capable + */ +bool wma_dual_beacon_on_single_mac_scc_capable(void); + +/** + * wma_dual_beacon_on_single_mac_mcc_capable() - get capability that whether + * Support dual beacon on different channel on single MAC + * + * Return: bool: capable + */ +bool wma_dual_beacon_on_single_mac_mcc_capable(void); + +/** + * wma_cleanup_vdev_resp_and_hold_req() - cleaunup the vdev resp and hold req + * queue + * @priv : WMA handle + * + * Return: None + */ +void wma_cleanup_vdev_resp_and_hold_req(void *priv); + #endif diff --git a/core/wma/inc/wma_dfs_interface.h b/core/wma/inc/wma_dfs_interface.h index 29dc25d54e78..9ab8d82a8085 100644 --- a/core/wma/inc/wma_dfs_interface.h +++ b/core/wma/inc/wma_dfs_interface.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #include "ath_dfs_structs.h" #include <qdf_lock.h> #include "cds_reg_service.h" diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 8e8128e42e34..e2d8b476a26a 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -1,8 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * + * Copyright (c) 2011-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 @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _HALMSGAPI_H_ #define _HALMSGAPI_H_ @@ -519,6 +510,10 @@ typedef struct { uint8_t nss_5g; uint16_t beacon_tx_rate; uint32_t tx_aggregation_size; + uint32_t tx_aggregation_size_be; + uint32_t tx_aggregation_size_bk; + uint32_t tx_aggregation_size_vi; + uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; } tAddBssParams, *tpAddBssParams; @@ -1155,6 +1150,10 @@ typedef struct sMaxTxPowerPerBandParams { * @enable_bcast_probe_rsp: enable broadcast probe response * @fils_max_chan_guard_time: FILS max channel guard time * @pkt_err_disconn_th: packet drop threshold + * @tx_aggr_sw_retry_threshold_be: sw retry threshold for be + * @tx_aggr_sw_retry_threshold_bk: sw retry threshold for bk + * @tx_aggr_sw_retry_threshold_vi: sw retry threshold for vi + * @tx_aggr_sw_retry_threshold_vo: sw retry threshold for vo */ struct add_sta_self_params { tSirMacAddr self_mac_addr; @@ -1166,11 +1165,19 @@ struct add_sta_self_params { uint8_t nss_5g; uint32_t status; uint32_t tx_aggregation_size; + uint32_t tx_aggregation_size_be; + uint32_t tx_aggregation_size_bk; + uint32_t tx_aggregation_size_vi; + uint32_t tx_aggregation_size_vo; uint32_t rx_aggregation_size; bool enable_bcast_probe_rsp; uint8_t fils_max_chan_guard_time; uint16_t pkt_err_disconn_th; uint8_t oce_feature_bitmap; + uint32_t tx_aggr_sw_retry_threshold_be; + uint32_t tx_aggr_sw_retry_threshold_bk; + uint32_t tx_aggr_sw_retry_threshold_vi; + uint32_t tx_aggr_sw_retry_threshold_vo; }; /** diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index c8b5731a29fd..5931bc42faaf 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WMA_INTERNAL_H #define WMA_INTERNAL_H @@ -131,6 +122,11 @@ #define MAX_NUM_HW_MODE 0xff #define MAX_NUM_PHY 0xff +enum sar_version { + SAR_VERSION_1, + SAR_VERSION_2 +}; + /** * struct index_data_rate_type - non vht data rate type * @mcs_index: mcs rate index @@ -1235,6 +1231,16 @@ QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle, tSirLedFlashingReq *flashing); #endif +/** + * wma_sar_rsp_evt_handler() - process sar response event from FW. + * @handle: wma handle + * @event: event buffer + * @len: buffer length + * + * Return: 0 for success or error code + */ +int wma_sar_rsp_evt_handler(void *handle, uint8_t *event, uint32_t len); + #ifdef FEATURE_WLAN_CH_AVOID int wma_channel_avoid_evt_handler(void *handle, uint8_t *event, uint32_t len); diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index ce0517de8ead..cda306b551f5 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WMA_TGT_CFG_H #define WMA_TGT_CFG_H @@ -141,6 +132,26 @@ struct wma_dfs_radar_ind { }; /** + * struct board_info - Structure for board related information + * @bdf_version: board file version + * @ref_design_id: reference design id + * @customer_id: customer id + * @project_id: project id + * @board_data_rev: board data revision + * + * This board information will be stored in board file during the + * calibration and customization. + * + */ +struct board_info { + uint32_t bdf_version; + uint32_t ref_design_id; + uint32_t customer_id; + uint32_t project_id; + uint32_t board_data_rev; +}; + +/** * struct wma_tgt_cfg - target config * @target_fw_version: target fw version * @target_fw_vers_ext: target fw extended sub version @@ -189,5 +200,7 @@ struct wma_tgt_cfg { uint16_t wmi_max_len; bool tx_bfee_8ss_enabled; bool rcpi_enabled; + uint32_t hw_bd_id; + struct board_info hw_bd_info; }; #endif /* WMA_TGT_CFG_H */ diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 3ecd0a6a3625..508f9a590407 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef WLAN_QCT_WMA_H #define WLAN_QCT_WMA_H diff --git a/core/wma/src/wlan_qct_wma_legacy.c b/core/wma/src/wlan_qct_wma_legacy.c index 45409c86cf34..f489397c5bf8 100644 --- a/core/wma/src/wlan_qct_wma_legacy.c +++ b/core/wma/src/wlan_qct_wma_legacy.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wlan_qct_wma_legacy.c * diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c index 83b56fda8e8d..f199e29c7fe5 100644 --- a/core/wma/src/wma_data.c +++ b/core/wma/src/wma_data.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_data.c * This file contains tx/rx and data path related functions. @@ -1224,6 +1215,7 @@ void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params) WMA_LOGP(FL("Failed to fill vdev request for vdev_id %d"), vdev_id); params->status = false; + goto out; } status = wma_send_vdev_stop_to_fw(wma, vdev_id); @@ -2898,12 +2890,8 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen, tx_frm_ota_comp_cb; } } else { - if (downld_comp_required) - tx_frm_index = - GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX; - else - tx_frm_index = - GENERIC_NODOWNLD_NOACK_COMP_INDEX; + tx_frm_index = + GENERIC_NODOWNLD_NOACK_COMP_INDEX; } } diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 3c6d9ec12bb0..8af9c5bf7f61 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_dev_if.c * This file contains vdev & peer related operations. @@ -1065,7 +1056,8 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info, if ((resp_event->vdev_id < wma->max_bssid) && (qdf_atomic_read( &wma->interfaces[resp_event->vdev_id].vdev_restart_params.hidden_ssid_restart_in_progress)) - && (wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id) == true)) { + && (wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id) == true) + && (req_msg->msg_type == WMA_HIDDEN_SSID_VDEV_RESTART)) { tpHalHiddenSsidVdevRestart hidden_ssid_restart = (tpHalHiddenSsidVdevRestart)req_msg->user_data; WMA_LOGE("%s: vdev restart event recevied for hidden ssid set using IOCTL", @@ -2073,6 +2065,7 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, struct vdev_create_params params = { 0 }; u_int8_t vdev_id; struct sir_set_tx_rx_aggregation_size tx_rx_aggregation_size; + struct sir_set_tx_aggr_sw_retry_threshold tx_aggr_sw_retry_threshold; WMA_LOGD("mac %pM, vdev_id %hu, type %d, sub_type %d, nss 2g %d, 5g %d", self_sta_req->self_mac_addr, self_sta_req->session_id, @@ -2171,8 +2164,34 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, if (status != QDF_STATUS_SUCCESS) WMA_LOGE("failed to set aggregation sizes(err=%d)", status); + tx_rx_aggregation_size.tx_aggregation_size_be = + self_sta_req->tx_aggregation_size_be; + tx_rx_aggregation_size.tx_aggregation_size_bk = + self_sta_req->tx_aggregation_size_bk; + tx_rx_aggregation_size.tx_aggregation_size_vi = + self_sta_req->tx_aggregation_size_vi; + tx_rx_aggregation_size.tx_aggregation_size_vo = + self_sta_req->tx_aggregation_size_vo; + + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_be = + self_sta_req->tx_aggr_sw_retry_threshold_be; + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_bk = + self_sta_req->tx_aggr_sw_retry_threshold_bk; + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_vi = + self_sta_req->tx_aggr_sw_retry_threshold_vi; + tx_aggr_sw_retry_threshold.tx_aggr_sw_retry_threshold_vo = + self_sta_req->tx_aggr_sw_retry_threshold_vo; + tx_aggr_sw_retry_threshold.vdev_id = self_sta_req->session_id; + + switch (self_sta_req->type) { case WMI_VDEV_TYPE_STA: + status = wma_set_tx_rx_aggregation_size_per_ac( + &tx_rx_aggregation_size); + if (status != QDF_STATUS_SUCCESS) + WMA_LOGE("failed to set aggr sizes per ac(err=%d)", + status); + if (wlan_cfg_get_int(mac, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, &cfg_val) != eSIR_SUCCESS) { WMA_LOGE("Failed to get value for WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD"); @@ -2190,6 +2209,12 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, wma_set_sta_sa_query_param(wma_handle, self_sta_req->session_id); } + + status = wma_set_sw_retry_threshold( + &tx_aggr_sw_retry_threshold); + if (status != QDF_STATUS_SUCCESS) + WMA_LOGE("failed to set retry threshold(err=%d)", + status); break; } @@ -2986,6 +3011,20 @@ int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info, return status; } +static void wma_trigger_recovery_assert_on_fw_timeout( + uint16_t wma_msg) +{ + if (cds_is_self_recovery_enabled()) { + WMA_LOGE("%s timed out, triggering recovery", + mac_trace_get_wma_msg_string(wma_msg)); + cds_trigger_recovery(CDS_REASON_UNSPECIFIED); + } else { + WMA_LOGE("%s timed out, BUG_ON()", + mac_trace_get_wma_msg_string(wma_msg)); + QDF_BUG(0); + } +} + static inline bool wma_crash_on_fw_timeout(bool crash_enabled) { /* Discard FW timeouts and dont crash during SSR */ @@ -3041,11 +3080,13 @@ void wma_hold_req_timer(void *data) WMA_LOGA(FL("WMA_ADD_STA_REQ timed out")); WMA_LOGD(FL("Sending add sta rsp to umac (mac:%pM, status:%d)"), params->staMac, params->status); - if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) - QDF_BUG(0); - else + if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { + wma_trigger_recovery_assert_on_fw_timeout( + WMA_ADD_STA_REQ); + } else { wma_send_msg_high_priority(wma, WMA_ADD_STA_RSP, (void *)params, 0); + } } else if (tgt_req->msg_type == WMA_ADD_BSS_REQ) { tpAddBssParams params = (tpAddBssParams) tgt_req->user_data; @@ -3053,11 +3094,13 @@ void wma_hold_req_timer(void *data) WMA_LOGA(FL("WMA_ADD_BSS_REQ timed out")); WMA_LOGD(FL("Sending add bss rsp to umac (mac:%pM, status:%d)"), params->selfMacAddr, params->status); - if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) - QDF_BUG(0); - else + if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { + wma_trigger_recovery_assert_on_fw_timeout( + WMA_ADD_BSS_REQ); + } else { wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP, (void *)params, 0); + } } else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) && (tgt_req->type == WMA_DELETE_STA_RSP_START)) { tpDeleteStaParams params = @@ -3068,7 +3111,8 @@ void wma_hold_req_timer(void *data) params->staMac, params->status); if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { - QDF_BUG(0); + wma_trigger_recovery_assert_on_fw_timeout( + WMA_DELETE_STA_REQ); } else { /* * Assert in development build only. @@ -3087,7 +3131,8 @@ void wma_hold_req_timer(void *data) WMA_LOGA(FL("wma delete sta p2p request timed out")); if (wma_crash_on_fw_timeout(wma->fw_timeout_crash)) { - QDF_BUG(0); + wma_trigger_recovery_assert_on_fw_timeout( + WMA_DELETE_STA_REQ); } else { if (del_sta->generate_rsp) wma_send_del_sta_self_resp( @@ -3101,11 +3146,13 @@ void wma_hold_req_timer(void *data) params->status = false; WMA_LOGA(FL("wma delete peer for set link timed out")); - if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) - QDF_BUG(0); - else + if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { + wma_trigger_recovery_assert_on_fw_timeout( + WMA_DELETE_STA_REQ); + } else { wma_send_msg(wma, WMA_SET_LINK_STATE_RSP, params, 0); + } } else if ((tgt_req->msg_type == WMA_DELETE_STA_REQ) && (tgt_req->type == WMA_DELETE_PEER_RSP)) { tpDeleteBssParams params = @@ -3113,11 +3160,13 @@ void wma_hold_req_timer(void *data) params->status = QDF_STATUS_E_TIMEOUT; WMA_LOGE(FL("wma delete peer for del bss req timed out")); - if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) - QDF_BUG(0); - else + if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { + wma_trigger_recovery_assert_on_fw_timeout( + WMA_DELETE_STA_REQ); + } else { wma_send_msg_high_priority(wma, WMA_DELETE_BSS_RSP, params, 0); + } } else { WMA_LOGE(FL("Unhandled timeout for msg_type:%d and type:%d"), tgt_req->msg_type, tgt_req->type); @@ -3145,6 +3194,11 @@ struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma, struct wma_target_req *req; QDF_STATUS status; + if (!cds_is_target_ready()) { + WMA_LOGE("target not ready, drop the request"); + return NULL; + } + req = qdf_mem_malloc(sizeof(*req)); if (!req) { WMA_LOGE(FL("Failed to allocate memory for msg %d vdev %d"), @@ -3270,11 +3324,13 @@ void wma_vdev_resp_timer(void *data) * Trigger host crash if the flag is set or if the timeout * is not due to fw down */ - if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) - QDF_BUG(0); - else + if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { + wma_trigger_recovery_assert_on_fw_timeout( + WMA_CHNL_SWITCH_REQ); + } else { wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP, (void *)params, 0); + } if (wma->interfaces[tgt_req->vdev_id].is_channel_switch) { wma->interfaces[tgt_req->vdev_id].is_channel_switch = false; @@ -3306,7 +3362,8 @@ void wma_vdev_resp_timer(void *data) * is not due to fw down */ if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { - QDF_BUG(0); + wma_trigger_recovery_assert_on_fw_timeout( + WMA_DELETE_BSS_REQ); return; } @@ -3381,15 +3438,26 @@ void wma_vdev_resp_timer(void *data) params->status = QDF_STATUS_E_TIMEOUT; WMA_LOGA("%s: WMA_DEL_STA_SELF_REQ timedout", __func__); - if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) - QDF_BUG(0); - else + if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { + wma_trigger_recovery_assert_on_fw_timeout( + WMA_DEL_STA_SELF_REQ); + } else if (!cds_is_driver_unloading() && + (cds_is_fw_down() || cds_is_driver_recovering())) { + qdf_mem_free(iface->del_staself_req); + iface->del_staself_req = NULL; + } else { wma_send_del_sta_self_resp(iface->del_staself_req); + } - if (iface->addBssStaContext) + if (iface->addBssStaContext) { qdf_mem_free(iface->addBssStaContext); - if (iface->staKeyParams) + iface->addBssStaContext = NULL; + } + + if (iface->staKeyParams) { qdf_mem_free(iface->staKeyParams); + iface->staKeyParams = NULL; + } wma_vdev_deinit(iface); qdf_mem_zero(iface, sizeof(*iface)); @@ -3402,7 +3470,8 @@ void wma_vdev_resp_timer(void *data) WMA_LOGD("%s: bssid %pM vdev_id %d", __func__, params->bssId, tgt_req->vdev_id); if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { - QDF_BUG(0); + wma_trigger_recovery_assert_on_fw_timeout( + WMA_ADD_BSS_REQ); } else { wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP, (void *)params, 0); @@ -3465,6 +3534,11 @@ struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma, struct wma_target_req *req; QDF_STATUS status; + if (!cds_is_target_ready()) { + WMA_LOGE("target not ready, drop the request"); + return NULL; + } + req = qdf_mem_malloc(sizeof(*req)); if (!req) { WMA_LOGE("%s: Failed to allocate memory for msg %d vdev %d", @@ -5015,9 +5089,9 @@ static void wma_del_tdls_sta(tp_wma_handle wma, tpDeleteStaParams del_sta) WMA_DELETE_STA_TIMEOUT); if (!msg) { WMA_LOGE(FL("Failed to allocate vdev_id %d"), - peerStateParams->vdevId); + del_sta->smesessionId); wma_remove_req(wma, - peerStateParams->vdevId, + del_sta->smesessionId, WMA_DELETE_STA_RSP_START); del_sta->status = QDF_STATUS_E_NOMEM; goto send_del_rsp; @@ -5567,7 +5641,7 @@ void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle, * * Return: void */ -static void wma_vdev_reset_beacon_interval_timer(void *data) +static void wma_vdev_reset_beacon_interval_timer(unsigned long data) { tp_wma_handle wma; struct wma_beacon_interval_reset_req *req = diff --git a/core/wma/src/wma_dfs_interface.c b/core/wma/src/wma_dfs_interface.c index 7048e42dd399..a7bea0d65442 100644 --- a/core/wma/src/wma_dfs_interface.c +++ b/core/wma/src/wma_dfs_interface.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_dfs_interface.c * diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 97a6fae28e33..eeb1c085c7b3 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_features.c * This file contains different features related functions like WoW, @@ -1859,7 +1850,7 @@ int wma_nan_rsp_event_handler(void *handle, uint8_t *event_buf, alloc_len = sizeof(tSirNanEvent); alloc_len += nan_rsp_event_hdr->data_len; if (nan_rsp_event_hdr->data_len > ((WMI_SVC_MSG_MAX_SIZE - - sizeof(*nan_rsp_event_hdr)) / sizeof(uint8_t)) || + WMI_TLV_HDR_SIZE - sizeof(*nan_rsp_event_hdr)) / sizeof(uint8_t)) || nan_rsp_event_hdr->data_len > param_buf->num_data) { WMA_LOGE("excess data length:%d, num_data:%d", nan_rsp_event_hdr->data_len, param_buf->num_data); @@ -1942,6 +1933,14 @@ int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len) return -EINVAL; } + if (wma->interfaces[vdev_id].roaming_in_progress || + wma->interfaces[vdev_id].roam_synch_in_progress) { + WMA_LOGE("Roaming in progress for vdev %d, ignore csa_offload_event", + vdev_id); + qdf_mem_free(csa_offload_event); + return -EINVAL; + } + qdf_mem_zero(csa_offload_event, sizeof(*csa_offload_event)); qdf_mem_copy(csa_offload_event->bssId, &bssid, IEEE80211_ADDR_LEN); @@ -2945,6 +2944,11 @@ static QDF_STATUS spectral_process_phyerr(tp_wma_handle wma, uint8_t *data, get_spectral_control_info(wma, &upper_is_control, &lower_is_control); + if (!wma->dfs_ic || !wma->dfs_ic->ic_curchan) { + WMA_LOGE("%s: channel information is not available", __func__); + return QDF_STATUS_E_FAILURE; + } + if (upper_is_control) rssi_up = control_rssi; else @@ -3774,22 +3778,35 @@ static const u8 *wma_wow_wake_reason_str(A_INT32 wake_reason) */ static void wma_wow_stats_display(struct sir_vdev_wow_stats *stats) { - WMA_LOGA("uc %d bc %d v4_mc %d v6_mc %d ra %d ns %d na %d pno_match %d pno_complete %d gscan %d low_rssi %d rssi_breach %d icmp %d icmpv6 %d oem %d", - stats->ucast, - stats->bcast, - stats->ipv4_mcast, - stats->ipv6_mcast, - stats->ipv6_mcast_ra, - stats->ipv6_mcast_ns, - stats->ipv6_mcast_na, - stats->pno_match, - stats->pno_complete, - stats->gscan, - stats->low_rssi, - stats->rssi_breach, - stats->icmpv4, - stats->icmpv6, - stats->oem_response); + WMA_LOGA("WLAN wake reason counters:"); + WMA_LOGA("uc:%d bc:%d v4_mc:%d v6_mc:%d ra:%d ns:%d na:%d icmp:%d icmpv6:%d", + stats->ucast, + stats->bcast, + stats->ipv4_mcast, + stats->ipv6_mcast, + stats->ipv6_mcast_ra, + stats->ipv6_mcast_ns, + stats->ipv6_mcast_na, + stats->icmpv4, + stats->icmpv6); + + WMA_LOGA("assoc:%d disassoc:%d assoc_resp:%d reassoc:%d reassoc_resp:%d auth:%d deauth:%d action:%d", + stats->mgmt_assoc, + stats->mgmt_disassoc, + stats->mgmt_assoc_resp, + stats->mgmt_reassoc, + stats->mgmt_reassoc_resp, + stats->mgmt_auth, + stats->mgmt_deauth, + stats->mgmt_action); + + WMA_LOGA("pno_match:%d pno_complete:%d gscan:%d low_rssi:%d rssi_breach:%d oem:%d", + stats->pno_match, + stats->pno_complete, + stats->gscan, + stats->low_rssi, + stats->rssi_breach, + stats->oem_response); } /** @@ -3845,6 +3862,38 @@ static void wma_inc_wow_stats(struct sir_vdev_wow_stats *stats, uint8_t *data, int32_t len, WOW_WAKE_REASON_TYPE reason) { switch (reason) { + case WOW_REASON_ASSOC_REQ_RECV: + stats->mgmt_assoc++; + break; + + case WOW_REASON_DISASSOC_RECVD: + stats->mgmt_disassoc++; + break; + + case WOW_REASON_ASSOC_RES_RECV: + stats->mgmt_assoc_resp++; + break; + + case WOW_REASON_REASSOC_REQ_RECV: + stats->mgmt_reassoc++; + break; + + case WOW_REASON_REASSOC_RES_RECV: + stats->mgmt_reassoc_resp++; + break; + + case WOW_REASON_AUTH_REQ_RECV: + stats->mgmt_auth++; + break; + + case WOW_REASON_DEAUTH_RECVD: + stats->mgmt_deauth++; + break; + + case WOW_REASON_ACTION_FRAME_RECV: + stats->mgmt_action++; + break; + case WOW_REASON_BPF_ALLOW: case WOW_REASON_PATTERN_MATCH_FOUND: if (!data || len == 0) { @@ -4256,7 +4305,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, WMA_LOGD("wow_buf_pkt_len: %u", buf_len); if (buf_len >= QDF_NBUF_TRAC_IPV4_OFFSET) - WMA_LOGD("Src_mac: "MAC_ADDRESS_STR" Dst_mac: "MAC_ADDRESS_STR, + WMA_LOGI("Src_mac: "MAC_ADDRESS_STR" Dst_mac: "MAC_ADDRESS_STR, MAC_ADDR_ARRAY(data + QDF_NBUF_SRC_MAC_OFFSET), MAC_ADDR_ARRAY(data + QDF_NBUF_DEST_MAC_OFFSET)); else @@ -4268,7 +4317,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, case QDF_PROTO_EAPOL_M2: case QDF_PROTO_EAPOL_M3: case QDF_PROTO_EAPOL_M4: - WMA_LOGD("WOW Wakeup: %s rcvd", + WMA_LOGI("WOW Wakeup: %s rcvd", wma_pkt_proto_subtype_to_string(proto_subtype)); if (buf_len >= WMA_EAPOL_INFO_GET_MIN_LEN) { pkt_len = (uint16_t)(*(uint16_t *)(data + @@ -4289,7 +4338,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, case QDF_PROTO_DHCP_RELEASE: case QDF_PROTO_DHCP_INFORM: case QDF_PROTO_DHCP_DECLINE: - WMA_LOGD("WOW Wakeup: %s rcvd", + WMA_LOGI("WOW Wakeup: %s rcvd", wma_pkt_proto_subtype_to_string(proto_subtype)); if (buf_len >= WMA_DHCP_INFO_GET_MIN_LEN) { pkt_len = (uint16_t)(*(uint16_t *)(data + @@ -4304,13 +4353,13 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, case QDF_PROTO_ARP_REQ: case QDF_PROTO_ARP_RES: - WMA_LOGD("WOW Wakeup: %s rcvd", + WMA_LOGI("WOW Wakeup: %s rcvd", wma_pkt_proto_subtype_to_string(proto_subtype)); break; case QDF_PROTO_ICMP_REQ: case QDF_PROTO_ICMP_RES: - WMA_LOGD("WOW Wakeup: %s rcvd", + WMA_LOGI("WOW Wakeup: %s rcvd", wma_pkt_proto_subtype_to_string(proto_subtype)); if (buf_len >= WMA_IPV4_PKT_INFO_GET_MIN_LEN) { pkt_len = (uint16_t)(*(uint16_t *)(data + @@ -4329,7 +4378,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, case QDF_PROTO_ICMPV6_RA: case QDF_PROTO_ICMPV6_NS: case QDF_PROTO_ICMPV6_NA: - WMA_LOGD("WOW Wakeup: %s rcvd", + WMA_LOGI("WOW Wakeup: %s rcvd", wma_pkt_proto_subtype_to_string(proto_subtype)); if (buf_len >= WMA_IPV6_PKT_INFO_GET_MIN_LEN) { pkt_len = (uint16_t)(*(uint16_t *)(data + @@ -4344,7 +4393,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, case QDF_PROTO_IPV4_UDP: case QDF_PROTO_IPV4_TCP: - WMA_LOGD("WOW Wakeup: %s rcvd", + WMA_LOGI("WOW Wakeup: %s rcvd", wma_pkt_proto_subtype_to_string(proto_subtype)); if (buf_len >= WMA_IPV4_PKT_INFO_GET_MIN_LEN) { pkt_len = (uint16_t)(*(uint16_t *)(data + @@ -4361,7 +4410,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, IPV4_DST_PORT_OFFSET)); WMA_LOGD("Pkt_len: %u", ani_cpu_to_be16(pkt_len)); - WMA_LOGD("src_port: %u, dst_port: %u", + WMA_LOGI("src_port: %u, dst_port: %u", ani_cpu_to_be16(src_port), ani_cpu_to_be16(dst_port)); if (proto_subtype == QDF_PROTO_IPV4_TCP) { @@ -4375,7 +4424,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, case QDF_PROTO_IPV6_UDP: case QDF_PROTO_IPV6_TCP: - WMA_LOGD("WOW Wakeup: %s rcvd", + WMA_LOGI("WOW Wakeup: %s rcvd", wma_pkt_proto_subtype_to_string(proto_subtype)); if (buf_len >= WMA_IPV6_PKT_INFO_GET_MIN_LEN) { pkt_len = (uint16_t)(*(uint16_t *)(data + @@ -4400,7 +4449,7 @@ static void wma_wow_parse_data_pkt_buffer(uint8_t *data, IPV6_DST_PORT_OFFSET)); WMA_LOGD("Pkt_len: %u", ani_cpu_to_be16(pkt_len)); - WMA_LOGD("src_port: %u, dst_port: %u", + WMA_LOGI("src_port: %u, dst_port: %u", ani_cpu_to_be16(src_port), ani_cpu_to_be16(dst_port)); if (proto_subtype == QDF_PROTO_IPV6_TCP) { @@ -8178,6 +8227,20 @@ QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle, } #endif /* WLAN_FEATURE_GPIO_LED_FLASHING */ +int wma_sar_rsp_evt_handler(void *handle, uint8_t *event, uint32_t len) +{ + QDF_STATUS status; + + status = wmi_unified_extract_sar2_result_event(handle, + event, len); + if (QDF_IS_STATUS_ERROR(status)) { + WMA_LOGE(FL("Event extract failure: %d"), status); + return -EINVAL; + } + + return 0; +} + #ifdef FEATURE_WLAN_CH_AVOID /** * wma_channel_avoid_evt_handler() - process channel to avoid event from FW. @@ -9124,6 +9187,8 @@ QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams) wma_tdls->teardown_notification_ms; params.tdls_peer_kickout_threshold = wma_tdls->tdls_peer_kickout_threshold; + params.tdls_discovery_wake_timeout = + wma_tdls->tdls_discovery_wake_timeout; ret = wmi_unified_update_fw_tdls_state_cmd(wma_handle->wmi_handle, ¶ms, tdls_state); @@ -9785,6 +9850,8 @@ QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma, return ret; } +static void *apf_context; + int wma_get_apf_caps_event_handler(void *handle, u_int8_t *cmd_param_info, u_int32_t len) @@ -9822,12 +9889,12 @@ int wma_get_apf_caps_event_handler(void *handle, apf_get_offload->max_bytes_for_apf_inst); WMA_LOGD("%s: sending apf capabilities event to hdd", __func__); - pmac->sme.papf_get_offload_cb(pmac->hHdd, apf_get_offload); + pmac->sme.papf_get_offload_cb(apf_context, apf_get_offload); qdf_mem_free(apf_get_offload); return 0; } -QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma) +QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma, void *context) { QDF_STATUS status = QDF_STATUS_SUCCESS; wmi_bpf_get_capability_cmd_fixed_param *cmd; @@ -9846,6 +9913,7 @@ QDF_STATUS wma_get_apf_capabilities(tp_wma_handle wma) return QDF_STATUS_E_FAILURE; } + apf_context = context; len = sizeof(*cmd); wmi_buf = wmi_buf_alloc(wma->wmi_handle, len); if (!wmi_buf) { @@ -10021,7 +10089,7 @@ int wma_apf_read_work_memory_event_handler(void *handle, uint8_t *evt_buf, QDF_STATUS status; tpAniSirGlobal pmac = cds_get_context(QDF_MODULE_ID_PE); - WMA_LOGI(FL("handle:%pK event:%pK len:%u"), handle, evt_buf, len); + WMA_LOGD(FL("handle:%pK event:%pK len:%u"), handle, evt_buf, len); wma_handle = handle; if (!wma_handle) { @@ -10150,6 +10218,156 @@ QDF_STATUS wma_set_tx_rx_aggregation_size( return QDF_STATUS_SUCCESS; } +QDF_STATUS wma_set_tx_rx_aggregation_size_per_ac( + struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size) +{ + tp_wma_handle wma_handle; + wmi_vdev_set_custom_aggr_size_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + u_int8_t *buf_ptr; + int ret; + int queue_num; + uint32_t tx_aggr_size[4]; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + + if (!tx_rx_aggregation_size) { + WMA_LOGE("%s: invalid pointer", __func__); + return QDF_STATUS_E_INVAL; + } + + if (!wma_handle) { + WMA_LOGE("%s: WMA context is invald!", __func__); + return QDF_STATUS_E_INVAL; + } + + tx_aggr_size[0] = tx_rx_aggregation_size->tx_aggregation_size_be; + tx_aggr_size[1] = tx_rx_aggregation_size->tx_aggregation_size_bk; + tx_aggr_size[2] = tx_rx_aggregation_size->tx_aggregation_size_vi; + tx_aggr_size[3] = tx_rx_aggregation_size->tx_aggregation_size_vo; + + for (queue_num = 0; queue_num < 4; queue_num++) { + if (tx_aggr_size[queue_num] == 0) + continue; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return QDF_STATUS_E_NOMEM; + } + + buf_ptr = (u_int8_t *)wmi_buf_data(buf); + cmd = (wmi_vdev_set_custom_aggr_size_cmd_fixed_param *)buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_custom_aggr_size_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_vdev_set_custom_aggr_size_cmd_fixed_param)); + + cmd->vdev_id = tx_rx_aggregation_size->vdev_id; + cmd->rx_aggr_size = + tx_rx_aggregation_size->rx_aggregation_size; + + cmd->tx_aggr_size = tx_aggr_size[queue_num]; + /* bit 5: tx_ac_enable, if set, ac bitmap is valid. */ + cmd->enable_bitmap = 0x20 | queue_num; + + WMA_LOGD("queue_num: %d, tx aggr: %d rx aggr: %d vdev: %d", + queue_num, cmd->tx_aggr_size, + cmd->rx_aggr_size, cmd->vdev_id); + + ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send aggregation size command", + __func__); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + } + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wma_set_sw_retry_threshold( + struct sir_set_tx_aggr_sw_retry_threshold *tx_sw_retry_threshold) +{ + tp_wma_handle wma_handle; + wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + u_int8_t *buf_ptr; + int ret; + int queue_num; + uint32_t tx_aggr_retry[WMI_AC_MAX]; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + + if (!tx_sw_retry_threshold) { + WMA_LOGE("%s: invalid pointer", __func__); + return QDF_STATUS_E_INVAL; + } + + if (!wma_handle) { + WMA_LOGE("%s: WMA context is invald!", __func__); + return QDF_STATUS_E_INVAL; + } + + tx_aggr_retry[0] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_be; + tx_aggr_retry[1] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_bk; + tx_aggr_retry[2] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_vi; + tx_aggr_retry[3] = + tx_sw_retry_threshold->tx_aggr_sw_retry_threshold_vo; + + for (queue_num = 0; queue_num < WMI_AC_MAX; queue_num++) { + if (tx_aggr_retry[queue_num] == 0) + continue; + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return QDF_STATUS_E_NOMEM; + } + + buf_ptr = (u_int8_t *)wmi_buf_data(buf); + cmd = + (wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param *)buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_vdev_set_custom_sw_retry_th_cmd_fixed_param)); + + cmd->vdev_id = tx_sw_retry_threshold->vdev_id; + cmd->ac_type = queue_num; + cmd->sw_retry_type = WMI_VDEV_CUSTOM_SW_RETRY_TYPE_AGGR; + cmd->sw_retry_th = tx_aggr_retry[queue_num]; + + WMA_LOGD("queue: %d type: %d threadhold: %d vdev: %d", + queue_num, cmd->sw_retry_type, + cmd->sw_retry_th, cmd->vdev_id); + + ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_VDEV_SET_CUSTOM_SW_RETRY_TH_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send retry threshold command", + __func__); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + } + + return QDF_STATUS_SUCCESS; +} + /** * wma_p2p_lo_start() - P2P listen offload start * @params: p2p listen offload parameters @@ -10730,7 +10948,7 @@ int wma_get_arp_stats_handler(void *handle, uint8_t *data, wmi_vdev_get_arp_stats_event_fixed_param *data_event; wmi_vdev_get_connectivity_check_stats *connect_stats_event; uint8_t *buf_ptr; - struct rsp_stats rsp; + struct rsp_stats rsp = {0}; tpAniSirGlobal mac = cds_get_context(QDF_MODULE_ID_PE); ENTER(); @@ -11263,3 +11481,51 @@ int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf, return 0; } + + +bool wma_dual_beacon_on_single_mac_scc_capable(void) +{ + tp_wma_handle wma_handle = NULL; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + if (NULL == wma_handle) { + WMA_LOGE("%s : Failed to get wma_handle", __func__); + return false; + } + if (WMI_SERVICE_EXT_IS_ENABLED(wma_handle->wmi_service_bitmap, + wma_handle->wmi_service_ext_bitmap, + WMI_SERVICE_DUAL_BEACON_ON_SINGLE_MAC_SCC_SUPPORT)) { + WMA_LOGD("Support dual beacon on same channel on single MAC"); + return true; + } + if (WMI_SERVICE_EXT_IS_ENABLED(wma_handle->wmi_service_bitmap, + wma_handle->wmi_service_ext_bitmap, + WMI_SERVICE_DUAL_BEACON_ON_SINGLE_MAC_MCC_SUPPORT)) { + WMA_LOGD("Support dual beacon on both different and same channel on single MAC"); + return true; + } else { + WMA_LOGD("Not support dual beacon on same channel on single MAC"); + return false; + } +} + +bool wma_dual_beacon_on_single_mac_mcc_capable(void) +{ + tp_wma_handle wma_handle = NULL; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + if (NULL == wma_handle) { + WMA_LOGE("%s : Failed to get wma_handle", __func__); + return false; + } + + if (WMI_SERVICE_EXT_IS_ENABLED(wma_handle->wmi_service_bitmap, + wma_handle->wmi_service_ext_bitmap, + WMI_SERVICE_DUAL_BEACON_ON_SINGLE_MAC_MCC_SUPPORT)) { + WMA_LOGD("Support dual beacon on different channel on single MAC"); + return true; + } else { + WMA_LOGD("Not support dual beacon on different channel on single MAC"); + return false; + } +} diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index dae373290122..6f2c77f1db58 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_main.c * @@ -1898,6 +1889,19 @@ static void wma_cleanup_hold_req(tp_wma_handle wma) qdf_spin_unlock_bh(&wma->wma_hold_req_q_lock); } +void wma_cleanup_vdev_resp_and_hold_req(void *priv) +{ + tp_wma_handle wma_handle = priv; + + if (!wma_handle) { + WMA_LOGE(FL("wma_handle is invald!")); + return; + } + + wma_cleanup_vdev_resp_queue(wma_handle); + wma_cleanup_hold_req(wma_handle); +} + /** * wma_shutdown_notifier_cb - Shutdown notifer call back * @priv : WMA handle @@ -1913,10 +1917,16 @@ static void wma_cleanup_hold_req(tp_wma_handle wma) static void wma_shutdown_notifier_cb(void *priv) { tp_wma_handle wma_handle = priv; + cds_msg_t msg = { 0 }; + QDF_STATUS status; qdf_event_set(&wma_handle->wma_resume_event); - wma_cleanup_vdev_resp_queue(wma_handle); - wma_cleanup_hold_req(wma_handle); + + sys_build_message_header(SYS_MSG_ID_CLEAN_VDEV_RSP_QUEUE, &msg); + msg.bodyptr = priv; + status = cds_mq_post_message(QDF_MODULE_ID_SYS, &msg); + if (QDF_IS_STATUS_ERROR(status)) + WMA_LOGE(FL("Failed to post SYS_MSG_ID_CLEAN_VDEV_RSP_QUEUE")); } struct wma_version_info g_wmi_version_info; @@ -2069,6 +2079,7 @@ static int wma_flush_complete_evt_handler(void *handle, wmi_event = param_buf->fixed_param; reason_code = wmi_event->reserved0; + WMA_LOGD("Received reason code %d from FW", reason_code); buf_ptr = (uint8_t *)wmi_event; buf_ptr = buf_ptr + sizeof(wmi_debug_mesg_flush_complete_fixed_param) + @@ -3220,7 +3231,13 @@ void wma_process_pdev_hw_mode_trans_ind(void *handle, { uint32_t i; tp_wma_handle wma = (tp_wma_handle) handle; - + if (fixed_param->num_vdev_mac_entries > MAX_VDEV_SUPPORTED) { + WMA_LOGE("Number of Vdev mac entries %d exceeded" + " max vdev supported %d", + fixed_param->num_vdev_mac_entries, + MAX_VDEV_SUPPORTED); + return; + } hw_mode_trans_ind->old_hw_mode_index = fixed_param->old_hw_mode_index; hw_mode_trans_ind->new_hw_mode_index = fixed_param->new_hw_mode_index; hw_mode_trans_ind->num_vdev_mac_entries = @@ -3538,6 +3555,18 @@ QDF_STATUS wma_start(void *cds_ctx) goto end; } #endif /* FEATURE_WLAN_CH_AVOID */ + WMA_LOGD("Registering SAR2 response handler"); + + status = wmi_unified_register_event_handler(wma_handle->wmi_handle, + WMI_SAR2_RESULT_EVENTID, + wma_sar_rsp_evt_handler, + WMA_RX_SERIALIZER_CTX); + if (status) { + WMA_LOGE("Failed to register sar response event cb"); + qdf_status = QDF_STATUS_E_FAILURE; + goto end; + } + #ifdef FEATURE_WLAN_AUTO_SHUTDOWN WMA_LOGD("Registering auto shutdown handler"); status = wmi_unified_register_event_handler(wma_handle->wmi_handle, @@ -4811,6 +4840,16 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle) tgt_cfg.target_fw_version = wma_handle->target_fw_version; tgt_cfg.target_fw_vers_ext = wma_handle->target_fw_vers_ext; + tgt_cfg.hw_bd_id = wma_handle->hw_bd_id; + + tgt_cfg.hw_bd_info.bdf_version = wma_handle->hw_bd_info[BDF_VERSION]; + tgt_cfg.hw_bd_info.ref_design_id = + wma_handle->hw_bd_info[REF_DESIGN_ID]; + tgt_cfg.hw_bd_info.customer_id = wma_handle->hw_bd_info[CUSTOMER_ID]; + tgt_cfg.hw_bd_info.project_id = wma_handle->hw_bd_info[PROJECT_ID]; + tgt_cfg.hw_bd_info.board_data_rev = + wma_handle->hw_bd_info[BOARD_DATA_REV]; + #ifdef WLAN_FEATURE_LPSS tgt_cfg.lpss_support = wma_handle->lpss_support; #endif /* WLAN_FEATURE_LPSS */ @@ -5124,24 +5163,27 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info, __func__, ev->fw_build_vers); WMA_LOGD("FW fine time meas cap: 0x%x", ev->wmi_fw_sub_feat_caps); - if (ev->hw_bd_id) { - wma_handle->hw_bd_id = ev->hw_bd_id; - qdf_mem_copy(wma_handle->hw_bd_info, - ev->hw_bd_info, sizeof(ev->hw_bd_info)); - - WMA_LOGI("%s: Board version: %x.%x", - __func__, - wma_handle->hw_bd_info[0], wma_handle->hw_bd_info[1]); - } else { - wma_handle->hw_bd_id = 0; - qdf_mem_zero(wma_handle->hw_bd_info, - sizeof(wma_handle->hw_bd_info)); - WMA_LOGW("%s: Board version is unknown!", __func__); - } + wma_handle->hw_bd_id = ev->hw_bd_id; wma_handle->dfs_ic->dfs_hw_bd_id = wma_handle->hw_bd_id; - /* TODO: Recheck below line to dump service ready event */ - /* dbg_print_wmi_service_11ac(ev); */ + wma_handle->hw_bd_info[BDF_VERSION] = + WMI_GET_BDF_VERSION(ev->hw_bd_info); + wma_handle->hw_bd_info[REF_DESIGN_ID] = + WMI_GET_REF_DESIGN(ev->hw_bd_info); + wma_handle->hw_bd_info[CUSTOMER_ID] = + WMI_GET_CUSTOMER_ID(ev->hw_bd_info); + wma_handle->hw_bd_info[PROJECT_ID] = + WMI_GET_PROJECT_ID(ev->hw_bd_info); + wma_handle->hw_bd_info[BOARD_DATA_REV] = + WMI_GET_BOARD_DATA_REV(ev->hw_bd_info); + + WMA_LOGI("%s: Board id: %x, Board version: %x %x %x %x %x", + __func__, wma_handle->hw_bd_id, + wma_handle->hw_bd_info[BDF_VERSION], + wma_handle->hw_bd_info[REF_DESIGN_ID], + wma_handle->hw_bd_info[CUSTOMER_ID], + wma_handle->hw_bd_info[PROJECT_ID], + wma_handle->hw_bd_info[BOARD_DATA_REV]); /* wmi service is ready */ qdf_mem_copy(wma_handle->wmi_service_bitmap, @@ -5990,6 +6032,18 @@ static void wma_populate_soc_caps(t_wma_handle *wma_handle, wma_cleanup_dbs_phy_caps(wma_handle); return; } + + if (param_buf->sar_caps) { + qdf_mem_copy(&phy_caps->sar_capability, + param_buf->sar_caps, + sizeof(WMI_SAR_CAPABILITIES)); + if (phy_caps->sar_capability.active_version > SAR_VERSION_2) { + WMA_LOGE("%s: incorrect SAR version", __func__); + wma_cleanup_dbs_phy_caps(wma_handle); + return; + } + } + phy_caps->each_phy_hal_reg_cap = qdf_mem_malloc(phy_caps->num_phy_for_hal_reg_cap.num_phy * sizeof(WMI_HAL_REG_CAPABILITIES_EXT)); @@ -8114,7 +8168,7 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) qdf_mem_free(msg->bodyptr); break; case WDA_APF_GET_CAPABILITIES_REQ: - wma_get_apf_capabilities(wma_handle); + wma_get_apf_capabilities(wma_handle, msg->bodyptr); break; case WDA_APF_SET_INSTRUCTIONS_REQ: wma_set_apf_instructions(wma_handle, msg->bodyptr); diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 6fb37f3e8951..09cef7c2cdc9 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_mgmt.c * @@ -3357,6 +3348,13 @@ int wma_process_rmf_frame(tp_wma_handle wma_handle, cds_pkt_return_packet(rx_pkt); return -EINVAL; } + if (qdf_nbuf_len(wbuf) < (sizeof(*wh) + IEEE80211_CCMP_HEADERLEN + + IEEE80211_CCMP_MICLEN)) { + WMA_LOGE("Buffer length less than expected %d ", + (int)qdf_nbuf_len(wbuf)); + cds_pkt_return_packet(rx_pkt); + return -EINVAL; + } orig_hdr = (uint8_t *) qdf_nbuf_data(wbuf); /* Pointer to head of CCMP header */ @@ -3541,6 +3539,7 @@ end: } #define RATE_LIMIT 16 +#define RESERVE_BYTES 100 /** * wma_mgmt_rx_process() - process management rx frame. * @handle: wma handle @@ -3676,9 +3675,28 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data, qdf_mem_free(rx_pkt); return -EINVAL; } - - /* Why not just use rx_event->hdr.buf_len? */ - wbuf = qdf_nbuf_alloc(NULL, roundup(hdr->buf_len, 4), 0, 4, false); + /* + * Allocate the memory for this rx packet, add extra 100 bytes for:- + * + * 1. Filling the missing RSN capabilites by some APs, which fill the + * RSN IE length as extra 2 bytes but dont fill the IE data with + * capabilities, resulting in failure in unpack core due to length + * mismatch. Check sir_validate_and_rectify_ies for more info. + * + * 2. In the API wma_process_rmf_frame(), the driver trims the CCMP + * header by overwriting the IEEE header to memory occupied by CCMP + * header, but an overflow is possible if the memory allocated to + * frame is less than the sizeof(struct ieee80211_frame) +CCMP + * HEADER len, so allocating 100 bytes would solve this issue too. + * + * 3. CCMP header is pointing to orig_hdr + + * sizeof(struct ieee80211_frame) which could also result in OOB + * access, if the data len is less than + * sizeof(struct ieee80211_frame), allocating extra bytes would + * result in solving this issue too. + */ + wbuf = qdf_nbuf_alloc(NULL, roundup(hdr->buf_len + RESERVE_BYTES, + 4), 0, 4, false); if (!wbuf) { WMA_LOGE("%s: Failed to allocate wbuf for mgmt rx len(%u)", __func__, hdr->buf_len); @@ -3724,7 +3742,7 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data, mgt_type = (wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK; mgt_subtype = (wh)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - WMA_LOGD(FL("BSSID: "MAC_ADDRESS_STR" snr = %d, Type = %x, Subtype = %x, seq_num = %x, rssi = %d, rssi_raw = %d tsf_delta: %u"), + WMA_LOGD(FL("BSSID: "MAC_ADDRESS_STR" snr = %d, Type = %x, Subtype = %x, seq_num = %x, rssi = %d, rssi_raw = %d rssi for chain0 is :- %d, chain1 is %d, tsf_delta: %u"), MAC_ADDR_ARRAY(wh->i_addr3), hdr->snr, mgt_type, mgt_subtype, (((*(uint16_t *)wh->i_seq) & @@ -3732,6 +3750,10 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data, IEEE80211_SEQ_SEQ_SHIFT), rx_pkt->pkt_meta.rssi, rx_pkt->pkt_meta.rssi_raw, + (rx_pkt->pkt_meta.rssi_per_chain[0] + + WMA_NOISE_FLOOR_DBM_DEFAULT), + (rx_pkt->pkt_meta.rssi_per_chain[1] + + WMA_NOISE_FLOOR_DBM_DEFAULT), hdr->tsf_delta); if (!wma_handle->mgmt_rx) { WMA_LOGE("Not registered for Mgmt rx, dropping the frame"); diff --git a/core/wma/src/wma_nan_datapath.c b/core/wma/src/wma_nan_datapath.c index 720b627008be..1cf32838fad8 100644 --- a/core/wma/src/wma_nan_datapath.c +++ b/core/wma/src/wma_nan_datapath.c @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/wma/src/wma_nan_datapath.h b/core/wma/src/wma_nan_datapath.h index d65c2b100a5d..716cf16903f5 100644 --- a/core/wma/src/wma_nan_datapath.h +++ b/core/wma/src/wma_nan_datapath.h @@ -1,8 +1,6 @@ /* * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all diff --git a/core/wma/src/wma_ocb.c b/core/wma/src/wma_ocb.c index 5dc6c87fde7d..64b615890693 100644 --- a/core/wma/src/wma_ocb.c +++ b/core/wma/src/wma_ocb.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_ocb.c * diff --git a/core/wma/src/wma_ocb.h b/core/wma/src/wma_ocb.h index 897efa005dda..db022b744e17 100644 --- a/core/wma/src/wma_ocb.h +++ b/core/wma/src/wma_ocb.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef __WMA_OCB_H #define __WMA_OCB_H diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index 721be0443b4d..59209dfb8b21 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_power.c * This file contains powersave related functions. diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 35742442a5cc..0a32d4fc8237 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_scan_roam.c * This file contains functions related to scan and @@ -390,8 +381,12 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, * of channels in every transition by using * burst scan. */ - cmd->burst_duration = - wma_get_burst_duration( + if (pMac->go_scan_burst_duration) + cmd->burst_duration = + pMac->go_scan_burst_duration; + else + cmd->burst_duration = + wma_get_burst_duration( scan_req->maxChannelTime, wma_handle->miracast_value); @@ -399,14 +394,19 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, } if (wma_is_sta_active(wma_handle) || wma_is_p2p_cli_active(wma_handle)) { - if (scan_req->burst_scan_duration) + if (pMac->sta_scan_burst_duration) { cmd->burst_duration = + pMac->sta_scan_burst_duration; + } else { + if (scan_req->burst_scan_duration) + cmd->burst_duration = scan_req->burst_scan_duration; - else - /* Typical background scan. - * Disable burst scan for now. - */ - cmd->burst_duration = 0; + else + /* Typical background scan. + * Disable burst scan for now. + */ + cmd->burst_duration = 0; + } break; } if (wma_is_ndi_active(wma_handle)) { @@ -433,6 +433,9 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, case P2P_SCAN_TYPE_SEARCH: WMA_LOGD("P2P_SCAN_TYPE_SEARCH"); cmd->scan_ctrl_flags |= WMI_SCAN_FILTER_PROBE_REQ; + if (!scan_req->numSsid) + cmd->scan_ctrl_flags |= + WMI_SCAN_ADD_BCAST_PROBE_REQ; /* Default P2P burst duration of 120 ms will cover * 3 channels with default max dwell time 40 ms. * Cap limit will be set by @@ -449,20 +452,28 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, cmd->repeat_probe_time = scan_req->maxChannelTime / 3; - cmd->burst_duration = - WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS * - scan_req->maxChannelTime; - if (cmd->burst_duration > - WMA_P2P_SCAN_MAX_BURST_DURATION) { - uint8_t channels = - WMA_P2P_SCAN_MAX_BURST_DURATION / + if (pMac->p2p_scan_burst_duration) { + cmd->burst_duration = + pMac->p2p_scan_burst_duration; + } else { + cmd->burst_duration = + WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS * scan_req->maxChannelTime; - if (channels) - cmd->burst_duration = - channels * scan_req->maxChannelTime; - else - cmd->burst_duration = + if (cmd->burst_duration > + WMA_P2P_SCAN_MAX_BURST_DURATION) { + uint8_t channels = + WMA_P2P_SCAN_MAX_BURST_DURATION + / scan_req->maxChannelTime; + if (channels) { + cmd->burst_duration = + channels * + scan_req-> + maxChannelTime; + } else { + cmd->burst_duration = WMA_P2P_SCAN_MAX_BURST_DURATION; + } + } } cmd->scan_priority = WMI_SCAN_PRIORITY_MEDIUM; break; @@ -488,11 +499,16 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, cds_get_channel(CDS_SAP_MODE, NULL)))) { cmd->dwell_time_passive = cmd->dwell_time_active; } - cmd->burst_duration = 0; - if (CDS_IS_DFS_CH(cds_get_channel(CDS_SAP_MODE, NULL))) - cmd->burst_duration = - WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS * - scan_req->maxChannelTime; + + if (pMac->ap_scan_burst_duration) { + cmd->burst_duration = pMac->ap_scan_burst_duration; + } else { + cmd->burst_duration = 0; + if (CDS_IS_DFS_CH(cds_get_channel(CDS_SAP_MODE, NULL))) + cmd->burst_duration = + WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS * + scan_req->maxChannelTime; + } WMA_LOGD("SAP: burst_duration: %d", cmd->burst_duration); } @@ -948,6 +964,8 @@ QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle, params->is_roam_req_valid = 1; #ifdef WLAN_FEATURE_ROAM_OFFLOAD params->roam_offload_enabled = roam_req->RoamOffloadEnabled; + params->roam_offload_params.ho_delay_for_rx = + roam_req->ho_delay_for_rx; params->prefer_5ghz = roam_req->Prefer5GHz; params->roam_rssi_cat_gap = roam_req->RoamRssiCatGap; params->select_5ghz_margin = roam_req->Select5GHzMargin; @@ -968,6 +986,10 @@ QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle, params->fw_okc = roam_req->pmkid_modes.fw_okc; params->fw_pmksa_cache = roam_req->pmkid_modes.fw_pmksa_cache; #endif + params->min_delay_btw_roam_scans = + roam_req->min_delay_btw_roam_scans; + params->roam_trigger_reason_bitmask = + roam_req->roam_trigger_reason_bitmask; params->is_ese_assoc = roam_req->IsESEAssoc; params->is_11r_assoc = roam_req->is_11r_assoc; params->mdid.mdie_present = roam_req->MDID.mdiePresent; @@ -979,10 +1001,14 @@ QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle, wma_roam_scan_fill_fils_params(wma_handle, params, roam_req); } - WMA_LOGD(FL("qos_caps: %d, qos_enabled: %d, roam_scan_mode: %d"), + WMA_LOGD(FL("qos_caps: %d, qos_enabled: %d, ho_delay_for_rx: %d, roam_scan_mode: %d"), params->roam_offload_params.qos_caps, params->roam_offload_params.qos_enabled, - params->mode); + params->roam_offload_params.ho_delay_for_rx, params->mode); + + WMA_LOGD(FL("min_delay_btw_roam_scans: %d, roam_trigger_reason_bitmask: %d"), + params->min_delay_btw_roam_scans, + params->roam_trigger_reason_bitmask); status = wmi_unified_roam_scan_offload_mode_cmd(wma_handle->wmi_handle, scan_cmd_fp, params); @@ -2107,7 +2133,8 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, /* Don't use rssi triggered roam scans if external app * is in control of channel list. */ - if (roam_req->ChannelCacheType != CHANNEL_LIST_STATIC) + if (roam_req->ChannelCacheType != CHANNEL_LIST_STATIC || + roam_req->roam_force_rssi_trigger) mode |= WMI_ROAM_SCAN_MODE_RSSI_CHANGE; } else { @@ -2233,11 +2260,16 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, NULL, &scan_params); if (roam_req->reason == REASON_ROAM_STOP_ALL || - roam_req->reason == REASON_ROAM_SYNCH_FAILED) + roam_req->reason == REASON_ROAM_SYNCH_FAILED) { mode = WMI_ROAM_SCAN_MODE_NONE; - else - mode = WMI_ROAM_SCAN_MODE_NONE | - WMI_ROAM_SCAN_MODE_ROAMOFFLOAD; + } else { + if (csr_roamIsRoamOffloadEnabled(pMac)) + mode = WMI_ROAM_SCAN_MODE_NONE | + WMI_ROAM_SCAN_MODE_ROAMOFFLOAD; + else + mode = WMI_ROAM_SCAN_MODE_NONE; + } + qdf_status = wma_roam_scan_offload_mode(wma_handle, &scan_params, NULL, mode, roam_req->sessionId); @@ -2387,7 +2419,8 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle, /* Don't use rssi triggered roam scans if external app * is in control of channel list. */ - if (roam_req->ChannelCacheType != CHANNEL_LIST_STATIC) + if (roam_req->ChannelCacheType != CHANNEL_LIST_STATIC || + roam_req->roam_force_rssi_trigger) mode |= WMI_ROAM_SCAN_MODE_RSSI_CHANGE; } else { @@ -2726,7 +2759,16 @@ static int wma_fill_roam_synch_buffer(tp_wma_handle wma, fils_info = (wmi_roam_fils_synch_tlv_param *) (param_buf->roam_fils_synch_info); - if (param_buf->roam_fils_synch_info) { + if (fils_info) { + if ((fils_info->kek_len > SIR_KEK_KEY_LEN_FILS) || + (fils_info->pmk_len > SIR_PMK_LEN)) { + WMA_LOGE("%s: Invalid kek_len %d or pmk_len %d", + __func__, + fils_info->kek_len, + fils_info->pmk_len); + return -EINVAL; + } + roam_synch_ind_ptr->kek_len = fils_info->kek_len; qdf_mem_copy(roam_synch_ind_ptr->kek, fils_info->kek, fils_info->kek_len); @@ -2898,6 +2940,14 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, return status; } + /* + * This flag is set during ROAM_START and once this event is being + * executed which is a run to completion, no other event can interrupt + * this in MC thread context. So, it is OK to reset the flag here as + * soon as we receive this event. + */ + wma->interfaces[synch_event->vdev_id].roaming_in_progress = false; + if (synch_event->bcn_probe_rsp_len > param_buf->num_bcn_probe_rsp_frame || synch_event->reassoc_req_len > @@ -3222,6 +3272,7 @@ cleanup_label: return status; } +#define RSN_CAPS_SHIFT 16 /** * wma_roam_scan_fill_self_caps() - fill capabilities * @wma_handle: wma handle @@ -3326,7 +3377,18 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, selfCaps.immediateBA = (uint16_t) ((val >> WNI_CFG_BLOCK_ACK_ENABLED_IMMEDIATE) & 1); pCfgValue16 = (uint16_t *) &selfCaps; - roam_offload_params->capability = (*pCfgValue16) & 0xFFFF; + /* + * RSN caps arent been sent to firmware, so in case of PMF required, + * the firmware connects to a non PMF AP advertising PMF not required + * in the re-assoc request which violates protocol. + * So send this to firmware in the roam SCAN offload command to + * let it configure the params in the re-assoc request too. + * Instead of making another infra, send the RSN-CAPS in MSB of + * beacon Caps. + */ + roam_offload_params->capability = *((uint32_t *)(&roam_req->rsn_caps)); + roam_offload_params->capability <<= RSN_CAPS_SHIFT; + roam_offload_params->capability |= ((*pCfgValue16) & 0xFFFF); if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &nCfgValue) != eSIR_SUCCESS) { @@ -3840,7 +3902,7 @@ QDF_STATUS wma_pno_start(tp_wma_handle wma, tpSirPNOScanReq pno) pno->aNetworks[i].ssId.length; qdf_mem_copy(params->aNetworks[i].ssid.mac_ssid, pno->aNetworks[i].ssId.ssId, - WMI_MAC_MAX_SSID_LENGTH); + pno->aNetworks[i].ssId.length); } params->enable_pno_scan_randomization = @@ -5245,12 +5307,12 @@ int wma_extscan_change_results_event_handler(void *handle, tSirWifiSignificantChange *dest_ap; wmi_extscan_wlan_change_result_bssid *src_chglist; - int numap; + uint32_t numap; int i, k; uint8_t *src_rssi; int count = 0; int moredata; - int rssi_num = 0; + uint32_t rssi_num = 0; tpAniSirGlobal pMac = cds_get_context(QDF_MODULE_ID_PE); uint32_t buf_len; bool excess_data = false; @@ -5282,8 +5344,17 @@ int wma_extscan_change_results_event_handler(void *handle, WMA_LOGE("%s: Invalid num of entries in page: %d", __func__, numap); return -EINVAL; } - for (i = 0; i < numap; i++) + for (i = 0; i < numap; i++) { + if (src_chglist->num_rssi_samples > (UINT_MAX - rssi_num)) { + WMA_LOGE("%s: Invalid num of rssi samples %d numap %d rssi_num %d", + __func__, src_chglist->num_rssi_samples, + numap, rssi_num); + return -EINVAL; + } rssi_num += src_chglist->num_rssi_samples; + src_chglist++; + } + src_chglist = param_buf->bssid_signal_descriptor_list; if (event->first_entry_index + event->num_entries_in_page < event->total_entries) { @@ -6319,7 +6390,7 @@ QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma, req->networks[i].ssid.length; qdf_mem_copy(params->networks[i].ssid.mac_ssid, req->networks[i].ssid.ssId, - WMI_MAC_MAX_SSID_LENGTH); + req->networks[i].ssid.length); } } @@ -6718,6 +6789,8 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, WMA_LOGE("LFR3:Hand-Off Failed for vdevid %x", wmi_event->vdev_id); wma_roam_ho_fail_handler(wma_handle, wmi_event->vdev_id); + wma_handle->interfaces[wmi_event->vdev_id]. + roaming_in_progress = false; break; #endif case WMI_ROAM_REASON_INVALID: @@ -6726,10 +6799,16 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, WMA_LOGE("Memory unavailable for roam synch data"); return -ENOMEM; } - if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_START) + if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_START) { op_code = SIR_ROAMING_START; - if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_ABORT) + wma_handle->interfaces[wmi_event->vdev_id]. + roaming_in_progress = true; + } + if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_ABORT) { op_code = SIR_ROAMING_ABORT; + wma_handle->interfaces[wmi_event->vdev_id]. + roaming_in_progress = false; + } roam_synch_data->roamedVdevId = wmi_event->vdev_id; wma_handle->pe_roam_synch_cb( (tpAniSirGlobal)wma_handle->mac_context, diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index f575c06e9251..3a39569150b2 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_utis.c * This file contains utilities and stats related functions. @@ -461,8 +452,8 @@ int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf, alloc_len += stats_ext_info->data_len; if (stats_ext_info->data_len > (WMI_SVC_MSG_MAX_SIZE - - sizeof(*stats_ext_info)) || stats_ext_info->data_len > - param_buf->num_data) { + WMI_TLV_HDR_SIZE - sizeof(*stats_ext_info)) || + stats_ext_info->data_len > param_buf->num_data) { WMA_LOGE("Excess data_len:%d, num_data:%d", stats_ext_info->data_len, param_buf->num_data); return -EINVAL; @@ -3604,7 +3595,6 @@ int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap, WMI_DEBUG_PRINT_EVENTID_param_tlvs *param_buf; uint8_t *data; uint32_t datalen; - char dbgbuf[WMI_SVC_MSG_MAX_SIZE] = { 0 }; param_buf = (WMI_DEBUG_PRINT_EVENTID_param_tlvs *) datap; if (!param_buf || !param_buf->data) { @@ -3614,33 +3604,28 @@ int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap, data = param_buf->data; datalen = param_buf->num_data; if (datalen > WMI_SVC_MSG_MAX_SIZE) { - WMA_LOGE("Received data len %d exceeds max value %d", - datalen, WMI_SVC_MSG_MAX_SIZE); - return QDF_STATUS_E_FAILURE; + WMA_LOGE("Received data len %d exceeds max value %d", + datalen, WMI_SVC_MSG_MAX_SIZE); + return QDF_STATUS_E_FAILURE; } + data[datalen - 1] = '\0'; #ifdef BIG_ENDIAN_HOST { if (datalen >= BIG_ENDIAN_MAX_DEBUG_BUF) { WMA_LOGE("%s Invalid data len %d, limiting to max", __func__, datalen); - datalen = BIG_ENDIAN_MAX_DEBUG_BUF-1; + datalen = BIG_ENDIAN_MAX_DEBUG_BUF - 1; } + char dbgbuf[BIG_ENDIAN_MAX_DEBUG_BUF] = { 0 }; - strlcpy(dbgbuf, data, datalen); + memcpy(dbgbuf, data, datalen); SWAPME(dbgbuf, datalen); WMA_LOGD("FIRMWARE:%s", dbgbuf); return 0; } #else - if (datalen == WMI_SVC_MSG_MAX_SIZE) { - WMA_LOGE("%s Invalid data len %d, limiting to max", - __func__, datalen); - datalen = WMI_SVC_MSG_MAX_SIZE -1 ; - } - - strlcpy(dbgbuf, data, datalen); - WMA_LOGD("FIRMWARE:%s", dbgbuf); + WMA_LOGD("FIRMWARE:%s", data); return 0; #endif /* BIG_ENDIAN_HOST */ } @@ -6035,6 +6020,7 @@ QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id) QDF_STATUS status; struct wma_txrx_node *vdev = &wma->interfaces[vdev_id]; + wma->interfaces[vdev_id].roaming_in_progress = false; status = wmi_unified_vdev_down_send(wma->wmi_handle, vdev_id); wma_release_wakelock(&vdev->vdev_start_wakelock); diff --git a/core/wma/src/wma_utils_ut.c b/core/wma/src/wma_utils_ut.c index 8eb5e3d302e8..0fbd6041d209 100644 --- a/core/wma/src/wma_utils_ut.c +++ b/core/wma/src/wma_utils_ut.c @@ -1,9 +1,6 @@ /* * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: wma_utils_ut.c * This file contains utilities related to unit test framework diff --git a/uapi/linux/a_debug.h b/uapi/linux/a_debug.h index 3a5fd4c2204c..659454fbc82a 100644 --- a/uapi/linux/a_debug.h +++ b/uapi/linux/a_debug.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _A_DEBUG_H_ #define _A_DEBUG_H_ diff --git a/uapi/linux/a_types.h b/uapi/linux/a_types.h index b47f4a83903c..190d40df6afd 100644 --- a/uapi/linux/a_types.h +++ b/uapi/linux/a_types.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* depot/sw/qca_main/perf_pwr_offload/drivers/host/include/a_types.h#7 - integrate change 1327637 (ktext) */ /* ============================================================================== */ /* This file contains the definitions of the basic atheros data types. */ diff --git a/uapi/linux/athstartpack.h b/uapi/linux/athstartpack.h index c6c051eb2912..0b92352228ec 100644 --- a/uapi/linux/athstartpack.h +++ b/uapi/linux/athstartpack.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _ATHSTARTPACK_H #define _ATHSTARTPACK_H diff --git a/uapi/linux/dbglog_common.h b/uapi/linux/dbglog_common.h index 152862fa661b..75c2d5e729c9 100644 --- a/uapi/linux/dbglog_common.h +++ b/uapi/linux/dbglog_common.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2011, 2014-2015 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _DBGLOG_COMMON_H_ #define _DBGLOG_COMMON_H_ diff --git a/uapi/linux/debug_linux.h b/uapi/linux/debug_linux.h index 428c90b057f5..d91dd110f8f4 100644 --- a/uapi/linux/debug_linux.h +++ b/uapi/linux/debug_linux.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef _DEBUG_LINUX_H_ #define _DEBUG_LINUX_H_ diff --git a/uapi/linux/osapi_linux.h b/uapi/linux/osapi_linux.h index d6eb339f7b81..eb6c19a659d7 100644 --- a/uapi/linux/osapi_linux.h +++ b/uapi/linux/osapi_linux.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /* ------------------------------------------------------------------------------ */ /* This file contains the definitions of the basic atheros data types. */ /* It is used to map the data types in atheros files to a platform specific */ diff --git a/uapi/linux/pktlog_ac_fmt.h b/uapi/linux/pktlog_ac_fmt.h index 8b03aecb2e27..c7b0a52a4a64 100644 --- a/uapi/linux/pktlog_ac_fmt.h +++ b/uapi/linux/pktlog_ac_fmt.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - #ifndef REMOVE_PKT_LOG #ifndef _PKTLOG_FMT_H_ #define _PKTLOG_FMT_H_ diff --git a/uapi/linux/qca_vendor.h b/uapi/linux/qca_vendor.h index a46a520fec50..6b167af35420 100644 --- a/uapi/linux/qca_vendor.h +++ b/uapi/linux/qca_vendor.h @@ -1,9 +1,6 @@ /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all @@ -19,12 +16,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - /** * DOC: declares vendor commands interfacing with linux kernel */ @@ -4685,6 +4676,8 @@ enum qca_wlan_vendor_tdls_trigger_mode { * limit feature. * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER: Select the SAR power * limits configured by %QCA_NL80211_VENDOR_SUBCMD_SET_SAR. + * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0: Select the SAR power + * limits version 2.0 configured by %QCA_NL80211_VENDOR_SUBCMD_SET_SAR. * * This enumerates the valid set of values that may be supplied for * attribute %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT in an instance of @@ -4700,6 +4693,7 @@ enum qca_vendor_attr_sar_limits_selections { QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF4 = 4, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_NONE = 5, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER = 6, + QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0 = 7, }; /** @@ -4747,6 +4741,11 @@ enum qca_vendor_attr_sar_limits_spec_modulations { * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_MODULATION and always * contains as a payload the attribute * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT. + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX. + * Either %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT or + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX is + * needed based upon the value of + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SAR_ENABLE. * * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_BAND: Optional (u32) value to * indicate for which band this specification applies. Valid @@ -4769,8 +4768,15 @@ enum qca_vendor_attr_sar_limits_spec_modulations { * modulation schemes. * * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT: Required (u32) - * value to specify the actual power limit value in steps of 0.5 - * dbm. + * value to specify the actual power limit value in units of 0.5 + * dBm (i.e., a value of 11 represents 5.5 dBm). + * This is required, when %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT is + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_USER. + * + * @QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX: Required (u32) + * value to indicate SAR V2 indices (0 - 11) to select SAR V2 profiles. + * This is required, when %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT is + * %QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0. * * These attributes are used with %QCA_NL80211_VENDOR_SUBCMD_SET_SAR_LIMITS * and %QCA_NL80211_VENDOR_SUBCMD_GET_SAR_LIMITS. @@ -4784,6 +4790,7 @@ enum qca_vendor_attr_sar_limits { QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_CHAIN = 5, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_MODULATION = 6, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT = 7, + QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SPEC_POWER_LIMIT_INDEX = 8, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX = |
