diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-05-17 09:18:48 -0600 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2018-05-17 09:18:48 -0600 |
| commit | 0a0d3154df0baa90b349706b5b541940f0de3aa3 (patch) | |
| tree | d777a805cd27d9869e0e46226b66a87ee2e33782 | |
| parent | e0e82b3326813acf6956574264a1bfd44bc40258 (diff) | |
| parent | d05435169c6feaa6c141bf93975c192d0b8be2ba (diff) | |
Merge d05435169c6feaa6c141bf93975c192d0b8be2ba on remote branch
Change-Id: I4abeaee7d6b38dff15b9ba3430a48658512b65f1
439 files changed, 6269 insertions, 6571 deletions
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..fe22eb106753 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 * @@ -2781,7 +2772,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..651c9761004a 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 * @@ -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,6 +5705,7 @@ 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) { @@ -5629,6 +5713,11 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode 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 +5755,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 +6024,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 +6799,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 +9382,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 +9452,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 +9711,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 +10167,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 +10199,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..07f57651d375 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 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..9843a2dec05b 100644 --- a/core/dp/htt/htt_fw_stats.c +++ b/core/dp/htt/htt_fw_stats.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 htt_fw_stats.c * @brief Provide functions to process FW status retrieved from FW. 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..eb522855796f 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,23 +147,11 @@ 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}; 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; - } - qdf_spin_lock_bh(&(pdev->rx_ring.rx_hash_lock)); hash_table = pdev->rx_ring.hash_table; pdev->rx_ring.hash_table = NULL; @@ -190,12 +169,13 @@ static void htt_rx_hash_deinit(struct htt_pdev_t *pdev) if (qdf_mem_smmu_s1_enabled(pdev->osdev) && pdev->is_ipa_uc_enabled) { 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 +199,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 @@ -733,7 +706,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; diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index f017192e93b1..25921ed0e4db 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. @@ -994,8 +985,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 +998,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 +1017,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..65ad008dbf4e 100644 --- a/core/dp/htt/htt_types.h +++ b/core/dp/htt/htt_types.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_TYPES__H_ #define _HTT_TYPES__H_ 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..2d6698a9af6c 100644 --- a/core/dp/ol/inc/ol_htt_rx_api.h +++ b/core/dp/ol/inc/ol_htt_rx_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_rx_api.h * @brief Specify the rx HTT API functions called by the host data SW. 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..9529021bff86 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. */ 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..70b30c97bec9 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,31 @@ 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; + ol_tx_flow_pool_unlock(tx_desc); + + pkt_type_bitmap = cds_get_connectivity_stats_pkt_bitmap(osif_dev); - 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 +638,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 +731,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 +774,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, 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..1c44106ba72c 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. */ @@ -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; 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..865528047a0e 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,31 @@ 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> * roamscan_adaptive_dwell_mode - Sets dwell time adaptive mode * @Min: 0 * @Max: 4 @@ -6088,30 +6151,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 +7299,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 +8888,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> @@ -9175,6 +9331,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 +9459,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 +9739,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 @@ -10957,29 +11337,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 +12525,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 +12582,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 +13290,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 +14514,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 +14749,7 @@ enum hw_filter_mode { * gTxSchDelay - Enable/Disable Tx sch delay * @Min: 0 * @Max: 5 - * @Default: 2 + * @Default: 0 * * Usage: Internal/External * @@ -14365,7 +14759,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 +14777,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 +14843,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 +15187,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 +15350,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,6 +15408,10 @@ 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; @@ -15017,6 +15454,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 +15497,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 +15561,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 +15678,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 +15746,8 @@ struct hdd_config { #endif bool enable_rtt_mac_randomization; bool enable_ftopen; + bool is_unit_test_framework_enabled; + uint32_t enable_secondary_rate; }; #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..f2fe94abc210 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 */ /** 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..74e7139daaed 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,10 +403,27 @@ struct statsContext { unsigned int magic; }; -struct linkspeedContext { - struct completion completion; - hdd_adapter_t *pAdapter; +/** + * 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; + bool apf_enabled; + bool cmd_in_progress; + uint8_t *buf; + uint32_t buf_len; + uint32_t offset; + qdf_spinlock_t lock; }; /** @@ -438,12 +447,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 +1389,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 +1560,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 +1618,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) @@ -2150,7 +2151,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 +2236,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, @@ -3076,7 +3083,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 +3132,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..84c147b589a0 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__ @@ -331,9 +322,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 +362,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, 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..f599cd986827 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; + } - status = sme_get_apf_capabilities(hdd_ctx->hHal); + cookie = hdd_request_cookie(request); + + 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; + write_mem_params.vdev_id = adapter->sessionId; - qdf_spin_lock(&apf_context.lock); - apf_enabled = apf_context.apf_enabled; - qdf_spin_unlock(&apf_context.lock); - - 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,15 @@ 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); + 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 +466,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 +479,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 +502,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 +527,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 +538,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 +553,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 +607,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 +620,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 +665,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..f4ee2604f56c 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); @@ -2183,7 +2178,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; } diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 746a6ce9fd28..740a1bd478e8 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, @@ -3904,6 +3837,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 +4065,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 +4452,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 +4492,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 +5075,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 +5607,22 @@ 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), }; /** @@ -6326,8 +6373,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,12 +6611,6 @@ 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); @@ -7044,6 +7083,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 +7156,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 +7522,12 @@ 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); } /** @@ -9412,7 +9469,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 +9512,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 +9992,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 +10048,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 = @@ -10031,8 +10112,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..5c9f22d54a47 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,11 +1613,6 @@ 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; @@ -9879,6 +9865,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 +9943,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 +9978,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 +10327,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 +11193,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]) { @@ -18470,6 +18472,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 +18526,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); 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_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..3e23f4f54e03 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; @@ -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) && @@ -3937,11 +3917,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 +4585,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 +5263,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 +5336,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 +5597,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; @@ -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 @@ -7716,82 +7583,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 @@ -8168,7 +7959,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 +8360,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], @@ -8804,7 +8595,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); } @@ -9325,10 +9117,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..a0a2188ce63e 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> @@ -2395,6 +2386,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 +3016,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 +4840,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 +5206,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 +5224,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 +5247,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 +5384,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: @@ -6303,7 +6431,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; } @@ -7177,8 +7305,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 +7357,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 +7405,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..7368ef690351 100644 --- a/core/hdd/src/wlan_hdd_ioctl.h +++ b/core/hdd/src/wlan_hdd_ioctl.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. - */ - #if !defined(WLAN_HDD_IOCTL_H) #define WLAN_HDD_IOCTL_H diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 00022a92d97c..aed20b55a3ae 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; } @@ -1429,6 +1438,57 @@ 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; +} #else /* CONFIG_IPA_WDI_UNIFIED_API */ static inline void hdd_ipa_wdi_get_wdi_version(struct hdd_ipa_priv *hdd_ipa) { @@ -2047,7 +2107,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; } @@ -2649,6 +2710,70 @@ 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; +} #endif /* CONFIG_IPA_WDI_UNIFIED_API */ /** @@ -3269,7 +3394,7 @@ static void __hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason) hdd_context_t *hdd_ctx; struct hdd_ipa_priv *hdd_ipa; - if (!adapter) + if (hdd_validate_adapter(adapter)) return; hdd_ctx = (hdd_context_t *)adapter->pHddCtx; @@ -3325,7 +3450,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 +3486,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; @@ -3707,8 +3832,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 +3840,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 +3861,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, @@ -4364,7 +4471,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 +4678,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); @@ -5311,7 +5423,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 +5453,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 +5648,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 +5777,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 +5867,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 +6007,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 +6302,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 +6365,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 +6385,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; } @@ -6622,6 +6695,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, 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..4fec177e6d7c 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,6 +7240,9 @@ 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); } @@ -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: @@ -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); @@ -11993,7 +12107,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 +12320,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 +12576,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); @@ -13124,7 +13240,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..0b6dd22845ee 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 diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h index a6ee7fe760d6..2b3c0e098dd3 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 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..002237da943f 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 @@ -2843,6 +2834,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 +2843,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..18054844b3da 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 * @@ -753,9 +744,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, 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..5468457738c0 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" @@ -4089,18 +4087,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 +4941,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 +4989,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 +5045,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..3baf85e034f2 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); } @@ -1710,11 +1702,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 +1723,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 +1773,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 +1918,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 +2062,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 +4733,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 +4771,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,6 +4800,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, pAdapter->sessionId, oper)); status = wlan_hdd_validate_context(pHddCtx); + tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); if (0 != status) return status; @@ -5080,6 +5104,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 +5196,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..6bc2688dc313 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 * @@ -1055,6 +1046,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 */ diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index f987db26b0ed..105090af52de 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 */ @@ -3093,60 +3065,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 +3367,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 - * a &struct statsContext - * - * Return: None - */ -static void hdd_get_rssi_cb(int8_t rssi, uint32_t staId, void *pContext) -{ - struct statsContext *pStatsContext; - hdd_adapter_t *pAdapter; - hdd_station_ctx_t *pHddStaCtx; - - if (NULL == pContext) { - hdd_err("Bad param"); - return; - } - - pStatsContext = pContext; - pAdapter = pStatsContext->pAdapter; - - if (!pAdapter) { - hdd_err("Invalid pAdapter"); - 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 + * @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_snr_cb(int8_t snr, 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; + struct hdd_request *request; + struct rssi_priv *priv; - if (NULL == pContext) { - hdd_err("Bad param"); - return; - } + hdd_info("%s: rssi [%d] sta_id [%d] context [%pK]\n", + __func__, (int)rssi, (int)sta_id, context); - 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); + request = hdd_request_get(context); + if (!request) { + hdd_err("%s: Obsolete request", __func__); 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 +3409,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 +3449,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 +3502,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 +3545,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 +3573,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; - - 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) { + cookie = hdd_request_cookie(request); + priv = hdd_request_priv(request); + + 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; - } + 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; - /* 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 +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 errno; +return_cached_value: + *linkspeed = adapter->estimated_linkspeed; + + return ret; } /** @@ -3911,12 +3737,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; } @@ -4523,188 +4349,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 +5720,43 @@ 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) || (NULL == context)) { + hdd_err("Bad param, stats [%p] context [%p]", + stats, context); 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 +5769,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 +5788,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,37 +5802,30 @@ 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"); + 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; } - /* 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 + /* 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; } @@ -7576,10 +7205,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 +7220,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 +7250,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 +7445,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; @@ -8910,7 +8548,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 +8848,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 +9375,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 +9472,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; } @@ -12725,9 +12346,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 +12400,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 +12519,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 +12950,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 +13230,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..23416b72866a 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 * @@ -331,7 +322,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 +462,24 @@ hdd_wmm_disable_inactivity_timer(struct hdd_wmm_qos_context *pQosContext) return qdf_status; } +#else + +static void hdd_wmm_inactivity_timer_cb(void *user_data) +{ +} + +static QDF_STATUS +hdd_wmm_enable_inactivity_timer(struct hdd_wmm_qos_context *pQosContext, + uint32_t inactivity_time) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS +hdd_wmm_disable_inactivity_timer(struct hdd_wmm_qos_context *pQosContext) +{ + return QDF_STATUS_SUCCESS; +} #endif /* FEATURE_WLAN_ESE */ /** @@ -590,6 +605,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 +775,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 +822,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 +1225,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 +1389,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); @@ -2219,9 +2246,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 +2260,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 +2350,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..073a42a25d87 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 "S" +#define QWLAN_VERSION_BUILD 55 -#define QWLAN_VERSIONSTR "5.1.1.52R" +#define QWLAN_VERSIONSTR "5.1.1.55S" #endif /* QWLAN_VERSION_H */ diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 4873e98b3a87..4d8742f8a8ee 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 @@ -1334,6 +1325,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 +2896,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 +2923,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 { @@ -3651,6 +3691,9 @@ typedef struct sSirRoamOffloadScanReq { #endif struct scoring_param score_params; 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; } tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq; typedef struct sSirRoamOffloadScanRsp { @@ -7315,6 +7358,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 +7384,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 +7935,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..3f35924571d2 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. */ 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..19ec5ff22da9 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): + * Fri Apr 27 15:42:09 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..74453a551778 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. * @@ -1559,12 +1550,11 @@ lim_detect_change_in_ap_capabilities(tpAniSirGlobal pMac, 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"); 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..4dc5d3810587 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" @@ -634,6 +625,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; } @@ -2277,7 +2276,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 +2385,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..e38ab686f434 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" @@ -3066,7 +3057,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) { 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..e8c256b23f2f 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, @@ -2600,11 +2599,16 @@ 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"); + lim_send_disconnect_done_ind(pMac, NULL, CSR_SESSION_ID_INVALID, + eSIR_SME_INVALID_SESSION, NULL); return; } if (!lim_is_sme_disassoc_cnf_valid(pMac, &smeDisassocCnf, psessionEntry)) { pe_err("received invalid SME_DISASSOC_CNF message"); + lim_send_disconnect_done_ind(pMac, psessionEntry, sessionId, + eSIR_SME_INVALID_PARAMETERS, + smeDisassocCnf.bssid.bytes); return; } #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ @@ -2628,6 +2632,11 @@ static void __lim_process_sme_disassoc_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBu psessionEntry->limSmeState); lim_print_sme_state(pMac, LOGE, psessionEntry->limSmeState); + lim_send_disconnect_done_ind(pMac, psessionEntry, + sessionId, + eSIR_SME_INVALID_STATE, + smeDisassocCnf.bssid. + bytes); return; } break; @@ -2640,7 +2649,9 @@ 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)); - + lim_send_disconnect_done_ind(pMac, psessionEntry, sessionId, + eSIR_SME_INVALID_STATE, + smeDisassocCnf.bssid.bytes); return; } @@ -2654,6 +2665,10 @@ 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)); + lim_send_disconnect_done_ind(pMac, psessionEntry, + sessionId, + eSIR_SME_INVALID_PARAMETERS, + smeDisassocCnf.bssid.bytes); return; } @@ -2664,6 +2679,9 @@ static void __lim_process_sme_disassoc_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBu 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); + lim_send_disconnect_done_ind(pMac, NULL, + CSR_SESSION_ID_INVALID, + eSIR_SME_SUCCESS, NULL); return; } @@ -2749,6 +2767,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: 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..dca2356a8249 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,6 @@ 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; pe_debug("Disassoc Ntf with trigger : %d reasonCode: %d", disassocTrigger, reasonCode); @@ -985,37 +975,9 @@ 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"); - 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; + lim_send_disconnect_done_ind(pMac, psessionEntry, smesessionId, + reasonCode, peerMacAddr); + return; default: /** @@ -1371,6 +1333,51 @@ void lim_send_sme_tdls_event_notify(tpAniSirGlobal pMac, uint16_t msgType, } #endif /* FEATURE_WLAN_TDLS */ +void lim_send_disconnect_done_ind(tpAniSirGlobal mac_ctx, + tpPESession session_entry, uint8_t session_id, + tSirResultCodes reason_code, + tSirMacAddr peer_mac_addr) +{ + struct sir_sme_discon_done_ind *sir_sme_dis_ind; + uint32_t *msg; + + 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"); + return; + } + + pe_debug("send 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; + 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; + + /*Delete the PE session created */ + if (session_entry) + pe_delete_session(mac_ctx, session_entry); + + lim_send_sme_disassoc_deauth_ntf(mac_ctx, QDF_STATUS_SUCCESS, + (uint32_t *)msg); +} + /** * lim_send_sme_deauth_ntf() * @@ -1410,7 +1417,6 @@ lim_send_sme_deauth_ntf(tpAniSirGlobal pMac, tSirMacAddr peerMacAddr, tpPESession psessionEntry; uint8_t sessionId; uint32_t *pMsg; - struct sir_sme_discon_done_ind *sir_sme_dis_ind; psessionEntry = pe_find_session_by_bssid(pMac, peerMacAddr, &sessionId); switch (deauthTrigger) { @@ -1446,38 +1452,9 @@ 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"); - 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; - + lim_send_disconnect_done_ind(pMac, psessionEntry, smesessionId, + reasonCode, peerMacAddr); + return; default: /** * Deauthentication indication due to Deauthentication @@ -2244,10 +2221,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..2fd11c6d488e 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,10 @@ 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); +void lim_send_disconnect_done_ind(tpAniSirGlobal mac_ctx, + tpPESession session_entry, uint8_t session_id, + tSirResultCodes reason_code, + tSirMacAddr 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..10d095a7dd41 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 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..450dabd0a372 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) { 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..bbac0a6e0b78 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): + * Fri Apr 27 15:42:09 2018 from the following file(s): * * dot11f.frms * @@ -823,6 +814,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 +838,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 +898,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 +924,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 +1028,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 +1063,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 +1095,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 +1121,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 +1148,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 +1208,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 +1243,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 +1310,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 +1330,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 +1364,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 +1391,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 +1431,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 +1461,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 +1486,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 +1508,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 +1540,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 +1568,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 +1613,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 +1678,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 +1700,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 +1731,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 +1778,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 +1806,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 +1828,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 +1854,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 +1880,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 +1914,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 +1945,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 +1959,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 +1973,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 +1983,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 +1995,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 +2070,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 +2080,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 +2120,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 +2246,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 +2275,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 +2297,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 +2328,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 +2342,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 +2461,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 +2487,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 +2531,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 +2572,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 +2582,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 +2592,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 +2632,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 +2642,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 +2768,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 +2794,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 +2804,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 +2826,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 +2836,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 +2861,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 +2871,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 +2885,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 +3001,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 +3035,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 +3057,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 +3108,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 +3127,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 +3137,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 +3187,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 +3209,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 +3256,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 +3278,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 +3343,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 +3419,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 +3466,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 +3488,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 +3512,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 +3536,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 +3560,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 +3591,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 +3643,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 +3673,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 +3707,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 +3738,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 +3766,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 +3876,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 +3916,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 +3944,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 +4013,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 +4070,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 +4090,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 +4116,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 +4138,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 +4180,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 +4197,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 +4208,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 +4221,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 +4252,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 +4274,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 +4387,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 +4403,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 +4414,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 +4446,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 +4701,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 +4719,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 +4832,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 +4847,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 +4887,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 +4947,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 +4966,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 +4976,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 +5026,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 +5085,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 +5401,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 +5430,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 +5457,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 +5485,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 +5507,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 +5541,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 +5563,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 +5592,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 +5620,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 +5674,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 +5714,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 +5810,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 +5839,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 +5862,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 +5874,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 +5899,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 +5911,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 +5935,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 +5953,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 +5965,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 +5985,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 +6013,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 +6143,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 +6186,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 +6232,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 +6266,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 +6294,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 +6377,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 +6387,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 +6404,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 +6421,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 +6439,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 +6498,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 +6552,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 +6562,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 +6590,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 +6622,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 +6665,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 +6675,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 +6697,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 +6721,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 +6745,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 +6769,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 +6799,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 +6816,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 +6828,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 +6850,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 +6871,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 +7413,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 +7439,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 +7479,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 +7501,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 +7534,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 +7569,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 +7615,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 +7637,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 +7663,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 +7726,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 +7741,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 +7777,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 +7805,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 +7856,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 +7893,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 +16288,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 +17260,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 +17506,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 +17543,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 +17728,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 +18162,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 +18178,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 +18190,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 +18204,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 +18217,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 +18314,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 +18564,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 +18574,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 +18584,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 +18683,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 +18696,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 +18709,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 +18799,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 +19069,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 +19079,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 +19089,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 +19273,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 +19285,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 +19678,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 +19688,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 +19703,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 +19713,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 +19728,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 +19738,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 +19753,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 +19763,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 +19805,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 +19890,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 +20290,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 +20359,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 +20370,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 +20386,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 +20410,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 +20426,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 +20474,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 +20487,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 +20502,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 +20667,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 +20696,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 +20769,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 +20843,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 +20976,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 +21025,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 +21037,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 +21142,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 +21635,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 +21846,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 +21888,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 +22565,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 +22736,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 +22787,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 +22842,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 +22907,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 +22917,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 +22932,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 +22942,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 +22957,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 +22967,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 +22982,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 +22992,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 +23711,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 +23985,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 +24042,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..4b041a0538f3 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 */ 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..8ee0432c3c4c 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, 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..24830a537c5b 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 @@ -3236,8 +3227,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..a618477fbe33 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 * @@ -1311,6 +1302,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 +1339,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 +1381,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; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 62ed7329ee8e..15a569442108 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 * @@ -612,6 +603,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 +655,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; @@ -1035,6 +1037,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; 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..77d9c3458590 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 * diff --git a/core/sme/inc/csr_support.h b/core/sme/inc/csr_support.h index db47ec47c13f..3ded42774efd 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 * 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..203754ebbe83 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 @@ -1421,12 +1412,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. 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..f4fdcd090931 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; @@ -9795,13 +9820,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 +9944,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 +10052,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 +10280,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 +10412,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 +10448,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; } @@ -13739,13 +13767,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,7 +15555,7 @@ 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; } @@ -16374,13 +16403,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 +16810,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 +16821,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 +17470,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; } 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..397ee9611781 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. @@ -2829,6 +2820,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 +2918,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 +2981,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 = @@ -3167,6 +3188,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 +3276,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 +3328,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 = @@ -3325,6 +3366,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; } @@ -3944,8 +3992,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 +6246,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 +7678,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 +11673,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 @@ -12977,7 +13028,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 +13063,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 +13090,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 +15156,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 +15619,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 +15706,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 +15718,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 +17408,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 +17426,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 +18905,11 @@ 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; if (wlan_cfg_get_int(mac_ctx, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT, (uint32_t *) &req_buf->ReassocFailureTimeout) != eSIR_SUCCESS) { @@ -22036,6 +22611,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..54fa7e4eb78c 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. @@ -3849,12 +3840,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); } 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..2ccd04418df8 100644 --- a/core/sme/src/csr/csr_roam_preauth.c +++ b/core/sme/src/csr/csr_roam_preauth.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/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..1d63d770535a 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. 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..0fc587cba031 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 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..8ca83bc09ed2 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" 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..defcaae9ddbb 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,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(__HOST_DIAG_CORE_EVENT_H) #define __HOST_DIAG_CORE_EVENT_H 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..7ce94d9723a2 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,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 EVENT_DEFS_H #define EVENT_DEFS_H 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..8cbde65201ee 100644 --- a/core/utils/host_diag_log/src/host_diag_log.c +++ b/core/utils/host_diag_log/src/host_diag_log.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: host_diag_log.c 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..0799ba35429b 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,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_EVENT_H) #define __I_HOST_DIAG_CORE_EVENT_H 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..f312de5411a2 100644 --- a/core/utils/logging/src/wlan_logging_sock_svc.c +++ b/core/utils/logging/src/wlan_logging_sock_svc.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. - */ - /****************************************************************************** * wlan_logging_sock_svc.c * 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..c2bbadb66ec8 100644 --- a/core/utils/ptt/src/wlan_ptt_sock_svc.c +++ b/core/utils/ptt/src/wlan_ptt_sock_svc.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_ptt_sock_svc.c * 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..000c0e9b19f6 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; } @@ -3145,6 +3170,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"), @@ -3381,15 +3411,25 @@ 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) + if (wma_crash_on_fw_timeout(wma->fw_timeout_crash) == true) { QDF_BUG(0); - else + } 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)); @@ -3465,6 +3505,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 +5060,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 +5612,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..c319e4392e93 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, @@ -3774,22 +3765,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 +3849,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 +4292,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 +4304,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 +4325,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 +4340,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 +4365,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 +4380,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 +4397,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 +4411,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 +4436,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 +8214,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 +9174,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 +9837,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 +9876,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 +9900,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) { @@ -10150,6 +10205,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 +10935,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 +11468,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..85a307a60bbc 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; @@ -3220,7 +3230,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 +3554,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 +4839,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 +5162,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 +6031,16 @@ static void wma_populate_soc_caps(t_wma_handle *wma_handle, wma_cleanup_dbs_phy_caps(wma_handle); return; } + + 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 +8165,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..5cd7de492138 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 * @@ -3724,7 +3715,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 +3723,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..ba839090d750 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,23 +381,33 @@ 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( - scan_req->maxChannelTime, - wma_handle->miracast_value); + 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); + } break; } if (wma_is_sta_active(wma_handle) || wma_is_p2p_cli_active(wma_handle)) { - 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; + 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; + } break; } if (wma_is_ndi_active(wma_handle)) { @@ -433,6 +434,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 +453,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 +500,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 +965,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 +987,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 +1002,10 @@ 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); status = wmi_unified_roam_scan_offload_mode_cmd(wma_handle->wmi_handle, scan_cmd_fp, params); @@ -2726,7 +2749,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); @@ -3840,7 +3872,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 +5277,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 +5314,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 +6360,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); } } diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index f575c06e9251..32553342c66f 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. @@ -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 */ } 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 = |
