Browse Source

Initial host-common file folder cleanup and moves

Initial host-common file folder cleanup and moves
on top of baseline reference of MCL WLAN driver
SU#5.0.0.160.

Move dp, ht comm, hif, wmi and qdf folders one level up

Change-Id: I2120898024b1eafd5d651c48768dbf48bf05995d
Prakash Dhavali 9 years ago
parent
commit
142cee4bf2
100 changed files with 0 additions and 117455 deletions
  1. 0 114
      Android.mk
  2. 0 1345
      Kbuild
  3. 0 114
      Kconfig
  4. 0 20
      Makefile
  5. 0 594
      config/WCNSS_qcom_cfg.ini
  6. 0 60
      core/bmi/inc/bmi.h
  7. 0 64
      core/bmi/inc/ol_fw.h
  8. 0 87
      core/bmi/inc/ol_if_athvar.h
  9. 0 469
      core/bmi/src/bmi.c
  10. 0 321
      core/bmi/src/bmi_1.c
  11. 0 452
      core/bmi/src/bmi_2.c
  12. 0 607
      core/bmi/src/i_ar6320v2_regtable.h
  13. 0 149
      core/bmi/src/i_bmi.h
  14. 0 1638
      core/bmi/src/ol_fw.c
  15. 0 243
      core/cds/inc/cds_api.h
  16. 0 657
      core/cds/inc/cds_concurrency.h
  17. 0 182
      core/cds/inc/cds_crypto.h
  18. 0 2105
      core/cds/inc/cds_ieee80211_common.h
  19. 0 1374
      core/cds/inc/cds_ieee80211_defines.h
  20. 0 238
      core/cds/inc/cds_if_upperproto.h
  21. 0 165
      core/cds/inc/cds_mq.h
  22. 0 111
      core/cds/inc/cds_pack_align.h
  23. 0 188
      core/cds/inc/cds_packet.h
  24. 0 33
      core/cds/inc/cds_queue.h
  25. 0 346
      core/cds/inc/cds_reg_service.h
  26. 0 1082
      core/cds/inc/cds_regdomain.h
  27. 0 2220
      core/cds/inc/cds_regdomain_common.h
  28. 0 443
      core/cds/inc/cds_sched.h
  29. 0 189
      core/cds/inc/cds_utils.h
  30. 0 1984
      core/cds/src/cds_api.c
  31. 0 7849
      core/cds/src/cds_concurrency.c
  32. 0 545
      core/cds/src/cds_ieee80211_common_i.h
  33. 0 215
      core/cds/src/cds_mq.c
  34. 0 345
      core/cds/src/cds_packet.c
  35. 0 1190
      core/cds/src/cds_reg_service.c
  36. 0 743
      core/cds/src/cds_regdomain.c
  37. 0 1282
      core/cds/src/cds_sched.c
  38. 0 1139
      core/cds/src/cds_utils.c
  39. 0 98
      core/cds/src/i_cds_packet.h
  40. 0 571
      core/cds/src/queue.h
  41. 0 253
      core/hdd/inc/qc_sap_ioctl.h
  42. 0 264
      core/hdd/inc/wlan_hdd_assoc.h
  43. 0 3611
      core/hdd/inc/wlan_hdd_cfg.h
  44. 0 79
      core/hdd/inc/wlan_hdd_conc_ut.h
  45. 0 44
      core/hdd/inc/wlan_hdd_debugfs.h
  46. 0 39
      core/hdd/inc/wlan_hdd_driver_ops.h
  47. 0 89
      core/hdd/inc/wlan_hdd_ether.h
  48. 0 68
      core/hdd/inc/wlan_hdd_ftm.h
  49. 0 60
      core/hdd/inc/wlan_hdd_host_offload.h
  50. 0 69
      core/hdd/inc/wlan_hdd_includes.h
  51. 0 171
      core/hdd/inc/wlan_hdd_ipa.h
  52. 0 145
      core/hdd/inc/wlan_hdd_lro.h
  53. 0 1529
      core/hdd/inc/wlan_hdd_main.h
  54. 0 92
      core/hdd/inc/wlan_hdd_memdump.h
  55. 0 190
      core/hdd/inc/wlan_hdd_mib.h
  56. 0 39
      core/hdd/inc/wlan_hdd_misc.h
  57. 0 59
      core/hdd/inc/wlan_hdd_nan.h
  58. 0 82
      core/hdd/inc/wlan_hdd_napi.h
  59. 0 175
      core/hdd/inc/wlan_hdd_oemdata.h
  60. 0 144
      core/hdd/inc/wlan_hdd_p2p.h
  61. 0 174
      core/hdd/inc/wlan_hdd_power.h
  62. 0 94
      core/hdd/inc/wlan_hdd_softap_tx_rx.h
  63. 0 628
      core/hdd/inc/wlan_hdd_tdls.h
  64. 0 147
      core/hdd/inc/wlan_hdd_trace.h
  65. 0 137
      core/hdd/inc/wlan_hdd_tx_rx.h
  66. 0 371
      core/hdd/inc/wlan_hdd_wext.h
  67. 0 404
      core/hdd/inc/wlan_hdd_wmm.h
  68. 0 183
      core/hdd/inc/wlan_hdd_wowl.h
  69. 0 5491
      core/hdd/src/wlan_hdd_assoc.c
  70. 0 6893
      core/hdd/src/wlan_hdd_cfg.c
  71. 0 11325
      core/hdd/src/wlan_hdd_cfg80211.c
  72. 0 2404
      core/hdd/src/wlan_hdd_cfg80211.h
  73. 0 863
      core/hdd/src/wlan_hdd_conc_ut.c
  74. 0 654
      core/hdd/src/wlan_hdd_debugfs.c
  75. 0 924
      core/hdd/src/wlan_hdd_driver_ops.c
  76. 0 4631
      core/hdd/src/wlan_hdd_ext_scan.c
  77. 0 127
      core/hdd/src/wlan_hdd_ext_scan.h
  78. 0 1037
      core/hdd/src/wlan_hdd_ftm.c
  79. 0 492
      core/hdd/src/wlan_hdd_green_ap.c
  80. 0 58
      core/hdd/src/wlan_hdd_green_ap.h
  81. 0 8320
      core/hdd/src/wlan_hdd_hostapd.c
  82. 0 116
      core/hdd/src/wlan_hdd_hostapd.h
  83. 0 6428
      core/hdd/src/wlan_hdd_ioctl.c
  84. 0 39
      core/hdd/src/wlan_hdd_ioctl.h
  85. 0 4199
      core/hdd/src/wlan_hdd_ipa.c
  86. 0 659
      core/hdd/src/wlan_hdd_lro.c
  87. 0 7000
      core/hdd/src/wlan_hdd_main.c
  88. 0 637
      core/hdd/src/wlan_hdd_memdump.c
  89. 0 193
      core/hdd/src/wlan_hdd_nan.c
  90. 0 273
      core/hdd/src/wlan_hdd_napi.c
  91. 0 1997
      core/hdd/src/wlan_hdd_ocb.c
  92. 0 292
      core/hdd/src/wlan_hdd_ocb.h
  93. 0 811
      core/hdd/src/wlan_hdd_oemdata.c
  94. 0 2396
      core/hdd/src/wlan_hdd_p2p.c
  95. 0 2325
      core/hdd/src/wlan_hdd_power.c
  96. 0 2417
      core/hdd/src/wlan_hdd_scan.c
  97. 0 72
      core/hdd/src/wlan_hdd_scan.h
  98. 0 919
      core/hdd/src/wlan_hdd_softap_tx_rx.c
  99. 0 2343
      core/hdd/src/wlan_hdd_stats.c
  100. 0 209
      core/hdd/src/wlan_hdd_stats.h

+ 0 - 114
Android.mk

@@ -1,114 +0,0 @@
-# Android makefile for the WLAN Module
-
-# Assume no targets will be supported
-WLAN_CHIPSET :=
-
-ifeq ($(BOARD_HAS_QCOM_WLAN), true)
-
-# Build/Package options for 8084/8092/8960/8992/8994 target
-ifeq ($(call is-board-platform-in-list, apq8084 mpq8092 msm8960 msm8992 msm8994 msm8996 msm8998),true)
-	WLAN_CHIPSET := qca_cld3
-	WLAN_SELECT  := CONFIG_QCA_CLD_WLAN=m
-endif # platform
-
-# Build/Package only in case of supported target
-ifneq ($(WLAN_CHIPSET),)
-
-LOCAL_PATH := $(call my-dir)
-
-# This makefile is only for DLKM
-ifneq ($(findstring vendor,$(LOCAL_PATH)),)
-
-ifneq ($(findstring opensource,$(LOCAL_PATH)),)
-    WLAN_PROPRIETARY := 0
-    WLAN_BLD_DIR := vendor/qcom/opensource/wlan
-else
-    WLAN_PROPRIETARY := 1
-    WLAN_BLD_DIR := vendor/qcom/proprietary/wlan-noship
-endif # opensource
-
-# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
-ifeq ($(call is-platform-sdk-version-at-least,16),true)
-       DLKM_DIR := $(TOP)/device/qcom/common/dlkm
-else
-       DLKM_DIR := build/dlkm
-endif # platform-sdk-version
-
-# Copy WCNSS_cfg.dat and WCNSS_qcom_cfg.ini file from firmware_bin/ folder to target out directory.
-ifeq ($(call is-board-platform-in-list, msm8960),true)
-$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/WCNSS_cfg.dat)
-$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini)
-$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/qca_cld)
-$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_qcom_cfg.ini $(TARGET_OUT_ETC)/firmware/wlan/qca_cld)
-endif
-
-# Build wlan.ko as $(WLAN_CHIPSET)_wlan.ko
-###########################################################
-# This is set once per LOCAL_PATH, not per (kernel) module
-ifeq ($(WLAN_PROPRIETARY),1)
-	KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/qcacld-new
-else
-	KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/qcacld-3.0
-endif # WLAN_PROPRIETARY
-# We are actually building wlan.ko here, as per the
-# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
-# This means we need to rename the module to <chipset>_wlan.ko
-# after wlan.ko is built.
-KBUILD_OPTIONS += MODNAME=wlan
-KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
-KBUILD_OPTIONS += $(WLAN_SELECT)
-
-include $(CLEAR_VARS)
-ifeq ($(WLAN_PROPRIETARY),1)
-	LOCAL_MODULE              := proprietary_$(WLAN_CHIPSET)_wlan.ko
-else
-	LOCAL_MODULE              := $(WLAN_CHIPSET)_wlan.ko
-endif # WLAN_PROPRIETARY
-LOCAL_MODULE_KBUILD_NAME  := wlan.ko
-LOCAL_MODULE_TAGS         := debug
-LOCAL_MODULE_DEBUG_ENABLE := true
-LOCAL_MODULE_PATH         := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
-include $(DLKM_DIR)/AndroidKernelModule.mk
-###########################################################
-
-# Create Symbolic link
-ifeq ($(WLAN_PROPRIETARY),1)
-$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
-        ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) \
-               $(TARGET_OUT)/lib/modules/wlan.ko)
-endif
-$(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin)
-
-ifeq ($(call is-board-platform-in-list, msm8960),true)
-$(shell ln -sf /firmware/image/bdwlan20.bin $(TARGET_OUT_ETC)/firmware/fakeboar.bin)
-$(shell ln -sf /firmware/image/otp20.bin $(TARGET_OUT_ETC)/firmware/otp.bin)
-$(shell ln -sf /firmware/image/utf20.bin $(TARGET_OUT_ETC)/firmware/utf.bin)
-$(shell ln -sf /firmware/image/qwlan20.bin $(TARGET_OUT_ETC)/firmware/athwlan.bin)
-
-$(shell ln -sf /firmware/image/bdwlan20.bin $(TARGET_OUT_ETC)/firmware/bdwlan20.bin)
-$(shell ln -sf /firmware/image/otp20.bin $(TARGET_OUT_ETC)/firmware/otp20.bin)
-$(shell ln -sf /firmware/image/utf20.bin $(TARGET_OUT_ETC)/firmware/utf20.bin)
-$(shell ln -sf /firmware/image/qwlan20.bin $(TARGET_OUT_ETC)/firmware/qwlan20.bin)
-
-$(shell ln -sf /firmware/image/bdwlan30.bin $(TARGET_OUT_ETC)/firmware/bdwlan30.bin)
-$(shell ln -sf /firmware/image/otp30.bin $(TARGET_OUT_ETC)/firmware/otp30.bin)
-$(shell ln -sf /firmware/image/utf30.bin $(TARGET_OUT_ETC)/firmware/utf30.bin)
-$(shell ln -sf /firmware/image/qwlan30.bin $(TARGET_OUT_ETC)/firmware/qwlan30.bin)
-endif
-
-# Copy config ini files to target
-#ifeq ($(call is-board-platform-in-list, msm8992 msm8994),false)
-ifeq ($(WLAN_PROPRIETARY),1)
-$(shell mkdir -p $(TARGET_OUT)/etc/firmware/wlan/$(WLAN_CHIPSET))
-$(shell mkdir -p $(TARGET_OUT)/etc/wifi)
-$(shell rm -f $(TARGET_OUT)/etc/wifi/WCNSS_qcom_cfg.ini)
-$(shell rm -f $(TARGET_OUT)/etc/firmware/wlan/$(WLAN_SHIPSET)/WCNSS_cfg.dat)
-$(shell cp $(LOCAL_PATH)/config/WCNSS_qcom_cfg.ini $(TARGET_OUT)/etc/wifi)
-$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT)/etc/firmware/wlan/$(WLAN_CHIPSET))
-endif
-#endif
-
-endif # DLKM check
-
-endif # supported target check
-endif # WLAN enabled check

+ 0 - 1345
Kbuild

@@ -1,1345 +0,0 @@
-# We can build either as part of a standalone Kernel build or as
-# an external module.  Determine which mechanism is being used
-ifeq ($(MODNAME),)
-	KERNEL_BUILD := 1
-else
-	KERNEL_BUILD := 0
-endif
-
-ifeq ($(CONFIG_CNSS), y)
-ifndef CONFIG_ROME_IF
-	#use pci as default interface
-	CONFIG_ROME_IF = pci
-endif
-endif
-
-ifeq ($(KERNEL_BUILD),1)
-	# These are provided in external module based builds
-	# Need to explicitly define for Kernel-based builds
-	MODNAME := wlan
-	WLAN_ROOT := drivers/staging/qcacld-3.0
-endif
-
-# Make WLAN as open-source driver by default
-WLAN_OPEN_SOURCE := 1
-
-ifeq ($(KERNEL_BUILD), 0)
-	# These are configurable via Kconfig for kernel-based builds
-	# Need to explicitly configure for Android-based builds
-
-	ifeq ($(CONFIG_ARCH_MDM9630), y)
-	CONFIG_MOBILE_ROUTER := y
-	endif
-
-	ifeq ($(CONFIG_ARCH_MDM9640), y)
-	CONFIG_MOBILE_ROUTER := y
-	endif
-
-	#Flag to enable Legacy Fast Roaming3(LFR3)
-	CONFIG_QCACLD_WLAN_LFR3 := y
-
-	#JB kernel has PMKSA patches, hence enabling this flag
-	CONFIG_PRIMA_WLAN_OKC := y
-
-	# JB kernel has CPU enablement patches, so enable
-	ifeq ($(CONFIG_ROME_IF),pci)
-		CONFIG_PRIMA_WLAN_11AC_HIGH_TP := y
-	endif
-	ifeq ($(CONFIG_ROME_IF),usb)
-		CONFIG_PRIMA_WLAN_11AC_HIGH_TP := n
-	endif
-	ifeq ($(CONFIG_ROME_IF),sdio)
-		CONFIG_PRIMA_WLAN_11AC_HIGH_TP := n
-	endif
-
-	ifneq ($(CONFIG_MOBILE_ROUTER), y)
-	#Flag to enable TDLS feature
-	CONFIG_QCOM_TDLS := y
-	endif
-
-	ifeq ($(CONFIG_MOBILE_ROUTER), y)
-	CONFIG_QCACLD_FEATURE_GREEN_AP := y
-	endif
-
-	#Flag to enable Fast Transition (11r) feature
-	CONFIG_QCOM_VOWIFI_11R := y
-
-	ifneq ($(CONFIG_QCA_CLD_WLAN),)
-	        ifeq ($(CONFIG_CNSS),y)
-		#Flag to enable Protected Managment Frames (11w) feature
-		CONFIG_WLAN_FEATURE_11W := y
-		#Flag to enable LTE CoEx feature
-		CONFIG_QCOM_LTE_COEX := y
-			ifneq ($(CONFIG_MOBILE_ROUTER), y)
-			#Flag to enable LPSS feature
-			CONFIG_WLAN_FEATURE_LPSS := y
-			endif
-		endif
-	endif
-
-
-        #Flag to enable Protected Managment Frames (11w) feature
-        ifeq ($(CONFIG_ROME_IF),usb)
-                CONFIG_WLAN_FEATURE_11W := y
-        endif
-        ifeq ($(CONFIG_ROME_IF),sdio)
-                CONFIG_WLAN_FEATURE_11W := y
-        endif
-
-	ifneq ($(CONFIG_MOBILE_ROUTER), y)
-		#Flag to enable NAN
-		CONFIG_QCACLD_FEATURE_NAN := y
-	endif
-
-        #Flag to enable Linux QCMBR feature as default feature
-        ifeq ($(CONFIG_ROME_IF),usb)
-                CONFIG_LINUX_QCMBR :=y
-        endif
-
-        ifeq ($(CONFIG_CNSS_EOS),y)
-        CONFIG_FEATURE_BMI_2 :=y
-        endif
-
-	CONFIG_MPC_UT_FRAMEWORK := y
-
-	#Flag to enable offload packets feature
-	CONFIG_WLAN_OFFLOAD_PACKETS := y
-
-	#Flag to enable memdump feature
-	CONFIG_WLAN_FEATURE_MEMDUMP := y
-
-	#Flag to enable Fast Path feature
-	CONFIG_WLAN_FASTPATH := y
-
-	# Flag to enable NAPI
-	CONFIG_WLAN_NAPI := y
-	CONFIG_WLAN_NAPI_DEBUG := n
-
-	# Flag to enable FW based TX Flow control
-	ifeq ($(CONFIG_CNSS_EOS),y)
-		CONFIG_WLAN_TX_FLOW_CONTROL_V2 := y
-	else
-		CONFIG_WLAN_TX_FLOW_CONTROL_V2 := n
-	endif
-
-	# Flag to enable LRO (Large Receive Offload)
-	ifeq ($(CONFIG_CNSS_EOS), y)
-		ifeq ($(CONFIG_INET_LRO), y)
-			CONFIG_WLAN_LRO := y
-		else
-			CONFIG_WLAN_LRO := n
-		endif
-	endif
-
-	# Flag to enable LFR Subnet Detection
-	CONFIG_LFR_SUBNET_DETECTION := y
-endif
-
-ifneq ($(CONFIG_MOBILE_ROUTER), y)
-# To enable ESE upload, dependent config
-# CONFIG_QCOM_ESE must be enabled.
-CONFIG_QCOM_ESE := y
-CONFIG_QCOM_ESE_UPLOAD := y
-endif
-
-# Feature flags which are not (currently) configurable via Kconfig
-
-#Whether to build debug version
-BUILD_DEBUG_VERSION := 1
-
-#Enable this flag to build driver in diag version
-BUILD_DIAG_VERSION := 1
-
-#Do we panic on bug?  default is to warn
-PANIC_ON_BUG := 1
-
-#Enable OL debug and wmi unified functions
-CONFIG_ATH_PERF_PWR_OFFLOAD := 1
-
-#Disable packet log
-CONFIG_REMOVE_PKT_LOG := 0
-
-#Enable 11AC TX
-ifeq ($(CONFIG_ROME_IF),pci)
-	CONFIG_ATH_11AC_TXCOMPACT := 1
-endif
-ifeq ($(CONFIG_ROME_IF),usb)
-	CONFIG_ATH_11AC_TXCOMPACT := 0
-endif
-
-#Enable OS specific IRQ abstraction
-CONFIG_ATH_SUPPORT_SHARED_IRQ := 1
-
-#Enable message based HIF instead of RAW access in BMI
-ifeq ($(CONFIG_QCA_WIFI_SDIO), 1)
-CONFIG_HIF_MESSAGE_BASED := 0
-else
-CONFIG_HIF_MESSAGE_BASED := 1
-endif
-
-#Enable PCI specific APIS (dma, etc)
-ifeq ($(CONFIG_ROME_IF),pci)
-	CONFIG_HIF_PCI := 1
-endif
-
-#Enable pci read/write config functions
-ifeq ($(CONFIG_ROME_IF),pci)
-	CONFIG_ATH_PCI := 1
-endif
-ifeq ($(CONFIG_ROME_IF),usb)
-#CONFIG_ATH_PCI := 1
-endif
-
-ifneq ($(CONFIG_MOBILE_ROUTER), y)
-#Enable IBSS support on CLD
-CONFIG_QCA_IBSS_SUPPORT := 1
-endif
-
-#Enable power management suspend/resume functionality to PCI
-CONFIG_ATH_BUS_PM := 1
-
-#Enable FLOWMAC module support
-CONFIG_ATH_SUPPORT_FLOWMAC_MODULE := 0
-
-#Enable spectral support
-CONFIG_ATH_SUPPORT_SPECTRAL := 0
-
-#Enable HOST statistics support
-CONFIG_SUPPORT_HOST_STATISTICS := 0
-
-#Enable WDI Event support
-CONFIG_WDI_EVENT_ENABLE := 1
-
-#Endianess selection
-CONFIG_LITTLE_ENDIAN := 1
-
-#Enable TX reclaim support
-CONFIG_TX_CREDIT_RECLAIM_SUPPORT := 0
-
-#Enable FTM support
-CONFIG_QCA_WIFI_FTM := 1
-
-#Enable Checksum Offload
-CONFIG_CHECKSUM_OFFLOAD := 1
-
-#Enable GTK offload
-CONFIG_GTK_OFFLOAD := 1
-
-#Enable EXT WOW
-ifeq ($(CONFIG_ROME_IF),pci)
-	CONFIG_EXT_WOW := 1
-endif
-
-#Set this to 1 to catch erroneous Target accesses during debug.
-CONFIG_ATH_PCIE_ACCESS_DEBUG := 0
-
-#Enable IPA offload
-ifeq ($(CONFIG_IPA), y)
-CONFIG_IPA_OFFLOAD := 1
-endif
-
-#Enable Signed firmware support for split binary format
-CONFIG_QCA_SIGNED_SPLIT_BINARY_SUPPORT := 0
-
-#Enable single firmware binary format
-CONFIG_QCA_SINGLE_BINARY_SUPPORT := 0
-
-#Enable collecting target RAM dump after kernel panic
-CONFIG_TARGET_RAMDUMP_AFTER_KERNEL_PANIC := 1
-
-#Flag to enable/disable secure firmware feature
-CONFIG_FEATURE_SECURE_FIRMWARE := 0
-
-#Flag to enable Stats Ext implementation
-CONFIG_FEATURE_STATS_EXT := 1
-
-ifeq ($(CONFIG_CFG80211),y)
-HAVE_CFG80211 := 1
-else
-ifeq ($(CONFIG_CFG80211),m)
-HAVE_CFG80211 := 1
-else
-HAVE_CFG80211 := 0
-endif
-endif
-
-############ UAPI ############
-UAPI_DIR :=	uapi
-UAPI_INC :=	-I$(WLAN_ROOT)/$(UAPI_DIR)/linux
-
-############ COMMON ############
-COMMON_DIR :=	core/common
-COMMON_INC :=	-I$(WLAN_ROOT)/$(COMMON_DIR)
-
-############ HDD ############
-HDD_DIR :=	core/hdd
-HDD_INC_DIR :=	$(HDD_DIR)/inc
-HDD_SRC_DIR :=	$(HDD_DIR)/src
-
-HDD_INC := 	-I$(WLAN_ROOT)/$(HDD_INC_DIR) \
-		-I$(WLAN_ROOT)/$(HDD_SRC_DIR)
-
-HDD_OBJS := 	$(HDD_SRC_DIR)/wlan_hdd_assoc.o \
-		$(HDD_SRC_DIR)/wlan_hdd_cfg.o \
-		$(HDD_SRC_DIR)/wlan_hdd_debugfs.o \
-		$(HDD_SRC_DIR)/wlan_hdd_driver_ops.o \
-		$(HDD_SRC_DIR)/wlan_hdd_ftm.o \
-		$(HDD_SRC_DIR)/wlan_hdd_hostapd.o \
-		$(HDD_SRC_DIR)/wlan_hdd_ioctl.o \
-		$(HDD_SRC_DIR)/wlan_hdd_main.o \
-		$(HDD_SRC_DIR)/wlan_hdd_ocb.o \
-		$(HDD_SRC_DIR)/wlan_hdd_oemdata.o \
-		$(HDD_SRC_DIR)/wlan_hdd_power.o \
-		$(HDD_SRC_DIR)/wlan_hdd_scan.o \
-		$(HDD_SRC_DIR)/wlan_hdd_softap_tx_rx.o \
-		$(HDD_SRC_DIR)/wlan_hdd_tx_rx.o \
-		$(HDD_SRC_DIR)/wlan_hdd_trace.o \
-		$(HDD_SRC_DIR)/wlan_hdd_wext.o \
-		$(HDD_SRC_DIR)/wlan_hdd_wmm.o \
-		$(HDD_SRC_DIR)/wlan_hdd_wowl.o
-
-ifeq ($(CONFIG_WLAN_LRO), y)
-HDD_OBJS +=     $(HDD_SRC_DIR)/wlan_hdd_lro.o
-endif
-
-ifeq ($(CONFIG_WLAN_NAPI), y)
-HDD_OBJS +=     $(HDD_SRC_DIR)/wlan_hdd_napi.o
-endif
-
-ifeq ($(CONFIG_IPA_OFFLOAD), 1)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_ipa.o
-endif
-
-ifeq ($(HAVE_CFG80211),1)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_cfg80211.o \
-		$(HDD_SRC_DIR)/wlan_hdd_ext_scan.o \
-		$(HDD_SRC_DIR)/wlan_hdd_stats.o \
-		$(HDD_SRC_DIR)/wlan_hdd_p2p.o
-endif
-
-ifeq ($(CONFIG_QCACLD_FEATURE_GREEN_AP),y)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_green_ap.o
-endif
-
-ifeq ($(CONFIG_QCACLD_FEATURE_NAN),y)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_nan.o
-endif
-
-ifeq ($(CONFIG_QCOM_TDLS),y)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_tdls.o
-endif
-
-ifeq ($(CONFIG_MPC_UT_FRAMEWORK),y)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_conc_ut.o
-endif
-
-ifeq ($(CONFIG_WLAN_FEATURE_MEMDUMP),y)
-HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_memdump.o
-endif
-
-ifeq ($(CONFIG_LFR_SUBNET_DETECTION), y)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_subnet_detect.o
-endif
-
-########### HOST DIAG LOG ###########
-HOST_DIAG_LOG_DIR :=	core/utils/host_diag_log
-
-HOST_DIAG_LOG_INC_DIR :=	$(HOST_DIAG_LOG_DIR)/inc
-HOST_DIAG_LOG_SRC_DIR :=	$(HOST_DIAG_LOG_DIR)/src
-
-HOST_DIAG_LOG_INC :=	-I$(WLAN_ROOT)/$(HOST_DIAG_LOG_INC_DIR) \
-			-I$(WLAN_ROOT)/$(HOST_DIAG_LOG_SRC_DIR)
-
-HOST_DIAG_LOG_OBJS +=	$(HOST_DIAG_LOG_SRC_DIR)/host_diag_log.o
-
-############ EPPING ############
-EPPING_DIR :=	core/utils/epping
-EPPING_INC_DIR :=	$(EPPING_DIR)/inc
-EPPING_SRC_DIR :=	$(EPPING_DIR)/src
-
-EPPING_INC := 	-I$(WLAN_ROOT)/$(EPPING_INC_DIR)
-
-EPPING_OBJS := $(EPPING_SRC_DIR)/epping_main.o \
-		$(EPPING_SRC_DIR)/epping_txrx.o \
-		$(EPPING_SRC_DIR)/epping_tx.o \
-		$(EPPING_SRC_DIR)/epping_rx.o \
-		$(EPPING_SRC_DIR)/epping_helper.o \
-
-
-############ MAC ############
-MAC_DIR :=	core/mac
-MAC_INC_DIR :=	$(MAC_DIR)/inc
-MAC_SRC_DIR :=	$(MAC_DIR)/src
-
-MAC_INC := 	-I$(WLAN_ROOT)/$(MAC_INC_DIR) \
-		-I$(WLAN_ROOT)/$(MAC_SRC_DIR)/dph \
-		-I$(WLAN_ROOT)/$(MAC_SRC_DIR)/include \
-		-I$(WLAN_ROOT)/$(MAC_SRC_DIR)/pe/include \
-		-I$(WLAN_ROOT)/$(MAC_SRC_DIR)/pe/lim
-
-MAC_CFG_OBJS := $(MAC_SRC_DIR)/cfg/cfg_api.o \
-		$(MAC_SRC_DIR)/cfg/cfg_debug.o \
-		$(MAC_SRC_DIR)/cfg/cfg_param_name.o \
-		$(MAC_SRC_DIR)/cfg/cfg_proc_msg.o \
-		$(MAC_SRC_DIR)/cfg/cfg_send_msg.o
-
-MAC_DPH_OBJS :=	$(MAC_SRC_DIR)/dph/dph_hash_table.o
-
-MAC_LIM_OBJS := $(MAC_SRC_DIR)/pe/lim/lim_aid_mgmt.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_admit_control.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_api.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_assoc_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_debug.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_ft.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_ibss_peer_mgmt.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_link_monitoring_algo.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_p2p.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_action_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_assoc_req_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_assoc_rsp_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_auth_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_beacon_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_cfg_updates.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_deauth_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_disassoc_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_message_queue.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_mlm_req_messages.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_mlm_rsp_messages.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_probe_req_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_probe_rsp_frame.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_process_sme_req_messages.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_prop_exts_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_scan_result_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_security_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_send_management_frames.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_send_messages.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_send_sme_rsp_messages.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_ser_des_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_session.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_session_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_sme_req_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_sta_hash_api.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_timer_utils.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_trace.o \
-		$(MAC_SRC_DIR)/pe/lim/lim_utils.o
-
-ifeq ($(CONFIG_QCOM_ESE),y)
-ifneq ($(CONFIG_QCOM_ESE_UPLOAD),y)
-MAC_LIM_OBJS += $(MAC_SRC_DIR)/pe/lim/limProcessEseFrame.o
-endif
-endif
-
-ifeq ($(CONFIG_QCOM_TDLS),y)
-MAC_LIM_OBJS += $(MAC_SRC_DIR)/pe/lim/lim_process_tdls.o
-endif
-
-MAC_SCH_OBJS := $(MAC_SRC_DIR)/pe/sch/sch_api.o \
-		$(MAC_SRC_DIR)/pe/sch/sch_beacon_gen.o \
-		$(MAC_SRC_DIR)/pe/sch/sch_beacon_process.o \
-		$(MAC_SRC_DIR)/pe/sch/sch_debug.o \
-		$(MAC_SRC_DIR)/pe/sch/sch_message.o
-
-MAC_RRM_OBJS :=	$(MAC_SRC_DIR)/pe/rrm/rrm_api.o
-
-MAC_OBJS := 	$(MAC_CFG_OBJS) \
-		$(MAC_DPH_OBJS) \
-		$(MAC_LIM_OBJS) \
-		$(MAC_SCH_OBJS) \
-		$(MAC_RRM_OBJS)
-
-############ SAP ############
-SAP_DIR :=	core/sap
-SAP_INC_DIR :=	$(SAP_DIR)/inc
-SAP_SRC_DIR :=	$(SAP_DIR)/src
-
-SAP_INC := 	-I$(WLAN_ROOT)/$(SAP_INC_DIR) \
-		-I$(WLAN_ROOT)/$(SAP_SRC_DIR)
-
-SAP_OBJS :=	$(SAP_SRC_DIR)/sap_api_link_cntl.o \
-		$(SAP_SRC_DIR)/sap_ch_select.o \
-		$(SAP_SRC_DIR)/sap_fsm.o \
-		$(SAP_SRC_DIR)/sap_module.o
-
-############ DFS ############ 350
-DFS_DIR :=	$(SAP_DIR)/dfs
-DFS_INC_DIR :=	$(DFS_DIR)/inc
-DFS_SRC_DIR :=	$(DFS_DIR)/src
-
-DFS_INC :=	-I$(WLAN_ROOT)/$(DFS_INC_DIR) \
-		-I$(WLAN_ROOT)/$(DFS_SRC_DIR)
-
-DFS_OBJS :=	$(DFS_SRC_DIR)/dfs_bindetects.o \
-		$(DFS_SRC_DIR)/dfs.o \
-		$(DFS_SRC_DIR)/dfs_debug.o\
-		$(DFS_SRC_DIR)/dfs_fcc_bin5.o\
-		$(DFS_SRC_DIR)/dfs_init.o\
-		$(DFS_SRC_DIR)/dfs_misc.o\
-		$(DFS_SRC_DIR)/dfs_nol.o\
-		$(DFS_SRC_DIR)/dfs_phyerr_tlv.o\
-		$(DFS_SRC_DIR)/dfs_process_phyerr.o\
-		$(DFS_SRC_DIR)/dfs_process_radarevent.o\
-		$(DFS_SRC_DIR)/dfs_staggered.o
-
-############ SME ############
-SME_DIR :=	core/sme
-SME_INC_DIR :=	$(SME_DIR)/inc
-SME_SRC_DIR :=	$(SME_DIR)/src
-
-SME_INC := 	-I$(WLAN_ROOT)/$(SME_INC_DIR) \
-		-I$(WLAN_ROOT)/$(SME_SRC_DIR)/csr
-
-SME_CSR_OBJS := $(SME_SRC_DIR)/csr/csr_api_roam.o \
-		$(SME_SRC_DIR)/csr/csr_api_scan.o \
-		$(SME_SRC_DIR)/csr/csr_cmd_process.o \
-		$(SME_SRC_DIR)/csr/csr_link_list.o \
-		$(SME_SRC_DIR)/csr/csr_neighbor_roam.o \
-		$(SME_SRC_DIR)/csr/csr_util.o
-
-ifeq ($(CONFIG_QCOM_ESE),y)
-ifneq ($(CONFIG_QCOM_ESE_UPLOAD),y)
-SME_CSR_OBJS += $(SME_SRC_DIR)/csr/csrEse.o
-endif
-endif
-
-ifeq ($(CONFIG_QCOM_TDLS),y)
-SME_CSR_OBJS += $(SME_SRC_DIR)/csr/csr_tdls_process.o
-endif
-
-SME_QOS_OBJS := $(SME_SRC_DIR)/qos/sme_qos.o
-
-SME_CMN_OBJS := $(SME_SRC_DIR)/common/sme_api.o \
-		$(SME_SRC_DIR)/common/sme_ft_api.o \
-		$(SME_SRC_DIR)/common/sme_power_save.o \
-		$(SME_SRC_DIR)/common/sme_trace.o
-
-SME_OEM_DATA_OBJS := $(SME_SRC_DIR)/oem_data/oem_data_api.o
-
-SME_P2P_OBJS = $(SME_SRC_DIR)/p2p/p2p_api.o
-
-SME_RRM_OBJS := $(SME_SRC_DIR)/rrm/sme_rrm.o
-
-ifeq ($(CONFIG_QCACLD_FEATURE_NAN),y)
-SME_NAN_OBJS = $(SME_SRC_DIR)/nan/nan_api.o
-endif
-
-SME_OBJS :=	$(SME_CMN_OBJS) \
-		$(SME_CSR_OBJS) \
-		$(SME_OEM_DATA_OBJS) \
-		$(SME_P2P_OBJS) \
-		$(SME_QOS_OBJS) \
-		$(SME_RRM_OBJS) \
-		$(SME_NAN_OBJS)
-
-############ NLINK ############
-NLINK_DIR     :=	core/utils/nlink
-NLINK_INC_DIR :=	$(NLINK_DIR)/inc
-NLINK_SRC_DIR :=	$(NLINK_DIR)/src
-
-NLINK_INC     := 	-I$(WLAN_ROOT)/$(NLINK_INC_DIR)
-NLINK_OBJS    :=	$(NLINK_SRC_DIR)/wlan_nlink_srv.o
-
-############ PTT ############
-PTT_DIR     :=	core/utils/ptt
-PTT_INC_DIR :=	$(PTT_DIR)/inc
-PTT_SRC_DIR :=	$(PTT_DIR)/src
-
-PTT_INC     := 	-I$(WLAN_ROOT)/$(PTT_INC_DIR)
-PTT_OBJS    :=	$(PTT_SRC_DIR)/wlan_ptt_sock_svc.o
-
-############ WLAN_LOGGING ############
-WLAN_LOGGING_DIR     :=	core/utils/logging
-WLAN_LOGGING_INC_DIR :=	$(WLAN_LOGGING_DIR)/inc
-WLAN_LOGGING_SRC_DIR :=	$(WLAN_LOGGING_DIR)/src
-
-WLAN_LOGGING_INC     := -I$(WLAN_ROOT)/$(WLAN_LOGGING_INC_DIR)
-WLAN_LOGGING_OBJS    := $(WLAN_LOGGING_SRC_DIR)/wlan_logging_sock_svc.o
-
-############ SYS ############
-SYS_DIR :=	core/mac/src/sys
-
-SYS_INC := 	-I$(WLAN_ROOT)/$(SYS_DIR)/common/inc \
-		-I$(WLAN_ROOT)/$(SYS_DIR)/legacy/src/platform/inc \
-		-I$(WLAN_ROOT)/$(SYS_DIR)/legacy/src/system/inc \
-		-I$(WLAN_ROOT)/$(SYS_DIR)/legacy/src/utils/inc
-
-SYS_COMMON_SRC_DIR := $(SYS_DIR)/common/src
-SYS_LEGACY_SRC_DIR := $(SYS_DIR)/legacy/src
-SYS_OBJS :=	$(SYS_COMMON_SRC_DIR)/wlan_qct_sys.o \
-		$(SYS_LEGACY_SRC_DIR)/platform/src/sys_wrapper.o \
-		$(SYS_LEGACY_SRC_DIR)/system/src/mac_init_api.o \
-		$(SYS_LEGACY_SRC_DIR)/system/src/sys_entry_func.o \
-		$(SYS_LEGACY_SRC_DIR)/utils/src/dot11f.o \
-		$(SYS_LEGACY_SRC_DIR)/utils/src/log_api.o \
-		$(SYS_LEGACY_SRC_DIR)/utils/src/mac_trace.o \
-		$(SYS_LEGACY_SRC_DIR)/utils/src/parser_api.o \
-		$(SYS_LEGACY_SRC_DIR)/utils/src/utils_api.o \
-		$(SYS_LEGACY_SRC_DIR)/utils/src/utils_parser.o
-
-############ CDF (Connectivity driver framework) ############
-CDF_DIR :=	core/cdf
-CDF_INC_DIR :=	$(CDF_DIR)/inc
-CDF_SRC_DIR :=	$(CDF_DIR)/src
-
-CDF_INC := 	-I$(WLAN_ROOT)/$(CDF_INC_DIR) \
-		-I$(WLAN_ROOT)/$(CDF_SRC_DIR)
-
-CDF_OBJS :=	$(CDF_SRC_DIR)/cdf_event.o \
-		$(CDF_SRC_DIR)/cdf_list.o \
-		$(CDF_SRC_DIR)/cdf_lock.o \
-		$(CDF_SRC_DIR)/cdf_memory.o \
-		$(CDF_SRC_DIR)/cdf_threads.o \
-		$(CDF_SRC_DIR)/cdf_mc_timer.o \
-		$(CDF_SRC_DIR)/cdf_trace.o \
-		$(CDF_SRC_DIR)/cdf_nbuf.o \
-		$(CDF_SRC_DIR)/cdf_defer.o
-
-############ CDS (Connectivity driver services) ############
-CDS_DIR :=	core/cds
-CDS_INC_DIR :=	$(CDS_DIR)/inc
-CDS_SRC_DIR :=	$(CDS_DIR)/src
-
-CDS_INC := 	-I$(WLAN_ROOT)/$(CDS_INC_DIR) \
-		-I$(WLAN_ROOT)/$(CDS_SRC_DIR)
-
-CDS_OBJS :=	$(CDS_SRC_DIR)/cds_api.o \
-		$(CDS_SRC_DIR)/cds_reg_service.o \
-		$(CDS_SRC_DIR)/cds_mq.o \
-		$(CDS_SRC_DIR)/cds_packet.o \
-		$(CDS_SRC_DIR)/cds_regdomain.o \
-		$(CDS_SRC_DIR)/cds_sched.o \
-		$(CDS_SRC_DIR)/cds_concurrency.o \
-		$(CDS_SRC_DIR)/cds_utils.o
-
-
-########### BMI ###########
-BMI_DIR := core/bmi
-
-BMI_INC := -I$(WLAN_ROOT)/$(BMI_DIR)/inc
-
-ifneq ($(CONFIG_ICNSS), y)
-BMI_OBJS := $(BMI_DIR)/src/bmi.o \
-            $(BMI_DIR)/src/ol_fw.o
-ifeq ($(CONFIG_FEATURE_BMI_2), y)
-BMI_OBJS += $(BMI_DIR)/src/bmi_2.o
-else
-BMI_OBJS += $(BMI_DIR)/src/bmi_1.o
-endif
-endif
-########### WMI ###########
-WMI_DIR := core/wmi
-
-WMI_INC := -I$(WLAN_ROOT)/$(WMI_DIR)
-
-WMI_OBJS := $(WMI_DIR)/wmi_unified.o \
-	    $(WMI_DIR)/wmi_tlv_helper.o
-
-########### FWLOG ###########
-FWLOG_DIR := core/utils/fwlog
-
-FWLOG_INC := -I$(WLAN_ROOT)/$(FWLOG_DIR)
-
-FWLOG_OBJS := $(FWLOG_DIR)/dbglog_host.o
-
-############ TXRX ############
-TXRX_DIR :=     core/dp/txrx
-TXRX_INC :=     -I$(WLAN_ROOT)/$(TXRX_DIR)
-
-TXRX_OBJS := $(TXRX_DIR)/ol_txrx.o \
-                $(TXRX_DIR)/ol_cfg.o \
-                $(TXRX_DIR)/ol_rx.o \
-                $(TXRX_DIR)/ol_rx_fwd.o \
-                $(TXRX_DIR)/ol_txrx.o \
-                $(TXRX_DIR)/ol_rx_defrag.o \
-                $(TXRX_DIR)/ol_tx_desc.o \
-                $(TXRX_DIR)/ol_tx.o \
-                $(TXRX_DIR)/ol_rx_reorder_timeout.o \
-                $(TXRX_DIR)/ol_rx_reorder.o \
-                $(TXRX_DIR)/ol_rx_pn.o \
-                $(TXRX_DIR)/ol_tx_queue.o \
-                $(TXRX_DIR)/ol_txrx_peer_find.o \
-                $(TXRX_DIR)/ol_txrx_event.o \
-                $(TXRX_DIR)/ol_txrx_encap.o \
-                $(TXRX_DIR)/ol_tx_send.o
-
-ifeq ($(CONFIG_WLAN_TX_FLOW_CONTROL_V2), y)
-TXRX_OBJS +=     $(TXRX_DIR)/ol_txrx_flow_control.o
-endif
-
-############ OL ############
-OL_DIR :=     core/dp/ol
-OL_INC :=     -I$(WLAN_ROOT)/$(OL_DIR)/inc
-
-############ PKTLOG ############
-PKTLOG_DIR :=      core/utils/pktlog
-PKTLOG_INC :=      -I$(WLAN_ROOT)/$(PKTLOG_DIR)/include
-
-PKTLOG_OBJS :=	$(PKTLOG_DIR)/pktlog_ac.o \
-		$(PKTLOG_DIR)/pktlog_internal.o \
-		$(PKTLOG_DIR)/linux_ac.o
-
-############ HTT ############
-HTT_DIR :=      core/dp/htt
-HTT_INC :=      -I$(WLAN_ROOT)/$(HTT_DIR)
-
-HTT_OBJS := $(HTT_DIR)/htt_tx.o \
-            $(HTT_DIR)/htt.o \
-            $(HTT_DIR)/htt_t2h.o \
-            $(HTT_DIR)/htt_h2t.o \
-            $(HTT_DIR)/htt_fw_stats.o \
-            $(HTT_DIR)/htt_rx.o
-
-############## HTC ##########
-HTC_DIR := core/htc
-HTC_INC := -I$(WLAN_ROOT)/$(HTC_DIR)
-
-HTC_OBJS := $(HTC_DIR)/htc.o \
-            $(HTC_DIR)/htc_send.o \
-            $(HTC_DIR)/htc_recv.o \
-            $(HTC_DIR)/htc_services.o
-
-########### HIF ###########
-HIF_DIR := core/hif
-HIF_CE_DIR := $(HIF_DIR)/src/ce
-HIF_CNSS_STUB_DIR := $(HIF_DIR)/src/icnss_stub
-
-ifeq ($(CONFIG_HIF_PCI), 1)
-HIF_PCIE_DIR := $(HIF_DIR)/src/pcie
-else
-HIF_SNOC_DIR := $(HIF_DIR)/src/snoc
-endif
-
-HIF_INC := -I$(WLAN_ROOT)/$(HIF_DIR)/inc \
-				-I$(WLAN_ROOT)/$(HIF_DIR)/src \
-				-I$(WLAN_ROOT)/$(HIF_CE_DIR) \
-				-I$(WLAN_ROOT)/$(HIF_CNSS_STUB_DIR)
-
-ifeq ($(CONFIG_HIF_PCI), 1)
-HIF_INC += -I$(WLAN_ROOT)/$(HIF_PCIE_DIR)
-else
-HIF_INC += -I$(WLAN_ROOT)/$(HIF_SNOC_DIR)
-endif
-
-HIF_OBJS := $(HIF_DIR)/src/ath_procfs.o \
-		$(HIF_CE_DIR)/ce_diag.o \
-		$(HIF_CE_DIR)/ce_main.o \
-		$(HIF_CE_DIR)/ce_service.o \
-		$(HIF_CE_DIR)/ce_tasklet.o \
-		$(HIF_DIR)/src/hif_main.o \
-		$(HIF_DIR)/src/mp_dev.o \
-		$(HIF_DIR)/src/regtable.o
-
-ifeq ($(CONFIG_CNSS), y)
-HIF_OBJS += $(HIF_CNSS_STUB_DIR)/icnss_stub.o \
-		$(HIF_CE_DIR)/ce_bmi.o
-endif
-
-ifeq ($(CONFIG_WLAN_NAPI), y)
-HIF_OBJS += $(HIF_DIR)/src/hif_napi.o
-endif
-
-ifeq ($(CONFIG_HIF_PCI), 1)
-HIF_PCIE_OBJS := $(HIF_PCIE_DIR)/if_pci.o
-
-HIF_OBJS += $(HIF_PCIE_OBJS)
-else
-HIF_SNOC_OBJS := $(HIF_SNOC_DIR)/if_snoc.o
-
-HIF_OBJS += $(HIF_SNOC_OBJS)
-endif
-
-############ WMA ############
-WMA_DIR :=	core/wma
-
-WMA_INC_DIR :=  $(WMA_DIR)/inc
-WMA_SRC_DIR :=  $(WMA_DIR)/src
-
-WMA_INC :=	-I$(WLAN_ROOT)/$(WMA_INC_DIR) \
-		-I$(WLAN_ROOT)/$(WMA_SRC_DIR)
-
-WMA_OBJS :=	$(WMA_SRC_DIR)/wma_main.o \
-		$(WMA_SRC_DIR)/wma_scan_roam.o \
-		$(WMA_SRC_DIR)/wma_dev_if.o \
-		$(WMA_SRC_DIR)/wma_mgmt.o \
-		$(WMA_SRC_DIR)/wma_power.o \
-		$(WMA_SRC_DIR)/wma_data.o \
-		$(WMA_SRC_DIR)/wma_utils.o \
-		$(WMA_SRC_DIR)/wma_features.o \
-		$(WMA_SRC_DIR)/wma_dfs_interface.o \
-		$(WMA_SRC_DIR)/wma_ocb.o \
-		$(WMA_SRC_DIR)/wlan_qct_wma_legacy.o
-
-ifeq ($(CONFIG_MPC_UT_FRAMEWORK),y)
-WMA_OBJS +=	$(WMA_SRC_DIR)/wma_utils_ut.o
-endif
-
-TARGET_INC :=	-I$(WLAN_ROOT)/target/inc
-
-LINUX_INC :=	-Iinclude/linux
-
-INCS :=		$(HDD_INC) \
-		$(EPPING_INC) \
-		$(LINUX_INC) \
-		$(MAC_INC) \
-		$(SAP_INC) \
-		$(SME_INC) \
-		$(SYS_INC) \
-		$(CDF_INC) \
-		$(CDS_INC) \
-		$(DFS_INC)
-
-INCS +=		$(WMA_INC) \
-		$(UAPI_INC) \
-		$(COMMON_INC) \
-		$(WMI_INC) \
-		$(FWLOG_INC) \
-		$(TXRX_INC) \
-		$(OL_INC) \
-		$(PKTLOG_INC) \
-		$(HTT_INC) \
-		$(HTC_INC) \
-		$(DFS_INC)
-
-INCS +=		$(HIF_INC) \
-		$(BMI_INC)
-
-INCS +=		$(TARGET_INC)
-
-INCS +=		$(NLINK_INC) \
-		$(PTT_INC) \
-		$(WLAN_LOGGING_INC)
-
-ifeq ($(CONFIG_REMOVE_PKT_LOG), 0)
-INCS +=		$(PKTLOG_INC)
-endif
-
-ifeq ($(BUILD_DIAG_VERSION), 1)
-INCS +=		$(HOST_DIAG_LOG_INC)
-endif
-
-OBJS :=		$(HDD_OBJS) \
-		$(EPPING_OBJS) \
-		$(MAC_OBJS) \
-		$(SAP_OBJS) \
-		$(SME_OBJS) \
-		$(SYS_OBJS) \
-		$(CDF_OBJS) \
-		$(CDS_OBJS) \
-		$(DFS_OBJS)
-
-OBJS +=		$(WMA_OBJS) \
-		$(TXRX_OBJS) \
-		$(WMI_OBJS) \
-		$(FWLOG_OBJS) \
-		$(HTC_OBJS) \
-		$(DFS_OBJS)
-
-OBJS +=		$(HIF_OBJS) \
-		$(BMI_OBJS) \
-		$(HTT_OBJS)
-
-OBJS +=		$(WLAN_LOGGING_OBJS)
-OBJS +=		$(NLINK_OBJS)
-OBJS +=		$(PTT_OBJS)
-
-ifeq ($(CONFIG_REMOVE_PKT_LOG), 0)
-OBJS +=		$(PKTLOG_OBJS)
-endif
-
-ifeq ($(BUILD_DIAG_VERSION), 1)
-OBJS +=		$(HOST_DIAG_LOG_OBJS)
-endif
-
-
-EXTRA_CFLAGS += $(INCS)
-
-CDEFINES :=	-DANI_LITTLE_BYTE_ENDIAN \
-		-DANI_LITTLE_BIT_ENDIAN \
-		-DQC_WLAN_CHIPSET_QCA_CLD \
-		-DDOT11F_LITTLE_ENDIAN_HOST \
-		-DANI_COMPILER_TYPE_GCC \
-		-DANI_OS_TYPE_ANDROID=6 \
-		-DWLAN_PERF \
-		-DPTT_SOCK_SVC_ENABLE \
-		-Wall\
-		-Werror\
-		-D__linux__ \
-		-DHAL_SELF_STA_PER_BSS=1 \
-		-DWLAN_FEATURE_VOWIFI_11R \
-		-DWLAN_FEATURE_NEIGHBOR_ROAMING \
-		-DWLAN_FEATURE_NEIGHBOR_ROAMING_DEBUG \
-		-DWLAN_FEATURE_VOWIFI_11R_DEBUG \
-		-DFEATURE_WLAN_WAPI \
-		-DFEATURE_OEM_DATA_SUPPORT\
-		-DSOFTAP_CHANNEL_RANGE \
-		-DWLAN_AP_STA_CONCURRENCY \
-		-DFEATURE_WLAN_SCAN_PNO \
-		-DWLAN_FEATURE_PACKET_FILTERING \
-		-DWLAN_FEATURE_VOWIFI \
-		-DWLAN_FEATURE_11AC \
-		-DWLAN_FEATURE_P2P_DEBUG \
-		-DWLAN_ENABLE_AGEIE_ON_SCAN_RESULTS \
-		-DWLANTL_DEBUG\
-		-DWLAN_NS_OFFLOAD \
-		-DWLAN_SOFTAP_VSTA_FEATURE \
-		-DWLAN_FEATURE_GTK_OFFLOAD \
-		-DWLAN_WAKEUP_EVENTS \
-		-DFEATURE_WLAN_RA_FILTERING\
-	        -DWLAN_KD_READY_NOTIFIER \
-		-DWLAN_NL80211_TESTMODE \
-		-DFEATURE_WLAN_LPHB \
-		-DFEATURE_WLAN_PAL_TIMER_DISABLE \
-		-DFEATURE_WLAN_PAL_MEM_DISABLE \
-		-DQCA_SUPPORT_TX_THROTTLE \
-		-DWMI_INTERFACE_EVENT_LOGGING \
-		-DATH_SUPPORT_WAPI \
-		-DWLAN_FEATURE_LINK_LAYER_STATS \
-		-DWLAN_LOGGING_SOCK_SVC_ENABLE \
-		-DFEATURE_WLAN_EXTSCAN \
-		-DFEATURE_WLAN_LFR \
-		-DWLAN_FEATURE_MBSSID \
-		-DCONFIG_160MHZ_SUPPORT
-
-ifeq (y,$(filter y,$(CONFIG_CNSS_EOS) $(CONFIG_ICNSS)))
-CDEFINES += -DQCA_WIFI_3_0
-CDEFINES += -DQCA_WIFI_3_0_EMU
-endif
-
-ifeq (y,$(filter y,$(CONFIG_CNSS_ADRASTEA) $(CONFIG_ICNSS)))
-CDEFINES += -DQCA_WIFI_3_0_ADRASTEA
-CDEFINES += -DADRASTEA_SHADOW_REGISTERS
-CDEFINES += -DADRASTEA_RRI_ON_DDR
-endif
-
-ifneq (y,$(filter y,$(CONFIG_CNSS_EOS) $(CONFIG_ICNSS) $(CONFIG_CNSS_ADRASTEA)))
-CDEFINES += -DQCA_WIFI_2_0
-endif
-
-ifeq ($(CONFIG_WLAN_FASTPATH), y)
-CDEFINES +=	-DWLAN_FEATURE_FASTPATH
-endif
-
-ifeq ($(CONFIG_WLAN_NAPI), y)
-CDEFINES += -DFEATURE_NAPI
-ifeq ($(CONFIG_WLAN_NAPI_DEBUG), y)
-CDEFINES += -DFEATURE_NAPI_DEBUG
-endif
-endif
-
-ifeq ($(CONFIG_FEATURE_BMI_2), y)
-CDEFINES += -DFEATURE_BMI_2
-endif
-
-ifeq ($(CONFIG_ARCH_MSM), y)
-CDEFINES += -DMSM_PLATFORM
-endif
-
-CDEFINES +=	-DQCA_SUPPORT_TXRX_LOCAL_PEER_ID
-
-ifeq ($(CONFIG_WLAN_TX_FLOW_CONTROL_V2), y)
-CDEFINES +=	-DQCA_LL_TX_FLOW_CONTROL_V2
-CDEFINES +=	-DQCA_LL_TX_FLOW_GLOBAL_MGMT_POOL
-else
-ifeq ($(CONFIG_ROME_IF),pci)
-CDEFINES +=	-DQCA_LL_LEGACY_TX_FLOW_CONTROL
-endif
-endif
-
-ifeq ($(CONFIG_DEBUG_LL),y)
-CDEFINES +=    	-DQCA_PKT_PROTO_TRACE
-endif
-
-ifneq ($(CONFIG_QCA_CLD_WLAN),)
-CDEFINES += -DWCN_PRONTO
-CDEFINES += -DWCN_PRONTO_V1
-endif
-
-ifeq ($(BUILD_DEBUG_VERSION),1)
-CDEFINES +=	-DWLAN_DEBUG \
-		-DTRACE_RECORD \
-		-DLIM_TRACE_RECORD \
-		-DSME_TRACE_RECORD \
-		-DHDD_TRACE_RECORD \
-		-DPE_DEBUG_LOGW \
-		-DPE_DEBUG_LOGE \
-		-DDEBUG
-endif
-
-ifeq ($(CONFIG_SLUB_DEBUG_ON),y)
-CDEFINES += -DTIMER_MANAGER
-CDEFINES += -DMEMORY_DEBUG
-endif
-
-ifeq ($(HAVE_CFG80211),1)
-CDEFINES += -DWLAN_FEATURE_P2P
-CDEFINES += -DWLAN_FEATURE_WFD
-ifeq ($(CONFIG_QCOM_VOWIFI_11R),y)
-CDEFINES += -DKERNEL_SUPPORT_11R_CFG80211
-CDEFINES += -DUSE_80211_WMMTSPEC_FOR_RIC
-endif
-endif
-
-ifeq ($(CONFIG_QCOM_ESE),y)
-CDEFINES += -DFEATURE_WLAN_ESE
-CDEFINES += -DQCA_COMPUTE_TX_DELAY
-CDEFINES += -DQCA_COMPUTE_TX_DELAY_PER_TID
-ifeq ($(CONFIG_QCOM_ESE_UPLOAD),y)
-CDEFINES += -DFEATURE_WLAN_ESE_UPLOAD
-endif
-endif
-
-#normally, TDLS negative behavior is not needed
-ifeq ($(CONFIG_QCOM_TDLS),y)
-CDEFINES += -DFEATURE_WLAN_TDLS
-endif
-
-ifeq ($(CONFIG_QCACLD_WLAN_LFR3),y)
-CDEFINES += -DWLAN_FEATURE_ROAM_OFFLOAD
-endif
-
-ifeq ($(CONFIG_PRIMA_WLAN_OKC),y)
-CDEFINES += -DFEATURE_WLAN_OKC
-endif
-
-ifeq ($(CONFIG_PRIMA_WLAN_11AC_HIGH_TP),y)
-CDEFINES += -DWLAN_FEATURE_11AC_HIGH_TP
-endif
-
-ifeq ($(BUILD_DIAG_VERSION),1)
-CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT
-CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT_CSR
-CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT_LIM
-ifeq ($(CONFIG_HIF_PCI), 1)
-CDEFINES += -DCONFIG_ATH_PROCFS_DIAG_SUPPORT
-endif
-endif
-
-ifeq ($(CONFIG_HIF_USB), 1)
-CDEFINES += -DCONFIG_ATH_PROCFS_DIAG_SUPPORT
-CDEFINES += -DQCA_SUPPORT_OL_RX_REORDER_TIMEOUT
-CDEFINES += -DCONFIG_ATH_PCIE_MAX_PERF=0 -DCONFIG_ATH_PCIE_AWAKE_WHILE_DRIVER_LOAD=0 -DCONFIG_DISABLE_CDC_MAX_PERF_WAR=0
-CDEFINES += -DQCA_TX_HTT2_SUPPORT
-endif
-
-# enable the MAC Address auto-generation feature
-CDEFINES += -DWLAN_AUTOGEN_MACADDR_FEATURE
-
-ifeq ($(CONFIG_WLAN_FEATURE_11W),y)
-CDEFINES += -DWLAN_FEATURE_11W
-endif
-
-ifeq ($(CONFIG_QCOM_LTE_COEX),y)
-CDEFINES += -DFEATURE_WLAN_CH_AVOID
-endif
-
-ifeq ($(CONFIG_WLAN_FEATURE_LPSS),y)
-CDEFINES += -DWLAN_FEATURE_LPSS
-endif
-
-ifeq ($(PANIC_ON_BUG),1)
-CDEFINES += -DPANIC_ON_BUG
-endif
-
-ifeq ($(WLAN_OPEN_SOURCE), 1)
-CDEFINES += -DWLAN_OPEN_SOURCE
-endif
-
-ifeq ($(CONFIG_FEATURE_STATS_EXT), 1)
-CDEFINES += -DWLAN_FEATURE_STATS_EXT
-endif
-
-ifeq ($(CONFIG_QCACLD_FEATURE_NAN),y)
-CDEFINES += -DWLAN_FEATURE_NAN
-endif
-
-ifeq ($(CONFIG_QCA_IBSS_SUPPORT), 1)
-CDEFINES += -DQCA_IBSS_SUPPORT
-endif
-
-#Enable OL debug and wmi unified functions
-ifeq ($(CONFIG_ATH_PERF_PWR_OFFLOAD), 1)
-CDEFINES += -DATH_PERF_PWR_OFFLOAD
-endif
-
-#Disable packet log
-ifeq ($(CONFIG_REMOVE_PKT_LOG), 1)
-CDEFINES += -DREMOVE_PKT_LOG
-endif
-
-#Enable 11AC TX
-ifeq ($(CONFIG_ATH_11AC_TXCOMPACT), 1)
-CDEFINES += -DATH_11AC_TXCOMPACT
-endif
-
-#Enable OS specific IRQ abstraction
-ifeq ($(CONFIG_ATH_SUPPORT_SHARED_IRQ), 1)
-CDEFINES += -DATH_SUPPORT_SHARED_IRQ
-endif
-
-#Enable message based HIF instead of RAW access in BMI
-ifeq ($(CONFIG_HIF_MESSAGE_BASED), 1)
-CDEFINES += -DHIF_MESSAGE_BASED
-endif
-
-#Enable PCI specific APIS (dma, etc)
-ifeq ($(CONFIG_HIF_PCI), 1)
-CDEFINES += -DHIF_PCI
-endif
-
-#Enable USB specific APIS
-ifeq ($(CONFIG_HIF_USB), 1)
-CDEFINES += -DHIF_USB
-CDEFINES += -DCONFIG_HL_SUPPORT
-endif
-
-#Enable FW logs through ini
-CDEFINES += -DCONFIG_FW_LOGS_BASED_ON_INI
-
-#Enable pci read/write config functions
-ifeq ($(CONFIG_ATH_PCI), 1)
-CDEFINES += -DATH_PCI
-endif
-
-#Enable power management suspend/resume functionality
-ifeq ($(CONFIG_ATH_BUS_PM), 1)
-CDEFINES += -DATH_BUS_PM
-endif
-
-#Enable FLOWMAC module support
-ifeq ($(CONFIG_ATH_SUPPORT_FLOWMAC_MODULE), 1)
-CDEFINES += -DATH_SUPPORT_FLOWMAC_MODULE
-endif
-
-#Enable spectral support
-ifeq ($(CONFIG_ATH_SUPPORT_SPECTRAL), 1)
-CDEFINES += -DATH_SUPPORT_SPECTRAL
-endif
-
-#Enable WDI Event support
-ifeq ($(CONFIG_WDI_EVENT_ENABLE), 1)
-CDEFINES += -DWDI_EVENT_ENABLE
-endif
-
-#Endianess selection
-ifeq ($(CONFIG_LITTLE_ENDIAN), 1)
-AH_LITTLE_ENDIAN=1234
-CDEFINES += -DAH_BYTE_ORDER=$(AH_LITTLE_ENDIAN)
-else
-AH_BIG_ENDIAN=4321
-CDEFINES += -DAH_BYTE_ORDER=$(AH_BIG_ENDIAN)
-CDEFINES += -DBIG_ENDIAN_HOST
-endif
-
-#Enable TX reclaim support
-ifeq ($(CONFIG_TX_CREDIT_RECLAIM_SUPPORT), 1)
-CDEFINES += -DTX_CREDIT_RECLAIM_SUPPORT
-endif
-
-#Enable FTM support
-ifeq ($(CONFIG_QCA_WIFI_FTM), 1)
-CDEFINES += -DQCA_WIFI_FTM
-endif
-
-#Enable Checksum Offload support
-ifeq ($(CONFIG_CHECKSUM_OFFLOAD), 1)
-CDEFINES += -DCHECKSUM_OFFLOAD
-endif
-
-#Enable Checksum Offload support
-ifeq ($(CONFIG_IPA_OFFLOAD), 1)
-CDEFINES += -DIPA_OFFLOAD
-endif
-
-ifneq ($(CONFIG_ARCH_MDM9630), y)
-ifeq ($(CONFIG_ARCH_MDM9640), y)
-CDEFINES += -DQCA_CONFIG_SMP
-endif
-endif
-
-#Enable GTK Offload
-ifeq ($(CONFIG_GTK_OFFLOAD), 1)
-CDEFINES += -DWLAN_FEATURE_GTK_OFFLOAD
-CDEFINES += -DIGTK_OFFLOAD
-endif
-
-#Enable GTK Offload
-ifeq ($(CONFIG_EXT_WOW), 1)
-CDEFINES += -DWLAN_FEATURE_EXTWOW_SUPPORT
-endif
-
-#Mark it as SMP Kernel
-ifeq ($(CONFIG_SMP),y)
-CDEFINES += -DQCA_CONFIG_SMP
-endif
-
-ifeq ($(CONFIG_WLAN_FEATURE_RX_WAKELOCK), y)
-CDEFINES += -DWLAN_FEATURE_HOLD_RX_WAKELOCK
-endif
-
-#Enable Channel Matrix restriction for all targets
-CDEFINES += -DWLAN_ENABLE_CHNL_MATRIX_RESTRICTION
-
-#features specific to mobile router use case
-ifeq ($(CONFIG_MOBILE_ROUTER), y)
-
-#enable MCC TO SCC switch
-CDEFINES += -DFEATURE_WLAN_MCC_TO_SCC_SWITCH
-
-#enable wlan auto shutdown feature
-CDEFINES += -DFEATURE_WLAN_AUTO_SHUTDOWN
-
-#enable for MBSSID
-CDEFINES += -DWLAN_FEATURE_MBSSID
-
-#enable AP-AP ACS Optimization
-CDEFINES += -DFEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-
-#Enable 4address scheme
-CDEFINES += -DFEATURE_WLAN_STA_4ADDR_SCHEME
-
-#Disable STA-AP Mode DFS support
-CDEFINES += -DFEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
-
-#Enable OBSS feature
-CDEFINES += -DQCA_HT_2040_COEX
-
-#Disable HT40 in 2.4GHZ STA mode
-CDEFINES += -DQCA_HT_20_24G_STA_ONLY
-
-else #CONFIG_MOBILE_ROUTER
-
-#Open P2P device interface only for non-Mobile router use cases
-CDEFINES += -DWLAN_OPEN_P2P_INTERFACE
-
-#Enable 2.4 GHz social channels in 5 GHz only mode for p2p usage
-CDEFINES += -DWLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY
-
-endif #CONFIG_MOBILE_ROUTER
-
-#Green AP feature
-ifeq ($(CONFIG_QCACLD_FEATURE_GREEN_AP),y)
-CDEFINES += -DFEATURE_GREEN_AP
-endif
-
-#Enable RX Full re-order OL feature only "LL and NON-MDM9630 platform"
-ifneq ($(CONFIG_ARCH_MDM9630), y)
-ifeq ($(CONFIG_HIF_PCI), 1)
-CDEFINES += -DWLAN_FEATURE_RX_FULL_REORDER_OL
-endif
-endif
-
-#Enable Signed firmware support for split binary format
-ifeq ($(CONFIG_QCA_SIGNED_SPLIT_BINARY_SUPPORT), 1)
-CDEFINES += -DQCA_SIGNED_SPLIT_BINARY_SUPPORT
-endif
-
-#Enable single firmware binary format
-ifeq ($(CONFIG_QCA_SINGLE_BINARY_SUPPORT), 1)
-CDEFINES += -DQCA_SINGLE_BINARY_SUPPORT
-endif
-
-#Enable collecting target RAM dump after kernel panic
-ifeq ($(CONFIG_TARGET_RAMDUMP_AFTER_KERNEL_PANIC), 1)
-CDEFINES += -DTARGET_RAMDUMP_AFTER_KERNEL_PANIC
-endif
-
-#Enable/disable secure firmware feature
-ifeq ($(CONFIG_FEATURE_SECURE_FIRMWARE), 1)
-CDEFINES += -DFEATURE_SECURE_FIRMWARE
-endif
-
-ifeq ($(CONFIG_ATH_PCIE_ACCESS_DEBUG), 1)
-CDEFINES += -DCONFIG_ATH_PCIE_ACCESS_DEBUG
-endif
-
-# Some kernel include files are being moved.  Check to see if
-# the old version of the files are present
-
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/mach-msm/include/mach/msm_smd.h),)
-CDEFINES += -DEXISTS_MSM_SMD
-endif
-
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/mach-msm/include/mach/msm_smsm.h),)
-CDEFINES += -DEXISTS_MSM_SMSM
-endif
-
-# Enable feature support fo Linux version QCMBR
-ifeq ($(CONFIG_LINUX_QCMBR),y)
-CDEFINES += -DLINUX_QCMBR
-endif
-
-
-# Enable full rx re-order offload for adrastea
-ifeq (y, $(filter y, $(CONFIG_CNSS_ADRASTEA) $(CONFIG_ICNSS)))
-CDEFINES += -DWLAN_FEATURE_RX_FULL_REORDER_OL
-endif
-
-# Enable athdiag procfs debug support for adrastea
-ifeq (y, $(filter y, $(CONFIG_CNSS_ADRASTEA) $(CONFIG_ICNSS)))
-CDEFINES += -DCONFIG_ATH_PROCFS_DIAG_SUPPORT
-endif
-
-# Enable 11AC TX compact feature for adrastea
-ifeq (y, $(filter y, $(CONFIG_CNSS_ADRASTEA) $(CONFIG_ICNSS)))
-CDEFINES += -DATH_11AC_TXCOMPACT
-endif
-
-# NOTE: CONFIG_64BIT_PADDR requires CONFIG_HELIUMPLUS
-ifeq (y,$(filter y,$(CONFIG_CNSS_EOS) $(CONFIG_ICNSS)))
-CONFIG_HELIUMPLUS := y
-CONFIG_64BIT_PADDR := y
-CONFIG_FEATURE_TSO := y
-CONFIG_FEATURE_TSO_DEBUG := y
-ifeq ($(CONFIG_HELIUMPLUS),y)
-CDEFINES += -DHELIUMPLUS_PADDR64
-CDEFINES += -DHELIUMPLUS
-CDEFINES += -DAR900B
-ifeq ($(CONFIG_64BIT_PADDR),y)
-CDEFINES += -DHTT_PADDR64
-endif
-endif
-endif
-
-ifeq ($(CONFIG_FEATURE_TSO),y)
-CDEFINES += -DFEATURE_TSO
-endif
-ifeq ($(CONFIG_FEATURE_TSO_DEBUG),y)
-CDEFINES += -DFEATURE_TSO_DEBUG
-endif
-
-ifeq ($(CONFIG_WLAN_LRO), y)
-CDEFINES += -DFEATURE_LRO
-endif
-
-ifeq ($(CONFIG_MOBILE_ROUTER), y)
-CDEFINES += -DFEATURE_AP_MCC_CH_AVOIDANCE
-endif
-
-ifeq ($(CONFIG_MPC_UT_FRAMEWORK), y)
-CDEFINES += -DMPC_UT_FRAMEWORK
-endif
-
-ifeq ($(CONFIG_WLAN_OFFLOAD_PACKETS),y)
-CDEFINES += -DWLAN_FEATURE_OFFLOAD_PACKETS
-endif
-
-ifeq ($(CONFIG_WLAN_FEATURE_MEMDUMP),y)
-CDEFINES += -DWLAN_FEATURE_MEMDUMP
-endif
-
-ifeq ($(CONFIG_LFR_SUBNET_DETECTION), y)
-CDEFINES += -DFEATURE_LFR_SUBNET_DETECTION
-endif
-
-KBUILD_CPPFLAGS += $(CDEFINES)
-
-# Currently, for versions of gcc which support it, the kernel Makefile
-# is disabling the maybe-uninitialized warning.  Re-enable it for the
-# WLAN driver.  Note that we must use EXTRA_CFLAGS here so that it
-# will override the kernel settings.
-ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
-EXTRA_CFLAGS += -Wmaybe-uninitialized
-endif
-
-# Module information used by KBuild framework
-obj-$(CONFIG_QCA_CLD_WLAN) += $(MODNAME).o
-$(MODNAME)-y := $(OBJS)

+ 0 - 114
Kconfig

@@ -1,114 +0,0 @@
-comment "Qualcomm Atheros CLD WLAN module"
-
-config QCA_CLD_WLAN
-
-	tristate "Qualcomm Atheros CLD WLAN module"
-	default n
-	help
-	Add support for the Qualcomm Atheros CLD WLAN module
-
-if QCA_CLD_WLAN != n
-
-config QCACLD_WLAN_LFR3
-	bool "Enable the WLAN Legacy Fast Roaming feature Version 3"
-	default n
-
-config PRIMA_WLAN_OKC
-	bool "Enable the Prima WLAN Opportunistic Key Caching feature"
-	default n
-
-config PRIMA_WLAN_11AC_HIGH_TP
-	bool "Enable the Prima WLAN 802.11ac High Throughput option (depends upon kernel support)"
-	default n
-
-config WLAN_FEATURE_11W
-	bool "Enable the WLAN 802.11w Protected Management Frames feature"
-	default n
-
-config WLAN_FEATURE_LPSS
-	bool "Enable the WLAN LPSS feature"
-	default n
-
-config QCOM_VOWIFI_11R
-	bool "Enable Fast Transition (11r) feature"
-	default n
-
-config QCACLD_FEATURE_NAN
-	bool "Enable NAN feature"
-	default n
-
-config QCACLD_FEATURE_GREEN_AP
-	bool "Enable Green AP feature"
-	default n
-
-config HELIUMPLUS
-	bool "Enable Beeliner based descriptor structures for Helium"
-	default n
-
-config 64BIT_PADDR
-	bool "Enable 37-bit physical/bus addresses"
-	depends on HELIUMPLUS
-	default n
-
-config QCOM_TDLS
-	bool "Enable TDLS feature"
-	default n
-
-config QCOM_LTE_COEX
-	bool "Enable QCOM LTE Coex feature"
-	default n
-
-config MPC_UT_FRAMEWORK
-	bool "Enable Unit test framework for multiport concurrency"
-	default n
-
-config WLAN_OFFLOAD_PACKETS
-	bool "Enable offload packets feature"
-	default n
-
-config WLAN_FEATURE_MEMDUMP
-	bool "Enable MEMDUMP feature"
-	default n
-
-config FEATURE_TSO
-	bool "Enable TCP Segmentation Offload"
-	depends on HELIUMPLUS
-	default n
-
-config FEATURE_TSO_DEBUG
-	bool "Enable TCP Segmentation Offload with debug"
-	depends on FEATURE_TSO
-	default n
-
-config WLAN_FASTPATH
-	bool "Enable fastpath for datapackets"
-	default n
-
-config WLAN_NAPI
-	bool "Enable NAPI - datapath rx"
-	default n
-
-config WLAN_NAPI_DEBUG
-       bool "Enable debug logging on NAPI"
-       depends on WLAN_NAPI
-       default n
-
-config WLAN_TX_FLOW_CONTROL_V2
-	bool "Enable tx flow control version:2"
-	default n
-
-config WLAN_LRO
-	bool "Enable Large Receive Offload"
-	depends on HELIUMPLUS
-	depends on CONFIG_INET_LRO
-	default n
-
-config WLAN_FEATURE_RX_WAKELOCK
-	bool "Enable RX wake lock feature"
-	default n
-
-config FEATURE_LFR_SUBNET_DETECTION
-	bool "Enable LFR Subnet Change Detection"
-	default n
-
-endif # QCA_CLD_WLAN

+ 0 - 20
Makefile

@@ -1,20 +0,0 @@
-KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
-
-KBUILD_OPTIONS := WLAN_ROOT=$(PWD)
-KBUILD_OPTIONS += MODNAME=wlan
-
-#By default build for CLD
-WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m
-KBUILD_OPTIONS += CONFIG_QCA_WIFI_ISOC=0
-KBUILD_OPTIONS += CONFIG_QCA_WIFI_2_0=1
-KBUILD_OPTIONS += $(WLAN_SELECT)
-KBUILD_OPTIONS += $(KBUILD_EXTRA) # Extra config if any
-
-all:
-	$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
-
-modules_install:
-	$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
-
-clean:
-	$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean

+ 0 - 594
config/WCNSS_qcom_cfg.ini

@@ -1,594 +0,0 @@
-# This file allows user to override the factory
-
-# defaults for the WLAN Driver
-
-
-# Enable IMPS or not
-gEnableImps=1
-
-# Enable/Disable Idle Scan
-
-gEnableIdleScan=0
-
-
-# Increase sleep duration (seconds) during IMPS
-# 0 implies no periodic wake up from IMPS. Periodic wakeup is
-# unnecessary if Idle Scan is disabled.
-gImpsModSleepTime=0
-
-
-# Enable BMPS or not
-gEnableBmps=1
-
-# Enable suspend or not
-
-# 1: Enable standby, 2: Enable Deep sleep, 3: Enable Mcast/Bcast Filter
-
-gEnableSuspend=3
-
-
-# Phy Mode (auto, b, g, n, etc)
-# Valid values are 0-9, with 0 = Auto, 4 = 11n, 9 = 11ac
-# 1 = 11abg, 2 = 11b, 3 = 11g, 5 = 11g only, 6 = 11n only
-# 7 = 11b only 8 = 11ac only.
-gDot11Mode=0
-
-
-# CSR Roaming Enable(1) Disable(0)
-
-gRoamingTime=0
-
-
-# Assigned MAC Addresses - This will be used until NV items are in place
-
-# Each byte of MAC address is represented in Hex format as XX
-
-Intf0MacAddress=000AF58989FF
-Intf1MacAddress=000AF58989FE
-Intf2MacAddress=000AF58989FD
-
-Intf3MacAddress=000AF58989FC
-
-
-# UAPSD service interval for VO,VI, BE, BK traffic
-
-InfraUapsdVoSrvIntv=0
-
-InfraUapsdViSrvIntv=0
-
-InfraUapsdBeSrvIntv=0
-
-InfraUapsdBkSrvIntv=0
-
-# Flag to allow STA send AddTspec even when ACM is Off
-gAddTSWhenACMIsOff=1
-
-# Make 1x1 the default antenna configuration
-
-gNumRxAnt=1
-
-
-# Beacon filtering frequency (unit in beacon intervals)
-
-gNthBeaconFilter=50
-
-
-# Enable WAPI or not
-
-# WAPIIsEnabled=0
-
-
-# Flags to filter Mcast abd Bcast RX packets.
-
-# Value 0: No filtering, 1: Filter all Multicast.
-
-# 2: Filter all Broadcast. 3: Filter all Mcast abd Bcast
-
-McastBcastFilter=3
-
-
-#Flag to enable HostARPOffload feature or not
-
-hostArpOffload=1
-
-#Flag to enable HostNSOffload feature or not
-
-hostNSOffload=1
-
-# This flag enables IP, TCP and UDP checksum offload
-gEnableIpTcpUdpChecksumOffload=1
-
-#SoftAP Related Parameters
-
-# AP MAc addr
-
-gAPMacAddr=000AF589dcab
-
-
-# 802.11n Protection flag
-
-gEnableApProt=1
-
-
-#Enable OBSS protection
-
-gEnableApOBSSProt=1
-
-
-#Enable/Disable UAPSD for SoftAP
-
-gEnableApUapsd=1
-
-
-# Fixed Rate
-
-gFixedRate=0
-
-
-# Maximum Tx power
-
-# gTxPowerCap=30
-
-
-# Fragmentation Threshold
-
-# gFragmentationThreshold=2346
-
-
-# RTS threshold
-
-RTSThreshold=1048576
-
-
-# Intra-BSS forward
-
-gDisableIntraBssFwd=0
-
-
-# WMM Enable/Disable
-
-WmmIsEnabled=0
-
-
-# 802.11d support
-
-g11dSupportEnabled=1
-
-# 802.11h support
-
-g11hSupportEnabled=1
-
-# DFS Master Capability
-gEnableDFSMasterCap=1
-
-# ESE Support and fast transition
-EseEnabled=1
-ImplicitQosIsEnabled=0
-gNeighborScanTimerPeriod=200
-
-gNeighborLookupThreshold=76
-gNeighborReassocThreshold=81
-
-gNeighborScanChannelMinTime=20
-gNeighborScanChannelMaxTime=30
-gMaxNeighborReqTries=3
-
-# Legacy (non-ESE, non-802.11r) Fast Roaming Support
-# To enable, set FastRoamEnabled=1
-# To disable, set FastRoamEnabled=0
-FastRoamEnabled=1
-
-#Check if the AP to which we are roaming is better than current AP in terms of RSSI.
-#Checking is disabled if set to Zero.Otherwise it will use this value as to how better
-#the RSSI of the new/roamable AP should be for roaming
-RoamRssiDiff=3
-
-# If the RSSI of any available candidate is better than currently associated
-# AP by at least gImmediateRoamRssiDiff, then being to roam immediately (without
-# registering for reassoc threshold).
-# NOTE: Value of 0 means that we would register for reassoc threshold.
-gImmediateRoamRssiDiff=10
-
-# To enable, set gRoamIntraBand=1 (Roaming within band)
-# To disable, set gRoamIntraBand=0 (Roaming across band)
-gRoamIntraBand=0
-
-#Short Guard Interval Enable/disable
-
-gShortGI20Mhz=1
-
-gShortGI40Mhz=1
-
-
-#Auto Shutdown  Value in seconds. A value of 0 means Auto shutoff is disabled
-
-gAPAutoShutOff=0
-
-#Auto Shutdown wlan : Value in Seconds. 0 means disabled. Max 1 day = 86400 sec
-gWlanAutoShutdown = 0
-
-# Not used.
-gApAutoChannelSelection=0
-
-
-# Listen Energy Detect Mode Configuration
-
-# Valid values 0-128
-
-# 128 means disable Energy Detect feature
-
-# 0-9 are threshold code and 7 is recommended value from system if feature is to be enabled.
-
-# 10-128 are reserved.
-
-# The EDET threshold mapping is as follows in 3dB step:
-
-# 0 = -60 dBm
-
-# 1 = -63 dBm
-
-# 2 = -66 dBm
-
-# ...
-
-# 7 = -81 dBm
-
-# 8 = -84 dBm
-
-# 9 = -87 dBm
-
-# Note: Any of these settings are valid. Setting 0 would yield the highest power saving (in a noisy environment) at the cost of more range. The range impact is approximately #calculated as:
-
-#
-
-#  Range Loss  (dB)  =  EDET threshold level (dBm) + 97 dBm.
-
-#
-
-gEnablePhyAgcListenMode=128
-
-
-#Preferred band (both or 2.4 only or 5 only)
-
-BandCapability=0
-
-
-#Beacon Early Termination (1 = enable the BET feature, 0 = disable)
-
-enableBeaconEarlyTermination=0
-
-beaconEarlyTerminationWakeInterval=3
-
-
-#Channel Bonding
-gChannelBondingMode5GHz=1
-
-
-#Enable Keep alive with non-zero period value
-
-gStaKeepAlivePeriod = 30
-
-#Say gGoKeepAlivePeriod(5 seconds) and gGoLinkMonitorPeriod(10 seconds).
-#For every 10 seconds DUT send Qos Null frame(i.e., Keep Alive frame if link is idle for last 10 seconds.)
-#For both active and power save clients.
-
-#Power save clients: DUT set TIM bit from 10th second onwards and till client honors TIM bit.
-#If doesn't honor for 5 seconds then DUT remove client.
-
-#Active clients: DUT send Qos Null frame for 10th seconds onwards if it is not success still we try on
-#11th second if not tries on 12th and so on till 15th second. Hence before disconnection DUT will send 5 NULL frames.
-#Hence in any case DUT will detect client got removed in (10+5) seconds. i.e., (gGoKeepAlivePeriod + gGoLinkMonitorPeriod)..
-
-#gGoLinkMonitorPeriod/ gApLinkMonitorPeriod is period where link is idle and it is period
-#where we send NULL frame.
-
-#gApLinkMonitorPeriod = 10
-
-#gGoLinkMonitorPeriod = 10
-
-#gGoKeepAlivePeriod/gApKeepAlivePeriod is time to spend to check whether frame are succeed to send or not.
-#Hence total effective detection time is gGoLinkMonitorPeriod+ gGoKeepAlivePeriod/gApLinkMonitorPeriod+ gApKeepAlivePeriod.
-
-
-gGoKeepAlivePeriod = 20
-
-gApKeepAlivePeriod = 20
-
-
-#If set will start with active scan after driver load, otherwise will start with
-
-#passive scan to find out the domain
-
-gEnableBypass11d=1
-
-
-#If set to 0, will not scan DFS channels
-
-gEnableDFSChnlScan=1
-
-# Enable DFS channel roam
-# 0: DISABLE, 1: ENABLED_NORMAL, 2: ENABLED_ACTIVE
-gAllowDFSChannelRoam=1
-
-gVhtChannelWidth=2
-
-# Enable Automatic Tx Power control
-
-gEnableAutomaticTxPowerControl=1
-
-# 0 for OLPC 1 for CLPC and SCPC
-gEnableCloseLoop=1
-
-#Data Inactivity Timeout when in powersave (in ms)
-gDataInactivityTimeout=200
-
-# VHT Tx/Rx MCS values
-# Valid values are 0,1,2. If commented out, the default value is 0.
-# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
-gVhtRxMCS=2
-gVhtTxMCS=2
-
-# VHT Tx/Rx MCS values for 2x2
-# Valid values are 0,1,2. If commented out, the default value is 0.
-# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9
-gEnable2x2=1
-gVhtRxMCS2x2=2
-gVhtTxMCS2x2=2
-
-# Set txchainmask and rxchainmask
-# These parameters are used only if gEnable2x2 is 0
-# Valid values are 1,2
-# Set gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
-# Set gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
-gSetTxChainmask1x1=1
-gSetRxChainmask1x1=1
-
-# Scan Timing Parameters
-# gPassiveMaxChannelTime=110
-# gPassiveMinChannelTime=60
-gActiveMaxChannelTime=40
-gActiveMinChannelTime=20
-
-#If set to 0, MCC is not allowed.
-gEnableMCCMode=1
-
-# MCC to SCC Switch mode: 0-Disable 1-Enable 2-Force SCC if same band
-gWlanMccToSccSwitchMode = 0
-
-# 1=enable STBC; 0=disable STBC
-gEnableRXSTBC=1
-
-# 1=enable tx STBC; 0=disable
-gEnableTXSTBC=1
-
-# 1=enable rx LDPC; 0=disable
-gEnableRXLDPC=1
-
-#Enable/Disable Tx beamforming
-gTxBFEnable=1
-
-#Enable/Disable Tx beamformee in SAP mode
-gEnableTxBFeeSAP=1
-
-# Enable Tx beamforming in VHT20MHz
-# Valid values are 0,1. If commented out, the default value is 0.
-# 0=disable, 1=enable
-gEnableTxBFin20MHz=1
-
-#Enable/Disable SU Tx beamformer support.
-gEnableTxSUBeamformer=1
-
-#Enable Scan Results Aging based on timer
-#Timer value is in seconds
-#If Set to 0 it will not enable the feature
-gScanAgingTime=30
-
-#Enable Scan Results Aging based on number of scans
-gScanResultAgeCount=1
-
-#Enable Power saving mechanism Based on Android Framework
-#If set to 0 Driver internally control the Power saving mechanism
-#If set to 1 Android Framwrok control the Power saving mechanism
-isAndroidPsEn=0
-
-#Enable thermal mitigation
-gThermalMitigationEnable=0
-
-gEnableFastRoamInConcurrency=1
-
-#Maxium Channel time in msec
-gMaxMediumTime = 6000
-
-# 802.11K support
-gRrmEnable=1
-gRrmOperChanMax=8
-gRrmNonOperChanMax=8
-gRrmRandIntvl=100
-
-#Scan offload
-gEnableDirectedScanOffload=1
-
-#FlexConnect Power Factor
-#Default is set to 0 (disable)
-gFlexConnectPowerFactor=0
-
-#Disable split scan, the FW will take care of it
-gNumChanCombinedConc=60
-
-#Enable Power Save offload
-gEnablePowerSaveOffload=2
-
-#Enable firmware uart print
-gEnablefwprint=0
-
-#IPA config
-gIPAConfig=0
-gIPADescSize=800
-gIPAPreFilterEnable=1
-gIPARMEnable=1
-gIPAIPv6Enable=1
-
-IpaUcOffloadEnabled=0
-gIpaUcStaOffload=0
-
-#P2P Listen offload
-gEnableP2pListenOffload=1
-
-# Maximum Receive AMPDU size (VHT only. Valid values: 0->8k 1->16k 2->32k 3->64k 4->128k)
-gVhtAmpduLenExponent=7
-
-# Maximum MPDU length (VHT only. Valid values: 0->3895 octets, 1->7991 octets, 2->11454 octets)
-gVhtMpduLen=2
-
-# Maximum number of wow filters required
-#gMaxWoWFilters=22
-
-# WOW Enable/Disable.
-# 0 - Disable both magic pattern match and pattern byte match.
-# 1 - Enable magic pattern match on all interfaces.
-# 2 - Enable pattern byte match on all interfaces.
-# 3 - Enable both magic patter and pattern byte match on all interfaces.
-# Default value of gEnableWoW is 3.
-# gEnableWoW=0
-
-# Enable or Disable MCC Adaptive Scheduler at the FW
-# 1=Enable (default), 0=Disable
-gEnableMCCAdaptiveScheduler=1
-
-#Enable or Disable p2p device address administered
-isP2pDeviceAddrAdministrated=0
-
-#Enable Rx thread
-gEnableRxThread=1
-
-#Enable NAPI
-gEnableNAPI=1
-
-# Set Thermal Power limit
-TxPower2g=10
-TxPower5g=10
-
-# Remove Overlap channel restriction
-gEnableOverLapCh=0
-
-#Enable VHT on 2.4Ghz
-gEnableVhtFor24GHzBand=1
-
-#Enable or Disable 5G early beacon termination
-gEnable5gEBT=1
-
-#Maximum number of offload peers supported
-# gMaxOffloadPeers=2
-
-# controlling the following offload patterns
-# through ini parameter. Default value is 1
-# to disable set it to zero. ssdp = 0
-# Setup multicast pattern for mDNS 224.0.0.251,
-# SSDP 239.255.255.250 and LLMNR 224.0.0.252
-ssdp = 0
-
-#Enable Memory Deep Sleep
-gEnableMemDeepSleep=1
-
-# Bus bandwidth threshold values in terms of number of packets
-gBusBandwidthHighThreshold=2000
-gBusBandwidthMediumThreshold=500
-gBusBandwidthLowThreshold=150
-
-# Bus bandwidth compute timeout value in ms
-gBusBandwidthComputeInterval=100
-
-# Regulatory Setting; 0=STRICT; 1=CUSTOM
-gRegulatoryChangeCountry=1
-# RA filtering rate limit param, the current value would not
-# help if the lifetime in RA is less than 3*60=3min. Then
-# we need to change it, though it is uncommon.
-# gRAFilterEnable=0
-gRArateLimitInterval=600
-
-# Maximum number of concurrent connections
-gMaxConcurrentActiveSessions=2
-
-# Disable/Enable GreenAP
-# 0 to disable, 1 to enable, default: 1
-gEnableGreenAp=1
-
-# Radar PRI multiplier
-gDFSradarMappingPriMultiplier=4
-
-gPNOScanSupport=1
-
-# Enable/Disable RX full reorder offload
-gReorderOffloadSupported=1
-
-#Enable/Disable LPASS support
-# 0 to disable, 1 to enable
-gEnableLpassSupport=0
-
-# Whether userspace country code setting shld have priority
-gCountryCodePriority=1
-
-# Enable(1)/Disable(0) SIFS burst
-gEnableSifsBurst=1
-
-# Enable or Disable Multi-user MIMO
-# 1=Enable (default), 0=Disable
-gEnableMuBformee=1
-
-# Enable/Disable channel avoidance for SAP in SCC scenario
-# 0 - disable
-# 1 - enable
-gSapSccChanAvoidance=0
-
-# Inactivity time (in ms) to end TX Service Period while in IBSS power save mode
-gIbssTxSpEndInactivityTime=10
-
-# Enable/Disable Roaming Offload Support (a.k.a Key Management Offload)
-# 0 to disable, 1 to enable
-gRoamOffloadEnabled=0
-
-# Enable support for TDLS
-#  0 - disable
-#  1 - enable
-gEnableTDLSSupport=1
-
-# Enable support for Implicit Trigger of TDLS. That is, wlan driver shall
-# initiate TDLS Discovery towards a peer whenever setup criteria (throughput
-# and RSSI) is met and then will initiate teardown when teardown criteria
-# (idle packet count and RSSI) is met.
-#  0 - disable
-#  1 - enable
-gEnableTDLSImplicitTrigger=1
-
-# Enable TDLS External Control. That is, user space application has to
-# first configure a peer MAC in wlan driver towards which TDLS is desired.
-# Device will establish TDLS only towards those configured peers whenever
-# TDLS criteria (throughput and RSSI threshold) is met and teardown TDLS
-# when teardown criteria (idle packet count and RSSI) is met. However,
-# device will accept TDLS connection if it is initiated from any other peer,
-# even if that peer is not configured.
-#  0 - disable
-#  1 - enable
-# For TDLS External Control, Implicit Trigger must also be enabled.
-gTDLSExternalControl=1
-
-# Enable support for TDLS off-channel operation
-#  0 - disable
-#  1 - enable
-# TDLS off-channel operation will be invoked when there is only one
-# TDLS connection.
-gEnableTDLSOffChannel=1
-
-# Enable or Disable Random MAC (Spoofing)
-# 1=Enable, 0=Disable (default)
-gEnableMacAddrSpoof=0
-
-# Enable(Tx) fastpath for data traffic.
-# 0 - disable
-# 1 - enable
-gEnableFastPath=1
-
-END
-
-# Note: Configuration parser would not read anything past the END marker
-

+ 0 - 60
core/bmi/inc/bmi.h

@@ -1,60 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/* ================================================================ */
-/* BMI declarations and prototypes */
-/* */
-/* ================================================================= */
-
-#ifndef _BMI_H_
-#define _BMI_H_
-#include "bmi_msg.h"
-#include "cdf_trace.h"
-#include "ol_if_athvar.h"
-#include "hif.h"
-
-#ifdef HIF_PCI
-void bmi_cleanup(struct ol_softc *scn);
-CDF_STATUS bmi_done(struct ol_softc *scn);
-CDF_STATUS bmi_download_firmware(struct ol_softc *scn);
-#else
-static inline void bmi_cleanup(struct ol_softc *scn)
-{
-	return;
-}
-
-static inline CDF_STATUS bmi_done(struct ol_softc *scn)
-{
-	return CDF_STATUS_SUCCESS;
-}
-
-static inline CDF_STATUS bmi_download_firmware(struct ol_softc *scn)
-{
-	return CDF_STATUS_SUCCESS;
-}
-#endif
-#endif /* _BMI_H_ */

+ 0 - 64
core/bmi/inc/ol_fw.h

@@ -1,64 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _OL_FW_H_
-#define _OL_FW_H_
-
-#ifdef QCA_WIFI_FTM
-#include "cdf_types.h"
-#endif
-#include "hif.h"
-
-#define AR6004_VERSION_REV1_3        0x31c8088a
-
-#define AR9888_REV2_VERSION          0x4100016c
-#define AR6320_REV1_VERSION          0x5000000
-#define AR6320_REV1_1_VERSION        0x5000001
-#define AR6320_REV1_VERSION_1        AR6320_REV1_1_VERSION
-#define AR6320_REV1_3_VERSION        0x5000003
-#define AR6320_REV2_VERSION          AR6320_REV1_1_VERSION
-#define AR6320_REV2_1_VERSION        0x5010000
-#define AR6320_REV3_VERSION          0x5020000
-#define AR6320_REV3_2_VERSION        0x5030000
-#define AR6320_REV4_VERSION          AR6320_REV2_1_VERSION
-#define AR6320_DEV_VERSION           0x1000000
-
-#ifdef HIF_PCI
-void ol_target_failure(void *instance, CDF_STATUS status);
-uint8_t ol_get_number_of_peers_supported(struct ol_softc *scn);
-#else
-static inline void ol_target_failure(void *instance, CDF_STATUS status)
-{
-	return;
-}
-
-static inline uint8_t ol_get_number_of_peers_supported(struct ol_softc *scn)
-{
-	return 1;
-}
-#endif
-#endif /* _OL_FW_H_ */

+ 0 - 87
core/bmi/inc/ol_if_athvar.h

@@ -1,87 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/*
- * Defintions for the Atheros Wireless LAN controller driver.
- */
-#ifndef _DEV_OL_ATH_ATHVAR_H
-#define _DEV_OL_ATH_ATHVAR_H
-
-#include <osapi_linux.h>
-#include "cdf_types.h"
-#include "cdf_lock.h"
-#include "wmi_unified_api.h"
-#include "htc_api.h"
-#include "bmi_msg.h"
-#include "ol_txrx_api.h"
-#include "ol_txrx_ctrl_api.h"
-#include "ol_txrx_osif_api.h"
-#include "ol_params.h"
-#include <wdi_event_api.h>
-
-#ifdef CONFIG_CNSS
-#include <net/cnss.h>
-#endif
-
-#include "ol_ctrl_addba_api.h"
-typedef void *hif_handle_t;
-
-struct ol_version {
-	uint32_t host_ver;
-	uint32_t target_ver;
-	uint32_t wlan_ver;
-	uint32_t wlan_ver_1;
-	uint32_t abi_ver;
-};
-
-typedef enum _ol_target_status {
-	OL_TRGET_STATUS_CONNECTED = 0,  /* target connected */
-	OL_TRGET_STATUS_RESET,  /* target got reset */
-	OL_TRGET_STATUS_EJECT,  /* target got ejected */
-	OL_TRGET_STATUS_SUSPEND /*target got suspend */
-} ol_target_status;
-
-enum ol_ath_tx_ecodes {
-	TX_IN_PKT_INCR = 0,
-	TX_OUT_HDR_COMPL,
-	TX_OUT_PKT_COMPL,
-	PKT_ENCAP_FAIL,
-	TX_PKT_BAD,
-	RX_RCV_MSG_RX_IND,
-	RX_RCV_MSG_PEER_MAP,
-	RX_RCV_MSG_TYPE_TEST
-};
-
-/*
- * structure to hold the packet error count for CE and hif layer
- */
-struct ol_ath_stats {
-	int hif_pipe_no_resrc_count;
-	int ce_ring_delta_fail_count;
-};
-
-#endif /* _DEV_OL_ATH_ATHVAR_H  */

+ 0 - 469
core/bmi/src/bmi.c

@@ -1,469 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#include "i_bmi.h"
-
-/* APIs visible to the driver */
-
-/* BMI_1 refers QCA6174 target; the ADDR is AXI addr */
-#define BMI_1_TEST_ADDR	(0xa0000)
-/* BMI_2 ; */
-#define BMI_2_TEST_ADDR	(0x6E0000)
-/* Enable BMI_TEST COMMANDs; The Value 0x09 is randomly choosen */
-#define BMI_TEST_ENABLE (0x09)
-
-static CDF_STATUS
-bmi_command_test(uint32_t command, uint32_t address, uint8_t *data,
-				uint32_t length, struct ol_softc *scn)
-{
-	switch (command) {
-	case BMI_NO_COMMAND:
-		return bmi_no_command(scn);
-	case BMI_WRITE_MEMORY:
-		return bmi_write_memory(address, data, length, scn);
-	case BMI_READ_MEMORY:
-		return bmi_read_memory(address, data, length, scn);
-	case BMI_EXECUTE:
-		return bmi_execute(address, (uint32_t *)data, scn);
-	default:
-		break;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS bmi_init(struct ol_softc *scn)
-{
-	if (!scn) {
-		BMI_ERR("Invalid scn Context");
-		bmi_assert(0);
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-	scn->bmi_done = false;
-
-	if (!scn->bmi_cmd_buff) {
-		scn->bmi_cmd_buff = cdf_os_mem_alloc_consistent(scn->cdf_dev,
-					MAX_BMI_CMDBUF_SZ, &scn->bmi_cmd_da, 0);
-		if (!scn->bmi_cmd_buff) {
-			BMI_ERR("No Memory for BMI Command");
-			return CDF_STATUS_E_NOMEM;
-		}
-	}
-
-	if (!scn->bmi_rsp_buff) {
-		scn->bmi_rsp_buff = cdf_os_mem_alloc_consistent(scn->cdf_dev,
-					MAX_BMI_CMDBUF_SZ, &scn->bmi_rsp_da, 0);
-		if (!scn->bmi_rsp_buff) {
-			BMI_ERR("No Memory for BMI Response");
-			goto end;
-		}
-	}
-	return CDF_STATUS_SUCCESS;
-end:
-	cdf_os_mem_free_consistent(scn->cdf_dev, MAX_BMI_CMDBUF_SZ,
-				 scn->bmi_cmd_buff, scn->bmi_cmd_da, 0);
-	scn->bmi_cmd_buff = NULL;
-	return CDF_STATUS_E_NOMEM;
-}
-
-void bmi_cleanup(struct ol_softc *scn)
-{
-	if (scn->bmi_cmd_buff) {
-		cdf_os_mem_free_consistent(scn->cdf_dev, MAX_BMI_CMDBUF_SZ,
-				    scn->bmi_cmd_buff, scn->bmi_cmd_da, 0);
-		scn->bmi_cmd_buff = NULL;
-		scn->bmi_cmd_da = 0;
-	}
-
-	if (scn->bmi_rsp_buff) {
-		cdf_os_mem_free_consistent(scn->cdf_dev, MAX_BMI_CMDBUF_SZ,
-				    scn->bmi_rsp_buff, scn->bmi_rsp_da, 0);
-		scn->bmi_rsp_buff = NULL;
-		scn->bmi_rsp_da = 0;
-	}
-}
-
-
-CDF_STATUS bmi_done(struct ol_softc *scn)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	if (NO_BMI)
-		return status;
-
-	status = bmi_done_local(scn);
-
-	if (status != CDF_STATUS_SUCCESS)
-		BMI_ERR("BMI_DONE Failed status:%d", status);
-	return status;
-}
-
-CDF_STATUS
-bmi_get_target_info(struct bmi_target_info *targ_info,
-						struct ol_softc *scn)
-{
-	int status = 0;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-	uint32_t cid, length;
-
-	if (scn->bmi_done) {
-		BMI_ERR("BMI Phase is Already Done");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("%s:BMI CMD/RSP Buffer is NULL", __func__);
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-	cid = BMI_GET_TARGET_INFO;
-
-	cdf_mem_copy(bmi_cmd_buff, &cid, sizeof(cid));
-	length = sizeof(struct bmi_target_info);
-
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, sizeof(cid),
-					(uint8_t *)bmi_rsp_buff, &length,
-					BMI_EXCHANGE_TIMEOUT_MS);
-	if (status) {
-		BMI_ERR("Failed to target info: status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_mem_copy(targ_info, bmi_rsp_buff, length);
-	return CDF_STATUS_SUCCESS;
-}
-
-#ifdef FEATURE_BMI_2
-static inline uint32_t bmi_get_test_addr(void)
-{
-	return BMI_2_TEST_ADDR;
-}
-#else
-static inline uint32_t bmi_get_test_addr(void)
-{
-	return BMI_1_TEST_ADDR;
-}
-#endif
-
-CDF_STATUS bmi_download_firmware(struct ol_softc *scn)
-{
-	uint8_t data[10], out[10];
-	uint32_t address;
-	int32_t ret;
-
-	if (NO_BMI)
-		return CDF_STATUS_SUCCESS; /* no BMI for Q6 bring up */
-
-	if (!scn) {
-		BMI_ERR("Invalid scn context");
-		bmi_assert(0);
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-#ifdef CONFIG_CNSS
-	if (BMI_TEST_ENABLE == cnss_get_bmi_setup()) {
-		ret = snprintf(data, 10, "ABCDEFGHI");
-		BMI_DBG("ret:%d writing data:%s\n", ret, data);
-		address = bmi_get_test_addr();
-
-		if (bmi_init(scn) != CDF_STATUS_SUCCESS) {
-			BMI_WARN("BMI_INIT Failed; No Memory!");
-			goto end;
-		}
-		bmi_command_test(BMI_NO_COMMAND, address, data, 9, scn);
-		bmi_command_test(BMI_WRITE_MEMORY, address, data, 9, scn);
-		bmi_command_test(BMI_READ_MEMORY, address, out, 9, scn);
-		BMI_DBG("Output:%s", out);
-	}
-#endif
-end:
-	return bmi_firmware_download(scn);
-}
-
-CDF_STATUS
-bmi_read_soc_register(uint32_t address, uint32_t *param, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset, param_len;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-
-	bmi_assert(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address)));
-	cdf_mem_set(bmi_cmd_buff, 0, sizeof(cid) + sizeof(address));
-	cdf_mem_set(bmi_rsp_buff, 0, sizeof(cid) + sizeof(address));
-
-	if (scn->bmi_done) {
-		BMI_DBG("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	BMI_DBG("BMI Read SOC Register:device: 0x%p, address: 0x%x",
-			 scn, address);
-
-	cid = BMI_READ_SOC_REGISTER;
-
-	offset = 0;
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-	offset += sizeof(cid);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &address, sizeof(address));
-	offset += sizeof(address);
-	param_len = sizeof(*param);
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-			bmi_rsp_buff, &param_len, BMI_EXCHANGE_TIMEOUT_MS);
-	if (status) {
-		BMI_DBG("Unable to read from the device; status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-	cdf_mem_copy(param, bmi_rsp_buff, sizeof(*param));
-
-	BMI_DBG("BMI Read SOC Register: Exit value: %d", *param);
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_write_soc_register(uint32_t address, uint32_t param, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint32_t size = sizeof(cid) + sizeof(address) + sizeof(param);
-	bmi_assert(BMI_COMMAND_FITS(size));
-	cdf_mem_set(bmi_cmd_buff, 0, size);
-
-	if (scn->bmi_done) {
-		BMI_DBG("Command disallowed");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	BMI_DBG("SOC Register Write:device:0x%p, addr:0x%x, param:%d",
-						scn, address, param);
-
-	cid = BMI_WRITE_SOC_REGISTER;
-
-	offset = 0;
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-	offset += sizeof(cid);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &address, sizeof(address));
-	offset += sizeof(address);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &param, sizeof(param));
-	offset += sizeof(param);
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-						NULL, NULL, 0);
-	if (status) {
-		BMI_ERR("Unable to write to the device: status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	BMI_DBG("BMI Read SOC Register: Exit");
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmilz_data(uint8_t *buffer, uint32_t length, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset;
-	uint32_t remaining, txlen;
-	const uint32_t header = sizeof(cid) + sizeof(length);
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-
-	bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + header));
-	cdf_mem_set(bmi_cmd_buff, 0, BMI_DATASZ_MAX + header);
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	BMI_DBG("BMI Send LZ Data: device: 0x%p, length: %d",
-						scn, length);
-
-	cid = BMI_LZ_DATA;
-
-	remaining = length;
-	while (remaining) {
-		txlen = (remaining < (BMI_DATASZ_MAX - header)) ?
-			remaining : (BMI_DATASZ_MAX - header);
-		offset = 0;
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-		offset += sizeof(cid);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &txlen, sizeof(txlen));
-		offset += sizeof(txlen);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]),
-			&buffer[length - remaining], txlen);
-		offset += txlen;
-		status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-					NULL, NULL, 0);
-		if (status) {
-			BMI_ERR("Failed to write to the device: status:%d",
-								status);
-			return CDF_STATUS_E_FAILURE;
-		}
-		remaining -= txlen;
-	}
-
-	BMI_DBG("BMI LZ Data: Exit");
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_sign_stream_start(uint32_t address,
-		      uint8_t *buffer, uint32_t length, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset;
-	const uint32_t header = sizeof(cid) + sizeof(address) + sizeof(length);
-	uint8_t aligned_buf[BMI_DATASZ_MAX + 4];
-	uint8_t *src;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint32_t remaining, txlen;
-
-	bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + header));
-	cdf_mem_set(bmi_cmd_buff, 0, BMI_DATASZ_MAX + header);
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	BMI_ERR("Sign Stream start:device:0x%p, addr:0x%x, length:%d",
-						scn, address, length);
-
-	cid = BMI_SIGN_STREAM_START;
-	remaining = length;
-	while (remaining) {
-		src = &buffer[length - remaining];
-		if (remaining < (BMI_DATASZ_MAX - header)) {
-			if (remaining & 0x3) {
-				remaining = remaining + (4 - (remaining & 0x3));
-				memcpy(aligned_buf, src, remaining);
-				src = aligned_buf;
-			}
-			txlen = remaining;
-		} else {
-			txlen = (BMI_DATASZ_MAX - header);
-		}
-
-		offset = 0;
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-		offset += sizeof(cid);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &address,
-						sizeof(address));
-		offset += sizeof(offset);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &txlen, sizeof(txlen));
-		offset += sizeof(txlen);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), src, txlen);
-		offset += txlen;
-		status = hif_exchange_bmi_msg(scn,
-					bmi_cmd_buff, offset,
-					NULL, NULL, BMI_EXCHANGE_TIMEOUT_MS);
-		if (status) {
-			BMI_ERR("Unable to write to the device: status:%d",
-								status);
-			return CDF_STATUS_E_FAILURE;
-		}
-		remaining -= txlen;
-	}
-	BMI_DBG("BMI SIGN Stream Start: Exit");
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmilz_stream_start(uint32_t address, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-
-	bmi_assert(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address)));
-	cdf_mem_set(bmi_cmd_buff, 0, sizeof(cid) + sizeof(address));
-
-	if (scn->bmi_done) {
-		BMI_DBG("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-	BMI_DBG("BMI LZ Stream Start: (device: 0x%p, address: 0x%x)",
-						scn, address);
-
-	cid = BMI_LZ_STREAM_START;
-	offset = 0;
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-	offset += sizeof(cid);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &address, sizeof(address));
-	offset += sizeof(address);
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-						NULL, NULL, 0);
-	if (status) {
-		BMI_ERR("Unable to Start LZ Stream to the device status:%d",
-								status);
-		return CDF_STATUS_E_FAILURE;
-	}
-	BMI_DBG("BMI LZ Stream: Exit");
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_fast_download(uint32_t address, uint8_t *buffer,
-		  uint32_t length, struct ol_softc *scn)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t last_word = 0;
-	uint32_t last_word_offset = length & ~0x3;
-	uint32_t unaligned_bytes = length & 0x3;
-
-	status = bmilz_stream_start(address, scn);
-	if (status != CDF_STATUS_SUCCESS)
-		goto end;
-
-	/* copy the last word into a zero padded buffer */
-	if (unaligned_bytes)
-		cdf_mem_copy(&last_word, &buffer[last_word_offset],
-						unaligned_bytes);
-
-	status = bmilz_data(buffer, last_word_offset, scn);
-
-	if (status != CDF_STATUS_SUCCESS)
-		goto end;
-
-	if (unaligned_bytes)
-		status = bmilz_data((uint8_t *) &last_word, 4, scn);
-
-	if (status != CDF_STATUS_SUCCESS)
-		/*
-		 * Close compressed stream and open a new (fake) one.
-		 * This serves mainly to flush Target caches.
-		 */
-		status = bmilz_stream_start(0x00, scn);
-end:
-	return status;
-}
-

+ 0 - 321
core/bmi/src/bmi_1.c

@@ -1,321 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#include "i_bmi.h"
-
-/* APIs visible to the driver */
-
-CDF_STATUS
-bmi_read_memory(uint32_t address,
-		uint8_t *buffer, uint32_t length, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset;
-	uint32_t remaining, rxlen;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-	uint32_t align;
-
-	if (scn->bmi_done) {
-		BMI_DBG("command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!scn->bmi_cmd_buff || !scn->bmi_rsp_buff) {
-		BMI_ERR("BMI Initialization hasn't done");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + sizeof(cid) +
-			sizeof(address) + sizeof(length)));
-	cdf_mem_set(bmi_cmd_buff, 0, BMI_DATASZ_MAX + sizeof(cid) +
-			sizeof(address) + sizeof(length));
-	cdf_mem_set(bmi_rsp_buff, 0, BMI_DATASZ_MAX + sizeof(cid) +
-			sizeof(address) + sizeof(length));
-
-	BMI_DBG("BMI Read: device: 0x%p, address: 0x%x, length: %d",
-						scn, address, length);
-
-	cid = BMI_READ_MEMORY;
-	align = 0;
-	remaining = length;
-
-	while (remaining) {
-		rxlen = (remaining < BMI_DATASZ_MAX) ?
-				remaining : BMI_DATASZ_MAX;
-		offset = 0;
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-		offset += sizeof(cid);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &address,
-						sizeof(address));
-		offset += sizeof(address);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &rxlen, sizeof(rxlen));
-		offset += sizeof(length);
-
-		/* note we reuse the same buffer to receive on */
-		status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-				bmi_rsp_buff, &rxlen, BMI_EXCHANGE_TIMEOUT_MS);
-		if (status) {
-			BMI_ERR("Unable to read from the device");
-			return CDF_STATUS_E_FAILURE;
-		}
-		if (remaining == rxlen) {
-			cdf_mem_copy(&buffer[length - remaining + align],
-					bmi_rsp_buff, rxlen - align);
-			/* last align bytes are invalid */
-		} else {
-			cdf_mem_copy(&buffer[length - remaining + align],
-				 bmi_rsp_buff, rxlen);
-		}
-		remaining -= rxlen;
-		address += rxlen;
-	}
-
-	BMI_DBG("BMI Read Memory: Exit");
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_write_memory(uint32_t address,
-		 uint8_t *buffer, uint32_t length, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset;
-	uint32_t remaining, txlen;
-	const uint32_t header = sizeof(cid) + sizeof(address) + sizeof(length);
-	uint8_t aligned_buffer[BMI_DATASZ_MAX];
-	uint8_t *src;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff) {
-		BMI_ERR("BMI initialization hasn't done");
-		return CDF_STATUS_E_PERM;
-	}
-
-	bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + header));
-	cdf_mem_set(bmi_cmd_buff, 0, BMI_DATASZ_MAX + header);
-
-	BMI_DBG("BMI Write Memory:device: 0x%p, address: 0x%x, length: %d",
-						scn, address, length);
-
-	cid = BMI_WRITE_MEMORY;
-
-	remaining = length;
-	while (remaining) {
-		src = &buffer[length - remaining];
-		if (remaining < (BMI_DATASZ_MAX - header)) {
-			if (remaining & 3) {
-				/* align it with 4 bytes */
-				remaining = remaining + (4 - (remaining & 3));
-				memcpy(aligned_buffer, src, remaining);
-				src = aligned_buffer;
-			}
-			txlen = remaining;
-		} else {
-			txlen = (BMI_DATASZ_MAX - header);
-		}
-		offset = 0;
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-		offset += sizeof(cid);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &address,
-						sizeof(address));
-		offset += sizeof(address);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &txlen, sizeof(txlen));
-		offset += sizeof(txlen);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), src, txlen);
-		offset += txlen;
-		status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-					NULL, NULL, BMI_EXCHANGE_TIMEOUT_MS);
-		if (status) {
-			BMI_ERR("Unable to write to the device; status:%d",
-								status);
-			return CDF_STATUS_E_FAILURE;
-		}
-		remaining -= txlen;
-		address += txlen;
-	}
-
-	BMI_DBG("BMI Write Memory: Exit");
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_execute(uint32_t address, A_UINT32 *param, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t offset;
-	uint32_t param_len;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-	uint32_t size = sizeof(cid) + sizeof(address) + sizeof(param);
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("%s:BMI CMD/RSP Buffer is NULL", __func__);
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	bmi_assert(BMI_COMMAND_FITS(size));
-	cdf_mem_set(bmi_cmd_buff, 0, size);
-	cdf_mem_set(bmi_rsp_buff, 0, size);
-
-
-	BMI_DBG("BMI Execute: device: 0x%p, address: 0x%x, param: %d",
-						scn, address, *param);
-
-	cid = BMI_EXECUTE;
-
-	offset = 0;
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-	offset += sizeof(cid);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &address, sizeof(address));
-	offset += sizeof(address);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), param, sizeof(*param));
-	offset += sizeof(*param);
-	param_len = sizeof(*param);
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-					bmi_rsp_buff, &param_len, 0);
-	if (status) {
-		BMI_ERR("Unable to read from the device status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_mem_copy(param, bmi_rsp_buff, sizeof(*param));
-
-	BMI_DBG("BMI Execute: Exit (param: %d)", *param);
-	return CDF_STATUS_SUCCESS;
-}
-
-inline CDF_STATUS
-bmi_no_command(struct ol_softc *scn)
-{
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_firmware_download(struct ol_softc *scn)
-{
-	CDF_STATUS status;
-	struct bmi_target_info targ_info;
-	cdf_mem_zero(&targ_info, sizeof(targ_info));
-
-	/* Initialize BMI */
-	status = bmi_init(scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("BMI Initialization Failed err:%d", status);
-		return status;
-	}
-
-	/* Get target information */
-	status = bmi_get_target_info(&targ_info, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("BMI Target Info get failed: status:%d", status);
-		return status;
-	}
-
-	scn->target_type = targ_info.target_type;
-	scn->target_version = targ_info.target_ver;
-
-	/* Configure target */
-	status = ol_configure_target(scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("BMI Configure Target Failed status:%d", status);
-		return status;
-	}
-
-	status = ol_download_firmware(scn);
-	if (status != CDF_STATUS_SUCCESS)
-		BMI_ERR("BMI Download Firmware Failed Status:%d", status);
-
-	return status;
-}
-
-CDF_STATUS bmi_done_local(struct ol_softc *scn)
-{
-	int status;
-	uint32_t cid;
-
-	if (!scn) {
-		BMI_ERR("Invalid scn context");
-		bmi_assert(0);
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	if (scn->bmi_done) {
-		BMI_DBG("bmi_done_local skipped");
-		return CDF_STATUS_E_PERM;
-	}
-
-	BMI_DBG("BMI Done: Enter (device: 0x%p)", scn);
-
-	scn->bmi_done = true;
-	cid = BMI_DONE;
-
-	if (!scn->bmi_cmd_buff) {
-		BMI_ERR("Invalid scn BMICmdBuff");
-		bmi_assert(0);
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	cdf_mem_copy(scn->bmi_cmd_buff, &cid, sizeof(cid));
-
-	status = hif_exchange_bmi_msg(scn, scn->bmi_cmd_buff,
-				sizeof(cid), NULL, NULL, 0);
-	if (status) {
-		BMI_ERR("Failed to write to the device; status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (scn->bmi_cmd_buff) {
-		cdf_os_mem_free_consistent(scn->cdf_dev, MAX_BMI_CMDBUF_SZ,
-				    scn->bmi_cmd_buff, scn->bmi_cmd_da, 0);
-		scn->bmi_cmd_buff = NULL;
-		scn->bmi_cmd_da = 0;
-	}
-
-	if (scn->bmi_rsp_buff) {
-		cdf_os_mem_free_consistent(scn->cdf_dev, MAX_BMI_CMDBUF_SZ,
-				    scn->bmi_rsp_buff, scn->bmi_rsp_da, 0);
-		scn->bmi_rsp_buff = NULL;
-		scn->bmi_rsp_da = 0;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}

+ 0 - 452
core/bmi/src/bmi_2.c

@@ -1,452 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-#include "i_bmi.h"
-/* This need to defined in firmware interface files.
- * Defining here to address compilation issues.
- * Will be deleted once firmware interface files for
- * target are merged
- */
-#define BMI_LOAD_IMAGE              18
-
-CDF_STATUS
-bmi_no_command(struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t length;
-	uint8_t ret = 0;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed: BMI DONE ALREADY");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("No Memory Allocated for BMI CMD/RSP Buffer");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-	cid = BMI_NO_COMMAND;
-
-	cdf_mem_copy(bmi_cmd_buff, &cid, sizeof(cid));
-	length = sizeof(ret);
-
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, sizeof(cid),
-			bmi_rsp_buff, &length, BMI_EXCHANGE_TIMEOUT_MS);
-
-	if (status) {
-		BMI_ERR("Failed to write bmi no command status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_mem_copy(&ret, bmi_rsp_buff, length);
-	if (ret != 0) {
-		BMI_ERR("bmi no command response error ret 0x%x", ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_done_local(struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t length;
-	uint8_t ret = 0;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("No Memory Allocated for BMI CMD/RSP Buffer");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-	cid = BMI_DONE;
-
-	cdf_mem_copy(bmi_cmd_buff, &cid, sizeof(cid));
-	length = sizeof(ret);
-
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, sizeof(cid),
-		   bmi_rsp_buff, &length, BMI_EXCHANGE_TIMEOUT_MS);
-
-	if (status) {
-		BMI_ERR("Failed to close BMI on target status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-	cdf_mem_copy(&ret, bmi_rsp_buff, length);
-
-	if (ret != 0) {
-		BMI_ERR("BMI DONE response failed:%d", ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (scn->bmi_cmd_buff) {
-		cdf_os_mem_free_consistent(scn->cdf_dev, MAX_BMI_CMDBUF_SZ,
-				    scn->bmi_cmd_buff, scn->bmi_cmd_da, 0);
-		scn->bmi_cmd_buff = NULL;
-		scn->bmi_cmd_da = 0;
-	}
-
-	if (scn->bmi_rsp_buff) {
-		cdf_os_mem_free_consistent(scn->cdf_dev, MAX_BMI_CMDBUF_SZ,
-				    scn->bmi_rsp_buff, scn->bmi_rsp_da, 0);
-		scn->bmi_rsp_buff = NULL;
-		scn->bmi_rsp_da = 0;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_write_memory(uint32_t address,
-		uint8_t *buffer,
-		uint32_t length,
-		struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t rsp_len;
-	uint8_t ret = 0;
-	uint32_t offset;
-	uint32_t remaining, txlen;
-	const uint32_t header = sizeof(cid) + sizeof(address) + sizeof(length);
-	uint8_t aligned_buffer[BMI_DATASZ_MAX];
-	uint8_t *src;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("BMI Initialization is not happened");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + header));
-	cdf_mem_set(bmi_cmd_buff, 0, BMI_DATASZ_MAX + header);
-
-	cid = BMI_WRITE_MEMORY;
-	rsp_len = sizeof(ret);
-
-	remaining = length;
-	while (remaining) {
-		src = &buffer[length - remaining];
-		if (remaining < (BMI_DATASZ_MAX - header)) {
-			if (remaining & 3) {
-				/* align it with 4 bytes */
-				remaining = remaining + (4 - (remaining & 3));
-				memcpy(aligned_buffer, src, remaining);
-				src = aligned_buffer;
-			}
-			txlen = remaining;
-		} else {
-			txlen = (BMI_DATASZ_MAX - header);
-		}
-		offset = 0;
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-		offset += sizeof(cid);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &address,
-						sizeof(address));
-		offset += sizeof(address);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &txlen, sizeof(txlen));
-		offset += sizeof(txlen);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), src, txlen);
-		offset += txlen;
-		status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-			bmi_rsp_buff, &rsp_len, BMI_EXCHANGE_TIMEOUT_MS);
-		if (status) {
-			BMI_ERR("BMI Write Memory Failed status:%d", status);
-			return CDF_STATUS_E_FAILURE;
-		}
-		cdf_mem_copy(&ret, bmi_rsp_buff, rsp_len);
-		if (ret != 0) {
-			BMI_ERR("BMI Write memory response fail: %x", ret);
-			return CDF_STATUS_E_FAILURE;
-		}
-		remaining -= txlen; address += txlen;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_read_memory(uint32_t address, uint8_t *buffer,
-		uint32_t length, struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint8_t ret = 0;
-	uint32_t offset;
-	uint32_t remaining, rxlen, rsp_len, total_len;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	/* note we reuse the same buffer to receive on */
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-	uint32_t size = sizeof(cid) + sizeof(address) + sizeof(length);
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("BMI Initialization is not done");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	bmi_assert(BMI_COMMAND_FITS(BMI_DATASZ_MAX + size));
-	cdf_mem_set(bmi_cmd_buff, 0, BMI_DATASZ_MAX + size);
-	cdf_mem_set(bmi_rsp_buff, 0, BMI_DATASZ_MAX + size);
-
-	cid = BMI_READ_MEMORY;
-	rsp_len = sizeof(ret);
-	remaining = length;
-
-	while (remaining) {
-		rxlen = (remaining < BMI_DATASZ_MAX - rsp_len) ? remaining :
-						(BMI_DATASZ_MAX - rsp_len);
-		offset = 0;
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-		offset += sizeof(cid);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &address,
-						sizeof(address));
-		offset += sizeof(address);
-		cdf_mem_copy(&(bmi_cmd_buff[offset]), &rxlen, sizeof(rxlen));
-		offset += sizeof(length);
-
-		total_len = rxlen + rsp_len;
-
-		status = hif_exchange_bmi_msg(scn,
-					   bmi_cmd_buff,
-					   offset,
-					   bmi_rsp_buff,
-					   &total_len,
-					   BMI_EXCHANGE_TIMEOUT_MS);
-
-		if (status) {
-			BMI_ERR("BMI Read memory failed status:%d", status);
-			return CDF_STATUS_E_FAILURE;
-		}
-
-		cdf_mem_copy(&ret, bmi_rsp_buff, rsp_len);
-
-		if (ret != 0) {
-			BMI_ERR("bmi read memory response fail %x", ret);
-			return CDF_STATUS_E_FAILURE;
-		}
-
-		cdf_mem_copy(&buffer[length - remaining],
-				(uint8_t *)bmi_rsp_buff	+ rsp_len, rxlen);
-		remaining -= rxlen; address += rxlen;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS
-bmi_execute(uint32_t address, uint32_t *param,
-					struct ol_softc *scn)
-{
-	uint32_t cid;
-	int status;
-	uint32_t length;
-	uint8_t ret = 0;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("No Memory Allocated for bmi buffers");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	cid = BMI_EXECUTE;
-
-	cdf_mem_copy(bmi_cmd_buff, &cid, sizeof(cid));
-	length = sizeof(ret);
-
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, sizeof(cid),
-		   bmi_rsp_buff, &length, BMI_EXCHANGE_TIMEOUT_MS);
-
-	if (status) {
-		BMI_ERR("Failed to do BMI_EXECUTE status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_mem_copy(&ret, bmi_rsp_buff, length);
-
-	if (ret != 0) {
-		BMI_ERR("%s: ret 0x%x", __func__, ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-static CDF_STATUS
-bmi_load_image(dma_addr_t address,
-		uint32_t size, struct ol_softc *scn)
-{
-	uint32_t cid;
-	CDF_STATUS status;
-	uint32_t offset;
-	uint32_t length;
-	uint8_t ret = 0;
-	uint8_t *bmi_cmd_buff = scn->bmi_cmd_buff;
-	uint8_t *bmi_rsp_buff = scn->bmi_rsp_buff;
-	uint32_t addr_h, addr_l;
-
-	if (scn->bmi_done) {
-		BMI_ERR("Command disallowed");
-		return CDF_STATUS_E_PERM;
-	}
-
-	if (!bmi_cmd_buff || !bmi_rsp_buff) {
-		BMI_ERR("No Memory Allocated for BMI CMD/RSP Buffer");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	bmi_assert(BMI_COMMAND_FITS(sizeof(cid) + sizeof(address)));
-	cdf_mem_set(bmi_cmd_buff, 0, sizeof(cid) + sizeof(address));
-
-
-	BMI_DBG("%s: Enter device: 0x%p, size %d", __func__, scn, size);
-
-	cid = BMI_LOAD_IMAGE;
-
-	offset = 0;
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &cid, sizeof(cid));
-	offset += sizeof(cid);
-	addr_l = address & 0xffffffff;
-	addr_h = 0x00;
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &addr_l, sizeof(addr_l));
-	offset += sizeof(addr_l);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &addr_h, sizeof(addr_h));
-	offset += sizeof(addr_h);
-	cdf_mem_copy(&(bmi_cmd_buff[offset]), &size, sizeof(size));
-	offset += sizeof(size);
-	length = sizeof(ret);
-
-	status = hif_exchange_bmi_msg(scn, bmi_cmd_buff, offset,
-		   bmi_rsp_buff, &length, BMI_EXCHANGE_TIMEOUT_MS);
-
-	if (status) {
-		BMI_ERR("BMI Load Image Failed; status:%d", status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_mem_copy(&ret, bmi_rsp_buff, length);
-	if (ret != 0) {
-		BMI_ERR("%s: ret 0x%x", __func__, ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-static CDF_STATUS bmi_enable(struct ol_softc *scn)
-{
-	struct bmi_target_info targ_info;
-	struct image_desc_info image_desc_info;
-	CDF_STATUS status;
-
-	if (!scn) {
-		BMI_ERR("Invalid scn context");
-		bmi_assert(0);
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	if (scn->bmi_cmd_buff == NULL || scn->bmi_rsp_buff == NULL) {
-		BMI_ERR("bmi_open failed!");
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	status = bmi_get_target_info(&targ_info, scn);
-	if (status != CDF_STATUS_SUCCESS)
-			return status;
-
-	BMI_DBG("%s: target type 0x%x, target ver 0x%x", __func__,
-	       targ_info.target_type, targ_info.target_ver);
-	scn->target_type = targ_info.target_type;
-	scn->target_version = targ_info.target_ver;
-
-	if (cnss_get_fw_image(&image_desc_info) != 0) {
-		BMI_ERR("Failed to get fw image");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	status = bmi_load_image(image_desc_info.bdata_addr,
-				image_desc_info.bdata_size,
-				scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Load board data failed! status:%d", status);
-		return status;
-	}
-
-	status = bmi_load_image(image_desc_info.fw_addr,
-				image_desc_info.fw_size,
-				scn);
-	if (status != CDF_STATUS_SUCCESS)
-		BMI_ERR("Load fw image failed! status:%d", status);
-
-	return status;
-}
-
-CDF_STATUS bmi_firmware_download(struct ol_softc *scn)
-{
-	CDF_STATUS status;
-
-	if (NO_BMI)
-		return CDF_STATUS_SUCCESS;
-
-	status = bmi_init(scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("BMI_INIT Failed status:%d", status);
-		goto end;
-	}
-
-	status = bmi_enable(scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("BMI_ENABLE failed status:%d\n", status);
-		goto err_bmi_enable;
-	}
-
-	return status;
-err_bmi_enable:
-	bmi_cleanup(scn);
-end:
-	return status;
-}

+ 0 - 607
core/bmi/src/i_ar6320v2_regtable.h

@@ -1,607 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _AR6320V2_DBG_REGTABLE_H_
-#define _AR6320V2_DBG_REGTABLE_H_
-
-#include "regtable.h"
-
-#define AR6320_REV2_1_REG_SIZE 0x0007F820
-#define AR6320_REV3_REG_SIZE   0x0007F820
-
-#ifdef HIF_PCI
-/*
- * Redefine the register list. To minimize the size of the array, the list must
- * obey the below format. {start0, end0}, {start1, end1}, {start2, end2}.......
- * The value below must obey to "start0 < end0 < start1 < end1 < start2 < ...",
- * otherwise we may encouter error in the dump processing.
- */
-
-static const tgt_reg_section ar6320v2_reg_table[] = {
-	{0x800, 0x810},
-	{0x820, 0x82C},
-	{0x830, 0x8F4},
-	{0x90C, 0x91C},
-	{0xA14, 0xA18},
-	{0xA84, 0xA94},
-	{0xAA8, 0xAD4},
-	{0xADC, 0xB40},
-	{0x1000, 0x10A4},
-	{0x10BC, 0x111C},
-	{0x1134, 0x1138},
-	{0x1144, 0x114C},
-	{0x1150, 0x115C},
-	{0x1160, 0x1178},
-	{0x1240, 0x1260},
-	{0x2000, 0x207C},
-	{0x3000, 0x3014},
-	{0x4000, 0x4014},
-	{0x5000, 0x5124},
-	{0x6000, 0x6040},
-	{0x6080, 0x60CC},
-	{0x6100, 0x611C},
-	{0x6140, 0x61D8},
-	{0x6200, 0x6238},
-	{0x6240, 0x628C},
-	{0x62C0, 0x62EC},
-	{0x6380, 0x63E8},
-	{0x6400, 0x6440},
-	{0x6480, 0x64CC},
-	{0x6500, 0x651C},
-	{0x6540, 0x6580},
-	{0x6600, 0x6638},
-	{0x6640, 0x668C},
-	{0x66C0, 0x66EC},
-	{0x6780, 0x67E8},
-	{0x7080, 0x708C},
-	{0x70C0, 0x70C8},
-	{0x7400, 0x741C},
-	{0x7440, 0x7454},
-	{0x7800, 0x7818},
-	{0x8000, 0x8004},
-	{0x8010, 0x8064},
-	{0x8080, 0x8084},
-	{0x80A0, 0x80A4},
-	{0x80C0, 0x80C4},
-	{0x80E0, 0x80F4},
-	{0x8100, 0x8104},
-	{0x8110, 0x812C},
-	{0x9000, 0x9004},
-	{0x9800, 0x982C},
-	{0x9830, 0x9838},
-	{0x9840, 0x986C},
-	{0x9870, 0x9898},
-	{0x9A00, 0x9C00},
-	{0xD580, 0xD59C},
-	{0xF000, 0xF0E0},
-	{0xF140, 0xF190},
-	{0xF250, 0xF25C},
-	{0xF260, 0xF268},
-	{0xF26C, 0xF2A8},
-	{0x10008, 0x1000C},
-	{0x10014, 0x10018},
-	{0x1001C, 0x10020},
-	{0x10024, 0x10028},
-	{0x10030, 0x10034},
-	{0x10040, 0x10054},
-	{0x10058, 0x1007C},
-	{0x10080, 0x100C4},
-	{0x100C8, 0x10114},
-	{0x1012C, 0x10130},
-	{0x10138, 0x10144},
-	{0x10200, 0x10220},
-	{0x10230, 0x10250},
-	{0x10260, 0x10280},
-	{0x10290, 0x102B0},
-	{0x102C0, 0x102DC},
-	{0x102E0, 0x102F4},
-	{0x102FC, 0x1037C},
-	{0x10380, 0x10390},
-	{0x10800, 0x10828},
-	{0x10840, 0x10844},
-	{0x10880, 0x10884},
-	{0x108C0, 0x108E8},
-	{0x10900, 0x10928},
-	{0x10940, 0x10944},
-	{0x10980, 0x10984},
-	{0x109C0, 0x109E8},
-	{0x10A00, 0x10A28},
-	{0x10A40, 0x10A50},
-	{0x11000, 0x11028},
-	{0x11030, 0x11034},
-	{0x11038, 0x11068},
-	{0x11070, 0x11074},
-	{0x11078, 0x110A8},
-	{0x110B0, 0x110B4},
-	{0x110B8, 0x110E8},
-	{0x110F0, 0x110F4},
-	{0x110F8, 0x11128},
-	{0x11138, 0x11144},
-	{0x11178, 0x11180},
-	{0x111B8, 0x111C0},
-	{0x111F8, 0x11200},
-	{0x11238, 0x1123C},
-	{0x11270, 0x11274},
-	{0x11278, 0x1127C},
-	{0x112B0, 0x112B4},
-	{0x112B8, 0x112BC},
-	{0x112F0, 0x112F4},
-	{0x112F8, 0x112FC},
-	{0x11338, 0x1133C},
-	{0x11378, 0x1137C},
-	{0x113B8, 0x113BC},
-	{0x113F8, 0x113FC},
-	{0x11438, 0x11440},
-	{0x11478, 0x11480},
-	{0x114B8, 0x114BC},
-	{0x114F8, 0x114FC},
-	{0x11538, 0x1153C},
-	{0x11578, 0x1157C},
-	{0x115B8, 0x115BC},
-	{0x115F8, 0x115FC},
-	{0x11638, 0x1163C},
-	{0x11678, 0x1167C},
-	{0x116B8, 0x116BC},
-	{0x116F8, 0x116FC},
-	{0x11738, 0x1173C},
-	{0x11778, 0x1177C},
-	{0x117B8, 0x117BC},
-	{0x117F8, 0x117FC},
-	{0x17000, 0x1701C},
-	{0x17020, 0x170AC},
-	{0x18000, 0x18050},
-	{0x18054, 0x18074},
-	{0x18080, 0x180D4},
-	{0x180DC, 0x18104},
-	{0x18108, 0x1813C},
-	{0x18144, 0x18148},
-	{0x18168, 0x18174},
-	{0x18178, 0x18180},
-	{0x181C8, 0x181E0},
-	{0x181E4, 0x181E8},
-	{0x181EC, 0x1820C},
-	{0x1825C, 0x18280},
-	{0x18284, 0x18290},
-	{0x18294, 0x182A0},
-	{0x18300, 0x18304},
-	{0x18314, 0x18320},
-	{0x18328, 0x18350},
-	{0x1835C, 0x1836C},
-	{0x18370, 0x18390},
-	{0x18398, 0x183AC},
-	{0x183BC, 0x183D8},
-	{0x183DC, 0x183F4},
-	{0x18400, 0x186F4},
-	{0x186F8, 0x1871C},
-	{0x18720, 0x18790},
-	{0x19800, 0x19830},
-	{0x19834, 0x19840},
-	{0x19880, 0x1989C},
-	{0x198A4, 0x198B0},
-	{0x198BC, 0x19900},
-	{0x19C00, 0x19C88},
-	{0x19D00, 0x19D20},
-	{0x19E00, 0x19E7C},
-	{0x19E80, 0x19E94},
-	{0x19E98, 0x19EAC},
-	{0x19EB0, 0x19EBC},
-	{0x19F70, 0x19F74},
-	{0x19F80, 0x19F8C},
-	{0x19FA0, 0x19FB4},
-	{0x19FC0, 0x19FD8},
-	{0x1A000, 0x1A200},
-	{0x1A204, 0x1A210},
-	{0x1A228, 0x1A22C},
-	{0x1A230, 0x1A248},
-	{0x1A250, 0x1A270},
-	{0x1A280, 0x1A290},
-	{0x1A2A0, 0x1A2A4},
-	{0x1A2C0, 0x1A2EC},
-	{0x1A300, 0x1A3BC},
-	{0x1A3F0, 0x1A3F4},
-	{0x1A3F8, 0x1A434},
-	{0x1A438, 0x1A444},
-	{0x1A448, 0x1A468},
-	{0x1A580, 0x1A58C},
-	{0x1A644, 0x1A654},
-	{0x1A670, 0x1A698},
-	{0x1A6AC, 0x1A6B0},
-	{0x1A6D0, 0x1A6D4},
-	{0x1A6EC, 0x1A70C},
-	{0x1A710, 0x1A738},
-	{0x1A7C0, 0x1A7D0},
-	{0x1A7D4, 0x1A7D8},
-	{0x1A7DC, 0x1A7E4},
-	{0x1A7F0, 0x1A7F8},
-	{0x1A888, 0x1A89C},
-	{0x1A8A8, 0x1A8AC},
-	{0x1A8C0, 0x1A8DC},
-	{0x1A8F0, 0x1A8FC},
-	{0x1AE04, 0x1AE08},
-	{0x1AE18, 0x1AE24},
-	{0x1AF80, 0x1AF8C},
-	{0x1AFA0, 0x1AFB4},
-	{0x1B000, 0x1B200},
-	{0x1B284, 0x1B288},
-	{0x1B2D0, 0x1B2D8},
-	{0x1B2DC, 0x1B2EC},
-	{0x1B300, 0x1B340},
-	{0x1B374, 0x1B378},
-	{0x1B380, 0x1B384},
-	{0x1B388, 0x1B38C},
-	{0x1B404, 0x1B408},
-	{0x1B420, 0x1B428},
-	{0x1B440, 0x1B444},
-	{0x1B448, 0x1B44C},
-	{0x1B450, 0x1B458},
-	{0x1B45C, 0x1B468},
-	{0x1B584, 0x1B58C},
-	{0x1B68C, 0x1B690},
-	{0x1B6AC, 0x1B6B0},
-	{0x1B7F0, 0x1B7F8},
-	{0x1C800, 0x1CC00},
-	{0x1CE00, 0x1CE04},
-	{0x1CF80, 0x1CF84},
-	{0x1D200, 0x1D800},
-	{0x1E000, 0x20014},
-	{0x20100, 0x20124},
-	{0x21400, 0x217A8},
-	{0x21800, 0x21BA8},
-	{0x21C00, 0x21FA8},
-	{0x22000, 0x223A8},
-	{0x22400, 0x227A8},
-	{0x22800, 0x22BA8},
-	{0x22C00, 0x22FA8},
-	{0x23000, 0x233A8},
-	{0x24000, 0x24034},
-
-	/*
-	 * EFUSE0,1,2 is disabled here
-	 * because it's state may be reset
-	 *
-	 * {0x24800, 0x24804},
-	 * {0x25000, 0x25004},
-	 * {0x25800, 0x25804},
-	 */
-
-	{0x26000, 0x26064},
-	{0x27000, 0x27024},
-	{0x34000, 0x3400C},
-	{0x34400, 0x3445C},
-	{0x34800, 0x3485C},
-	{0x34C00, 0x34C5C},
-	{0x35000, 0x3505C},
-	{0x35400, 0x3545C},
-	{0x35800, 0x3585C},
-	{0x35C00, 0x35C5C},
-	{0x36000, 0x3605C},
-	{0x38000, 0x38064},
-	{0x38070, 0x380E0},
-	{0x3A000, 0x3A064},
-
-	/* DBI windows is skipped here, it can be only accessed when pcie
-	 * is active (not in reset) and CORE_CTRL_PCIE_LTSSM_EN = 0 &&
-	 * PCIE_CTRL_APP_LTSSM_ENALBE=0.
-	 * {0x3C000 , 0x3C004},
-	 */
-
-	{0x40000, 0x400A4},
-
-	/*
-	 * SI register is skiped here.
-	 * Because it will cause bus hang
-	 *
-	 * {0x50000, 0x50018},
-	 */
-
-	{0x80000, 0x8000C},
-	{0x80010, 0x80020},
-};
-
-static const tgt_reg_section ar6320v3_reg_table[] = {
-	{0x800, 0x810},
-	{0x820, 0x82C},
-	{0x830, 0x8F4},
-	{0x90C, 0x91C},
-	{0xA14, 0xA18},
-	{0xA84, 0xA94},
-	{0xAA8, 0xAD4},
-	{0xADC, 0xB40},
-	{0x1000, 0x10A4},
-	{0x10BC, 0x111C},
-	{0x1134, 0x1138},
-	{0x1144, 0x114C},
-	{0x1150, 0x115C},
-	{0x1160, 0x1178},
-	{0x1240, 0x1260},
-	{0x2000, 0x207C},
-	{0x3000, 0x3014},
-	{0x4000, 0x4014},
-	{0x5000, 0x5124},
-	{0x6000, 0x6040},
-	{0x6080, 0x60CC},
-	{0x6100, 0x611C},
-	{0x6140, 0x61D8},
-	{0x6200, 0x6238},
-	{0x6240, 0x628C},
-	{0x62C0, 0x62EC},
-	{0x6380, 0x63E8},
-	{0x6400, 0x6440},
-	{0x6480, 0x64CC},
-	{0x6500, 0x651C},
-	{0x6540, 0x6580},
-	{0x6600, 0x6638},
-	{0x6640, 0x668C},
-	{0x66C0, 0x66EC},
-	{0x6780, 0x67E8},
-	{0x7080, 0x708C},
-	{0x70C0, 0x70C8},
-	{0x7400, 0x741C},
-	{0x7440, 0x7454},
-	{0x7800, 0x7818},
-	{0x8000, 0x8004},
-	{0x8010, 0x8064},
-	{0x8080, 0x8084},
-	{0x80A0, 0x80A4},
-	{0x80C0, 0x80C4},
-	{0x80E0, 0x80F4},
-	{0x8100, 0x8104},
-	{0x8110, 0x812C},
-	{0x9000, 0x9004},
-	{0x9800, 0x982C},
-	{0x9830, 0x9838},
-	{0x9840, 0x986C},
-	{0x9870, 0x9898},
-	{0x9A00, 0x9C00},
-	{0xD580, 0xD59C},
-	{0xF000, 0xF0E0},
-	{0xF140, 0xF190},
-	{0xF250, 0xF25C},
-	{0xF260, 0xF268},
-	{0xF26C, 0xF2A8},
-	{0x10008, 0x1000C},
-	{0x10014, 0x10018},
-	{0x1001C, 0x10020},
-	{0x10024, 0x10028},
-	{0x10030, 0x10034},
-	{0x10040, 0x10054},
-	{0x10058, 0x1007C},
-	{0x10080, 0x100C4},
-	{0x100C8, 0x10114},
-	{0x1012C, 0x10130},
-	{0x10138, 0x10144},
-	{0x10200, 0x10220},
-	{0x10230, 0x10250},
-	{0x10260, 0x10280},
-	{0x10290, 0x102B0},
-	{0x102C0, 0x102DC},
-	{0x102E0, 0x102F4},
-	{0x102FC, 0x1037C},
-	{0x10380, 0x10390},
-	{0x10800, 0x10828},
-	{0x10840, 0x10844},
-	{0x10880, 0x10884},
-	{0x108C0, 0x108E8},
-	{0x10900, 0x10928},
-	{0x10940, 0x10944},
-	{0x10980, 0x10984},
-	{0x109C0, 0x109E8},
-	{0x10A00, 0x10A28},
-	{0x10A40, 0x10A50},
-	{0x11000, 0x11028},
-	{0x11030, 0x11034},
-	{0x11038, 0x11068},
-	{0x11070, 0x11074},
-	{0x11078, 0x110A8},
-	{0x110B0, 0x110B4},
-	{0x110B8, 0x110E8},
-	{0x110F0, 0x110F4},
-	{0x110F8, 0x11128},
-	{0x11138, 0x11144},
-	{0x11178, 0x11180},
-	{0x111B8, 0x111C0},
-	{0x111F8, 0x11200},
-	{0x11238, 0x1123C},
-	{0x11270, 0x11274},
-	{0x11278, 0x1127C},
-	{0x112B0, 0x112B4},
-	{0x112B8, 0x112BC},
-	{0x112F0, 0x112F4},
-	{0x112F8, 0x112FC},
-	{0x11338, 0x1133C},
-	{0x11378, 0x1137C},
-	{0x113B8, 0x113BC},
-	{0x113F8, 0x113FC},
-	{0x11438, 0x11440},
-	{0x11478, 0x11480},
-	{0x114B8, 0x114BC},
-	{0x114F8, 0x114FC},
-	{0x11538, 0x1153C},
-	{0x11578, 0x1157C},
-	{0x115B8, 0x115BC},
-	{0x115F8, 0x115FC},
-	{0x11638, 0x1163C},
-	{0x11678, 0x1167C},
-	{0x116B8, 0x116BC},
-	{0x116F8, 0x116FC},
-	{0x11738, 0x1173C},
-	{0x11778, 0x1177C},
-	{0x117B8, 0x117BC},
-	{0x117F8, 0x117FC},
-	{0x17000, 0x1701C},
-	{0x17020, 0x170AC},
-	{0x18000, 0x18050},
-	{0x18054, 0x18074},
-	{0x18080, 0x180D4},
-	{0x180DC, 0x18104},
-	{0x18108, 0x1813C},
-	{0x18144, 0x18148},
-	{0x18168, 0x18174},
-	{0x18178, 0x18180},
-	{0x181C8, 0x181E0},
-	{0x181E4, 0x181E8},
-	{0x181EC, 0x1820C},
-	{0x1825C, 0x18280},
-	{0x18284, 0x18290},
-	{0x18294, 0x182A0},
-	{0x18300, 0x18304},
-	{0x18314, 0x18320},
-	{0x18328, 0x18350},
-	{0x1835C, 0x1836C},
-	{0x18370, 0x18390},
-	{0x18398, 0x183AC},
-	{0x183BC, 0x183D8},
-	{0x183DC, 0x183F4},
-	{0x18400, 0x186F4},
-	{0x186F8, 0x1871C},
-	{0x18720, 0x18790},
-	{0x19800, 0x19830},
-	{0x19834, 0x19840},
-	{0x19880, 0x1989C},
-	{0x198A4, 0x198B0},
-	{0x198BC, 0x19900},
-	{0x19C00, 0x19C88},
-	{0x19D00, 0x19D20},
-	{0x19E00, 0x19E7C},
-	{0x19E80, 0x19E94},
-	{0x19E98, 0x19EAC},
-	{0x19EB0, 0x19EBC},
-	{0x19F70, 0x19F74},
-	{0x19F80, 0x19F8C},
-	{0x19FA0, 0x19FB4},
-	{0x19FC0, 0x19FD8},
-	{0x1A000, 0x1A200},
-	{0x1A204, 0x1A210},
-	{0x1A228, 0x1A22C},
-	{0x1A230, 0x1A248},
-	{0x1A250, 0x1A270},
-	{0x1A280, 0x1A290},
-	{0x1A2A0, 0x1A2A4},
-	{0x1A2C0, 0x1A2EC},
-	{0x1A300, 0x1A3BC},
-	{0x1A3F0, 0x1A3F4},
-	{0x1A3F8, 0x1A434},
-	{0x1A438, 0x1A444},
-	{0x1A448, 0x1A468},
-	{0x1A580, 0x1A58C},
-	{0x1A644, 0x1A654},
-	{0x1A670, 0x1A698},
-	{0x1A6AC, 0x1A6B0},
-	{0x1A6D0, 0x1A6D4},
-	{0x1A6EC, 0x1A70C},
-	{0x1A710, 0x1A738},
-	{0x1A7C0, 0x1A7D0},
-	{0x1A7D4, 0x1A7D8},
-	{0x1A7DC, 0x1A7E4},
-	{0x1A7F0, 0x1A7F8},
-	{0x1A888, 0x1A89C},
-	{0x1A8A8, 0x1A8AC},
-	{0x1A8C0, 0x1A8DC},
-	{0x1A8F0, 0x1A8FC},
-	{0x1AE04, 0x1AE08},
-	{0x1AE18, 0x1AE24},
-	{0x1AF80, 0x1AF8C},
-	{0x1AFA0, 0x1AFB4},
-	{0x1B000, 0x1B200},
-	{0x1B284, 0x1B288},
-	{0x1B2D0, 0x1B2D8},
-	{0x1B2DC, 0x1B2EC},
-	{0x1B300, 0x1B340},
-	{0x1B374, 0x1B378},
-	{0x1B380, 0x1B384},
-	{0x1B388, 0x1B38C},
-	{0x1B404, 0x1B408},
-	{0x1B420, 0x1B428},
-	{0x1B440, 0x1B444},
-	{0x1B448, 0x1B44C},
-	{0x1B450, 0x1B458},
-	{0x1B45C, 0x1B468},
-	{0x1B584, 0x1B58C},
-	{0x1B68C, 0x1B690},
-	{0x1B6AC, 0x1B6B0},
-	{0x1B7F0, 0x1B7F8},
-	{0x1C800, 0x1CC00},
-	{0x1CE00, 0x1CE04},
-	{0x1CF80, 0x1CF84},
-	{0x1D200, 0x1D800},
-	{0x1E000, 0x20014},
-	{0x20100, 0x20124},
-	{0x21400, 0x217A8},
-	{0x21800, 0x21BA8},
-	{0x21C00, 0x21FA8},
-	{0x22000, 0x223A8},
-	{0x22400, 0x227A8},
-	{0x22800, 0x22BA8},
-	{0x22C00, 0x22FA8},
-	{0x23000, 0x233A8},
-	{0x24000, 0x24034},
-
-	/*
-	 * EFUSE0,1,2 is disabled here
-	 * because it's state may be reset
-	 *
-	 * {0x24800, 0x24804},
-	 * {0x25000, 0x25004},
-	 * {0x25800, 0x25804},
-	 */
-
-	{0x26000, 0x26064},
-	{0x27000, 0x27024},
-	{0x34000, 0x3400C},
-	{0x34400, 0x3445C},
-	{0x34800, 0x3485C},
-	{0x34C00, 0x34C5C},
-	{0x35000, 0x3505C},
-	{0x35400, 0x3545C},
-	{0x35800, 0x3585C},
-	{0x35C00, 0x35C5C},
-	{0x36000, 0x3605C},
-	{0x38000, 0x38064},
-	{0x38070, 0x380E0},
-	{0x3A000, 0x3A074},
-
-	/*
-	 * DBI windows is skipped here, it can be only accessed when pcie
-	 * is active (not in reset) and CORE_CTRL_PCIE_LTSSM_EN = 0 &&
-	 * PCIE_CTRL_APP_LTSSM_ENALBE=0.
-	 * {0x3C000 , 0x3C004},
-	 */
-
-	{0x40000, 0x400A4},
-
-	/*
-	 * SI register is skiped here.
-	 * Because it will cause bus hang
-	 *
-	 * {0x50000, 0x50018},
-	 */
-
-	{0x80000, 0x8000C},
-	{0x80010, 0x80020},
-};
-#endif
-#endif /* #ifndef _AR6320V2_DBG_REGTABLE_H_ */

+ 0 - 149
core/bmi/src/i_bmi.h

@@ -1,149 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-/* ===================================================================
- * Internal BMI Header File
- */
-
-#ifndef _I_BMI_H_
-#define _I_BMI_H_
-
-#ifdef CONFIG_CNSS
-#include <net/cnss.h>
-#endif
-
-#include "hif.h"
-#include "bmi_msg.h"
-#include "bmi.h"
-#include "ol_fw.h"
-
-#define QCA_FIRMWARE_FILE            "athwlan.bin"
-#define QCA_UTF_FIRMWARE_FILE        "utf.bin"
-#define QCA_BOARD_DATA_FILE          "fakeboar.bin"
-#define QCA_OTP_FILE                 "otp.bin"
-#define QCA_SETUP_FILE               "athsetup.bin"
-#define QCA_FIRMWARE_EPPING_FILE     "epping.bin"
-/*
- * Note that not all the register locations are accessible.
- * A list of accessible target registers are specified with
- * their start and end addresses in a table for given target
- * version. We should NOT access other locations as either
- * they are invalid locations or host does not have read
- * access to it or the value of the particular register
- * read might change
- */
-#define REGISTER_LOCATION       0x00000800
-
-#define DRAM_LOCATION           0x00400000
-#define DRAM_SIZE               0x000a8000
-/* The local base addr is used to read the target dump using pcie I/O reads */
-#define DRAM_LOCAL_BASE_ADDR    (0x100000)
-
-#define IRAM_LOCATION           0x00980000
-#define IRAM_SIZE               0x00038000
-
-#define AXI_LOCATION            0x000a0000
-#define AXI_SIZE                0x00018000
-
-#define CE_OFFSET               0x00000400
-#define CE_USEFUL_SIZE          0x00000058
-
-#define TOTAL_DUMP_SIZE         0x00200000
-#define PCIE_READ_LIMIT         0x00005000
-
-#define SHA256_DIGEST_SIZE      32
-
-/* BMI LOGGING WRAPPERS */
-
-#define BMI_LOG(level, args...) CDF_TRACE(CDF_MODULE_ID_BMI, \
-					level, ##args)
-#define BMI_ERR(args ...)	BMI_LOG(CDF_TRACE_LEVEL_ERROR, args)
-#define BMI_DBG(args ...)	BMI_LOG(CDF_TRACE_LEVEL_DEBUG, args)
-#define BMI_WARN(args ...)	BMI_LOG(CDF_TRACE_LEVEL_WARN, args)
-#define BMI_INFO(args ...)	BMI_LOG(CDF_TRACE_LEVEL_INFO, args)
-/* End of BMI Logging Wrappers */
-
-/* BMI Assert Wrappers */
-#define bmi_assert CDF_BUG
-/*
- * Although we had envisioned BMI to run on top of HTC, this is not how the
- * final implementation ended up. On the Target side, BMI is a part of the BSP
- * and does not use the HTC protocol nor even DMA -- it is intentionally kept
- * very simple.
- */
-
-#define MAX_BMI_CMDBUF_SZ (BMI_DATASZ_MAX + \
-			sizeof(uint32_t) /* cmd */ + \
-			sizeof(uint32_t) /* addr */ + \
-			sizeof(uint32_t))    /* length */
-#define BMI_COMMAND_FITS(sz) ((sz) <= MAX_BMI_CMDBUF_SZ)
-#define BMI_EXCHANGE_TIMEOUT_MS  1000
-
-struct hash_fw {
-	u8 qwlan[SHA256_DIGEST_SIZE];
-	u8 otp[SHA256_DIGEST_SIZE];
-	u8 bdwlan[SHA256_DIGEST_SIZE];
-	u8 utf[SHA256_DIGEST_SIZE];
-};
-
-typedef enum _ATH_BIN_FILE {
-	ATH_OTP_FILE,
-	ATH_FIRMWARE_FILE,
-	ATH_PATCH_FILE,
-	ATH_BOARD_DATA_FILE,
-	ATH_FLASH_FILE,
-	ATH_SETUP_FILE,
-} ATH_BIN_FILE;
-
-#if defined(QCA_WIFI_3_0_ADRASTEA)
-#define NO_BMI 1
-#else
-#define NO_BMI 0
-#endif
-
-CDF_STATUS bmi_execute(uint32_t address, uint32_t *param,
-						struct ol_softc *scn);
-CDF_STATUS bmi_init(struct ol_softc *scn);
-CDF_STATUS bmi_no_command(struct ol_softc *scn);
-CDF_STATUS bmi_read_memory(uint32_t address,
-		uint8_t *buffer, uint32_t length, struct ol_softc *scn);
-CDF_STATUS bmi_write_memory(uint32_t address,
-		uint8_t *buffer, uint32_t length, struct ol_softc *scn);
-CDF_STATUS bmi_fast_download(uint32_t address,
-		uint8_t *buffer, uint32_t length, struct ol_softc *scn);
-CDF_STATUS bmi_read_soc_register(uint32_t address,
-				uint32_t *param, struct ol_softc *scn);
-CDF_STATUS bmi_write_soc_register(uint32_t address,
-				uint32_t param, struct ol_softc *scn);
-CDF_STATUS bmi_get_target_info(
-		struct bmi_target_info *targ_info, struct ol_softc *scn);
-
-CDF_STATUS bmi_firmware_download(struct ol_softc *scn);
-CDF_STATUS bmi_done_local(struct ol_softc *scn);
-
-CDF_STATUS ol_download_firmware(struct ol_softc *scn);
-CDF_STATUS ol_configure_target(struct ol_softc *scn);
-#endif

+ 0 - 1638
core/bmi/src/ol_fw.c

@@ -1,1638 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#include <linux/firmware.h>
-#include "ol_if_athvar.h"
-#include "targaddrs.h"
-#include "ol_cfg.h"
-#include "cds_api.h"
-#include "wma_api.h"
-#include "wma.h"
-#include "bin_sig.h"
-#include "i_ar6320v2_regtable.h"
-#include "epping_main.h"
-#include "ce_reg.h"
-#if  defined(CONFIG_CNSS)
-#include <net/cnss.h>
-#endif
-
-#include "i_bmi.h"
-#include "qwlan_version.h"
-#include "cds_concurrency.h"
-
-#ifdef FEATURE_SECURE_FIRMWARE
-static struct hash_fw fw_hash;
-#endif
-
-static uint32_t refclk_speed_to_hz[] = {
-	48000000,               /* SOC_REFCLK_48_MHZ */
-	19200000,               /* SOC_REFCLK_19_2_MHZ */
-	24000000,               /* SOC_REFCLK_24_MHZ */
-	26000000,               /* SOC_REFCLK_26_MHZ */
-	37400000,               /* SOC_REFCLK_37_4_MHZ */
-	38400000,               /* SOC_REFCLK_38_4_MHZ */
-	40000000,               /* SOC_REFCLK_40_MHZ */
-	52000000,               /* SOC_REFCLK_52_MHZ */
-};
-
-static int ol_target_coredump(void *inst, void *memory_block,
-					uint32_t block_len);
-#ifdef FEATURE_SECURE_FIRMWARE
-static int ol_check_fw_hash(const u8 *data, u32 fw_size, ATH_BIN_FILE file)
-{
-	u8 *hash = NULL;
-#ifdef CONFIG_CNSS
-	u8 *fw_mem = NULL;
-	u8 digest[SHA256_DIGEST_SIZE];
-#endif
-	u8 temp[SHA256_DIGEST_SIZE] = { };
-	int ret = 0;
-
-	switch (file) {
-	case ATH_BOARD_DATA_FILE:
-		hash = fw_hash.bdwlan;
-		break;
-	case ATH_OTP_FILE:
-		hash = fw_hash.otp;
-		break;
-	case ATH_FIRMWARE_FILE:
-#ifdef QCA_WIFI_FTM
-		if (cds_get_conparam() == CDF_GLOBAL_FTM_MODE) {
-			hash = fw_hash.utf;
-			break;
-		}
-#endif
-		hash = fw_hash.qwlan;
-	default:
-		break;
-	}
-
-	if (!hash) {
-		BMI_INFO("No entry for file:%d Download FW in non-secure mode",
-									file);
-		goto end;
-	}
-
-	if (!cdf_mem_compare(hash, temp, SHA256_DIGEST_SIZE)) {
-		BMI_INFO("Download FW in non-secure mode:%d", file);
-		goto end;
-	}
-
-#ifdef CONFIG_CNSS
-	fw_mem = (u8 *)cnss_get_fw_ptr();
-	if (!fw_mem || (fw_size > MAX_FIRMWARE_SIZE)) {
-		BMI_ERR("No Memory to copy FW data");
-		ret = -1;
-		goto end;
-	}
-	cdf_mem_copy(fw_mem, data, fw_size);
-
-	ret = cnss_get_sha_hash(fw_mem, fw_size, "sha256", digest);
-
-	if (ret) {
-		BMI_ERR("Sha256 Hash computation failed err:%d", ret);
-		goto end;
-	}
-
-	if (cdf_mem_compare(hash, digest, SHA256_DIGEST_SIZE) != 0) {
-		BMI_ERR("Hash Mismatch");
-		cdf_trace_hex_dump(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-				   digest, SHA256_DIGEST_SIZE);
-		cdf_trace_hex_dump(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-				   hash, SHA256_DIGEST_SIZE);
-		ret = CDF_STATUS_E_FAILURE;
-	}
-#endif
-end:
-	return ret;
-}
-#endif
-
-static int __ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
-				  uint32_t address, bool compressed)
-{
-	int status = EOK;
-	const char *filename = NULL;
-	const struct firmware *fw_entry;
-	uint32_t fw_entry_size;
-	uint8_t *temp_eeprom;
-	uint32_t board_data_size;
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-	bool bin_sign = false;
-	int bin_off, bin_len;
-	SIGN_HEADER_T *sign_header;
-#endif
-
-	switch (file) {
-	default:
-		BMI_ERR("%s: Unknown file type", __func__);
-		return -1;
-	case ATH_OTP_FILE:
-#if defined(CONFIG_CNSS)
-		filename = scn->fw_files.otp_data;
-#else
-		filename = QCA_OTP_FILE;
-#endif
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-		bin_sign = true;
-#endif
-		break;
-	case ATH_FIRMWARE_FILE:
-		if (WLAN_IS_EPPING_ENABLED(cds_get_conparam())) {
-#if defined(CONFIG_CNSS)
-			filename = scn->fw_files.epping_file;
-#else
-			filename = QCA_FIRMWARE_EPPING_FILE;
-#endif
-			BMI_INFO("%s: Loading epping firmware file %s",
-						__func__, filename);
-			break;
-		}
-#ifdef QCA_WIFI_FTM
-		if (cds_get_conparam() == CDF_GLOBAL_FTM_MODE) {
-#if defined(CONFIG_CNSS)
-			filename = scn->fw_files.utf_file;
-#else
-			filename = QCA_UTF_FIRMWARE_FILE;
-#endif
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-			bin_sign = true;
-#endif
-			BMI_INFO("%s: Loading firmware file %s",
-						__func__, filename);
-			break;
-		}
-#endif
-#if defined(CONFIG_CNSS)
-		filename = scn->fw_files.image_file;
-#else
-		filename = QCA_FIRMWARE_FILE;
-#endif
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-		bin_sign = true;
-#endif
-		break;
-	case ATH_PATCH_FILE:
-		BMI_INFO("%s: no Patch file defined", __func__);
-		return 0;
-	case ATH_BOARD_DATA_FILE:
-#ifdef QCA_WIFI_FTM
-		if (cds_get_conparam() == CDF_GLOBAL_FTM_MODE) {
-#if defined(CONFIG_CNSS)
-			filename = scn->fw_files.utf_board_data;
-#else
-			filename = QCA_BOARD_DATA_FILE;
-#endif
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-			bin_sign = true;
-#endif
-			BMI_INFO("%s: Loading board data file %s",
-						__func__, filename);
-			break;
-		}
-#endif /* QCA_WIFI_FTM */
-#if defined(CONFIG_CNSS)
-		filename = scn->fw_files.board_data;
-#else
-		filename = QCA_BOARD_DATA_FILE;
-#endif
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-		bin_sign = false;
-#endif
-		break;
-	case ATH_SETUP_FILE:
-		if (cds_get_conparam() != CDF_GLOBAL_FTM_MODE &&
-		    !WLAN_IS_EPPING_ENABLED(cds_get_conparam())) {
-#ifdef CONFIG_CNSS
-			BMI_INFO("%s: no Setup file defined", __func__);
-			return -1;
-#else
-			filename = QCA_SETUP_FILE;
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-			bin_sign = true;
-#endif
-			BMI_INFO("%s: Loading setup file %s",
-			       __func__, filename);
-#endif /* CONFIG_CNSS */
-		} else {
-			BMI_INFO("%s: no Setup file needed", __func__);
-			return -1;
-		}
-		break;
-	}
-
-	if (request_firmware(&fw_entry, filename, scn->aps_osdev.device) != 0) {
-		BMI_ERR("%s: Failed to get %s", __func__, filename);
-
-		if (file == ATH_OTP_FILE)
-			return -ENOENT;
-
-#if defined(QCA_WIFI_FTM) && defined(CONFIG_CNSS)
-		/* Try default board data file if FTM specific
-		 * board data file is not present. */
-		if (filename == scn->fw_files.utf_board_data) {
-			filename = scn->fw_files.board_data;
-			BMI_INFO("%s: Trying to load default %s",
-			       __func__, filename);
-			if (request_firmware(&fw_entry, filename,
-					     scn->aps_osdev.device) != 0) {
-				BMI_ERR("%s: Failed to get %s",
-				       __func__, filename);
-				return -1;
-			}
-		} else {
-			return -1;
-		}
-#else
-		return -1;
-#endif
-	}
-
-	if (!fw_entry || !fw_entry->data) {
-		BMI_ERR("Invalid fw_entries");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	fw_entry_size = fw_entry->size;
-	temp_eeprom = NULL;
-
-#ifdef FEATURE_SECURE_FIRMWARE
-
-	if (ol_check_fw_hash(fw_entry->data, fw_entry_size, file)) {
-		BMI_ERR("Hash Check failed for file:%s", filename);
-		status = CDF_STATUS_E_FAILURE;
-		goto end;
-	}
-#endif
-
-	if (file == ATH_BOARD_DATA_FILE) {
-		uint32_t board_ext_address;
-		int32_t board_ext_data_size;
-
-		temp_eeprom = cdf_mem_malloc(fw_entry_size);
-		if (!temp_eeprom) {
-			BMI_ERR("%s: Memory allocation failed", __func__);
-			release_firmware(fw_entry);
-			return CDF_STATUS_E_NOMEM;
-		}
-
-		cdf_mem_copy(temp_eeprom, (uint8_t *) fw_entry->data,
-			  fw_entry_size);
-
-		switch (scn->target_type) {
-		default:
-			board_data_size = 0;
-			board_ext_data_size = 0;
-			break;
-		case TARGET_TYPE_AR6004:
-			board_data_size = AR6004_BOARD_DATA_SZ;
-			board_ext_data_size = AR6004_BOARD_EXT_DATA_SZ;
-		case TARGET_TYPE_AR9888:
-			board_data_size = AR9888_BOARD_DATA_SZ;
-			board_ext_data_size = AR9888_BOARD_EXT_DATA_SZ;
-			break;
-		}
-
-		/* Determine where in Target RAM to write Board Data */
-		bmi_read_memory(HOST_INTEREST_ITEM_ADDRESS(scn->target_type,
-							   hi_board_ext_data),
-				(uint8_t *) &board_ext_address, 4, scn);
-		BMI_INFO("Board extended Data download address: 0x%x",
-		       board_ext_address);
-
-		/* Check whether the target has allocated memory for extended
-		 * board data and file contains extended board data
-		 */
-
-		if ((board_ext_address)
-		    && (fw_entry_size ==
-			(board_data_size + board_ext_data_size))) {
-			uint32_t param;
-
-			status = bmi_write_memory(board_ext_address,
-					(uint8_t *)(temp_eeprom +
-					board_data_size),
-					board_ext_data_size, scn);
-
-			if (status != EOK)
-				goto end;
-
-			/* Record extended board Data initialized */
-			param = (board_ext_data_size << 16) | 1;
-			bmi_write_memory(
-				HOST_INTEREST_ITEM_ADDRESS(scn->target_type,
-					hi_board_ext_data_config),
-					(uint8_t *)&param, 4, scn);
-
-			fw_entry_size = board_data_size;
-		}
-	}
-#ifdef QCA_SIGNED_SPLIT_BINARY_SUPPORT
-	if (bin_sign) {
-		uint32_t chip_id;
-
-		if (fw_entry_size < sizeof(SIGN_HEADER_T)) {
-			BMI_ERR("Invalid binary size %d", fw_entry_size);
-			status = CDF_STATUS_E_FAILURE;
-			goto end;
-		}
-
-		sign_header = (SIGN_HEADER_T *) fw_entry->data;
-		chip_id = cpu_to_le32(sign_header->product_id);
-		if (sign_header->magic_num == SIGN_HEADER_MAGIC
-		    && (chip_id == AR6320_REV1_1_VERSION
-			|| chip_id == AR6320_REV1_3_VERSION
-			|| chip_id == AR6320_REV2_1_VERSION)) {
-
-			status = bmi_sign_stream_start(address,
-						(uint8_t *)fw_entry->data,
-						sizeof(SIGN_HEADER_T), scn);
-			if (status != EOK) {
-				BMI_ERR("unable to start sign stream");
-				status = CDF_STATUS_E_FAILURE;
-				goto end;
-			}
-
-			bin_off = sizeof(SIGN_HEADER_T);
-			bin_len = sign_header->rampatch_len
-				  - sizeof(SIGN_HEADER_T);
-		} else {
-			bin_sign = false;
-			bin_off = 0;
-			bin_len = fw_entry_size;
-		}
-	} else {
-		bin_len = fw_entry_size;
-		bin_off = 0;
-	}
-
-	if (compressed) {
-		status = bmi_fast_download(address,
-					   (uint8_t *) fw_entry->data + bin_off,
-					   bin_len, scn);
-	} else {
-		if (file == ATH_BOARD_DATA_FILE && fw_entry->data) {
-			status = bmi_write_memory(address,
-						  (uint8_t *) temp_eeprom,
-						  fw_entry_size, scn);
-		} else {
-			status = bmi_write_memory(address,
-						  (uint8_t *) fw_entry->data
-						  + bin_off, bin_len, scn);
-		}
-	}
-
-	if (bin_sign) {
-		bin_off += bin_len;
-		bin_len = sign_header->total_len - sign_header->rampatch_len;
-
-		if (bin_len > 0) {
-			status = bmi_sign_stream_start(0,
-					(uint8_t *)fw_entry->data +
-					bin_off, bin_len, scn);
-			if (status != EOK)
-				BMI_ERR("sign stream error");
-		}
-	}
-#else
-	if (compressed) {
-		status = bmi_fast_download(address,
-					   (uint8_t *) fw_entry->data,
-					   fw_entry_size, scn);
-	} else {
-		if (file == ATH_BOARD_DATA_FILE && fw_entry->data) {
-			status = bmi_write_memory(address,
-						  (uint8_t *) temp_eeprom,
-						  fw_entry_size, scn);
-		} else {
-			status = bmi_write_memory(address,
-						  (uint8_t *) fw_entry->data,
-						  fw_entry_size, scn);
-		}
-	}
-#endif /* QCA_SIGNED_SPLIT_BINARY_SUPPORT */
-
-end:
-	if (temp_eeprom)
-		cdf_mem_free(temp_eeprom);
-
-	if (status != EOK) {
-		BMI_ERR("%s, BMI operation failed: %d", __func__, __LINE__);
-		release_firmware(fw_entry);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	release_firmware(fw_entry);
-
-	BMI_INFO("transferring file: %s size %d bytes done!",
-		(filename != NULL) ? filename : " ", fw_entry_size);
-
-	return status;
-}
-
-static int ol_transfer_bin_file(struct ol_softc *scn, ATH_BIN_FILE file,
-				uint32_t address, bool compressed)
-{
-	int ret;
-
-#ifdef CONFIG_CNSS
-	/* Wait until suspend and resume are completed before loading FW */
-	cnss_lock_pm_sem();
-#endif
-
-	ret = __ol_transfer_bin_file(scn, file, address, compressed);
-
-#ifdef CONFIG_CNSS
-	cnss_release_pm_sem();
-#endif
-
-	return ret;
-}
-
-int dump_ce_register(struct ol_softc *scn)
-{
-	uint32_t ce_reg_address = CE0_BASE_ADDRESS;
-	uint32_t ce_reg_values[8][CE_USEFUL_SIZE >> 2];
-	uint32_t ce_reg_word_size = CE_USEFUL_SIZE >> 2;
-	uint16_t i, j;
-
-	for (i = 0; i < 8; i++, ce_reg_address += CE_OFFSET) {
-		if (hif_diag_read_mem(scn, ce_reg_address,
-			(uint8_t *) &ce_reg_values[i][0], ce_reg_word_size *
-			sizeof(uint32_t)) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("Dumping CE register failed!");
-			return -EACCES;
-		}
-	}
-
-	for (i = 0; i < 8; i++) {
-		BMI_ERR("CE%d Registers:", i);
-		for (j = 0; j < ce_reg_word_size; j++) {
-			BMI_ERR("0x%08x ", ce_reg_values[i][j]);
-			if (!((j + 1) % 5) || (ce_reg_word_size - 1) == j)
-				BMI_ERR(" ");
-		}
-	}
-
-	return 0;
-}
-
-#if  defined(CONFIG_CNSS)
-
-static struct ol_softc *ramdump_scn;
-
-int ol_copy_ramdump(struct ol_softc *scn)
-{
-	int ret;
-
-	if (!scn->ramdump_base || !scn->ramdump_size) {
-		BMI_ERR("%s:ramdump collection fail", __func__);
-		ret = -EACCES;
-		goto out;
-	}
-
-	ret = ol_target_coredump(scn, scn->ramdump_base, scn->ramdump_size);
-
-out:
-	return ret;
-}
-
-static void ramdump_work_handler(struct work_struct *ramdump)
-{
-	int ret;
-	uint32_t host_interest_address;
-	uint32_t dram_dump_values[4];
-
-	if (!ramdump_scn) {
-		BMI_ERR("%s:Ramdump_scn is null:", __func__);
-		goto out_fail;
-	}
-#ifdef DEBUG
-	ret = hif_check_soc_status(ramdump_scn);
-	if (ret)
-		goto out_fail;
-
-	ret = dump_ce_register(ramdump_scn);
-	if (ret)
-		goto out_fail;
-
-	dump_ce_debug_register(ramdump_scn);
-#endif
-
-	if (hif_diag_read_mem(ramdump_scn,
-			hif_hia_item_address(ramdump_scn->target_type,
-			offsetof(struct host_interest_s, hi_failure_state)),
-			(uint8_t *)&host_interest_address,
-			sizeof(uint32_t)) != CDF_STATUS_SUCCESS) {
-		BMI_ERR("HifDiagReadiMem FW Dump Area Pointer failed!");
-		ol_copy_ramdump(ramdump_scn);
-		cnss_device_crashed();
-		return;
-	}
-
-	BMI_ERR("Host interest item address: 0x%08x", host_interest_address);
-
-	if (hif_diag_read_mem(ramdump_scn, host_interest_address,
-			      (uint8_t *) &dram_dump_values[0],
-			      4 * sizeof(uint32_t)) != CDF_STATUS_SUCCESS) {
-		BMI_ERR("HifDiagReadiMem FW Dump Area failed!");
-		goto out_fail;
-	}
-	BMI_ERR("FW Assertion at PC: 0x%08x BadVA: 0x%08x TargetID: 0x%08x",
-	       dram_dump_values[2], dram_dump_values[3], dram_dump_values[0]);
-
-	if (ol_copy_ramdump(ramdump_scn))
-		goto out_fail;
-
-	BMI_ERR("%s: RAM dump collecting completed!", __func__);
-	/* notify SSR framework the target has crashed. */
-	cnss_device_crashed();
-	return;
-
-out_fail:
-	/* Silent SSR on dump failure */
-#ifdef CNSS_SELF_RECOVERY
-	cnss_device_self_recovery();
-#else
-	cnss_device_crashed();
-#endif
-	return;
-}
-
-static DECLARE_WORK(ramdump_work, ramdump_work_handler);
-
-void ol_schedule_ramdump_work(struct ol_softc *scn)
-{
-	ramdump_scn = scn;
-	schedule_work(&ramdump_work);
-}
-
-static void fw_indication_work_handler(struct work_struct *fw_indication)
-{
-	cnss_device_self_recovery();
-}
-
-static DECLARE_WORK(fw_indication_work, fw_indication_work_handler);
-
-void ol_schedule_fw_indication_work(struct ol_softc *scn)
-{
-	schedule_work(&fw_indication_work);
-}
-#endif
-
-void ol_target_failure(void *instance, CDF_STATUS status)
-{
-	struct ol_softc *scn = (struct ol_softc *)instance;
-	tp_wma_handle wma = cds_get_context(CDF_MODULE_ID_WMA);
-	int ret;
-
-	cdf_event_set(&wma->recovery_event);
-
-	if (OL_TRGET_STATUS_RESET == scn->target_status) {
-		BMI_ERR("Target is already asserted, ignore!");
-		return;
-	}
-	scn->target_status = OL_TRGET_STATUS_RESET;
-
-	if (cds_is_driver_recovering()) {
-		BMI_ERR("%s: Recovery in progress, ignore!\n", __func__);
-		return;
-	}
-
-	if (cds_is_load_or_unload_in_progress()) {
-		BMI_ERR("%s: Loading/Unloading is in progress, ignore!",
-		       __func__);
-		return;
-	}
-	cds_set_recovery_in_progress(true);
-
-#ifdef CONFIG_CNSS
-	ret = hif_check_fw_reg(scn);
-	if (0 == ret) {
-		if (scn->enable_self_recovery) {
-			ol_schedule_fw_indication_work(scn);
-			return;
-		}
-	} else if (-1 == ret) {
-		return;
-	}
-#endif
-
-	BMI_ERR("XXX TARGET ASSERTED XXX");
-
-#if  defined(CONFIG_CNSS)
-	/* Collect the RAM dump through a workqueue */
-	if (scn->enable_ramdump_collection)
-		ol_schedule_ramdump_work(scn);
-	else
-		pr_debug("%s: athdiag read for target reg\n", __func__);
-#endif
-
-	return;
-}
-
-CDF_STATUS ol_configure_target(struct ol_softc *scn)
-{
-	uint32_t param;
-#ifdef CONFIG_CNSS
-	struct cnss_platform_cap cap;
-	int ret;
-#endif
-
-	/* Tell target which HTC version it is used */
-	param = HTC_PROTOCOL_VERSION;
-	if (bmi_write_memory(
-		hif_hia_item_address(scn->target_type,
-		offsetof(struct host_interest_s, hi_app_host_interest)),
-		(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
-		BMI_ERR("bmi_write_memory for htc version failed");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* set the firmware mode to STA/IBSS/AP */
-	{
-		if (bmi_read_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag)),
-			(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("bmi_read_memory for setting fwmode failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-
-		/* TODO following parameters need to be re-visited. */
-		param |= (1 << HI_OPTION_NUM_DEV_SHIFT); /* num_device */
-		/* Firmware mode ?? */
-		param |= (HI_OPTION_FW_MODE_AP << HI_OPTION_FW_MODE_SHIFT);
-		/* mac_addr_method */
-		param |= (1 << HI_OPTION_MAC_ADDR_METHOD_SHIFT);
-		/* firmware_bridge */
-		param |= (0 << HI_OPTION_FW_BRIDGE_SHIFT);
-		/* fwsubmode */
-		param |= (0 << HI_OPTION_FW_SUBMODE_SHIFT);
-
-		BMI_INFO("NUM_DEV=%d FWMODE=0x%x FWSUBMODE=0x%x FWBR_BUF %d",
-		       1, HI_OPTION_FW_MODE_AP, 0, 0);
-
-		if (bmi_write_memory(
-			hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag)),
-			(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("BMI WRITE for setting fwmode failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-
-#if (CONFIG_DISABLE_CDC_MAX_PERF_WAR)
-	{
-		/* set the firmware to disable CDC max perf WAR */
-		if (bmi_read_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag2)),
-			(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("BMI READ for setting cdc max perf failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-
-		param |= HI_OPTION_DISABLE_CDC_MAX_PERF_WAR;
-		if (bmi_write_memory(
-			hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag2)),
-			(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("setting cdc max perf failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-#endif /* CONFIG_CDC_MAX_PERF_WAR */
-
-#ifdef CONFIG_CNSS
-
-	ret = cnss_get_platform_cap(&cap);
-	if (ret)
-		BMI_ERR("platform capability info from CNSS not available");
-
-	if (!ret && cap.cap_flag & CNSS_HAS_EXTERNAL_SWREG) {
-		if (bmi_read_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag2)),
-			(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("bmi_read_memory for setting"
-				"external SWREG failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-
-		param |= HI_OPTION_USE_EXT_LDO;
-		if (bmi_write_memory(
-			hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag2)),
-			(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("BMI WRITE for setting external SWREG fail");
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-#endif
-
-#ifdef WLAN_FEATURE_LPSS
-	if (scn->enablelpasssupport) {
-		if (bmi_read_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag2)),
-			(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("BMI READ:Setting LPASS Support failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-
-		param |= HI_OPTION_DBUART_SUPPORT;
-		if (bmi_write_memory(
-			hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag2)),
-			(uint8_t *)&param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("BMI_READ for setting LPASS Support fail");
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-#endif
-
-	/* If host is running on a BE CPU, set the host interest area */
-	{
-#ifdef BIG_ENDIAN_HOST
-		param = 1;
-#else
-		param = 0;
-#endif
-		if (bmi_write_memory(
-			hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_be)),
-			(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
-			BMI_ERR("setting host CPU BE mode failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-
-	/* FW descriptor/Data swap flags */
-	param = 0;
-	if (bmi_write_memory(
-		hif_hia_item_address(scn->target_type,
-		offsetof(struct host_interest_s, hi_fw_swap)),
-		(uint8_t *) &param, 4, scn) != CDF_STATUS_SUCCESS) {
-		BMI_ERR("BMI WRITE failed setting FW data/desc swap flags");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-static int ol_check_dataset_patch(struct ol_softc *scn, uint32_t *address)
-{
-	/* Check if patch file needed for this target type/version. */
-	return 0;
-}
-
-
-CDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk,
-				     struct cmnos_clock_s *clock_s)
-{
-	if (!clock_s)
-		return CDF_STATUS_E_FAILURE;
-
-	switch (refclk) {
-	case SOC_REFCLK_48_MHZ:
-		clock_s->wlan_pll.div = 0xE;
-		clock_s->wlan_pll.rnfrac = 0x2AAA8;
-		clock_s->pll_settling_time = 2400;
-		break;
-	case SOC_REFCLK_19_2_MHZ:
-		clock_s->wlan_pll.div = 0x24;
-		clock_s->wlan_pll.rnfrac = 0x2AAA8;
-		clock_s->pll_settling_time = 960;
-		break;
-	case SOC_REFCLK_24_MHZ:
-		clock_s->wlan_pll.div = 0x1D;
-		clock_s->wlan_pll.rnfrac = 0x15551;
-		clock_s->pll_settling_time = 1200;
-		break;
-	case SOC_REFCLK_26_MHZ:
-		clock_s->wlan_pll.div = 0x1B;
-		clock_s->wlan_pll.rnfrac = 0x4EC4;
-		clock_s->pll_settling_time = 1300;
-		break;
-	case SOC_REFCLK_37_4_MHZ:
-		clock_s->wlan_pll.div = 0x12;
-		clock_s->wlan_pll.rnfrac = 0x34B49;
-		clock_s->pll_settling_time = 1870;
-		break;
-	case SOC_REFCLK_38_4_MHZ:
-		clock_s->wlan_pll.div = 0x12;
-		clock_s->wlan_pll.rnfrac = 0x15551;
-		clock_s->pll_settling_time = 1920;
-		break;
-	case SOC_REFCLK_40_MHZ:
-		clock_s->wlan_pll.div = 0x11;
-		clock_s->wlan_pll.rnfrac = 0x26665;
-		clock_s->pll_settling_time = 2000;
-		break;
-	case SOC_REFCLK_52_MHZ:
-		clock_s->wlan_pll.div = 0x1B;
-		clock_s->wlan_pll.rnfrac = 0x4EC4;
-		clock_s->pll_settling_time = 2600;
-		break;
-	case SOC_REFCLK_UNKNOWN:
-		clock_s->wlan_pll.refdiv = 0;
-		clock_s->wlan_pll.div = 0;
-		clock_s->wlan_pll.rnfrac = 0;
-		clock_s->wlan_pll.outdiv = 0;
-		clock_s->pll_settling_time = 1024;
-		clock_s->refclk_hz = 0;
-	default:
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	clock_s->refclk_hz = refclk_speed_to_hz[refclk];
-	clock_s->wlan_pll.refdiv = 0;
-	clock_s->wlan_pll.outdiv = 1;
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS ol_patch_pll_switch(struct ol_softc *scn)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	uint32_t addr = 0;
-	uint32_t reg_val = 0;
-	uint32_t mem_val = 0;
-	struct cmnos_clock_s clock_s;
-	uint32_t cmnos_core_clk_div_addr = 0;
-	uint32_t cmnos_cpu_pll_init_done_addr = 0;
-	uint32_t cmnos_cpu_speed_addr = 0;
-
-	switch (scn->target_version) {
-	case AR6320_REV1_1_VERSION:
-		cmnos_core_clk_div_addr = AR6320_CORE_CLK_DIV_ADDR;
-		cmnos_cpu_pll_init_done_addr = AR6320_CPU_PLL_INIT_DONE_ADDR;
-		cmnos_cpu_speed_addr = AR6320_CPU_SPEED_ADDR;
-		break;
-	case AR6320_REV1_3_VERSION:
-	case AR6320_REV2_1_VERSION:
-		cmnos_core_clk_div_addr = AR6320V2_CORE_CLK_DIV_ADDR;
-		cmnos_cpu_pll_init_done_addr = AR6320V2_CPU_PLL_INIT_DONE_ADDR;
-		cmnos_cpu_speed_addr = AR6320V2_CPU_SPEED_ADDR;
-		break;
-	case AR6320_REV3_VERSION:
-	case AR6320_REV3_2_VERSION:
-		cmnos_core_clk_div_addr = AR6320V3_CORE_CLK_DIV_ADDR;
-		cmnos_cpu_pll_init_done_addr = AR6320V3_CPU_PLL_INIT_DONE_ADDR;
-		cmnos_cpu_speed_addr = AR6320V3_CPU_SPEED_ADDR;
-		break;
-	default:
-		BMI_ERR("%s: Unsupported target version %x", __func__,
-		       scn->target_version);
-		goto end;
-	}
-
-	addr = (RTC_SOC_BASE_ADDRESS | EFUSE_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read EFUSE Addr");
-		goto end;
-	}
-
-	status = ol_fw_populate_clk_settings(EFUSE_XTAL_SEL_GET(reg_val),
-					     &clock_s);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to set clock settings");
-		goto end;
-	}
-	BMI_DBG("crystal_freq: %dHz", clock_s.refclk_hz);
-
-	/* ------Step 1---- */
-	reg_val = 0;
-	addr = (RTC_SOC_BASE_ADDRESS | BB_PLL_CONFIG_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read PLL_CONFIG Addr");
-		goto end;
-	}
-	BMI_DBG("Step 1a: %8X", reg_val);
-
-	reg_val &= ~(BB_PLL_CONFIG_FRAC_MASK | BB_PLL_CONFIG_OUTDIV_MASK);
-	reg_val |= (BB_PLL_CONFIG_FRAC_SET(clock_s.wlan_pll.rnfrac) |
-		    BB_PLL_CONFIG_OUTDIV_SET(clock_s.wlan_pll.outdiv));
-	status = bmi_write_soc_register(addr, reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write PLL_CONFIG Addr");
-		goto end;
-	}
-
-	reg_val = 0;
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read back PLL_CONFIG Addr");
-		goto end;
-	}
-	BMI_DBG("Step 1b: %8X", reg_val);
-
-	/* ------Step 2---- */
-	reg_val = 0;
-	addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_SETTLE_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read PLL_SETTLE Addr");
-		goto end;
-	}
-	BMI_DBG("Step 2a: %8X", reg_val);
-
-	reg_val &= ~WLAN_PLL_SETTLE_TIME_MASK;
-	reg_val |= WLAN_PLL_SETTLE_TIME_SET(clock_s.pll_settling_time);
-	status = bmi_write_soc_register(addr, reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write PLL_SETTLE Addr");
-		goto end;
-	}
-
-	reg_val = 0;
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read back PLL_SETTLE Addr");
-		goto end;
-	}
-	BMI_DBG("Step 2b: %8X", reg_val);
-
-	/* ------Step 3---- */
-	reg_val = 0;
-	addr = (RTC_SOC_BASE_ADDRESS | SOC_CORE_CLK_CTRL_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read CLK_CTRL Addr");
-		goto end;
-	}
-	BMI_DBG("Step 3a: %8X", reg_val);
-
-	reg_val &= ~SOC_CORE_CLK_CTRL_DIV_MASK;
-	reg_val |= SOC_CORE_CLK_CTRL_DIV_SET(1);
-	status = bmi_write_soc_register(addr, reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write CLK_CTRL Addr");
-		goto end;
-	}
-
-	reg_val = 0;
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read back CLK_CTRL Addr");
-		goto end;
-	}
-	BMI_DBG("Step 3b: %8X", reg_val);
-
-	/* ------Step 4----- */
-	mem_val = 1;
-	status = bmi_write_memory(cmnos_core_clk_div_addr,
-				  (uint8_t *) &mem_val, 4, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write CLK_DIV Addr");
-		goto end;
-	}
-
-	/* ------Step 5----- */
-	reg_val = 0;
-	addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_CONTROL_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read PLL_CTRL Addr");
-		goto end;
-	}
-	BMI_DBG("Step 5a: %8X", reg_val);
-
-	reg_val &= ~(WLAN_PLL_CONTROL_REFDIV_MASK | WLAN_PLL_CONTROL_DIV_MASK |
-		     WLAN_PLL_CONTROL_NOPWD_MASK);
-	reg_val |= (WLAN_PLL_CONTROL_REFDIV_SET(clock_s.wlan_pll.refdiv) |
-		    WLAN_PLL_CONTROL_DIV_SET(clock_s.wlan_pll.div) |
-		    WLAN_PLL_CONTROL_NOPWD_SET(1));
-	status = bmi_write_soc_register(addr, reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write PLL_CTRL Addr");
-		goto end;
-	}
-
-	reg_val = 0;
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read back PLL_CTRL Addr");
-		goto end;
-	}
-	OS_DELAY(100);
-	BMI_DBG("Step 5b: %8X", reg_val);
-
-	/* ------Step 6------- */
-	do {
-		reg_val = 0;
-		status = bmi_read_soc_register((RTC_WMAC_BASE_ADDRESS |
-				RTC_SYNC_STATUS_OFFSET), &reg_val, scn);
-		if (status != CDF_STATUS_SUCCESS) {
-			BMI_ERR("Failed to read RTC_SYNC_STATUS Addr");
-			goto end;
-		}
-	} while (RTC_SYNC_STATUS_PLL_CHANGING_GET(reg_val));
-
-	/* ------Step 7------- */
-	reg_val = 0;
-	addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_CONTROL_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read PLL_CTRL Addr for CTRL_BYPASS");
-		goto end;
-	}
-	BMI_DBG("Step 7a: %8X", reg_val);
-
-	reg_val &= ~WLAN_PLL_CONTROL_BYPASS_MASK;
-	reg_val |= WLAN_PLL_CONTROL_BYPASS_SET(0);
-	status = bmi_write_soc_register(addr, reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write PLL_CTRL Addr for CTRL_BYPASS");
-		goto end;
-	}
-
-	reg_val = 0;
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read back PLL_CTRL Addr for CTRL_BYPASS");
-		goto end;
-	}
-	BMI_DBG("Step 7b: %8X", reg_val);
-
-	/* ------Step 8-------- */
-	do {
-		reg_val = 0;
-		status = bmi_read_soc_register((RTC_WMAC_BASE_ADDRESS |
-				RTC_SYNC_STATUS_OFFSET), &reg_val, scn);
-		if (status != CDF_STATUS_SUCCESS) {
-			BMI_ERR("Failed to read SYNC_STATUS Addr");
-			goto end;
-		}
-	} while (RTC_SYNC_STATUS_PLL_CHANGING_GET(reg_val));
-
-	/* ------Step 9-------- */
-	reg_val = 0;
-	addr = (RTC_SOC_BASE_ADDRESS | SOC_CPU_CLOCK_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read CPU_CLK Addr");
-		goto end;
-	}
-	BMI_DBG("Step 9a: %8X", reg_val);
-
-	reg_val &= ~SOC_CPU_CLOCK_STANDARD_MASK;
-	reg_val |= SOC_CPU_CLOCK_STANDARD_SET(1);
-	status = bmi_write_soc_register(addr, reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write CPU_CLK Addr");
-		goto end;
-	}
-
-	reg_val = 0;
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read back CPU_CLK Addr");
-		goto end;
-	}
-	BMI_DBG("Step 9b: %8X", reg_val);
-
-	/* ------Step 10------- */
-	reg_val = 0;
-	addr = (RTC_WMAC_BASE_ADDRESS | WLAN_PLL_CONTROL_OFFSET);
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read PLL_CTRL Addr for NOPWD");
-		goto end;
-	}
-	BMI_DBG("Step 10a: %8X", reg_val);
-
-	reg_val &= ~WLAN_PLL_CONTROL_NOPWD_MASK;
-	status = bmi_write_soc_register(addr, reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write PLL_CTRL Addr for NOPWD");
-		goto end;
-	}
-	reg_val = 0;
-	status = bmi_read_soc_register(addr, &reg_val, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to read back PLL_CTRL Addr for NOPWD");
-		goto end;
-	}
-	BMI_DBG("Step 10b: %8X", reg_val);
-
-	/* ------Step 11------- */
-	mem_val = 1;
-	status = bmi_write_memory(cmnos_cpu_pll_init_done_addr,
-				  (uint8_t *) &mem_val, 4, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write PLL_INIT Addr");
-		goto end;
-	}
-
-	mem_val = TARGET_CPU_FREQ;
-	status = bmi_write_memory(cmnos_cpu_speed_addr,
-				  (uint8_t *) &mem_val, 4, scn);
-	if (status != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to write CPU_SPEED Addr");
-		goto end;
-	}
-
-end:
-	return status;
-}
-
-#ifdef CONFIG_CNSS
-/* AXI Start Address */
-#define TARGET_ADDR (0xa0000)
-
-void ol_transfer_codeswap_struct(struct ol_softc *scn)
-{
-	struct codeswap_codeseg_info wlan_codeswap;
-	CDF_STATUS rv;
-
-	if (!scn) {
-		BMI_ERR("%s: ol_softc is null", __func__);
-		return;
-	}
-	if (cnss_get_codeswap_struct(&wlan_codeswap)) {
-		BMI_ERR("%s: failed to get codeswap structure", __func__);
-		return;
-	}
-
-	rv = bmi_write_memory(TARGET_ADDR,
-			      (uint8_t *) &wlan_codeswap, sizeof(wlan_codeswap),
-			      scn);
-
-	if (rv != CDF_STATUS_SUCCESS) {
-		BMI_ERR("Failed to Write 0xa0000 to Target");
-		return;
-	}
-	BMI_INFO("codeswap structure is successfully downloaded");
-}
-#endif
-
-CDF_STATUS ol_download_firmware(struct ol_softc *scn)
-{
-	uint32_t param, address = 0;
-	int status = !EOK;
-	CDF_STATUS ret;
-
-#ifdef CONFIG_CNSS
-	if (0 != cnss_get_fw_files_for_target(&scn->fw_files,
-					      scn->target_type,
-					      scn->target_version)) {
-		BMI_ERR("%s: No FW files from CNSS driver", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-#endif
-	/* Transfer Board Data from Target EEPROM to Target RAM */
-	/* Determine where in Target RAM to write Board Data */
-	bmi_read_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_board_data)),
-			(uint8_t *)&address, 4, scn);
-
-	if (!address) {
-		address = AR6004_REV5_BOARD_DATA_ADDRESS;
-		BMI_DBG("%s: Target address not known! Using 0x%x",
-						__func__, address);
-	}
-	ret = ol_patch_pll_switch(scn);
-	if (ret != CDF_STATUS_SUCCESS) {
-		BMI_ERR("pll switch failed. status %d", ret);
-		return ret;
-	}
-	if (scn->cal_in_flash) {
-		/* Write EEPROM or Flash data to Target RAM */
-		status = ol_transfer_bin_file(scn, ATH_FLASH_FILE,
-						address, false);
-	}
-
-	if (status == EOK) {
-		/* Record the fact that Board Data is initialized */
-		param = 1;
-		bmi_write_memory(
-			hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s,
-				hi_board_data_initialized)),
-				(uint8_t *) &param, 4, scn);
-	} else {
-		/* Flash is either not available or invalid */
-		if (ol_transfer_bin_file
-			    (scn, ATH_BOARD_DATA_FILE, address, false) != EOK) {
-			return -1;
-		}
-
-		/* Record the fact that Board Data is initialized */
-		param = 1;
-		bmi_write_memory(
-			hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s,
-				hi_board_data_initialized)),
-				(uint8_t *) &param, 4, scn);
-
-		/* Transfer One Time Programmable data */
-		address = BMI_SEGMENTED_WRITE_ADDR;
-		BMI_INFO("%s: Using 0x%x for the remainder of init",
-				__func__, address);
-
-#ifdef CONFIG_CNSS
-		ol_transfer_codeswap_struct(scn);
-#endif
-		status = ol_transfer_bin_file(scn, ATH_OTP_FILE,
-						address, true);
-		/* Execute the OTP code only if entry found and downloaded */
-		if (status == EOK) {
-			param = 0;
-#ifndef FEATURE_BMI_2
-			bmi_execute(address, &param, scn);
-#endif
-		} else if (status < 0) {
-			return status;
-		}
-	}
-
-	if (ol_transfer_bin_file(scn, ATH_SETUP_FILE,
-		BMI_SEGMENTED_WRITE_ADDR, true) == EOK) {
-		param = 0;
-#ifndef FEATURE_BMI_2
-		bmi_execute(address, &param, scn);
-#endif
-	}
-
-	/* Download Target firmware
-	 * TODO point to target specific files in runtime
-	 */
-	address = BMI_SEGMENTED_WRITE_ADDR;
-	if (ol_transfer_bin_file(scn, ATH_FIRMWARE_FILE,
-				address, true) != EOK) {
-		return -1;
-	}
-
-	/* Apply the patches */
-	if (ol_check_dataset_patch(scn, &address)) {
-		if ((ol_transfer_bin_file(scn, ATH_PATCH_FILE, address, false))
-		    != EOK) {
-			return -1;
-		}
-		bmi_write_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_dset_list_head)),
-			(uint8_t *) &address, 4, scn);
-	}
-
-	if (scn->enableuartprint ||
-	    (WLAN_IS_EPPING_ENABLED(cds_get_conparam()) &&
-	     WLAN_IS_EPPING_FW_UART(cds_get_conparam()))) {
-		switch (scn->target_version) {
-		case AR6004_VERSION_REV1_3:
-			param = 11;
-			break;
-		case AR6320_REV1_VERSION:
-		case AR6320_REV2_VERSION:
-		case AR6320_REV3_VERSION:
-		case AR6320_REV3_2_VERSION:
-		case AR6320_REV4_VERSION:
-		case AR6320_DEV_VERSION:
-			param = 6;
-			break;
-		default:
-			/* Configure GPIO AR9888 UART */
-			param = 7;
-		}
-
-		bmi_write_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_dbg_uart_txpin)),
-			(uint8_t *)&param, 4, scn);
-		param = 1;
-		bmi_write_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_serial_enable)),
-			(uint8_t *)&param, 4, scn);
-	} else {
-		/*
-		 * Explicitly setting UART prints to zero as target turns it on
-		 * based on scratch registers.
-		 */
-		param = 0;
-		bmi_write_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_serial_enable)),
-			(uint8_t *)&param, 4, scn);
-	}
-
-	if (scn->enablefwlog) {
-		bmi_read_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag)),
-			(uint8_t *)&param, 4, scn);
-
-		param &= ~(HI_OPTION_DISABLE_DBGLOG);
-		bmi_write_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag)),
-			(uint8_t *)&param, 4, scn);
-	} else {
-		/*
-		 * Explicitly setting fwlog prints to zero as target turns it on
-		 * based on scratch registers.
-		 */
-		bmi_read_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag)),
-			(uint8_t *)&param, 4, scn);
-
-		param |= HI_OPTION_DISABLE_DBGLOG;
-		bmi_write_memory(hif_hia_item_address(scn->target_type,
-			offsetof(struct host_interest_s, hi_option_flag)),
-			(uint8_t *) &param, 4, scn);
-	}
-
-	return status;
-}
-
-int ol_diag_read(struct ol_softc *scn, uint8_t *buffer,
-		 uint32_t pos, size_t count)
-{
-	int result = 0;
-
-	if ((4 == count) && ((pos & 3) == 0)) {
-		result = hif_diag_read_access(scn, pos,
-					      (uint32_t *) buffer);
-	} else {
-		size_t amount_read = 0;
-		size_t readSize = PCIE_READ_LIMIT;
-		size_t remainder = 0;
-		if (count > PCIE_READ_LIMIT) {
-			while ((amount_read < count) && (0 == result)) {
-				result = hif_diag_read_mem(scn, pos,
-							   buffer, readSize);
-				if (0 == result) {
-					buffer += readSize;
-					pos += readSize;
-					amount_read += readSize;
-					remainder = count - amount_read;
-					if (remainder < PCIE_READ_LIMIT)
-						readSize = remainder;
-				}
-			}
-		} else {
-		result = hif_diag_read_mem(scn, pos,
-					   buffer, count);
-		}
-	}
-
-	if (!result)
-		return count;
-	else
-		return -EIO;
-}
-
-static int ol_ath_get_reg_table(uint32_t target_version,
-				tgt_reg_table *reg_table)
-{
-	int section_len = 0;
-
-	if (!reg_table) {
-		cdf_assert(0);
-		return section_len;
-	}
-
-	switch (target_version) {
-	case AR6320_REV2_1_VERSION:
-		reg_table->section =
-			(tgt_reg_section *) &ar6320v2_reg_table[0];
-		reg_table->section_size = sizeof(ar6320v2_reg_table)
-					  / sizeof(ar6320v2_reg_table[0]);
-		section_len = AR6320_REV2_1_REG_SIZE;
-		break;
-	case AR6320_REV3_VERSION:
-	case AR6320_REV3_2_VERSION:
-		reg_table->section =
-			(tgt_reg_section *) &ar6320v3_reg_table[0];
-		reg_table->section_size = sizeof(ar6320v3_reg_table)
-					  / sizeof(ar6320v3_reg_table[0]);
-		section_len = AR6320_REV3_REG_SIZE;
-		break;
-	default:
-		reg_table->section = (void *)NULL;
-		reg_table->section_size = 0;
-		section_len = 0;
-	}
-
-	return section_len;
-}
-
-static int ol_diag_read_reg_loc(struct ol_softc *scn, uint8_t *buffer,
-				uint32_t buffer_len)
-{
-	int i, len, section_len, fill_len;
-	int dump_len, result = 0;
-	tgt_reg_table reg_table;
-	tgt_reg_section *curr_sec, *next_sec;
-
-	section_len = ol_ath_get_reg_table(scn->target_version, &reg_table);
-
-	if (!reg_table.section || !reg_table.section_size || !section_len) {
-		BMI_ERR("%s: failed to get reg table", __func__);
-		result = -EIO;
-		goto out;
-	}
-
-	curr_sec = reg_table.section;
-	for (i = 0; i < reg_table.section_size; i++) {
-
-		dump_len = curr_sec->end_addr - curr_sec->start_addr;
-
-		if ((buffer_len - result) < dump_len) {
-			BMI_ERR("Not enough memory to dump the registers:"
-			       " %d: 0x%08x-0x%08x", i,
-			       curr_sec->start_addr, curr_sec->end_addr);
-			goto out;
-		}
-
-		len = ol_diag_read(scn, buffer, curr_sec->start_addr, dump_len);
-
-		if (len != -EIO) {
-			buffer += len;
-			result += len;
-		} else {
-			BMI_ERR("%s: can't read reg 0x%08x len = %d",
-				__func__, curr_sec->start_addr, dump_len);
-			result = -EIO;
-			goto out;
-		}
-
-		if (result < section_len) {
-			next_sec = (tgt_reg_section *) ((uint8_t *) curr_sec
-							+ sizeof(*curr_sec));
-			fill_len = next_sec->start_addr - curr_sec->end_addr;
-			if ((buffer_len - result) < fill_len) {
-				BMI_ERR("Not enough memory to fill registers:"
-				       " %d: 0x%08x-0x%08x", i,
-				       curr_sec->end_addr,
-				       next_sec->start_addr);
-				goto out;
-			}
-
-			if (fill_len) {
-				buffer += fill_len;
-				result += fill_len;
-			}
-		}
-		curr_sec++;
-	}
-
-out:
-	return result;
-}
-
-void ol_dump_target_memory(struct ol_softc *scn, void *memory_block)
-{
-	char *buffer_loc = memory_block;
-	u_int32_t section_count = 0;
-	u_int32_t address = 0;
-	u_int32_t size = 0;
-
-	for (; section_count < 2; section_count++) {
-		switch (section_count) {
-		case 0:
-			address = DRAM_LOCAL_BASE_ADDR;
-			size = DRAM_SIZE;
-			break;
-		case 1:
-			address = AXI_LOCATION;
-			size = AXI_SIZE;
-		default:
-			break;
-		}
-		hif_dump_target_memory(scn, buffer_loc, address, size);
-		buffer_loc += size;
-	}
-}
-
-/**---------------------------------------------------------------------------
-*   \brief  ol_target_coredump
-*
-*   Function to perform core dump for the target
-*
-*   \param:   scn - ol_softc handler
-*             memory_block - non-NULL reserved memory location
-*             block_len - size of the dump to collect
-*
-*   \return:  None
-* --------------------------------------------------------------------------*/
-static int ol_target_coredump(void *inst, void *memory_block,
-					uint32_t block_len)
-{
-	struct ol_softc *scn = (struct ol_softc *)inst;
-	int8_t *buffer_loc = memory_block;
-	int result = 0;
-	int ret = 0;
-	uint32_t amount_read = 0;
-	uint32_t section_count = 0;
-	uint32_t pos = 0;
-	uint32_t read_len = 0;
-
-	/*
-	 * SECTION = DRAM
-	 * START   = 0x00400000
-	 * LENGTH  = 0x000a8000
-	 *
-	 * SECTION = AXI
-	 * START   = 0x000a0000
-	 * LENGTH  = 0x00018000
-	 *
-	 * SECTION = REG
-	 * START   = 0x00000800
-	 * LENGTH  = 0x0007F820
-	 */
-
-	while ((section_count < 3) && (amount_read < block_len)) {
-		switch (section_count) {
-		case 0:
-			/* DRAM SECTION */
-			pos = DRAM_LOCATION;
-			read_len = DRAM_SIZE;
-			BMI_ERR("%s: Dumping DRAM section...", __func__);
-			break;
-		case 1:
-			/* AXI SECTION */
-			pos = AXI_LOCATION;
-			read_len = AXI_SIZE;
-			BMI_ERR("%s: Dumping AXI section...", __func__);
-			break;
-		case 2:
-			/* REG SECTION */
-			pos = REGISTER_LOCATION;
-			/* ol_diag_read_reg_loc checks for buffer overrun */
-			read_len = 0;
-			BMI_ERR("%s: Dumping Register section...", __func__);
-			break;
-		}
-
-		if ((block_len - amount_read) >= read_len) {
-			if (pos == REGISTER_LOCATION)
-				result = ol_diag_read_reg_loc(scn, buffer_loc,
-							      block_len -
-							      amount_read);
-			else
-				result = ol_diag_read(scn, buffer_loc,
-					      pos, read_len);
-			if (result != -EIO) {
-				amount_read += result;
-				buffer_loc += result;
-				section_count++;
-			} else {
-				BMI_ERR("Could not read dump section!");
-				dump_ce_register(scn);
-				dump_ce_debug_register(scn);
-				ol_dump_target_memory(scn, memory_block);
-				ret = -EACCES;
-				break;  /* Could not read the section */
-			}
-		} else {
-			BMI_ERR("Insufficient room in dump buffer!");
-			break;  /* Insufficient room in buffer */
-		}
-	}
-	return ret;
-}
-
-#define MAX_SUPPORTED_PEERS_REV1_1 14
-#define MAX_SUPPORTED_PEERS_REV1_3 32
-
-uint8_t ol_get_number_of_peers_supported(struct ol_softc *scn)
-{
-	uint8_t max_no_of_peers = 0;
-
-	switch (scn->target_version) {
-	case AR6320_REV1_1_VERSION:
-		if (scn->max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_1)
-			max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_1;
-		else
-			max_no_of_peers = scn->max_no_of_peers;
-		break;
-
-	default:
-		if (scn->max_no_of_peers > MAX_SUPPORTED_PEERS_REV1_3)
-			max_no_of_peers = MAX_SUPPORTED_PEERS_REV1_3;
-		else
-			max_no_of_peers = scn->max_no_of_peers;
-		break;
-
-	}
-	return max_no_of_peers;
-}

+ 0 - 243
core/cds/inc/cds_api.h

@@ -1,243 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-#if !defined(__CDS_API_H)
-#define __CDS_API_H
-
-/**
- * DOC:  cds_api.h
- *
- * Connectivity driver services public API
- *
- */
-
-#include <cdf_types.h>
-#include <cdf_status.h>
-#include <cdf_memory.h>
-#include <cdf_list.h>
-#include <cdf_trace.h>
-#include <cdf_event.h>
-#include <cdf_lock.h>
-#include <cds_reg_service.h>
-#include <cds_mq.h>
-#include <cds_packet.h>
-#include <cds_sched.h>
-#include <cdf_threads.h>
-#include <cdf_mc_timer.h>
-#include <cds_pack_align.h>
-
-/* Amount of time to wait for WMA to perform an asynchronous activity.
- * This value should be larger than the timeout used by WMI to wait for
- * a response from target
- */
-#define CDS_WMA_TIMEOUT  (15000)
-
-/**
- * enum cds_driver_state - Driver state
- * @CDS_DRIVER_STATE_UNINITIALIZED: Driver is in uninitialized state.
- * CDS_DRIVER_STATE_LOADED: Driver is loaded and functional.
- * CDS_DRIVER_STATE_LOADING: Driver probe is in progress.
- * CDS_DRIVER_STATE_UNLOADING: Driver remove is in progress.
- * CDS_DRIVER_STATE_RECOVERING: Recovery in progress.
- */
-enum cds_driver_state {
-	CDS_DRIVER_STATE_UNINITIALIZED	= 0,
-	CDS_DRIVER_STATE_LOADED		= BIT(0),
-	CDS_DRIVER_STATE_LOADING	= BIT(1),
-	CDS_DRIVER_STATE_UNLOADING	= BIT(2),
-	CDS_DRIVER_STATE_RECOVERING	= BIT(3),
-};
-
-#define __CDS_IS_DRIVER_STATE(_state, _mask) (((_state) & (_mask)) == (_mask))
-
-void cds_set_driver_state(enum cds_driver_state);
-void cds_clear_driver_state(enum cds_driver_state);
-enum cds_driver_state cds_get_driver_state(void);
-
-/**
- * cds_is_driver_loading() - Is driver load in progress
- *
- * Return: true if driver is loading and false otherwise.
- */
-static inline bool cds_is_driver_loading(void)
-{
-	enum cds_driver_state state = cds_get_driver_state();
-
-	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADING);
-}
-
-/**
- * cds_is_driver_unloading() - Is driver unload in progress
- *
- * Return: true if driver is unloading and false otherwise.
- */
-static inline bool cds_is_driver_unloading(void)
-{
-	enum cds_driver_state state = cds_get_driver_state();
-
-	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_UNLOADING);
-}
-
-/**
- * cds_is_driver_recovering() - Is recovery in progress
- *
- * Return: true if recovery in progress  and false otherwise.
- */
-static inline bool cds_is_driver_recovering(void)
-{
-	enum cds_driver_state state = cds_get_driver_state();
-
-	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_RECOVERING);
-}
-
-/**
- * cds_is_load_or_unload_in_progress() - Is driver load OR unload in progress
- *
- * Return: true if driver is loading OR unloading and false otherwise.
- */
-static inline bool cds_is_load_or_unload_in_progress(void)
-{
-	enum cds_driver_state state = cds_get_driver_state();
-
-	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADING) ||
-		__CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_UNLOADING);
-}
-
-/**
- * cds_set_recovery_in_progress() - Set recovery in progress
- * @value: value to set
- *
- * Return: none
- */
-static inline void cds_set_recovery_in_progress(uint8_t value)
-{
-	if (value)
-		cds_set_driver_state(CDS_DRIVER_STATE_RECOVERING);
-	else
-		cds_clear_driver_state(CDS_DRIVER_STATE_RECOVERING);
-}
-
-/**
- * cds_set_load_in_progress() - Set load in progress
- * @value: value to set
- *
- * Return: none
- */
-static inline void cds_set_load_in_progress(uint8_t value)
-{
-	if (value)
-		cds_set_driver_state(CDS_DRIVER_STATE_LOADING);
-	else
-		cds_clear_driver_state(CDS_DRIVER_STATE_LOADING);
-}
-
-/**
- * cds_set_driver_loaded() - Set load completed
- * @value: value to set
- *
- * Return: none
- */
-static inline void cds_set_driver_loaded(uint8_t value)
-{
-	if (value)
-		cds_set_driver_state(CDS_DRIVER_STATE_LOADED);
-	else
-		cds_clear_driver_state(CDS_DRIVER_STATE_LOADED);
-}
-
-/**
- * cds_set_unload_in_progress() - Set unload in progress
- * @value: value to set
- *
- * Return: none
- */
-static inline void cds_set_unload_in_progress(uint8_t value)
-{
-	if (value)
-		cds_set_driver_state(CDS_DRIVER_STATE_UNLOADING);
-	else
-		cds_clear_driver_state(CDS_DRIVER_STATE_UNLOADING);
-}
-
-v_CONTEXT_t cds_init(void);
-void cds_deinit(void);
-
-CDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context);
-
-CDF_STATUS cds_open(void);
-
-CDF_STATUS cds_enable(v_CONTEXT_t cds_context);
-
-CDF_STATUS cds_disable(v_CONTEXT_t cds_context);
-
-CDF_STATUS cds_close(v_CONTEXT_t cds_context);
-
-CDF_STATUS cds_shutdown(v_CONTEXT_t cds_context);
-
-void cds_core_return_msg(void *pVContext, p_cds_msg_wrapper pMsgWrapper);
-
-void *cds_get_context(CDF_MODULE_ID moduleId);
-
-v_CONTEXT_t cds_get_global_context(void);
-
-CDF_STATUS cds_alloc_context(void *p_cds_context, CDF_MODULE_ID moduleID,
-			     void **ppModuleContext, uint32_t size);
-
-CDF_STATUS cds_free_context(void *p_cds_context, CDF_MODULE_ID moduleID,
-			    void *pModuleContext);
-
-CDF_STATUS cds_get_vdev_types(enum tCDF_ADAPTER_MODE mode, uint32_t *type,
-			      uint32_t *subType);
-
-void cds_flush_work(void *work);
-void cds_flush_delayed_work(void *dwork);
-
-bool cds_is_packet_log_enabled(void);
-
-uint64_t cds_get_monotonic_boottime(void);
-
-void cds_trigger_recovery(void);
-
-void cds_set_wakelock_logging(bool value);
-bool cds_is_wakelock_enabled(void);
-void cds_set_ring_log_level(uint32_t ring_id, uint32_t log_level);
-enum wifi_driver_log_level cds_get_ring_log_level(uint32_t ring_id);
-void cds_set_multicast_logging(uint8_t value);
-uint8_t cds_is_multicast_logging(void);
-CDF_STATUS cds_set_log_completion(uint32_t is_fatal,
-		uint32_t type,
-		uint32_t sub_type);
-void cds_get_log_completion(uint32_t *is_fatal,
-		uint32_t *type,
-		uint32_t *sub_type);
-bool cds_is_log_report_in_progress(void);
-void cds_init_log_completion(void);
-void cds_deinit_log_completion(void);
-CDF_STATUS cds_flush_logs(uint32_t is_fatal,
-		uint32_t indicator,
-		uint32_t reason_code);
-void cds_logging_set_fw_flush_complete(void);
-#endif /* if !defined __CDS_API_H */

+ 0 - 657
core/cds/inc/cds_concurrency.h

@@ -1,657 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __CDS_CONCURRENCY_H
-#define __CDS_CONCURRENCY_H
-
-/**
- * DOC: cds_concurrency.h
- *
- * CDS Concurrenct Connection Management entity
- */
-
-/* Include files */
-
-#include "wlan_hdd_main.h"
-
-#define MAX_NUMBER_OF_CONC_CONNECTIONS 3
-#define MAX_NUM_CHAN    128
-#define DBS_OPPORTUNISTIC_TIME    10
-#define CONNECTION_UPDATE_TIMEOUT 500
-
-/**
- * enum cds_chain_mode - Chain Mask tx & rx combination.
- *
- * @CDS_ONE_ONE: One for Tx, One for Rx
- * @CDS_TWO_TWO: Two for Tx, Two for Rx
- * @CDS_MAX_NO_OF_CHAIN_MODE: Max place holder
- *
- * These are generic IDs that identify the various roles
- * in the software system
- */
-enum cds_chain_mode {
-	CDS_ONE_ONE = 0,
-	CDS_TWO_TWO,
-	CDS_MAX_NO_OF_CHAIN_MODE
-};
-
-/**
- * enum cds_conc_priority_mode - t/p, powersave, latency.
- *
- * @CDS_THROUGHPUT: t/p is the priority
- * @CDS_POWERSAVE: powersave is the priority
- * @CDS_LATENCY: latency is the priority
- * @CDS_MAX_CONC_PRIORITY_MODE: Max place holder
- *
- * These are generic IDs that identify the various roles
- * in the software system
- */
-enum cds_conc_priority_mode {
-	CDS_THROUGHPUT = 0,
-	CDS_POWERSAVE,
-	CDS_LATENCY,
-	CDS_MAX_CONC_PRIORITY_MODE
-};
-
-/**
- * enum cds_con_mode - concurrency mode for PCL table
- *
- * @CDS_STA_MODE: station mode
- * @CDS_SAP_MODE: SAP mode
- * @CDS_P2P_CLIENT_MODE: P2P client mode
- * @CDS_P2P_GO_MODE: P2P Go mode
- * @CDS_IBSS_MODE: IBSS mode
- * @CDS_MAX_NUM_OF_MODE: max value place holder
- */
-enum cds_con_mode {
-	CDS_STA_MODE = 0,
-	CDS_SAP_MODE,
-	CDS_P2P_CLIENT_MODE,
-	CDS_P2P_GO_MODE,
-	CDS_IBSS_MODE,
-	CDS_MAX_NUM_OF_MODE
-};
-
-/**
- * enum cds_pcl_type - Various types of Preferred channel list (PCL).
- *
- * @CDS_NONE: No channel preference
- * @CDS_24G: 2.4 Ghz channels only
- * @CDS_5G: 5 Ghz channels only
- * @CDS_SCC_CH: SCC channel only
- * @CDS_MCC_CH: MCC channels only
- * @CDS_SCC_CH_24G: SCC channel & 2.4 Ghz channels
- * @CDS_SCC_CH_5G: SCC channel & 5 Ghz channels
- * @CDS_24G_SCC_CH: 2.4 Ghz channels & SCC channel
- * @CDS_5G_SCC_CH: 5 Ghz channels & SCC channel
- * @CDS_SCC_ON_5_SCC_ON_24_24G: SCC channel on 5 Ghz, SCC
- *	channel on 2.4 Ghz & 2.4 Ghz channels
- * @CDS_SCC_ON_5_SCC_ON_24_5G: SCC channel on 5 Ghz, SCC channel
- *	on 2.4 Ghz & 5 Ghz channels
- * @CDS_SCC_ON_24_SCC_ON_5_24G: SCC channel on 2.4 Ghz, SCC
- *	channel on 5 Ghz & 2.4 Ghz channels
- * @CDS_SCC_ON_24_SCC_ON_5_5G: SCC channel on 2.4 Ghz, SCC
- *	channel on 5 Ghz & 5 Ghz channels
- * @CDS_SCC_ON_5_SCC_ON_24: SCC channel on 5 Ghz, SCC channel on
- *	2.4 Ghz
- * @CDS_SCC_ON_24_SCC_ON_5: SCC channel on 2.4 Ghz, SCC channel
- *	on 5 Ghz
- * @CDS_MCC_CH_24G: MCC channels & 2.4 Ghz channels
- * @CDS_MCC_CH_5G:  MCC channels & 5 Ghz channels
- * @CDS_24G_MCC_CH: 2.4 Ghz channels & MCC channels
- * @CDS_5G_MCC_CH: 5 Ghz channels & MCC channels
- * @CDS_MAX_PCL_TYPE: Max place holder
- *
- * These are generic IDs that identify the various roles
- * in the software system
- */
-enum cds_pcl_type {
-	CDS_NONE = 0,
-	CDS_24G,
-	CDS_5G,
-	CDS_SCC_CH,
-	CDS_MCC_CH,
-	CDS_SCC_CH_24G,
-	CDS_SCC_CH_5G,
-	CDS_24G_SCC_CH,
-	CDS_5G_SCC_CH,
-	CDS_SCC_ON_5_SCC_ON_24_24G,
-	CDS_SCC_ON_5_SCC_ON_24_5G,
-	CDS_SCC_ON_24_SCC_ON_5_24G,
-	CDS_SCC_ON_24_SCC_ON_5_5G,
-	CDS_SCC_ON_5_SCC_ON_24,
-	CDS_SCC_ON_24_SCC_ON_5,
-	CDS_MCC_CH_24G,
-	CDS_MCC_CH_5G,
-	CDS_24G_MCC_CH,
-	CDS_5G_MCC_CH,
-
-	CDS_MAX_PCL_TYPE
-};
-
-/**
- * enum cds_one_connection_mode - Combination of first connection
- * type, band & spatial stream used.
- *
- * @CDS_STA_24_1x1: STA connection using [email protected] Ghz
- * @CDS_STA_24_2x2: STA connection using [email protected] Ghz
- * @CDS_STA_5_1x1: STA connection using 1x1@5 Ghz
- * @CDS_STA_5_2x2: STA connection using 2x2@5 Ghz
- * @CDS_P2P_CLI_24_1x1: P2P Client connection using [email protected] Ghz
- * @CDS_P2P_CLI_24_2x2: P2P Client connection using [email protected] Ghz
- * @CDS_P2P_CLI_5_1x1: P2P Client connection using 1x1@5 Ghz
- * @CDS_P2P_CLI_5_2x2: P2P Client connection using 2x2@5 Ghz
- * @CDS_P2P_GO_24_1x1: P2P GO connection using [email protected] Ghz
- * @CDS_P2P_GO_24_2x2: P2P GO connection using [email protected] Ghz
- * @CDS_P2P_GO_5_1x1: P2P GO connection using 1x1@5 Ghz
- * @CDS_P2P_GO_5_2x2: P2P GO connection using 2x2@5 Ghz
- * @CDS_SAP_24_1x1: SAP connection using [email protected] Ghz
- * @CDS_SAP_24_2x2: SAP connection using [email protected] Ghz
- * @CDS_SAP_5_1x1: SAP connection using 1x1@5 Ghz
- * @CDS_SAP_5_1x1: SAP connection using 2x2@5 Ghz
- * @CDS_IBSS_24_1x1:  IBSS connection using [email protected] Ghz
- * @CDS_IBSS_24_2x2:  IBSS connection using [email protected] Ghz
- * @CDS_IBSS_5_1x1:  IBSS connection using 1x1@5 Ghz
- * @CDS_IBSS_5_2x2:  IBSS connection using 2x2@5 Ghz
- * @CDS_MAX_ONE_CONNECTION_MODE: Max place holder
- *
- * These are generic IDs that identify the various roles
- * in the software system
- */
-enum cds_one_connection_mode {
-	CDS_STA_24_1x1 = 0,
-	CDS_STA_24_2x2,
-	CDS_STA_5_1x1,
-	CDS_STA_5_2x2,
-	CDS_P2P_CLI_24_1x1,
-	CDS_P2P_CLI_24_2x2,
-	CDS_P2P_CLI_5_1x1,
-	CDS_P2P_CLI_5_2x2,
-	CDS_P2P_GO_24_1x1,
-	CDS_P2P_GO_24_2x2,
-	CDS_P2P_GO_5_1x1,
-	CDS_P2P_GO_5_2x2,
-	CDS_SAP_24_1x1,
-	CDS_SAP_24_2x2,
-	CDS_SAP_5_1x1,
-	CDS_SAP_5_2x2,
-	CDS_IBSS_24_1x1,
-	CDS_IBSS_24_2x2,
-	CDS_IBSS_5_1x1,
-	CDS_IBSS_5_2x2,
-
-	CDS_MAX_ONE_CONNECTION_MODE
-};
-
-/**
- * enum cds_two_connection_mode - Combination of first two
- * connections type, concurrency state, band & spatial stream
- * used.
- *
- * @CDS_STA_SAP_SCC_24_1x1: STA & SAP connection on SCC using
- *			[email protected] Ghz
- * @CDS_STA_SAP_SCC_24_2x2: STA & SAP connection on SCC using
- *			[email protected] Ghz
- * @CDS_STA_SAP_MCC_24_1x1: STA & SAP connection on MCC using
- *			[email protected] Ghz
- * @CDS_STA_SAP_MCC_24_2x2: STA & SAP connection on MCC using
- *			[email protected] Ghz
- * @CDS_STA_SAP_SCC_5_1x1: STA & SAP connection on SCC using
- *			1x1@5 Ghz
- * @CDS_STA_SAP_SCC_5_2x2: STA & SAP connection on SCC using
- *			2x2@5 Ghz
- * @CDS_STA_SAP_MCC_5_1x1: STA & SAP connection on MCC using
- *			1x1@5 Ghz
- * @CDS_STA_SAP_MCC_5_2x2: STA & SAP connection on MCC using
- *			2x2@5 Ghz
- * @CDS_STA_SAP_DBS_1x1,: STA & SAP connection on DBS using 1x1
- * @CDS_STA_P2P_GO_SCC_24_1x1: STA & P2P GO connection on SCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_GO_SCC_24_2x2: STA & P2P GO connection on SCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_GO_MCC_24_1x1: STA & P2P GO connection on MCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_GO_MCC_24_2x2: STA & P2P GO connection on MCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_GO_SCC_5_1x1: STA & P2P GO connection on SCC
- *			using 1x1@5 Ghz
- * @CDS_STA_P2P_GO_SCC_5_2x2: STA & P2P GO connection on SCC
- *			using 2x2@5 Ghz
- * @CDS_STA_P2P_GO_MCC_5_1x1: STA & P2P GO connection on MCC
- *			using 1x1@5 Ghz
- * @CDS_STA_P2P_GO_MCC_5_2x2: STA & P2P GO connection on MCC
- *			using 2x2@5 Ghz
- * @CDS_STA_P2P_GO_DBS_1x1: STA & P2P GO connection on DBS using
- *			1x1
- * @CDS_STA_P2P_CLI_SCC_24_1x1: STA & P2P CLI connection on SCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_CLI_SCC_24_2x2: STA & P2P CLI connection on SCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_CLI_MCC_24_1x1: STA & P2P CLI connection on MCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_CLI_MCC_24_2x2: STA & P2P CLI connection on MCC
- *			using [email protected] Ghz
- * @CDS_STA_P2P_CLI_SCC_5_1x1: STA & P2P CLI connection on SCC
- *			using 1x1@5 Ghz
- * @CDS_STA_P2P_CLI_SCC_5_2x2: STA & P2P CLI connection on SCC
- *			using 2x2@5 Ghz
- * @CDS_STA_P2P_CLI_MCC_5_1x1: STA & P2P CLI connection on MCC
- *			using 1x1@5 Ghz
- * @CDS_STA_P2P_CLI_MCC_5_2x2: STA & P2P CLI connection on MCC
- *			using 2x2@5 Ghz
- * @CDS_STA_P2P_CLI_DBS_1x1: STA & P2P CLI connection on DBS
- *			using 1x1
- * @CDS_P2P_GO_P2P_CLI_SCC_24_1x1: P2P GO & CLI connection on
- *			SCC using [email protected] Ghz
- * @CDS_P2P_GO_P2P_CLI_SCC_24_2x2: P2P GO & CLI connection on
- *			SCC using [email protected] Ghz
- * @CDS_P2P_GO_P2P_CLI_MCC_24_1x1: P2P GO & CLI connection on
- *			MCC using [email protected] Ghz
- * @CDS_P2P_GO_P2P_CLI_MCC_24_2x2: P2P GO & CLI connection on
- *			MCC using [email protected] Ghz
- * @CDS_P2P_GO_P2P_CLI_SCC_5_1x1: P2P GO & CLI connection on
- *			SCC using 1x1@5 Ghz
- * @CDS_P2P_GO_P2P_CLI_SCC_5_2x2: P2P GO & CLI connection on
- *			SCC using 2x2@5 Ghz
- * @CDS_P2P_GO_P2P_CLI_MCC_5_1x1: P2P GO & CLI connection on
- *			MCC using 1x1@5 Ghz
- * @CDS_P2P_GO_P2P_CLI_MCC_5_2x2: P2P GO & CLI connection on
- *			MCC using 2x2@5 Ghz
- * @CDS_P2P_GO_P2P_CLI_DBS_1x1: P2P GO & CLI connection on DBS
- *			using 1x1
- * @CDS_P2P_GO_SAP_SCC_24_1x1: P2P GO & SAP connection on
- *			SCC using [email protected] Ghz
- * @CDS_P2P_GO_SAP_SCC_24_2x2: P2P GO & SAP connection on
- *			SCC using [email protected] Ghz
- * @CDS_P2P_GO_SAP_MCC_24_1x1: P2P GO & SAP connection on
- *			MCC using [email protected] Ghz
- * @CDS_P2P_GO_SAP_MCC_24_2x2: P2P GO & SAP connection on
- *			MCC using [email protected] Ghz
- * @CDS_P2P_GO_SAP_SCC_5_1x1: P2P GO & SAP connection on
- *			SCC using 1x1@5 Ghz
- * @CDS_P2P_GO_SAP_SCC_5_2x2: P2P GO & SAP connection on
- *			SCC using 2x2@5 Ghz
- * @CDS_P2P_GO_SAP_MCC_5_1x1: P2P GO & SAP connection on
- *			MCC using 1x1@5 Ghz
- * @CDS_P2P_GO_SAP_MCC_5_2x2: P2P GO & SAP connection on
- *			MCC using 2x2@5 Ghz
- * @CDS_P2P_GO_SAP_DBS_1x1: P2P GO & SAP connection on DBS using
- *			1x1
- * @CDS_P2P_CLI_SAP_SCC_24_1x1: CLI & SAP connection on SCC using
- *			[email protected] Ghz
- * @CDS_P2P_CLI_SAP_SCC_24_2x2: CLI & SAP connection on SCC using
- *			[email protected] Ghz
- * @CDS_P2P_CLI_SAP_MCC_24_1x1: CLI & SAP connection on MCC using
- *			[email protected] Ghz
- * @CDS_P2P_CLI_SAP_MCC_24_2x2: CLI & SAP connection on MCC using
- *			[email protected] Ghz
- * @CDS_P2P_CLI_SAP_SCC_5_1x1: CLI & SAP connection on SCC using
- *			1x1@5 Ghz
- * @CDS_P2P_CLI_SAP_SCC_5_2x2: CLI & SAP connection on SCC using
- *			2x2@5 Ghz
- * @CDS_P2P_CLI_SAP_MCC_5_1x1: CLI & SAP connection on MCC using
- *			1x1@5 Ghz
- * @CDS_P2P_CLI_SAP_MCC_5_2x2: CLI & SAP connection on MCC using
- *			2x2@5 Ghz
- * @CDS_P2P_STA_SAP_MCC_24_5_1x1: CLI and SAP connecting on MCC
- *			in 2.4 and 5GHz 1x1
- * @CDS_P2P_STA_SAP_MCC_24_5_2x2: CLI and SAP connecting on MCC
-			in 2.4 and 5GHz 2x2
- * @CDS_P2P_CLI_SAP_DBS_1x1,: CLI & SAP connection on DBS using 1x1
-
- * @CDS_MAX_TWO_CONNECTION_MODE: Max place holder
- *
- * These are generic IDs that identify the various roles
- * in the software system
- */
-enum cds_two_connection_mode {
-	CDS_STA_SAP_SCC_24_1x1 = 0,
-	CDS_STA_SAP_SCC_24_2x2,
-	CDS_STA_SAP_MCC_24_1x1,
-	CDS_STA_SAP_MCC_24_2x2,
-	CDS_STA_SAP_SCC_5_1x1,
-	CDS_STA_SAP_SCC_5_2x2,
-	CDS_STA_SAP_MCC_5_1x1,
-	CDS_STA_SAP_MCC_5_2x2,
-	CDS_STA_SAP_MCC_24_5_1x1,
-	CDS_STA_SAP_MCC_24_5_2x2,
-	CDS_STA_SAP_DBS_1x1,
-	CDS_STA_P2P_GO_SCC_24_1x1,
-	CDS_STA_P2P_GO_SCC_24_2x2,
-	CDS_STA_P2P_GO_MCC_24_1x1,
-	CDS_STA_P2P_GO_MCC_24_2x2,
-	CDS_STA_P2P_GO_SCC_5_1x1,
-	CDS_STA_P2P_GO_SCC_5_2x2,
-	CDS_STA_P2P_GO_MCC_5_1x1,
-	CDS_STA_P2P_GO_MCC_5_2x2,
-	CDS_STA_P2P_GO_MCC_24_5_1x1,
-	CDS_STA_P2P_GO_MCC_24_5_2x2,
-	CDS_STA_P2P_GO_DBS_1x1,
-	CDS_STA_P2P_CLI_SCC_24_1x1,
-	CDS_STA_P2P_CLI_SCC_24_2x2,
-	CDS_STA_P2P_CLI_MCC_24_1x1,
-	CDS_STA_P2P_CLI_MCC_24_2x2,
-	CDS_STA_P2P_CLI_SCC_5_1x1,
-	CDS_STA_P2P_CLI_SCC_5_2x2,
-	CDS_STA_P2P_CLI_MCC_5_1x1,
-	CDS_STA_P2P_CLI_MCC_5_2x2,
-	CDS_STA_P2P_CLI_MCC_24_5_1x1,
-	CDS_STA_P2P_CLI_MCC_24_5_2x2,
-	CDS_STA_P2P_CLI_DBS_1x1,
-	CDS_P2P_GO_P2P_CLI_SCC_24_1x1,
-	CDS_P2P_GO_P2P_CLI_SCC_24_2x2,
-	CDS_P2P_GO_P2P_CLI_MCC_24_1x1,
-	CDS_P2P_GO_P2P_CLI_MCC_24_2x2,
-	CDS_P2P_GO_P2P_CLI_SCC_5_1x1,
-	CDS_P2P_GO_P2P_CLI_SCC_5_2x2,
-	CDS_P2P_GO_P2P_CLI_MCC_5_1x1,
-	CDS_P2P_GO_P2P_CLI_MCC_5_2x2,
-	CDS_P2P_GO_P2P_CLI_MCC_24_5_1x1,
-	CDS_P2P_GO_P2P_CLI_MCC_24_5_2x2,
-	CDS_P2P_GO_P2P_CLI_DBS_1x1,
-	CDS_P2P_GO_SAP_SCC_24_1x1,
-	CDS_P2P_GO_SAP_SCC_24_2x2,
-	CDS_P2P_GO_SAP_MCC_24_1x1,
-	CDS_P2P_GO_SAP_MCC_24_2x2,
-	CDS_P2P_GO_SAP_SCC_5_1x1,
-	CDS_P2P_GO_SAP_SCC_5_2x2,
-	CDS_P2P_GO_SAP_MCC_5_1x1,
-	CDS_P2P_GO_SAP_MCC_5_2x2,
-	CDS_P2P_GO_SAP_MCC_24_5_1x1,
-	CDS_P2P_GO_SAP_MCC_24_5_2x2,
-	CDS_P2P_GO_SAP_DBS_1x1,
-	CDS_P2P_CLI_SAP_SCC_24_1x1,
-	CDS_P2P_CLI_SAP_SCC_24_2x2,
-	CDS_P2P_CLI_SAP_MCC_24_1x1,
-	CDS_P2P_CLI_SAP_MCC_24_2x2,
-	CDS_P2P_CLI_SAP_SCC_5_1x1,
-	CDS_P2P_CLI_SAP_SCC_5_2x2,
-	CDS_P2P_CLI_SAP_MCC_5_1x1,
-	CDS_P2P_CLI_SAP_MCC_5_2x2,
-	CDS_P2P_CLI_SAP_MCC_24_5_1x1,
-	CDS_P2P_CLI_SAP_MCC_24_5_2x2,
-	CDS_P2P_CLI_SAP_DBS_1x1,
-
-	CDS_MAX_TWO_CONNECTION_MODE
-};
-
-/**
- * enum cds_conc_next_action - actions to be taken on old
- * connections.
- *
- * @CDS_NOP: No action
- * @CDS_DBS: switch to DBS mode
- * @CDS_DBS_DOWNGRADE: switch to DBS mode & downgrade to 1x1
- * @CDS_MCC: switch to MCC/SCC mode
- * @CDS_MCC_UPGRADE: switch to MCC/SCC mode & upgrade to 2x2
- * @CDS_MAX_CONC_PRIORITY_MODE: Max place holder
- *
- * These are generic IDs that identify the various roles
- * in the software system
- */
-enum cds_conc_next_action {
-	CDS_NOP = 0,
-	CDS_DBS,
-	CDS_DBS_DOWNGRADE,
-	CDS_MCC,
-	CDS_MCC_UPGRADE,
-	CDS_MAX_CONC_NEXT_ACTION
-};
-
-/**
- * enum cds_band - wifi band.
- *
- * @CDS_BAND_24: 2.4 Ghz band
- * @CDS_BAND_5: 5 Ghz band
- * @CDS_MAX_BAND: Max place holder
- *
- * These are generic IDs that identify the various roles
- * in the software system
- */
-enum cds_band {
-	CDS_BAND_24 = 0,
-	CDS_BAND_5,
-	CDS_MAX_BAND
-};
-
-/**
- * struct cds_conc_connection_info - information of all existing
- * connections in the wlan system
- *
- * @mode: connection type
- * @chan: channel of the connection
- * @mac: The HW mac it is running
- * @tx_spatial_stream: Tx spatial stream used by the connection
- * @rx_spatial_stream: Tx spatial stream used by the connection
- * @original_nss: nss negotiated at connection time
- * @vdev_id: vdev id of the connection
- * @in_use: if the table entry is active
- */
-struct cds_conc_connection_info {
-	enum cds_con_mode mode;
-	uint8_t       chan;
-	uint8_t       mac;
-	enum cds_chain_mode chain_mask;
-	uint8_t       tx_spatial_stream;
-	uint8_t       rx_spatial_stream;
-	uint32_t      original_nss;
-	uint32_t      vdev_id;
-	bool          in_use;
-};
-
-bool cds_is_connection_in_progress(void);
-void cds_dump_concurrency_info(void);
-void cds_set_concurrency_mode(enum tCDF_ADAPTER_MODE mode);
-void cds_clear_concurrency_mode(enum tCDF_ADAPTER_MODE mode);
-uint32_t cds_get_connection_count(void);
-bool cds_is_sta_connection_pending(void);
-void cds_change_sta_conn_pending_status(bool value);
-void cds_change_sap_restart_required_status(bool value);
-bool cds_set_connection_in_progress(bool value);
-int cds_cfg80211_get_concurrency_matrix(struct wiphy *wiphy,
-			struct wireless_dev *wdev,
-			const void *data,
-			int data_len);
-uint32_t cds_get_concurrency_mode(void);
-CDF_STATUS cds_check_and_restart_sap(eCsrRoamResult roam_result,
-		hdd_station_ctx_t *hdd_sta_ctx);
-void cds_handle_conc_rule1(hdd_adapter_t *adapter,
-		tCsrRoamProfile *roam_profile);
-#ifdef FEATURE_WLAN_CH_AVOID
-bool cds_handle_conc_rule2(hdd_adapter_t *adapter,
-		tCsrRoamProfile *roam_profile,
-		uint32_t *roam_id);
-#else
-static inline bool cds_handle_conc_rule2(hdd_adapter_t *adapter,
-		tCsrRoamProfile *roam_profile,
-		uint32_t *roam_id)
-{
-		return true;
-}
-#endif /* FEATURE_WLAN_CH_AVOID */
-uint8_t cds_search_and_check_for_session_conc(uint8_t session_id,
-		tCsrRoamProfile * roam_profile);
-bool cds_check_for_session_conc(uint8_t session_id, uint8_t channel);
-CDF_STATUS cds_handle_conc_multiport(uint8_t session_id, uint8_t channel);
-
-#ifdef FEATURE_WLAN_FORCE_SAP_SCC
-void cds_force_sap_on_scc(eCsrRoamResult roam_result,
-		uint8_t channel_id);
-#else
-static inline void cds_force_sap_on_scc(eCsrRoamResult roam_result,
-				uint8_t channel_id)
-{
-
-}
-#endif /* FEATURE_WLAN_FORCE_SAP_SCC */
-
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-void cds_check_concurrent_intf_and_restart_sap(
-		hdd_station_ctx_t *hdd_sta_ctx,
-		hdd_adapter_t *adapter);
-#else
-static inline void cds_check_concurrent_intf_and_restart_sap(
-		hdd_station_ctx_t *hdd_sta_ctx,
-		hdd_adapter_t *adapter)
-{
-
-}
-#endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */
-uint8_t cds_is_mcc_in_24G(void);
-int32_t cds_set_mas(hdd_adapter_t *adapter, uint8_t mas_value);
-int cds_set_mcc_p2p_quota(hdd_adapter_t *hostapd_adapter,
-		uint32_t set_value);
-CDF_STATUS cds_change_mcc_go_beacon_interval(hdd_adapter_t *pHostapdAdapter);
-int cds_go_set_mcc_p2p_quota(hdd_adapter_t *hostapd_adapter,
-		uint32_t set_value);
-void cds_set_mcc_latency(hdd_adapter_t *adapter, int set_value);
-#if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) || \
-		defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE)
-void cds_restart_sap(hdd_adapter_t *ap_adapter);
-#else
-static inline void cds_restart_sap(hdd_adapter_t *ap_adapter)
-{
-
-}
-#endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH ||
-	* FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
-	*/
-
-#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
-void cds_check_and_restart_sap_with_non_dfs_acs(void);
-#else
-static inline void cds_check_and_restart_sap_with_non_dfs_acs(void)
-{
-
-}
-#endif /* FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE */
-void cds_incr_active_session(enum tCDF_ADAPTER_MODE mode,
-				uint8_t sessionId);
-void cds_decr_active_session(enum tCDF_ADAPTER_MODE mode,
-				uint8_t sessionId);
-void cds_decr_session_set_pcl(enum tCDF_ADAPTER_MODE mode,
-		uint8_t session_id);
-CDF_STATUS cds_init_policy_mgr(void);
-CDF_STATUS cds_deinit_policy_mgr(void);
-CDF_STATUS cds_get_pcl(enum cds_con_mode mode,
-				uint8_t *pcl_Channels, uint32_t *len);
-bool cds_allow_concurrency(enum cds_con_mode mode,
-				uint8_t channel, enum hw_mode_bandwidth bw);
-enum cds_conc_priority_mode cds_get_first_connection_pcl_table_index(void);
-enum cds_one_connection_mode cds_get_second_connection_pcl_table_index(void);
-enum cds_two_connection_mode cds_get_third_connection_pcl_table_index(void);
-CDF_STATUS cds_incr_connection_count(uint32_t vdev_id);
-CDF_STATUS cds_update_connection_info(uint32_t vdev_id);
-CDF_STATUS cds_decr_connection_count(uint32_t vdev_id);
-CDF_STATUS cds_current_connections_update(uint32_t session_id,
-				uint8_t channel,
-				enum cds_conn_update_reason);
-bool cds_is_ibss_conn_exist(uint8_t *ibss_channel);
-#ifdef MPC_UT_FRAMEWORK
-CDF_STATUS cds_incr_connection_count_utfw(
-		uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams,
-		uint32_t chain_mask, uint32_t type, uint32_t sub_type,
-		uint32_t channelid, uint32_t mac_id);
-CDF_STATUS cds_update_connection_info_utfw(
-		uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams,
-		uint32_t chain_mask, uint32_t type, uint32_t sub_type,
-		uint32_t channelid, uint32_t mac_id);
-CDF_STATUS cds_decr_connection_count_utfw(
-		uint32_t del_all, uint32_t vdev_id);
-struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len);
-enum cds_pcl_type get_pcl_from_first_conn_table(enum cds_con_mode type,
-		enum cds_conc_priority_mode sys_pref);
-enum cds_pcl_type get_pcl_from_second_conn_table(
-	enum cds_one_connection_mode idx, enum cds_con_mode type,
-	enum cds_conc_priority_mode sys_pref, uint8_t dbs_capable);
-enum cds_pcl_type get_pcl_from_third_conn_table(
-	enum cds_two_connection_mode idx, enum cds_con_mode type,
-	enum cds_conc_priority_mode sys_pref, uint8_t dbs_capable);
-#else
-static inline CDF_STATUS cds_incr_connection_count_utfw(uint32_t vdev_id,
-		uint32_t tx_streams, uint32_t rx_streams,
-		uint32_t chain_mask, uint32_t type, uint32_t sub_type,
-		uint32_t channelid, uint32_t mac_id)
-{
-	return CDF_STATUS_SUCCESS;
-}
-static inline CDF_STATUS cds_update_connection_info_utfw(uint32_t vdev_id,
-		uint32_t tx_streams, uint32_t rx_streams,
-		uint32_t chain_mask, uint32_t type, uint32_t sub_type,
-		uint32_t channelid, uint32_t mac_id)
-{
-	return CDF_STATUS_SUCCESS;
-}
-static inline CDF_STATUS cds_decr_connection_count_utfw(uint32_t del_all,
-		uint32_t vdev_id)
-{
-	return CDF_STATUS_SUCCESS;
-}
-static inline struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len)
-{
-	return NULL;
-}
-#endif
-enum cds_con_mode cds_convert_device_mode_to_hdd_type(
-				device_mode_t device_mode);
-CDF_STATUS cds_soc_set_hw_mode(uint32_t session_id,
-		enum hw_mode_ss_config mac0_ss,
-		enum hw_mode_bandwidth mac0_bw,
-		enum hw_mode_ss_config mac1_ss,
-		enum hw_mode_bandwidth mac1_bw,
-		enum hw_mode_dbs_capab dbs,
-		enum hw_mode_agile_dfs_capab dfs,
-		enum cds_conn_update_reason reason);
-enum cds_conc_next_action cds_need_opportunistic_upgrade(void);
-CDF_STATUS cds_next_actions(uint32_t session_id,
-		enum cds_conc_next_action action,
-		enum cds_conn_update_reason reason);
-void cds_set_dual_mac_scan_config(uint8_t dbs_val,
-		uint8_t dbs_plus_agile_scan_val,
-		uint8_t single_mac_scan_with_dbs_val);
-void cds_set_dual_mac_fw_mode_config(uint8_t dbs,
-		uint8_t dfs);
-void cds_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status,
-		uint32_t scan_config,
-		uint32_t fw_mode_config);
-bool cds_map_concurrency_mode(enum tCDF_ADAPTER_MODE *old_mode,
-		enum cds_con_mode *new_mode);
-CDF_STATUS cds_get_channel_from_scan_result(hdd_adapter_t *adapter,
-		tCsrRoamProfile *roam_profile, uint8_t *channel);
-
-enum tCDF_GLOBAL_CON_MODE cds_get_conparam(void);
-bool cds_concurrent_open_sessions_running(void);
-bool cds_max_concurrent_connections_reached(void);
-void cds_clear_concurrent_session_count(void);
-bool cds_is_multiple_active_sta_sessions(void);
-bool cds_is_sta_active_connection_exists(void);
-bool cds_concurrent_beaconing_sessions_running(void);
-CDF_STATUS cdf_wait_for_connection_update(void);
-CDF_STATUS cdf_reset_connection_update(void);
-CDF_STATUS cdf_set_connection_update(void);
-CDF_STATUS cdf_init_connection_update(void);
-#endif /* __CDS_CONCURRENCY_H */

+ 0 - 182
core/cds/inc/cds_crypto.h

@@ -1,182 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-#if !defined(__CDS_CRYPTO_H)
-#define __CDS_CRYPTO_H
-
-/**
- * DOC:  cds_crypto.h
- *
- * Crypto APIs
- *
- */
-
-#include <cdf_types.h>
-#include <cdf_status.h>
-#include <cdf_memory.h>
-#include <cdf_list.h>
-#include <cdf_trace.h>
-#include <cdf_event.h>
-#include <cdf_lock.h>
-#include <cds_reg_service.h>
-#include <cds_mq.h>
-#include <cds_packet.h>
-#include <cds_sched.h>
-#include <cdf_threads.h>
-#include <cdf_mc_timer.h>
-#include <cds_pack_align.h>
-#include <crypto/aes.h>
-#include <crypto/hash.h>
-#ifdef CONFIG_CNSS
-#include <net/cnss.h>
-#include <linux/qcomwlan_secif.h>
-#endif
-
-#ifdef CONFIG_CNSS
-static inline struct crypto_ahash *cds_crypto_alloc_ahash(const char *alg_name,
-	u32 type, u32 mask)
-{
-	return wcnss_wlan_crypto_alloc_ahash(alg_name, type, mask);
-}
-#else
-static inline struct crypto_ahash *cds_crypto_alloc_ahash(const char *alg_name,
-	u32 type, u32 mask)
-{
-	return crypto_alloc_ahash(alg_name, type, mask);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline struct crypto_cipher *
-cds_crypto_alloc_cipher(const char *alg_name, u32 type, u32 mask)
-{
-	return wcnss_wlan_crypto_alloc_cipher(alg_name, type, mask);
-}
-#else
-static inline struct crypto_cipher *
-cds_crypto_alloc_cipher(const char *alg_name, u32 type, u32 mask)
-{
-	return crypto_alloc_cipher(alg_name, type, mask);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline void cds_cmac_calc_mic(struct crypto_cipher *tfm, u8 *m,
-		u16 length, u8 *mac)
-{
-	wcnss_wlan_cmac_calc_mic(tfm, m, length, mac);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline void cds_crypto_free_cipher(struct crypto_cipher *tfm)
-{
-	wcnss_wlan_crypto_free_cipher(tfm);
-}
-#else
-static inline void cds_crypto_free_cipher(struct crypto_cipher *tfm)
-{
-	crypto_free_cipher(tfm);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline void cds_crypto_free_ahash(struct crypto_ahash *tfm)
-{
-	wcnss_wlan_crypto_free_ahash(tfm);
-}
-#else
-static inline void cds_crypto_free_ahash(struct crypto_ahash *tfm)
-{
-	crypto_free_ahash(tfm);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline int cds_crypto_ahash_setkey(struct crypto_ahash *tfm,
-	const u8 *key, unsigned int keylen)
-{
-	return wcnss_wlan_crypto_ahash_setkey(tfm, key, keylen);
-}
-#else
-static inline int cds_crypto_ahash_setkey(struct crypto_ahash *tfm,
-	const u8 *key, unsigned int keylen)
-{
-	return crypto_ahash_setkey(tfm, key, keylen);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline int cds_crypto_ahash_digest(struct ahash_request *req)
-{
-	return wcnss_wlan_crypto_ahash_digest(req);
-}
-#else
-static inline int cds_crypto_ahash_digest(struct ahash_request *req)
-{
-	return crypto_ahash_digest(req);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline struct crypto_ablkcipher *
-cds_crypto_alloc_ablkcipher(const char *alg_name, u32 type, u32 mask)
-{
-	return wcnss_wlan_crypto_alloc_ablkcipher(alg_name, type, mask);
-}
-#else
-static inline struct crypto_ablkcipher *
-cds_crypto_alloc_ablkcipher(const char *alg_name, u32 type, u32 mask)
-{
-	return crypto_alloc_ablkcipher(alg_name, type, mask);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline void cds_ablkcipher_request_free(struct ablkcipher_request *req)
-{
-	wcnss_wlan_ablkcipher_request_free(req);
-}
-#else
-static inline void cds_ablkcipher_request_free(struct ablkcipher_request *req)
-{
-	ablkcipher_request_free(req);
-}
-#endif
-
-#ifdef CONFIG_CNSS
-static inline void cds_crypto_free_ablkcipher(struct crypto_ablkcipher *tfm)
-{
-	wcnss_wlan_crypto_free_ablkcipher(tfm);
-}
-#else
-static inline void cds_crypto_free_ablkcipher(struct crypto_ablkcipher *tfm)
-{
-	crypto_free_ablkcipher(tfm);
-}
-#endif
-
-#endif /* if !defined __CDS_CRYPTO_H */

+ 0 - 2105
core/cds/inc/cds_ieee80211_common.h

@@ -1,2105 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef EXTERNAL_USE_ONLY
-#include "osdep.h"
-#endif /* EXTERNAL_USE_ONLY */
-#include "cds_ieee80211_common_i.h"
-
-#ifndef CDS_COMMON_IEEE80211_H_
-#define CDS_COMMON_IEEE80211_H_
-
-/*
- * 802.11 protocol definitions.
- */
-
-/* is 802.11 address multicast/broadcast? */
-#define IEEE80211_IS_MULTICAST(_a)  (*(_a) & 0x01)
-
-#define IEEE80211_IS_IPV4_MULTICAST(_a)  (*(_a) == 0x01)
-
-#define IEEE80211_IS_IPV6_MULTICAST(_a)		\
-	((_a)[0] == 0x33 &&			    \
-	 (_a)[1] == 0x33)
-
-#define IEEE80211_IS_BROADCAST(_a)		\
-	((_a)[0] == 0xff &&			    \
-	 (_a)[1] == 0xff &&			    \
-	 (_a)[2] == 0xff &&			    \
-	 (_a)[3] == 0xff &&			    \
-	 (_a)[4] == 0xff &&			    \
-	 (_a)[5] == 0xff)
-
-/* IEEE 802.11 PLCP header */
-struct ieee80211_plcp_hdr {
-	uint16_t i_sfd;
-	uint8_t i_signal;
-	uint8_t i_service;
-	uint16_t i_length;
-	uint16_t i_crc;
-} __packed;
-
-#define IEEE80211_PLCP_SFD      0xF3A0
-#define IEEE80211_PLCP_SERVICE  0x00
-
-/*
- * generic definitions for IEEE 802.11 frames
- */
-struct ieee80211_frame {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	union {
-		struct {
-			uint8_t i_addr1[IEEE80211_ADDR_LEN];
-			uint8_t i_addr2[IEEE80211_ADDR_LEN];
-			uint8_t i_addr3[IEEE80211_ADDR_LEN];
-		};
-		uint8_t i_addr_all[3 * IEEE80211_ADDR_LEN];
-	};
-	uint8_t i_seq[2];
-	/* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
-	/* see below */
-} __packed;
-
-struct ieee80211_qosframe {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-	uint8_t i_addr2[IEEE80211_ADDR_LEN];
-	uint8_t i_addr3[IEEE80211_ADDR_LEN];
-	uint8_t i_seq[2];
-	uint8_t i_qos[2];
-	/* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
-	/* see below */
-} __packed;
-
-struct ieee80211_qoscntl {
-	uint8_t i_qos[2];
-};
-
-struct ieee80211_frame_addr4 {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-	uint8_t i_addr2[IEEE80211_ADDR_LEN];
-	uint8_t i_addr3[IEEE80211_ADDR_LEN];
-	uint8_t i_seq[2];
-	uint8_t i_addr4[IEEE80211_ADDR_LEN];
-} __packed;
-
-struct ieee80211_qosframe_addr4 {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-	uint8_t i_addr2[IEEE80211_ADDR_LEN];
-	uint8_t i_addr3[IEEE80211_ADDR_LEN];
-	uint8_t i_seq[2];
-	uint8_t i_addr4[IEEE80211_ADDR_LEN];
-	uint8_t i_qos[2];
-} __packed;
-
-/* HTC frame for TxBF*/
-/* for TxBF RC */
-struct ieee80211_frame_min_one {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-
-} __packed;                     /* For TxBF RC */
-
-struct ieee80211_qosframe_htc {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-	uint8_t i_addr2[IEEE80211_ADDR_LEN];
-	uint8_t i_addr3[IEEE80211_ADDR_LEN];
-	uint8_t i_seq[2];
-	uint8_t i_qos[2];
-	uint8_t i_htc[4];
-	/* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
-	/* see below */
-} __packed;
-struct ieee80211_qosframe_htc_addr4 {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-	uint8_t i_addr2[IEEE80211_ADDR_LEN];
-	uint8_t i_addr3[IEEE80211_ADDR_LEN];
-	uint8_t i_seq[2];
-	uint8_t i_addr4[IEEE80211_ADDR_LEN];
-	uint8_t i_qos[2];
-	uint8_t i_htc[4];
-} __packed;
-struct ieee80211_htc {
-	uint8_t i_htc[4];
-};
-/*HTC frame for TxBF*/
-
-struct ieee80211_ctlframe_addr2 {
-	uint8_t i_fc[2];
-	uint8_t i_aidordur[2];  /* AID or duration */
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-	uint8_t i_addr2[IEEE80211_ADDR_LEN];
-} __packed;
-
-#define IEEE80211_WHQ(wh)               ((struct ieee80211_qosframe *)(wh))
-#define IEEE80211_WH4(wh)               ((struct ieee80211_frame_addr4 *)(wh))
-#define IEEE80211_WHQ4(wh)              ((struct ieee80211_qosframe_addr4 *)(wh))
-
-#define IEEE80211_FC0_VERSION_MASK          0x03
-#define IEEE80211_FC0_VERSION_SHIFT         0
-#define IEEE80211_FC0_VERSION_0             0x00
-#define IEEE80211_FC0_TYPE_MASK             0x0c
-#define IEEE80211_FC0_TYPE_SHIFT            2
-#define IEEE80211_FC0_TYPE_MGT              0x00
-#define IEEE80211_FC0_TYPE_CTL              0x04
-#define IEEE80211_FC0_TYPE_DATA             0x08
-
-#define IEEE80211_FC0_SUBTYPE_MASK          0xf0
-#define IEEE80211_FC0_SUBTYPE_SHIFT         4
-/* for TYPE_MGT */
-#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ     0x00
-#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP    0x10
-#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ   0x20
-#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP  0x30
-#define IEEE80211_FC0_SUBTYPE_PROBE_REQ     0x40
-#define IEEE80211_FC0_SUBTYPE_PROBE_RESP    0x50
-#define IEEE80211_FC0_SUBTYPE_BEACON        0x80
-#define IEEE80211_FC0_SUBTYPE_ATIM          0x90
-#define IEEE80211_FC0_SUBTYPE_DISASSOC      0xa0
-#define IEEE80211_FC0_SUBTYPE_AUTH          0xb0
-#define IEEE80211_FC0_SUBTYPE_DEAUTH        0xc0
-#define IEEE80211_FC0_SUBTYPE_ACTION        0xd0
-#define IEEE80211_FCO_SUBTYPE_ACTION_NO_ACK 0xe0
-/* for TYPE_CTL */
-#define IEEE80211_FCO_SUBTYPE_Control_Wrapper   0x70    /* For TxBF RC */
-#define IEEE80211_FC0_SUBTYPE_BAR           0x80
-#define IEEE80211_FC0_SUBTYPE_PS_POLL       0xa0
-#define IEEE80211_FC0_SUBTYPE_RTS           0xb0
-#define IEEE80211_FC0_SUBTYPE_CTS           0xc0
-#define IEEE80211_FC0_SUBTYPE_ACK           0xd0
-#define IEEE80211_FC0_SUBTYPE_CF_END        0xe0
-#define IEEE80211_FC0_SUBTYPE_CF_END_ACK    0xf0
-/* for TYPE_DATA (bit combination) */
-#define IEEE80211_FC0_SUBTYPE_DATA          0x00
-#define IEEE80211_FC0_SUBTYPE_CF_ACK        0x10
-#define IEEE80211_FC0_SUBTYPE_CF_POLL       0x20
-#define IEEE80211_FC0_SUBTYPE_CF_ACPL       0x30
-#define IEEE80211_FC0_SUBTYPE_NODATA        0x40
-#define IEEE80211_FC0_SUBTYPE_CFACK         0x50
-#define IEEE80211_FC0_SUBTYPE_CFPOLL        0x60
-#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
-#define IEEE80211_FC0_SUBTYPE_QOS           0x80
-#define IEEE80211_FC0_SUBTYPE_QOS_NULL      0xc0
-
-#define IEEE80211_FC1_DIR_MASK              0x03
-#define IEEE80211_FC1_DIR_NODS              0x00        /* STA->STA */
-#define IEEE80211_FC1_DIR_TODS              0x01        /* STA->AP  */
-#define IEEE80211_FC1_DIR_FROMDS            0x02        /* AP ->STA */
-#define IEEE80211_FC1_DIR_DSTODS            0x03        /* AP ->AP  */
-
-#define IEEE80211_FC1_MORE_FRAG             0x04
-#define IEEE80211_FC1_RETRY                 0x08
-#define IEEE80211_FC1_PWR_MGT               0x10
-#define IEEE80211_FC1_MORE_DATA             0x20
-#define IEEE80211_FC1_WEP                   0x40
-#define IEEE80211_FC1_ORDER                 0x80
-
-#define IEEE80211_SEQ_FRAG_MASK             0x000f
-#define IEEE80211_SEQ_FRAG_SHIFT            0
-#define IEEE80211_SEQ_SEQ_MASK              0xfff0
-#define IEEE80211_SEQ_SEQ_SHIFT             4
-#define IEEE80211_SEQ_MAX                   4096
-
-#define IEEE80211_SEQ_LEQ(a,b)  ((int)((a)-(b)) <= 0)
-
-#define IEEE80211_QOS_TXOP                  0x00ff
-
-#define IEEE80211_QOS_AMSDU                 0x80
-#define IEEE80211_QOS_AMSDU_S               7
-#define IEEE80211_QOS_ACKPOLICY             0x60
-#define IEEE80211_QOS_ACKPOLICY_S           5
-#define IEEE80211_QOS_EOSP                  0x10
-#define IEEE80211_QOS_EOSP_S                4
-#define IEEE80211_QOS_TID                   0x0f
-#define IEEE80211_MFP_TID                   0xff
-
-#define IEEE80211_HTC0_TRQ                  0x02
-#define IEEE80211_HTC2_CalPos               0x03
-#define IEEE80211_HTC2_CalSeq               0x0C
-#define IEEE80211_HTC2_CSI_NONCOMP_BF       0x80
-#define IEEE80211_HTC2_CSI_COMP_BF          0xc0
-
-/* Set bits 14 and 15 to 1 when duration field carries Association ID */
-#define IEEE80211_FIELD_TYPE_AID            0xC000
-
-#define IEEE80211_IS_BEACON(_frame)    ((((_frame)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT) && \
-					(((_frame)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_BEACON))
-#define IEEE80211_IS_DATA(_frame)      (((_frame)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA)
-
-#define IEEE80211_IS_MFP_FRAME(_frame) ((((_frame)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT) && \
-					((_frame)->i_fc[1] & IEEE80211_FC1_WEP) && \
-					((((_frame)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_DEAUTH) || \
-					 (((_frame)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_DISASSOC) || \
-					 (((_frame)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_ACTION)))
-#define IEEE80211_IS_AUTH(_frame)      ((((_frame)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT) && \
-					(((_frame)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == IEEE80211_FC0_SUBTYPE_AUTH))
-
-/* MCS Set */
-#define IEEE80211_RX_MCS_1_STREAM_BYTE_OFFSET 0
-#define IEEE80211_RX_MCS_2_STREAM_BYTE_OFFSET 1
-#define IEEE80211_RX_MCS_3_STREAM_BYTE_OFFSET 2
-#define IEEE80211_RX_MCS_ALL_NSTREAM_RATES 0xff
-#define IEEE80211_TX_MCS_OFFSET 12
-
-#define IEEE80211_TX_MCS_SET_DEFINED 0x80
-#define IEEE80211_TX_RX_MCS_SET_NOT_EQUAL 0x40
-#define IEEE80211_TX_1_SPATIAL_STREAMS 0x0
-#define IEEE80211_TX_2_SPATIAL_STREAMS 0x10
-#define IEEE80211_TX_3_SPATIAL_STREAMS 0x20
-#define IEEE80211_TX_4_SPATIAL_STREAMS 0x30
-
-#define IEEE80211_TX_MCS_SET 0xf8
-
-/*
- * Subtype data: If bit 6 is set then the data frame contains no actual data.
- */
-#define IEEE80211_FC0_SUBTYPE_NO_DATA_MASK  0x40
-#define IEEE80211_CONTAIN_DATA(_subtype) \
-	(!((_subtype) & IEEE80211_FC0_SUBTYPE_NO_DATA_MASK))
-
-#define IEEE8023_MAX_LEN 0x600  /* 1536 - larger is Ethernet II */
-#define RFC1042_SNAP_ORGCODE_0 0x00
-#define RFC1042_SNAP_ORGCODE_1 0x00
-#define RFC1042_SNAP_ORGCODE_2 0x00
-
-#define BTEP_SNAP_ORGCODE_0 0x00
-#define BTEP_SNAP_ORGCODE_1 0x00
-#define BTEP_SNAP_ORGCODE_2 0xf8
-
-/* BT 3.0 */
-#define BTAMP_SNAP_ORGCODE_0 0x00
-#define BTAMP_SNAP_ORGCODE_1 0x19
-#define BTAMP_SNAP_ORGCODE_2 0x58
-
-/* Aironet OUI Codes */
-#define AIRONET_SNAP_CODE_0  0x00
-#define AIRONET_SNAP_CODE_1  0x40
-#define AIRONET_SNAP_CODE_2  0x96
-
-#define IEEE80211_LSIG_LEN  3
-#define IEEE80211_HTSIG_LEN 6
-#define IEEE80211_SB_LEN    2
-
-/*
- * Information element header format
- */
-struct ieee80211_ie_header {
-	uint8_t element_id;     /* Element Id */
-	uint8_t length;         /* IE Length */
-} __packed;
-
-/*
- * Country information element.
- */
-#define IEEE80211_COUNTRY_MAX_TRIPLETS (83)
-struct ieee80211_ie_country {
-	uint8_t country_id;
-	uint8_t country_len;
-	uint8_t country_str[3];
-	uint8_t country_triplet[IEEE80211_COUNTRY_MAX_TRIPLETS * 3];
-} __packed;
-
-/* does frame have QoS sequence control data */
-#define IEEE80211_QOS_HAS_SEQ(wh) \
-	(((wh)->i_fc[0] & \
-	  (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) == \
-	 (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS))
-
-#define WME_QOSINFO_UAPSD   0x80        /* Mask for U-APSD field */
-#define WME_QOSINFO_COUNT   0x0f        /* Mask for Param Set Count field */
-/*
- * WME/802.11e information element.
- */
-struct ieee80211_ie_wme {
-	uint8_t wme_id;         /* IEEE80211_ELEMID_VENDOR */
-	uint8_t wme_len;        /* length in bytes */
-	uint8_t wme_oui[3];     /* 0x00, 0x50, 0xf2 */
-	uint8_t wme_type;       /* OUI type */
-	uint8_t wme_subtype;    /* OUI subtype */
-	uint8_t wme_version;    /* spec revision */
-	uint8_t wme_info;       /* QoS info */
-} __packed;
-
-/*
- * TS INFO part of the tspec element is a collection of bit flags
- */
-#if _BYTE_ORDER == _BIG_ENDIAN
-struct ieee80211_tsinfo_bitmap {
-	uint8_t one : 1, direction : 2, tid : 4, reserved1 : 1;
-	uint8_t reserved2 : 2, dot1Dtag : 3, psb : 1, reserved3 : 1, zero : 1;
-	uint8_t reserved5 : 7, reserved4 : 1;
-} __packed;
-#else
-struct ieee80211_tsinfo_bitmap {
-	uint8_t reserved1 : 1, tid : 4, direction : 2, one : 1;
-	uint8_t zero : 1, reserved3 : 1, psb : 1, dot1Dtag : 3, reserved2 : 2;
-	uint8_t reserved4 : 1, reserved5 : 7;
-} __packed;
-#endif
-
-/*
- * WME/802.11e Tspec Element
- */
-struct ieee80211_wme_tspec {
-	uint8_t ts_id;
-	uint8_t ts_len;
-	uint8_t ts_oui[3];
-	uint8_t ts_oui_type;
-	uint8_t ts_oui_subtype;
-	uint8_t ts_version;
-	uint8_t ts_tsinfo[3];
-	uint8_t ts_nom_msdu[2];
-	uint8_t ts_max_msdu[2];
-	uint8_t ts_min_svc[4];
-	uint8_t ts_max_svc[4];
-	uint8_t ts_inactv_intv[4];
-	uint8_t ts_susp_intv[4];
-	uint8_t ts_start_svc[4];
-	uint8_t ts_min_rate[4];
-	uint8_t ts_mean_rate[4];
-	uint8_t ts_peak_rate[4];
-	uint8_t ts_max_burst[4];
-	uint8_t ts_delay[4];
-	uint8_t ts_min_phy[4];
-	uint8_t ts_surplus[2];
-	uint8_t ts_medium_time[2];
-} __packed;
-
-/*
- * WME AC parameter field
- */
-struct ieee80211_wme_acparams {
-	uint8_t acp_aci_aifsn;
-	uint8_t acp_logcwminmax;
-	uint16_t acp_txop;
-} __packed;
-
-#define IEEE80211_WME_PARAM_LEN 24
-#define WME_NUM_AC              4       /* 4 AC categories */
-
-#define WME_PARAM_ACI           0x60    /* Mask for ACI field */
-#define WME_PARAM_ACI_S         5       /* Shift for ACI field */
-#define WME_PARAM_ACM           0x10    /* Mask for ACM bit */
-#define WME_PARAM_ACM_S         4       /* Shift for ACM bit */
-#define WME_PARAM_AIFSN         0x0f    /* Mask for aifsn field */
-#define WME_PARAM_AIFSN_S       0       /* Shift for aifsn field */
-#define WME_PARAM_LOGCWMIN      0x0f    /* Mask for CwMin field (in log) */
-#define WME_PARAM_LOGCWMIN_S    0       /* Shift for CwMin field */
-#define WME_PARAM_LOGCWMAX      0xf0    /* Mask for CwMax field (in log) */
-#define WME_PARAM_LOGCWMAX_S    4       /* Shift for CwMax field */
-
-#define WME_AC_TO_TID(_ac) (	   \
-		((_ac) == WME_AC_VO) ? 6 : \
-		((_ac) == WME_AC_VI) ? 5 : \
-		((_ac) == WME_AC_BK) ? 1 : \
-		0)
-
-#define TID_TO_WME_AC(_tid) (	   \
-		(((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
-		(((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
-		(((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
-		WME_AC_VO)
-
-/*
- * WME Parameter Element
- */
-struct ieee80211_wme_param {
-	uint8_t param_id;
-	uint8_t param_len;
-	uint8_t param_oui[3];
-	uint8_t param_oui_type;
-	uint8_t param_oui_sybtype;
-	uint8_t param_version;
-	uint8_t param_qosInfo;
-	uint8_t param_reserved;
-	struct ieee80211_wme_acparams params_acParams[WME_NUM_AC];
-} __packed;
-
-/*
- * WME U-APSD qos info field defines
- */
-#define WME_CAPINFO_UAPSD_EN                    0x00000080
-#define WME_CAPINFO_UAPSD_VO                    0x00000001
-#define WME_CAPINFO_UAPSD_VI                    0x00000002
-#define WME_CAPINFO_UAPSD_BK                    0x00000004
-#define WME_CAPINFO_UAPSD_BE                    0x00000008
-#define WME_CAPINFO_UAPSD_ACFLAGS_SHIFT         0
-#define WME_CAPINFO_UAPSD_ACFLAGS_MASK          0xF
-#define WME_CAPINFO_UAPSD_MAXSP_SHIFT           5
-#define WME_CAPINFO_UAPSD_MAXSP_MASK            0x3
-#define WME_CAPINFO_IE_OFFSET                   8
-#define WME_UAPSD_MAXSP(_qosinfo) (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & WME_CAPINFO_UAPSD_MAXSP_MASK)
-#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) ( (1<<(3 - (_ac))) &   \
-					      (((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & WME_CAPINFO_UAPSD_ACFLAGS_MASK) )
-
-/* Mask used to determined whether all queues are UAPSD-enabled */
-#define WME_CAPINFO_UAPSD_ALL                   (WME_CAPINFO_UAPSD_VO |	\
-						 WME_CAPINFO_UAPSD_VI |	\
-						 WME_CAPINFO_UAPSD_BK |	\
-						 WME_CAPINFO_UAPSD_BE)
-#define WME_CAPINFO_UAPSD_NONE                  0
-
-#define WME_UAPSD_AC_MAX_VAL            1
-#define WME_UAPSD_AC_INVAL                      WME_UAPSD_AC_MAX_VAL+1
-
-/*
- * Atheros Advanced Capability information element.
- */
-struct ieee80211_ie_athAdvCap {
-	uint8_t athAdvCap_id;   /* IEEE80211_ELEMID_VENDOR */
-	uint8_t athAdvCap_len;  /* length in bytes */
-	uint8_t athAdvCap_oui[3];       /* 0x00, 0x03, 0x7f */
-	uint8_t athAdvCap_type; /* OUI type */
-	uint16_t athAdvCap_version;     /* spec revision */
-	uint8_t athAdvCap_capability;   /* Capability info */
-	uint16_t athAdvCap_defKeyIndex;
-} __packed;
-
-/*
- * Atheros Extended Capability information element.
- */
-struct ieee80211_ie_ath_extcap {
-	uint8_t ath_extcap_id;  /* IEEE80211_ELEMID_VENDOR */
-	uint8_t ath_extcap_len; /* length in bytes */
-	uint8_t ath_extcap_oui[3];      /* 0x00, 0x03, 0x7f */
-	uint8_t ath_extcap_type;        /* OUI type */
-	uint8_t ath_extcap_subtype;     /* OUI subtype */
-	uint8_t ath_extcap_version;     /* spec revision */
-	uint32_t ath_extcap_extcap : 16,  /* B0-15  extended capabilities */
-		 ath_extcap_weptkipaggr_rxdelim : 8, /* B16-23 num delimiters for receiving WEP/TKIP aggregates */
-		 ath_extcap_reserved : 8; /* B24-31 reserved */
-} __packed;
-
-/*
- * Atheros XR information element.
- */
-struct ieee80211_xr_param {
-	uint8_t param_id;
-	uint8_t param_len;
-	uint8_t param_oui[3];
-	uint8_t param_oui_type;
-	uint8_t param_oui_sybtype;
-	uint8_t param_version;
-	uint8_t param_Info;
-	uint8_t param_base_bssid[IEEE80211_ADDR_LEN];
-	uint8_t param_xr_bssid[IEEE80211_ADDR_LEN];
-	uint16_t param_xr_beacon_interval;
-	uint8_t param_base_ath_capability;
-	uint8_t param_xr_ath_capability;
-} __packed;
-
-/*
- * SFA information element.
- */
-struct ieee80211_ie_sfa {
-	uint8_t sfa_id;         /* IEEE80211_ELEMID_VENDOR */
-	uint8_t sfa_len;        /* length in bytes */
-	uint8_t sfa_oui[3];     /* 0x00, 0x40, 0x96 */
-	uint8_t sfa_type;       /* OUI type */
-	uint8_t sfa_caps;       /* Capabilities */
-} __packed;
-
-/* Atheros capabilities */
-#define IEEE80211_ATHC_TURBOP   0x0001  /* Turbo Prime */
-#define IEEE80211_ATHC_COMP     0x0002  /* Compression */
-#define IEEE80211_ATHC_FF       0x0004  /* Fast Frames */
-#define IEEE80211_ATHC_XR       0x0008  /* Xtended Range support */
-#define IEEE80211_ATHC_AR       0x0010  /* Advanced Radar support */
-#define IEEE80211_ATHC_BURST    0x0020  /* Bursting - not negotiated */
-#define IEEE80211_ATHC_WME      0x0040  /* CWMin tuning */
-#define IEEE80211_ATHC_BOOST    0x0080  /* Boost */
-#define IEEE80211_ATHC_TDLS     0x0100  /* TDLS */
-
-/* Atheros extended capabilities */
-/* OWL device capable of WDS workaround */
-#define IEEE80211_ATHEC_OWLWDSWAR        0x0001
-#define IEEE80211_ATHEC_WEPTKIPAGGR          0x0002
-#define IEEE80211_ATHEC_EXTRADELIMWAR    0x0004
-/*
- * Management Frames
- */
-
-/*
- * *** Platform-specific code?? ***
- * In Vista one must use bit fields of type (unsigned short = uint16_t) to
- * ensure data structure is of the correct size. ANSI C used to specify only
- * "int" bit fields, which led to a larger structure size in Windows (32 bits).
- *
- * We must make sure the following construction is valid in all OS's.
- */
-union ieee80211_capability {
-	struct {
-		uint16_t ess : 1;
-		uint16_t ibss : 1;
-		uint16_t cf_pollable : 1;
-		uint16_t cf_poll_request : 1;
-		uint16_t privacy : 1;
-		uint16_t short_preamble : 1;
-		uint16_t pbcc : 1;
-		uint16_t channel_agility : 1;
-		uint16_t spectrum_management : 1;
-		uint16_t qos : 1;
-		uint16_t short_slot_time : 1;
-		uint16_t apsd : 1;
-		uint16_t reserved2 : 1;
-		uint16_t dsss_ofdm : 1;
-		uint16_t del_block_ack : 1;
-		uint16_t immed_block_ack : 1;
-	};
-
-	uint16_t value;
-} __packed;
-
-struct ieee80211_beacon_frame {
-	uint8_t timestamp[8];   /* the value of sender's TSFTIMER */
-	uint16_t beacon_interval;       /* the number of time units between target beacon transmission times */
-	union ieee80211_capability capability;
-/* Value of capability for every bit
-   #define IEEE80211_CAPINFO_ESS               0x0001
-   #define IEEE80211_CAPINFO_IBSS              0x0002
-   #define IEEE80211_CAPINFO_CF_POLLABLE       0x0004
-   #define IEEE80211_CAPINFO_CF_POLLREQ        0x0008
-   #define IEEE80211_CAPINFO_PRIVACY           0x0010
-   #define IEEE80211_CAPINFO_SHORT_PREAMBLE    0x0020
-   #define IEEE80211_CAPINFO_PBCC              0x0040
-   #define IEEE80211_CAPINFO_CHNL_AGILITY      0x0080
-   #define IEEE80211_CAPINFO_SPECTRUM_MGMT     0x0100
-   #define IEEE80211_CAPINFO_QOS               0x0200
-   #define IEEE80211_CAPINFO_SHORT_SLOTTIME    0x0400
-   #define IEEE80211_CAPINFO_APSD              0x0800
-   #define IEEE80211_CAPINFO_RADIOMEAS         0x1000
-   #define IEEE80211_CAPINFO_DSSSOFDM          0x2000
-   bits 14-15 are reserved
- */
-	struct ieee80211_ie_header info_elements;
-} __packed;
-
-/*
- * Management Action Frames
- */
-
-/* generic frame format */
-struct ieee80211_action {
-	uint8_t ia_category;
-	uint8_t ia_action;
-} __packed;
-
-/* spectrum action frame header */
-struct ieee80211_action_measrep_header {
-	struct ieee80211_action action_header;
-	uint8_t dialog_token;
-} __packed;
-
-/* categories */
-#define IEEE80211_ACTION_CAT_SPECTRUM       0   /* Spectrum management */
-#define IEEE80211_ACTION_CAT_QOS            1   /* IEEE QoS  */
-#define IEEE80211_ACTION_CAT_DLS            2   /* DLS */
-#define IEEE80211_ACTION_CAT_BA             3   /* BA */
-#define IEEE80211_ACTION_CAT_PUBLIC         4   /* Public Action Frame */
-#define IEEE80211_ACTION_CAT_HT             7   /* HT per IEEE802.11n-D1.06 */
-#define IEEE80211_ACTION_CAT_SA_QUERY       8   /* SA Query per IEEE802.11w, PMF */
-#define IEEE80211_ACTION_CAT_WMM_QOS       17   /* QoS from WMM specification */
-#define IEEE80211_ACTION_CAT_VHT           21   /* VHT Action */
-
-/* Spectrum Management actions */
-#define IEEE80211_ACTION_MEAS_REQUEST       0   /* Measure channels */
-#define IEEE80211_ACTION_MEAS_REPORT        1
-#define IEEE80211_ACTION_TPC_REQUEST        2   /* Transmit Power control */
-#define IEEE80211_ACTION_TPC_REPORT         3
-#define IEEE80211_ACTION_CHAN_SWITCH        4   /* 802.11h Channel Switch Announcement */
-
-/* HT actions */
-#define IEEE80211_ACTION_HT_TXCHWIDTH       0   /* recommended transmission channel width */
-#define IEEE80211_ACTION_HT_SMPOWERSAVE     1   /* Spatial Multiplexing (SM) Power Save */
-#define IEEE80211_ACTION_HT_CSI             4   /* CSI Frame */
-#define IEEE80211_ACTION_HT_NONCOMP_BF      5   /* Non-compressed Beamforming */
-#define IEEE80211_ACTION_HT_COMP_BF         6   /* Compressed Beamforming */
-
-/* VHT actions */
-#define IEEE80211_ACTION_VHT_OPMODE         2   /* Operating  mode notification */
-
-/* Spectrum channel switch action frame after IE*/
-/* Public Actions*/
-#define IEEE80211_ACTION_TDLS_DISCRESP  14      /* TDLS Discovery Response frame */
-
-/* HT - recommended transmission channel width */
-struct ieee80211_action_ht_txchwidth {
-	struct ieee80211_action at_header;
-	uint8_t at_chwidth;
-} __packed;
-
-#define IEEE80211_A_HT_TXCHWIDTH_20         0
-#define IEEE80211_A_HT_TXCHWIDTH_2040       1
-
-/* HT - Spatial Multiplexing (SM) Power Save */
-struct ieee80211_action_ht_smpowersave {
-	struct ieee80211_action as_header;
-	uint8_t as_control;
-} __packed;
-
-/*HT - CSI Frame */                        /* for TxBF RC */
-#define MIMO_CONTROL_LEN 6
-struct ieee80211_action_ht_CSI {
-	struct ieee80211_action as_header;
-	uint8_t mimo_control[MIMO_CONTROL_LEN];
-} __packed;
-
-/*HT - V/CV report frame*/
-struct ieee80211_action_ht_txbf_rpt {
-	struct ieee80211_action as_header;
-	uint8_t mimo_control[MIMO_CONTROL_LEN];
-} __packed;
-
-/*
- * 802.11ac Operating Mode  Notification
- */
-struct ieee80211_ie_op_mode {
-#if _BYTE_ORDER == _BIG_ENDIAN
-	uint8_t rx_nss_type : 1, rx_nss : 3, reserved : 2, ch_width : 2;
-#else
-	uint8_t ch_width : 2, reserved : 2, rx_nss : 3, rx_nss_type : 1;
-#endif
-} __packed;
-
-struct ieee80211_ie_op_mode_ntfy {
-	uint8_t elem_id;
-	uint8_t elem_len;
-	struct ieee80211_ie_op_mode opmode;
-} __packed;
-
-/* VHT - recommended Channel width and Nss */
-struct ieee80211_action_vht_opmode {
-	struct ieee80211_action at_header;
-	struct ieee80211_ie_op_mode at_op_mode;
-} __packed;
-
-/* values defined for 'as_control' field per 802.11n-D1.06 */
-#define IEEE80211_A_HT_SMPOWERSAVE_DISABLED     0x00    /* SM Power Save Disabled, SM packets ok  */
-#define IEEE80211_A_HT_SMPOWERSAVE_ENABLED      0x01    /* SM Power Save Enabled bit  */
-#define IEEE80211_A_HT_SMPOWERSAVE_MODE         0x02    /* SM Power Save Mode bit */
-#define IEEE80211_A_HT_SMPOWERSAVE_RESERVED     0xFC    /* SM Power Save Reserved bits */
-
-/* values defined for SM Power Save Mode bit */
-#define IEEE80211_A_HT_SMPOWERSAVE_STATIC       0x00    /* Static, SM packets not ok */
-#define IEEE80211_A_HT_SMPOWERSAVE_DYNAMIC      0x02    /* Dynamic, SM packets ok if preceded by RTS */
-
-/* DLS actions */
-#define IEEE80211_ACTION_DLS_REQUEST            0
-#define IEEE80211_ACTION_DLS_RESPONSE           1
-#define IEEE80211_ACTION_DLS_TEARDOWN           2
-
-struct ieee80211_dls_request {
-	struct ieee80211_action hdr;
-	uint8_t dst_addr[IEEE80211_ADDR_LEN];
-	uint8_t src_addr[IEEE80211_ADDR_LEN];
-	uint16_t capa_info;
-	uint16_t timeout;
-} __packed;
-
-struct ieee80211_dls_response {
-	struct ieee80211_action hdr;
-	uint16_t statuscode;
-	uint8_t dst_addr[IEEE80211_ADDR_LEN];
-	uint8_t src_addr[IEEE80211_ADDR_LEN];
-} __packed;
-
-/* BA actions */
-#define IEEE80211_ACTION_BA_ADDBA_REQUEST       0       /* ADDBA request */
-#define IEEE80211_ACTION_BA_ADDBA_RESPONSE      1       /* ADDBA response */
-#define IEEE80211_ACTION_BA_DELBA               2       /* DELBA */
-
-struct ieee80211_ba_parameterset {
-#if _BYTE_ORDER == _BIG_ENDIAN
-	uint16_t buffersize : 10, /* B6-15  buffer size */
-		 tid : 4,       /* B2-5   TID */
-		 bapolicy : 1,  /* B1   block ack policy */
-		 amsdusupported : 1; /* B0   amsdu supported */
-#else
-	uint16_t amsdusupported : 1,      /* B0   amsdu supported */
-		 bapolicy : 1,  /* B1   block ack policy */
-		 tid : 4,       /* B2-5   TID */
-		 buffersize : 10; /* B6-15  buffer size */
-#endif
-} __packed;
-
-#define  IEEE80211_BA_POLICY_DELAYED      0
-#define  IEEE80211_BA_POLICY_IMMEDIATE    1
-#define  IEEE80211_BA_AMSDU_SUPPORTED     1
-
-struct ieee80211_ba_seqctrl {
-#if _BYTE_ORDER == _BIG_ENDIAN
-	uint16_t startseqnum : 12,        /* B4-15  starting sequence number */
-		 fragnum : 4;   /* B0-3  fragment number */
-#else
-	uint16_t fragnum : 4,     /* B0-3  fragment number */
-		 startseqnum : 12; /* B4-15  starting sequence number */
-#endif
-} __packed;
-
-struct ieee80211_delba_parameterset {
-#if _BYTE_ORDER == _BIG_ENDIAN
-	uint16_t tid : 4,         /* B12-15  tid */
-		 initiator : 1, /* B11     initiator */
-		 reserved0 : 11; /* B0-10   reserved */
-#else
-	uint16_t reserved0 : 11,  /* B0-10   reserved */
-		 initiator : 1, /* B11     initiator */
-		 tid : 4;       /* B12-15  tid */
-#endif
-} __packed;
-
-/* BA - ADDBA request */
-struct ieee80211_action_ba_addbarequest {
-	struct ieee80211_action rq_header;
-	uint8_t rq_dialogtoken;
-	struct ieee80211_ba_parameterset rq_baparamset;
-	uint16_t rq_batimeout;  /* in TUs */
-	struct ieee80211_ba_seqctrl rq_basequencectrl;
-} __packed;
-
-/* BA - ADDBA response */
-struct ieee80211_action_ba_addbaresponse {
-	struct ieee80211_action rs_header;
-	uint8_t rs_dialogtoken;
-	uint16_t rs_statuscode;
-	struct ieee80211_ba_parameterset rs_baparamset;
-	uint16_t rs_batimeout;  /* in TUs */
-} __packed;
-
-/* BA - DELBA */
-struct ieee80211_action_ba_delba {
-	struct ieee80211_action dl_header;
-	struct ieee80211_delba_parameterset dl_delbaparamset;
-	uint16_t dl_reasoncode;
-} __packed;
-
-/* MGT Notif actions */
-#define IEEE80211_WMM_QOS_ACTION_SETUP_REQ    0
-#define IEEE80211_WMM_QOS_ACTION_SETUP_RESP   1
-#define IEEE80211_WMM_QOS_ACTION_TEARDOWN     2
-
-#define IEEE80211_WMM_QOS_DIALOG_TEARDOWN     0
-#define IEEE80211_WMM_QOS_DIALOG_SETUP        1
-
-#define IEEE80211_WMM_QOS_TSID_DATA_TSPEC     6
-#define IEEE80211_WMM_QOS_TSID_SIG_TSPEC      7
-
-struct ieee80211_action_wmm_qos {
-	struct ieee80211_action ts_header;
-	uint8_t ts_dialogtoken;
-	uint8_t ts_statuscode;
-	struct ieee80211_wme_tspec ts_tspecie;
-} __packed;
-
-/*
- * Control frames.
- */
-struct ieee80211_frame_min {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_addr1[IEEE80211_ADDR_LEN];
-	uint8_t i_addr2[IEEE80211_ADDR_LEN];
-	/* FCS */
-} __packed;
-
-/*
- * BAR frame format
- */
-#define IEEE80211_BAR_CTL_TID_M     0xF000      /* tid mask             */
-#define IEEE80211_BAR_CTL_TID_S         12      /* tid shift            */
-#define IEEE80211_BAR_CTL_NOACK     0x0001      /* no-ack policy        */
-#define IEEE80211_BAR_CTL_COMBA     0x0004      /* compressed block-ack */
-
-/*
- * SA Query Action mgmt Frame
- */
-struct ieee80211_action_sa_query {
-	struct ieee80211_action sa_header;
-	uint16_t sa_transId;
-};
-
-typedef enum ieee80211_action_sa_query_type {
-	IEEE80211_ACTION_SA_QUERY_REQUEST,
-	IEEE80211_ACTION_SA_QUERY_RESPONSE
-} ieee80211_action_sa_query_type_t;
-
-struct ieee80211_frame_bar {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_ra[IEEE80211_ADDR_LEN];
-	uint8_t i_ta[IEEE80211_ADDR_LEN];
-	uint16_t i_ctl;
-	uint16_t i_seq;
-	/* FCS */
-} __packed;
-
-struct ieee80211_frame_rts {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_ra[IEEE80211_ADDR_LEN];
-	uint8_t i_ta[IEEE80211_ADDR_LEN];
-	/* FCS */
-} __packed;
-
-struct ieee80211_frame_cts {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_ra[IEEE80211_ADDR_LEN];
-	/* FCS */
-} __packed;
-
-struct ieee80211_frame_ack {
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];
-	uint8_t i_ra[IEEE80211_ADDR_LEN];
-	/* FCS */
-} __packed;
-
-struct ieee80211_frame_pspoll {
-	uint8_t i_fc[2];
-	uint8_t i_aid[2];
-	uint8_t i_bssid[IEEE80211_ADDR_LEN];
-	uint8_t i_ta[IEEE80211_ADDR_LEN];
-	/* FCS */
-} __packed;
-
-struct ieee80211_frame_cfend {  /* NB: also CF-End+CF-Ack */
-	uint8_t i_fc[2];
-	uint8_t i_dur[2];       /* should be zero */
-	uint8_t i_ra[IEEE80211_ADDR_LEN];
-	uint8_t i_bssid[IEEE80211_ADDR_LEN];
-	/* FCS */
-} __packed;
-
-/*
- * BEACON management packets
- *
- *  octet timestamp[8]
- *  octet beacon interval[2]
- *  octet capability information[2]
- *  information element
- *      octet elemid
- *      octet length
- *      octet information[length]
- */
-
-typedef uint8_t *ieee80211_mgt_beacon_t;
-
-#define IEEE80211_BEACON_INTERVAL(beacon) \
-	((beacon)[8] | ((beacon)[9] << 8))
-#define IEEE80211_BEACON_CAPABILITY(beacon) \
-	((beacon)[10] | ((beacon)[11] << 8))
-
-#define IEEE80211_CAPINFO_ESS               0x0001
-#define IEEE80211_CAPINFO_IBSS              0x0002
-#define IEEE80211_CAPINFO_CF_POLLABLE       0x0004
-#define IEEE80211_CAPINFO_CF_POLLREQ        0x0008
-#define IEEE80211_CAPINFO_PRIVACY           0x0010
-#define IEEE80211_CAPINFO_SHORT_PREAMBLE    0x0020
-#define IEEE80211_CAPINFO_PBCC              0x0040
-#define IEEE80211_CAPINFO_CHNL_AGILITY      0x0080
-#define IEEE80211_CAPINFO_SPECTRUM_MGMT     0x0100
-#define IEEE80211_CAPINFO_QOS               0x0200
-#define IEEE80211_CAPINFO_SHORT_SLOTTIME    0x0400
-#define IEEE80211_CAPINFO_APSD              0x0800
-#define IEEE80211_CAPINFO_RADIOMEAS         0x1000
-#define IEEE80211_CAPINFO_DSSSOFDM          0x2000
-/* bits 14-15 are reserved */
-
-/*
- * 802.11i/WPA information element (maximally sized).
- */
-struct ieee80211_ie_wpa {
-	uint8_t wpa_id;         /* IEEE80211_ELEMID_VENDOR */
-	uint8_t wpa_len;        /* length in bytes */
-	uint8_t wpa_oui[3];     /* 0x00, 0x50, 0xf2 */
-	uint8_t wpa_type;       /* OUI type */
-	uint16_t wpa_version;   /* spec revision */
-	uint32_t wpa_mcipher[1];        /* multicast/group key cipher */
-	uint16_t wpa_uciphercnt;        /* # pairwise key ciphers */
-	uint32_t wpa_uciphers[8];       /* ciphers */
-	uint16_t wpa_authselcnt;        /* authentication selector cnt */
-	uint32_t wpa_authsels[8];       /* selectors */
-	uint16_t wpa_caps;      /* 802.11i capabilities */
-	uint16_t wpa_pmkidcnt;  /* 802.11i pmkid count */
-	uint16_t wpa_pmkids[8]; /* 802.11i pmkids */
-} __packed;
-
-#ifndef _BYTE_ORDER
-#error "Don't know native byte order"
-#endif
-
-#ifndef IEEE80211N_IE
-/* Temporary vendor specific IE for 11n pre-standard interoperability */
-#define VENDOR_HT_OUI       0x00904c
-#define VENDOR_HT_CAP_ID    51
-#define VENDOR_HT_INFO_ID   52
-#endif
-
-#ifdef ATH_SUPPORT_TxBF
-union ieee80211_hc_txbf {
-	struct {
-#if _BYTE_ORDER == _BIG_ENDIAN
-		uint32_t reserved : 3,
-			 channel_estimation_cap : 2,
-			 csi_max_rows_bfer : 2,
-			 comp_bfer_antennas : 2,
-			 noncomp_bfer_antennas : 2,
-			 csi_bfer_antennas : 2,
-			 minimal_grouping : 2,
-			 explicit_comp_bf : 2,
-			 explicit_noncomp_bf : 2,
-			 explicit_csi_feedback : 2,
-			 explicit_comp_steering : 1,
-			 explicit_noncomp_steering : 1,
-			 explicit_csi_txbf_capable : 1,
-			 calibration : 2,
-			 implicit_txbf_capable : 1,
-			 tx_ndp_capable : 1,
-			 rx_ndp_capable : 1,
-			 tx_staggered_sounding : 1,
-			 rx_staggered_sounding : 1, implicit_rx_capable : 1;
-#else
-		uint32_t implicit_rx_capable : 1,
-			 rx_staggered_sounding : 1,
-			 tx_staggered_sounding : 1,
-			 rx_ndp_capable : 1,
-			 tx_ndp_capable : 1,
-			 implicit_txbf_capable : 1,
-			 calibration : 2,
-			 explicit_csi_txbf_capable : 1,
-			 explicit_noncomp_steering : 1,
-			 explicit_comp_steering : 1,
-			 explicit_csi_feedback : 2,
-			 explicit_noncomp_bf : 2,
-			 explicit_comp_bf : 2,
-			 minimal_grouping : 2,
-			 csi_bfer_antennas : 2,
-			 noncomp_bfer_antennas : 2,
-			 comp_bfer_antennas : 2,
-			 csi_max_rows_bfer : 2, channel_estimation_cap : 2, reserved : 3;
-#endif
-	};
-
-	uint32_t value;
-} __packed;
-#endif
-
-struct ieee80211_ie_htcap_cmn {
-	uint16_t hc_cap;        /* HT capabilities */
-#if _BYTE_ORDER == _BIG_ENDIAN
-	uint8_t hc_reserved : 3,  /* B5-7 reserved */
-		hc_mpdudensity : 3, /* B2-4 MPDU density (aka Minimum MPDU Start Spacing) */
-		hc_maxampdu : 2; /* B0-1 maximum rx A-MPDU factor */
-#else
-	uint8_t hc_maxampdu : 2,  /* B0-1 maximum rx A-MPDU factor */
-		hc_mpdudensity : 3, /* B2-4 MPDU density (aka Minimum MPDU Start Spacing) */
-		hc_reserved : 3; /* B5-7 reserved */
-#endif
-	uint8_t hc_mcsset[16];  /* supported MCS set */
-	uint16_t hc_extcap;     /* extended HT capabilities */
-#ifdef ATH_SUPPORT_TxBF
-	union ieee80211_hc_txbf hc_txbf;        /* txbf capabilities */
-#else
-	uint32_t hc_txbf;       /* txbf capabilities */
-#endif
-	uint8_t hc_antenna;     /* antenna capabilities */
-} __packed;
-
-/*
- * 802.11n HT Capability IE
- */
-struct ieee80211_ie_htcap {
-	uint8_t hc_id;          /* element ID */
-	uint8_t hc_len;         /* length in bytes */
-	struct ieee80211_ie_htcap_cmn hc_ie;
-} __packed;
-
-/*
- * Temporary vendor private HT Capability IE
- */
-struct vendor_ie_htcap {
-	uint8_t hc_id;          /* element ID */
-	uint8_t hc_len;         /* length in bytes */
-	uint8_t hc_oui[3];
-	uint8_t hc_ouitype;
-	struct ieee80211_ie_htcap_cmn hc_ie;
-} __packed;
-
-/* HT capability flags */
-#define IEEE80211_HTCAP_C_ADVCODING             0x0001
-#define IEEE80211_HTCAP_C_CHWIDTH40             0x0002
-#define IEEE80211_HTCAP_C_SMPOWERSAVE_STATIC    0x0000  /* Capable of SM Power Save (Static) */
-#define IEEE80211_HTCAP_C_SMPOWERSAVE_DYNAMIC   0x0004  /* Capable of SM Power Save (Dynamic) */
-#define IEEE80211_HTCAP_C_SM_RESERVED           0x0008  /* Reserved */
-#define IEEE80211_HTCAP_C_SM_ENABLED            0x000c  /* SM enabled, no SM Power Save */
-#define IEEE80211_HTCAP_C_GREENFIELD            0x0010
-#define IEEE80211_HTCAP_C_SHORTGI20             0x0020
-#define IEEE80211_HTCAP_C_SHORTGI40             0x0040
-#define IEEE80211_HTCAP_C_TXSTBC                0x0080
-#define IEEE80211_HTCAP_C_TXSTBC_S                   7
-#define IEEE80211_HTCAP_C_RXSTBC                0x0300  /* 2 bits */
-#define IEEE80211_HTCAP_C_RXSTBC_S                   8
-#define IEEE80211_HTCAP_C_DELAYEDBLKACK         0x0400
-#define IEEE80211_HTCAP_C_MAXAMSDUSIZE          0x0800  /* 1 = 8K, 0 = 3839B */
-#define IEEE80211_HTCAP_C_DSSSCCK40             0x1000
-#define IEEE80211_HTCAP_C_PSMP                  0x2000
-#define IEEE80211_HTCAP_C_INTOLERANT40          0x4000
-#define IEEE80211_HTCAP_C_LSIGTXOPPROT          0x8000
-
-#define IEEE80211_HTCAP_C_SM_MASK               0x000c  /* Spatial Multiplexing (SM) capabitlity bitmask */
-
-/* B0-1 maximum rx A-MPDU factor 2^(13+Max Rx A-MPDU Factor) */
-enum {
-	IEEE80211_HTCAP_MAXRXAMPDU_8192,        /* 2 ^ 13 */
-	IEEE80211_HTCAP_MAXRXAMPDU_16384,       /* 2 ^ 14 */
-	IEEE80211_HTCAP_MAXRXAMPDU_32768,       /* 2 ^ 15 */
-	IEEE80211_HTCAP_MAXRXAMPDU_65536,       /* 2 ^ 16 */
-};
-#define IEEE80211_HTCAP_MAXRXAMPDU_FACTOR   13
-
-/* B2-4 MPDU density (usec) */
-enum {
-	IEEE80211_HTCAP_MPDUDENSITY_NA, /* No time restriction */
-	IEEE80211_HTCAP_MPDUDENSITY_0_25,       /* 1/4 usec */
-	IEEE80211_HTCAP_MPDUDENSITY_0_5,        /* 1/2 usec */
-	IEEE80211_HTCAP_MPDUDENSITY_1,  /* 1 usec */
-	IEEE80211_HTCAP_MPDUDENSITY_2,  /* 2 usec */
-	IEEE80211_HTCAP_MPDUDENSITY_4,  /* 4 usec */
-	IEEE80211_HTCAP_MPDUDENSITY_8,  /* 8 usec */
-	IEEE80211_HTCAP_MPDUDENSITY_16, /* 16 usec */
-};
-
-/* HT extended capability flags */
-#define IEEE80211_HTCAP_EXTC_PCO                0x0001
-#define IEEE80211_HTCAP_EXTC_TRANS_TIME_RSVD    0x0000
-#define IEEE80211_HTCAP_EXTC_TRANS_TIME_400     0x0002  /* 20-40 switch time */
-#define IEEE80211_HTCAP_EXTC_TRANS_TIME_1500    0x0004  /* in us             */
-#define IEEE80211_HTCAP_EXTC_TRANS_TIME_5000    0x0006
-#define IEEE80211_HTCAP_EXTC_RSVD_1             0x00f8
-#define IEEE80211_HTCAP_EXTC_MCS_FEEDBACK_NONE  0x0000
-#define IEEE80211_HTCAP_EXTC_MCS_FEEDBACK_RSVD  0x0100
-#define IEEE80211_HTCAP_EXTC_MCS_FEEDBACK_UNSOL 0x0200
-#define IEEE80211_HTCAP_EXTC_MCS_FEEDBACK_FULL  0x0300
-#define IEEE80211_HTCAP_EXTC_RSVD_2             0xfc00
-#ifdef ATH_SUPPORT_TxBF
-#define IEEE80211_HTCAP_EXTC_HTC_SUPPORT        0x0400
-#endif
-
-struct ieee80211_ie_htinfo_cmn {
-	uint8_t hi_ctrlchannel; /* control channel */
-#if _BYTE_ORDER == _BIG_ENDIAN
-	uint8_t hi_serviceinterval : 3,   /* B5-7 svc interval granularity */
-		hi_ctrlaccess : 1, /* B4   controlled access only */
-		hi_rifsmode : 1, /* B3   rifs mode */
-		hi_txchwidth : 1, /* B2   recommended xmiss width set */
-		hi_extchoff : 2; /* B0-1 extension channel offset */
-
-/*
-
- * The following 2 consecutive bytes are defined in word in 80211n spec.
-
- * Some processors store MSB byte into lower memory address which causes wrong
-
- * wrong byte sequence in beacon. Thus we break into byte definition which should
-
- * avoid the problem for all processors
-
- */
-
-	uint8_t hi_reserved3 : 3, /* B5-7 reserved */
-		hi_obssnonhtpresent : 1, /* B4   OBSS non-HT STA present */
-		hi_txburstlimit : 1, /* B3   transmit burst limit */
-		hi_nongfpresent : 1, /* B2   non greenfield devices present */
-		hi_opmode : 2;  /* B0-1 operating mode */
-
-	uint8_t hi_reserved0;   /* B0-7 (B8-15 in 11n) reserved */
-
-/* The following 2 consecutive bytes are defined in word in 80211n spec. */
-
-	uint8_t hi_dualctsprot : 1,       /* B7   dual CTS protection */
-		hi_dualbeacon : 1, /* B6   dual beacon */
-		hi_reserved2 : 6; /* B0-5 reserved */
-	uint8_t hi_reserved1 : 4, /* B4-7 (B12-15 in 11n) reserved */
-		hi_pcophase : 1, /* B3   (B11 in 11n)  pco phase */
-		hi_pcoactive : 1, /* B2   (B10 in 11n)  pco active */
-		hi_lsigtxopprot : 1, /* B1   (B9 in 11n)   l-sig txop protection full support */
-		hi_stbcbeacon : 1; /* B0   (B8 in 11n)   STBC beacon */
-#else
-	uint8_t hi_extchoff : 2,  /* B0-1 extension channel offset */
-		hi_txchwidth : 1, /* B2   recommended xmiss width set */
-		hi_rifsmode : 1, /* B3   rifs mode */
-		hi_ctrlaccess : 1, /* B4   controlled access only */
-		hi_serviceinterval : 3; /* B5-7 svc interval granularity */
-	uint16_t hi_opmode : 2,   /* B0-1 operating mode */
-		 hi_nongfpresent : 1, /* B2   non greenfield devices present */
-		 hi_txburstlimit : 1, /* B3   transmit burst limit */
-		 hi_obssnonhtpresent : 1, /* B4   OBSS non-HT STA present */
-		 hi_reserved0 : 11; /* B5-15 reserved */
-	uint16_t hi_reserved2 : 6,        /* B0-5 reserved */
-		 hi_dualbeacon : 1, /* B6   dual beacon */
-		 hi_dualctsprot : 1, /* B7   dual CTS protection */
-		 hi_stbcbeacon : 1, /* B8   STBC beacon */
-		 hi_lsigtxopprot : 1, /* B9   l-sig txop protection full support */
-		 hi_pcoactive : 1, /* B10  pco active */
-		 hi_pcophase : 1, /* B11  pco phase */
-		 hi_reserved1 : 4; /* B12-15 reserved */
-#endif
-	uint8_t hi_basicmcsset[16];     /* basic MCS set */
-} __packed;
-
-/*
- * 802.11n HT Information IE
- */
-struct ieee80211_ie_htinfo {
-	uint8_t hi_id;          /* element ID */
-	uint8_t hi_len;         /* length in bytes */
-	struct ieee80211_ie_htinfo_cmn hi_ie;
-} __packed;
-
-/*
- * Temporary vendor private HT Information IE
- */
-struct vendor_ie_htinfo {
-	uint8_t hi_id;          /* element ID */
-	uint8_t hi_len;         /* length in bytes */
-	uint8_t hi_oui[3];
-	uint8_t hi_ouitype;
-	struct ieee80211_ie_htinfo_cmn hi_ie;
-} __packed;
-
-/* extension channel offset (2 bit signed number) */
-enum {
-	IEEE80211_HTINFO_EXTOFFSET_NA = 0,      /* 0  no extension channel is present */
-	IEEE80211_HTINFO_EXTOFFSET_ABOVE = 1,   /* +1 extension channel above control channel */
-	IEEE80211_HTINFO_EXTOFFSET_UNDEF = 2,   /* -2 undefined */
-	IEEE80211_HTINFO_EXTOFFSET_BELOW = 3    /* -1 extension channel below control channel */
-};
-
-/* recommended transmission width set */
-enum {
-	IEEE80211_HTINFO_TXWIDTH_20,
-	IEEE80211_HTINFO_TXWIDTH_2040
-};
-
-/* operating flags */
-#define IEEE80211_HTINFO_OPMODE_PURE                0x00        /* no protection */
-#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_OPT      0x01        /* prot optional (legacy device maybe present) */
-#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_40       0x02        /* prot required (20 MHz) */
-#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_ALL      0x03        /* prot required (legacy devices present) */
-#define IEEE80211_HTINFO_OPMODE_NON_GF_PRESENT      0x04        /* non-greenfield devices present */
-
-#define IEEE80211_HTINFO_OPMODE_MASK                0x03        /* For protection 0x00-0x03 */
-
-/* Non-greenfield STAs present */
-enum {
-	IEEE80211_HTINFO_NON_GF_NOT_PRESENT,    /* Non-greenfield STAs not present */
-	IEEE80211_HTINFO_NON_GF_PRESENT,        /* Non-greenfield STAs present */
-};
-
-/* Transmit Burst Limit */
-enum {
-	IEEE80211_HTINFO_TXBURST_UNLIMITED,     /* Transmit Burst is unlimited */
-	IEEE80211_HTINFO_TXBURST_LIMITED,       /* Transmit Burst is limited */
-};
-
-/* OBSS Non-HT STAs present */
-enum {
-	IEEE80211_HTINFO_OBSS_NONHT_NOT_PRESENT,        /* OBSS Non-HT STAs not present */
-	IEEE80211_HTINFO_OBSS_NONHT_PRESENT,    /* OBSS Non-HT STAs present */
-};
-
-/* misc flags */
-#define IEEE80211_HTINFO_DUALBEACON               0x0040        /* B6   dual beacon */
-#define IEEE80211_HTINFO_DUALCTSPROT              0x0080        /* B7   dual stbc protection */
-#define IEEE80211_HTINFO_STBCBEACON               0x0100        /* B8   secondary beacon */
-#define IEEE80211_HTINFO_LSIGTXOPPROT             0x0200        /* B9   lsig txop prot full support */
-#define IEEE80211_HTINFO_PCOACTIVE                0x0400        /* B10  pco active */
-#define IEEE80211_HTINFO_PCOPHASE                 0x0800        /* B11  pco phase */
-
-/* Secondary Channel offset for for 40MHz direct link */
-#define IEEE80211_SECONDARY_CHANNEL_ABOVE         1
-#define IEEE80211_SECONDARY_CHANNEL_BELOW         3
-
-#define IEEE80211_TDLS_CHAN_SX_PROHIBIT         0x00000002      /* bit-2 TDLS Channel Switch Prohibit */
-
-/* RIFS mode */
-enum {
-	IEEE80211_HTINFO_RIFSMODE_PROHIBITED,   /* use of rifs prohibited */
-	IEEE80211_HTINFO_RIFSMODE_ALLOWED,      /* use of rifs permitted */
-};
-
-/*
- * Management information element payloads.
- */
-enum {
-	IEEE80211_ELEMID_SSID = 0,
-	IEEE80211_ELEMID_RATES = 1,
-	IEEE80211_ELEMID_FHPARMS = 2,
-	IEEE80211_ELEMID_DSPARMS = 3,
-	IEEE80211_ELEMID_CFPARMS = 4,
-	IEEE80211_ELEMID_TIM = 5,
-	IEEE80211_ELEMID_IBSSPARMS = 6,
-	IEEE80211_ELEMID_COUNTRY = 7,
-	IEEE80211_ELEMID_REQINFO = 10,
-	IEEE80211_ELEMID_QBSS_LOAD = 11,
-	IEEE80211_ELEMID_TCLAS = 14,
-	IEEE80211_ELEMID_CHALLENGE = 16,
-	/* 17-31 reserved for challenge text extension */
-	IEEE80211_ELEMID_PWRCNSTR = 32,
-	IEEE80211_ELEMID_PWRCAP = 33,
-	IEEE80211_ELEMID_TPCREQ = 34,
-	IEEE80211_ELEMID_TPCREP = 35,
-	IEEE80211_ELEMID_SUPPCHAN = 36,
-	IEEE80211_ELEMID_CHANSWITCHANN = 37,
-	IEEE80211_ELEMID_MEASREQ = 38,
-	IEEE80211_ELEMID_MEASREP = 39,
-	IEEE80211_ELEMID_QUIET = 40,
-	IEEE80211_ELEMID_IBSSDFS = 41,
-	IEEE80211_ELEMID_ERP = 42,
-	IEEE80211_ELEMID_TCLAS_PROCESS = 44,
-	IEEE80211_ELEMID_HTCAP_ANA = 45,
-	IEEE80211_ELEMID_RESERVED_47 = 47,
-	IEEE80211_ELEMID_RSN = 48,
-	IEEE80211_ELEMID_XRATES = 50,
-	IEEE80211_ELEMID_HTCAP = 51,
-	IEEE80211_ELEMID_HTINFO = 52,
-	IEEE80211_ELEMID_MOBILITY_DOMAIN = 54,
-	IEEE80211_ELEMID_FT = 55,
-	IEEE80211_ELEMID_TIMEOUT_INTERVAL = 56,
-	IEEE80211_ELEMID_EXTCHANSWITCHANN = 60,
-	IEEE80211_ELEMID_HTINFO_ANA = 61,
-	IEEE80211_ELEMID_SECCHANOFFSET = 62,
-	IEEE80211_ELEMID_WAPI = 68,     /*IE for WAPI */
-	IEEE80211_ELEMID_TIME_ADVERTISEMENT = 69,
-	IEEE80211_ELEMID_RRM = 70,      /* Radio resource measurement */
-	IEEE80211_ELEMID_2040_COEXT = 72,
-	IEEE80211_ELEMID_2040_INTOL = 73,
-	IEEE80211_ELEMID_OBSS_SCAN = 74,
-	IEEE80211_ELEMID_MMIE = 76,     /* 802.11w Management MIC IE */
-	IEEE80211_ELEMID_FMS_DESCRIPTOR = 86,   /* 802.11v FMS descriptor IE */
-	IEEE80211_ELEMID_FMS_REQUEST = 87,      /* 802.11v FMS request IE */
-	IEEE80211_ELEMID_FMS_RESPONSE = 88,     /* 802.11v FMS response IE */
-	IEEE80211_ELEMID_BSSMAX_IDLE_PERIOD = 90,       /* BSS MAX IDLE PERIOD */
-	IEEE80211_ELEMID_TFS_REQUEST = 91,
-	IEEE80211_ELEMID_TFS_RESPONSE = 92,
-	IEEE80211_ELEMID_TIM_BCAST_REQUEST = 94,
-	IEEE80211_ELEMID_TIM_BCAST_RESPONSE = 95,
-	IEEE80211_ELEMID_INTERWORKING = 107,
-	IEEE80211_ELEMID_XCAPS = 127,
-	IEEE80211_ELEMID_RESERVED_133 = 133,
-	IEEE80211_ELEMID_TPC = 150,
-	IEEE80211_ELEMID_CCKM = 156,
-	IEEE80211_ELEMID_VHTCAP = 191,  /* VHT Capabilities */
-	IEEE80211_ELEMID_VHTOP = 192,   /* VHT Operation */
-	IEEE80211_ELEMID_EXT_BSS_LOAD = 193,    /* Extended BSS Load */
-	IEEE80211_ELEMID_WIDE_BAND_CHAN_SWITCH = 194,   /* Wide Band Channel Switch */
-	IEEE80211_ELEMID_VHT_TX_PWR_ENVLP = 195,        /* VHT Transmit Power Envelope */
-	IEEE80211_ELEMID_CHAN_SWITCH_WRAP = 196,        /* Channel Switch Wrapper */
-	IEEE80211_ELEMID_AID = 197,     /* AID */
-	IEEE80211_ELEMID_QUIET_CHANNEL = 198,   /* Quiet Channel */
-	IEEE80211_ELEMID_OP_MODE_NOTIFY = 199,  /* Operating Mode Notification */
-	IEEE80211_ELEMID_VENDOR = 221,  /* vendor private */
-};
-
-#define IEEE80211_MAX_IE_LEN                255
-#define IEEE80211_RSN_IE_LEN                22
-
-#define IEEE80211_CHANSWITCHANN_BYTES        5
-#define IEEE80211_EXTCHANSWITCHANN_BYTES     6
-
-/* TODO -> Need to Check Redefinition Error used in only UMAC */
-#if 0
-struct ieee80211_tim_ie {
-	uint8_t tim_ie;         /* IEEE80211_ELEMID_TIM */
-	uint8_t tim_len;
-	uint8_t tim_count;      /* DTIM count */
-	uint8_t tim_period;     /* DTIM period */
-	uint8_t tim_bitctl;     /* bitmap control */
-	uint8_t tim_bitmap[1];  /* variable-length bitmap */
-} __packed;
-#endif
-
-/* Country IE channel triplet */
-struct country_ie_triplet {
-	union {
-		uint8_t schan;  /* starting channel */
-		uint8_t regextid;       /* Regulatory Extension Identifier */
-	};
-	union {
-		uint8_t nchan;  /* number of channels */
-		uint8_t regclass;       /* Regulatory Class */
-	};
-	union {
-		uint8_t maxtxpwr;       /* tx power  */
-		uint8_t coverageclass;  /* Coverage Class */
-	};
-} __packed;
-
-struct ieee80211_country_ie {
-	uint8_t ie;             /* IEEE80211_ELEMID_COUNTRY */
-	uint8_t len;
-	uint8_t cc[3];          /* ISO CC+(I)ndoor/(O)utdoor */
-	struct country_ie_triplet triplet[1];
-} __packed;
-
-struct ieee80211_fh_ie {
-	uint8_t ie;             /* IEEE80211_ELEMID_FHPARMS */
-	uint8_t len;
-	uint16_t dwell_time;    /* endianess?? */
-	uint8_t hop_set;
-	uint8_t hop_pattern;
-	uint8_t hop_index;
-} __packed;
-
-struct ieee80211_ds_ie {
-	uint8_t ie;             /* IEEE80211_ELEMID_DSPARMS */
-	uint8_t len;
-	uint8_t current_channel;
-} __packed;
-
-struct ieee80211_erp_ie {
-	uint8_t ie;             /* IEEE80211_ELEMID_ERP */
-	uint8_t len;
-	uint8_t value;
-} __packed;
-
-/* TODO -> Need to Check Redefinition Error used in only UMAC */
-#if 0
-struct ieee80211_quiet_ie {
-	uint8_t ie;             /* IEEE80211_ELEMID_QUIET */
-	uint8_t len;
-	uint8_t tbttcount;      /* quiet start */
-	uint8_t period;         /* beacon intervals between quiets */
-	uint16_t duration;      /* TUs of each quiet */
-	uint16_t offset;        /* TUs of from TBTT of quiet start */
-} __packed;
-#endif
-
-struct ieee80211_channelswitch_ie {
-	uint8_t ie;             /* IEEE80211_ELEMID_CHANSWITCHANN */
-	uint8_t len;
-	uint8_t switchmode;
-	uint8_t newchannel;
-	uint8_t tbttcount;
-} __packed;
-
-/* channel switch action frame format definition */
-struct ieee80211_action_spectrum_channel_switch {
-	struct ieee80211_action csa_header;
-	struct ieee80211_channelswitch_ie csa_element;
-} __packed;
-
-struct ieee80211_extendedchannelswitch_ie {
-	uint8_t ie;             /* IEEE80211_ELEMID_EXTCHANSWITCHANN */
-	uint8_t len;
-	uint8_t switchmode;
-	uint8_t newClass;
-	uint8_t newchannel;
-	uint8_t tbttcount;
-} __packed;
-
-struct ieee80211_tpc_ie {
-	uint8_t ie;
-	uint8_t len;
-	uint8_t pwrlimit;
-} __packed;
-
-/*
- * MHDRIE included in TKIP MFP protected management frames
- */
-struct ieee80211_ese_mhdr_ie {
-	uint8_t mhdr_id;
-	uint8_t mhdr_len;
-	uint8_t mhdr_oui[3];
-	uint8_t mhdr_oui_type;
-	uint8_t mhdr_fc[2];
-	uint8_t mhdr_bssid[IEEE80211_ADDR_LEN];
-} __packed;
-
-/*
- * SSID IE
- */
-struct ieee80211_ie_ssid {
-	uint8_t ssid_id;
-	uint8_t ssid_len;
-	uint8_t ssid[32];
-} __packed;
-
-/*
- * Supported rates
- */
-#define IEEE80211_MAX_SUPPORTED_RATES      8
-
-struct ieee80211_ie_rates {
-	uint8_t rate_id;        /* Element Id */
-	uint8_t rate_len;       /* IE Length */
-	uint8_t rate[IEEE80211_MAX_SUPPORTED_RATES];    /* IE Length */
-} __packed;
-
-/*
- * Extended rates
- */
-#define IEEE80211_MAX_EXTENDED_RATES     256
-
-struct ieee80211_ie_xrates {
-	uint8_t xrate_id;       /* Element Id */
-	uint8_t xrate_len;      /* IE Length */
-	uint8_t xrate[IEEE80211_MAX_EXTENDED_RATES];    /* IE Length */
-} __packed;
-
-/*
- * WPS SSID list information element (maximally sized).
- */
-struct ieee80211_ie_ssidl {
-	uint8_t ssidl_id;       /* IEEE80211_ELEMID_VENDOR */
-	uint8_t ssidl_len;      /* length in bytes */
-	uint8_t ssidl_oui[3];   /* 0x00, 0x50, 0xf2 */
-	uint8_t ssidl_type;     /* OUI type */
-	uint8_t ssidl_prim_cap; /* Primary capabilities */
-	uint8_t ssidl_count;    /* # of secondary SSIDs */
-	uint16_t ssidl_value[248];
-} __packed;
-
-#if _BYTE_ORDER == _BIG_ENDIAN
-struct ieee80211_sec_ssid_cap {
-	uint32_t reserved0 : 1,
-		 akmlist : 6, reserved1 : 4, reeserved2 : 2, ucipher : 15, mcipher : 4;
-};
-#else
-struct ieee80211_sec_ssid_cap {
-	uint32_t mcipher : 4,
-		 ucipher : 15, reserved2 : 2, reserved1 : 4, akmlist : 6, reserved0 : 1;
-};
-#endif
-
-struct ieee80211_ie_qbssload {
-	uint8_t elem_id;        /* IEEE80211_ELEMID_QBSS_LOAD */
-	uint8_t length;         /* length in bytes */
-	uint16_t station_count; /* number of station associated */
-	uint8_t channel_utilization;    /* channel busy time in 0-255 scale */
-	uint16_t aac;           /* available admission capacity */
-} __packed;
-
-#define SEC_SSID_HEADER_LEN  6
-#define SSIDL_IE_HEADER_LEN  6
-
-struct ieee80211_sec_ssid {
-	uint8_t sec_ext_cap;
-	struct ieee80211_sec_ssid_cap sec_cap;
-	uint8_t sec_ssid_len;
-	uint8_t sec_ssid[32];
-} __packed;
-
-/* Definitions of SSIDL IE */
-enum {
-	CAP_MCIPHER_ENUM_NONE = 0,
-	CAP_MCIPHER_ENUM_WEP40,
-	CAP_MCIPHER_ENUM_WEP104,
-	CAP_MCIPHER_ENUM_TKIP,
-	CAP_MCIPHER_ENUM_CCMP,
-	CAP_MCIPHER_ENUM_CKIP_CMIC,
-	CAP_MCIPHER_ENUM_CKIP,
-	CAP_MCIPHER_ENUM_CMIC
-};
-
-#define CAP_UCIPHER_BIT_NONE           0x0001
-#define CAP_UCIPHER_BIT_WEP40          0x0002
-#define CAP_UCIPHER_BIT_WEP104         0x0004
-#define CAP_UCIPHER_BIT_TKIP           0x0008
-#define CAP_UCIPHER_BIT_CCMP           0x0010
-#define CAP_UCIPHER_BIT_CKIP_CMIC      0x0020
-#define CAP_UCIPHER_BIT_CKIP           0x0040
-#define CAP_UCIPHER_BIT_CMIC           0x0080
-#define CAP_UCIPHER_BIT_WPA2_WEP40     0x0100
-#define CAP_UCIPHER_BIT_WPA2_WEP104    0x0200
-#define CAP_UCIPHER_BIT_WPA2_TKIP      0x0400
-#define CAP_UCIPHER_BIT_WPA2_CCMP      0x0800
-#define CAP_UCIPHER_BIT_WPA2_CKIP_CMIC 0x1000
-#define CAP_UCIPHER_BIT_WPA2_CKIP      0x2000
-#define CAP_UCIPHER_BIT_WPA2_CMIC      0x4000
-
-#define CAP_AKM_BIT_WPA1_1X            0x01
-#define CAP_AKM_BIT_WPA1_PSK           0x02
-#define CAP_AKM_BIT_WPA2_1X            0x04
-#define CAP_AKM_BIT_WPA2_PSK           0x08
-#define CAP_AKM_BIT_WPA1_CCKM          0x10
-#define CAP_AKM_BIT_WPA2_CCKM          0x20
-
-#define IEEE80211_CHALLENGE_LEN         128
-
-#define IEEE80211_SUPPCHAN_LEN          26
-
-#define IEEE80211_RATE_BASIC            0x80
-#define IEEE80211_RATE_VAL              0x7f
-
-/* EPR information element flags */
-#define IEEE80211_ERP_NON_ERP_PRESENT   0x01
-#define IEEE80211_ERP_USE_PROTECTION    0x02
-#define IEEE80211_ERP_LONG_PREAMBLE     0x04
-
-/* Atheros private advanced capabilities info */
-#define ATHEROS_CAP_TURBO_PRIME         0x01
-#define ATHEROS_CAP_COMPRESSION         0x02
-#define ATHEROS_CAP_FAST_FRAME          0x04
-/* bits 3-6 reserved */
-#define ATHEROS_CAP_BOOST               0x80
-
-#define ATH_OUI                     0x7f0300    /* Atheros OUI */
-#define ATH_OUI_TYPE                    0x01
-#define ATH_OUI_SUBTYPE                 0x01
-#define ATH_OUI_VERSION                 0x00
-#define ATH_OUI_TYPE_XR                 0x03
-#define ATH_OUI_VER_XR                  0x01
-#define ATH_OUI_EXTCAP_TYPE             0x04    /* Atheros Extended Cap Type */
-#define ATH_OUI_EXTCAP_SUBTYPE          0x01    /* Atheros Extended Cap Sub-type */
-#define ATH_OUI_EXTCAP_VERSION          0x00    /* Atheros Extended Cap Version */
-
-#define WPA_OUI                     0xf25000
-#define WPA_VERSION                        1    /* current supported version */
-#define CSCO_OUI                    0x964000    /* Cisco OUI */
-#define AOW_OUI                     0x4a0100    /* AoW OUI, workaround */
-#define AOW_OUI_TYPE                    0x01
-#define AOW_OUI_VERSION                 0x01
-
-#define WSC_OUI                   0x0050f204
-
-#define WPA_CSE_NULL                    0x00
-#define WPA_CSE_WEP40                   0x01
-#define WPA_CSE_TKIP                    0x02
-#define WPA_CSE_CCMP                    0x04
-#define WPA_CSE_WEP104                  0x05
-
-#define WPA_ASE_NONE                    0x00
-#define WPA_ASE_8021X_UNSPEC            0x01
-#define WPA_ASE_8021X_PSK               0x02
-#define WPA_ASE_FT_IEEE8021X            0x20
-#define WPA_ASE_FT_PSK                  0x40
-#define WPA_ASE_SHA256_IEEE8021X        0x80
-#define WPA_ASE_SHA256_PSK              0x100
-#define WPA_ASE_WPS                     0x200
-
-#define RSN_OUI                     0xac0f00
-#define RSN_VERSION                        1    /* current supported version */
-
-#define RSN_CSE_NULL                    0x00
-#define RSN_CSE_WEP40                   0x01
-#define RSN_CSE_TKIP                    0x02
-#define RSN_CSE_WRAP                    0x03
-#define RSN_CSE_CCMP                    0x04
-#define RSN_CSE_WEP104                  0x05
-#define RSN_CSE_AES_CMAC                0x06
-
-#define RSN_ASE_NONE                    0x00
-#define RSN_ASE_8021X_UNSPEC            0x01
-#define RSN_ASE_8021X_PSK               0x02
-#define RSN_ASE_FT_IEEE8021X            0x20
-#define RSN_ASE_FT_PSK                  0x40
-#define RSN_ASE_SHA256_IEEE8021X        0x80
-#define RSN_ASE_SHA256_PSK              0x100
-#define RSN_ASE_WPS                     0x200
-
-#define AKM_SUITE_TYPE_IEEE8021X        0x01
-#define AKM_SUITE_TYPE_PSK              0x02
-#define AKM_SUITE_TYPE_FT_IEEE8021X     0x03
-#define AKM_SUITE_TYPE_FT_PSK           0x04
-#define AKM_SUITE_TYPE_SHA256_IEEE8021X 0x05
-#define AKM_SUITE_TYPE_SHA256_PSK       0x06
-
-#define RSN_CAP_PREAUTH                 0x01
-#define RSN_CAP_PTKSA_REPLAYCOUNTER    0x0c
-#define RSN_CAP_GTKSA_REPLAYCOUNTER    0x30
-#define RSN_CAP_MFP_REQUIRED            0x40
-#define RSN_CAP_MFP_ENABLED             0x80
-
-#define CCKM_OUI                    0x964000
-#define CCKM_ASE_UNSPEC                    0
-#define WPA_CCKM_AKM              0x00964000
-#define RSN_CCKM_AKM              0x00964000
-
-#define WME_OUI                     0xf25000
-#define WME_OUI_TYPE                    0x02
-#define WME_INFO_OUI_SUBTYPE            0x00
-#define WME_PARAM_OUI_SUBTYPE           0x01
-#define WME_TSPEC_OUI_SUBTYPE           0x02
-
-#define WME_PARAM_OUI_VERSION              1
-#define WME_TSPEC_OUI_VERSION              1
-#define WME_VERSION                        1
-
-/* WME stream classes */
-#define WME_AC_BE                          0    /* best effort */
-#define WME_AC_BK                          1    /* background */
-#define WME_AC_VI                          2    /* video */
-#define WME_AC_VO                          3    /* voice */
-
-/* WCN IE */
-#define WCN_OUI                     0xf25000    /* Microsoft OUI */
-#define WCN_OUI_TYPE                    0x04    /* WCN */
-
-/* Atheros htoui  for ht vender ie; use Epigram OUI for compatibility with pre11n devices */
-#define ATH_HTOUI                   0x00904c
-
-#define SFA_OUI                     0x964000
-#define SFA_OUI_TYPE                    0x14
-#define SFA_IE_CAP_MFP                  0x01
-#define SFA_IE_CAP_DIAG_CHANNEL         0x02
-#define SFA_IE_CAP_LOCATION_SVCS        0x04
-#define SFA_IE_CAP_EXP_BANDWIDTH        0x08
-
-#define WPA_OUI_BYTES       0x00, 0x50, 0xf2
-#define RSN_OUI_BYTES       0x00, 0x0f, 0xac
-#define WME_OUI_BYTES       0x00, 0x50, 0xf2
-#define ATH_OUI_BYTES       0x00, 0x03, 0x7f
-#define SFA_OUI_BYTES       0x00, 0x40, 0x96
-#define CCKM_OUI_BYTES      0x00, 0x40, 0x96
-#define WPA_SEL(x)          (((x)<<24)|WPA_OUI)
-#define RSN_SEL(x)          (((x)<<24)|RSN_OUI)
-#define SFA_SEL(x)          (((x)<<24)|SFA_OUI)
-#define CCKM_SEL(x)         (((x)<<24)|CCKM_OUI)
-
-#define IEEE80211_RV(v)     ((v) & IEEE80211_RATE_VAL)
-
-/*
- * AUTH management packets
- *
- *  octet algo[2]
- *  octet seq[2]
- *  octet status[2]
- *  octet chal.id
- *  octet chal.length
- *  octet chal.text[253]
- */
-
-typedef uint8_t *ieee80211_mgt_auth_t;
-
-#define IEEE80211_AUTH_ALGORITHM(auth) \
-	((auth)[0] | ((auth)[1] << 8))
-#define IEEE80211_AUTH_TRANSACTION(auth) \
-	((auth)[2] | ((auth)[3] << 8))
-#define IEEE80211_AUTH_STATUS(auth) \
-	((auth)[4] | ((auth)[5] << 8))
-
-#define IEEE80211_AUTH_ALG_OPEN     0x0000
-#define IEEE80211_AUTH_ALG_SHARED   0x0001
-#define IEEE80211_AUTH_ALG_FT       0x0002
-#define IEEE80211_AUTH_ALG_LEAP     0x0080
-
-enum {
-	IEEE80211_AUTH_OPEN_REQUEST = 1,
-	IEEE80211_AUTH_OPEN_RESPONSE = 2,
-};
-
-enum {
-	IEEE80211_AUTH_SHARED_REQUEST = 1,
-	IEEE80211_AUTH_SHARED_CHALLENGE = 2,
-	IEEE80211_AUTH_SHARED_RESPONSE = 3,
-	IEEE80211_AUTH_SHARED_PASS = 4,
-};
-
-/*
- * Reason codes
- *
- * Unlisted codes are reserved
- */
-
-enum {
-	IEEE80211_REASON_UNSPECIFIED = 1,
-	IEEE80211_REASON_AUTH_EXPIRE = 2,
-	IEEE80211_REASON_AUTH_LEAVE = 3,
-	IEEE80211_REASON_ASSOC_EXPIRE = 4,
-	IEEE80211_REASON_ASSOC_TOOMANY = 5,
-	IEEE80211_REASON_NOT_AUTHED = 6,
-	IEEE80211_REASON_NOT_ASSOCED = 7,
-	IEEE80211_REASON_ASSOC_LEAVE = 8,
-	IEEE80211_REASON_ASSOC_NOT_AUTHED = 9,
-
-	IEEE80211_REASON_RSN_REQUIRED = 11,
-	IEEE80211_REASON_RSN_INCONSISTENT = 12,
-	IEEE80211_REASON_IE_INVALID = 13,
-	IEEE80211_REASON_MIC_FAILURE = 14,
-
-	IEEE80211_REASON_QOS = 32,
-	IEEE80211_REASON_QOS_BANDWITDH = 33,
-	IEEE80211_REASON_QOS_CH_CONDITIONS = 34,
-	IEEE80211_REASON_QOS_TXOP = 35,
-	IEEE80211_REASON_QOS_LEAVE = 36,
-	IEEE80211_REASON_QOS_DECLINED = 37,
-	IEEE80211_REASON_QOS_SETUP_REQUIRED = 38,
-	IEEE80211_REASON_QOS_TIMEOUT = 39,
-	IEEE80211_REASON_QOS_CIPHER = 45,
-
-	IEEE80211_STATUS_SUCCESS = 0,
-	IEEE80211_STATUS_UNSPECIFIED = 1,
-	IEEE80211_STATUS_CAPINFO = 10,
-	IEEE80211_STATUS_NOT_ASSOCED = 11,
-	IEEE80211_STATUS_OTHER = 12,
-	IEEE80211_STATUS_ALG = 13,
-	IEEE80211_STATUS_SEQUENCE = 14,
-	IEEE80211_STATUS_CHALLENGE = 15,
-	IEEE80211_STATUS_TIMEOUT = 16,
-	IEEE80211_STATUS_TOOMANY = 17,
-	IEEE80211_STATUS_BASIC_RATE = 18,
-	IEEE80211_STATUS_SP_REQUIRED = 19,
-	IEEE80211_STATUS_PBCC_REQUIRED = 20,
-	IEEE80211_STATUS_CA_REQUIRED = 21,
-	IEEE80211_STATUS_TOO_MANY_STATIONS = 22,
-	IEEE80211_STATUS_RATES = 23,
-	IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25,
-	IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26,
-	IEEE80211_STATUS_NO_HT = 27,
-	IEEE80211_STATUS_REJECT_TEMP = 30,
-	IEEE80211_STATUS_MFP_VIOLATION = 31,
-	IEEE80211_STATUS_REFUSED = 37,
-	IEEE80211_STATUS_INVALID_PARAM = 38,
-
-	IEEE80211_STATUS_DLS_NOT_ALLOWED = 48,
-};
-
-/* private IEEE80211_STATUS */
-#define    IEEE80211_STATUS_CANCEL             -1
-#define    IEEE80211_STATUS_INVALID_IE         -2
-#define    IEEE80211_STATUS_INVALID_CHANNEL    -3
-
-#define IEEE80211_WEP_KEYLEN        5   /* 40bit */
-#define IEEE80211_WEP_IVLEN         3   /* 24bit */
-#define IEEE80211_WEP_KIDLEN        1   /* 1 octet */
-#define IEEE80211_WEP_CRCLEN        4   /* CRC-32 */
-#define IEEE80211_WEP_NKID          4   /* number of key ids */
-
-/*
- * 802.11i defines an extended IV for use with non-WEP ciphers.
- * When the EXTIV bit is set in the key id byte an additional
- * 4 bytes immediately follow the IV for TKIP.  For CCMP the
- * EXTIV bit is likewise set but the 8 bytes represent the
- * CCMP header rather than IV+extended-IV.
- */
-#define IEEE80211_WEP_EXTIV      0x20
-#define IEEE80211_WEP_EXTIVLEN      4   /* extended IV length */
-#define IEEE80211_WEP_MICLEN        8   /* trailing MIC */
-
-#define IEEE80211_CCMP_HEADERLEN    8
-#define IEEE80211_CCMP_MICLEN       8
-
-/*
- * 802.11w defines a MMIE chunk to be attached at the end of
- * any outgoing broadcast or multicast robust management frame.
- * MMIE field is total 18 bytes in size. Following the diagram of MMIE
- *
- *        <------------ 18 Bytes MMIE ----------------------->
- *        +--------+---------+---------+-----------+---------+
- *        |Element | Length  | Key id  |   IPN     |  MIC    |
- *        |  id    |         |         |           |         |
- *        +--------+---------+---------+-----------+---------+
- * bytes      1         1         2         6            8
- *
- */
-#define IEEE80211_MMIE_LEN          18
-#define IEEE80211_MMIE_ELEMENTIDLEN 1
-#define IEEE80211_MMIE_LENGTHLEN    1
-#define IEEE80211_MMIE_KEYIDLEN     2
-#define IEEE80211_MMIE_IPNLEN       6
-#define IEEE80211_MMIE_MICLEN       8
-
-#define IEEE80211_CRC_LEN           4
-
-#define IEEE80211_8021Q_HEADER_LEN  4
-/*
- * Maximum acceptable MTU is:
- *  IEEE80211_MAX_LEN - WEP overhead - CRC -
- *      QoS overhead - RSN/WPA overhead
- * Min is arbitrarily chosen > IEEE80211_MIN_LEN.  The default
- * mtu is Ethernet-compatible; it's set by ether_ifattach.
- */
-#define IEEE80211_MTU_MAX       2290
-#define IEEE80211_MTU_MIN       32
-
-/* Rather than using this default value, customer platforms can provide a custom value for this constant.
-   Coustomer platform will use the different define value by themself */
-#ifndef IEEE80211_MAX_MPDU_LEN
-#define IEEE80211_MAX_MPDU_LEN      (3840 + IEEE80211_CRC_LEN +	\
-				     (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
-#endif
-#define IEEE80211_ACK_LEN \
-	(sizeof(struct ieee80211_frame_ack) + IEEE80211_CRC_LEN)
-#define IEEE80211_MIN_LEN \
-	(sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN)
-
-/* An 802.11 data frame can be one of three types:
-   1. An unaggregated frame: The maximum length of an unaggregated data frame is 2324 bytes + headers.
-   2. A data frame that is part of an AMPDU: The maximum length of an AMPDU may be upto 65535 bytes, but data frame is limited to 2324 bytes + header.
-   3. An AMSDU: The maximum length of an AMSDU is eihther 3839 or 7095 bytes.
-   The maximum frame length supported by hardware is 4095 bytes.
-   A length of 3839 bytes is chosen here to support unaggregated data frames, any size AMPDUs and 3839 byte AMSDUs.
- */
-#define IEEE80211N_MAX_FRAMELEN  3839
-#define IEEE80211N_MAX_LEN (IEEE80211N_MAX_FRAMELEN + IEEE80211_CRC_LEN + \
-			    (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN))
-
-#define IEEE80211_TX_CHAINMASK_MIN  1
-#define IEEE80211_TX_CHAINMASK_MAX  7
-
-#define IEEE80211_RX_CHAINMASK_MIN  1
-#define IEEE80211_RX_CHAINMASK_MAX  7
-
-/*
- * The 802.11 spec says at most 2007 stations may be
- * associated at once.  For most AP's this is way more
- * than is feasible so we use a default of 128.  This
- * number may be overridden by the driver and/or by
- * user configuration.
- */
-#define IEEE80211_AID_MAX       2007
-#define IEEE80211_AID_DEF       128
-
-#define IEEE80211_AID(b)    ((b) &~0xc000)
-
-/*
- * RTS frame length parameters.  The default is specified in
- * the 802.11 spec.  The max may be wrong for jumbo frames.
- */
-#define IEEE80211_RTS_DEFAULT       512
-#define IEEE80211_RTS_MIN           0
-#define IEEE80211_RTS_MAX           2347
-
-/*
- * Fragmentation limits
- */
-#define IEEE80211_FRAGMT_THRESHOLD_MIN        540       /* min frag threshold */
-#define IEEE80211_FRAGMT_THRESHOLD_MAX       2346       /* max frag threshold */
-
-/*
- * Regulatory extention identifier for country IE.
- */
-#define IEEE80211_REG_EXT_ID        201
-
-/*
- * overlapping BSS
- */
-#define IEEE80211_OBSS_SCAN_PASSIVE_DWELL_DEF  20
-#define IEEE80211_OBSS_SCAN_ACTIVE_DWELL_DEF   10
-#define IEEE80211_OBSS_SCAN_INTERVAL_DEF       300
-#define IEEE80211_OBSS_SCAN_PASSIVE_TOTAL_DEF  200
-#define IEEE80211_OBSS_SCAN_ACTIVE_TOTAL_DEF   20
-#define IEEE80211_OBSS_SCAN_THRESH_DEF   25
-#define IEEE80211_OBSS_SCAN_DELAY_DEF   5
-
-/*
- * overlapping BSS scan ie
- */
-struct ieee80211_ie_obss_scan {
-	uint8_t elem_id;
-	uint8_t elem_len;
-	uint16_t scan_passive_dwell;
-	uint16_t scan_active_dwell;
-	uint16_t scan_interval;
-	uint16_t scan_passive_total;
-	uint16_t scan_active_total;
-	uint16_t scan_delay;
-	uint16_t scan_thresh;
-} __packed;
-
-/*
- * Extended capability ie
- */
-struct ieee80211_ie_ext_cap {
-	uint8_t elem_id;
-	uint8_t elem_len;
-	uint32_t ext_capflags;
-	uint32_t ext_capflags2;
-} __packed;
-
-/* Extended capability IE flags */
-#define IEEE80211_EXTCAPIE_2040COEXTMGMT        0x00000001
-#define IEEE80211_EXTCAPIE_TFS                  0x00010000
-#define IEEE80211_EXTCAPIE_FMS                  0x00000800
-#define IEEE80211_EXTCAPIE_WNMSLEEPMODE         0x00020000
-#define IEEE80211_EXTCAPIE_TIMBROADCAST         0x00040000
-#define IEEE80211_EXTCAPIE_PROXYARP             0x00001000
-#define IEEE80211_EXTCAPIE_BSSTRANSITION        0x00080000
-/* Tunneled Direct Link Setup (TDLS) extended capability bits */
-#define IEEE80211_EXTCAPIE_PEER_UAPSD_BUF_STA   0x10000000
-#define IEEE80211_EXTCAPIE_TDLS_PEER_PSM        0x20000000
-#define IEEE80211_EXTCAPIE_TDLS_CHAN_SX         0x40000000
-/* 2nd Extended capability IE flags bit32-bit63*/
-#define IEEE80211_EXTCAPIE_TDLSSUPPORT      0x00000020  /* bit-37 TDLS Support */
-#define IEEE80211_EXTCAPIE_TDLSPROHIBIT     0x00000040  /* bit-38 TDLS Prohibit Support */
-#define IEEE80211_EXTCAPIE_TDLSCHANSXPROHIBIT   0x00000080      /* bit-39 TDLS Channel Switch Prohibit */
-#define IEEE80211_EXTCAPIE_TDLS_WIDE_BAND   0x20000080  /* bit-61 TDLS Wide Bandwidth support */
-#define IEEE80211_EXTCAPIE_OP_MODE_NOTIFY   0x40000000  /* bit-62 Operating Mode notification */
-
-/*
- * These caps are populated when we recieve beacon/probe response
- * This is used to maintain local TDLS cap bit masks
- */
-
-#define IEEE80211_TDLS_PROHIBIT     0x00000001  /* bit-1 TDLS Prohibit Support */
-
-/*
- * 20/40 BSS coexistence ie
- */
-struct ieee80211_ie_bss_coex {
-	uint8_t elem_id;
-	uint8_t elem_len;
-#if _BYTE_ORDER == _BIG_ENDIAN
-	uint8_t reserved1 : 1,
-		reserved2 : 1,
-		reserved3 : 1,
-		obss_exempt_grant : 1,
-		obss_exempt_req : 1,
-		ht20_width_req : 1, ht40_intolerant : 1, inf_request : 1;
-#else
-	uint8_t inf_request : 1,
-		ht40_intolerant : 1,
-		ht20_width_req : 1,
-		obss_exempt_req : 1,
-		obss_exempt_grant : 1, reserved3 : 1, reserved2 : 1, reserved1 : 1;
-#endif
-} __packed;
-
-/*
- * 20/40 BSS intolerant channel report ie
- */
-struct ieee80211_ie_intolerant_report {
-	uint8_t elem_id;
-	uint8_t elem_len;
-	uint8_t reg_class;
-	uint8_t chan_list[1];   /* variable-length channel list */
-} __packed;
-
-/*
- * 20/40 coext management action frame
- */
-struct ieee80211_action_bss_coex_frame {
-	struct ieee80211_action ac_header;
-	struct ieee80211_ie_bss_coex coex;
-	struct ieee80211_ie_intolerant_report chan_report;
-} __packed;
-
-typedef enum ieee80211_tie_interval_type {
-	IEEE80211_TIE_INTERVAL_TYPE_RESERVED = 0,
-	IEEE80211_TIE_INTERVAL_TYPE_REASSOC_DEADLINE_INTERVAL = 1,
-	IEEE80211_TIE_INTERVAL_TYPE_KEY_LIFETIME_INTERVAL = 2,
-	IEEE80211_TIE_INTERVAL_TYPE_ASSOC_COMEBACK_TIME = 3,
-} ieee80211_tie_interval_type_t;
-
-struct ieee80211_ie_timeout_interval {
-	uint8_t elem_id;
-	uint8_t elem_len;
-	uint8_t interval_type;
-	uint32_t value;
-} __packed;
-
-/* TODO -> Need to Check Redefinition Error used in only UMAC */
-#if 0
-/* Management MIC information element (IEEE 802.11w) */
-struct ieee80211_mmie {
-	uint8_t element_id;
-	uint8_t length;
-	uint16_t key_id;
-	uint8_t sequence_number[6];
-	uint8_t mic[8];
-} __packed;
-#endif
-
-/*
- * 802.11n Secondary Channel Offset element
- */
-#define IEEE80211_SEC_CHAN_OFFSET_SCN               0   /* no secondary channel */
-#define IEEE80211_SEC_CHAN_OFFSET_SCA               1   /* secondary channel above */
-#define IEEE80211_SEC_CHAN_OFFSET_SCB               3   /* secondary channel below */
-
-struct ieee80211_ie_sec_chan_offset {
-	uint8_t elem_id;
-	uint8_t len;
-	uint8_t sec_chan_offset;
-} __packed;
-
-/*
- * 802.11ac Transmit Power Envelope element
- */
-#define IEEE80211_VHT_TXPWR_IS_SUB_ELEMENT          1   /* It checks whether its  sub element */
-#define IEEE80211_VHT_TXPWR_MAX_POWER_COUNT         4   /* Max TX power elements valid */
-#define IEEE80211_VHT_TXPWR_NUM_POWER_SUPPORTED     3   /* Max TX power elements supported */
-#define IEEE80211_VHT_TXPWR_LCL_MAX_PWR_UNITS_SHFT  3   /* B3-B5 Local Max transmit power units */
-
-struct ieee80211_ie_vht_txpwr_env {
-	uint8_t elem_id;
-	uint8_t elem_len;
-	uint8_t txpwr_info;     /* Transmit Power Information */
-	uint8_t local_max_txpwr[4];     /* Local Max TxPower for 20,40,80,160MHz */
-} __packed;
-
-/*
- * 802.11ac Wide Bandwidth Channel Switch Element
- */
-
-#define IEEE80211_VHT_EXTCH_SWITCH             1        /* For extension channel switch */
-#define CHWIDTH_VHT20                          20       /* Channel width 20 */
-#define CHWIDTH_VHT40                          40       /* Channel width 40 */
-#define CHWIDTH_VHT80                          80       /* Channel width 80 */
-#define CHWIDTH_VHT160                         160      /* Channel width 160 */
-
-struct ieee80211_ie_wide_bw_switch {
-	uint8_t elem_id;
-	uint8_t elem_len;
-	uint8_t new_ch_width;   /* New channel width */
-	uint8_t new_ch_freq_seg1;       /* Channel Center frequency 1 */
-	uint8_t new_ch_freq_seg2;       /* Channel Center frequency 2 */
-} __packed;
-
-#define IEEE80211_RSSI_RX       0x00000001
-#define IEEE80211_RSSI_TX       0x00000002
-#define IEEE80211_RSSI_EXTCHAN  0x00000004
-#define IEEE80211_RSSI_BEACON   0x00000008
-#define IEEE80211_RSSI_RXDATA   0x00000010
-
-#define IEEE80211_RATE_TX 0
-#define IEEE80211_RATE_RX 1
-#define IEEE80211_LASTRATE_TX 2
-#define IEEE80211_LASTRATE_RX 3
-#define IEEE80211_RATECODE_TX 4
-#define IEEE80211_RATECODE_RX 5
-
-#define IEEE80211_MAX_RATE_PER_CLIENT 8
-/* Define for the P2P Wildcard SSID */
-#define IEEE80211_P2P_WILDCARD_SSID         "DIRECT-"
-
-#define IEEE80211_P2P_WILDCARD_SSID_LEN     (sizeof(IEEE80211_P2P_WILDCARD_SSID) - 1)
-
-#endif /* CDS_COMMON_IEEE80211_H_ */

+ 0 - 1374
core/cds/inc/cds_ieee80211_defines.h

@@ -1,1374 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef CDS_IEEE80211_DEFINES_H_
-#define CDS_IEEE80211_DEFINES_H_
-
-#include "cds_ieee80211_common.h"
-
-/*
- * Public defines for Atheros Upper MAC Layer
- */
-
-/**
- * @brief Opaque handle of 802.11 protocal layer.
- */
-struct ieee80211com;
-typedef struct ieee80211com *wlan_dev_t;
-
-/**
- * @brief Opaque handle to App IE module.
- */
-struct wlan_mlme_app_ie;
-typedef struct wlan_mlme_app_ie *wlan_mlme_app_ie_t;
-
-/**
- * @brief Opaque handle of network instance (vap) in 802.11 protocal layer.
- */
-struct ieee80211vap;
-typedef struct ieee80211vap *wlan_if_t;
-
-struct ieee80211vapprofile;
-typedef struct ieee80211vapprofile *wlan_if_info_t;
-
-/**
- * @brief Opaque handle of a node in the wifi network.
- */
-struct ieee80211_node;
-typedef struct ieee80211_node *wlan_node_t;
-
-/**
- * @brief Opaque handle of OS interface (ifp in the case of unix ).
- */
-struct _os_if_t;
-typedef struct _os_if_t *os_if_t;
-
-/**
- *
- * @brief Opaque handle.
- */
-typedef void *os_handle_t;
-
-/**
- * @brief Opaque handle of a channel.
- */
-struct ieee80211_channel;
-typedef struct ieee80211_channel *wlan_chan_t;
-
-/**
- * @brief Opaque handle scan_entry.
- */
-struct ieee80211_scan_entry;
-typedef struct ieee80211_scan_entry *wlan_scan_entry_t;
-
-/* AoW related defines */
-#define AOW_MAX_RECEIVER_COUNT  10
-
-#define IEEE80211_NWID_LEN                  32
-#define IEEE80211_ISO_COUNTRY_LENGTH        3   /* length of 11d ISO country string */
-
-typedef struct _ieee80211_ssid {
-	int len;
-	uint8_t ssid[IEEE80211_NWID_LEN];
-} ieee80211_ssid;
-
-typedef struct ieee80211_tx_status {
-	int ts_flags;
-#define IEEE80211_TX_ERROR          0x01
-#define IEEE80211_TX_XRETRY         0x02
-
-	int ts_retries;         /* number of retries to successfully transmit this frame */
-#ifdef ATH_SUPPORT_TxBF
-	uint8_t ts_txbfstatus;
-#define AR_BW_Mismatch      0x1
-#define AR_Stream_Miss      0x2
-#define AR_CV_Missed        0x4
-#define AR_Dest_Miss        0x8
-#define AR_Expired          0x10
-#define AR_TxBF_Valid_HW_Status    (AR_BW_Mismatch|AR_Stream_Miss|AR_CV_Missed|AR_Dest_Miss|AR_Expired)
-#define TxBF_STATUS_Sounding_Complete   0x20
-#define TxBF_STATUS_Sounding_Request    0x40
-#define TxBF_Valid_SW_Status  (TxBF_STATUS_Sounding_Complete | TxBF_STATUS_Sounding_Request)
-#define TxBF_Valid_Status  (AR_TxBF_Valid_HW_Status | TxBF_Valid_SW_Status)
-	uint32_t ts_tstamp;     /* tx time stamp */
-#endif
-#ifdef ATH_SUPPORT_FLOWMAC_MODULE
-	uint8_t ts_flowmac_flags;
-#define IEEE80211_TX_FLOWMAC_DONE           0x01
-#endif
-	uint32_t ts_rateKbps;
-} ieee80211_xmit_status;
-
-#ifndef EXTERNAL_USE_ONLY
-typedef struct ieee80211_rx_status {
-	int rs_numchains;
-	int rs_flags;
-#define IEEE80211_RX_FCS_ERROR      0x01
-#define IEEE80211_RX_MIC_ERROR      0x02
-#define IEEE80211_RX_DECRYPT_ERROR  0x04
-/* holes in flags here between, ATH_RX_XXXX to IEEE80211_RX_XXX */
-#define IEEE80211_RX_KEYMISS        0x200
-	int rs_rssi;            /* RSSI (noise floor ajusted) */
-	int rs_abs_rssi;        /* absolute RSSI */
-	int rs_datarate;        /* data rate received */
-	int rs_rateieee;
-	int rs_ratephy;
-
-#define IEEE80211_MAX_ANTENNA       3   /* Keep the same as ATH_MAX_ANTENNA */
-	uint8_t rs_rssictl[IEEE80211_MAX_ANTENNA];      /* RSSI (noise floor ajusted) */
-	uint8_t rs_rssiextn[IEEE80211_MAX_ANTENNA];     /* RSSI (noise floor ajusted) */
-	uint8_t rs_isvalidrssi; /* rs_rssi is valid or not */
-
-	enum ieee80211_phymode rs_phymode;
-	int rs_freq;
-
-	union {
-		uint8_t data[8];
-		uint64_t tsf;
-	} rs_tstamp;
-
-	/*
-	 * Detail channel structure of recv frame.
-	 * It could be NULL if not available
-	 */
-	struct ieee80211_channel *rs_full_chan;
-
-	uint8_t rs_isaggr;
-	uint8_t rs_isapsd;
-	int16_t rs_noisefloor;
-	uint16_t rs_channel;
-#ifdef ATH_SUPPORT_TxBF
-	uint32_t rs_rpttstamp;  /* txbf report time stamp */
-#endif
-
-	/* The following counts are meant to assist in stats calculation.
-	   These variables are incremented only in specific situations, and
-	   should not be relied upon for any purpose other than the original
-	   stats related purpose they have been introduced for. */
-
-	uint16_t rs_cryptodecapcount;   /* Crypto bytes decapped/demic'ed. */
-	uint8_t rs_padspace;    /* No. of padding bytes present after header
-	                           in wbuf. */
-	uint8_t rs_qosdecapcount;       /* QoS/HTC bytes decapped. */
-
-	/* End of stats calculation related counts. */
-
-	uint8_t rs_lsig[IEEE80211_LSIG_LEN];
-	uint8_t rs_htsig[IEEE80211_HTSIG_LEN];
-	uint8_t rs_servicebytes[IEEE80211_SB_LEN];
-
-} ieee80211_recv_status;
-#endif /* EXTERNAL_USE_ONLY */
-
-/*
- * flags to be passed to ieee80211_vap_create function .
- */
-#define IEEE80211_CLONE_BSSID           0x0001  /* allocate unique mac/bssid */
-#define IEEE80211_CLONE_NOBEACONS       0x0002  /* don't setup beacon timers */
-#define IEEE80211_CLONE_WDS             0x0004  /* enable WDS processing */
-#define IEEE80211_CLONE_WDSLEGACY       0x0008  /* legacy WDS operation */
-#define IEEE80211_PRIMARY_VAP           0x0010  /* primary vap */
-#define IEEE80211_P2PDEV_VAP            0x0020  /* p2pdev vap */
-#define IEEE80211_P2PGO_VAP             0x0040  /* p2p-go vap */
-#define IEEE80211_P2PCLI_VAP            0x0080  /* p2p-client vap */
-#define IEEE80211_CLONE_MACADDR         0x0100  /* create vap w/ specified mac/bssid */
-#define IEEE80211_CLONE_MATADDR         0x0200  /* create vap w/ specified MAT addr */
-#define IEEE80211_WRAP_VAP              0x0400  /* wireless repeater ap vap */
-
-/*
- * For the new multi-vap scan feature, there is a set of default priority tables
- * for each OpMode.
- * The following are the default list of the VAP Scan Priority Mapping based on OpModes.
- * NOTE: the following are only used when "#if ATH_SUPPORT_MULTIPLE_SCANS" is true.
- */
-/* For IBSS opmode */
-#define DEF_VAP_SCAN_PRI_MAP_OPMODE_IBSS_BASE               0
-/* For STA opmode */
-#define DEF_VAP_SCAN_PRI_MAP_OPMODE_STA_BASE                0
-#define DEF_VAP_SCAN_PRI_MAP_OPMODE_STA_P2P_CLIENT          1
-/* For HostAp opmode */
-#define DEF_VAP_SCAN_PRI_MAP_OPMODE_AP_BASE                 0
-#define DEF_VAP_SCAN_PRI_MAP_OPMODE_AP_P2P_GO               1
-#define DEF_VAP_SCAN_PRI_MAP_OPMODE_AP_P2P_DEVICE           2
-/* For BTAmp opmode */
-#define DEF_VAP_SCAN_PRI_MAP_OPMODE_BTAMP_BASE              0
-
-typedef enum _ieee80211_dev_vap_event {
-	IEEE80211_VAP_CREATED = 1,
-	IEEE80211_VAP_STOPPED,
-	IEEE80211_VAP_DELETED
-} ieee80211_dev_vap_event;
-
-typedef struct _wlan_dev_event_handler_table {
-	void (*wlan_dev_vap_event)(void *event_arg, wlan_dev_t, os_if_t, ieee80211_dev_vap_event);      /* callback to receive vap events */
-#ifdef ATH_SUPPORT_SPECTRAL
-	void (*wlan_dev_spectral_indicate)(void *, void *, uint32_t);
-#endif
-} wlan_dev_event_handler_table;
-
-typedef enum _ieee80211_ap_stopped_reason {
-	IEEE80211_AP_STOPPED_REASON_DUMMY = 0,  /* Dummy placeholder. Should not use */
-	IEEE80211_AP_STOPPED_REASON_CHANNEL_DFS = 1,
-} ieee80211_ap_stopped_reason;
-
-typedef int IEEE80211_REASON_CODE;
-typedef int IEEE80211_STATUS;
-
-/*
- * scan API related structs.
- */
-typedef enum _ieee80211_scan_type {
-	IEEE80211_SCAN_BACKGROUND,
-	IEEE80211_SCAN_FOREGROUND,
-	IEEE80211_SCAN_SPECTRAL,
-	IEEE80211_SCAN_REPEATER_BACKGROUND,
-	IEEE80211_SCAN_REPEATER_EXT_BACKGROUND,
-	IEEE80211_SCAN_RADIO_MEASUREMENTS,
-} ieee80211_scan_type;
-
-/*
- * Priority numbers must be sequential, starting with 0.
- */
-typedef enum ieee80211_scan_priority_t {
-	IEEE80211_SCAN_PRIORITY_VERY_LOW = 0,
-	IEEE80211_SCAN_PRIORITY_LOW,
-	IEEE80211_SCAN_PRIORITY_MEDIUM,
-	IEEE80211_SCAN_PRIORITY_HIGH,
-	IEEE80211_SCAN_PRIORITY_VERY_HIGH,
-
-	IEEE80211_SCAN_PRIORITY_COUNT   /* number of priorities supported */
-} IEEE80211_SCAN_PRIORITY;
-
-typedef uint16_t IEEE80211_SCAN_REQUESTOR;
-typedef uint32_t IEEE80211_SCAN_ID;
-
-#define IEEE80211_SCAN_ID_NONE                    0
-
-/* All P2P scans currently use medium priority */
-#define IEEE80211_P2P_DEFAULT_SCAN_PRIORITY       IEEE80211_SCAN_PRIORITY_MEDIUM
-#define IEEE80211_P2P_SCAN_PRIORITY_HIGH          IEEE80211_SCAN_PRIORITY_HIGH
-
-/* Masks identifying types/ID of scans */
-#define IEEE80211_SPECIFIC_SCAN       0x00000000
-#define IEEE80211_VAP_SCAN            0x01000000
-#define IEEE80211_ALL_SCANS           0x04000000
-
-/**
- * host scan bit. only relevant for host/target architecture.
- * do not reuse this bit definition. target uses this .
- *
- */
-#define IEEE80211_HOST_SCAN           0x80000000
-#define IEEE80211_SCAN_CLASS_MASK     0xFF000000
-
-#define IEEE80211_SCAN_PASSIVE            0x0001        /* passively scan all the channels */
-#define IEEE80211_SCAN_ACTIVE             0x0002        /* actively  scan all the channels (regdomain rules still apply) */
-#define IEEE80211_SCAN_2GHZ               0x0004        /* scan 2GHz band */
-#define IEEE80211_SCAN_5GHZ               0x0008        /* scan 5GHz band */
-#define IEEE80211_SCAN_ALLBANDS           (IEEE80211_SCAN_5GHZ | IEEE80211_SCAN_2GHZ)
-#define IEEE80211_SCAN_CONTINUOUS         0x0010        /* keep scanning until maxscantime expires */
-#define IEEE80211_SCAN_FORCED             0x0020        /* forced scan (OS request) - should proceed even in the presence of data traffic */
-#define IEEE80211_SCAN_NOW                0x0040        /* scan now (User request)  - should proceed even in the presence of data traffic */
-#define IEEE80211_SCAN_ADD_BCAST_PROBE    0x0080        /* add wildcard ssid and broadcast probe request if there is none */
-#define IEEE80211_SCAN_EXTERNAL           0x0100        /* scan requested by OS */
-#define IEEE80211_SCAN_BURST              0x0200        /* scan multiple channels before returning to BSS channel */
-#define IEEE80211_SCAN_CHAN_EVENT         0x0400        /* scan chan event for  offload architectures */
-#define IEEE80211_SCAN_FILTER_PROBE_REQ   0x0800        /* Filter probe requests- applicable only for offload architectures */
-
-#define IEEE80211_SCAN_PARAMS_MAX_SSID     10
-#define IEEE80211_SCAN_PARAMS_MAX_BSSID    10
-
-/* flag definitions passed to scan_cancel API */
-
-#define IEEE80211_SCAN_CANCEL_ASYNC 0x0 /* asynchronouly wait for scan SM to complete cancel */
-#define IEEE80211_SCAN_CANCEL_WAIT  0x1 /* wait for scan SM to complete cancel */
-#define IEEE80211_SCAN_CANCEL_SYNC  0x2 /* synchronously execute cancel scan */
-
-#ifndef EXTERNAL_USE_ONLY
-typedef bool (*ieee80211_scan_termination_check)(void *arg);
-
-typedef struct _ieee80211_scan_params {
-	ieee80211_scan_type type;
-	int min_dwell_time_active;      /* min time in msec on active channels */
-	int max_dwell_time_active;      /* max time in msec on active channels (if no response) */
-	int min_dwell_time_passive;     /* min time in msec on passive channels */
-	int max_dwell_time_passive;     /* max time in msec on passive channels (if no response) */
-	int min_rest_time;      /* min time in msec on the BSS channel, only valid for BG scan */
-	int max_rest_time;      /* max time in msec on the BSS channel, only valid for BG scan */
-	int max_offchannel_time;        /* max time away from BSS channel, in ms */
-	int repeat_probe_time;  /* time before sending second probe request */
-	int idle_time;          /* time in msec on bss channel before switching channel */
-	int max_scan_time;      /* maximum time in msec allowed for scan  */
-	int probe_delay;        /* delay in msec before sending probe request */
-	int offchan_retry_delay;        /* delay in msec before retrying off-channel switch */
-	int min_beacon_count;   /* number of home AP beacons to receive before leaving the home channel */
-	int max_offchan_retries;        /* maximum number of times to retry off-channel switch */
-	int beacon_timeout;     /* maximum time to wait for beacons */
-	int flags;              /* scan flags */
-	int num_channels;       /* number of channels to scan */
-	bool multiple_ports_active;     /* driver has multiple ports active in the home channel */
-	bool restricted_scan;   /* Perform restricted scan */
-	bool chan_list_allocated;
-	IEEE80211_SCAN_PRIORITY p2p_scan_priority;      /* indicates the scan priority if this is a P2P-related scan */
-	uint32_t *chan_list;    /* array of ieee channels (or) frequencies to scan */
-	int num_ssid;           /* number of desired ssids */
-	ieee80211_ssid ssid_list[IEEE80211_SCAN_PARAMS_MAX_SSID];
-	int num_bssid;          /* number of desired bssids */
-	uint8_t bssid_list[IEEE80211_SCAN_PARAMS_MAX_BSSID][IEEE80211_ADDR_LEN];
-	struct ieee80211_node *bss_node;        /* BSS node */
-	int ie_len;             /* length of the ie data to be added to probe req */
-	uint8_t *ie_data;       /* pointer to ie data */
-	ieee80211_scan_termination_check check_termination_function;    /* function checking for termination condition */
-	void *check_termination_context;        /* context passed to function above */
-} ieee80211_scan_params;
-
-/* Data types used to specify scan priorities */
-typedef uint32_t IEEE80211_PRIORITY_MAPPING[IEEE80211_SCAN_PRIORITY_COUNT];
-
-/**************************************
- * Called before attempting to roam.  Modifies the rssiAdder of a BSS
- * based on the preferred status of a BSS.
- *
- * According to CCX spec, AP in the neighbor list is not meant for giving extra
- * weightage in roaming. By doing so, roaming becomes sticky. See bug 21220.
- * Change the weightage to 0. Cisco may ask in future for a user control of
- * this weightage.
- */
-#define PREFERRED_BSS_RANK                20
-#define NEIGHBOR_BSS_RANK                  0    /* must be less than preferred BSS rank */
-
-/*
- * The utility of the BSS is the metric used in the selection
- * of a BSS. The Utility of the BSS is reduced if we just left the BSS.
- * The Utility of the BSS is not reduced if we have left the
- * BSS for 8 seconds (8000ms) or more.
- * 2^13 milliseconds is a close approximation to avoid expensive division
- */
-#define LAST_ASSOC_TIME_DELTA_REQUIREMENT (1 << 13)     /* 8192 */
-
-#define QBSS_SCALE_MAX                   255    /* Qbss channel load Max value */
-#define QBSS_SCALE_DOWN_FACTOR             2    /* scale factor to reduce Qbss channel load */
-#define QBSS_HYST_ADJ                     60    /* Qbss Weightage factor for the current AP */
-
-/*
- * Flags used to set field APState
- */
-#define AP_STATE_GOOD    0x00
-#define AP_STATE_BAD     0x01
-#define AP_STATE_RETRY   0x10
-#define BAD_AP_TIMEOUT   6000   /* In milli seconds */
-/*
- * To disable BAD_AP status check on any scan entry
- */
-#define BAD_AP_TIMEOUT_DISABLED             0
-
-/*
- * BAD_AP timeout specified in seconds
- */
-#define BAD_AP_TIMEOUT_IN_SECONDS           10
-
-/*
- * State values used to represent our assoc_state with ap (discrete, not bitmasks)
- */
-#define AP_ASSOC_STATE_NONE     0
-#define AP_ASSOC_STATE_AUTH     1
-#define AP_ASSOC_STATE_ASSOC    2
-
-/*
- * Entries in the scan list are considered obsolete after 75 seconds.
- */
-#define IEEE80211_SCAN_ENTRY_EXPIRE_TIME           75000
-
-/*
- * idle time is only valid for scan type IEEE80211_SCAN_BACKGROUND.
- * if idle time is set then the scanner would change channel from BSS
- * channel to foreign channel only if both resttime is expired and
- * the theres was not traffic for idletime msec on the bss channel.
- * value of 0 for idletime would cause the channel to switch from BSS
- * channel to foreign channel as soon  as the resttime is expired.
- *
- * if maxscantime is nonzero and if the scanner can not complete the
- * scan in maxscantime msec then the scanner will cancel the scan and
- * post IEEE80211_SCAN_COMPLETED event with reason SCAN_TIMEDOUT.
- *
- */
-
-/*
- * chanlist can be either ieee channels (or) frequencies.
- * if a value is less than 1000 implementation assumes it
- * as ieee channel # otherwise implementation assumes it
- * as frequency in Mhz.
- */
-
-typedef enum _ieee80211_scan_event_type {
-	IEEE80211_SCAN_STARTED,
-	IEEE80211_SCAN_COMPLETED,
-	IEEE80211_SCAN_RADIO_MEASUREMENT_START,
-	IEEE80211_SCAN_RADIO_MEASUREMENT_END,
-	IEEE80211_SCAN_RESTARTED,
-	IEEE80211_SCAN_HOME_CHANNEL,
-	IEEE80211_SCAN_FOREIGN_CHANNEL,
-	IEEE80211_SCAN_BSSID_MATCH,
-	IEEE80211_SCAN_FOREIGN_CHANNEL_GET_NF,
-	IEEE80211_SCAN_DEQUEUED,
-	IEEE80211_SCAN_PREEMPTED,
-
-	IEEE80211_SCAN_EVENT_COUNT
-} ieee80211_scan_event_type;
-
-typedef enum ieee80211_scan_completion_reason {
-	IEEE80211_REASON_NONE,
-	IEEE80211_REASON_COMPLETED,
-	IEEE80211_REASON_CANCELLED,
-	IEEE80211_REASON_TIMEDOUT,
-	IEEE80211_REASON_TERMINATION_FUNCTION,
-	IEEE80211_REASON_MAX_OFFCHAN_RETRIES,
-	IEEE80211_REASON_PREEMPTED,
-	IEEE80211_REASON_RUN_FAILED,
-	IEEE80211_REASON_INTERNAL_STOP,
-
-	IEEE80211_REASON_COUNT
-} ieee80211_scan_completion_reason;
-
-typedef struct _ieee80211_scan_event {
-	ieee80211_scan_event_type type;
-	ieee80211_scan_completion_reason reason;
-	wlan_chan_t chan;
-	IEEE80211_SCAN_REQUESTOR requestor;     /* Requestor ID passed to the scan_start function */
-	IEEE80211_SCAN_ID scan_id;      /* Specific ID of the scan reporting the event */
-} ieee80211_scan_event;
-
-typedef enum _ieee80211_scan_request_status {
-	IEEE80211_SCAN_STATUS_QUEUED,
-	IEEE80211_SCAN_STATUS_RUNNING,
-	IEEE80211_SCAN_STATUS_PREEMPTED,
-	IEEE80211_SCAN_STATUS_COMPLETED
-} ieee80211_scan_request_status;
-
-/*
- * the sentry field of tht ieee80211_scan_event is only valid if the
- * event type is IEEE80211_SCAN_BSSID_MATCH.
- */
-
-typedef void (*ieee80211_scan_event_handler)(wlan_if_t vaphandle,
-					     ieee80211_scan_event *event,
-					     void *arg);
-
-typedef struct _ieee80211_scan_info {
-	ieee80211_scan_type type;
-	IEEE80211_SCAN_REQUESTOR requestor;     /* Originator ID passed to the scan_start function */
-	IEEE80211_SCAN_ID scan_id;      /* Specific ID of the scan reporting the event */
-	IEEE80211_SCAN_PRIORITY priority;       /* Requested priority level (low/medium/high) */
-	ieee80211_scan_request_status scheduling_status;        /* Queued/running/preempted/completed */
-	int min_dwell_time_active;      /* min time in msec on active channels */
-	int max_dwell_time_active;      /* max time in msec on active channel (if no response) */
-	int min_dwell_time_passive;     /* min time in msec on passive channels */
-	int max_dwell_time_passive;     /* max time in msec on passive channel */
-	int min_rest_time;      /* min time in msec on the BSS channel, only valid for BG scan */
-	int max_rest_time;      /* max time in msec on the BSS channel, only valid for BG scan */
-	int max_offchannel_time;        /* max time away from BSS channel, in ms */
-	int repeat_probe_time;  /* time before sending second probe request */
-	int min_beacon_count;   /* number of home AP beacons to receive before leaving the home channel */
-	int flags;              /* scan flags */
-	systime_t scan_start_time;      /* system time when last scani started */
-	int scanned_channels;   /* number of scanned channels */
-	int default_channel_list_length;        /* number of channels in the default channel list */
-	int channel_list_length;        /* number of channels in the channel list used for the current scan */
-	uint8_t in_progress : 1,  /* if the scan is in progress */
-		cancelled : 1,  /* if the scan is cancelled */
-		preempted : 1,  /* if the scan is preempted */
-		restricted : 1; /* if the scan is restricted */
-} ieee80211_scan_info;
-
-typedef struct _ieee80211_scan_request_info {
-	wlan_if_t vaphandle;
-	IEEE80211_SCAN_REQUESTOR requestor;
-	IEEE80211_SCAN_PRIORITY requested_priority;
-	IEEE80211_SCAN_PRIORITY absolute_priority;
-	IEEE80211_SCAN_ID scan_id;
-	ieee80211_scan_request_status scheduling_status;
-	ieee80211_scan_params params;
-	systime_t request_timestamp;
-	uint32_t maximum_duration;
-} ieee80211_scan_request_info;
-
-#endif /* EXTERNAL_USE_ONLY */
-
-#ifndef EXTERNAL_USE_ONLY
-typedef void (*ieee80211_acs_event_handler)(void *arg, wlan_chan_t channel);
-#endif /* EXTERNAL_USE_ONLY */
-
-#define MAX_CHAINS 3
-
-typedef struct _wlan_rssi_info {
-	int8_t avg_rssi;        /* average rssi */
-	uint8_t valid_mask;     /* bitmap of valid elements in rssi_ctrl/ext array */
-	int8_t rssi_ctrl[MAX_CHAINS];
-	int8_t rssi_ext[MAX_CHAINS];
-} wlan_rssi_info;
-
-typedef enum _wlan_rssi_type {
-	WLAN_RSSI_TX,
-	WLAN_RSSI_RX,
-	WLAN_RSSI_BEACON,       /* rssi of the beacon, only valid for STA/IBSS vap */
-	WLAN_RSSI_RX_DATA
-} wlan_rssi_type;
-
-typedef enum _ieee80211_rate_type {
-	IEEE80211_RATE_TYPE_LEGACY,
-	IEEE80211_RATE_TYPE_MCS,
-} ieee80211_rate_type;
-
-typedef struct _ieee80211_rate_info {
-	ieee80211_rate_type type;
-	uint32_t rate;          /* average rate in kbps */
-	uint32_t lastrate;      /* last packet rate in kbps */
-	uint8_t mcs;            /* mcs index . is valid if rate type is MCS20 or MCS40 */
-	uint8_t maxrate_per_client;
-} ieee80211_rate_info;
-
-typedef enum _ieee80211_node_param_type {
-	IEEE80211_NODE_PARAM_TX_POWER,
-	IEEE80211_NODE_PARAM_ASSOCID,
-	IEEE80211_NODE_PARAM_INACT,     /* inactivity timer value */
-	IEEE80211_NODE_PARAM_AUTH_MODE, /* auth mode */
-	IEEE80211_NODE_PARAM_CAP_INFO,  /* auth mode */
-} ieee80211_node_param_type;
-
-/*
- * Per/node (station) statistics available when operating as an AP.
- */
-struct ieee80211_nodestats {
-	uint32_t ns_rx_data;    /* rx data frames */
-	uint32_t ns_rx_mgmt;    /* rx management frames */
-	uint32_t ns_rx_ctrl;    /* rx control frames */
-	uint32_t ns_rx_ucast;   /* rx unicast frames */
-	uint32_t ns_rx_mcast;   /* rx multi/broadcast frames */
-	uint64_t ns_rx_bytes;   /* rx data count (bytes) */
-	uint64_t ns_rx_beacons; /* rx beacon frames */
-	uint32_t ns_rx_proberesp;       /* rx probe response frames */
-
-	uint32_t ns_rx_dup;     /* rx discard 'cuz dup */
-	uint32_t ns_rx_noprivacy;       /* rx w/ wep but privacy off */
-	uint32_t ns_rx_wepfail; /* rx wep processing failed */
-	uint32_t ns_rx_demicfail;       /* rx demic failed */
-
-	/* We log MIC and decryption failures against Transmitter STA stats.
-	   Though the frames may not actually be sent by STAs corresponding
-	   to TA, the stats are still valuable for some customers as a sort
-	   of rough indication.
-	   Also note that the mapping from TA to STA may fail sometimes. */
-	uint32_t ns_rx_tkipmic; /* rx TKIP MIC failure */
-	uint32_t ns_rx_ccmpmic; /* rx CCMP MIC failure */
-	uint32_t ns_rx_wpimic;  /* rx WAPI MIC failure */
-	uint32_t ns_rx_tkipicv; /* rx ICV check failed (TKIP) */
-	uint32_t ns_rx_decap;   /* rx decapsulation failed */
-	uint32_t ns_rx_defrag;  /* rx defragmentation failed */
-	uint32_t ns_rx_disassoc;        /* rx disassociation */
-	uint32_t ns_rx_deauth;  /* rx deauthentication */
-	uint32_t ns_rx_action;  /* rx action */
-	uint32_t ns_rx_decryptcrc;      /* rx decrypt failed on crc */
-	uint32_t ns_rx_unauth;  /* rx on unauthorized port */
-	uint32_t ns_rx_unencrypted;     /* rx unecrypted w/ privacy */
-
-	uint32_t ns_tx_data;    /* tx data frames */
-	uint32_t ns_tx_data_success;    /* tx data frames successfully
-	                                   transmitted (unicast only) */
-	uint32_t ns_tx_mgmt;    /* tx management frames */
-	uint32_t ns_tx_ucast;   /* tx unicast frames */
-	uint32_t ns_tx_mcast;   /* tx multi/broadcast frames */
-	uint64_t ns_tx_bytes;   /* tx data count (bytes) */
-	uint64_t ns_tx_bytes_success;   /* tx success data count - unicast only
-	                                   (bytes) */
-	uint32_t ns_tx_probereq;        /* tx probe request frames */
-	uint32_t ns_tx_uapsd;   /* tx on uapsd queue */
-	uint32_t ns_tx_discard; /* tx dropped by NIC */
-
-	uint32_t ns_tx_novlantag;       /* tx discard 'cuz no tag */
-	uint32_t ns_tx_vlanmismatch;    /* tx discard 'cuz bad tag */
-
-	uint32_t ns_tx_eosplost;        /* uapsd EOSP retried out */
-
-	uint32_t ns_ps_discard; /* ps discard 'cuz of age */
-
-	uint32_t ns_uapsd_triggers;     /* uapsd triggers */
-	uint32_t ns_uapsd_duptriggers;  /* uapsd duplicate triggers */
-	uint32_t ns_uapsd_ignoretriggers;       /* uapsd duplicate triggers */
-	uint32_t ns_uapsd_active;       /* uapsd duplicate triggers */
-	uint32_t ns_uapsd_triggerenabled;       /* uapsd duplicate triggers */
-
-	/* MIB-related state */
-	uint32_t ns_tx_assoc;   /* [re]associations */
-	uint32_t ns_tx_assoc_fail;      /* [re]association failures */
-	uint32_t ns_tx_auth;    /* [re]authentications */
-	uint32_t ns_tx_auth_fail;       /* [re]authentication failures */
-	uint32_t ns_tx_deauth;  /* deauthentications */
-	uint32_t ns_tx_deauth_code;     /* last deauth reason */
-	uint32_t ns_tx_disassoc;        /* disassociations */
-	uint32_t ns_tx_disassoc_code;   /* last disassociation reason */
-	uint32_t ns_psq_drops;  /* power save queue drops */
-};
-
-/*
- * station power save mode.
- */
-typedef enum ieee80211_psmode {
-	IEEE80211_PWRSAVE_NONE = 0,     /* no power save */
-	IEEE80211_PWRSAVE_LOW,
-	IEEE80211_PWRSAVE_NORMAL,
-	IEEE80211_PWRSAVE_MAXIMUM,
-	IEEE80211_PWRSAVE_WNM   /* WNM-Sleep Mode */
-} ieee80211_pwrsave_mode;
-
-/* station power save pspoll handling */
-typedef enum {
-	IEEE80211_CONTINUE_PSPOLL_FOR_MORE_DATA,
-	IEEE80211_WAKEUP_FOR_MORE_DATA,
-} ieee80211_pspoll_moredata_handling;
-
-/*
- * apps power save state.
- */
-typedef enum {
-	APPS_AWAKE = 0,
-	APPS_PENDING_SLEEP,
-	APPS_SLEEP,
-	APPS_FAKE_SLEEP,        /* Pending blocking sleep */
-	APPS_FAKING_SLEEP,      /* Blocking sleep */
-	APPS_UNKNOWN_PWRSAVE,
-} ieee80211_apps_pwrsave_state;
-
-typedef enum _iee80211_mimo_powersave_mode {
-	IEEE80211_MIMO_POWERSAVE_NONE,  /* no mimo power save */
-	IEEE80211_MIMO_POWERSAVE_STATIC,        /* static mimo power save */
-	IEEE80211_MIMO_POWERSAVE_DYNAMIC        /* dynamic mimo powersave */
-} ieee80211_mimo_powersave_mode;
-
-#ifdef ATH_COALESCING
-typedef enum _ieee80211_coalescing_state {
-	IEEE80211_COALESCING_DISABLED = 0,      /* Coalescing is disabled */
-	IEEE80211_COALESCING_DYNAMIC = 1,       /* Dynamically move to Enabled state based on Uruns */
-	IEEE80211_COALESCING_ENABLED = 2,       /* Coalescing is enabled */
-} ieee80211_coalescing_state;
-
-#define IEEE80211_TX_COALESCING_THRESHOLD     5 /* Number of underrun errors to trigger coalescing */
-#endif
-
-typedef enum _ieee80211_cap {
-	IEEE80211_CAP_SHSLOT,   /* CAPABILITY: short slot */
-	IEEE80211_CAP_SHPREAMBLE,       /* CAPABILITY: short premable */
-	IEEE80211_CAP_MULTI_DOMAIN,     /* CAPABILITY: multiple domain */
-	IEEE80211_CAP_WMM,      /* CAPABILITY: WMM */
-	IEEE80211_CAP_HT,       /* CAPABILITY: HT */
-	IEEE80211_CAP_PERF_PWR_OFLD,    /* CAPABILITY: power performance offload support */
-	IEEE80211_CAP_11AC,     /* CAPABILITY: 11ac support */
-} ieee80211_cap;
-
-typedef enum _ieee80211_device_param {
-	IEEE80211_DEVICE_RSSI_CTL,
-	IEEE80211_DEVICE_NUM_TX_CHAIN,
-	IEEE80211_DEVICE_NUM_RX_CHAIN,
-	IEEE80211_DEVICE_TX_CHAIN_MASK,
-	IEEE80211_DEVICE_RX_CHAIN_MASK,
-	IEEE80211_DEVICE_TX_CHAIN_MASK_LEGACY,
-	IEEE80211_DEVICE_RX_CHAIN_MASK_LEGACY,
-	IEEE80211_DEVICE_BMISS_LIMIT,   /* # of beacon misses for HW to generate BMISS intr */
-	IEEE80211_DEVICE_PROTECTION_MODE,       /* protection mode */
-	IEEE80211_DEVICE_BLKDFSCHAN,    /* block the use of DFS channels */
-	IEEE80211_DEVICE_GREEN_AP_PS_ENABLE,
-	IEEE80211_DEVICE_GREEN_AP_PS_TIMEOUT,
-	IEEE80211_DEVICE_GREEN_AP_PS_ON_TIME,
-	IEEE80211_DEVICE_CWM_EXTPROTMODE,
-	IEEE80211_DEVICE_CWM_EXTPROTSPACING,
-	IEEE80211_DEVICE_CWM_ENABLE,
-	IEEE80211_DEVICE_CWM_EXTBUSYTHRESHOLD,
-	IEEE80211_DEVICE_DOTH,
-	IEEE80211_DEVICE_ADDBA_MODE,
-	IEEE80211_DEVICE_COUNTRYCODE,
-	IEEE80211_DEVICE_MULTI_CHANNEL, /* turn on/off off channel support */
-	IEEE80211_DEVICE_MAX_AMSDU_SIZE,        /* Size of AMSDU to be sent on the air */
-	IEEE80211_DEVICE_P2P,   /* Enable or Disable P2P */
-	IEEE80211_DEVICE_OVERRIDE_SCAN_PROBERESPONSE_IE,        /* Override scan Probe response IE, 0: Don't over-ride */
-	IEEE80211_DEVICE_2G_CSA,
-	IEEE80211_DEVICE_PWRTARGET,
-	IEEE80211_DEVICE_OFF_CHANNEL_SUPPORT,
-} ieee80211_device_param;
-
-typedef enum _ieee80211_param {
-	IEEE80211_BEACON_INTVAL,        /* in TUs */
-	IEEE80211_LISTEN_INTVAL,        /* number of beacons */
-	IEEE80211_DTIM_INTVAL,  /* number of beacons */
-	IEEE80211_BMISS_COUNT_RESET,    /* number of beacon miss intrs before reset */
-	IEEE80211_BMISS_COUNT_MAX,      /* number of beacon miss intrs for bmiss notificationst */
-	IEEE80211_ATIM_WINDOW,  /* ATIM window */
-	IEEE80211_SHORT_SLOT,   /* short slot on/off */
-	IEEE80211_SHORT_PREAMBLE,       /* short preamble on/off */
-	IEEE80211_RTS_THRESHOLD,        /* rts threshold, 0 means no rts threshold  */
-	IEEE80211_FRAG_THRESHOLD,       /* fragmentation threshold, 0 means no rts threshold  */
-	IEEE80211_FIXED_RATE,   /*
-	                         * rate code series(0: auto rate, 32 bit value:  rate
-	                         * codes for 4 rate series. each byte for one rate series)
-	                         */
-	IEEE80211_MCAST_RATE,   /* rate in Kbps */
-	IEEE80211_TXPOWER,      /* in 0.5db units */
-	IEEE80211_AMPDU_DENCITY,        /* AMPDU dencity */
-	IEEE80211_AMPDU_LIMIT,  /* AMPDU limit */
-	IEEE80211_MAX_AMPDU,    /* Max AMPDU Exp */
-	IEEE80211_VHT_MAX_AMPDU,        /* VHT Max AMPDU Exp */
-	IEEE80211_WPS_MODE,     /* WPS mode */
-	IEEE80211_TSN_MODE,     /* TSN mode */
-	IEEE80211_MULTI_DOMAIN, /* Multiple domain */
-	IEEE80211_SAFE_MODE,    /* Safe mode */
-	IEEE80211_NOBRIDGE_MODE,        /* No bridging done, all frames sent up the stack */
-	IEEE80211_PERSTA_KEYTABLE_SIZE, /* IBSS-only, read-only: persta key table size */
-	IEEE80211_RECEIVE_80211,        /* deliver std 802.11 frames 802.11 instead of ethernet frames on the rx */
-	IEEE80211_SEND_80211,   /* OS sends std 802.11 frames 802.11 instead of ethernet frames on tx side */
-	IEEE80211_MIN_BEACON_COUNT,     /* minumum number beacons to tx/rx before vap can pause */
-	IEEE80211_IDLE_TIME,    /* minimun no activity time before vap can pause */
-	IEEE80211_MIN_FRAMESIZE,        /* smallest frame size we are allowed to receive */
-	/* features. 0:feature is off. 1:feature is on. */
-	IEEE80211_FEATURE_WMM,  /* WMM */
-	IEEE80211_FEATURE_WMM_PWRSAVE,  /* WMM Power Save */
-	IEEE80211_FEATURE_UAPSD,        /* UAPSD setting (BE/BK/VI/VO) */
-	IEEE80211_FEATURE_WDS,  /* dynamic WDS feature */
-	IEEE80211_FEATURE_PRIVACY,      /* encryption */
-	IEEE80211_FEATURE_DROP_UNENC,   /* drop un encrypted frames */
-	IEEE80211_FEATURE_COUNTER_MEASURES,     /* turn on couter measures */
-	IEEE80211_FEATURE_HIDE_SSID,    /* turn on hide ssid feature */
-	IEEE80211_FEATURE_APBRIDGE,     /* turn on internal mcast traffic bridging for AP */
-	IEEE80211_FEATURE_PUREB,        /* turn on pure B mode for AP */
-	IEEE80211_FEATURE_PUREG,        /* turn on pure G mode for AP */
-	IEEE80211_FEATURE_REGCLASS,     /* add regulatory class IE in AP */
-	IEEE80211_FEATURE_COUNTRY_IE,   /* add country IE for vap in AP */
-	IEEE80211_FEATURE_IC_COUNTRY_IE,        /* add country IE for ic in AP */
-	IEEE80211_FEATURE_DOTH, /* enable 802.11h */
-	IEEE80211_FEATURE_PURE11N,      /* enable pure 11n  mode */
-	IEEE80211_FEATURE_PRIVATE_RSNIE,        /* enable OS shim to setup RSN IE */
-	IEEE80211_FEATURE_COPY_BEACON,  /* keep a copy of beacon */
-	IEEE80211_FEATURE_PSPOLL,       /* enable/disable pspoll mode in power save SM */
-	IEEE80211_FEATURE_CONTINUE_PSPOLL_FOR_MOREDATA, /* enable/disable option to contunue sending ps polls when there is more data */
-	IEEE80211_FEATURE_AMPDU,        /* Enable or Disable Aggregation */
-#ifdef ATH_COALESCING
-	IEEE80211_FEATURE_TX_COALESCING,        /* enable tx coalescing */
-#endif
-	IEEE80211_FEATURE_VAP_IND,      /* Repeater independant VAP */
-	IEEE80211_FIXED_RETRIES,        /* fixed retries  0-4 */
-	IEEE80211_SHORT_GI,     /* short gi on/off */
-	IEEE80211_HT40_INTOLERANT,
-	IEEE80211_CHWIDTH,
-	IEEE80211_CHEXTOFFSET,
-	IEEE80211_DISABLE_2040COEXIST,
-	IEEE80211_DISABLE_HTPROTECTION,
-	IEEE80211_STA_QUICKKICKOUT,
-	IEEE80211_CHSCANINIT,
-	IEEE80211_FEATURE_STAFWD,       /* dynamic AP Client  feature */
-	IEEE80211_DRIVER_CAPS,
-	IEEE80211_UAPSD_MAXSP,  /* UAPSD service period setting (0:unlimited, 2,4,6) */
-	IEEE80211_WEP_MBSSID,
-	IEEE80211_MGMT_RATE,    /* ieee rate to be used for management */
-	IEEE80211_RESMGR_VAP_AIR_TIME_LIMIT,    /* When multi-channel enabled, restrict air-time allocated to a VAP */
-	IEEE80211_TDLS_MACADDR1,        /* Upper 4 bytes of device's MAC address */
-	IEEE80211_TDLS_MACADDR2,        /* Lower 2 bytes of device's MAC address */
-	IEEE80211_TDLS_ACTION,  /* TDLS action requested                 */
-	IEEE80211_AUTO_ASSOC,
-	IEEE80211_PROTECTION_MODE,      /* per VAP protection mode */
-	IEEE80211_AUTH_INACT_TIMEOUT,   /* inactivity time while waiting for 802.11x auth to complete */
-	IEEE80211_INIT_INACT_TIMEOUT,   /* inactivity time while waiting for 802.11 auth/assoc to complete */
-	IEEE80211_RUN_INACT_TIMEOUT,    /* inactivity time when fully authed */
-	IEEE80211_PROBE_INACT_TIMEOUT,  /* inactivity counter value below which starts probing */
-	IEEE80211_QBSS_LOAD,
-	IEEE80211_WNM_CAP,
-	IEEE80211_WNM_BSS_CAP,
-	IEEE80211_WNM_TFS_CAP,
-	IEEE80211_WNM_TIM_CAP,
-	IEEE80211_WNM_SLEEP_CAP,
-	IEEE80211_WNM_FMS_CAP,
-	IEEE80211_AP_REJECT_DFS_CHAN,   /* AP to reject resuming on DFS Channel */
-	IEEE80211_ABOLT,
-	IEEE80211_COMP,
-	IEEE80211_FF,
-	IEEE80211_TURBO,
-	IEEE80211_BURST,
-	IEEE80211_AR,
-	IEEE80211_SLEEP,
-	IEEE80211_EOSPDROP,
-	IEEE80211_MARKDFS,
-	IEEE80211_WDS_AUTODETECT,
-	IEEE80211_WEP_TKIP_HT,
-	IEEE80211_ATH_RADIO,
-	IEEE80211_IGNORE_11DBEACON,
-	/* Video debug feature */
-	IEEE80211_VI_DBG_CFG,   /* Video debug configuration - Bit0- enable dbg, Bit1 - enable stats log */
-	IEEE80211_VI_DBG_NUM_STREAMS,   /* Total number of receive streams */
-	IEEE80211_VI_STREAM_NUM,        /* the stream number whose marker parameters are being set */
-	IEEE80211_VI_DBG_NUM_MARKERS,   /* total number of markers used to filter pkts */
-	IEEE80211_VI_MARKER_NUM,        /* the marker number whose parameters (offset, size & match) are being set */
-	IEEE80211_VI_MARKER_OFFSET_SIZE,        /* byte offset from skb start (upper 16 bits) & size in bytes(lower 16 bits) */
-	IEEE80211_VI_MARKER_MATCH,      /* marker pattern match used in filtering */
-	IEEE80211_VI_RXSEQ_OFFSET_SIZE, /* Rx Seq num offset skb start (upper 16 bits) & size in bytes(lower 16 bits) */
-	IEEE80211_VI_RX_SEQ_RSHIFT,     /* right-shift value in case field is not word aligned */
-	IEEE80211_VI_RX_SEQ_MAX,        /* maximum Rx Seq number (to check wrap around) */
-	IEEE80211_VI_RX_SEQ_DROP,       /* Indicator to the debug app that a particular seq num has been dropped */
-	IEEE80211_VI_TIME_OFFSET_SIZE,  /* Timestamp offset skb start (upper 16 bits) & size in bytes(lower 16 bits) */
-	IEEE80211_VI_RESTART,   /* If set to 1 resets all internal variables/counters & restarts debug tool */
-	IEEE80211_VI_RXDROP_STATUS,     /* Total RX drops in wireless */
-	IEEE80211_TRIGGER_MLME_RESP,    /* Option for App to trigger mlme response */
-#ifdef ATH_SUPPORT_TxBF
-	IEEE80211_TXBF_AUTO_CVUPDATE,   /* auto CV update enable */
-	IEEE80211_TXBF_CVUPDATE_PER,    /* per threshold to initial CV update */
-#endif
-	IEEE80211_MAX_CLIENT_NUMBERS,
-	IEEE80211_SMARTNET,
-	IEEE80211_FEATURE_MFP_TEST,     /* MFP test */
-	IEEE80211_WEATHER_RADAR,        /* weather radar channel skip */
-	IEEE80211_WEP_KEYCACHE, /* WEP KEYCACHE is enable */
-	IEEE80211_SEND_DEAUTH,  /* send deauth instead of disassoc while doing interface down  */
-	IEEE80211_SET_TXPWRADJUST,
-	IEEE80211_RRM_CAP,
-	IEEE80211_RRM_DEBUG,
-	IEEE80211_RRM_STATS,
-	IEEE80211_RRM_SLWINDOW,
-	IEEE80211_FEATURE_OFF_CHANNEL_SUPPORT,
-	IEEE80211_FIXED_VHT_MCS,        /* VHT mcs index */
-	IEEE80211_FIXED_NSS,    /* Spatial Streams count */
-	IEEE80211_SUPPORT_LDPC, /* LDPC Support */
-	IEEE80211_SUPPORT_TX_STBC,      /* TX STBC enable/disable */
-	IEEE80211_SUPPORT_RX_STBC,      /* RX STBC enable/disable */
-	IEEE80211_DEFAULT_KEYID,        /* XMIT default key */
-	IEEE80211_OPMODE_NOTIFY_ENABLE, /* Op mode notification enable/disable */
-	IEEE80211_ENABLE_RTSCTS,        /* Enable/Disable RTS-CTS */
-	IEEE80211_VHT_MCSMAP,   /* VHT MCS Map */
-	IEEE80211_GET_ACS_STATE,        /* get acs state */
-	IEEE80211_GET_CAC_STATE,        /* get cac state */
-} ieee80211_param;
-
-#define  IEEE80211_PROTECTION_NONE         0
-#define  IEEE80211_PROTECTION_CTSTOSELF    1
-#define  IEEE80211_PROTECTION_RTS_CTS      2
-
-typedef enum _ieee80211_privacy_filter {
-	IEEE80211_PRIVACY_FILTER_ALLWAYS,
-	IEEE80211_PRIVACY_FILTER_KEY_UNAVAILABLE,
-} ieee80211_privacy_filter;
-
-typedef enum _ieee80211_privacy_filter_packet_type {
-	IEEE80211_PRIVACY_FILTER_PACKET_UNICAST,
-	IEEE80211_PRIVACY_FILTER_PACKET_MULTICAST,
-	IEEE80211_PRIVACY_FILTER_PACKET_BOTH
-} ieee80211_privacy_filter_packet_type;
-
-typedef struct _ieee80211_privacy_excemption_filter {
-	uint16_t ether_type;    /* type of ethernet to apply this filter, in host byte order */
-	ieee80211_privacy_filter filter_type;
-	ieee80211_privacy_filter_packet_type packet_type;
-} ieee80211_privacy_exemption;
-
-/*
- * Authentication mode.
- * NB: the usage of auth modes NONE, AUTO are deprecated,
- * they are implemented through combinations of other auth modes
- * and cipher types. The deprecated values are preserved here to
- * maintain binary compatibility with applications like
- * wpa_supplicant and hostapd.
- */
-typedef enum _ieee80211_auth_mode {
-	IEEE80211_AUTH_NONE = 0,        /* deprecated */
-	IEEE80211_AUTH_OPEN = 1,        /* open */
-	IEEE80211_AUTH_SHARED = 2,      /* shared-key */
-	IEEE80211_AUTH_8021X = 3,       /* 802.1x */
-	IEEE80211_AUTH_AUTO = 4,        /* deprecated */
-	IEEE80211_AUTH_WPA = 5, /* WPA */
-	IEEE80211_AUTH_RSNA = 6,        /* WPA2/RSNA */
-	IEEE80211_AUTH_CCKM = 7,        /* CCK */
-	IEEE80211_AUTH_WAPI = 8,        /* WAPI */
-} ieee80211_auth_mode;
-
-#define IEEE80211_AUTH_MAX      (IEEE80211_AUTH_WAPI+1)
-
-/*
- * Cipher types.
- * NB: The values are preserved here to maintain binary compatibility
- * with applications like wpa_supplicant and hostapd.
- */
-typedef enum _ieee80211_cipher_type {
-	IEEE80211_CIPHER_WEP = 0,
-	IEEE80211_CIPHER_TKIP = 1,
-	IEEE80211_CIPHER_AES_OCB = 2,
-	IEEE80211_CIPHER_AES_CCM = 3,
-	IEEE80211_CIPHER_WAPI = 4,
-	IEEE80211_CIPHER_CKIP = 5,
-	IEEE80211_CIPHER_AES_CMAC = 6,
-	IEEE80211_CIPHER_NONE = 7,
-} ieee80211_cipher_type;
-
-#define IEEE80211_CIPHER_MAX    (IEEE80211_CIPHER_NONE+1)
-
-/* key direction */
-typedef enum _ieee80211_key_direction {
-	IEEE80211_KEY_DIR_TX,
-	IEEE80211_KEY_DIR_RX,
-	IEEE80211_KEY_DIR_BOTH
-} ieee80211_key_direction;
-
-#define IEEE80211_KEYIX_NONE    ((uint16_t) -1)
-
-typedef struct _ieee80211_keyval {
-	ieee80211_cipher_type keytype;
-	ieee80211_key_direction keydir;
-	u_int persistent : 1,     /* persistent key */
-	      mfp : 1;          /* management frame protection */
-	uint16_t keylen;        /* length of the key data fields */
-	uint8_t *macaddr;       /* mac address of length IEEE80211_ADDR_LEN . all bytes are 0xff for multicast key */
-	uint64_t keyrsc;
-	uint64_t keytsc;
-	uint16_t txmic_offset;  /* TKIP/SMS4 only: offset to tx mic key */
-	uint16_t rxmic_offset;  /* TKIP/SMS4 only: offset to rx mic key */
-	uint8_t *keydata;
-#ifdef ATH_SUPPORT_WAPI
-	uint8_t key_used;       /*index for WAPI rekey labeling */
-#endif
-} ieee80211_keyval;
-
-#define IEEE80211_AES_CMAC_LEN     128
-typedef enum _ieee80211_rsn_param {
-	IEEE80211_UCAST_CIPHER_LEN,
-	IEEE80211_MCAST_CIPHER_LEN,
-	IEEE80211_MCASTMGMT_CIPHER_LEN,
-	IEEE80211_KEYMGT_ALGS,
-	IEEE80211_RSN_CAPS
-} ieee80211_rsn_param;
-
-#define IEEE80211_PMKID_LEN     16
-
-typedef struct _ieee80211_pmkid_entry {
-	uint8_t bssid[IEEE80211_ADDR_LEN];
-	uint8_t pmkid[IEEE80211_PMKID_LEN];
-} ieee80211_pmkid_entry;
-
-typedef enum _wlan_wme_param {
-	WLAN_WME_CWMIN,
-	WLAN_WME_CWMAX,
-	WLAN_WME_AIFS,
-	WLAN_WME_TXOPLIMIT,
-	WLAN_WME_ACM,           /*bss only */
-	WLAN_WME_ACKPOLICY      /*bss only */
-} wlan_wme_param;
-
-typedef enum _ieee80211_frame_type {
-	IEEE80211_FRAME_TYPE_PROBEREQ,
-	IEEE80211_FRAME_TYPE_BEACON,
-	IEEE80211_FRAME_TYPE_PROBERESP,
-	IEEE80211_FRAME_TYPE_ASSOCREQ,
-	IEEE80211_FRAME_TYPE_ASSOCRESP,
-	IEEE80211_FRAME_TYPE_AUTH
-} ieee80211_frame_type;
-
-#define IEEE80211_FRAME_TYPE_MAX    (IEEE80211_FRAME_TYPE_AUTH+1)
-
-typedef enum _ieee80211_ampdu_mode {
-	IEEE80211_AMPDU_MODE_OFF,       /* disable AMPDU */
-	IEEE80211_AMPDU_MODE_ON,        /* enable AMPDU */
-	IEEE80211_AMPDU_MODE_WDSVAR     /* enable AMPDU with 4addr WAR */
-} ieee80211_ampdu_mode;
-
-typedef enum _ieee80211_reset_type {
-	IEEE80211_RESET_TYPE_DEVICE = 0,        /* device reset on error: tx timeout and etc. */
-	IEEE80211_RESET_TYPE_DOT11_INTF,        /* dot11 reset: only reset one network interface (vap) */
-	IEEE80211_RESET_TYPE_INTERNAL,  /* internal reset */
-} ieee80211_reset_type;
-
-typedef struct _ieee80211_reset_request {
-	ieee80211_reset_type type;
-
-	u_int reset_hw : 1,       /* reset the actual H/W */
-	/*
-	 * The following fields are only valid for DOT11 reset, i.e.,
-	 * IEEE80211_RESET_TYPE_DOT11_INTF
-	 */
-	      reset_phy : 1,    /* reset PHY */
-	      reset_mac : 1,    /* reset MAC */
-	      set_default_mib : 1, /* set default MIB variables */
-	      no_flush : 1;
-	uint8_t macaddr[IEEE80211_ADDR_LEN];
-	enum ieee80211_phymode phy_mode;
-} ieee80211_reset_request;
-
-#define IEEE80211_MSG_MAX 63
-#define IEEE80211_MSG_SMARTANT 7        /* Bit 7 (0x80)for Smart Antenna debug */
-enum {
-	/* IEEE80211_PARAM_DBG_LVL */
-	IEEE80211_MSG_TDLS = 0, /* TDLS */
-	IEEE80211_MSG_ACS,      /* auto channel selection */
-	IEEE80211_MSG_SCAN_SM,  /* scan state machine */
-	IEEE80211_MSG_SCANENTRY,        /* scan entry */
-	IEEE80211_MSG_WDS,      /* WDS handling */
-	IEEE80211_MSG_ACTION,   /* action management frames */
-	IEEE80211_MSG_ROAM,     /* sta-mode roaming */
-	IEEE80211_MSG_INACT,    /* inactivity handling */
-	IEEE80211_MSG_DOTH = 8, /* 11.h */
-	IEEE80211_MSG_IQUE,     /* IQUE features */
-	IEEE80211_MSG_WME,      /* WME protocol */
-	IEEE80211_MSG_ACL,      /* ACL handling */
-	IEEE80211_MSG_WPA,      /* WPA/RSN protocol */
-	IEEE80211_MSG_RADKEYS,  /* dump 802.1x keys */
-	IEEE80211_MSG_RADDUMP,  /* dump 802.1x radius packets */
-	IEEE80211_MSG_RADIUS,   /* 802.1x radius client */
-	IEEE80211_MSG_DOT1XSM = 16,     /* 802.1x state machine */
-	IEEE80211_MSG_DOT1X,    /* 802.1x authenticator */
-	IEEE80211_MSG_POWER,    /* power save handling */
-	IEEE80211_MSG_STATE,    /* state machine */
-	IEEE80211_MSG_OUTPUT,   /* output handling */
-	IEEE80211_MSG_SCAN,     /* scanning */
-	IEEE80211_MSG_AUTH,     /* authentication handling */
-	IEEE80211_MSG_ASSOC,    /* association handling */
-	IEEE80211_MSG_NODE = 24,        /* node handling */
-	IEEE80211_MSG_ELEMID,   /* element id parsing */
-	IEEE80211_MSG_XRATE,    /* rate set handling */
-	IEEE80211_MSG_INPUT,    /* input handling */
-	IEEE80211_MSG_CRYPTO,   /* crypto work */
-	IEEE80211_MSG_DUMPPKTS, /* IFF_LINK2 equivalant */
-	IEEE80211_MSG_DEBUG,    /* IFF_DEBUG equivalent */
-	IEEE80211_MSG_MLME,     /* MLME */
-	/* IEEE80211_PARAM_DBG_LVL_HIGH */
-	IEEE80211_MSG_RRM = 32, /* Radio resource measurement */
-	IEEE80211_MSG_WNM,      /* Wireless Network Management */
-	IEEE80211_MSG_P2P_PROT, /* P2P Protocol driver */
-	IEEE80211_MSG_PROXYARP, /* 11v Proxy ARP */
-	IEEE80211_MSG_L2TIF,    /* Hotspot 2.0 L2 TIF */
-	IEEE80211_MSG_WIFIPOS,  /* WifiPositioning Feature */
-	IEEE80211_MSG_WRAP,     /* WRAP or Wireless ProxySTA */
-	IEEE80211_MSG_DFS,      /* DFS debug mesg */
-
-	IEEE80211_MSG_NUM_CATEGORIES,   /* total ieee80211 messages */
-	IEEE80211_MSG_UNMASKABLE = IEEE80211_MSG_MAX,   /* anything */
-	IEEE80211_MSG_ANY = IEEE80211_MSG_MAX,  /* anything */
-};
-
-/* verbosity levels */
-#define     IEEE80211_VERBOSE_OFF                  100
-#define     IEEE80211_VERBOSE_FORCE               1
-#define     IEEE80211_VERBOSE_SERIOUS             2
-#define     IEEE80211_VERBOSE_NORMAL              3
-#define     IEEE80211_VERBOSE_LOUD                4
-#define     IEEE80211_VERBOSE_DETAILED            5
-#define     IEEE80211_VERBOSE_COMPLEX             6
-#define     IEEE80211_VERBOSE_FUNCTION            7
-#define     IEEE80211_VERBOSE_TRACE               8
-
-#define IEEE80211_DEBUG_DEFAULT IEEE80211_MSG_DEBUG
-
-/*
- * the lower 4 bits of the msg flags are used for extending the
- * debug flags.
- */
-
-/*
- * flag defintions for wlan_mlme_stop_bss(vap) API.
- */
-#define WLAN_MLME_STOP_BSS_F_SEND_DEAUTH                0x01
-#define WLAN_MLME_STOP_BSS_F_CLEAR_ASSOC_STATE          0x02
-#define WLAN_MLME_STOP_BSS_F_FORCE_STOP_RESET           0x04
-#define WLAN_MLME_STOP_BSS_F_WAIT_RX_DONE               0x08
-#define WLAN_MLME_STOP_BSS_F_NO_RESET                   0x10
-#define WLAN_MLME_STOP_BSS_F_STANDBY                    0x20
-
-/*
- * WAPI commands to authenticator
- */
-#define WAPI_WAI_REQUEST            (uint16_t)0x00F1
-#define WAPI_UNICAST_REKEY          (uint16_t)0x00F2
-#define WAPI_STA_AGING              (uint16_t)0x00F3
-#define WAPI_MULTI_REKEY            (uint16_t)0x00F4
-#define WAPI_STA_STATS              (uint16_t)0x00F5
-
-/*
- * IEEE80211 PHY Statistics.
- */
-struct ieee80211_phy_stats {
-	uint64_t ips_tx_packets;        /* frames successfully transmitted */
-	uint64_t ips_tx_multicast;      /* multicast/broadcast frames successfully transmitted */
-	uint64_t ips_tx_fragments;      /* fragments successfully transmitted */
-	uint64_t ips_tx_xretries;       /* frames that are xretried. NB: not number of retries */
-	uint64_t ips_tx_retries;        /* frames transmitted after retries. NB: not number of retries */
-	uint64_t ips_tx_multiretries;   /* frames transmitted after more than one retry. */
-	uint64_t ips_tx_timeout;        /* frames that expire the dot11MaxTransmitMSDULifetime */
-	uint64_t ips_rx_packets;        /* frames successfully received */
-	uint64_t ips_rx_multicast;      /* multicast/broadcast frames successfully received */
-	uint64_t ips_rx_fragments;      /* fragments successfully received */
-	uint64_t ips_rx_timeout;        /* frmaes that expired the dot11MaxReceiveLifetime */
-	uint64_t ips_rx_dup;    /* duplicated fragments */
-	uint64_t ips_rx_mdup;   /* multiple duplicated fragments */
-	uint64_t ips_rx_promiscuous;    /* frames that are received only because promiscuous filter is on */
-	uint64_t ips_rx_promiscuous_fragments;  /* fragments that are received only because promiscuous filter is on */
-	uint64_t ips_tx_rts;    /* RTS success count */
-	uint64_t ips_tx_shortretry;     /* tx on-chip retries (short). RTSFailCnt */
-	uint64_t ips_tx_longretry;      /* tx on-chip retries (long). DataFailCnt */
-	uint64_t ips_rx_crcerr; /* rx failed 'cuz of bad CRC */
-	uint64_t ips_rx_fifoerr;        /* rx failed 'cuz of FIFO overrun */
-	uint64_t ips_rx_decrypterr;     /* rx decryption error */
-};
-
-struct ieee80211_chan_stats {
-	uint32_t chan_clr_cnt;
-	uint32_t cycle_cnt;
-	uint32_t phy_err_cnt;
-};
-
-struct ieee80211_mac_stats {
-	uint64_t ims_tx_packets;        /* frames successfully transmitted */
-	uint64_t ims_rx_packets;        /* frames successfully received */
-	uint64_t ims_tx_bytes;  /* bytes successfully transmitted */
-	uint64_t ims_rx_bytes;  /* bytes successfully received */
-
-	/* TODO: For the byte counts below, we need to handle some scenarios
-	   such as encryption related decaps, etc */
-	uint64_t ims_tx_data_packets;   /* data frames successfully transmitted */
-	uint64_t ims_rx_data_packets;   /* data frames successfully received */
-	uint64_t ims_tx_data_bytes;     /* data bytes successfully transmitted,
-	                                   inclusive of FCS. */
-	uint64_t ims_rx_data_bytes;     /* data bytes successfully received,
-	                                   inclusive of FCS. */
-
-	uint64_t ims_tx_datapyld_bytes; /* data payload bytes successfully
-	                                   transmitted */
-	uint64_t ims_rx_datapyld_bytes; /* data payload successfully
-	                                   received */
-
-	/* Decryption errors */
-	uint64_t ims_rx_unencrypted;    /* rx w/o wep and privacy on */
-	uint64_t ims_rx_badkeyid;       /* rx w/ incorrect keyid */
-	uint64_t ims_rx_decryptok;      /* rx decrypt okay */
-	uint64_t ims_rx_decryptcrc;     /* rx decrypt failed on crc */
-	uint64_t ims_rx_wepfail;        /* rx wep processing failed */
-	uint64_t ims_rx_tkipreplay;     /* rx seq# violation (TKIP) */
-	uint64_t ims_rx_tkipformat;     /* rx format bad (TKIP) */
-	uint64_t ims_rx_tkipmic;        /* rx MIC check failed (TKIP) */
-	uint64_t ims_rx_tkipicv;        /* rx ICV check failed (TKIP) */
-	uint64_t ims_rx_ccmpreplay;     /* rx seq# violation (CCMP) */
-	uint64_t ims_rx_ccmpformat;     /* rx format bad (CCMP) */
-	uint64_t ims_rx_ccmpmic;        /* rx MIC check failed (CCMP) */
-/*this file can be included by applications as 80211stats that has no such MACRO definition*/
-/* #if ATH_SUPPORT_WAPI */
-	uint64_t ims_rx_wpireplay;      /* rx seq# violation (WPI) */
-	uint64_t ims_rx_wpimic; /* rx MIC check failed (WPI) */
-/* #endif */
-	/* Other Tx/Rx errors */
-	uint64_t ims_tx_discard;        /* tx dropped by NIC */
-	uint64_t ims_rx_discard;        /* rx dropped by NIC */
-
-	uint64_t ims_rx_countermeasure; /* rx TKIP countermeasure activation count */
-};
-
-/*
- * Summary statistics.
- */
-struct ieee80211_stats {
-	uint32_t is_rx_badversion;      /* rx frame with bad version */
-	uint32_t is_rx_tooshort;        /* rx frame too short */
-	uint32_t is_rx_wrongbss;        /* rx from wrong bssid */
-	uint32_t is_rx_wrongdir;        /* rx w/ wrong direction */
-	uint32_t is_rx_mcastecho;       /* rx discard 'cuz mcast echo */
-	uint32_t is_rx_notassoc;        /* rx discard 'cuz sta !assoc */
-	uint32_t is_rx_noprivacy;       /* rx w/ wep but privacy off */
-	uint32_t is_rx_decap;   /* rx decapsulation failed */
-	uint32_t is_rx_mgtdiscard;      /* rx discard mgt frames */
-	uint32_t is_rx_ctl;     /* rx discard ctrl frames */
-	uint32_t is_rx_beacon;  /* rx beacon frames */
-	uint32_t is_rx_rstoobig;        /* rx rate set truncated */
-	uint32_t is_rx_elem_missing;    /* rx required element missing */
-	uint32_t is_rx_elem_toobig;     /* rx element too big */
-	uint32_t is_rx_elem_toosmall;   /* rx element too small */
-	uint32_t is_rx_elem_unknown;    /* rx element unknown */
-	uint32_t is_rx_badchan; /* rx frame w/ invalid chan */
-	uint32_t is_rx_chanmismatch;    /* rx frame chan mismatch */
-	uint32_t is_rx_nodealloc;       /* rx frame dropped */
-	uint32_t is_rx_ssidmismatch;    /* rx frame ssid mismatch  */
-	uint32_t is_rx_auth_unsupported;        /* rx w/ unsupported auth alg */
-	uint32_t is_rx_auth_fail;       /* rx sta auth failure */
-	uint32_t is_rx_auth_countermeasures;    /* rx auth discard 'cuz CM */
-	uint32_t is_rx_assoc_bss;       /* rx assoc from wrong bssid */
-	uint32_t is_rx_assoc_notauth;   /* rx assoc w/o auth */
-	uint32_t is_rx_assoc_capmismatch;       /* rx assoc w/ cap mismatch */
-	uint32_t is_rx_assoc_norate;    /* rx assoc w/ no rate match */
-	uint32_t is_rx_assoc_badwpaie;  /* rx assoc w/ bad WPA IE */
-	uint32_t is_rx_deauth;  /* rx deauthentication */
-	uint32_t is_rx_disassoc;        /* rx disassociation */
-	uint32_t is_rx_action;  /* rx action mgt */
-	uint32_t is_rx_badsubtype;      /* rx frame w/ unknown subtype */
-	uint32_t is_rx_nobuf;   /* rx failed for lack of buf */
-	uint32_t is_rx_ahdemo_mgt;      /* rx discard ahdemo mgt frame */
-	uint32_t is_rx_bad_auth;        /* rx bad auth request */
-	uint32_t is_rx_unauth;  /* rx on unauthorized port */
-	uint32_t is_rx_badcipher;       /* rx failed 'cuz key type */
-	uint32_t is_tx_nodefkey;        /* tx failed 'cuz no defkey */
-	uint32_t is_tx_noheadroom;      /* tx failed 'cuz no space */
-	uint32_t is_rx_nocipherctx;     /* rx failed 'cuz key !setup */
-	uint32_t is_rx_acl;     /* rx discard 'cuz acl policy */
-	uint32_t is_rx_ffcnt;   /* rx fast frames */
-	uint32_t is_rx_badathtnl;       /* driver key alloc failed */
-	uint32_t is_rx_nowds;   /* 4-addr packets received with no wds enabled */
-	uint32_t is_tx_nobuf;   /* tx failed for lack of buf */
-	uint32_t is_tx_nonode;  /* tx failed for no node */
-	uint32_t is_tx_unknownmgt;      /* tx of unknown mgt frame */
-	uint32_t is_tx_badcipher;       /* tx failed 'cuz key type */
-	uint32_t is_tx_ffokcnt; /* tx fast frames sent success */
-	uint32_t is_tx_fferrcnt;        /* tx fast frames sent success */
-	uint32_t is_scan_active;        /* active scans started */
-	uint32_t is_scan_passive;       /* passive scans started */
-	uint32_t is_node_timeout;       /* nodes timed out inactivity */
-	uint32_t is_crypto_nomem;       /* no memory for crypto ctx */
-	uint32_t is_crypto_tkip;        /* tkip crypto done in s/w */
-	uint32_t is_crypto_tkipenmic;   /* tkip en-MIC done in s/w */
-	uint32_t is_crypto_tkipdemic;   /* tkip de-MIC done in s/w */
-	uint32_t is_crypto_tkipcm;      /* tkip counter measures */
-	uint32_t is_crypto_ccmp;        /* ccmp crypto done in s/w */
-	uint32_t is_crypto_wep; /* wep crypto done in s/w */
-	uint32_t is_crypto_setkey_cipher;       /* cipher rejected key */
-	uint32_t is_crypto_setkey_nokey;        /* no key index for setkey */
-	uint32_t is_crypto_delkey;      /* driver key delete failed */
-	uint32_t is_crypto_badcipher;   /* unknown cipher */
-	uint32_t is_crypto_nocipher;    /* cipher not available */
-	uint32_t is_crypto_attachfail;  /* cipher attach failed */
-	uint32_t is_crypto_swfallback;  /* cipher fallback to s/w */
-	uint32_t is_crypto_keyfail;     /* driver key alloc failed */
-	uint32_t is_crypto_enmicfail;   /* en-MIC failed */
-	uint32_t is_ibss_capmismatch;   /* merge failed-cap mismatch */
-	uint32_t is_ibss_norate;        /* merge failed-rate mismatch */
-	uint32_t is_ps_unassoc; /* ps-poll for unassoc. sta */
-	uint32_t is_ps_badaid;  /* ps-poll w/ incorrect aid */
-	uint32_t is_ps_qempty;  /* ps-poll w/ nothing to send */
-};
-
-typedef enum _ieee80211_send_frame_type {
-	IEEE80211_SEND_NULL,
-	IEEE80211_SEND_QOSNULL,
-} ieee80211_send_frame_type;
-
-typedef struct _ieee80211_tspec_info {
-	uint8_t traffic_type;
-	uint8_t direction;
-	uint8_t dot1Dtag;
-	uint8_t tid;
-	uint8_t acc_policy_edca;
-	uint8_t acc_policy_hcca;
-	uint8_t aggregation;
-	uint8_t psb;
-	uint8_t ack_policy;
-	uint16_t norminal_msdu_size;
-	uint16_t max_msdu_size;
-	uint32_t min_srv_interval;
-	uint32_t max_srv_interval;
-	uint32_t inactivity_interval;
-	uint32_t suspension_interval;
-	uint32_t srv_start_time;
-	uint32_t min_data_rate;
-	uint32_t mean_data_rate;
-	uint32_t peak_data_rate;
-	uint32_t max_burst_size;
-	uint32_t delay_bound;
-	uint32_t min_phy_rate;
-	uint16_t surplus_bw;
-	uint16_t medium_time;
-} ieee80211_tspec_info;
-
-#ifndef EXTERNAL_USE_ONLY
-/*
- * Manual ADDBA support
- */
-enum {
-	ADDBA_SEND = 0,
-	ADDBA_STATUS = 1,
-	DELBA_SEND = 2,
-	ADDBA_RESP = 3,
-	ADDBA_CLR_RESP = 4,
-	SINGLE_AMSDU = 5,
-};
-
-enum {
-	ADDBA_MODE_AUTO = 0,
-	ADDBA_MODE_MANUAL = 1,
-};
-
-struct ieee80211_addba_delba_request {
-	wlan_dev_t ic;
-	uint8_t action;
-	uint8_t tid;
-	uint16_t status;
-	uint16_t aid;
-	uint32_t arg1;
-	uint32_t arg2;
-};
-#endif /* EXTERNAL_USE_ONLY */
-
-#ifdef ATH_BT_COEX
-typedef enum _ieee80211_bt_coex_info_type {
-	IEEE80211_BT_COEX_INFO_SCHEME = 0,
-	IEEE80211_BT_COEX_INFO_BTBUSY = 1,
-} ieee80211_bt_coex_info_type;
-#endif
-
-struct tkip_countermeasure {
-	uint16_t mic_count_in_60s;
-	uint32_t timestamp;
-};
-
-enum _ieee80211_qos_frame_direction {
-	IEEE80211_RX_QOS_FRAME = 0,
-	IEEE80211_TX_QOS_FRAME = 1,
-	IEEE80211_TX_COMPLETE_QOS_FRAME = 2
-};
-
-typedef struct ieee80211_vap_opmode_count {
-	int total_vaps;
-	int ibss_count;
-	int sta_count;
-	int wds_count;
-	int ahdemo_count;
-	int ap_count;
-	int monitor_count;
-	int btamp_count;
-	int unknown_count;
-} ieee80211_vap_opmode_count;
-
-struct ieee80211_app_ie_t {
-	uint32_t length;
-	uint8_t *ie;
-};
-
-/*
- * MAC ACL operations.
- */
-enum {
-	IEEE80211_MACCMD_POLICY_OPEN = 0,       /* set policy: no ACL's */
-	IEEE80211_MACCMD_POLICY_ALLOW = 1,      /* set policy: allow traffic */
-	IEEE80211_MACCMD_POLICY_DENY = 2,       /* set policy: deny traffic */
-	IEEE80211_MACCMD_FLUSH = 3,     /* flush ACL database */
-	IEEE80211_MACCMD_DETACH = 4,    /* detach ACL policy */
-	IEEE80211_MACCMD_POLICY_RADIUS = 5,     /* set policy: RADIUS managed ACLs */
-};
-
-#endif

+ 0 - 238
core/cds/inc/cds_if_upperproto.h

@@ -1,238 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/* #ifndef _NET_IF_ETHERSUBR_H_ */
-/* #define _NET_IF_ETHERSUBR_H_ */
-#ifndef _NET_IF_UPPERPROTO_H_
-#define _NET_IF_UPPERPROTO_H_
-
-#define ETHER_ADDR_LEN    6     /* length of an Ethernet address */
-#define ETHER_TYPE_LEN    2     /* length of the Ethernet type field */
-#define ETHER_CRC_LEN     4     /* length of the Ethernet CRC */
-#define ETHER_HDR_LEN     (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-#define ETHER_MAX_LEN     1518
-
-#define ETHERMTU          (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-#ifndef _NET_ETHERNET_H_
-struct ether_header {
-	uint8_t ether_dhost[ETHER_ADDR_LEN];
-	uint8_t ether_shost[ETHER_ADDR_LEN];
-	uint16_t ether_type;
-} __packed;
-#endif
-
-#ifndef ETHERTYPE_PAE
-#define ETHERTYPE_PAE    0x888e /* EAPOL PAE/802.1x */
-#endif
-#ifndef ETHERTYPE_IP
-#define ETHERTYPE_IP     0x0800 /* IP protocol */
-#endif
-#ifndef ETHERTYPE_AARP
-#define ETHERTYPE_AARP  0x80f3  /* Appletalk AARP protocol */
-#endif
-#ifndef ETHERTYPE_IPX
-#define ETHERTYPE_IPX    0x8137 /* IPX over DIX protocol */
-#endif
-#ifndef ETHERTYPE_ARP
-#define ETHERTYPE_ARP    0x0806 /* ARP protocol */
-#endif
-#ifndef ETHERTYPE_IPV6
-#define ETHERTYPE_IPV6   0x86dd /* IPv6 */
-#endif
-#ifndef ETHERTYPE_8021Q
-#define ETHERTYPE_8021Q 0x8100  /* 802.1Q vlan protocol */
-#endif
-#ifndef ETHERTYPE_VLAN
-#define ETHERTYPE_VLAN  0x8100  /* VLAN TAG protocol */
-#endif
-#ifndef TX_QUEUE_FOR_EAPOL_FRAME
-#define TX_QUEUE_FOR_EAPOL_FRAME  0x7   /* queue eapol frame to queue 7 to avoid aggregation disorder */
-#endif
-
-/*
- * define WAI ethertype
- */
-#ifndef ETHERTYPE_WAI
-#define ETHERTYPE_WAI    0x88b4 /* WAI/WAPI */
-#endif
-
-#define ETHERTYPE_OCB_TX   0x8151
-#define ETHERTYPE_OCB_RX   0x8152
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-#if 0
-#ifndef _NET_ETHERNET_H_
-struct ether_addr {
-	uint8_t octet[ETHER_ADDR_LEN];
-} __packed;
-#endif
-#endif
-
-#define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01)       /* is address mcast/bcast? */
-
-#define VLAN_PRI_SHIFT  13      /* Shift to find VLAN user priority */
-#define VLAN_PRI_MASK    7      /* Mask for user priority bits in VLAN */
-
-/*
- * Structure of the IP frame
- */
-struct ip_header {
-	uint8_t version_ihl;
-	uint8_t tos;
-	uint16_t tot_len;
-	uint16_t id;
-	uint16_t frag_off;
-	uint8_t ttl;
-	uint8_t protocol;
-	uint16_t check;
-	uint32_t saddr;
-	uint32_t daddr;
-	/*The options start here. */
-};
-#ifndef IP_PROTO_TCP
-#define IP_PROTO_TCP    0x6     /* TCP protocol */
-#endif
-#ifndef IP_PROTO_UDP
-#define IP_PROTO_UDP 17
-#endif
-
-/*
- *   IGMP protocol structures
- */
-
-/* IGMP record type */
-#define IGMP_QUERY_TYPE       0x11
-#define IGMPV1_REPORT_TYPE    0x12
-#define IGMPV2_REPORT_TYPE    0x16
-#define IGMPV2_LEAVE_TYPE     0x17
-#define IGMPV3_REPORT_TYPE    0x22
-
-/* Is packet type is either leave or report */
-#define IS_IGMP_REPORT_LEAVE_PACKET(type) ( \
-		(IGMPV1_REPORT_TYPE == type) \
-		|| (IGMPV2_REPORT_TYPE == type)	\
-		|| (IGMPV2_LEAVE_TYPE  == type)	\
-		|| (IGMPV3_REPORT_TYPE == type)	\
-		)
-/*
- *    Header in on cable format
- */
-
-struct igmp_header {
-	uint8_t type;
-	uint8_t code;           /* For newer IGMP */
-	uint16_t csum;
-	uint32_t group;
-};
-
-/* V3 group record types [grec_type] */
-#define IGMPV3_MODE_IS_INCLUDE        1
-#define IGMPV3_MODE_IS_EXCLUDE        2
-#define IGMPV3_CHANGE_TO_INCLUDE      3
-#define IGMPV3_CHANGE_TO_EXCLUDE      4
-#define IGMPV3_ALLOW_NEW_SOURCES      5
-#define IGMPV3_BLOCK_OLD_SOURCES      6
-
-/*  Group record format
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |  Record Type  |  Aux Data Len |     Number of Sources (N)     |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |                       Multicast Address                       |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |                       Source Address [1]                      |
- ||+-                                                             -+
- |                       Source Address [2]                      |
- ||+-                                                             -+
-      .                               .                               .
-      .                               .                               .
-      .                               .                               .
- ||+-                                                             -+
- |                       Source Address [N]                      |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |                                                               |
-      .                                                               .
-      .                         Auxiliary Data                        .
-      .                                                               .
- |                                                               |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-struct igmp_v3_grec {
-	uint8_t grec_type;
-	uint8_t grec_auxwords;
-	uint16_t grec_nsrcs;
-	uint32_t grec_mca;
-};
-
-/* IGMPv3 report format
-       0                   1                   2                   3
-       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |  Type = 0x22  |    Reserved   |           Checksum            |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |           Reserved            |  Number of Group Records (M)  |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |                                                               |
-      .                                                               .
-      .                        Group Record [1]                       .
-      .                                                               .
- |                                                               |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |                                                               |
-      .                                                               .
-      .                        Group Record [2]                       .
-      .                                                               .
- |                                                               |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |                               .                               |
-      .                               .                               .
- |                               .                               |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |                                                               |
-      .                                                               .
-      .                        Group Record [M]                       .
-      .                                                               .
- |                                                               |
- ||+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- */
-struct igmp_v3_report {
-	uint8_t type;
-	uint8_t resv1;
-	uint16_t csum;
-	uint16_t resv2;
-	uint16_t ngrec;
-};
-
-/* Calculate the group record length*/
-#define IGMPV3_GRP_REC_LEN(x) (8 + (4 * x->grec_nsrcs) + (4 * x->grec_auxwords) )
-
-#endif /* _NET_IF_ETHERSUBR_H_ */

+ 0 - 165
core/cds/inc/cds_mq.h

@@ -1,165 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined( __CDS_MQ_H )
-#define __CDS_MQ_H
-
-/**=========================================================================
-
-   \file  cds_mq.h
-
-   \brief virtual Operating System Services (CDF) message queue APIs
-
-   Message Queue Definitions and API
-
-   ========================================================================*/
-
-/*--------------------------------------------------------------------------
-   Include Files
-   ------------------------------------------------------------------------*/
-#include <cdf_types.h>
-#include <cdf_status.h>
-
-/*--------------------------------------------------------------------------
-   Preprocessor definitions and constants
-   ------------------------------------------------------------------------*/
-
-/*--------------------------------------------------------------------------
-   Type declarations
-   ------------------------------------------------------------------------*/
-
-/* cds Message Type.
-   This represnets a message that can be posted to another module through
-   the cds Message Queues.
-   \note This is mapped directly to the tSirMsgQ for backward
-   compatibility with the legacy MAC code */
-
-typedef struct cds_msg_s {
-	uint16_t type;
-	/*
-	 * This field can be used as sequence number/dialog token for matching
-	 * requests and responses.
-	 */
-	uint16_t reserved;
-	/**
-	 * Based on the type either a bodyptr pointer into
-	 * memory or bodyval as a 32 bit data is used.
-	 * bodyptr: is always a freeable pointer, one should always
-	 * make sure that bodyptr is always freeable.
-	 *
-	 * Messages should use either bodyptr or bodyval; not both !!!.
-	 */
-	void *bodyptr;
-
-	uint32_t bodyval;
-
-	/*
-	 * Some messages provide a callback function.  The function signature
-	 * must be agreed upon between the two entities exchanging the message
-	 */
-	void *callback;
-
-} cds_msg_t;
-
-/*-------------------------------------------------------------------------
-   Function declarations and documenation
-   ------------------------------------------------------------------------*/
-
-/* Message Queue IDs */
-typedef enum {
-	/* Message Queue ID for messages bound for SME */
-	CDS_MQ_ID_SME = CDF_MODULE_ID_SME,
-
-	/* Message Queue ID for messages bound for PE */
-	CDS_MQ_ID_PE = CDF_MODULE_ID_PE,
-
-	/* Message Queue ID for messages bound for WMA */
-	CDS_MQ_ID_WMA = CDF_MODULE_ID_WMA,
-
-	/* Message Queue ID for messages bound for the SYS module */
-	CDS_MQ_ID_SYS = CDF_MODULE_ID_SYS,
-
-} CDS_MQ_ID;
-
-/**---------------------------------------------------------------------------
-
-   \brief cds_mq_post_message() - post a message to a message queue
-
-   This API allows messages to be posted to a specific message queue.  Messages
-   can be posted to the following message queues:
-
-   <ul>
-    <li> SME
-    <li> PE
-    <li> HAL
-    <li> TL
-   </ul>
-
-   \param msgQueueId - identifies the message queue upon which the message
-         will be posted.
-
-   \param message - a pointer to a message buffer.  Memory for this message
-         buffer is allocated by the caller and free'd by the CDF after the
-         message is posted to the message queue.  If the consumer of the
-         message needs anything in this message, it needs to copy the contents
-         before returning from the message queue handler.
-
-   \return CDF_STATUS_SUCCESS - the message has been successfully posted
-          to the message queue.
-
-          CDF_STATUS_E_INVAL - The value specified by msgQueueId does not
-          refer to a valid Message Queue Id.
-
-          CDF_STATUS_E_FAULT  - message is an invalid pointer.
-
-          CDF_STATUS_E_FAILURE - the message queue handler has reported
-          an unknown failure.
-
-   \sa
-
-   --------------------------------------------------------------------------*/
-CDF_STATUS cds_mq_post_message(CDS_MQ_ID msgQueueId, cds_msg_t *message);
-
-/**---------------------------------------------------------------------------
-
-   \brief cds_send_mb_message_to_mac() - post a message to a message queue
-
-   \param pBuf is a buffer allocated by caller. The actual structure varies
-         base on message type
-
-   \return CDF_STATUS_SUCCESS - the message has been successfully posted
-          to the message queue.
-
-          CDF_STATUS_E_FAILURE - the message queue handler has reported
-          an unknown failure.
-
-   \sa
-   --------------------------------------------------------------------------*/
-
-CDF_STATUS cds_send_mb_message_to_mac(void *pBuf);
-
-#endif /* if !defined __CDS_MQ_H */

+ 0 - 111
core/cds/inc/cds_pack_align.h

@@ -1,111 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined( __CDS_PACK_ALIGN_H )
-#define __CDS_PACK_ALIGN_H
-
-/**=========================================================================
-
-   \file  cds_pack_align.h
-
-   \brief Connectivity driver services (CDS) pack and align primitives
-
-   Definitions for platform independent means of packing and aligning
-   data structures
-
-   ========================================================================*/
-
-/*
-
-   Place the macro CDS_PACK_START above a structure declaration to pack. We
-   are not going to allow modifying the pack size because pack size cannot be
-   specified in AMSS and GNU. Place the macro CDS_PACK_END below a structure
-   declaration to stop the pack. This requirement is necessitated by Windows
-   which need pragma based prolog and epilog.
-
-   Pack-size > 1-byte is not supported since gcc and arm do not support that.
-
-   Here are some examples
-
-   1. Pack-size 1-byte foo_t across all platforms
-
-   CDS_PACK_START
-   typedef CDS_PACK_PRE struct foo_s { ... } CDS_PACK_POST foo_t;
-   CDS_PACK_END
-
-   2. 2-byte alignment for foo_t across all platforms
-
-   typedef CDS_ALIGN_PRE(2) struct foo_s { ... } CDS_ALIGN_POST(2) foo_t;
-
-   3. Pack-size 1-byte and 2-byte alignment for foo_t across all platforms
-
-   CDS_PACK_START
-   typedef CDS_PACK_PRE CDS_ALIGN_PRE(2) struct foo_s { ... } CDS_ALIGN_POST(2) CDS_PACK_POST foo_t;
-   CDS_PACK_END
-
- */
-
-#if defined __GNUC__
-
-#define CDS_PACK_START
-#define CDS_PACK_END
-
-#define CDS_PACK_PRE
-#define CDS_PACK_POST  __attribute__((__packed__))
-
-#define CDS_ALIGN_PRE(__value)
-#define CDS_ALIGN_POST(__value)  __attribute__((__aligned__(__value)))
-
-#elif defined __arm
-
-#define CDS_PACK_START
-#define CDS_PACK_END
-
-#define CDS_PACK_PRE  __packed
-#define CDS_PACK_POST
-
-#define CDS_ALIGN_PRE(__value)  __align(__value)
-#define CDS_ALIGN_POST(__value)
-
-#elif defined _MSC_VER
-
-#define CDS_PACK_START  __pragma(pack(push,1))
-#define CDS_PACK_END  __pragma(pack(pop))
-
-#define CDS_PACK_PRE
-#define CDS_PACK_POST
-
-#define CDS_ALIGN_PRE(__value)  __declspec(align(__value))
-#define CDS_ALIGN_POST(__value)
-
-#else
-
-#error Unsupported compiler!!!
-
-#endif
-
-#endif /* __CDS_PACK_ALIGN_H */

+ 0 - 188
core/cds/inc/cds_packet.h

@@ -1,188 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined( __CDS_PKT_H )
-#define __CDS_PKT_H
-
-/**=========================================================================
-
-   \file        cds_packet.h
-
-   \brief       Connectivity driver services (CDS) network Packet APIs
-
-   Network Protocol packet/buffer support interfaces
-
-   ========================================================================*/
-
-/*--------------------------------------------------------------------------
-   Include Files
-   ------------------------------------------------------------------------*/
-#include <cdf_types.h>
-#include <cdf_status.h>
-
-/*--------------------------------------------------------------------------
-   Preprocessor definitions and constants
-   ------------------------------------------------------------------------*/
-
-/*--------------------------------------------------------------------------
-   Type declarations
-   ------------------------------------------------------------------------*/
-struct cds_pkt_t;
-typedef struct cds_pkt_t cds_pkt_t;
-
-#include "cdf_nbuf.h"
-
-#define CDS_PKT_TRAC_TYPE_EAPOL   NBUF_PKT_TRAC_TYPE_EAPOL
-#define CDS_PKT_TRAC_TYPE_DHCP    NBUF_PKT_TRAC_TYPE_DHCP
-#define CDS_PKT_TRAC_TYPE_MGMT_ACTION    NBUF_PKT_TRAC_TYPE_MGMT_ACTION /* Managment action frame */
-
-#define CDS_PKT_TRAC_DUMP_CMD     9999
-
-/*---------------------------------------------------------------------------
-
-* brief cds_pkt_get_proto_type() -
-      Find protoco type from packet contents
-
-* skb Packet Pointer
-* tracking_map packet type want to track
-* dot11_type, frame type when the frame is in dot11 format
-
-   ---------------------------------------------------------------------------*/
-uint8_t cds_pkt_get_proto_type
-	(struct sk_buff *skb, uint8_t tracking_map, uint8_t dot11_type);
-
-#ifdef QCA_PKT_PROTO_TRACE
-/*---------------------------------------------------------------------------
-
-* brief cds_pkt_trace_buf_update() -
-      Update storage buffer with interest event string
-
-* event_string Event String may packet type or outstanding event
-
-   ---------------------------------------------------------------------------*/
-void cds_pkt_trace_buf_update(char *event_string);
-
-/*---------------------------------------------------------------------------
-
-* brief cds_pkt_trace_buf_dump() -
-      Dump stored information into kernel log
-
-   ---------------------------------------------------------------------------*/
-void cds_pkt_trace_buf_dump(void);
-
-/*---------------------------------------------------------------------------
-
-* brief cds_pkt_proto_trace_init() -
-      Initialize protocol trace functionality, allocate required resource
-
-   ---------------------------------------------------------------------------*/
-void cds_pkt_proto_trace_init(void);
-
-/*---------------------------------------------------------------------------
-
-* brief cds_pkt_proto_trace_close() -
-      Free required resource
-
-   ---------------------------------------------------------------------------*/
-void cds_pkt_proto_trace_close(void);
-#else
-static inline void cds_pkt_proto_trace_init(void) { }
-static inline void cds_pkt_proto_trace_close(void) {}
-#endif /* QCA_PKT_PROTO_TRACE */
-
-/**
- * cds_pkt_return_packet  Free the cds Packet
- * @ cds Packet
- */
-CDF_STATUS cds_pkt_return_packet(cds_pkt_t *packet);
-
-/**
- * cds_pkt_get_packet_length  Returns the packet length
- * @ cds Packet
- */
-CDF_STATUS cds_pkt_get_packet_length(cds_pkt_t *pPacket,
-				     uint16_t *pPacketSize);
-
-/*
- * TODO: Remove later
- * All the below difinitions are not
- * required for Host Driver 2.0
- * once corresponding references are removed
- * from HDD and other layers
- * below code will be removed
- */
-/* The size of AMSDU frame per spec can be a max of 3839 bytes
-   in BD/PDUs that means 30 (one BD = 128 bytes)
-   we must add the size of the 802.11 header to that */
-#define CDS_PKT_SIZE_BUFFER  ((30 * 128) + 32)
-
-/* cds Packet Types */
-typedef enum {
-	/* cds Packet is used to transmit 802.11 Management frames. */
-	CDS_PKT_TYPE_TX_802_11_MGMT,
-
-	/* cds Packet is used to transmit 802.11 Data frames. */
-	CDS_PKT_TYPE_TX_802_11_DATA,
-
-	/* cds Packet is used to transmit 802.3 Data frames. */
-	CDS_PKT_TYPE_TX_802_3_DATA,
-
-	/* cds Packet contains Received data of an unknown frame type */
-	CDS_PKT_TYPE_RX_RAW,
-
-	/* Invalid sentinel value */
-	CDS_PKT_TYPE_MAXIMUM
-} CDS_PKT_TYPE;
-
-/* user IDs.   These IDs are needed on the cds_pkt_get/set_user_data_ptr()
-   to identify the user area in the cds Packet. */
-typedef enum {
-	CDS_PKT_USER_DATA_ID_TL = 0,
-	CDS_PKT_USER_DATA_ID_BAL,
-	CDS_PKT_USER_DATA_ID_WMA,
-	CDS_PKT_USER_DATA_ID_HDD,
-	CDS_PKT_USER_DATA_ID_BSL,
-
-	CDS_PKT_USER_DATA_ID_MAX
-} CDS_PKT_USER_DATA_ID;
-
-#ifdef MEMORY_DEBUG
-#define cds_packet_alloc(s, d, p)	\
-	cds_packet_alloc_debug(s, d, p, __FILE__, __LINE__)
-
-CDF_STATUS cds_packet_alloc_debug(uint16_t size, void **data, void **ppPacket,
-				  uint8_t *file_name, uint32_t line_num);
-#else
-CDF_STATUS cds_packet_alloc(uint16_t size, void **data, void **ppPacket);
-#endif
-
-void cds_packet_free(void *pPacket);
-
-typedef CDF_STATUS (*cds_pkt_get_packet_callback)(cds_pkt_t *pPacket,
-						  void *userData);
-
-#endif /* !defined( __CDS_PKT_H ) */

+ 0 - 33
core/cds/inc/cds_queue.h

@@ -1,33 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _CDS_QUEUE_H
-#define _CDS_QUEUE_H
-
-#include <queue.h> /* include BSD queue */
-
-#endif /* end of _CDS_QUEUE_H */

+ 0 - 346
core/cds/inc/cds_reg_service.h

@@ -1,346 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined __CDS_REG_SERVICE_H
-#define __CDS_REG_SERVICE_H
-
-/**=========================================================================
-
-   \file  cds_reg_service.h
-
-   \brief Connectivity driver services (CDS): Non-Volatile storage API
-
-   ========================================================================*/
-
-#include "cdf_status.h"
-
-#define CDS_COUNTRY_CODE_LEN  2
-#define CDS_MAC_ADDRESS_LEN 6
-
-#define CDS_CHANNEL_STATE(chan_enum) reg_channels[chan_enum].state
-#define CDS_CHANNEL_NUM(chan_enum) chan_mapping[chan_enum].chan_num
-#define CDS_CHANNEL_FREQ(chan_enum) chan_mapping[chan_enum].center_freq
-#define CDS_IS_DFS_CH(chan_num) (cds_get_channel_state((chan_num)) == \
-				CHANNEL_STATE_DFS)
-
-#define CDS_IS_PASSIVE_OR_DISABLE_CH(chan_num) \
-	(cds_get_channel_state(chan_num) != CHANNEL_STATE_ENABLE)
-
-#define CDS_MIN_24GHZ_CHANNEL_NUMBER chan_mapping[MIN_24GHZ_CHANNEL].chan_num
-#define CDS_MAX_24GHZ_CHANNEL_NUMBER chan_mapping[MAX_24GHZ_CHANNEL].chan_num
-#define CDS_MIN_5GHZ_CHANNEL_NUMBER chan_mapping[MIN_5GHZ_CHANNEL].chan_num
-#define CDS_MAX_5GHZ_CHANNEL_NUMBER chan_mapping[MAX_5GHZ_CHANNEL].chan_num
-
-#define CDS_IS_CHANNEL_5GHZ(chan_num) \
-	((chan_num >= CDS_MIN_5GHZ_CHANNEL_NUMBER) && \
-	 (chan_num <= CDS_MAX_5GHZ_CHANNEL_NUMBER))
-
-#define CDS_IS_CHANNEL_24GHZ(chan_num) \
-	((chan_num >= CDS_MIN_24GHZ_CHANNEL_NUMBER) && \
-	 (chan_num <= CDS_MAX_24GHZ_CHANNEL_NUMBER))
-
-#define CDS_IS_SAME_BAND_CHANNELS(chan_num1, chan_num2) \
-	(chan_num1 && chan_num2 && \
-	(CDS_IS_CHANNEL_5GHZ(chan_num1) == CDS_IS_CHANNEL_5GHZ(chan_num2)))
-
-#define CDS_MIN_11P_CHANNEL chan_mapping[MIN_59GHZ_CHANNEL].chan_num
-
-typedef enum {
-	REGDOMAIN_FCC,
-	REGDOMAIN_ETSI,
-	REGDOMAIN_JAPAN,
-	REGDOMAIN_WORLD,
-	REGDOMAIN_COUNT
-} v_REGDOMAIN_t;
-
-enum channel_enum {
-	RF_CHAN_1 = 0,
-	RF_CHAN_2,
-	RF_CHAN_3,
-	RF_CHAN_4,
-	RF_CHAN_5,
-	RF_CHAN_6,
-	RF_CHAN_7,
-	RF_CHAN_8,
-	RF_CHAN_9,
-	RF_CHAN_10,
-	RF_CHAN_11,
-	RF_CHAN_12,
-	RF_CHAN_13,
-	RF_CHAN_14,
-
-	RF_CHAN_36,
-	RF_CHAN_40,
-	RF_CHAN_44,
-	RF_CHAN_48,
-	RF_CHAN_52,
-	RF_CHAN_56,
-	RF_CHAN_60,
-	RF_CHAN_64,
-
-	RF_CHAN_100,
-	RF_CHAN_104,
-	RF_CHAN_108,
-	RF_CHAN_112,
-	RF_CHAN_116,
-	RF_CHAN_120,
-	RF_CHAN_124,
-	RF_CHAN_128,
-	RF_CHAN_132,
-	RF_CHAN_136,
-	RF_CHAN_140,
-	RF_CHAN_144,
-
-	RF_CHAN_149,
-	RF_CHAN_153,
-	RF_CHAN_157,
-	RF_CHAN_161,
-	RF_CHAN_165,
-
-	RF_CHAN_170,
-	RF_CHAN_171,
-	RF_CHAN_172,
-	RF_CHAN_173,
-	RF_CHAN_174,
-	RF_CHAN_175,
-	RF_CHAN_176,
-	RF_CHAN_177,
-	RF_CHAN_178,
-	RF_CHAN_179,
-	RF_CHAN_180,
-	RF_CHAN_181,
-	RF_CHAN_182,
-	RF_CHAN_183,
-	RF_CHAN_184,
-
-	/* CHANNEL BONDED CHANNELS */
-	RF_CHAN_BOND_3,
-	RF_CHAN_BOND_4,
-	RF_CHAN_BOND_5,
-	RF_CHAN_BOND_6,
-	RF_CHAN_BOND_7,
-	RF_CHAN_BOND_8,
-	RF_CHAN_BOND_9,
-	RF_CHAN_BOND_10,
-	RF_CHAN_BOND_11,
-	RF_CHAN_BOND_38,
-	RF_CHAN_BOND_42,
-	RF_CHAN_BOND_46,
-	RF_CHAN_BOND_50,
-	RF_CHAN_BOND_54,
-	RF_CHAN_BOND_58,
-	RF_CHAN_BOND_62,
-	RF_CHAN_BOND_102,
-	RF_CHAN_BOND_106,
-	RF_CHAN_BOND_110,
-	RF_CHAN_BOND_114,
-	RF_CHAN_BOND_118,
-	RF_CHAN_BOND_122,
-	RF_CHAN_BOND_126,
-	RF_CHAN_BOND_130,
-	RF_CHAN_BOND_134,
-	RF_CHAN_BOND_138,
-	RF_CHAN_BOND_142,
-	RF_CHAN_BOND_151,
-	RF_CHAN_BOND_155,
-	RF_CHAN_BOND_159,
-	RF_CHAN_BOND_163,
-
-	NUM_RF_CHANNELS,
-
-	MIN_24GHZ_CHANNEL = RF_CHAN_1,
-	MAX_24GHZ_CHANNEL = RF_CHAN_14,
-	NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1),
-
-	MIN_5GHZ_CHANNEL = RF_CHAN_36,
-	MAX_5GHZ_CHANNEL = RF_CHAN_184,
-	NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1),
-
-	MIN_20MHZ_RF_CHANNEL = RF_CHAN_1,
-	MAX_20MHZ_RF_CHANNEL = RF_CHAN_184,
-	NUM_20MHZ_RF_CHANNELS =
-		(MAX_20MHZ_RF_CHANNEL - MIN_20MHZ_RF_CHANNEL + 1),
-
-	MIN_40MHZ_RF_CHANNEL = RF_CHAN_BOND_3,
-	MAX_40MHZ_RF_CHANNEL = RF_CHAN_BOND_163,
-	NUM_40MHZ_RF_CHANNELS =
-		(MAX_40MHZ_RF_CHANNEL - MIN_40MHZ_RF_CHANNEL + 1),
-
-	MIN_59GHZ_CHANNEL = RF_CHAN_170,
-	MAX_59GHZ_CHANNEL = RF_CHAN_184,
-
-	INVALID_RF_CHANNEL = 0xBAD,
-	RF_CHANNEL_INVALID_MAX_FIELD = 0x7FFFFFFF
-};
-
-/**
- * enum channel_state: channel state
- *
- * @CHANNEL_STATE_DISABLE: channel disabled
- * @CHANNEL_STATE_ENABLE: tx/rx enabled
- * @CHANNEL_STATE_DFS: rx enabled, tx DFS
- * @CHANNEL_STATE_INVALID: not a valid channel
- */
-enum channel_state {
-	CHANNEL_STATE_DISABLE,
-	CHANNEL_STATE_ENABLE,
-	CHANNEL_STATE_DFS,
-	CHANNEL_STATE_INVALID
-};
-
-/**
- * struct regulatory_channel: regulatory channel
- *
- * @state: channel state
- * @flags: channel flags
- * @pwr_limit: channel tx power limit
- */
-struct regulatory_channel {
-	uint32_t state:4;
-	uint32_t flags:28;
-	int8_t pwr_limit;
-};
-
-/**
- * struct chan_map: channel mapping
- *
- * @center_freq: channel center freq
- * @chan_num: channel number
- */
-struct chan_map {
-	uint16_t center_freq;
-	uint16_t chan_num;
-};
-
-/**
- * struct channel_power: channel power
- *
- * @chan_num: channel number
- * @power: tx power
- */
-struct channel_power {
-	uint8_t chan_num;
-	int8_t power;
-};
-
-/**
- * enum country_src: country source
- *
- * @SOURCE_QUERY: source query
- * @SOURCE_CORE: source regulatory core
- * @SOURCE_DRIVER: source driver
- * @SOURCE_USERSPACE: source userspace
- * @SOURCE_11D: source 11D
- */
-enum country_src {
-	SOURCE_QUERY,
-	SOURCE_CORE,
-	SOURCE_DRIVER,
-	SOURCE_USERSPACE,
-	SOURCE_11D
-};
-
-/**
- * struct regulatory: regulatory information
- *
- * @reg_domain: regulatory domain pair
- * @eeprom_rd_ext: eeprom value
- * @country_code: current country in integer
- * @alpha2: current alpha2
- * @def_country: default country alpha2
- * @def_region: DFS region
- * @ctl_2g: 2G CTL value
- * @ctl_5g: 5G CTL value
- * @reg_pair: pointer to regulatory pair
- * @cc_src: country code src
- * @reg_flags: kernel regulatory flags
- */
-struct regulatory {
-	uint32_t reg_domain;
-	uint32_t eeprom_rd_ext;
-	uint16_t country_code;
-	uint8_t alpha2[CDS_COUNTRY_CODE_LEN + 1];
-	uint8_t def_country[CDS_COUNTRY_CODE_LEN + 1];
-	uint8_t dfs_region;
-	uint8_t ctl_2g;
-	uint8_t ctl_5g;
-	const void *regpair;
-	enum country_src cc_src;
-	uint32_t reg_flags;
-};
-
-/**
- * enum chan_width: channel width
- *
- * @CHAN_WIDTH_0MHZ: channel disabled or invalid
- * @CHAN_WIDTH_5MHZ: channel width 5 MHZ
- * @CHAN_WIDTH_10MHZ: channel width 10 MHZ
- * @CHAN_WIDTH_20MHZ: channel width 20 MHZ
- * @CHAN_WIDTH_40MHZ: channel width 40 MHZ
- * @CHAN_WIDTH_80MHZ: channel width 80MHZ
- * @CHAN_WIDTH_160MHZ: channel width 160 MHZ
- */
-enum channel_width {
-	CHAN_WIDTH_0MHZ,
-	CHAN_WIDTH_5MHZ,
-	CHAN_WIDTH_10MHZ,
-	CHAN_WIDTH_20MHZ,
-	CHAN_WIDTH_40MHZ,
-	CHAN_WIDTH_80MHZ,
-	CHAN_WIDTH_160MHZ
-};
-
-
-extern struct regulatory_channel reg_channels[NUM_RF_CHANNELS];
-extern const struct chan_map chan_mapping[NUM_RF_CHANNELS];
-
-CDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *pRegDomain,
-						const uint8_t *country_alpha2,
-						enum country_src source);
-
-CDF_STATUS cds_read_default_country(uint8_t *default_country);
-
-CDF_STATUS cds_get_channel_list_with_power(struct channel_power
-					   *base_channels,
-					   uint8_t *num_base_channels,
-					   struct channel_power
-					   *channel_40mhz,
-					   uint8_t *num_channels_40mhz);
-
-CDF_STATUS cds_set_reg_domain(void *client_ctxt, v_REGDOMAIN_t reg_domain);
-
-enum channel_state cds_get_channel_state(uint32_t chan_num);
-
-CDF_STATUS cds_regulatory_init(void);
-CDF_STATUS cds_get_dfs_region(uint8_t *dfs_region);
-CDF_STATUS cds_set_dfs_region(uint8_t dfs_region);
-bool cds_is_dsrc_channel(uint16_t);
-enum channel_state cds_get_bonded_channel_state(uint32_t chan_num,
-					   enum channel_width chan_width);
-enum channel_width cds_get_max_channel_bw(uint32_t chan_num);
-
-#endif /* __CDS_REG_SERVICE_H */

+ 0 - 1082
core/cds/inc/cds_regdomain.h

@@ -1,1082 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/*
- * Notifications and licenses are retained for attribution purposes only.
- */
-/*
- * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
- * Copyright (c) 2005-2006 Atheros Communications, Inc.
- * Copyright (c) 2010, Atheros Communications Inc.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the following conditions are met:
- * 1. The materials contained herein are unmodified and are used
- *    unmodified.
- * 2. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following NO
- *    ''WARRANTY'' disclaimer below (''Disclaimer''), without
- *    modification.
- * 3. Redistributions in binary form must reproduce at minimum a
- *    disclaimer similar to the Disclaimer below and any redistribution
- *    must be conditioned upon including a substantially similar
- *    Disclaimer requirement for further binary redistribution.
- * 4. Neither the names of the above-listed copyright holders nor the
- *    names of any contributors may be used to endorse or promote
- *    product derived from this software without specific prior written
- *    permission.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT,
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
- * FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGES.
- *
- * This module contains the regulatory domain private structure definitions .
- *
- */
-
-#ifndef REGULATORY_H
-#define REGULATORY_H
-
-enum {
-	CTRY_DEBUG = 0x1ff,     /* debug country code */
-	CTRY_DEFAULT = 0        /* default country code */
-};
-
-#define BMLEN 2                 /* Use 2 64 bit uint for channel bitmask */
-
-/*
- * The following table is the master list for all different freqeuncy
- * bands with the complete matrix of all possible flags and settings
- * for each band if it is used in ANY reg domain.
- */
-
-#define DEF_REGDMN              FCC3_FCCA
-#define    DEF_DMN_5            FCC1
-#define    DEF_DMN_2            FCCA
-#define    COUNTRY_ERD_FLAG     0x8000
-#define WORLDWIDE_ROAMING_FLAG  0x4000
-#define    SUPER_DOMAIN_MASK    0x0fff
-#define    COUNTRY_CODE_MASK    0x3fff
-#define CF_INTERFERENCE         (CHANNEL_CW_INT | CHANNEL_RADAR_INT)
-
-/*
- * The following describe the bit masks for different passive scan
- * capability/requirements per regdomain.
- */
-#define NO_PSCAN    0x0ULL
-#define PSCAN_FCC   0x0000000000000001ULL
-#define PSCAN_FCC_T 0x0000000000000002ULL
-#define PSCAN_ETSI  0x0000000000000004ULL
-#define PSCAN_MKK1  0x0000000000000008ULL
-#define PSCAN_MKK2  0x0000000000000010ULL
-#define PSCAN_MKKA  0x0000000000000020ULL
-#define PSCAN_MKKA_G    0x0000000000000040ULL
-#define PSCAN_ETSIA 0x0000000000000080ULL
-#define PSCAN_ETSIB 0x0000000000000100ULL
-#define PSCAN_ETSIC 0x0000000000000200ULL
-#define PSCAN_WWR   0x0000000000000400ULL
-#define PSCAN_MKKA1 0x0000000000000800ULL
-#define PSCAN_MKKA1_G   0x0000000000001000ULL
-#define PSCAN_MKKA2 0x0000000000002000ULL
-#define PSCAN_MKKA2_G   0x0000000000004000ULL
-#define PSCAN_MKK3  0x0000000000008000ULL
-#define PSCAN_EXT_CHAN  0x0000000000010000ULL
-#define PSCAN_DEFER 0x7FFFFFFFFFFFFFFFULL
-#define IS_ECM_CHAN 0x8000000000000000ULL
-
-/* define in ah_eeprom.h */
-#define SD_NO_CTL       0xf0
-#define NO_CTL          0xff
-#define CTL_MODE_M      0x0f
-#define CTL_11A         0
-#define CTL_11B         1
-#define CTL_11G         2
-#define CTL_TURBO       3
-#define CTL_108G        4
-#define CTL_2GHT20      5
-#define CTL_5GHT20      6
-#define CTL_2GHT40      7
-#define CTL_5GHT40      8
-#define CTL_5GVHT80     9
-
-#ifndef ATH_NO_5G_SUPPORT
-#define REGDMN_MODE_11A_TURBO    REGDMN_MODE_108A
-#define CHAN_11A_BMZERO BMZERO,
-#define CHAN_11A_BM(_a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l) \
-	BM(_a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l),
-#else
-/* remove 11a channel info if 11a is not supported */
-#define CHAN_11A_BMZERO
-#define CHAN_11A_BM(_a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l)
-#endif
-#ifndef ATH_REMOVE_2G_TURBO_RD_TABLE
-#define REGDMN_MODE_11G_TURBO    REGDMN_MODE_108G
-#define CHAN_TURBO_G_BMZERO BMZERO,
-#define CHAN_TURBO_G_BM(_a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l)	\
-	BM(_a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l),
-#else
-/* remove turbo-g channel info if turbo-g is not supported */
-#define CHAN_TURBO_G(a, b)
-#define CHAN_TURBO_G_BMZERO
-#define CHAN_TURBO_G_BM(_a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l)
-#endif
-
-#define BMLEN 2                 /* Use 2 64 bit uint for channel bitmask
-	                           NB: Must agree with macro below (BM) */
-#define BMZERO {(uint64_t) 0, (uint64_t) 0} /* BMLEN zeros */
-
-#ifndef SUPPRESS_SHIFT_WARNING
-#define SUPPRESS_SHIFT_WARNING
-#endif
-
-/* Suppress MS warning "C4293: 'operator' : shift count negative or too big,
- * undefined behavior"
- * This is safe below because the the operand is properly range-checked, but
- * the compiler can't reason that out before it spits the warning.
- * Using suppress, so the warning can still be enabled globally to catch other
- * incorrect uses.
- */
-#define BM(_fa, _fb, _fc, _fd, _fe, _ff, _fg, _fh, _fi, _fj, _fk, _fl) \
-	SUPPRESS_SHIFT_WARNING \
-	{((((_fa >= 0) && (_fa < 64)) ? (((uint64_t) 1) << _fa) : (uint64_t) 0) | \
-	  (((_fb >= 0) && (_fb < 64)) ? (((uint64_t) 1) << _fb) : (uint64_t) 0) | \
-	  (((_fc >= 0) && (_fc < 64)) ? (((uint64_t) 1) << _fc) : (uint64_t) 0) | \
-	  (((_fd >= 0) && (_fd < 64)) ? (((uint64_t) 1) << _fd) : (uint64_t) 0) | \
-	  (((_fe >= 0) && (_fe < 64)) ? (((uint64_t) 1) << _fe) : (uint64_t) 0) | \
-	  (((_ff >= 0) && (_ff < 64)) ? (((uint64_t) 1) << _ff) : (uint64_t) 0) | \
-	  (((_fg >= 0) && (_fg < 64)) ? (((uint64_t) 1) << _fg) : (uint64_t) 0) | \
-	  (((_fh >= 0) && (_fh < 64)) ? (((uint64_t) 1) << _fh) : (uint64_t) 0) | \
-	  (((_fi >= 0) && (_fi < 64)) ? (((uint64_t) 1) << _fi) : (uint64_t) 0) | \
-	  (((_fj >= 0) && (_fj < 64)) ? (((uint64_t) 1) << _fj) : (uint64_t) 0) | \
-	  (((_fk >= 0) && (_fk < 64)) ? (((uint64_t) 1) << _fk) : (uint64_t) 0) | \
-	  (((_fl >= 0) && (_fl < 64)) ? (((uint64_t) 1) << _fl) : (uint64_t) 0) ) \
-	 ,(((((_fa > 63) && (_fa < 128)) ? (((uint64_t) 1) << (_fa - 64)) : (uint64_t) 0) | \
-	    (((_fb > 63) && (_fb < 128)) ? (((uint64_t) 1) << (_fb - 64)) : (uint64_t) 0) | \
-	    (((_fc > 63) && (_fc < 128)) ? (((uint64_t) 1) << (_fc - 64)) : (uint64_t) 0) | \
-	    (((_fd > 63) && (_fd < 128)) ? (((uint64_t) 1) << (_fd - 64)) : (uint64_t) 0) | \
-	    (((_fe > 63) && (_fe < 128)) ? (((uint64_t) 1) << (_fe - 64)) : (uint64_t) 0) | \
-	    (((_ff > 63) && (_ff < 128)) ? (((uint64_t) 1) << (_ff - 64)) : (uint64_t) 0) | \
-	    (((_fg > 63) && (_fg < 128)) ? (((uint64_t) 1) << (_fg - 64)) : (uint64_t) 0) | \
-	    (((_fh > 63) && (_fh < 128)) ? (((uint64_t) 1) << (_fh - 64)) : (uint64_t) 0) | \
-	    (((_fi > 63) && (_fi < 128)) ? (((uint64_t) 1) << (_fi - 64)) : (uint64_t) 0) | \
-	    (((_fj > 63) && (_fj < 128)) ? (((uint64_t) 1) << (_fj - 64)) : (uint64_t) 0) | \
-	    (((_fk > 63) && (_fk < 128)) ? (((uint64_t) 1) << (_fk - 64)) : (uint64_t) 0) | \
-	    (((_fl > 63) && (_fl < 128)) ? (((uint64_t) 1) << (_fl - 64)) : (uint64_t) 0)))}
-
-/*
- * THE following table is the mapping of regdomain pairs specified by
- * an 8 bit regdomain value to the individual unitary reg domains
- */
-
-typedef struct reg_dmn_pair_mapping {
-	uint16_t regDmnEnum;    /* 16 bit reg domain pair */
-	uint16_t regDmn5GHz;    /* 5GHz reg domain */
-	uint16_t regDmn2GHz;    /* 2GHz reg domain */
-	uint32_t flags5GHz;     /* Requirements flags (AdHoc
-	                           disallow, noise floor cal needed,
-	                           etc) */
-	uint32_t flags2GHz;     /* Requirements flags (AdHoc
-	                           disallow, noise floor cal needed,
-	                           etc) */
-	uint64_t pscanMask;     /* Passive Scan flags which
-	                           can override unitary domain
-	                           passive scan flags.  This
-	                           value is used as a mask on
-	                           the unitary flags */
-	uint16_t singleCC;      /* Country code of single country if
-	                           a one-on-one mapping exists */
-} REG_DMN_PAIR_MAPPING;
-
-typedef struct {
-	uint16_t countryCode;
-	uint16_t regDmnEnum;
-	const char *isoName;
-	const char *name;
-	uint16_t allow11g : 1, allow11aTurbo : 1, allow11gTurbo : 1, allow11ng20 : 1, /* HT-20 allowed in 2GHz? */
-		 allow11ng40 : 1, /* HT-40 allowed in 2GHz? */
-		 allow11na20 : 1, /* HT-20 allowed in 5GHz? */
-		 allow11na40 : 1, /* HT-40 VHT-40 allowed in 5GHz? */
-		 allow11na80 : 1; /* VHT-80 allowed in 5GHz */
-	uint16_t outdoorChanStart;
-} COUNTRY_CODE_TO_ENUM_RD;
-
-typedef struct RegDmnFreqBand {
-	uint16_t lowChannel;    /* Low channel center in MHz */
-	uint16_t highChannel;   /* High Channel center in MHz */
-	uint8_t powerDfs;       /* Max power (dBm) for channel
-	                           range when using DFS */
-	uint8_t antennaMax;     /* Max allowed antenna gain */
-	uint8_t channelBW;      /* Bandwidth of the channel */
-	uint8_t channelSep;     /* Channel separation within
-	                           the band */
-	uint64_t useDfs;        /* Use DFS in the RegDomain
-	                           if corresponding bit is set */
-	uint64_t usePassScan;   /* Use Passive Scan in the RegDomain
-	                           if corresponding bit is set */
-	uint8_t regClassId;     /* Regulatory class id */
-} REG_DMN_FREQ_BAND;
-
-typedef struct reg_domain {
-	uint16_t regDmnEnum;    /* value from EnumRd table */
-	uint8_t conformance_test_limit;
-	uint64_t dfsMask;       /* DFS bitmask for 5Ghz tables */
-	uint64_t pscan;         /* Bitmask for passive scan */
-	uint32_t flags;         /* Requirement flags (AdHoc disallow, noise
-	                           floor cal needed, etc) */
-	uint64_t chan11a[BMLEN];        /* 128 bit bitmask for channel/band selection */
-	uint64_t chan11a_turbo[BMLEN];  /* 128 bit bitmask for channel/band select */
-	uint64_t chan11a_dyn_turbo[BMLEN];      /* 128 bit mask for chan/band select */
-
-	uint64_t chan11b[BMLEN];        /* 128 bit bitmask for channel/band selection */
-	uint64_t chan11g[BMLEN];        /* 128 bit bitmask for channel/band selection */
-	uint64_t chan11g_turbo[BMLEN];
-} REG_DOMAIN;
-
-struct cmode {
-	uint32_t mode;
-	uint32_t flags;
-};
-
-#define    YES    true
-#define    NO    false
-
-/* mapping of old skus to new skus for Japan */
-typedef struct {
-	uint16_t domain;
-	uint16_t newdomain_pre53;       /* pre eeprom version 5.3 */
-	uint16_t newdomain_post53;      /* post eeprom version 5.3 */
-} JAPAN_SKUMAP;
-
-/* mapping of countrycode to new skus for Japan */
-typedef struct {
-	uint16_t ccode;
-	uint16_t newdomain_pre53;       /* pre eeprom version 5.3 */
-	uint16_t newdomain_post53;      /* post eeprom version 5.3 */
-} JAPAN_COUNTRYMAP;
-
-/* check rd flags in eeprom for japan */
-typedef struct {
-	uint16_t freqbandbit;
-	uint32_t eepromflagtocheck;
-} JAPAN_BANDCHECK;
-
-/* Common mode power table for 5Ghz */
-typedef struct {
-	uint16_t lchan;
-	uint16_t hchan;
-	uint8_t pwrlvl;
-} COMMON_MODE_POWER;
-
-/* Multi-Device RegDomain Support */
-typedef struct ath_hal_reg_dmn_tables {
-	/* regDomainPairs: Map of 8-bit regdomain values to unitary reg domain */
-	const REG_DMN_PAIR_MAPPING *regDomainPairs;
-	/* allCountries: Master list of freq. bands (flags, settings) */
-	const COUNTRY_CODE_TO_ENUM_RD *allCountries;
-	/* regDomains: Array of supported reg domains */
-	const REG_DOMAIN *regDomains;
-
-	uint16_t regDomainPairsCt;      /* Num reg domain pair entries */
-	uint16_t allCountriesCt;        /* Num country entries */
-	uint16_t regDomainsCt;  /* Num reg domain entries */
-} HAL_REG_DMN_TABLES;
-
-/*
- * Country/Region Codes from MS WINNLS.H
- * Numbering from ISO 3166
- */
-/**     @brief country code definitions
- *        - country definition: CTRY_DEBUG
- *            - country string: DB
- *            - country ID: 0
- *        - country definition: CTRY_DEFAULT
- *            - country string: NA
- *            - country ID: 0
- *        - country definition: CTRY_ALBANIA
- *            - country string: AL
- *            - country ID: 8
- *        - country definition: CTRY_ALGERIA
- *            - country string: DZ
- *            - country ID: 12
- *        - country definition: CTRY_ARGENTINA
- *            - country string: AR
- *            - country ID: 32
- *        - country definition: CTRY_ARMENIA
- *            - country string: AM
- *            - country ID: 51
- *        - country definition: CTRY_AUSTRALIA
- *            - country string: AU
- *            - country ID: 36
- *        - country definition: CTRY_AUSTRALIA2
- *            - country string: AU2
- *            - country ID: 5000
- *        - country definition: CTRY_AUSTRIA
- *            - country string: AT
- *            - country ID: 40
- *        - country definition: CTRY_AZERBAIJAN
- *            - country string: AZ
- *            - country ID: 31
- *        - country definition: CTRY_BAHAMAS
- *            - country string: BS
- *            - country ID: 44
- *        - country definition: CTRY_BAHRAIN
- *            - country string: BH
- *            - country ID: 48
- *        - country definition: CTRY_BELARUS
- *            - country string: BY
- *            - country ID: 112
- *        - country definition: CTRY_BELGIUM
- *            - country string: BE
- *            - country ID: 56
- *        - country definition: CTRY_BELIZE
- *            - country string: BZ
- *            - country ID: 84
- *        - country definition: CTRY_BERMUDA
- *            - country string: BM
- *            - country ID: 60
- *        - country definition: CTRY_BOLIVIA
- *            - country string: BO
- *            - country ID: 68
- *        - country definition: CTRY_BOSNIA_HERZEGOWINA
- *            - country string: 70
- *            - country ID: BA
- *        - country definition: CTRY_BRAZIL
- *            - country string: BR
- *            - country ID: 76
- *        - country definition: CTRY_BRUNEI_DARUSSALAM
- *            - country string: BN
- *            - country ID: 96
- *        - country definition: CTRY_BULGARIA
- *            - country string: BG
- *            - country ID: 100
- *        - country definition: CTRY_CANADA
- *            - country string: CA
- *            - country ID: 124
- *        - country definition: CTRY_CANADA2
- *            - country string: CA2
- *            - country ID: 5001
- *        - country definition: CTRY_CHILE
- *            - country string: CL
- *            - country ID: 152
- *        - country definition: CTRY_CHINA
- *            - country string: CN
- *            - country ID: 152
- *        - country definition: CTRY_COLOMBIA
- *            - country string: CO
- *            - country ID: 170
- *        - country definition: CTRY_COSTA_RICA
- *            - country string: CR
- *            - country ID: 191
- *        - country definition: CTRY_CROATIA
- *            - country string: HR
- *            - country ID: 191
- *        - country definition: CTRY_CYPRUS
- *            - country string: CY
- *            - country ID: 196
- *        - country definition: CTRY_CZECH
- *            - country string: CZ
- *            - country ID: 203
- *        - country definition: CTRY_DENMARK
- *            - country string: DK
- *            - country ID: 208
- *        - country definition: CTRY_DOMINICAN_REPUBLIC
- *            - country string: DO
- *            - country ID: 214
- *        - country definition: CTRY_ECUADOR
- *            - country string: EC
- *            - country ID: 218
- *        - country definition: CTRY_EGYPT
- *            - country string: EG
- *            - country ID: 818
- *        - country definition: CTRY_EL_SALVADOR
- *            - country string: SV
- *            - country ID: 222
- *        - country definition: CTRY_ESTONIA
- *            - country string: EE
- *            - country ID: 233
- *        - country definition: CTRY_FAEROE_ISLANDS
- *            - country string: FO
- *            - country ID: 234
- *        - country definition: CTRY_FINLAND
- *            - country string: FI
- *            - country ID: 246
- *        - country definition: CTRY_FRANCE
- *            - country string: FR
- *            - country ID: 250
- *        - country definition: CTRY_FRANCE2
- *            - country string: F2
- *            - country ID: 255
- *        - country definition: CTRY_GEORGIA
- *            - country string: GE
- *            - country ID: 268
- *        - country definition: CTRY_GERMANY
- *            - country string: DE
- *            - country ID: 276
- *        - country definition: CTRY_GREECE
- *            - country string: GR
- *            - country ID: 300
- *        - country definition: CTRY_GUATEMALA
- *            - country string: GT
- *            - country ID: 320
- *        - country definition: CTRY_HONDURAS
- *            - country string: HN
- *            - country ID: 340
- *        - country definition: CTRY_HONG_KONG
- *            - country string: HK
- *            - country ID: 344
- *        - country definition: CTRY_HUNGARY
- *            - country string: HU
- *            - country ID: 348
- *        - country definition: CTRY_ICELAND
- *            - country string: IS
- *            - country ID: 352
- *        - country definition: CTRY_INDIA
- *            - country string: IN
- *            - country ID: 356
- *        - country definition: CTRY_INDONESIA
- *            - country string: ID
- *            - country ID: 360
- *        - country definition: CTRY_IRAN
- *            - country string: IR
- *            - country ID: 364
- *        - country definition: CTRY_IRAQ
- *            - country string: IQ
- *            - country ID: 368
- *        - country definition: CTRY_IRELAND
- *            - country string: IE
- *            - country ID: 372
- *        - country definition: CTRY_ISRAEL
- *            - country string: IL
- *            - country ID: 376
- *        - country definition: CTRY_ITALY
- *            - country string: IT
- *            - country ID: 380
- *        - country definition: CTRY_JAMAICA
- *            - country string: JM
- *            - country ID: 388
- *        - country definition: CTRY_JAPAN
- *            - country string: JP
- *            - country ID: 392
- *        - country definition: CTRY_JAPAN1
- *            - country string: JP1
- *            - country ID: 393
- *        - country definition: CTRY_JAPAN2
- *            - country string: JP2
- *            - country ID: 394
- *        - country definition: CTRY_JAPAN3
- *            - country string: JP3
- *            - country ID: 395
- *        - country definition: CTRY_JAPAN4
- *            - country string: JP4
- *            - country ID: 396
- *        - country definition: CTRY_JAPAN5
- *            - country string: JP5
- *            - country ID: 397
- *        - country definition: CTRY_JAPAN6
- *            - country string: JP6
- *            - country ID: 399
- *        - country definition: CTRY_JAPAN7
- *            - country string: JP7
- *            - country ID: 4007
- *        - country definition: CTRY_JAPAN8
- *            - country string: JP8
- *            - country ID: 4008
- *        - country definition: CTRY_JAPAN9
- *            - country string: JP9
- *            - country ID: 4009
- *        - country definition: CTRY_JAPAN10
- *            - country string: JP10
- *            - country ID: 4010
- *        - country definition: CTRY_JAPAN11
- *            - country string: JP11
- *            - country ID: 4011
- *        - country definition: CTRY_JAPAN12
- *            - country string: JP12
- *            - country ID: 4012
- *        - country definition: CTRY_JAPAN13
- *            - country string: JP13
- *            - country ID: 4013
- *        - country definition: CTRY_JAPAN14
- *            - country string: JP14
- *            - country ID: 4014
- *        - country definition: CTRY_JAPAN15
- *            - country string: JP15
- *            - country ID: 4015
- *        - country definition: CTRY_JAPAN16
- *            - country string: JP16
- *            - country ID: 4016
- *        - country definition: CTRY_JAPAN17
- *            - country string: JP17
- *            - country ID: 4017
- *        - country definition: CTRY_JAPAN18
- *            - country string: JP18
- *            - country ID: 4018
- *        - country definition: CTRY_JAPAN19
- *            - country string: JP19
- *            - country ID: 4019
- *        - country definition: CTRY_JAPAN20
- *            - country string: JP20
- *            - country ID: 4020
- *        - country definition: CTRY_JAPAN21
- *            - country string: JP21
- *            - country ID: 4021
- *        - country definition: CTRY_JAPAN22
- *            - country string: JP22
- *            - country ID: 4022
- *        - country definition: CTRY_JAPAN23
- *            - country string: JP23
- *            - country ID: 4023
- *        - country definition: CTRY_JAPAN24
- *            - country string: JP24
- *            - country ID: 4024
- *        - country definition: CTRY_JAPAN25
- *            - country string: JP25
- *            - country ID: 4025
- *        - country definition: CTRY_JAPAN26
- *            - country string: JP26
- *            - country ID: 4026
- *        - country definition: CTRY_JAPAN27
- *            - country string: JP27
- *            - country ID: 4027
- *        - country definition: CTRY_JAPAN28
- *            - country string: JP28
- *            - country ID: 4028
- *        - country definition: CTRY_JAPAN29
- *            - country string: JP29
- *            - country ID: 4029
- *        - country definition: CTRY_JAPAN30
- *            - country string: JP30
- *            - country ID: 4030
- *        - country definition: CTRY_JAPAN31
- *            - country string: JP31
- *            - country ID: 4031
- *        - country definition: CTRY_JAPAN32
- *            - country string: JP32
- *            - country ID: 4032
- *        - country definition: CTRY_JAPAN33
- *            - country string: JP33
- *            - country ID: 4033
- *        - country definition: CTRY_JAPAN34
- *            - country string: JP34
- *            - country ID: 4034
- *        - country definition: CTRY_JAPAN35
- *            - country string: JP35
- *            - country ID: 4035
- *        - country definition: CTRY_JAPAN36
- *            - country string: JP36
- *            - country ID: 4036
- *        - country definition: CTRY_JAPAN37
- *            - country string: JP37
- *            - country ID: 4037
- *        - country definition: CTRY_JAPAN38
- *            - country string: JP38
- *            - country ID: 4038
- *        - country definition: CTRY_JAPAN39
- *            - country string: JP39
- *            - country ID: 4039
- *        - country definition: CTRY_JAPAN40
- *            - country string: JP40
- *            - country ID: 4040
- *        - country definition: CTRY_JAPAN41
- *            - country string: JP41
- *            - country ID: 4041
- *        - country definition: CTRY_JAPAN42
- *            - country string: JP42
- *            - country ID: 4042
- *        - country definition: CTRY_JAPAN43
- *            - country string: JP43
- *            - country ID: 4043
- *        - country definition: CTRY_JAPAN44
- *            - country string: JP44
- *            - country ID: 4044
- *        - country definition: CTRY_JAPAN45
- *            - country string: JP45
- *            - country ID: 4045
- *        - country definition: CTRY_JAPAN46
- *            - country string: JP46
- *            - country ID: 4046
- *        - country definition: CTRY_JAPAN47
- *            - country string: JP47
- *            - country ID: 4047
- *        - country definition: CTRY_JAPAN48
- *            - country string: JP48
- *            - country ID: 4048
- *        - country definition: CTRY_JAPAN49
- *            - country string: JP49
- *            - country ID: 4049
- *        - country definition: CTRY_JAPAN50
- *            - country string: JP50
- *            - country ID: 4050
- *        - country definition: CTRY_JAPAN51
- *            - country string: JP51
- *            - country ID: 4051
- *        - country definition: CTRY_JAPAN52
- *            - country string: JP52
- *            - country ID: 4052
- *        - country definition: CTRY_JAPAN53
- *            - country string: JP53
- *            - country ID: 4053
- *        - country definition: CTRY_JAPAN54
- *            - country string: JP54
- *            - country ID: 4054
- *        - country definition: CTRY_JAPAN55
- *            - country string: JP55
- *            - country ID: 4055
- *        - country definition: CTRY_JAPAN56
- *            - country string: JP56
- *            - country ID: 4056
- *        - country definition: CTRY_JORDAN
- *            - country string: JO
- *            - country ID: 400
- *        - country definition: CTRY_KAZAKHSTAN
- *            - country string: KZ
- *            - country ID: 398
- *        - country definition: CTRY_KENYA
- *            - country string: KE
- *            - country ID: 404
- *        - country definition: CTRY_KOREA_NORTH
- *            - country string: KP
- *            - country ID: 408
- *        - country definition: CTRY_KOREA_ROC
- *            - country string: KR
- *            - country ID: 410
- *        - country definition: CTRY_KOREA_ROC2
- *            - country string: KR2
- *            - country ID: 411
- *        - country definition: CTRY_KOREA_ROC3
- *            - country string: KR3
- *            - country ID: 412
- *        - country definition: CTRY_KUWAIT
- *            - country string: KW
- *            - country ID: 414
- *        - country definition: CTRY_LATVIA
- *            - country string: LV
- *            - country ID: 428
- *        - country definition: CTRY_LEBANON
- *            - country string: LB
- *            - country ID: 422
- *        - country definition: CTRY_LIBYA
- *            - country string: LY
- *            - country ID: 434
- *        - country definition: CTRY_LIECHTENSTEIN
- *            - country string: LI
- *            - country ID: 438
- *        - country definition: CTRY_LITHUANIA
- *            - country string: LT
- *            - country ID: 440
- *        - country definition: CTRY_LUXEMBOURG
- *            - country string: LU
- *            - country ID: 442
- *        - country definition: CTRY_MACAU
- *            - country string: MO
- *            - country ID: 446
- *        - country definition: CTRY_MACEDONIA
- *            - country string: MK
- *            - country ID: 807
- *        - country definition: CTRY_MALAYSIA
- *            - country string: MY
- *            - country ID: 458
- *        - country definition: CTRY_MALTA
- *            - country string: MT
- *            - country ID: 470
- *        - country definition: CTRY_MAURITIUS
- *            - country string: MU
- *            - country ID: 480
- *        - country definition: CTRY_MEXICO
- *            - country string: MX
- *            - country ID: 484
- *        - country definition: CTRY_MONACO
- *            - country string: MC
- *            - country ID: 492
- *        - country definition: CTRY_MOROCCO
- *            - country string: MA
- *            - country ID: 504
- *        - country definition: CTRY_NETHERLANDS
- *            - country string: NL
- *            - country ID: 528
- *        - country definition: CTRY_NEW_ZEALAND
- *            - country string: NZ
- *            - country ID: 554
- *        - country definition: CTRY_NICARAGUA
- *            - country string: NI
- *            - country ID: 558
- *        - country definition: CTRY_NORWAY
- *            - country string: NO
- *            - country ID: 578
- *        - country definition: CTRY_OMAN
- *            - country string: OM
- *            - country ID: 512
- *        - country definition: CTRY_PAKISTAN
- *            - country string: PK
- *            - country ID: 586
- *        - country definition: CTRY_PANAMA
- *            - country string: PA
- *            - country ID: 591
- *        - country definition: CTRY_PARAGUAY
- *            - country string: PY
- *            - country ID: 600
- *        - country definition: CTRY_PERU
- *            - country string: PE
- *            - country ID: 604
- *        - country definition: CTRY_PHILIPPINES
- *            - country string: PH
- *            - country ID: 608
- *        - country definition: CTRY_POLAND
- *            - country string: PL
- *            - country ID: 616
- *        - country definition: CTRY_PORTUGAL
- *            - country string: PT
- *            - country ID: 620
- *        - country definition: CTRY_PUERTO_RICO
- *            - country string: PR
- *            - country ID: 630
- *        - country definition: CTRY_QATAR
- *            - country string: QA
- *            - country ID: 634
- *        - country definition: CTRY_ROMANIA
- *            - country string: RO
- *            - country ID: 642
- *        - country definition: CTRY_RUSSIA
- *            - country string: RU
- *            - country ID: 643
- *        - country definition: CTRY_SAUDI_ARABIA
- *            - country string: SA
- *            - country ID: 682
- *        - country definition: CTRY_SERBIA
- *            - country string: RS
- *            - country ID: 688
- *        - country definition: CTRY_MONTENEGRO
- *            - country string: ME
- *            - country ID: 499
- *        - country definition: CTRY_SINGAPORE
- *            - country string: SG
- *            - country ID: 702
- *        - country definition: CTRY_SLOVAKIA
- *            - country string: SK
- *            - country ID: 703
- *        - country definition: CTRY_SLOVENIA
- *            - country string: SI
- *            - country ID: 705
- *        - country definition: CTRY_SOUTH_AFRICA
- *            - country string: ZA
- *            - country ID: 710
- *        - country definition: CTRY_SPAIN
- *            - country string: ES
- *            - country ID: 724
- *        - country definition: CTRY_SRI_LANKA
- *            - country string: LK
- *            - country ID: 144
- *        - country definition: CTRY_SWEDEN
- *            - country string: SE
- *            - country ID: 752
- *        - country definition: CTRY_SWITZERLAND
- *            - country string: CH
- *            - country ID: 756
- *        - country definition: CTRY_SYRIA
- *            - country string: SY
- *            - country ID: 760
- *        - country definition: CTRY_TAIWAN
- *            - country string: TW
- *            - country ID: 158
- *        - country definition: CTRY_TANZANIA
- *            - country string: TZ
- *            - country ID: 834
- *        - country definition: CTRY_THAILAND
- *            - country string: TH
- *            - country ID: 764
- *        - country definition: CTRY_TRINIDAD_Y_TOBAGO
- *            - country string: TT
- *            - country ID: 780
- *        - country definition: CTRY_TUNISIA
- *            - country string: TN
- *            - country ID: 788
- *        - country definition: CTRY_TURKEY
- *            - country string: TR
- *            - country ID: 792
- *        - country definition: CTRY_UAE
- *            - country string: AE
- *            - country ID: 784
- *        - country definition: CTRY_UKRAINE
- *            - country string: UA
- *            - country ID: 804
- *        - country definition: CTRY_UNITED_KINGDOM
- *            - country string: GB
- *            - country ID: 826
- *        - country definition: CTRY_UNITED_STATES
- *            - country string: US
- *            - country ID: 840
- *        - country definition: CTRY_UNITED_STATES_FCC49
- *            - country string: US
- *            - country ID: 842
- *        - country definition: CTRY_URUGUAY
- *            - country string: UY
- *            - country ID: 858
- *        - country definition: CTRY_UZBEKISTAN
- *            - country string: UZ
- *            - country ID: 860
- *        - country definition: CTRY_VENEZUELA
- *            - country string: VE
- *            - country ID: 862
- *        - country definition: CTRY_VIET_NAM
- *            - country string: VN
- *            - country ID: 704
- *        - country definition: CTRY_YEMEN
- *            - country string: YE
- *            - country ID: 887
- *        - country definition: CTRY_ZIMBABWE
- *            - country string: ZW
- *            - country ID: 716
- */
-enum CountryCode {
-	CTRY_ALBANIA = 8,       /* Albania */
-	CTRY_ALGERIA = 12,      /* Algeria */
-	CTRY_ARGENTINA = 32,    /* Argentina */
-	CTRY_ARMENIA = 51,      /* Armenia */
-	CTRY_AUSTRALIA = 36,    /* Australia */
-	CTRY_AUSTRIA = 40,      /* Austria */
-	CTRY_AZERBAIJAN = 31,   /* Azerbaijan */
-	CTRY_BAHAMAS = 44,      /* Bahamas */
-	CTRY_BAHRAIN = 48,      /* Bahrain */
-	CTRY_BANGLADESH = 50,   /* Bangladesh */
-	CTRY_BARBADOS = 52,     /* Barbados */
-	CTRY_BELARUS = 112,     /* Belarus */
-	CTRY_BELGIUM = 56,      /* Belgium */
-	CTRY_BELIZE = 84,       /* Belize */
-	CTRY_BERMUDA = 60,      /* Berumuda */
-	CTRY_BOLIVIA = 68,      /* Bolivia */
-	CTRY_BOSNIA_HERZ = 70,  /* Bosnia and Herzegowina */
-	CTRY_BRAZIL = 76,       /* Brazil */
-	CTRY_BRUNEI_DARUSSALAM = 96,    /* Brunei Darussalam */
-	CTRY_BULGARIA = 100,    /* Bulgaria */
-	CTRY_CAMBODIA = 116,    /* Cambodia */
-	CTRY_CANADA = 124,      /* Canada */
-	CTRY_CHILE = 152,       /* Chile */
-	CTRY_CHINA = 156,       /* People's Republic of China */
-	CTRY_COLOMBIA = 170,    /* Colombia */
-	CTRY_COSTA_RICA = 188,  /* Costa Rica */
-	CTRY_CROATIA = 191,     /* Croatia */
-	CTRY_CYPRUS = 196,
-	CTRY_CZECH = 203,       /* Czech Republic */
-	CTRY_DENMARK = 208,     /* Denmark */
-	CTRY_DOMINICAN_REPUBLIC = 214,  /* Dominican Republic */
-	CTRY_ECUADOR = 218,     /* Ecuador */
-	CTRY_EGYPT = 818,       /* Egypt */
-	CTRY_EL_SALVADOR = 222, /* El Salvador */
-	CTRY_ESTONIA = 233,     /* Estonia */
-	CTRY_FAEROE_ISLANDS = 234,      /* Faeroe Islands */
-	CTRY_FINLAND = 246,     /* Finland */
-	CTRY_FRANCE = 250,      /* France */
-	CTRY_GEORGIA = 268,     /* Georgia */
-	CTRY_GERMANY = 276,     /* Germany */
-	CTRY_GREECE = 300,      /* Greece */
-	CTRY_GREENLAND = 304,   /* Greenland */
-	CTRY_GRENADA = 308,     /* Grenada */
-	CTRY_GUAM = 316,        /* Guam */
-	CTRY_GUATEMALA = 320,   /* Guatemala */
-	CTRY_HAITI = 332,       /* Haiti */
-	CTRY_HONDURAS = 340,    /* Honduras */
-	CTRY_HONG_KONG = 344,   /* Hong Kong S.A.R., P.R.C. */
-	CTRY_HUNGARY = 348,     /* Hungary */
-	CTRY_ICELAND = 352,     /* Iceland */
-	CTRY_INDIA = 356,       /* India */
-	CTRY_INDONESIA = 360,   /* Indonesia */
-	CTRY_IRAN = 364,        /* Iran */
-	CTRY_IRAQ = 368,        /* Iraq */
-	CTRY_IRELAND = 372,     /* Ireland */
-	CTRY_ISRAEL = 376,      /* Israel */
-	CTRY_ITALY = 380,       /* Italy */
-	CTRY_JAMAICA = 388,     /* Jamaica */
-	CTRY_JAPAN = 392,       /* Japan */
-	CTRY_JORDAN = 400,      /* Jordan */
-	CTRY_KAZAKHSTAN = 398,  /* Kazakhstan */
-	CTRY_KENYA = 404,       /* Kenya */
-	CTRY_KOREA_NORTH = 408, /* North Korea */
-	CTRY_KOREA_ROC = 410,   /* South Korea */
-	CTRY_KOREA_ROC3 = 412,  /* South Korea */
-	CTRY_KUWAIT = 414,      /* Kuwait */
-	CTRY_LATVIA = 428,      /* Latvia */
-	CTRY_LEBANON = 422,     /* Lebanon */
-	CTRY_LIBYA = 434,       /* Libya */
-	CTRY_LIECHTENSTEIN = 438,       /* Liechtenstein */
-	CTRY_LITHUANIA = 440,   /* Lithuania */
-	CTRY_LUXEMBOURG = 442,  /* Luxembourg */
-	CTRY_MACAU = 446,       /* Macau SAR */
-	CTRY_MACEDONIA = 807,   /* the Former Yugoslav Republic of Macedonia */
-	CTRY_MALAYSIA = 458,    /* Malaysia */
-	CTRY_MALDIVES = 462,    /* Maldives */
-	CTRY_MALTA = 470,       /* Malta */
-	CTRY_MAURITIUS = 480,   /* Mauritius */
-	CTRY_MEXICO = 484,      /* Mexico */
-	CTRY_MONACO = 492,      /* Principality of Monaco */
-	CTRY_MOROCCO = 504,     /* Morocco */
-	CTRY_NEPAL = 524,       /* Nepal */
-	CTRY_NETHERLANDS = 528, /* Netherlands */
-	CTRY_NETHERLANDS_ANTILLES = 530,        /* Netherlands-Antilles */
-	CTRY_ARUBA = 533,       /* Aruba */
-	CTRY_NEW_ZEALAND = 554, /* New Zealand */
-	CTRY_NICARAGUA = 558,   /* Nicaragua */
-	CTRY_NORWAY = 578,      /* Norway */
-	CTRY_OMAN = 512,        /* Oman */
-	CTRY_PAKISTAN = 586,    /* Islamic Republic of Pakistan */
-	CTRY_PANAMA = 591,      /* Panama */
-	CTRY_PAPUA_NEW_GUINEA = 598,    /* Papua New Guinea */
-	CTRY_PARAGUAY = 600,    /* Paraguay */
-	CTRY_PERU = 604,        /* Peru */
-	CTRY_PHILIPPINES = 608, /* Republic of the Philippines */
-	CTRY_POLAND = 616,      /* Poland */
-	CTRY_PORTUGAL = 620,    /* Portugal */
-	CTRY_PUERTO_RICO = 630, /* Puerto Rico */
-	CTRY_QATAR = 634,       /* Qatar */
-	CTRY_ROMANIA = 642,     /* Romania */
-	CTRY_RUSSIA = 643,      /* Russia */
-	CTRY_RWANDA = 646,      /* Rwanda */
-	CTRY_SAUDI_ARABIA = 682,        /* Saudi Arabia */
-	CTRY_SERBIA = 688,      /* Republic of Serbia */
-	CTRY_MONTENEGRO = 499,  /* Montenegro */
-	CTRY_SINGAPORE = 702,   /* Singapore */
-	CTRY_SLOVAKIA = 703,    /* Slovak Republic */
-	CTRY_SLOVENIA = 705,    /* Slovenia */
-	CTRY_SOUTH_AFRICA = 710,        /* South Africa */
-	CTRY_SPAIN = 724,       /* Spain */
-	CTRY_SRI_LANKA = 144,   /* Sri Lanka */
-	CTRY_SWEDEN = 752,      /* Sweden */
-	CTRY_SWITZERLAND = 756, /* Switzerland */
-	CTRY_SYRIA = 760,       /* Syria */
-	CTRY_TAIWAN = 158,      /* Taiwan */
-	CTRY_TANZANIA = 834,    /* Tanzania */
-	CTRY_THAILAND = 764,    /* Thailand */
-	CTRY_TRINIDAD_Y_TOBAGO = 780,   /* Trinidad y Tobago */
-	CTRY_TUNISIA = 788,     /* Tunisia */
-	CTRY_TURKEY = 792,      /* Turkey */
-	CTRY_UAE = 784,         /* U.A.E. */
-	CTRY_UGANDA = 800,      /* Uganda */
-	CTRY_UKRAINE = 804,     /* Ukraine */
-	CTRY_UNITED_KINGDOM = 826,      /* United Kingdom */
-	CTRY_UNITED_STATES = 840,       /* United States */
-	CTRY_UNITED_STATES2 = 841,      /* United States for AP */
-	CTRY_UNITED_STATES_FCC49 = 842, /* United States (Public Safety) */
-	CTRY_URUGUAY = 858,     /* Uruguay */
-	CTRY_UZBEKISTAN = 860,  /* Uzbekistan */
-	CTRY_VENEZUELA = 862,   /* Venezuela */
-	CTRY_VIET_NAM = 704,    /* Viet Nam */
-	CTRY_YEMEN = 887,       /* Yemen */
-	CTRY_ZIMBABWE = 716,    /* Zimbabwe */
-
-	/*
-	** Japan special codes.  Boy, do they have a lot
-	*/
-
-	CTRY_JAPAN1 = 393,      /* Japan (JP1) */
-	CTRY_JAPAN2 = 394,      /* Japan (JP0) */
-	CTRY_JAPAN3 = 395,      /* Japan (JP1-1) */
-	CTRY_JAPAN4 = 396,      /* Japan (JE1) */
-	CTRY_JAPAN5 = 397,      /* Japan (JE2) */
-	CTRY_JAPAN6 = 4006,     /* Japan (JP6) */
-	CTRY_JAPAN7 = 4007,     /* Japan (J7) */
-	CTRY_JAPAN8 = 4008,     /* Japan (J8) */
-	CTRY_JAPAN9 = 4009,     /* Japan (J9) */
-	CTRY_JAPAN10 = 4010,    /* Japan (J10) */
-	CTRY_JAPAN11 = 4011,    /* Japan (J11) */
-	CTRY_JAPAN12 = 4012,    /* Japan (J12) */
-	CTRY_JAPAN13 = 4013,    /* Japan (J13) */
-	CTRY_JAPAN14 = 4014,    /* Japan (J14) */
-	CTRY_JAPAN15 = 4015,    /* Japan (J15) */
-	CTRY_JAPAN16 = 4016,    /* Japan (J16) */
-	CTRY_JAPAN17 = 4017,    /* Japan (J17) */
-	CTRY_JAPAN18 = 4018,    /* Japan (J18) */
-	CTRY_JAPAN19 = 4019,    /* Japan (J19) */
-	CTRY_JAPAN20 = 4020,    /* Japan (J20) */
-	CTRY_JAPAN21 = 4021,    /* Japan (J21) */
-	CTRY_JAPAN22 = 4022,    /* Japan (J22) */
-	CTRY_JAPAN23 = 4023,    /* Japan (J23) */
-	CTRY_JAPAN24 = 4024,    /* Japan (J24) */
-	CTRY_JAPAN25 = 4025,    /* Japan (J25) */
-	CTRY_JAPAN26 = 4026,    /* Japan (J26) */
-	CTRY_JAPAN27 = 4027,    /* Japan (J27) */
-	CTRY_JAPAN28 = 4028,    /* Japan (J28) */
-	CTRY_JAPAN29 = 4029,    /* Japan (J29) */
-	CTRY_JAPAN30 = 4030,    /* Japan (J30) */
-	CTRY_JAPAN31 = 4031,    /* Japan (J31) */
-	CTRY_JAPAN32 = 4032,    /* Japan (J32) */
-	CTRY_JAPAN33 = 4033,    /* Japan (J33) */
-	CTRY_JAPAN34 = 4034,    /* Japan (J34) */
-	CTRY_JAPAN35 = 4035,    /* Japan (J35) */
-	CTRY_JAPAN36 = 4036,    /* Japan (J36) */
-	CTRY_JAPAN37 = 4037,    /* Japan (J37) */
-	CTRY_JAPAN38 = 4038,    /* Japan (J38) */
-	CTRY_JAPAN39 = 4039,    /* Japan (J39) */
-	CTRY_JAPAN40 = 4040,    /* Japan (J40) */
-	CTRY_JAPAN41 = 4041,    /* Japan (J41) */
-	CTRY_JAPAN42 = 4042,    /* Japan (J42) */
-	CTRY_JAPAN43 = 4043,    /* Japan (J43) */
-	CTRY_JAPAN44 = 4044,    /* Japan (J44) */
-	CTRY_JAPAN45 = 4045,    /* Japan (J45) */
-	CTRY_JAPAN46 = 4046,    /* Japan (J46) */
-	CTRY_JAPAN47 = 4047,    /* Japan (J47) */
-	CTRY_JAPAN48 = 4048,    /* Japan (J48) */
-	CTRY_JAPAN49 = 4049,    /* Japan (J49) */
-	CTRY_JAPAN50 = 4050,    /* Japan (J50) */
-	CTRY_JAPAN51 = 4051,    /* Japan (J51) */
-	CTRY_JAPAN52 = 4052,    /* Japan (J52) */
-	CTRY_JAPAN53 = 4053,    /* Japan (J53) */
-	CTRY_JAPAN54 = 4054,    /* Japan (J54) */
-	CTRY_JAPAN55 = 4055,    /* Japan (J55) */
-	CTRY_JAPAN56 = 4056,    /* Japan (J56) */
-	CTRY_JAPAN57 = 4057,    /* Japan (J57) */
-	CTRY_JAPAN58 = 4058,    /* Japan (J58) */
-	CTRY_JAPAN59 = 4059,    /* Japan (J59) */
-
-	/*
-	** "Special" codes for multiply defined countries, with the exception
-	** of Japan and US.
-	*/
-
-	CTRY_AUSTRALIA2 = 5000, /* Australia for AP only */
-	CTRY_CANADA2 = 5001,    /* Canada for AP only */
-	CTRY_BELGIUM2 = 5002    /* Belgium/Cisco implementation */
-};
-
-int32_t cds_fill_some_regulatory_info(struct regulatory *reg);
-void cds_fill_and_send_ctl_to_fw(struct regulatory *reg);
-int32_t cds_get_country_from_alpha2(uint8_t *alpha2);
-void cds_fill_send_ctl_info_to_fw(struct regulatory *reg, uint32_t modesAvail,
-				  uint32_t modeSelect);
-void cds_set_wma_dfs_region(struct regulatory *reg);
-void cds_set_ch_params(uint8_t ch, uint32_t phy_mode,
-		chan_params_t *ch_params);
-
-#endif /* REGULATORY_H */

+ 0 - 2220
core/cds/inc/cds_regdomain_common.h

@@ -1,2220 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/*
- * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
- * Copyright (c) 2005-2011 Atheros Communications, Inc.
- * 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 above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 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.
- *
- * $FreeBSD: release/9.0.0/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h 224226 2011-07-20 12:46:58Z adrian $
- */
-/*
- * This module contains the common regulatory domain database tables:
- *
- *     - reg domain enum constants
- *     - reg domain enum to reg domain pair mappings
- *     - country to regdomain mappings
- *     - channel tag enums and the frequency-to-frequency band mappings
- *       for all the modes
- *
- * "The country table and respective Regulatory Domain channel and power
- * settings are based on available knowledge as of software release. The
- * underlying global regulatory and spectrum rules change on a regular basis,
- * therefore, no warranty is given that the channel and power information
- * herein is complete, accurate or up to date.  Developers are responsible
- * for regulatory compliance of end-products developed using the enclosed
- * data per all applicable national requirements.  Furthermore, data in this
- * table does not guarantee that spectrum is available and that regulatory
- * approval is possible in every case. Knowldegable regulatory compliance
- * or government contacts should be consulted by the manufacturer to ensure
- * that the most current and accurate settings are used in each end-product.
- * This table was designed so that developers are able to update the country
- * table mappings as well as the Regulatory Domain definitions in order to
- * incorporate the most current channel and power settings in the end-product."
- *
- */
-
-/* Enumerated Regulatory Domain Information 8 bit values indicate that
- * the regdomain is really a pair of unitary regdomains.  12 bit values
- * are the real unitary regdomains and are the only ones which have the
- * frequency bitmasks and flags set.
- */
-
-#include "cds_ieee80211_common.h"
-#include <a_types.h>
-#include "wlan_defs.h"
-
-#define MAX_CHANNELS_PER_OPERATING_CLASS  25
-
-enum EnumRd {
-	/*
-	 * The following regulatory domain definitions are
-	 * found in the EEPROM. Each regulatory domain
-	 * can operate in either a 5GHz or 2.4GHz wireless mode or
-	 * both 5GHz and 2.4GHz wireless modes.
-	 * In general, the value holds no special
-	 * meaning and is used to decode into either specific
-	 * 2.4GHz or 5GHz wireless mode for that particular
-	 * regulatory domain.
-	 */
-	NO_ENUMRD = 0x00,
-	NULL1_WORLD = 0x03,     /* For 11b-only countries (no 11a allowed) */
-	NULL1_ETSIB = 0x07,     /* Israel */
-	NULL1_ETSIC = 0x08,
-	FCC1_FCCA = 0x10,       /* USA */
-	FCC1_WORLD = 0x11,      /* Hong Kong */
-	FCC4_FCCA = 0x12,       /* USA - Public Safety */
-	FCC5_FCCA = 0x13,       /* US with no DFS (UNII-1 + UNII-3 Only) */
-	FCC6_FCCA = 0x14,       /* Canada for AP only */
-
-	FCC2_FCCA = 0x20,       /* Canada */
-	FCC2_WORLD = 0x21,      /* Australia & HK */
-	FCC2_ETSIC = 0x22,
-	FCC6_WORLD = 0x23,      /* Australia for AP only */
-	FRANCE_RES = 0x31,      /* Legacy France for OEM */
-	FCC3_FCCA = 0x3A,       /* USA & Canada w/5470 band, 11h, DFS enabled */
-	FCC3_WORLD = 0x3B,      /* USA & Canada w/5470 band, 11h, DFS enabled */
-	FCC3_ETSIC = 0x3F,      /* New Zealand, DFS enabled */
-
-	ETSI1_WORLD = 0x37,
-	ETSI3_ETSIA = 0x32,     /* France (optional) */
-	ETSI2_WORLD = 0x35,     /* Hungary & others */
-	ETSI3_WORLD = 0x36,     /* France & others */
-	ETSI4_WORLD = 0x30,
-	ETSI4_ETSIC = 0x38,
-	ETSI5_WORLD = 0x39,
-	ETSI6_WORLD = 0x34,     /* Bulgaria */
-	ETSI8_WORLD = 0x3D,     /* Russia */
-	ETSI9_WORLD = 0x3E,     /* Ukraine */
-	ETSI_RESERVED = 0x33,   /* Reserved (Do not used) */
-
-	MKK1_MKKA = 0x40,       /* Japan (JP1) */
-	MKK1_MKKB = 0x41,       /* Japan (JP0) */
-	APL4_WORLD = 0x42,      /* Singapore and Morocco */
-	MKK2_MKKA = 0x43,       /* Japan with 4.9G channels */
-	APL_RESERVED = 0x44,    /* Reserved (Do not used)  */
-	APL2_WORLD = 0x45,      /* Korea */
-	APL2_APLC = 0x46,
-	APL3_WORLD = 0x47,
-	MKK1_FCCA = 0x48,       /* Japan (JP1-1) */
-	APL2_APLD = 0x49,       /* Korea with 2.3G channels */
-	MKK1_MKKA1 = 0x4A,      /* Japan (JE1) */
-	MKK1_MKKA2 = 0x4B,      /* Japan (JE2) */
-	MKK1_MKKC = 0x4C,       /* Japan (MKK1_MKKA,except Ch14) */
-	APL2_FCCA = 0x4D,       /* Mobile customer */
-	APL11_FCCA = 0x4F,      /* Specific AP Customer 5GHz, For APs Only */
-
-	APL3_FCCA = 0x50,
-	APL12_WORLD = 0x51,
-	APL1_WORLD = 0x52,      /* Latin America */
-	APL1_FCCA = 0x53,
-	APL1_APLA = 0x54,
-	APL1_ETSIC = 0x55,
-	APL2_ETSIC = 0x56,      /* Venezuela */
-	APL5_WORLD = 0x58,      /* Chile */
-	APL13_WORLD = 0x5A,     /* Algeria */
-	APL6_WORLD = 0x5B,      /* Singapore */
-	APL7_FCCA = 0x5C,       /* Taiwan 5.47 Band */
-	APL8_WORLD = 0x5D,      /* Malaysia 5GHz */
-	APL9_MKKC = 0x5E,      /* Korea 5GHz, Before 11/2007. Now used only by APs */
-	APL10_MKKC = 0x5F,     /* Korea 5GHz, After 11/2007. For STAs only */
-
-	/*
-	 * World mode SKUs
-	 */
-	WOR0_WORLD = 0x60,      /* World0 (WO0 SKU) */
-	WOR1_WORLD = 0x61,      /* World1 (WO1 SKU) */
-	WOR2_WORLD = 0x62,      /* World2 (WO2 SKU) */
-	WOR3_WORLD = 0x63,      /* World3 (WO3 SKU) */
-	WOR4_WORLD = 0x64,      /* World4 (WO4 SKU) */
-	WOR5_ETSIC = 0x65,      /* World5 (WO5 SKU) */
-
-	WOR01_WORLD = 0x66,     /* World0-1 (WW0-1 SKU) */
-	WOR02_WORLD = 0x67,     /* World0-2 (WW0-2 SKU) */
-	EU1_WORLD = 0x68,       /* Same as World0-2 (WW0-2 SKU), except active scan ch1-13. No ch14 */
-
-	WOR9_WORLD = 0x69,      /* World9 (WO9 SKU) */
-	WORA_WORLD = 0x6A,      /* WorldA (WOA SKU) */
-	WORB_WORLD = 0x6B,      /* WorldB (WOB SKU) */
-	WORC_WORLD = 0x6C,      /* WorldC (WOC SKU) */
-
-	MKK3_MKKB = 0x80,       /* Japan UNI-1 even + MKKB */
-	MKK3_MKKA2 = 0x81,      /* Japan UNI-1 even + MKKA2 */
-	MKK3_MKKC = 0x82,       /* Japan UNI-1 even + MKKC */
-
-	MKK4_MKKB = 0x83,       /* Japan UNI-1 even + UNI-2 + MKKB */
-	MKK4_MKKA2 = 0x84,      /* Japan UNI-1 even + UNI-2 + MKKA2 */
-	MKK4_MKKC = 0x85,       /* Japan UNI-1 even + UNI-2 + MKKC */
-
-	MKK5_MKKB = 0x86,       /* Japan UNI-1 even + UNI-2 + mid-band + MKKB */
-	MKK5_MKKA2 = 0x87,      /* Japan UNI-1 even + UNI-2 + mid-band + MKKA2 */
-	MKK5_MKKC = 0x88,       /* Japan UNI-1 even + UNI-2 + mid-band + MKKC */
-	MKK5_FCCA = 0x9A,
-
-	MKK6_MKKB = 0x89,       /* Japan UNI-1 even + UNI-1 odd MKKB */
-	MKK6_MKKA2 = 0x8A,      /* Japan UNI-1 even + UNI-1 odd + MKKA2 */
-	MKK6_MKKC = 0x8B,       /* Japan UNI-1 even + UNI-1 odd + MKKC */
-
-	MKK7_MKKB = 0x8C,       /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKB */
-	MKK7_MKKA2 = 0x8D,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA2 */
-	MKK7_MKKC = 0x8E,       /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKC */
-
-	MKK8_MKKB = 0x8F,       /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKB */
-	MKK8_MKKA2 = 0x90,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKA2 */
-	MKK8_MKKC = 0x91,       /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKC */
-
-	MKK14_MKKA1 = 0x92,     /* Japan UNI-1 even + UNI-1 odd + 4.9GHz + MKKA1 */
-	MKK15_MKKA1 = 0x93,     /* Japan UNI-1 even + UNI-1 odd + UNI-2 + 4.9GHz + MKKA1 */
-
-	MKK10_FCCA = 0xD0,      /* Japan UNI-1 even + UNI-2 + 4.9GHz + FCCA */
-	MKK10_MKKA1 = 0xD1,     /* Japan UNI-1 even + UNI-2 + 4.9GHz + MKKA1 */
-	MKK10_MKKC = 0xD2,      /* Japan UNI-1 even + UNI-2 + 4.9GHz + MKKC */
-	MKK10_MKKA2 = 0xD3,     /* Japan UNI-1 even + UNI-2 + 4.9GHz + MKKA2 */
-
-	MKK11_MKKA = 0xD4,      /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKA */
-	MKK11_FCCA = 0xD5,      /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + FCCA */
-	MKK11_MKKA1 = 0xD6,     /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKA1 */
-	MKK11_MKKC = 0xD7,      /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKC */
-	MKK11_MKKA2 = 0xD8,     /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKA2 */
-
-	MKK12_MKKA = 0xD9,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKA */
-	MKK12_FCCA = 0xDA,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + FCCA */
-	MKK12_MKKA1 = 0xDB,     /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKA1 */
-	MKK12_MKKC = 0xDC,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKC */
-	MKK12_MKKA2 = 0xDD,     /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKA2 */
-
-	MKK13_MKKB = 0xDE,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKB + All passive + no adhoc */
-
-	/* Following definitions are used only by s/w to map old
-	 * Japan SKUs.
-	 */
-	MKK3_MKKA = 0xF0,       /* Japan UNI-1 even + MKKA */
-	MKK3_MKKA1 = 0xF1,      /* Japan UNI-1 even + MKKA1 */
-	MKK3_FCCA = 0xF2,       /* Japan UNI-1 even + FCCA */
-	MKK4_MKKA = 0xF3,       /* Japan UNI-1 even + UNI-2 + MKKA */
-	MKK4_MKKA1 = 0xF4,      /* Japan UNI-1 even + UNI-2 + MKKA1 */
-	MKK4_FCCA = 0xF5,       /* Japan UNI-1 even + UNI-2 + FCCA */
-	MKK9_MKKA = 0xF6,       /* Japan UNI-1 even + 4.9GHz */
-	MKK10_MKKA = 0xF7,      /* Japan UNI-1 even + UNI-2 + 4.9GHz */
-	MKK6_MKKA1 = 0xF8,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA1 */
-	MKK6_FCCA = 0xF9,       /* Japan UNI-1 even + UNI-1 odd + UNI-2 + FCCA */
-	MKK7_MKKA1 = 0xFA,      /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA1 */
-	MKK7_FCCA = 0xFB,       /* Japan UNI-1 even + UNI-1 odd + UNI-2 + FCCA */
-	MKK9_FCCA = 0xFC,       /* Japan UNI-1 even + 4.9GHz + FCCA */
-	MKK9_MKKA1 = 0xFD,      /* Japan UNI-1 even + 4.9GHz + MKKA1 */
-	MKK9_MKKC = 0xFE,       /* Japan UNI-1 even + 4.9GHz + MKKC */
-	MKK9_MKKA2 = 0xFF,      /* Japan UNI-1 even + 4.9GHz + MKKA2 */
-
-	/*
-	 * Regulator domains ending in a number (e.g. APL1,
-	 * MK1, ETSI4, etc) apply to 5GHz channel and power
-	 * information.  Regulator domains ending in a letter
-	 * (e.g. APLA, FCCA, etc) apply to 2.4GHz channel and
-	 * power information.
-	 */
-	APL1 = 0x0150,          /* LAT & Asia */
-	APL2 = 0x0250,          /* LAT & Asia */
-	APL3 = 0x0350,          /* Taiwan */
-	APL4 = 0x0450,          /* Jordan */
-	APL5 = 0x0550,          /* Chile */
-	APL6 = 0x0650,          /* Singapore */
-	APL7 = 0x0750,          /* Taiwan, disable ch52 */
-	APL8 = 0x0850,          /* Malaysia */
-	APL9 = 0x0950,          /* Korea. Before 11/2007. Now used only by APs */
-	APL10 = 0x1050,         /* Korea. After 11/2007. For STAs only */
-	APL11 = 0x1150,         /* Specific AP Customer 5GHz, For APs Only */
-	APL12 = 0x1160,         /* Kenya */
-
-	ETSI1 = 0x0130,         /* Europe & others */
-	ETSI2 = 0x0230,         /* Europe & others */
-	ETSI3 = 0x0330,         /* Europe & others */
-	ETSI4 = 0x0430,         /* Europe & others */
-	ETSI5 = 0x0530,         /* Europe & others */
-	ETSI6 = 0x0630,         /* Europe & others */
-	ETSI8 = 0x0830,         /* Russia */
-	ETSI9 = 0x0930,         /* Ukraine */
-	ETSIA = 0x0A30,         /* France */
-	ETSIB = 0x0B30,         /* Israel */
-	ETSIC = 0x0C30,         /* Latin America */
-
-	FCC1 = 0x0110,          /* US & others */
-	FCC2 = 0x0120,          /* Canada, Australia & New Zealand */
-	FCC3 = 0x0160,          /* US w/new middle band & DFS */
-	FCC4 = 0x0165,          /* US Public Safety */
-	FCC5 = 0x0510,
-	FCC6 = 0x0610,          /* Canada & Australia */
-	FCCA = 0x0A10,
-
-	APLD = 0x0D50,          /* South Korea */
-
-	MKK1 = 0x0140,          /* Japan (UNI-1 odd) */
-	MKK2 = 0x0240,          /* Japan (4.9 GHz + UNI-1 odd) */
-	MKK3 = 0x0340,          /* Japan (UNI-1 even) */
-	MKK4 = 0x0440,          /* Japan (UNI-1 even + UNI-2) */
-	MKK5 = 0x0540,          /* Japan (UNI-1 even + UNI-2 + mid-band) */
-	MKK6 = 0x0640,          /* Japan (UNI-1 odd + UNI-1 even) */
-	MKK7 = 0x0740,          /* Japan (UNI-1 odd + UNI-1 even + UNI-2 */
-	MKK8 = 0x0840,          /* Japan (UNI-1 odd + UNI-1 even + UNI-2 + mid-band) */
-	MKK9 = 0x0940,          /* Japan (UNI-1 even + 4.9 GHZ) */
-	MKK10 = 0x0B40,         /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */
-	MKK11 = 0x1140,         /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */
-	MKK12 = 0x1240,         /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */
-	MKK13 = 0x0C40,         /* Same as MKK8 but all passive and no adhoc 11a */
-	MKK14 = 0x1440,         /* Japan UNI-1 even + UNI-1 odd + 4.9GHz */
-	MKK15 = 0x1540,         /* Japan UNI-1 even + UNI-1 odd + UNI-2 + 4.9GHz */
-	MKKA = 0x0A40,          /* Japan */
-	MKKC = 0x0A50,
-
-	NULL1 = 0x0198,
-	WORLD = 0x0199,
-	DEBUG_REG_DMN = 0x01ff,
-};
-
-enum {                          /* conformance test limits */
-	FCC = 0x10,
-	MKK = 0x40,
-	ETSI = 0x30,
-};
-/*
- * The following are flags for different requirements per reg domain.
- * These requirements are either inhereted from the reg domain pair or
- * from the unitary reg domain if the reg domain pair flags value is
- * 0
- */
-
-enum {
-	NO_REQ = 0x00000000,
-	DISALLOW_ADHOC_11A = 0x00000001,
-	DISALLOW_ADHOC_11A_TURB = 0x00000002,
-	NEED_NFC = 0x00000004,
-
-	ADHOC_PER_11D = 0x00000008,     /* Start Ad-Hoc mode */
-	ADHOC_NO_11A = 0x00000010,
-
-	PUBLIC_SAFETY_DOMAIN = 0x00000020,      /* public safety domain */
-	LIMIT_FRAME_4MS = 0x00000040,   /* 4msec limit on the frame length */
-
-	NO_HOSTAP = 0x00000080, /* No HOSTAP mode opereation */
-
-	REQ_MASK = 0x000000FF,  /* Requirements bit mask */
-};
-
-static const REG_DMN_PAIR_MAPPING ah_cmn_reg_domain_pairs[] = {
-	{NO_ENUMRD, DEBUG_REG_DMN, DEBUG_REG_DMN, NO_REQ, NO_REQ, PSCAN_DEFER,
-	 0},
-	{NULL1_WORLD, NULL1, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{NULL1_ETSIB, NULL1, ETSIB, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{NULL1_ETSIC, NULL1, ETSIC, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-
-	{FCC2_FCCA, FCC2, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC2_WORLD, FCC2, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC2_ETSIC, FCC2, ETSIC, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC3_FCCA, FCC3, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC3_WORLD, FCC3, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC3_ETSIC, FCC3, ETSIC, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC4_FCCA, FCC4, FCCA, DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 NO_REQ, PSCAN_DEFER, 0},
-	{FCC5_FCCA, FCC5, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC6_FCCA, FCC6, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC6_WORLD, FCC6, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-
-	{ETSI1_WORLD, ETSI1, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{ETSI2_WORLD, ETSI2, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{ETSI3_WORLD, ETSI3, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{ETSI4_WORLD, ETSI4, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{ETSI5_WORLD, ETSI5, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{ETSI6_WORLD, ETSI6, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{ETSI8_WORLD, ETSI8, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{ETSI9_WORLD, ETSI9, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-
-	{ETSI3_ETSIA, ETSI3, WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{FRANCE_RES, ETSI3, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-
-	{FCC1_WORLD, FCC1, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{FCC1_FCCA, FCC1, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL1_WORLD, APL1, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL2_WORLD, APL2, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL2_FCCA, APL2, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL3_WORLD, APL3, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL4_WORLD, APL4, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL5_WORLD, APL5, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL6_WORLD, APL6, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL7_FCCA, APL7, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL8_WORLD, APL8, WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL9_MKKC, APL9, MKKC, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL10_MKKC, APL10, MKKC, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL3_FCCA, APL3, FCCA, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL1_ETSIC, APL1, ETSIC, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{APL2_ETSIC, APL2, ETSIC, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-
-	{MKK1_MKKA, MKK1, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKKA, CTRY_JAPAN},
-	{MKK1_MKKB, MKK1, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK1 | PSCAN_MKKA | PSCAN_MKKA_G,
-	 CTRY_JAPAN1},
-	{MKK1_FCCA, MKK1, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1, CTRY_JAPAN2},
-	{MKK1_MKKA1, MKK1, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN4},
-	{MKK1_MKKA2, MKK1, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN5},
-	{MKK1_MKKC, MKK1, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1, CTRY_JAPAN6},
-
-	/* MKK2 */
-	{MKK2_MKKA, MKK2, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK2 | PSCAN_MKKA | PSCAN_MKKA_G,
-	 CTRY_JAPAN3},
-
-	/* MKK3 */
-	{MKK3_MKKA, MKK3, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKKA, CTRY_JAPAN25},
-	{MKK3_MKKB, MKK3, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN7},
-	{MKK3_MKKA1, MKK3, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN26},
-	{MKK3_MKKA2, MKK3, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN8},
-	{MKK3_MKKC, MKK3, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 NO_PSCAN, CTRY_JAPAN9},
-	{MKK3_FCCA, MKK3, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 NO_PSCAN, CTRY_JAPAN27},
-
-	/* MKK4 */
-	{MKK4_MKKA, MKK4, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN36},
-	{MKK4_MKKB, MKK4, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G,
-	 CTRY_JAPAN10},
-	{MKK4_MKKA1, MKK4, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN28},
-	{MKK4_MKKA2, MKK4, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN11},
-	{MKK4_MKKC, MKK4, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN12},
-	{MKK4_FCCA, MKK4, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN29},
-
-	/* MKK5 */
-/*	{MKK5_MKKA,     MKK5,           MKKA,           DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3, CTRY_JAPAN56 },*/
-	{MKK5_MKKB, MKK5, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G,
-	 CTRY_JAPAN13},
-	{MKK5_MKKA2, MKK5, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN14},
-	{MKK5_MKKC, MKK5, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN15},
-	{MKK5_FCCA,     MKK5,       FCCA,       DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3, CTRY_JAPAN56 },
-
-	/* MKK6 */
-	{MKK6_MKKB, MKK6, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN16},
-	{MKK6_MKKA1, MKK6, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN30},
-	{MKK6_MKKA2, MKK6, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN17},
-	{MKK6_MKKC, MKK6, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1, CTRY_JAPAN18},
-	{MKK6_FCCA, MKK6, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1, CTRY_JAPAN31},
-
-	/* MKK7 */
-	{MKK7_MKKB, MKK7, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN19},
-	{MKK7_MKKA1, MKK7, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN32},
-	{MKK7_MKKA2, MKK7, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN20},
-	{MKK7_MKKC, MKK7, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3, CTRY_JAPAN21},
-	{MKK7_FCCA, MKK7, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3, CTRY_JAPAN33},
-
-	/* MKK8 */
-	{MKK8_MKKB, MKK8, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN22},
-	{MKK8_MKKA2, MKK8, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN23},
-	{MKK8_MKKC, MKK8, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3, CTRY_JAPAN24},
-
-	{MKK9_MKKA, MKK9, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3, CTRY_JAPAN34},
-	{MKK9_FCCA, MKK9, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 NO_PSCAN, CTRY_JAPAN37},
-	{MKK9_MKKA1, MKK9, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN38},
-	{MKK9_MKKA2, MKK9, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN40},
-	{MKK9_MKKC, MKK9, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 NO_PSCAN, CTRY_JAPAN39},
-
-	{MKK10_MKKA, MKK10, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC, PSCAN_MKK3, CTRY_JAPAN35},
-	{MKK10_FCCA, MKK10, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN41},
-	{MKK10_MKKA1, MKK10, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN42},
-	{MKK10_MKKA2, MKK10, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN44},
-	{MKK10_MKKC, MKK10, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN43},
-
-	{MKK11_MKKA, MKK11, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN45},
-	{MKK11_FCCA, MKK11, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN46},
-	{MKK11_MKKA1, MKK11, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN47},
-	{MKK11_MKKA2, MKK11, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN49},
-	{MKK11_MKKC, MKK11, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK3, CTRY_JAPAN48},
-
-	{MKK12_MKKA, MKK12, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3, CTRY_JAPAN50},
-	{MKK12_FCCA, MKK12, FCCA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3, CTRY_JAPAN51},
-	{MKK12_MKKA1, MKK12, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN52},
-	{MKK12_MKKA2, MKK12, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA2 | PSCAN_MKKA2_G, CTRY_JAPAN54},
-	{MKK12_MKKC, MKK12, MKKC,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3, CTRY_JAPAN53},
-
-	{MKK13_MKKB, MKK13, MKKA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB | NEED_NFC |
-	 LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA | PSCAN_MKKA_G, CTRY_JAPAN57},
-
-	{MKK14_MKKA1, MKK14, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN58},
-	{MKK15_MKKA1, MKK15, MKKA,
-	 DISALLOW_ADHOC_11A_TURB | NEED_NFC | LIMIT_FRAME_4MS, NEED_NFC,
-	 PSCAN_MKK1 | PSCAN_MKK3 | PSCAN_MKKA1 | PSCAN_MKKA1_G, CTRY_JAPAN59},
-
-	/* These are super domains */
-	{WOR0_WORLD, WOR0_WORLD, WOR0_WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{WOR1_WORLD, WOR1_WORLD, WOR1_WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{WOR2_WORLD, WOR2_WORLD, WOR2_WORLD, DISALLOW_ADHOC_11A_TURB, NO_REQ,
-	 PSCAN_DEFER, 0},
-	{WOR3_WORLD, WOR3_WORLD, WOR3_WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{WOR4_WORLD, WOR4_WORLD, WOR4_WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{WOR5_ETSIC, WOR5_ETSIC, WOR5_ETSIC,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{WOR01_WORLD, WOR01_WORLD, WOR01_WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{WOR02_WORLD, WOR02_WORLD, WOR02_WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{EU1_WORLD, EU1_WORLD, EU1_WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-	{WOR9_WORLD, WOR9_WORLD, WOR9_WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{WORA_WORLD, WORA_WORLD, WORA_WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{WORB_WORLD, WORB_WORLD, WORB_WORLD,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB, NO_REQ, PSCAN_DEFER, 0},
-	{WORC_WORLD, WORC_WORLD, WORC_WORLD, NO_REQ, NO_REQ, PSCAN_DEFER, 0},
-};
-
-static const COUNTRY_CODE_TO_ENUM_RD ah_cmn_all_countries[] = {
-	{CTRY_DEBUG, NO_ENUMRD, "DB", "DEBUG", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_DEFAULT, DEF_REGDMN, "NA", "NO_COUNTRY_SET", YES, YES, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_ALBANIA, NULL1_WORLD, "AL", "ALBANIA", YES, NO, YES, YES, YES, NO,
-	 NO, NO, 7000},
-	{CTRY_ALGERIA, NULL1_WORLD, "DZ", "ALGERIA", YES, NO, YES, YES, YES, NO,
-	 NO, NO, 7000},
-	{CTRY_ARGENTINA, FCC3_WORLD, "AR", "ARGENTINA", YES, NO, NO, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_ARMENIA, ETSI4_WORLD, "AM", "ARMENIA", YES, NO, YES, YES, YES,
-	 YES, NO, NO, 7000},
-	{CTRY_ARUBA, ETSI1_WORLD, "AW", "ARUBA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_AUSTRALIA, FCC3_WORLD, "AU", "AUSTRALIA", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_AUSTRALIA2, FCC6_WORLD, "AU", "AUSTRALIA2", YES, YES, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_AUSTRIA, ETSI1_WORLD, "AT", "AUSTRIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_AZERBAIJAN, ETSI4_WORLD, "AZ", "AZERBAIJAN", YES, YES, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_BAHAMAS, FCC3_WORLD, "BS", "BAHAMAS", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_BAHRAIN, APL6_WORLD, "BH", "BAHRAIN", YES, NO, YES, YES, YES, YES,
-	 NO, NO, 7000},
-	{CTRY_BANGLADESH, NULL1_WORLD, "BD", "BANGLADESH", YES, NO, YES, YES,
-	 YES, NO, NO, NO, 7000},
-	{CTRY_BARBADOS, FCC2_WORLD, "BB", "BARBADOS", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_BELARUS, ETSI1_WORLD, "BY", "BELARUS", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_BELGIUM, ETSI1_WORLD, "BE", "BELGIUM", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_BELGIUM2, ETSI4_WORLD, "BE", "BELGIUM2", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_BELIZE, APL1_ETSIC, "BZ", "BELIZE", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_BERMUDA, FCC3_FCCA, "BM", "BERMUDA", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_BOLIVIA, APL1_ETSIC, "BO", "BOLIVIA", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_BOSNIA_HERZ, ETSI1_WORLD, "BA", "BOSNIA AND HERZEGOVINA", YES, NO,
-	 YES, YES, YES, YES, YES, YES, 7000},
-	{CTRY_BRAZIL, FCC3_WORLD, "BR", "BRAZIL", YES, NO, NO, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_BRUNEI_DARUSSALAM, APL6_WORLD, "BN", "BRUNEI DARUSSALAM", YES,
-	 YES, YES, YES, YES, YES, YES, YES, 7000},
-	{CTRY_BULGARIA, ETSI1_WORLD, "BG", "BULGARIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_CAMBODIA, ETSI1_WORLD, "KH", "CAMBODIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_CANADA, FCC3_FCCA, "CA", "CANADA", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_CANADA2, FCC6_FCCA, "CA", "CANADA2", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_CHILE, APL6_WORLD, "CL", "CHILE", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_CHINA, APL1_WORLD, "CN", "CHINA", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_COLOMBIA, FCC1_FCCA, "CO", "COLOMBIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_COSTA_RICA, FCC1_WORLD, "CR", "COSTA RICA", YES, NO, YES, YES,
-	 YES, YES, NO, NO, 7000},
-	{CTRY_CROATIA, ETSI1_WORLD, "HR", "CROATIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_CYPRUS, ETSI1_WORLD, "CY", "CYPRUS", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_CZECH, ETSI1_WORLD, "CZ", "CZECH REPUBLIC", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_DENMARK, ETSI1_WORLD, "DK", "DENMARK", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_DOMINICAN_REPUBLIC, FCC1_FCCA, "DO", "DOMINICAN REPUBLIC", YES,
-	 YES, YES, YES, YES, YES, YES, YES, 7000},
-	{CTRY_ECUADOR, FCC1_WORLD, "EC", "ECUADOR", YES, NO, NO, YES, YES, YES,
-	 NO, NO, 7000},
-	{CTRY_EGYPT, ETSI3_WORLD, "EG", "EGYPT", YES, NO, YES, YES, YES, YES,
-	 NO, NO, 7000},
-	{CTRY_EL_SALVADOR, FCC1_WORLD, "SV", "EL SALVADOR", YES, NO, YES, YES,
-	 YES, YES, NO, NO, 7000},
-	{CTRY_ESTONIA, ETSI1_WORLD, "EE", "ESTONIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_FINLAND, ETSI1_WORLD, "FI", "FINLAND", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_FRANCE, ETSI1_WORLD, "FR", "FRANCE", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_GEORGIA, ETSI4_WORLD, "GE", "GEORGIA", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_GERMANY, ETSI1_WORLD, "DE", "GERMANY", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_GREECE, ETSI1_WORLD, "GR", "GREECE", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_GREENLAND, ETSI1_WORLD, "GL", "GREENLAND", YES, NO, YES, YES, YES,
-	 YES, NO, NO, 7000},
-	{CTRY_GRENADA, FCC3_FCCA, "GD", "GRENADA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_GUAM, FCC1_FCCA, "GU", "GUAM", YES, NO, YES, YES, YES, YES, NO,
-	 NO, 7000},
-	{CTRY_GUATEMALA, FCC1_FCCA, "GT", "GUATEMALA", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_HAITI, ETSI1_WORLD, "HT", "HAITI", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_HONDURAS, FCC3_WORLD, "HN", "HONDURAS", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_HONG_KONG, FCC3_WORLD, "HK", "HONG KONG", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_HUNGARY, ETSI1_WORLD, "HU", "HUNGARY", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_ICELAND, ETSI1_WORLD, "IS", "ICELAND", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_INDIA, APL6_WORLD, "IN", "INDIA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_INDONESIA, APL2_WORLD, "ID", "INDONESIA", YES, NO, YES, YES, YES,
-	 YES, NO, NO, 7000},
-	{CTRY_IRAN, APL1_WORLD, "IR", "IRAN", YES, YES, YES, YES, YES, YES, YES,
-	 YES, 7000},
-	{CTRY_IRELAND, ETSI1_WORLD, "IE", "IRELAND", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_ISRAEL, ETSI3_WORLD, "IL", "ISRAEL", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_ITALY, ETSI1_WORLD, "IT", "ITALY", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_JAMAICA, FCC3_WORLD, "JM", "JAMAICA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_JAPAN, MKK5_MKKA2, "JP", "JAPAN", YES, NO, NO, YES, YES, YES, NO,
-	 NO, 7000},
-	{CTRY_JAPAN1, MKK1_MKKB, "JP", "JAPAN1", YES, NO, NO, YES, YES, YES, NO,
-	 NO, 7000},
-	{CTRY_JAPAN2, MKK1_FCCA, "JP", "JAPAN2", YES, NO, NO, YES, YES, YES, NO,
-	 NO, 7000},
-	{CTRY_JAPAN3, MKK2_MKKA, "JP", "JAPAN3", YES, NO, NO, YES, YES, YES, NO,
-	 NO, 7000},
-	{CTRY_JAPAN4, MKK1_MKKA1, "JP", "JAPAN4", YES, NO, NO, YES, YES, YES,
-	 NO, NO, 7000},
-	{CTRY_JAPAN5, MKK1_MKKA2, "JP", "JAPAN5", YES, NO, NO, YES, YES, YES,
-	 NO, NO, 7000},
-	{CTRY_JAPAN6, MKK1_MKKC, "JP", "JAPAN6", YES, NO, NO, YES, YES, YES, NO,
-	 NO, 7000},
-	{CTRY_JAPAN7, MKK3_MKKB, "JP", "JAPAN7", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN8, MKK3_MKKA2, "JP", "JAPAN8", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN9, MKK3_MKKC, "JP", "JAPAN9", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN10, MKK4_MKKB, "JP", "JAPAN10", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN11, MKK4_MKKA2, "JP", "JAPAN11", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN12, MKK4_MKKC, "JP", "JAPAN12", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN13, MKK5_MKKB, "JP", "JAPAN13", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN14, MKK5_MKKA2, "JP", "JAPAN14", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN15, MKK5_MKKC, "JP", "JAPAN15", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN16, MKK6_MKKB, "JP", "JAPAN16", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN17, MKK6_MKKA2, "JP", "JAPAN17", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN18, MKK6_MKKC, "JP", "JAPAN18", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN19, MKK7_MKKB, "JP", "JAPAN19", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN20, MKK7_MKKA2, "JP", "JAPAN20", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN21, MKK7_MKKC, "JP", "JAPAN21", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN22, MKK8_MKKB, "JP", "JAPAN22", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN23, MKK8_MKKA2, "JP", "JAPAN23", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN24, MKK8_MKKC, "JP", "JAPAN24", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN25, MKK3_MKKA, "JP", "JAPAN25", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN26, MKK3_MKKA1, "JP", "JAPAN26", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN27, MKK3_FCCA, "JP", "JAPAN27", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN28, MKK4_MKKA1, "JP", "JAPAN28", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN29, MKK4_FCCA, "JP", "JAPAN29", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN30, MKK6_MKKA1, "JP", "JAPAN30", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN31, MKK6_FCCA, "JP", "JAPAN31", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN32, MKK7_MKKA1, "JP", "JAPAN32", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN33, MKK7_FCCA, "JP", "JAPAN33", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN34, MKK9_MKKA, "JP", "JAPAN34", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN35, MKK10_MKKA, "JP", "JAPAN35", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN36, MKK4_MKKA, "JP", "JAPAN36", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN37, MKK9_FCCA, "JP", "JAPAN37", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN38, MKK9_MKKA1, "JP", "JAPAN38", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN39, MKK9_MKKC, "JP", "JAPAN39", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN40, MKK9_MKKA2, "JP", "JAPAN40", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN41, MKK10_FCCA, "JP", "JAPAN41", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN42, MKK10_MKKA1, "JP", "JAPAN42", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN43, MKK10_MKKC, "JP", "JAPAN43", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN44, MKK10_MKKA2, "JP", "JAPAN44", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN45, MKK11_MKKA, "JP", "JAPAN45", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN46, MKK11_FCCA, "JP", "JAPAN46", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN47, MKK11_MKKA1, "JP", "JAPAN47", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN48, MKK11_MKKC, "JP", "JAPAN48", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN49, MKK11_MKKA2, "JP", "JAPAN49", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN50, MKK12_MKKA, "JP", "JAPAN50", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN51, MKK12_FCCA, "JP", "JAPAN51", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN52, MKK12_MKKA1, "JP", "JAPAN52", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN53, MKK12_MKKC, "JP", "JAPAN53", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN54, MKK12_MKKA2, "JP", "JAPAN54", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-/*    {CTRY_JAPAN55,     MKK5_MKKA,     "JP", "JAPAN55",        YES,  NO,  NO, YES, YES, YES, YES, NO, 7000 },*/
-	{CTRY_JAPAN56,     MKK5_FCCA,     "JP", "JAPAN56",        YES,  NO,  NO,
-	 YES, YES, YES, YES, NO, 7000 },
-	{CTRY_JAPAN57, MKK13_MKKB, "JP", "JAPAN57", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN58, MKK14_MKKA1, "JP", "JAPAN58", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JAPAN59, MKK15_MKKA1, "JP", "JAPAN59", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_JORDAN, ETSI2_WORLD, "JO", "JORDAN", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_KAZAKHSTAN, NULL1_WORLD, "KZ", "KAZAKHSTAN", YES, NO, YES, YES,
-	 YES, NO, NO, NO, 7000},
-	{CTRY_KENYA, APL1_WORLD, "KE", "KENYA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_KOREA_NORTH, APL9_MKKC, "KP", "NORTH KOREA", YES, NO, NO, YES,
-	 NO, YES, NO, NO, 7000},
-	{CTRY_KOREA_ROC, APL10_MKKC, "KR", "KOREA REPUBLIC", YES, NO, NO, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_KOREA_ROC3, APL9_MKKC, "KR", "KOREA REPUBLIC3", YES, NO, NO, YES,
-	 NO, YES, NO, NO, 7000},
-	{CTRY_KUWAIT, ETSI3_WORLD, "KW", "KUWAIT", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_LATVIA, ETSI1_WORLD, "LV", "LATVIA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_LEBANON, APL1_WORLD, "LB", "LEBANON", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_LIECHTENSTEIN, ETSI1_WORLD, "LI", "LIECHTENSTEIN", YES, NO, YES,
-	 YES, YES, YES, YES, YES, 7000},
-	{CTRY_LITHUANIA, ETSI1_WORLD, "LT", "LITHUANIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_LUXEMBOURG, ETSI1_WORLD, "LU", "LUXEMBOURG", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_MACAU, FCC2_WORLD, "MO", "MACAU SAR", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_MACEDONIA, ETSI1_WORLD, "MK", "MACEDONIA, FYRO", YES, NO, YES,
-	 YES, YES, YES, YES, YES, 7000},
-	{CTRY_MALAYSIA, FCC1_WORLD, "MY", "MALAYSIA", YES, NO, NO, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_MALTA, ETSI1_WORLD, "MT", "MALTA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_MAURITIUS, ETSI1_WORLD, "MU", "MAURITIUS", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_MEXICO, FCC1_WORLD, "MX", "MEXICO", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_MONACO, ETSI4_WORLD, "MC", "MONACO", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_MOROCCO, APL4_WORLD, "MA", "MOROCCO", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_NEPAL, APL1_WORLD, "NP", "NEPAL", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_NETHERLANDS, ETSI1_WORLD, "NL", "NETHERLANDS", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_NETHERLANDS_ANTILLES, ETSI1_WORLD, "AN", "NETHERLANDS ANTILLES",
-	 YES, NO, YES, YES, YES, YES, YES, YES, 7000},
-	{CTRY_NEW_ZEALAND, FCC3_ETSIC, "NZ", "NEW ZEALAND", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_NICARAGUA, FCC3_FCCA, "NI", "NICARAGUA", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_NORWAY, ETSI1_WORLD, "NO", "NORWAY", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_OMAN, FCC3_WORLD, "OM", "OMAN", YES, NO, YES, YES, YES, YES, YES,
-	 YES, 7000},
-	{CTRY_PAKISTAN, APL1_WORLD, "PK", "PAKISTAN", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_PANAMA, FCC1_FCCA, "PA", "PANAMA", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_PAPUA_NEW_GUINEA, FCC1_WORLD, "PG", "PAPUA NEW GUINEA", YES, YES,
-	 YES, YES, YES, YES, YES, YES, 7000},
-	{CTRY_PARAGUAY, FCC3_WORLD, "PY", "PARAGUAY", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_PERU, FCC3_WORLD, "PE", "PERU", YES, NO, YES, YES, YES, YES, YES,
-	 YES, 7000},
-	{CTRY_PHILIPPINES, FCC3_WORLD, "PH", "PHILIPPINES", YES, YES, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_POLAND, ETSI1_WORLD, "PL", "POLAND", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_PORTUGAL, ETSI1_WORLD, "PT", "PORTUGAL", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_PUERTO_RICO, FCC1_FCCA, "PR", "PUERTO RICO", YES, YES, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_QATAR, APL1_WORLD, "QA", "QATAR", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_ROMANIA, ETSI1_WORLD, "RO", "ROMANIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_RUSSIA, ETSI8_WORLD, "RU", "RUSSIA", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_RWANDA, APL1_WORLD, "RW", "RWANDA", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_SAUDI_ARABIA, FCC2_WORLD, "SA", "SAUDI ARABIA", YES, NO, YES, YES,
-	 YES, YES, NO, NO, 7000},
-	{CTRY_SERBIA, ETSI1_WORLD, "RS", "REPUBLIC OF SERBIA", YES, NO, YES,
-	 YES, YES, YES, YES, YES, 7000},
-	{CTRY_MONTENEGRO, ETSI1_WORLD, "ME", "MONTENEGRO", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_SINGAPORE, FCC3_WORLD, "SG", "SINGAPORE", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_SLOVAKIA, ETSI1_WORLD, "SK", "SLOVAKIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_SLOVENIA, ETSI1_WORLD, "SI", "SLOVENIA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_SOUTH_AFRICA, FCC3_WORLD, "ZA", "SOUTH AFRICA", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_SPAIN, ETSI1_WORLD, "ES", "SPAIN", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_SRI_LANKA, FCC3_WORLD, "LK", "SRI LANKA", YES, NO, YES, YES, YES,
-	 YES, NO, NO, 7000},
-	{CTRY_SWEDEN, ETSI1_WORLD, "SE", "SWEDEN", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_SWITZERLAND, ETSI1_WORLD, "CH", "SWITZERLAND", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_SYRIA, NULL1_WORLD, "SY", "SYRIAN ARAB REPUBLIC", YES, NO, YES,
-	 YES, YES, NO, NO, NO, 7000},
-	{CTRY_TAIWAN, APL7_FCCA, "TW", "TAIWAN", YES, YES, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_TANZANIA, APL1_WORLD, "TZ", "TANZANIA", YES, YES, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_THAILAND, FCC3_WORLD, "TH", "THAILAND", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_TRINIDAD_Y_TOBAGO, FCC3_WORLD, "TT", "TRINIDAD AND TOBAGO", YES,
-	 NO, YES, YES, YES, YES, YES, YES, 7000},
-	{CTRY_TUNISIA, ETSI3_WORLD, "TN", "TUNISIA", YES, NO, YES, YES, YES,
-	 YES, NO, NO, 7000},
-	{CTRY_TURKEY, ETSI3_WORLD, "TR", "TURKEY", YES, NO, YES, YES, YES, YES,
-	 NO, NO, 7000},
-	{CTRY_UGANDA, FCC3_WORLD, "UG", "UGANDA", YES, NO, NO, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_UKRAINE, ETSI9_WORLD, "UA", "UKRAINE", YES, NO, NO, YES, YES, YES,
-	 YES, NO, 7000},
-	{CTRY_UAE, ETSI1_WORLD, "AE", "UNITED ARAB EMIRATES", YES, NO, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB", "UNITED KINGDOM", YES, NO, YES,
-	 YES, YES, YES, YES, YES, 7000},
-	{CTRY_UNITED_STATES, FCC3_FCCA, "US", "UNITED STATES", YES, YES, YES,
-	 YES, YES, YES, YES, YES, 5825},
-	{CTRY_UNITED_STATES2, FCC6_FCCA, "US", "UNITED STATES2", YES, YES, YES,
-	 YES, YES, YES, YES, YES, 7000},
-	{CTRY_UNITED_STATES_FCC49, FCC4_FCCA, "PS",
-	 "UNITED STATES (PUBLIC SAFETY)", YES, YES, YES, YES, YES, YES, YES,
-	 YES, 7000},
-	{CTRY_URUGUAY, FCC3_WORLD, "UY", "URUGUAY", YES, NO, YES, YES, YES, YES,
-	 YES, YES, 7000},
-	{CTRY_UZBEKISTAN, FCC3_FCCA, "UZ", "UZBEKISTAN", YES, YES, YES, YES,
-	 YES, YES, YES, YES, 7000},
-	{CTRY_VENEZUELA, FCC1_WORLD, "VE", "VENEZUELA", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_VIET_NAM, ETSI3_WORLD, "VN", "VIET NAM", YES, NO, YES, YES, YES,
-	 YES, YES, YES, 7000},
-	{CTRY_YEMEN, NULL1_WORLD, "YE", "YEMEN", YES, NO, YES, YES, YES, NO, NO,
-	 NO, 7000},
-	{CTRY_ZIMBABWE, NULL1_WORLD, "ZW", "ZIMBABWE", YES, NO, YES, YES, YES,
-	 NO, NO, NO, 7000}
-};
-
-/* Bit masks for DFS per regdomain */
-
-enum {
-	NO_DFS = 0x0000000000000000ULL,
-	DFS_FCC3 = 0x0000000000000001ULL,
-	DFS_ETSI = 0x0000000000000002ULL,
-	DFS_MKK4 = 0x0000000000000004ULL,
-};
-
-/* The table of frequency bands is indexed by a bitmask.  The ordering
- * must be consistent with the enum below.  When adding a new
- * frequency band, be sure to match the location in the enum with the
- * comments
- */
-
-/*
- * 5GHz 11A channel tags
- */
-enum {
-	F1_4912_4947,
-	F1_4915_4925,
-	F2_4915_4925,
-	F1_4935_4945,
-	F2_4935_4945,
-	F1_4920_4980,
-	F2_4920_4980,
-	F1_4942_4987,
-	F1_4945_4985,
-	F1_4950_4980,
-	F1_5032_5057,
-	F1_5035_5040,
-	F2_5035_5040,
-	F1_5035_5045,
-	F1_5040_5040,
-	F1_5040_5080,
-	F2_5040_5080,
-	F1_5055_5055,
-	F2_5055_5055,
-
-	F1_5120_5240,
-
-	F1_5170_5230,
-	F2_5170_5230,
-
-	F1_5180_5240,
-	F2_5180_5240,
-	F3_5180_5240,
-	F4_5180_5240,
-	F5_5180_5240,
-	F6_5180_5240,
-	F7_5180_5240,
-	F8_5180_5240,
-	F9_5180_5240,
-	F10_5180_5240,
-
-	F1_5240_5280,
-
-	F1_5260_5280,
-
-	F1_5260_5320,
-	F2_5260_5320,
-	F3_5260_5320,
-	F4_5260_5320,
-	F5_5260_5320,
-	F6_5260_5320,
-	F7_5260_5320,
-
-	F1_5260_5700,
-
-	F1_5280_5320,
-	F2_5280_5320,
-	F1_5500_5560,
-
-	F1_5500_5580,
-	F2_5500_5580,
-
-	F1_5500_5620,
-
-	F1_5500_5660,
-
-	F1_5500_5720,
-	F2_5500_5700,
-	F3_5500_5700,
-	F4_5500_5700,
-	F5_5500_5700,
-	F6_5500_5700,
-
-	F1_5660_5700,
-	F2_5660_5720,
-	F3_5660_5720,
-
-	F1_5745_5765,
-
-	F1_5745_5805,
-	F2_5745_5805,
-	F3_5745_5805,
-	F4_5745_5805,
-
-	F1_5745_5825,
-	F2_5745_5825,
-	F3_5745_5825,
-	F4_5745_5825,
-	F5_5745_5825,
-	F6_5745_5825,
-	F7_5745_5825,
-	F8_5745_5825,
-	F9_5745_5825,
-
-	F1_5845_5865,
-
-	W1_4920_4980,
-	W1_5040_5080,
-	W1_5170_5230,
-	W1_5180_5240,
-	W1_5260_5320,
-	W1_5745_5825,
-	W1_5500_5700,
-	A_DEMO_ALL_CHANNELS
-};
-
-static const REG_DMN_FREQ_BAND reg_dmn5_ghz_freq[] = {
-	{4915, 4925, 20, 0, 10, 5, NO_DFS, PSCAN_MKK2, 16},     /* F1_4915_4925 */
-	{4915, 4925, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 16},     /* F2_4915_4925 */
-	{4935, 4945, 20, 0, 10, 5, NO_DFS, PSCAN_MKK2, 16},     /* F1_4935_4945 */
-	{4935, 4945, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 16},     /* F2_4935_4945 */
-	{4920, 4980, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2, 7},     /* F1_4920_4980 */
-	{4920, 4980, 20, 0, 20, 20, NO_DFS, PSCAN_MKK2, 7},     /* F2_4920_4980 */
-	{4942, 4987, 27, 6, 5, 5, NO_DFS, PSCAN_FCC, 0},        /* F1_4942_4987 */
-	{4945, 4985, 30, 6, 10, 5, NO_DFS, PSCAN_FCC, 0},       /* F1_4945_4985 */
-	{4950, 4980, 33, 6, 20, 5, NO_DFS, PSCAN_FCC, 0},       /* F1_4950_4980 */
-	{5035, 5040, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 12},     /* F1_5035_5040 */
-	{5035, 5040, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 12},     /* F2_5035_5040 */
-	{5040, 5040, 20, 0, 10, 5, NO_DFS, PSCAN_MKK2, 12},     /* F1_5040_5040 */
-	{5040, 5080, 23, 0, 20, 20, NO_DFS, PSCAN_MKK2, 2},     /* F1_5040_5080 */
-	{5040, 5080, 20, 0, 20, 20, NO_DFS, NO_PSCAN, 6},       /* F2_5040_5080 */
-	{5055, 5055, 20, 0, 10, 5, NO_DFS, PSCAN_MKK2, 12},     /* F1_5055_5055 */
-	{5055, 5055, 23, 0, 10, 5, NO_DFS, PSCAN_MKK2, 12},     /* F2_5055_5055 */
-
-	{5120, 5240, 5, 6, 20, 20, NO_DFS, NO_PSCAN, 0},        /* F1_5120_5240 */
-
-	{5170, 5230, 23, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2, 1},        /* F1_5170_5230 */
-	{5170, 5230, 20, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK2, 1},        /* F2_5170_5230 */
-
-	{5180, 5240, 15, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 1}, /* F1_5180_5240 */
-	{5180, 5240, 17, 6, 20, 20, NO_DFS, NO_PSCAN, 1},       /* F2_5180_5240 */
-	{5180, 5240, 18, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 1}, /* F3_5180_5240 */
-	{5180, 5240, 20, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 1}, /* F4_5180_5240 */
-	{5180, 5240, 23, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 1}, /* F5_5180_5240 */
-	{5180, 5240, 23, 6, 20, 20, NO_DFS, PSCAN_FCC, 1},      /* F6_5180_5240 */
-	{5180, 5240, 20, 0, 20, 20, NO_DFS, PSCAN_MKK1 | PSCAN_MKK3, 0},        /* F7_5180_5240 */
-	{5180, 5240, 23, 6, 20, 20, NO_DFS, NO_PSCAN, 1},       /* F8_5180_5240 */
-	{5180, 5240, 20, 6, 20, 20, NO_DFS, PSCAN_ETSI, 0},     /* F9_5180_5240 */
-	{5180, 5240, 23, 0, 20, 20, NO_DFS, PSCAN_FCC | PSCAN_ETSI, 1}, /* F10_5180_5240 */
-
-	{5240, 5280, 23, 0, 20, 20, DFS_FCC3, PSCAN_FCC | PSCAN_ETSI, 0},       /* F1_5240_5280 */
-
-	{5260, 5280, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 2},    /* F1_5260_5280 */
-
-	{5260, 5320, 18, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 2},    /* F1_5260_5320 */
-
-	{5260, 5320, 20, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4,
-	 PSCAN_FCC | PSCAN_ETSI | PSCAN_MKK3, 0},
-	/* F2_5260_5320 */
-
-	{5260, 5320, 24, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 2},    /* F3_5260_5320 */
-	{5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 2}, /* F4_5260_5320 */
-	{5260, 5320, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 2}, /* F5_5260_5320 */
-	{5260, 5320, 30, 0, 20, 20, NO_DFS, NO_PSCAN, 2},       /* F6_5260_5320 */
-	{5260, 5320, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4,
-	 PSCAN_FCC | PSCAN_ETSI | PSCAN_MKK3, 0},
-	/* F7_5260_5320 */
-
-	{5260, 5700, 5, 6, 20, 20, DFS_FCC3 | DFS_ETSI, NO_PSCAN, 0},   /* F1_5260_5700 */
-
-	{5280, 5320, 17, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 2}, /* F1_5280_5320 */
-
-	{5500, 5580, 23, 6, 20, 20, DFS_FCC3, PSCAN_FCC, 4},    /* F1_5500_5580 */
-	{5500, 5580, 30, 6, 20, 20, DFS_FCC3, PSCAN_FCC, 4},    /* F2_5500_5580 */
-
-	{5500, 5620, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI, 3},   /* F1_5500_5620 */
-
-	{5500, 5660, 20, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 0},    /* F1_5500_5660 */
-
-	{5500, 5720, 24, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC, 4}, /* F1_5500_5720 */
-	{5500, 5700, 27, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 3},    /* F2_5500_5700 */
-	{5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 3},    /* F3_5500_5700 */
-	{5500, 5700, 23, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_MKK3 | PSCAN_FCC, 0}, /* F4_5500_5700 */
-	{5500, 5700, 30, 6, 20, 20, DFS_ETSI, PSCAN_ETSI, 0},   /* F5_5500_5700 */
-	{5500, 5700, 20, 0, 20, 20, DFS_FCC3 | DFS_ETSI | DFS_MKK4, PSCAN_MKK3 | PSCAN_FCC, 0}, /* F6_5500_5700 */
-
-	{5660, 5700, 20, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 4},    /* F1_5660_5700 */
-	{5660, 5700, 23, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 4},    /* F2_5660_5700 */
-	{5660, 5700, 30, 6, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, 4},    /* F3_5660_5700 */
-
-	{5745, 5805, 23, 0, 20, 20, NO_DFS, NO_PSCAN, 3},       /* F1_5745_5805 */
-	{5745, 5805, 30, 6, 20, 20, NO_DFS, NO_PSCAN, 3},       /* F2_5745_5805 */
-	{5745, 5805, 30, 6, 20, 20, NO_DFS, PSCAN_ETSI, 0},     /* F3_5745_5805 */
-	{5745, 5805, 20, 0, 20, 20, NO_DFS, NO_PSCAN, 0},       /* F4_5745_5805 */
-
-	{5745, 5825, 5, 6, 20, 20, NO_DFS, NO_PSCAN, 5},        /* F1_5745_5825 */
-	{5745, 5825, 17, 0, 20, 20, NO_DFS, NO_PSCAN, 5},       /* F2_5745_5825 */
-	{5745, 5825, 20, 0, 20, 20, NO_DFS, NO_PSCAN, 0},       /* F3_5745_5825 */
-	{5745, 5825, 30, 0, 20, 20, NO_DFS, NO_PSCAN, 0},       /* F4_5745_5825 */
-	{5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN, 5},       /* F5_5745_5825 */
-	{5745, 5825, 30, 6, 20, 20, NO_DFS, NO_PSCAN, 5},       /* F6_5745_5825 */
-	{5745, 5825, 30, 6, 20, 20, NO_DFS, PSCAN_ETSI, 0},     /* F7_5745_5825 */
-	{5745, 5825, 20, 6, 20, 20, NO_DFS, PSCAN_ETSI, 0},     /* F8_5745_5825 */
-
-	/*
-	 * Below are the world roaming channels
-	 * All WWR domains have no power limit, instead use the card's CTL
-	 * or max power settings.
-	 */
-	{4920, 4980, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0},      /* W1_4920_4980 */
-	{5040, 5080, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0},      /* W1_5040_5080 */
-	{5170, 5230, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0},      /* W1_5170_5230 */
-	{5180, 5240, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0},      /* W1_5180_5240 */
-	{5260, 5320, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0}, /* W1_5260_5320 */
-	{5745, 5825, 30, 0, 20, 20, NO_DFS, PSCAN_WWR, 0},      /* W1_5745_5825 */
-	{5500, 5700, 30, 0, 20, 20, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, 0}, /* W1_5500_5700 */
-	{4920, 6100, 30, 6, 20, 20, NO_DFS, NO_PSCAN, 0},       /* A_DEMO_ALL_CHANNELS */
-};
-
-/*
- * 2GHz 11b channel tags
- */
-enum {
-	F1_2312_2372,
-	F2_2312_2372,
-
-	F1_2412_2472,
-	F2_2412_2472,
-	F3_2412_2472,
-	F4_2412_2472,
-
-	F1_2412_2462,
-	F2_2412_2462,
-
-	F1_2432_2442,
-
-	F1_2457_2472,
-
-	F1_2467_2472,
-
-	F1_2484_2484,
-	F2_2484_2484,
-
-	F1_2512_2732,
-
-	W1_2312_2372,
-	W1_2412_2412,
-	W1_2417_2432,
-	W1_2437_2442,
-	W1_2447_2457,
-	W1_2462_2462,
-	W1_2467_2467,
-	W2_2467_2467,
-	W1_2472_2472,
-	W2_2472_2472,
-	W1_2484_2484,
-	W2_2484_2484,
-};
-
-static const REG_DMN_FREQ_BAND reg_dmn2_ghz_freq[] = {
-	{2312, 2372, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* F1_2312_2372 */
-	{2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* F2_2312_2372 */
-
-	{2412, 2472, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* F1_2412_2472 */
-	{2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA, 30},     /* F2_2412_2472 */
-	{2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN, 4},        /* F3_2412_2472 */
-	{2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA, 0},      /* F4_2412_2472 */
-
-	{2412, 2462, 30, 6, 20, 5, NO_DFS, NO_PSCAN, 12},       /* F1_2412_2462 */
-	{2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA, 30},     /* F2_2412_2462 */
-
-	{2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 4},        /* F1_2432_2442 */
-
-	{2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* F1_2457_2472 */
-
-	{2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA, 30},       /* F1_2467_2472 */
-
-	{2484, 2484, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* F1_2484_2484 */
-	{2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA | PSCAN_MKKA1 | PSCAN_MKKA2, 31}, /* F2_2484_2484 */
-
-	{2512, 2732, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* F1_2512_2732 */
-
-	/*
-	 * WWR have powers opened up to 20dBm.  Limits should often come from CTL/Max powers
-	 */
-
-	{2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* W1_2312_2372 */
-	{2412, 2412, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* W1_2412_2412 */
-	{2417, 2432, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* W1_2417_2432 */
-	{2437, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* W1_2437_2442 */
-	{2447, 2457, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* W1_2447_2457 */
-	{2462, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* W1_2462_2462 */
-	{2467, 2467, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, /* W1_2467_2467 */
-	{2467, 2467, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0},  /* W2_2467_2467 */
-	{2472, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, /* W1_2472_2472 */
-	{2472, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0},  /* W2_2472_2472 */
-	{2484, 2484, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN, 0}, /* W1_2484_2484 */
-	{2484, 2484, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0},  /* W2_2484_2484 */
-};
-
-/*
- * 2GHz 11g channel tags
- */
-
-enum {
-	G1_2312_2372,
-	G2_2312_2372,
-
-	G1_2412_2472,
-	G2_2412_2472,
-	G3_2412_2472,
-	G4_2412_2472,
-
-	G1_2412_2462,
-	G2_2412_2462,
-
-	G1_2432_2442,
-
-	G1_2457_2472,
-
-	G1_2512_2732,
-
-	G1_2467_2472,
-	G2_2467_2472,
-
-	G1_2484_2484,
-
-	WG1_2312_2372,
-	WG1_2412_2462,
-	WG1_2412_2472,
-	WG2_2412_2472,
-	G_DEMO_ALMOST_ALL_CHANNELS,
-	G_DEMO_ALL_CHANNELS,
-};
-
-static const REG_DMN_FREQ_BAND reg_dmn2_ghz11g_freq[] = {
-	{2312, 2372, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* G1_2312_2372 */
-	{2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* G2_2312_2372 */
-
-	{2412, 2472, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* G1_2412_2472 */
-	{2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G | PSCAN_MKKA2 | PSCAN_MKKA | PSCAN_EXT_CHAN, 30},       /* G2_2412_2472 */
-	{2412, 2472, 30, 0, 20, 5, NO_DFS, NO_PSCAN, 4},        /* G3_2412_2472 */
-	{2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G | PSCAN_MKKA2 | PSCAN_MKKA | PSCAN_EXT_CHAN, 0},        /* G4_2412_2472 */
-
-	{2412, 2462, 30, 6, 20, 5, NO_DFS, NO_PSCAN, 12},       /* G1_2412_2462 */
-	{2412, 2462, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G, 30},   /* G2_2412_2462 */
-
-	{2432, 2442, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 4},        /* G1_2432_2442 */
-
-	{2457, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* G1_2457_2472 */
-
-	{2512, 2732, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* G1_2512_2732 */
-
-	{2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA2 | PSCAN_MKKA, 30},       /* G1_2467_2472 */
-	{2467, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_MKKA_G | PSCAN_MKKA2, 0},      /* G2_2467_2472 */
-
-	{2484, 2484, 5, 6, 20, 5, NO_DFS, NO_PSCAN, 0}, /* G1_2484_2484 */
-	/*
-	 * WWR open up the power to 20dBm
-	 */
-
-	{2312, 2372, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* WG1_2312_2372 */
-	{2412, 2462, 20, 0, 20, 5, NO_DFS, NO_PSCAN, 0},        /* WG1_2412_2462 */
-	{2412, 2472, 20, 0, 20, 5, NO_DFS, PSCAN_WWR | IS_ECM_CHAN | PSCAN_EXT_CHAN, 0},        /* WG1_2412_2472 */
-	{2412, 2472, 20, 0, 20, 5, NO_DFS, NO_PSCAN | IS_ECM_CHAN, 0},  /* WG2_2412_2472 */
-	{2312, 2532, 27, 6, 20, 5, NO_DFS, NO_PSCAN, 0},        /* G_DEMO_ALMOST_ALL_CHANNELS */
-	{2312, 2732, 27, 6, 20, 5, NO_DFS, NO_PSCAN, 0},        /* G_DEMO_ALL_CHANNELS */
-};
-
-/* regulatory capabilities */
-#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN    0x0080
-#define REGDMN_EEPROM_EEREGCAP_EN_KK_U2         0x0100
-#define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND    0x0200
-#define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD     0x0400
-
-static const JAPAN_BANDCHECK j_bandcheck[] = {
-	{F1_5170_5230, REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD},
-	{F4_5180_5240, REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN},
-	{F2_5260_5320, REGDMN_EEPROM_EEREGCAP_EN_KK_U2},
-	{F4_5500_5700, REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND}
-};
-
-static const COMMON_MODE_POWER common_mode_pwrtbl[] = {
-	{4900, 5000, 17},
-	{5000, 5100, 17},
-	{5150, 5250, 17},       /* ETSI & MKK */
-	{5250, 5350, 18},       /* ETSI */
-	{5470, 5725, 20},       /* ETSI */
-	{5725, 5825, 20},       /* Singapore */
-	{5825, 5850, 23} /* Korea */
-};
-
-/*
- * 5GHz Turbo (dynamic & static) tags
- */
-
-enum {
-	T1_5130_5650,
-	T1_5150_5670,
-
-	T1_5200_5200,
-	T2_5200_5200,
-	T3_5200_5200,
-	T4_5200_5200,
-	T5_5200_5200,
-	T6_5200_5200,
-	T7_5200_5200,
-	T8_5200_5200,
-
-	T1_5200_5280,
-	T2_5200_5280,
-	T3_5200_5280,
-	T4_5200_5280,
-	T5_5200_5280,
-	T6_5200_5280,
-
-	T1_5200_5240,
-	T1_5210_5210,
-	T2_5210_5210,
-	T3_5210_5210,
-	T4_5210_5210,
-	T5_5210_5210,
-	T6_5210_5210,
-	T7_5210_5210,
-	T8_5210_5210,
-	T9_5210_5210,
-	T10_5210_5210,
-	T1_5240_5240,
-
-	T1_5210_5250,
-	T1_5210_5290,
-	T2_5210_5290,
-	T3_5210_5290,
-
-	T1_5280_5280,
-	T2_5280_5280,
-	T1_5290_5290,
-	T2_5290_5290,
-	T3_5290_5290,
-	T1_5250_5290,
-	T2_5250_5290,
-	T3_5250_5290,
-	T4_5250_5290,
-
-	T1_5540_5660,
-	T2_5540_5660,
-	T3_5540_5660,
-	T1_5760_5800,
-	T2_5760_5800,
-	T3_5760_5800,
-	T4_5760_5800,
-	T5_5760_5800,
-	T6_5760_5800,
-	T7_5760_5800,
-
-	T1_5765_5805,
-	T2_5765_5805,
-	T3_5765_5805,
-	T4_5765_5805,
-	T5_5765_5805,
-	T6_5765_5805,
-	T7_5765_5805,
-	T8_5765_5805,
-	T9_5765_5805,
-
-	WT1_5210_5250,
-	WT1_5290_5290,
-	WT1_5540_5660,
-	WT1_5760_5800,
-};
-
-/*
- * 2GHz Dynamic turbo tags
- */
-#ifndef ATH_REMOVE_2G_TURBO_RD_TABLE
-enum {
-	T1_2312_2372,
-	T1_2437_2437,
-	T2_2437_2437,
-	T3_2437_2437,
-	T1_2512_2732
-};
-
-static const REG_DMN_FREQ_BAND reg_dmn2_ghz11g_turbo_freq[] = {
-	{2312, 2372, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0},        /* T1_2312_2372 */
-	{2437, 2437, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0},        /* T1_2437_2437 */
-	{2437, 2437, 20, 6, 40, 40, NO_DFS, NO_PSCAN, 0},       /* T2_2437_2437 */
-	{2437, 2437, 18, 6, 40, 40, NO_DFS, PSCAN_WWR, 0},      /* T3_2437_2437 */
-	{2512, 2732, 5, 6, 40, 40, NO_DFS, NO_PSCAN, 0},        /* T1_2512_2732 */
-};
-#endif /* ATH_REMOVE_2G_TURBO_RD_TABLE */
-
-static const REG_DOMAIN ah_cmn_reg_domains[] = {
-
-	{DEBUG_REG_DMN, FCC, DFS_FCC3, NO_PSCAN, NO_REQ,
-	 CHAN_11A_BM(A_DEMO_ALL_CHANNELS, F6_5745_5825,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(T1_5130_5650, T1_5150_5670, F6_5745_5825,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(T1_5200_5240, T1_5280_5280, T1_5540_5660, T1_5765_5805,
-		     -1, -1, -1, -1, -1, -1, -1, -1)
-	 BM(F1_2312_2372, F1_2412_2472, F1_2484_2484, F1_2512_2732,
-	    -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(G_DEMO_ALMOST_ALL_CHANNELS,
-	    G1_2484_2484, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T1_2312_2372, T1_2437_2437, T1_2512_2732,
-			 -1, -1, -1, -1, -1, -1, -1, -1, -1)},
-
-	{APL1, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 BM(F4_5745_5825, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL2, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 BM(F1_5745_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL3, FCC, DFS_FCC3, PSCAN_FCC, NO_REQ,
-	 BM(F1_5280_5320, F6_5745_5825, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5290_5290, T1_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL4, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 BM(F5_5180_5240, F9_5745_5825, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5210_5210, T3_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5200_5200, T3_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL5, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 BM(F2_5745_5825, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T4_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T4_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL6, ETSI, DFS_ETSI, PSCAN_FCC_T | PSCAN_FCC, NO_REQ,
-	 BM(F9_5180_5240, F2_5260_5320, F3_5745_5825, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T2_5210_5210, T1_5250_5290, T1_5760_5800, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T1_5200_5280, T5_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL7, FCC, DFS_FCC3 | DFS_ETSI, PSCAN_FCC | PSCAN_ETSI, NO_REQ,
-	 BM(F2_5280_5320, F2_5500_5580, F3_5660_5720, F7_5745_5825, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T3_5290_5290, T5_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5540_5660, T6_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL8, ETSI, NO_DFS, NO_PSCAN,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F6_5260_5320, F4_5745_5825, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5290_5290, T2_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5280_5280, T1_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL9, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F9_5180_5240, F2_5260_5320, F1_5500_5620, F3_5745_5805, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T3_5290_5290, T5_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5540_5660, T6_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL10, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F9_5180_5240, F2_5260_5320, F5_5500_5700, F3_5745_5805, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T3_5290_5290, T5_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5540_5660, T6_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL11, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F9_5180_5240, F2_5260_5320, F5_5500_5700, F7_5745_5825,
-	    F1_5845_5865, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T3_5290_5290, T5_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5540_5660, T6_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{APL12, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F5_5180_5240, F1_5500_5560, F1_5745_5765, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T2_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSI1, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F2_5180_5240, F2_5260_5320, F2_5500_5700, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T1_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5200_5280, T2_5540_5660, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSI2, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F3_5180_5240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T3_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSI3, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F4_5180_5240, F2_5260_5320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5200_5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSI4, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F3_5180_5240, F1_5260_5320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T3_5200_5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSI5, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_5180_5240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T4_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T3_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSI6, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F5_5180_5240, F1_5260_5280, F3_5500_5700, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T1_5210_5250, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T4_5200_5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSI8, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F4_5180_5240, F2_5260_5320, F1_5660_5700, F4_5745_5825, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T1_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5200_5280, T2_5540_5660, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 BMZERO},
-
-	{ETSI9, ETSI, DFS_ETSI, PSCAN_ETSI,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F4_5180_5240, F2_5260_5320, F1_5500_5660, F8_5745_5825, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T1_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T2_5200_5280, T2_5540_5660, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 BMZERO},
-
-	{FCC1, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 BM(F2_5180_5240, F4_5260_5320, F5_5745_5825, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T6_5210_5210, T2_5250_5290, T6_5760_5800, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T1_5200_5240, T2_5280_5280, T7_5765_5805, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{FCC2, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 BM(F6_5180_5240, F5_5260_5320, F6_5745_5825, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T7_5210_5210, T3_5250_5290, T2_5760_5800, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T7_5200_5200, T1_5240_5240, T2_5280_5280, T1_5765_5805, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{FCC3, FCC, DFS_FCC3, PSCAN_FCC | PSCAN_FCC_T, NO_REQ,
-	 BM(F2_5180_5240, F3_5260_5320, F1_5500_5720, F5_5745_5825, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T6_5210_5210, T2_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T4_5200_5200, T8_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-	/*
-
-	   Bug Fix: EV 98583 Public Safety channel
-	   Exclude the following channel in FCC Public safety domain
-	   Uni-1: 5180, 5200, 5220, 5240
-	   Uni-2: 5260, 5280, 5300, 5320
-	   Uni-3: 5745, 5765, 5785, 5805, 5825
-	 */
-	{FCC4, FCC, DFS_FCC3, PSCAN_FCC | PSCAN_FCC_T, NO_REQ,
-	 BM(F1_4942_4987, F1_4945_4985, F1_4950_4980, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T8_5210_5210, T4_5250_5290, T7_5760_5800, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T1_5200_5240, T1_5280_5280, T9_5765_5805, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{FCC5, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 BM(F2_5180_5240, F6_5745_5825, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T6_5210_5210, T2_5760_5800, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T8_5200_5200, T7_5765_5805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{FCC6, FCC, DFS_FCC3, PSCAN_FCC, NO_REQ,
-	 BM(F8_5180_5240, F5_5260_5320, F1_5500_5580, F2_5660_5720,
-	    F6_5745_5825, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T7_5210_5210, T3_5250_5290, T2_5760_5800, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T7_5200_5200, T1_5240_5240, T2_5280_5280, T1_5765_5805, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{MKK1, MKK, DFS_MKK4, PSCAN_MKK1 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_5170_5230, F10_5180_5240, F7_5260_5320, F4_5500_5700, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T7_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T5_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	{MKK2, MKK, DFS_MKK4, PSCAN_MKK2 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F2_4915_4925, F2_4935_4945, F1_4920_4980, F1_5035_5040,
-	    F2_5055_5055, F1_5040_5080, F1_5170_5230, F10_5180_5240, -1, -1, -1,
-	    -1),
-	 BM(T7_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T5_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 even */
-	{MKK3, MKK, NO_DFS, PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F4_5180_5240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T9_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 even + UNI-2 */
-	{MKK4, MKK, DFS_MKK4, PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F4_5180_5240, F2_5260_5320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T10_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T6_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 even + UNI-2 + mid-band */
-	{MKK5, MKK, DFS_MKK4, PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F4_5180_5240, F2_5260_5320, F6_5500_5700, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T3_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T5_5200_5280, T3_5540_5660, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 odd + even */
-	{MKK6, MKK, NO_DFS, PSCAN_MKK1, DISALLOW_ADHOC_11A_TURB,
-	 BM(F2_5170_5230, F4_5180_5240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T3_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T6_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 odd + UNI-1 even + UNI-2 */
-	{MKK7, MKK, DFS_MKK4, PSCAN_MKK1 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F2_5170_5230, F4_5180_5240, F2_5260_5320, -1, -1, -1, -1, -1, -1,
-	    -1, -1, -1),
-	 BM(T3_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T5_5200_5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 odd + UNI-1 even + UNI-2 + mid-band */
-	{MKK8, MKK, DFS_MKK4, PSCAN_MKK1 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F2_5170_5230, F4_5180_5240, F2_5260_5320, F6_5500_5700, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BM(T3_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T5_5200_5280, T3_5540_5660, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 even + 4.9 GHZ */
-	{MKK9, MKK, NO_DFS, PSCAN_MKK2 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_4912_4947, F1_5032_5057, F1_4915_4925, F1_4935_4945,
-	    F2_4920_4980, F1_5035_5045, F1_5055_5055, F2_5040_5080,
-	    F4_5180_5240, -1, -1, -1),
-	 BM(T9_5210_5210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5200_5200, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 even + UNI-2 + 4.9 GHZ */
-	{MKK10, MKK, DFS_MKK4, PSCAN_MKK2 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_4912_4947, F1_5032_5057, F1_4915_4925, F1_4935_4945,
-	    F2_4920_4980, F1_5035_5045, F1_5055_5055, F2_5040_5080,
-	    F4_5180_5240, F2_5260_5320, -1, -1),
-	 BM(T3_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5200_5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz */
-	{MKK11, MKK, DFS_MKK4, PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_4912_4947, F1_5032_5057, F1_4915_4925, F1_4935_4945,
-	    F2_4920_4980, F1_5035_5045, F1_5055_5055, F2_5040_5080,
-	    F4_5180_5240, F2_5260_5320, F6_5500_5700, -1),
-	 BM(T3_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5200_5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz */
-	{MKK12, MKK, DFS_MKK4, PSCAN_MKK1 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_4915_4925, F1_4935_4945, F2_4920_4980, F1_5040_5040,
-	    F1_5055_5055, F2_5040_5080, F2_5170_5230, F4_5180_5240,
-	    F2_5260_5320, F6_5500_5700, -1, -1),
-	 BM(T3_5210_5290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(T1_5200_5280, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 odd + UNI-1 even + UNI-2 + mid-band */
-	{MKK13, MKK, DFS_MKK4, PSCAN_MKK1 | PSCAN_MKK3,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 BM(F2_5170_5230, F7_5180_5240, F2_5260_5320, F6_5500_5700, -1, -1, -1,
-	    -1, -1, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 odd + UNI-1 even + 4.9GHz */
-	{MKK14, MKK, DFS_MKK4, PSCAN_MKK1, DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_4915_4925, F1_4935_4945, F2_4920_4980, F1_5040_5040,
-	    F2_5040_5080, F1_5055_5055, F2_5170_5230, F4_5180_5240, -1, -1, -1,
-	    -1),
-	 BMZERO,
-	 BMZERO,
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/* UNI-1 odd + UNI-1 even + UNI-2 + 4.9GHz */
-	{MKK15, MKK, DFS_MKK4, PSCAN_MKK1 | PSCAN_MKK3, DISALLOW_ADHOC_11A_TURB,
-	 BM(F1_4915_4925, F1_4935_4945, F2_4920_4980, F1_5040_5040,
-	    F2_5040_5080, F1_5055_5055, F2_5170_5230, F4_5180_5240,
-	    F2_5260_5320, -1, -1, -1),
-	 BMZERO,
-	 BMZERO,
-	 BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-
-	/*=== 2 GHz ===*/
-
-	/* Defined here to use when 2G channels are authorised for country K2 */
-	{APLD, NO_CTL, NO_DFS, NO_PSCAN, NO_REQ,
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(F2_2312_2372, F4_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(G2_2312_2372, G4_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BMZERO},
-
-	{ETSIA, NO_CTL, NO_DFS, PSCAN_ETSIA,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 CHAN_11A_BMZERO CHAN_11A_BMZERO CHAN_11A_BMZERO BM(F1_2457_2472, -1,
-							    -1, -1, -1, -1, -1,
-							    -1, -1, -1, -1, -1),
-	 BM(G1_2457_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T2_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{ETSIB, ETSI, NO_DFS, PSCAN_ETSIB,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 CHAN_11A_BMZERO CHAN_11A_BMZERO CHAN_11A_BMZERO BM(F1_2432_2442, -1,
-							    -1, -1, -1, -1, -1,
-							    -1, -1, -1, -1, -1),
-	 BM(G1_2432_2442, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T2_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{ETSIC, ETSI, NO_DFS, PSCAN_ETSIC,
-	 DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB,
-	 CHAN_11A_BMZERO CHAN_11A_BMZERO CHAN_11A_BMZERO BM(F3_2412_2472, -1,
-							    -1, -1, -1, -1, -1,
-							    -1, -1, -1, -1, -1),
-	 BM(G3_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T2_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{FCCA, FCC, NO_DFS, NO_PSCAN, NO_REQ,
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(F1_2412_2462, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(G1_2412_2462, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T2_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{MKKA, MKK, NO_DFS,
-	 PSCAN_MKKA | PSCAN_MKKA_G | PSCAN_MKKA1 | PSCAN_MKKA1_G | PSCAN_MKKA2 |
-	 PSCAN_MKKA2_G, DISALLOW_ADHOC_11A_TURB,
-	 CHAN_11A_BMZERO CHAN_11A_BMZERO CHAN_11A_BMZERO BM(F2_2412_2462,
-							    F1_2467_2472,
-							    F2_2484_2484,
-							    -1, -1, -1, -1, -1,
-							    -1, -1, -1, -1),
-	 BM(G2_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T2_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{MKKC, MKK, NO_DFS, NO_PSCAN, NO_REQ,
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(F2_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(G2_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T2_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WORLD, ETSI, NO_DFS, NO_PSCAN, NO_REQ,
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(F4_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 BM(G4_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T2_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR0_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_PER_11D,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5745_5825, W1_5500_5700,
-		     -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, W1_2484_2484, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR01_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_PER_11D,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5170_5230, W1_5745_5825,
-		     W1_5500_5700, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2417_2432,
-	    W1_2447_2457,
-	    -1, -1, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2462, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR02_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_PER_11D,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5170_5230, W1_5745_5825,
-		     W1_5500_5700, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{EU1_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_PER_11D,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5170_5230, W1_5745_5825,
-		     W1_5500_5700, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W2_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W2_2467_2467, -1, -1, -1, -1, -1),
-	 BM(WG2_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR1_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_NO_11A,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5170_5230, W1_5745_5825,
-		     W1_5500_5700, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, W1_2484_2484, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR2_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_NO_11A,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5170_5230, W1_5745_5825,
-		     W1_5500_5700, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, W1_2484_2484, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR3_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_PER_11D,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5170_5230, W1_5745_5825,
-		     -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR4_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_NO_11A,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5745_5825,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2417_2432,
-	    W1_2447_2457,
-	    -1, -1, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2462, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR5_ETSIC, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_NO_11A,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5745_5825,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WOR9_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_NO_11A,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5745_5825, W1_5500_5700,
-		     -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BM(WT1_5210_5250, WT1_5290_5290, WT1_5760_5800,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2417_2432,
-	    W1_2447_2457,
-	    -1, -1, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2462, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WORA_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_NO_11A,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5745_5825, W1_5500_5700,
-		     -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WORB_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_NO_11A,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5500_5700,
-		     -1, -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{WORC_WORLD, NO_CTL, DFS_FCC3 | DFS_ETSI, PSCAN_WWR, ADHOC_PER_11D,
-	 CHAN_11A_BM(W1_5260_5320, W1_5180_5240, W1_5500_5700, W1_5745_5825,
-		     -1, -1, -1, -1, -1, -1, -1, -1)
-	 CHAN_11A_BMZERO
-	 CHAN_11A_BMZERO
-	 BM(W1_2412_2412, W1_2437_2442, W1_2462_2462, W1_2472_2472,
-	    W1_2417_2432,
-	    W1_2447_2457, W1_2467_2467, -1, -1, -1, -1, -1),
-	 BM(WG1_2412_2472, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1),
-	 CHAN_TURBO_G_BM(T3_2437_2437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-			 -1)},
-
-	{NULL1, NO_CTL, NO_DFS, NO_PSCAN, NO_REQ,
-	 CHAN_11A_BMZERO CHAN_11A_BMZERO CHAN_11A_BMZERO BMZERO,
-	 BMZERO,
-	 CHAN_TURBO_G_BMZERO},
-};
-
-static const struct cmode modes[] = {
-	{REGDMN_MODE_TURBO, IEEE80211_CHAN_ST}, /* TURBO means 11a Static Turbo */
-	{REGDMN_MODE_11A, IEEE80211_CHAN_A},
-	{REGDMN_MODE_11B, IEEE80211_CHAN_B},
-	{REGDMN_MODE_11G, IEEE80211_CHAN_PUREG},
-	{REGDMN_MODE_11G_TURBO, IEEE80211_CHAN_108G},
-	{REGDMN_MODE_11A_TURBO, IEEE80211_CHAN_108A},
-	{REGDMN_MODE_11NG_HT20, IEEE80211_CHAN_11NG_HT20},
-	{REGDMN_MODE_11NG_HT40PLUS, IEEE80211_CHAN_11NG_HT40PLUS},
-	{REGDMN_MODE_11NG_HT40MINUS, IEEE80211_CHAN_11NG_HT40MINUS},
-	{REGDMN_MODE_11NA_HT20, IEEE80211_CHAN_11NA_HT20},
-	{REGDMN_MODE_11NA_HT40PLUS, IEEE80211_CHAN_11NA_HT40PLUS},
-	{REGDMN_MODE_11NA_HT40MINUS, IEEE80211_CHAN_11NA_HT40MINUS},
-	{REGDMN_MODE_11AC_VHT20, IEEE80211_CHAN_11AC_VHT20},
-	{REGDMN_MODE_11AC_VHT40PLUS, IEEE80211_CHAN_11AC_VHT40PLUS},
-	{REGDMN_MODE_11AC_VHT40MINUS, IEEE80211_CHAN_11AC_VHT40MINUS},
-	{REGDMN_MODE_11AC_VHT80, IEEE80211_CHAN_11AC_VHT80},
-	{REGDMN_MODE_11AC_VHT20_2G, IEEE80211_CHAN_11AC_VHT20_2G},
-	{REGDMN_MODE_11AC_VHT40_2G, IEEE80211_CHAN_11AC_VHT40_2G},
-	{REGDMN_MODE_11AC_VHT80_2G, IEEE80211_CHAN_11AC_VHT80_2G},
-};
-
-typedef enum offset {
-	BW20 = 0,
-	BW40_LOW_PRIMARY = 1,
-	BW40_HIGH_PRIMARY = 3,
-	BW80,
-	BWALL
-} offset_t;
-
-typedef struct _regdm_op_class_map {
-	uint8_t op_class;
-	uint8_t ch_spacing;
-	offset_t offset;
-	uint8_t channels[MAX_CHANNELS_PER_OPERATING_CLASS];
-} regdm_op_class_map_t;
-
-typedef struct _regdm_supp_op_classes {
-	uint8_t num_classes;
-	uint8_t classes[SIR_MAC_MAX_SUPP_OPER_CLASSES];
-} regdm_supp_op_classes;
-
-uint16_t cds_regdm_get_opclass_from_channel(uint8_t *country, uint8_t channel,
-					    uint8_t offset);
-uint16_t cds_regdm_get_chanwidth_from_opclass(uint8_t *country, uint8_t channel,
-					    uint8_t opclass);
-uint16_t cds_regdm_set_curr_opclasses(uint8_t num_classes, uint8_t *class);
-uint16_t cds_regdm_get_curr_opclasses(uint8_t *num_classes, uint8_t *class);

+ 0 - 443
core/cds/inc/cds_sched.h

@@ -1,443 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined( __CDS_SCHED_H )
-#define __CDS_SCHED_H
-
-/**=========================================================================
-
-   \file  cds_sched.h
-
-   \brief Connectivity driver services scheduler
-
-   ========================================================================*/
-
-/*--------------------------------------------------------------------------
-   Include Files
-   ------------------------------------------------------------------------*/
-#include <cdf_event.h>
-#include "i_cdf_types.h"
-#include <linux/wait.h>
-#if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)
-#include <linux/wakelock.h>
-#endif
-#include <cds_mq.h>
-#include <cdf_types.h>
-#include "cdf_lock.h"
-
-#define TX_POST_EVENT_MASK               0x001
-#define TX_SUSPEND_EVENT_MASK            0x002
-#define MC_POST_EVENT_MASK               0x001
-#define MC_SUSPEND_EVENT_MASK            0x002
-#define RX_POST_EVENT_MASK               0x001
-#define RX_SUSPEND_EVENT_MASK            0x002
-#define TX_SHUTDOWN_EVENT_MASK           0x010
-#define MC_SHUTDOWN_EVENT_MASK           0x010
-#define RX_SHUTDOWN_EVENT_MASK           0x010
-#define WD_POST_EVENT_MASK               0x001
-#define WD_SHUTDOWN_EVENT_MASK           0x002
-#define WD_CHIP_RESET_EVENT_MASK         0x004
-#define WD_WLAN_SHUTDOWN_EVENT_MASK      0x008
-#define WD_WLAN_REINIT_EVENT_MASK        0x010
-
-/*
- * Maximum number of messages in the system
- * These are buffers to account for all current messages
- * with some accounting of what we think is a
- * worst-case scenario.  Must be able to handle all
- * incoming frames, as well as overhead for internal
- * messaging
- *
- * Increased to 8000 to handle more RX frames
- */
-#define CDS_CORE_MAX_MESSAGES 8000
-
-#ifdef QCA_CONFIG_SMP
-/*
-** Maximum number of cds messages to be allocated for
-** OL Rx thread.
-*/
-#define CDS_MAX_OL_RX_PKT 4000
-
-typedef void (*cds_ol_rx_thread_cb)(void *context, void *rxpkt, uint16_t staid);
-#endif
-
-/*
-** CDF Message queue definition.
-*/
-typedef struct _cds_mq_type {
-	/* Lock use to synchronize access to this message queue */
-	spinlock_t mqLock;
-
-	/* List of vOS Messages waiting on this queue */
-	struct list_head mqList;
-
-} cds_mq_type, *p_cds_mq_type;
-
-#ifdef QCA_CONFIG_SMP
-/*
-** CDS message wrapper for data rx from TXRX
-*/
-struct cds_ol_rx_pkt {
-	struct list_head list;
-	void *context;
-
-	/* Rx skb */
-	void *Rxpkt;
-
-	/* Station id to which this packet is destined */
-	uint16_t staId;
-
-	/* Call back to further send this packet to txrx layer */
-	cds_ol_rx_thread_cb callback;
-
-};
-#endif
-
-/*
-** CDS Scheduler context
-** The scheduler context contains the following:
-**   ** the messages queues
-**   ** the handle to the tread
-**   ** pointer to the events that gracefully shutdown the MC and Tx threads
-**
-*/
-typedef struct _cds_sched_context {
-	/* Place holder to the CDS Context */
-	void *pVContext;
-	/* WMA Message queue on the Main thread */
-	cds_mq_type wmaMcMq;
-
-	/* PE Message queue on the Main thread */
-	cds_mq_type peMcMq;
-
-	/* SME Message queue on the Main thread */
-	cds_mq_type smeMcMq;
-
-	/* SYS Message queue on the Main thread */
-	cds_mq_type sysMcMq;
-
-	/* Handle of Event for MC thread to signal startup */
-	struct completion McStartEvent;
-
-	struct task_struct *McThread;
-
-	/* completion object for MC thread shutdown */
-	struct completion McShutdown;
-
-	/* Wait queue for MC thread */
-	wait_queue_head_t mcWaitQueue;
-
-	unsigned long mcEventFlag;
-
-	/* Completion object to resume Mc thread */
-	struct completion ResumeMcEvent;
-
-	/* lock to make sure that McThread suspend/resume mechanism is in sync */
-	spinlock_t McThreadLock;
-#ifdef QCA_CONFIG_SMP
-	spinlock_t ol_rx_thread_lock;
-
-	/* OL Rx thread handle */
-	struct task_struct *ol_rx_thread;
-
-	/* Handle of Event for Rx thread to signal startup */
-	struct completion ol_rx_start_event;
-
-	/* Completion object to suspend OL rx thread */
-	struct completion ol_suspend_rx_event;
-
-	/* Completion objext to resume OL rx thread */
-	struct completion ol_resume_rx_event;
-
-	/* Completion object for OL Rxthread shutdown */
-	struct completion ol_rx_shutdown;
-
-	/* Waitq for OL Rx thread */
-	wait_queue_head_t ol_rx_wait_queue;
-
-	unsigned long ol_rx_event_flag;
-
-	/* Rx buffer queue */
-	struct list_head ol_rx_thread_queue;
-
-	/* Spinlock to synchronize between tasklet and thread */
-	spinlock_t ol_rx_queue_lock;
-
-	/* Rx queue length */
-	unsigned int ol_rx_queue_len;
-
-	/* Lock to synchronize free buffer queue access */
-	spinlock_t cds_ol_rx_pkt_freeq_lock;
-
-	/* Free message queue for OL Rx processing */
-	struct list_head cds_ol_rx_pkt_freeq;
-
-	/* cpu hotplug notifier */
-	struct notifier_block *cpu_hot_plug_notifier;
-#endif
-} cds_sched_context, *p_cds_sched_context;
-
-/**
- * struct cds_log_complete - Log completion internal structure
- * @is_fatal: Type is fatal or not
- * @indicator: Source of bug report
- * @reason_code: Reason code for bug report
- * @is_report_in_progress: If bug report is in progress
- *
- * This structure internally stores the log related params
- */
-struct cds_log_complete {
-	uint32_t is_fatal;
-	uint32_t indicator;
-	uint32_t reason_code;
-	bool is_report_in_progress;
-};
-
-/*
-** CDS Sched Msg Wrapper
-** Wrapper messages so that they can be chained to their respective queue
-** in the scheduler.
-*/
-typedef struct _cds_msg_wrapper {
-	/* Message node */
-	struct list_head msgNode;
-
-	/* the Vos message it is associated to */
-	cds_msg_t *pVosMsg;
-
-} cds_msg_wrapper, *p_cds_msg_wrapper;
-
-typedef struct _cds_context_type {
-	/* Messages buffers */
-	cds_msg_t aMsgBuffers[CDS_CORE_MAX_MESSAGES];
-
-	cds_msg_wrapper aMsgWrappers[CDS_CORE_MAX_MESSAGES];
-
-	/* Free Message queue */
-	cds_mq_type freeVosMq;
-
-	/* Scheduler Context */
-	cds_sched_context cdf_sched;
-
-	/* HDD Module Context  */
-	void *pHDDContext;
-
-	/* MAC Module Context  */
-	void *pMACContext;
-
-	cdf_event_t ProbeEvent;
-
-	uint32_t driver_state;
-
-	cdf_event_t wmaCompleteEvent;
-
-	/* WMA Context */
-	void *pWMAContext;
-
-	void *pHIFContext;
-
-	void *htc_ctx;
-
-	/*
-	 * cdf_ctx will be used by cdf
-	 * while allocating dma memory
-	 * to access dev information.
-	 */
-	cdf_device_t cdf_ctx;
-
-	void *pdev_txrx_ctx;
-
-	/* Configuration handle used to get system configuration */
-	void *cfg_ctx;
-
-	bool is_wakelock_log_enabled;
-	uint32_t wakelock_log_level;
-	uint32_t connectivity_log_level;
-	uint32_t packet_stats_log_level;
-	uint32_t driver_debug_log_level;
-	uint32_t fw_debug_log_level;
-	struct cds_log_complete log_complete;
-	cdf_spinlock_t bug_report_lock;
-	cdf_event_t connection_update_done_evt;
-	cdf_mutex_t cdf_conc_list_lock;
-
-} cds_context_type, *p_cds_contextType;
-
-/*---------------------------------------------------------------------------
-   Function declarations and documenation
-   ---------------------------------------------------------------------------*/
-
-#ifdef QCA_CONFIG_SMP
-/*---------------------------------------------------------------------------
-   \brief cds_drop_rxpkt_by_staid() - API to drop pending Rx packets for a sta
-   The \a cds_drop_rxpkt_by_staid() drops queued packets for a station, to drop
-   all the pending packets the caller has to send WLAN_MAX_STA_COUNT as staId.
-   \param  pSchedContext - pointer to the global CDS Sched Context
-   \param staId - Station Id
-
-   \return Nothing
-   \sa cds_drop_rxpkt_by_staid()
-   -------------------------------------------------------------------------*/
-void cds_drop_rxpkt_by_staid(p_cds_sched_context pSchedContext, uint16_t staId);
-
-/*---------------------------------------------------------------------------
-   \brief cds_indicate_rxpkt() - API to Indicate rx data packet
-   The \a cds_indicate_rxpkt() enqueues the rx packet onto ol_rx_thread_queue
-   and notifies cds_ol_rx_thread().
-   \param  Arg - pointer to the global CDS Sched Context
-   \param pkt - Vos data message buffer
-
-   \return Nothing
-   \sa cds_indicate_rxpkt()
-   -------------------------------------------------------------------------*/
-void cds_indicate_rxpkt(p_cds_sched_context pSchedContext,
-			struct cds_ol_rx_pkt *pkt);
-
-/*---------------------------------------------------------------------------
-   \brief cds_alloc_ol_rx_pkt() - API to return next available cds message
-   The \a cds_alloc_ol_rx_pkt() returns next available cds message buffer
-   used for Rx Data processing.
-   \param pSchedContext - pointer to the global CDS Sched Context
-
-   \return pointer to cds message buffer
-   \sa cds_alloc_ol_rx_pkt()
-   -------------------------------------------------------------------------*/
-struct cds_ol_rx_pkt *cds_alloc_ol_rx_pkt(p_cds_sched_context pSchedContext);
-
-/*---------------------------------------------------------------------------
-   \brief cds_free_ol_rx_pkt() - API to release cds message to the freeq
-   The \a cds_free_ol_rx_pkt() returns the cds message used for Rx data
-   to the free queue.
-   \param  pSchedContext - pointer to the global CDS Sched Context
-   \param  pkt - Vos message buffer to be returned to free queue.
-
-   \return Nothing
-   \sa cds_free_ol_rx_pkt()
-   -------------------------------------------------------------------------*/
-void cds_free_ol_rx_pkt(p_cds_sched_context pSchedContext,
-			 struct cds_ol_rx_pkt *pkt);
-/*---------------------------------------------------------------------------
-   \brief cds_free_ol_rx_pkt_freeq() - Free cdss buffer free queue
-   The \a cds_free_ol_rx_pkt_freeq() does mem free of the buffers
-   available in free cds buffer queue which is used for Data rx processing
-   from Tlshim.
-   \param pSchedContext - pointer to the global CDS Sched Context
-
-   \return Nothing
-   \sa cds_free_ol_rx_pkt_freeq()
-   -------------------------------------------------------------------------*/
-void cds_free_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext);
-#endif
-
-/*---------------------------------------------------------------------------
-
-   \brief cds_sched_open() - initialize the CDS Scheduler
-
-   The \a cds_sched_open() function initializes the CDS Scheduler
-   Upon successful initialization:
-
-     - All the message queues are initialized
-
-     - The Main Controller thread is created and ready to receive and
-       dispatch messages.
-
-     - The Tx thread is created and ready to receive and dispatch messages
-
-   \param  p_cds_context - pointer to the global CDF Context
-
-   \param  p_cds_sched_context - pointer to a previously allocated buffer big
-          enough to hold a scheduler context.
- \
-
-   \return CDF_STATUS_SUCCESS - Scheduler was successfully initialized and
-          is ready to be used.
-
-          CDF_STATUS_E_RESOURCES - System resources (other than memory)
-          are unavailable to initilize the scheduler
-
-          CDF_STATUS_E_NOMEM - insufficient memory exists to initialize
-          the scheduler
-
-          CDF_STATUS_E_INVAL - Invalid parameter passed to the scheduler Open
-          function
-
-          CDF_STATUS_E_FAILURE - Failure to initialize the scheduler/
-
-   \sa cds_sched_open()
-
-   -------------------------------------------------------------------------*/
-CDF_STATUS cds_sched_open(void *p_cds_context,
-			  p_cds_sched_context pSchedCxt, uint32_t SchedCtxSize);
-
-/*---------------------------------------------------------------------------
-
-   \brief cds_sched_close() - Close the CDS Scheduler
-
-   The \a cds_sched_closes() function closes the CDS Scheduler
-   Upon successful closing:
-
-     - All the message queues are flushed
-
-     - The Main Controller thread is closed
-
-     - The Tx thread is closed
-
-   \param  p_cds_context - pointer to the global CDF Context
-
-   \return CDF_STATUS_SUCCESS - Scheduler was successfully initialized and
-          is ready to be used.
-
-          CDF_STATUS_E_INVAL - Invalid parameter passed to the scheduler Open
-          function
-
-          CDF_STATUS_E_FAILURE - Failure to initialize the scheduler/
-
-   \sa cds_sched_close()
-
-   ---------------------------------------------------------------------------*/
-CDF_STATUS cds_sched_close(void *p_cds_context);
-
-/* Helper routines provided to other CDS API's */
-CDF_STATUS cds_mq_init(p_cds_mq_type pMq);
-void cds_mq_deinit(p_cds_mq_type pMq);
-void cds_mq_put(p_cds_mq_type pMq, p_cds_msg_wrapper pMsgWrapper);
-p_cds_msg_wrapper cds_mq_get(p_cds_mq_type pMq);
-bool cds_is_mq_empty(p_cds_mq_type pMq);
-p_cds_sched_context get_cds_sched_ctxt(void);
-CDF_STATUS cds_sched_init_mqs(p_cds_sched_context pSchedContext);
-void cds_sched_deinit_mqs(p_cds_sched_context pSchedContext);
-void cds_sched_flush_mc_mqs(p_cds_sched_context pSchedContext);
-
-void cdf_timer_module_init(void);
-void cds_ssr_protect_init(void);
-void cds_ssr_protect(const char *caller_func);
-void cds_ssr_unprotect(const char *caller_func);
-bool cds_wait_for_external_threads_completion(const char *caller_func);
-int cds_get_gfp_flags(void);
-
-#endif /* #if !defined __CDS_SCHED_H */

+ 0 - 189
core/cds/inc/cds_utils.h

@@ -1,189 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined( __CDS_UTILS_H )
-#define __CDS_UTILS_H
-
-/**=========================================================================
-
-   \file  cds_utils.h
-
-   \brief Connectivity driver services (CDS) utility APIs
-
-   Various utility functions
-
-   ========================================================================*/
-
-/*--------------------------------------------------------------------------
-   Include Files
-   ------------------------------------------------------------------------*/
-#include <cdf_types.h>
-#include <cdf_status.h>
-#include <cdf_event.h>
-#include "ani_global.h"
-
-/*--------------------------------------------------------------------------
-   Preprocessor definitions and constants
-   ------------------------------------------------------------------------*/
-#define CDS_DIGEST_SHA1_SIZE    (20)
-#define CDS_DIGEST_MD5_SIZE     (16)
-#define CDS_BAND_2GHZ          (1)
-#define CDS_BAND_5GHZ          (2)
-
-#define CDS_24_GHZ_BASE_FREQ   (2407)
-#define CDS_5_GHZ_BASE_FREQ    (5000)
-#define CDS_24_GHZ_CHANNEL_14  (14)
-#define CDS_24_GHZ_CHANNEL_15  (15)
-#define CDS_24_GHZ_CHANNEL_27  (27)
-#define CDS_5_GHZ_CHANNEL_170  (170)
-#define CDS_CHAN_SPACING_5MHZ  (5)
-#define CDS_CHAN_SPACING_20MHZ (20)
-#define CDS_CHAN_14_FREQ       (2484)
-#define CDS_CHAN_15_FREQ       (2512)
-#define CDS_CHAN_170_FREQ      (5852)
-
-#define cds_log(level, args...) CDF_TRACE(CDF_MODULE_ID_CDF, level, ## args)
-#define cds_logfl(level, format, args...) cds_log(level, FL(format), ## args)
-
-#define cds_alert(format, args...) \
-		cds_logfl(CDF_TRACE_LEVEL_FATAL, format, ## args)
-#define cds_err(format, args...) \
-		cds_logfl(CDF_TRACE_LEVEL_ERROR, format, ## args)
-#define cds_warn(format, args...) \
-		cds_logfl(CDF_TRACE_LEVEL_WARN, format, ## args)
-#define cds_notice(format, args...) \
-		cds_logfl(CDF_TRACE_LEVEL_INFO, format, ## args)
-#define cds_info(format, args...) \
-		cds_logfl(CDF_TRACE_LEVEL_INFO_HIGH, format, ## args)
-#define cds_debug(format, args...) \
-		cds_logfl(CDF_TRACE_LEVEL_DEBUG, format, ## args)
-/*--------------------------------------------------------------------------
-   Type declarations
-   ------------------------------------------------------------------------*/
-
-/*-------------------------------------------------------------------------
-   Function declarations and documenation
-   ------------------------------------------------------------------------*/
-
-CDF_STATUS cds_crypto_init(uint32_t *phCryptProv);
-
-CDF_STATUS cds_crypto_deinit(uint32_t hCryptProv);
-
-/**
- * cds_rand_get_bytes
-
- * FUNCTION:
- * Returns cryptographically secure pseudo-random bytes.
- *
- *
- * @param pbBuf - the caller allocated location where the bytes should be copied
- * @param numBytes the number of bytes that should be generated and
- * copied
- *
- * @return CDF_STATUS_SUCCSS if the operation succeeds
- */
-CDF_STATUS cds_rand_get_bytes(uint32_t handle, uint8_t *pbBuf,
-			      uint32_t numBytes);
-
-/**
- * cds_sha1_hmac_str
- *
- * FUNCTION:
- * Generate the HMAC-SHA1 of a string given a key.
- *
- * LOGIC:
- * Standard HMAC processing from RFC 2104. The code is provided in the
- * appendix of the RFC.
- *
- * ASSUMPTIONS:
- * The RFC is correct.
- *
- * @param text text to be hashed
- * @param textLen length of text
- * @param key key to use for HMAC
- * @param keyLen length of key
- * @param digest holds resultant SHA1 HMAC (20B)
- *
- * @return CDF_STATUS_SUCCSS if the operation succeeds
- *
- */
-CDF_STATUS cds_sha1_hmac_str(uint32_t cryptHandle,      /* Handle */
-			     uint8_t * text,    /* pointer to data stream */
-			     uint32_t textLen,  /* length of data stream */
-			     uint8_t * key,     /* pointer to authentication key */
-			     uint32_t keyLen,   /* length of authentication key */
-			     uint8_t digest[CDS_DIGEST_SHA1_SIZE]);     /* caller digest to be filled in */
-
-/**
- * cds_md5_hmac_str
- *
- * FUNCTION:
- * Generate the HMAC-MD5 of a string given a key.
- *
- * LOGIC:
- * Standard HMAC processing from RFC 2104. The code is provided in the
- * appendix of the RFC.
- *
- * ASSUMPTIONS:
- * The RFC is correct.
- *
- * @param text text to be hashed
- * @param textLen length of text
- * @param key key to use for HMAC
- * @param keyLen length of key
- * @param digest holds resultant MD5 HMAC (16B)
- *
- * @return CDF_STATUS_SUCCSS if the operation succeeds
- *
- */
-CDF_STATUS cds_md5_hmac_str(uint32_t cryptHandle,       /* Handle */
-			    uint8_t * text,     /* pointer to data stream */
-			    uint32_t textLen,   /* length of data stream */
-			    uint8_t * key,      /* pointer to authentication key */
-			    uint32_t keyLen,    /* length of authentication key */
-			    uint8_t digest[CDS_DIGEST_MD5_SIZE]);       /* caller digest to be filled in */
-
-CDF_STATUS cds_encrypt_aes(uint32_t cryptHandle,        /* Handle */
-			   uint8_t *pText,      /* pointer to data stream */
-			   uint8_t *Encrypted, uint8_t *pKey);          /* pointer to authentication key */
-
-CDF_STATUS cds_decrypt_aes(uint32_t cryptHandle,        /* Handle */
-			   uint8_t *pText,      /* pointer to data stream */
-			   uint8_t *pDecrypted, uint8_t *pKey);         /* pointer to authentication key */
-
-uint32_t cds_chan_to_freq(uint8_t chan);
-uint8_t cds_freq_to_chan(uint32_t freq);
-uint8_t cds_chan_to_band(uint32_t chan);
-#ifdef WLAN_FEATURE_11W
-bool cds_is_mmie_valid(uint8_t *key, uint8_t *ipn,
-		       uint8_t *frm, uint8_t *efrm);
-bool cds_attach_mmie(uint8_t *igtk, uint8_t *ipn, uint16_t key_id,
-		     uint8_t *frm, uint8_t *efrm, uint16_t frmLen);
-uint8_t cds_get_mmie_size(void);
-#endif /* WLAN_FEATURE_11W */
-CDF_STATUS sme_send_flush_logs_cmd_to_fw(tpAniSirGlobal pMac);
-#endif /* #if !defined __CDS_UTILS_H */

+ 0 - 1984
core/cds/src/cds_api.c

@@ -1,1984 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: cds_api.c
- *
- * Connectivity driver services APIs
- */
-
-#include <cds_mq.h>
-#include "cds_sched.h"
-#include <cds_api.h>
-#include "sir_types.h"
-#include "sir_api.h"
-#include "sir_mac_prot_def.h"
-#include "sme_api.h"
-#include "mac_init_api.h"
-#include "wlan_qct_sys.h"
-#include "i_cds_packet.h"
-#include "cds_reg_service.h"
-#include "wma_types.h"
-#include "wlan_hdd_main.h"
-#include <linux/vmalloc.h>
-#ifdef CONFIG_CNSS
-#include <net/cnss.h>
-#endif
-
-#include "sap_api.h"
-#include "cdf_trace.h"
-#include "bmi.h"
-#include "ol_fw.h"
-#include "ol_if_athvar.h"
-#include "hif.h"
-
-#include "cds_utils.h"
-#include "wlan_logging_sock_svc.h"
-#include "wma.h"
-
-#include "wlan_hdd_ipa.h"
-/* Preprocessor Definitions and Constants */
-
-/* Maximum number of cds message queue get wrapper failures to cause panic */
-#define CDS_WRAPPER_MAX_FAIL_COUNT (CDS_CORE_MAX_MESSAGES * 3)
-
-/* Data definitions */
-static cds_context_type g_cds_context;
-static p_cds_contextType gp_cds_context;
-static struct __cdf_device g_cdf_ctx;
-
-/* Debug variable to detect MC thread stuck */
-static atomic_t cds_wrapper_empty_count;
-
-static uint8_t cds_multicast_logging;
-
-void cds_sys_probe_thread_cback(void *pUserData);
-
-/**
- * cds_init() - Initialize CDS
- *
- * This function allocates the resource required for CDS, but does not
- * initialize all the members. This overall initialization will happen at
- * cds_open().
- *
- * Return: Global context on success and NULL on failure.
- */
-v_CONTEXT_t cds_init(void)
-{
-	cdf_mc_timer_manager_init();
-	cdf_mem_init();
-
-	gp_cds_context = &g_cds_context;
-
-	gp_cds_context->cdf_ctx = &g_cdf_ctx;
-	cdf_mem_zero(&g_cdf_ctx, sizeof(g_cdf_ctx));
-
-	cdf_trace_spin_lock_init();
-
-#if defined(TRACE_RECORD)
-	cdf_trace_init();
-#endif
-	cdf_dp_trace_init();
-
-	cds_ssr_protect_init();
-
-	return gp_cds_context;
-}
-
-/**
- * cds_deinit() - Deinitialize CDS
- *
- * This function frees the CDS resources
- */
-void cds_deinit(void)
-{
-	if (gp_cds_context == NULL)
-		return;
-
-	gp_cds_context->cdf_ctx = NULL;
-	gp_cds_context = NULL;
-
-	cdf_mem_zero(&g_cds_context, sizeof(g_cds_context));
-
-	cdf_mc_timer_exit();
-	cdf_mem_exit();
-
-	return;
-}
-
-#ifdef WLAN_FEATURE_NAN
-/**
- * cds_set_nan_enable() - set nan enable flag in mac open param
- * @wma_handle: Pointer to mac open param
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: none
- */
-static void cds_set_nan_enable(tMacOpenParameters *param,
-					hdd_context_t *hdd_ctx)
-{
-	param->is_nan_enabled = hdd_ctx->config->enable_nan_support;
-}
-#else
-static void cds_set_nan_enable(tMacOpenParameters *param,
-					hdd_context_t *pHddCtx)
-{
-}
-#endif
-
-/**
- * cds_open() - open the CDS Module
- *
- * cds_open() function opens the CDS Scheduler
- * Upon successful initialization:
- * - All CDS submodules should have been initialized
- *
- * - The CDS scheduler should have opened
- *
- * - All the WLAN SW components should have been opened. This includes
- * SYS, MAC, SME, WMA and TL.
- *
- * Return: CDF status
- */
-CDF_STATUS cds_open(void)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-	int iter = 0;
-	tSirRetStatus sirStatus = eSIR_SUCCESS;
-	tMacOpenParameters mac_openParms;
-	cdf_device_t cdf_ctx;
-	HTC_INIT_INFO htcInfo;
-	struct ol_softc *scn;
-	void *HTCHandle;
-	hdd_context_t *pHddCtx;
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Opening CDS", __func__);
-
-	if (NULL == gp_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Trying to open CDS without a PreOpen", __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Initialize the timer module */
-	cdf_timer_module_init();
-
-	/* Initialize bug reporting structure */
-	cds_init_log_completion();
-
-	/* Initialize the probe event */
-	if (cdf_event_init(&gp_cds_context->ProbeEvent) != CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Unable to init probeEvent", __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-	if (cdf_event_init(&(gp_cds_context->wmaCompleteEvent)) !=
-	    CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Unable to init wmaCompleteEvent", __func__);
-		CDF_ASSERT(0);
-		goto err_probe_event;
-	}
-
-	/* Initialize the free message queue */
-	cdf_status = cds_mq_init(&gp_cds_context->freeVosMq);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to initialize CDS free message queue",
-			  __func__);
-		CDF_ASSERT(0);
-		goto err_wma_complete_event;
-	}
-
-	for (iter = 0; iter < CDS_CORE_MAX_MESSAGES; iter++) {
-		(gp_cds_context->aMsgWrappers[iter]).pVosMsg =
-			&(gp_cds_context->aMsgBuffers[iter]);
-		INIT_LIST_HEAD(&gp_cds_context->aMsgWrappers[iter].msgNode);
-		cds_mq_put(&gp_cds_context->freeVosMq,
-			   &(gp_cds_context->aMsgWrappers[iter]));
-	}
-
-	/* Now Open the CDS Scheduler */
-	cdf_status = cds_sched_open(gp_cds_context, &gp_cds_context->cdf_sched,
-				    sizeof(cds_sched_context));
-
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to open CDS Scheduler", __func__);
-		CDF_ASSERT(0);
-		goto err_msg_queue;
-	}
-
-	pHddCtx = (hdd_context_t *) (gp_cds_context->pHDDContext);
-	if ((NULL == pHddCtx) || (NULL == pHddCtx->config)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Hdd Context is Null", __func__);
-		CDF_ASSERT(0);
-		goto err_sched_close;
-	}
-
-	scn = cds_get_context(CDF_MODULE_ID_HIF);
-	if (!scn) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: scn is null!", __func__);
-		goto err_sched_close;
-	}
-	scn->enableuartprint = pHddCtx->config->enablefwprint;
-	scn->enablefwlog = pHddCtx->config->enablefwlog;
-	scn->max_no_of_peers = pHddCtx->config->maxNumberOfPeers;
-#ifdef WLAN_FEATURE_LPSS
-	scn->enablelpasssupport = pHddCtx->config->enablelpasssupport;
-#endif
-	scn->enable_ramdump_collection =
-				pHddCtx->config->is_ramdump_enabled;
-	scn->enable_self_recovery = pHddCtx->config->enableSelfRecovery;
-
-	/* Initialize BMI and Download firmware */
-	cdf_status = bmi_download_firmware(scn);
-	if (cdf_status != CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "BMI FIALED status:%d", cdf_status);
-		goto err_bmi_close;
-	}
-
-	htcInfo.pContext = gp_cds_context->pHIFContext;
-	htcInfo.TargetFailure = ol_target_failure;
-	htcInfo.TargetSendSuspendComplete = wma_target_suspend_acknowledge;
-	cdf_ctx = cds_get_context(CDF_MODULE_ID_CDF_DEVICE);
-
-	/* Create HTC */
-	gp_cds_context->htc_ctx =
-		htc_create(htcInfo.pContext, &htcInfo, cdf_ctx);
-	if (!gp_cds_context->htc_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to Create HTC", __func__);
-		goto err_bmi_close;
-	}
-
-	if (bmi_done(scn)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to complete BMI phase", __func__);
-		goto err_htc_close;
-	}
-
-	/*
-	** Need to open WMA first because it calls WDI_Init, which calls wpalOpen
-	** The reason that is needed becasue cds_packet_open need to use PAL APIs
-	*/
-
-	/*Open the WMA module */
-	cdf_mem_set(&mac_openParms, sizeof(mac_openParms), 0);
-	/* UMA is supported in hardware for performing the
-	** frame translation 802.11 <-> 802.3
-	*/
-	mac_openParms.frameTransRequired = 1;
-	mac_openParms.driverType = eDRIVER_TYPE_PRODUCTION;
-	mac_openParms.powersaveOffloadEnabled =
-		pHddCtx->config->enablePowersaveOffload;
-	mac_openParms.staDynamicDtim = pHddCtx->config->enableDynamicDTIM;
-	mac_openParms.staModDtim = pHddCtx->config->enableModulatedDTIM;
-	mac_openParms.staMaxLIModDtim = pHddCtx->config->fMaxLIModulatedDTIM;
-	mac_openParms.wowEnable = pHddCtx->config->wowEnable;
-	mac_openParms.maxWoWFilters = pHddCtx->config->maxWoWFilters;
-	/* Here olIniInfo is used to store ini status of arp offload
-	 * ns offload and others. Currently 1st bit is used for arp
-	 * off load and 2nd bit for ns offload currently, rest bits are unused
-	 */
-	if (pHddCtx->config->fhostArpOffload)
-		mac_openParms.olIniInfo = mac_openParms.olIniInfo | 0x1;
-	if (pHddCtx->config->fhostNSOffload)
-		mac_openParms.olIniInfo = mac_openParms.olIniInfo | 0x2;
-	/*
-	 * Copy the DFS Phyerr Filtering Offload status.
-	 * This parameter reflects the value of the
-	 * dfsPhyerrFilterOffload flag  as set in the ini.
-	 */
-	mac_openParms.dfsPhyerrFilterOffload =
-		pHddCtx->config->fDfsPhyerrFilterOffload;
-	if (pHddCtx->config->ssdp)
-		mac_openParms.ssdp = pHddCtx->config->ssdp;
-#ifdef FEATURE_WLAN_RA_FILTERING
-	mac_openParms.RArateLimitInterval =
-		pHddCtx->config->RArateLimitInterval;
-	mac_openParms.IsRArateLimitEnabled =
-		pHddCtx->config->IsRArateLimitEnabled;
-#endif
-
-	mac_openParms.apMaxOffloadPeers = pHddCtx->config->apMaxOffloadPeers;
-
-	mac_openParms.apMaxOffloadReorderBuffs =
-		pHddCtx->config->apMaxOffloadReorderBuffs;
-
-	mac_openParms.apDisableIntraBssFwd =
-		pHddCtx->config->apDisableIntraBssFwd;
-
-	mac_openParms.dfsRadarPriMultiplier =
-		pHddCtx->config->dfsRadarPriMultiplier;
-	mac_openParms.reorderOffload = pHddCtx->config->reorderOffloadSupport;
-
-	/* IPA micro controller data path offload resource config item */
-	mac_openParms.ucOffloadEnabled = hdd_ipa_uc_is_enabled(pHddCtx);
-	mac_openParms.ucTxBufCount = pHddCtx->config->IpaUcTxBufCount;
-	mac_openParms.ucTxBufSize = pHddCtx->config->IpaUcTxBufSize;
-	mac_openParms.ucRxIndRingCount = pHddCtx->config->IpaUcRxIndRingCount;
-	mac_openParms.ucTxPartitionBase = pHddCtx->config->IpaUcTxPartitionBase;
-	mac_openParms.max_scan = pHddCtx->config->max_scan_count;
-
-	mac_openParms.ip_tcp_udp_checksum_offload =
-			pHddCtx->config->enable_ip_tcp_udp_checksum_offload;
-	mac_openParms.enable_rxthread = pHddCtx->config->enableRxThread;
-	mac_openParms.ce_classify_enabled =
-				pHddCtx->config->ce_classify_enabled;
-
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
-	mac_openParms.tx_flow_stop_queue_th =
-				pHddCtx->config->TxFlowStopQueueThreshold;
-	mac_openParms.tx_flow_start_queue_offset =
-				pHddCtx->config->TxFlowStartQueueOffset;
-#endif
-	cds_set_nan_enable(&mac_openParms, pHddCtx);
-
-	mac_openParms.tx_chain_mask_cck = pHddCtx->config->tx_chain_mask_cck;
-	mac_openParms.self_gen_frm_pwr = pHddCtx->config->self_gen_frm_pwr;
-
-	cdf_status = wma_open(gp_cds_context,
-			      hdd_update_tgt_cfg,
-			      hdd_dfs_indicate_radar, &mac_openParms);
-
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to open WMA module", __func__);
-		CDF_ASSERT(0);
-		goto err_htc_close;
-	}
-
-	/* Number of peers limit differs in each chip version. If peer max
-	 * limit configured in ini exceeds more than supported, WMA adjusts
-	 * and keeps correct limit in mac_openParms.maxStation. So, make sure
-	 * config entry pHddCtx->config->maxNumberOfPeers has adjusted value
-	 */
-	pHddCtx->config->maxNumberOfPeers = mac_openParms.maxStation;
-	HTCHandle = cds_get_context(CDF_MODULE_ID_HTC);
-	if (!HTCHandle) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: HTCHandle is null!", __func__);
-		goto err_wma_close;
-	}
-	if (htc_wait_target(HTCHandle)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to complete BMI phase", __func__);
-		goto err_wma_close;
-	}
-
-	/* Now proceed to open the MAC */
-
-	/* UMA is supported in hardware for performing the
-	 * frame translation 802.11 <-> 802.3
-	 */
-	mac_openParms.frameTransRequired = 1;
-
-	sirStatus =
-		mac_open(&(gp_cds_context->pMACContext), gp_cds_context->pHDDContext,
-			 &mac_openParms);
-
-	if (eSIR_SUCCESS != sirStatus) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to open MAC", __func__);
-		CDF_ASSERT(0);
-		goto err_wma_close;
-	}
-
-	/* Now proceed to open the SME */
-	cdf_status = sme_open(gp_cds_context->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to open SME", __func__);
-		CDF_ASSERT(0);
-		goto err_mac_close;
-	}
-
-	gp_cds_context->pdev_txrx_ctx =
-		ol_txrx_pdev_alloc(gp_cds_context->cfg_ctx,
-				    gp_cds_context->htc_ctx,
-				    gp_cds_context->cdf_ctx);
-	if (!gp_cds_context->pdev_txrx_ctx) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to open TXRX", __func__);
-		CDF_ASSERT(0);
-		goto err_sme_close;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: CDS successfully Opened", __func__);
-
-	return CDF_STATUS_SUCCESS;
-
-err_sme_close:
-	sme_close(gp_cds_context->pMACContext);
-
-err_mac_close:
-	mac_close(gp_cds_context->pMACContext);
-
-err_wma_close:
-	wma_close(gp_cds_context);
-
-	wma_wmi_service_close(gp_cds_context);
-
-err_htc_close:
-	if (gp_cds_context->htc_ctx) {
-		htc_destroy(gp_cds_context->htc_ctx);
-		gp_cds_context->htc_ctx = NULL;
-	}
-
-err_bmi_close:
-	bmi_cleanup(scn);
-
-err_sched_close:
-	cds_sched_close(gp_cds_context);
-
-err_msg_queue:
-	cds_mq_deinit(&gp_cds_context->freeVosMq);
-
-err_wma_complete_event:
-	cdf_event_destroy(&gp_cds_context->wmaCompleteEvent);
-
-err_probe_event:
-	cdf_event_destroy(&gp_cds_context->ProbeEvent);
-
-	return CDF_STATUS_E_FAILURE;
-} /* cds_open() */
-
-/**
- * cds_pre_enable() - pre enable cds
- * @cds_context: CDS context
- *
- * Return: CDF status
- */
-CDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-	p_cds_contextType p_cds_context = (p_cds_contextType) cds_context;
-	void *scn;
-	CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_INFO, "cds prestart");
-
-	if (gp_cds_context != p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Context mismatch", __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_INVAL;
-	}
-
-	if (p_cds_context->pMACContext == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: MAC NULL context", __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_INVAL;
-	}
-
-	if (p_cds_context->pWMAContext == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: WMA NULL context", __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_INVAL;
-	}
-
-	scn = cds_get_context(CDF_MODULE_ID_HIF);
-	if (!scn) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: scn is null!", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Reset wma wait event */
-	cdf_event_reset(&gp_cds_context->wmaCompleteEvent);
-
-	/*call WMA pre start */
-	cdf_status = wma_pre_start(gp_cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_FATAL,
-			  "Failed to WMA prestart");
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Need to update time out of complete */
-	cdf_status = cdf_wait_single_event(&gp_cds_context->wmaCompleteEvent,
-					   CDS_WMA_TIMEOUT);
-	if (cdf_status != CDF_STATUS_SUCCESS) {
-		if (cdf_status == CDF_STATUS_E_TIMEOUT) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Timeout occurred before WMA complete",
-				  __func__);
-		} else {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: wma_pre_start reporting other error",
-				  __func__);
-		}
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Test MC thread by posting a probe message to SYS",
-			  __func__);
-		wlan_sys_probe();
-
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_status = htc_start(gp_cds_context->htc_ctx);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_FATAL,
-			  "Failed to Start HTC");
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-	cdf_status = wma_wait_for_ready_event(gp_cds_context->pWMAContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "Failed to get ready event from target firmware");
-		htc_set_target_to_sleep(scn);
-		htc_stop(gp_cds_context->htc_ctx);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (ol_txrx_pdev_attach(gp_cds_context->pdev_txrx_ctx)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			"Failed to attach pdev");
-		htc_set_target_to_sleep(scn);
-		htc_stop(gp_cds_context->htc_ctx);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	htc_set_target_to_sleep(scn);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_enable() - start/enable cds module
- * @cds_context: CDS context
- *
- * Return: CDF status
- */
-CDF_STATUS cds_enable(v_CONTEXT_t cds_context)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-	tSirRetStatus sirStatus = eSIR_SUCCESS;
-	p_cds_contextType p_cds_context = (p_cds_contextType) cds_context;
-	tHalMacStartParameters halStartParams;
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: Starting Libra SW", __func__);
-
-	/* We support only one instance for now ... */
-	if (gp_cds_context != p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: mismatch in context", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if ((p_cds_context->pWMAContext == NULL) ||
-	    (p_cds_context->pMACContext == NULL)) {
-		if (p_cds_context->pWMAContext == NULL)
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: WMA NULL context", __func__);
-		else
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: MAC NULL context", __func__);
-
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Start the wma */
-	cdf_status = wma_start(p_cds_context);
-	if (cdf_status != CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to start wma", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: wma correctly started", __func__);
-
-	/* Start the MAC */
-	cdf_mem_zero(&halStartParams,
-		     sizeof(tHalMacStartParameters));
-
-	/* Start the MAC */
-	sirStatus =
-		mac_start(p_cds_context->pMACContext, &halStartParams);
-
-	if (eSIR_SUCCESS != sirStatus) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to start MAC", __func__);
-		goto err_wma_stop;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: MAC correctly started", __func__);
-
-	/* START SME */
-	cdf_status = sme_start(p_cds_context->pMACContext);
-
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to start SME", __func__);
-		goto err_mac_stop;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: SME correctly started", __func__);
-
-	if (ol_txrx_pdev_attach_target
-		       (p_cds_context->pdev_txrx_ctx) != A_OK) {
-	   CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-				"%s: Failed attach target", __func__);
-	   goto err_sme_stop;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "TL correctly started");
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: CDS Start is successful!!", __func__);
-
-	return CDF_STATUS_SUCCESS;
-
-err_sme_stop:
-	sme_stop(p_cds_context->pMACContext, HAL_STOP_TYPE_SYS_RESET);
-
-err_mac_stop:
-	mac_stop(p_cds_context->pMACContext, HAL_STOP_TYPE_SYS_RESET);
-
-err_wma_stop:
-	cdf_event_reset(&(gp_cds_context->wmaCompleteEvent));
-	cdf_status = wma_stop(p_cds_context, HAL_STOP_TYPE_RF_KILL);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to stop wma", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-		wma_setneedshutdown(cds_context);
-	} else {
-		cdf_status =
-			cdf_wait_single_event(&(gp_cds_context->wmaCompleteEvent),
-					      CDS_WMA_TIMEOUT);
-		if (cdf_status != CDF_STATUS_SUCCESS) {
-			if (cdf_status == CDF_STATUS_E_TIMEOUT) {
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_FATAL,
-					  "%s: Timeout occurred before WMA_stop complete",
-					  __func__);
-			} else {
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_FATAL,
-					  "%s: WMA_stop reporting other error",
-					  __func__);
-			}
-			CDF_ASSERT(0);
-			wma_setneedshutdown(cds_context);
-		}
-	}
-
-	return CDF_STATUS_E_FAILURE;
-} /* cds_enable() */
-
-/**
- * cds_disable() - stop/disable cds module
- * @cds_context: CDS context
- *
- * Return: CDF status
- */
-CDF_STATUS cds_disable(v_CONTEXT_t cds_context)
-{
-	CDF_STATUS cdf_status;
-
-	/* wma_stop is called before the SYS so that the processing of target
-	 * pending responses will not be handled during uninitialization of
-	 * WLAN driver
-	 */
-	cdf_event_reset(&(gp_cds_context->wmaCompleteEvent));
-
-	cdf_status = wma_stop(cds_context, HAL_STOP_TYPE_RF_KILL);
-
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to stop wma", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-		wma_setneedshutdown(cds_context);
-	}
-
-	hif_disable_isr(((cds_context_type *) cds_context)->pHIFContext);
-	hif_reset_soc(((cds_context_type *) cds_context)->pHIFContext);
-
-	/* SYS STOP will stop SME and MAC */
-	cdf_status = sys_stop(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to stop SYS", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_close() - close cds module
- * @cds_context: CDS context
- *
- * Return: CDF status
- */
-CDF_STATUS cds_close(v_CONTEXT_t cds_context)
-{
-	CDF_STATUS cdf_status;
-
-	cdf_status = wma_wmi_work_close(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		 "%s: Failed to close wma_wmi_work", __func__);
-		CDF_ASSERT(0);
-	}
-
-	if (gp_cds_context->htc_ctx) {
-		htc_stop(gp_cds_context->htc_ctx);
-		htc_destroy(gp_cds_context->htc_ctx);
-		gp_cds_context->htc_ctx = NULL;
-	}
-
-	ol_txrx_pdev_detach(gp_cds_context->pdev_txrx_ctx, 1);
-	cds_free_context(cds_context, CDF_MODULE_ID_TXRX,
-			 gp_cds_context->pdev_txrx_ctx);
-
-	cdf_status = sme_close(((p_cds_contextType) cds_context)->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close SME", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	cdf_status = mac_close(((p_cds_contextType) cds_context)->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close MAC", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	((p_cds_contextType) cds_context)->pMACContext = NULL;
-
-	if (true == wma_needshutdown(cds_context)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Failed to shutdown wma", __func__);
-	} else {
-		cdf_status = wma_close(cds_context);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Failed to close wma", __func__);
-			CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-		}
-	}
-
-	cdf_status = wma_wmi_service_close(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close wma_wmi_service", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	cds_mq_deinit(&((p_cds_contextType) cds_context)->freeVosMq);
-
-	cdf_status = cdf_event_destroy(&gp_cds_context->wmaCompleteEvent);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to destroy wmaCompleteEvent", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	cdf_status = cdf_event_destroy(&gp_cds_context->ProbeEvent);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to destroy ProbeEvent", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	cds_deinit_log_completion();
-
-	gp_cds_context->pHDDContext = NULL;
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_context() - get context data area
- *
- * @moduleId: ID of the module who's context data is being retrived.
- *
- * Each module in the system has a context / data area that is allocated
- * and managed by CDS.  This API allows any user to get a pointer to its
- * allocated context data area from the CDS global context.
- *
- * Return: pointer to the context data area of the module ID
- *	   specified, or NULL if the context data is not allocated for
- *	   the module ID specified
- */
-void *cds_get_context(CDF_MODULE_ID moduleId)
-{
-	void *pModContext = NULL;
-
-	if (gp_cds_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: cds context pointer is null", __func__);
-		return NULL;
-	}
-
-	switch (moduleId) {
-	case CDF_MODULE_ID_HDD:
-	{
-		pModContext = gp_cds_context->pHDDContext;
-		break;
-	}
-
-	case CDF_MODULE_ID_SME:
-	case CDF_MODULE_ID_PE:
-	{
-		/* In all these cases, we just return the MAC Context */
-		pModContext = gp_cds_context->pMACContext;
-		break;
-	}
-
-	case CDF_MODULE_ID_WMA:
-	{
-		/* For wma module */
-		pModContext = gp_cds_context->pWMAContext;
-		break;
-	}
-
-	case CDF_MODULE_ID_CDF:
-	{
-		/* For SYS this is CDS itself */
-		pModContext = gp_cds_context;
-		break;
-	}
-
-	case CDF_MODULE_ID_HIF:
-	{
-		pModContext = gp_cds_context->pHIFContext;
-		break;
-	}
-
-	case CDF_MODULE_ID_HTC:
-	{
-		pModContext = gp_cds_context->htc_ctx;
-		break;
-	}
-
-	case CDF_MODULE_ID_CDF_DEVICE:
-	{
-		pModContext = gp_cds_context->cdf_ctx;
-		break;
-	}
-
-	case CDF_MODULE_ID_TXRX:
-	{
-		pModContext = gp_cds_context->pdev_txrx_ctx;
-		break;
-	}
-
-	case CDF_MODULE_ID_CFG:
-	{
-		pModContext = gp_cds_context->cfg_ctx;
-		break;
-	}
-
-	default:
-	{
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Module ID %i does not have its context maintained by CDS",
-			  __func__, moduleId);
-		CDF_ASSERT(0);
-		return NULL;
-	}
-	}
-
-	if (pModContext == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Module ID %i context is Null", __func__,
-			  moduleId);
-	}
-
-	return pModContext;
-} /* cds_get_context() */
-
-/**
- * cds_get_global_context() - get CDS global Context
- *
- * This API allows any user to get the CDS Global Context pointer from a
- * module context data area.
- *
- * Return: pointer to the CDS global context, NULL if the function is
- *	   unable to retreive the CDS context.
- */
-v_CONTEXT_t cds_get_global_context(void)
-{
-	if (gp_cds_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: global cds context is NULL", __func__);
-	}
-
-	return gp_cds_context;
-} /* cds_get_global_context() */
-
-/**
- * cds_get_driver_state() - Get current driver state
- *
- * This API returns current driver state stored in global context.
- *
- * Return: Driver state enum
- */
-enum cds_driver_state cds_get_driver_state(void)
-{
-	if (gp_cds_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: global cds context is NULL", __func__);
-
-		return CDS_DRIVER_STATE_UNINITIALIZED;
-	}
-
-	return gp_cds_context->driver_state;
-}
-
-/**
- * cds_set_driver_state() - Set current driver state
- * @state:	Driver state to be set to.
- *
- * This API sets driver state to state. This API only sets the state and doesn't
- * clear states, please make sure to use cds_clear_driver_state to clear any
- * state if required.
- *
- * Return: None
- */
-void cds_set_driver_state(enum cds_driver_state state)
-{
-	if (gp_cds_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: global cds context is NULL: %x", __func__,
-			  state);
-
-		return;
-	}
-
-	gp_cds_context->driver_state |= state;
-}
-
-/**
- * cds_clear_driver_state() - Clear current driver state
- * @state:	Driver state to be cleared.
- *
- * This API clears driver state. This API only clears the state, please make
- * sure to use cds_set_driver_state to set any new states.
- *
- * Return: None
- */
-void cds_clear_driver_state(enum cds_driver_state state)
-{
-	if (gp_cds_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: global cds context is NULL: %x", __func__,
-			  state);
-
-		return;
-	}
-
-	gp_cds_context->driver_state &= ~state;
-}
-
-/**
- * cds_alloc_context() - allocate a context within the CDS global Context
- * @p_cds_context: pointer to the global Vos context
- * @moduleId: module ID who's context area is being allocated.
- * @ppModuleContext: pointer to location where the pointer to the
- *	allocated context is returned. Note this output pointer
- *	is valid only if the API returns CDF_STATUS_SUCCESS
- * @param size: size of the context area to be allocated.
- *
- * This API allows any user to allocate a user context area within the
- * CDS Global Context.
- *
- * Return: CDF status
- */
-CDF_STATUS cds_alloc_context(void *p_cds_context, CDF_MODULE_ID moduleID,
-			     void **ppModuleContext, uint32_t size)
-{
-	void **pGpModContext = NULL;
-
-	if (p_cds_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: cds context is null", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if ((gp_cds_context != p_cds_context) || (ppModuleContext == NULL)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: context mismatch or null param passed",
-			  __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	switch (moduleID) {
-	case CDF_MODULE_ID_WMA:
-	{
-		pGpModContext = &(gp_cds_context->pWMAContext);
-		break;
-	}
-
-	case CDF_MODULE_ID_HIF:
-	{
-		pGpModContext = &(gp_cds_context->pHIFContext);
-		break;
-	}
-
-	case CDF_MODULE_ID_EPPING:
-	case CDF_MODULE_ID_SME:
-	case CDF_MODULE_ID_PE:
-	case CDF_MODULE_ID_HDD:
-	case CDF_MODULE_ID_HDD_SOFTAP:
-	default:
-	{
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Module ID %i "
-			  "does not have its context allocated by CDS",
-			  __func__, moduleID);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_INVAL;
-	}
-	}
-
-	if (NULL != *pGpModContext) {
-		/* Context has already been allocated!
-		 * Prevent double allocation
-		 */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Module ID %i context has already been allocated",
-			  __func__, moduleID);
-		return CDF_STATUS_E_EXISTS;
-	}
-
-	/* Dynamically allocate the context for module */
-
-	*ppModuleContext = cdf_mem_malloc(size);
-
-	if (*ppModuleContext == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to " "allocate Context for module ID %i",
-			  __func__, moduleID);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_NOMEM;
-	}
-
-	if (moduleID == CDF_MODULE_ID_TLSHIM)
-		cdf_mem_zero(*ppModuleContext, size);
-
-	*pGpModContext = *ppModuleContext;
-
-	return CDF_STATUS_SUCCESS;
-} /* cds_alloc_context() */
-
-/**
- * cds_free_context() - free an allocated context within the
- *			CDS global Context
- * @p_cds_context: pointer to the global Vos context
- * @moduleId: module ID who's context area is being free
- * @pModuleContext: pointer to module context area to be free'd.
- *
- *  This API allows a user to free the user context area within the
- *  CDS Global Context.
- *
- * Return: CDF status
- */
-CDF_STATUS cds_free_context(void *p_cds_context, CDF_MODULE_ID moduleID,
-			    void *pModuleContext)
-{
-	void **pGpModContext = NULL;
-
-	if ((p_cds_context == NULL) || (gp_cds_context != p_cds_context) ||
-	    (pModuleContext == NULL)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Null params or context mismatch", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	switch (moduleID) {
-	case CDF_MODULE_ID_WMA:
-	{
-		pGpModContext = &(gp_cds_context->pWMAContext);
-		break;
-	}
-
-	case CDF_MODULE_ID_HIF:
-	{
-		pGpModContext = &(gp_cds_context->pHIFContext);
-		break;
-	}
-
-	case CDF_MODULE_ID_TXRX:
-	{
-		pGpModContext = &(gp_cds_context->pdev_txrx_ctx);
-		break;
-	}
-
-	case CDF_MODULE_ID_EPPING:
-	case CDF_MODULE_ID_HDD:
-	case CDF_MODULE_ID_SME:
-	case CDF_MODULE_ID_PE:
-	case CDF_MODULE_ID_HDD_SOFTAP:
-	default:
-	{
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Module ID %i "
-			  "does not have its context allocated by CDS",
-			  __func__, moduleID);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_INVAL;
-	}
-	}
-
-	if (NULL == *pGpModContext) {
-		/* Context has not been allocated or freed already! */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Module ID %i "
-			  "context has not been allocated or freed already",
-			  __func__, moduleID);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (*pGpModContext != pModuleContext) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: pGpModContext != pModuleContext", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (pModuleContext != NULL)
-		cdf_mem_free(pModuleContext);
-
-	*pGpModContext = NULL;
-
-	return CDF_STATUS_SUCCESS;
-} /* cds_free_context() */
-
-/**
- * cds_mq_post_message() - post a message to a message queue
- * @msgQueueId: identifies the message queue upon which the message
- *	will be posted.
- * @message: a pointer to a message buffer. Memory for this message
- *	buffer is allocated by the caller and free'd by the CDF after the
- *	message is posted to the message queue.  If the consumer of the
- *	message needs anything in this message, it needs to copy the contents
- *	before returning from the message queue handler.
- *
- * Return: CDF status
- */
-CDF_STATUS cds_mq_post_message(CDS_MQ_ID msgQueueId, cds_msg_t *pMsg)
-{
-	p_cds_mq_type pTargetMq = NULL;
-	p_cds_msg_wrapper pMsgWrapper = NULL;
-	uint32_t debug_count = 0;
-
-	if ((gp_cds_context == NULL) || (pMsg == NULL)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Null params or global cds context is null",
-			  __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	switch (msgQueueId) {
-	/* Message Queue ID for messages bound for SME */
-	case CDS_MQ_ID_SME:
-	{
-		pTargetMq = &(gp_cds_context->cdf_sched.smeMcMq);
-		break;
-	}
-
-	/* Message Queue ID for messages bound for PE */
-	case CDS_MQ_ID_PE:
-	{
-		pTargetMq = &(gp_cds_context->cdf_sched.peMcMq);
-		break;
-	}
-
-	/* Message Queue ID for messages bound for wma */
-	case CDS_MQ_ID_WMA:
-	{
-		pTargetMq = &(gp_cds_context->cdf_sched.wmaMcMq);
-		break;
-	}
-
-	/* Message Queue ID for messages bound for the SYS module */
-	case CDS_MQ_ID_SYS:
-	{
-		pTargetMq = &(gp_cds_context->cdf_sched.sysMcMq);
-		break;
-	}
-
-	default:
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  ("%s: Trying to queue msg into unknown MC Msg queue ID %d"),
-			  __func__, msgQueueId);
-
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	CDF_ASSERT(NULL != pTargetMq);
-	if (pTargetMq == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: pTargetMq == NULL", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Try and get a free Msg wrapper */
-	pMsgWrapper = cds_mq_get(&gp_cds_context->freeVosMq);
-
-	if (NULL == pMsgWrapper) {
-		debug_count = atomic_inc_return(&cds_wrapper_empty_count);
-		if (1 == debug_count)
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: CDS Core run out of message wrapper %d",
-				__func__, debug_count);
-
-		if (CDS_WRAPPER_MAX_FAIL_COUNT == debug_count)
-			CDF_BUG(0);
-
-		return CDF_STATUS_E_RESOURCES;
-	}
-
-	atomic_set(&cds_wrapper_empty_count, 0);
-
-	/* Copy the message now */
-	cdf_mem_copy((void *)pMsgWrapper->pVosMsg,
-		     (void *)pMsg, sizeof(cds_msg_t));
-
-	cds_mq_put(pTargetMq, pMsgWrapper);
-
-	set_bit(MC_POST_EVENT_MASK, &gp_cds_context->cdf_sched.mcEventFlag);
-	wake_up_interruptible(&gp_cds_context->cdf_sched.mcWaitQueue);
-
-	return CDF_STATUS_SUCCESS;
-} /* cds_mq_post_message() */
-
-/**
- * cds_sys_probe_thread_cback() -  probe mc thread callback
- * @pUserData: pointer to user data
- *
- * Return: none
- */
-void cds_sys_probe_thread_cback(void *pUserData)
-{
-	if (gp_cds_context != pUserData) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: gp_cds_context != pUserData", __func__);
-		return;
-	}
-
-	if (cdf_event_set(&gp_cds_context->ProbeEvent) != CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: cdf_event_set failed", __func__);
-		return;
-	}
-} /* cds_sys_probe_thread_cback() */
-
-/**
- * cds_wma_complete_cback() - wma complete callback
- * @pUserData: pointer to user data
- *
- * Return: none
- */
-void cds_wma_complete_cback(void *pUserData)
-{
-	if (gp_cds_context != pUserData) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: gp_cds_context != pUserData", __func__);
-		return;
-	}
-
-	if (cdf_event_set(&gp_cds_context->wmaCompleteEvent) !=
-	    CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: cdf_event_set failed", __func__);
-		return;
-	}
-} /* cds_wma_complete_cback() */
-
-/**
- * cds_core_return_msg() - return core message
- * @pVContext: pointer to cds context
- * @pMsgWrapper: pointer to message wrapper
- *
- * Return: none
- */
-void cds_core_return_msg(void *pVContext, p_cds_msg_wrapper pMsgWrapper)
-{
-	p_cds_contextType p_cds_context = (p_cds_contextType) pVContext;
-
-	CDF_ASSERT(gp_cds_context == p_cds_context);
-
-	if (gp_cds_context != p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: gp_cds_context != p_cds_context", __func__);
-		return;
-	}
-
-	CDF_ASSERT(NULL != pMsgWrapper);
-
-	if (pMsgWrapper == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: pMsgWrapper == NULL in function", __func__);
-		return;
-	}
-
-	/*
-	** Return the message on the free message queue
-	*/
-	INIT_LIST_HEAD(&pMsgWrapper->msgNode);
-	cds_mq_put(&p_cds_context->freeVosMq, pMsgWrapper);
-} /* cds_core_return_msg() */
-
-
-/**
- * cds_shutdown() - shutdown CDS
- * @cds_context: global cds context
- *
- * Return: CDF status
- */
-CDF_STATUS cds_shutdown(v_CONTEXT_t cds_context)
-{
-	CDF_STATUS cdf_status;
-	tpAniSirGlobal pmac = (((p_cds_contextType)cds_context)->pMACContext);
-
-	ol_txrx_pdev_detach(gp_cds_context->pdev_txrx_ctx, 1);
-	cds_free_context(cds_context, CDF_MODULE_ID_TXRX,
-			 gp_cds_context->pdev_txrx_ctx);
-
-	cdf_status = sme_close(((p_cds_contextType) cds_context)->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close SME", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-	/*
-	 * CAC timer will be initiated and started only when SAP starts on
-	 * DFS channel and it will be stopped and destroyed immediately once the
-	 * radar detected or timedout. So as per design CAC timer should be
-	 * destroyed after stop
-	 */
-	if (pmac->sap.SapDfsInfo.is_dfs_cac_timer_running) {
-		cdf_mc_timer_stop(&pmac->sap.SapDfsInfo.sap_dfs_cac_timer);
-		pmac->sap.SapDfsInfo.is_dfs_cac_timer_running = 0;
-		cdf_mc_timer_destroy(&pmac->sap.SapDfsInfo.sap_dfs_cac_timer);
-	}
-
-	cdf_status = mac_close(((p_cds_contextType) cds_context)->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close MAC", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	((p_cds_contextType) cds_context)->pMACContext = NULL;
-
-	if (false == wma_needshutdown(cds_context)) {
-
-		cdf_status = wma_close(cds_context);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Failed to close wma!", __func__);
-			CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-		}
-	}
-
-	cdf_status = wma_wmi_work_close(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		"%s: Failed to close wma_wmi_work!", __func__);
-		CDF_ASSERT(0);
-	}
-
-	if (gp_cds_context->htc_ctx) {
-		htc_stop(gp_cds_context->htc_ctx);
-		htc_destroy(gp_cds_context->htc_ctx);
-		gp_cds_context->htc_ctx = NULL;
-	}
-
-	cdf_status = wma_wmi_service_close(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close wma_wmi_service!", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	cds_mq_deinit(&((p_cds_contextType) cds_context)->freeVosMq);
-
-	cdf_status = cdf_event_destroy(&gp_cds_context->wmaCompleteEvent);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to destroy wmaCompleteEvent", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	cdf_status = cdf_event_destroy(&gp_cds_context->ProbeEvent);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to destroy ProbeEvent", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_vdev_types() - get vdev type
- * @mode: mode
- * @type: type
- * @sub_type: sub_type
- *
- * Return: WMI vdev type
- */
-CDF_STATUS cds_get_vdev_types(enum tCDF_ADAPTER_MODE mode, uint32_t *type,
-			      uint32_t *sub_type)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	*type = 0;
-	*sub_type = 0;
-
-	switch (mode) {
-	case CDF_STA_MODE:
-		*type = WMI_VDEV_TYPE_STA;
-		break;
-	case CDF_SAP_MODE:
-		*type = WMI_VDEV_TYPE_AP;
-		break;
-	case CDF_P2P_DEVICE_MODE:
-		*type = WMI_VDEV_TYPE_AP;
-		*sub_type = WMI_UNIFIED_VDEV_SUBTYPE_P2P_DEVICE;
-		break;
-	case CDF_P2P_CLIENT_MODE:
-		*type = WMI_VDEV_TYPE_STA;
-		*sub_type = WMI_UNIFIED_VDEV_SUBTYPE_P2P_CLIENT;
-		break;
-	case CDF_P2P_GO_MODE:
-		*type = WMI_VDEV_TYPE_AP;
-		*sub_type = WMI_UNIFIED_VDEV_SUBTYPE_P2P_GO;
-		break;
-	case CDF_OCB_MODE:
-		*type = WMI_VDEV_TYPE_OCB;
-		break;
-	default:
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "Invalid device mode %d", mode);
-		status = CDF_STATUS_E_INVAL;
-		break;
-	}
-	return status;
-}
-
-/**
- * cds_flush_work() - flush pending works
- * @work: pointer to work
- *
- * Return: none
- */
-void cds_flush_work(void *work)
-{
-#if defined (CONFIG_CNSS)
-	cnss_flush_work(work);
-#elif defined (WLAN_OPEN_SOURCE)
-	cancel_work_sync(work);
-#endif
-}
-
-/**
- * cds_flush_delayed_work() - flush delayed works
- * @dwork: pointer to delayed work
- *
- * Return: none
- */
-void cds_flush_delayed_work(void *dwork)
-{
-#if defined (CONFIG_CNSS)
-	cnss_flush_delayed_work(dwork);
-#elif defined (WLAN_OPEN_SOURCE)
-	cancel_delayed_work_sync(dwork);
-#endif
-}
-
-/**
- * cds_is_packet_log_enabled() - check if packet log is enabled
- *
- * Return: true if packet log is enabled else false
- */
-bool cds_is_packet_log_enabled(void)
-{
-	hdd_context_t *pHddCtx;
-
-	pHddCtx = (hdd_context_t *) (gp_cds_context->pHDDContext);
-	if ((NULL == pHddCtx) || (NULL == pHddCtx->config)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Hdd Context is Null", __func__);
-		return false;
-	}
-
-	return pHddCtx->config->enablePacketLog;
-}
-
-/**
- * cds_trigger_recovery() - trigger self recovery
- *
- * Return: none
- */
-void cds_trigger_recovery(void)
-{
-	tp_wma_handle wma_handle = cds_get_context(CDF_MODULE_ID_WMA);
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	if (!wma_handle) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			"WMA context is invald!");
-		return;
-	}
-
-	wma_crash_inject(wma_handle, RECOVERY_SIM_SELF_RECOVERY, 0);
-
-	status = cdf_wait_single_event(&wma_handle->recovery_event,
-		WMA_CRASH_INJECT_TIMEOUT);
-
-	if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			"CRASH_INJECT command is timed out!");
- #ifdef CONFIG_CNSS
-		if (cds_is_driver_recovering()) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"Recovery is in progress, ignore!");
-			return;
-		}
-		cds_set_recovery_in_progress(true);
-		cnss_schedule_recovery_work();
- #endif
-
-		return;
-	}
-}
-
-/**
- * cds_get_monotonic_boottime() - Get kernel boot time.
- *
- * Return: Time in microseconds
- */
-
-uint64_t cds_get_monotonic_boottime(void)
-{
-#ifdef CONFIG_CNSS
-	struct timespec ts;
-
-	cnss_get_monotonic_boottime(&ts);
-	return ((uint64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
-#else
-	return ((uint64_t)cdf_system_ticks_to_msecs(cdf_system_ticks()) *
-			 1000);
-#endif
-}
-
-/**
- * cds_set_wakelock_logging() - Logging of wakelock enabled/disabled
- * @value: Boolean value
- *
- * This function is used to set the flag which will indicate whether
- * logging of wakelock is enabled or not
- *
- * Return: None
- */
-void cds_set_wakelock_logging(bool value)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"cds context is Invald");
-		return;
-	}
-	p_cds_context->is_wakelock_log_enabled = value;
-}
-
-/**
- * cds_is_wakelock_enabled() - Check if logging of wakelock is enabled/disabled
- * @value: Boolean value
- *
- * This function is used to check whether logging of wakelock is enabled or not
- *
- * Return: true if logging of wakelock is enabled
- */
-bool cds_is_wakelock_enabled(void)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"cds context is Invald");
-		return false;
-	}
-	return p_cds_context->is_wakelock_log_enabled;
-}
-
-/**
- * cds_set_ring_log_level() - Sets the log level of a particular ring
- * @ring_id: ring_id
- * @log_levelvalue: Log level specificed
- *
- * This function converts HLOS values to driver log levels and sets the log
- * level of a particular ring accordingly.
- *
- * Return: None
- */
-void cds_set_ring_log_level(uint32_t ring_id, uint32_t log_level)
-{
-	p_cds_contextType p_cds_context;
-	uint32_t log_val;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invald", __func__);
-		return;
-	}
-
-	switch (log_level) {
-	case LOG_LEVEL_NO_COLLECTION:
-		log_val = WLAN_LOG_LEVEL_OFF;
-		break;
-	case LOG_LEVEL_NORMAL_COLLECT:
-		log_val = WLAN_LOG_LEVEL_NORMAL;
-		break;
-	case LOG_LEVEL_ISSUE_REPRO:
-		log_val = WLAN_LOG_LEVEL_REPRO;
-		break;
-	case LOG_LEVEL_ACTIVE:
-	default:
-		log_val = WLAN_LOG_LEVEL_ACTIVE;
-		break;
-	}
-
-	if (ring_id == RING_ID_WAKELOCK) {
-		p_cds_context->wakelock_log_level = log_val;
-		return;
-	} else if (ring_id == RING_ID_CONNECTIVITY) {
-		p_cds_context->connectivity_log_level = log_val;
-		return;
-	} else if (ring_id == RING_ID_PER_PACKET_STATS) {
-		p_cds_context->packet_stats_log_level = log_val;
-		return;
-	} else if (ring_id == RING_ID_DRIVER_DEBUG) {
-		p_cds_context->driver_debug_log_level = log_val;
-		return;
-	} else if (ring_id == RING_ID_FIRMWARE_DEBUG) {
-		p_cds_context->fw_debug_log_level = log_val;
-		return;
-	}
-}
-
-/**
- * cds_get_ring_log_level() - Get the a ring id's log level
- * @ring_id: Ring id
- *
- * Fetch and return the log level corresponding to a ring id
- *
- * Return: Log level corresponding to the ring ID
- */
-enum wifi_driver_log_level cds_get_ring_log_level(uint32_t ring_id)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invald", __func__);
-		return WLAN_LOG_LEVEL_OFF;
-	}
-
-	if (ring_id == RING_ID_WAKELOCK)
-		return p_cds_context->wakelock_log_level;
-	else if (ring_id == RING_ID_CONNECTIVITY)
-		return p_cds_context->connectivity_log_level;
-	else if (ring_id == RING_ID_PER_PACKET_STATS)
-		return p_cds_context->packet_stats_log_level;
-	else if (ring_id == RING_ID_DRIVER_DEBUG)
-		return p_cds_context->driver_debug_log_level;
-	else if (ring_id == RING_ID_FIRMWARE_DEBUG)
-		return p_cds_context->fw_debug_log_level;
-
-	return WLAN_LOG_LEVEL_OFF;
-}
-
-/**
- * cds_set_multicast_logging() - Set mutlicast logging value
- * @value: Value of multicast logging
- *
- * Set the multicast logging value which will indicate
- * whether to multicast host and fw messages even
- * without any registration by userspace entity
- *
- * Return: None
- */
-void cds_set_multicast_logging(uint8_t value)
-{
-	cds_multicast_logging = value;
-}
-
-/**
- * cds_is_multicast_logging() - Get multicast logging value
- *
- * Get the multicast logging value which will indicate
- * whether to multicast host and fw messages even
- * without any registration by userspace entity
- *
- * Return: 0 - Multicast logging disabled, 1 - Multicast logging enabled
- */
-uint8_t cds_is_multicast_logging(void)
-{
-	return cds_multicast_logging;
-}
-
-/*
- * cds_init_log_completion() - Initialize log param structure
- *
- * This function is used to initialize the logging related
- * parameters
- *
- * Return: None
- */
-void cds_init_log_completion(void)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invalid", __func__);
-		return;
-	}
-
-	p_cds_context->log_complete.is_fatal = WLAN_LOG_TYPE_NON_FATAL;
-	p_cds_context->log_complete.indicator = WLAN_LOG_INDICATOR_UNUSED;
-	p_cds_context->log_complete.reason_code = WLAN_LOG_REASON_CODE_UNUSED;
-	p_cds_context->log_complete.is_report_in_progress = false;
-	/* Attempting to initialize an already initialized lock
-	 * results in a failure. This must be ok here.
-	 */
-	cdf_spinlock_init(&p_cds_context->bug_report_lock);
-}
-
-/**
- * cds_deinit_log_completion() - Deinitialize log param structure
- *
- * This function is used to deinitialize the logging related
- * parameters
- *
- * Return: None
- */
-void cds_deinit_log_completion(void)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invalid", __func__);
-		return;
-	}
-
-	cdf_spinlock_destroy(&p_cds_context->bug_report_lock);
-}
-
-/**
- * cds_set_log_completion() - Store the logging params
- * @is_fatal: Indicates if the event triggering bug report is fatal or not
- * @indicator: Source which trigerred the bug report
- * @reason_code: Reason for triggering bug report
- *
- * This function is used to set the logging parameters based on the
- * caller
- *
- * Return: 0 if setting of params is successful
- */
-CDF_STATUS cds_set_log_completion(uint32_t is_fatal,
-		uint32_t indicator,
-		uint32_t reason_code)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invalid", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_spinlock_acquire(&p_cds_context->bug_report_lock);
-	p_cds_context->log_complete.is_fatal = is_fatal;
-	p_cds_context->log_complete.indicator = indicator;
-	p_cds_context->log_complete.reason_code = reason_code;
-	p_cds_context->log_complete.is_report_in_progress = true;
-	cdf_spinlock_release(&p_cds_context->bug_report_lock);
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_log_completion() - Get the logging related params
- * @is_fatal: Indicates if the event triggering bug report is fatal or not
- * @indicator: Source which trigerred the bug report
- * @reason_code: Reason for triggering bug report
- *
- * This function is used to get the logging related parameters
- *
- * Return: None
- */
-void cds_get_log_completion(uint32_t *is_fatal,
-		uint32_t *indicator,
-		uint32_t *reason_code)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invalid", __func__);
-		return;
-	}
-
-	cdf_spinlock_acquire(&p_cds_context->bug_report_lock);
-	*is_fatal =  p_cds_context->log_complete.is_fatal;
-	*indicator = p_cds_context->log_complete.indicator;
-	*reason_code = p_cds_context->log_complete.reason_code;
-	p_cds_context->log_complete.is_report_in_progress = false;
-	cdf_spinlock_release(&p_cds_context->bug_report_lock);
-}
-
-/**
- * cds_is_log_report_in_progress() - Check if bug reporting is in progress
- *
- * This function is used to check if the bug reporting is already in progress
- *
- * Return: true if the bug reporting is in progress
- */
-bool cds_is_log_report_in_progress(void)
-{
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invalid", __func__);
-		return true;
-	}
-	return p_cds_context->log_complete.is_report_in_progress;
-}
-
-/**
- * cds_flush_logs() - Report fatal event to userspace
- * @is_fatal: Indicates if the event triggering bug report is fatal or not
- * @indicator: Source which trigerred the bug report
- * @reason_code: Reason for triggering bug report
- *
- * This function sets the log related params and send the WMI command to the
- * FW to flush its logs. On receiving the flush completion event from the FW
- * the same will be conveyed to userspace
- *
- * Return: 0 on success
- */
-CDF_STATUS cds_flush_logs(uint32_t is_fatal,
-		uint32_t indicator,
-		uint32_t reason_code)
-{
-	uint32_t ret;
-	CDF_STATUS status;
-
-	p_cds_contextType p_cds_context;
-
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: cds context is Invalid", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (cds_is_log_report_in_progress() == true) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: Bug report already in progress - dropping! type:%d, indicator=%d reason_code=%d",
-				__func__, is_fatal, indicator, reason_code);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	status = cds_set_log_completion(is_fatal, indicator, reason_code);
-	if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			"%s: Failed to set log trigger params", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-			"%s: Triggering bug report: type:%d, indicator=%d reason_code=%d",
-			__func__, is_fatal, indicator, reason_code);
-
-	ret = sme_send_flush_logs_cmd_to_fw(p_cds_context->pMACContext);
-	if (0 != ret) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				"%s: Failed to send flush FW log", __func__);
-		cds_init_log_completion();
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_logging_set_fw_flush_complete() - Wrapper for FW log flush completion
- *
- * This function is used to send signal to the logger thread to indicate
- * that the flushing of FW logs is complete by the FW
- *
- * Return: None
- *
- */
-void cds_logging_set_fw_flush_complete(void)
-{
-	wlan_logging_set_fw_flush_complete();
-}

+ 0 - 7849
core/cds/src/cds_concurrency.c

@@ -1,7849 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: cds_concurrency.c
- *
- * WLAN Concurrenct Connection Management functions
- *
- */
-
-/* Include files */
-
-#include <cds_api.h>
-#include <cds_sched.h>
-#include <linux/etherdevice.h>
-#include <linux/firmware.h>
-#include <wlan_hdd_tx_rx.h>
-#include <wni_api.h>
-#include "wlan_hdd_trace.h"
-#include "wlan_hdd_hostapd.h"
-#include "cds_concurrency.h"
-#include "cdf_types.h"
-#include "cdf_trace.h"
-
-#include <net/addrconf.h>
-#include <linux/wireless.h>
-#include <net/cfg80211.h>
-#include <linux/inetdevice.h>
-#include <net/addrconf.h>
-#include <linux/rtnetlink.h>
-#include "sap_api.h"
-#include <linux/semaphore.h>
-#include <linux/ctype.h>
-#include <linux/compat.h>
-#include "cfg_api.h"
-#include "qwlan_version.h"
-#include "wma_types.h"
-#include "wma.h"
-#include "wma_api.h"
-#include "cds_utils.h"
-#include "cds_reg_service.h"
-#include "wlan_hdd_ipa.h"
-
-#define CDS_MAX_FEATURE_SET   8
-static struct cds_conc_connection_info
-	conc_connection_list[MAX_NUMBER_OF_CONC_CONNECTIONS];
-
-#define CONC_CONNECTION_LIST_VALID_INDEX(index) \
-		((MAX_NUMBER_OF_CONC_CONNECTIONS > index) && \
-			(conc_connection_list[index].in_use))
-
-#define CDS_MAX_CON_STRING_LEN   100
-/**
- * first_connection_pcl_table - table which provides PCL for the
- * very first connection in the system
- */
-static const enum cds_pcl_type
-first_connection_pcl_table[CDS_MAX_NUM_OF_MODE]
-			[CDS_MAX_CONC_PRIORITY_MODE] = {
-	[CDS_STA_MODE] = {CDS_NONE, CDS_NONE, CDS_NONE},
-	[CDS_SAP_MODE] = {CDS_5G,   CDS_5G,   CDS_5G  },
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G,   CDS_5G,   CDS_5G  },
-	[CDS_P2P_GO_MODE] = {CDS_5G,   CDS_5G,   CDS_5G  },
-	[CDS_IBSS_MODE] = {CDS_NONE, CDS_NONE, CDS_NONE},
-};
-
-/**
- * second_connection_pcl_dbs_table - table which provides PCL
- * for the 2nd connection, when we have a connection already in
- * the system (with DBS supported by HW)
- */
-static const enum cds_pcl_type
-second_connection_pcl_dbs_table[CDS_MAX_ONE_CONNECTION_MODE]
-			[CDS_MAX_NUM_OF_MODE][CDS_MAX_CONC_PRIORITY_MODE] = {
-	[CDS_STA_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {CDS_5G,        CDS_5G,        CDS_5G       } },
-
-	[CDS_STA_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {CDS_5G,        CDS_5G,        CDS_5G       } },
-
-	[CDS_STA_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {CDS_24G,        CDS_24G,        CDS_24G       } },
-
-	[CDS_STA_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {CDS_24G,        CDS_24G,        CDS_24G       } },
-
-	[CDS_P2P_CLI_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G, CDS_5G, CDS_5G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G, CDS_5G, CDS_5G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_SCC_CH_24G, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_24G_SCC_CH, CDS_24G_SCC_CH, CDS_24G_SCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_24G_SCC_CH, CDS_24G_SCC_CH, CDS_24G_SCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] =	{
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-};
-
-/**
- * second_connection_pcl_nodbs_table - table which provides PCL
- * for the 2nd connection, when we have a connection already in
- * the system (with DBS not supported by HW)
- */
-static const enum cds_pcl_type
-second_connection_pcl_nodbs_table[CDS_MAX_ONE_CONNECTION_MODE]
-			[CDS_MAX_NUM_OF_MODE][CDS_MAX_CONC_PRIORITY_MODE] = {
-	[CDS_STA_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_GO_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_GO_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_GO_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_P2P_GO_MODE] = {CDS_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH_5G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH,    CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH,    CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH,    CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH,    CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH,    CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH,    CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_SAP_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_24_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_24_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_5_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_IBSS_5_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-};
-
-/**
- * third_connection_pcl_dbs_table - table which provides PCL for
- * the 3rd connection, when we have two connections already in
- * the system (with DBS supported by HW)
- */
-static const enum cds_pcl_type
-third_connection_pcl_dbs_table[CDS_MAX_TWO_CONNECTION_MODE]
-			[CDS_MAX_NUM_OF_MODE][CDS_MAX_CONC_PRIORITY_MODE] = {
-	[CDS_STA_SAP_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
-	[CDS_STA_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
-	[CDS_STA_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
-	[CDS_STA_P2P_GO_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
-	[CDS_STA_P2P_GO_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
-	[CDS_STA_P2P_GO_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
-	[CDS_STA_P2P_CLI_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_IBSS_MODE] = {CDS_NONE, CDS_NONE, CDS_NONE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_MCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
-	[CDS_STA_P2P_CLI_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
-	[CDS_STA_P2P_CLI_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
-	[CDS_P2P_GO_P2P_CLI_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_24G,        CDS_24G, CDS_24G},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
-	[CDS_P2P_GO_P2P_CLI_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
-	[CDS_P2P_GO_P2P_CLI_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_P2P_GO_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
-	[CDS_P2P_GO_SAP_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
-	[CDS_P2P_GO_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_ON_5_SCC_ON_24_5G,
-	CDS_SCC_ON_5_SCC_ON_24_5G, CDS_SCC_ON_5_SCC_ON_24_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
-	[CDS_P2P_GO_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_ON_5_SCC_ON_24,
-	CDS_SCC_ON_5_SCC_ON_24, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
-	[CDS_P2P_CLI_SAP_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_SCC_CH, CDS_5G_SCC_CH, CDS_5G_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_5G, CDS_5G_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH_24G, CDS_24G_SCC_CH, CDS_SCC_CH_24G},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#ifndef QCA_WIFI_3_0_EMU
-	[CDS_P2P_CLI_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24_5G, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#else
-	[CDS_P2P_CLI_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-		CDS_SCC_ON_5_SCC_ON_24, CDS_NONE, CDS_SCC_ON_5_SCC_ON_24},
-	[CDS_SAP_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-#endif
-
-};
-
-/**
- * third_connection_pcl_nodbs_table - table which provides PCL
- * for the 3rd connection, when we have two connections already
- * in the system (with DBS not supported by HW)
- */
-static const enum cds_pcl_type
-third_connection_pcl_nodbs_table[CDS_MAX_TWO_CONNECTION_MODE]
-			[CDS_MAX_NUM_OF_MODE][CDS_MAX_CONC_PRIORITY_MODE] = {
-	[CDS_STA_SAP_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_GO_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH_5G, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH_5G, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_STA_P2P_CLI_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH_5G, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_5G_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {
-			CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_CLIENT_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_P2P_GO_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_P2P_CLI_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_24G, CDS_24G, CDS_24G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH_5G, CDS_5G, CDS_5G},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_GO_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-
-	[CDS_P2P_CLI_SAP_SCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_SCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G,        CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_1x1] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_2x2] = {
-	[CDS_STA_MODE] = {CDS_5G_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_SCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_SCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_SCC_CH, CDS_SCC_CH, CDS_SCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_5_1x1] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_MCC_24_5_2x2] = {
-	[CDS_STA_MODE] = {CDS_MCC_CH, CDS_MCC_CH, CDS_MCC_CH},
-	[CDS_SAP_MODE] = {CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-	[CDS_P2P_CLI_SAP_DBS_1x1] = {
-	[CDS_STA_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_SAP_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_CLIENT_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_P2P_GO_MODE] = {
-			CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE},
-	[CDS_IBSS_MODE] = {
-		CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE, CDS_MAX_PCL_TYPE} },
-
-};
-
-/**
- * next_action_two_connection_table - table which provides next
- * action while a new connection is coming up, with one
- * connection already in the system
- */
-static const enum cds_conc_next_action
-next_action_two_connection_table[CDS_MAX_ONE_CONNECTION_MODE][CDS_MAX_BAND] = {
-	[CDS_STA_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_STA_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_STA_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_STA_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_CLI_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_CLI_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_CLI_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_CLI_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_GO_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_GO_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_GO_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_GO_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_SAP_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_SAP_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_SAP_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_SAP_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_IBSS_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_IBSS_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_IBSS_5_1x1] = {CDS_DBS,            CDS_NOP},
-	[CDS_IBSS_5_2x2] = {CDS_DBS_DOWNGRADE,  CDS_NOP},
-};
-
-/**
- * next_action_three_connection_table - table which provides next
- * action while a new connection is coming up, with two
- * connections already in the system
- */
-static const enum cds_conc_next_action
-next_action_three_connection_table[CDS_MAX_TWO_CONNECTION_MODE]
-				[CDS_MAX_BAND] = {
-	[CDS_STA_SAP_SCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_STA_SAP_SCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_STA_SAP_MCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_STA_SAP_MCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_STA_SAP_SCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_STA_SAP_SCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_STA_SAP_MCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_STA_SAP_MCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_STA_SAP_MCC_24_5_1x1] = {CDS_DBS,             CDS_DBS},
-	[CDS_STA_SAP_MCC_24_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_DBS_DOWNGRADE},
-	[CDS_STA_SAP_DBS_1x1] = {CDS_NOP,             CDS_NOP},
-	[CDS_STA_P2P_GO_SCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_STA_P2P_GO_SCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_STA_P2P_GO_MCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_STA_P2P_GO_MCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_STA_P2P_GO_SCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_STA_P2P_GO_SCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_STA_P2P_GO_MCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_STA_P2P_GO_MCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_STA_P2P_GO_MCC_24_5_1x1] = {CDS_DBS,             CDS_DBS},
-	[CDS_STA_P2P_GO_MCC_24_5_2x2] = {
-			CDS_DBS_DOWNGRADE,   CDS_DBS_DOWNGRADE},
-	[CDS_STA_P2P_GO_DBS_1x1] = {CDS_NOP,             CDS_NOP},
-	[CDS_STA_P2P_CLI_SCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_STA_P2P_CLI_SCC_24_2x2] = {
-			CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_STA_P2P_CLI_MCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_STA_P2P_CLI_MCC_24_2x2] = {
-			CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_STA_P2P_CLI_SCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_STA_P2P_CLI_SCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_STA_P2P_CLI_MCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_STA_P2P_CLI_MCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_STA_P2P_CLI_MCC_24_5_1x1] = {CDS_DBS,             CDS_DBS},
-	[CDS_STA_P2P_CLI_MCC_24_5_2x2] = {
-			CDS_DBS_DOWNGRADE,   CDS_DBS_DOWNGRADE},
-	[CDS_STA_P2P_CLI_DBS_1x1] = {CDS_NOP,             CDS_NOP},
-	[CDS_P2P_GO_P2P_CLI_SCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_GO_P2P_CLI_SCC_24_2x2] = {
-			CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_GO_P2P_CLI_MCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_GO_P2P_CLI_MCC_24_2x2] = {
-			CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_GO_P2P_CLI_SCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_GO_P2P_CLI_SCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_GO_P2P_CLI_MCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_GO_P2P_CLI_MCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_GO_P2P_CLI_MCC_24_5_1x1] = {CDS_DBS,             CDS_DBS},
-	[CDS_P2P_GO_P2P_CLI_MCC_24_5_2x2] = {
-			CDS_DBS_DOWNGRADE,   CDS_DBS_DOWNGRADE},
-	[CDS_P2P_GO_P2P_CLI_DBS_1x1] = {CDS_NOP,             CDS_NOP},
-	[CDS_P2P_GO_SAP_SCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_GO_SAP_SCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_GO_SAP_MCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_GO_SAP_MCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_GO_SAP_SCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_GO_SAP_SCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_GO_SAP_MCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_GO_SAP_MCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_GO_SAP_MCC_24_5_1x1] = {CDS_DBS,             CDS_DBS},
-	[CDS_P2P_GO_SAP_MCC_24_5_2x2] = {
-			CDS_DBS_DOWNGRADE,   CDS_DBS_DOWNGRADE},
-	[CDS_P2P_GO_SAP_DBS_1x1] = {CDS_NOP,             CDS_NOP},
-	[CDS_P2P_CLI_SAP_SCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_CLI_SAP_SCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_CLI_SAP_MCC_24_1x1] = {CDS_NOP,             CDS_DBS},
-	[CDS_P2P_CLI_SAP_MCC_24_2x2] = {CDS_NOP,             CDS_DBS_DOWNGRADE},
-	[CDS_P2P_CLI_SAP_SCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_CLI_SAP_SCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_CLI_SAP_MCC_5_1x1] = {CDS_DBS,             CDS_NOP},
-	[CDS_P2P_CLI_SAP_MCC_5_2x2] = {CDS_DBS_DOWNGRADE,   CDS_NOP},
-	[CDS_P2P_CLI_SAP_MCC_24_5_1x1] = {CDS_DBS,             CDS_DBS},
-	[CDS_P2P_CLI_SAP_MCC_24_5_2x2] = {CDS_DBS_DOWNGRADE, CDS_DBS_DOWNGRADE},
-	[CDS_P2P_CLI_SAP_DBS_1x1] = {CDS_NOP,             CDS_NOP},
-
-};
-
-/**
- * cds_is_sta_connection_pending() - This function will check if sta connection
- *                                   is pending or not.
- *
- * This function will return the status of flag is_sta_connection_pending
- *
- * Return: true or false
- */
-bool cds_is_sta_connection_pending(void)
-{
-	bool status;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return false;
-	}
-
-	spin_lock(&hdd_ctx->sta_update_info_lock);
-	status = hdd_ctx->is_sta_connection_pending;
-	spin_unlock(&hdd_ctx->sta_update_info_lock);
-	return status;
-}
-
-/**
- * cds_change_sta_conn_pending_status() - This function will change the value
- *                                        of is_sta_connection_pending
- * @value: value to set
- *
- * This function will change the value of is_sta_connection_pending
- *
- * Return: none
- */
-void cds_change_sta_conn_pending_status(bool value)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	spin_lock(&hdd_ctx->sta_update_info_lock);
-	hdd_ctx->is_sta_connection_pending = value;
-	spin_unlock(&hdd_ctx->sta_update_info_lock);
-}
-
-/**
- * cds_is_sap_restart_required() - This function will check if sap restart
- *                                 is pending or not.
- *
- * This function will return the status of flag is_sap_restart_required.
- *
- * Return: true or false
- */
-static bool cds_is_sap_restart_required(void)
-{
-	bool status;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return false;
-	}
-
-	spin_lock(&hdd_ctx->sap_update_info_lock);
-	status = hdd_ctx->is_sap_restart_required;
-	spin_unlock(&hdd_ctx->sap_update_info_lock);
-	return status;
-}
-
-/**
- * cds_change_sap_restart_required_status() - This function will change the
- *                                            value of is_sap_restart_required
- * @value: value to set
- *
- * This function will change the value of is_sap_restart_required
- *
- * Return: none
- */
-void cds_change_sap_restart_required_status(bool value)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	spin_lock(&hdd_ctx->sap_update_info_lock);
-	hdd_ctx->is_sap_restart_required = value;
-	spin_unlock(&hdd_ctx->sap_update_info_lock);
-}
-
-/**
- * cds_set_connection_in_progress() - to set the connection in progress flag
- * @value: value to set
- *
- * This function will set the passed value to connection in progress flag.
- * If value is previously being set to true then no need to set it again.
- *
- * Return: true if value is being set correctly and false otherwise.
- */
-bool cds_set_connection_in_progress(bool value)
-{
-	bool status = true;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return false;
-	}
-
-	cdf_spin_lock(&hdd_ctx->connection_status_lock);
-	/*
-	 * if the value is set to true previously and if someone is
-	 * trying to make it true again then it could be some race
-	 * condition being triggered. Avoid this situation by returning
-	 * false
-	 */
-	if (hdd_ctx->connection_in_progress && value)
-		status = false;
-	else
-		hdd_ctx->connection_in_progress = value;
-	cdf_spin_unlock(&hdd_ctx->connection_status_lock);
-	return status;
-}
-
-/**
- * cds_update_conc_list() - Update the concurrent connection list
- * @conn_index: Connection index
- * @mode: Mode
- * @chan: Channel
- * @mac: Mac id
- * @chain_mask: Chain mask
- * @tx_spatial_stream: Tx spatial stream
- * @rx_spatial_stream: Rx spatial stream
- * @vdev_id: vdev id
- * @in_use: Flag to indicate if the index is in use or not
- *
- * Updates the index value of the concurrent connection list
- *
- * Return: None
- */
-static void cds_update_conc_list(uint32_t conn_index,
-		enum cds_con_mode mode,
-		uint8_t chan,
-		uint8_t mac,
-		enum cds_chain_mode chain_mask,
-		uint8_t tx_spatial_stream,
-		uint8_t rx_spatial_stream,
-		uint32_t original_nss,
-		uint32_t vdev_id,
-		bool in_use)
-{
-	if (conn_index >= MAX_NUMBER_OF_CONC_CONNECTIONS) {
-		cds_err("Number of connections exceeded conn_index: %d",
-			conn_index);
-		return;
-	}
-	conc_connection_list[conn_index].mode = mode;
-	conc_connection_list[conn_index].chan = chan;
-	conc_connection_list[conn_index].mac = mac;
-	conc_connection_list[conn_index].chain_mask = chain_mask;
-	conc_connection_list[conn_index].tx_spatial_stream = tx_spatial_stream;
-	conc_connection_list[conn_index].rx_spatial_stream = rx_spatial_stream;
-	conc_connection_list[conn_index].original_nss = original_nss;
-	conc_connection_list[conn_index].vdev_id = vdev_id;
-	conc_connection_list[conn_index].in_use = in_use;
-}
-
-/**
- * cds_mode_specific_connection_count() - provides the
- * count of connections of specific mode
- * @mode: type of connection
- * @list: To provide the indices on conc_connection_list
- *	(optional)
- *
- * This function provides the count of current connections
- *
- * Return: connection count of specific type
- */
-static uint32_t cds_mode_specific_connection_count(enum cds_con_mode mode,
-						uint32_t *list)
-{
-	uint32_t conn_index = 0, count = 0;
-	for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
-		 conn_index++) {
-		if ((conc_connection_list[conn_index].mode == mode) &&
-			conc_connection_list[conn_index].in_use) {
-			if (list != NULL)
-				list[count] = conn_index;
-			 count++;
-		}
-	}
-	return count;
-}
-
-/**
- * cds_store_and_del_conn_info() - Store and del a connection info
- * @mode: Mode whose entry has to be deleted
- * @info: Struture pointer where the connection info will be saved
- *
- * Saves the connection info corresponding to the provided mode
- * and deleted that corresponding entry based on vdev from the
- * connection info structure
- *
- * Return: None
- */
-static void cds_store_and_del_conn_info(enum cds_con_mode mode,
-				struct cds_conc_connection_info *info)
-{
-	uint32_t conn_index = 0;
-	bool found = false;
-
-	while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-		if (mode == conc_connection_list[conn_index].mode) {
-			found = true;
-			break;
-		}
-		conn_index++;
-	}
-
-	if (!found) {
-		cds_err("Mode:%d not available in the conn info", mode);
-		return;
-	}
-
-	/* Storing the STA entry which will be temporarily deleted */
-	*info = conc_connection_list[conn_index];
-
-	/* Deleting the STA entry */
-	cds_decr_connection_count(info->vdev_id);
-
-	cds_info("Stored %d (%d), deleted STA entry with vdev id %d, index %d",
-		info->vdev_id, info->mode, info->vdev_id, conn_index);
-
-	/* Caller should set the PCL and restore the STA entry in conn info */
-}
-
-/**
- * cds_restore_deleted_conn_info() - Restore connection info
- * @info: Saved connection info that is to be restored
- *
- * Restores the connection info of STA that was saved before
- * updating the PCL to the FW
- *
- * Return: None
- */
-static void cds_restore_deleted_conn_info(
-					struct cds_conc_connection_info *info)
-{
-	uint32_t conn_index;
-
-	conn_index = cds_get_connection_count();
-	if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) {
-		cds_err("Failed to restore the deleted information %d/%d",
-			conn_index, MAX_NUMBER_OF_CONC_CONNECTIONS);
-		return;
-	}
-
-	conc_connection_list[conn_index] = *info;
-
-	cds_info("Restored the deleleted conn info, vdev:%d, index:%d",
-		info->vdev_id, conn_index);
-}
-
-/**
- * cds_update_hw_mode_conn_info() - Update connection info based on HW mode
- * @num_vdev_mac_entries: Number of vdev-mac id entries that follow
- * @vdev_mac_map: Mapping of vdev-mac id
- * @hw_mode: HW mode
- *
- * Updates the connection info parameters based on the new HW mode
- *
- * Return: None
- */
-static void cds_update_hw_mode_conn_info(uint32_t num_vdev_mac_entries,
-				       struct sir_vdev_mac_map *vdev_mac_map,
-				       struct sir_hw_mode_params hw_mode)
-{
-	uint32_t i, conn_index, found;
-	cds_context_type *cds_ctx;
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return;
-	}
-
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	for (i = 0; i < num_vdev_mac_entries; i++) {
-		conn_index = 0;
-		found = 0;
-		while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-			if (vdev_mac_map[i].vdev_id ==
-				conc_connection_list[conn_index].vdev_id) {
-				found = 1;
-				break;
-			}
-			conn_index++;
-		}
-		if (found) {
-			conc_connection_list[conn_index].mac =
-				vdev_mac_map[i].mac_id;
-			if (vdev_mac_map[i].mac_id == 0) {
-				conc_connection_list[conn_index].
-					tx_spatial_stream = hw_mode.mac0_tx_ss;
-				conc_connection_list[conn_index].
-					rx_spatial_stream = hw_mode.mac0_rx_ss;
-			} else {
-				conc_connection_list[conn_index].
-					tx_spatial_stream = hw_mode.mac1_tx_ss;
-				conc_connection_list[conn_index].
-					rx_spatial_stream = hw_mode.mac1_rx_ss;
-			}
-			cds_info("vdev:%d, mac:%d, tx ss:%d, rx ss;%d",
-			  conc_connection_list[conn_index].vdev_id,
-			  conc_connection_list[conn_index].mac,
-			  conc_connection_list[conn_index].tx_spatial_stream,
-			  conc_connection_list[conn_index].rx_spatial_stream);
-		}
-	}
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-}
-
-/**
- * cds_soc_set_dual_mac_cfg_cb() - Callback for set dual mac config
- * @status: Status of set dual mac config
- * @scan_config: Current scan config whose status is the first param
- * @fw_mode_config: Current FW mode config whose status is the first param
- *
- * Callback on setting the dual mac configuration
- *
- * Return: None
- */
-void cds_soc_set_dual_mac_cfg_cb(enum set_hw_mode_status status,
-		uint32_t scan_config,
-		uint32_t fw_mode_config)
-{
-	cds_info("Status:%d for scan_config:%x fw_mode_config:%x",
-			status, scan_config, fw_mode_config);
-}
-
-/**
- * cds_set_dual_mac_scan_config() - Set the dual MAC scan config
- * @dbs_val: Value of DBS bit
- * @dbs_plus_agile_scan_val: Value of DBS plus agile scan bit
- * @single_mac_scan_with_dbs_val: Value of Single MAC scan with DBS
- *
- * Set the values of scan config. For FW mode config, the existing values
- * will be retained
- *
- * Return: None
- */
-void cds_set_dual_mac_scan_config(uint8_t dbs_val,
-		uint8_t dbs_plus_agile_scan_val,
-		uint8_t single_mac_scan_with_dbs_val)
-{
-	struct sir_dual_mac_config cfg;
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	/* Any non-zero positive value is treated as 1 */
-	if (dbs_val != 0)
-		dbs_val = 1;
-	if (dbs_plus_agile_scan_val != 0)
-		dbs_plus_agile_scan_val = 1;
-	if (single_mac_scan_with_dbs_val != 0)
-		single_mac_scan_with_dbs_val = 1;
-
-	status = wma_get_updated_scan_config(&cfg.scan_config,
-			dbs_val,
-			dbs_plus_agile_scan_val,
-			single_mac_scan_with_dbs_val);
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("wma_get_updated_scan_config failed %d", status);
-		return;
-	}
-
-	status = wma_get_updated_fw_mode_config(&cfg.fw_mode_config,
-			wma_get_dbs_config(),
-			wma_get_agile_dfs_config());
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("wma_get_updated_fw_mode_config failed %d", status);
-		return;
-	}
-
-	cfg.set_dual_mac_cb = (void *)cds_soc_set_dual_mac_cfg_cb;
-
-	cds_info("scan_config:%x fw_mode_config:%x",
-			cfg.scan_config, cfg.fw_mode_config);
-
-	status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("sme_soc_set_dual_mac_config failed %d", status);
-		return;
-	}
-}
-
-/**
- * cds_set_dual_mac_fw_mode_config() - Set the dual mac FW mode config
- * @dbs: DBS bit
- * @dfs: Agile DFS bit
- *
- * Set the values of fw mode config. For scan config, the existing values
- * will be retain.
- *
- * Return: None
- */
-void cds_set_dual_mac_fw_mode_config(uint8_t dbs, uint8_t dfs)
-{
-	struct sir_dual_mac_config cfg;
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	/* Any non-zero positive value is treated as 1 */
-	if (dbs != 0)
-		dbs = 1;
-	if (dfs != 0)
-		dfs = 1;
-
-	status = wma_get_updated_scan_config(&cfg.scan_config,
-			wma_get_dbs_scan_config(),
-			wma_get_dbs_plus_agile_scan_config(),
-			wma_get_single_mac_scan_with_dfs_config());
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("wma_get_updated_scan_config failed %d", status);
-		return;
-	}
-
-	status = wma_get_updated_fw_mode_config(&cfg.fw_mode_config,
-			dbs, dfs);
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("wma_get_updated_fw_mode_config failed %d", status);
-		return;
-	}
-
-	cfg.set_dual_mac_cb = (void *)cds_soc_set_dual_mac_cfg_cb;
-
-	cds_info("scan_config:%x fw_mode_config:%x",
-			cfg.scan_config, cfg.fw_mode_config);
-
-	status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("sme_soc_set_dual_mac_config failed %d", status);
-		return;
-	}
-}
-
-/**
- * cds_soc_set_hw_mode_cb() - Callback for set hw mode
- * @status: Status
- * @cfgd_hw_mode_index: Configured HW mode index
- * @num_vdev_mac_entries: Number of vdev-mac id mapping that follows
- * @vdev_mac_map: vdev-mac id map. This memory will be freed by the caller.
- * So, make local copy if needed.
- *
- * Provides the status and configured hw mode index set
- * by the FW
- *
- * Return: None
- */
-static void cds_soc_set_hw_mode_cb(uint32_t status,
-				 uint32_t cfgd_hw_mode_index,
-				 uint32_t num_vdev_mac_entries,
-				 struct sir_vdev_mac_map *vdev_mac_map)
-{
-	CDF_STATUS ret;
-	struct sir_hw_mode_params hw_mode;
-	uint32_t i;
-
-	if (status != SET_HW_MODE_STATUS_OK) {
-		cds_err("Set HW mode failed with status %d", status);
-		return;
-	}
-
-	if (!vdev_mac_map) {
-		cds_err("vdev_mac_map is NULL");
-		return;
-	}
-
-	cds_info("cfgd_hw_mode_index=%d", cfgd_hw_mode_index);
-
-	for (i = 0; i < num_vdev_mac_entries; i++)
-		cds_info("vdev_id:%d mac_id:%d",
-				vdev_mac_map[i].vdev_id,
-				vdev_mac_map[i].mac_id);
-
-	ret = wma_get_hw_mode_from_idx(cfgd_hw_mode_index, &hw_mode);
-	if (ret != CDF_STATUS_SUCCESS) {
-		cds_err("Get HW mode failed: %d", ret);
-		return;
-	}
-
-	cds_info("MAC0: TxSS:%d, RxSS:%d, Bw:%d",
-		hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw);
-	cds_info("MAC1: TxSS:%d, RxSS:%d, Bw:%d",
-		hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw);
-	cds_info("DBS:%d, Agile DFS:%d",
-		hw_mode.dbs_cap, hw_mode.agile_dfs_cap);
-
-	/* update conc_connection_list */
-	cds_update_hw_mode_conn_info(num_vdev_mac_entries,
-			vdev_mac_map,
-			hw_mode);
-
-	ret = cdf_set_connection_update();
-	if (!CDF_IS_STATUS_SUCCESS(ret))
-		cds_err("ERROR: set connection_update_done event failed");
-
-	return;
-}
-
-/**
- * cds_hw_mode_transition_cb() - Callback for HW mode transition from FW
- * @old_hw_mode_index: Old HW mode index
- * @new_hw_mode_index: New HW mode index
- * @num_vdev_mac_entries: Number of vdev-mac id mapping that follows
- * @vdev_mac_map: vdev-mac id map. This memory will be freed by the caller.
- * So, make local copy if needed.
- *
- * Provides the old and new HW mode index set by the FW
- *
- * Return: None
- */
-static void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index,
-				 uint32_t new_hw_mode_index,
-				 uint32_t num_vdev_mac_entries,
-				 struct sir_vdev_mac_map *vdev_mac_map)
-{
-	CDF_STATUS status;
-	struct sir_hw_mode_params hw_mode;
-	uint32_t i;
-
-	if (!vdev_mac_map) {
-		cds_err("vdev_mac_map is NULL");
-		return;
-	}
-
-	cds_info("old_hw_mode_index=%d, new_hw_mode_index=%d",
-		old_hw_mode_index, new_hw_mode_index);
-
-	for (i = 0; i < num_vdev_mac_entries; i++)
-		cds_info("vdev_id:%d mac_id:%d",
-			vdev_mac_map[i].vdev_id,
-			vdev_mac_map[i].mac_id);
-
-	status = wma_get_hw_mode_from_idx(new_hw_mode_index, &hw_mode);
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("Get HW mode failed: %d", status);
-		return;
-	}
-
-	cds_info("MAC0: TxSS:%d, RxSS:%d, Bw:%d",
-		hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw);
-	cds_info("MAC1: TxSS:%d, RxSS:%d, Bw:%d",
-		hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw);
-	cds_info("DBS:%d, Agile DFS:%d",
-		hw_mode.dbs_cap, hw_mode.agile_dfs_cap);
-
-	/* update conc_connection_list */
-	cds_update_hw_mode_conn_info(num_vdev_mac_entries,
-					  vdev_mac_map,
-					  hw_mode);
-
-	return;
-}
-
-/**
- * cds_soc_set_hw_mode() - Set HW mode command to SME
- * @session_id: Session ID
- * @mac0_ss: MAC0 spatial stream configuration
- * @mac0_bw: MAC0 bandwidth configuration
- * @mac1_ss: MAC1 spatial stream configuration
- * @mac1_bw: MAC1 bandwidth configuration
- * @dbs: HW DBS capability
- * @dfs: HW Agile DFS capability
- * @reason: Reason for connection update
- *
- * Sends the set hw mode to the SME module which will pass on
- * this message to WMA layer
- *
- * e.g.: To configure 2x2_80
- *       mac0_ss = HW_MODE_SS_2x2, mac0_bw = HW_MODE_80_MHZ
- *       mac1_ss = HW_MODE_SS_0x0, mac1_bw = HW_MODE_BW_NONE
- *       dbs = HW_MODE_DBS_NONE, dfs = HW_MODE_AGILE_DFS_NONE
- * e.g.: To configure 1x1_80_1x1_40 (DBS)
- *       mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ
- *       mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ
- *       dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE
- * e.g.: To configure 1x1_80_1x1_40 (Agile DFS)
- *       mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ
- *       mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ
- *       dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS
- *
- * Return: Success if the message made it down to the next layer
- */
-CDF_STATUS cds_soc_set_hw_mode(uint32_t session_id,
-		enum hw_mode_ss_config mac0_ss,
-		enum hw_mode_bandwidth mac0_bw,
-		enum hw_mode_ss_config mac1_ss,
-		enum hw_mode_bandwidth mac1_bw,
-		enum hw_mode_dbs_capab dbs,
-		enum hw_mode_agile_dfs_capab dfs,
-		enum cds_conn_update_reason reason)
-{
-	int8_t hw_mode_index;
-	struct sir_hw_mode msg;
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("Invalid HDD context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	hw_mode_index = wma_get_hw_mode_idx_from_dbs_hw_list(mac0_ss,
-			mac0_bw, mac1_ss, mac1_bw, dbs, dfs);
-	if (hw_mode_index < 0) {
-		cds_err("Invalid HW mode index obtained");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	msg.hw_mode_index = hw_mode_index;
-	msg.set_hw_mode_cb = (void *)cds_soc_set_hw_mode_cb;
-	msg.reason = reason;
-	msg.session_id = session_id;
-
-	cds_info("set hw mode to sme: hw_mode_index: %d",
-		msg.hw_mode_index);
-
-	status = sme_soc_set_hw_mode(hdd_ctx->hHal, msg);
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("Failed to set hw mode to SME");
-		return status;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_is_connection_in_progress() - check if connection is in progress
- * @hdd_ctx - HDD context
- *
- * Go through each adapter and check if Connection is in progress
- *
- * Return: true if connection is in progress else false
- */
-bool cds_is_connection_in_progress(void)
-{
-	hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
-	hdd_station_ctx_t *hdd_sta_ctx = NULL;
-	hdd_adapter_t *adapter = NULL;
-	CDF_STATUS status = 0;
-	uint8_t sta_id = 0;
-	uint8_t *sta_mac = NULL;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return false;
-	}
-
-	if (true == hdd_ctx->btCoexModeSet) {
-		cds_info("BTCoex Mode operation in progress");
-		return true;
-	}
-	status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
-	while (NULL != adapter_node && CDF_STATUS_SUCCESS == status) {
-		adapter = adapter_node->pAdapter;
-		if (!adapter)
-			goto end;
-
-		cds_info("Adapter with device mode %s(%d) exists",
-			hdd_device_mode_to_string(adapter->device_mode),
-			adapter->device_mode);
-		if (((WLAN_HDD_INFRA_STATION == adapter->device_mode)
-			|| (WLAN_HDD_P2P_CLIENT == adapter->device_mode)
-			|| (WLAN_HDD_P2P_DEVICE == adapter->device_mode))
-			&& (eConnectionState_Connecting ==
-				(WLAN_HDD_GET_STATION_CTX_PTR(adapter))->
-					conn_info.connState)) {
-			cds_err("%p(%d) Connection is in progress",
-				WLAN_HDD_GET_STATION_CTX_PTR(adapter),
-				adapter->sessionId);
-			return true;
-		}
-		if ((WLAN_HDD_INFRA_STATION == adapter->device_mode) &&
-				sme_neighbor_middle_of_roaming(
-					WLAN_HDD_GET_HAL_CTX(adapter),
-					adapter->sessionId)) {
-			cds_err("%p(%d) Reassociation in progress",
-				WLAN_HDD_GET_STATION_CTX_PTR(adapter),
-				adapter->sessionId);
-			return true;
-		}
-		if ((WLAN_HDD_INFRA_STATION == adapter->device_mode) ||
-			(WLAN_HDD_P2P_CLIENT == adapter->device_mode) ||
-			(WLAN_HDD_P2P_DEVICE == adapter->device_mode)) {
-			hdd_sta_ctx =
-				WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-			if ((eConnectionState_Associated ==
-				hdd_sta_ctx->conn_info.connState)
-				&& (false ==
-				hdd_sta_ctx->conn_info.uIsAuthenticated)) {
-				sta_mac = (uint8_t *)
-					&(adapter->macAddressCurrent.bytes[0]);
-				cds_err("client " MAC_ADDRESS_STR
-					" is in middle of WPS/EAPOL exchange.",
-					MAC_ADDR_ARRAY(sta_mac));
-				return true;
-			}
-		} else if ((WLAN_HDD_SOFTAP == adapter->device_mode) ||
-				(WLAN_HDD_P2P_GO == adapter->device_mode)) {
-			for (sta_id = 0; sta_id < WLAN_MAX_STA_COUNT;
-				sta_id++) {
-				if (!((adapter->aStaInfo[sta_id].isUsed)
-				    && (ol_txrx_peer_state_conn ==
-				    adapter->aStaInfo[sta_id].tlSTAState)))
-					continue;
-
-				sta_mac = (uint8_t *)
-						&(adapter->aStaInfo[sta_id].
-							macAddrSTA.bytes[0]);
-				cds_err("client " MAC_ADDRESS_STR
-				" of SAP/GO is in middle of WPS/EAPOL exchange",
-				MAC_ADDR_ARRAY(sta_mac));
-				return true;
-			}
-			if (hdd_ctx->connection_in_progress) {
-				cds_err("AP/GO: connection is in progress");
-				return true;
-			}
-		}
-end:
-		status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next);
-		adapter_node = next;
-	}
-	return false;
-}
-
-/**
- * cds_dump_current_concurrency_one_connection() - To dump the
- * current concurrency info with one connection
- * @cc_mode: connection string
- * @length: Maximum size of the string
- *
- * This routine is called to dump the concurrency info
- *
- * Return: length of the string
- */
-static uint32_t cds_dump_current_concurrency_one_connection(char *cc_mode,
-			uint32_t length)
-{
-	uint32_t count = 0;
-
-	switch (conc_connection_list[0].mode) {
-	case CDS_STA_MODE:
-		count = strlcat(cc_mode, "STA",
-					length);
-		break;
-	case CDS_SAP_MODE:
-		count = strlcat(cc_mode, "SAP",
-					length);
-		break;
-	case CDS_P2P_CLIENT_MODE:
-		count = strlcat(cc_mode, "P2P CLI",
-					length);
-		break;
-	case CDS_P2P_GO_MODE:
-		count = strlcat(cc_mode, "P2P GO",
-					length);
-		break;
-	case CDS_IBSS_MODE:
-		count = strlcat(cc_mode, "IBSS",
-					length);
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected mode %d", conc_connection_list[0].mode);
-		break;
-	}
-	return count;
-}
-
-/**
- * cds_dump_current_concurrency_two_connection() - To dump the
- * current concurrency info with two connections
- * @cc_mode: connection string
- * @length: Maximum size of the string
- *
- * This routine is called to dump the concurrency info
- *
- * Return: length of the string
- */
-static uint32_t cds_dump_current_concurrency_two_connection(char *cc_mode,
-			uint32_t length)
-{
-	uint32_t count = 0;
-
-	switch (conc_connection_list[1].mode) {
-	case CDS_STA_MODE:
-		count = cds_dump_current_concurrency_one_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+STA",
-					length);
-		break;
-	case CDS_SAP_MODE:
-		count = cds_dump_current_concurrency_one_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+SAP",
-					length);
-		break;
-	case CDS_P2P_CLIENT_MODE:
-		count = cds_dump_current_concurrency_one_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+P2P CLI",
-					length);
-		break;
-	case CDS_P2P_GO_MODE:
-		count = cds_dump_current_concurrency_one_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+P2P GO",
-					length);
-		break;
-	case CDS_IBSS_MODE:
-		count = cds_dump_current_concurrency_one_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+IBSS",
-					length);
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected mode %d", conc_connection_list[1].mode);
-		break;
-	}
-	return count;
-}
-
-/**
- * cds_dump_current_concurrency_three_connection() - To dump the
- * current concurrency info with three connections
- * @cc_mode: connection string
- * @length: Maximum size of the string
- *
- * This routine is called to dump the concurrency info
- *
- * Return: length of the string
- */
-static uint32_t cds_dump_current_concurrency_three_connection(char *cc_mode,
-			uint32_t length)
-{
-	uint32_t count = 0;
-
-	switch (conc_connection_list[2].mode) {
-	case CDS_STA_MODE:
-		count = cds_dump_current_concurrency_two_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+STA",
-					length);
-		break;
-	case CDS_SAP_MODE:
-		count = cds_dump_current_concurrency_two_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+SAP",
-					length);
-		break;
-	case CDS_P2P_CLIENT_MODE:
-		count = cds_dump_current_concurrency_two_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+P2P CLI",
-					length);
-		break;
-	case CDS_P2P_GO_MODE:
-		count = cds_dump_current_concurrency_two_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+P2P GO",
-					length);
-		break;
-	case CDS_IBSS_MODE:
-		count = cds_dump_current_concurrency_two_connection(
-				cc_mode, length);
-		count += strlcat(cc_mode, "+IBSS",
-					length);
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected mode %d", conc_connection_list[2].mode);
-		break;
-	}
-	return count;
-}
-
-/**
- * cds_dump_dbs_concurrency() - To dump the dbs concurrency
- * combination
- * @cc_mode: connection string
- *
- * This routine is called to dump the concurrency info
- *
- * Return: None
- */
-static void cds_dump_dbs_concurrency(char *cc_mode, uint32_t length)
-{
-	char buf[4] = {0};
-	uint8_t mac = 0;
-
-	strlcat(cc_mode, " DBS", length);
-	if (conc_connection_list[0].mac ==
-		conc_connection_list[1].mac) {
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[1].chan)
-			strlcat(cc_mode,
-				" with SCC for 1st two connections on mac ",
-				length);
-		else
-			strlcat(cc_mode,
-				" with MCC for 1st two connections on mac ",
-				length);
-		mac = conc_connection_list[0].mac;
-	}
-	if (conc_connection_list[0].mac == conc_connection_list[2].mac) {
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[2].chan)
-			strlcat(cc_mode,
-				" with SCC for 1st & 3rd connections on mac ",
-				length);
-		else
-			strlcat(cc_mode,
-				" with MCC for 1st & 3rd connections on mac ",
-				length);
-		mac = conc_connection_list[0].mac;
-	}
-	if (conc_connection_list[1].mac == conc_connection_list[2].mac) {
-		if (conc_connection_list[1].chan ==
-			conc_connection_list[2].chan)
-			strlcat(cc_mode,
-				" with SCC for 2nd & 3rd connections on mac ",
-				length);
-		else
-			strlcat(cc_mode,
-				" with MCC for 2nd & 3rd connections on mac ",
-				length);
-		mac = conc_connection_list[1].mac;
-	}
-	snprintf(buf, sizeof(buf), "%d ", mac);
-	strlcat(cc_mode, buf, length);
-}
-
-/**
- * cds_dump_current_concurrency() - To dump the current
- * concurrency combination
- *
- * This routine is called to dump the concurrency info
- *
- * Return: None
- */
-static void cds_dump_current_concurrency(void)
-{
-	uint32_t num_connections = 0;
-	char cc_mode[CDS_MAX_CON_STRING_LEN] = {0};
-	uint32_t count = 0;
-
-	num_connections = cds_get_connection_count();
-
-	switch (num_connections) {
-	case 1:
-		cds_dump_current_concurrency_one_connection(cc_mode,
-					sizeof(cc_mode));
-		cds_err("%s Standalone", cc_mode);
-		break;
-	case 2:
-		count = cds_dump_current_concurrency_two_connection(
-			cc_mode, sizeof(cc_mode));
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) {
-			strlcat(cc_mode, " SCC", sizeof(cc_mode));
-		} else if (conc_connection_list[0].mac ==
-					conc_connection_list[1].mac) {
-			strlcat(cc_mode, " MCC", sizeof(cc_mode));
-		} else
-			strlcat(cc_mode, " DBS", sizeof(cc_mode));
-		cds_err("%s", cc_mode);
-		break;
-	case 3:
-		count = cds_dump_current_concurrency_three_connection(
-			cc_mode, sizeof(cc_mode));
-		if ((conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) &&
-			(conc_connection_list[0].chan ==
-				conc_connection_list[2].chan)){
-				strlcat(cc_mode, " SCC",
-						sizeof(cc_mode));
-		} else if ((conc_connection_list[0].mac ==
-				conc_connection_list[1].mac)
-				&& (conc_connection_list[0].mac ==
-					conc_connection_list[2].mac)) {
-					strlcat(cc_mode, " MCC on single MAC",
-						sizeof(cc_mode));
-		} else {
-			cds_dump_dbs_concurrency(cc_mode, sizeof(cc_mode));
-		}
-		cds_err("%s", cc_mode);
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected num_connections value %d",
-			num_connections);
-		break;
-	}
-
-	return;
-}
-
-/**
- * cds_current_concurrency_is_scc() - To check the current
- * concurrency combination if it is doing SCC
- *
- * This routine is called to check if it is doing SCC
- *
- * Return: True - SCC, False - Otherwise
- */
-static bool cds_current_concurrency_is_scc(void)
-{
-	uint32_t num_connections = 0;
-	bool is_scc = false;
-
-	num_connections = cds_get_connection_count();
-
-	switch (num_connections) {
-	case 1:
-		is_scc = true;
-		break;
-	case 2:
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) {
-			is_scc = true;
-		}
-		break;
-	case 3:
-		if ((conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) &&
-			(conc_connection_list[0].chan ==
-				conc_connection_list[2].chan)){
-				is_scc = true;
-		}
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected num_connections value %d",
-			num_connections);
-		break;
-	}
-
-	return is_scc;
-}
-
-/**
- * cds_dump_legacy_concurrency() - To dump the current
- * concurrency combination
- * @sta_channel: Channel STA connection has come up
- * @ap_channel: Channel SAP connection has come up
- * @p2p_channel: Channel P2P connection has come up
- * @sta_bssid: BSSID to which STA is connected to
- * @p2p_bssid: BSSID to which P2P is connected to
- * @ap_bssid: BSSID of the AP
- * @p2p_mode: P2P Client or GO
- *
- * This routine is called to dump the concurrency info
- *
- * Return: None
- */
-static void cds_dump_legacy_concurrency(
-		uint8_t sta_channel, uint8_t ap_channel, uint8_t p2p_channel,
-		struct cdf_mac_addr sta_bssid, struct cdf_mac_addr p2p_bssid,
-		struct cdf_mac_addr ap_bssid, const char *p2p_mode)
-{
-	const char *cc_mode = "Standalone";
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	if ((sta_channel == 0) && (ap_channel == 0) && (p2p_channel == 0)) {
-		cds_err("IBSS standalone");
-		hdd_ctx->mcc_mode = 0;
-		return;
-	}
-	if (sta_channel > 0) {
-		if (ap_channel > 0) {
-			if (p2p_channel > 0) {
-				/* STA + AP + P2P */
-				if (p2p_channel == sta_channel
-					&& ap_channel == sta_channel) {
-					cc_mode = "STA+AP+P2P SCC";
-				} else {
-					if (p2p_channel == sta_channel)
-						cc_mode =
-							"STA+P2P SCC, SAP MCC";
-					else if (ap_channel == sta_channel)
-						cc_mode =
-							"STA+SAP SCC, P2P MCC";
-					else if (ap_channel == p2p_channel)
-						cc_mode =
-							"P2P+SAP SCC, STA MCC";
-				}
-			} else {
-				/* STA + AP */
-				cc_mode = (ap_channel == sta_channel) ?
-						"SCC" : "MCC";
-			}
-		} else {
-			if (p2p_channel > 0) {
-				/* STA + P2P */
-				cc_mode = (p2p_channel == sta_channel) ?
-						"SCC" : "MCC";
-			}
-		}
-	} else {
-		if (ap_channel > 0) {
-			if (p2p_channel > 0) {
-				/* AP + P2P */
-				cc_mode = (p2p_channel == ap_channel) ?
-						"SCC" : "MCC";
-			}
-		}
-	}
-	if (sta_channel > 0)
-		cds_err("wlan(%d) " MAC_ADDRESS_STR " %s",
-			sta_channel, MAC_ADDR_ARRAY(sta_bssid.bytes), cc_mode);
-
-	if (p2p_channel > 0)
-		cds_err("p2p-%s(%d) " MAC_ADDRESS_STR " %s",
-			p2p_mode, p2p_channel, MAC_ADDR_ARRAY(p2p_bssid.bytes),
-			cc_mode);
-
-	if (ap_channel > 0)
-		cds_err("AP(%d) " MAC_ADDRESS_STR " %s",
-			ap_channel, MAC_ADDR_ARRAY(ap_bssid.bytes), cc_mode);
-
-	hdd_ctx->mcc_mode = strcmp(cc_mode, "SCC");
-}
-
-/**
- * cds_dump_concurrency_info() - To dump concurrency info
- *
- * This routine is called to dump the concurrency info
- *
- * Return: None
- */
-void cds_dump_concurrency_info(void)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-	hdd_station_ctx_t *pHddStaCtx;
-	hdd_ap_ctx_t *hdd_ap_ctx;
-	hdd_hostapd_state_t *hostapd_state;
-	struct cdf_mac_addr staBssid = CDF_MAC_ADDR_ZERO_INITIALIZER;
-	struct cdf_mac_addr p2pBssid = CDF_MAC_ADDR_ZERO_INITIALIZER;
-	struct cdf_mac_addr apBssid = CDF_MAC_ADDR_ZERO_INITIALIZER;
-	uint8_t staChannel = 0, p2pChannel = 0, apChannel = 0;
-	const char *p2pMode = "DEV";
-	hdd_context_t *hdd_ctx;
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-	uint8_t targetChannel = 0;
-	uint8_t preAdapterChannel = 0;
-	uint8_t channel24;
-	uint8_t channel5;
-	hdd_adapter_t *preAdapterContext = NULL;
-	hdd_adapter_t *adapter2_4 = NULL;
-	hdd_adapter_t *adapter5 = NULL;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-		switch (adapter->device_mode) {
-		case WLAN_HDD_INFRA_STATION:
-			pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-			if (eConnectionState_Associated ==
-			    pHddStaCtx->conn_info.connState) {
-				staChannel =
-					pHddStaCtx->conn_info.operationChannel;
-				cdf_copy_macaddr(&staBssid,
-						 &pHddStaCtx->conn_info.bssId);
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-				targetChannel = staChannel;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-			}
-			break;
-		case WLAN_HDD_P2P_CLIENT:
-			pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-			if (eConnectionState_Associated ==
-			    pHddStaCtx->conn_info.connState) {
-				p2pChannel =
-					pHddStaCtx->conn_info.operationChannel;
-				cdf_copy_macaddr(&p2pBssid,
-						&pHddStaCtx->conn_info.bssId);
-				p2pMode = "CLI";
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-				targetChannel = p2pChannel;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-			}
-			break;
-		case WLAN_HDD_P2P_GO:
-			hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter);
-			hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
-			if (hostapd_state->bssState == BSS_START
-			    && hostapd_state->cdf_status ==
-			    CDF_STATUS_SUCCESS) {
-				p2pChannel = hdd_ap_ctx->operatingChannel;
-				cdf_copy_macaddr(&p2pBssid,
-						 &adapter->macAddressCurrent);
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-				targetChannel = p2pChannel;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-			}
-			p2pMode = "GO";
-			break;
-		case WLAN_HDD_SOFTAP:
-			hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter);
-			hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
-			if (hostapd_state->bssState == BSS_START
-			    && hostapd_state->cdf_status ==
-			    CDF_STATUS_SUCCESS) {
-				apChannel = hdd_ap_ctx->operatingChannel;
-				cdf_copy_macaddr(&apBssid,
-						&adapter->macAddressCurrent);
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-				targetChannel = apChannel;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-			}
-			break;
-		case WLAN_HDD_IBSS:
-		default:
-			break;
-		}
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-		if (targetChannel) {
-			/*
-			 * This is first adapter detected as active
-			 * set as default for none concurrency case
-			 */
-			if (!preAdapterChannel) {
-				/* If IPA UC data path is enabled,
-				 * target should reserve extra tx descriptors
-				 * for IPA data path.
-				 * Then host data path should allow less TX
-				 * packet pumping in case IPA
-				 * data path enabled
-				 */
-				if (hdd_ipa_uc_is_enabled(hdd_ctx) &&
-				    (WLAN_HDD_SOFTAP == adapter->device_mode)) {
-					adapter->tx_flow_low_watermark =
-					hdd_ctx->config->TxFlowLowWaterMark +
-					WLAN_TFC_IPAUC_TX_DESC_RESERVE;
-				} else {
-					adapter->tx_flow_low_watermark =
-						hdd_ctx->config->
-							TxFlowLowWaterMark;
-				}
-				adapter->tx_flow_high_watermark_offset =
-				   hdd_ctx->config->TxFlowHighWaterMarkOffset;
-				ol_txrx_ll_set_tx_pause_q_depth(
-					adapter->sessionId,
-					hdd_ctx->config->TxFlowMaxQueueDepth);
-				cds_info("MODE %d,CH %d,LWM %d,HWM %d,TXQDEP %d",
-				    adapter->device_mode,
-				    targetChannel,
-				    adapter->tx_flow_low_watermark,
-				    adapter->tx_flow_low_watermark +
-				    adapter->tx_flow_high_watermark_offset,
-				    hdd_ctx->config->TxFlowMaxQueueDepth);
-				preAdapterChannel = targetChannel;
-				preAdapterContext = adapter;
-			} else {
-				/*
-				 * SCC, disable TX flow control for both
-				 * SCC each adapter cannot reserve dedicated
-				 * channel resource, as a result, if any adapter
-				 * blocked OS Q by flow control,
-				 * blocked adapter will lost chance to recover
-				 */
-				if (preAdapterChannel == targetChannel) {
-					/* Current adapter */
-					adapter->tx_flow_low_watermark = 0;
-					adapter->
-					tx_flow_high_watermark_offset = 0;
-					ol_txrx_ll_set_tx_pause_q_depth(
-						adapter->sessionId,
-						hdd_ctx->config->
-						TxHbwFlowMaxQueueDepth);
-					cds_info("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
-					       hdd_device_mode_to_string(
-							adapter->device_mode),
-					       adapter->device_mode,
-					       targetChannel,
-					       adapter->tx_flow_low_watermark,
-					       adapter->tx_flow_low_watermark +
-					       adapter->
-					       tx_flow_high_watermark_offset,
-					       hdd_ctx->config->
-					       TxHbwFlowMaxQueueDepth);
-
-					if (!preAdapterContext) {
-						cds_err("SCC: Previous adapter context NULL");
-						continue;
-					}
-
-					/* Previous adapter */
-					preAdapterContext->
-					tx_flow_low_watermark = 0;
-					preAdapterContext->
-					tx_flow_high_watermark_offset = 0;
-					ol_txrx_ll_set_tx_pause_q_depth(
-						preAdapterContext->sessionId,
-						hdd_ctx->config->
-						TxHbwFlowMaxQueueDepth);
-					cds_info("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
-					       hdd_device_mode_to_string(
-						preAdapterContext->device_mode
-							  ),
-					       preAdapterContext->device_mode,
-					       targetChannel,
-					       preAdapterContext->
-					       tx_flow_low_watermark,
-					       preAdapterContext->
-					       tx_flow_low_watermark +
-					       preAdapterContext->
-					       tx_flow_high_watermark_offset,
-					       hdd_ctx->config->
-					       TxHbwFlowMaxQueueDepth);
-				}
-				/*
-				 * MCC, each adapter will have dedicated
-				 * resource
-				 */
-				else {
-					/* current channel is 2.4 */
-					if (targetChannel <=
-				     WLAN_HDD_TX_FLOW_CONTROL_MAX_24BAND_CH) {
-						channel24 = targetChannel;
-						channel5 = preAdapterChannel;
-						adapter2_4 = adapter;
-						adapter5 = preAdapterContext;
-					} else {
-						/* Current channel is 5 */
-						channel24 = preAdapterChannel;
-						channel5 = targetChannel;
-						adapter2_4 = preAdapterContext;
-						adapter5 = adapter;
-					}
-
-					if (!adapter5) {
-						cds_err("MCC: 5GHz adapter context NULL");
-						continue;
-					}
-					adapter5->tx_flow_low_watermark =
-						hdd_ctx->config->
-						TxHbwFlowLowWaterMark;
-					adapter5->
-					tx_flow_high_watermark_offset =
-						hdd_ctx->config->
-						TxHbwFlowHighWaterMarkOffset;
-					ol_txrx_ll_set_tx_pause_q_depth(
-						adapter5->sessionId,
-						hdd_ctx->config->
-						TxHbwFlowMaxQueueDepth);
-					cds_info("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
-					    hdd_device_mode_to_string(
-						    adapter5->device_mode),
-					    adapter5->device_mode,
-					    channel5,
-					    adapter5->tx_flow_low_watermark,
-					    adapter5->
-					    tx_flow_low_watermark +
-					    adapter5->
-					    tx_flow_high_watermark_offset,
-					    hdd_ctx->config->
-					    TxHbwFlowMaxQueueDepth);
-
-					if (!adapter2_4) {
-						cds_err("MCC: 2.4GHz adapter context NULL");
-						continue;
-					}
-					adapter2_4->tx_flow_low_watermark =
-						hdd_ctx->config->
-						TxLbwFlowLowWaterMark;
-					adapter2_4->
-					tx_flow_high_watermark_offset =
-						hdd_ctx->config->
-						TxLbwFlowHighWaterMarkOffset;
-					ol_txrx_ll_set_tx_pause_q_depth(
-						adapter2_4->sessionId,
-						hdd_ctx->config->
-						TxLbwFlowMaxQueueDepth);
-					cds_info("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
-						hdd_device_mode_to_string(
-						    adapter2_4->device_mode),
-						adapter2_4->device_mode,
-						channel24,
-						adapter2_4->
-						tx_flow_low_watermark,
-						adapter2_4->
-						tx_flow_low_watermark +
-						adapter2_4->
-						tx_flow_high_watermark_offset,
-						hdd_ctx->config->
-						TxLbwFlowMaxQueueDepth);
-
-				}
-			}
-		}
-		targetChannel = 0;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-	if (hdd_ctx->config->policy_manager_enabled) {
-		cds_dump_current_concurrency();
-		hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc();
-	} else {
-		/* hdd_ctx->mcc_mode gets updated inside below function, which
-		 *  gets used by IPA
-		 */
-		cds_dump_legacy_concurrency(
-			staChannel, apChannel, p2pChannel,
-			staBssid, p2pBssid, apBssid, p2pMode);
-	}
-}
-
-/**
- * cds_set_concurrency_mode() - To set concurrency mode
- * @mode: adapter mode
- *
- * This routine is called to set the concurrency mode
- *
- * Return: NONE
- */
-void cds_set_concurrency_mode(enum tCDF_ADAPTER_MODE mode)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	switch (mode) {
-	case CDF_STA_MODE:
-	case CDF_P2P_CLIENT_MODE:
-	case CDF_P2P_GO_MODE:
-	case CDF_SAP_MODE:
-	case CDF_IBSS_MODE:
-		hdd_ctx->concurrency_mode |= (1 << mode);
-		hdd_ctx->no_of_open_sessions[mode]++;
-		break;
-	default:
-		break;
-	}
-	cds_info("concurrency_mode = 0x%x Number of open sessions for mode %d = %d",
-		hdd_ctx->concurrency_mode, mode,
-		hdd_ctx->no_of_open_sessions[mode]);
-}
-
-/**
- * cds_clear_concurrency_mode() - To clear concurrency mode
- * @mode: adapter mode
- *
- * This routine is called to clear the concurrency mode
- *
- * Return: NONE
- */
-void cds_clear_concurrency_mode(enum tCDF_ADAPTER_MODE mode)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	switch (mode) {
-	case CDF_STA_MODE:
-	case CDF_P2P_CLIENT_MODE:
-	case CDF_P2P_GO_MODE:
-	case CDF_SAP_MODE:
-		hdd_ctx->no_of_open_sessions[mode]--;
-		if (!(hdd_ctx->no_of_open_sessions[mode]))
-			hdd_ctx->concurrency_mode &= (~(1 << mode));
-		break;
-	default:
-		break;
-	}
-	cds_info("concurrency_mode = 0x%x Number of open sessions for mode %d = %d",
-		hdd_ctx->concurrency_mode, mode,
-		hdd_ctx->no_of_open_sessions[mode]);
-}
-
-/**
- * cds_soc_set_pcl() - Sets PCL to FW
- * @mode: adapter mode
- *
- * Fetches the PCL and sends the PCL to SME
- * module which in turn will send the WMI
- * command WMI_SOC_SET_PCL_CMDID to the fw
- *
- * Return: None
- */
-static void cds_soc_set_pcl(enum tCDF_ADAPTER_MODE mode)
-{
-	CDF_STATUS status;
-	enum cds_con_mode con_mode;
-	struct sir_pcl_list pcl;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-	pcl.pcl_len = 0;
-
-	switch (mode) {
-	case CDF_STA_MODE:
-		con_mode = CDS_STA_MODE;
-		break;
-	case CDF_P2P_CLIENT_MODE:
-		con_mode = CDS_P2P_CLIENT_MODE;
-		break;
-	case CDF_P2P_GO_MODE:
-		con_mode = CDS_P2P_GO_MODE;
-		break;
-	case CDF_SAP_MODE:
-		con_mode = CDS_SAP_MODE;
-		break;
-	case CDF_IBSS_MODE:
-		con_mode = CDS_IBSS_MODE;
-		break;
-	default:
-		cds_err("Unable to set PCL to FW: %d", mode);
-		return;
-	}
-
-	cds_debug("get pcl to set it to the FW");
-
-	status = cds_get_pcl(con_mode,
-			pcl.pcl_list, &pcl.pcl_len);
-	if (status != CDF_STATUS_SUCCESS) {
-		cds_err("Unable to set PCL to FW, Get PCL failed");
-		return;
-	}
-
-	status = sme_soc_set_pcl(hdd_ctx->hHal, pcl);
-	if (status != CDF_STATUS_SUCCESS)
-		cds_err("Send soc set PCL to SME failed");
-	else
-		cds_info("Set PCL to FW for mode:%d", mode);
-}
-
-/**
- * cds_incr_active_session() - increments the number of active sessions
- * @mode:	Adapter mode
- * @session_id: session ID for the connection session
- *
- * This function increments the number of active sessions maintained per device
- * mode. In the case of STA/P2P CLI/IBSS upon connection indication it is
- * incremented; In the case of SAP/P2P GO upon bss start it is incremented
- *
- * Return: None
- */
-void cds_incr_active_session(enum tCDF_ADAPTER_MODE mode,
-				  uint8_t session_id)
-{
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return;
-	}
-
-	/*
-	 * Need to aquire mutex as entire functionality in this function
-	 * is in critical section
-	 */
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	switch (mode) {
-	case CDF_STA_MODE:
-	case CDF_P2P_CLIENT_MODE:
-	case CDF_P2P_GO_MODE:
-	case CDF_SAP_MODE:
-	case CDF_IBSS_MODE:
-		hdd_ctx->no_of_active_sessions[mode]++;
-		break;
-	default:
-		break;
-	}
-	cds_info("No.# of active sessions for mode %d = %d",
-		mode, hdd_ctx->no_of_active_sessions[mode]);
-	/*
-	 * Get PCL logic makes use of the connection info structure.
-	 * Let us set the PCL to the FW before updating the connection
-	 * info structure about the new connection.
-	 */
-	if (mode == CDF_STA_MODE) {
-		/* Set PCL of STA to the FW */
-		cds_soc_set_pcl(mode);
-		cds_info("Set PCL of STA to FW");
-	}
-	cds_incr_connection_count(session_id);
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-}
-
-/**
- * cds_need_opportunistic_upgrade() - Tells us if we really
- * need an upgrade to 2x2
- *
- * This function returns if updrade to 2x2 is needed
- *
- * Return: CDS_NOP = upgrade is not needed, otherwise upgrade is
- * needed
- */
-enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
-{
-	uint32_t conn_index;
-	enum cds_conc_next_action upgrade = CDS_NOP;
-	uint8_t mac = 0;
-#ifdef QCA_WIFI_3_0_EMU
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return upgrade;
-	}
-#endif
-	if (wma_is_hw_dbs_capable() == false) {
-		cds_err("driver isn't dbs capable, no further action needed");
-		return upgrade;
-	}
-
-	/* Are both mac's still in use*/
-	for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
-		conn_index++) {
-		if ((conc_connection_list[conn_index].mac == 0) &&
-			conc_connection_list[conn_index].in_use) {
-			mac |= 1;
-			if (3 == mac)
-				goto done;
-		} else if ((conc_connection_list[conn_index].mac == 1) &&
-			conc_connection_list[conn_index].in_use) {
-			mac |= 2;
-			if (3 == mac)
-				goto done;
-		}
-	}
-#ifdef QCA_WIFI_3_0_EMU
-	/* For M2M emulation only: if we have a connection on 2.4, stay in DBS */
-	if (hdd_ctx->config->enable_m2m_limitation &&
-		CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan))
-		goto done;
-#endif
-	/* Let's request for single MAC mode */
-	upgrade = CDS_MCC;
-	/* Is there any connection had an initial connection with 2x2 */
-	for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
-		conn_index++) {
-		if ((conc_connection_list[conn_index].original_nss == 1) &&
-			conc_connection_list[conn_index].in_use) {
-			upgrade = CDS_MCC_UPGRADE;
-			goto done;
-		}
-	}
-
-done:
-	return upgrade;
-}
-
-
-/**
- * cds_set_pcl_for_existing_combo() - Set PCL for existing connection
- * @mode: Connection mode of type 'cds_con_mode'
- *
- * Set the PCL for an existing connection
- *
- * Return: None
- */
-static void cds_set_pcl_for_existing_combo(enum cds_con_mode mode)
-{
-	struct cds_conc_connection_info info;
-	enum tCDF_ADAPTER_MODE pcl_mode;
-
-	switch (mode) {
-	case CDS_STA_MODE:
-		pcl_mode = CDF_STA_MODE;
-		break;
-	case CDS_SAP_MODE:
-		pcl_mode = CDF_SAP_MODE;
-		break;
-	case CDS_P2P_CLIENT_MODE:
-		pcl_mode = CDF_P2P_CLIENT_MODE;
-		break;
-	case CDS_P2P_GO_MODE:
-		pcl_mode = CDF_P2P_GO_MODE;
-		break;
-	case CDS_IBSS_MODE:
-		pcl_mode = CDF_IBSS_MODE;
-		break;
-	default:
-		cds_err("Invalid mode to set PCL");
-		return;
-	};
-
-	if (cds_mode_specific_connection_count(mode, NULL) > 0) {
-		/* Check, store and temp delete the mode's parameter */
-		cds_store_and_del_conn_info(mode, &info);
-		/* Set the PCL to the FW since connection got updated */
-		cds_soc_set_pcl(pcl_mode);
-		cds_info("Set PCL to FW for mode:%d", mode);
-		/* Restore the connection info */
-		cds_restore_deleted_conn_info(&info);
-	}
-}
-
-/**
- * cds_decr_session_set_pcl() - Decrement session count and set PCL
- * @mode: Adapter mode
- * @session_id: Session id
- *
- * Decrements the active session count and sets the PCL if a STA connection
- * exists
- *
- * Return: None
- */
-void cds_decr_session_set_pcl(enum tCDF_ADAPTER_MODE mode,
-						uint8_t session_id)
-{
-	CDF_STATUS cdf_status;
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return;
-	}
-
-	cds_decr_active_session(mode, session_id);
-	/*
-	 * After the removal of this connection, we need to check if
-	 * a STA connection still exists. The reason for this is that
-	 * if one or more STA exists, we need to provide the updated
-	 * PCL to the FW for cases like LFR.
-	 *
-	 * Since cds_get_pcl provides PCL list based on the new
-	 * connection that is going to come up, we will find the
-	 * existing STA entry, save it and delete it temporarily.
-	 * After this we will get PCL as though as new STA connection
-	 * is coming up. This will give the exact PCL that needs to be
-	 * given to the FW. After setting the PCL, we need to restore
-	 * the entry that we have saved before.
-	 */
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	cds_set_pcl_for_existing_combo(CDS_STA_MODE);
-	/* do we need to change the HW mode */
-	if (cds_need_opportunistic_upgrade()) {
-		/* let's start the timer */
-		cdf_mc_timer_stop(&hdd_ctx->dbs_opportunistic_timer);
-		cdf_status = cdf_mc_timer_start(
-					&hdd_ctx->dbs_opportunistic_timer,
-					DBS_OPPORTUNISTIC_TIME *
-						1000);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-			cds_err("Failed to start dbs opportunistic timer");
-	}
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-
-	return;
-}
-
-
-/**
- * cds_decr_active_session() - decrements the number of active sessions
- * @mode: Adapter mode
- * @session_id: session ID for the connection session
- *
- * This function decrements the number of active sessions maintained per device
- * mode. In the case of STA/P2P CLI/IBSS upon disconnection it is decremented
- * In the case of SAP/P2P GO upon bss stop it is decremented
- *
- * Return: None
- */
-void cds_decr_active_session(enum tCDF_ADAPTER_MODE mode,
-				  uint8_t session_id)
-{
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return;
-	}
-
-	/*
-	 * Need to aquire mutex as entire functionality in this function
-	 * is in critical section
-	 */
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	switch (mode) {
-	case CDF_STA_MODE:
-	case CDF_P2P_CLIENT_MODE:
-	case CDF_P2P_GO_MODE:
-	case CDF_SAP_MODE:
-	case CDF_IBSS_MODE:
-		if (hdd_ctx->no_of_active_sessions[mode])
-			hdd_ctx->no_of_active_sessions[mode]--;
-		break;
-	default:
-		break;
-	}
-	cds_info("No.# of active sessions for mode %d = %d",
-		mode, hdd_ctx->no_of_active_sessions[mode]);
-	cds_decr_connection_count(session_id);
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-}
-
-/**
- * cds_dbs_opportunistic_timer_handler() - handler of
- * dbs_opportunistic_timer
- * @data: HDD context
- *
- * handler for dbs_opportunistic_timer
- *
- * Return: None
- */
-void cds_dbs_opportunistic_timer_handler(void *data)
-{
-	enum cds_conc_next_action action = CDS_NOP;
-	cds_context_type *cds_ctx;
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return;
-	}
-
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	/* if we still need it */
-	action = cds_need_opportunistic_upgrade();
-	if (action) {
-		/* lets call for action */
-		/* session id is being used only
-		 * in hidden ssid case for now.
-		 * So, session id 0 is ok here.
-		 */
-		cds_next_actions(0, action,
-				CDS_UPDATE_REASON_OPPORTUNISTIC);
-	}
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-
-}
-
-/**
- * cds_deinit_policy_mgr() - Deinitialize the policy manager
- * related data structures
- *
- * Deinitialize the policy manager related data structures
- *
- * Return: Success if the policy manager is deinitialized completely
- */
-CDF_STATUS cds_deinit_policy_mgr(void)
-{
-	cds_context_type *cds_ctx;
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return CDF_STATUS_E_FAILURE;
-	}
-	if (!CDF_IS_STATUS_SUCCESS(cdf_mutex_destroy(
-					&cds_ctx->cdf_conc_list_lock))) {
-		cds_err("Failed to destroy cdf_conc_list_lock");
-		return CDF_STATUS_E_FAILURE;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_init_policy_mgr() - Initialize the policy manager
- * related data structures
- *
- * Initialize the policy manager related data structures
- *
- * Return: Success if the policy manager is initialized completely
- */
-CDF_STATUS cds_init_policy_mgr(void)
-{
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cds_debug("Initializing the policy manager");
-
-	/* init conc_connection_list */
-	cdf_mem_zero(conc_connection_list, sizeof(conc_connection_list));
-
-	if (!CDF_IS_STATUS_SUCCESS(cdf_mutex_init(
-					&cds_ctx->cdf_conc_list_lock))) {
-		cds_err("Failed to init cdf_conc_list_lock");
-		/* Lets us not proceed further */
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	sme_register_hw_mode_trans_cb(hdd_ctx->hHal,
-				cds_hw_mode_transition_cb);
-	status = cdf_mc_timer_init(&hdd_ctx->dbs_opportunistic_timer,
-				   CDF_TIMER_TYPE_SW,
-				   cds_dbs_opportunistic_timer_handler,
-				   (void *)hdd_ctx);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		cds_err("Failed to init DBS opportunistic timer");
-		return status;
-	}
-
-	status = cdf_init_connection_update();
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		cds_err("connection_update_done_evt init failed");
-		return status;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_connection_for_vdev_id() - provides the
- * perticular connection with the requested vdev id
- * @vdev_id: vdev id of the connection
- *
- * This function provides the specific connection with the
- * requested vdev id
- *
- * Return: index in the connection table
- */
-uint32_t cds_get_connection_for_vdev_id(uint32_t vdev_id)
-{
-	uint32_t conn_index = 0;
-	for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
-		 conn_index++) {
-		if ((conc_connection_list[conn_index].vdev_id == vdev_id) &&
-			conc_connection_list[conn_index].in_use) {
-			break;
-		}
-	}
-	return conn_index;
-}
-
-
-/**
- * cds_get_connection_count() - provides the count of
- * current connections
- *
- *
- * This function provides the count of current connections
- *
- * Return: connection count
- */
-uint32_t cds_get_connection_count(void)
-{
-	uint32_t conn_index, count = 0;
-	for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
-		 conn_index++) {
-		if (conc_connection_list[conn_index].in_use)
-			count++;
-	}
-	return count;
-}
-
-/**
- * cds_get_mode() - Get mode from type and subtype
- * @type: type
- * @subtype: subtype
- *
- * Get the concurrency mode from the type and subtype
- * of the interface
- *
- * Return: cds_con_mode
- */
-enum cds_con_mode cds_get_mode(uint8_t type, uint8_t subtype)
-{
-	enum cds_con_mode mode = CDS_MAX_NUM_OF_MODE;
-	if (type == WMI_VDEV_TYPE_AP) {
-		switch (subtype) {
-		case 0:
-			mode = CDS_SAP_MODE;
-			break;
-		case WMI_UNIFIED_VDEV_SUBTYPE_P2P_GO:
-			mode = CDS_P2P_GO_MODE;
-			break;
-		default:
-		/* err msg*/
-			cds_err("Unknown subtype %d for type %d",
-				subtype, type);
-			break;
-		}
-	} else if (type == WMI_VDEV_TYPE_STA) {
-		switch (subtype) {
-		case 0:
-			mode = CDS_STA_MODE;
-			break;
-		case WMI_UNIFIED_VDEV_SUBTYPE_P2P_CLIENT:
-			mode = CDS_P2P_CLIENT_MODE;
-			break;
-		default:
-		/* err msg*/
-			cds_err("Unknown subtype %d for type %d",
-				subtype, type);
-			break;
-		}
-	} else if (type == WMI_VDEV_TYPE_IBSS) {
-		mode = CDS_IBSS_MODE;
-	} else {
-		/* err msg */
-		cds_err("Unknown type %d", type);
-	}
-
-	return mode;
-}
-
-/**
- * cds_incr_connection_count() - adds the new connection to
- * the current connections list
- * @vdev_id: vdev id
- *
- *
- * This function adds the new connection to the current
- * connections list
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_incr_connection_count(uint32_t vdev_id)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t conn_index;
-	struct wma_txrx_node *wma_conn_table_entry;
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return status;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return status;
-	}
-
-	conn_index = cds_get_connection_count();
-	if (hdd_ctx->config->gMaxConcurrentActiveSessions < conn_index) {
-		/* err msg */
-		cds_err("exceeded max connection limit %d",
-			hdd_ctx->config->gMaxConcurrentActiveSessions);
-		return status;
-	}
-
-	wma_conn_table_entry = wma_get_interface_by_vdev_id(vdev_id);
-
-	if (NULL == wma_conn_table_entry) {
-		/* err msg*/
-		cds_err("can't find vdev_id %d in WMA table", vdev_id);
-		return status;
-	}
-
-	/* add the entry */
-	cds_update_conc_list(conn_index,
-			cds_get_mode(wma_conn_table_entry->type,
-					wma_conn_table_entry->sub_type),
-			cds_freq_to_chan(wma_conn_table_entry->mhz),
-			wma_conn_table_entry->mac_id,
-			wma_conn_table_entry->chain_mask,
-			wma_conn_table_entry->tx_streams,
-			wma_conn_table_entry->rx_streams,
-			wma_conn_table_entry->nss, vdev_id, true);
-	cds_info("Add at idx:%d vdev %d tx ss=%d rx ss=%d chainmask=%d mac=%d",
-		conn_index, vdev_id,
-		wma_conn_table_entry->tx_streams,
-		wma_conn_table_entry->rx_streams,
-		wma_conn_table_entry->chain_mask,
-		wma_conn_table_entry->mac_id);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_update_connection_info() - updates the existing
- * connection in the current connections list
- * @vdev_id: vdev id
- *
- *
- * This function adds the new connection to the current
- * connections list
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_update_connection_info(uint32_t vdev_id)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t conn_index = 0;
-	bool found = false;
-	struct wma_txrx_node *wma_conn_table_entry;
-	cds_context_type *cds_ctx;
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return status;
-	}
-
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-		if (vdev_id == conc_connection_list[conn_index].vdev_id) {
-			/* debug msg */
-			found = true;
-			break;
-		}
-		conn_index++;
-	}
-	if (!found) {
-		/* err msg */
-		cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-		cds_err("can't find vdev_id %d in conc_connection_list",
-			vdev_id);
-		return status;
-	}
-
-	wma_conn_table_entry = wma_get_interface_by_vdev_id(vdev_id);
-
-	if (NULL == wma_conn_table_entry) {
-		/* err msg*/
-		cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-		cds_err("can't find vdev_id %d in WMA table", vdev_id);
-		return status;
-	}
-
-	/* add the entry */
-	cds_update_conc_list(conn_index,
-			cds_get_mode(wma_conn_table_entry->type,
-					wma_conn_table_entry->sub_type),
-			cds_freq_to_chan(wma_conn_table_entry->mhz),
-			wma_conn_table_entry->mac_id,
-			wma_conn_table_entry->chain_mask,
-			wma_conn_table_entry->tx_streams,
-			wma_conn_table_entry->rx_streams,
-			wma_conn_table_entry->nss, vdev_id, true);
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_decr_connection_count() - remove the old connection
- * from the current connections list
- * @vdev_id: vdev id of the old connection
- *
- *
- * This function removes the old connection from the current
- * connections list
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_decr_connection_count(uint32_t vdev_id)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t conn_index = 0, next_conn_index = 0;
-	bool found = false;
-
-	while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-		if (vdev_id == conc_connection_list[conn_index].vdev_id) {
-			/* debug msg */
-			found = true;
-			break;
-		}
-		conn_index++;
-	}
-	if (!found) {
-		/* err msg */
-		cds_err("can't find vdev_id %d in conc_connection_list",
-			vdev_id);
-		return status;
-	}
-	next_conn_index = conn_index + 1;
-	while (CONC_CONNECTION_LIST_VALID_INDEX(next_conn_index)) {
-		conc_connection_list[conn_index].vdev_id =
-			conc_connection_list[next_conn_index].vdev_id;
-		conc_connection_list[conn_index].tx_spatial_stream =
-			conc_connection_list[next_conn_index].tx_spatial_stream;
-		conc_connection_list[conn_index].rx_spatial_stream =
-			conc_connection_list[next_conn_index].rx_spatial_stream;
-		conc_connection_list[conn_index].mode =
-			conc_connection_list[next_conn_index].mode;
-		conc_connection_list[conn_index].mac =
-			conc_connection_list[next_conn_index].mac;
-		conc_connection_list[conn_index].chan =
-			conc_connection_list[next_conn_index].chan;
-		conc_connection_list[conn_index].chain_mask =
-			conc_connection_list[next_conn_index].chain_mask;
-		conc_connection_list[conn_index].original_nss =
-			conc_connection_list[next_conn_index].original_nss;
-		conc_connection_list[conn_index].in_use =
-			conc_connection_list[next_conn_index].in_use;
-		conn_index++;
-		next_conn_index++;
-	}
-
-	/* clean up the entry */
-	cdf_mem_zero(&conc_connection_list[next_conn_index - 1],
-		sizeof(*conc_connection_list));
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_connection_channels() - provides the channel(s)
- * on which current connection(s) is
- * @channels:	the channel(s) on which current connection(s) is
- * @len:	Number of channels
- * @order:	no order OR 2.4 Ghz channel followed by 5 Ghz
- *	channel OR 5 Ghz channel followed by 2.4 Ghz channel
- *
- *
- * This function provides the channel(s) on which current
- * connection(s) is/are
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_get_connection_channels(uint8_t *channels,
-			uint32_t *len, uint8_t order)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	uint32_t conn_index = 0, num_channels = 0;
-
-	if ((NULL == channels) || (NULL == len)) {
-		/* err msg*/
-		cds_err("channels or len is NULL");
-		status = CDF_STATUS_E_FAILURE;
-		return status;
-	}
-
-	if (0 == order) {
-		while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-			channels[num_channels++] =
-				conc_connection_list[conn_index++].chan;
-		}
-		*len = num_channels;
-	} else if (1 == order) {
-		while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-			if (CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[conn_index].chan)) {
-				channels[num_channels++] =
-					conc_connection_list[conn_index++].chan;
-			} else
-				conn_index++;
-		}
-		conn_index = 0;
-		while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-			if (CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[conn_index].chan)) {
-				channels[num_channels++] =
-					conc_connection_list[conn_index++].chan;
-			} else
-				conn_index++;
-		}
-		*len = num_channels;
-	} else if (2 == order) {
-		while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-			if (CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[conn_index].chan)) {
-				channels[num_channels++] =
-					conc_connection_list[conn_index++].chan;
-			} else
-				conn_index++;
-		}
-		conn_index = 0;
-		while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-			if (CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[conn_index].chan)) {
-				channels[num_channels++] =
-					conc_connection_list[conn_index++].chan;
-			} else
-				conn_index++;
-		}
-		*len = num_channels;
-	} else {
-		cds_err("unknown order %d", order);
-		status = CDF_STATUS_E_FAILURE;
-	}
-	return status;
-}
-
-/**
- * cds_update_with_safe_channel_list() - provides the safe
- * channel list
- * @pcl_channels: channel list
- * @len: length of the list
- *
- * This function provides the safe channel list from the list
- * provided after consulting the channel avoidance list
- *
- * Return: None
- */
-#ifdef CONFIG_CNSS
-void cds_update_with_safe_channel_list(uint8_t *pcl_channels, uint32_t *len)
-{
-	uint16_t unsafe_channel_list[MAX_NUM_CHAN];
-	uint8_t current_channel_list[MAX_NUM_CHAN];
-	uint16_t unsafe_channel_count = 0;
-	uint8_t is_unsafe = 1;
-	uint8_t i, j;
-	uint32_t safe_channel_count = 0, current_channel_count = 0;
-
-	if (len) {
-		current_channel_count = CDF_MIN(*len, MAX_NUM_CHAN);
-	} else {
-		cds_err("invalid number of channel length");
-		return;
-	}
-
-	cnss_get_wlan_unsafe_channel(unsafe_channel_list,
-				     &unsafe_channel_count,
-				     sizeof(unsafe_channel_list));
-
-	if (unsafe_channel_count) {
-		cdf_mem_copy(current_channel_list, pcl_channels,
-			current_channel_count);
-		cdf_mem_zero(pcl_channels,
-			sizeof(*pcl_channels)*current_channel_count);
-
-		for (i = 0; i < current_channel_count; i++) {
-			is_unsafe = 0;
-			for (j = 0; j < unsafe_channel_count; j++) {
-				if (current_channel_list[i] ==
-					unsafe_channel_list[j]) {
-					/* Found unsafe channel, update it */
-					is_unsafe = 1;
-					cds_warn("CH %d is not safe",
-						current_channel_list[i]);
-					break;
-				}
-			}
-			if (!is_unsafe) {
-				pcl_channels[safe_channel_count++] =
-					current_channel_list[i];
-			}
-		}
-		*len = safe_channel_count;
-	}
-	return;
-}
-#else
-void cds_update_with_safe_channel_list(uint8_t *pcl_channels, uint32_t *len)
-{
-	return;
-}
-#endif
-/**
- * cds_get_channel_list() - provides the channel list
- * suggestion for new connection
- * @hdd_ctx:	HDD Context
- * @pcl:	The preferred channel list enum
- * @pcl_channels: PCL channels
- * @len: lenght of the PCL
- *
- * This function provides the actual channel list based on the
- * current regulatory domain derived using preferred channel
- * list enum obtained from one of the pcl_table
- *
- * Return: Channel List
- */
-CDF_STATUS cds_get_channel_list(enum cds_pcl_type pcl,
-			uint8_t *pcl_channels, uint32_t *len)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t num_channels = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-	uint32_t chan_index = 0, chan_index_24 = 0, chan_index_5 = 0;
-	uint8_t channel_list[MAX_NUM_CHAN] = {0};
-	uint8_t channel_list_24[MAX_NUM_CHAN] = {0};
-	uint8_t channel_list_5[MAX_NUM_CHAN] = {0};
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return status;
-	}
-
-	if ((NULL == pcl_channels) || (NULL == len)) {
-		/* err msg*/
-		cds_err("pcl_channels or len is NULL");
-		return status;
-	}
-
-	if (CDS_MAX_PCL_TYPE == pcl) {
-		/* msg */
-		cds_err("pcl is invalid");
-		return status;
-	}
-
-	if (CDS_NONE == pcl) {
-		/* msg */
-		cds_err("pcl is 0");
-		return CDF_STATUS_SUCCESS;
-	}
-	/* get the channel list for current domain */
-	status = sme_get_cfg_valid_channels(hdd_ctx->hHal, channel_list,
-			&num_channels);
-	if (CDF_STATUS_SUCCESS != status) {
-		/* err msg*/
-		cds_err("No valid channel");
-		return status;
-	}
-	/* Let's divide the list in 2.4 & 5 Ghz lists */
-	while ((channel_list[chan_index] <= 11) &&
-		(chan_index_24 < MAX_NUM_CHAN))
-		channel_list_24[chan_index_24++] = channel_list[chan_index++];
-	if (channel_list[chan_index] == 12) {
-		channel_list_24[chan_index_24++] = channel_list[chan_index++];
-		if (channel_list[chan_index] == 13) {
-			channel_list_24[chan_index_24++] =
-				channel_list[chan_index++];
-			if (channel_list[chan_index] == 14)
-				channel_list_24[chan_index_24++] =
-					channel_list[chan_index++];
-		}
-	}
-	while ((chan_index < num_channels) &&
-		(chan_index_5 < MAX_NUM_CHAN))
-		channel_list_5[chan_index_5++] = channel_list[chan_index++];
-
-	num_channels = 0;
-	switch (pcl) {
-	case CDS_24G:
-		cdf_mem_copy(pcl_channels, channel_list_24,
-			chan_index_24);
-		*len = chan_index_24;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_5G:
-		cdf_mem_copy(pcl_channels, channel_list_5,
-			chan_index_5);
-		*len = chan_index_5;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_CH:
-	case CDS_MCC_CH:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 0);
-		cdf_mem_copy(pcl_channels, channel_list, num_channels);
-		*len = num_channels;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_CH_24G:
-	case CDS_MCC_CH_24G:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 0);
-		cdf_mem_copy(pcl_channels, channel_list, num_channels);
-		*len = num_channels;
-		cdf_mem_copy(&pcl_channels[num_channels],
-			channel_list_24, chan_index_24);
-		*len += chan_index_24;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_CH_5G:
-	case CDS_MCC_CH_5G:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 0);
-		cdf_mem_copy(pcl_channels, channel_list,
-			num_channels);
-		*len = num_channels;
-		cdf_mem_copy(&pcl_channels[num_channels],
-			channel_list_5, chan_index_5);
-		*len += chan_index_5;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_24G_SCC_CH:
-	case CDS_24G_MCC_CH:
-		cdf_mem_copy(pcl_channels, channel_list_24,
-			chan_index_24);
-		*len = chan_index_24;
-		cds_get_connection_channels(
-			channel_list, &num_channels, 0);
-		cdf_mem_copy(&pcl_channels[chan_index_24],
-			channel_list, num_channels);
-		*len += num_channels;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_5G_SCC_CH:
-	case CDS_5G_MCC_CH:
-		cdf_mem_copy(pcl_channels, channel_list_5,
-			chan_index_5);
-		*len = chan_index_5;
-		cds_get_connection_channels(
-			channel_list, &num_channels, 0);
-		cdf_mem_copy(&pcl_channels[chan_index_5],
-			channel_list, num_channels);
-		*len += num_channels;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_ON_24_SCC_ON_5:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 1);
-		cdf_mem_copy(pcl_channels, channel_list,
-			num_channels);
-		*len = num_channels;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_ON_5_SCC_ON_24:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 2);
-		cdf_mem_copy(pcl_channels, channel_list, num_channels);
-		*len = num_channels;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_ON_24_SCC_ON_5_24G:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 1);
-		cdf_mem_copy(pcl_channels, channel_list, num_channels);
-		*len = num_channels;
-		cdf_mem_copy(&pcl_channels[num_channels],
-			channel_list_24, chan_index_24);
-		*len += chan_index_24;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_ON_24_SCC_ON_5_5G:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 1);
-		cdf_mem_copy(pcl_channels, channel_list, num_channels);
-		*len = num_channels;
-		cdf_mem_copy(&pcl_channels[num_channels],
-			channel_list_5, chan_index_5);
-		*len += chan_index_5;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_ON_5_SCC_ON_24_24G:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 2);
-		cdf_mem_copy(pcl_channels, channel_list, num_channels);
-		*len = num_channels;
-		cdf_mem_copy(&pcl_channels[num_channels],
-			channel_list_24, chan_index_24);
-		*len += chan_index_24;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	case CDS_SCC_ON_5_SCC_ON_24_5G:
-		cds_get_connection_channels(
-			channel_list, &num_channels, 2);
-		cdf_mem_copy(pcl_channels, channel_list, num_channels);
-		*len = num_channels;
-		cdf_mem_copy(&pcl_channels[num_channels],
-			channel_list_5, chan_index_5);
-		*len += chan_index_5;
-		status = CDF_STATUS_SUCCESS;
-		break;
-	default:
-		/* err msg */
-		cds_err("unknown pcl value %d", pcl);
-		break;
-	}
-
-	/* check the channel avoidance list */
-	cds_update_with_safe_channel_list(pcl_channels, len);
-
-	return status;
-}
-
-/**
- * cds_map_concurrency_mode() - to map concurrency mode between sme and hdd
- * @old_mode: sme provided adapter mode
- * @new_mode: hdd provided concurrency mode
- *
- * This routine will map concurrency mode between sme and hdd
- *
- * Return: true or false
- */
-bool cds_map_concurrency_mode(enum tCDF_ADAPTER_MODE *old_mode,
-	enum cds_con_mode *new_mode)
-{
-	bool status = true;
-
-	switch (*old_mode) {
-
-	case CDF_STA_MODE:
-		*new_mode = CDS_STA_MODE;
-		break;
-	case CDF_SAP_MODE:
-		*new_mode = CDS_SAP_MODE;
-		break;
-	case CDF_P2P_CLIENT_MODE:
-		*new_mode = CDS_P2P_CLIENT_MODE;
-		break;
-	case CDF_P2P_GO_MODE:
-		*new_mode = CDS_P2P_GO_MODE;
-		break;
-	case CDF_IBSS_MODE:
-		*new_mode = CDS_IBSS_MODE;
-		break;
-	default:
-		*new_mode = CDS_MAX_NUM_OF_MODE;
-		status = false;
-		break;
-	}
-	return status;
-}
-
-/**
- * cds_get_pcl() - provides the preferred channel list for
- * new connection
- * @mode:	Device mode
- * @pcl_channels: PCL channels
- * @len: lenght of the PCL
- *
- * This function provides the preferred channel list on which
- * policy manager wants the new connection to come up. Various
- * connection decision making entities will using this function
- * to query the PCL info
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_get_pcl(enum cds_con_mode mode,
-			uint8_t *pcl_channels, uint32_t *len)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t num_connections = 0;
-	enum cds_conc_priority_mode first_index = 0;
-	enum cds_one_connection_mode second_index = 0;
-	enum cds_two_connection_mode third_index = 0;
-	enum cds_pcl_type pcl = CDS_NONE;
-	enum cds_conc_priority_mode conc_system_pref = 0;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return status;
-	}
-
-	/* find the current connection state from conc_connection_list*/
-	num_connections = cds_get_connection_count();
-	cds_debug("connections:%d pref:%d requested mode:%d",
-		num_connections, hdd_ctx->config->conc_system_pref, mode);
-
-	switch (hdd_ctx->config->conc_system_pref) {
-	case 0:
-		conc_system_pref = CDS_THROUGHPUT;
-		break;
-	case 1:
-		conc_system_pref = CDS_POWERSAVE;
-		break;
-	case 2:
-		conc_system_pref = CDS_LATENCY;
-		break;
-	default:
-		/* err msg */
-		cds_err("unknown conc_system_pref value %d",
-			hdd_ctx->config->conc_system_pref);
-		break;
-	}
-
-	switch (num_connections) {
-	case 0:
-		first_index =
-			cds_get_first_connection_pcl_table_index();
-		pcl = first_connection_pcl_table[mode][first_index];
-		break;
-	case 1:
-		second_index =
-			cds_get_second_connection_pcl_table_index();
-		if (CDS_MAX_ONE_CONNECTION_MODE == second_index) {
-			/* err msg */
-			cds_err("couldn't find index for 2nd connection pcl table");
-			return status;
-		}
-		if (wma_is_hw_dbs_capable() == true) {
-			pcl = second_connection_pcl_dbs_table
-				[second_index][mode][conc_system_pref];
-		} else {
-			pcl = second_connection_pcl_nodbs_table
-				[second_index][mode][conc_system_pref];
-		}
-
-		break;
-	case 2:
-		third_index =
-			cds_get_third_connection_pcl_table_index();
-		if (CDS_MAX_TWO_CONNECTION_MODE == third_index) {
-			/* err msg */
-			cds_err("couldn't find index for 3rd connection pcl table");
-			return status;
-		}
-		if (wma_is_hw_dbs_capable() == true) {
-			pcl = third_connection_pcl_dbs_table
-				[third_index][mode][conc_system_pref];
-		} else {
-			pcl = third_connection_pcl_nodbs_table
-				[third_index][mode][conc_system_pref];
-		}
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected num_connections value %d",
-			num_connections);
-		break;
-	}
-
-	cds_debug("index1:%d index2:%d index3:%d pcl:%d dbs:%d",
-		first_index, second_index, third_index,
-		pcl, wma_is_hw_dbs_capable());
-
-	/* once the PCL enum is obtained find out the exact channel list with
-	 * help from sme_get_cfg_valid_channels
-	 */
-	status = cds_get_channel_list(pcl, pcl_channels, len);
-	if (status == CDF_STATUS_SUCCESS) {
-		uint32_t i;
-		cds_debug("pcl len:%d", *len);
-		for (i = 0; i < *len; i++)
-			cds_debug("chan:%d", pcl_channels[i]);
-	}
-
-	return status;
-}
-
-/**
- * cds_disallow_mcc() - Check for mcc
- *
- * @channel: channel on which new connection is coming up
- *
- * When a new connection is about to come up check if current
- * concurrency combination including the new connection is
- * causing MCC
- *
- * Return: True/False
- */
-bool cds_disallow_mcc(uint8_t channel)
-{
-	uint32_t index = 0;
-	bool match = false;
-	while (CONC_CONNECTION_LIST_VALID_INDEX(index)) {
-		if (wma_is_hw_dbs_capable() == false) {
-			if (conc_connection_list[index].chan !=
-				channel) {
-				match = true;
-				break;
-			}
-		} else if (CDS_IS_CHANNEL_5GHZ
-			(conc_connection_list[index].chan)) {
-			if (conc_connection_list[index].chan != channel) {
-				match = true;
-				break;
-			}
-		}
-		index++;
-	}
-	return match;
-}
-
-/**
- * cds_allow_new_home_channel() - Check for allowed number of
- * home channels
- * @channel: channel on which new connection is coming up
- * @num_connections: number of current connections
- *
- * When a new connection is about to come up check if current
- * concurrency combination including the new connection is
- * allowed or not based on the HW capability
- *
- * Return: True/False
- */
-bool cds_allow_new_home_channel(uint8_t channel, uint32_t num_connections)
-{
-	bool status = true;
-#ifdef QCA_WIFI_3_0_EMU
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return false;
-	}
-#endif
-
-	if ((num_connections == 2) &&
-		(conc_connection_list[0].chan != conc_connection_list[1].chan)
-		&&
-		(conc_connection_list[0].mac == conc_connection_list[1].mac)) {
-		if (wma_is_hw_dbs_capable() == false) {
-			if ((channel != conc_connection_list[0].chan) &&
-				(channel != conc_connection_list[1].chan)) {
-				/* err msg */
-				cds_err("don't allow 3rd home channel on same MAC");
-				status = false;
-			}
-		} else if (((CDS_IS_CHANNEL_24GHZ(channel)) &&
-				(CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[1].chan))) ||
-				   ((CDS_IS_CHANNEL_5GHZ(channel)) &&
-				(CDS_IS_CHANNEL_5GHZ
-				(conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ
-				(conc_connection_list[1].chan)))) {
-			/* err msg */
-			cds_err("don't allow 3rd home channel on same MAC");
-			status = false;
-		}
-#ifndef QCA_WIFI_3_0_EMU
-	}
-#else
-	} else if (hdd_ctx->config->enable_m2m_limitation &&
-		(num_connections == 1) &&
-		(conc_connection_list[0].chan != channel)) {
-		if (((CDS_IS_CHANNEL_24GHZ(channel)) &&
-			(CDS_IS_CHANNEL_24GHZ
-			(conc_connection_list[0].chan))) ||
-			   ((CDS_IS_CHANNEL_5GHZ(channel)) &&
-			(CDS_IS_CHANNEL_5GHZ
-			(conc_connection_list[0].chan)))) {
-			/* err msg */
-			cds_err("don't allow 2nd home channel on same MAC");
-			status = false;
-		}
-	}
-#endif
-	return status;
-}
-
-/**
- * cds_is_ibss_conn_exist() - to check if IBSS connection already present
- * @hdd_ctx: pointer to hdd context
- * @ibss_channel: pointer to ibss channel which needs to be filled
- *
- * this routine will check if IBSS connection already exist or no. If it
- * exist then this routine will return true and fill the ibss_channel value.
- *
- * Return: true if ibss connection exist else false
- */
-bool cds_is_ibss_conn_exist(uint8_t *ibss_channel)
-{
-	uint32_t count = 0, index = 0;
-	uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS];
-	bool status = false;
-
-	if (NULL == ibss_channel) {
-		cds_err("Null pointer error");
-		return false;
-	}
-	count = cds_mode_specific_connection_count(CDS_IBSS_MODE, list);
-	if (count == 0) {
-		/* No IBSS connection */
-		status = false;
-	} else if (count == 1) {
-		*ibss_channel = conc_connection_list[list[index]].chan;
-		status = true;
-	} else {
-		*ibss_channel = conc_connection_list[list[index]].chan;
-		cds_notice("Multiple IBSS connections, picking first one");
-		status = true;
-	}
-	return status;
-}
-
-/**
- * cds_allow_concurrency() - Check for allowed concurrency
- * combination
- * @mode:	new connection mode
- * @channel: channel on which new connection is coming up
- * @bw: Bandwidth requested by the connection (optional)
- *
- * When a new connection is about to come up check if current
- * concurrency combination including the new connection is
- * allowed or not based on the HW capability
- *
- * Return: True/False
- */
-bool cds_allow_concurrency(enum cds_con_mode mode,
-				uint8_t channel, enum hw_mode_bandwidth bw)
-{
-	uint32_t num_connections = 0, count = 0, index = 0;
-	bool status = false, match = false;
-	uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS];
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return status;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return status;
-	}
-
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	/* find the current connection state from conc_connection_list*/
-	num_connections = cds_get_connection_count();
-
-	if (cds_max_concurrent_connections_reached()) {
-		cds_err("Reached max concurrent connections: %d",
-			hdd_ctx->config->gMaxConcurrentActiveSessions);
-		goto done;
-	}
-
-	if (channel) {
-		/* don't allow 3rd home channel on same MAC */
-		if (!cds_allow_new_home_channel(channel,
-			num_connections))
-				goto done;
-
-		/* don't allow MCC if SAP/GO on DFS channel or about to come up
-		* on DFS channel
-		*/
-		count = cds_mode_specific_connection_count(
-				CDS_P2P_GO_MODE, list);
-		while (index < count) {
-			if ((CDS_IS_DFS_CH(
-				conc_connection_list[list[index]].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(channel)) &&
-				(channel !=
-				conc_connection_list[list[index]].chan)) {
-				/* err msg */
-				cds_err("don't allow MCC if SAP/GO on DFS channel");
-				goto done;
-			}
-			index++;
-		}
-
-		index = 0;
-		count = cds_mode_specific_connection_count(
-				CDS_SAP_MODE, list);
-		while (index < count) {
-			if ((CDS_IS_DFS_CH(
-				conc_connection_list[list[index]].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(channel)) &&
-				(channel !=
-				conc_connection_list[list[index]].chan)) {
-				/* err msg */
-				cds_err("don't allow MCC if SAP/GO on DFS channel");
-				goto done;
-			}
-			index++;
-		}
-
-		index = 0;
-		if ((CDS_P2P_GO_MODE == mode) || (CDS_SAP_MODE == mode)) {
-			if (CDS_IS_DFS_CH(channel))
-				match = cds_disallow_mcc(channel);
-		}
-		if (true == match) {
-			cds_err("No MCC, SAP/GO about to come up on DFS channel");
-			goto done;
-		}
-	}
-
-	/* don't allow IBSS + STA MCC */
-	/* don't allow IBSS + STA SCC if IBSS is on DFS channel */
-	count = cds_mode_specific_connection_count(
-			CDS_STA_MODE, list);
-	if ((CDS_IBSS_MODE == mode) &&
-		(cds_mode_specific_connection_count(
-		CDS_IBSS_MODE, list)) && count) {
-		/* err msg */
-		cds_err("No 2nd IBSS, we already have STA + IBSS");
-		goto done;
-	}
-	if ((CDS_IBSS_MODE == mode) &&
-		(CDS_IS_DFS_CH(channel)) && count) {
-		/* err msg */
-		cds_err("No IBSS + STA SCC/MCC, IBSS is on DFS channel");
-		goto done;
-	}
-	if (CDS_IBSS_MODE == mode) {
-		if (wma_is_hw_dbs_capable() == true) {
-			if (num_connections > 1) {
-				/* err msg */
-				cds_err("No IBSS, we have concurrent connections already");
-				goto done;
-			}
-#ifndef QCA_WIFI_3_0_EMU
-			if (CDS_STA_MODE != conc_connection_list[0].mode) {
-				/* err msg */
-				cds_err("No IBSS, we've a non-STA connection");
-				goto done;
-			}
-#else
-			if (CDS_STA_MODE != conc_connection_list[0].mode &&
-				CDS_SAP_MODE != conc_connection_list[0].mode) {
-				/* err msg */
-				cds_err("No IBSS, we've a non-STA/SAP conn");
-				goto done;
-			}
-#endif
-			/*
-			 * This logic protects STA and IBSS to come up on same
-			 * band. If requirement changes then this condition
-			 * needs to be removed
-			 */
-			if (channel &&
-				(conc_connection_list[0].chan != channel) &&
-				CDS_IS_SAME_BAND_CHANNELS(
-				conc_connection_list[0].chan, channel)) {
-				/* err msg */
-				cds_err("No IBSS + STA MCC");
-				goto done;
-			}
-		} else if (num_connections) {
-			/* err msg */
-			cds_err("No IBSS, we have one connection already");
-			goto done;
-		}
-	}
-	count = cds_mode_specific_connection_count(CDS_STA_MODE, list);
-	if ((CDS_STA_MODE == mode) &&
-		(cds_mode_specific_connection_count(
-		CDS_IBSS_MODE, list)) && count) {
-		/* err msg */
-		cds_err("No 2nd STA, we already have STA + IBSS");
-		goto done;
-	}
-
-	if ((CDS_STA_MODE == mode) &&
-		(cds_mode_specific_connection_count(CDS_IBSS_MODE, list))) {
-		if (wma_is_hw_dbs_capable() == true) {
-			if (num_connections > 1) {
-				/* err msg */
-				cds_err("No 2nd STA, we already have IBSS concurrency");
-				goto done;
-			}
-			if (channel &&
-				(CDS_IS_DFS_CH(conc_connection_list[0].chan))
-				&& (CDS_IS_CHANNEL_5GHZ(channel))) {
-				/* err msg */
-				cds_err("No IBSS + STA SCC/MCC, IBSS is on DFS channel");
-				goto done;
-			}
-			/*
-			 * This logic protects STA and IBSS to come up on same
-			 * band. If requirement changes then this condition
-			 * needs to be removed
-			 */
-			if ((conc_connection_list[0].chan != channel) &&
-				CDS_IS_SAME_BAND_CHANNELS(
-				conc_connection_list[0].chan, channel)) {
-				/* err msg */
-				cds_err("No IBSS + STA MCC");
-				goto done;
-			}
-		} else {
-			/* err msg */
-			cds_err("No STA, we have IBSS connection already");
-			goto done;
-		}
-	}
-
-	/* can we allow vht160 */
-	if (num_connections &&
-		((bw == HW_MODE_80_PLUS_80_MHZ) || (bw == HW_MODE_160_MHZ))) {
-		/* err msg */
-		cds_err("No VHT160, we have one connection already");
-		goto done;
-	}
-
-	/* don't allow two P2P GO on same band */
-	if (channel && (mode == CDS_P2P_GO_MODE) && num_connections) {
-		index = 0;
-		count = cds_mode_specific_connection_count(
-						CDS_P2P_GO_MODE, list);
-		while (index < count) {
-			if (CDS_IS_SAME_BAND_CHANNELS(channel,
-				conc_connection_list[list[index]].chan)) {
-				cds_err("Don't allow P2P GO on same band");
-				goto done;
-			}
-			index++;
-		}
-	}
-
-	status = true;
-
-done:
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-	return status;
-}
-
-/**
- * cds_get_first_connection_pcl_table_index() - provides the
- * row index to firstConnectionPclTable to get to the correct
- * pcl
- *
- * This function provides the row index to
- * firstConnectionPclTable. The index is the preference config.
- *
- * Return: table index
- */
-enum cds_conc_priority_mode cds_get_first_connection_pcl_table_index(void)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return CDS_THROUGHPUT;
-	}
-
-	if (hdd_ctx->config->conc_system_pref >= CDS_MAX_CONC_PRIORITY_MODE)
-		return CDS_THROUGHPUT;
-	return hdd_ctx->config->conc_system_pref;
-}
-
-/**
- * cds_get_second_connection_pcl_table_index() - provides the
- * row index to secondConnectionPclTable to get to the correct
- * pcl
- *
- * This function provides the row index to
- * secondConnectionPclTable. The index is derived based on
- * current connection, band on which it is on & chain mask it is
- * using, as obtained from conc_connection_list.
- *
- * Return: table index
- */
-enum cds_one_connection_mode cds_get_second_connection_pcl_table_index(void)
-{
-	enum cds_one_connection_mode index = CDS_MAX_ONE_CONNECTION_MODE;
-
-	if (CDS_STA_MODE == conc_connection_list[0].mode) {
-		if (CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan)) {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_STA_24_1x1;
-			else
-				index = CDS_STA_24_2x2;
-		} else {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_STA_5_1x1;
-			else
-				index = CDS_STA_5_2x2;
-		}
-	} else if (CDS_SAP_MODE == conc_connection_list[0].mode) {
-		if (CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan)) {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_SAP_24_1x1;
-			else
-				index = CDS_SAP_24_2x2;
-		} else {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_SAP_5_1x1;
-			else
-				index = CDS_SAP_5_2x2;
-		}
-	} else if (CDS_P2P_CLIENT_MODE == conc_connection_list[0].mode) {
-		if (CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan)) {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_P2P_CLI_24_1x1;
-			else
-				index = CDS_P2P_CLI_24_2x2;
-		} else {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_P2P_CLI_5_1x1;
-			else
-				index = CDS_P2P_CLI_5_2x2;
-		}
-	} else if (CDS_P2P_GO_MODE == conc_connection_list[0].mode) {
-		if (CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan)) {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_P2P_GO_24_1x1;
-			else
-				index = CDS_P2P_GO_24_2x2;
-		} else {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_P2P_GO_5_1x1;
-			else
-				index = CDS_P2P_GO_5_2x2;
-		}
-	} else if (CDS_IBSS_MODE == conc_connection_list[0].mode) {
-		if (CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan)) {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_IBSS_24_1x1;
-			else
-				index = CDS_IBSS_24_2x2;
-		} else {
-			if (CDS_ONE_ONE == conc_connection_list[0].chain_mask)
-				index = CDS_IBSS_5_1x1;
-			else
-				index = CDS_IBSS_5_2x2;
-		}
-	}
-
-	cds_debug("mode:%d chan:%d chain:%d index:%d",
-		conc_connection_list[0].mode, conc_connection_list[0].chan,
-		conc_connection_list[0].chain_mask, index);
-
-	return index;
-}
-
-/**
- * cds_get_third_connection_pcl_table_index() - provides the
- * row index to thirdConnectionPclTable to get to the correct
- * pcl
- *
- * This function provides the row index to
- * thirdConnectionPclTable. The index is derived based on
- * current connection, band on which it is on & chain mask it is
- * using, as obtained from conc_connection_list.
- *
- * Return: table index
- */
-enum cds_two_connection_mode cds_get_third_connection_pcl_table_index(void)
-{
-	enum cds_one_connection_mode index = CDS_MAX_TWO_CONNECTION_MODE;
-
-	/* P2P Client + SAP */
-	if (((CDS_P2P_CLIENT_MODE == conc_connection_list[0].mode) &&
-		(CDS_SAP_MODE == conc_connection_list[1].mode)) ||
-		((CDS_SAP_MODE == conc_connection_list[0].mode) &&
-		(CDS_P2P_CLIENT_MODE == conc_connection_list[1].mode))) {
-		/* SCC */
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) {
-			if (CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[0].chan)) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_CLI_SAP_SCC_24_1x1;
-				else
-					index = CDS_P2P_CLI_SAP_SCC_24_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_CLI_SAP_SCC_5_1x1;
-				else
-					index = CDS_P2P_CLI_SAP_SCC_5_2x2;
-			}
-		/* MCC */
-		} else if (conc_connection_list[0].mac ==
-				conc_connection_list[1].mac) {
-			if ((CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_P2P_CLI_SAP_MCC_24_1x1;
-				else
-					index = CDS_P2P_CLI_SAP_MCC_24_2x2;
-			} else if ((CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_P2P_CLI_SAP_MCC_5_1x1;
-				else
-					index = CDS_P2P_CLI_SAP_MCC_5_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_P2P_CLI_SAP_MCC_24_5_1x1;
-				else
-					index = CDS_P2P_CLI_SAP_MCC_24_5_2x2;
-			}
-		/* DBS */
-		} else
-			index = CDS_P2P_CLI_SAP_DBS_1x1;
-	} else
-	/* STA + SAP */
-	if (((CDS_STA_MODE == conc_connection_list[0].mode) &&
-		(CDS_SAP_MODE == conc_connection_list[1].mode)) ||
-		((CDS_SAP_MODE == conc_connection_list[0].mode) &&
-		(CDS_STA_MODE == conc_connection_list[1].mode))) {
-		/* SCC */
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) {
-			if (CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[0].chan)) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_STA_SAP_SCC_24_1x1;
-				else
-					index = CDS_STA_SAP_SCC_24_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_STA_SAP_SCC_5_1x1;
-				else
-					index = CDS_STA_SAP_SCC_5_2x2;
-			}
-		/* MCC */
-		} else if (conc_connection_list[0].mac ==
-				conc_connection_list[1].mac) {
-			if ((CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_SAP_MCC_24_1x1;
-				else
-					index = CDS_STA_SAP_MCC_24_2x2;
-			} else if ((CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_SAP_MCC_5_1x1;
-				else
-					index = CDS_STA_SAP_MCC_5_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_SAP_MCC_24_5_1x1;
-				else
-					index = CDS_STA_SAP_MCC_24_5_2x2;
-			}
-		/* DBS */
-		} else
-			index = CDS_STA_SAP_DBS_1x1;
-	} else    /* STA + P2P GO */
-	if (((CDS_STA_MODE == conc_connection_list[0].mode) &&
-		(CDS_P2P_GO_MODE == conc_connection_list[1].mode)) ||
-		((CDS_P2P_GO_MODE == conc_connection_list[0].mode) &&
-		(CDS_STA_MODE == conc_connection_list[1].mode))) {
-		/* SCC */
-		if (conc_connection_list[0].chan ==
-		conc_connection_list[1].chan) {
-			if (CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[0].chan)) {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_GO_SCC_24_1x1;
-				else
-					index = CDS_STA_P2P_GO_SCC_24_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_GO_SCC_5_1x1;
-				else
-					index = CDS_STA_P2P_GO_SCC_5_2x2;
-			}
-		/* MCC */
-		} else if (conc_connection_list[0].mac ==
-			conc_connection_list[1].mac) {
-			if ((CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_GO_MCC_24_1x1;
-				else
-					index = CDS_STA_P2P_GO_MCC_24_2x2;
-			} else if ((CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_GO_MCC_5_1x1;
-				else
-					index = CDS_STA_P2P_GO_MCC_5_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_GO_MCC_24_5_1x1;
-				else
-					index = CDS_STA_P2P_GO_MCC_24_5_2x2;
-			}
-		/* DBS */
-		} else
-			index = CDS_STA_P2P_GO_DBS_1x1;
-	} else    /* STA + P2P CLI */
-	if (((CDS_STA_MODE == conc_connection_list[0].mode) &&
-		(CDS_P2P_CLIENT_MODE == conc_connection_list[1].mode)) ||
-		((CDS_P2P_CLIENT_MODE == conc_connection_list[0].mode) &&
-		(CDS_STA_MODE == conc_connection_list[1].mode))) {
-		/* SCC */
-		if (conc_connection_list[0].chan ==
-		conc_connection_list[1].chan) {
-			if (CDS_IS_CHANNEL_24GHZ
-				(conc_connection_list[0].chan)) {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_CLI_SCC_24_1x1;
-				else
-					index = CDS_STA_P2P_CLI_SCC_24_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-				conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_CLI_SCC_5_1x1;
-				else
-					index = CDS_STA_P2P_CLI_SCC_5_2x2;
-			}
-		/* MCC */
-		} else if (conc_connection_list[0].mac ==
-			conc_connection_list[1].mac) {
-			if ((CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_CLI_MCC_24_1x1;
-				else
-					index = CDS_STA_P2P_CLI_MCC_24_2x2;
-			} else if ((CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_CLI_MCC_5_1x1;
-				else
-					index = CDS_STA_P2P_CLI_MCC_5_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_STA_P2P_CLI_MCC_24_5_1x1;
-				else
-					index = CDS_STA_P2P_CLI_MCC_24_5_2x2;
-			}
-		/* DBS */
-		} else
-			index = CDS_STA_P2P_CLI_DBS_1x1;
-	} else    /* P2P GO + P2P CLI */
-	if (((CDS_P2P_GO_MODE == conc_connection_list[0].mode) &&
-		(CDS_P2P_CLIENT_MODE == conc_connection_list[1].mode)) ||
-		((CDS_P2P_CLIENT_MODE == conc_connection_list[0].mode) &&
-		(CDS_P2P_GO_MODE == conc_connection_list[1].mode))) {
-		/* SCC */
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) {
-			if (CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[0].chan)) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_P2P_CLI_SCC_24_1x1;
-				else
-					index = CDS_P2P_GO_P2P_CLI_SCC_24_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_P2P_CLI_SCC_5_1x1;
-				else
-					index = CDS_P2P_GO_P2P_CLI_SCC_5_2x2;
-			}
-		/* MCC */
-		} else if (conc_connection_list[0].mac ==
-			conc_connection_list[1].mac) {
-			if ((CDS_IS_CHANNEL_24GHZ(
-			conc_connection_list[0].chan)) &&
-			(CDS_IS_CHANNEL_24GHZ(
-			conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_P2P_CLI_MCC_24_1x1;
-				else
-					index = CDS_P2P_GO_P2P_CLI_MCC_24_2x2;
-			} else if ((CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_P2P_CLI_MCC_5_1x1;
-				else
-					index = CDS_P2P_GO_P2P_CLI_MCC_5_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_P2P_CLI_MCC_24_5_1x1;
-				else
-					index = CDS_P2P_GO_P2P_CLI_MCC_24_5_2x2;
-			}
-		/* DBS */
-		} else
-			index = CDS_P2P_GO_P2P_CLI_DBS_1x1;
-	} else    /* STA + P2P CLI */
-	if (((CDS_SAP_MODE == conc_connection_list[0].mode) &&
-		(CDS_P2P_GO_MODE == conc_connection_list[1].mode)) ||
-		((CDS_P2P_GO_MODE == conc_connection_list[0].mode) &&
-		(CDS_SAP_MODE == conc_connection_list[1].mode))) {
-		/* SCC */
-		if (conc_connection_list[0].chan ==
-			conc_connection_list[1].chan) {
-			if (CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[0].chan)) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_SAP_SCC_24_1x1;
-				else
-					index = CDS_P2P_GO_SAP_SCC_24_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_SAP_SCC_5_1x1;
-				else
-					index = CDS_P2P_GO_SAP_SCC_5_2x2;
-			}
-		/* MCC */
-		} else if (conc_connection_list[0].mac ==
-			conc_connection_list[1].mac) {
-			if ((CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_24GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_SAP_MCC_24_1x1;
-				else
-					index = CDS_P2P_GO_SAP_MCC_24_2x2;
-			} else if ((CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[0].chan)) &&
-				(CDS_IS_CHANNEL_5GHZ(
-				conc_connection_list[1].chan))) {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_SAP_MCC_5_1x1;
-				else
-					index = CDS_P2P_GO_SAP_MCC_5_2x2;
-			} else {
-				if (CDS_ONE_ONE ==
-					conc_connection_list[0].chain_mask)
-					index = CDS_P2P_GO_SAP_MCC_24_5_1x1;
-				else
-					index = CDS_P2P_GO_SAP_MCC_24_5_2x2;
-			}
-		/* DBS */
-		} else
-			index = CDS_P2P_GO_SAP_DBS_1x1;
-	}
-
-	cds_debug("mode0:%d mode1:%d chan0:%d chan1:%d chain:%d index:%d",
-		conc_connection_list[0].mode, conc_connection_list[1].mode,
-		conc_connection_list[0].chan, conc_connection_list[1].chan,
-		conc_connection_list[0].chain_mask, index);
-
-	return index;
-}
-
-/**
- * cds_current_connections_update() - initiates actions
- * needed on current connections once channel has been decided
- * for the new connection
- * @session_id: Session id
- * @channel: Channel on which new connection will be
- * @reason: Reason for which connection update is required
- *
- * This function initiates initiates actions
- * needed on current connections once channel has been decided
- * for the new connection. Notifies UMAC & FW as well
- *
- * Return: CDF_STATUS enum
- */
-CDF_STATUS cds_current_connections_update(uint32_t session_id,
-				uint8_t channel,
-				enum cds_conn_update_reason reason)
-{
-	enum cds_conc_next_action next_action = CDS_NOP;
-	uint32_t num_connections = 0;
-	enum cds_one_connection_mode second_index = 0;
-	enum cds_two_connection_mode third_index = 0;
-	enum cds_band band;
-	cds_context_type *cds_ctx;
-	hdd_context_t *hdd_ctx;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return status;
-	}
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("Invalid HDD context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (wma_is_hw_dbs_capable() == false) {
-		cds_err("driver isn't dbs capable, no further action needed");
-		return CDF_STATUS_E_NOSUPPORT;
-	}
-	if (CDS_IS_CHANNEL_24GHZ(channel))
-		band = CDS_BAND_24;
-	else
-		band = CDS_BAND_5;
-
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	num_connections = cds_get_connection_count();
-
-	cds_debug("num_connections=%d channel=%d",
-		num_connections, channel);
-
-	switch (num_connections) {
-	case 0:
-		next_action = CDS_NOP;
-#ifdef QCA_WIFI_3_0_EMU
-		/* For M2M emulation only: if it is a connection on 2.4,
-		 * request DBS
-		 */
-		if (hdd_ctx->config->enable_m2m_limitation &&
-			CDS_IS_CHANNEL_24GHZ(channel))
-			next_action = CDS_DBS;
-#endif
-		break;
-	case 1:
-		second_index =
-			cds_get_second_connection_pcl_table_index();
-		if (CDS_MAX_ONE_CONNECTION_MODE == second_index) {
-			/* err msg */
-			cds_err("couldn't find index for 2nd connection next action table");
-			goto done;
-		}
-		next_action =
-			next_action_two_connection_table[second_index][band];
-		break;
-	case 2:
-		third_index =
-			cds_get_third_connection_pcl_table_index();
-		if (CDS_MAX_TWO_CONNECTION_MODE == third_index) {
-			/* err msg */
-			cds_err("couldn't find index for 3rd connection next action table");
-			goto done;
-		}
-		next_action =
-			next_action_three_connection_table[third_index][band];
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected num_connections value %d", num_connections);
-		break;
-	}
-
-	if (CDS_NOP != next_action)
-		status = cds_next_actions(session_id,
-						next_action, reason);
-	else
-		status = CDF_STATUS_E_NOSUPPORT;
-
-	cds_debug("index2=%d index3=%d next_action=%d, band=%d status=%d reason=%d session_id=%d",
-		second_index, third_index, next_action, band, status,
-		reason, session_id);
-
-done:
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-	return status;
-}
-
-/**
- * cds_wait_for_nss_update() - finds out if we need to wait
- * for all nss update to finish before requesting for HW mode
- * update
- * @action: next action to happen at policy mgr after
- *		beacon update
- *
- * This function finds out if we need to wait
- * for all nss update to finish before requesting for HW mode
- * update
- *
- * Return: boolean. True = wait for nss update, False = go ahead
- * with HW mode update
- */
-bool cds_wait_for_nss_update(uint8_t action)
-{
-	uint32_t conn_index = 0;
-	bool wait = false;
-	if (CDS_DBS == action) {
-		for (conn_index = 0;
-			conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
-			conn_index++) {
-			if ((conc_connection_list
-				[conn_index].original_nss == 1) &&
-				(conc_connection_list
-				[conn_index].tx_spatial_stream == 2) &&
-				(conc_connection_list
-				[conn_index].rx_spatial_stream == 2) &&
-				conc_connection_list[conn_index].in_use) {
-				wait = true;
-				break;
-			}
-		}
-	} else if (CDS_MCC == action) {
-		for (conn_index = 0;
-			conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
-			conn_index++) {
-			if ((conc_connection_list
-				[conn_index].original_nss == 1) &&
-				(conc_connection_list
-				[conn_index].tx_spatial_stream == 1) &&
-				(conc_connection_list
-				[conn_index].rx_spatial_stream == 1) &&
-				conc_connection_list[conn_index].in_use) {
-				wait = true;
-				break;
-			}
-		}
-	}
-	return wait;
-}
-
-/**
- * cds_nss_update_cb() - callback from SME confirming nss
- * update
- * @hdd_ctx:	HDD Context
- * @tx_status: tx completion status for updated beacon with new
- *		nss value
- * @vdev_id: vdev id for the specific connection
- * @next_action: next action to happen at policy mgr after
- *		beacon update
- *
- * This function is the callback registered with SME at nss
- * update request time
- *
- * Return: None
- */
-void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id,
-				uint8_t next_action)
-{
-	cds_context_type *cds_ctx;
-	uint32_t conn_index = 0;
-	bool wait = true;
-
-	if (CDF_STATUS_E_FAILURE == tx_status) {
-		cds_err("nss update failed for vdev %d", vdev_id);
-		return;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return;
-	}
-
-	/*
-	 * Check if we are ok to request for HW mode change now
-	 */
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	conn_index = cds_get_connection_for_vdev_id(vdev_id);
-	if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) {
-		cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-		cds_err("connection not found for vdev %d", vdev_id);
-		return;
-	}
-	switch (next_action) {
-	case CDS_DBS:
-		conc_connection_list[conn_index].tx_spatial_stream = 1;
-		conc_connection_list[conn_index].rx_spatial_stream = 1;
-		wait = cds_wait_for_nss_update(next_action);
-		break;
-	case CDS_MCC:
-		conc_connection_list[conn_index].tx_spatial_stream = 2;
-		conc_connection_list[conn_index].rx_spatial_stream = 2;
-		wait = cds_wait_for_nss_update(next_action);
-		break;
-	default:
-		cds_err("unexpected action %d", next_action);
-		break;
-	}
-	if (!wait)
-		cds_next_actions(vdev_id,
-				next_action,
-				CDS_UPDATE_REASON_NSS_UPDATE);
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-	return;
-}
-
-/**
- * cds_complete_action() - initiates actions needed on
- * current connections once channel has been decided for the new
- * connection
- * @new_nss: the new nss value
- * @next_action: next action to happen at policy mgr after
- *		beacon update
- * @reason: Reason for connection update
- * @session_id: Session id
- *
- * This function initiates initiates actions
- * needed on current connections once channel has been decided
- * for the new connection. Notifies UMAC & FW as well
- *
- * Return: CDF_STATUS enum
- */
-CDF_STATUS cds_complete_action(uint8_t  new_nss, uint8_t next_action,
-				enum cds_conn_update_reason reason,
-				uint32_t session_id)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t index = 0, count = 0;
-	uint32_t list[MAX_NUMBER_OF_CONC_CONNECTIONS];
-	uint32_t conn_index = 0;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return status;
-	}
-
-	if (wma_is_hw_dbs_capable() == false) {
-		cds_err("driver isn't dbs capable, no further action needed");
-		return CDF_STATUS_E_NOSUPPORT;
-	}
-
-	/* cds_complete_action() is called by cds_next_actions().
-	 * All other callers of cds_next_actions() have taken mutex
-	 * protection. So, not taking any lock inside cds_complete_action()
-	 * during conc_connection_list access.
-	 */
-	count = cds_mode_specific_connection_count(
-			CDS_P2P_GO_MODE, list);
-	while (index < count) {
-		conn_index = cds_get_connection_for_vdev_id(
-				conc_connection_list[list[index]].vdev_id);
-		if (MAX_NUMBER_OF_CONC_CONNECTIONS == conn_index) {
-			cds_err("connection not found for vdev %d",
-				conc_connection_list[list[index]].vdev_id);
-			continue;
-		}
-
-		if (1 == conc_connection_list[list[index]].original_nss) {
-			status = sme_nss_update_request(hdd_ctx->hHal,
-					conc_connection_list
-					[list[index]].vdev_id, new_nss,
-					cds_nss_update_cb,
-					next_action, hdd_ctx);
-			if (!CDF_IS_STATUS_SUCCESS(status)) {
-				cds_err("sme_nss_update_request() failed for vdev %d",
-				conc_connection_list[list[index]].vdev_id);
-			}
-		}
-		index++;
-	}
-
-	index = 0;
-	count = cds_mode_specific_connection_count(
-			CDS_SAP_MODE, list);
-	while (index < count) {
-		if (1 == conc_connection_list[list[index]].original_nss) {
-			status = sme_nss_update_request(hdd_ctx->hHal,
-					conc_connection_list
-					[list[index]].vdev_id, new_nss,
-					cds_nss_update_cb,
-					next_action, hdd_ctx);
-			if (!CDF_IS_STATUS_SUCCESS(status)) {
-				cds_err("sme_nss_update_request() failed for vdev %d",
-				conc_connection_list[list[index]].vdev_id);
-			}
-		}
-		index++;
-	}
-	if (!CDF_IS_STATUS_SUCCESS(status))
-		status = cds_next_actions(session_id,
-						next_action, reason);
-
-	return status;
-}
-
-/**
- * cds_next_actions() - initiates actions needed on current
- * connections once channel has been decided for the new
- * connection
- * @session_id: Session id
- * @action: action to be executed
- * @reason: Reason for connection update
- *
- * This function initiates initiates actions
- * needed on current connections once channel has been decided
- * for the new connection. Notifies UMAC & FW as well
- *
- * Return: CDF_STATUS enum
- */
-CDF_STATUS cds_next_actions(uint32_t session_id,
-				enum cds_conc_next_action action,
-				enum cds_conn_update_reason reason)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	struct sir_hw_mode_params hw_mode;
-
-	if (wma_is_hw_dbs_capable() == false) {
-		cds_err("driver isn't dbs capable, no further action needed");
-		return CDF_STATUS_E_NOSUPPORT;
-	}
-
-	/* check for the current HW index to see if really need any action */
-	status = wma_get_current_hw_mode(&hw_mode);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		cds_err("wma_get_current_hw_mode failed");
-		return status;
-	}
-	/**
-	 *  if already in DBS no need to request DBS or if already in
-	 *  non dbs no need request for non dbs again. Might be needed
-	 *  to extend the logic when multiple dbs HW mode is available
-	 */
-	if ((((CDS_DBS_DOWNGRADE == action) || (CDS_DBS == action))
-		&& hw_mode.dbs_cap) ||
-		(((CDS_MCC_UPGRADE == action) || (CDS_MCC == action))
-		&& !hw_mode.dbs_cap)) {
-		cds_err("driver is already in %s mode, no further action needed",
-				(hw_mode.dbs_cap) ? "dbs" : "non dbs");
-		return CDF_STATUS_E_ALREADY;
-	}
-
-	switch (action) {
-	case CDS_DBS_DOWNGRADE:
-		/*
-		* check if we have a beaconing entity that is using 2x2. If yes,
-		* update the beacon template & notify FW. Once FW confirms
-		*  beacon updated, send down the HW mode change req
-		*/
-		status = cds_complete_action(1, CDS_DBS, reason,
-						session_id);
-		break;
-	case CDS_DBS:
-		status = cds_soc_set_hw_mode(session_id,
-						HW_MODE_SS_1x1,
-						HW_MODE_80_MHZ,
-						HW_MODE_SS_1x1, HW_MODE_40_MHZ,
-						HW_MODE_DBS,
-						HW_MODE_AGILE_DFS_NONE,
-						reason);
-		break;
-	case CDS_MCC_UPGRADE:
-		/*
-		* check if we have a beaconing entity that advertised 2x2
-		* intially. If yes, update the beacon template & notify FW.
-		* Once FW confirms beacon updated, send the HW mode change req
-		*/
-		status = cds_complete_action(0, CDS_MCC, reason,
-						session_id);
-		break;
-	case CDS_MCC:
-		status = cds_soc_set_hw_mode(session_id,
-						HW_MODE_SS_2x2,
-						HW_MODE_80_MHZ,
-						HW_MODE_SS_0x0, HW_MODE_BW_NONE,
-						HW_MODE_DBS_NONE,
-						HW_MODE_AGILE_DFS_NONE,
-						reason);
-		break;
-	default:
-		/* err msg */
-		cds_err("unexpected action value %d", action);
-		status = CDF_STATUS_E_FAILURE;
-		break;
-	}
-
-	return status;
-}
-
-/**
- * cds_cfg80211_get_concurrency_matrix() - to retrieve concurrency matrix
- * @wiphy: pointer phy adapter
- * @wdev: pointer to wireless device structure
- * @data: pointer to data buffer
- * @data_len: length of data
- *
- * This routine will give concurrency matrix
- *
- * Return: int status code
- */
-static int __cds_cfg80211_get_concurrency_matrix(struct wiphy *wiphy,
-					 struct wireless_dev *wdev,
-					 const void *data,
-					 int data_len)
-{
-	uint32_t feature_set_matrix[CDS_MAX_FEATURE_SET] = {0};
-	uint8_t i, feature_sets, max_feature_sets;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX + 1];
-	struct sk_buff *reply_skb;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	int ret;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		cds_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret) {
-		cds_err("HDD context is not valid");
-		return ret;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX,
-			data, data_len, NULL)) {
-		cds_err("Invalid ATTR");
-		return -EINVAL;
-	}
-
-	/* Parse and fetch max feature set */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX]) {
-		cds_err("Attr max feature set size failed");
-		return -EINVAL;
-	}
-	max_feature_sets = nla_get_u32(tb[
-		QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX]);
-	cds_info("Max feature set size (%d)", max_feature_sets);
-
-	/* Fill feature combination matrix */
-	feature_sets = 0;
-	feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA |
-		WIFI_FEATURE_P2P;
-	/* Add more feature combinations here */
-
-	feature_sets = CDF_MIN(feature_sets, max_feature_sets);
-	cds_info("Number of feature sets (%d)", feature_sets);
-	cds_info("Feature set matrix");
-	for (i = 0; i < feature_sets; i++)
-		cds_info("[%d] 0x%02X", i, feature_set_matrix[i]);
-
-	reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u32) +
-			sizeof(u32) * feature_sets + NLMSG_HDRLEN);
-
-	if (reply_skb) {
-		if (nla_put_u32(reply_skb,
-			QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET_SIZE,
-			feature_sets) ||
-			nla_put(reply_skb,
-			      QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET,
-			      sizeof(u32) * feature_sets,
-			      feature_set_matrix)) {
-			cds_err("nla put fail");
-			kfree_skb(reply_skb);
-			return -EINVAL;
-		}
-		return cfg80211_vendor_cmd_reply(reply_skb);
-	}
-	cds_err("Feature set matrix: buffer alloc fail");
-	return -ENOMEM;
-}
-
-/**
- * cds_cfg80211_get_concurrency_matrix() - get concurrency matrix
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * Return:   Return the Success or Failure code.
- */
-int
-cds_cfg80211_get_concurrency_matrix(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __cds_cfg80211_get_concurrency_matrix(wiphy, wdev, data,
-			data_len);
-	cds_ssr_unprotect(__func__);
-	return ret;
-}
-
-/**
- * cds_get_concurrency_mode() - return concurrency mode
- *
- * This routine is used to retrieve concurrency mode
- *
- * Return: uint32_t value of concurrency mask
- */
-uint32_t cds_get_concurrency_mode(void)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL != hdd_ctx) {
-		cds_info("concurrency_mode = 0x%x",
-			hdd_ctx->concurrency_mode);
-		return hdd_ctx->concurrency_mode;
-	}
-
-	/* we are in an invalid state :( */
-	cds_err("Invalid context");
-	return CDF_STA_MASK;
-}
-
-/**
- * cds_sap_restart_handle() - to handle restarting of SAP
- * @work: name of the work
- *
- * Purpose of this function is to trigger sap start. this function
- * will be called from workqueue.
- *
- * Return: void.
- */
-static void cds_sap_restart_handle(struct work_struct *work)
-{
-	hdd_adapter_t *sap_adapter;
-	hdd_context_t *hdd_ctx = container_of(work, hdd_context_t,
-					sap_start_work);
-	cds_ssr_protect(__func__);
-	if (0 != wlan_hdd_validate_context(hdd_ctx)) {
-		cds_err("HDD context is not valid");
-		cds_ssr_unprotect(__func__);
-		return;
-	}
-	sap_adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP);
-	if (sap_adapter == NULL) {
-		cds_err("sap_adapter is NULL");
-		cds_ssr_unprotect(__func__);
-		return;
-	}
-	wlan_hdd_start_sap(sap_adapter);
-
-	cds_change_sap_restart_required_status(false);
-	cds_ssr_unprotect(__func__);
-}
-
-/**
- * cds_check_and_restart_sap() - Check and restart sap if required
- * @roam_result: Roam result
- * @hdd_sta_ctx: HDD station context
- *
- * This routine will restart the SAP if restart is pending
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_check_and_restart_sap(eCsrRoamResult roam_result,
-			hdd_station_ctx_t *hdd_sta_ctx)
-{
-	hdd_adapter_t *sap_adapter = NULL;
-	hdd_ap_ctx_t *hdd_ap_ctx = NULL;
-	uint8_t default_sap_channel = 6;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (!(hdd_ctx->config->conc_custom_rule1 &&
-			(true == cds_is_sap_restart_required())))
-		return CDF_STATUS_SUCCESS;
-
-	sap_adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP);
-	if (sap_adapter == NULL) {
-		cds_err("sap_adapter is NULL");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (test_bit(SOFTAP_BSS_STARTED, &sap_adapter->event_flags)) {
-		cds_err("SAP is already in started state");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(sap_adapter);
-	if (hdd_ap_ctx == NULL) {
-		cds_err("HDD sap context is NULL");
-		return CDF_STATUS_E_FAILURE;
-	}
-	if ((eCSR_ROAM_RESULT_ASSOCIATED == roam_result) &&
-			hdd_sta_ctx->conn_info.operationChannel <
-			SIR_11A_CHANNEL_BEGIN) {
-		cds_err("Starting SAP on chnl [%d] after STA assoc complete",
-			hdd_sta_ctx->conn_info.operationChannel);
-		hdd_ap_ctx->operatingChannel =
-			hdd_sta_ctx->conn_info.operationChannel;
-	} else {
-		/* start on default SAP channel */
-		hdd_ap_ctx->operatingChannel =
-			default_sap_channel;
-		cds_err("Starting SAP on channel [%d] after STA assoc failed",
-			default_sap_channel);
-	}
-	hdd_ap_ctx->sapConfig.ch_params.ch_width =
-		hdd_ap_ctx->sapConfig.ch_width_orig;
-	sme_set_ch_params(WLAN_HDD_GET_HAL_CTX(sap_adapter),
-			hdd_ap_ctx->sapConfig.SapHw_mode,
-			hdd_ap_ctx->operatingChannel,
-			hdd_ap_ctx->sapConfig.sec_ch,
-			&hdd_ap_ctx->sapConfig.ch_params);
-	/*
-	 * Create a workqueue and let the workqueue handle the restart
-	 * of sap task. if we directly call sap restart function without
-	 * creating workqueue then our main thread might go to sleep
-	 * which is not acceptable.
-	 */
-#ifdef CONFIG_CNSS
-	cnss_init_work(&hdd_ctx->sap_start_work,
-			cds_sap_restart_handle);
-#else
-	INIT_WORK(&hdd_ctx->sap_start_work,
-			cds_sap_restart_handle);
-#endif
-	schedule_work(&hdd_ctx->sap_start_work);
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_sta_sap_concur_handle() - This function will handle Station and sap
- * concurrency.
- * @sta_adapter: pointer to station adapter.
- * @roam_profile: pointer to station's roam profile.
- *
- * This function will find the AP to which station is likely to make the
- * the connection, if that AP's channel happens to be different than
- * SAP's channel then this function will stop the SAP.
- *
- * Return: true or false based on function's overall success.
- */
-static bool cds_sta_sap_concur_handle(hdd_adapter_t *sta_adapter,
-		tCsrRoamProfile *roam_profile)
-{
-	hdd_adapter_t *ap_adapter;
-	bool are_cc_channels_same = false;
-	tScanResultHandle scan_cache = NULL;
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return are_cc_channels_same;
-	}
-
-	ap_adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP);
-	if ((ap_adapter != NULL) &&
-		test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) {
-		status =
-			wlan_hdd_check_custom_con_channel_rules(sta_adapter,
-					ap_adapter, roam_profile, &scan_cache,
-					&are_cc_channels_same);
-		if (CDF_STATUS_SUCCESS != status) {
-			cds_err("wlan_hdd_check_custom_con_channel_rules failed!");
-			/* Not returning */
-		}
-		status = sme_scan_result_purge(
-				WLAN_HDD_GET_HAL_CTX(sta_adapter),
-				scan_cache);
-		if (CDF_STATUS_SUCCESS != status) {
-			cds_err("sme_scan_result_purge failed!");
-			/* Not returning */
-		}
-		/*
-		 * are_cc_channels_same will be false incase if SAP and STA
-		 * channel is different or STA channel is zero.
-		 * incase if STA channel is zero then lets stop the AP and
-		 * restart flag set, so later whenever STA channel is defined
-		 * we can restart our SAP in that channel.
-		 */
-		if (false == are_cc_channels_same) {
-			cds_info("Stop AP due to mismatch with STA channel");
-			wlan_hdd_stop_sap(ap_adapter);
-			cds_change_sap_restart_required_status(true);
-			return false;
-		} else {
-			cds_info("sap channels are same");
-		}
-	}
-	return true;
-}
-
-#ifdef FEATURE_WLAN_CH_AVOID
-/**
- * cds_sta_p2pgo_concur_handle() - This function will handle Station and GO
- * concurrency.
- * @sta_adapter: pointer to station adapter.
- * @roam_profile: pointer to station's roam profile.
- * @roam_id: reference to roam_id variable being passed.
- *
- * This function will find the AP to which station is likely to make the
- * the connection, if that AP's channel happens to be different than our
- * P2PGO's channel then this function will send avoid frequency event to
- * framework to make P2PGO stop and also caches station's connect request.
- *
- * Return: true or false based on function's overall success.
- */
-static bool cds_sta_p2pgo_concur_handle(hdd_adapter_t *sta_adapter,
-		tCsrRoamProfile *roam_profile,
-		uint32_t *roam_id)
-{
-	hdd_adapter_t *p2pgo_adapter;
-	bool are_cc_channels_same = false;
-	tScanResultHandle scan_cache = NULL;
-	uint32_t p2pgo_channel_num, freq;
-	tHddAvoidFreqList hdd_avoid_freq_list;
-	CDF_STATUS status;
-	bool ret;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return are_cc_channels_same;
-	}
-	p2pgo_adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_P2P_GO);
-	if ((p2pgo_adapter != NULL) &&
-		test_bit(SOFTAP_BSS_STARTED, &p2pgo_adapter->event_flags)) {
-		status =
-			wlan_hdd_check_custom_con_channel_rules(sta_adapter,
-					p2pgo_adapter, roam_profile,
-					&scan_cache, &are_cc_channels_same);
-		if (CDF_STATUS_SUCCESS != status) {
-			cds_err("wlan_hdd_check_custom_con_channel_rules failed");
-			/* Not returning */
-		}
-		/*
-		 * are_cc_channels_same will be false incase if P2PGO and STA
-		 * channel is different or STA channel is zero.
-		 */
-		if (false == are_cc_channels_same) {
-			if (true == cds_is_sta_connection_pending()) {
-				MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-					TRACE_CODE_HDD_CLEAR_JOIN_REQ,
-					sta_adapter->sessionId, *roam_id));
-				ret = sme_clear_joinreq_param(
-					WLAN_HDD_GET_HAL_CTX(sta_adapter),
-					sta_adapter->sessionId);
-				if (true != ret) {
-					cds_err("sme_clear_joinreq_param failed");
-					/* Not returning */
-				}
-				cds_change_sta_conn_pending_status(false);
-				cds_info("===>Clear pending join req");
-			}
-			MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-					TRACE_CODE_HDD_STORE_JOIN_REQ,
-					sta_adapter->sessionId, *roam_id));
-			/* store the scan cache here */
-			ret = sme_store_joinreq_param(
-					WLAN_HDD_GET_HAL_CTX(sta_adapter),
-					roam_profile,
-					scan_cache,
-					roam_id,
-					sta_adapter->sessionId);
-			if (true != ret) {
-				cds_err("sme_store_joinreq_param failed");
-				/* Not returning */
-			}
-			cds_change_sta_conn_pending_status(true);
-			/*
-			 * fill frequency avoidance event and send it up, so
-			 * p2pgo stop event should get trigger from upper layer
-			 */
-			p2pgo_channel_num =
-				WLAN_HDD_GET_AP_CTX_PTR(p2pgo_adapter)->
-				operatingChannel;
-			if (p2pgo_channel_num <= 14) {
-				freq = ieee80211_channel_to_frequency(
-						p2pgo_channel_num,
-						IEEE80211_BAND_2GHZ);
-			} else {
-				freq = ieee80211_channel_to_frequency(
-						p2pgo_channel_num,
-						IEEE80211_BAND_5GHZ);
-			}
-			cdf_mem_zero(&hdd_avoid_freq_list,
-					sizeof(hdd_avoid_freq_list));
-			hdd_avoid_freq_list.avoidFreqRangeCount = 1;
-			hdd_avoid_freq_list.avoidFreqRange[0].startFreq = freq;
-			hdd_avoid_freq_list.avoidFreqRange[0].endFreq = freq;
-			wlan_hdd_send_avoid_freq_event(hdd_ctx,
-					&hdd_avoid_freq_list);
-			cds_info("===>Sending chnl_avoid ch[%d] freq[%d]",
-				p2pgo_channel_num, freq);
-			cds_info("=>Stop GO due to mismatch with STA channel");
-			return false;
-		} else {
-			cds_info("===>p2pgo channels are same");
-			status = sme_scan_result_purge(
-					WLAN_HDD_GET_HAL_CTX(sta_adapter),
-					scan_cache);
-			if (CDF_STATUS_SUCCESS != status) {
-				cds_err("sme_scan_result_purge failed");
-				/* Not returning */
-			}
-		}
-	}
-	return true;
-}
-#endif
-
-/**
- * cds_handle_conc_rule1() - Check if concurrency rule1 is enabled
- * @adapter: HDD adpater
- * @roam_profile: Profile for connection
- *
- * Check if concurrency rule1 is enabled. As per rule1, if station is trying to
- * connect to some AP in 2.4Ghz and SAP is already in started state then SAP
- * should restart in station's
- *
- * Return: None
- */
-void cds_handle_conc_rule1(hdd_adapter_t *adapter,
-		tCsrRoamProfile *roam_profile)
-{
-	bool ret;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	/*
-	 * Custom concurrency rule1: As per this rule if station is
-	 * trying to connect to some AP in 2.4Ghz and SAP is already
-	 * in started state then SAP should restart in station's
-	 * channel.
-	 */
-	if (hdd_ctx->config->conc_custom_rule1 &&
-			(WLAN_HDD_INFRA_STATION == adapter->device_mode)) {
-		ret = cds_sta_sap_concur_handle(adapter,
-				roam_profile);
-		if (true != ret) {
-			cds_err("cds_sta_sap_concur_handle failed");
-			/* Nothing to do for now */
-		}
-	}
-}
-
-#ifdef FEATURE_WLAN_CH_AVOID
-/**
- * cds_handle_conc_rule2() - Check if concurrency rule2 is enabled
- * @adapter: HDD adpater
- * @roam_profile: Profile for connection
- *
- * Check if concurrency rule1 is enabled. As per rule1, if station is trying to
- * connect to some AP in 5Ghz and P2PGO is already in started state then P2PGO
- * should restart in station's channel
- *
- * Return: None
- */
-bool cds_handle_conc_rule2(hdd_adapter_t *adapter,
-		tCsrRoamProfile *roam_profile,
-		uint32_t *roam_id)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return false;
-	}
-
-	/*
-	 * Custom concurrency rule2: As per this rule if station is
-	 * trying to connect to some AP in 5Ghz and P2PGO is already in
-	 * started state then P2PGO should restart in station's channel.
-	 */
-	if (hdd_ctx->config->conc_custom_rule2 &&
-		(WLAN_HDD_INFRA_STATION == adapter->device_mode)) {
-		if (false == cds_sta_p2pgo_concur_handle(
-					adapter, roam_profile, roam_id)) {
-			cds_err("P2PGO-STA chnl diff, cache join req");
-			return false;
-		}
-	}
-	return true;
-}
-#endif
-
-/**
- * cds_get_channel_from_scan_result() - to get channel from scan result
- * @adapter: station adapter
- * @roam_profile: pointer to roam profile
- * @channel: channel to be filled
- *
- * This routine gets channel which most likely a candidate to which STA
- * will make connection.
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_get_channel_from_scan_result(hdd_adapter_t *adapter,
-			tCsrRoamProfile *roam_profile, uint8_t *channel)
-{
-	CDF_STATUS status;
-	tScanResultHandle scan_cache = NULL;
-
-	status = sme_get_ap_channel_from_scan_cache(
-				WLAN_HDD_GET_HAL_CTX(adapter),
-				roam_profile, &scan_cache,
-				channel);
-	sme_scan_result_purge(WLAN_HDD_GET_HAL_CTX(adapter), scan_cache);
-	return status;
-}
-
-/**
- * cds_search_and_check_for_session_conc() - Checks if concurrecy is allowed
- * @session_id: Session id
- * @roam_profile: Pointer to the roam profile
- *
- * Searches and gets the channel number from the scan results and checks if
- * concurrency is allowed for the given session ID
- *
- * Non zero channel number if concurrency is allowed, zero otherwise
- */
-uint8_t cds_search_and_check_for_session_conc(uint8_t session_id,
-		tCsrRoamProfile *roam_profile)
-{
-	uint8_t channel = 0;
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx;
-	hdd_adapter_t *adapter;
-	bool ret;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("Invalid HDD context");
-		return channel;
-	}
-
-	adapter = hdd_get_adapter_by_vdev(hdd_ctx, session_id);
-	if (!adapter) {
-		cds_err("Invalid HDD adapter");
-		return channel;
-	}
-
-	status = cds_get_channel_from_scan_result(adapter,
-			roam_profile, &channel);
-	if ((CDF_STATUS_SUCCESS != status) || (channel == 0)) {
-		cds_err("%s error %d %d",
-			__func__, status, channel);
-		return 0;
-	}
-
-	/* Take care of 160MHz and 80+80Mhz later */
-	ret = cds_allow_concurrency(
-		cds_convert_device_mode_to_hdd_type(
-			adapter->device_mode),
-		channel, HW_MODE_20_MHZ);
-	if (false == ret) {
-		cds_err("Connection failed due to conc check fail");
-		return 0;
-	}
-
-	return channel;
-}
-
-/**
- * cds_check_for_session_conc() - Check if concurrency is allowed for a session
- * @session_id: Session ID
- * @channel: Channel number
- *
- * Checks if connection is allowed for a given session_id
- *
- * True if the concurrency is allowed, false otherwise
- */
-bool cds_check_for_session_conc(uint8_t session_id, uint8_t channel)
-{
-	hdd_context_t *hdd_ctx;
-	hdd_adapter_t *adapter;
-	bool ret;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("Invalid HDD context");
-		return false;
-	}
-
-	adapter = hdd_get_adapter_by_vdev(hdd_ctx, session_id);
-	if (!adapter) {
-		cds_err("Invalid HDD adapter");
-		return false;
-	}
-
-	if (channel == 0) {
-		cds_err("Invalid channel number 0");
-		return false;
-	}
-
-	/* Take care of 160MHz and 80+80Mhz later */
-	ret = cds_allow_concurrency(
-		cds_convert_device_mode_to_hdd_type(
-			adapter->device_mode),
-		channel, HW_MODE_20_MHZ);
-	if (false == ret) {
-		cds_err("Connection failed due to conc check fail");
-		return 0;
-	}
-
-	return true;
-}
-
-/**
- * cds_handle_conc_multiport() - to handle multiport concurrency
- * @session_id: Session ID
- * @channel: Channel number
- *
- * This routine will handle STA side concurrency when policy manager
- * is enabled.
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_handle_conc_multiport(uint8_t session_id, uint8_t channel)
-{
-	CDF_STATUS status;
-
-	if (!cds_check_for_session_conc(session_id, channel)) {
-		cds_err("Conc not allowed for the session %d", session_id);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	status = cdf_reset_connection_update();
-	if (!CDF_IS_STATUS_SUCCESS(status))
-		cds_err("clearing event failed");
-
-	status = cds_current_connections_update(session_id,
-			channel,
-			CDS_UPDATE_REASON_NORMAL_STA);
-	if (CDF_STATUS_E_FAILURE == status) {
-		cds_err("connections update failed");
-		return status;
-	}
-
-	return status;
-}
-
-#ifdef FEATURE_WLAN_FORCE_SAP_SCC
-/**
- * cds_restart_softap() - restart SAP on STA channel to support
- * STA + SAP concurrency.
- *
- * @pHostapdAdapter: pointer to hdd adapter
- *
- * Return: None
- */
-void cds_restart_softap(hdd_adapter_t *pHostapdAdapter)
-{
-	tHddAvoidFreqList hdd_avoid_freq_list;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	/* generate vendor specific event */
-	cdf_mem_zero((void *)&hdd_avoid_freq_list, sizeof(tHddAvoidFreqList));
-	hdd_avoid_freq_list.avoidFreqRange[0].startFreq =
-		cds_chan_to_freq(pHostapdAdapter->sessionCtx.ap.
-				operatingChannel);
-	hdd_avoid_freq_list.avoidFreqRange[0].endFreq =
-		cds_chan_to_freq(pHostapdAdapter->sessionCtx.ap.
-				operatingChannel);
-	hdd_avoid_freq_list.avoidFreqRangeCount = 1;
-	wlan_hdd_send_avoid_freq_event(hdd_ctx, &hdd_avoid_freq_list);
-}
-
-/**
- * cds_force_sap_on_scc() - Force SAP on SCC
- * @roam_result: Roam result
- * @channel_id: STA channel id
- *
- * Restarts SAP on SCC if its operating channel is different from that of the
- * STA-AP interface
- *
- * Return: None
- */
-void cds_force_sap_on_scc(eCsrRoamResult roam_result,
-			 uint8_t channel_id)
-{
-	hdd_adapter_t *hostapd_adapter;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	if (!(eCSR_ROAM_RESULT_ASSOCIATED == roam_result &&
-		hdd_ctx->config->SapSccChanAvoidance)) {
-		cds_err("Not able to force SAP on SCC");
-		return;
-	}
-	hostapd_adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP);
-	if (hostapd_adapter != NULL) {
-		/* Restart SAP if its operating channel is different
-		 * from AP channel.
-		 */
-		if (hostapd_adapter->sessionCtx.ap.operatingChannel !=
-				channel_id) {
-			cds_err("Restart SAP: SAP channel-%d, STA channel-%d",
-				hostapd_adapter->sessionCtx.ap.operatingChannel,
-				channel_id);
-			cds_restart_softap(hostapd_adapter);
-		}
-	}
-}
-#endif /* FEATURE_WLAN_FORCE_SAP_SCC */
-
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-/**
- * cds_check_sta_ap_concurrent_ch_intf() - Restart SAP in STA-AP case
- * @data: Pointer to STA adapter
- *
- * Restarts the SAP interface in STA-AP concurrency scenario
- *
- * Restart: None
- */
-static void cds_check_sta_ap_concurrent_ch_intf(void *data)
-{
-	hdd_adapter_t *ap_adapter = NULL, *sta_adapter = (hdd_adapter_t *) data;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(sta_adapter);
-	tHalHandle *hal_handle;
-	hdd_ap_ctx_t *hdd_ap_ctx;
-	uint16_t intf_ch = 0;
-
-	if ((hdd_ctx->config->WlanMccToSccSwitchMode ==
-				CDF_MCC_TO_SCC_SWITCH_DISABLE)
-			|| !(cds_concurrent_open_sessions_running()
-			    || !(cds_get_concurrency_mode() ==
-					(CDF_STA_MASK | CDF_SAP_MASK))))
-		return;
-
-	ap_adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP);
-	if (ap_adapter == NULL)
-		return;
-
-	if (!test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags))
-		return;
-
-	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	hal_handle = WLAN_HDD_GET_HAL_CTX(ap_adapter);
-
-	if (hal_handle == NULL)
-		return;
-
-	intf_ch = wlansap_check_cc_intf(hdd_ap_ctx->sapContext);
-
-	if (intf_ch == 0)
-		return;
-
-	hdd_ap_ctx->sapConfig.channel = intf_ch;
-	hdd_ap_ctx->sapConfig.ch_params.ch_width =
-		hdd_ap_ctx->sapConfig.ch_width_orig;
-	sme_set_ch_params(hal_handle,
-			hdd_ap_ctx->sapConfig.SapHw_mode,
-			hdd_ap_ctx->sapConfig.channel,
-			hdd_ap_ctx->sapConfig.sec_ch,
-			&hdd_ap_ctx->sapConfig.ch_params);
-	cds_restart_sap(ap_adapter);
-}
-/**
- * cds_check_concurrent_intf_and_restart_sap() - Check concurrent change intf
- * @hdd_sta_ctx: Pointer to HDD STA context
- *
- * Checks the concurrent change interface and restarts SAP
- * Return: None
- */
-void cds_check_concurrent_intf_and_restart_sap(hdd_station_ctx_t *hdd_sta_ctx,
-		hdd_adapter_t *adapter)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	if ((hdd_ctx->config->WlanMccToSccSwitchMode
-				!= CDF_MCC_TO_SCC_SWITCH_DISABLE) &&
-			((0 == hdd_ctx->config->conc_custom_rule1) &&
-			 (0 == hdd_ctx->config->conc_custom_rule2))
-#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
-			&& !CDS_IS_DFS_CH(hdd_sta_ctx->conn_info.
-				operationChannel)
-#endif
-	   ) {
-		cdf_create_work(&hdd_ctx->sta_ap_intf_check_work,
-				cds_check_sta_ap_concurrent_ch_intf,
-				(void *)adapter);
-		cdf_schedule_work(&hdd_ctx->sta_ap_intf_check_work);
-		cds_info("Checking for Concurrent Change interference");
-	}
-}
-#endif /* FEATURE_WLAN_MCC_TO_SCC_SWITCH */
-
-/**
- * cds_is_mcc_in_24G() - Function to check for MCC in 2.4GHz
- *
- * This function is used to check for MCC operation in 2.4GHz band.
- * STA, P2P and SAP adapters are only considered.
- *
- * Return: Non zero value if MCC is detected in 2.4GHz band
- *
- */
-uint8_t cds_is_mcc_in_24G(void)
-{
-	CDF_STATUS status;
-	hdd_adapter_t *hdd_adapter = NULL;
-	hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
-	uint8_t ret = 0;
-	hdd_station_ctx_t *sta_ctx;
-	hdd_ap_ctx_t *ap_ctx;
-	uint8_t ch1 = 0, ch2 = 0;
-	uint8_t channel = 0;
-	hdd_hostapd_state_t *hostapd_state;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return 1;
-	}
-
-	status =  hdd_get_front_adapter(hdd_ctx, &adapter_node);
-
-	/* loop through all adapters and check MCC for STA,P2P,SAP adapters */
-	while (NULL != adapter_node && CDF_STATUS_SUCCESS == status) {
-		hdd_adapter = adapter_node->pAdapter;
-
-		if (!((hdd_adapter->device_mode >= WLAN_HDD_INFRA_STATION)
-					|| (hdd_adapter->device_mode
-						<= WLAN_HDD_P2P_GO))) {
-			/* skip for other adapters */
-			status = hdd_get_next_adapter(hdd_ctx,
-					adapter_node, &next);
-			adapter_node = next;
-			continue;
-		}
-		if (WLAN_HDD_INFRA_STATION ==
-				hdd_adapter->device_mode ||
-				WLAN_HDD_P2P_CLIENT ==
-				hdd_adapter->device_mode) {
-			sta_ctx =
-				WLAN_HDD_GET_STATION_CTX_PTR(
-						hdd_adapter);
-			if (eConnectionState_Associated ==
-					sta_ctx->conn_info.connState)
-				channel =
-					sta_ctx->conn_info.
-					operationChannel;
-		} else if (WLAN_HDD_P2P_GO ==
-				hdd_adapter->device_mode ||
-				WLAN_HDD_SOFTAP ==
-				hdd_adapter->device_mode) {
-			ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(hdd_adapter);
-			hostapd_state =
-				WLAN_HDD_GET_HOSTAP_STATE_PTR(
-						hdd_adapter);
-			if (hostapd_state->bssState == BSS_START &&
-					hostapd_state->cdf_status ==
-					CDF_STATUS_SUCCESS)
-				channel = ap_ctx->operatingChannel;
-		}
-
-		if ((ch1 == 0) ||
-				((ch2 != 0) && (ch2 != channel))) {
-			ch1 = channel;
-		} else if ((ch2 == 0) ||
-				((ch1 != 0) && (ch1 != channel))) {
-			ch2 = channel;
-		}
-
-		if ((ch1 != 0 && ch2 != 0) && (ch1 != ch2) &&
-				((ch1 <= SIR_11B_CHANNEL_END) &&
-				 (ch2 <= SIR_11B_CHANNEL_END))) {
-			cds_err("MCC in 2.4Ghz on channels %d and %d",
-				ch1, ch2);
-			return 1;
-		}
-		status = hdd_get_next_adapter(hdd_ctx,
-				adapter_node, &next);
-		adapter_node = next;
-	}
-	return ret;
-}
-
-/**
- * cds_set_mas() - Function to set MAS value to UMAC
- * @adapter:            Pointer to HDD adapter
- * @mas_value:          0-Disable, 1-Enable MAS
- *
- * This function passes down the value of MAS to UMAC
- *
- * Return: Configuration message posting status, SUCCESS or Fail
- *
- */
-int32_t cds_set_mas(hdd_adapter_t *adapter, uint8_t mas_value)
-{
-	hdd_context_t *hdd_ctx = NULL;
-	CDF_STATUS ret_status;
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (!hdd_ctx)
-		return -EFAULT;
-
-	if (mas_value) {
-		/* Miracast is ON. Disable MAS and configure P2P quota */
-		if (hdd_ctx->config->enableMCCAdaptiveScheduler) {
-			if (cfg_set_int(hdd_ctx->hHal,
-					WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, 0)
-					!= eSIR_SUCCESS) {
-				cds_err("Could not pass on WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED to CCM");
-			}
-			ret_status = sme_set_mas(false);
-			if (CDF_STATUS_SUCCESS != ret_status) {
-				cds_err("Failed to disable MAS");
-				return -EBUSY;
-			}
-		}
-
-		/* Config p2p quota */
-		if (adapter->device_mode == WLAN_HDD_INFRA_STATION)
-			cds_set_mcc_p2p_quota(adapter,
-					100 - HDD_DEFAULT_MCC_P2P_QUOTA);
-		else if (adapter->device_mode == WLAN_HDD_P2P_GO)
-			cds_go_set_mcc_p2p_quota(adapter,
-					HDD_DEFAULT_MCC_P2P_QUOTA);
-		else
-			cds_set_mcc_p2p_quota(adapter,
-					HDD_DEFAULT_MCC_P2P_QUOTA);
-	} else {
-		/* Reset p2p quota */
-		if (adapter->device_mode == WLAN_HDD_P2P_GO)
-			cds_go_set_mcc_p2p_quota(adapter,
-					HDD_RESET_MCC_P2P_QUOTA);
-		else
-			cds_set_mcc_p2p_quota(adapter,
-					HDD_RESET_MCC_P2P_QUOTA);
-
-		/* Miracast is OFF. Enable MAS and reset P2P quota */
-		if (hdd_ctx->config->enableMCCAdaptiveScheduler) {
-			if (cfg_set_int(hdd_ctx->hHal,
-					WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED, 1)
-					!= eSIR_SUCCESS) {
-				cds_err("Could not pass on WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED to CCM");
-			}
-
-			/* Enable MAS */
-			ret_status = sme_set_mas(true);
-			if (CDF_STATUS_SUCCESS != ret_status) {
-				cds_err("Unable to enable MAS");
-				return -EBUSY;
-			}
-		}
-	}
-
-	return 0;
-}
-
-/**
- * cds_set_mcc_p2p_quota() - Function to set quota for P2P
- * @hostapd_adapter:    Pointer to HDD adapter
- * @set_value:          Qouta value for the interface
- *
- * This function is used to set the quota for P2P cases
- *
- * Return: Configuration message posting status, SUCCESS or Fail
- *
- */
-int32_t cds_set_mcc_p2p_quota(hdd_adapter_t *hostapd_adapater,
-		uint32_t set_value)
-{
-	uint8_t first_adapter_operating_channel = 0;
-	uint8_t second_adapter_opertaing_channel = 0;
-	hdd_adapter_t *sta_adapter = NULL;
-	int32_t ret = 0; /* success */
-
-	uint32_t concurrent_state = cds_get_concurrency_mode();
-
-	/*
-	 * Check if concurrency mode is active.
-	 * Need to modify this code to support MCC modes other than STA/P2P
-	 */
-	if ((concurrent_state == (CDF_STA_MASK | CDF_P2P_CLIENT_MASK)) ||
-		(concurrent_state == (CDF_STA_MASK | CDF_P2P_GO_MASK))) {
-		cds_info("STA & P2P are both enabled");
-		/*
-		 * The channel numbers for both adapters and the time
-		 * quota for the 1st adapter, i.e., one specified in cmd
-		 * are formatted as a bit vector then passed on to WMA
-		 * +***********************************************************+
-		 * |bit 31-24  | bit 23-16  |   bits 15-8   |   bits 7-0       |
-		 * |  Unused   | Quota for  | chan. # for   |   chan. # for    |
-		 * |           | 1st chan.  | 1st chan.     |   2nd chan.      |
-		 * +***********************************************************+
-		 */
-		/* Get the operating channel of the specified vdev */
-		first_adapter_operating_channel =
-			hdd_get_operating_channel
-			(
-			 hostapd_adapater->pHddCtx,
-			 hostapd_adapater->device_mode
-			);
-		cds_info("1st channel No.:%d and quota:%dms",
-			first_adapter_operating_channel, set_value);
-		/* Move the time quota for first channel to bits 15-8 */
-		set_value = set_value << 8;
-		/*
-		 * Store the channel number of 1st channel at bits 7-0
-		 * of the bit vector
-		 */
-		set_value = set_value | first_adapter_operating_channel;
-		/* Find out the 2nd MCC adapter and its operating channel */
-		if (hostapd_adapater->device_mode == WLAN_HDD_INFRA_STATION) {
-			/*
-			 * iwpriv cmd was issued on wlan0;
-			 * get p2p0 vdev channel
-			 */
-			if ((concurrent_state & CDF_P2P_CLIENT_MASK) != 0) {
-				/* The 2nd MCC vdev is P2P client */
-				sta_adapter = hdd_get_adapter(
-						hostapd_adapater->pHddCtx,
-						WLAN_HDD_P2P_CLIENT);
-			} else {
-				/* The 2nd MCC vdev is P2P GO */
-				sta_adapter = hdd_get_adapter(
-						hostapd_adapater->pHddCtx,
-						WLAN_HDD_P2P_GO);
-			}
-		} else {
-			/*
-			 * iwpriv cmd was issued on p2p0;
-			 * get wlan0 vdev channel
-			 */
-			sta_adapter = hdd_get_adapter(hostapd_adapater->pHddCtx,
-					WLAN_HDD_INFRA_STATION);
-		}
-		if (sta_adapter != NULL) {
-			second_adapter_opertaing_channel =
-				hdd_get_operating_channel
-				(
-				 sta_adapter->pHddCtx,
-				 sta_adapter->device_mode
-				);
-			cds_info("2nd vdev channel No. is:%d",
-				second_adapter_opertaing_channel);
-
-			if (second_adapter_opertaing_channel == 0 ||
-					first_adapter_operating_channel == 0) {
-				cds_err("Invalid channel");
-				return -EINVAL;
-			}
-			/*
-			 * Now move the time quota and channel number of the
-			 * 1st adapter to bits 23-16 and bits 15-8 of the bit
-			 * vector, respectively.
-			 */
-			set_value = set_value << 8;
-			/*
-			 * Store the channel number for 2nd MCC vdev at bits
-			 * 7-0 of set_value
-			 */
-			set_value = set_value |
-				second_adapter_opertaing_channel;
-			ret = wma_cli_set_command(hostapd_adapater->sessionId,
-					WMA_VDEV_MCC_SET_TIME_QUOTA,
-					set_value, VDEV_CMD);
-		} else {
-			cds_err("NULL adapter handle. Exit");
-		}
-	} else {
-		cds_info("MCC is not active. Exit w/o setting latency");
-	}
-	return ret;
-}
-
-/**
- * cds_change_mcc_go_beacon_interval() - Change MCC beacon interval
- * @pHostapdAdapter: HDD adapter
- *
- * Updates the beacon parameters of the GO in MCC scenario
- *
- * Return: Success or Failure depending on the overall function behavior
- */
-CDF_STATUS cds_change_mcc_go_beacon_interval(hdd_adapter_t *pHostapdAdapter)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-	void *hHal;
-
-	cds_info("UPDATE Beacon Params");
-
-	if (WLAN_HDD_SOFTAP == pHostapdAdapter->device_mode) {
-		hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-		if (NULL == hHal) {
-			cds_err("Hal ctx is null");
-			return CDF_STATUS_E_FAULT;
-		}
-		cdf_ret_status =
-			sme_change_mcc_beacon_interval(hHal,
-					pHostapdAdapter->
-					sessionId);
-		if (cdf_ret_status == CDF_STATUS_E_FAILURE) {
-			cds_err("Failed to update Beacon Params");
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_go_set_mcc_p2p_quota() - Function to set quota for P2P GO
- * @hostapd_adapter:    Pointer to HDD adapter
- * @set_value:          Qouta value for the interface
- *
- * This function is used to set the quota for P2P GO cases
- *
- * Return: Configuration message posting status, SUCCESS or Fail
- *
- */
-int32_t cds_go_set_mcc_p2p_quota(hdd_adapter_t *hostapd_adapter,
-		uint32_t set_value)
-{
-	uint8_t first_adapter_operating_channel = 0;
-	uint8_t second_adapter_opertaing_channel = 0;
-	uint32_t concurrent_state = 0;
-	hdd_adapter_t *sta_adapter = NULL;
-	int32_t ret = 0; /* success */
-
-	/*
-	 * Check if concurrency mode is active.
-	 * Need to modify this code to support MCC modes other than
-	 * STA/P2P GO
-	 */
-
-	concurrent_state = cds_get_concurrency_mode();
-	if (concurrent_state == (CDF_STA_MASK | CDF_P2P_GO_MASK)) {
-		cds_info("STA & P2P are both enabled");
-
-		/*
-		 * The channel numbers for both adapters and the time
-		 * quota for the 1st adapter, i.e., one specified in cmd
-		 * are formatted as a bit vector then passed on to WMA
-		 * +************************************************+
-		 * |bit 31-24 |bit 23-16  |  bits 15-8  |bits 7-0   |
-		 * |  Unused  |  Quota for| chan. # for |chan. # for|
-		 * |          |  1st chan.| 1st chan.   |2nd chan.  |
-		 * +************************************************+
-		 */
-
-		/* Get the operating channel of the specified vdev */
-		first_adapter_operating_channel =
-			hdd_get_operating_channel(hostapd_adapter->pHddCtx,
-					hostapd_adapter->device_mode);
-
-		cds_info("1st channel No.:%d and quota:%dms",
-			first_adapter_operating_channel, set_value);
-
-		/* Move the time quota for first adapter to bits 15-8 */
-		set_value = set_value << 8;
-		/*
-		 * Store the operating channel number of 1st adapter at
-		 * the lower 8-bits of bit vector.
-		 */
-		set_value = set_value | first_adapter_operating_channel;
-		if (hostapd_adapter->device_mode ==
-				WLAN_HDD_INFRA_STATION) {
-			/* iwpriv cmd issued on wlan0; get p2p0 vdev chan */
-			if ((concurrent_state & CDF_P2P_CLIENT_MASK) != 0) {
-				/* The 2nd MCC vdev is P2P client */
-				sta_adapter = hdd_get_adapter
-					(
-					 hostapd_adapter->pHddCtx,
-					 WLAN_HDD_P2P_CLIENT
-					);
-			} else {
-				/* The 2nd MCC vdev is P2P GO */
-				sta_adapter = hdd_get_adapter
-					(
-					 hostapd_adapter->pHddCtx,
-					 WLAN_HDD_P2P_GO
-					);
-			}
-		} else {
-			/* iwpriv cmd issued on p2p0; get channel for wlan0 */
-			sta_adapter = hdd_get_adapter
-				(
-				 hostapd_adapter->pHddCtx,
-				 WLAN_HDD_INFRA_STATION
-				);
-		}
-		if (sta_adapter != NULL) {
-			second_adapter_opertaing_channel =
-				hdd_get_operating_channel
-				(
-				 sta_adapter->pHddCtx,
-				 sta_adapter->device_mode
-				);
-			cds_info("2nd vdev channel No. is:%d",
-				second_adapter_opertaing_channel);
-
-			if (second_adapter_opertaing_channel == 0 ||
-					first_adapter_operating_channel == 0) {
-				cds_err("Invalid channel");
-				return -EINVAL;
-			}
-
-			/*
-			 * Move the time quota and operating channel number
-			 * for the first adapter to bits 23-16 & bits 15-8
-			 * of set_value vector, respectively.
-			 */
-			set_value = set_value << 8;
-			/*
-			 * Store the channel number for 2nd MCC vdev at bits
-			 * 7-0 of set_value vector as per the bit format above.
-			 */
-			set_value = set_value |
-				second_adapter_opertaing_channel;
-			ret = wma_cli_set_command(hostapd_adapter->sessionId,
-					WMA_VDEV_MCC_SET_TIME_QUOTA,
-					set_value, VDEV_CMD);
-		} else {
-			cds_err("NULL adapter handle. Exit");
-		}
-	} else {
-		cds_info("MCC is not active. Exit w/o setting latency");
-	}
-	return ret;
-}
-
-/**
- * cds_set_mcc_latency() - Set MCC latency
- * @adapter: Pointer to HDD adapter
- * @set_value: Latency value
- *
- * Sets the MCC latency value during STA-P2P concurrency
- *
- * Return: None
- */
-void cds_set_mcc_latency(hdd_adapter_t *adapter, int set_value)
-{
-	uint32_t concurrent_state = 0;
-	uint8_t first_adapter_operating_channel = 0;
-	int ret = 0;            /* success */
-
-	cds_info("iwpriv cmd to set MCC latency with val %dms",
-		set_value);
-	/**
-	 * Check if concurrency mode is active.
-	 * Need to modify this code to support MCC modes other than STA/P2P
-	 */
-	concurrent_state = cds_get_concurrency_mode();
-	if ((concurrent_state == (CDF_STA_MASK | CDF_P2P_CLIENT_MASK)) ||
-		(concurrent_state == (CDF_STA_MASK | CDF_P2P_GO_MASK))) {
-		cds_info("STA & P2P are both enabled");
-		/*
-		 * The channel number and latency are formatted in
-		 * a bit vector then passed on to WMA layer.
-		 * +**********************************************+
-		 * |bits 31-16 |      bits 15-8    |  bits 7-0    |
-		 * |  Unused   | latency - Chan. 1 |  channel no. |
-		 * +**********************************************+
-		 */
-		/* Get the operating channel of the designated vdev */
-		first_adapter_operating_channel =
-			hdd_get_operating_channel
-			(adapter->pHddCtx, adapter->device_mode);
-		/* Move the time latency for the adapter to bits 15-8 */
-		set_value = set_value << 8;
-		/* Store the channel number at bits 7-0 of the bit vector */
-		set_value =
-			set_value | first_adapter_operating_channel;
-		/* Send command to WMA */
-		ret = wma_cli_set_command(adapter->sessionId,
-				WMA_VDEV_MCC_SET_TIME_LATENCY,
-				set_value, VDEV_CMD);
-	} else {
-		cds_info("%s: MCC is not active. Exit w/o setting latency",
-			__func__);
-	}
-}
-
-#if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) || \
-			defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE)
-/**
- * cds_restart_sap() - to restart SAP in driver internally
- * @ap_adapter: Pointer to SAP hdd_adapter_t structure
- *
- * Return: None
- */
-void cds_restart_sap(hdd_adapter_t *ap_adapter)
-{
-	hdd_ap_ctx_t *hdd_ap_ctx;
-	hdd_hostapd_state_t *hostapd_state;
-	CDF_STATUS cdf_status;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
-#ifdef CFG80211_DEL_STA_V2
-	struct tagCsrDelStaParams delStaParams;
-#endif
-	tsap_Config_t *sap_config;
-	void *sap_ctx;
-
-	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	sap_config = &hdd_ap_ctx.sapConfig;
-	sap_ctx = hdd_ap_ctx->sapContext;
-
-	mutex_lock(&hdd_ctx->sap_lock);
-	if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) {
-#ifdef CFG80211_DEL_STA_V2
-		delStaParams.mac = NULL;
-		delStaParams.subtype = SIR_MAC_MGMT_DEAUTH >> 4;
-		delStaParams.reason_code = eCsrForcedDeauthSta;
-		wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy,
-				ap_adapter->dev,
-				&delStaParams);
-#else
-		wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy,
-				ap_adapter->dev, NULL);
-#endif
-		hdd_cleanup_actionframe(hdd_ctx, ap_adapter);
-		hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
-		cdf_event_reset(&hostapd_state->cdf_stop_bss_event);
-		if (CDF_STATUS_SUCCESS == wlansap_stop_bss(sap_ctx)) {
-			cdf_status =
-				cdf_wait_single_event(&hostapd_state->
-						cdf_stop_bss_event,
-						BSS_WAIT_TIMEOUT);
-
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				cds_err("SAP Stop Failed");
-				goto end;
-			}
-		}
-		clear_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags);
-		cds_decr_session_set_pcl(
-			ap_adapter->device_mode, ap_adapter->sessionId);
-		cds_err("SAP Stop Success");
-
-		if (0 != wlan_hdd_cfg80211_update_apies(ap_adapter)) {
-			cds_err("SAP Not able to set AP IEs");
-			wlansap_reset_sap_config_add_ie(sap_config,
-					eUPDATE_IE_ALL);
-			goto end;
-		}
-
-		if (wlansap_start_bss(sap_ctx, hdd_hostapd_sap_event_cb,
-				      sap_config,
-				      ap_adapter->dev) != CDF_STATUS_SUCCESS) {
-			cds_err("SAP Start Bss fail");
-			goto end;
-		}
-
-		cds_info("Waiting for SAP to start");
-		cdf_status =
-			cdf_wait_single_event(&hostapd_state->cdf_event,
-					BSS_WAIT_TIMEOUT);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			cds_err("SAP Start failed");
-			goto end;
-		}
-		cds_err("SAP Start Success");
-		set_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags);
-		cds_incr_active_session(ap_adapter->device_mode,
-					 ap_adapter->sessionId);
-		hostapd_state->bCommit = true;
-	}
-end:
-	mutex_unlock(&hdd_ctx->sap_lock);
-	return;
-}
-#endif
-
-#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
-/**
- * cds_check_and_restart_sap_with_non_dfs_acs() - Restart SAP with non dfs acs
- *
- * Restarts SAP in non-DFS ACS mode when STA-AP mode DFS is not supported
- *
- * Return: None
- */
-void cds_check_and_restart_sap_with_non_dfs_acs(void)
-{
-	hdd_adapter_t *ap_adapter;
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return;
-	}
-
-	if (cds_get_concurrency_mode() != (CDF_STA_MASK | CDF_SAP_MASK)) {
-		cds_info("Concurrency mode is not SAP");
-		return;
-	}
-
-	ap_adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP);
-	if (ap_adapter != NULL &&
-			test_bit(SOFTAP_BSS_STARTED,
-				&ap_adapter->event_flags)
-			&& CDS_IS_DFS_CH(ap_adapter->sessionCtx.ap.
-				operatingChannel)) {
-
-		cds_warn("STA-AP Mode DFS not supported. Restart SAP with Non DFS ACS");
-		ap_adapter->sessionCtx.ap.sapConfig.channel =
-			AUTO_CHANNEL_SELECT;
-		ap_adapter->sessionCtx.ap.sapConfig.
-			acs_cfg.acs_mode = true;
-
-		cds_restart_sap(ap_adapter);
-	}
-}
-#endif
-#ifdef MPC_UT_FRAMEWORK
-CDF_STATUS cds_update_connection_info_utfw(
-		uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams,
-		uint32_t chain_mask, uint32_t type, uint32_t sub_type,
-		uint32_t channelid, uint32_t mac_id)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t conn_index = 0, found = 0;
-	cds_context_type *cds_ctx;
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return status;
-	}
-
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	while (CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-		if (vdev_id == conc_connection_list[conn_index].vdev_id) {
-			/* debug msg */
-			found = 1;
-			break;
-		}
-		conn_index++;
-	}
-	if (!found) {
-		/* err msg */
-		cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-		cds_err("can't find vdev_id %d in conc_connection_list",
-			vdev_id);
-		return status;
-	}
-	cds_info("--> updating entry at index[%d]", conn_index);
-
-	cds_update_conc_list(conn_index,
-			cds_get_mode(type, sub_type),
-			channelid, mac_id, chain_mask, tx_streams,
-			rx_streams, 0, vdev_id, true);
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS cds_incr_connection_count_utfw(
-		uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams,
-		uint32_t chain_mask, uint32_t type, uint32_t sub_type,
-		uint32_t channelid, uint32_t mac_id)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t conn_index = 0;
-	hdd_context_t *hdd_ctx;
-	cds_context_type *cds_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
-		return status;
-	}
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return status;
-	}
-
-	cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-	conn_index = cds_get_connection_count();
-	if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) {
-		/* err msg */
-		cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-		cds_err("exceeded max connection limit %d",
-			MAX_NUMBER_OF_CONC_CONNECTIONS);
-		return status;
-	}
-	cds_info("--> filling entry at index[%d]", conn_index);
-
-	cds_update_conc_list(conn_index,
-			     cds_get_mode(type, sub_type),
-			     channelid, mac_id, chain_mask, tx_streams,
-			     rx_streams, 0, vdev_id, true);
-	cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS cds_decr_connection_count_utfw(uint32_t del_all,
-	uint32_t vdev_id)
-{
-	CDF_STATUS status;
-	cds_context_type *cds_ctx;
-
-	cds_ctx = cds_get_context(CDF_MODULE_ID_CDF);
-	if (!cds_ctx) {
-		cds_err("Invalid CDS Context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (del_all) {
-		status = cds_init_policy_mgr();
-		if (!CDF_IS_STATUS_SUCCESS(status)) {
-			cds_err("Policy manager initialization failed");
-			return CDF_STATUS_E_FAILURE;
-		}
-	} else {
-		cdf_mutex_acquire(&cds_ctx->cdf_conc_list_lock);
-		cds_decr_connection_count(vdev_id);
-		cdf_mutex_release(&cds_ctx->cdf_conc_list_lock);
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len)
-{
-	struct cds_conc_connection_info *conn_ptr = &conc_connection_list[0];
-	*len = MAX_NUMBER_OF_CONC_CONNECTIONS;
-
-	return conn_ptr;
-}
-
-enum cds_pcl_type get_pcl_from_first_conn_table(enum cds_con_mode type,
-		enum cds_conc_priority_mode sys_pref)
-{
-	if ((sys_pref >= CDS_MAX_CONC_PRIORITY_MODE) ||
-		(type >= CDS_MAX_NUM_OF_MODE))
-		return CDS_MAX_PCL_TYPE;
-	return first_connection_pcl_table[type][sys_pref];
-}
-
-enum cds_pcl_type get_pcl_from_second_conn_table(
-	enum cds_one_connection_mode idx, enum cds_con_mode type,
-	enum cds_conc_priority_mode sys_pref, uint8_t dbs_capable)
-{
-	if ((idx >= CDS_MAX_ONE_CONNECTION_MODE) ||
-		(sys_pref >= CDS_MAX_CONC_PRIORITY_MODE) ||
-		(type >= CDS_MAX_NUM_OF_MODE))
-		return CDS_MAX_PCL_TYPE;
-	if (dbs_capable)
-		return second_connection_pcl_dbs_table[idx][type][sys_pref];
-	else
-		return second_connection_pcl_nodbs_table[idx][type][sys_pref];
-}
-
-enum cds_pcl_type get_pcl_from_third_conn_table(
-	enum cds_two_connection_mode idx, enum cds_con_mode type,
-	enum cds_conc_priority_mode sys_pref, uint8_t dbs_capable)
-{
-	if ((idx >= CDS_MAX_TWO_CONNECTION_MODE) ||
-		(sys_pref >= CDS_MAX_CONC_PRIORITY_MODE) ||
-		(type >= CDS_MAX_NUM_OF_MODE))
-		return CDS_MAX_PCL_TYPE;
-	if (dbs_capable)
-		return third_connection_pcl_dbs_table[idx][type][sys_pref];
-	else
-		return third_connection_pcl_nodbs_table[idx][type][sys_pref];
-}
-#endif
-
-/**
- * cds_convert_device_mode_to_hdd_type() - provides the
- * type translation from HDD to policy manager type
- * @device_mode: Generic connection mode type
- *
- *
- * This function provides the type translation
- *
- * Return: cds_con_mode enum
- */
-enum cds_con_mode cds_convert_device_mode_to_hdd_type(
-					device_mode_t device_mode)
-{
-	enum cds_con_mode mode = CDS_MAX_NUM_OF_MODE;
-	switch (device_mode) {
-	case WLAN_HDD_INFRA_STATION:
-		mode = CDS_STA_MODE;
-		break;
-	case WLAN_HDD_P2P_CLIENT:
-		mode = CDS_P2P_CLIENT_MODE;
-		break;
-	case WLAN_HDD_P2P_GO:
-		mode = CDS_P2P_GO_MODE;
-		break;
-	case WLAN_HDD_SOFTAP:
-		mode = CDS_SAP_MODE;
-		break;
-	case WLAN_HDD_IBSS:
-		mode = CDS_IBSS_MODE;
-		break;
-	default:
-		cds_err("Unsupported mode (%d)",
-			device_mode);
-	}
-	return mode;
-}
-
-/**
- * cds_get_conparam() - Get the connection mode parameters
- *
- * Return the connection mode parameter set by insmod or set during statically
- * linked driver
- *
- * Return: enum tCDF_GLOBAL_CON_MODE
- */
-enum tCDF_GLOBAL_CON_MODE cds_get_conparam(void)
-{
-	enum tCDF_GLOBAL_CON_MODE con_mode;
-	con_mode = hdd_get_conparam();
-	return con_mode;
-}
-
-/**
- * cds_concurrent_open_sessions_running() - Checks for concurrent open session
- *
- * Checks if more than one open session is running for all the allowed modes
- * in the driver
- *
- * Return: True if more than one open session exists, False otherwise
- */
-bool cds_concurrent_open_sessions_running(void)
-{
-	uint8_t i = 0;
-	uint8_t j = 0;
-	hdd_context_t *pHddCtx;
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL != pHddCtx) {
-		for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
-			j += pHddCtx->no_of_open_sessions[i];
-	}
-
-	return j > 1;
-}
-
-/**
- * cds_concurrent_beaconing_sessions_running() - Checks for concurrent beaconing
- * entities
- *
- * Checks if multiple beaconing sessions are running i.e., if SAP or GO or IBSS
- * are beaconing together
- *
- * Return: True if multiple entities are beaconing together, False otherwise
- */
-bool cds_concurrent_beaconing_sessions_running(void)
-{
-	uint8_t i = 0;
-	hdd_context_t *pHddCtx;
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL != pHddCtx) {
-		i = pHddCtx->no_of_open_sessions[CDF_SAP_MODE] +
-			pHddCtx->no_of_open_sessions[CDF_P2P_GO_MODE] +
-			pHddCtx->no_of_open_sessions[CDF_IBSS_MODE];
-	}
-	return i > 1;
-}
-
-
-/**
- * cds_max_concurrent_connections_reached() - Check if max conccurrency is
- * reached
- *
- * Checks for presence of concurrency where more than one connection exists
- *
- * Return: True if the max concurrency is reached, False otherwise
- *
- * Example:
- *    STA + STA (wlan0 and wlan1 are connected) - returns true
- *    STA + STA (wlan0 connected and wlan1 disconnected) - returns false
- *    DUT with P2P-GO + P2P-CLIENT connection) - returns true
- *
- */
-bool cds_max_concurrent_connections_reached(void)
-{
-	uint8_t i = 0, j = 0;
-	hdd_context_t *pHddCtx;
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL != pHddCtx) {
-		for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
-			j += pHddCtx->no_of_active_sessions[i];
-		return j >
-			(pHddCtx->config->
-			 gMaxConcurrentActiveSessions - 1);
-	}
-
-	return false;
-}
-
-/**
- * cds_clear_concurrent_session_count() - Clear active session count
- *
- * Clears the active session count for all modes
- *
- * Return: None
- */
-void cds_clear_concurrent_session_count(void)
-{
-	uint8_t i = 0;
-	hdd_context_t *pHddCtx;
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL != pHddCtx) {
-		for (i = 0; i < CDF_MAX_NO_OF_MODE; i++)
-			pHddCtx->no_of_active_sessions[i] = 0;
-	}
-}
-
-/**
- * cds_is_multiple_active_sta_sessions() - Check for multiple STA connections
- *
- * Checks if multiple active STA connection are in the driver
- *
- * Return: True if multiple STA sessions are present, False otherwise
- *
- */
-bool cds_is_multiple_active_sta_sessions(void)
-{
-	hdd_context_t *pHddCtx;
-	uint8_t j = 0;
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL != pHddCtx)
-		j = pHddCtx->no_of_active_sessions[CDF_STA_MODE];
-
-	return j > 1;
-}
-
-/**
- * cds_is_sta_active_connection_exists() - Check if a STA connection is active
- *
- * Checks if there is atleast one active STA connection in the driver
- *
- * Return: True if an active STA session is present, False otherwise
- */
-bool cds_is_sta_active_connection_exists(void)
-{
-	hdd_context_t *pHddCtx;
-	uint8_t j = 0;
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL != pHddCtx)
-		j = pHddCtx->no_of_active_sessions[CDF_STA_MODE];
-
-	return j ? true : false;
-}
-
-/**
- * cdf_wait_for_connection_update() - Wait for hw mode command to get processed
- *
- * Waits for CONNECTION_UPDATE_TIMEOUT duration until the set hw mode
- * response sets the event connection_update_done_evt
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cdf_wait_for_connection_update(void)
-{
-	CDF_STATUS status;
-	p_cds_contextType cds_context;
-
-	cds_context = cds_get_global_context();
-	if (!cds_context) {
-		cds_err("Invalid CDS context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	status = cdf_wait_single_event(
-			&cds_context->connection_update_done_evt,
-			CONNECTION_UPDATE_TIMEOUT);
-
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		cds_err("wait for event failed");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cdf_reset_connection_update() - Reset connection update event
- *
- * Resets the concurrent connection update event
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cdf_reset_connection_update(void)
-{
-	CDF_STATUS status;
-	p_cds_contextType cds_context;
-
-	cds_context = cds_get_global_context();
-	if (!cds_context) {
-		cds_err("Invalid CDS context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	status = cdf_event_reset(&cds_context->connection_update_done_evt);
-
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		cds_err("clear event failed");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cdf_set_connection_update() - Set connection update event
- *
- * Sets the concurrent connection update event
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cdf_set_connection_update(void)
-{
-	CDF_STATUS status;
-	p_cds_contextType cds_context;
-
-	cds_context = cds_get_global_context();
-	if (!cds_context) {
-		cds_err("Invalid CDS context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	status = cdf_event_set(&cds_context->connection_update_done_evt);
-
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		cds_err("set event failed");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cdf_init_connection_update() - Initialize connection update event
- *
- * Initializes the concurrent connection update event
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cdf_init_connection_update(void)
-{
-	CDF_STATUS status;
-	p_cds_contextType cds_context;
-
-	cds_context = cds_get_global_context();
-	if (!cds_context) {
-		cds_err("Invalid CDS context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	status = cdf_event_init(&cds_context->connection_update_done_evt);
-
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		cds_err("init event failed");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}

+ 0 - 545
core/cds/src/cds_ieee80211_common_i.h

@@ -1,545 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef CDS_COMMON__IEEE80211_I_H_
-#define CDS_COMMON__IEEE80211_I_H_
-
-/* These defines should match the table from ah_internal.h */
-typedef enum {
-	DFS_UNINIT_DOMAIN = 0,  /* Uninitialized dfs domain */
-	DFS_FCC_DOMAIN = 1,     /* FCC3 dfs domain */
-	DFS_ETSI_DOMAIN = 2,    /* ETSI dfs domain */
-	DFS_MKK4_DOMAIN = 3     /* Japan dfs domain */
-} HAL_DFS_DOMAIN;
-
-/* XXX not really a mode; there are really multiple PHY's */
-enum ieee80211_phymode {
-	IEEE80211_MODE_AUTO = 0,        /* autoselect */
-	IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */
-	IEEE80211_MODE_11B = 2, /* 2GHz, CCK */
-	IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */
-	IEEE80211_MODE_FH = 4,  /* 2GHz, GFSK */
-	IEEE80211_MODE_TURBO_A = 5,     /* 5GHz, OFDM, 2x clock dynamic turbo */
-	IEEE80211_MODE_TURBO_G = 6,     /* 2GHz, OFDM, 2x clock dynamic turbo */
-	IEEE80211_MODE_11NA_HT20 = 7,   /* 5Ghz, HT20 */
-	IEEE80211_MODE_11NG_HT20 = 8,   /* 2Ghz, HT20 */
-	IEEE80211_MODE_11NA_HT40PLUS = 9,       /* 5Ghz, HT40 (ext ch +1) */
-	IEEE80211_MODE_11NA_HT40MINUS = 10,     /* 5Ghz, HT40 (ext ch -1) */
-	IEEE80211_MODE_11NG_HT40PLUS = 11,      /* 2Ghz, HT40 (ext ch +1) */
-	IEEE80211_MODE_11NG_HT40MINUS = 12,     /* 2Ghz, HT40 (ext ch -1) */
-	IEEE80211_MODE_11NG_HT40 = 13,  /* 2Ghz, Auto HT40 */
-	IEEE80211_MODE_11NA_HT40 = 14,  /* 2Ghz, Auto HT40 */
-	IEEE80211_MODE_11AC_VHT20 = 15, /* 5Ghz, VHT20 */
-	IEEE80211_MODE_11AC_VHT40PLUS = 16,     /* 5Ghz, VHT40 (Ext ch +1) */
-	IEEE80211_MODE_11AC_VHT40MINUS = 17,    /* 5Ghz  VHT40 (Ext ch -1) */
-	IEEE80211_MODE_11AC_VHT40 = 18, /* 5Ghz, VHT40 */
-	IEEE80211_MODE_11AC_VHT80 = 19, /* 5Ghz, VHT80 */
-	IEEE80211_MODE_2G_AUTO = 20,    /* 2G 11 b/g/n  autoselect */
-	IEEE80211_MODE_5G_AUTO = 21,    /* 5G 11 a/n/ac autoselect */
-	IEEE80211_MODE_11AGN = 22,   /* Support 11N in both 2G and 5G */
-};
-#define IEEE80211_MODE_MAX      (IEEE80211_MODE_11AC_VHT80 + 1)
-
-enum ieee80211_opmode {
-	IEEE80211_M_STA = 1,    /* infrastructure station */
-	IEEE80211_M_IBSS = 0,   /* IBSS (adhoc) station */
-	IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */
-	IEEE80211_M_HOSTAP = 6, /* Software Access Point */
-	IEEE80211_M_MONITOR = 8,        /* Monitor mode */
-	IEEE80211_M_WDS = 2,    /* WDS link */
-	IEEE80211_M_BTAMP = 9,  /* VAP for BT AMP */
-
-	IEEE80211_M_P2P_GO = 33,        /* P2P GO */
-	IEEE80211_M_P2P_CLIENT = 34,    /* P2P Client */
-	IEEE80211_M_P2P_DEVICE = 35,    /* P2P Device */
-
-	IEEE80211_OPMODE_MAX = IEEE80211_M_BTAMP,       /* Highest numbered opmode in the list */
-
-	IEEE80211_M_ANY = 0xFF  /* Any of the above; used by NDIS 6.x */
-};
-
-/*
- * 802.11n
- */
-#define IEEE80211_CWM_EXTCH_BUSY_THRESHOLD 30
-
-enum ieee80211_cwm_mode {
-	IEEE80211_CWM_MODE20,
-	IEEE80211_CWM_MODE2040,
-	IEEE80211_CWM_MODE40,
-	IEEE80211_CWM_MODEMAX
-};
-
-enum ieee80211_cwm_extprotspacing {
-	IEEE80211_CWM_EXTPROTSPACING20,
-	IEEE80211_CWM_EXTPROTSPACING25,
-	IEEE80211_CWM_EXTPROTSPACINGMAX
-};
-
-enum ieee80211_cwm_width {
-	IEEE80211_CWM_WIDTH20,
-	IEEE80211_CWM_WIDTH40,
-	IEEE80211_CWM_WIDTH80,
-	IEEE80211_CWM_WIDTHINVALID = 0xff       /* user invalid value */
-};
-
-enum ieee80211_cwm_extprotmode {
-	IEEE80211_CWM_EXTPROTNONE,      /* no protection */
-	IEEE80211_CWM_EXTPROTCTSONLY,   /* CTS to self */
-	IEEE80211_CWM_EXTPROTRTSCTS,    /* RTS-CTS */
-	IEEE80211_CWM_EXTPROTMAX
-};
-
-enum ieee80211_fixed_rate_mode {
-	IEEE80211_FIXED_RATE_NONE = 0,
-	IEEE80211_FIXED_RATE_MCS = 1,   /* HT rates */
-	IEEE80211_FIXED_RATE_LEGACY = 2,        /* legacy rates */
-	IEEE80211_FIXED_RATE_VHT = 3    /* VHT rates */
-};
-
-/* Holds the fixed rate information for each VAP */
-struct ieee80211_fixed_rate {
-	enum ieee80211_fixed_rate_mode mode;
-	uint32_t series;
-	uint32_t retries;
-};
-
-/*
- * 802.11g protection mode.
- */
-enum ieee80211_protmode {
-	IEEE80211_PROT_NONE = 0,        /* no protection */
-	IEEE80211_PROT_CTSONLY = 1,     /* CTS to self */
-	IEEE80211_PROT_RTSCTS = 2,      /* RTS-CTS */
-};
-
-/*
- * Roaming mode is effectively who controls the operation
- * of the 802.11 state machine when operating as a station.
- * State transitions are controlled either by the driver
- * (typically when management frames are processed by the
- * hardware/firmware), the host (auto/normal operation of
- * the 802.11 layer), or explicitly through ioctl requests
- * when applications like wpa_supplicant want control.
- */
-enum ieee80211_roamingmode {
-	IEEE80211_ROAMING_DEVICE = 0,   /* driver/hardware control */
-	IEEE80211_ROAMING_AUTO = 1,     /* 802.11 layer control */
-	IEEE80211_ROAMING_MANUAL = 2,   /* application control */
-};
-
-/*
- * Scanning mode controls station scanning work; this is
- * used only when roaming mode permits the host to select
- * the bss to join/channel to use.
- */
-enum ieee80211_scanmode {
-	IEEE80211_SCAN_DEVICE = 0,      /* driver/hardware control */
-	IEEE80211_SCAN_BEST = 1,        /* 802.11 layer selects best */
-	IEEE80211_SCAN_FIRST = 2,       /* take first suitable candidate */
-};
-
-#define IEEE80211_NWID_LEN      32
-#define IEEE80211_CHAN_MAX      255
-#define IEEE80211_CHAN_BYTES    32      /* howmany(IEEE80211_CHAN_MAX, NBBY) */
-#define IEEE80211_CHAN_ANY      (-1)    /* token for ``any channel'' */
-#define IEEE80211_CHAN_ANYC \
-	((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
-
-#define IEEE80211_CHAN_DEFAULT          11
-#define IEEE80211_CHAN_DEFAULT_11A      52
-#define IEEE80211_CHAN_ADHOC_DEFAULT1   10
-#define IEEE80211_CHAN_ADHOC_DEFAULT2   11
-
-#define IEEE80211_RADAR_11HCOUNT        5
-#define IEEE80211_RADAR_TEST_MUTE_CHAN_11A      36      /* Move to channel 36 for mute test */
-#define IEEE80211_RADAR_TEST_MUTE_CHAN_11NHT20  36
-#define IEEE80211_RADAR_TEST_MUTE_CHAN_11NHT40U 36
-#define IEEE80211_RADAR_TEST_MUTE_CHAN_11NHT40D 40      /* Move to channel 40 for HT40D mute test */
-#define IEEE80211_RADAR_DETECT_DEFAULT_DELAY    60000   /* STA ignore AP beacons during this period in millisecond */
-
-#define IEEE80211_2GCSA_TBTTCOUNT        3
-
-/* bits 0-3 are for private use by drivers */
-/* channel attributes */
-#define IEEE80211_CHAN_TURBO            0x00000010      /* Turbo channel */
-#define IEEE80211_CHAN_CCK              0x00000020      /* CCK channel */
-#define IEEE80211_CHAN_OFDM             0x00000040      /* OFDM channel */
-#define IEEE80211_CHAN_2GHZ             0x00000080      /* 2 GHz spectrum channel. */
-#define IEEE80211_CHAN_5GHZ             0x00000100      /* 5 GHz spectrum channel */
-#define IEEE80211_CHAN_PASSIVE          0x00000200      /* Only passive scan allowed */
-#define IEEE80211_CHAN_DYN              0x00000400      /* Dynamic CCK-OFDM channel */
-#define IEEE80211_CHAN_GFSK             0x00000800      /* GFSK channel (FHSS PHY) */
-#define IEEE80211_CHAN_RADAR_DFS        0x00001000      /* Radar found on channel */
-#define IEEE80211_CHAN_STURBO           0x00002000      /* 11a static turbo channel only */
-#define IEEE80211_CHAN_HALF             0x00004000      /* Half rate channel */
-#define IEEE80211_CHAN_QUARTER          0x00008000      /* Quarter rate channel */
-#define IEEE80211_CHAN_HT20             0x00010000      /* HT 20 channel */
-#define IEEE80211_CHAN_HT40PLUS         0x00020000      /* HT 40 with extension channel above */
-#define IEEE80211_CHAN_HT40MINUS        0x00040000      /* HT 40 with extension channel below */
-#define IEEE80211_CHAN_HT40INTOL        0x00080000      /* HT 40 Intolerant */
-#define IEEE80211_CHAN_VHT20            0x00100000      /* VHT 20 channel */
-#define IEEE80211_CHAN_VHT40PLUS        0x00200000      /* VHT 40 with extension channel above */
-#define IEEE80211_CHAN_VHT40MINUS       0x00400000      /* VHT 40 with extension channel below */
-#define IEEE80211_CHAN_VHT80            0x00800000      /* VHT 80 channel */
-
-/* flagext */
-#define IEEE80211_CHAN_RADAR_FOUND    0x01
-#define IEEE80211_CHAN_DFS              0x0002  /* DFS required on channel */
-#define IEEE80211_CHAN_DFS_CLEAR        0x0008  /* if channel has been checked for DFS */
-#define IEEE80211_CHAN_11D_EXCLUDED     0x0010  /* excluded in 11D */
-#define IEEE80211_CHAN_CSA_RECEIVED     0x0020  /* Channel Switch Announcement received on this channel */
-#define IEEE80211_CHAN_DISALLOW_ADHOC   0x0040  /* ad-hoc is not allowed */
-#define IEEE80211_CHAN_DISALLOW_HOSTAP  0x0080  /* Station only channel */
-
-/*
- * Useful combinations of channel characteristics.
- */
-#define IEEE80211_CHAN_FHSS \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
-#define IEEE80211_CHAN_A \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
-#define IEEE80211_CHAN_B \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
-#define IEEE80211_CHAN_PUREG \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
-#define IEEE80211_CHAN_G \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
-#define IEEE80211_CHAN_108A \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
-#define IEEE80211_CHAN_108G \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
-#define IEEE80211_CHAN_ST \
-	(IEEE80211_CHAN_108A | IEEE80211_CHAN_STURBO)
-
-#define IEEE80211_IS_CHAN_11AC_2G(_c) \
-	(IEEE80211_IS_CHAN_2GHZ((_c)) && IEEE80211_IS_CHAN_VHT((_c)))
-#define IEEE80211_CHAN_11AC_VHT20_2G \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_VHT20)
-#define IEEE80211_CHAN_11AC_VHT40_2G \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_VHT40PLUS | IEEE80211_CHAN_VHT40MINUS)
-#define IEEE80211_CHAN_11AC_VHT80_2G \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_VHT80)
-
-#define IEEE80211_IS_CHAN_11AC_VHT20_2G(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT20_2G) == IEEE80211_CHAN_11AC_VHT20_2G)
-#define IEEE80211_IS_CHAN_11AC_VHT40_2G(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT40_2G) != 0)
-#define IEEE80211_IS_CHAN_11AC_VHT80_2G(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT80_2G) == IEEE80211_CHAN_11AC_VHT80_2G)
-
-#define IEEE80211_CHAN_11NG_HT20 \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HT20)
-#define IEEE80211_CHAN_11NA_HT20 \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HT20)
-#define IEEE80211_CHAN_11NG_HT40PLUS \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HT40PLUS)
-#define IEEE80211_CHAN_11NG_HT40MINUS \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_HT40MINUS)
-#define IEEE80211_CHAN_11NA_HT40PLUS \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HT40PLUS)
-#define IEEE80211_CHAN_11NA_HT40MINUS \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_HT40MINUS)
-
-#define IEEE80211_CHAN_ALL \
-	(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \
-	 IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \
-	 IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40PLUS | IEEE80211_CHAN_HT40MINUS | \
-	 IEEE80211_CHAN_VHT20 | IEEE80211_CHAN_VHT40PLUS | IEEE80211_CHAN_VHT40MINUS | IEEE80211_CHAN_VHT80 | \
-	 IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER)
-#define IEEE80211_CHAN_ALLTURBO	\
-	(IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)
-
-#define IEEE80211_IS_CHAN_FHSS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
-#define IEEE80211_IS_CHAN_A(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
-#define IEEE80211_IS_CHAN_B(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
-#define IEEE80211_IS_CHAN_PUREG(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
-#define IEEE80211_IS_CHAN_G(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
-#define IEEE80211_IS_CHAN_ANYG(_c) \
-	(IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c))
-#define IEEE80211_IS_CHAN_ST(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_ST) == IEEE80211_CHAN_ST)
-#define IEEE80211_IS_CHAN_108A(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_108A) == IEEE80211_CHAN_108A)
-#define IEEE80211_IS_CHAN_108G(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G)
-
-#define IEEE80211_IS_CHAN_2GHZ(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0)
-#define IEEE80211_IS_CHAN_5GHZ(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0)
-#define IEEE80211_IS_CHAN_OFDM(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0)
-#define IEEE80211_IS_CHAN_CCK(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0)
-#define IEEE80211_IS_CHAN_GFSK(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0)
-#define IEEE80211_IS_CHAN_TURBO(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_TURBO) != 0)
-#define IEEE80211_IS_CHAN_WEATHER_RADAR(_c) \
-	((((_c)->ic_freq >= 5600) && ((_c)->ic_freq <= 5650)) \
-	 || (((_c)->ic_flags & IEEE80211_CHAN_HT40PLUS) && (5580 == (_c)->ic_freq)))
-#define IEEE80211_IS_CHAN_STURBO(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_STURBO) != 0)
-#define IEEE80211_IS_CHAN_DTURBO(_c) \
-	(((_c)->ic_flags & \
-	  (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO)) == IEEE80211_CHAN_TURBO)
-#define IEEE80211_IS_CHAN_HALF(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_HALF) != 0)
-#define IEEE80211_IS_CHAN_QUARTER(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_QUARTER) != 0)
-#define IEEE80211_IS_CHAN_PASSIVE(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_PASSIVE) != 0)
-
-#define IEEE80211_IS_CHAN_DFS(_c) \
-	(((_c)->ic_flagext & (IEEE80211_CHAN_DFS|IEEE80211_CHAN_DFS_CLEAR)) == IEEE80211_CHAN_DFS)
-#define IEEE80211_IS_CHAN_DFSFLAG(_c) \
-	(((_c)->ic_flagext & IEEE80211_CHAN_DFS) == IEEE80211_CHAN_DFS)
-#define IEEE80211_IS_CHAN_DISALLOW_ADHOC(_c) \
-	(((_c)->ic_flagext & IEEE80211_CHAN_DISALLOW_ADHOC) != 0)
-#define IEEE80211_IS_CHAN_11D_EXCLUDED(_c) \
-	(((_c)->ic_flagext & IEEE80211_CHAN_11D_EXCLUDED) != 0)
-#define IEEE80211_IS_CHAN_CSA(_c) \
-	(((_c)->ic_flagext & IEEE80211_CHAN_CSA_RECEIVED) != 0)
-#define IEEE80211_IS_CHAN_ODD(_c) \
-	(((_c)->ic_freq == 5170) || ((_c)->ic_freq == 5190) || \
-	 ((_c)->ic_freq == 5210) || ((_c)->ic_freq == 5230))
-#define IEEE80211_IS_CHAN_DISALLOW_HOSTAP(_c) \
-	(((_c)->ic_flagext & IEEE80211_CHAN_DISALLOW_HOSTAP) != 0)
-
-#define IEEE80211_IS_CHAN_11NG_HT20(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_11NG_HT20) == IEEE80211_CHAN_11NG_HT20)
-#define IEEE80211_IS_CHAN_11NA_HT20(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_11NA_HT20) == IEEE80211_CHAN_11NA_HT20)
-#define IEEE80211_IS_CHAN_11NG_HT40PLUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11NG_HT40PLUS) == IEEE80211_CHAN_11NG_HT40PLUS)
-#define IEEE80211_IS_CHAN_11NG_HT40MINUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11NG_HT40MINUS) == IEEE80211_CHAN_11NG_HT40MINUS)
-#define IEEE80211_IS_CHAN_11NA_HT40PLUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11NA_HT40PLUS) == IEEE80211_CHAN_11NA_HT40PLUS)
-#define IEEE80211_IS_CHAN_11NA_HT40MINUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11NA_HT40MINUS) == IEEE80211_CHAN_11NA_HT40MINUS)
-
-#define IEEE80211_IS_CHAN_11N(_c) \
-	(((_c)->ic_flags & (IEEE80211_CHAN_HT20 | IEEE80211_CHAN_HT40PLUS | IEEE80211_CHAN_HT40MINUS)) != 0)
-#define IEEE80211_IS_CHAN_11N_HT20(_c) \
-	(((_c)->ic_flags & (IEEE80211_CHAN_HT20)) != 0)
-#define IEEE80211_IS_CHAN_11N_HT40(_c) \
-	(((_c)->ic_flags & (IEEE80211_CHAN_HT40PLUS | IEEE80211_CHAN_HT40MINUS)) != 0)
-#define IEEE80211_IS_CHAN_11NG(_c) \
-	(IEEE80211_IS_CHAN_2GHZ((_c)) && IEEE80211_IS_CHAN_11N((_c)))
-#define IEEE80211_IS_CHAN_11NA(_c) \
-	(IEEE80211_IS_CHAN_5GHZ((_c)) && IEEE80211_IS_CHAN_11N((_c)))
-#define IEEE80211_IS_CHAN_11N_HT40PLUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40PLUS) != 0)
-#define IEEE80211_IS_CHAN_11N_HT40MINUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40MINUS) != 0)
-
-#define IEEE80211_IS_CHAN_HT20_CAPABLE(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_HT20) == IEEE80211_CHAN_HT20)
-#define IEEE80211_IS_CHAN_HT40PLUS_CAPABLE(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40PLUS) == IEEE80211_CHAN_HT40PLUS)
-#define IEEE80211_IS_CHAN_HT40MINUS_CAPABLE(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40MINUS) == IEEE80211_CHAN_HT40MINUS)
-#define IEEE80211_IS_CHAN_HT40_CAPABLE(_c) \
-	(IEEE80211_IS_CHAN_HT40PLUS_CAPABLE(_c) || IEEE80211_IS_CHAN_HT40MINUS_CAPABLE(_c))
-#define IEEE80211_IS_CHAN_HT_CAPABLE(_c) \
-	(IEEE80211_IS_CHAN_HT20_CAPABLE(_c) || IEEE80211_IS_CHAN_HT40_CAPABLE(_c))
-#define IEEE80211_IS_CHAN_11N_CTL_CAPABLE(_c)  IEEE80211_IS_CHAN_HT20_CAPABLE(_c)
-#define IEEE80211_IS_CHAN_11N_CTL_U_CAPABLE(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40PLUS) == IEEE80211_CHAN_HT40PLUS)
-#define IEEE80211_IS_CHAN_11N_CTL_L_CAPABLE(_c)	\
-	(((_c)->ic_flags & IEEE80211_CHAN_HT40MINUS) == IEEE80211_CHAN_HT40MINUS)
-#define IEEE80211_IS_CHAN_11N_CTL_40_CAPABLE(_c) \
-	(IEEE80211_IS_CHAN_11N_CTL_U_CAPABLE((_c)) || IEEE80211_IS_CHAN_11N_CTL_L_CAPABLE((_c)))
-
-#define IEEE80211_IS_CHAN_VHT(_c) \
-	(((_c)->ic_flags & (IEEE80211_CHAN_VHT20 | \
-			    IEEE80211_CHAN_VHT40PLUS | IEEE80211_CHAN_VHT40MINUS | IEEE80211_CHAN_VHT80)) != 0)
-#define IEEE80211_IS_CHAN_11AC(_c) \
-	( IEEE80211_IS_CHAN_5GHZ((_c)) && IEEE80211_IS_CHAN_VHT((_c)) )
-#define IEEE80211_CHAN_11AC_VHT20 \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT20)
-#define IEEE80211_CHAN_11AC_VHT40 \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT40PLUS | IEEE80211_CHAN_VHT40MINUS )
-#define IEEE80211_CHAN_11AC_VHT40PLUS \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT40PLUS)
-#define IEEE80211_CHAN_11AC_VHT40MINUS \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT40MINUS)
-#define IEEE80211_CHAN_11AC_VHT80 \
-	(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_VHT80)
-#define IEEE80211_IS_CHAN_11AC_VHT20(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT20) == IEEE80211_CHAN_11AC_VHT20)
-
-#define IEEE80211_IS_CHAN_11AC_VHT40(_c) \
-	(((_c)->ic_flags & (IEEE80211_CHAN_VHT40PLUS | IEEE80211_CHAN_VHT40MINUS)) !=0)
-#define IEEE80211_IS_CHAN_11AC_VHT40PLUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT40PLUS) == IEEE80211_CHAN_11AC_VHT40PLUS)
-#define IEEE80211_IS_CHAN_11AC_VHT40MINUS(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT40MINUS) == IEEE80211_CHAN_11AC_VHT40MINUS)
-#define IEEE80211_IS_CHAN_11AC_VHT80(_c) \
-	(((_c)->ic_flags & IEEE80211_CHAN_11AC_VHT80) == IEEE80211_CHAN_11AC_VHT80)
-
-#define IEEE80211_IS_CHAN_RADAR(_c)    \
-	(((_c)->ic_flags & IEEE80211_CHAN_RADAR_DFS) == IEEE80211_CHAN_RADAR_DFS)
-#define IEEE80211_CHAN_SET_RADAR(_c)	\
-	((_c)->ic_flags |= IEEE80211_CHAN_RADAR_DFS)
-#define IEEE80211_CHAN_CLR_RADAR(_c)	\
-	((_c)->ic_flags &= ~IEEE80211_CHAN_RADAR_DFS)
-#define IEEE80211_CHAN_SET_DISALLOW_ADHOC(_c)	\
-	((_c)->ic_flagext |= IEEE80211_CHAN_DISALLOW_ADHOC)
-#define IEEE80211_CHAN_SET_DISALLOW_HOSTAP(_c)	 \
-	((_c)->ic_flagext |= IEEE80211_CHAN_DISALLOW_HOSTAP)
-#define IEEE80211_CHAN_SET_DFS(_c)  \
-	((_c)->ic_flagext |= IEEE80211_CHAN_DFS)
-#define IEEE80211_CHAN_SET_DFS_CLEAR(_c)  \
-	((_c)->ic_flagext |= IEEE80211_CHAN_DFS_CLEAR)
-#define IEEE80211_CHAN_EXCLUDE_11D(_c)	\
-	((_c)->ic_flagext |= IEEE80211_CHAN_11D_EXCLUDED)
-
-/* channel encoding for FH phy */
-#define IEEE80211_FH_CHANMOD            80
-#define IEEE80211_FH_CHAN(set,pat)      (((set)-1)*IEEE80211_FH_CHANMOD+(pat))
-#define IEEE80211_FH_CHANSET(chan)      ((chan)/IEEE80211_FH_CHANMOD+1)
-#define IEEE80211_FH_CHANPAT(chan)      ((chan)%IEEE80211_FH_CHANMOD)
-
-/*
- * 802.11 rate set.
- */
-#define IEEE80211_RATE_SIZE     8       /* 802.11 standard */
-#define IEEE80211_RATE_MAXSIZE  36      /* max rates we'll handle */
-#define IEEE80211_HT_RATE_SIZE  128
-#define IEEE80211_RATE_SINGLE_STREAM_MCS_MAX     7      /* MCS7 */
-
-#define IEEE80211_RATE_MCS      0x8000
-#define IEEE80211_RATE_MCS_VAL  0x7FFF
-
-#define IEEE80211_RATE_IDX_ENTRY(val, idx) (((val&(0xff<<(idx*8)))>>(idx*8)))
-
-/*
- * RSSI range
- */
-#define IEEE80211_RSSI_MAX           -10        /* in db */
-#define IEEE80211_RSSI_MIN           -200
-
-/*
- * 11n A-MPDU & A-MSDU limits
- */
-#define IEEE80211_AMPDU_LIMIT_MIN           (1 * 1024)
-#define IEEE80211_AMPDU_LIMIT_MAX           (64 * 1024 - 1)
-#define IEEE80211_AMPDU_LIMIT_DEFAULT       IEEE80211_AMPDU_LIMIT_MAX
-#define IEEE80211_AMPDU_SUBFRAME_MIN        2
-#define IEEE80211_AMPDU_SUBFRAME_MAX        64
-#define IEEE80211_AMPDU_SUBFRAME_DEFAULT    32
-#define IEEE80211_AMSDU_LIMIT_MAX           4096
-#define IEEE80211_RIFS_AGGR_DIV             10
-#define IEEE80211_MAX_AMPDU_MIN             0
-#define IEEE80211_MAX_AMPDU_MAX             3
-
-/*
- * 11ac A-MPDU limits
- */
-#define IEEE80211_VHT_MAX_AMPDU_MIN         0
-#define IEEE80211_VHT_MAX_AMPDU_MAX         7
-
-struct ieee80211_rateset {
-	uint8_t rs_nrates;
-	uint8_t rs_rates[IEEE80211_RATE_MAXSIZE];
-};
-
-struct ieee80211_beacon_info {
-	uint8_t essid[IEEE80211_NWID_LEN + 1];
-	uint8_t esslen;
-	uint8_t rssi_ctl_0;
-	uint8_t rssi_ctl_1;
-	uint8_t rssi_ctl_2;
-	int numchains;
-};
-
-#define IEEE80211_ADDR_LEN  6   /* size of 802.11 address */
-
-struct ieee80211_ibss_peer_list {
-	uint8_t bssid[IEEE80211_ADDR_LEN];
-};
-
-struct ieee80211_roam {
-	int8_t rssi11a;         /* rssi thresh for 11a bss */
-	int8_t rssi11b;         /* for 11g sta in 11b bss */
-	int8_t rssi11bOnly;     /* for 11b sta */
-	uint8_t pad1;
-	uint8_t rate11a;        /* rate thresh for 11a bss */
-	uint8_t rate11b;        /* for 11g sta in 11b bss */
-	uint8_t rate11bOnly;    /* for 11b sta */
-	uint8_t pad2;
-};
-
-#define IEEE80211_TID_SIZE      17      /* total number of TIDs */
-#define IEEE80211_NON_QOS_SEQ   16      /* index for non-QoS (including management) sequence number space */
-#define IEEE80211_SEQ_MASK      0xfff   /* sequence generator mask */
-#define MIN_SW_SEQ              0x100   /* minimum sequence for SW generate packect */
-
-/* crypto related defines*/
-#define IEEE80211_KEYBUF_SIZE   16
-#define IEEE80211_MICBUF_SIZE   (8+8)   /* space for both tx+rx keys */
-
-enum ieee80211_clist_cmd {
-	CLIST_UPDATE,
-	CLIST_DFS_UPDATE,
-	CLIST_NEW_COUNTRY,
-	CLIST_NOL_UPDATE
-};
-
-enum ieee80211_nawds_param {
-	IEEE80211_NAWDS_PARAM_NUM = 0,
-	IEEE80211_NAWDS_PARAM_MODE,
-	IEEE80211_NAWDS_PARAM_DEFCAPS,
-	IEEE80211_NAWDS_PARAM_OVERRIDE,
-};
-
-struct ieee80211_mib_cycle_cnts {
-	uint32_t tx_frame_count;
-	uint32_t rx_frame_count;
-	uint32_t rx_clear_count;
-	uint32_t cycle_count;
-	uint8_t is_rx_active;
-	uint8_t is_tx_active;
-};
-
-struct ieee80211_chanutil_info {
-	uint32_t rx_clear_count;
-	uint32_t cycle_count;
-	uint8_t value;
-	uint32_t beacon_count;
-	uint8_t beacon_intervals;
-};
-
-#endif /* CDS_COMMON__IEEE80211_I_H_ */

+ 0 - 215
core/cds/src/cds_mq.c

@@ -1,215 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: cds_mq.c
- *
- * Connectivity driver services (CDS) message queue APIs
- *
- * Message Queue Definitions and API
- */
-
-/* Include Files */
-#include <cds_mq.h>
-#include "cds_sched.h"
-#include <cds_api.h>
-#include "sir_types.h"
-
-/* Preprocessor definitions and constants */
-
-/* Type declarations */
-
-/* Function declarations and documenation */
-
-tSirRetStatus u_mac_post_ctrl_msg(void *pSirGlobal, void *pMb);
-
-/**
- * cds_mq_init() - initialize cds message queue
- * @pMq: Pointer to the message queue
- *
- * This function initializes the Message queue.
- *
- * Return: cdf status
- */
-inline CDF_STATUS cds_mq_init(p_cds_mq_type pMq)
-{
-
-	if (pMq == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: NULL pointer passed", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Now initialize the lock */
-	spin_lock_init(&pMq->mqLock);
-
-	/* Now initialize the List data structure */
-	INIT_LIST_HEAD(&pMq->mqList);
-
-	return CDF_STATUS_SUCCESS;
-} /* cds_mq_init() */
-
-/**
- * cds_mq_deinit() - de-initialize cds message queue
- * @pMq: Pointer to the message queue
- *
- * This function de-initializes cds message queue
- *
- * Return: none
- */
-inline void cds_mq_deinit(p_cds_mq_type pMq)
-{
-	if (pMq == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: NULL pointer passed", __func__);
-		return;
-	}
-
-	/* we don't have to do anything with the embedded list or spinlock */
-} /* cds_mq_deinit() */
-
-/**
- * cds_mq_put() - add a message to the message queue
- * @pMq: Pointer to the message queue
- * @pMsgWrapper: Msg wrapper containing the message
- *
- * Return: none
- */
-inline void cds_mq_put(p_cds_mq_type pMq, p_cds_msg_wrapper pMsgWrapper)
-{
-	unsigned long flags;
-
-	if ((pMq == NULL) || (pMsgWrapper == NULL)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: NULL pointer passed", __func__);
-		return;
-	}
-
-	spin_lock_irqsave(&pMq->mqLock, flags);
-
-	list_add_tail(&pMsgWrapper->msgNode, &pMq->mqList);
-
-	spin_unlock_irqrestore(&pMq->mqLock, flags);
-
-} /* cds_mq_put() */
-
-/**
- * cds_mq_get() - get a message with its wrapper from a message queue
- * @pMq: Pointer to the message queue
- *
- * Return: pointer to the message wrapper
- */
-inline p_cds_msg_wrapper cds_mq_get(p_cds_mq_type pMq)
-{
-	p_cds_msg_wrapper pMsgWrapper = NULL;
-
-	struct list_head *listptr;
-	unsigned long flags;
-
-	if (pMq == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: NULL pointer passed", __func__);
-		return NULL;
-	}
-
-	spin_lock_irqsave(&pMq->mqLock, flags);
-
-	if (list_empty(&pMq->mqList)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_WARN,
-			  "%s: CDS Message Queue is empty", __func__);
-	} else {
-		listptr = pMq->mqList.next;
-		pMsgWrapper =
-			(p_cds_msg_wrapper) list_entry(listptr, cds_msg_wrapper,
-						       msgNode);
-		list_del(pMq->mqList.next);
-	}
-
-	spin_unlock_irqrestore(&pMq->mqLock, flags);
-
-	return pMsgWrapper;
-
-} /* cds_mq_get() */
-
-/**
- * cds_is_mq_empty() - check if the message queue is empty
- * @pMq: Pointer to the message queue
- *
- * Return: true if message queue is emtpy
- *	   false otherwise
- */
-inline bool cds_is_mq_empty(p_cds_mq_type pMq)
-{
-	bool state = false;
-	unsigned long flags;
-
-	if (pMq == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: NULL pointer passed", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	spin_lock_irqsave(&pMq->mqLock, flags);
-	state = list_empty(&pMq->mqList) ? true : false;
-	spin_unlock_irqrestore(&pMq->mqLock, flags);
-
-	return state;
-} /* cds_mq_get() */
-
-/**
- * cds_send_mb_message_to_mac() - post a message to a message queue
- * @pBuf: Pointer to buffer allocated by caller
- *
- * Return: cdf status
- */
-CDF_STATUS cds_send_mb_message_to_mac(void *pBuf)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-	tSirRetStatus sirStatus;
-	v_CONTEXT_t cds_context;
-	void *hHal;
-
-	cds_context = cds_get_global_context();
-	if (NULL == cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_ERROR,
-			  "%s: invalid cds_context", __func__);
-	} else {
-		hHal = cds_get_context(CDF_MODULE_ID_SME);
-		if (NULL == hHal) {
-			CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_ERROR,
-				  "%s: invalid hHal", __func__);
-		} else {
-			sirStatus = u_mac_post_ctrl_msg(hHal, pBuf);
-			if (eSIR_SUCCESS == sirStatus)
-				cdf_ret_status = CDF_STATUS_SUCCESS;
-		}
-	}
-
-	cdf_mem_free(pBuf);
-
-	return cdf_ret_status;
-}

+ 0 - 345
core/cds/src/cds_packet.c

@@ -1,345 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**=========================================================================
-
-   \file        cds_packet.c
-
-   \brief       Connectivity driver services (CDS) network Packet APIs
-
-   Network Protocol packet/buffer support interfaces
-
-   ========================================================================*/
-
-/*--------------------------------------------------------------------------
-   Include Files
-   ------------------------------------------------------------------------*/
-#include <cds_packet.h>
-#include <i_cds_packet.h>
-#include <cdf_mc_timer.h>
-#include <cdf_trace.h>
-#include <wlan_hdd_main.h>
-#include "cdf_nbuf.h"
-#include "cdf_memory.h"
-
-#define TX_PKT_MIN_HEADROOM          (64)
-
-/* Protocol specific packet tracking feature */
-#define CDS_PKT_TRAC_ETH_TYPE_OFFSET (12)
-#define CDS_PKT_TRAC_IP_OFFSET       (14)
-#define CDS_PKT_TRAC_IP_HEADER_SIZE  (20)
-#define CDS_PKT_TRAC_DHCP_SRV_PORT   (67)
-#define CDS_PKT_TRAC_DHCP_CLI_PORT   (68)
-#define CDS_PKT_TRAC_EAPOL_ETH_TYPE  (0x888E)
-#ifdef QCA_PKT_PROTO_TRACE
-#define CDS_PKT_TRAC_MAX_STRING_LEN  (12)
-#define CDS_PKT_TRAC_MAX_TRACE_BUF   (50)
-#define CDS_PKT_TRAC_MAX_STRING_BUF  (64)
-
-/* protocol Storage Structure */
-typedef struct {
-	uint32_t order;
-	v_TIME_t event_time;
-	char event_string[CDS_PKT_TRAC_MAX_STRING_LEN];
-} cds_pkt_proto_trace_t;
-
-cds_pkt_proto_trace_t *trace_buffer = NULL;
-unsigned int trace_buffer_order = 0;
-cdf_spinlock_t trace_buffer_lock;
-#endif /* QCA_PKT_PROTO_TRACE */
-
-/**
- * cds_pkt_return_packet  Free the cds Packet
- * @ cds Packet
- */
-CDF_STATUS cds_pkt_return_packet(cds_pkt_t *packet)
-{
-	/* Validate the input parameter pointer */
-	if (unlikely(packet == NULL)) {
-		return CDF_STATUS_E_INVAL;
-	}
-
-	/* Free up the Adf nbuf */
-	cdf_nbuf_free(packet->pkt_buf);
-
-	packet->pkt_buf = NULL;
-
-	/* Free up the Rx packet */
-	cdf_mem_free(packet);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**--------------------------------------------------------------------------
-
-   \brief cds_pkt_get_packet_length() - Get packet length for a cds Packet
-
-   This API returns the total length of the data in a cds Packet.
-
-   \param pPacket - the cds Packet to get the packet length from.
-
-   \param pPacketSize - location to return the total size of the data contained
-                       in the cds Packet.
-   \return
-
-   \sa
-
-   ---------------------------------------------------------------------------*/
-CDF_STATUS
-cds_pkt_get_packet_length(cds_pkt_t *pPacket, uint16_t *pPacketSize)
-{
-	/* Validate the parameter pointers */
-	if (unlikely((pPacket == NULL) || (pPacketSize == NULL)) ||
-	    (pPacket->pkt_buf == NULL)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "VPKT [%d]: NULL pointer", __LINE__);
-		return CDF_STATUS_E_INVAL;
-	}
-	/* return the requested information */
-	*pPacketSize = cdf_nbuf_len(pPacket->pkt_buf);
-	return CDF_STATUS_SUCCESS;
-}
-
-/*---------------------------------------------------------------------------
-* @brief cds_pkt_get_proto_type() -
-      Find protoco type from packet contents
-
-* skb Packet Pointer
-* tracking_map packet type want to track
-* dot11_type, type of dot11 frame
-   ---------------------------------------------------------------------------*/
-uint8_t cds_pkt_get_proto_type(struct sk_buff *skb, uint8_t tracking_map,
-			       uint8_t dot11_type)
-{
-	uint8_t pkt_proto_type = 0;
-	uint16_t ether_type;
-	uint16_t SPort;
-	uint16_t DPort;
-
-	if (dot11_type) {
-		if (dot11_type ==
-		    (CDS_PKT_TRAC_TYPE_MGMT_ACTION & tracking_map))
-			pkt_proto_type |= CDS_PKT_TRAC_TYPE_MGMT_ACTION;
-
-		/* Protocol type map */
-		return pkt_proto_type;
-	}
-
-	/* EAPOL Tracking enabled */
-	if (CDS_PKT_TRAC_TYPE_EAPOL & tracking_map) {
-		ether_type = (uint16_t) (*(uint16_t *)
-					 (skb->data +
-					  CDS_PKT_TRAC_ETH_TYPE_OFFSET));
-		if (CDS_PKT_TRAC_EAPOL_ETH_TYPE == CDF_SWAP_U16(ether_type)) {
-			pkt_proto_type |= CDS_PKT_TRAC_TYPE_EAPOL;
-		}
-	}
-
-	/* DHCP Tracking enabled */
-	if (CDS_PKT_TRAC_TYPE_DHCP & tracking_map) {
-		SPort = (uint16_t) (*(uint16_t *)
-				    (skb->data + CDS_PKT_TRAC_IP_OFFSET +
-				     CDS_PKT_TRAC_IP_HEADER_SIZE));
-		DPort = (uint16_t) (*(uint16_t *)
-				    (skb->data + CDS_PKT_TRAC_IP_OFFSET +
-				     CDS_PKT_TRAC_IP_HEADER_SIZE +
-				     sizeof(uint16_t)));
-		if (((CDS_PKT_TRAC_DHCP_SRV_PORT == CDF_SWAP_U16(SPort))
-		     && (CDS_PKT_TRAC_DHCP_CLI_PORT == CDF_SWAP_U16(DPort)))
-		    || ((CDS_PKT_TRAC_DHCP_CLI_PORT == CDF_SWAP_U16(SPort))
-			&& (CDS_PKT_TRAC_DHCP_SRV_PORT == CDF_SWAP_U16(DPort)))) {
-			pkt_proto_type |= CDS_PKT_TRAC_TYPE_DHCP;
-		}
-	}
-
-	/* Protocol type map */
-	return pkt_proto_type;
-}
-
-#ifdef QCA_PKT_PROTO_TRACE
-/*---------------------------------------------------------------------------
-* @brief cds_pkt_trace_buf_update() -
-      Update storage buffer with interest event string
-
-* event_string Event String may packet type or outstanding event
-   ---------------------------------------------------------------------------*/
-void cds_pkt_trace_buf_update(char *event_string)
-{
-	uint32_t slot;
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s %d, %s", __func__, __LINE__, event_string);
-	cdf_spinlock_acquire(&trace_buffer_lock);
-	slot = trace_buffer_order % CDS_PKT_TRAC_MAX_TRACE_BUF;
-	trace_buffer[slot].order = trace_buffer_order;
-	trace_buffer[slot].event_time = cdf_mc_timer_get_system_time();
-	cdf_mem_zero(trace_buffer[slot].event_string,
-		     sizeof(trace_buffer[slot].event_string));
-	cdf_mem_copy(trace_buffer[slot].event_string,
-		     event_string,
-		     (CDS_PKT_TRAC_MAX_STRING_LEN < strlen(event_string)) ?
-		     CDS_PKT_TRAC_MAX_STRING_LEN : strlen(event_string));
-	trace_buffer_order++;
-	cdf_spinlock_release(&trace_buffer_lock);
-
-	return;
-}
-
-/*---------------------------------------------------------------------------
-* @brief cds_pkt_trace_buf_dump() -
-      Dump stored information into kernel log
-   ---------------------------------------------------------------------------*/
-void cds_pkt_trace_buf_dump(void)
-{
-	uint32_t slot, idx;
-
-	cdf_spinlock_acquire(&trace_buffer_lock);
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		  "PACKET TRACE DUMP START Current Timestamp %u",
-		  (unsigned int)cdf_mc_timer_get_system_time());
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		  "ORDER :        TIME : EVT");
-	if (CDS_PKT_TRAC_MAX_TRACE_BUF > trace_buffer_order) {
-		for (slot = 0; slot < trace_buffer_order; slot++) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%5d :%12u : %s",
-				  trace_buffer[slot].order,
-				  (unsigned int)trace_buffer[slot].event_time,
-				  trace_buffer[slot].event_string);
-		}
-	} else {
-		for (idx = 0; idx < CDS_PKT_TRAC_MAX_TRACE_BUF; idx++) {
-			slot =
-				(trace_buffer_order +
-				 idx) % CDS_PKT_TRAC_MAX_TRACE_BUF;
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%5d :%12u : %s", trace_buffer[slot].order,
-				  (unsigned int)trace_buffer[slot].event_time,
-				  trace_buffer[slot].event_string);
-		}
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		  "PACKET TRACE DUMP END");
-	cdf_spinlock_release(&trace_buffer_lock);
-
-	return;
-}
-
-/*---------------------------------------------------------------------------
-* @brief cds_pkt_proto_trace_init() -
-      Initialize protocol trace functionality, allocate required resource
-   ---------------------------------------------------------------------------*/
-void cds_pkt_proto_trace_init(void)
-{
-	/* Init spin lock to protect global memory */
-	cdf_spinlock_init(&trace_buffer_lock);
-	trace_buffer_order = 0;
-
-	trace_buffer = cdf_mem_malloc(CDS_PKT_TRAC_MAX_TRACE_BUF *
-				      sizeof(cds_pkt_proto_trace_t));
-
-	/* Register callback function to NBUF
-	 * Lower layer event also will be reported to here */
-	cdf_nbuf_reg_trace_cb(cds_pkt_trace_buf_update);
-	return;
-}
-
-/*---------------------------------------------------------------------------
-* @brief cds_pkt_proto_trace_close() -
-      Free required resource
-   ---------------------------------------------------------------------------*/
-void cds_pkt_proto_trace_close(void)
-{
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		  "%s %d", __func__, __LINE__);
-	cdf_mem_free(trace_buffer);
-	cdf_spinlock_destroy(&trace_buffer_lock);
-
-	return;
-}
-#endif /* QCA_PKT_PROTO_TRACE */
-
-#ifdef MEMORY_DEBUG
-/*---------------------------------------------------------------------------
-* @brief cds_packet_alloc_debug() -
-      Allocate a network buffer for TX
-   ---------------------------------------------------------------------------*/
-CDF_STATUS cds_packet_alloc_debug(uint16_t size, void **data, void **ppPacket,
-				  uint8_t *file_name, uint32_t line_num)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-	cdf_nbuf_t nbuf;
-
-	nbuf =
-		cdf_nbuf_alloc_debug(NULL, roundup(size + TX_PKT_MIN_HEADROOM, 4),
-				     TX_PKT_MIN_HEADROOM, sizeof(uint32_t), false,
-				     file_name, line_num);
-
-	if (nbuf != NULL) {
-		cdf_nbuf_put_tail(nbuf, size);
-		cdf_nbuf_set_protocol(nbuf, ETH_P_CONTROL);
-		*ppPacket = nbuf;
-		*data = cdf_nbuf_data(nbuf);
-		cdf_ret_status = CDF_STATUS_SUCCESS;
-	}
-
-	return cdf_ret_status;
-}
-#else
-/*---------------------------------------------------------------------------
-* @brief cds_packet_alloc() -
-      Allocate a network buffer for TX
-   ---------------------------------------------------------------------------*/
-CDF_STATUS cds_packet_alloc(uint16_t size, void **data, void **ppPacket)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-	cdf_nbuf_t nbuf;
-
-	nbuf = cdf_nbuf_alloc(NULL, roundup(size + TX_PKT_MIN_HEADROOM, 4),
-			      TX_PKT_MIN_HEADROOM, sizeof(uint32_t), false);
-
-	if (nbuf != NULL) {
-		cdf_nbuf_put_tail(nbuf, size);
-		cdf_nbuf_set_protocol(nbuf, ETH_P_CONTROL);
-		*ppPacket = nbuf;
-		*data = cdf_nbuf_data(nbuf);
-		cdf_ret_status = CDF_STATUS_SUCCESS;
-	}
-
-	return cdf_ret_status;
-}
-
-#endif
-/*---------------------------------------------------------------------------
-* @brief cds_packet_free() -
-      Free input network buffer
-   ---------------------------------------------------------------------------*/
-void cds_packet_free(void *pPacket)
-{
-	cdf_nbuf_free((cdf_nbuf_t) pPacket);
-}

+ 0 - 1190
core/cds/src/cds_reg_service.c

@@ -1,1190 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/*============================================================================
-   FILE:         cds_reg_service.c
-   OVERVIEW:     This source file contains definitions for CDS regulatory APIs
-   DEPENDENCIES: None
-   ============================================================================*/
-
-#include <net/cfg80211.h>
-#include "cdf_types.h"
-#include "cds_reg_service.h"
-#include "cdf_trace.h"
-#include "sme_api.h"
-#include "wlan_hdd_main.h"
-#include "cds_regdomain.h"
-#include "cds_regdomain_common.h"
-
-#define WORLD_SKU_MASK          0x00F0
-#define WORLD_SKU_PREFIX        0x0060
-#define REG_WAIT_TIME           50
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-#define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR
-#define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR
-#endif
-
-#define REG_RULE_2412_2462    REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
-
-#define REG_RULE_2467_2472    REG_RULE(2467-10, 2472+10, 40, 0, 20, \
-			      NL80211_RRF_PASSIVE_SCAN)
-
-#define REG_RULE_2484         REG_RULE(2484-10, 2484+10, 40, 0, 20, \
-		NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM)
-
-#define REG_RULE_5180_5320    REG_RULE(5180-10, 5320+10, 80, 0, 20, \
-		NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
-
-#define REG_RULE_5500_5720    REG_RULE(5500-10, 5720+10, 80, 0, 20, \
-		NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
-
-#define REG_RULE_5745_5925    REG_RULE(5745-10, 5925+10, 80, 0, 20, \
-		NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
-
-static const struct ieee80211_regdomain cds_world_regdom_60_61_62 = {
-	.n_reg_rules = 6,
-	.alpha2 =  "00",
-	.reg_rules = {
-		REG_RULE_2412_2462,
-		REG_RULE_2467_2472,
-		REG_RULE_2484,
-		REG_RULE_5180_5320,
-		REG_RULE_5500_5720,
-		REG_RULE_5745_5925,
-	}
-};
-
-static const struct ieee80211_regdomain cds_world_regdom_63_65 = {
-	.n_reg_rules = 4,
-	.alpha2 =  "00",
-	.reg_rules = {
-		REG_RULE_2412_2462,
-		REG_RULE_2467_2472,
-		REG_RULE_5180_5320,
-		REG_RULE_5745_5925,
-	}
-};
-
-static const struct ieee80211_regdomain cds_world_regdom_64 = {
-	.n_reg_rules = 3,
-	.alpha2 =  "00",
-	.reg_rules = {
-		REG_RULE_2412_2462,
-		REG_RULE_5180_5320,
-		REG_RULE_5745_5925,
-	}
-};
-
-static const struct ieee80211_regdomain cds_world_regdom_66_69 = {
-	.n_reg_rules = 4,
-	.alpha2 =  "00",
-	.reg_rules = {
-		REG_RULE_2412_2462,
-		REG_RULE_5180_5320,
-		REG_RULE_5500_5720,
-		REG_RULE_5745_5925,
-	}
-};
-
-static const struct ieee80211_regdomain cds_world_regdom_67_68_6A_6C = {
-	.n_reg_rules = 5,
-	.alpha2 =  "00",
-	.reg_rules = {
-		REG_RULE_2412_2462,
-		REG_RULE_2467_2472,
-		REG_RULE_5180_5320,
-		REG_RULE_5500_5720,
-		REG_RULE_5745_5925,
-	}
-};
-
-const struct chan_map chan_mapping[NUM_RF_CHANNELS] = {
-	{2412, 1},
-	{2417, 2},
-	{2422, 3},
-	{2427, 4},
-	{2432, 5},
-	{2437, 6},
-	{2442, 7},
-	{2447, 8},
-	{2452, 9},
-	{2457, 10},
-	{2462, 11},
-	{2467, 12},
-	{2472, 13},
-	{2484, 14},
-	{5180, 36},
-	{5200, 40},
-	{5220, 44},
-	{5240, 48},
-	{5260, 52},
-	{5280, 56},
-	{5300, 60},
-	{5320, 64},
-	{5500, 100},
-	{5520, 104},
-	{5540, 108},
-	{5560, 112},
-	{5580, 116},
-	{5600, 120},
-	{5620, 124},
-	{5640, 128},
-	{5660, 132},
-	{5680, 136},
-	{5700, 140},
-	{5720, 144},
-	{5745, 149},
-	{5765, 153},
-	{5785, 157},
-	{5805, 161},
-	{5825, 165},
-	{5852, 170},
-	{5855, 171},
-	{5860, 172},
-	{5865, 173},
-	{5870, 174},
-	{5875, 175},
-	{5880, 176},
-	{5885, 177},
-	{5890, 178},
-	{5895, 179},
-	{5900, 180},
-	{5905, 181},
-	{5910, 182},
-	{5915, 183},
-	{5920, 184},
-	{2422, 3},
-	{2427, 4},
-	{2432, 5},
-	{2437, 6},
-	{2442, 7},
-	{2447, 8},
-	{2452, 9},
-	{2457, 10},
-	{2462, 11},
-	{5190, 38},
-	{5210, 42},
-	{5230, 46},
-	{5250, 50},
-	{5270, 54},
-	{5290, 58},
-	{5310, 62},
-	{5510, 102},
-	{5530, 106},
-	{5550, 110},
-	{5570, 114},
-	{5590, 118},
-	{5610, 122},
-	{5630, 126},
-	{5650, 130},
-	{5670, 134},
-	{5690, 138},
-	{5710, 142},
-	{5755, 151},
-	{5775, 155},
-	{5795, 159},
-	{5815, 163},
-};
-
-struct regulatory_channel reg_channels[NUM_RF_CHANNELS];
-static bool init_by_driver;
-static bool init_by_reg_core;
-
-/**
- * cds_is_world_regdomain() - whether world regdomain
- * @regd: integer regulatory domain
- *
- * Return: bool
- */
-bool cds_is_world_regdomain(uint32_t reg_domain)
-{
-	uint32_t temp_regd = reg_domain & ~WORLDWIDE_ROAMING_FLAG;
-
-	return ((temp_regd & COUNTRY_ERD_FLAG) != COUNTRY_ERD_FLAG) &&
-		(((temp_regd & WORLD_SKU_MASK) == WORLD_SKU_PREFIX) ||
-		 (temp_regd == WORLD));
-
-}
-
-
-/**
- * cds_world_regdomain() - which constant world regdomain
- * @reg: regulatory data
- *
- * Return: regdomain ptr
- */
-static const struct ieee80211_regdomain
-*cds_world_regdomain(struct regulatory *reg)
-{
-	REG_DMN_PAIR_MAPPING *regpair =
-		(REG_DMN_PAIR_MAPPING *)reg->regpair;
-
-	switch (regpair->regDmnEnum) {
-	case 0x60:
-	case 0x61:
-	case 0x62:
-		return &cds_world_regdom_60_61_62;
-	case 0x63:
-	case 0x65:
-		return &cds_world_regdom_63_65;
-	case 0x64:
-		return &cds_world_regdom_64;
-	case 0x66:
-	case 0x69:
-		return &cds_world_regdom_66_69;
-	case 0x67:
-	case 0x68:
-	case 0x6A:
-	case 0x6C:
-		return &cds_world_regdom_67_68_6A_6C;
-	default:
-		WARN_ON(1);
-		return &cds_world_regdom_60_61_62;
-	}
-}
-
-/**
- * cds_regulatory_wiphy_init() - regulatory wiphy init
- * @hdd_ctx: hdd context
- * @reg: regulatory data
- * @wiphy: wiphy structure
- *
- * Return: int
- */
-static int cds_regulatory_wiphy_init(hdd_context_t *hdd_ctx,
-				     struct regulatory *reg,
-				     struct wiphy *wiphy)
-{
-	const struct ieee80211_regdomain *reg_domain;
-
-	if (cds_is_world_regdomain(reg->reg_domain)) {
-		reg_domain = cds_world_regdomain(reg);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-		wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
-#else
-		wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
-#endif
-	} else if (hdd_ctx->config->fRegChangeDefCountry) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-		wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
-#else
-		wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
-#endif
-		reg_domain = &cds_world_regdom_60_61_62;
-	} else {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-		wiphy->regulatory_flags |= REGULATORY_STRICT_REG;
-#else
-		wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
-#endif
-		reg_domain = &cds_world_regdom_60_61_62;
-	}
-
-	/*
-	 * save the original driver regulatory flags
-	 */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-	hdd_ctx->reg.reg_flags = wiphy->regulatory_flags;
-#else
-	hdd_ctx->reg.reg_flags = wiphy->flags;
-#endif
-	wiphy_apply_custom_regulatory(wiphy, reg_domain);
-
-	/*
-	 * restore the driver regulatory flags since
-	 * wiphy_apply_custom_regulatory may have
-	 * changed them
-	 */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-	wiphy->regulatory_flags = hdd_ctx->reg.reg_flags;
-#else
-	wiphy->flags = hdd_ctx->reg.reg_flags;
-#endif
-
-	return 0;
-}
-
-/**
- * cds_update_regulatory_info() - update regulatory info
- * @hdd_ctx: hdd context
- *
- * Return: CDF_STATUS
- */
-static void cds_update_regulatory_info(hdd_context_t *hdd_ctx)
-{
-	uint32_t country_code;
-
-	country_code = cds_get_country_from_alpha2(hdd_ctx->reg.alpha2);
-
-	hdd_ctx->reg.reg_domain = COUNTRY_ERD_FLAG;
-	hdd_ctx->reg.reg_domain |= country_code;
-
-	cds_fill_some_regulatory_info(&hdd_ctx->reg);
-
-	return;
-}
-
-
-/**
- * cds_get_channel_list_with_power() - retrieve channel list with power
- * @base_channels: base channels
- * @num_base_channels: number of base channels
- * @channels_40mhz: 40 MHz channels
- * @num_40mhz_channels: number of 40 Mhz channels
- *
- * Return: CDF_STATUS_SUCCESS
- */
-CDF_STATUS cds_get_channel_list_with_power(struct channel_power
-					   *base_channels,
-					   uint8_t *num_base_channels,
-					   struct channel_power
-					   *channels_40mhz,
-					   uint8_t *num_40mhz_channels)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	int i, count;
-
-	if (base_channels && num_base_channels) {
-		count = 0;
-		for (i = 0; i <= RF_CHAN_14; i++) {
-			if (reg_channels[i].state) {
-				base_channels[count].chan_num =
-					chan_mapping[i].chan_num;
-				base_channels[count++].power =
-					reg_channels[i].pwr_limit;
-			}
-		}
-		for (i = RF_CHAN_36; i <= RF_CHAN_184; i++) {
-			if (reg_channels[i].state) {
-				base_channels[count].chan_num =
-					chan_mapping[i].chan_num;
-				base_channels[count++].power =
-					reg_channels[i].pwr_limit;
-			}
-		}
-		*num_base_channels = count;
-	}
-
-	if (channels_40mhz && num_40mhz_channels) {
-		count = 0;
-
-		for (i = RF_CHAN_BOND_3; i <= RF_CHAN_BOND_11; i++) {
-			if (reg_channels[i].state) {
-				channels_40mhz[count].chan_num =
-					chan_mapping[i].chan_num;
-				channels_40mhz[count++].power =
-					reg_channels[i].pwr_limit;
-			}
-		}
-
-		for (i = RF_CHAN_BOND_38; i <= RF_CHAN_BOND_163; i++) {
-			if (reg_channels[i].state) {
-				channels_40mhz[count].chan_num =
-					chan_mapping[i].chan_num;
-				channels_40mhz[count++].power =
-					reg_channels[i].pwr_limit;
-			}
-		}
-		*num_40mhz_channels = count;
-	}
-
-	return status;
-}
-
-/**
- * cds_read_default_country() - set the default country
- * @default_country: default country
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_read_default_country(uint8_t *default_country)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "invalid hdd_ctx pointer");
-		return CDF_STATUS_E_FAULT;
-	}
-
-	memcpy(default_country,
-	       hdd_ctx->reg.def_country,
-	       CDS_COUNTRY_CODE_LEN + 1);
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "default country is %c%c\n",
-		  default_country[0],
-		  default_country[1]);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_channel_enum() - get the channel enumeration
- * @chan_num: channel number
- *
- * Return: enum for the channel
- */
-static enum channel_enum cds_get_channel_enum(uint32_t chan_num)
-{
-	uint32_t loop;
-
-	for (loop = 0; loop <= RF_CHAN_184; loop++)
-		if (chan_mapping[loop].chan_num == chan_num)
-			return loop;
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		  "invalid channel number %d", chan_num);
-
-	return INVALID_RF_CHANNEL;
-}
-
-
-/**
- * cds_get_channel_state() - get the channel state
- * @chan_num: channel number
- *
- * Return: channel state
- */
-enum channel_state cds_get_channel_state(uint32_t chan_num)
-{
-	enum channel_enum chan_enum;
-
-	chan_enum = cds_get_channel_enum(chan_num);
-	if (INVALID_RF_CHANNEL == chan_enum)
-		return CHANNEL_STATE_INVALID;
-	else
-		return reg_channels[chan_enum].state;
-}
-
-
-/**
- * cds_get_bonded_channel_state() - get the bonded channel state
- * @channel_num: channel number
- *
- * Return: channel state
- */
-enum channel_state cds_get_bonded_channel_state(uint32_t chan_num,
-					   enum channel_width ch_width)
-{
-	enum channel_enum chan_enum;
-	bool bw_enabled = false;
-
-	chan_enum = cds_get_channel_enum(chan_num);
-	if (INVALID_RF_CHANNEL == chan_enum)
-		return CHANNEL_STATE_INVALID;
-
-	if (reg_channels[chan_enum].state) {
-		if (CHAN_WIDTH_5MHZ == ch_width)
-			bw_enabled = 1;
-		else if (CHAN_WIDTH_10MHZ == ch_width)
-			bw_enabled = !(reg_channels[chan_enum].flags &
-				       IEEE80211_CHAN_NO_10MHZ);
-		else if (CHAN_WIDTH_20MHZ == ch_width)
-			bw_enabled = !(reg_channels[chan_enum].flags &
-				       IEEE80211_CHAN_NO_20MHZ);
-		else if (CHAN_WIDTH_40MHZ == ch_width)
-			bw_enabled = !(reg_channels[chan_enum].flags &
-				       IEEE80211_CHAN_NO_HT40);
-		else if (CHAN_WIDTH_80MHZ == ch_width)
-			bw_enabled = !(reg_channels[chan_enum].flags &
-				       IEEE80211_CHAN_NO_80MHZ);
-		else if (CHAN_WIDTH_160MHZ == ch_width)
-			bw_enabled = !(reg_channels[chan_enum].flags &
-				       IEEE80211_CHAN_NO_160MHZ);
-	}
-
-	if (bw_enabled)
-		return reg_channels[chan_enum].state;
-	else
-		return CHANNEL_STATE_DISABLE;
-}
-
-/**
- * cds_get_max_channel_bw() - get the max channel bandwidth
- * @channel_num: channel number
- *
- * Return: channel_width
- */
-enum channel_width cds_get_max_channel_bw(uint32_t chan_num)
-{
-	enum channel_enum chan_enum;
-	enum channel_width chan_bw = CHAN_WIDTH_0MHZ;
-
-	chan_enum = cds_get_channel_enum(chan_num);
-
-	if ((INVALID_RF_CHANNEL != chan_enum) &&
-	    (CHANNEL_STATE_DISABLE != reg_channels[chan_enum].state)) {
-
-		if (!(reg_channels[chan_enum].flags &
-		      IEEE80211_CHAN_NO_160MHZ))
-			chan_bw = CHAN_WIDTH_160MHZ;
-		else if (!(reg_channels[chan_enum].flags &
-			   IEEE80211_CHAN_NO_80MHZ))
-			chan_bw = CHAN_WIDTH_80MHZ;
-		else if (!(reg_channels[chan_enum].flags &
-			   IEEE80211_CHAN_NO_HT40))
-			chan_bw = CHAN_WIDTH_40MHZ;
-		else if (!(reg_channels[chan_enum].flags &
-			   IEEE80211_CHAN_NO_20MHZ))
-			chan_bw = CHAN_WIDTH_20MHZ;
-		else if (!(reg_channels[chan_enum].flags &
-			   IEEE80211_CHAN_NO_10MHZ))
-			chan_bw = CHAN_WIDTH_10MHZ;
-		else
-			chan_bw = CHAN_WIDTH_5MHZ;
-	}
-
-	return chan_bw;
-
-}
-
-static int cds_bw20_ch_index_to_bw40_ch_index(int k)
-{
-	int m = -1;
-	if (k >= RF_CHAN_1 && k <= RF_CHAN_13) {
-		/*
-		 * Channel bonding is not valid for channel 14,
-		 * Hence don't consider it
-		 */
-		m = k - RF_CHAN_1 + RF_CHAN_BOND_3;
-		if (m > RF_CHAN_BOND_11)
-			m = RF_CHAN_BOND_11;
-	} else if (k >= RF_CHAN_36 && k <= RF_CHAN_64) {
-		m = k - RF_CHAN_36 + RF_CHAN_BOND_38;
-		if (m > RF_CHAN_BOND_62)
-			m = RF_CHAN_BOND_62;
-	}
-	else if (k >= RF_CHAN_100 && k <= RF_CHAN_144)
-	{
-		m = k - RF_CHAN_100 + RF_CHAN_BOND_102;
-		if (m > RF_CHAN_BOND_142)
-			m = RF_CHAN_BOND_142;
-	} else if (k >= RF_CHAN_149 && k <= RF_CHAN_165) {
-		m = k - RF_CHAN_149 + RF_CHAN_BOND_151;
-		if (m > RF_CHAN_BOND_163)
-			m = RF_CHAN_BOND_163;
-	}
-	return m;
-}
-
-/**
- * cds_set_dfs_region() - set the dfs_region
- * @dfs_region: the dfs_region to set
- *
- * Return: CDF_STATUS_SUCCESS if dfs_region set correctly
- *         CDF_STATUS_E_EXISTS if hdd context not found
- */
-CDF_STATUS cds_set_dfs_region(uint8_t dfs_region)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-
-	if (NULL == hdd_ctx)
-		return CDF_STATUS_E_EXISTS;
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-	hdd_ctx->reg.dfs_region = dfs_region;
-#else
-
-	/* remap the ctl code to dfs region code */
-	switch (hdd_ctx->reg.ctl_5g) {
-	case FCC:
-		hdd_ctx->reg.dfs_region = DFS_FCC_DOMAIN;
-		break;
-	case ETSI:
-		hdd_ctx->reg.dfs_region = DFS_ETSI_DOMAIN;
-		break;
-	case MKK:
-		hdd_ctx->reg.dfs_region = DFS_MKK4_DOMAIN;
-		break;
-	default:
-		/* set default dfs_region to FCC */
-		hdd_ctx->reg.dfs_region = DFS_FCC_DOMAIN;
-		break;
-	}
-#endif
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_dfs_region() - get the dfs_region
- * @dfs_region: the dfs_region to return
- *
- * Return: CDF_STATUS_SUCCESS if dfs_region set correctly
- *         CDF_STATUS_E_EXISTS if hdd context not found
- */
-CDF_STATUS cds_get_dfs_region(uint8_t *dfs_region)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-
-	if (NULL == hdd_ctx)
-		return CDF_STATUS_E_EXISTS;
-
-	*dfs_region = hdd_ctx->reg.dfs_region;
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_get_reg_domain_from_country_code() - get the regulatory domain
- * @reg_domain_ptr: ptr to store regulatory domain
- *
- * Return: CDF_STATUS_SUCCESS on success
- *         CDF_STATUS_E_FAULT on error
- *         CDF_STATUS_E_EMPTY country table empty
- */
-CDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
-						const uint8_t *country_alpha2,
-						enum country_src source)
-{
-	hdd_context_t *hdd_ctx = NULL;
-	struct wiphy *wiphy = NULL;
-
-	if (NULL == reg_domain_ptr) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  ("Invalid reg domain pointer"));
-		return CDF_STATUS_E_FAULT;
-	}
-
-	*reg_domain_ptr = 0;
-
-	if (SOURCE_QUERY == source)
-		return CDF_STATUS_SUCCESS;
-
-	if (NULL == country_alpha2) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  ("Country code array is NULL"));
-		return CDF_STATUS_E_FAULT;
-	}
-
-	if (cds_is_driver_recovering()) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "SSR in progress, return");
-		return CDF_STATUS_SUCCESS;
-	}
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-
-	if (NULL == hdd_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  ("Invalid pHddCtx pointer"));
-		return CDF_STATUS_E_FAULT;
-	}
-
-	wiphy = hdd_ctx->wiphy;
-
-	if ((SOURCE_DRIVER == source) && (false == init_by_reg_core)) {
-		init_by_driver = true;
-		if (('0' != country_alpha2[0]) || ('0' != country_alpha2[1])) {
-			INIT_COMPLETION(hdd_ctx->reg_init);
-			regulatory_hint(wiphy, country_alpha2);
-			wait_for_completion_timeout(&hdd_ctx->reg_init,
-					       msecs_to_jiffies(REG_WAIT_TIME));
-		}
-	} else if (SOURCE_11D == source || SOURCE_USERSPACE == source) {
-		regulatory_hint_user(country_alpha2,
-				     NL80211_USER_REG_HINT_USER);
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/*
- * cds_is_dsrc_channel() - is the channel DSRC
- * @center_freq: center freq of the channel
- *
- * Return: true if dsrc channel
- *         false otherwise
- */
-bool cds_is_dsrc_channel(uint16_t center_freq)
-{
-	if (center_freq >= 5852 &&
-	    center_freq <= 5920)
-		return 1;
-
-	return 0;
-}
-
-/**
- * cds_process_regulatory_data() - process regulatory data
- * @wiphy: wiphy
- * @band_capability: band_capability
- *
- * Return: int
- */
-static int cds_process_regulatory_data(struct wiphy *wiphy,
-				       uint8_t band_capability,
-				       bool reset)
-{
-	int i, j, m;
-	int k = 0, n = 0;
-	hdd_context_t *hdd_ctx;
-	const struct ieee80211_reg_rule *reg_rule;
-	struct ieee80211_channel *chan;
-	struct regulatory_channel *temp_chan_k, *temp_chan_n, *temp_chan;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL == hdd_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "invalid hdd_ctx pointer");
-		return CDF_STATUS_E_FAULT;
-	}
-
-	hdd_ctx->isVHT80Allowed = 0;
-
-	if (band_capability == eCSR_BAND_24)
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-			  "band capability is set to 2G only");
-
-	for (i = 0, m = 0; i < IEEE80211_NUM_BANDS; i++) {
-
-		if (i == IEEE80211_BAND_2GHZ && band_capability == eCSR_BAND_5G)
-			continue;
-
-		else if (i == IEEE80211_BAND_5GHZ
-			 && band_capability == eCSR_BAND_24)
-			continue;
-
-		if (wiphy->bands[i] == NULL)
-			continue;
-
-		if (i == 0)
-			m = 0;
-		else
-			m = wiphy->bands[i-1]->n_channels + m;
-
-		for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
-
-			k = m + j;
-			n = cds_bw20_ch_index_to_bw40_ch_index(k);
-
-			chan = &(wiphy->bands[i]->channels[j]);
-			temp_chan_k = &(reg_channels[k]);
-			temp_chan_n = &(reg_channels[n]);
-
-			if ((!reset) &&
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-			    (wiphy->regulatory_flags &
-			     REGULATORY_CUSTOM_REG)) {
-#else
-				(wiphy->flags &
-				 WIPHY_FLAG_CUSTOM_REGULATORY)) {
-#endif
-				reg_rule = freq_reg_info(wiphy,
-							 MHZ_TO_KHZ(chan->
-								 center_freq));
-
-				if (!IS_ERR(reg_rule)) {
-					chan->flags &=
-						~IEEE80211_CHAN_DISABLED;
-
-					if (!(reg_rule->flags &
-					      NL80211_RRF_DFS)) {
-						CDF_TRACE(CDF_MODULE_ID_CDF,
-							  CDF_TRACE_LEVEL_INFO,
-							  "%s: Remove passive scan restriction for %u",
-							  __func__,
-							  chan->center_freq);
-						chan->flags &=
-							~IEEE80211_CHAN_RADAR;
-					}
-
-					if (!(reg_rule->flags &
-					      NL80211_RRF_PASSIVE_SCAN)) {
-						CDF_TRACE(CDF_MODULE_ID_CDF,
-							  CDF_TRACE_LEVEL_INFO,
-							  "%s: Remove passive scan restriction for %u",
-							  __func__,
-							  chan->center_freq);
-						chan->flags &=
-						   ~IEEE80211_CHAN_PASSIVE_SCAN;
-					}
-
-					if (!(reg_rule->flags &
-					      NL80211_RRF_NO_IBSS)) {
-						CDF_TRACE(CDF_MODULE_ID_CDF,
-							  CDF_TRACE_LEVEL_INFO,
-							  "%s: Remove no ibss restriction for %u",
-							  __func__,
-							  chan->center_freq);
-						chan->flags &=
-							~IEEE80211_CHAN_NO_IBSS;
-					}
-
-					chan->max_power = MBM_TO_DBM(reg_rule->
-								     power_rule.
-								     max_eirp);
-				}
-			}
-
-			if (chan->flags & IEEE80211_CHAN_DISABLED) {
-				temp_chan_k->state =
-					CHANNEL_STATE_DISABLE;
-				temp_chan_k->flags = chan->flags;
-				if (n != -1) {
-					temp_chan_n->state =
-						CHANNEL_STATE_DISABLE;
-					temp_chan_n->flags = chan->flags;
-				}
-			} else if (chan->flags &
-				   (IEEE80211_CHAN_RADAR |
-				    IEEE80211_CHAN_PASSIVE_SCAN
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-					|
-					IEEE80211_CHAN_INDOOR_ONLY
-#endif
-				)) {
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-				if (chan->flags &
-				    IEEE80211_CHAN_INDOOR_ONLY)
-					chan->flags |=
-						IEEE80211_CHAN_PASSIVE_SCAN;
-#endif
-				temp_chan_k->state = CHANNEL_STATE_DFS;
-				temp_chan_k->pwr_limit =
-					chan->max_power;
-				temp_chan_k->flags = chan->flags;
-
-				if (n != -1) {
-					if ((chan->flags &
-					     IEEE80211_CHAN_NO_HT40) ==
-					    IEEE80211_CHAN_NO_HT40) {
-						temp_chan_n->state =
-							CHANNEL_STATE_DISABLE;
-					} else {
-						temp_chan_n->state =
-							CHANNEL_STATE_DFS;
-						temp_chan_n->pwr_limit =
-							 chan->max_power-3;
-					}
-					temp_chan_n->flags = chan->flags;
-				}
-				if ((chan->flags &
-				     IEEE80211_CHAN_NO_80MHZ) == 0)
-					hdd_ctx->isVHT80Allowed = 1;
-			} else {
-				temp_chan_k->state = CHANNEL_STATE_ENABLE;
-				temp_chan_k->pwr_limit = chan->max_power;
-				temp_chan_k->flags = chan->flags;
-				if (n != -1) {
-					if ((chan->flags &
-					     IEEE80211_CHAN_NO_HT40) ==
-					    IEEE80211_CHAN_NO_HT40) {
-						temp_chan_n->state =
-							CHANNEL_STATE_DISABLE;
-					} else {
-						temp_chan_n->state =
-							CHANNEL_STATE_ENABLE;
-						temp_chan_n->pwr_limit =
-							chan->max_power - 3;
-					}
-					temp_chan_n->flags = chan->flags;
-				}
-				if ((chan->flags &
-				     IEEE80211_CHAN_NO_80MHZ) == 0)
-					hdd_ctx->isVHT80Allowed = 1;
-			}
-		}
-	}
-
-	if (0 == (hdd_ctx->reg.eeprom_rd_ext &
-		  (1 << WHAL_REG_EXT_FCC_CH_144))) {
-		temp_chan = &(reg_channels[RF_CHAN_144]);
-		temp_chan->state =
-			CHANNEL_STATE_DISABLE;
-	}
-
-	if (k == 0)
-		return -1;
-
-	return 0;
-}
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)) && !defined(WITH_BACKPORTS)
-/**
- * restore_custom_reg_settings() - restore custom reg settings
- * @wiphy: wiphy structure
- *
- * Return: void
- */
-static void restore_custom_reg_settings(struct wiphy *wiphy)
-{
-	struct ieee80211_supported_band *sband;
-	enum ieee80211_band band;
-	struct ieee80211_channel *chan;
-	int i;
-
-	for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
-		sband = wiphy->bands[band];
-		if (!sband)
-			continue;
-		for (i = 0; i < sband->n_channels; i++) {
-			chan = &sband->channels[i];
-			chan->flags = chan->orig_flags;
-			chan->max_antenna_gain = chan->orig_mag;
-			chan->max_power = chan->orig_mpwr;
-		}
-	}
-}
-#endif
-
-/**
- * __hdd_reg_notifier() - regulatory notifier
- * @wiphy: wiphy
- * @request: regulatory request
- *
- * Return: void or int
- */
-void __hdd_reg_notifier(struct wiphy *wiphy,
-		      struct regulatory_request *request)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	eCsrBand band_capability = eCSR_BAND_ALL;
-	bool vht80_allowed;
-	bool reset = false;
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  FL("country: %c%c, initiator %d, dfs_region: %d"),
-		  request->alpha2[0],
-		  request->alpha2[1],
-		  request->initiator,
-		  request->dfs_region);
-
-	if (NULL == hdd_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  ("Invalid pHddCtx pointer"));
-		return;
-	}
-
-	if (cds_is_driver_unloading() || cds_is_driver_recovering()) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Unloading or SSR in Progress, Ignore!!!",
-			  __func__);
-		return;
-	}
-
-	sme_get_freq_band(hdd_ctx->hHal, &band_capability);
-
-	/* first check if this callback is in response to the driver callback */
-
-	switch (request->initiator) {
-	case NL80211_REGDOM_SET_BY_DRIVER:
-	case NL80211_REGDOM_SET_BY_CORE:
-	case NL80211_REGDOM_SET_BY_USER:
-
-		if ((false == init_by_driver) &&
-		    (false == init_by_reg_core)) {
-
-			if (NL80211_REGDOM_SET_BY_CORE == request->initiator) {
-				return;
-			}
-			init_by_reg_core = true;
-		}
-
-		if ((NL80211_REGDOM_SET_BY_DRIVER == request->initiator) &&
-		    (true == init_by_driver)) {
-
-			/*
-			 * restore the driver regulatory flags since
-			 * regulatory_hint may have
-			 * changed them
-			 */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-			wiphy->regulatory_flags = hdd_ctx->reg.reg_flags;
-#else
-			wiphy->flags = hdd_ctx->reg.reg_flags;
-#endif
-		}
-
-		if (NL80211_REGDOM_SET_BY_CORE == request->initiator) {
-			hdd_ctx->reg.cc_src = SOURCE_CORE;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
-			if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG)
-#else
-			if (wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)
-#endif
-				reset = true;
-		} else if (NL80211_REGDOM_SET_BY_DRIVER == request->initiator)
-			hdd_ctx->reg.cc_src = SOURCE_DRIVER;
-		else {
-			hdd_ctx->reg.cc_src = SOURCE_USERSPACE;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)) && !defined(WITH_BACKPORTS)
-			if ((request->alpha2[0] == '0') &&
-			    (request->alpha2[1] == '0') &&
-			    (wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY)) {
-				restore_custom_reg_settings(wiphy);
-				reset = true;
-			}
-#endif
-		}
-
-		hdd_ctx->reg.alpha2[0] = request->alpha2[0];
-		hdd_ctx->reg.alpha2[1] = request->alpha2[1];
-
-		cds_update_regulatory_info(hdd_ctx);
-
-		vht80_allowed = hdd_ctx->isVHT80Allowed;
-		if (cds_process_regulatory_data(wiphy, band_capability,
-						reset) == 0) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-				  (" regulatory entry created"));
-		}
-		if (hdd_ctx->isVHT80Allowed != vht80_allowed)
-			hdd_checkandupdate_phymode(hdd_ctx);
-
-		if (NL80211_REGDOM_SET_BY_DRIVER == request->initiator)
-			complete(&hdd_ctx->reg_init);
-
-		sme_generic_change_country_code(hdd_ctx->hHal,
-						hdd_ctx->reg.alpha2);
-
-		cds_fill_and_send_ctl_to_fw(&hdd_ctx->reg);
-
-		cds_set_dfs_region(request->dfs_region);
-
-		cds_set_wma_dfs_region(&hdd_ctx->reg);
-	default:
-		break;
-	}
-
-	return;
-}
-
-/**
- * hdd_reg_notifier() - regulatory notifier
- * @wiphy: wiphy
- * @request: regulatory request
- *
- * Return: void or int
- */
-void hdd_reg_notifier(struct wiphy *wiphy,
-		      struct regulatory_request *request)
-{
-	cds_ssr_protect(__func__);
-	__hdd_reg_notifier(wiphy, request);
-	cds_ssr_unprotect(__func__);
-}
-
-/**
- * cds_regulatory_init() - regulatory_init
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_regulatory_init(void)
-{
-	hdd_context_t *hdd_ctx = NULL;
-	struct wiphy *wiphy = NULL;
-	int ret_val = 0;
-	struct regulatory *reg_info;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "invalid hdd_ctx pointer");
-		return CDF_STATUS_E_FAULT;
-	}
-
-	wiphy = hdd_ctx->wiphy;
-
-	reg_info = &hdd_ctx->reg;
-
-	cds_regulatory_wiphy_init(hdd_ctx, reg_info, wiphy);
-
-	if (cds_process_regulatory_data(wiphy,
-					hdd_ctx->config->
-					nBandCapability, true) != 0) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  ("Error while creating regulatory entry"));
-		return CDF_STATUS_E_FAULT;
-	}
-
-	reg_info->cc_src = SOURCE_DRIVER;
-
-	ret_val = cds_fill_some_regulatory_info(reg_info);
-	if (ret_val) {
-		cdf_print(KERN_ERR "Error in getting country code\n");
-		return ret_val;
-	}
-
-	hdd_ctx->reg.def_country[0] = reg_info->alpha2[0];
-	hdd_ctx->reg.def_country[1] = reg_info->alpha2[1];
-
-	init_completion(&hdd_ctx->reg_init);
-
-	cds_fill_and_send_ctl_to_fw(reg_info);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_set_reg_domain() - set regulatory domain
- * @client_ctxt: client context
- * @reg_domain: regulatory domain
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS cds_set_reg_domain(void *client_ctxt, v_REGDOMAIN_t reg_domain)
-{
-	if (reg_domain >= REGDOMAIN_COUNT) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "CDS set reg domain, invalid REG domain ID %d",
-			  reg_domain);
-		return CDF_STATUS_E_INVAL;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_set_ch_params() - set channel parameters
- * @ch: channel
- * @phy_mode: physical mode
- * @ch_param: channel parameters will be returned
- *
- * Return: None
- */
-void cds_set_ch_params(uint8_t ch, uint32_t phy_mode,
-		chan_params_t *ch_params)
-{
-	tHalHandle *hal_ctx = cds_get_context(CDF_MODULE_ID_PE);
-	if (!hal_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			("Invalid hal_ctx pointer"));
-		return;
-	}
-	/*
-	 * TODO: remove SME call and move the SME set channel
-	 * param functionality to CDS.
-	 */
-	sme_set_ch_params(hal_ctx, phy_mode, ch, 0, ch_params);
-}

+ 0 - 743
core/cds/src/cds_regdomain.c

@@ -1,743 +0,0 @@
-/*
- * Copyright (c) 2011,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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/*
- * Notifications and licenses are retained for attribution purposes only.
- */
-/*
- * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
- * Copyright (c) 2005-2006 Atheros Communications, Inc.
- * Copyright (c) 2010, Atheros Communications Inc.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the following conditions are met:
- * 1. The materials contained herein are unmodified and are used
- *    unmodified.
- * 2. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following NO
- *    ''WARRANTY'' disclaimer below (''Disclaimer''), without
- *    modification.
- * 3. Redistributions in binary form must reproduce at minimum a
- *    disclaimer similar to the Disclaimer below and any redistribution
- *    must be conditioned upon including a substantially similar
- *    Disclaimer requirement for further binary redistribution.
- * 4. Neither the names of the above-listed copyright holders nor the
- *    names of any contributors may be used to endorse or promote
- *    product derived from this software without specific prior written
- *    permission.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT,
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
- * FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGES.
- */
-
-#include <cdf_types.h>
-#include "wma.h"
-#include "cds_regdomain.h"
-#include "cds_regdomain_common.h"
-
-static regdm_supp_op_classes regdm_curr_supp_opp_classes = { 0 };
-
-/* Global Operating Classes */
-regdm_op_class_map_t global_op_class[] = {
-	{81, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}},
-	{82, 25, BW20, {14}},
-	{83, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7, 8, 9}},
-	{84, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11, 12, 13}},
-	{115, 20, BW20, {36, 40, 44, 48}},
-	{116, 40, BW40_LOW_PRIMARY, {36, 44}},
-	{117, 40, BW40_HIGH_PRIMARY, {40, 48}},
-	{118, 20, BW20, {52, 56, 60, 64}},
-	{119, 40, BW40_LOW_PRIMARY, {52, 60}},
-	{120, 40, BW40_HIGH_PRIMARY, {56, 64}},
-	{121, 20, BW20,
-	 {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}},
-	{122, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}},
-	{123, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}},
-	{125, 20, BW20, {149, 153, 157, 161, 165, 169}},
-	{126, 40, BW40_LOW_PRIMARY, {149, 157}},
-	{127, 40, BW40_HIGH_PRIMARY, {153, 161}},
-	{128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108,
-			   112, 116, 120, 124, 128, 132, 136, 140, 144,
-			   149, 153, 157, 161} },
-	{0, 0, 0, {0}},
-};
-
-/* Operating Classes in US */
-regdm_op_class_map_t us_op_class[] = {
-	{1, 20, BW20, {36, 40, 44, 48}},
-	{2, 20, BW20, {52, 56, 60, 64}},
-	{4, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
-			144} },
-	{5, 20, BW20, {149, 153, 157, 161, 165}},
-	{12, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}},
-	{22, 40, BW40_LOW_PRIMARY, {36, 44}},
-	{23, 40, BW40_LOW_PRIMARY, {52, 60}},
-	{24, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}},
-	{26, 40, BW40_LOW_PRIMARY, {149, 157}},
-	{27, 40, BW40_HIGH_PRIMARY, {40, 48}},
-	{28, 40, BW40_HIGH_PRIMARY, {56, 64}},
-	{29, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}},
-	{31, 40, BW40_HIGH_PRIMARY, {153, 161}},
-	{32, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7}},
-	{33, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11}},
-	{128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108,
-			   112, 116, 120, 124, 128, 132, 136, 140, 144,
-			   149, 153, 157, 161} },
-	{0, 0, 0, {0}},
-};
-
-/* Operating Classes in Europe */
-regdm_op_class_map_t euro_op_class[] = {
-	{1, 20, BW20, {36, 40, 44, 48}},
-	{2, 20, BW20, {52, 56, 60, 64}},
-	{3, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}},
-	{4, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}},
-	{5, 40, BW40_LOW_PRIMARY, {36, 44}},
-	{6, 40, BW40_LOW_PRIMARY, {52, 60}},
-	{7, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}},
-	{8, 40, BW40_HIGH_PRIMARY, {40, 48}},
-	{9, 40, BW40_HIGH_PRIMARY, {56, 64}},
-	{10, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}},
-	{11, 40, BW40_LOW_PRIMARY, {1, 2, 3, 4, 5, 6, 7, 8, 9}},
-	{12, 40, BW40_HIGH_PRIMARY, {5, 6, 7, 8, 9, 10, 11, 12, 13}},
-	{17, 20, BW20, {149, 153, 157, 161, 165, 169}},
-	{128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112,
-			   116, 120, 124, 128} },
-	{0, 0, 0, {0}},
-};
-
-/* Operating Classes in Japan */
-regdm_op_class_map_t japan_op_class[] = {
-	{1, 20, BW20, {36, 40, 44, 48}},
-	{30, 25, BW20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}},
-	{31, 25, BW20, {14}},
-	{32, 20, BW20, {52, 56, 60, 64}},
-	{34, 20, BW20, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}},
-	{36, 40, BW40_LOW_PRIMARY, {36, 44}},
-	{37, 40, BW40_LOW_PRIMARY, {52, 60}},
-	{39, 40, BW40_LOW_PRIMARY, {100, 108, 116, 124, 132}},
-	{41, 40, BW40_HIGH_PRIMARY, {40, 48}},
-	{42, 40, BW40_HIGH_PRIMARY, {56, 64}},
-	{44, 40, BW40_HIGH_PRIMARY, {104, 112, 120, 128, 136}},
-	{128, 80, BW80, {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112,
-			   116, 120, 124, 128} },
-	{0, 0, 0, {0}},
-};
-
-/*
- * By default, the regdomain tables reference the common tables
- * from regdomain_common.h.  These default tables can be replaced
- * by calls to populate_regdomain_tables functions.
- */
-HAL_REG_DMN_TABLES ol_regdmn_rdt = {
-	ah_cmn_reg_domain_pairs,    /* regDomainPairs */
-	ah_cmn_all_countries,      /* allCountries */
-	ah_cmn_reg_domains,        /* allRegDomains */
-	CDF_ARRAY_SIZE(ah_cmn_reg_domain_pairs), /* regDomainPairsCt */
-	CDF_ARRAY_SIZE(ah_cmn_all_countries),   /* allCountriesCt */
-	CDF_ARRAY_SIZE(ah_cmn_reg_domains),     /* allRegDomainCt */
-};
-
-static uint16_t get_eeprom_rd(uint16_t rd)
-{
-	return rd & ~WORLDWIDE_ROAMING_FLAG;
-}
-
-/*
- * Return whether or not the regulatory domain/country in EEPROM
- * is acceptable.
- */
-static bool regdmn_is_eeprom_valid(uint16_t rd)
-{
-	int32_t i;
-
-	if (rd & COUNTRY_ERD_FLAG) {
-		uint16_t cc = rd & ~COUNTRY_ERD_FLAG;
-		for (i = 0; i < ol_regdmn_rdt.allCountriesCt; i++)
-			if (ol_regdmn_rdt.allCountries[i].countryCode == cc)
-				return true;
-	} else {
-		for (i = 0; i < ol_regdmn_rdt.regDomainPairsCt; i++)
-			if (ol_regdmn_rdt.regDomainPairs[i].regDmnEnum == rd)
-				return true;
-	}
-	/* TODO: Bring it under debug level */
-	cdf_print("%s: invalid regulatory domain/country code 0x%x\n",
-		  __func__, rd);
-	return false;
-}
-
-/*
- * Find the pointer to the country element in the country table
- * corresponding to the country code
- */
-static const COUNTRY_CODE_TO_ENUM_RD *find_country(uint16_t country_code)
-{
-	int32_t i;
-
-	for (i = 0; i < ol_regdmn_rdt.allCountriesCt; i++) {
-		if (ol_regdmn_rdt.allCountries[i].countryCode == country_code)
-			return &ol_regdmn_rdt.allCountries[i];
-	}
-	return NULL;            /* Not found */
-}
-
-int32_t cds_get_country_from_alpha2(uint8_t *alpha2)
-{
-	int32_t i;
-
-	for (i = 0; i < ol_regdmn_rdt.allCountriesCt; i++) {
-		if (ol_regdmn_rdt.allCountries[i].isoName[0] == alpha2[0] &&
-		    ol_regdmn_rdt.allCountries[i].isoName[1] == alpha2[1])
-			return ol_regdmn_rdt.allCountries[i].countryCode;
-	}
-	return CTRY_DEFAULT;
-}
-
-static uint16_t regdmn_get_default_country(uint16_t rd)
-{
-	int32_t i;
-
-	if (rd & COUNTRY_ERD_FLAG) {
-		const COUNTRY_CODE_TO_ENUM_RD *country = NULL;
-		uint16_t cc = rd & ~COUNTRY_ERD_FLAG;
-
-		country = find_country(cc);
-		if (country)
-			return cc;
-	}
-
-	/*
-	 * Check reg domains that have only one country
-	 */
-	for (i = 0; i < ol_regdmn_rdt.regDomainPairsCt; i++) {
-		if (ol_regdmn_rdt.regDomainPairs[i].regDmnEnum == rd) {
-			if (ol_regdmn_rdt.regDomainPairs[i].singleCC != 0)
-				return ol_regdmn_rdt.regDomainPairs[i].singleCC;
-			else
-				i = ol_regdmn_rdt.regDomainPairsCt;
-		}
-	}
-	return CTRY_DEFAULT;
-}
-
-static const REG_DMN_PAIR_MAPPING *get_regdmn_pair(uint16_t reg_dmn)
-{
-	int32_t i;
-
-	for (i = 0; i < ol_regdmn_rdt.regDomainPairsCt; i++) {
-		if (ol_regdmn_rdt.regDomainPairs[i].regDmnEnum == reg_dmn)
-			return &ol_regdmn_rdt.regDomainPairs[i];
-	}
-	return NULL;
-}
-
-static const REG_DOMAIN *get_regdmn(uint16_t reg_dmn)
-{
-	int32_t i;
-
-	for (i = 0; i < ol_regdmn_rdt.regDomainsCt; i++) {
-		if (ol_regdmn_rdt.regDomains[i].regDmnEnum == reg_dmn)
-			return &ol_regdmn_rdt.regDomains[i];
-	}
-	return NULL;
-}
-
-static const COUNTRY_CODE_TO_ENUM_RD *get_country_from_rd(uint16_t regdmn)
-{
-	int32_t i;
-
-	for (i = 0; i < ol_regdmn_rdt.allCountriesCt; i++) {
-		if (ol_regdmn_rdt.allCountries[i].regDmnEnum == regdmn)
-			return &ol_regdmn_rdt.allCountries[i];
-	}
-	return NULL;            /* Not found */
-}
-
-/*
- * Some users have reported their EEPROM programmed with
- * 0x8000 set, this is not a supported regulatory domain
- * but since we have more than one user with it we need
- * a solution for them. We default to WOR0_WORLD
- */
-static void regd_sanitize(struct regulatory *reg)
-{
-	if (reg->reg_domain != COUNTRY_ERD_FLAG)
-		return;
-	reg->reg_domain = WOR0_WORLD;
-}
-
-/*
- * Returns country string for the given regulatory domain.
- */
-int32_t cds_fill_some_regulatory_info(struct regulatory *reg)
-{
-	uint16_t country_code;
-	uint16_t regdmn, rd;
-	const COUNTRY_CODE_TO_ENUM_RD *country = NULL;
-
-	regd_sanitize(reg);
-	rd = reg->reg_domain;
-
-	if (!regdmn_is_eeprom_valid(rd))
-		return -EINVAL;
-
-	regdmn = get_eeprom_rd(rd);
-
-	country_code = regdmn_get_default_country(regdmn);
-	if (country_code == CTRY_DEFAULT && regdmn == CTRY_DEFAULT) {
-		/* Set to CTRY_UNITED_STATES for testing */
-		country_code = CTRY_UNITED_STATES;
-	}
-
-	if (country_code != CTRY_DEFAULT) {
-		country = find_country(country_code);
-		if (!country) {
-			/* TODO: Bring it under debug level */
-			cdf_print(KERN_ERR "Not a valid country code\n");
-			return -EINVAL;
-		}
-		regdmn = country->regDmnEnum;
-	}
-
-	reg->regpair = get_regdmn_pair(regdmn);
-	if (!reg->regpair) {
-		/* TODO: Bring it under debug level */
-		cdf_print(KERN_ERR "No regpair is found, can not proceeed\n");
-		return -EINVAL;
-	}
-	reg->country_code = country_code;
-
-	if (!country)
-		country = get_country_from_rd(regdmn);
-
-	if (country) {
-		reg->alpha2[0] = country->isoName[0];
-		reg->alpha2[1] = country->isoName[1];
-	} else {
-		reg->alpha2[0] = '0';
-		reg->alpha2[1] = '0';
-	}
-
-	return 0;
-}
-
-/*
- * Returns regulatory domain for given country string
- */
-int32_t regdmn_get_regdmn_for_country(uint8_t *alpha2)
-{
-	uint8_t i;
-
-	for (i = 0; i < ol_regdmn_rdt.allCountriesCt; i++) {
-		if ((ol_regdmn_rdt.allCountries[i].isoName[0] == alpha2[0]) &&
-		    (ol_regdmn_rdt.allCountries[i].isoName[1] == alpha2[1]))
-			return ol_regdmn_rdt.allCountries[i].regDmnEnum;
-	}
-	return -1;
-}
-
-/*
- * Test to see if the bitmask array is all zeros
- */
-static bool is_chan_bit_mask_zero(const uint64_t *bitmask)
-{
-	int i;
-
-	for (i = 0; i < BMLEN; i++) {
-		if (bitmask[i] != 0)
-			return false;
-	}
-	return true;
-}
-
-/*
- * Return the mask of available modes based on the hardware
- * capabilities and the specified country code and reg domain.
- */
-static uint32_t regdmn_getwmodesnreg(uint32_t modesAvail,
-				     const COUNTRY_CODE_TO_ENUM_RD *country,
-				     const REG_DOMAIN *rd5GHz)
-{
-
-	/* Check country regulations for allowed modes */
-	if ((modesAvail & (REGDMN_MODE_11A_TURBO | REGDMN_MODE_TURBO)) &&
-	    (!country->allow11aTurbo))
-		modesAvail &= ~(REGDMN_MODE_11A_TURBO | REGDMN_MODE_TURBO);
-
-	if ((modesAvail & REGDMN_MODE_11G_TURBO) && (!country->allow11gTurbo))
-		modesAvail &= ~REGDMN_MODE_11G_TURBO;
-
-	if ((modesAvail & REGDMN_MODE_11G) && (!country->allow11g))
-		modesAvail &= ~REGDMN_MODE_11G;
-
-	if ((modesAvail & REGDMN_MODE_11A) &&
-	    (is_chan_bit_mask_zero(rd5GHz->chan11a)))
-		modesAvail &= ~REGDMN_MODE_11A;
-
-	if ((modesAvail & REGDMN_MODE_11NG_HT20) && (!country->allow11ng20))
-		modesAvail &= ~REGDMN_MODE_11NG_HT20;
-
-	if ((modesAvail & REGDMN_MODE_11NA_HT20) && (!country->allow11na20))
-		modesAvail &= ~REGDMN_MODE_11NA_HT20;
-
-	if ((modesAvail & REGDMN_MODE_11NG_HT40PLUS) && (!country->allow11ng40))
-		modesAvail &= ~REGDMN_MODE_11NG_HT40PLUS;
-
-	if ((modesAvail & REGDMN_MODE_11NG_HT40MINUS) &&
-	    (!country->allow11ng40))
-		modesAvail &= ~REGDMN_MODE_11NG_HT40MINUS;
-
-	if ((modesAvail & REGDMN_MODE_11NA_HT40PLUS) && (!country->allow11na40))
-		modesAvail &= ~REGDMN_MODE_11NA_HT40PLUS;
-
-	if ((modesAvail & REGDMN_MODE_11NA_HT40MINUS) &&
-	    (!country->allow11na40))
-		modesAvail &= ~REGDMN_MODE_11NA_HT40MINUS;
-
-	if ((modesAvail & REGDMN_MODE_11AC_VHT20) && (!country->allow11na20))
-		modesAvail &= ~REGDMN_MODE_11AC_VHT20;
-
-	if ((modesAvail & REGDMN_MODE_11AC_VHT40PLUS) &&
-	    (!country->allow11na40))
-		modesAvail &= ~REGDMN_MODE_11AC_VHT40PLUS;
-
-	if ((modesAvail & REGDMN_MODE_11AC_VHT40MINUS) &&
-	    (!country->allow11na40))
-		modesAvail &= ~REGDMN_MODE_11AC_VHT40MINUS;
-
-	if ((modesAvail & REGDMN_MODE_11AC_VHT80) && (!country->allow11na80))
-		modesAvail &= ~REGDMN_MODE_11AC_VHT80;
-
-	if ((modesAvail & REGDMN_MODE_11AC_VHT20_2G) && (!country->allow11ng20))
-		modesAvail &= ~REGDMN_MODE_11AC_VHT20_2G;
-
-	return modesAvail;
-}
-
-void cds_fill_send_ctl_info_to_fw(struct regulatory *reg, uint32_t modesAvail,
-				  uint32_t modeSelect)
-{
-	const REG_DOMAIN *regdomain2G = NULL;
-	const REG_DOMAIN *regdomain5G = NULL;
-	int8_t ctl_2g, ctl_5g, ctl;
-	const REG_DOMAIN *rd = NULL;
-	const struct cmode *cm;
-	const COUNTRY_CODE_TO_ENUM_RD *country;
-	const REG_DMN_PAIR_MAPPING *regpair;
-
-	regpair = reg->regpair;
-	regdomain2G = get_regdmn(regpair->regDmn2GHz);
-	if (!regdomain2G) {
-		cdf_print(KERN_ERR "Failed to get regdmn 2G");
-		return;
-	}
-
-	regdomain5G = get_regdmn(regpair->regDmn5GHz);
-	if (!regdomain5G) {
-		cdf_print(KERN_ERR "Failed to get regdmn 5G");
-		return;
-	}
-
-	/* find first nible of CTL */
-	ctl_2g = regdomain2G->conformance_test_limit;
-	ctl_5g = regdomain5G->conformance_test_limit;
-
-	/* find second nible of CTL */
-	country = find_country(reg->country_code);
-	if (country != NULL)
-		modesAvail =
-			regdmn_getwmodesnreg(modesAvail, country, regdomain5G);
-
-	for (cm = modes; cm < &modes[CDF_ARRAY_SIZE(modes)]; cm++) {
-
-		if ((cm->mode & modeSelect) == 0)
-			continue;
-
-		if ((cm->mode & modesAvail) == 0)
-			continue;
-
-		switch (cm->mode) {
-		case REGDMN_MODE_TURBO:
-			rd = regdomain5G;
-			ctl = rd->conformance_test_limit | CTL_TURBO;
-			break;
-		case REGDMN_MODE_11A:
-		case REGDMN_MODE_11NA_HT20:
-		case REGDMN_MODE_11NA_HT40PLUS:
-		case REGDMN_MODE_11NA_HT40MINUS:
-		case REGDMN_MODE_11AC_VHT20:
-		case REGDMN_MODE_11AC_VHT40PLUS:
-		case REGDMN_MODE_11AC_VHT40MINUS:
-		case REGDMN_MODE_11AC_VHT80:
-			rd = regdomain5G;
-			ctl = rd->conformance_test_limit;
-			break;
-		case REGDMN_MODE_11B:
-			rd = regdomain2G;
-			ctl = rd->conformance_test_limit | CTL_11B;
-			break;
-		case REGDMN_MODE_11G:
-		case REGDMN_MODE_11NG_HT20:
-		case REGDMN_MODE_11NG_HT40PLUS:
-		case REGDMN_MODE_11NG_HT40MINUS:
-		case REGDMN_MODE_11AC_VHT20_2G:
-		case REGDMN_MODE_11AC_VHT40_2G:
-		case REGDMN_MODE_11AC_VHT80_2G:
-			rd = regdomain2G;
-			ctl = rd->conformance_test_limit | CTL_11G;
-			break;
-		case REGDMN_MODE_11G_TURBO:
-			rd = regdomain2G;
-			ctl = rd->conformance_test_limit | CTL_108G;
-			break;
-		case REGDMN_MODE_11A_TURBO:
-			rd = regdomain5G;
-			ctl = rd->conformance_test_limit | CTL_108G;
-			break;
-		default:
-			cdf_print(KERN_ERR "%s: Unkonwn HAL mode 0x%x\n",
-				  __func__, cm->mode);
-			continue;
-		}
-
-		if (rd == regdomain2G)
-			ctl_2g = ctl;
-
-		if (rd == regdomain5G)
-			ctl_5g = ctl;
-	}
-
-	/* save the ctl information for future reference */
-	reg->ctl_5g = ctl_5g;
-	reg->ctl_2g = ctl_2g;
-
-	wma_send_regdomain_info_to_fw(reg->reg_domain, regpair->regDmn2GHz,
-				      regpair->regDmn5GHz, ctl_2g, ctl_5g);
-}
-
-/* cds_set_wma_dfs_region() - to set the dfs region to wma
- *
- * @reg: the regulatory handle
- *
- * Return: none
- */
-void cds_set_wma_dfs_region(struct regulatory *reg)
-{
-	tp_wma_handle wma = cds_get_context(CDF_MODULE_ID_WMA);
-
-	if (!wma) {
-		cdf_print(KERN_ERR "%s: Unable to get WMA handle", __func__);
-		return;
-	}
-
-	cdf_print("%s: dfs_region: %d", __func__, reg->dfs_region);
-	wma_set_dfs_region(wma, reg->dfs_region);
-}
-
-void cds_fill_and_send_ctl_to_fw(struct regulatory *reg)
-{
-	tp_wma_handle wma = cds_get_context(CDF_MODULE_ID_WMA);
-	uint32_t modeSelect = 0xFFFFFFFF;
-
-	if (!wma) {
-		WMA_LOGE("%s: Unable to get WMA handle", __func__);
-		return;
-	}
-
-	wma_get_modeselect(wma, &modeSelect);
-
-	cds_fill_send_ctl_info_to_fw(reg, wma->reg_cap.wireless_modes,
-				     modeSelect);
-	return;
-}
-
-/* get the ctl from regdomain */
-uint8_t cds_get_ctl_for_regdmn(uint32_t reg_dmn)
-{
-	uint8_t i;
-	uint8_t default_regdmn_ctl = FCC;
-
-	if (reg_dmn == CTRY_DEFAULT) {
-		return default_regdmn_ctl;
-	} else {
-		for (i = 0; i < ol_regdmn_rdt.regDomainsCt; i++) {
-			if (ol_regdmn_rdt.regDomains[i].regDmnEnum == reg_dmn)
-				return ol_regdmn_rdt.regDomains[i].
-				       conformance_test_limit;
-		}
-	}
-	return -1;
-}
-
-/*
- * Get the 5G reg domain value for reg doamin
- */
-uint16_t cds_get_regdmn_5g(uint32_t reg_dmn)
-{
-	uint16_t i;
-
-	for (i = 0; i < ol_regdmn_rdt.regDomainPairsCt; i++) {
-		if (ol_regdmn_rdt.regDomainPairs[i].regDmnEnum == reg_dmn) {
-			return ol_regdmn_rdt.regDomainPairs[i].regDmn5GHz;
-		}
-	}
-	cdf_print("%s: invalid regulatory domain/country code 0x%x\n",
-		  __func__, reg_dmn);
-	return 0;
-}
-
-/**
- * cds_regdm_get_chanwidth_from_opclass() - return chan width based on opclass
- * @country: country name
- * @channel: operating channel
- * @opclass: operating class
- *
- * Given a value of country, channel and opclass this API will return value of
- * channel width.
- *
- * Return: channel width
- *
- */
-uint16_t cds_regdm_get_chanwidth_from_opclass(uint8_t *country,
-					       uint8_t channel,
-					       uint8_t opclass)
-{
-	regdm_op_class_map_t *class;
-	uint16_t i;
-
-	if (true == cdf_mem_compare(country, "US", 2))
-		class = us_op_class;
-	else if (true == cdf_mem_compare(country, "EU", 2))
-		class = euro_op_class;
-	else if (true == cdf_mem_compare(country, "JP", 2))
-		class = japan_op_class;
-	else
-		class = global_op_class;
-
-	while (class->op_class) {
-		if (opclass == class->op_class) {
-			for (i = 0;
-			  (i < MAX_CHANNELS_PER_OPERATING_CLASS &&
-			   class->channels[i]);
-			   i++) {
-				if (channel == class->channels[i])
-					return class->ch_spacing;
-			}
-		}
-		class++;
-	}
-	return 0;
-}
-
-
-/*
- * Get operating class for a given channel
- */
-uint16_t cds_regdm_get_opclass_from_channel(uint8_t *country, uint8_t channel,
-					    uint8_t offset)
-{
-	regdm_op_class_map_t *class = NULL;
-	uint16_t i = 0;
-
-	if (true == cdf_mem_compare(country, "US", 2)) {
-		class = us_op_class;
-	} else if (true == cdf_mem_compare(country, "EU", 2)) {
-		class = euro_op_class;
-	} else if (true == cdf_mem_compare(country, "JP", 2)) {
-		class = japan_op_class;
-	} else {
-		class = global_op_class;
-	}
-
-	while (class->op_class) {
-		if ((offset == class->offset) || (offset == BWALL)) {
-			for (i = 0;
-			     (i < MAX_CHANNELS_PER_OPERATING_CLASS &&
-			      class->channels[i]); i++) {
-				if (channel == class->channels[i])
-					return class->op_class;
-			}
-		}
-		class++;
-	}
-	return 0;
-}
-
-/*
- * Set current operating classes per country, regdomain
- */
-uint16_t cds_regdm_set_curr_opclasses(uint8_t num_classes, uint8_t *class)
-{
-	uint8_t i;
-
-	if (SIR_MAC_MAX_SUPP_OPER_CLASSES < num_classes) {
-		cdf_print(KERN_ERR "%s: Invalid numClasses (%d)\n",
-			  __func__, num_classes);
-		return -1;
-	}
-
-	for (i = 0; i < num_classes; i++) {
-		regdm_curr_supp_opp_classes.classes[i] = class[i];
-	}
-	regdm_curr_supp_opp_classes.num_classes = num_classes;
-
-	return 0;
-}
-
-/*
- * Get current operating classes
- */
-uint16_t cds_regdm_get_curr_opclasses(uint8_t *num_classes, uint8_t *class)
-{
-	uint8_t i;
-
-	if (!num_classes || !class) {
-		cdf_print(KERN_ERR "%s: Either num_classes or class is null\n",
-			  __func__);
-		return -1;
-	}
-
-	for (i = 0; i < regdm_curr_supp_opp_classes.num_classes; i++) {
-		class[i] = regdm_curr_supp_opp_classes.classes[i];
-	}
-
-	*num_classes = regdm_curr_supp_opp_classes.num_classes;
-
-	return 0;
-}

+ 0 - 1282
core/cds/src/cds_sched.c

@@ -1,1282 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- *  File: cds_sched.c
- *
- *  DOC: CDS Scheduler Implementation
- */
-
- /* Include Files */
-#include <cds_mq.h>
-#include <cds_api.h>
-#include <ani_global.h>
-#include <sir_types.h>
-#include <cdf_types.h>
-#include <lim_api.h>
-#include <sme_api.h>
-#include <wlan_qct_sys.h>
-#include "cds_sched.h"
-#include <wlan_hdd_power.h>
-#include "wma_types.h"
-#include <linux/spinlock.h>
-#include <linux/kthread.h>
-#include <linux/cpu.h>
-#if defined(QCA_CONFIG_SMP) && defined(CONFIG_CNSS)
-#include <net/cnss.h>
-#endif
-/* Preprocessor Definitions and Constants */
-#define CDS_SCHED_THREAD_HEART_BEAT    INFINITE
-/* Milli seconds to delay SSR thread when an Entry point is Active */
-#define SSR_WAIT_SLEEP_TIME 200
-/* MAX iteration count to wait for Entry point to exit before
- * we proceed with SSR in WD Thread
- */
-#define MAX_SSR_WAIT_ITERATIONS 200
-#define MAX_SSR_PROTECT_LOG (16)
-
-static atomic_t ssr_protect_entry_count;
-
-/**
- * struct ssr_protect - sub system restart(ssr) protection tracking table
- * @func: Function which needs ssr protection
- * @free: Flag to tell whether entry is free in table or not
- * @pid: Process id which needs ssr protection
- */
-struct ssr_protect {
-	const char *func;
-	bool  free;
-	uint32_t pid;
-};
-
-static spinlock_t ssr_protect_lock;
-static struct ssr_protect ssr_protect_log[MAX_SSR_PROTECT_LOG];
-
-static p_cds_sched_context gp_cds_sched_context;
-
-static int cds_mc_thread(void *Arg);
-#ifdef QCA_CONFIG_SMP
-static int cds_ol_rx_thread(void *arg);
-static unsigned long affine_cpu;
-static CDF_STATUS cds_alloc_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext);
-#endif
-
-#ifdef QCA_CONFIG_SMP
-#define CDS_CORE_PER_CLUSTER (4)
-static int cds_set_cpus_allowed_ptr(struct task_struct *task, unsigned long cpu)
-{
-#ifdef WLAN_OPEN_SOURCE
-	return set_cpus_allowed_ptr(task, cpumask_of(cpu));
-#elif defined(CONFIG_CNSS)
-	return cnss_set_cpus_allowed_ptr(task, cpu);
-#else
-	return 0;
-#endif
-}
-
-/**
- * cds_cpu_hotplug_notify() - hot plug notify
- * @block: Pointer to block
- * @state: State
- * @hcpu: Pointer to hotplug cpu
- *
- * Return: NOTIFY_OK
- */
-static int
-cds_cpu_hotplug_notify(struct notifier_block *block,
-		       unsigned long state, void *hcpu)
-{
-	unsigned long cpu = (unsigned long)hcpu;
-	unsigned long pref_cpu = 0;
-	p_cds_sched_context pSchedContext = get_cds_sched_ctxt();
-	int i;
-	unsigned int multi_cluster;
-	unsigned int num_cpus;
-
-	if ((NULL == pSchedContext) || (NULL == pSchedContext->ol_rx_thread))
-		return NOTIFY_OK;
-
-	if (cds_is_load_or_unload_in_progress())
-		return NOTIFY_OK;
-
-	num_cpus = num_possible_cpus();
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_LOW,
-		  "%s: RX CORE %d, STATE %d, NUM CPUS %d",
-		  __func__, (int)affine_cpu, (int)state, num_cpus);
-	multi_cluster = (num_cpus > CDS_CORE_PER_CLUSTER) ? 1 : 0;
-
-	switch (state) {
-	case CPU_ONLINE:
-		if ((!multi_cluster) && (affine_cpu != 0))
-			return NOTIFY_OK;
-
-		for_each_online_cpu(i) {
-			if (i == 0)
-				continue;
-			pref_cpu = i;
-			if (!multi_cluster)
-				break;
-		}
-		break;
-	case CPU_DEAD:
-		if (cpu != affine_cpu)
-			return NOTIFY_OK;
-
-		affine_cpu = 0;
-		for_each_online_cpu(i) {
-			if (i == 0)
-				continue;
-			pref_cpu = i;
-			if (!multi_cluster)
-				break;
-		}
-	}
-
-	if (pref_cpu == 0)
-		return NOTIFY_OK;
-
-	if (!cds_set_cpus_allowed_ptr(pSchedContext->ol_rx_thread, pref_cpu))
-		affine_cpu = pref_cpu;
-
-	return NOTIFY_OK;
-}
-
-static struct notifier_block cds_cpu_hotplug_notifier = {
-	.notifier_call = cds_cpu_hotplug_notify,
-};
-#endif
-
-/**
- * cds_sched_open() - initialize the CDS Scheduler
- * @p_cds_context: Pointer to the global CDS Context
- * @pSchedContext: Pointer to a previously allocated buffer big
- *	enough to hold a scheduler context.
- * @SchedCtxSize: CDS scheduler context size
- *
- * This function initializes the CDS Scheduler
- * Upon successful initialization:
- *	- All the message queues are initialized
- *	- The Main Controller thread is created and ready to receive and
- *	dispatch messages.
- *
- *
- * Return: CDF status
- */
-CDF_STATUS cds_sched_open(void *p_cds_context,
-		p_cds_sched_context pSchedContext,
-		uint32_t SchedCtxSize)
-{
-	CDF_STATUS vStatus = CDF_STATUS_SUCCESS;
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Opening the CDS Scheduler", __func__);
-	/* Sanity checks */
-	if ((p_cds_context == NULL) || (pSchedContext == NULL)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Null params being passed", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-	if (sizeof(cds_sched_context) != SchedCtxSize) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "%s: Incorrect CDS Sched Context size passed",
-			  __func__);
-		return CDF_STATUS_E_INVAL;
-	}
-	cdf_mem_zero(pSchedContext, sizeof(cds_sched_context));
-	pSchedContext->pVContext = p_cds_context;
-	vStatus = cds_sched_init_mqs(pSchedContext);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to initialize CDS Scheduler MQs",
-			  __func__);
-		return vStatus;
-	}
-	/* Initialize the helper events and event queues */
-	init_completion(&pSchedContext->McStartEvent);
-	init_completion(&pSchedContext->McShutdown);
-	init_completion(&pSchedContext->ResumeMcEvent);
-
-	spin_lock_init(&pSchedContext->McThreadLock);
-#ifdef QCA_CONFIG_SMP
-	spin_lock_init(&pSchedContext->ol_rx_thread_lock);
-#endif
-
-	init_waitqueue_head(&pSchedContext->mcWaitQueue);
-	pSchedContext->mcEventFlag = 0;
-
-#ifdef QCA_CONFIG_SMP
-	init_waitqueue_head(&pSchedContext->ol_rx_wait_queue);
-	init_completion(&pSchedContext->ol_rx_start_event);
-	init_completion(&pSchedContext->ol_suspend_rx_event);
-	init_completion(&pSchedContext->ol_resume_rx_event);
-	init_completion(&pSchedContext->ol_rx_shutdown);
-	pSchedContext->ol_rx_event_flag = 0;
-	spin_lock_init(&pSchedContext->ol_rx_queue_lock);
-	spin_lock_init(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	INIT_LIST_HEAD(&pSchedContext->ol_rx_thread_queue);
-	spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	INIT_LIST_HEAD(&pSchedContext->cds_ol_rx_pkt_freeq);
-	spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	if (cds_alloc_ol_rx_pkt_freeq(pSchedContext) != CDF_STATUS_SUCCESS) {
-		return CDF_STATUS_E_FAILURE;
-	}
-	register_hotcpu_notifier(&cds_cpu_hotplug_notifier);
-	pSchedContext->cpu_hot_plug_notifier = &cds_cpu_hotplug_notifier;
-#endif
-	gp_cds_sched_context = pSchedContext;
-
-	/* Create the CDS Main Controller thread */
-	pSchedContext->McThread = kthread_create(cds_mc_thread, pSchedContext,
-						 "cds_mc_thread");
-	if (IS_ERR(pSchedContext->McThread)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Could not Create CDS Main Thread Controller",
-			  __func__);
-		goto MC_THREAD_START_FAILURE;
-	}
-	wake_up_process(pSchedContext->McThread);
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: CDS Main Controller thread Created", __func__);
-
-#ifdef QCA_CONFIG_SMP
-	pSchedContext->ol_rx_thread = kthread_create(cds_ol_rx_thread,
-						       pSchedContext,
-						       "cds_ol_rx_thread");
-	if (IS_ERR(pSchedContext->ol_rx_thread)) {
-
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Could not Create CDS OL RX Thread",
-			  __func__);
-		goto OL_RX_THREAD_START_FAILURE;
-
-	}
-	wake_up_process(pSchedContext->ol_rx_thread);
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  ("CDS OL RX thread Created"));
-#endif
-	/*
-	 * Now make sure all threads have started before we exit.
-	 * Each thread should normally ACK back when it starts.
-	 */
-	wait_for_completion_interruptible(&pSchedContext->McStartEvent);
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: CDS MC Thread has started", __func__);
-#ifdef QCA_CONFIG_SMP
-	wait_for_completion_interruptible(&pSchedContext->ol_rx_start_event);
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: CDS OL Rx Thread has started", __func__);
-#endif
-	/* We're good now: Let's get the ball rolling!!! */
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: CDS Scheduler successfully Opened", __func__);
-	return CDF_STATUS_SUCCESS;
-
-#ifdef QCA_CONFIG_SMP
-OL_RX_THREAD_START_FAILURE:
-	/* Try and force the Main thread controller to exit */
-	set_bit(MC_SHUTDOWN_EVENT_MASK, &pSchedContext->mcEventFlag);
-	set_bit(MC_POST_EVENT_MASK, &pSchedContext->mcEventFlag);
-	wake_up_interruptible(&pSchedContext->mcWaitQueue);
-	/* Wait for MC to exit */
-	wait_for_completion_interruptible(&pSchedContext->McShutdown);
-#endif
-
-MC_THREAD_START_FAILURE:
-	/* De-initialize all the message queues */
-	cds_sched_deinit_mqs(pSchedContext);
-
-#ifdef QCA_CONFIG_SMP
-	unregister_hotcpu_notifier(&cds_cpu_hotplug_notifier);
-	cds_free_ol_rx_pkt_freeq(gp_cds_sched_context);
-#endif
-
-	return CDF_STATUS_E_RESOURCES;
-
-} /* cds_sched_open() */
-
-/**
- * cds_mc_thread() - cds main controller thread execution handler
- * @Arg: Pointer to the global CDS Sched Context
- *
- * Return: thread exit code
- */
-static int cds_mc_thread(void *Arg)
-{
-	p_cds_sched_context pSchedContext = (p_cds_sched_context) Arg;
-	p_cds_msg_wrapper pMsgWrapper = NULL;
-	tpAniSirGlobal pMacContext = NULL;
-	tSirRetStatus macStatus = eSIR_SUCCESS;
-	CDF_STATUS vStatus = CDF_STATUS_SUCCESS;
-	int retWaitStatus = 0;
-	bool shutdown = false;
-	hdd_context_t *pHddCtx = NULL;
-	v_CONTEXT_t p_cds_context = NULL;
-
-	if (Arg == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Bad Args passed", __func__);
-		return 0;
-	}
-	set_user_nice(current, -2);
-
-	/* Ack back to the context from which the main controller thread
-	 * has been created
-	 */
-	complete(&pSchedContext->McStartEvent);
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: MC Thread %d (%s) starting up", __func__, current->pid,
-		  current->comm);
-
-	/* Get the Global CDS Context */
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Global CDS context is Null", __func__);
-		return 0;
-	}
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!pHddCtx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: HDD context is Null", __func__);
-		return 0;
-	}
-
-	while (!shutdown) {
-		/* This implements the execution model algorithm */
-		retWaitStatus =
-			wait_event_interruptible(pSchedContext->mcWaitQueue,
-						 test_bit(MC_POST_EVENT_MASK,
-							  &pSchedContext->mcEventFlag)
-						 || test_bit(MC_SUSPEND_EVENT_MASK,
-							     &pSchedContext->mcEventFlag));
-
-		if (retWaitStatus == -ERESTARTSYS) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: wait_event_interruptible returned -ERESTARTSYS",
-				  __func__);
-			CDF_BUG(0);
-		}
-		clear_bit(MC_POST_EVENT_MASK, &pSchedContext->mcEventFlag);
-
-		while (1) {
-			/* Check if MC needs to shutdown */
-			if (test_bit
-				    (MC_SHUTDOWN_EVENT_MASK,
-				    &pSchedContext->mcEventFlag)) {
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: MC thread signaled to shutdown",
-					  __func__);
-				shutdown = true;
-				/* Check for any Suspend Indication */
-				if (test_bit
-					    (MC_SUSPEND_EVENT_MASK,
-					    &pSchedContext->mcEventFlag)) {
-					clear_bit(MC_SUSPEND_EVENT_MASK,
-						  &pSchedContext->mcEventFlag);
-
-					/* Unblock anyone waiting on suspend */
-					complete(&pHddCtx->mc_sus_event_var);
-				}
-				break;
-			}
-			/* Check the SYS queue first */
-			if (!cds_is_mq_empty(&pSchedContext->sysMcMq)) {
-				/* Service the SYS message queue */
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: Servicing the CDS SYS MC Message queue",
-					  __func__);
-				pMsgWrapper =
-					cds_mq_get(&pSchedContext->sysMcMq);
-				if (pMsgWrapper == NULL) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: pMsgWrapper is NULL",
-						  __func__);
-					CDF_ASSERT(0);
-					break;
-				}
-				vStatus =
-					sys_mc_process_msg(pSchedContext->pVContext,
-							   pMsgWrapper->pVosMsg);
-				if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: Issue Processing SYS message",
-						  __func__);
-				}
-				/* return message to the Core */
-				cds_core_return_msg(pSchedContext->pVContext,
-						    pMsgWrapper);
-				continue;
-			}
-			/* Check the WMA queue */
-			if (!cds_is_mq_empty(&pSchedContext->wmaMcMq)) {
-				/* Service the WMA message queue */
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: Servicing the CDS WMA MC Message queue",
-					  __func__);
-				pMsgWrapper =
-					cds_mq_get(&pSchedContext->wmaMcMq);
-				if (pMsgWrapper == NULL) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: pMsgWrapper is NULL",
-						  __func__);
-					CDF_ASSERT(0);
-					break;
-				}
-				vStatus =
-					wma_mc_process_msg(pSchedContext->pVContext,
-							 pMsgWrapper->pVosMsg);
-				if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: Issue Processing WMA message",
-						  __func__);
-				}
-				/* return message to the Core */
-				cds_core_return_msg(pSchedContext->pVContext,
-						    pMsgWrapper);
-				continue;
-			}
-			/* Check the PE queue */
-			if (!cds_is_mq_empty(&pSchedContext->peMcMq)) {
-				/* Service the PE message queue */
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: Servicing the CDS PE MC Message queue",
-					  __func__);
-				pMsgWrapper =
-					cds_mq_get(&pSchedContext->peMcMq);
-				if (NULL == pMsgWrapper) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: pMsgWrapper is NULL",
-						  __func__);
-					CDF_ASSERT(0);
-					break;
-				}
-
-				/* Need some optimization */
-				pMacContext =
-					cds_get_context(CDF_MODULE_ID_PE);
-				if (NULL == pMacContext) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_INFO,
-						  "MAC Context not ready yet");
-					cds_core_return_msg
-						(pSchedContext->pVContext,
-						pMsgWrapper);
-					continue;
-				}
-
-				macStatus =
-					pe_process_messages(pMacContext,
-							    (tSirMsgQ *)
-							    pMsgWrapper->pVosMsg);
-				if (eSIR_SUCCESS != macStatus) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: Issue Processing PE message",
-						  __func__);
-				}
-				/* return message to the Core */
-				cds_core_return_msg(pSchedContext->pVContext,
-						    pMsgWrapper);
-				continue;
-			}
-			/** Check the SME queue **/
-			if (!cds_is_mq_empty(&pSchedContext->smeMcMq)) {
-				/* Service the SME message queue */
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: Servicing the CDS SME MC Message queue",
-					  __func__);
-				pMsgWrapper =
-					cds_mq_get(&pSchedContext->smeMcMq);
-				if (NULL == pMsgWrapper) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: pMsgWrapper is NULL",
-						  __func__);
-					CDF_ASSERT(0);
-					break;
-				}
-
-				/* Need some optimization */
-				pMacContext =
-					cds_get_context(CDF_MODULE_ID_SME);
-				if (NULL == pMacContext) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_INFO,
-						  "MAC Context not ready yet");
-					cds_core_return_msg
-						(pSchedContext->pVContext,
-						pMsgWrapper);
-					continue;
-				}
-
-				vStatus =
-					sme_process_msg((tHalHandle) pMacContext,
-							pMsgWrapper->pVosMsg);
-				if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-					CDF_TRACE(CDF_MODULE_ID_CDF,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: Issue Processing SME message",
-						  __func__);
-				}
-				/* return message to the Core */
-				cds_core_return_msg(pSchedContext->pVContext,
-						    pMsgWrapper);
-				continue;
-			}
-			/* Check for any Suspend Indication */
-			if (test_bit
-				    (MC_SUSPEND_EVENT_MASK,
-				    &pSchedContext->mcEventFlag)) {
-				clear_bit(MC_SUSPEND_EVENT_MASK,
-					  &pSchedContext->mcEventFlag);
-				spin_lock(&pSchedContext->McThreadLock);
-
-				/* Mc Thread Suspended */
-				complete(&pHddCtx->mc_sus_event_var);
-
-				INIT_COMPLETION(pSchedContext->ResumeMcEvent);
-				spin_unlock(&pSchedContext->McThreadLock);
-
-				/* Wait foe Resume Indication */
-				wait_for_completion_interruptible
-					(&pSchedContext->ResumeMcEvent);
-			}
-			break;  /* All queues are empty now */
-		} /* while message loop processing */
-	} /* while true */
-	/* If we get here the MC thread must exit */
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: MC Thread exiting!!!!", __func__);
-	complete_and_exit(&pSchedContext->McShutdown, 0);
-} /* cds_mc_thread() */
-
-#ifdef QCA_CONFIG_SMP
-/**
- * cds_free_ol_rx_pkt_freeq() - free cds buffer free queue
- * @pSchedContext - pointer to the global CDS Sched Context
- *
- * This API does mem free of the buffers available in free cds buffer
- * queue which is used for Data rx processing.
- *
- * Return: none
- */
-void cds_free_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext)
-{
-	struct cds_ol_rx_pkt *pkt;
-
-	spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	while (!list_empty(&pSchedContext->cds_ol_rx_pkt_freeq)) {
-		pkt = list_entry((&pSchedContext->cds_ol_rx_pkt_freeq)->next,
-			typeof(*pkt), list);
-		list_del(&pkt->list);
-		spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-		cdf_mem_free(pkt);
-		spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	}
-	spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-}
-
-/**
- * cds_alloc_ol_rx_pkt_freeq() - Function to allocate free buffer queue
- * @pSchedContext - pointer to the global CDS Sched Context
- *
- * This API allocates CDS_MAX_OL_RX_PKT number of cds message buffers
- * which are used for Rx data processing.
- *
- * Return: status of memory allocation
- */
-static CDF_STATUS cds_alloc_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext)
-{
-	struct cds_ol_rx_pkt *pkt, *tmp;
-	int i;
-
-	for (i = 0; i < CDS_MAX_OL_RX_PKT; i++) {
-		pkt = cdf_mem_malloc(sizeof(*pkt));
-		if (!pkt) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s Vos packet allocation for ol rx thread failed",
-				  __func__);
-			goto free;
-		}
-		memset(pkt, 0, sizeof(*pkt));
-		spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-		list_add_tail(&pkt->list, &pSchedContext->cds_ol_rx_pkt_freeq);
-		spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	}
-
-	return CDF_STATUS_SUCCESS;
-
-free:
-	spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	list_for_each_entry_safe(pkt, tmp, &pSchedContext->cds_ol_rx_pkt_freeq,
-				 list) {
-		list_del(&pkt->list);
-		spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-		cdf_mem_free(pkt);
-		spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	}
-	spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	return CDF_STATUS_E_NOMEM;
-}
-
-/**
- * cds_free_ol_rx_pkt() - api to release cds message to the freeq
- * This api returns the cds message used for Rx data to the free queue
- * @pSchedContext: Pointer to the global CDS Sched Context
- * @pkt: CDS message buffer to be returned to free queue.
- *
- * Return: none
- */
-void
-cds_free_ol_rx_pkt(p_cds_sched_context pSchedContext,
-		    struct cds_ol_rx_pkt *pkt)
-{
-	memset(pkt, 0, sizeof(*pkt));
-	spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	list_add_tail(&pkt->list, &pSchedContext->cds_ol_rx_pkt_freeq);
-	spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-}
-
-/**
- * cds_alloc_ol_rx_pkt() - API to return next available cds message
- * @pSchedContext: Pointer to the global CDS Sched Context
- *
- * This api returns next available cds message buffer used for rx data
- * processing
- *
- * Return: Pointer to cds message buffer
- */
-struct cds_ol_rx_pkt *cds_alloc_ol_rx_pkt(p_cds_sched_context pSchedContext)
-{
-	struct cds_ol_rx_pkt *pkt;
-
-	spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	if (list_empty(&pSchedContext->cds_ol_rx_pkt_freeq)) {
-		spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-		return NULL;
-	}
-	pkt = list_first_entry(&pSchedContext->cds_ol_rx_pkt_freeq,
-			       struct cds_ol_rx_pkt, list);
-	list_del(&pkt->list);
-	spin_unlock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
-	return pkt;
-}
-
-/**
- * cds_indicate_rxpkt() - indicate rx data packet
- * @Arg: Pointer to the global CDS Sched Context
- * @pkt: CDS data message buffer
- *
- * This api enqueues the rx packet into ol_rx_thread_queue and notifies
- * cds_ol_rx_thread()
- *
- * Return: none
- */
-void
-cds_indicate_rxpkt(p_cds_sched_context pSchedContext,
-		   struct cds_ol_rx_pkt *pkt)
-{
-	spin_lock_bh(&pSchedContext->ol_rx_queue_lock);
-	list_add_tail(&pkt->list, &pSchedContext->ol_rx_thread_queue);
-	spin_unlock_bh(&pSchedContext->ol_rx_queue_lock);
-	set_bit(RX_POST_EVENT_MASK, &pSchedContext->ol_rx_event_flag);
-	wake_up_interruptible(&pSchedContext->ol_rx_wait_queue);
-}
-
-/**
- * cds_drop_rxpkt_by_staid() - api to drop pending rx packets for a sta
- * @pSchedContext: Pointer to the global CDS Sched Context
- * @staId: Station Id
- *
- * This api drops queued packets for a station, to drop all the pending
- * packets the caller has to send WLAN_MAX_STA_COUNT as staId.
- *
- * Return: none
- */
-void cds_drop_rxpkt_by_staid(p_cds_sched_context pSchedContext, uint16_t staId)
-{
-	struct list_head local_list;
-	struct cds_ol_rx_pkt *pkt, *tmp;
-	cdf_nbuf_t buf, next_buf;
-
-	INIT_LIST_HEAD(&local_list);
-	spin_lock_bh(&pSchedContext->ol_rx_queue_lock);
-	if (list_empty(&pSchedContext->ol_rx_thread_queue)) {
-		spin_unlock_bh(&pSchedContext->ol_rx_queue_lock);
-		return;
-	}
-	list_for_each_entry_safe(pkt, tmp, &pSchedContext->ol_rx_thread_queue,
-								list) {
-		if (pkt->staId == staId || staId == WLAN_MAX_STA_COUNT)
-			list_move_tail(&pkt->list, &local_list);
-	}
-	spin_unlock_bh(&pSchedContext->ol_rx_queue_lock);
-
-	list_for_each_entry_safe(pkt, tmp, &local_list, list) {
-		list_del(&pkt->list);
-		buf = pkt->Rxpkt;
-		while (buf) {
-			next_buf = cdf_nbuf_queue_next(buf);
-			cdf_nbuf_free(buf);
-			buf = next_buf;
-		}
-		cds_free_ol_rx_pkt(pSchedContext, pkt);
-	}
-}
-
-/**
- * cds_rx_from_queue() - function to process pending Rx packets
- * @pSchedContext: Pointer to the global CDS Sched Context
- *
- * This api traverses the pending buffer list and calling the callback.
- * This callback would essentially send the packet to HDD.
- *
- * Return: none
- */
-static void cds_rx_from_queue(p_cds_sched_context pSchedContext)
-{
-	struct cds_ol_rx_pkt *pkt;
-	uint16_t sta_id;
-
-	spin_lock_bh(&pSchedContext->ol_rx_queue_lock);
-	while (!list_empty(&pSchedContext->ol_rx_thread_queue)) {
-		pkt = list_first_entry(&pSchedContext->ol_rx_thread_queue,
-				       struct cds_ol_rx_pkt, list);
-		list_del(&pkt->list);
-		spin_unlock_bh(&pSchedContext->ol_rx_queue_lock);
-		sta_id = pkt->staId;
-		pkt->callback(pkt->context, pkt->Rxpkt, sta_id);
-		cds_free_ol_rx_pkt(pSchedContext, pkt);
-		spin_lock_bh(&pSchedContext->ol_rx_queue_lock);
-	}
-	spin_unlock_bh(&pSchedContext->ol_rx_queue_lock);
-}
-
-/**
- * cds_ol_rx_thread() - cds main tlshim rx thread
- * @Arg: pointer to the global CDS Sched Context
- *
- * This api is the thread handler for Tlshim Data packet processing.
- *
- * Return: thread exit code
- */
-static int cds_ol_rx_thread(void *arg)
-{
-	p_cds_sched_context pSchedContext = (p_cds_sched_context) arg;
-	unsigned long pref_cpu = 0;
-	bool shutdown = false;
-	int status, i;
-	unsigned int num_cpus;
-
-	set_user_nice(current, -1);
-#ifdef MSM_PLATFORM
-	set_wake_up_idle(true);
-#endif
-
-	num_cpus = num_possible_cpus();
-	/* Find the available cpu core other than cpu 0 and
-	 * bind the thread
-	 */
-	for_each_online_cpu(i) {
-		if (i == 0)
-			continue;
-		pref_cpu = i;
-		if (num_cpus <= CDS_CORE_PER_CLUSTER)
-			break;
-	}
-	if (pref_cpu != 0 && (!cds_set_cpus_allowed_ptr(current, pref_cpu)))
-		affine_cpu = pref_cpu;
-
-	if (!arg) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Bad Args passed", __func__);
-		return 0;
-	}
-
-	complete(&pSchedContext->ol_rx_start_event);
-
-	while (!shutdown) {
-		status =
-			wait_event_interruptible(pSchedContext->ol_rx_wait_queue,
-						 test_bit(RX_POST_EVENT_MASK,
-							  &pSchedContext->ol_rx_event_flag)
-						 || test_bit(RX_SUSPEND_EVENT_MASK,
-							     &pSchedContext->ol_rx_event_flag));
-		if (status == -ERESTARTSYS)
-			break;
-
-		clear_bit(RX_POST_EVENT_MASK, &pSchedContext->ol_rx_event_flag);
-		while (true) {
-			if (test_bit(RX_SHUTDOWN_EVENT_MASK,
-				     &pSchedContext->ol_rx_event_flag)) {
-				clear_bit(RX_SHUTDOWN_EVENT_MASK,
-					  &pSchedContext->ol_rx_event_flag);
-				if (test_bit(RX_SUSPEND_EVENT_MASK,
-					     &pSchedContext->ol_rx_event_flag)) {
-					clear_bit(RX_SUSPEND_EVENT_MASK,
-						  &pSchedContext->ol_rx_event_flag);
-					complete
-						(&pSchedContext->ol_suspend_rx_event);
-				}
-				CDF_TRACE(CDF_MODULE_ID_CDF,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: Shutting down OL RX Thread",
-					  __func__);
-				shutdown = true;
-				break;
-			}
-			cds_rx_from_queue(pSchedContext);
-
-			if (test_bit(RX_SUSPEND_EVENT_MASK,
-				     &pSchedContext->ol_rx_event_flag)) {
-				clear_bit(RX_SUSPEND_EVENT_MASK,
-					  &pSchedContext->ol_rx_event_flag);
-				spin_lock(&pSchedContext->ol_rx_thread_lock);
-				complete(&pSchedContext->ol_suspend_rx_event);
-				INIT_COMPLETION
-					(pSchedContext->ol_resume_rx_event);
-				spin_unlock(&pSchedContext->ol_rx_thread_lock);
-				wait_for_completion_interruptible
-					(&pSchedContext->ol_resume_rx_event);
-			}
-			break;
-		}
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "%s: Exiting CDS OL rx thread", __func__);
-	complete_and_exit(&pSchedContext->ol_rx_shutdown, 0);
-}
-#endif
-
-/**
- * cds_sched_close() - close the cds scheduler
- * @p_cds_context: Pointer to the global CDS Context
- *
- * This api closes the CDS Scheduler upon successful closing:
- *	- All the message queues are flushed
- *	- The Main Controller thread is closed
- *	- The Tx thread is closed
- *
- *
- * Return: cdf status
- */
-CDF_STATUS cds_sched_close(void *p_cds_context)
-{
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: invoked", __func__);
-	if (gp_cds_sched_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: gp_cds_sched_context == NULL", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-	/* shut down MC Thread */
-	set_bit(MC_SHUTDOWN_EVENT_MASK, &gp_cds_sched_context->mcEventFlag);
-	set_bit(MC_POST_EVENT_MASK, &gp_cds_sched_context->mcEventFlag);
-	wake_up_interruptible(&gp_cds_sched_context->mcWaitQueue);
-	/* Wait for MC to exit */
-	wait_for_completion(&gp_cds_sched_context->McShutdown);
-	gp_cds_sched_context->McThread = 0;
-
-	/* Clean up message queues of MC thread */
-	cds_sched_flush_mc_mqs(gp_cds_sched_context);
-
-	/* Deinit all the queues */
-	cds_sched_deinit_mqs(gp_cds_sched_context);
-
-#ifdef QCA_CONFIG_SMP
-	/* Shut down Tlshim Rx thread */
-	set_bit(RX_SHUTDOWN_EVENT_MASK, &gp_cds_sched_context->ol_rx_event_flag);
-	set_bit(RX_POST_EVENT_MASK, &gp_cds_sched_context->ol_rx_event_flag);
-	wake_up_interruptible(&gp_cds_sched_context->ol_rx_wait_queue);
-	wait_for_completion(&gp_cds_sched_context->ol_rx_shutdown);
-	gp_cds_sched_context->ol_rx_thread = NULL;
-	cds_drop_rxpkt_by_staid(gp_cds_sched_context, WLAN_MAX_STA_COUNT);
-	cds_free_ol_rx_pkt_freeq(gp_cds_sched_context);
-	unregister_hotcpu_notifier(&cds_cpu_hotplug_notifier);
-#endif
-	return CDF_STATUS_SUCCESS;
-} /* cds_sched_close() */
-
-/**
- * cds_sched_init_mqs() - initialize the cds scheduler message queues
- * @p_cds_sched_context: Pointer to the Scheduler Context.
- *
- * This api initializes the cds scheduler message queues.
- *
- * Return: CDF status
- */
-CDF_STATUS cds_sched_init_mqs(p_cds_sched_context pSchedContext)
-{
-	CDF_STATUS vStatus = CDF_STATUS_SUCCESS;
-	/* Now intialize all the message queues */
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Initializing the WMA MC Message queue", __func__);
-	vStatus = cds_mq_init(&pSchedContext->wmaMcMq);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to init WMA MC Message queue", __func__);
-		CDF_ASSERT(0);
-		return vStatus;
-	}
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Initializing the PE MC Message queue", __func__);
-	vStatus = cds_mq_init(&pSchedContext->peMcMq);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to init PE MC Message queue", __func__);
-		CDF_ASSERT(0);
-		return vStatus;
-	}
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Initializing the SME MC Message queue", __func__);
-	vStatus = cds_mq_init(&pSchedContext->smeMcMq);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to init SME MC Message queue", __func__);
-		CDF_ASSERT(0);
-		return vStatus;
-	}
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Initializing the SYS MC Message queue", __func__);
-	vStatus = cds_mq_init(&pSchedContext->sysMcMq);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to init SYS MC Message queue", __func__);
-		CDF_ASSERT(0);
-		return vStatus;
-	}
-
-	return CDF_STATUS_SUCCESS;
-} /* cds_sched_init_mqs() */
-
-/**
- * cds_sched_deinit_mqs() - Deinitialize the cds scheduler message queues
- * @p_cds_sched_context: Pointer to the Scheduler Context.
- *
- * Return: none
- */
-void cds_sched_deinit_mqs(p_cds_sched_context pSchedContext)
-{
-	/* Now de-intialize all message queues */
-
-	/* MC WMA */
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s De-Initializing the WMA MC Message queue", __func__);
-	cds_mq_deinit(&pSchedContext->wmaMcMq);
-	/* MC PE */
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s De-Initializing the PE MC Message queue", __func__);
-	cds_mq_deinit(&pSchedContext->peMcMq);
-	/* MC SME */
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s De-Initializing the SME MC Message queue", __func__);
-	cds_mq_deinit(&pSchedContext->smeMcMq);
-	/* MC SYS */
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s De-Initializing the SYS MC Message queue", __func__);
-	cds_mq_deinit(&pSchedContext->sysMcMq);
-
-} /* cds_sched_deinit_mqs() */
-
-/**
- * cds_sched_flush_mc_mqs() - flush all the MC thread message queues
- * @pSchedContext: Pointer to global cds context
- *
- * Return: none
- */
-void cds_sched_flush_mc_mqs(p_cds_sched_context pSchedContext)
-{
-	p_cds_msg_wrapper pMsgWrapper = NULL;
-	p_cds_contextType cds_ctx;
-
-	/* Here each of the MC thread MQ shall be drained and returned to the
-	 * Core. Before returning a wrapper to the Core, the CDS message shall
-	 * be freed first
-	 */
-	CDF_TRACE(CDF_MODULE_ID_CDF,
-		  CDF_TRACE_LEVEL_INFO,
-		  ("Flushing the MC Thread message queue"));
-
-	if (NULL == pSchedContext) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: pSchedContext is NULL", __func__);
-		return;
-	}
-
-	cds_ctx = (p_cds_contextType) (pSchedContext->pVContext);
-	if (NULL == cds_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: cds_ctx is NULL", __func__);
-		return;
-	}
-
-	/* Flush the SYS Mq */
-	while (NULL != (pMsgWrapper = cds_mq_get(&pSchedContext->sysMcMq))) {
-		CDF_TRACE(CDF_MODULE_ID_CDF,
-			  CDF_TRACE_LEVEL_INFO,
-			  "%s: Freeing MC SYS message type %d ", __func__,
-			  pMsgWrapper->pVosMsg->type);
-		cds_core_return_msg(pSchedContext->pVContext, pMsgWrapper);
-	}
-	/* Flush the WMA Mq */
-	while (NULL != (pMsgWrapper = cds_mq_get(&pSchedContext->wmaMcMq))) {
-		if (pMsgWrapper->pVosMsg != NULL) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-				  "%s: Freeing MC WMA MSG message type %d",
-				  __func__, pMsgWrapper->pVosMsg->type);
-			if (pMsgWrapper->pVosMsg->bodyptr) {
-				cdf_mem_free((void *)pMsgWrapper->
-					     pVosMsg->bodyptr);
-			}
-
-			pMsgWrapper->pVosMsg->bodyptr = NULL;
-			pMsgWrapper->pVosMsg->bodyval = 0;
-			pMsgWrapper->pVosMsg->type = 0;
-		}
-		cds_core_return_msg(pSchedContext->pVContext, pMsgWrapper);
-	}
-
-	/* Flush the PE Mq */
-	while (NULL != (pMsgWrapper = cds_mq_get(&pSchedContext->peMcMq))) {
-		CDF_TRACE(CDF_MODULE_ID_CDF,
-			  CDF_TRACE_LEVEL_INFO,
-			  "%s: Freeing MC PE MSG message type %d", __func__,
-			  pMsgWrapper->pVosMsg->type);
-		pe_free_msg(cds_ctx->pMACContext,
-			    (tSirMsgQ *) pMsgWrapper->pVosMsg);
-		cds_core_return_msg(pSchedContext->pVContext, pMsgWrapper);
-	}
-	/* Flush the SME Mq */
-	while (NULL != (pMsgWrapper = cds_mq_get(&pSchedContext->smeMcMq))) {
-		CDF_TRACE(CDF_MODULE_ID_CDF,
-			  CDF_TRACE_LEVEL_INFO,
-			  "%s: Freeing MC SME MSG message type %d", __func__,
-			  pMsgWrapper->pVosMsg->type);
-		sme_free_msg(cds_ctx->pMACContext, pMsgWrapper->pVosMsg);
-		cds_core_return_msg(pSchedContext->pVContext, pMsgWrapper);
-	}
-} /* cds_sched_flush_mc_mqs() */
-
-/**
- * get_cds_sched_ctxt() - get cds scheduler context
- *
- * Return: none
- */
-p_cds_sched_context get_cds_sched_ctxt(void)
-{
-	/* Make sure that Vos Scheduler context has been initialized */
-	if (gp_cds_sched_context == NULL)
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: gp_cds_sched_context == NULL", __func__);
-
-	return gp_cds_sched_context;
-}
-
-/**
- * cds_ssr_protect_init() - initialize ssr protection debug functionality
- *
- * Return:
- *        void
- */
-void cds_ssr_protect_init(void)
-{
-	int i = 0;
-
-	spin_lock_init(&ssr_protect_lock);
-
-	while (i < MAX_SSR_PROTECT_LOG) {
-		ssr_protect_log[i].func = NULL;
-		ssr_protect_log[i].free = true;
-		ssr_protect_log[i].pid =  0;
-		i++;
-	}
-}
-
-/**
- * cds_print_external_threads() - print external threads stuck in driver
- *
- * Return:
- *        void
- */
-
-static void cds_print_external_threads(void)
-{
-	int i = 0;
-	unsigned long irq_flags;
-
-	spin_lock_irqsave(&ssr_protect_lock, irq_flags);
-
-	while (i < MAX_SSR_PROTECT_LOG) {
-		if (!ssr_protect_log[i].free) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			"PID %d is stuck at %s", ssr_protect_log[i].pid,
-			ssr_protect_log[i].func);
-		}
-		i++;
-	}
-
-	spin_unlock_irqrestore(&ssr_protect_lock, irq_flags);
-}
-
-/**
- * cds_ssr_protect() - start ssr protection
- * @caller_func: name of calling function.
- *
- * This function is called to keep track of active driver entry points
- *
- * Return: none
- */
-void cds_ssr_protect(const char *caller_func)
-{
-	int count;
-	int i = 0;
-	bool status = false;
-	unsigned long irq_flags;
-
-	count = atomic_inc_return(&ssr_protect_entry_count);
-
-	spin_lock_irqsave(&ssr_protect_lock, irq_flags);
-
-	while (i < MAX_SSR_PROTECT_LOG) {
-		if (ssr_protect_log[i].free) {
-			ssr_protect_log[i].func = caller_func;
-			ssr_protect_log[i].free = false;
-			ssr_protect_log[i].pid = current->pid;
-			status = true;
-			break;
-		}
-		i++;
-	}
-
-	spin_unlock_irqrestore(&ssr_protect_lock, irq_flags);
-
-	if (!status)
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		"Could not track PID %d call %s: log is full",
-		current->pid, caller_func);
-}
-
-/**
- * cds_ssr_unprotect() - stop ssr protection
- * @caller_func: name of calling function.
- *
- * Return: none
- */
-void cds_ssr_unprotect(const char *caller_func)
-{
-	int count;
-	int i = 0;
-	bool status = false;
-	unsigned long irq_flags;
-
-	count = atomic_dec_return(&ssr_protect_entry_count);
-
-	spin_lock_irqsave(&ssr_protect_lock, irq_flags);
-
-	while (i < MAX_SSR_PROTECT_LOG) {
-		if (!ssr_protect_log[i].free) {
-			if ((ssr_protect_log[i].pid == current->pid) &&
-			     !strcmp(ssr_protect_log[i].func, caller_func)) {
-				ssr_protect_log[i].func = NULL;
-				ssr_protect_log[i].free = true;
-				ssr_protect_log[i].pid =  0;
-				status = true;
-				break;
-			}
-		}
-		i++;
-	}
-
-	spin_unlock_irqrestore(&ssr_protect_lock, irq_flags);
-
-	if (!status)
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			"Untracked call %s", caller_func);
-}
-
-/**
- * cds_wait_for_external_threads_completion() - wait for external threads
- *					completion before proceeding further
- * @caller_func: name of calling function.
- *
- * Return: true if there is no active entry points in driver
- *	   false if there is at least one active entry in driver
- */
-bool cds_wait_for_external_threads_completion(const char *caller_func)
-{
-	int count = MAX_SSR_WAIT_ITERATIONS;
-
-	while (count) {
-
-		if (!atomic_read(&ssr_protect_entry_count))
-			break;
-
-		if (--count) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Waiting for active entry points to exit",
-				  __func__);
-			msleep(SSR_WAIT_SLEEP_TIME);
-		}
-	}
-	/* at least one external thread is executing */
-	if (!count) {
-		cds_print_external_threads();
-		return false;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO,
-		  "Allowing SSR/Driver unload for %s", caller_func);
-
-	return true;
-}
-
-/**
- * cds_get_gfp_flags(): get GFP flags
- *
- * Based on the scheduled context, return GFP flags
- * Return: gfp flags
- */
-int cds_get_gfp_flags(void)
-{
-	int flags = GFP_KERNEL;
-
-	if (in_interrupt() || in_atomic() || irqs_disabled())
-		flags = GFP_ATOMIC;
-
-	return flags;
-}

+ 0 - 1139
core/cds/src/cds_utils.c

@@ -1,1139 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/*============================================================================
-   FILE:         cds_utils.c
-
-   OVERVIEW:     This source file contains definitions for CDS crypto APIs
-                The four APIs mentioned in this file are used for
-                initializing, and de-initializing a crypto context, and
-                obtaining truly random data (for keys), as well as
-                SHA1 HMAC, and AES encrypt and decrypt routines.
-
-                The routines include:
-                cds_crypto_init() - Initializes Crypto module
-                cds_crypto_deinit() - De-initializes Crypto module
-                cds_rand_get_bytes() - Generates random byte
-                cds_sha1_hmac_str() - Generate the HMAC-SHA1 of a string given a key
-                cds_encrypt_aes() - Generate AES Encrypted byte stream
-                cds_decrypt_aes() - Decrypts an AES Encrypted byte stream
-
-   DEPENDENCIES:
-   ============================================================================*/
-
-/*----------------------------------------------------------------------------
- * Include Files
- * -------------------------------------------------------------------------*/
-
-#include "cdf_trace.h"
-#include "cds_utils.h"
-#include "cdf_memory.h"
-#include "cds_crypto.h"
-
-#include <linux/err.h>
-#include <linux/random.h>
-#include <linux/crypto.h>
-#include <linux/scatterlist.h>
-#include <linux/completion.h>
-#include <linux/ieee80211.h>
-#include <crypto/hash.h>
-#include <crypto/aes.h>
-
-#include "cds_ieee80211_common.h"
-/*----------------------------------------------------------------------------
- * Preprocessor Definitions and Constants
- * -------------------------------------------------------------------------*/
-#define AAD_LEN 20
-#define IV_SIZE_AES_128 16
-#define CMAC_IPN_LEN 6
-#define CMAC_TLEN 8             /* CMAC TLen = 64 bits (8 octets) */
-
-/*----------------------------------------------------------------------------
- * Type Declarations
- * -------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Global Data Definitions
- * -------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Static Variable Definitions
- * -------------------------------------------------------------------------*/
-
-/*----------------------------------------------------------------------------
-   Function Definitions and Documentation
- * -------------------------------------------------------------------------*/
-#ifdef CONFIG_ICNSS
-#ifdef WLAN_FEATURE_11W
-static inline void xor_128(const u8 *a, const u8 *b, u8 *out)
-{
-	u8 i;
-
-	for (i = 0; i < AES_BLOCK_SIZE; i++)
-		out[i] = a[i] ^ b[i];
-}
-
-static inline void leftshift_onebit(const u8 *input, u8 *output)
-{
-	int i, overflow = 0;
-
-	for (i = (AES_BLOCK_SIZE - 1); i >= 0; i--) {
-		output[i] = input[i] << 1;
-		output[i] |= overflow;
-		overflow = (input[i] & 0x80) ? 1 : 0;
-	}
-	return;
-}
-
-static void generate_subkey(struct crypto_cipher *tfm, u8 *k1, u8 *k2)
-{
-	u8 l[AES_BLOCK_SIZE], tmp[AES_BLOCK_SIZE];
-	u8 const_rb[AES_BLOCK_SIZE] = {
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87
-	};
-	u8 const_zero[AES_BLOCK_SIZE] = {
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-	};
-
-	crypto_cipher_encrypt_one(tfm, l, const_zero);
-
-	if ((l[0] & 0x80) == 0) {       /* If MSB(l) = 0, then k1 = l << 1 */
-		leftshift_onebit(l, k1);
-	} else {                /* Else k1 = ( l << 1 ) (+) Rb */
-		leftshift_onebit(l, tmp);
-		xor_128(tmp, const_rb, k1);
-	}
-
-	if ((k1[0] & 0x80) == 0) {
-		leftshift_onebit(k1, k2);
-	} else {
-		leftshift_onebit(k1, tmp);
-		xor_128(tmp, const_rb, k2);
-	}
-}
-
-static inline void padding(u8 *lastb, u8 *pad, u16 length)
-{
-	u8 j;
-
-	/* original last block */
-	for (j = 0; j < AES_BLOCK_SIZE; j++) {
-		if (j < length)
-			pad[j] = lastb[j];
-		else if (j == length)
-			pad[j] = 0x80;
-		else
-			pad[j] = 0x00;
-	}
-}
-
-static void cds_cmac_calc_mic(struct crypto_cipher *tfm,
-		u8 *m, u16 length, u8 *mac)
-{
-	u8 x[AES_BLOCK_SIZE], y[AES_BLOCK_SIZE];
-	u8 m_last[AES_BLOCK_SIZE], padded[AES_BLOCK_SIZE];
-	u8 k1[AES_KEYSIZE_128], k2[AES_KEYSIZE_128];
-	int cmpBlk;
-	int i, nBlocks = (length + 15) / AES_BLOCK_SIZE;
-
-	generate_subkey(tfm, k1, k2);
-
-	if (nBlocks == 0) {
-		nBlocks = 1;
-		cmpBlk = 0;
-	} else {
-		cmpBlk = ((length % AES_BLOCK_SIZE) == 0) ? 1 : 0;
-	}
-
-	if (cmpBlk) {           /* Last block is complete block */
-		xor_128(&m[AES_BLOCK_SIZE * (nBlocks - 1)], k1, m_last);
-	} else {                /* Last block is not complete block */
-		padding(&m[AES_BLOCK_SIZE * (nBlocks - 1)], padded,
-			length % AES_BLOCK_SIZE);
-		xor_128(padded, k2, m_last);
-	}
-
-	for (i = 0; i < AES_BLOCK_SIZE; i++)
-		x[i] = 0;
-
-	for (i = 0; i < (nBlocks - 1); i++) {
-		xor_128(x, &m[AES_BLOCK_SIZE * i], y);  /* y = Mi (+) x */
-		crypto_cipher_encrypt_one(tfm, x, y);   /* x = AES-128(KEY, y) */
-	}
-
-	xor_128(x, m_last, y);
-	crypto_cipher_encrypt_one(tfm, x, y);
-
-	memcpy(mac, x, CMAC_TLEN);
-}
-#endif
-#endif
-
-/*--------------------------------------------------------------------------
-
-   \brief cds_crypto_init() - Initializes Crypto module
-
-   The cds_crypto_init() function initializes Crypto module.
-
-   \param phCryptProv - pointer to the Crypt handle
-
-   \return CDF_STATUS_SUCCESS - Successfully generated random memory.
-
-          CDF_STATUS_E_FAULT  - pbBuf is an invalid pointer.
-
-          CDF_STATUS_E_FAILURE - default return value if it fails due to
-          unknown reasons
-
-  ***CDF_STATUS_E_RESOURCES - System resources (other than memory)
-          are unavailable
-   \sa
-
-    ( *** return value not considered yet )
-   --------------------------------------------------------------------------*/
-CDF_STATUS cds_crypto_init(uint32_t *phCryptProv)
-{
-	CDF_STATUS uResult = CDF_STATUS_E_FAILURE;
-
-	/* This implementation doesn't require a crypto context */
-	*phCryptProv = 0;
-	uResult = CDF_STATUS_SUCCESS;
-	return (uResult);
-}
-
-CDF_STATUS cds_crypto_deinit(uint32_t hCryptProv)
-{
-	CDF_STATUS uResult = CDF_STATUS_E_FAILURE;
-
-	/* CryptReleaseContext succeeded */
-	uResult = CDF_STATUS_SUCCESS;
-
-	return (uResult);
-}
-
-/*--------------------------------------------------------------------------
-
-   \brief cds_rand_get_bytes() - Generates random byte
-
-   The cds_rand_get_bytes() function generate random bytes.
-
-   Buffer should be allocated before calling cds_rand_get_bytes().
-
-   Attempting to initialize an already initialized lock results in
-   a failure.
-
-   \param lock - pointer to the opaque lock object to initialize
-
-   \return CDF_STATUS_SUCCESS - Successfully generated random memory.
-
-          CDF_STATUS_E_FAULT  - pbBuf is an invalid pointer.
-
-          CDF_STATUS_E_FAILURE - default return value if it fails due to
-          unknown reasons
-
-  ***CDF_STATUS_E_RESOURCES - System resources (other than memory)
-          are unavailable
-   \sa
-
-    ( *** return value not considered yet )
-   --------------------------------------------------------------------------*/
-CDF_STATUS
-cds_rand_get_bytes(uint32_t cryptHandle, uint8_t *pbBuf, uint32_t numBytes)
-{
-	CDF_STATUS uResult = CDF_STATUS_E_FAILURE;
-
-	/* check for invalid pointer */
-	if (NULL == pbBuf) {
-		uResult = CDF_STATUS_E_FAULT;
-		return (uResult);
-	}
-
-	get_random_bytes(pbBuf, numBytes);
-	/* "Random sequence generated." */
-	uResult = CDF_STATUS_SUCCESS;
-	return (uResult);
-}
-
-#ifdef WLAN_FEATURE_11W
-uint8_t cds_get_mmie_size()
-{
-	return sizeof(struct ieee80211_mmie);
-}
-
-/*--------------------------------------------------------------------------
-
-   \brief cds_increase_seq() - Increase the IPN aka Sequence number by one unit
-
-   The cds_increase_seq() function increases the IPN by one unit.
-
-   \param ipn - pointer to the IPN aka Sequence number [6 bytes]
-
-   --------------------------------------------------------------------------*/
-static void cds_increase_seq(uint8_t *ipn)
-{
-	uint64_t value = 0;
-	if (ipn) {
-		value = (0xffffffffffff) & (*((uint64_t *) ipn));
-		value = value + 1;
-		cdf_mem_copy(ipn, &value, IEEE80211_MMIE_IPNLEN);
-	}
-}
-
-/*--------------------------------------------------------------------------
-
-   \brief cds_attach_mmie() - attches the complete MMIE at the end of frame
-
-   The cds_attach_mmie() calculates the entire MMIE and attaches at the end
-   of Broadcast/Multicast robust management frames.
-
-   \param igtk - pointer  group key which will be used to calculate
-                the 8 byte MIC.
-   \param ipn - pointer ipn, it is also known as sequence number
-   \param key_id - key identication number
-   \param frm - pointer to the start of the frame.
-   \param efrm - pointer to the end of the frame.
-   \param frmLen - size of the entire frame.
-
-   \return - this function will return true on success and false on
-            failure.
-
-   --------------------------------------------------------------------------*/
-
-bool
-cds_attach_mmie(uint8_t *igtk, uint8_t *ipn, uint16_t key_id,
-		uint8_t *frm, uint8_t *efrm, uint16_t frmLen)
-{
-	struct ieee80211_mmie *mmie;
-	struct ieee80211_frame *wh;
-	uint8_t aad[AAD_LEN], mic[CMAC_TLEN], *input = NULL;
-	uint8_t previous_ipn[IEEE80211_MMIE_IPNLEN] = { 0 };
-	uint16_t nBytes = 0;
-	int ret = 0;
-	struct crypto_cipher *tfm;
-
-	/*  This is how received frame look like
-	 *
-	 *        <------------frmLen---------------------------->
-	 *
-	 *        +---------------+----------------------+-------+
-	 *        | 802.11 HEADER | Management framebody | MMIE  |
-	 *        +---------------+----------------------+-------+
-	 *                                                       ^
-	 *                                                       |
-	 *                                                      efrm
-	 *   This is how MMIE from above frame look like
-	 *
-	 *
-	 *        <------------ 18 Bytes----------------------------->
-	 *        +--------+---------+---------+-----------+---------+
-	 *        |Element | Length  | Key id  |   IPN     |  MIC    |
-	 *        |  id    |         |         |           |         |
-	 *        +--------+---------+---------+-----------+---------+
-	 * Octet     1         1         2         6            8
-	 *
-	 */
-
-	/* Check if frame is invalid length */
-	if (((efrm - frm) != frmLen) || (frmLen < sizeof(*wh))) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Invalid frame length", __func__);
-		return false;
-	}
-	mmie = (struct ieee80211_mmie *)(efrm - sizeof(*mmie));
-
-	/* Copy Element id */
-	mmie->element_id = IEEE80211_ELEMID_MMIE;
-
-	/* Copy Length */
-	mmie->length = sizeof(*mmie) - 2;
-
-	/* Copy Key id */
-	mmie->key_id = key_id;
-
-	/*
-	 * In case of error, revert back to original IPN
-	 * to do that copy the original IPN into previous_ipn
-	 */
-	cdf_mem_copy(&previous_ipn[0], ipn, IEEE80211_MMIE_IPNLEN);
-	cds_increase_seq(ipn);
-	cdf_mem_copy(mmie->sequence_number, ipn, IEEE80211_MMIE_IPNLEN);
-
-	/*
-	 * Calculate MIC and then copy
-	 */
-	tfm = cds_crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
-	if (IS_ERR(tfm)) {
-		ret = PTR_ERR(tfm);
-		tfm = NULL;
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: crypto_alloc_cipher failed (%d)", __func__, ret);
-		goto err_tfm;
-	}
-
-	ret = crypto_cipher_setkey(tfm, igtk, AES_KEYSIZE_128);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: crypto_cipher_setkey failed (%d)", __func__,
-			  ret);
-		goto err_tfm;
-	}
-
-	/* Construct AAD */
-	wh = (struct ieee80211_frame *)frm;
-
-	/* Generate BIP AAD: FC(masked) || A1 || A2 || A3 */
-
-	/* FC type/subtype */
-	aad[0] = wh->i_fc[0];
-	/* Mask FC Retry, PwrMgt, MoreData flags to zero */
-	aad[1] = wh->i_fc[1] & ~(IEEE80211_FC1_RETRY | IEEE80211_FC1_PWR_MGT |
-				 IEEE80211_FC1_MORE_DATA);
-	/* A1 || A2 || A3 */
-	cdf_mem_copy(aad + 2, wh->i_addr_all, 3 * IEEE80211_ADDR_LEN);
-
-	/* MIC = AES-128-CMAC(IGTK, AAD || Management Frame Body || MMIE, 64) */
-	nBytes = AAD_LEN + (frmLen - sizeof(struct ieee80211_frame));
-	input = (uint8_t *) cdf_mem_malloc(nBytes);
-	if (NULL == input) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Memory allocation failed", __func__);
-		ret = CDF_STATUS_E_NOMEM;
-		goto err_tfm;
-	}
-
-	/*
-	 * Copy the AAD, Management frame body, and
-	 * MMIE with 8 bit MIC zeroed out
-	 */
-	cdf_mem_zero(input, nBytes);
-	cdf_mem_copy(input, aad, AAD_LEN);
-	/* Copy Management Frame Body and MMIE without MIC */
-	cdf_mem_copy(input + AAD_LEN,
-		     (uint8_t *) (efrm -
-				  (frmLen - sizeof(struct ieee80211_frame))),
-		     nBytes - AAD_LEN - CMAC_TLEN);
-
-	cds_cmac_calc_mic(tfm, input, nBytes, mic);
-	cdf_mem_free(input);
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "CMAC(T)= %02X %02X %02X %02X %02X %02X %02X %02X",
-		  mic[0], mic[1], mic[2], mic[3],
-		  mic[4], mic[5], mic[6], mic[7]);
-	cdf_mem_copy(mmie->mic, mic, IEEE80211_MMIE_MICLEN);
-
-err_tfm:
-	if (ret) {
-		cdf_mem_copy(ipn, previous_ipn, IEEE80211_MMIE_IPNLEN);
-	}
-
-	if (tfm)
-		cds_crypto_free_cipher(tfm);
-	return !ret ? true : false;
-}
-
-bool
-cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
-{
-	struct ieee80211_mmie *mmie;
-	struct ieee80211_frame *wh;
-	uint8_t *rx_ipn, aad[AAD_LEN], mic[CMAC_TLEN], *input;
-	uint16_t nBytes = 0;
-	int ret = 0;
-	struct crypto_cipher *tfm;
-
-	/* Check if frame is invalid length */
-	if ((efrm < frm) || ((efrm - frm) < sizeof(*wh))) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "Invalid frame length");
-		return false;
-	}
-
-	mmie = (struct ieee80211_mmie *)(efrm - sizeof(*mmie));
-
-	/* Check Element ID */
-	if ((mmie->element_id != IEEE80211_ELEMID_MMIE) ||
-	    (mmie->length != (sizeof(*mmie) - 2))) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "IE is not Mgmt MIC IE or Invalid length");
-		/* IE is not Mgmt MIC IE or invalid length */
-		return false;
-	}
-
-	/* Validate IPN */
-	rx_ipn = mmie->sequence_number;
-	if (OS_MEMCMP(rx_ipn, ipn, CMAC_IPN_LEN) <= 0) {
-		/* Replay error */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "Replay error mmie ipn %02X %02X %02X %02X %02X %02X"
-			  " drvr ipn %02X %02X %02X %02X %02X %02X",
-			  rx_ipn[0], rx_ipn[1], rx_ipn[2], rx_ipn[3], rx_ipn[4],
-			  rx_ipn[5], ipn[0], ipn[1], ipn[2], ipn[3], ipn[4],
-			  ipn[5]);
-		return false;
-	}
-	tfm = cds_crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
-	if (IS_ERR(tfm)) {
-		ret = PTR_ERR(tfm);
-		tfm = NULL;
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_alloc_cipher failed (%d)", ret);
-		goto err_tfm;
-	}
-
-	ret = crypto_cipher_setkey(tfm, igtk, AES_KEYSIZE_128);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_cipher_setkey failed (%d)", ret);
-		goto err_tfm;
-	}
-
-	/* Construct AAD */
-	wh = (struct ieee80211_frame *)frm;
-
-	/* Generate BIP AAD: FC(masked) || A1 || A2 || A3 */
-
-	/* FC type/subtype */
-	aad[0] = wh->i_fc[0];
-	/* Mask FC Retry, PwrMgt, MoreData flags to zero */
-	aad[1] = wh->i_fc[1] & ~(IEEE80211_FC1_RETRY | IEEE80211_FC1_PWR_MGT |
-				 IEEE80211_FC1_MORE_DATA);
-	/* A1 || A2 || A3 */
-	cdf_mem_copy(aad + 2, wh->i_addr_all, 3 * IEEE80211_ADDR_LEN);
-
-	/* MIC = AES-128-CMAC(IGTK, AAD || Management Frame Body || MMIE, 64) */
-	nBytes = AAD_LEN + (efrm - (uint8_t *) (wh + 1));
-	input = (uint8_t *) cdf_mem_malloc(nBytes);
-	if (NULL == input) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "Memory allocation failed");
-		ret = CDF_STATUS_E_NOMEM;
-		goto err_tfm;
-	}
-
-	/* Copy the AAD, MMIE with 8 bit MIC zeroed out */
-	cdf_mem_zero(input, nBytes);
-	cdf_mem_copy(input, aad, AAD_LEN);
-	cdf_mem_copy(input + AAD_LEN, (uint8_t *) (wh + 1),
-		     nBytes - AAD_LEN - CMAC_TLEN);
-
-	cds_cmac_calc_mic(tfm, input, nBytes, mic);
-	cdf_mem_free(input);
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-		  "CMAC(T)= %02X %02X %02X %02X %02X %02X %02X %02X",
-		  mic[0], mic[1], mic[2], mic[3],
-		  mic[4], mic[5], mic[6], mic[7]);
-
-	if (OS_MEMCMP(mic, mmie->mic, CMAC_TLEN) != 0) {
-		/* MMIE MIC mismatch */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "BC/MC MGMT frame MMIE MIC check Failed"
-			  " rmic %02X %02X %02X %02X %02X %02X %02X %02X"
-			  " cmic %02X %02X %02X %02X %02X %02X %02X %02X",
-			  mmie->mic[0], mmie->mic[1], mmie->mic[2],
-			  mmie->mic[3], mmie->mic[4], mmie->mic[5],
-			  mmie->mic[6], mmie->mic[7], mic[0], mic[1], mic[2],
-			  mic[3], mic[4], mic[5], mic[6], mic[7]);
-		return false;
-	}
-
-	/* Update IPN */
-	cdf_mem_copy(ipn, rx_ipn, CMAC_IPN_LEN);
-
-err_tfm:
-	if (tfm)
-		cds_crypto_free_cipher(tfm);
-
-	return !ret ? true : false;
-}
-
-#endif /* WLAN_FEATURE_11W */
-/**
- * cds_sha1_hmac_str
- *
- * FUNCTION:
- * Generate the HMAC-SHA1 of a string given a key.
- *
- * LOGIC:
- * Standard HMAC processing from RFC 2104. The code is provided in the
- * appendix of the RFC.
- *
- * ASSUMPTIONS:
- * The RFC is correct.
- *
- * @param text text to be hashed
- * @param textLen length of text
- * @param key key to use for HMAC
- * @param keyLen length of key
- * @param digest holds resultant SHA1 HMAC (20B)
- *
- * @return CDF_STATUS_SUCCSS if the operation succeeds
- *
- */
-
-struct hmac_sha1_result {
-	struct completion completion;
-	int err;
-};
-
-static void hmac_sha1_complete(struct crypto_async_request *req, int err)
-{
-	struct hmac_sha1_result *r = req->data;
-	if (err == -EINPROGRESS)
-		return;
-	r->err = err;
-	complete(&r->completion);
-}
-
-int
-hmac_sha1(uint8_t *key, uint8_t ksize, char *plaintext, uint8_t psize,
-	  uint8_t *output, uint8_t outlen)
-{
-	int ret = 0;
-	struct crypto_ahash *tfm;
-	struct scatterlist sg;
-	struct ahash_request *req;
-	struct hmac_sha1_result tresult;
-	void *hash_buff = NULL;
-
-	unsigned char hash_result[64];
-	int i;
-
-	memset(output, 0, outlen);
-
-	init_completion(&tresult.completion);
-
-	tfm = cds_crypto_alloc_ahash("hmac(sha1)", CRYPTO_ALG_TYPE_AHASH,
-				 CRYPTO_ALG_TYPE_AHASH_MASK);
-	if (IS_ERR(tfm)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_alloc_ahash failed");
-		ret = PTR_ERR(tfm);
-		goto err_tfm;
-	}
-
-	req = ahash_request_alloc(tfm, GFP_KERNEL);
-	if (!req) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "failed to allocate request for hmac(sha1)");
-		ret = -ENOMEM;
-		goto err_req;
-	}
-
-	ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
-				   hmac_sha1_complete, &tresult);
-
-	hash_buff = kzalloc(psize, GFP_KERNEL);
-	if (!hash_buff) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "failed to kzalloc hash_buff");
-		ret = -ENOMEM;
-		goto err_hash_buf;
-	}
-
-	memset(hash_result, 0, 64);
-	memcpy(hash_buff, plaintext, psize);
-	sg_init_one(&sg, hash_buff, psize);
-
-	if (ksize) {
-		crypto_ahash_clear_flags(tfm, ~0);
-		ret = cds_crypto_ahash_setkey(tfm, key, ksize);
-		if (ret) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "crypto_ahash_setkey failed");
-			goto err_setkey;
-		}
-	}
-
-	ahash_request_set_crypt(req, &sg, hash_result, psize);
-	ret = cds_crypto_ahash_digest(req);
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR, "ret 0x%x", ret);
-
-	switch (ret) {
-	case 0:
-		for (i = 0; i < outlen; i++)
-			output[i] = hash_result[i];
-		break;
-	case -EINPROGRESS:
-	case -EBUSY:
-		ret = wait_for_completion_interruptible(&tresult.completion);
-		if (!ret && !tresult.err) {
-			for (i = 0; i < outlen; i++)
-				output[i] = hash_result[i];
-			INIT_COMPLETION(tresult.completion);
-			break;
-		} else {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "wait_for_completion_interruptible failed");
-			if (!ret)
-				ret = tresult.err;
-			goto out;
-		}
-	default:
-		goto out;
-	}
-
-out:
-err_setkey:
-	kfree(hash_buff);
-err_hash_buf:
-	ahash_request_free(req);
-err_req:
-	cds_crypto_free_ahash(tfm);
-err_tfm:
-	return ret;
-}
-
-CDF_STATUS cds_sha1_hmac_str(uint32_t cryptHandle,      /* Handle */
-			     uint8_t *pText,    /* pointer to data stream */
-			     uint32_t textLen,  /* length of data stream */
-			     uint8_t *pKey,     /* pointer to authentication key */
-			     uint32_t keyLen,   /* length of authentication key */
-			     uint8_t digest[CDS_DIGEST_SHA1_SIZE])
-{                               /* caller digest to be filled in */
-	int ret = 0;
-
-	ret = hmac_sha1(pKey,   /* uint8_t *key, */
-			(uint8_t) keyLen,       /* uint8_t ksize, */
-			(char *)pText,  /* char *plaintext, */
-			(uint8_t) textLen,      /* uint8_t psize, */
-			digest, /* uint8_t *output, */
-			CDS_DIGEST_SHA1_SIZE    /* uint8_t outlen */
-			);
-
-	if (ret != 0) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "hmac_sha1() call failed");
-		return CDF_STATUS_E_FAULT;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_md5_hmac_str
- *
- * FUNCTION:
- * Generate the HMAC-MD5 of a string given a key.
- *
- * LOGIC:
- * Standard HMAC processing from RFC 2104. The code is provided in the
- * appendix of the RFC.
- *
- * ASSUMPTIONS:
- * The RFC is correct.
- *
- * @param text text to be hashed
- * @param textLen length of text
- * @param key key to use for HMAC
- * @param keyLen length of key
- * @param digest holds resultant MD5 HMAC (20B)
- *
- * @return CDF_STATUS_SUCCSS if the operation succeeds
- *
- */
-struct hmac_md5_result {
-	struct completion completion;
-	int err;
-};
-
-static void hmac_md5_complete(struct crypto_async_request *req, int err)
-{
-	struct hmac_md5_result *r = req->data;
-	if (err == -EINPROGRESS)
-		return;
-	r->err = err;
-	complete(&r->completion);
-}
-
-int
-hmac_md5(uint8_t *key, uint8_t ksize, char *plaintext, uint8_t psize,
-	 uint8_t *output, uint8_t outlen)
-{
-	int ret = 0;
-	struct crypto_ahash *tfm;
-	struct scatterlist sg;
-	struct ahash_request *req;
-	struct hmac_md5_result tresult = {.err = 0 };
-	void *hash_buff = NULL;
-
-	unsigned char hash_result[64];
-	int i;
-
-	memset(output, 0, outlen);
-
-	init_completion(&tresult.completion);
-
-	tfm = cds_crypto_alloc_ahash("hmac(md5)", CRYPTO_ALG_TYPE_AHASH,
-				 CRYPTO_ALG_TYPE_AHASH_MASK);
-	if (IS_ERR(tfm)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_alloc_ahash failed");
-		ret = PTR_ERR(tfm);
-		goto err_tfm;
-	}
-
-	req = ahash_request_alloc(tfm, GFP_KERNEL);
-	if (!req) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "failed to allocate request for hmac(md5)");
-		ret = -ENOMEM;
-		goto err_req;
-	}
-
-	ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
-				   hmac_md5_complete, &tresult);
-
-	hash_buff = kzalloc(psize, GFP_KERNEL);
-	if (!hash_buff) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "failed to kzalloc hash_buff");
-		ret = -ENOMEM;
-		goto err_hash_buf;
-	}
-
-	memset(hash_result, 0, 64);
-	memcpy(hash_buff, plaintext, psize);
-	sg_init_one(&sg, hash_buff, psize);
-
-	if (ksize) {
-		crypto_ahash_clear_flags(tfm, ~0);
-		ret = cds_crypto_ahash_setkey(tfm, key, ksize);
-		if (ret) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "crypto_ahash_setkey failed");
-			goto err_setkey;
-		}
-	}
-
-	ahash_request_set_crypt(req, &sg, hash_result, psize);
-	ret = cds_crypto_ahash_digest(req);
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR, "ret 0x%x", ret);
-
-	switch (ret) {
-	case 0:
-		for (i = 0; i < outlen; i++)
-			output[i] = hash_result[i];
-		break;
-	case -EINPROGRESS:
-	case -EBUSY:
-		ret = wait_for_completion_interruptible(&tresult.completion);
-		if (!ret && !tresult.err) {
-			INIT_COMPLETION(tresult.completion);
-			break;
-		} else {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "wait_for_completion_interruptible failed");
-			if (!ret)
-				ret = tresult.err;
-			goto out;
-		}
-	default:
-		goto out;
-	}
-
-out:
-err_setkey:
-	kfree(hash_buff);
-err_hash_buf:
-	ahash_request_free(req);
-err_req:
-	cds_crypto_free_ahash(tfm);
-err_tfm:
-	return ret;
-}
-
-CDF_STATUS cds_md5_hmac_str(uint32_t cryptHandle,       /* Handle */
-			    uint8_t *pText,     /* pointer to data stream */
-			    uint32_t textLen,   /* length of data stream */
-			    uint8_t *pKey,      /* pointer to authentication key */
-			    uint32_t keyLen,    /* length of authentication key */
-			    uint8_t digest[CDS_DIGEST_MD5_SIZE])
-{                               /* caller digest to be filled in */
-	int ret = 0;
-
-	ret = hmac_md5(pKey,    /* uint8_t *key, */
-		       (uint8_t) keyLen,        /* uint8_t ksize, */
-		       (char *)pText,   /* char *plaintext, */
-		       (uint8_t) textLen,       /* uint8_t psize, */
-		       digest,  /* uint8_t *output, */
-		       CDS_DIGEST_MD5_SIZE      /* uint8_t outlen */
-		       );
-
-	if (ret != 0) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "hmac_md5() call failed");
-		return CDF_STATUS_E_FAULT;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-struct ecb_aes_result {
-	struct completion completion;
-	int err;
-};
-
-static void ecb_aes_complete(struct crypto_async_request *req, int err)
-{
-	struct ecb_aes_result *r = req->data;
-	if (err == -EINPROGRESS)
-		return;
-	r->err = err;
-	complete(&r->completion);
-}
-
-/*--------------------------------------------------------------------------
-
-   \brief cds_encrypt_aes() - Generate AES Encrypted byte stream
-
-   The cds_encrypt_aes() function generates the encrypted byte stream for given text.
-
-   Buffer should be allocated before calling cds_rand_get_bytes().
-
-   Attempting to initialize an already initialized lock results in
-   a failure.
-
-   \param lock - pointer to the opaque lock object to initialize
-
-   \return CDF_STATUS_SUCCESS - Successfully generated random memory.
-
-          CDF_STATUS_E_FAULT  - pbBuf is an invalid pointer.
-
-          CDF_STATUS_E_FAILURE - default return value if it fails due to
-          unknown reasons
-
-  ***CDF_STATUS_E_RESOURCES - System resources (other than memory)
-          are unavailable
-   \sa
-
-    ( *** return value not considered yet )
-   --------------------------------------------------------------------------*/
-
-CDF_STATUS cds_encrypt_aes(uint32_t cryptHandle,        /* Handle */
-			   uint8_t *pPlainText,         /* pointer to data stream */
-			   uint8_t *pCiphertext, uint8_t *pKey)
-{                               /* pointer to authentication key */
-	struct ecb_aes_result result;
-	struct ablkcipher_request *req;
-	struct crypto_ablkcipher *tfm;
-	int ret = 0;
-	char iv[IV_SIZE_AES_128];
-	struct scatterlist sg_in;
-	struct scatterlist sg_out;
-
-	init_completion(&result.completion);
-
-	tfm = cds_crypto_alloc_ablkcipher("cbc(aes)", 0, 0);
-	if (IS_ERR(tfm)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_alloc_ablkcipher failed");
-		ret = PTR_ERR(tfm);
-		goto err_tfm;
-	}
-
-	req = ablkcipher_request_alloc(tfm, GFP_KERNEL);
-	if (!req) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "Failed to allocate request for cbc(aes)");
-		ret = -ENOMEM;
-		goto err_req;
-	}
-
-	ablkcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
-					ecb_aes_complete, &result);
-
-	crypto_ablkcipher_clear_flags(tfm, ~0);
-
-	ret = crypto_ablkcipher_setkey(tfm, pKey, AES_KEYSIZE_128);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_cipher_setkey failed");
-		goto err_setkey;
-	}
-
-	memset(iv, 0, IV_SIZE_AES_128);
-
-	sg_init_one(&sg_in, pPlainText, AES_BLOCK_SIZE);
-
-	sg_init_one(&sg_out, pCiphertext, AES_BLOCK_SIZE);
-
-	ablkcipher_request_set_crypt(req, &sg_in, &sg_out, AES_BLOCK_SIZE, iv);
-
-	crypto_ablkcipher_encrypt(req);
-
-/* ------------------------------------- */
-err_setkey:
-	cds_ablkcipher_request_free(req);
-err_req:
-	cds_crypto_free_ablkcipher(tfm);
-err_tfm:
-	/* return ret; */
-	if (ret != 0) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s() call failed", __func__);
-		return CDF_STATUS_E_FAULT;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/*--------------------------------------------------------------------------
-
-   \brief cds_decrypt_aes() - Decrypts an AES Encrypted byte stream
-
-   The cds_decrypt_aes() function decrypts the encrypted byte stream.
-
-   Buffer should be allocated before calling cds_rand_get_bytes().
-
-   Attempting to initialize an already initialized lock results in
-   a failure.
-
-   \param lock - pointer to the opaque lock object to initialize
-
-   \return CDF_STATUS_SUCCESS - Successfully generated random memory.
-
-          CDF_STATUS_E_FAULT  - pbBuf is an invalid pointer.
-
-          CDF_STATUS_E_FAILURE - default return value if it fails due to
-          unknown reasons
-
-  ***CDF_STATUS_E_RESOURCES - System resources (other than memory)
-          are unavailable
-   \sa
-
-    ( *** return value not considered yet )
-   --------------------------------------------------------------------------*/
-
-CDF_STATUS cds_decrypt_aes(uint32_t cryptHandle,        /* Handle */
-			   uint8_t *pText,      /* pointer to data stream */
-			   uint8_t *pDecrypted, uint8_t *pKey)
-{                               /* pointer to authentication key */
-/*    CDF_STATUS uResult = CDF_STATUS_E_FAILURE; */
-	struct ecb_aes_result result;
-	struct ablkcipher_request *req;
-	struct crypto_ablkcipher *tfm;
-	int ret = 0;
-	char iv[IV_SIZE_AES_128];
-	struct scatterlist sg_in;
-	struct scatterlist sg_out;
-
-	init_completion(&result.completion);
-
-	tfm = cds_crypto_alloc_ablkcipher("cbc(aes)", 0, 0);
-	if (IS_ERR(tfm)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_alloc_ablkcipher failed");
-		ret = PTR_ERR(tfm);
-		goto err_tfm;
-	}
-
-	req = ablkcipher_request_alloc(tfm, GFP_KERNEL);
-	if (!req) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "Failed to allocate request for cbc(aes)");
-		ret = -ENOMEM;
-		goto err_req;
-	}
-
-	ablkcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
-					ecb_aes_complete, &result);
-
-	crypto_ablkcipher_clear_flags(tfm, ~0);
-
-	ret = crypto_ablkcipher_setkey(tfm, pKey, AES_KEYSIZE_128);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "crypto_cipher_setkey failed");
-		goto err_setkey;
-	}
-
-	memset(iv, 0, IV_SIZE_AES_128);
-
-	sg_init_one(&sg_in, pText, AES_BLOCK_SIZE);
-
-	sg_init_one(&sg_out, pDecrypted, AES_BLOCK_SIZE);
-
-	ablkcipher_request_set_crypt(req, &sg_in, &sg_out, AES_BLOCK_SIZE, iv);
-
-	crypto_ablkcipher_decrypt(req);
-
-/* ------------------------------------- */
-err_setkey:
-	cds_ablkcipher_request_free(req);
-err_req:
-	cds_crypto_free_ablkcipher(tfm);
-err_tfm:
-	/* return ret; */
-	if (ret != 0) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s() call failed", __func__);
-		return CDF_STATUS_E_FAULT;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-uint32_t cds_chan_to_freq(uint8_t chan)
-{
-	if (chan < CDS_24_GHZ_CHANNEL_14)       /* ch 0 - ch 13 */
-		return CDS_24_GHZ_BASE_FREQ + chan * CDS_CHAN_SPACING_5MHZ;
-	else if (chan == CDS_24_GHZ_CHANNEL_14) /* ch 14 */
-		return CDS_CHAN_14_FREQ;
-	else if (chan < CDS_24_GHZ_CHANNEL_27)  /* ch 15 - ch 26 */
-		return CDS_CHAN_15_FREQ +
-		       (chan - CDS_24_GHZ_CHANNEL_15) * CDS_CHAN_SPACING_20MHZ;
-	else if (chan == CDS_5_GHZ_CHANNEL_170)
-		return CDS_CHAN_170_FREQ;
-	else
-		return CDS_5_GHZ_BASE_FREQ + chan * CDS_CHAN_SPACING_5MHZ;
-}
-
-uint8_t cds_freq_to_chan(uint32_t freq)
-{
-	uint8_t chan;
-
-	if (freq > CDS_24_GHZ_BASE_FREQ && freq < CDS_CHAN_14_FREQ)
-		chan = ((freq - CDS_24_GHZ_BASE_FREQ) / CDS_CHAN_SPACING_5MHZ);
-	else if (freq == CDS_CHAN_14_FREQ)
-		chan = CDS_24_GHZ_CHANNEL_14;
-	else if ((freq > CDS_24_GHZ_BASE_FREQ) && (freq < CDS_5_GHZ_BASE_FREQ))
-		chan = (((freq - CDS_CHAN_15_FREQ) / CDS_CHAN_SPACING_20MHZ) +
-			CDS_24_GHZ_CHANNEL_15);
-	else
-		chan = (freq - CDS_5_GHZ_BASE_FREQ) / CDS_CHAN_SPACING_5MHZ;
-	return chan;
-}
-
-uint8_t cds_chan_to_band(uint32_t chan)
-{
-	if (chan <= CDS_24_GHZ_CHANNEL_14)
-		return CDS_BAND_2GHZ;
-
-	return CDS_BAND_5GHZ;
-}

+ 0 - 98
core/cds/src/i_cds_packet.h

@@ -1,98 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined( __I_CDS_PACKET_H )
-#define __I_CDS_PACKET_H
-
-/**=========================================================================
-
-   \file        i_cds_packet.h
-
-   \brief       Connectivity driver services network packet APIs
-
-   Network Protocol packet/buffer internal include file
-
-   ========================================================================*/
-
-/*--------------------------------------------------------------------------
-   Include Files
-   ------------------------------------------------------------------------*/
-#include "cdf_types.h"
-/**
- * Rx Packet Struct
- * Buffer for the packet received from WMA has pointers to 802.11
- * frame fields and additional information based on the type of frame.
- * @channel: Channel number
- * @snr: Signal to noise ratio
- * @rssi: Received signal strength indicator, normalized to -96 dBm as
- *        normal noise floor by adding -96 to snr. All the configured
- *        thresholds in the driver assume that noise floor is -96 dBm.
- * @timestamp: System timestamp when frame was received. Set to jiffies.
- * @mpdu_hdr_ptr: Pointer to beginning of 802.11 MPDU
- * @mpdu_data_ptr: Pointer to beginning of payload
- * @mpdu_len: Length of 802.11 MPDU
- * @mpdu_hdr_len: Length of 802.11 MPDU header
- * @mpdu_data_len: Length of 802.11 MPDU payload
- * @offloadScanLearn: Bit set to 1 for beacons received during roaming scan
- * @roamCandidateInd: Bit set to 1 when roaming candidate is found by fw
- * @scan: Bit set to 1 if packet received during scanning
- * @scan_src: Source of scan
- * @dpuFeedback: DPU feedback for frame
- * @sessionId: PE session
- * @tsf_delta: Delta between tsf in frame and local value of tsf
- * @rssi_raw: rssi based on actual noise floor in hardware.
- */
-typedef struct {
-	uint8_t channel;
-	uint8_t snr;
-	uint32_t rssi;
-	uint32_t timestamp;
-	uint8_t *mpdu_hdr_ptr;
-	uint8_t *mpdu_data_ptr;
-	uint32_t mpdu_len;
-	uint32_t mpdu_hdr_len;
-	uint32_t mpdu_data_len;
-	uint8_t offloadScanLearn : 1;
-	uint8_t roamCandidateInd : 1;
-	uint8_t scan : 1;
-	uint8_t scan_src;
-	uint8_t dpuFeedback;
-	uint8_t sessionId;
-	uint32_t tsf_delta;
-	uint32_t rssi_raw;
-} t_packetmeta, *tp_packetmeta;
-
-/* implementation specific cds packet type */
-struct cds_pkt_t {
-	/* Packet Meta Information */
-	t_packetmeta pkt_meta;
-
-	/* Pointer to Packet */
-	void *pkt_buf;
-};
-
-#endif /* !defined( __I_CDS_PACKET_H ) */

+ 0 - 571
core/cds/src/queue.h

@@ -1,571 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- *    The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *    @(#)queue.h    8.5 (Berkeley) 8/20/94
- * $FreeBSD: src/sys/sys/queue.h,v 1.58 2004/04/07 04:19:49 imp Exp $
- */
-
-#if !defined(__NetBSD__)
-#ifndef _SYS_QUEUE_H_
-#define    _SYS_QUEUE_H_
-
-/*
- * This file defines four types of data structures: singly-linked lists,
- * singly-linked tail queues, lists and tail queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction.  Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may be traversed in either direction.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- *
- *
- *                SLIST    LIST    STAILQ    TAILQ
- * _HEAD            +    +    +    +
- * _HEAD_INITIALIZER        +    +    +    +
- * _ENTRY            +    +    +    +
- * _INIT            +    +    +    +
- * _EMPTY            +    +    +    +
- * _FIRST            +    +    +    +
- * _NEXT            +    +    +    +
- * _PREV            -    -    -    +
- * _LAST            -    -    +    +
- * _FOREACH            +    +    +    +
- * _FOREACH_SAFE        +    +    +    +
- * _FOREACH_REVERSE        -    -    -    +
- * _FOREACH_REVERSE_SAFE    -    -    -    +
- * _INSERT_HEAD            +    +    +    +
- * _INSERT_BEFORE        -    +    -    +
- * _INSERT_AFTER        +    +    +    +
- * _INSERT_TAIL            -    -    +    +
- * _CONCAT            -    -    +    +
- * _REMOVE_HEAD            +    -    +    -
- * _REMOVE            +    +    +    +
- *
- */
-#define    QUEUE_MACRO_DEBUG 0
-#if QUEUE_MACRO_DEBUG
-/* Store the last 2 places the queue element or head was altered */
-struct qm_trace {
-	char *lastfile;
-	int lastline;
-	char *prevfile;
-	int prevline;
-};
-
-#define    TRACEBUF    struct qm_trace trace;
-#define    TRASHIT(x)    do {(x) = (void *)NULL; } while (0)
-
-#define    QMD_TRACE_HEAD(head) do {			\
-		(head)->trace.prevline = (head)->trace.lastline;	\
-		(head)->trace.prevfile = (head)->trace.lastfile;	\
-		(head)->trace.lastline = __LINE__;		  \
-		(head)->trace.lastfile = __FILE__;		  \
-} while (0)
-
-#define    QMD_TRACE_ELEM(elem) do {			\
-		(elem)->trace.prevline = (elem)->trace.lastline;	\
-		(elem)->trace.prevfile = (elem)->trace.lastfile;	\
-		(elem)->trace.lastline = __LINE__;		  \
-		(elem)->trace.lastfile = __FILE__;		  \
-} while (0)
-
-#else
-#define    QMD_TRACE_ELEM(elem)
-#define    QMD_TRACE_HEAD(head)
-#define    TRACEBUF
-#define TRASHIT(x) do {(x) = (void *)0; } while (0)
-#endif /* QUEUE_MACRO_DEBUG */
-
-#ifdef ATHR_RNWF
-/* NDIS contains a defn for SLIST_ENTRY and SINGLE_LIST_ENTRY */
-#endif
-
-/*
- * Singly-linked List declarations.
- */
-#define    SLIST_HEAD(name, type)			 \
-	struct name {				     \
-		struct type *slh_first; /* first element */	       \
-	}
-
-#define    SLIST_HEAD_INITIALIZER(head)			   \
-	{ NULL }
-
-#define    SING_LIST_ENTRY(type)			\
-	struct {				\
-		struct type *sle_next; /* next element */	     \
-	}
-
-/*
- * Singly-linked List functions.
- */
-#define    SLIST_EMPTY(head)    ((head)->slh_first == NULL)
-
-#define    SLIST_FIRST(head)    ((head)->slh_first)
-
-#define    SLIST_FOREACH(var, head, field)		      \
-	for ((var) = SLIST_FIRST((head));		 \
-	     (var);			       \
-	     (var) = SLIST_NEXT((var), field))
-
-#define    SLIST_FOREACH_SAFE(var, head, field, tvar)		 \
-	for ((var) = SLIST_FIRST((head));		 \
-	     (var) && ((tvar) = SLIST_NEXT((var), field), 1);	     \
-	     (var) = (tvar))
-
-#define    SLIST_FOREACH_PREVPTR(var, varp, head, field)	    \
-	for ((varp) = &SLIST_FIRST((head));		   \
-	     ((var) = *(varp)) != NULL;			   \
-	     (varp) = &SLIST_NEXT((var), field))
-
-#define    SLIST_INIT(head) do {			\
-		SLIST_FIRST((head)) = NULL;		       \
-} while (0)
-
-#define    SLIST_INSERT_AFTER(slistelm, elm, field) do {	    \
-		SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field);    \
-		SLIST_NEXT((slistelm), field) = (elm);		      \
-} while (0)
-
-#define    SLIST_INSERT_HEAD(head, elm, field) do {	       \
-		SLIST_NEXT((elm), field) = SLIST_FIRST((head));		   \
-		SLIST_FIRST((head)) = (elm);			\
-} while (0)
-
-#define    SLIST_NEXT(elm, field)    ((elm)->field.sle_next)
-
-#define    SLIST_REMOVE(head, elm, type, field) do {		\
-		if (SLIST_FIRST((head)) == (elm)) {		   \
-			SLIST_REMOVE_HEAD((head), field);	     \
-		}				 \
-		else {				      \
-			struct type *curelm = SLIST_FIRST((head));	  \
-			while (SLIST_NEXT(curelm, field) != (elm))	  \
-				curelm = SLIST_NEXT(curelm, field);	   \
-			SLIST_NEXT(curelm, field) =		   \
-				SLIST_NEXT(SLIST_NEXT(curelm, field), field);	 \
-		}				 \
-} while (0)
-
-#define    SLIST_REMOVE_HEAD(head, field) do {		      \
-		SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);	 \
-} while (0)
-
-/*
- * Singly-linked Tail queue declarations.
- */
-#define    STAILQ_HEAD(name, type)			  \
-	struct name {				     \
-		struct type *stqh_first; /* first element */		\
-		struct type **stqh_last; /* addr of last next element */	 \
-	}
-
-#define    STAILQ_HEAD_INITIALIZER(head)		    \
-	{ NULL, &(head).stqh_first }
-
-#define    STAILQ_ENTRY(type)			     \
-	struct {				\
-		struct type *stqe_next; /* next element */	      \
-	}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define    STAILQ_CONCAT(head1, head2) do {		   \
-		if (!STAILQ_EMPTY((head2))) {			 \
-			*(head1)->stqh_last = (head2)->stqh_first;	  \
-			(head1)->stqh_last = (head2)->stqh_last;	\
-			STAILQ_INIT((head2));			 \
-		}				 \
-} while (0)
-
-#define    STAILQ_EMPTY(head)    ((head)->stqh_first == NULL)
-
-#define    STAILQ_FIRST(head)    ((head)->stqh_first)
-
-#define    STAILQ_FOREACH(var, head, field)		   \
-	for((var) = STAILQ_FIRST((head));		 \
-	    (var);			      \
-	    (var) = STAILQ_NEXT((var), field))
-
-#define    STAILQ_FOREACH_SAFE(var, head, field, tvar)		  \
-	for ((var) = STAILQ_FIRST((head));		  \
-	     (var) && ((tvar) = STAILQ_NEXT((var), field), 1);	      \
-	     (var) = (tvar))
-
-#define    STAILQ_INIT(head) do {			 \
-		STAILQ_FIRST((head)) = NULL;			\
-		(head)->stqh_last = &STAILQ_FIRST((head));	      \
-} while (0)
-
-#define    STAILQ_INSERT_AFTER(head, tqelm, elm, field) do {	    \
-		if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL) \
-			(head)->stqh_last = &STAILQ_NEXT((elm), field);	       \
-		STAILQ_NEXT((tqelm), field) = (elm);		    \
-} while (0)
-
-#define    STAILQ_INSERT_HEAD(head, elm, field) do {		\
-		if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL)	   \
-			(head)->stqh_last = &STAILQ_NEXT((elm), field);	       \
-		STAILQ_FIRST((head)) = (elm);			 \
-} while (0)
-
-#define    STAILQ_INSERT_TAIL(head, elm, field) do {		\
-		STAILQ_NEXT((elm), field) = NULL;		 \
-		*(head)->stqh_last = (elm);		       \
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		   \
-} while (0)
-
-#define    STAILQ_LAST(head, type, field)		     \
-	(STAILQ_EMPTY((head)) ?			       \
-	 NULL :				   \
-	 ((struct type *)		     \
-	  ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-
-#define    STAILQ_NEXT(elm, field)    ((elm)->field.stqe_next)
-
-#define    STAILQ_REMOVE(head, elm, type, field) do {		 \
-		if (STAILQ_FIRST((head)) == (elm)) {		    \
-			STAILQ_REMOVE_HEAD((head), field);	      \
-		}				 \
-		else {				      \
-			struct type *curelm = STAILQ_FIRST((head));	   \
-			while (STAILQ_NEXT(curelm, field) != (elm))	   \
-				curelm = STAILQ_NEXT(curelm, field);	    \
-			if ((STAILQ_NEXT(curelm, field) =	     \
-				     STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL) \
-				(head)->stqh_last = &STAILQ_NEXT((curelm), field); \
-		}				 \
-} while (0)
-
-#define    STAILQ_REMOVE_AFTER(head, elm, field) do {		 \
-		if (STAILQ_NEXT(elm, field)) {	      \
-			if ((STAILQ_NEXT(elm, field) =		  \
-				     STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \
-				(head)->stqh_last = &STAILQ_NEXT((elm), field);	\
-		}				 \
-} while (0)
-
-#define    STAILQ_REMOVE_HEAD(head, field) do {		       \
-		if ((STAILQ_FIRST((head)) =		       \
-			     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)	       \
-			(head)->stqh_last = &STAILQ_FIRST((head));	  \
-} while (0)
-
-#define    STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do {	      \
-		if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL)	   \
-			(head)->stqh_last = &STAILQ_FIRST((head));	  \
-} while (0)
-
-/*
- * List declarations.
- */
-#define    ATH_LIST_HEAD(name, type)			\
-	struct name {				     \
-		struct type *lh_first; /* first element */	      \
-	}
-
-#ifndef LIST_HEAD
-#define LIST_HEAD ATH_LIST_HEAD
-#endif
-
-#define    LIST_HEAD_INITIALIZER(head)			  \
-	{ NULL }
-
-#define    LIST_ENTRY(type)			   \
-	struct {				\
-		struct type *le_next; /* next element */	    \
-		struct type **le_prev; /* address of previous next element */	  \
-	}
-
-/*
- * List functions.
- */
-
-#define    LIST_EMPTY(head)    ((head)->lh_first == NULL)
-
-#define    LIST_FIRST(head)    ((head)->lh_first)
-
-#define    LIST_FOREACH(var, head, field)		     \
-	for ((var) = LIST_FIRST((head));		\
-	     (var);			       \
-	     (var) = LIST_NEXT((var), field))
-
-#define    LIST_FOREACH_SAFE(var, head, field, tvar)		\
-	for ((var) = LIST_FIRST((head));		\
-	     (var) && ((tvar) = LIST_NEXT((var), field), 1);	    \
-	     (var) = (tvar))
-
-#define    LIST_INIT(head) do {			       \
-		LIST_FIRST((head)) = NULL;		      \
-} while (0)
-
-#define    LIST_INSERT_AFTER(listelm, elm, field) do {		  \
-		if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL) \
-			LIST_NEXT((listelm), field)->field.le_prev =	    \
-				&LIST_NEXT((elm), field);		 \
-		LIST_NEXT((listelm), field) = (elm);		    \
-		(elm)->field.le_prev = &LIST_NEXT((listelm), field);	    \
-} while (0)
-
-#define    LIST_INSERT_BEFORE(listelm, elm, field) do {		   \
-		(elm)->field.le_prev = (listelm)->field.le_prev;	\
-		LIST_NEXT((elm), field) = (listelm);		    \
-		*(listelm)->field.le_prev = (elm);		  \
-		(listelm)->field.le_prev = &LIST_NEXT((elm), field);	    \
-} while (0)
-
-#define    LIST_INSERT_HEAD(head, elm, field) do {		  \
-		if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)    \
-			LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field); \
-		LIST_FIRST((head)) = (elm);		       \
-		(elm)->field.le_prev = &LIST_FIRST((head));	       \
-} while (0)
-
-#define    LIST_NEXT(elm, field)    ((elm)->field.le_next)
-
-#define    LIST_REMOVE(elm, field) do {			   \
-		if (LIST_NEXT((elm), field) != NULL)		    \
-			LIST_NEXT((elm), field)->field.le_prev =	 \
-				(elm)->field.le_prev;		     \
-		*(elm)->field.le_prev = LIST_NEXT((elm), field);	\
-} while (0)
-
-/*
- * Tail queue declarations.
- */
-#define  HEADNAME
-#define  COPY_HEADNAME(head)
-
-#define    TAILQ_HEAD(name, type)			 \
-	struct name {				     \
-		struct type *tqh_first; /* first element */	       \
-		struct type **tqh_last; /* addr of last next element */	\
-		HEADNAME			    \
-			TRACEBUF			    \
-	}
-
-#define    TAILQ_HEAD_INITIALIZER(head)			   \
-	{ NULL, &(head).tqh_first }
-
-#define    TAILQ_ENTRY(type)			    \
-	struct {				\
-		struct type *tqe_next; /* next element */	     \
-		struct type **tqe_prev; /* address of previous next element */	   \
-		TRACEBUF			    \
-	}
-
-/*
- * Tail queue functions.
- */
-
-#define    TAILQ_EMPTY(head)    ((head)->tqh_first == NULL)
-
-#define    TAILQ_FIRST(head)    ((head)->tqh_first)
-
-#define    TAILQ_FOREACH(var, head, field)		      \
-	for ((var) = TAILQ_FIRST((head));		 \
-	     (var);			       \
-	     (var) = TAILQ_NEXT((var), field))
-
-#define    TAILQ_FOREACH_SAFE(var, head, field, tvar)		 \
-	for ((var) = TAILQ_FIRST((head));		 \
-	     (var) && ((tvar) = TAILQ_NEXT((var), field), 1);	     \
-	     (var) = (tvar))
-
-#define    TAILQ_FOREACH_REVERSE(var, head, headname, field)	    \
-	for ((var) = TAILQ_LAST((head), headname);	      \
-	     (var);			       \
-	     (var) = TAILQ_PREV((var), headname, field))
-
-#define    TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	   \
-	for ((var) = TAILQ_LAST((head), headname);	      \
-	     (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	   \
-	     (var) = (tvar))
-
-#define    TAILQ_INIT(head) do {			\
-		TAILQ_FIRST((head)) = NULL;		       \
-		(head)->tqh_last = &TAILQ_FIRST((head));	    \
-		COPY_HEADNAME(head);			     \
-		QMD_TRACE_HEAD(head);			     \
-} while (0)
-
-#define    TAILQ_INSERT_AFTER(head, listelm, elm, field) do {	     \
-		if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL) \
-			TAILQ_NEXT((elm), field)->field.tqe_prev =	   \
-				&TAILQ_NEXT((elm), field);		  \
-		else {				      \
-			(head)->tqh_last = &TAILQ_NEXT((elm), field);	     \
-			QMD_TRACE_HEAD(head);			 \
-		}				 \
-		TAILQ_NEXT((listelm), field) = (elm);		     \
-		(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);	      \
-		QMD_TRACE_ELEM(&(elm)->field);			  \
-		QMD_TRACE_ELEM(&listelm->field);		\
-} while (0)
-
-#define    TAILQ_INSERT_BEFORE(listelm, elm, field) do {	    \
-		(elm)->field.tqe_prev = (listelm)->field.tqe_prev;	  \
-		TAILQ_NEXT((elm), field) = (listelm);		     \
-		*(listelm)->field.tqe_prev = (elm);		   \
-		(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field);	      \
-		QMD_TRACE_ELEM(&(elm)->field);			  \
-		QMD_TRACE_ELEM(&listelm->field);		\
-} while (0)
-
-#define    TAILQ_INSERT_HEAD(head, elm, field) do {	       \
-		if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)	 \
-			TAILQ_FIRST((head))->field.tqe_prev =		 \
-				&TAILQ_NEXT((elm), field);		  \
-		else				    \
-			(head)->tqh_last = &TAILQ_NEXT((elm), field);	     \
-		TAILQ_FIRST((head)) = (elm);			\
-		(elm)->field.tqe_prev = &TAILQ_FIRST((head));		 \
-		QMD_TRACE_HEAD(head);			     \
-		QMD_TRACE_ELEM(&(elm)->field);			  \
-} while (0)
-
-#define    TAILQ_INSERT_TAIL(head, elm, field) do {	       \
-		TAILQ_NEXT((elm), field) = NULL;		\
-		(elm)->field.tqe_prev = (head)->tqh_last;	     \
-		*(head)->tqh_last = (elm);		      \
-		(head)->tqh_last = &TAILQ_NEXT((elm), field);		 \
-		QMD_TRACE_HEAD(head);			     \
-		QMD_TRACE_ELEM(&(elm)->field);			  \
-} while (0)
-
-#define    TAILQ_LAST(head, headname)			 \
-	(*(((struct headname *)((head)->tqh_last))->tqh_last))
-
-#define    TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define    TAILQ_PREV(elm, headname, field)		   \
-	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-
-#define    TAILQ_REMOVE(head, elm, field) do {		      \
-		if ((TAILQ_NEXT((elm), field)) != NULL)		       \
-			TAILQ_NEXT((elm), field)->field.tqe_prev =	   \
-				(elm)->field.tqe_prev;		      \
-		else {				      \
-			(head)->tqh_last = (elm)->field.tqe_prev;	 \
-			QMD_TRACE_HEAD(head);			 \
-		}				 \
-		*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);	  \
-		TRASHIT((elm)->field.tqe_next);			   \
-		TRASHIT((elm)->field.tqe_prev);			   \
-		QMD_TRACE_ELEM(&(elm)->field);			  \
-} while (0)
-
-#define TAILQ_CONCAT(head1, head2, field)  do {			 \
-		if (!TAILQ_EMPTY(head2)) {				     \
-			*(head1)->tqh_last = (head2)->tqh_first;		 \
-			(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	 \
-			(head1)->tqh_last  = (head2)->tqh_last;			 \
-			TAILQ_INIT((head2));					 \
-		}							     \
-} while (0)
-
-#ifdef _KERNEL
-
-/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
-
-struct quehead {
-	struct quehead *qh_link;
-	struct quehead *qh_rlink;
-};
-
-#if defined(__GNUC__) || defined(__INTEL_COMPILER)
-
-static __inline void insque(void *a, void *b)
-{
-	struct quehead *element = (struct quehead *)a,
-	*head = (struct quehead *)b;
-
-	element->qh_link = head->qh_link;
-	element->qh_rlink = head;
-	head->qh_link = element;
-	element->qh_link->qh_rlink = element;
-}
-
-static __inline void remque(void *a)
-{
-	struct quehead *element = (struct quehead *)a;
-
-	element->qh_link->qh_rlink = element->qh_rlink;
-	element->qh_rlink->qh_link = element->qh_link;
-	element->qh_rlink = 0;
-}
-
-#else                           /* !(__GNUC__ || __INTEL_COMPILER) */
-
-void insque(void *a, void *b);
-void remque(void *a);
-
-#endif /* __GNUC__ || __INTEL_COMPILER */
-
-#endif /* _KERNEL */
-
-#endif /* !_SYS_QUEUE_H_ */
-#else                           /* !__NetBSD__ */
-#include_next <sys/queue.h>
-#endif /* __NetBSD__ */

+ 0 - 253
core/hdd/inc/qc_sap_ioctl.h

@@ -1,253 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _QC_SAP_IOCTL_H_
-#define _QC_SAP_IOCTL_H_
-
-/*
- * QCSAP ioctls.
- */
-
-/*
- * Max size of optional information elements.  We artificially
- * constrain this; it's limited only by the max frame size (and
- * the max parameter size of the wireless extensions).
- */
-#define QCSAP_MAX_OPT_IE        256
-#define QCSAP_MAX_WSC_IE        256
-#define QCSAP_MAX_GET_STA_INFO  512
-
-typedef struct sSSID {
-	uint8_t length;
-	uint8_t ssId[32];
-} tSSID;
-
-typedef struct sSSIDInfo {
-	tSSID ssid;
-	uint8_t ssidHidden;
-} tSSIDInfo;
-
-typedef enum {
-	eQC_DOT11_MODE_ALL = 0,
-	eQC_DOT11_MODE_ABG = 0x0001,    /* 11a/b/g only, no HT, no proprietary */
-	eQC_DOT11_MODE_11A = 0x0002,
-	eQC_DOT11_MODE_11B = 0x0004,
-	eQC_DOT11_MODE_11G = 0x0008,
-	eQC_DOT11_MODE_11N = 0x0010,
-	eQC_DOT11_MODE_11G_ONLY = 0x0020,
-	eQC_DOT11_MODE_11N_ONLY = 0x0040,
-	eQC_DOT11_MODE_11B_ONLY = 0x0080,
-	eQC_DOT11_MODE_11A_ONLY = 0x0100,
-	/* This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL except when it starts IBSS in 11B of 2.4GHz */
-	/* It is for CSR internal use */
-	eQC_DOT11_MODE_AUTO = 0x0200,
-
-} tQcPhyMode;
-
-#define QCSAP_ADDR_LEN  6
-
-typedef uint8_t qcmacaddr[QCSAP_ADDR_LEN];
-
-struct qc_mac_acl_entry {
-	qcmacaddr addr;
-	int vlan_id;
-};
-
-typedef enum {
-	eQC_AUTH_TYPE_OPEN_SYSTEM,
-	eQC_AUTH_TYPE_SHARED_KEY,
-	eQC_AUTH_TYPE_AUTO_SWITCH
-} eQcAuthType;
-
-typedef enum {
-	eQC_WPS_BEACON_IE,
-	eQC_WPS_PROBE_RSP_IE,
-	eQC_WPS_ASSOC_RSP_IE
-} eQCWPSType;
-
-/*
- * Retrieve the WPA/RSN information element for an associated station.
- */
-struct sQcSapreq_wpaie {
-	uint8_t wpa_ie[QCSAP_MAX_OPT_IE];
-	uint8_t wpa_macaddr[QCSAP_ADDR_LEN];
-};
-
-/*
- * Retrieve the WSC information element for an associated station.
- */
-struct sQcSapreq_wscie {
-	uint8_t wsc_macaddr[QCSAP_ADDR_LEN];
-	uint8_t wsc_ie[QCSAP_MAX_WSC_IE];
-};
-
-/*
- * Retrieve the WPS PBC Probe Request IEs.
- */
-typedef struct sQcSapreq_WPSPBCProbeReqIES {
-	struct cdf_mac_addr macaddr;
-	uint16_t probeReqIELen;
-	uint8_t probeReqIE[512];
-} sQcSapreq_WPSPBCProbeReqIES_t;
-
-/*
- * Channel List Info
- */
-
-typedef struct {
-	uint8_t num_channels;
-	uint8_t channels[WNI_CFG_VALID_CHANNEL_LIST_LEN];
-} tChannelListInfo, *tpChannelListInfo;
-
-#ifdef __linux__
-/*
- * Wireless Extensions API, private ioctl interfaces.
- *
- * NB: Even-numbered ioctl numbers have set semantics and are privileged!
- *     (regardless of the incorrect comment in wireless.h!)
- */
-
-#define QCSAP_IOCTL_SETPARAM          (SIOCIWFIRSTPRIV+0)
-#define QCSAP_IOCTL_GETPARAM          (SIOCIWFIRSTPRIV+1)
-/* (SIOCIWFIRSTPRIV+2) is unused */
-/* (SIOCIWFIRSTPRIV+3) is unused */
-#define QCSAP_IOCTL_GET_STAWPAIE      (SIOCIWFIRSTPRIV+4)
-#define QCSAP_IOCTL_SETWPAIE          (SIOCIWFIRSTPRIV+5)
-#define QCSAP_IOCTL_STOPBSS           (SIOCIWFIRSTPRIV+6)
-#define QCSAP_IOCTL_VERSION           (SIOCIWFIRSTPRIV+7)
-#define QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES       (SIOCIWFIRSTPRIV+8)
-#define QCSAP_IOCTL_GET_CHANNEL       (SIOCIWFIRSTPRIV+9)
-#define QCSAP_IOCTL_ASSOC_STA_MACADDR (SIOCIWFIRSTPRIV+10)
-#define QCSAP_IOCTL_DISASSOC_STA      (SIOCIWFIRSTPRIV+11)
-/* (SIOCIWFIRSTPRIV+12) is unused */
-/* Private ioctls and their sub-ioctls */
-#define QCSAP_PRIV_GET_CHAR_SET_NONE   (SIOCIWFIRSTPRIV + 13)
-#define QCSAP_GET_STATS 1
-#define QCSAP_LIST_FW_PROFILE 2
-#define QCSAP_IOCTL_CLR_STATS         (SIOCIWFIRSTPRIV+14)
-
-#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
-
-#define QCSAP_IOCTL_MODIFY_ACL          (SIOCIWFIRSTPRIV+18)
-#define QCSAP_IOCTL_GET_CHANNEL_LIST    (SIOCIWFIRSTPRIV+19)
-#define QCSAP_IOCTL_SET_TX_POWER        (SIOCIWFIRSTPRIV+20)
-#define QCSAP_IOCTL_GET_STA_INFO        (SIOCIWFIRSTPRIV+21)
-#define QCSAP_IOCTL_SET_MAX_TX_POWER    (SIOCIWFIRSTPRIV+22)
-#define QCSAP_IOCTL_GET_INI_CFG         (SIOCIWFIRSTPRIV+25)
-#define QCSAP_IOCTL_SET_INI_CFG         (SIOCIWFIRSTPRIV+26)
-#define QCSAP_IOCTL_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28)
-#ifdef DEBUG
-#define QCSAP_IOCTL_SET_FW_CRASH_INJECT 1
-#endif
-#define QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL 2
-#define QCSAP_ENABLE_FW_PROFILE          3
-#define QCSAP_SET_FW_PROFILE_HIST_INTVL  4
-
-#define MAX_VAR_ARGS         7
-#define QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED (SIOCIWFIRSTPRIV + 31)
-
-#define QCSAP_IOCTL_MAX_STR_LEN 1024
-
-#define RC_2_RATE_IDX(_rc)              ((_rc) & 0x7)
-#define HT_RC_2_STREAMS(_rc)            ((((_rc) & 0x78) >> 3) + 1)
-
-#define RC_2_RATE_IDX_11AC(_rc)         ((_rc) & 0xf)
-#define HT_RC_2_STREAMS_11AC(_rc)       ((((_rc) & 0x30) >> 4) + 1)
-
-enum {
-	QCSAP_PARAM_MAX_ASSOC = 1,
-	QCSAP_PARAM_GET_WLAN_DBG,
-	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,
-	QCSAP_PARAM_SET_MCC_CHANNEL_QUOTA,
-	QCSAP_DBGLOG_LOG_LEVEL,
-	QCSAP_DBGLOG_VAP_ENABLE,
-	QCSAP_DBGLOG_VAP_DISABLE,
-	QCSAP_DBGLOG_MODULE_ENABLE,
-	QCSAP_DBGLOG_MODULE_DISABLE,
-	QCSAP_DBGLOG_MOD_LOG_LEVEL,
-	QCSAP_DBGLOG_TYPE,
-	QCSAP_DBGLOG_REPORT_ENABLE,
-	QCASAP_TXRX_FWSTATS_RESET,
-	QCSAP_PARAM_RTSCTS,
-	QCASAP_SET_11N_RATE,
-	QCASAP_SET_VHT_RATE,
-	QCASAP_SHORT_GI,
-	QCSAP_SET_AMPDU,
-	QCSAP_SET_AMSDU,
-	QCSAP_GTX_HT_MCS,
-	QCSAP_GTX_VHT_MCS,
-	QCSAP_GTX_USRCFG,
-	QCSAP_GTX_THRE,
-	QCSAP_GTX_MARGIN,
-	QCSAP_GTX_STEP,
-	QCSAP_GTX_MINTPC,
-	QCSAP_GTX_BWMASK,
-#ifdef QCA_PKT_PROTO_TRACE
-	QCASAP_SET_DEBUG_LOG,
-#endif
-	QCASAP_SET_TM_LEVEL,
-	QCASAP_SET_DFS_IGNORE_CAC,
-	QCASAP_GET_DFS_NOL,
-	QCASAP_SET_DFS_NOL,
-	QCSAP_PARAM_SET_CHANNEL_CHANGE,
-	QCASAP_SET_DFS_TARGET_CHNL,
-	QCASAP_SET_RADAR_CMD,
-	QCSAP_GET_ACL,
-	QCASAP_TX_CHAINMASK_CMD,
-	QCASAP_RX_CHAINMASK_CMD,
-	QCASAP_NSS_CMD,
-	QCSAP_IPA_UC_STAT,
-	QCASAP_SET_PHYMODE,
-	QCASAP_GET_TEMP_CMD,
-	QCASAP_DUMP_STATS,
-	QCASAP_CLEAR_STATS,
-	QCASAP_SET_RADAR_DBG,
-	QCSAP_GET_FW_PROFILE_DATA,
-	QCSAP_START_FW_PROFILING
-};
-
-int iw_softap_get_channel_list(struct net_device *dev,
-			       struct iw_request_info *info,
-			       union iwreq_data *wrqu, char *extra);
-
-#endif /* __linux__ */
-
-#endif /*_QC_SAP_IOCTL_H_*/

+ 0 - 264
core/hdd/inc/wlan_hdd_assoc.h

@@ -1,264 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_ASSOC_H__)
-#define WLAN_HDD_ASSOC_H__
-
-/**
- * DOC: wlan_hdd_assoc.h
- *
- */
-
-/* Include files */
-#include <wlan_hdd_mib.h>
-#include <sme_api.h>
-#include <wlan_defs.h>
-#include "ol_txrx_ctrl_api.h"
-
-/* Preprocessor Definitions and Constants */
-#ifdef FEATURE_WLAN_TDLS
-#define HDD_MAX_NUM_TDLS_STA          8
-#define HDD_MAX_NUM_TDLS_STA_P_UAPSD_OFFCHAN  1
-#define TDLS_STA_INDEX_VALID(staId) \
-	(((staId) >= 1) && ((staId) < 0xFF))
-#endif
-#define TKIP_COUNTER_MEASURE_STARTED 1
-#define TKIP_COUNTER_MEASURE_STOPED  0
-/* Timeout (in ms) for Link to Up before Registering Station */
-#define ASSOC_LINKUP_TIMEOUT 60
-
-/* Type Declarations */
-/**
- * typedef eConnectionState - Connection states
- * @eConnectionState_NotConnected: Not associated in Infra or participating
- *			in an IBSS / Ad-hoc network
- * @eConnectionState_Connecting: While connection in progress
- * @eConnectionState_Associated: Associated in an Infrastructure network
- * @eConnectionState_IbssDisconnected: Participating in an IBSS network though
- *			disconnected (no partner stations in the IBSS)
- * @eConnectionState_IbssConnected: Participating in an IBSS network with
- *			partner stations also present
- * eConnectionState_Disconnecting: Disconnecting in an Infrastructure network
- */
-typedef enum {
-	eConnectionState_NotConnected,
-	eConnectionState_Connecting,
-	eConnectionState_Associated,
-	eConnectionState_IbssDisconnected,
-	eConnectionState_IbssConnected,
-	eConnectionState_Disconnecting
-} eConnectionState;
-
-/**
- * typedef ePeerStatus - Peer status
- * @ePeerConnected: peer connected
- * @ePeerDisconnected: peer disconnected
- */
-typedef enum {
-	ePeerConnected = 1,
-	ePeerDisconnected
-} ePeerStatus;
-
-/**
- * typedef connection_info_t - structure to store connection information
- * @connState: connection state of the NIC
- * @connDot11DesiredBssType: BSS type of the current connection.
- *		Comes from the MIB at the time the connect request is issued
- *		in combination with the BssDescription from the
- *		associated entity
- * @bssId: BSSID
- * @SSID: SSID Info
- * @staId: Station ID
- * @peerMacAddress:Peer Mac Address of the IBSS Stations
- * @authType: Auth Type
- * @ucEncryptionType: Unicast Encryption Type
- * @mcEncryptionType: Multicast Encryption Type
- * @Keys: Keys
- * @operationChannel: Operation Channel
- * @uIsAuthenticated: Remembers authenticated state
- * @dot11Mode: dot11Mode
- * @proxyARPService: proxy arp service
- * @ptk_installed: ptk installed state
- * @gtk_installed: gtk installed state
- * @nss: number of spatial streams negotiated
- * @rate_flags: rate flags for current connection
- */
-typedef struct connection_info_s {
-	eConnectionState connState;
-	eMib_dot11DesiredBssType connDot11DesiredBssType;
-	struct cdf_mac_addr bssId;
-	tCsrSSIDInfo SSID;
-	uint8_t staId[MAX_IBSS_PEERS];
-	struct cdf_mac_addr peerMacAddress[MAX_IBSS_PEERS];
-	eCsrAuthType authType;
-	eCsrEncryptionType ucEncryptionType;
-	eCsrEncryptionType mcEncryptionType;
-	tCsrKeys Keys;
-	uint8_t operationChannel;
-	uint8_t uIsAuthenticated;
-	uint32_t dot11Mode;
-	uint8_t proxyARPService;
-	bool ptk_installed;
-	bool gtk_installed;
-	uint8_t nss;
-	uint32_t rate_flags;
-} connection_info_t;
-
-/* Forward declarations */
-typedef struct hdd_adapter_s hdd_adapter_t;
-typedef struct hdd_context_s hdd_context_t;
-typedef struct hdd_station_ctx hdd_station_ctx_t;
-typedef struct hdd_ap_ctx_s hdd_ap_ctx_t;
-typedef struct hdd_mon_ctx_s hdd_mon_ctx_t;
-
-/**
- * hdd_is_connecting() - Function to check connection progress
- * @hdd_sta_ctx:    pointer to global HDD Station context
- *
- * Return: true if connecting, false otherwise
- */
-bool hdd_is_connecting(hdd_station_ctx_t *hdd_sta_ctx);
-
-/**
- * hdd_conn_is_connected() - Function to check connection status
- * @pHddStaCtx:    pointer to global HDD Station context
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_conn_is_connected(hdd_station_ctx_t *pHddStaCtx);
-
-/**
- * hdd_conn_get_connected_band() - get current connection radio band
- * @pHddStaCtx:    pointer to global HDD Station context
- *
- * Return: eCSR_BAND_24 or eCSR_BAND_5G based on current AP connection
- *      eCSR_BAND_ALL if not connected
- */
-eCsrBand hdd_conn_get_connected_band(hdd_station_ctx_t *pHddStaCtx);
-
-/**
- * hdd_sme_roam_callback() - hdd sme roam callback
- * @pContext: pointer to adapter context
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo,
-				 uint32_t roamId,
-				 eRoamCmdStatus roamStatus,
-				 eCsrRoamResult roamResult);
-
-/**
- * hdd_conn_get_connected_bss_type() - get current bss type
- * @pHddStaCtx:         pointer to global HDD Station context
- * @pConnectedBssType:  pointer to connected bss type
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool
-hdd_conn_get_connected_bss_type(hdd_station_ctx_t *pHddStaCtx,
-				eMib_dot11DesiredBssType *pConnectedBssType);
-
-/**
- * hdd_set_genie_to_csr() - set genie to csr
- * @pAdapter: pointer to adapter
- * @RSNAuthType: pointer to auth type
- *
- * Return: 0 on success, error number otherwise
- */
-int hdd_set_genie_to_csr(hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType);
-
-/**
- * hdd_set_csr_auth_type() - set csr auth type
- * @pAdapter: pointer to adapter
- * @RSNAuthType: auth type
- *
- * Return: 0 on success, error number otherwise
- */
-int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType);
-
-/**
- * hdd_roam_register_tdlssta() - register new TDLS station
- * @pAdapter: pointer to adapter
- * @peerMac: pointer to peer MAC address
- * @staId: station identifier
- * @ucastSig: unicast signature
- *
- * Construct the staDesc and register with TL the new STA.
- * This is called as part of ADD_STA in the TDLS setup.
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_roam_register_tdlssta(hdd_adapter_t *pAdapter,
-				     const uint8_t *peerMac, uint16_t staId,
-				     uint8_t ucastSig);
-
-/**
- * hdd_perform_roam_set_key_complete() - perform set key complete
- * @pAdapter: pointer to adapter
- *
- * Return: none
- */
-void hdd_perform_roam_set_key_complete(hdd_adapter_t *pAdapter);
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-/**
- * hdd_indicate_ese_bcn_report_no_results() - beacon report no scan results
- * @pAdapter: pointer to adapter
- * @measurementToken: measurement token
- * @flag: flag
- * @numBss: number of bss
- *
- * If the measurement is none and no scan results found,
- * indicate the supplicant about measurement done.
- *
- * Return: none
- */
-void
-hdd_indicate_ese_bcn_report_no_results(const hdd_adapter_t *pAdapter,
-					    const uint16_t measurementToken,
-					    const bool flag,
-					    const uint8_t numBss);
-#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
-
-CDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter,
-				 uint8_t sta_id,
-				 enum ol_txrx_peer_state sta_state,
-				 bool roam_synch_in_progress);
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-bool hdd_is_roam_sync_in_progress(tCsrRoamInfo *roaminfo);
-#else
-static inline bool hdd_is_roam_sync_in_progress(tCsrRoamInfo *roaminfo)
-{
-	return false;
-}
-#endif
-
-#endif

+ 0 - 3611
core/hdd/inc/wlan_hdd_cfg.h

@@ -1,3611 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(HDD_CONFIG_H__)
-#define HDD_CONFIG_H__
-
-/**
- *
- * DOC: wlan_hdd_config.h
- *
- * WLAN Adapter Configuration functions
- */
-
-/* $HEADER$ */
-
-/* Include files */
-#include <wlan_hdd_includes.h>
-#include <wlan_hdd_wmm.h>
-#include <cdf_types.h>
-#include <csr_api.h>
-#include <sap_api.h>
-#include <wmi_unified.h>
-
-#define FW_MODULE_LOG_LEVEL_STRING_LENGTH  (255)
-
-#ifdef DHCP_SERVER_OFFLOAD
-#define IPADDR_NUM_ENTRIES     (4)
-#define IPADDR_STRING_LENGTH   (16)
-#endif
-
-/* Number of items that can be configured */
-#define MAX_CFG_INI_ITEMS   1024
-
-/* Defines for all of the things we read from the configuration (registry). */
-
-#define CFG_RTS_THRESHOLD_NAME                 "RTSThreshold"
-#define CFG_RTS_THRESHOLD_MIN                  WNI_CFG_RTS_THRESHOLD_STAMIN     /* min is 0, meaning always use RTS. */
-#define CFG_RTS_THRESHOLD_MAX                  WNI_CFG_RTS_THRESHOLD_STAMAX     /* max is the max frame size */
-#define CFG_RTS_THRESHOLD_DEFAULT              WNI_CFG_RTS_THRESHOLD_STADEF
-
-#define CFG_FRAG_THRESHOLD_NAME                "gFragmentationThreshold"
-#define CFG_FRAG_THRESHOLD_MIN                 WNI_CFG_FRAGMENTATION_THRESHOLD_STAMIN
-#define CFG_FRAG_THRESHOLD_MAX                 WNI_CFG_FRAGMENTATION_THRESHOLD_STAMAX
-#define CFG_FRAG_THRESHOLD_DEFAULT             WNI_CFG_FRAGMENTATION_THRESHOLD_STADEF
-
-#define CFG_OPERATING_CHANNEL_NAME             "gOperatingChannel"
-#define CFG_OPERATING_CHANNEL_MIN              (0)
-#define CFG_OPERATING_CHANNEL_MAX              (14)
-#define CFG_OPERATING_CHANNEL_DEFAULT          (1)
-
-#define CFG_SHORT_SLOT_TIME_ENABLED_NAME       "gShortSlotTimeEnabled"
-#define CFG_SHORT_SLOT_TIME_ENABLED_MIN        WNI_CFG_SHORT_SLOT_TIME_STAMIN
-#define CFG_SHORT_SLOT_TIME_ENABLED_MAX        WNI_CFG_SHORT_SLOT_TIME_STAMAX
-#define CFG_SHORT_SLOT_TIME_ENABLED_DEFAULT    WNI_CFG_SHORT_SLOT_TIME_STADEF
-
-#define CFG_11D_SUPPORT_ENABLED_NAME           "g11dSupportEnabled"
-#define CFG_11D_SUPPORT_ENABLED_MIN            WNI_CFG_11D_ENABLED_STAMIN
-#define CFG_11D_SUPPORT_ENABLED_MAX            WNI_CFG_11D_ENABLED_STAMAX
-#define CFG_11D_SUPPORT_ENABLED_DEFAULT        WNI_CFG_11D_ENABLED_STADEF       /* Default is ON */
-
-#define CFG_11H_SUPPORT_ENABLED_NAME           "g11hSupportEnabled"
-#define CFG_11H_SUPPORT_ENABLED_MIN            (0)
-#define CFG_11H_SUPPORT_ENABLED_MAX            (1)
-#define CFG_11H_SUPPORT_ENABLED_DEFAULT        (1)    /* Default is ON */
-
-/* COUNTRY Code Priority */
-#define CFG_COUNTRY_CODE_PRIORITY_NAME         "gCountryCodePriority"
-#define CFG_COUNTRY_CODE_PRIORITY_MIN          (0)
-#define CFG_COUNTRY_CODE_PRIORITY_MAX          (1)
-#define CFG_COUNTRY_CODE_PRIORITY_DEFAULT      (0)
-
-#define CFG_HEARTBEAT_THRESH_24_NAME           "gHeartbeat24"
-#define CFG_HEARTBEAT_THRESH_24_MIN            WNI_CFG_HEART_BEAT_THRESHOLD_STAMIN
-#define CFG_HEARTBEAT_THRESH_24_MAX            WNI_CFG_HEART_BEAT_THRESHOLD_STAMAX
-#define CFG_HEARTBEAT_THRESH_24_DEFAULT        WNI_CFG_HEART_BEAT_THRESHOLD_STADEF
-
-#define CFG_POWER_USAGE_NAME                   "gPowerUsage"
-#define CFG_POWER_USAGE_MIN                    "Min"    /* Minimum Power Save */
-#define CFG_POWER_USAGE_MAX                    "Max"    /* Maximum Power Save */
-#define CFG_POWER_USAGE_DEFAULT                "Mod"    /* Moderate Power Save */
-
-#define CFG_WOWL_PATTERN_NAME                  "gWowlPattern"
-#define CFG_WOWL_PATTERN_DEFAULT               ""
-
-/* IMPS = IdleModePowerSave */
-#define CFG_ENABLE_IMPS_NAME                   "gEnableImps"
-#define CFG_ENABLE_IMPS_MIN                    (0)
-#define CFG_ENABLE_IMPS_MAX                    (1)
-#define CFG_ENABLE_IMPS_DEFAULT                (1)
-
-/* PS = PowerSave */
-#define CFG_ENABLE_PS_NAME                     "gEnableBmps"
-#define CFG_ENABLE_PS_MIN                      (0)
-#define CFG_ENABLE_PS_MAX                      (1)
-#define CFG_ENABLE_PS_DEFAULT                  (1)
-
-#define CFG_BMPS_MINIMUM_LI_NAME               "gBmpsMinListenInterval"
-#define CFG_BMPS_MINIMUM_LI_MIN                (1)
-#define CFG_BMPS_MINIMUM_LI_MAX                (65535)
-#define CFG_BMPS_MINIMUM_LI_DEFAULT            (1)
-
-#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)
-
-#define CFG_BMPS_MAXIMUM_LI_NAME               "gBmpsMaxListenInterval"
-#define CFG_BMPS_MAXIMUM_LI_MIN                (1)
-#define CFG_BMPS_MAXIMUM_LI_MAX                (65535)
-#define CFG_BMPS_MAXIMUM_LI_DEFAULT            (1)
-
-#define CFG_MAX_RX_AMPDU_FACTOR_NAME           "gMaxRxAmpduFactor"
-#define CFG_MAX_RX_AMPDU_FACTOR_MIN            WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMIN
-#define CFG_MAX_RX_AMPDU_FACTOR_MAX            WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX
-#define CFG_MAX_RX_AMPDU_FACTOR_DEFAULT        WNI_CFG_MAX_RX_AMPDU_FACTOR_STADEF
-
-/* Configuration option for HT MPDU density (Table 8-125 802.11-2012)
- * 0 for no restriction
- * 1 for 1/4 micro sec
- * 2 for 1/2 micro sec
- * 3 for 1 micro sec
- * 4 for 2 micro sec
- * 5 for 4 micro sec
- * 6 for 8 micro sec
- * 7 for 16 micro sec
- */
-#define CFG_HT_MPDU_DENSITY_NAME               "ght_mpdu_density"
-#define CFG_HT_MPDU_DENSITY_MIN                WNI_CFG_MPDU_DENSITY_STAMIN
-#define CFG_HT_MPDU_DENSITY_MAX                WNI_CFG_MPDU_DENSITY_STAMAX
-#define CFG_HT_MPDU_DENSITY_DEFAULT            WNI_CFG_MPDU_DENSITY_STADEF
-
-/* Configuration added to enable/disable CTS2SELF in */
-/* Adaptive RX drain feature */
-#define CFG_ENABLE_ADAPT_RX_DRAIN_NAME     "gEnableAdaptRxDrain"
-#define CFG_ENABLE_ADAPT_RX_DRAIN_MIN       WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STAMIN
-#define CFG_ENABLE_ADAPT_RX_DRAIN_MAX       WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STAMAX
-#define CFG_ENABLE_ADAPT_RX_DRAIN_DEFAULT   WNI_CFG_ENABLE_ADAPT_RX_DRAIN_STADEF
-
-#define CFG_REG_CHANGE_DEF_COUNTRY_NAME          "gRegulatoryChangeCountry"
-#define CFG_REG_CHANGE_DEF_COUNTRY_DEFAULT       (0)
-#define CFG_REG_CHANGE_DEF_COUNTRY_MIN           (0)
-#define CFG_REG_CHANGE_DEF_COUNTRY_MAX           (1)
-
-#define CFG_ADVERTISE_CONCURRENT_OPERATION_NAME    "gAdvertiseConcurrentOperation"
-#define CFG_ADVERTISE_CONCURRENT_OPERATION_DEFAULT (1)
-#define CFG_ADVERTISE_CONCURRENT_OPERATION_MIN     (0)
-#define CFG_ADVERTISE_CONCURRENT_OPERATION_MAX     (1)
-
-typedef enum {
-	eHDD_DOT11_MODE_AUTO = 0,       /* covers all things we support */
-	eHDD_DOT11_MODE_abg,    /* 11a/b/g only, no HT, no proprietary */
-	eHDD_DOT11_MODE_11b,
-	eHDD_DOT11_MODE_11g,
-	eHDD_DOT11_MODE_11n,
-	eHDD_DOT11_MODE_11g_ONLY,
-	eHDD_DOT11_MODE_11n_ONLY,
-	eHDD_DOT11_MODE_11b_ONLY,
-	eHDD_DOT11_MODE_11ac_ONLY,
-	eHDD_DOT11_MODE_11ac,
-	eHDD_DOT11_MODE_11a,
-} eHddDot11Mode;
-
-#define CFG_DOT11_MODE_NAME                    "gDot11Mode"
-#define CFG_DOT11_MODE_MIN                     eHDD_DOT11_MODE_AUTO
-#ifdef WLAN_FEATURE_11AC
-#define CFG_DOT11_MODE_DEFAULT                 eHDD_DOT11_MODE_11ac
-#else
-#define CFG_DOT11_MODE_DEFAULT                 eHDD_DOT11_MODE_11n
-#endif
-#define CFG_DOT11_MODE_MAX                     eHDD_DOT11_MODE_11a
-
-#define CFG_CHANNEL_BONDING_MODE_24GHZ_NAME    "gChannelBondingMode24GHz"
-#define CFG_CHANNEL_BONDING_MODE_MIN           WNI_CFG_CHANNEL_BONDING_MODE_STAMIN
-#define CFG_CHANNEL_BONDING_MODE_MAX           WNI_CFG_CHANNEL_BONDING_MODE_STAMAX
-#define CFG_CHANNEL_BONDING_MODE_DEFAULT       WNI_CFG_CHANNEL_BONDING_MODE_STADEF
-
-#define CFG_CHANNEL_BONDING_MODE_5GHZ_NAME     "gChannelBondingMode5GHz"
-#define CFG_CHANNEL_BONDING_MODE_MIN           WNI_CFG_CHANNEL_BONDING_MODE_STAMIN
-#define CFG_CHANNEL_BONDING_MODE_MAX           WNI_CFG_CHANNEL_BONDING_MODE_STAMAX
-#define CFG_CHANNEL_BONDING_MODE_DEFAULT       WNI_CFG_CHANNEL_BONDING_MODE_STADEF
-
-#define CFG_FIXED_RATE_NAME                    "gFixedRate"
-#define CFG_FIXED_RATE_MIN                     WNI_CFG_FIXED_RATE_STAMIN
-#define CFG_FIXED_RATE_MAX                     WNI_CFG_FIXED_RATE_STAMAX
-#define CFG_FIXED_RATE_DEFAULT                 WNI_CFG_FIXED_RATE_STADEF
-
-#define CFG_SHORT_GI_20MHZ_NAME                "gShortGI20Mhz"
-#define CFG_SHORT_GI_20MHZ_MIN                 WNI_CFG_SHORT_GI_20MHZ_STAMIN
-#define CFG_SHORT_GI_20MHZ_MAX                 WNI_CFG_SHORT_GI_20MHZ_STAMAX
-#define CFG_SHORT_GI_20MHZ_DEFAULT             WNI_CFG_SHORT_GI_20MHZ_STADEF
-
-#define CFG_SCAN_RESULT_AGE_COUNT_NAME         "gScanResultAgeCount"
-#define CFG_SCAN_RESULT_AGE_COUNT_MIN          (1)
-#define CFG_SCAN_RESULT_AGE_COUNT_MAX          (100)
-#define CFG_SCAN_RESULT_AGE_COUNT_DEFAULT      (3)
-
-/* All in seconds */
-/* Not Connect, No Power Save */
-#define CFG_SCAN_RESULT_AGE_TIME_NCNPS_NAME    "gScanResultAgeNCNPS"
-#define CFG_SCAN_RESULT_AGE_TIME_NCNPS_MIN     (10)
-#define CFG_SCAN_RESULT_AGE_TIME_NCNPS_MAX     (10000)
-#define CFG_SCAN_RESULT_AGE_TIME_NCNPS_DEFAULT (50)
-/* Not Connect, Power Save */
-#define CFG_SCAN_RESULT_AGE_TIME_NCPS_NAME     "gScanResultAgeNCPS"
-#define CFG_SCAN_RESULT_AGE_TIME_NCPS_MIN      (10)
-#define CFG_SCAN_RESULT_AGE_TIME_NCPS_MAX      (10000)
-#define CFG_SCAN_RESULT_AGE_TIME_NCPS_DEFAULT  (300)
-/* Connect, No Power Save */
-#define CFG_SCAN_RESULT_AGE_TIME_CNPS_NAME     "gScanResultAgeCNPS"
-#define CFG_SCAN_RESULT_AGE_TIME_CNPS_MIN      (10)
-#define CFG_SCAN_RESULT_AGE_TIME_CNPS_MAX      (10000)
-#define CFG_SCAN_RESULT_AGE_TIME_CNPS_DEFAULT  (150)
-/* Connect, Power Save */
-#define CFG_SCAN_RESULT_AGE_TIME_CPS_NAME      "gScanResultAgeCPS"
-#define CFG_SCAN_RESULT_AGE_TIME_CPS_MIN       (10)
-#define CFG_SCAN_RESULT_AGE_TIME_CPS_MAX       (10000)
-#define CFG_SCAN_RESULT_AGE_TIME_CPS_DEFAULT   (600)
-
-#define CFG_RSSI_CATEGORY_GAP_NAME             "gRssiCatGap"
-#define CFG_RSSI_CATEGORY_GAP_MIN              (5)
-#define CFG_RSSI_CATEGORY_GAP_MAX              (100)
-#define CFG_RSSI_CATEGORY_GAP_DEFAULT          (5)
-
-#define CFG_ROAM_PREFER_5GHZ                   "gRoamPrefer5GHz"
-#define CFG_ROAM_PREFER_5GHZ_MIN              (0)
-#define CFG_ROAM_PREFER_5GHZ_MAX              (1)
-#define CFG_ROAM_PREFER_5GHZ_DEFAULT          (1)
-
-/*
-    To enable, set gRoamIntraBand=1 (Roaming within band)
-    To disable, set gRoamIntraBand=0 (Roaming across band)
- */
-#define CFG_ROAM_INTRA_BAND                   "gRoamIntraBand"
-#define CFG_ROAM_INTRA_BAND_MIN               (0)
-#define CFG_ROAM_INTRA_BAND_MAX               (1)
-#define CFG_ROAM_INTRA_BAND_DEFAULT           (0)
-
-#define CFG_SHORT_PREAMBLE_NAME                "gShortPreamble"
-#define CFG_SHORT_PREAMBLE_MIN                 WNI_CFG_SHORT_PREAMBLE_STAMIN
-#define CFG_SHORT_PREAMBLE_MAX                 WNI_CFG_SHORT_PREAMBLE_STAMAX
-#define CFG_SHORT_PREAMBLE_DEFAULT             WNI_CFG_SHORT_PREAMBLE_STADEF
-
-#define CFG_IBSS_BSSID_NAME                    "gIbssBssid"
-#define CFG_IBSS_BSSID_MIN                     "000000000000"
-#define CFG_IBSS_BSSID_MAX                     "ffffffffffff"
-#define CFG_IBSS_BSSID_DEFAULT                 "000AF5040506"
-
-#define CFG_INTF0_MAC_ADDR_NAME                  "Intf0MacAddress"
-#define CFG_INTF0_MAC_ADDR_MIN                   "000000000000"
-#define CFG_INTF0_MAC_ADDR_MAX                   "ffffffffffff"
-#define CFG_INTF0_MAC_ADDR_DEFAULT               "000AF5898980"
-
-#define CFG_INTF1_MAC_ADDR_NAME                  "Intf1MacAddress"
-#define CFG_INTF1_MAC_ADDR_MIN                   "000000000000"
-#define CFG_INTF1_MAC_ADDR_MAX                   "ffffffffffff"
-#define CFG_INTF1_MAC_ADDR_DEFAULT               "000AF5898981"
-
-#define CFG_INTF2_MAC_ADDR_NAME                  "Intf2MacAddress"
-#define CFG_INTF2_MAC_ADDR_MIN                   "000000000000"
-#define CFG_INTF2_MAC_ADDR_MAX                   "ffffffffffff"
-#define CFG_INTF2_MAC_ADDR_DEFAULT               "000AF5898982"
-
-#define CFG_INTF3_MAC_ADDR_NAME                  "Intf3MacAddress"
-#define CFG_INTF3_MAC_ADDR_MIN                   "000000000000"
-#define CFG_INTF3_MAC_ADDR_MAX                   "ffffffffffff"
-#define CFG_INTF3_MAC_ADDR_DEFAULT               "000AF5898983"
-
-#define CFG_AP_QOS_UAPSD_MODE_NAME             "gEnableApUapsd" /* ACs to setup U-APSD for at assoc */
-#define CFG_AP_QOS_UAPSD_MODE_MIN              (0)
-#define CFG_AP_QOS_UAPSD_MODE_MAX              (1)
-#define CFG_AP_QOS_UAPSD_MODE_DEFAULT          (1)
-
-#define CFG_AP_ENABLE_RANDOM_BSSID_NAME            "gEnableApRandomBssid"
-#define CFG_AP_ENABLE_RANDOM_BSSID_MIN             (0)
-#define CFG_AP_ENABLE_RANDOM_BSSID_MAX             (1)
-#define CFG_AP_ENABLE_RANDOM_BSSID_DEFAULT         (0)
-
-#define CFG_AP_ENABLE_PROTECTION_MODE_NAME            "gEnableApProt"
-#define CFG_AP_ENABLE_PROTECTION_MODE_MIN             (0)
-#define CFG_AP_ENABLE_PROTECTION_MODE_MAX             (1)
-#define CFG_AP_ENABLE_PROTECTION_MODE_DEFAULT         (1)
-
-/* Bit map for CFG_AP_PROTECTION_MODE_DEFAULT */
-/* LOWER byte for associated stations */
-/* UPPER byte for overlapping stations */
-/* each byte will have the following info */
-/* bit15 bit14 bit13     bit12  bit11 bit10    bit9     bit8 */
-/* OBSS  RIFS  LSIG_TXOP NON_GF HT20  FROM_11G FROM_11B FROM_11A */
-/* bit7  bit6  bit5      bit4   bit3  bit2     bit1     bit0 */
-/* OBSS  RIFS  LSIG_TXOP NON_GF HT_20 FROM_11G FROM_11B FROM_11A */
-#define CFG_AP_PROTECTION_MODE_NAME            "gApProtection"
-#define CFG_AP_PROTECTION_MODE_MIN             (0x0)
-#define CFG_AP_PROTECTION_MODE_MAX             (0xFFFF)
-#define CFG_AP_PROTECTION_MODE_DEFAULT         (0xBFFF)
-
-#define CFG_AP_OBSS_PROTECTION_MODE_NAME       "gEnableApOBSSProt"
-#define CFG_AP_OBSS_PROTECTION_MODE_MIN        (0)
-#define CFG_AP_OBSS_PROTECTION_MODE_MAX        (1)
-#define CFG_AP_OBSS_PROTECTION_MODE_DEFAULT    (0)
-
-#define CFG_AP_STA_SECURITY_SEPERATION_NAME    "gDisableIntraBssFwd"
-#define CFG_AP_STA_SECURITY_SEPERATION_MIN     (0)
-#define CFG_AP_STA_SECURITY_SEPERATION_MAX     (1)
-#define CFG_AP_STA_SECURITY_SEPERATION_DEFAULT (0)
-
-#define CFG_AP_LISTEN_MODE_NAME               "gEnablePhyAgcListenMode"
-#define CFG_AP_LISTEN_MODE_MIN                (0)
-#define CFG_AP_LISTEN_MODE_MAX                (128)
-#define CFG_AP_LISTEN_MODE_DEFAULT            (128)
-
-#define CFG_AP_AUTO_SHUT_OFF                "gAPAutoShutOff"
-#define CFG_AP_AUTO_SHUT_OFF_MIN            (0)
-#define CFG_AP_AUTO_SHUT_OFF_MAX            (4294967295UL)
-#define CFG_AP_AUTO_SHUT_OFF_DEFAULT        (0)
-
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-#define CFG_WLAN_AUTO_SHUTDOWN              "gWlanAutoShutdown"
-#define CFG_WLAN_AUTO_SHUTDOWN_MIN          (0)
-#define CFG_WLAN_AUTO_SHUTDOWN_MAX          (86400)   /* Max 1 day timeout */
-#define CFG_WLAN_AUTO_SHUTDOWN_DEFAULT      (0)
-#endif
-
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE          "gWlanMccToSccSwitchMode"
-#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MIN      (CDF_MCC_TO_SCC_SWITCH_DISABLE)
-#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MAX      (CDF_MCC_TO_SCC_SWITCH_FORCE)
-#define CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_DEFAULT  (CDF_MCC_TO_SCC_SWITCH_DISABLE)
-#endif
-
-#define CFG_DISABLE_PACKET_FILTER "gDisablePacketFilter"
-#define CFG_DISABLE_PACKET_FILTER_MIN       (0)
-#define CFG_DISABLE_PACKET_FILTER_MAX               (0x1)
-#define CFG_DISABLE_PACKET_FILTER_DEFAULT           (0)
-
-#define CFG_ENABLE_LTE_COEX              "gEnableLTECoex"
-#define CFG_ENABLE_LTE_COEX_MIN               (0)
-#define CFG_ENABLE_LTE_COEX_MAX               (1)
-#define CFG_ENABLE_LTE_COEX_DEFAULT           (0)
-
-#define CFG_AP_KEEP_ALIVE_PERIOD_NAME          "gApKeepAlivePeriod"
-#define CFG_AP_KEEP_ALIVE_PERIOD_MIN           WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STAMIN
-#define CFG_AP_KEEP_ALIVE_PERIOD_MAX           WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STAMAX
-#define CFG_AP_KEEP_ALIVE_PERIOD_DEFAULT       WNI_CFG_AP_KEEP_ALIVE_TIMEOUT_STADEF
-
-#define CFG_GO_KEEP_ALIVE_PERIOD_NAME          "gGoKeepAlivePeriod"
-#define CFG_GO_KEEP_ALIVE_PERIOD_MIN           WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMIN
-#define CFG_GO_KEEP_ALIVE_PERIOD_MAX           WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STAMAX
-#define CFG_GO_KEEP_ALIVE_PERIOD_DEFAULT       WNI_CFG_GO_KEEP_ALIVE_TIMEOUT_STADEF
-
-#define CFG_AP_LINK_MONITOR_PERIOD_NAME          "gApLinkMonitorPeriod"
-#define CFG_AP_LINK_MONITOR_PERIOD_MIN           (3)
-#define CFG_AP_LINK_MONITOR_PERIOD_MAX           (50)
-#define CFG_AP_LINK_MONITOR_PERIOD_DEFAULT       (10)
-
-/* gGoLinkMonitorPeriod is period where link is idle and where
- * we send NULL frame
- */
-#define CFG_GO_LINK_MONITOR_PERIOD_NAME          "gGoLinkMonitorPeriod"
-#define CFG_GO_LINK_MONITOR_PERIOD_MIN           (3)
-#define CFG_GO_LINK_MONITOR_PERIOD_MAX           (50)
-#define CFG_GO_LINK_MONITOR_PERIOD_DEFAULT       (10)
-
-#define CFG_BEACON_INTERVAL_NAME               "gBeaconInterval"
-#define CFG_BEACON_INTERVAL_MIN                WNI_CFG_BEACON_INTERVAL_STAMIN
-#define CFG_BEACON_INTERVAL_MAX                WNI_CFG_BEACON_INTERVAL_STAMAX
-#define CFG_BEACON_INTERVAL_DEFAULT            WNI_CFG_BEACON_INTERVAL_STADEF
-
-/* Additional Handoff related Parameters */
-#define CFG_ROAMING_TIME_NAME                 "gRoamingTime"
-#define CFG_ROAMING_TIME_MIN                  (0)
-#define CFG_ROAMING_TIME_MAX                  (4294967UL)
-#define CFG_ROAMING_TIME_DEFAULT              (10)
-
-#define CFG_VCC_RSSI_TRIGGER_NAME             "gVccRssiTrigger"
-#define CFG_VCC_RSSI_TRIGGER_MIN              (0)
-#define CFG_VCC_RSSI_TRIGGER_MAX              (80)
-#define CFG_VCC_RSSI_TRIGGER_DEFAULT          (80)
-
-#define CFG_VCC_UL_MAC_LOSS_THRESH_NAME       "gVccUlMacLossThresh"
-#define CFG_VCC_UL_MAC_LOSS_THRESH_MIN        (0)
-#define CFG_VCC_UL_MAC_LOSS_THRESH_MAX        (9)
-#define CFG_VCC_UL_MAC_LOSS_THRESH_DEFAULT    (9)
-
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_NAME      "gPassiveMaxChannelTime"
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_MIN       (0)
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_MAX       (10000)
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_DEFAULT   (110)
-
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_NAME      "gPassiveMinChannelTime"
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_MIN       (0)
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_MAX       (10000)
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_DEFAULT   (60)
-
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_NAME       "gActiveMaxChannelTime"
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_MIN        (0)
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_MAX        (10000)
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_DEFAULT    (40)
-
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_NAME       "gActiveMinChannelTime"
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_MIN        (0)
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_MAX        (10000)
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_DEFAULT    (20)
-
-#define CFG_RETRY_LIMIT_ZERO_NAME       "gRetryLimitZero"
-#define CFG_RETRY_LIMIT_ZERO_MIN        (0)
-#define CFG_RETRY_LIMIT_ZERO_MAX        (15)
-#define CFG_RETRY_LIMIT_ZERO_DEFAULT    (5)
-
-#define CFG_RETRY_LIMIT_ONE_NAME       "gRetryLimitOne"
-#define CFG_RETRY_LIMIT_ONE_MIN        (0)
-#define CFG_RETRY_LIMIT_ONE_MAX        (15)
-#define CFG_RETRY_LIMIT_ONE_DEFAULT    (10)
-
-#define CFG_RETRY_LIMIT_TWO_NAME       "gRetryLimitTwo"
-#define CFG_RETRY_LIMIT_TWO_MIN        (0)
-#define CFG_RETRY_LIMIT_TWO_MAX        (15)
-#define CFG_RETRY_LIMIT_TWO_DEFAULT    (15)
-
-#ifdef WLAN_AP_STA_CONCURRENCY
-
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_NAME      "gPassiveMaxChannelTimeConc"
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MIN       (0)
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MAX       (10000)
-#define CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_DEFAULT   (110)
-
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_NAME      "gPassiveMinChannelTimeConc"
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MIN       (0)
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MAX       (10000)
-#define CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_DEFAULT   (60)
-
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_NAME       "gActiveMaxChannelTimeConc"
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MIN        (0)
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MAX        (10000)
-#define CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_DEFAULT    (40)
-
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_NAME       "gActiveMinChannelTimeConc"
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MIN        (0)
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MAX        (10000)
-#define CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_DEFAULT    (20)
-
-#define CFG_REST_TIME_CONC_NAME                     "gRestTimeConc"
-#define CFG_REST_TIME_CONC_MIN                      (0)
-#define CFG_REST_TIME_CONC_MAX                      (10000)
-#define CFG_REST_TIME_CONC_DEFAULT                  (100)
-
-#define CFG_NUM_STA_CHAN_COMBINED_CONC_NAME             "gNumStaChanCombinedConc"
-#define CFG_NUM_STA_CHAN_COMBINED_CONC_MIN              (1)
-#define CFG_NUM_STA_CHAN_COMBINED_CONC_MAX              (255)
-#define CFG_NUM_STA_CHAN_COMBINED_CONC_DEFAULT          (3)
-
-#define CFG_NUM_P2P_CHAN_COMBINED_CONC_NAME             "gNumP2PChanCombinedConc"
-#define CFG_NUM_P2P_CHAN_COMBINED_CONC_MIN              (1)
-#define CFG_NUM_P2P_CHAN_COMBINED_CONC_MAX              (255)
-#define CFG_NUM_P2P_CHAN_COMBINED_CONC_DEFAULT          (1)
-#endif
-
-#define CFG_MAX_PS_POLL_NAME                   "gMaxPsPoll"
-#define CFG_MAX_PS_POLL_MIN                    WNI_CFG_MAX_PS_POLL_STAMIN
-#define CFG_MAX_PS_POLL_MAX                    WNI_CFG_MAX_PS_POLL_STAMAX
-#define CFG_MAX_PS_POLL_DEFAULT                WNI_CFG_MAX_PS_POLL_STADEF
-
-#define CFG_MAX_TX_POWER_NAME                   "gTxPowerCap"
-#define CFG_MAX_TX_POWER_MIN                    WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMIN
-#define CFG_MAX_TX_POWER_MAX                    WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX
-/* Not to use CFG default because if no registry setting, this is ignored by SME. */
-#define CFG_MAX_TX_POWER_DEFAULT                WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX
-
-#define CFG_LOW_GAIN_OVERRIDE_NAME             "gLowGainOverride"
-#define CFG_LOW_GAIN_OVERRIDE_MIN              WNI_CFG_LOW_GAIN_OVERRIDE_STAMIN
-#define CFG_LOW_GAIN_OVERRIDE_MAX              WNI_CFG_LOW_GAIN_OVERRIDE_STAMAX
-#define CFG_LOW_GAIN_OVERRIDE_DEFAULT          WNI_CFG_LOW_GAIN_OVERRIDE_STADEF
-
-#define CFG_RSSI_FILTER_PERIOD_NAME            "gRssiFilterPeriod"
-#define CFG_RSSI_FILTER_PERIOD_MIN             WNI_CFG_RSSI_FILTER_PERIOD_STAMIN
-#define CFG_RSSI_FILTER_PERIOD_MAX             WNI_CFG_RSSI_FILTER_PERIOD_STAMAX
-/* Increased this value for Non-ESE AP. This is cause FW RSSI Monitoring */
-/* the consumer of this value is ON by default. So to impact power numbers */
-/* we are setting this to a high value. */
-#define CFG_RSSI_FILTER_PERIOD_DEFAULT         WNI_CFG_RSSI_FILTER_PERIOD_STADEF
-
-#define CFG_IGNORE_DTIM_NAME                   "gIgnoreDtim"
-#define CFG_IGNORE_DTIM_MIN                    WNI_CFG_IGNORE_DTIM_STAMIN
-#define CFG_IGNORE_DTIM_MAX                    WNI_CFG_IGNORE_DTIM_STAMAX
-#define CFG_IGNORE_DTIM_DEFAULT                WNI_CFG_IGNORE_DTIM_STADEF
-
-#define CFG_MAX_LI_MODULATED_DTIM_NAME         "gMaxLIModulatedDTIM"
-#define CFG_MAX_LI_MODULATED_DTIM_MIN          (1)
-#define CFG_MAX_LI_MODULATED_DTIM_MAX          (10)
-#define CFG_MAX_LI_MODULATED_DTIM_DEFAULT      (10)
-
-#define CFG_RX_ANT_CONFIGURATION_NAME          "gNumRxAnt"
-#define CFG_RX_ANT_CONFIGURATION_NAME_MIN      (1)
-#define CFG_RX_ANT_CONFIGURATION_NAME_MAX      (2)
-#define CFG_RX_ANT_CONFIGURATION_NAME_DEFAULT  (2)
-
-#define CFG_FW_HEART_BEAT_MONITORING_NAME      "gEnableFWHeartBeatMonitoring"
-#define CFG_FW_HEART_BEAT_MONITORING_MIN       (0)
-#define CFG_FW_HEART_BEAT_MONITORING_MAX       (1)
-#define CFG_FW_HEART_BEAT_MONITORING_DEFAULT   (1)
-
-#define CFG_FW_BEACON_FILTERING_NAME           "gEnableFWBeaconFiltering"
-#define CFG_FW_BEACON_FILTERING_MIN            (0)
-#define CFG_FW_BEACON_FILTERING_MAX            (1)
-#define CFG_FW_BEACON_FILTERING_DEFAULT        (1)
-
-#define CFG_FW_RSSI_MONITORING_NAME            "gEnableFWRssiMonitoring"
-#define CFG_FW_RSSI_MONITORING_MIN             (0)
-#define CFG_FW_RSSI_MONITORING_MAX             (1)
-#define CFG_FW_RSSI_MONITORING_DEFAULT         (1)
-
-/* enable use of long duration RTS-CTS protection when SAP goes off channel
- * in MCC mode
- */
-#define CFG_FW_MCC_RTS_CTS_PROT_NAME           "gFWMccRtsCtsProtection"
-#define CFG_FW_MCC_RTS_CTS_PROT_MIN            (0)
-#define CFG_FW_MCC_RTS_CTS_PROT_MAX            (1)
-#define CFG_FW_MCC_RTS_CTS_PROT_DEFAULT        (0)
-
-/* Enable use of broadcast probe response to increase the detectability of
- * SAP in MCC mode
- */
-#define CFG_FW_MCC_BCAST_PROB_RESP_NAME        "gFWMccBCastProbeResponse"
-#define CFG_FW_MCC_BCAST_PROB_RESP_MIN         (0)
-#define CFG_FW_MCC_BCAST_PROB_RESP_MAX         (1)
-#define CFG_FW_MCC_BCAST_PROB_RESP_DEFAULT     (0)
-
-#define CFG_DATA_INACTIVITY_TIMEOUT_NAME       "gDataInactivityTimeout"
-#define CFG_DATA_INACTIVITY_TIMEOUT_MIN        (1)
-#define CFG_DATA_INACTIVITY_TIMEOUT_MAX        (255)
-#define CFG_DATA_INACTIVITY_TIMEOUT_DEFAULT    (20)
-
-#define CFG_RF_SETTLING_TIME_CLK_NAME          "rfSettlingTimeUs"
-#define CFG_RF_SETTLING_TIME_CLK_MIN           (0)
-#define CFG_RF_SETTLING_TIME_CLK_MAX           (60000)
-#define CFG_RF_SETTLING_TIME_CLK_DEFAULT       (1500)
-
-#define CFG_INFRA_STA_KEEP_ALIVE_PERIOD_NAME          "gStaKeepAlivePeriod"
-#define CFG_INFRA_STA_KEEP_ALIVE_PERIOD_MIN           (0)
-#define CFG_INFRA_STA_KEEP_ALIVE_PERIOD_MAX           (65535)
-#define CFG_INFRA_STA_KEEP_ALIVE_PERIOD_DEFAULT       (0)
-
-/* WMM configuration */
-#define CFG_QOS_WMM_MODE_NAME                             "WmmIsEnabled"
-#define CFG_QOS_WMM_MODE_MIN                               (0)
-#define CFG_QOS_WMM_MODE_MAX                               (2)  /* HDD_WMM_NO_QOS */
-#define CFG_QOS_WMM_MODE_DEFAULT                           (0)  /* HDD_WMM_AUTO */
-
-#define CFG_QOS_WMM_80211E_ENABLED_NAME                   "80211eIsEnabled"
-#define CFG_QOS_WMM_80211E_ENABLED_MIN                     (0)
-#define CFG_QOS_WMM_80211E_ENABLED_MAX                     (1)
-#define CFG_QOS_WMM_80211E_ENABLED_DEFAULT                 (0)
-
-#define CFG_QOS_WMM_UAPSD_MASK_NAME                        "UapsdMask"  /* ACs to setup U-APSD for at assoc */
-#define CFG_QOS_WMM_UAPSD_MASK_MIN                         (0x00)
-#define CFG_QOS_WMM_UAPSD_MASK_MAX                         (0xFF)
-#define CFG_QOS_WMM_UAPSD_MASK_DEFAULT                     (0x00)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_NAME           "InfraUapsdVoSrvIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_DEFAULT         (20)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_NAME           "InfraUapsdVoSuspIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_DEFAULT         (2000)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_NAME           "InfraUapsdViSrvIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_DEFAULT         (300)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_NAME           "InfraUapsdViSuspIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_DEFAULT         (2000)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_NAME           "InfraUapsdBeSrvIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_DEFAULT         (300)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_NAME           "InfraUapsdBeSuspIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_DEFAULT         (2000)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_NAME           "InfraUapsdBkSrvIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_DEFAULT         (300)
-
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_NAME           "InfraUapsdBkSuspIntv"
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_MIN             (0)
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_MAX             (4294967295UL)
-#define CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_DEFAULT         (2000)
-
-#ifdef FEATURE_WLAN_ESE
-#define CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_NAME         "InfraInactivityInterval"
-#define CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_MIN           (0)
-#define CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_MAX           (4294967295UL)
-#define CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_DEFAULT       (0) /* disabled */
-
-#define CFG_ESE_FEATURE_ENABLED_NAME                       "EseEnabled"
-#define CFG_ESE_FEATURE_ENABLED_MIN                         (0)
-#define CFG_ESE_FEATURE_ENABLED_MAX                         (1)
-#define CFG_ESE_FEATURE_ENABLED_DEFAULT                     (0) /* disabled */
-#endif /* FEATURE_WLAN_ESE */
-
-#define CFG_LFR_FEATURE_ENABLED_NAME                       "FastRoamEnabled"
-#define CFG_LFR_FEATURE_ENABLED_MIN                         (0)
-#define CFG_LFR_FEATURE_ENABLED_MAX                         (1)
-#define CFG_LFR_FEATURE_ENABLED_DEFAULT                     (0) /* disabled */
-
-#define CFG_LFR_MAWC_FEATURE_ENABLED_NAME                   "MAWCEnabled"
-#define CFG_LFR_MAWC_FEATURE_ENABLED_MIN                    (0)
-#define CFG_LFR_MAWC_FEATURE_ENABLED_MAX                    (1)
-#define CFG_LFR_MAWC_FEATURE_ENABLED_DEFAULT                (0) /* disabled */
-
-/* This flag will control fasttransition in case of 11r and ese. */
-/* Basically with this the whole neighbor roam, pre-auth, reassoc */
-/* can be turned ON/OFF. */
-/* With this turned OFF 11r will completely not work. */
-/* For 11r this flag has to be ON. */
-/* For ESE fastroam will not work. */
-#define CFG_FAST_TRANSITION_ENABLED_NAME                    "FastTransitionEnabled"
-#define CFG_FAST_TRANSITION_ENABLED_NAME_MIN                (0)
-#define CFG_FAST_TRANSITION_ENABLED_NAME_MAX                (1)
-#define CFG_FAST_TRANSITION_ENABLED_NAME_DEFAULT            (1) /* Enabled */
-
-/* This parameter is used to decide whether to Roam or not.
- * AP1 is the currently associated AP and AP2 is chosen for roaming.
- * The Roaming will happen only if AP2 has better Signal Quality and it has a RSSI better than AP1
- * in terms of RoamRssiDiff,and RoamRssiDiff is the number of units (typically measured in dB) AP2
- * is better than AP1.
- * This check is not done if the value is Zero */
-#define CFG_ROAM_RSSI_DIFF_NAME                             "RoamRssiDiff"
-#define CFG_ROAM_RSSI_DIFF_MIN                              (0)
-#define CFG_ROAM_RSSI_DIFF_MAX                              (30)
-#define CFG_ROAM_RSSI_DIFF_DEFAULT                          (5)
-
-/*This parameter is used to set Wireless Extended Security Mode.*/
-#define CFG_ENABLE_WES_MODE_NAME                            "gWESModeEnabled"
-#define CFG_ENABLE_WES_MODE_NAME_MIN                        (0)
-#define CFG_ENABLE_WES_MODE_NAME_MAX                        (1)
-#define CFG_ENABLE_WES_MODE_NAME_DEFAULT                    (0)
-
-#define CFG_ROAM_SCAN_N_PROBES                             "gRoamScanNProbes"
-#define CFG_ROAM_SCAN_N_PROBES_MIN                          (1)
-#define CFG_ROAM_SCAN_N_PROBES_MAX                          (10)
-#define CFG_ROAM_SCAN_N_PROBES_DEFAULT                      (2)
-
-#define CFG_ROAM_SCAN_HOME_AWAY_TIME                        "gRoamScanHomeAwayTime"
-#define CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN                    (0) /* 0 for disable */
-#define CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX                    (300)
-#define CFG_ROAM_SCAN_HOME_AWAY_TIME_DEFAULT                (CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN)
-/* disabled by default */
-
-#ifdef FEATURE_WLAN_OKC
-#define CFG_OKC_FEATURE_ENABLED_NAME                       "OkcEnabled"
-#define CFG_OKC_FEATURE_ENABLED_MIN                        (0)
-#define CFG_OKC_FEATURE_ENABLED_MAX                        (1)
-#define CFG_OKC_FEATURE_ENABLED_DEFAULT                    (1)
-#endif
-
-#define CFG_ROAM_SCAN_OFFLOAD_ENABLED                       "gRoamScanOffloadEnabled"
-#define CFG_ROAM_SCAN_OFFLOAD_ENABLED_MIN                   (0)
-#define CFG_ROAM_SCAN_OFFLOAD_ENABLED_MAX                   (1)
-#define CFG_ROAM_SCAN_OFFLOAD_ENABLED_DEFAULT               (1)
-
-/* default TSPEC parameters for AC_VO */
-#define CFG_QOS_WMM_INFRA_DIR_AC_VO_NAME                   "InfraDirAcVo"
-#define CFG_QOS_WMM_INFRA_DIR_AC_VO_MIN                     (0)
-#define CFG_QOS_WMM_INFRA_DIR_AC_VO_MAX                     (3)
-#define CFG_QOS_WMM_INFRA_DIR_AC_VO_DEFAULT                 (3) /* WLAN_QCT_CUST_WMM_TSDIR_BOTH */
-
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_NAME         "InfraNomMsduSizeAcVo"
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_MIN           (0x0)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_MAX           (0xFFFF)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_DEFAULT       (0x80D0)
-
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_NAME        "InfraMeanDataRateAcVo"
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_MIN          (0x0)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_MAX          (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_DEFAULT      (0x14500)
-
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_NAME          "InfraMinPhyRateAcVo"
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_MIN            (0x0)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_MAX            (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_DEFAULT        (0x5B8D80)
-
-#define CFG_QOS_WMM_INFRA_SBA_AC_VO_NAME                   "InfraSbaAcVo"
-#define CFG_QOS_WMM_INFRA_SBA_AC_VO_MIN                     (0x2001)
-#define CFG_QOS_WMM_INFRA_SBA_AC_VO_MAX                     (0xFFFF)
-#define CFG_QOS_WMM_INFRA_SBA_AC_VO_DEFAULT                 (0x2001)
-
-/* default TSPEC parameters for AC_VI */
-#define CFG_QOS_WMM_INFRA_DIR_AC_VI_NAME                   "InfraDirAcVi"
-#define CFG_QOS_WMM_INFRA_DIR_AC_VI_MIN                     (0)
-#define CFG_QOS_WMM_INFRA_DIR_AC_VI_MAX                     (3)
-#define CFG_QOS_WMM_INFRA_DIR_AC_VI_DEFAULT                 (3) /* WLAN_QCT_CUST_WMM_TSDIR_BOTH */
-
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_NAME         "InfraNomMsduSizeAcVi"
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_MIN           (0x0)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_MAX           (0xFFFF)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_DEFAULT       (0x85DC)
-
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_NAME        "InfraMeanDataRateAcVi"
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_MIN          (0x0)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_MAX          (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_DEFAULT      (0x57E40)
-
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_NAME          "InfraMinPhyRateAcVi"
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_MIN            (0x0)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_MAX            (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_DEFAULT        (0x5B8D80)
-
-#define CFG_QOS_WMM_INFRA_SBA_AC_VI_NAME                   "InfraSbaAcVi"
-#define CFG_QOS_WMM_INFRA_SBA_AC_VI_MIN                     (0x2001)
-#define CFG_QOS_WMM_INFRA_SBA_AC_VI_MAX                     (0xFFFF)
-#define CFG_QOS_WMM_INFRA_SBA_AC_VI_DEFAULT                 (0x2001)
-
-/* default TSPEC parameters for AC_BE*/
-#define CFG_QOS_WMM_INFRA_DIR_AC_BE_NAME                   "InfraDirAcBe"
-#define CFG_QOS_WMM_INFRA_DIR_AC_BE_MIN                     (0)
-#define CFG_QOS_WMM_INFRA_DIR_AC_BE_MAX                     (3)
-#define CFG_QOS_WMM_INFRA_DIR_AC_BE_DEFAULT                 (3) /* WLAN_QCT_CUST_WMM_TSDIR_BOTH */
-
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_NAME         "InfraNomMsduSizeAcBe"
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_MIN           (0x0)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_MAX           (0xFFFF)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_DEFAULT       (0x85DC)
-
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_NAME        "InfraMeanDataRateAcBe"
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_MIN          (0x0)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_MAX          (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_DEFAULT      (0x493E0)
-
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_NAME          "InfraMinPhyRateAcBe"
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_MIN            (0x0)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_MAX            (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_DEFAULT        (0x5B8D80)
-
-#define CFG_QOS_WMM_INFRA_SBA_AC_BE_NAME                   "InfraSbaAcBe"
-#define CFG_QOS_WMM_INFRA_SBA_AC_BE_MIN                     (0x2001)
-#define CFG_QOS_WMM_INFRA_SBA_AC_BE_MAX                     (0xFFFF)
-#define CFG_QOS_WMM_INFRA_SBA_AC_BE_DEFAULT                 (0x2001)
-
-/* default TSPEC parameters for AC_Bk*/
-#define CFG_QOS_WMM_INFRA_DIR_AC_BK_NAME                   "InfraDirAcBk"
-#define CFG_QOS_WMM_INFRA_DIR_AC_BK_MIN                     (0)
-#define CFG_QOS_WMM_INFRA_DIR_AC_BK_MAX                     (3)
-#define CFG_QOS_WMM_INFRA_DIR_AC_BK_DEFAULT                 (3) /* WLAN_QCT_CUST_WMM_TSDIR_BOTH */
-
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_NAME         "InfraNomMsduSizeAcBk"
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_MIN           (0x0)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_MAX           (0xFFFF)
-#define CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_DEFAULT       (0x85DC)
-
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_NAME        "InfraMeanDataRateAcBk"
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_MIN          (0x0)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_MAX          (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_DEFAULT      (0x493E0)
-
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_NAME          "InfraMinPhyRateAcBk"
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_MIN            (0x0)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_MAX            (0xFFFFFFFF)
-#define CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_DEFAULT        (0x5B8D80)
-
-#define CFG_QOS_WMM_INFRA_SBA_AC_BK_NAME                   "InfraSbaAcBk"
-#define CFG_QOS_WMM_INFRA_SBA_AC_BK_MIN                     (0x2001)
-#define CFG_QOS_WMM_INFRA_SBA_AC_BK_MAX                     (0xFFFF)
-#define CFG_QOS_WMM_INFRA_SBA_AC_BK_DEFAULT                 (0x2001)
-
-#define CFG_TL_DELAYED_TRGR_FRM_INT_NAME                   "DelayedTriggerFrmInt"
-#define CFG_TL_DELAYED_TRGR_FRM_INT_MIN                     1
-#define CFG_TL_DELAYED_TRGR_FRM_INT_MAX                     (4294967295UL)
-#define CFG_TL_DELAYED_TRGR_FRM_INT_DEFAULT                 3000
-
-#if defined WLAN_FEATURE_VOWIFI
-#define CFG_RRM_ENABLE_NAME                              "gRrmEnable"
-#define CFG_RRM_ENABLE_MIN                               (0)
-#define CFG_RRM_ENABLE_MAX                               (1)
-#define CFG_RRM_ENABLE_DEFAULT                           (0)
-
-#define CFG_RRM_OPERATING_CHAN_MAX_DURATION_NAME         "gRrmOperChanMax"      /* section 11.10.3 IEEE std. 802.11k-2008 */
-#define CFG_RRM_OPERATING_CHAN_MAX_DURATION_MIN          (0)    /* Maxduration = 2^(maxDuration - 4) * bcnIntvl. */
-#define CFG_RRM_OPERATING_CHAN_MAX_DURATION_MAX          (8)
-#define CFG_RRM_OPERATING_CHAN_MAX_DURATION_DEFAULT      (3)    /* max duration = 2^-1 * bcnIntvl (50% of bcn intvl) */
-
-#define CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_NAME     "gRrmNonOperChanMax"   /* Same as above. */
-#define CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_MIN      (0)
-#define CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_MAX      (8)
-#define CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_DEFAULT  (3)
-
-#define CFG_RRM_MEAS_RANDOMIZATION_INTVL_NAME            "gRrmRandnIntvl"
-#define CFG_RRM_MEAS_RANDOMIZATION_INTVL_MIN             (10)
-#define CFG_RRM_MEAS_RANDOMIZATION_INTVL_MAX             (100)
-#define CFG_RRM_MEAS_RANDOMIZATION_INTVL_DEFAULT         (100)
-
-/**
- * This INI is used to configure RM enabled capabilities IE.
- * Using this INI, we can set/unset any of the bits in 5 bytes
- * (last 4bytes are reserved). Bit details are updated as per
- * Draft version of 11mc spec. (Draft P802.11REVmc_D4.2)
- *
- * Bitwise details are defined as bit mask in rrmGlobal.h
- * Comma is used as a separator for each byte.
- */
-#define CFG_RM_CAPABILITY_NAME            "rm_capability"
-#define CFG_RM_CAPABILITY_DEFAULT         "73,00,6D,00,04"
-#endif
-
-#define CFG_QOS_IMPLICIT_SETUP_ENABLED_NAME                 "ImplicitQosIsEnabled"
-#define CFG_QOS_IMPLICIT_SETUP_ENABLED_MIN                  (0)
-#define CFG_QOS_IMPLICIT_SETUP_ENABLED_MAX                  (1)
-#define CFG_QOS_IMPLICIT_SETUP_ENABLED_DEFAULT              (1)
-
-#if defined WLAN_FEATURE_VOWIFI_11R
-#define CFG_FT_RESOURCE_REQ_NAME                        "gFTResourceReqSupported"
-#define CFG_FT_RESOURCE_REQ_MIN                         (0)
-#define CFG_FT_RESOURCE_REQ_MAX                         (1)
-#define CFG_FT_RESOURCE_REQ_DEFAULT                     (0)
-#endif
-
-#define CFG_TELE_BCN_TRANS_LI_NAME                   "telescopicBeaconTransListenInterval"
-#define CFG_TELE_BCN_TRANS_LI_MIN                    (0)
-#define CFG_TELE_BCN_TRANS_LI_MAX                    (7)
-#define CFG_TELE_BCN_TRANS_LI_DEFAULT                (3)
-
-#define CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_NAME     "telescopicBeaconTransListenIntervalNumIdleBcns"
-#define CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_MIN      (5)
-#define CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_MAX      (255)
-#define CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_DEFAULT  (10)
-
-#define CFG_TELE_BCN_MAX_LI_NAME                     "telescopicBeaconMaxListenInterval"
-#define CFG_TELE_BCN_MAX_LI_MIN                      (0)
-#define CFG_TELE_BCN_MAX_LI_MAX                      (7)
-#define CFG_TELE_BCN_MAX_LI_DEFAULT                  (5)
-
-#define CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_NAME       "telescopicBeaconMaxListenIntervalNumIdleBcns"
-#define CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_MIN        (5)
-#define CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_MAX        (255)
-#define CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_DEFAULT    (15)
-
-#define CFG_BCN_EARLY_TERM_WAKE_NAME                 "beaconEarlyTerminationWakeInterval"
-#define CFG_BCN_EARLY_TERM_WAKE_MIN                  (2)
-#define CFG_BCN_EARLY_TERM_WAKE_MAX                  (255)
-#define CFG_BCN_EARLY_TERM_WAKE_DEFAULT              (3)
-
-#define CFG_NEIGHBOR_SCAN_TIMER_PERIOD_NAME             "gNeighborScanTimerPeriod"
-#define CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN              (3)
-#define CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX              (300)
-#define CFG_NEIGHBOR_SCAN_TIMER_PERIOD_DEFAULT          (200)
-
-#define CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_NAME      "gNeighborLookupThreshold"
-#define CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN       (10)
-#define CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX       (120)
-#define CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_DEFAULT   (78)
-
-#define CFG_DELAY_BEFORE_VDEV_STOP_NAME              "gDelayBeforeVdevStop"
-#define CFG_DELAY_BEFORE_VDEV_STOP_MIN               (2)
-#define CFG_DELAY_BEFORE_VDEV_STOP_MAX               (200)
-#define CFG_DELAY_BEFORE_VDEV_STOP_DEFAULT           (20)
-
-/*
- * This parameter is the drop in RSSI value that will trigger a precautionary
- * scan by firmware.
- * MAX value is choose so that this type of scan can be disabled by user.
- */
-#define CFG_ROAM_RESCAN_RSSI_DIFF_NAME                  "gRoamRescanRssiDiff"
-#define CFG_ROAM_RESCAN_RSSI_DIFF_MIN                   (0)
-#define CFG_ROAM_RESCAN_RSSI_DIFF_MAX                   (100)
-#define CFG_ROAM_RESCAN_RSSI_DIFF_DEFAULT               (5)
-
-/*
- * This parameter is the RSSI diff above neighbor lookup threshold, when
- * opportunistic scan should be triggered.
- * MAX value is choose so that this type of scan can be always enabled by user.
- * MIN value will cause opportunistic scan to be triggered in neighbor lookup
- * RSSI range.
- */
-#define CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_NAME            "gOpportunisticThresholdDiff"
-#define CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_MIN             (0)
-#define CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_MAX             (127)
-#define CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_DEFAULT         (0)
-
-#define CFG_NEIGHBOR_SCAN_CHAN_LIST_NAME                      "gNeighborScanChannelList"
-#define CFG_NEIGHBOR_SCAN_CHAN_LIST_DEFAULT                   ""
-
-#define CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_NAME                  "gNeighborScanChannelMinTime"
-#define CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN                   (10)
-#define CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX                   (40)
-#define CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_DEFAULT               (20)
-
-#define CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_NAME                  "gNeighborScanChannelMaxTime"
-#define CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN                   (3)
-#define CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX                   (300)
-#define CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_DEFAULT               (30)
-
-#define CFG_11R_NEIGHBOR_REQ_MAX_TRIES_NAME           "gMaxNeighborReqTries"
-#define CFG_11R_NEIGHBOR_REQ_MAX_TRIES_MIN            (1)
-#define CFG_11R_NEIGHBOR_REQ_MAX_TRIES_MAX            (4)
-#define CFG_11R_NEIGHBOR_REQ_MAX_TRIES_DEFAULT        (3)
-
-#define CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_NAME         "gNeighborScanRefreshPeriod"
-#define CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN          (1000)
-#define CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX          (60000)
-#define CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_DEFAULT      (20000)
-
-#define CFG_EMPTY_SCAN_REFRESH_PERIOD_NAME         "gEmptyScanRefreshPeriod"
-#define CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN          (0)
-#define CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX          (60000)
-#define CFG_EMPTY_SCAN_REFRESH_PERIOD_DEFAULT      (0)
-
-#define CFG_ROAM_BMISS_FIRST_BCNT_NAME                  "gRoamBmissFirstBcnt"
-#define CFG_ROAM_BMISS_FIRST_BCNT_MIN                   (5)
-#define CFG_ROAM_BMISS_FIRST_BCNT_MAX                   (100)
-#define CFG_ROAM_BMISS_FIRST_BCNT_DEFAULT               (10)
-
-#define CFG_ROAM_BMISS_FINAL_BCNT_NAME                  "gRoamBmissFinalBcnt"
-#define CFG_ROAM_BMISS_FINAL_BCNT_MIN                   (5)
-#define CFG_ROAM_BMISS_FINAL_BCNT_MAX                   (100)
-#define CFG_ROAM_BMISS_FINAL_BCNT_DEFAULT               (10)
-
-#define CFG_ROAM_BEACON_RSSI_WEIGHT_NAME                "gRoamBeaconRssiWeight"
-#define CFG_ROAM_BEACON_RSSI_WEIGHT_MIN                 (0)
-#define CFG_ROAM_BEACON_RSSI_WEIGHT_MAX                 (16)
-#define CFG_ROAM_BEACON_RSSI_WEIGHT_DEFAULT             (14)
-
-#define CFG_QOS_WMM_BURST_SIZE_DEFN_NAME                        "burstSizeDefinition"
-#define CFG_QOS_WMM_BURST_SIZE_DEFN_MIN                         (0)
-#define CFG_QOS_WMM_BURST_SIZE_DEFN_MAX                         (1)
-#define CFG_QOS_WMM_BURST_SIZE_DEFN_DEFAULT                     (0)
-
-#define CFG_QOS_WMM_TS_INFO_ACK_POLICY_NAME                        "tsInfoAckPolicy"
-#define CFG_QOS_WMM_TS_INFO_ACK_POLICY_MIN                         (0x00)
-#define CFG_QOS_WMM_TS_INFO_ACK_POLICY_MAX                         (0x01)
-#define CFG_QOS_WMM_TS_INFO_ACK_POLICY_DEFAULT                     (0x00)
-
-#define CFG_SINGLE_TID_RC_NAME                             "SingleTIDRC"
-#define CFG_SINGLE_TID_RC_MIN                               (0) /* Seperate replay counter for all TID */
-#define CFG_SINGLE_TID_RC_MAX                               (1) /* Single replay counter for all TID */
-#define CFG_SINGLE_TID_RC_DEFAULT                           (1)
-#define CFG_MCAST_BCAST_FILTER_SETTING_NAME          "McastBcastFilter"
-#define CFG_MCAST_BCAST_FILTER_SETTING_MIN           (0)
-#define CFG_MCAST_BCAST_FILTER_SETTING_MAX           (3)
-#define CFG_MCAST_BCAST_FILTER_SETTING_DEFAULT       (0)
-
-#define CFG_DYNAMIC_PSPOLL_VALUE_NAME          "gDynamicPSPollvalue"
-#define CFG_DYNAMIC_PSPOLL_VALUE_MIN           (0)
-#define CFG_DYNAMIC_PSPOLL_VALUE_MAX           (255)
-#define CFG_DYNAMIC_PSPOLL_VALUE_DEFAULT       (0)
-
-#define CFG_TELE_BCN_WAKEUP_EN_NAME            "gTelescopicBeaconWakeupEn"
-#define CFG_TELE_BCN_WAKEUP_EN_MIN             (0)
-#define CFG_TELE_BCN_WAKEUP_EN_MAX             (1)
-#define CFG_TELE_BCN_WAKEUP_EN_DEFAULT         (0)
-
-#define CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_NAME                 "gAddTSWhenACMIsOff"
-#define CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_MIN                  (0)
-#define CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_MAX                  (1)  /* Send AddTs even when ACM is not set for the AC */
-#define CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_DEFAULT              (0)
-
-#define CFG_VALIDATE_SCAN_LIST_NAME                 "gValidateScanList"
-#define CFG_VALIDATE_SCAN_LIST_MIN                  (0)
-#define CFG_VALIDATE_SCAN_LIST_MAX                  (1)
-#define CFG_VALIDATE_SCAN_LIST_DEFAULT              (0)
-
-#define CFG_NULLDATA_AP_RESP_TIMEOUT_NAME       "gNullDataApRespTimeout"
-#define CFG_NULLDATA_AP_RESP_TIMEOUT_MIN        (WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STAMIN)
-#define CFG_NULLDATA_AP_RESP_TIMEOUT_MAX        (WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STAMAX)
-#define CFG_NULLDATA_AP_RESP_TIMEOUT_DEFAULT    (WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT_STADEF)
-
-#define CFG_AP_DATA_AVAIL_POLL_PERIOD_NAME      "gApDataAvailPollInterval"
-#define CFG_AP_DATA_AVAIL_POLL_PERIOD_MIN       (WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STAMIN)
-#define CFG_AP_DATA_AVAIL_POLL_PERIOD_MAX       (WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STAMAX)
-#define CFG_AP_DATA_AVAIL_POLL_PERIOD_DEFAULT   (WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD_STADEF)
-
-#define CFG_ENABLE_HOST_ARPOFFLOAD_NAME         "hostArpOffload"
-#define CFG_ENABLE_HOST_ARPOFFLOAD_MIN          (0)
-#define CFG_ENABLE_HOST_ARPOFFLOAD_MAX          (1)
-#define CFG_ENABLE_HOST_ARPOFFLOAD_DEFAULT      (0)
-
-#define CFG_ENABLE_HOST_SSDP_NAME              "ssdp"
-#define CFG_ENABLE_HOST_SSDP_MIN               (0)
-#define CFG_ENABLE_HOST_SSDP_MAX               (1)
-#define CFG_ENABLE_HOST_SSDP_DEFAULT           (1)
-
-#define CFG_ENABLE_HOST_NSOFFLOAD_NAME         "hostNSOffload"
-#define CFG_ENABLE_HOST_NSOFFLOAD_MIN          (0)
-#define CFG_ENABLE_HOST_NSOFFLOAD_MAX          (1)
-#define CFG_ENABLE_HOST_NSOFFLOAD_DEFAULT      (0)
-
-#define CFG_BAND_CAPABILITY_NAME          "BandCapability"
-#define CFG_BAND_CAPABILITY_MIN           (0)
-#define CFG_BAND_CAPABILITY_MAX           (2)
-#define CFG_BAND_CAPABILITY_DEFAULT       (0)
-
-#define CFG_ENABLE_BEACON_EARLY_TERMINATION_NAME          "enableBeaconEarlyTermination"
-#define CFG_ENABLE_BEACON_EARLY_TERMINATION_MIN           (0)
-#define CFG_ENABLE_BEACON_EARLY_TERMINATION_MAX           (1)
-#define CFG_ENABLE_BEACON_EARLY_TERMINATION_DEFAULT       (0)
-
-#define CFG_ENABLE_CLOSE_LOOP_NAME                 "gEnableCloseLoop"
-#define CFG_ENABLE_CLOSE_LOOP_MIN                  WNI_CFG_FIXED_RATE_STAMIN
-#define CFG_ENABLE_CLOSE_LOOP_MAX                  WNI_CFG_FIXED_RATE_STAMAX
-#define CFG_ENABLE_CLOSE_LOOP_DEFAULT              WNI_CFG_FIXED_RATE_STADEF
-
-#define CFG_ENABLE_BYPASS_11D_NAME                 "gEnableBypass11d"
-#define CFG_ENABLE_BYPASS_11D_MIN                  (0)
-#define CFG_ENABLE_BYPASS_11D_MAX                  (1)
-#define CFG_ENABLE_BYPASS_11D_DEFAULT              (1)
-
-#define CFG_ENABLE_DFS_CHNL_SCAN_NAME              "gEnableDFSChnlScan"
-#define CFG_ENABLE_DFS_CHNL_SCAN_MIN               (0)
-#define CFG_ENABLE_DFS_CHNL_SCAN_MAX               (1)
-#define CFG_ENABLE_DFS_CHNL_SCAN_DEFAULT           (1)
-
-#define CFG_ENABLE_DFS_PNO_CHNL_SCAN_NAME              "gEnableDFSPnoChnlScan"
-#define CFG_ENABLE_DFS_PNO_CHNL_SCAN_MIN               (0)
-#define CFG_ENABLE_DFS_PNO_CHNL_SCAN_MAX               (1)
-#define CFG_ENABLE_DFS_PNO_CHNL_SCAN_DEFAULT           (1)
-
-#define CFG_ENABLE_RAMDUMP_COLLECTION              "gEnableDumpCollect"
-#define CFG_ENABLE_RAMDUMP_COLLECTION_MIN          (0)
-#define CFG_ENABLE_RAMDUMP_COLLECTION_MAX          (1)
-#define CFG_ENABLE_RAMDUMP_COLLECTION_DEFAULT      (1)
-
-typedef enum {
-	eHDD_LINK_SPEED_REPORT_ACTUAL = 0,
-	eHDD_LINK_SPEED_REPORT_MAX = 1,
-	eHDD_LINK_SPEED_REPORT_MAX_SCALED = 2,
-} eHddLinkSpeedReportType;
-#ifdef WLAN_FEATURE_11AC
-#define CFG_VHT_CHANNEL_WIDTH                "gVhtChannelWidth"
-#define CFG_VHT_CHANNEL_WIDTH_MIN            (0)
-#define CFG_VHT_CHANNEL_WIDTH_MAX            (4)
-#define CFG_VHT_CHANNEL_WIDTH_DEFAULT        (3)
-
-#define CFG_VHT_ENABLE_RX_MCS_8_9               "gVhtRxMCS"
-#define CFG_VHT_ENABLE_RX_MCS_8_9_MIN           (0)
-#define CFG_VHT_ENABLE_RX_MCS_8_9_MAX           (2)
-#define CFG_VHT_ENABLE_RX_MCS_8_9_DEFAULT       (0)
-
-#define CFG_VHT_ENABLE_TX_MCS_8_9               "gVhtTxMCS"
-#define CFG_VHT_ENABLE_TX_MCS_8_9_MIN           (0)
-#define CFG_VHT_ENABLE_TX_MCS_8_9_MAX           (2)
-#define CFG_VHT_ENABLE_TX_MCS_8_9_DEFAULT       (0)
-
-#define CFG_VHT_ENABLE_RX_MCS2x2_8_9               "gVhtRxMCS2x2"
-#define CFG_VHT_ENABLE_RX_MCS2x2_8_9_MIN           (0)
-#define CFG_VHT_ENABLE_RX_MCS2x2_8_9_MAX           (2)
-#define CFG_VHT_ENABLE_RX_MCS2x2_8_9_DEFAULT       (0)
-
-#define CFG_VHT_ENABLE_TX_MCS2x2_8_9               "gVhtTxMCS2x2"
-#define CFG_VHT_ENABLE_TX_MCS2x2_8_9_MIN           (0)
-#define CFG_VHT_ENABLE_TX_MCS2x2_8_9_MAX           (2)
-#define CFG_VHT_ENABLE_TX_MCS2x2_8_9_DEFAULT       (0)
-
-#define CFG_VHT_ENABLE_2x2_CAP_FEATURE         "gEnable2x2"
-#define CFG_VHT_ENABLE_2x2_CAP_FEATURE_MIN     (0)
-#define CFG_VHT_ENABLE_2x2_CAP_FEATURE_MAX     (1)
-#define CFG_VHT_ENABLE_2x2_CAP_FEATURE_DEFAULT (0)
-
-#define CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE         "gEnableMuBformee"
-#define CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE_MIN     (0)
-#define CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE_MAX     (1)
-#define CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE_DEFAULT (0)
-
-#define CFG_VHT_ENABLE_PAID_FEATURE             "gEnablePAID"
-#define CFG_VHT_ENABLE_PAID_FEATURE_MIN         (0)
-#define CFG_VHT_ENABLE_PAID_FEATURE_MAX         (1)
-#define CFG_VHT_ENABLE_PAID_FEATURE_DEFAULT     (0)
-
-#define CFG_VHT_ENABLE_GID_FEATURE              "gEnableGID"
-#define CFG_VHT_ENABLE_GID_FEATURE_MIN          (0)
-#define CFG_VHT_ENABLE_GID_FEATURE_MAX          (1)
-#define CFG_VHT_ENABLE_GID_FEATURE_DEFAULT      (0)
-#endif
-
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK         "gSetTxChainmask1x1"
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MIN     (1)
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MAX     (2)
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK_DEFAULT (1)
-
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK         "gSetRxChainmask1x1"
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MIN     (1)
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MAX     (2)
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK_DEFAULT (1)
-
-#define CFG_ENABLE_AMPDUPS_FEATURE              "gEnableAMPDUPS"
-#define CFG_ENABLE_AMPDUPS_FEATURE_MIN          (0)
-#define CFG_ENABLE_AMPDUPS_FEATURE_MAX          (1)
-#define CFG_ENABLE_AMPDUPS_FEATURE_DEFAULT      (0)
-
-#define CFG_HT_ENABLE_SMPS_CAP_FEATURE          "gEnableHtSMPS"
-#define CFG_HT_ENABLE_SMPS_CAP_FEATURE_MIN      (0)
-#define CFG_HT_ENABLE_SMPS_CAP_FEATURE_MAX      (1)
-#define CFG_HT_ENABLE_SMPS_CAP_FEATURE_DEFAULT  (0)
-
-#define CFG_HT_SMPS_CAP_FEATURE                 "gHtSMPS"
-#define CFG_HT_SMPS_CAP_FEATURE_MIN             (0)
-#define CFG_HT_SMPS_CAP_FEATURE_MAX             (3)
-#define CFG_HT_SMPS_CAP_FEATURE_DEFAULT         (3)
-
-#define CFG_DISABLE_DFS_CH_SWITCH                 "gDisableDFSChSwitch"
-#define CFG_DISABLE_DFS_CH_SWITCH_MIN             (0)
-#define CFG_DISABLE_DFS_CH_SWITCH_MAX             (1)
-#define CFG_DISABLE_DFS_CH_SWITCH_DEFAULT         (0)
-
-#define CFG_ENABLE_DFS_MASTER_CAPABILITY               "gEnableDFSMasterCap"
-#define CFG_ENABLE_DFS_MASTER_CAPABILITY_MIN           (0)
-#define CFG_ENABLE_DFS_MASTER_CAPABILITY_MAX           (1)
-#define CFG_ENABLE_DFS_MASTER_CAPABILITY_DEFAULT       (0)
-
-#define CFG_SAP_PREFERRED_CHANNEL_LOCATION          "gSapPreferredChanLocation"
-#define CFG_SAP_PREFERRED_CHANNEL_LOCATION_MIN      (0)
-#define CFG_SAP_PREFERRED_CHANNEL_LOCATION_MAX      (2)
-#define CFG_SAP_PREFERRED_CHANNEL_LOCATION_DEFAULT  (0)
-
-#define CFG_DISABLE_DFS_JAPAN_W53                      "gDisableDfsJapanW53"
-#define CFG_DISABLE_DFS_JAPAN_W53_MIN                  (0)
-#define CFG_DISABLE_DFS_JAPAN_W53_MAX                  (1)
-#define CFG_DISABLE_DFS_JAPAN_W53_DEFAULT              (0)
-
-#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_NAME       "dfsPhyerrFilterOffload"
-#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MIN        (0)
-#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MAX        (1)
-#define CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_DEFAULT    (0)
-
-#define CFG_REPORT_MAX_LINK_SPEED                  "gReportMaxLinkSpeed"
-#define CFG_REPORT_MAX_LINK_SPEED_MIN              (eHDD_LINK_SPEED_REPORT_ACTUAL)
-#define CFG_REPORT_MAX_LINK_SPEED_MAX              (eHDD_LINK_SPEED_REPORT_MAX_SCALED)
-#define CFG_REPORT_MAX_LINK_SPEED_DEFAULT          (eHDD_LINK_SPEED_REPORT_MAX_SCALED)
-
-/*
- * RSSI Thresholds
- * Used when eHDD_LINK_SPEED_REPORT_SCALED is selected
- */
-#define CFG_LINK_SPEED_RSSI_HIGH                   "gLinkSpeedRssiHigh"
-#define CFG_LINK_SPEED_RSSI_HIGH_MIN               (-127)
-#define CFG_LINK_SPEED_RSSI_HIGH_MAX               (0)
-#define CFG_LINK_SPEED_RSSI_HIGH_DEFAULT           (-55)
-
-#define CFG_LINK_SPEED_RSSI_MID                    "gLinkSpeedRssiMed"
-#define CFG_LINK_SPEED_RSSI_MID_MIN                (-127)
-#define CFG_LINK_SPEED_RSSI_MID_MAX                (0)
-#define CFG_LINK_SPEED_RSSI_MID_DEFAULT            (-65)
-
-#define CFG_LINK_SPEED_RSSI_LOW                    "gLinkSpeedRssiLow"
-#define CFG_LINK_SPEED_RSSI_LOW_MIN                (-127)
-#define CFG_LINK_SPEED_RSSI_LOW_MAX                (0)
-#define CFG_LINK_SPEED_RSSI_LOW_DEFAULT            (-80)
-
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_NAME                "isP2pDeviceAddrAdministrated"
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MIN                 (0)
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MAX                 (1)
-#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_DEFAULT             (1)
-
-#define CFG_ENABLE_SSR                      "gEnableSSR"
-#define CFG_ENABLE_SSR_MIN                  (0)
-#define CFG_ENABLE_SSR_MAX                  (1)
-#define CFG_ENABLE_SSR_DEFAULT              (1)
-
-#define CFG_ENABLE_OVERLAP_CH               "gEnableOverLapCh"
-#define CFG_ENABLE_OVERLAP_CH_MIN           (0)
-#define CFG_ENABLE_OVERLAP_CH_MAX           (1)
-#define CFG_ENABLE_OVERLAP_CH_DEFAULT       (0)
-
-#define CFG_PPS_ENABLE_5G_EBT                 "gEnable5gEBT"
-#define CFG_PPS_ENABLE_5G_EBT_FEATURE_MIN     (0)
-#define CFG_PPS_ENABLE_5G_EBT_FEATURE_MAX     (1)
-#define CFG_PPS_ENABLE_5G_EBT_FEATURE_DEFAULT (0)
-
-#define CFG_ENABLE_MEMORY_DEEP_SLEEP          "gEnableMemDeepSleep"
-#define CFG_ENABLE_MEMORY_DEEP_SLEEP_MIN      (0)
-#define CFG_ENABLE_MEMORY_DEEP_SLEEP_MAX      (1)
-#define CFG_ENABLE_MEMORY_DEEP_SLEEP_DEFAULT  (1)
-
-/* In cfg.dat 1=1MBPS, 2=2MBPS, 3=5_5MBPS, 4=11MBPS, 5=6MBPS, 6=9MBPS,
- * 7=12MBPS, 8=18MBPS, 9=24MBPS. But 6=9MBPS and 8=18MBPS are not basic
- * 11g rates and should not be set by gDefaultRateIndex24Ghz.
- */
-
-#define CFG_DEFAULT_RATE_INDEX_24GH               "gDefaultRateIndex24Ghz"
-#define CFG_DEFAULT_RATE_INDEX_24GH_MIN           (1)
-#define CFG_DEFAULT_RATE_INDEX_24GH_MAX           (9)
-#define CFG_DEFAULT_RATE_INDEX_24GH_DEFAULT       (1)
-
-#define CFG_ENABLE_PACKET_LOG            "gEnablePacketLog"
-#define CFG_ENABLE_PACKET_LOG_MIN        (0)
-#define CFG_ENABLE_PACKET_LOG_MAX        (1)
-#define CFG_ENABLE_PACKET_LOG_DEFAULT    (1)
-
-/* gFwDebugLogType takes values from enum dbglog_process_t,
- * make default value as DBGLOG_PROCESS_NET_RAW to give the
- * logs to net link since cnss_diag service is started at boot
- * time by default.
- */
-#define CFG_ENABLE_FW_LOG_TYPE            "gFwDebugLogType"
-#define CFG_ENABLE_FW_LOG_TYPE_MIN        (0)
-#define CFG_ENABLE_FW_LOG_TYPE_MAX        (255)
-#define CFG_ENABLE_FW_LOG_TYPE_DEFAULT    (3)
-
-/* gFwDebugLogLevel takes values from enum DBGLOG_LOG_LVL,
- * make default value as DBGLOG_WARN to enable error and
- * warning logs by default.
- */
-#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL          "gFwDebugLogLevel"
-#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MIN      (0)
-#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MAX      (255)
-#define CFG_ENABLE_FW_DEBUG_LOG_LEVEL_DEFAULT  (4)
-
-/* For valid values of log levels check enum DBGLOG_LOG_LVL and
- * for valid values of module ids check enum WLAN_MODULE_ID.
- */
-#define CFG_ENABLE_FW_MODULE_LOG_LEVEL    "gFwDebugModuleLoglevel"
-#define CFG_ENABLE_FW_MODULE_LOG_DEFAULT  ""
-
-#ifdef FEATURE_GREEN_AP
-#define CFG_ENABLE_GREEN_AP_FEATURE         "gEnableGreenAp"
-#define CFG_ENABLE_GREEN_AP_FEATURE_MIN     (0)
-#define CFG_ENABLE_GREEN_AP_FEATURE_MAX     (1)
-#define CFG_ENABLE_GREEN_AP_FEATURE_DEFAULT (1)
-
-/* Enhanced Green AP (EGAP) flags/params */
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE             "gEnableEGAP"
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_MIN         (0)
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_MAX         (1)
-#define CFG_ENABLE_EGAP_ENABLE_FEATURE_DEFAULT     (0)
-
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE         "gEGAPInactTime"
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MIN     (0)
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MAX     (5000)
-#define CFG_ENABLE_EGAP_INACT_TIME_FEATURE_DEFAULT (1000)
-
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE          "gEGAPWaitTime"
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MIN      (0)
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MAX      (5000)
-#define CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_DEFAULT  (100)
-
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE              "gEGAPFeatures"
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_MIN          (0)
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_MAX          (15)
-#define CFG_ENABLE_EGAP_FLAGS_FEATURE_DEFAULT      (7)
-/* end Enhanced Green AP flags/params */
-
-#endif
-
-#ifdef FEATURE_WLAN_FORCE_SAP_SCC
-#define CFG_SAP_SCC_CHAN_AVOIDANCE         "gSapSccChanAvoidance"
-#define CFG_SAP_SCC_CHAN_AVOIDANCE_MIN     (0)
-#define CFG_SAP_SCC_CHAN_AVOIDANCE_MAX     (1)
-#define CFG_SAP_SCC_CHAN_AVOIDANCE_DEFAULT (0)
-#endif /* FEATURE_WLAN_FORCE_SAP_SCC */
-
-/*
- * CDF Trace Enable Control
- * Notes:
- *  the MIN/MAX/DEFAULT values apply for all modules
- *  the DEFAULT value is outside the valid range.  if the DEFAULT
- *    value is not overridden, then no change will be made to the
- *    "built in" default values compiled into the code
- *  values are a bitmap indicating which log levels are to enabled
- *    (must match order of cdf_trace_level enumerations)
- *    00000001  FATAL
- *    00000010  ERROR
- *    00000100  WARN
- *    00001000  INFO
- *    00010000  INFO HIGH
- *    00100000  INFO MED
- *    01000000  INFO LOW
- *    10000000  DEBUG
- *
- *  hence a value of 0xFF would set all bits (enable all logs)
- */
-
-#define CFG_CDF_TRACE_ENABLE_WDI_NAME     "cdf_trace_enable_wdi"
-#define CFG_CDF_TRACE_ENABLE_HDD_NAME     "cdf_trace_enable_hdd"
-#define CFG_CDF_TRACE_ENABLE_SME_NAME     "cdf_trace_enable_sme"
-#define CFG_CDF_TRACE_ENABLE_PE_NAME      "cdf_trace_enable_pe"
-#define CFG_CDF_TRACE_ENABLE_PMC_NAME     "cdf_trace_enable_pmc"
-#define CFG_CDF_TRACE_ENABLE_WMA_NAME     "cdf_trace_enable_wma"
-#define CFG_CDF_TRACE_ENABLE_SYS_NAME     "cdf_trace_enable_sys"
-#define CFG_CDF_TRACE_ENABLE_CDF_NAME     "cdf_trace_enable_cdf"
-#define CFG_CDF_TRACE_ENABLE_SAP_NAME     "cdf_trace_enable_sap"
-#define CFG_CDF_TRACE_ENABLE_HDD_SAP_NAME "cdf_trace_enable_hdd_sap"
-#define CFG_CDF_TRACE_ENABLE_BMI_NAME     "cdf_trace_enable_bmi"
-#define CFG_CDF_TRACE_ENABLE_CFG_NAME     "cdf_trace_enable_cfg"
-#define CFG_CDF_TRACE_ENABLE_EPPING       "cdf_trace_enable_epping"
-#define CFG_CDF_TRACE_ENABLE_CDF_DEVICES  "cdf_trace_enable_cdf_devices"
-#define CFG_CDF_TRACE_ENABLE_TXRX_NAME    "cfd_trace_enable_txrx"
-#define CFG_CDF_TRACE_ENABLE_HTC_NAME     "cdf_trace_enable_htc"
-#define CFG_CDF_TRACE_ENABLE_HIF_NAME     "cdf_trace_enable_hif"
-#define CFG_CDR_TRACE_ENABLE_HDD_SAP_DATA_NAME   "cdf_trace_enable_hdd_sap_data"
-#define CFG_CDF_TRACE_ENABLE_HDD_DATA_NAME       "cdf_trace_enable_hdd_data"
-
-#define CFG_CDF_TRACE_ENABLE_MIN          (0)
-#define CFG_CDF_TRACE_ENABLE_MAX          (0xff)
-#define CFG_CDF_TRACE_ENABLE_DEFAULT      (0xffff)
-
-#define HDD_MCASTBCASTFILTER_FILTER_NONE                       0x00
-#define HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST              0x01
-#define HDD_MCASTBCASTFILTER_FILTER_ALL_BROADCAST              0x02
-#define HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST_BROADCAST    0x03
-#define HDD_MULTICAST_FILTER_LIST                              0x04
-#define HDD_MULTICAST_FILTER_LIST_CLEAR                        0x05
-
-/*BMPS Logic
- * Notes:
- * 1 - Then Host driver and above layers control the PS mechanism
- * 0 - Diver/Core Stack internally control the Power saving mechanism
- */
-#define CFG_ANDRIOD_POWER_SAVE_NAME      "isAndroidPsEn"
-#define CFG_ANDRIOD_POWER_SAVE_MIN       (0)
-#define CFG_ANDRIOD_POWER_SAVE_MAX       (1)
-#define CFG_ANDRIOD_POWER_SAVE_DEFAULT   (0)
-
-/*
- * Enable Dynamic DTIM
- * Options
- * 0 -Disable DynamicDTIM
- * 1 to 5 - SLM will switch to DTIM specified here when host suspends and
- *          switch DTIM1 when host resumes */
-#define CFG_ENABLE_DYNAMIC_DTIM_NAME            "gEnableDynamicDTIM"
-#define CFG_ENABLE_DYNAMIC_DTIM_MIN        (0)
-#define CFG_ENABLE_DYNAMIC_DTIM_MAX        (5)
-#define CFG_ENABLE_DYNAMIC_DTIM_DEFAULT    (0)
-
-/*
- * Enable First Scan 2G Only
- * Options
- * 0 - Disable First Scan 2G Option
- * 1 - Enable First Scan 2G Option
- */
-#define CFG_ENABLE_FIRST_SCAN_2G_ONLY_NAME            "gEnableFirstScan2GOnly"
-#define CFG_ENABLE_FIRST_SCAN_2G_ONLY_MIN        (0)
-#define CFG_ENABLE_FIRST_SCAN_2G_ONLY_MAX        (1)
-#define CFG_ENABLE_FIRST_SCAN_2G_ONLY_DEFAULT    (0)
-
-/*
- * 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)
-
-/*
- * Skip DFS Channel in case of P2P Search
- * Options
- * 0 - Don't Skip DFS Channel in case of P2P Search
- * 1 - Skip DFS Channel in case of P2P Search
- */
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_NAME       "gSkipDfsChannelInP2pSearch"
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MIN        (0)
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MAX        (1)
-#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_DEFAULT    (1)
-
-/*
- * Ignore Dynamic Dtim in case of P2P
- * Options
- * 0 - Consider Dynamic Dtim incase of P2P
- * 1 - Ignore Dynamic Dtim incase of P2P
- */
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_NAME       "gIgnoreDynamicDtimInP2pMode"
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MIN        (0)
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MAX        (1)
-#define CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_DEFAULT    (0)
-
-#define CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_NAME  "gEnableAutomaticTxPowerControl"
-#define CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_MIN        (0)
-#define CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_MAX        (1)
-#define CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_DEFAULT    (1)
-
-#define CFG_SHORT_GI_40MHZ_NAME                "gShortGI40Mhz"
-#define CFG_SHORT_GI_40MHZ_MIN                 0
-#define CFG_SHORT_GI_40MHZ_MAX                 1
-#define CFG_SHORT_GI_40MHZ_DEFAULT             1
-
-/*
- * Enable / Disable MCC feature
- * Default: Enable
- */
-#define CFG_ENABLE_MCC_ENABLED_NAME             "gEnableMCCMode"
-#define CFG_ENABLE_MCC_ENABLED_MIN              (0)
-#define CFG_ENABLE_MCC_ENABLED_MAX              (1)
-#define CFG_ENABLE_MCC_ENABLED_DEFAULT          (1)
-
-/*
- * Allow GO in MCC mode to accept different beacon interval than STA's.
- * Added for Wi-Fi Cert. 5.1.12
- * Default: gAllowMCCGODiffBI = 2
- * If gAllowMCCGODiffBI = 1  // Set to 1 for WFA certification. GO Beacon
- *                              interval is not changed. MCC GO
- *                              doesn't work well in optimized way.
- *                              In worst scenario, it may invite STA
- *                              disconnection.
- * gAllowMCCGODiffBI = 2     //If set to 2 workaround 1 disassoc all the clients
- *                             and update beacon Interval
- * gAllowMCCGODiffBI = 3     //If set to 3 tear down the P2P link in auto/
- *                             Non-autonomous -GO case
- * gAllowMCCGODiffBI = 4     //If set to 4 don't disconnect the P2P client
- *                             in autonomous/Non-autonomous -GO case update
- *                             the BI dynamically
- */
-#define CFG_ALLOW_MCC_GO_DIFF_BI_NAME           "gAllowMCCGODiffBI"
-#define CFG_ALLOW_MCC_GO_DIFF_BI_MIN            (0)
-#define CFG_ALLOW_MCC_GO_DIFF_BI_MAX            (4)
-#define CFG_ALLOW_MCC_GO_DIFF_BI_DEFAULT        (4)
-
-/*
- * Enable/Disable Thermal Mitigation feature
- * Default: Enable
- */
-#define CFG_THERMAL_MIGRATION_ENABLE_NAME      "gThermalMitigationEnable"
-#define CFG_THERMAL_MIGRATION_ENABLE_MIN       (0)
-#define CFG_THERMAL_MIGRATION_ENABLE_MAX       (1)
-#define CFG_THERMAL_MIGRATION_ENABLE_DEFAULT   (1)
-
-#define CFG_THROTTLE_PERIOD_NAME               "gThrottlePeriod"
-#define CFG_THROTTLE_PERIOD_MIN                (10)
-#define CFG_THROTTLE_PERIOD_MAX                (10000)
-#define CFG_THROTTLE_PERIOD_DEFAULT            (4000)
-
-#define CFG_THERMAL_TEMP_MIN_LEVEL0_NAME      "gThermalTempMinLevel0"
-#define CFG_THERMAL_TEMP_MIN_LEVEL0_MIN       (0)
-#define CFG_THERMAL_TEMP_MIN_LEVEL0_MAX       (1000)
-#define CFG_THERMAL_TEMP_MIN_LEVEL0_DEFAULT   (0)
-
-#define CFG_THERMAL_TEMP_MAX_LEVEL0_NAME      "gThermalTempMaxLevel0"
-#define CFG_THERMAL_TEMP_MAX_LEVEL0_MIN       (0)
-#define CFG_THERMAL_TEMP_MAX_LEVEL0_MAX       (1000)
-#define CFG_THERMAL_TEMP_MAX_LEVEL0_DEFAULT   (90)
-
-#define CFG_THERMAL_TEMP_MIN_LEVEL1_NAME      "gThermalTempMinLevel1"
-#define CFG_THERMAL_TEMP_MIN_LEVEL1_MIN       (0)
-#define CFG_THERMAL_TEMP_MIN_LEVEL1_MAX       (1000)
-#define CFG_THERMAL_TEMP_MIN_LEVEL1_DEFAULT   (70)
-
-#define CFG_THERMAL_TEMP_MAX_LEVEL1_NAME      "gThermalTempMaxLevel1"
-#define CFG_THERMAL_TEMP_MAX_LEVEL1_MIN       (0)
-#define CFG_THERMAL_TEMP_MAX_LEVEL1_MAX       (1000)
-#define CFG_THERMAL_TEMP_MAX_LEVEL1_DEFAULT   (110)
-
-#define CFG_THERMAL_TEMP_MIN_LEVEL2_NAME      "gThermalTempMinLevel2"
-#define CFG_THERMAL_TEMP_MIN_LEVEL2_MIN       (0)
-#define CFG_THERMAL_TEMP_MIN_LEVEL2_MAX       (1000)
-#define CFG_THERMAL_TEMP_MIN_LEVEL2_DEFAULT   (90)
-
-#define CFG_THERMAL_TEMP_MAX_LEVEL2_NAME      "gThermalTempMaxLevel2"
-#define CFG_THERMAL_TEMP_MAX_LEVEL2_MIN       (0)
-#define CFG_THERMAL_TEMP_MAX_LEVEL2_MAX       (1000)
-#define CFG_THERMAL_TEMP_MAX_LEVEL2_DEFAULT   (125)
-
-#define CFG_THERMAL_TEMP_MIN_LEVEL3_NAME      "gThermalTempMinLevel3"
-#define CFG_THERMAL_TEMP_MIN_LEVEL3_MIN       (0)
-#define CFG_THERMAL_TEMP_MIN_LEVEL3_MAX       (1000)
-#define CFG_THERMAL_TEMP_MIN_LEVEL3_DEFAULT   (110)
-
-#define CFG_THERMAL_TEMP_MAX_LEVEL3_NAME      "gThermalTempMaxLevel3"
-#define CFG_THERMAL_TEMP_MAX_LEVEL3_MIN       (0)
-#define CFG_THERMAL_TEMP_MAX_LEVEL3_MAX       (1000)
-#define CFG_THERMAL_TEMP_MAX_LEVEL3_DEFAULT   (0)
-
-/*
- * Enable/Disable Modulated DTIM feature
- * Default: Disable
- */
-#define CFG_ENABLE_MODULATED_DTIM_NAME       "gEnableModulatedDTIM"
-#define CFG_ENABLE_MODULATED_DTIM_MIN        (0)
-#define CFG_ENABLE_MODULATED_DTIM_MAX        (5)
-#define CFG_ENABLE_MODULATED_DTIM_DEFAULT    (0)
-
-/*
- * Enable/Disable Multicast MAC Address List feature
- * Default: Disable
- */
-#define CFG_MC_ADDR_LIST_ENABLE_NAME          "gMCAddrListEnable"
-#define CFG_MC_ADDR_LIST_ENABLE_MIN           (0)
-#define CFG_MC_ADDR_LIST_ENABLE_MAX           (1)
-#define CFG_MC_ADDR_LIST_ENABLE_DEFAULT       (0)
-
-#define CFG_ENABLE_RX_STBC                       "gEnableRXSTBC"
-#define CFG_ENABLE_RX_STBC_MIN                   (0)
-#define CFG_ENABLE_RX_STBC_MAX                   (1)
-#define CFG_ENABLE_RX_STBC_DEFAULT               (1)
-
-#define CFG_ENABLE_TX_STBC                       "gEnableTXSTBC"
-#define CFG_ENABLE_TX_STBC_MIN                   (0)
-#define CFG_ENABLE_TX_STBC_MAX                   (1)
-#define CFG_ENABLE_TX_STBC_DEFAULT               (0)
-
-#define CFG_ENABLE_RX_LDPC                       "gEnableRXLDPC"
-#define CFG_ENABLE_RX_LDPC_MIN                   (0)
-#define CFG_ENABLE_RX_LDPC_MAX                   (1)
-#define CFG_ENABLE_RX_LDPC_DEFAULT               (0)
-
-/*
- * Enable/Disable vsta based on MAX Assoc limit
- * defined in WCNSS_qcom_cfg.ini.
- */
-#ifdef WLAN_SOFTAP_VSTA_FEATURE
-#define CFG_VSTA_SUPPORT_ENABLE               "gEnableVSTASupport"
-#define CFG_VSTA_SUPPORT_ENABLE_MIN           (0)
-#define CFG_VSTA_SUPPORT_ENABLE_MAX           (1)
-#define CFG_VSTA_SUPPORT_ENABLE_DEFAULT       (0)
-#endif
-
-#ifdef FEATURE_WLAN_TDLS
-#define CFG_TDLS_SUPPORT_ENABLE                     "gEnableTDLSSupport"
-#define CFG_TDLS_SUPPORT_ENABLE_MIN                 (0)
-#define CFG_TDLS_SUPPORT_ENABLE_MAX                 (1)
-#define CFG_TDLS_SUPPORT_ENABLE_DEFAULT             (0)
-
-#define CFG_TDLS_IMPLICIT_TRIGGER                   "gEnableTDLSImplicitTrigger"
-#define CFG_TDLS_IMPLICIT_TRIGGER_MIN               (0)
-#define CFG_TDLS_IMPLICIT_TRIGGER_MAX               (1)
-#define CFG_TDLS_IMPLICIT_TRIGGER_DEFAULT           (0)
-
-#define CFG_TDLS_TX_STATS_PERIOD                    "gTDLSTxStatsPeriod"
-#define CFG_TDLS_TX_STATS_PERIOD_MIN                (10)
-#define CFG_TDLS_TX_STATS_PERIOD_MAX                (4294967295UL)
-#define CFG_TDLS_TX_STATS_PERIOD_DEFAULT            (500)
-
-#define CFG_TDLS_TX_PACKET_THRESHOLD                "gTDLSTxPacketThreshold"
-#define CFG_TDLS_TX_PACKET_THRESHOLD_MIN            (0)
-#define CFG_TDLS_TX_PACKET_THRESHOLD_MAX            (4294967295UL)
-#define CFG_TDLS_TX_PACKET_THRESHOLD_DEFAULT        (10)
-
-#define CFG_TDLS_MAX_DISCOVERY_ATTEMPT              "gTDLSMaxDiscoveryAttempt"
-#define CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MIN          (1)
-#define CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MAX          (100)
-#define CFG_TDLS_MAX_DISCOVERY_ATTEMPT_DEFAULT      (5)
-
-/*  teardown notification interval (gTDLSIdleTimeout) should be multiple of
- *  setup notification (gTDLSTxStatsPeriod) interval.
- *  e.g.
- *       if setup notification (gTDLSTxStatsPeriod) interval = 500, then
- *       teardown notification (gTDLSIdleTimeout) interval should be 1000,
- *       1500, 2000, 2500...
- */
-#define CFG_TDLS_IDLE_TIMEOUT                       "gTDLSIdleTimeout"
-#define CFG_TDLS_IDLE_TIMEOUT_MIN                   (500)
-#define CFG_TDLS_IDLE_TIMEOUT_MAX                   (40000)
-#define CFG_TDLS_IDLE_TIMEOUT_DEFAULT               (5000)
-
-
-#define CFG_TDLS_IDLE_PACKET_THRESHOLD              "gTDLSIdlePacketThreshold"
-#define CFG_TDLS_IDLE_PACKET_THRESHOLD_MIN          (0)
-#define CFG_TDLS_IDLE_PACKET_THRESHOLD_MAX          (40000)
-#define CFG_TDLS_IDLE_PACKET_THRESHOLD_DEFAULT      (3)
-
-#define CFG_TDLS_RSSI_TRIGGER_THRESHOLD             "gTDLSRSSITriggerThreshold"
-#define CFG_TDLS_RSSI_TRIGGER_THRESHOLD_MIN         (-120)
-#define CFG_TDLS_RSSI_TRIGGER_THRESHOLD_MAX         (0)
-#define CFG_TDLS_RSSI_TRIGGER_THRESHOLD_DEFAULT     (-75)
-
-#define CFG_TDLS_RSSI_TEARDOWN_THRESHOLD            "gTDLSRSSITeardownThreshold"
-#define CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_MIN        (-120)
-#define CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_MAX        (0)
-#define CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_DEFAULT    (-75)
-
-#define CFG_TDLS_RSSI_DELTA                         "gTDLSRSSIDelta"
-#define CFG_TDLS_RSSI_DELTA_MIN                     (-30)
-#define CFG_TDLS_RSSI_DELTA_MAX                     (0)
-#define CFG_TDLS_RSSI_DELTA_DEFAULT                 (-20)
-
-#define CFG_TDLS_QOS_WMM_UAPSD_MASK_NAME            "gTDLSUapsdMask"    /* ACs to setup U-APSD for TDLS Sta */
-#define CFG_TDLS_QOS_WMM_UAPSD_MASK_MIN             (0)
-#define CFG_TDLS_QOS_WMM_UAPSD_MASK_MAX             (0x0F)
-#define CFG_TDLS_QOS_WMM_UAPSD_MASK_DEFAULT         (0x0F)
-
-#define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE          "gEnableTDLSBufferSta"
-#define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_MIN      (0)
-#define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_MAX      (1)
-/* Buffer STA is not enabled in CLD 2.0 yet */
-#define CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_DEFAULT  (1)
-
-#define CFG_TDLS_PUAPSD_INACTIVITY_TIME             "gTDLSPuapsdInactivityTime"
-#define CFG_TDLS_PUAPSD_INACTIVITY_TIME_MIN         (0)
-#define CFG_TDLS_PUAPSD_INACTIVITY_TIME_MAX         (10)
-#define CFG_TDLS_PUAPSD_INACTIVITY_TIME_DEFAULT     (0)
-
-#define CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD          "gTDLSPuapsdRxFrameThreshold"
-#define CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD_MIN      (10)
-#define CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD_MAX      (20)
-#define CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD_DEFAULT  (10)
-
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW          "gTDLSPuapsdPTIWindow"
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW_MIN      (1)
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW_MAX      (5)
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW_DEFAULT  (2)
-
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT         "gTDLSPuapsdPTRTimeout"
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT_MIN     (0)
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT_MAX     (10000)
-#define CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT_DEFAULT (5000)
-
-#define CFG_TDLS_EXTERNAL_CONTROL                   "gTDLSExternalControl"
-#define CFG_TDLS_EXTERNAL_CONTROL_MIN               (0)
-#define CFG_TDLS_EXTERNAL_CONTROL_MAX               (1)
-#define CFG_TDLS_EXTERNAL_CONTROL_DEFAULT           (0)
-
-#define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE          "gEnableTDLSOffChannel"
-#define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_MIN      (0)
-#define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_MAX      (1)
-#define CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_DEFAULT  (0)
-
-#define CFG_TDLS_WMM_MODE_ENABLE                     "gEnableTDLSWmmMode"
-#define CFG_TDLS_WMM_MODE_ENABLE_MIN                 (0)
-#define CFG_TDLS_WMM_MODE_ENABLE_MAX                 (1)
-#define CFG_TDLS_WMM_MODE_ENABLE_DEFAULT             (1)
-
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM          "gTDLSPrefOffChanNum"
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_MIN      (1)
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_MAX      (165)
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT  (36)
-
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_BW           "gTDLSPrefOffChanBandwidth"
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_BW_MIN      (0)
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_BW_MAX      (0x0F)
-#define CFG_TDLS_PREFERRED_OFF_CHANNEL_BW_DEFAULT  (0x07)
-
-/* Enable TDLS Scan: Allow scan and maintain TDLS link.
- *  0: If peer is not buffer STA capable and device is not sleep STA
- *     capable, then teardown TDLS link when scan is initiated. If peer
- *     is buffer STA and we can be sleep STA then TDLS link is maintained
- *     during scan.
- *  1: Maintain TDLS link and allow scan even if peer is not buffer STA
- *     capable and device is not sleep STA capable. There will be loss of
- *     Rx pkts since peer would not know when device moves away from tdls
- *     channel. Tx on TDLS link would stop when device moves away from tdls
- *     channel.
- */
-#define CFG_TDLS_SCAN_ENABLE                       "gEnableTDLSScan"
-#define CFG_TDLS_SCAN_ENABLE_MIN                   (0)
-#define CFG_TDLS_SCAN_ENABLE_MAX                   (1)
-#define CFG_TDLS_SCAN_ENABLE_DEFAULT               (0)
-
-/* TDLS peer kickout threshold to fw
- *     Firmware will use this value to determine, when to send TDLS
- *     peer kick out event to host.
- *     E.g.
- *        if peer kick out threshold is 10, then firmware will wait for 10
- *        consecutive packet failures and then send TDLS kickout
- *        notification to host driver
- */
-#define CFG_TDLS_PEER_KICKOUT_THRESHOLD            "gTDLSPeerKickoutThreshold"
-#define CFG_TDLS_PEER_KICKOUT_THRESHOLD_MIN        (10)
-#define CFG_TDLS_PEER_KICKOUT_THRESHOLD_MAX        (5000)
-#define CFG_TDLS_PEER_KICKOUT_THRESHOLD_DEFAULT    (96)
-
-#endif
-
-/* Enable/Disable LPWR Image(cMEM uBSP) Transition */
-#define CFG_ENABLE_LPWR_IMG_TRANSITION_NAME        "gEnableLpwrImgTransition"
-#define CFG_ENABLE_LPWR_IMG_TRANSITION_MIN         (0)
-#define CFG_ENABLE_LPWR_IMG_TRANSITION_MAX         (1)
-#define CFG_ENABLE_LPWR_IMG_TRANSITION_DEFAULT     (0)
-
-/*
- * Scan Aging timeout value in seconds
- */
-#define CFG_SCAN_AGING_PARAM_NAME          "gScanAgingTime"
-#define CFG_SCAN_AGING_PARAM_MIN           (0)
-#define CFG_SCAN_AGING_PARAM_MAX           (200)
-#define CFG_SCAN_AGING_PARAM_DEFAULT       (60)
-
-/* Config Param to enable the txLdpc capability
- * 0 - disable
- * 1 - HT LDPC enable
- * 2 - VHT LDPC enable
- * 3 - HT & VHT LDPC enable */
-#define CFG_TX_LDPC_ENABLE_FEATURE         "gTxLdpcEnable"
-#define CFG_TX_LDPC_ENABLE_FEATURE_MIN     (0)
-#define CFG_TX_LDPC_ENABLE_FEATURE_MAX     (3)
-#define CFG_TX_LDPC_ENABLE_FEATURE_DEFAULT (0)
-
-/*
- * Enable / Disable MCC Adaptive Scheduler feature
- * Default: Enable
- */
-#define CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_NAME             "gEnableMCCAdaptiveScheduler"
-#define CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_MIN              (0)
-#define CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_MAX              (1)
-#define CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_DEFAULT          (1)
-
-#define CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE         "gTxBFEnable"
-#define CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE_MIN     (WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMIN)
-#define CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE_MAX     (WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STAMAX)
-#define CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE_DEFAULT (WNI_CFG_VHT_SU_BEAMFORMEE_CAP_STADEF)
-
-/*
- * Enable / Disable Tx beamformee in SAP mode
- * Default: Disable
- */
-#define CFG_VHT_ENABLE_TXBF_SAP_MODE         "gEnableTxBFeeSAP"
-#define CFG_VHT_ENABLE_TXBF_SAP_MODE_MIN     (0)
-#define CFG_VHT_ENABLE_TXBF_SAP_MODE_MAX     (1)
-#define CFG_VHT_ENABLE_TXBF_SAP_MODE_DEFAULT (0)
-
-#define CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED         "gTxBFCsnValue"
-#define CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_MIN     (WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMIN)
-#define CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_MAX     (WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMAX - 1)
-#define CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_DEFAULT (WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_STAMAX - 1)
-
-#define CFG_VHT_ENABLE_TXBF_IN_20MHZ               "gEnableTxBFin20MHz"
-#define CFG_VHT_ENABLE_TXBF_IN_20MHZ_MIN           (0)
-#define CFG_VHT_ENABLE_TXBF_IN_20MHZ_MAX           (1)
-#define CFG_VHT_ENABLE_TXBF_IN_20MHZ_DEFAULT       (0)
-
-#define CFG_VHT_ENABLE_TX_SU_BEAM_FORMER         "gEnableTxSUBeamformer"
-#define CFG_VHT_ENABLE_TX_SU_BEAM_FORMER_MIN     (0)
-#define CFG_VHT_ENABLE_TX_SU_BEAM_FORMER_MAX     (1)
-#define CFG_VHT_ENABLE_TX_SU_BEAM_FORMER_DEFAULT (0)
-
-/* Enable debug for remain on channel issues */
-#define CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_NAME    "gDebugP2pRemainOnChannel"
-#define CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_DEFAULT (0)
-#define CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_MIN     (0)
-#define CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_MAX     (1)
-
-/*
- * SAP ALLOW All Channels
- */
-#define CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_NAME          "gSapAllowAllChannel"
-#define CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_MIN           (0)
-#define CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_MAX           (1)
-#define CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_DEFAULT       (0)
-
-#ifdef WLAN_FEATURE_11AC
-#define CFG_DISABLE_LDPC_WITH_TXBF_AP             "gDisableLDPCWithTxbfAP"
-#define CFG_DISABLE_LDPC_WITH_TXBF_AP_MIN         (0)
-#define CFG_DISABLE_LDPC_WITH_TXBF_AP_MAX         (1)
-#define CFG_DISABLE_LDPC_WITH_TXBF_AP_DEFAULT     (0)
-#endif
-
-/*
- * IBSS Operating Channels for 2.4G and 5GHz channels
- */
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_NAME          "gAdHocChannel5G"
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_MIN           (36)
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_MAX           (165)
-#define CFG_IBSS_ADHOC_CHANNEL_5GHZ_DEFAULT       (44)
-
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_NAME         "gAdHocChannel24G"
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_MIN          (1)
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_MAX          (14)
-#define CFG_IBSS_ADHOC_CHANNEL_24GHZ_DEFAULT      (6)
-
-/* Parameter to control VHT support in 2.4 GHz band */
-#define CFG_ENABLE_VHT_FOR_24GHZ_NAME             "gEnableVhtFor24GHzBand"
-#define CFG_ENABLE_VHT_FOR_24GHZ_MIN              (0)
-#define CFG_ENABLE_VHT_FOR_24GHZ_MAX              (1)
-#define CFG_ENABLE_VHT_FOR_24GHZ_DEFAULT          (0)
-
-#define CFG_MAX_MEDIUM_TIME                      "gMaxMediumTime"
-#define CFG_MAX_MEDIUM_TIME_STAMIN               WNI_CFG_MAX_MEDIUM_TIME_STAMIN
-#define CFG_MAX_MEDIUM_TIME_STAMAX               WNI_CFG_MAX_MEDIUM_TIME_STAMAX
-#define CFG_MAX_MEDIUM_TIME_STADEFAULT           WNI_CFG_MAX_MEDIUM_TIME_STADEF
-
-/*
- * Enable legacy fast roaming (LFR) on STA link during concurrent sessions
- */
-#define CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY          "gEnableFastRoamInConcurrency"
-#define CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY_MIN      (0)
-#define CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY_MAX      (1)
-#define CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY_DEFAULT  (1)
-
-/*
- * FlexConnectPowerFactor parameter
- * Default: Disable (0)
- */
-#define CFG_FLEX_CONNECT_POWER_FACTOR_NAME          "gFlexConnectPowerFactor"
-#define CFG_FLEX_CONNECT_POWER_FACTOR_MIN           (0)
-#define CFG_FLEX_CONNECT_POWER_FACTOR_MAX           (9)
-#define CFG_FLEX_CONNECT_POWER_FACTOR_DEFAULT       (0)
-
-/*
- * Enable heart beat monitoring offload to FW
- */
-#define CFG_ENABLE_HEART_BEAT_OFFLOAD          "gEnableIbssHeartBeatOffload"
-#define CFG_ENABLE_HEART_BEAT_OFFLOAD_MIN      (0)
-#define CFG_ENABLE_HEART_BEAT_OFFLOAD_MAX      (1)
-#define CFG_ENABLE_HEART_BEAT_OFFLOAD_DEFAULT  (1)
-
-#define CFG_ANTENNA_DIVERSITY_PARAM_NAME          "gAntennaDiversity"
-#define CFG_ANTENNA_DIVERSITY_PARAM_MIN           (0)
-#define CFG_ANTENNA_DIVERSITY_PARAM_MAX           (3)
-#define CFG_ANTENNA_DIVERSITY_PARAM_DEFAULT       (0)
-
-#define CFG_ENABLE_SNR_MONITORING_NAME              "gEnableSNRMonitoring"
-#define CFG_ENABLE_SNR_MONITORING_MIN               (0)
-#define CFG_ENABLE_SNR_MONITORING_MAX               (1)
-#define CFG_ENABLE_SNR_MONITORING_DEFAULT           (0)
-
-#ifdef FEATURE_WLAN_SCAN_PNO
-#define CFG_PNO_SCAN_SUPPORT                         "gPNOScanSupport"
-#define CFG_PNO_SCAN_SUPPORT_ENABLE                  (1)
-#define CFG_PNO_SCAN_SUPPORT_DISABLE                 (0)
-#define CFG_PNO_SCAN_SUPPORT_DEFAULT                 (1)
-
-#define CFG_PNO_SCAN_TIMER_REPEAT_VALUE              "gPNOScanTimerRepeatValue"
-#define CFG_PNO_SCAN_TIMER_REPEAT_VALUE_DEFAULT      (30)
-#define CFG_PNO_SCAN_TIMER_REPEAT_VALUE_MIN          (0)
-#define CFG_PNO_SCAN_TIMER_REPEAT_VALUE_MAX          (0xffffffff)
-
-#define CFG_PNO_SLOW_SCAN_MULTIPLIER                 "gPNOSlowScanMultiplier"
-#define CFG_PNO_SLOW_SCAN_MULTIPLIER_DEFAULT         (6)
-#define CFG_PNO_SLOW_SCAN_MULTIPLIER_MIN             (0)
-#define CFG_PNO_SLOW_SCAN_MULTIPLIER_MAX             (30)
-#endif
-
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_NAME                "gAmsduSupportInAMPDU"
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_MIN                 (0)
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_MAX                 (1)
-#define CFG_AMSDU_SUPPORT_IN_AMPDU_DEFAULT             (0)      /* disabled */
-
-/* Prefer connecting to 5G AP even if its RSSI is lower by
-   gSelect5GHzMargin dBm than 2.4G AP.
-   This feature requires the dependent cfg.ini "gRoamPrefer5GHz" set to 1 */
-#define CFG_STRICT_5GHZ_PREF_BY_MARGIN                 "gSelect5GHzMargin"
-#define CFG_STRICT_5GHZ_PREF_BY_MARGIN_MIN             (0)
-#define CFG_STRICT_5GHZ_PREF_BY_MARGIN_MAX             (60)
-#define CFG_STRICT_5GHZ_PREF_BY_MARGIN_DEFAULT         (0)      /* set 0 to disable */
-
-/* It enables IP, TCP and UDP checksum offload in hardware
- * and also advertise same to network stack.
- */
-#define CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD            "gEnableIpTcpUdpChecksumOffload"
-#define CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD_DISABLE    (0)
-#define CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD_ENABLE     (1)
-#define CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD_DEFAULT    (CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD_ENABLE)
-
-/*
- * Power Save Offload
- * Power Save Offload configuration:
- * Current values of gEnablePowerSaveOffload:
- * 0 -> Power save offload is disabled
- * 1 -> Legacy Power save enabled + Deep sleep Disabled
- * 2 -> QPower enabled + Deep sleep Disabled
- * 3 -> Legacy Power save enabled + Deep sleep Enabled
- * 4 -> QPower enabled + Deep sleep Enabled
- * 5 -> Duty cycling QPower enabled
- */
-#define CFG_POWERSAVE_OFFLOAD_NAME                "gEnablePowerSaveOffload"
-#define CFG_POWERSAVE_OFFLOAD_MIN                 (0)
-#define CFG_POWERSAVE_OFFLOAD_MAX                 (PS_DUTY_CYCLING_QPOWER)
-#define CFG_POWERSAVE_OFFLOAD_DEFAULT             (CFG_POWERSAVE_OFFLOAD_MIN)
-
-#ifdef WLAN_FEATURE_FASTPATH
-#define CFG_ENABLE_FASTPATH                      "gEnableFastPath"
-#define CFG_ENABLE_FASTPATH_MIN                  (0)
-#define CFG_ENABLE_FASTPATH_MAX                  (1)
-#define CFG_ENABLE_FASTPATH_DEFAULT              (CFG_ENABLE_FASTPATH_MIN)
-#endif /* WLAN_FEATURE_FASTPATH */
-
-/*
- * IPA Offload configuration - Each bit enables a feature
- * bit0 - IPA Enable
- * bit1 - IPA Pre filter enable
- * bit2 - IPv6 enable
- * bit3 - IPA Resource Manager (RM) enable
- * bit4 - IPA Clock scaling enable
- */
-#define CFG_IPA_OFFLOAD_CONFIG_NAME              "gIPAConfig"
-#define CFG_IPA_OFFLOAD_CONFIG_MIN               (0)
-#define CFG_IPA_OFFLOAD_CONFIG_MAX               (0xFFFFFFFF)
-#define CFG_IPA_OFFLOAD_CONFIG_DEFAULT           (CFG_IPA_OFFLOAD_CONFIG_MIN)
-
-/*
- * IPA DESC SIZE
- */
-#define CFG_IPA_DESC_SIZE_NAME                   "gIPADescSize"
-#define CFG_IPA_DESC_SIZE_MIN                    (800)
-#define CFG_IPA_DESC_SIZE_MAX                    (8000)
-#define CFG_IPA_DESC_SIZE_DEFAULT                (800)
-
-#define CFG_IPA_HIGH_BANDWIDTH_MBPS              "gIPAHighBandwidthMbps"
-#define CFG_IPA_HIGH_BANDWIDTH_MBPS_MIN          (200)
-#define CFG_IPA_HIGH_BANDWIDTH_MBPS_MAX          (1000)
-#define CFG_IPA_HIGH_BANDWIDTH_MBPS_DEFAULT      (400)
-
-#define CFG_IPA_MEDIUM_BANDWIDTH_MBPS            "gIPAMediumBandwidthMbps"
-#define CFG_IPA_MEDIUM_BANDWIDTH_MBPS_MIN        (100)
-#define CFG_IPA_MEDIUM_BANDWIDTH_MBPS_MAX        (400)
-#define CFG_IPA_MEDIUM_BANDWIDTH_MBPS_DEFAULT    (200)
-
-#define CFG_IPA_LOW_BANDWIDTH_MBPS               "gIPALowBandwidthMbps"
-#define CFG_IPA_LOW_BANDWIDTH_MBPS_MIN           (0)
-#define CFG_IPA_LOW_BANDWIDTH_MBPS_MAX           (100)
-#define CFG_IPA_LOW_BANDWIDTH_MBPS_DEFAULT       (100)
-
-/*
- * Firmware uart print
- */
-#define CFG_ENABLE_FW_UART_PRINT_NAME             "gEnablefwprint"
-#define CFG_ENABLE_FW_UART_PRINT_DISABLE          (0)
-#define CFG_ENABLE_FW_UART_PRINT_ENABLE           (1)
-#define CFG_ENABLE_FW_UART_PRINT_DEFAULT          (CFG_ENABLE_FW_UART_PRINT_DISABLE)
-
-/*
- * Firmware log
- */
-#define CFG_ENABLE_FW_LOG_NAME                   "gEnablefwlog"
-#define CFG_ENABLE_FW_LOG_DISABLE                (0)
-#define CFG_ENABLE_FW_LOG_ENABLE                 (1)
-#ifdef QCA_WIFI_3_0_ADRASTEA
-#define CFG_ENABLE_FW_LOG_DEFAULT                (CFG_ENABLE_FW_LOG_DISABLE)
-#else
-#define CFG_ENABLE_FW_LOG_DEFAULT                (CFG_ENABLE_FW_LOG_ENABLE)
-#endif
-
-/*
- * Enable/Disable SSR for USB
- */
-#define CFG_ENABLE_FW_SELF_RECOVERY_NAME         "gEnableFwSelfRecovery"
-#define CFG_ENABLE_FW_SELF_RECOVERY_DISABLE      (0)
-#define CFG_ENABLE_FW_SELF_RECOVERY_ENABLE       (1)
-#define CFG_ENABLE_FW_SELF_RECOVERY_DEFAULT      (CFG_ENABLE_FW_SELF_RECOVERY_DISABLE)
-
-#ifdef WLAN_FEATURE_11AC
-/* Macro to handle maximum receive AMPDU size configuration */
-#define CFG_VHT_AMPDU_LEN_EXPONENT_NAME                "gVhtAmpduLenExponent"
-#define CFG_VHT_AMPDU_LEN_EXPONENT_MIN                 (0)
-#define CFG_VHT_AMPDU_LEN_EXPONENT_MAX                 (7)
-#define CFG_VHT_AMPDU_LEN_EXPONENT_DEFAULT             (3)
-
-#define CFG_VHT_MPDU_LEN_NAME                          "gVhtMpduLen"
-#define CFG_VHT_MPDU_LEN_MIN                           (0)
-#define CFG_VHT_MPDU_LEN_MAX                           (2)
-#define CFG_VHT_MPDU_LEN_DEFAULT                       (0)
-#endif
-
-#define CFG_MAX_WOW_FILTERS_NAME                       "gMaxWoWFilters"
-#define CFG_MAX_WOW_FILTERS_MIN                        (0)
-#define CFG_MAX_WOW_FILTERS_MAX                        (WOW_MAX_BITMAP_FILTERS)
-#define CFG_MAX_WOW_FILTERS_DEFAULT                    (WOW_MAX_BITMAP_FILTERS)
-
-/*
- * WOW Enable/Disable.
- * 0 - Disable both magic pattern match and pattern byte match.
- * 1 - Enable magic pattern match on all interfaces.
- * 2 - Enable pattern byte match on all interfaces.
- * 3 - Enable both magic patter and pattern byte match on all interfaces.
- */
-#define CFG_WOW_STATUS_NAME                           "gEnableWoW"
-#define CFG_WOW_ENABLE_MIN                            (0)
-#define CFG_WOW_ENABLE_MAX                            (3)
-#define CFG_WOW_STATUS_DEFAULT                        (3)
-
-#define CFG_COALESING_IN_IBSS_NAME                "gCoalesingInIBSS"
-#define CFG_COALESING_IN_IBSS_MIN                 (0)
-#define CFG_COALESING_IN_IBSS_MAX                 (1)
-#define CFG_COALESING_IN_IBSS_DEFAULT             (0)   /* disabled */
-
-#define CFG_IBSS_ATIM_WIN_SIZE_NAME                "gIbssATIMWinSize"
-#define CFG_IBSS_ATIM_WIN_SIZE_MIN                 (0)
-#define CFG_IBSS_ATIM_WIN_SIZE_MAX                 (50)
-#define CFG_IBSS_ATIM_WIN_SIZE_DEFAULT             (0)
-
-/*
- * Indicates if IBSS Power Save is
- * supported or not. When not allowed,
- * IBSS station has to stay awake all
- * the time and should never set PM=1
- * in its transmitted frames. This
- * parameter is meaningful/valid only
- * when gIbssATIMWinSize is non-zero
- */
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_NAME        "gIbssIsPowerSaveAllowed"
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_MIN         (0)
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_MAX         (1)
-#define CFG_IBSS_IS_POWER_SAVE_ALLOWED_DEFAULT     (1)
-
-/*
- * Indicates if IBSS Power Collapse
- * is allowed or not.
- */
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_NAME    "gIbssIsPowerCollapseAllowed"
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MIN     (0)
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MAX     (1)
-#define CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_DEFAULT (1)
-
-/*
- * This parameter indicates whether IBSS station
- * can exit power save mode and enter power active
- * state whenever there is a TX/RX activity.
- */
-#define CFG_IBSS_AWAKE_ON_TX_RX_NAME               "gIbssAwakeOnTxRx"
-#define CFG_IBSS_AWAKE_ON_TX_RX_MIN                (0)
-#define CFG_IBSS_AWAKE_ON_TX_RX_MAX                (1)
-#define CFG_IBSS_AWAKE_ON_TX_RX_DEFAULT            (0)
-
-/*
- * In IBSS mode if Awake on TX/RX activity is enabled
- * Ibss Inactivity parameter indicates the data
- * inactivity time in number of beacon intervals
- * after which IBSS station re-inters power save
- * by sending Null frame with PM=1
- */
-#define CFG_IBSS_INACTIVITY_TIME_NAME              "gIbssInactivityTime"
-#define CFG_IBSS_INACTIVITY_TIME_MIN               (1)
-#define CFG_IBSS_INACTIVITY_TIME_MAX               (10)
-#define CFG_IBSS_INACTIVITY_TIME_DEFAULT           (1)
-
-/*
- * In IBSS mode Tx Service Period Inactivity
- * time in msecs indicates the time after
- * which TX Service Period is terminated by
- * sending a Qos Null frame with EOSP.
- * If value is 0, TX SP is terminated with the
- * last buffered packet itself instead of waiting
- * for the inactivity
- */
-#define CFG_IBSS_TXSP_END_INACTIVITY_NAME          "gIbssTxSpEndInactivityTime"
-#define CFG_IBSS_TXSP_END_INACTIVITY_MIN           (0)
-#define CFG_IBSS_TXSP_END_INACTIVITY_MAX           (100)
-#define CFG_IBSS_TXSP_END_INACTIVITY_DEFAULT       (0)
-
-/*
- * When IBSS network is initialized, PS-supporting device
- * does not enter protocol sleep state during first
- * gIbssPsWarmupTime seconds.
- */
-#define CFG_IBSS_PS_WARMUP_TIME_NAME               "gIbssPsWarmupTime"
-#define CFG_IBSS_PS_WARMUP_TIME_MIN                (0)
-/* Allow unsigned Int Max for now */
-#define CFG_IBSS_PS_WARMUP_TIME_MAX                (65535)
-#define CFG_IBSS_PS_WARMUP_TIME_DEFAULT            (0)
-
-/*
- * IBSS Power Save Enable/Disable 1 RX
- * chain usage during the ATIM window
- */
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_NAME    "gIbssPs1RxChainInAtim"
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MIN     (0)
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MAX     (1)
-#define CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_DEFAULT (0)
-
-#define CFG_SAP_MAX_NO_PEERS                       "gSoftApMaxPeers"
-#define CFG_SAP_MAX_NO_PEERS_MIN                   (1)
-#define CFG_SAP_MAX_NO_PEERS_MAX                   (32)
-#define CFG_SAP_MAX_NO_PEERS_DEFAULT               (32)
-
-/*
- * Connection related log Enable/Disable.
- * 0x1 - Enable mgmt pkt logs (no probe req/rsp).
- * 0x2 - Enable EAPOL pkt logs.
- * 0x4 - Enable DHCP pkt logs.
- * 0x0 - Disable all the above connection related logs.
- */
-#define CFG_ENABLE_DEBUG_CONNECT_ISSUE             "gEnableDebugLog"
-#define CFG_ENABLE_DEBUG_CONNECT_ISSUE_MIN         (0)
-#define CFG_ENABLE_DEBUG_CONNECT_ISSUE_MAX         (0xFF)
-#define CFG_ENABLE_DEBUG_CONNECT_ISSUE_DEFAULT     (0)
-
-/* This will be used only for debugging purpose, will be removed after sometime */
-#define CFG_ENABLE_RX_THREAD                       "gEnableRxThread"
-#define CFG_ENABLE_RX_THREAD_MIN                   (0)
-#define CFG_ENABLE_RX_THREAD_MAX                   (1)
-#define CFG_ENABLE_RX_THREAD_DEFAULT               (1)
-
-/* SAR Thermal limit values for 2g and 5g */
-
-#define CFG_SET_TXPOWER_LIMIT2G_NAME               "TxPower2g"
-#define CFG_SET_TXPOWER_LIMIT2G_MIN                (0)
-#define CFG_SET_TXPOWER_LIMIT2G_MAX                (30)
-#define CFG_SET_TXPOWER_LIMIT2G_DEFAULT            (15)
-
-#define CFG_SET_TXPOWER_LIMIT5G_NAME               "TxPower5g"
-#define CFG_SET_TXPOWER_LIMIT5G_MIN                (0)
-#define CFG_SET_TXPOWER_LIMIT5G_MAX                (30)
-#define CFG_SET_TXPOWER_LIMIT5G_DEFAULT            (15)
-
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-#define CFG_LL_TX_FLOW_LWM                         "TxFlowLowWaterMark"
-#define CFG_LL_TX_FLOW_LWM_MIN                     (0)
-#define CFG_LL_TX_FLOW_LWM_MAX                     (1000)
-
-#define CFG_LL_TX_FLOW_LWM_DEFAULT                 (300)
-
-#define CFG_LL_TX_FLOW_HWM_OFFSET                  "TxFlowHighWaterMarkOffset"
-#define CFG_LL_TX_FLOW_HWM_OFFSET_MIN              (0)
-#define CFG_LL_TX_FLOW_HWM_OFFSET_MAX              (300)
-
-#define CFG_LL_TX_FLOW_HWM_OFFSET_DEFAULT          (94)
-
-#define CFG_LL_TX_FLOW_MAX_Q_DEPTH                 "TxFlowMaxQueueDepth"
-#define CFG_LL_TX_FLOW_MAX_Q_DEPTH_MIN             (400)
-#define CFG_LL_TX_FLOW_MAX_Q_DEPTH_MAX             (3500)
-#define CFG_LL_TX_FLOW_MAX_Q_DEPTH_DEFAULT         (1500)
-
-#define CFG_LL_TX_LBW_FLOW_LWM                     "TxLbwFlowLowWaterMark"
-#define CFG_LL_TX_LBW_FLOW_LWM_MIN                 (0)
-#define CFG_LL_TX_LBW_FLOW_LWM_MAX                 (1000)
-
-#define CFG_LL_TX_LBW_FLOW_LWM_DEFAULT             (450)
-
-#define CFG_LL_TX_LBW_FLOW_HWM_OFFSET              "TxLbwFlowHighWaterMarkOffset"
-#define CFG_LL_TX_LBW_FLOW_HWM_OFFSET_MIN          (0)
-#define CFG_LL_TX_LBW_FLOW_HWM_OFFSET_MAX          (300)
-
-#define CFG_LL_TX_LBW_FLOW_HWM_OFFSET_DEFAULT      (50)
-
-#define CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH             "TxLbwFlowMaxQueueDepth"
-#define CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH_MIN         (400)
-#define CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH_MAX         (3500)
-#define CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH_DEFAULT     (750)
-
-#define CFG_LL_TX_HBW_FLOW_LWM                     "TxHbwFlowLowWaterMark"
-#define CFG_LL_TX_HBW_FLOW_LWM_MIN                 (0)
-#define CFG_LL_TX_HBW_FLOW_LWM_MAX                 (1000)
-
-#define CFG_LL_TX_HBW_FLOW_LWM_DEFAULT             (406)
-
-#define CFG_LL_TX_HBW_FLOW_HWM_OFFSET              "TxHbwFlowHighWaterMarkOffset"
-#define CFG_LL_TX_HBW_FLOW_HWM_OFFSET_MIN          (0)
-#define CFG_LL_TX_HBW_FLOW_HWM_OFFSET_MAX          (300)
-
-#define CFG_LL_TX_HBW_FLOW_HWM_OFFSET_DEFAULT      (94)
-
-#define CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH             "TxHbwFlowMaxQueueDepth"
-#define CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH_MIN         (400)
-#define CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH_MAX         (3500)
-#define CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH_DEFAULT     (1500)
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
-
-#define CFG_LL_TX_FLOW_STOP_QUEUE_TH		   "TxFlowStopQueueThreshold"
-#define CFG_LL_TX_FLOW_STOP_QUEUE_TH_DEFAULT	   (15)
-#define CFG_LL_TX_FLOW_STOP_QUEUE_TH_MIN	   (0)
-#define CFG_LL_TX_FLOW_STOP_QUEUE_TH_MAX	   (50)
-
-#define CFG_LL_TX_FLOW_START_QUEUE_OFFSET	   "TxFlowStartQueueOffset"
-#define CFG_LL_TX_FLOW_START_QUEUE_OFFSET_DEFAULT  (10)
-#define CFG_LL_TX_FLOW_START_QUEUE_OFFSET_MIN	   (0)
-#define CFG_LL_TX_FLOW_START_QUEUE_OFFSET_MAX	   (30)
-
-#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
-
-#define CFG_SAP_MAX_OFFLOAD_PEERS                  "gMaxOffloadPeers"
-#define CFG_SAP_MAX_OFFLOAD_PEERS_MIN              (2)
-#define CFG_SAP_MAX_OFFLOAD_PEERS_MAX              (5)
-#define CFG_SAP_MAX_OFFLOAD_PEERS_DEFAULT          (2)
-
-#define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS          "gMaxOffloadReorderBuffs"
-#define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_MIN      (0)
-#define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_MAX      (3)
-#define CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_DEFAULT  (2)
-
-#ifdef FEATURE_WLAN_RA_FILTERING
-#define CFG_RA_FILTER_ENABLE_NAME                  "gRAFilterEnable"
-#define CFG_RA_FILTER_ENABLE_MIN                   (0)
-#define CFG_RA_FILTER_ENABLE_MAX                   (1)
-#define CFG_RA_FILTER_ENABLE_DEFAULT               (0)
-
-#define CFG_RA_RATE_LIMIT_INTERVAL_NAME            "gRArateLimitInterval"
-#define CFG_RA_RATE_LIMIT_INTERVAL_MIN             (60)
-#define CFG_RA_RATE_LIMIT_INTERVAL_MAX             (3600)
-#define CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT         (60) /*60 SEC */
-#endif
-
-#define CFG_IGNORE_PEER_ERP_INFO_NAME      "gIgnorePeerErpInfo"
-#define CFG_IGNORE_PEER_ERP_INFO_MIN       (0)
-#define CFG_IGNORE_PEER_ERP_INFO_MAX       (1)
-#define CFG_IGNORE_PEER_ERP_INFO_DEFAULT   (0)
-
-/* Enable Memory Debug */
-#ifdef MEMORY_DEBUG
-#define CFG_ENABLE_MEMORY_DEBUG_NAME             "gEnableMemoryDebug"
-#define CFG_ENABLE_MEMORY_DEBUG_MIN              (0)
-#define CFG_ENABLE_MEMORY_DEBUG_MAX              (1)
-#define CFG_ENABLE_MEMORY_DEBUG_DEFAULT          (1)
-#endif
-
-#define CFG_INITIAL_DWELL_TIME_NAME            "gInitialDwellTime"
-#define CFG_INITIAL_DWELL_TIME_DEFAULT         (0)
-#define CFG_INITIAL_DWELL_TIME_MIN             (0)
-#define CFG_INITIAL_DWELL_TIME_MAX             (100)
-
-#define CFG_INITIAL_SCAN_NO_DFS_CHNL_NAME         "gInitialScanNoDFSChnl"
-#define CFG_INITIAL_SCAN_NO_DFS_CHNL_DEFAULT      (0)
-#define CFG_INITIAL_SCAN_NO_DFS_CHNL_MIN          (0)
-#define CFG_INITIAL_SCAN_NO_DFS_CHNL_MAX          (1)
-
-#define CFG_ROAMING_DFS_CHANNEL_NAME               "gAllowDFSChannelRoam"
-#define CFG_ROAMING_DFS_CHANNEL_DISABLED           (0)
-#define CFG_ROAMING_DFS_CHANNEL_ENABLED_NORMAL     (1)
-#define CFG_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE     (2)
-#define CFG_ROAMING_DFS_CHANNEL_MIN                (CFG_ROAMING_DFS_CHANNEL_DISABLED)
-#define CFG_ROAMING_DFS_CHANNEL_MAX                (CFG_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE)
-#define CFG_ROAMING_DFS_CHANNEL_DEFAULT            (CFG_ROAMING_DFS_CHANNEL_DISABLED)
-
-#ifdef MSM_PLATFORM
-#define CFG_BUS_BANDWIDTH_HIGH_THRESHOLD           "gBusBandwidthHighThreshold"
-#define CFG_BUS_BANDWIDTH_HIGH_THRESHOLD_DEFAULT   (2000)
-#define CFG_BUS_BANDWIDTH_HIGH_THRESHOLD_MIN       (0)
-#define CFG_BUS_BANDWIDTH_HIGH_THRESHOLD_MAX       (4294967295UL)
-
-#define CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD         "gBusBandwidthMediumThreshold"
-#define CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD_DEFAULT (500)
-#define CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD_MIN     (0)
-#define CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD_MAX     (4294967295UL)
-
-#define CFG_BUS_BANDWIDTH_LOW_THRESHOLD            "gBusBandwidthLowThreshold"
-#define CFG_BUS_BANDWIDTH_LOW_THRESHOLD_DEFAULT    (150)
-#define CFG_BUS_BANDWIDTH_LOW_THRESHOLD_MIN        (0)
-#define CFG_BUS_BANDWIDTH_LOW_THRESHOLD_MAX        (4294967295UL)
-
-#define CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL         "gBusBandwidthComputeInterval"
-#define CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_DEFAULT (100)
-#define CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MIN     (0)
-#define CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MAX     (10000)
-
-#define CFG_TCP_DELACK_THRESHOLD_HIGH              "gTcpDelAckThresholdHigh"
-#define CFG_TCP_DELACK_THRESHOLD_HIGH_DEFAULT      (500)
-#define CFG_TCP_DELACK_THRESHOLD_HIGH_MIN          (0)
-#define CFG_TCP_DELACK_THRESHOLD_HIGH_MAX          (16000)
-
-#define CFG_TCP_DELACK_THRESHOLD_LOW               "gTcpDelAckThresholdLow"
-#define CFG_TCP_DELACK_THRESHOLD_LOW_DEFAULT       (1000)
-#define CFG_TCP_DELACK_THRESHOLD_LOW_MIN           (0)
-#define CFG_TCP_DELACK_THRESHOLD_LOW_MAX           (10000)
-
-/* TCP_TX_HIGH_TPUT_THRESHOLD specifies the threshold of packets transmitted
- * over a period of 100 ms beyond which TCP can be considered to have a high
- * TX throughput requirement. The driver uses this condition to tweak TCP TX
- * specific parameters (via cnss-daemon).
- * default  - 500
- */
-#define CFG_TCP_TX_HIGH_TPUT_THRESHOLD_NAME         "gTcpTxHighTputThreshold"
-#define CFG_TCP_TX_HIGH_TPUT_THRESHOLD_DEFAULT      (500)
-#define CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MIN          (0)
-#define CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MAX          (16000)
-
-#endif /* MSM_PLATFORM */
-
-#ifdef WLAN_FEATURE_11W
-#define CFG_PMF_SA_QUERY_MAX_RETRIES_NAME          "pmfSaQueryMaxRetries"
-#define CFG_PMF_SA_QUERY_MAX_RETRIES_DEFAULT       (5)
-#define CFG_PMF_SA_QUERY_MAX_RETRIES_MIN           (0)
-#define CFG_PMF_SA_QUERY_MAX_RETRIES_MAX           (20)
-
-#define CFG_PMF_SA_QUERY_RETRY_INTERVAL_NAME       "pmfSaQueryRetryInterval"
-#define CFG_PMF_SA_QUERY_RETRY_INTERVAL_DEFAULT    (200)
-#define CFG_PMF_SA_QUERY_RETRY_INTERVAL_MIN        (0)
-#define CFG_PMF_SA_QUERY_RETRY_INTERVAL_MAX        (2000)
-#endif
-
-#define CFG_MAX_CONCURRENT_CONNECTIONS_NAME        "gMaxConcurrentActiveSessions"
-#define CFG_MAX_CONCURRENT_CONNECTIONS_DEFAULT     (2)
-#define CFG_MAX_CONCURRENT_CONNECTIONS_MIN         (1)
-#define CFG_MAX_CONCURRENT_CONNECTIONS_MAX         (4)
-
-#define CFG_IGNORE_CAC_NAME                        "gIgnoreCAC"
-#define CFG_IGNORE_CAC_MIN                         (0)
-#define CFG_IGNORE_CAC_MAX                         (1)
-#define CFG_IGNORE_CAC_DEFAULT                     (0)
-
-#define CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_NAME      "gEnableSAPDfsChSifsBurst"
-#define CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_MIN       (0)
-#define CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_MAX       (1)
-#define CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_DEFAULT   (1)
-
-#define CFG_DFS_RADAR_PRI_MULTIPLIER_NAME          "gDFSradarMappingPriMultiplier"
-#define CFG_DFS_RADAR_PRI_MULTIPLIER_DEFAULT       (4)
-#define CFG_DFS_RADAR_PRI_MULTIPLIER_MIN           (0)
-#define CFG_DFS_RADAR_PRI_MULTIPLIER_MAX           (10)
-#define CFG_REORDER_OFFLOAD_SUPPORT_NAME    "gReorderOffloadSupported"
-#define CFG_REORDER_OFFLOAD_SUPPORT_MIN     (0)
-#define CFG_REORDER_OFFLOAD_SUPPORT_MAX     (1)
-#define CFG_REORDER_OFFLOAD_SUPPORT_DEFAULT (0)
-
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-#define CFG_ROAMING_OFFLOAD_NAME                "gRoamOffloadEnabled"
-#define CFG_ROAMING_OFFLOAD_MIN                 (0)
-#define CFG_ROAMING_OFFLOAD_MAX                 (1)
-#define CFG_ROAMING_OFFLOAD_DEFAULT             (0)
-#endif
-
-#define CFG_IPA_UC_TX_BUF_COUNT_NAME               "IpaUcTxBufCount"
-#define CFG_IPA_UC_TX_BUF_COUNT_MIN                (0)
-#define CFG_IPA_UC_TX_BUF_COUNT_MAX                (2048)
-#define CFG_IPA_UC_TX_BUF_COUNT_DEFAULT            (512)
-
-#define CFG_IPA_UC_TX_BUF_SIZE_NAME                "IpaUcTxBufSize"
-#define CFG_IPA_UC_TX_BUF_SIZE_MIN                (0)
-#define CFG_IPA_UC_TX_BUF_SIZE_MAX                (4096)
-#define CFG_IPA_UC_TX_BUF_SIZE_DEFAULT            (2048)
-
-#define CFG_IPA_UC_RX_IND_RING_COUNT_NAME          "IpaUcRxIndRingCount"
-#define CFG_IPA_UC_RX_IND_RING_COUNT_MIN           (0)
-#define CFG_IPA_UC_RX_IND_RING_COUNT_MAX           (2048)
-#define CFG_IPA_UC_RX_IND_RING_COUNT_DEFAULT       (1024)
-
-#define CFG_IPA_UC_TX_PARTITION_BASE_NAME          "IpaUcTxPartitionBase"
-#define CFG_IPA_UC_TX_PARTITION_BASE_MIN           (0)
-#define CFG_IPA_UC_TX_PARTITION_BASE_MAX           (9000)
-#define CFG_IPA_UC_TX_PARTITION_BASE_DEFAULT       (3000)
-
-#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-/* Enable WLAN Logging to app space */
-#define CFG_WLAN_LOGGING_SUPPORT_NAME               "wlanLoggingEnable"
-#define CFG_WLAN_LOGGING_SUPPORT_ENABLE             (1)
-#define CFG_WLAN_LOGGING_SUPPORT_DISABLE            (0)
-#define CFG_WLAN_LOGGING_SUPPORT_DEFAULT            (1)
-
-/* Enable FATAL and ERROR logs for kmsg console */
-#define CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_NAME    "wlanLoggingFEToConsole"
-#define CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_ENABLE  (1)
-#define CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_DISABLE (0)
-#define CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_DEFAULT (1)
-
-/* Number of buffers to be used for WLAN logging */
-#define CFG_WLAN_LOGGING_NUM_BUF_NAME               "wlanLoggingNumBuf"
-#define CFG_WLAN_LOGGING_NUM_BUF_MIN                (4)
-#define CFG_WLAN_LOGGING_NUM_BUF_MAX                (512)
-#define CFG_WLAN_LOGGING_NUM_BUF_DEFAULT            (256)
-#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */
-
-#define CFG_ENABLE_SIFS_BURST                      "gEnableSifsBurst"
-#define CFG_ENABLE_SIFS_BURST_MIN                  (0)
-#define CFG_ENABLE_SIFS_BURST_MAX                  (1)
-#define CFG_ENABLE_SIFS_BURST_DEFAULT              (0)
-
-#ifdef WLAN_FEATURE_LPSS
-#define CFG_ENABLE_LPASS_SUPPORT                          "gEnableLpassSupport"
-#define CFG_ENABLE_LPASS_SUPPORT_DEFAULT                  (0)
-#define CFG_ENABLE_LPASS_SUPPORT_MIN                      (0)
-#define CFG_ENABLE_LPASS_SUPPORT_MAX                      (1)
-#endif
-
-/*
- * NaN feature support configuration
- * gEnableNanSupport = 0 means NaN is not supported
- * gEnableNanSupport = 1 means NaN is supported
- */
-#ifdef WLAN_FEATURE_NAN
-#define CFG_ENABLE_NAN_SUPPORT                          "gEnableNanSupport"
-#define CFG_ENABLE_NAN_SUPPORT_DEFAULT                  (0)
-#define CFG_ENABLE_NAN_SUPPORT_MIN                      (0)
-#define CFG_ENABLE_NAN_SUPPORT_MAX                      (1)
-#endif
-
-#define CFG_ENABLE_SELF_RECOVERY                   "gEnableSelfRecovery"
-#define CFG_ENABLE_SELF_RECOVERY_MIN               (0)
-#define CFG_ENABLE_SELF_RECOVERY_MAX               (1)
-#define CFG_ENABLE_SELF_RECOVERY_DEFAULT           (0)
-
-#define CFG_ENABLE_SAP_SUSPEND                     "gEnableSapSuspend"
-#define CFG_ENABLE_SAP_SUSPEND_MIN                 (0)
-#define CFG_ENABLE_SAP_SUSPEND_MAX                 (1)
-#define CFG_ENABLE_SAP_SUSPEND_DEFAULT             (1)
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-#define CFG_EXTWOW_GO_TO_SUSPEND                   "gExtWoWgotoSuspend"
-#define CFG_EXTWOW_GO_TO_SUSPEND_MIN               (0)
-#define CFG_EXTWOW_GO_TO_SUSPEND_MAX               (1)
-#define CFG_EXTWOW_GO_TO_SUSPEND_DEFAULT           (1)
-
-#define CFG_EXTWOW_APP1_WAKE_PIN_NUMBER            "gExtWowApp1WakeupPinNumber"
-#define CFG_EXTWOW_APP1_WAKE_PIN_NUMBER_MIN        (0)
-#define CFG_EXTWOW_APP1_WAKE_PIN_NUMBER_MAX        (255)
-#define CFG_EXTWOW_APP1_WAKE_PIN_NUMBER_DEFAULT    (12)
-
-#define CFG_EXTWOW_APP2_WAKE_PIN_NUMBER            "gExtWowApp2WakeupPinNumber"
-#define CFG_EXTWOW_APP2_WAKE_PIN_NUMBER_MIN        (0)
-#define CFG_EXTWOW_APP2_WAKE_PIN_NUMBER_MAX        (255)
-#define CFG_EXTWOW_APP2_WAKE_PIN_NUMBER_DEFAULT    (16)
-
-#define CFG_EXTWOW_KA_INIT_PING_INTERVAL           "gExtWoWApp2KAInitPingInterval"
-#define CFG_EXTWOW_KA_INIT_PING_INTERVAL_MIN       (0)
-#define CFG_EXTWOW_KA_INIT_PING_INTERVAL_MAX       (0xffffffff)
-#define CFG_EXTWOW_KA_INIT_PING_INTERVAL_DEFAULT   (240)
-
-#define CFG_EXTWOW_KA_MIN_PING_INTERVAL            "gExtWoWApp2KAMinPingInterval"
-#define CFG_EXTWOW_KA_MIN_PING_INTERVAL_MIN        (0)
-#define CFG_EXTWOW_KA_MIN_PING_INTERVAL_MAX        (0xffffffff)
-#define CFG_EXTWOW_KA_MIN_PING_INTERVAL_DEFAULT    (240)
-
-#define CFG_EXTWOW_KA_MAX_PING_INTERVAL            "gExtWoWApp2KAMaxPingInterval"
-#define CFG_EXTWOW_KA_MAX_PING_INTERVAL_MIN        (0)
-#define CFG_EXTWOW_KA_MAX_PING_INTERVAL_MAX        (0xffffffff)
-#define CFG_EXTWOW_KA_MAX_PING_INTERVAL_DEFAULT    (1280)
-
-#define CFG_EXTWOW_KA_INC_PING_INTERVAL            "gExtWoWApp2KAIncPingInterval"
-#define CFG_EXTWOW_KA_INC_PING_INTERVAL_MIN        (0)
-#define CFG_EXTWOW_KA_INC_PING_INTERVAL_MAX        (0xffffffff)
-#define CFG_EXTWOW_KA_INC_PING_INTERVAL_DEFAULT    (4)
-
-#define CFG_EXTWOW_TCP_SRC_PORT                    "gExtWoWApp2TcpSrcPort"
-#define CFG_EXTWOW_TCP_SRC_PORT_MIN                (0)
-#define CFG_EXTWOW_TCP_SRC_PORT_MAX                (65535)
-#define CFG_EXTWOW_TCP_SRC_PORT_DEFAULT            (5000)
-
-#define CFG_EXTWOW_TCP_DST_PORT                    "gExtWoWApp2TcpDstPort"
-#define CFG_EXTWOW_TCP_DST_PORT_MIN                (0)
-#define CFG_EXTWOW_TCP_DST_PORT_MAX                (65535)
-#define CFG_EXTWOW_TCP_DST_PORT_DEFAULT            (5001)
-
-#define CFG_EXTWOW_TCP_TX_TIMEOUT                  "gExtWoWApp2TcpTxTimeout"
-#define CFG_EXTWOW_TCP_TX_TIMEOUT_MIN              (0)
-#define CFG_EXTWOW_TCP_TX_TIMEOUT_MAX              (0xffffffff)
-#define CFG_EXTWOW_TCP_TX_TIMEOUT_DEFAULT          (200)
-
-#define CFG_EXTWOW_TCP_RX_TIMEOUT                  "gExtWoWApp2TcpRxTimeout"
-#define CFG_EXTWOW_TCP_RX_TIMEOUT_MIN              (0)
-#define CFG_EXTWOW_TCP_RX_TIMEOUT_MAX              (0xffffffff)
-#define CFG_EXTWOW_TCP_RX_TIMEOUT_DEFAULT          (200)
-#endif
-
-#define CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_NAME    "gEnableDeauthToDisassocMap"
-#define CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_MIN     (0)
-#define CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_MAX     (1)
-#define CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_DEFAULT (0)
-
-#ifdef DHCP_SERVER_OFFLOAD
-#define CFG_DHCP_SERVER_OFFLOAD_SUPPORT_NAME      "gDHCPServerOffloadEnable"
-#define CFG_DHCP_SERVER_OFFLOAD_SUPPORT_MIN       (0)
-#define CFG_DHCP_SERVER_OFFLOAD_SUPPORT_MAX       (1)
-#define CFG_DHCP_SERVER_OFFLOAD_SUPPORT_DEFAULT   (CFG_DHCP_SERVER_OFFLOAD_SUPPORT_MIN)
-
-#define CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_NAME     "gDHCPMaxNumClients"
-#define CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_MIN      (1)
-#define CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_MAX      (8)
-#define CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_DEFAULT  (CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_MAX)
-
-#define CFG_DHCP_SERVER_IP_NAME     "gDHCPServerIP"
-#define CFG_DHCP_SERVER_IP_DEFAULT  ""
-#endif /* DHCP_SERVER_OFFLOAD */
-
-/*
- * If last disconnection was due to HB failure and we reconnect
- * to same AP next time, send Deauth before starting connection
- */
-#define CFG_ENABLE_DEAUTH_BEFORE_CONNECTION                  "gSendDeauthBeforeCon"
-#define CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_MIN              (0)
-#define CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_MAX              (1)
-#define CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_DEFAULT          (0)
-
-/*
- * Custom concurrency rule1:
- * If SAP comes up first and STA comes up later then SAP
- * needs to follow STA's channel.
- */
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME         "gEnableCustomConcRule1"
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MIN     (0)
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MAX     (1)
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_DEFAULT (0)
-
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME         "gEnableCustomConcRule2"
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MIN     (0)
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MAX     (1)
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_DEFAULT (0)
-
-#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ         "gEnableStaConnectionIn5Ghz"
-#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MIN     (0)
-#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MAX     (1)
-#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_DEFAULT (1)
-
-#define CFG_ENABLE_MAC_ADDR_SPOOFING                "gEnableMacAddrSpoof"
-#define CFG_ENABLE_MAC_ADDR_SPOOFING_MIN            (0)
-#define CFG_ENABLE_MAC_ADDR_SPOOFING_MAX            (1)
-#define CFG_ENABLE_MAC_ADDR_SPOOFING_DEFAULT        (1)
-
-#define CFG_P2P_LISTEN_DEFER_INTERVAL_NAME        "gP2PListenDeferInterval"
-#define CFG_P2P_LISTEN_DEFER_INTERVAL_MIN         (100)
-#define CFG_P2P_LISTEN_DEFER_INTERVAL_MAX         (200)
-#define CFG_P2P_LISTEN_DEFER_INTERVAL_DEFAULT     (100)
-
-#define CFG_STA_MIRACAST_MCC_REST_TIME_VAL          "gStaMiracastMccRestTimeVal"
-#define CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MIN     (100)
-#define CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MAX     (500)
-#define CFG_STA_MIRACAST_MCC_REST_TIME_VAL_DEFAULT (400)
-
-#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_NAME         "gSapChannelAvoidance"
-#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_MIN          (0)
-#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_MAX          (1)
-#define CFG_SAP_MCC_CHANNEL_AVOIDANCE_DEFAULT      (0)
-#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
-
-#define CFG_SAP_P2P_11AC_OVERRIDE_NAME             "gAP11ACOverride"
-#define CFG_SAP_P2P_11AC_OVERRIDE_MIN              (0)
-#define CFG_SAP_P2P_11AC_OVERRIDE_MAX              (1)
-#define CFG_SAP_P2P_11AC_OVERRIDE_DEFAULT          (1)
-
-#define CFG_SAP_DOT11MC               "gSapDot11mc"
-#define CFG_SAP_DOT11MC_MIN           (0)
-#define CFG_SAP_DOT11MC_MAX           (1)
-#define CFG_SAP_DOT11MC_DEFAULT       (0)
-
-#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR           "gPreferNonDfsChanOnRadar"
-#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MIN       (0)
-#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MAX       (1)
-#define CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_DEFAULT   (0)
-
-#define CFG_MULTICAST_HOST_FW_MSGS          "gMulticastHostFwMsgs"
-#define CFG_MULTICAST_HOST_FW_MSGS_MIN      (0)
-#define CFG_MULTICAST_HOST_FW_MSGS_MAX      (1)
-#define CFG_MULTICAST_HOST_FW_MSGS_DEFAULT  (1)
-
-/*
- * wlan system preference option to help policy manager decide
- * on Preferred Channel List for a new connection. For possible
- * values refer to enum hdd_conc_priority_mode
- */
-#define CFG_CONC_SYSTEM_PREF               "gSystemPref"
-#define CFG_CONC_SYSTEM_PREF_MIN           (0)
-#define CFG_CONC_SYSTEM_PREF_MAX           (2)
-#define CFG_CONC_SYSTEM_PREF_DEFAULT       (0)
-
-#define CFG_POLICY_MNGR_ENABLE              "gPolicyManagerEnable"
-#define CFG_POLICY_MNGR_ENABLE_MIN          (0)
-#define CFG_POLICY_MNGR_ENABLE_MAX          (1)
-#define CFG_POLICY_MNGR_ENABLE_DEFAULT      (1)
-
-#define CFG_TSO_ENABLED_NAME           "TSOEnable"
-#define CFG_TSO_ENABLED_MIN            (0)
-#define CFG_TSO_ENABLED_MAX            (1)
-#define CFG_TSO_ENABLED_DEFAULT        (0)
-
-/*
- * Configuration option to enable or disable LRO (Large Receive Offload)
- *  in the WLAN driver
- *  Set 1 - enable, 0 - disable
- */
-#define CFG_LRO_ENABLED_NAME           "LROEnable"
-#define CFG_LRO_ENABLED_MIN            (0)
-#define CFG_LRO_ENABLED_MAX            (1)
-#define CFG_LRO_ENABLED_DEFAULT        (0)
-
-/*
- * In static display use case when APPS is in stand alone power save mode enable
- * active offload mode which helps FW to filter out MC/BC data packets to avoid
- * APPS wake up and save more power.
- *
- * By default enable active mode offload as it helps to save more power in
- * static display usecase(APPS stand alone power collapse).
- *
- * If active mode offload(gActiveModeOffload=1) is enabled then all applicable
- * data offload/filtering is enabled immediately in FW once config is available
- * in WLAN driver and FW caches this configuration accross suspend/resume
- *
- * If active mode offload is disabled(gActiveModeOffload=0) then all applicable
- * data offload/filtering is enabled during cfg80211 suspend and disabled
- * during cfg80211 resume
- *
- * Active mode offload feature is bydefault enabled for adrastea and disabled
- * for non adrastea targets like ROME
- */
-
-#define CFG_ACTIVE_MODE_OFFLOAD            "gActiveModeOffload"
-#define CFG_ACTIVE_MODE_OFFLOAD_MIN        (0)
-#define CFG_ACTIVE_MODE_OFFLOAD_MAX        (1)
-#ifdef QCA_WIFI_3_0_ADRASTEA
-#define CFG_ACTIVE_MODE_OFFLOAD_DEFAULT    (1)
-#else
-#define CFG_ACTIVE_MODE_OFFLOAD_DEFAULT    (0)
-#endif
-
-/*
- * 0: disable the cck tx chain mask (default)
- * 1: enable the cck tx chain mask
- */
-#define CFG_TX_CHAIN_MASK_CCK          "gCckChainMaskEnable"
-#define CFG_TX_CHAIN_MASK_CCK_MIN      (0)
-#define CFG_TX_CHAIN_MASK_CCK_MAX      (1)
-#define CFG_TX_CHAIN_MASK_CCK_DEFAULT  (0)
-
-#define CFG_TX_CHAIN_MASK_1SS       "gTxChainMask1ss"
-#define CFG_TX_CHAIN_MASK_1SS_MIN      (0)
-#define CFG_TX_CHAIN_MASK_1SS_MAX      (3)
-#define CFG_TX_CHAIN_MASK_1SS_DEFAULT  (1)
-
-/*
- * set the self gen power value from
- * 0 to 0xffff
- */
-#define CFG_SELF_GEN_FRM_PWR        "gSelfGenFrmPwr"
-#define CFG_SELF_GEN_FRM_PWR_MIN      (0)
-#define CFG_SELF_GEN_FRM_PWR_MAX      (0xffff)
-#define CFG_SELF_GEN_FRM_PWR_DEFAULT  (0)
-
-/*
- * fine timing measurement capability information
- *
- * <----- fine_time_meas_cap (in bits) ----->
- *+----------+-----+-----+------+------+-------+-------+-----+-----+
- *|   9-31   |  8  |  7  |   5  |   4  |   3   |   2   |  1  |  0  |
- *+----------+-----+-----+------+------+-------+-------+-----+-----+
- *| reserved | SAP | SAP |P2P-GO|P2P-GO|P2P-CLI|P2P-CLI| STA | STA |
- *|          |resp |init |resp  |init  |resp   |init   |resp |init |
- *+----------+-----+-----+------+------+-------+-------+-----+-----+
- *
- * resp - responder role; init- initiator role
- *
- * CFG_FINE_TIME_MEAS_CAPABILITY_MAX computed based on the table
- * +-----------------+-----------------+-----------+
- * |  Device Role    |   Initiator     | Responder |
- * +-----------------+-----------------+-----------+
- * |   Station       |       Y         |     N     |
- * |   P2P-CLI       |       Y         |     Y     |
- * |   P2P-GO        |       Y         |     Y     |
- * |   SAP           |       N         |     Y     |
- * +-----------------+-----------------+-----------+
- */
-#define CFG_FINE_TIME_MEAS_CAPABILITY              "gfine_time_meas_cap"
-#define CFG_FINE_TIME_MEAS_CAPABILITY_MIN          (0x0000)
-#define CFG_FINE_TIME_MEAS_CAPABILITY_MAX          (0x00BD)
-#define CFG_FINE_TIME_MEAS_CAPABILITY_DEFAULT      (0x000D)
-
-/*
- * Maximum number of scans that host can queue at firmware is controlled
- * through the configuration item  'max_scan_count'.
- *
- * Rome - Rome firmware support 8 scan queue size and 4 are reserved
- * for internal scan requests like roaming. So host can send 4
- * scan requests.
- *
- * ihelium - There is no constraint in number of scan queue size at
- * firmware but the current uses cases needs support of maximum
- * of 4 scan request from host.
- */
-#define CFG_MAX_SCAN_COUNT_NAME           "max_scan_count"
-#define CFG_MAX_SCAN_COUNT_MIN            (1)
-#define CFG_MAX_SCAN_COUNT_MAX            (8)
-#define CFG_MAX_SCAN_COUNT_DEFAULT        (4)
-
-/**
- * enum dot11p_mode - The 802.11p mode of operation
- * @WLAN_HDD_11P_DISABLED:   802.11p mode is disabled
- * @WLAN_HDD_11P_STANDALONE: 802.11p-only operation
- * @WLAN_HDD_11P_CONCURRENT: 802.11p and WLAN operate concurrently
- */
-enum dot11p_mode {
-	WLAN_HDD_11P_DISABLED = 0,
-	WLAN_HDD_11P_STANDALONE,
-	WLAN_HDD_11P_CONCURRENT,
-};
-
-#define CFG_DOT11P_MODE_NAME             "gDot11PMode"
-#define CFG_DOT11P_MODE_DEFAULT          (WLAN_HDD_11P_DISABLED)
-#define CFG_DOT11P_MODE_MIN              (WLAN_HDD_11P_DISABLED)
-#define CFG_DOT11P_MODE_MAX              (WLAN_HDD_11P_CONCURRENT)
-
-#define CFG_NAPI_NAME       "gEnableNAPI"
-#define CFG_NAPI_MIN        (0)
-#define CFG_NAPI_MAX        (1)
-#define CFG_NAPI_DEFAULT    (0)
-
-#ifdef FEATURE_WLAN_EXTSCAN
-#define CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_NAME      "gExtScanPassiveMaxChannelTime"
-#define CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_MIN       (0)
-#define CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_MAX       (500)
-#define CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_DEFAULT   (110)
-
-#define CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_NAME      "gExtScanPassiveMinChannelTime"
-#define CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_MIN       (0)
-#define CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_MAX       (500)
-#define CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_DEFAULT   (60)
-
-#define CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_NAME       "gExtScanActiveMaxChannelTime"
-#define CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_MIN        (0)
-#define CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_MAX        (110)
-#define CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_DEFAULT    (40)
-
-#define CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_NAME       "gExtScanActiveMinChannelTime"
-#define CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_MIN        (0)
-#define CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_MAX        (110)
-#define CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_DEFAULT    (20)
-#endif
-
-#define CFG_CE_CLASSIFY_ENABLE_NAME	"gCEClassifyEnable"
-#define CFG_CE_CLASSIFY_ENABLE_MIN	(0)
-#define CFG_CE_CLASSIFY_ENABLE_MAX	(1)
-#define CFG_CE_CLASSIFY_ENABLE_DEFAULT	(0)
-
-#define CFG_DUAL_MAC_FEATURE_DISABLE               "gDualMacFeatureDisable"
-#define CFG_DUAL_MAC_FEATURE_DISABLE_MIN          (0)
-#define CFG_DUAL_MAC_FEATURE_DISABLE_MAX          (1)
-#define CFG_DUAL_MAC_FEATURE_DISABLE_DEFAULT      (0)
-
-/* Parameters for roaming scans performed at high RSSI */
-
-/* Maximum number of scans after RSSI change */
-#define CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_NAME         "gRoamScanHiRssiMaxCount"
-#define CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_MIN          (0)
-#define CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_MAX          (10)
-#define CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_DEFAULT      (3)
-
-/* Change in RSSI at which scan is triggered */
-#define CFG_ROAM_SCAN_HI_RSSI_DELTA_NAME           "gRoamScanHiRssiDelta"
-#define CFG_ROAM_SCAN_HI_RSSI_DELTA_MIN            (0)
-#define CFG_ROAM_SCAN_HI_RSSI_DELTA_MAX            (16)
-#define CFG_ROAM_SCAN_HI_RSSI_DELTA_DEFAULT        (10)
-
-/* Delay between consecutive scans in milliseconds */
-#define CFG_ROAM_SCAN_HI_RSSI_DELAY_NAME            "gRoamScanHiRssiDelay"
-#define CFG_ROAM_SCAN_HI_RSSI_DELAY_MIN             (5000)
-#define CFG_ROAM_SCAN_HI_RSSI_DELAY_MAX             (0x7fffffff)
-#define CFG_ROAM_SCAN_HI_RSSI_DELAY_DEFAULT         (15000)
-
-/* Upper bound after which scan will not be performed */
-#define CFG_ROAM_SCAN_HI_RSSI_UB_NAME              "gRoamScanHiRssiUpperBound"
-#define CFG_ROAM_SCAN_HI_RSSI_UB_MIN               (-66)
-#define CFG_ROAM_SCAN_HI_RSSI_UB_MAX               (0)
-#define CFG_ROAM_SCAN_HI_RSSI_UB_DEFAULT           (-30)
-/*
- * gPNOChannelPrediction will allow user to enable/disable the
- * PNO channel prediction feature.
- * In current PNO implementation, scan is always done until all configured
- * channels are scanned. If we can determine DUT is stationary based on
- * scanning a subset of channels, we may cancel the remaining channels.
- * Hence, we can save additional power consumption.
- */
-#define CFG_PNO_CHANNEL_PREDICTION_NAME      "gPNOChannelPrediction"
-#define CFG_PNO_CHANNEL_PREDICTION_MIN       (0)
-#define CFG_PNO_CHANNEL_PREDICTION_MAX       (1)
-#define CFG_PNO_CHANNEL_PREDICTION_DEFAULT   (0)
-/*
- * The top K number of channels are used for tanimoto distance
- * calculation. These are the top channels on which the probability
- * of finding the AP's is extremely high. This number is intended
- * for tweaking the internal algorithm for experiments. This should
- * not be changed externally.
- */
-#define CFG_TOP_K_NUM_OF_CHANNELS_NAME      "gTopKNumOfChannels"
-#define CFG_TOP_K_NUM_OF_CHANNELS_MIN       (1)
-#define CFG_TOP_K_NUM_OF_CHANNELS_MAX       (5)
-#define CFG_TOP_K_NUM_OF_CHANNELS_DEFAULT   (3)
-/*
- * This is the threshold value to determine that the STA is
- * stationary. If the tanimoto distance is less than this
- * value, then the device is considered to be stationary.
- * This parameter is intended to tweak the internal algorithm
- * for experiments. This should not be changed externally.
- */
-#define CFG_STATIONARY_THRESHOLD_NAME      "gStationaryThreshold"
-#define CFG_STATIONARY_THRESHOLD_MIN       (0)
-#define CFG_STATIONARY_THRESHOLD_MAX       (100)
-#define CFG_STATIONARY_THRESHOLD_DEFAULT   (10)
-/*
- * The following parameter is the periodic timer upon which
- * a full scan needs to be triggered when PNO channel prediction
- * feature is enabled. This parameter is intended to tweak the
- * internal algortihm for experiments. This should not be changed
- * externally.
- */
-#define CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_NAME      "gChPredictionFullScanMs"
-#define CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_MIN       (30000)
-#define CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_MAX       (0x7fffffff)
-#define CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_DEFAULT   (60000)
-
-/*
- * Early stop scan is a feature for roaming to stop the scans at
- * an early stage as soon as we find a better AP to roam. This
- * would make the roaming happen quickly.
- */
-#define CFG_EARLY_STOP_SCAN_ENABLE           "gEnableEarlyStopScan"
-#define CFG_EARLY_STOP_SCAN_ENABLE_MIN       (0)
-#define CFG_EARLY_STOP_SCAN_ENABLE_MAX       (1)
-#define CFG_EARLY_STOP_SCAN_ENABLE_DEFAULT   (0)
-/*
- * Early stop scan minimum threshold is the minimum threshold
- * to be considered for stopping the scan. The algorithm starts
- * with a scan on the greedy channel list with the maximum threshold
- * and steps down the threshold by 20% for each further channel.
- * It can step down on each channel but cannot go lower than the minimum
- * threshold.
- */
-#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD           "gEarlyStopScanMinThreshold"
-#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_MIN       (-80)
-#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_MAX       (-70)
-#define CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_DEFAULT   (-78)
-/*
- * Early stop scan maximum threshold is the maximum threshold
- * at which the candidate AP should be to be qualified as a
- * potential roam candidate and good enough to stop the roaming scan
- */
-#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD           "gEarlyStopScanMaxThreshold"
-#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_MIN       (-60)
-#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_MAX       (-40)
-#define CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_DEFAULT   (-45)
-
-/*
- * This parameter will configure the first scan bucket
- * threshold to the mentioned value and all the AP's which
- * have RSSI under this threshold will fall under this
- * bucket.
- * This is a configuration item used to tweak and test the input
- * for internal algorithm. It should not be modified externally.
- */
-#define CFG_FIRST_SCAN_BUCKET_THRESHOLD_NAME      "gFirstScanBucketThreshold"
-#define CFG_FIRST_SCAN_BUCKET_THRESHOLD_MIN       (-50)
-#define CFG_FIRST_SCAN_BUCKET_THRESHOLD_MAX       (-30)
-#define CFG_FIRST_SCAN_BUCKET_THRESHOLD_DEFAULT   (-30)
-
-#ifdef FEATURE_LFR_SUBNET_DETECTION
-/*
- * Enable IP subnet detection during legacy fast roming version 3.
- * Legacy fast roaming could roam across IP subnets without host
- * processors' knowledge. This feature enables firmware to wake up
- * the host processor if it successfully determines change in the IP subnet.
- * Change in IP subnet could potentially cause disruption in IP connnectivity
- * if IP address is not refreshed.
- */
-#define CFG_ENABLE_LFR_SUBNET_DETECTION    "gLFRSubnetDetectionEnable"
-#define CFG_ENABLE_LFR_SUBNET_MIN          (0)
-#define CFG_ENABLE_LFR_SUBNET_MAX          (1)
-#define CFG_ENABLE_LFR_SUBNET_DEFAULT      (1)
-#endif /* FEATURE_LFR_SUBNET_DETECTION */
-/* Option to report rssi in cfg80211_inform_bss_frame()
- * 0 = use rssi value based on noise floor = -96 dBm
- * 1 = use rssi value based on actual noise floor in hardware
- */
-#define CFG_INFORM_BSS_RSSI_RAW_NAME               "gInformBssRssiRaw"
-#define CFG_INFORM_BSS_RSSI_RAW_MIN                (0)
-#define CFG_INFORM_BSS_RSSI_RAW_MAX                (1)
-#define CFG_INFORM_BSS_RSSI_RAW_DEFAULT            (1)
-
-#ifdef QCA_WIFI_3_0_EMU
-/*
- * On M2M emulation platform we have a fixed mapping between macs, hence
- * vdev transition & MCC support is not possible on this platform. But MPR
- * platform doesn't have these limitations. This config allows at runtime
- * enable/disable vdev transition & MCC support depending on the platform
- * it is running on
- */
-#define CFG_ENABLE_M2M_LIMITATION              "gEnableM2MLimitation"
-#define CFG_ENABLE_M2M_LIMITATION_MIN          (0)
-#define CFG_ENABLE_M2M_LIMITATION_MAX          (1)
-#define CFG_ENABLE_M2M_LIMITATION_DEFAULT      (1)
-#endif /* QCA_WIFI_3_0_EMU */
-
-/*---------------------------------------------------------------------------
-   Type declarations
-   -------------------------------------------------------------------------*/
-
-struct hdd_config {
-	/* Bitmap to track what is explicitly configured */
-	DECLARE_BITMAP(bExplicitCfg, MAX_CFG_INI_ITEMS);
-
-	/* Config parameters */
-	uint32_t RTSThreshold;
-	uint32_t FragmentationThreshold;
-	uint8_t OperatingChannel;
-	bool ShortSlotTimeEnabled;
-	bool Is11dSupportEnabled;
-	bool Is11hSupportEnabled;
-	bool fSupplicantCountryCodeHasPriority;
-	uint32_t HeartbeatThresh24;
-	char PowerUsageControl[4];
-	bool fIsImpsEnabled;
-	bool is_ps_enabled;
-	uint32_t nBmpsModListenInterval;
-	uint32_t nBmpsMaxListenInterval;
-	uint32_t nBmpsMinListenInterval;
-	eHddDot11Mode dot11Mode;
-	uint32_t nChannelBondingMode24GHz;
-	uint32_t nChannelBondingMode5GHz;
-	uint32_t MaxRxAmpduFactor;
-	uint16_t TxRate;
-	uint32_t ShortGI20MhzEnable;
-	uint32_t ScanResultAgeCount;
-	uint32_t nScanAgeTimeNCNPS;
-	uint32_t nScanAgeTimeNCPS;
-	uint32_t nScanAgeTimeCNPS;
-	uint32_t nScanAgeTimeCPS;
-	uint8_t nRssiCatGap;
-	bool fIsShortPreamble;
-	struct cdf_mac_addr IbssBssid;
-	uint32_t AdHocChannel5G;
-	uint32_t AdHocChannel24G;
-	uint8_t intfAddrMask;
-	struct cdf_mac_addr intfMacAddr[CDF_MAX_CONCURRENCY_PERSONA];
-
-	bool apUapsdEnabled;
-	bool apRandomBssidEnabled;
-	bool apProtEnabled;
-	uint16_t apProtection;
-	bool apOBSSProtEnabled;
-	bool apDisableIntraBssFwd;
-	uint8_t nEnableListenMode;
-	uint32_t nAPAutoShutOff;
-	uint8_t enableLTECoex;
-	uint32_t apKeepAlivePeriod;
-	uint32_t goKeepAlivePeriod;
-	uint32_t apLinkMonitorPeriod;
-	uint32_t goLinkMonitorPeriod;
-	uint32_t nBeaconInterval;
-	uint8_t nTxPowerCap;    /* In dBm */
-	bool fIsLowGainOverride;
-	uint8_t disablePacketFilter;
-#if defined WLAN_FEATURE_VOWIFI
-	bool fRrmEnable;
-	uint8_t nInChanMeasMaxDuration;
-	uint8_t nOutChanMeasMaxDuration;
-	uint16_t nRrmRandnIntvl;
-	/* length includes separator */
-	char rm_capability[3 * DOT11F_IE_RRMENABLEDCAP_MAX_LEN];
-#endif
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	/* Vowifi 11r params */
-	bool fFTResourceReqSupported;
-#endif
-
-	uint16_t nNeighborScanPeriod;
-	uint8_t nNeighborLookupRssiThreshold;
-	uint8_t delay_before_vdev_stop;
-	uint8_t nOpportunisticThresholdDiff;
-	uint8_t nRoamRescanRssiDiff;
-	uint8_t neighborScanChanList[WNI_CFG_VALID_CHANNEL_LIST_LEN];
-	uint16_t nNeighborScanMinChanTime;
-	uint16_t nNeighborScanMaxChanTime;
-	uint16_t nMaxNeighborReqTries;
-	uint16_t nNeighborResultsRefreshPeriod;
-	uint16_t nEmptyScanRefreshPeriod;
-	uint8_t nRoamBmissFirstBcnt;
-	uint8_t nRoamBmissFinalBcnt;
-	uint8_t nRoamBeaconRssiWeight;
-	uint32_t nhi_rssi_scan_max_count;
-	uint32_t nhi_rssi_scan_rssi_delta;
-	uint32_t nhi_rssi_scan_delay;
-	int32_t nhi_rssi_scan_rssi_ub;
-
-	/* Additional Handoff params */
-	uint32_t nRoamingTime;
-	uint16_t nVccRssiTrigger;
-	uint32_t nVccUlMacLossThreshold;
-
-	uint32_t nPassiveMinChnTime;    /* in units of milliseconds */
-	uint32_t nPassiveMaxChnTime;    /* in units of milliseconds */
-	uint32_t nActiveMinChnTime;     /* in units of milliseconds */
-	uint32_t nActiveMaxChnTime;     /* in units of milliseconds */
-
-	uint32_t nInitialDwellTime;     /* in units of milliseconds */
-	bool initial_scan_no_dfs_chnl;
-
-#ifdef WLAN_AP_STA_CONCURRENCY
-	uint32_t nPassiveMinChnTimeConc;        /* in units of milliseconds */
-	uint32_t nPassiveMaxChnTimeConc;        /* in units of milliseconds */
-	uint32_t nActiveMinChnTimeConc; /* in units of milliseconds */
-	uint32_t nActiveMaxChnTimeConc; /* in units of milliseconds */
-	uint32_t nRestTimeConc; /* in units of milliseconds */
-	uint8_t nNumStaChanCombinedConc;        /* number of channels combined for */
-	/* STA in each split scan operation */
-	uint8_t nNumP2PChanCombinedConc;        /* number of channels combined for */
-	/* P2P in each split scan operation */
-#endif
-
-	uint8_t nMaxPsPoll;
-
-	uint8_t nRssiFilterPeriod;
-	bool fIgnoreDtim;
-	uint8_t fMaxLIModulatedDTIM;
-
-	uint8_t nRxAnt;
-	uint8_t fEnableFwHeartBeatMonitoring;
-	uint8_t fEnableFwBeaconFiltering;
-	bool fEnableFwRssiMonitoring;
-	bool mcc_rts_cts_prot_enable;
-	bool mcc_bcast_prob_resp_enable;
-	uint8_t nDataInactivityTimeout;
-
-	/* WMM QoS Configuration */
-	hdd_wmm_user_mode_t WmmMode;
-	bool b80211eIsEnabled;
-	uint8_t UapsdMask;      /* what ACs to setup U-APSD for at assoc */
-	uint32_t InfraUapsdVoSrvIntv;
-	uint32_t InfraUapsdVoSuspIntv;
-	uint32_t InfraUapsdViSrvIntv;
-	uint32_t InfraUapsdViSuspIntv;
-	uint32_t InfraUapsdBeSrvIntv;
-	uint32_t InfraUapsdBeSuspIntv;
-	uint32_t InfraUapsdBkSrvIntv;
-	uint32_t InfraUapsdBkSuspIntv;
-	bool isFastRoamIniFeatureEnabled;
-	bool MAWCEnabled;
-#ifdef FEATURE_WLAN_ESE
-	uint32_t InfraInactivityInterval;
-	bool isEseIniFeatureEnabled;
-#endif
-	bool isFastTransitionEnabled;
-	uint8_t RoamRssiDiff;
-	bool isWESModeEnabled;
-#ifdef FEATURE_WLAN_OKC
-	bool isOkcIniFeatureEnabled;
-#endif
-	bool isRoamOffloadScanEnabled;
-	bool bImplicitQosEnabled;
-
-	/* default TSPEC parameters for AC_VO */
-	sme_QosWmmDirType InfraDirAcVo;
-	uint16_t InfraNomMsduSizeAcVo;
-	uint32_t InfraMeanDataRateAcVo;
-	uint32_t InfraMinPhyRateAcVo;
-	uint16_t InfraSbaAcVo;
-
-	/* default TSPEC parameters for AC_VI */
-	sme_QosWmmDirType InfraDirAcVi;
-	uint16_t InfraNomMsduSizeAcVi;
-	uint32_t InfraMeanDataRateAcVi;
-	uint32_t InfraMinPhyRateAcVi;
-	uint16_t InfraSbaAcVi;
-
-	/* default TSPEC parameters for AC_BE */
-	sme_QosWmmDirType InfraDirAcBe;
-	uint16_t InfraNomMsduSizeAcBe;
-	uint32_t InfraMeanDataRateAcBe;
-	uint32_t InfraMinPhyRateAcBe;
-	uint16_t InfraSbaAcBe;
-
-	/* default TSPEC parameters for AC_BK */
-	sme_QosWmmDirType InfraDirAcBk;
-	uint16_t InfraNomMsduSizeAcBk;
-	uint32_t InfraMeanDataRateAcBk;
-	uint32_t InfraMinPhyRateAcBk;
-	uint16_t InfraSbaAcBk;
-
-	uint32_t DelayedTriggerFrmInt;
-
-	/* Wowl pattern */
-	char wowlPattern[1024];
-
-	/* Control for Replay counetr. value 1 means
-	   single replay counter for all TID */
-	bool bSingleTidRc;
-	uint8_t mcastBcastFilterSetting;
-	bool fhostArpOffload;
-	bool ssdp;
-#ifdef FEATURE_WLAN_RA_FILTERING
-	bool IsRArateLimitEnabled;
-	uint16_t RArateLimitInterval;
-#endif
-#ifdef FEATURE_WLAN_SCAN_PNO
-	bool PnoOffload;
-#endif
-	bool fhostNSOffload;
-	bool burstSizeDefinition;
-	uint8_t tsInfoAckPolicy;
-
-	/* RF Settling Time Clock */
-	uint32_t rfSettlingTimeUs;
-
-	uint8_t dynamicPsPollValue;
-	bool AddTSWhenACMIsOff;
-	bool fValidateScanList;
-
-	uint32_t infraStaKeepAlivePeriod;
-	uint8_t nNullDataApRespTimeout;
-	uint8_t nBandCapability;
-
-	uint32_t apDataAvailPollPeriodInMs;
-	bool fEnableBeaconEarlyTermination;
-	bool teleBcnWakeupEn;
-
-/* CDF Trace Control*/
-	uint16_t cdf_trace_enable_wdi;
-	uint16_t cdf_trace_enable_hdd;
-	uint16_t cdf_trace_enable_sme;
-	uint16_t cdf_trace_enable_pe;
-	uint16_t cdf_trace_enable_pmc;
-	uint16_t cdf_trace_enable_wma;
-	uint16_t cdf_trace_enable_sys;
-	uint16_t cdf_trace_enable_cdf;
-	uint16_t cdf_trace_enable_sap;
-	uint16_t cdf_trace_enable_hdd_sap;
-	uint16_t cdf_trace_enable_bmi;
-	uint16_t cdf_trace_enable_cfg;
-	uint16_t cfd_trace_enable_txrx;
-	uint16_t cdf_trace_enable_htc;
-	uint16_t cdf_trace_enable_hif;
-	uint16_t cdf_trace_enable_hdd_sap_data;
-	uint16_t cdf_trace_enable_hdd_data;
-	uint16_t cdf_trace_enable_epping;
-	uint16_t cdf_trace_enable_cdf_devices;
-
-	uint16_t nTeleBcnTransListenInterval;
-	uint16_t nTeleBcnMaxListenInterval;
-	uint16_t nTeleBcnTransLiNumIdleBeacons;
-	uint16_t nTeleBcnMaxLiNumIdleBeacons;
-	uint8_t bcnEarlyTermWakeInterval;
-	uint32_t enableCloseLoop;
-	uint8_t enableBypass11d;
-	uint8_t enableDFSChnlScan;
-	uint8_t enable_dfs_pno_chnl_scan;
-	uint8_t enableDynamicDTIM;
-	uint8_t enableAutomaticTxPowerControl;
-	uint8_t ShortGI40MhzEnable;
-	eHddLinkSpeedReportType reportMaxLinkSpeed;
-	int32_t linkSpeedRssiHigh;
-	int32_t linkSpeedRssiMid;
-	int32_t linkSpeedRssiLow;
-	bool nRoamPrefer5GHz;
-	bool nRoamIntraBand;
-	uint8_t nProbes;
-	uint16_t nRoamScanHomeAwayTime;
-	uint8_t enableMCC;
-	uint8_t allowMCCGODiffBI;
-	bool isP2pDeviceAddrAdministrated;
-	uint8_t thermalMitigationEnable;
-	uint32_t throttlePeriod;
-	uint8_t vhtChannelWidth;
-	uint8_t vhtRxMCS;
-	uint8_t vhtTxMCS;
-	bool enableTxBF;
-	bool enable_txbf_sap_mode;
-	uint8_t txBFCsnValue;
-	bool enable_su_tx_bformer;
-	uint8_t vhtRxMCS2x2;
-	uint8_t vhtTxMCS2x2;
-	bool enable2x2;
-	bool txchainmask1x1;
-	bool rxchainmask1x1;
-	bool enableMuBformee;
-	bool enableVhtpAid;
-	bool enableVhtGid;
-	bool enableTxBFin20MHz;
-	uint8_t enableAmpduPs;
-	uint8_t enableHtSmps;
-	uint8_t htSmps;
-	uint8_t enableModulatedDTIM;
-	uint32_t fEnableMCAddrList;
-	bool enableFirstScan2GOnly;
-	bool skipDfsChnlInP2pSearch;
-	bool ignoreDynamicDtimInP2pMode;
-	bool enableRxSTBC;
-	bool enableTxSTBC;
-	bool enableRxLDPC;
-	bool enable5gEBT;
-#ifdef FEATURE_WLAN_TDLS
-	bool fEnableTDLSSupport;
-	bool fEnableTDLSImplicitTrigger;
-	uint32_t fTDLSTxStatsPeriod;
-	uint32_t fTDLSTxPacketThreshold;
-	uint32_t fTDLSMaxDiscoveryAttempt;
-	uint32_t tdls_idle_timeout;
-	uint32_t fTDLSIdlePacketThreshold;
-	int32_t fTDLSRSSITriggerThreshold;
-	int32_t fTDLSRSSITeardownThreshold;
-	int32_t fTDLSRSSIDelta;
-	uint32_t fTDLSUapsdMask;        /* what ACs to setup U-APSD for TDLS */
-	uint32_t fEnableTDLSBufferSta;
-	uint32_t fEnableTDLSSleepSta;
-	uint32_t fTDLSPuapsdInactivityTimer;
-	uint32_t fTDLSRxFrameThreshold;
-	uint32_t fTDLSPuapsdPTIWindow;
-	uint32_t fTDLSPuapsdPTRTimeout;
-	bool fTDLSExternalControl;
-	uint32_t fEnableTDLSOffChannel;
-	uint32_t fEnableTDLSWmmMode;
-	uint8_t fTDLSPrefOffChanNum;
-	uint8_t fTDLSPrefOffChanBandwidth;
-	uint8_t enable_tdls_scan;
-	uint32_t tdls_peer_kickout_threshold;
-#endif
-#ifdef WLAN_SOFTAP_VSTA_FEATURE
-	bool fEnableVSTASupport;
-#endif
-	uint32_t enableLpwrImgTransition;
-	uint8_t scanAgingTimeout;
-	bool enableTxLdpc;
-	uint8_t disableLDPCWithTxbfAP;
-	uint8_t enableMCCAdaptiveScheduler;
-	bool isAndroidPsEn;
-	bool sapAllowAllChannel;
-	uint8_t retryLimitZero;
-	uint8_t retryLimitOne;
-	uint8_t retryLimitTwo;
-	bool enableSSR;
-	uint32_t cfgMaxMediumTime;
-	bool enableVhtFor24GHzBand;
-	/* Flag indicating whether legacy fast roam during concurrency is enabled in cfg.ini or not */
-	bool bFastRoamInConIniFeatureEnabled;
-	bool fEnableAdaptRxDrain;
-	uint8_t flexConnectPowerFactor;
-	bool enableIbssHeartBeatOffload;
-	uint32_t antennaDiversity;
-	bool fEnableSNRMonitoring;
-	/*PNO related parameters */
-#ifdef FEATURE_WLAN_SCAN_PNO
-	bool configPNOScanSupport;
-	uint32_t configPNOScanTimerRepeatValue;
-	uint32_t pno_slow_scan_multiplier;
-#endif
-	uint8_t isAmsduSupportInAMPDU;
-	uint8_t nSelect5GHzMargin;
-	uint8_t isCoalesingInIBSSAllowed;
-
-	/* IBSS Power Save related parameters */
-	uint32_t ibssATIMWinSize;
-	uint8_t isIbssPowerSaveAllowed;
-	uint8_t isIbssPowerCollapseAllowed;
-	uint8_t isIbssAwakeOnTxRx;
-	uint32_t ibssInactivityCount;
-	uint32_t ibssTxSpEndInactivityTime;
-	uint32_t ibssPsWarmupTime;
-	uint32_t ibssPs1RxChainInAtimEnable;
-
-	bool enable_ip_tcp_udp_checksum_offload;
-	bool enablePowersaveOffload;
-	bool enablefwprint;
-	bool enablefwlog;
-#ifdef WLAN_FEATURE_11AC
-	uint8_t fVhtAmpduLenExponent;
-	uint32_t vhtMpduLen;
-#endif
-	uint32_t IpaConfig;
-	bool IpaClkScalingEnable;
-	uint32_t IpaDescSize;
-	uint32_t IpaHighBandwidthMbps;
-	uint32_t IpaMediumBandwidthMbps;
-	uint32_t IpaLowBandwidthMbps;
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-	uint32_t WlanMccToSccSwitchMode;
-#endif
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-	uint32_t WlanAutoShutdown;
-#endif
-	uint8_t maxWoWFilters;
-	uint8_t wowEnable;
-	uint8_t maxNumberOfPeers;
-	uint8_t disableDFSChSwitch;
-	uint8_t enableDFSMasterCap;
-	uint16_t thermalTempMinLevel0;
-	uint16_t thermalTempMaxLevel0;
-	uint16_t thermalTempMinLevel1;
-	uint16_t thermalTempMaxLevel1;
-	uint16_t thermalTempMinLevel2;
-	uint16_t thermalTempMaxLevel2;
-	uint16_t thermalTempMinLevel3;
-	uint16_t thermalTempMaxLevel3;
-	uint32_t TxPower2g;
-	uint32_t TxPower5g;
-	uint32_t gEnableDebugLog;
-	uint8_t enableRxThread;
-	bool fDfsPhyerrFilterOffload;
-	uint8_t gSapPreferredChanLocation;
-	uint8_t gDisableDfsJapanW53;
-	bool gEnableOverLapCh;
-	bool fRegChangeDefCountry;
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-	uint32_t TxFlowLowWaterMark;
-	uint32_t TxFlowHighWaterMarkOffset;
-	uint32_t TxFlowMaxQueueDepth;
-	uint32_t TxLbwFlowLowWaterMark;
-	uint32_t TxLbwFlowHighWaterMarkOffset;
-	uint32_t TxLbwFlowMaxQueueDepth;
-	uint32_t TxHbwFlowLowWaterMark;
-	uint32_t TxHbwFlowHighWaterMarkOffset;
-	uint32_t TxHbwFlowMaxQueueDepth;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
-	uint32_t TxFlowStopQueueThreshold;
-	uint32_t TxFlowStartQueueOffset;
-#endif
-	uint8_t apMaxOffloadPeers;
-	uint8_t apMaxOffloadReorderBuffs;
-	bool advertiseConcurrentOperation;
-	bool enableMemDeepSleep;
-
-	uint32_t defaultRateIndex24Ghz;
-#ifdef MEMORY_DEBUG
-	bool IsMemoryDebugSupportEnabled;
-#endif
-
-	uint8_t allowDFSChannelRoam;
-
-	bool debugP2pRemainOnChannel;
-
-	bool enablePacketLog;
-#ifdef MSM_PLATFORM
-	uint32_t busBandwidthHighThreshold;
-	uint32_t busBandwidthMediumThreshold;
-	uint32_t busBandwidthLowThreshold;
-	uint32_t busBandwidthComputeInterval;
-	uint32_t tcpDelackThresholdHigh;
-	uint32_t tcpDelackThresholdLow;
-	uint32_t tcp_tx_high_tput_thres;
-#endif /* MSM_PLATFORM */
-
-	/* FW debug log parameters */
-	uint32_t enableFwLogType;
-	uint32_t enableFwLogLevel;
-	uint8_t enableFwModuleLogLevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
-
-#ifdef WLAN_FEATURE_11W
-	uint32_t pmfSaQueryMaxRetries;
-	uint32_t pmfSaQueryRetryInterval;
-#endif
-
-	uint8_t gMaxConcurrentActiveSessions;
-
-	uint8_t ignoreCAC;
-	bool IsSapDfsChSifsBurstEnabled;
-
-#ifdef FEATURE_GREEN_AP
-	bool enableGreenAP;
-	bool enable_egap;
-	uint32_t egap_feature_flag;
-	uint32_t egap_inact_time;
-	uint32_t egap_wait_time;
-#endif
-	uint8_t force_sap_acs;
-	uint8_t force_sap_acs_st_ch;
-	uint8_t force_sap_acs_end_ch;
-
-	int32_t dfsRadarPriMultiplier;
-	uint8_t reorderOffloadSupport;
-
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	bool isRoamOffloadEnabled;
-#endif
-
-	uint32_t IpaUcTxBufCount;
-	uint32_t IpaUcTxBufSize;
-	uint32_t IpaUcRxIndRingCount;
-	uint32_t IpaUcTxPartitionBase;
-#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-	/* WLAN Logging */
-	uint32_t wlanLoggingEnable;
-	uint32_t wlanLoggingFEToConsole;
-	uint32_t wlanLoggingNumBuf;
-#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */
-
-	bool enableSifsBurst;
-
-#ifdef WLAN_FEATURE_LPSS
-	bool enablelpasssupport;
-#endif
-#ifdef WLAN_FEATURE_NAN
-	bool enable_nan_support;
-#endif
-	bool enableSelfRecovery;
-#ifdef FEATURE_WLAN_FORCE_SAP_SCC
-	uint8_t SapSccChanAvoidance;
-#endif /* FEATURE_WLAN_FORCE_SAP_SCC */
-
-	bool enableSapSuspend;
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-	uint8_t extWowGotoSuspend;
-	uint8_t extWowApp1WakeupPinNumber;
-	uint8_t extWowApp2WakeupPinNumber;
-	uint32_t extWowApp2KAInitPingInterval;
-	uint32_t extWowApp2KAMinPingInterval;
-	uint32_t extWowApp2KAMaxPingInterval;
-	uint32_t extWowApp2KAIncPingInterval;
-	uint16_t extWowApp2TcpSrcPort;
-	uint16_t extWowApp2TcpDstPort;
-	uint32_t extWowApp2TcpTxTimeout;
-	uint32_t extWowApp2TcpRxTimeout;
-#endif
-	bool gEnableDeauthToDisassocMap;
-#ifdef DHCP_SERVER_OFFLOAD
-	bool enableDHCPServerOffload;
-	uint32_t dhcpMaxNumClients;
-	uint8_t dhcpServerIP[IPADDR_STRING_LENGTH];
-#endif /* DHCP_SERVER_OFFLOAD */
-	bool enable_mac_spoofing;
-	uint8_t conc_custom_rule1;
-	uint8_t conc_custom_rule2;
-	uint8_t is_sta_connection_in_5gz_enabled;
-	uint16_t p2p_listen_defer_interval;
-	uint32_t sta_miracast_mcc_rest_time_val;
-	bool is_ramdump_enabled;
-#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-	bool sap_channel_avoidance;
-#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
-	uint8_t sap_p2p_11ac_override;
-	uint8_t sap_dot11mc;
-	uint8_t prefer_non_dfs_on_radar;
-	bool ignore_peer_erp_info;
-	uint8_t multicast_host_fw_msgs;
-	uint8_t conc_system_pref;
-	bool sendDeauthBeforeCon;
-	bool policy_manager_enabled;
-	bool tso_enable;
-	bool lro_enable;
-	bool active_mode_offload;
-	uint32_t fine_time_meas_cap;
-	uint8_t max_scan_count;
-#ifdef WLAN_FEATURE_FASTPATH
-	bool fastpath_enable;
-#endif
-	uint8_t dot11p_mode;
-#ifdef FEATURE_NAPI
-	bool napi_enable;
-#endif
-#ifdef FEATURE_WLAN_EXTSCAN
-	uint32_t extscan_passive_max_chn_time;
-	uint32_t extscan_passive_min_chn_time;
-	uint32_t extscan_active_max_chn_time;
-	uint32_t extscan_active_min_chn_time;
-#endif
-	bool ce_classify_enabled;
-	uint32_t dual_mac_feature_disable;
-	bool     tx_chain_mask_cck;
-	uint8_t  tx_chain_mask_1ss;
-	uint16_t  self_gen_frm_pwr;
-#ifdef FEATURE_WLAN_SCAN_PNO
-	bool pno_channel_prediction;
-	uint8_t top_k_num_of_channels;
-	uint8_t stationary_thresh;
-	uint32_t channel_prediction_full_scan;
-#endif
-	bool early_stop_scan_enable;
-	int8_t early_stop_scan_min_threshold;
-	int8_t early_stop_scan_max_threshold;
-	int8_t first_scan_bucket_threshold;
-	uint8_t ht_mpdu_density;
-#ifdef FEATURE_LFR_SUBNET_DETECTION
-	bool enable_lfr_subnet_detection;
-#endif
-	uint8_t inform_bss_rssi_raw;
-#ifdef QCA_WIFI_3_0_EMU
-	bool enable_m2m_limitation;
-#endif
-};
-
-#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
-#define VAR_SIZE(_Struct, _Var) (sizeof(((_Struct *)0)->_Var))
-
-#define VAR_FLAGS_NONE         (0)
-
-/* bit 0 is Required or Optional */
-#define VAR_FLAGS_REQUIRED     (1 << 0)
-#define VAR_FLAGS_OPTIONAL     (0 << 0)
-
-/*
- * bit 1 tells if range checking is required.
- * If less than MIN, assume MIN.
- * If greater than MAX, assume MAX.
- */
-#define VAR_FLAGS_RANGE_CHECK  (1 << 1)
-#define VAR_FLAGS_RANGE_CHECK_ASSUME_MINMAX (VAR_FLAGS_RANGE_CHECK)
-
-/*
- * bit 2 is range checking that assumes the DEFAULT value
- * If less than MIN, assume DEFAULT,
- * If greater than MAX, assume DEFAULT.
- */
-#define VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT (1 << 2)
-
-/*
- * Bit 3 indicates that the config item can be modified dynamicially
- * on a running system
- */
-#define VAR_FLAGS_DYNAMIC_CFG (1 << 3)
-
-typedef enum {
-	WLAN_PARAM_Integer,
-	WLAN_PARAM_SignedInteger,
-	WLAN_PARAM_HexInteger,
-	WLAN_PARAM_String,
-	WLAN_PARAM_MacAddr,
-} WLAN_PARAMETER_TYPE;
-
-#define REG_VARIABLE(_Name, _Type,  _Struct, _VarName,		\
-		      _Flags, _Default, _Min, _Max)		\
-	{							\
-		(_Name),					\
-		(_Type),					\
-		(_Flags),					\
-		VAR_OFFSET(_Struct, _VarName),			\
-		VAR_SIZE(_Struct, _VarName),			\
-		(_Default),					\
-		(_Min),						\
-		(_Max),						\
-		NULL,						\
-		0						\
-	}
-
-#define REG_DYNAMIC_VARIABLE(_Name, _Type,  _Struct, _VarName,	\
-			      _Flags, _Default, _Min, _Max,	\
-			      _CBFunc, _CBParam)		\
-	{							\
-		(_Name),					\
-		(_Type),					\
-		(VAR_FLAGS_DYNAMIC_CFG | (_Flags)),		\
-		VAR_OFFSET(_Struct, _VarName),			\
-		VAR_SIZE(_Struct, _VarName),			\
-		(_Default),					\
-		(_Min),						\
-		(_Max),						\
-		(_CBFunc),					\
-		(_CBParam)					\
-	}
-
-#define REG_VARIABLE_STRING(_Name, _Type,  _Struct, _VarName,	\
-			     _Flags, _Default)			\
-	{							\
-		(_Name),					\
-		(_Type),					\
-		(_Flags),					\
-		VAR_OFFSET(_Struct, _VarName),			\
-		VAR_SIZE(_Struct, _VarName),			\
-		(unsigned long)(_Default),			\
-		0,						\
-		0,						\
-		NULL,						\
-		0						\
-	}
-
-typedef struct tREG_TABLE_ENTRY {
-
-	char *RegName;          /* variable name in the qcom_cfg.ini file */
-	WLAN_PARAMETER_TYPE RegType;    /* variable type in hdd_config struct */
-	unsigned long Flags;    /* Specify optional parms and if RangeCheck is performed */
-	unsigned short VarOffset;       /* offset to field from the base address of the structure */
-	unsigned short VarSize; /* size (in bytes) of the field */
-	unsigned long VarDefault;       /* default value to use */
-	unsigned long VarMin;   /* minimum value, for range checking */
-	unsigned long VarMax;   /* maximum value, for range checking */
-	/* Dynamic modification notifier */
-	void (*pfnDynamicnotify)(hdd_context_t *pHddCtx,
-				 unsigned long notifyId);
-	unsigned long notifyId; /* Dynamic modification identifier */
-} REG_TABLE_ENTRY;
-
-static __inline unsigned long util_min(unsigned long a, unsigned long b)
-{
-	unsigned long r;
-
-	r = ((a < b) ? a : b);
-	return r;
-}
-
-/* Function declarations and documenation */
-CDF_STATUS hdd_parse_config_ini(hdd_context_t *pHddCtx);
-CDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx);
-CDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx);
-CDF_STATUS hdd_set_sme_chan_list(hdd_context_t *hdd_ctx);
-bool hdd_update_config_dat(hdd_context_t *pHddCtx);
-CDF_STATUS hdd_cfg_get_global_config(hdd_context_t *pHddCtx, char *pBuf,
-				     int buflen);
-
-eCsrPhyMode hdd_cfg_xlate_to_csr_phy_mode(eHddDot11Mode dot11Mode);
-CDF_STATUS hdd_execute_global_config_command(hdd_context_t *pHddCtx,
-					     char *command);
-
-bool hdd_is_okc_mode_enabled(hdd_context_t *pHddCtx);
-CDF_STATUS hdd_set_idle_ps_config(hdd_context_t *pHddCtx, uint32_t val);
-
-void hdd_update_tgt_cfg(void *context, void *param);
-bool hdd_dfs_indicate_radar(void *context, void *param);
-
-CDF_STATUS hdd_string_to_u8_array(char *str, uint8_t *intArray, uint8_t *len,
-				  uint8_t intArrayMaxLen);
-CDF_STATUS hdd_hex_string_to_u16_array(char *str, uint16_t *int_array,
-				uint8_t *len, uint8_t int_array_max_len);
-
-void hdd_cfg_print(hdd_context_t *pHddCtx);
-
-CDF_STATUS hdd_update_nss(hdd_context_t *hdd_ctx, uint8_t nss);
-#ifdef FEATURE_WLAN_SCAN_PNO
-void hdd_set_pno_channel_prediction_config(
-	tpSmeConfigParams sme_config, hdd_context_t *hdd_ctx);
-#else
-static inline void hdd_set_pno_channel_prediction_config(
-	tpSmeConfigParams sme_config, hdd_context_t *hdd_ctx)
-{}
-#endif
-
-#endif

+ 0 - 79
core/hdd/inc/wlan_hdd_conc_ut.h

@@ -1,79 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_CONC_UT_H
-#define __WLAN_HDD_CONC_UT_H
-
-/* Include files */
-
-#include "wlan_hdd_main.h"
-#include "cds_concurrency.h"
-#ifdef MPC_UT_FRAMEWORK
-void clean_report(hdd_context_t *hdd_ctx);
-void fill_report(hdd_context_t *hdd_ctx, char *title,
-	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
-	uint32_t chnl_1st_conn, uint32_t chnl_2nd_conn, uint32_t chnl_3rd_conn,
-	bool status, enum cds_pcl_type pcl_type, char *reason, uint8_t *pcl);
-void print_report(hdd_context_t *hdd_ctx);
-void wlan_hdd_one_connection_scenario(hdd_context_t *hdd_ctx);
-void wlan_hdd_two_connections_scenario(hdd_context_t *hdd_ctx,
-	uint8_t first_chnl, enum cds_chain_mode first_chain_mask);
-void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
-	uint8_t first_chnl, uint8_t second_chnl,
-	enum cds_chain_mode chain_mask, uint8_t use_same_mac);
-#else
-static inline void clean_report(hdd_context_t *hdd_ctx)
-{
-}
-
-static inline void fill_report(hdd_context_t *hdd_ctx, char *title,
-	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
-	uint32_t chnl_1st_conn, uint32_t chnl_2nd_conn, uint32_t chnl_3rd_conn,
-	bool status, enum hdd_pcl_type pcl_type, char *reason, uint8_t *pcl)
-{
-}
-
-static inline void print_report(hdd_context_t *hdd_ctx)
-{
-}
-
-static inline void wlan_hdd_one_connection_scenario(hdd_context_t *hdd_ctx)
-{
-}
-
-static inline void wlan_hdd_two_connections_scenario(hdd_context_t *hdd_ctx,
-		uint8_t first_chnl, enum hdd_chain_mode first_chain_mask)
-{
-}
-
-static inline void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
-		uint8_t first_chnl, uint8_t second_chnl,
-		enum hdd_chain_mode chain_mask, uint8_t use_same_mac)
-{
-}
-#endif
-#endif

+ 0 - 44
core/hdd/inc/wlan_hdd_debugfs.h

@@ -1,44 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _WLAN_HDD_DEBUGFS_H
-#define _WLAN_HDD_DEBUGFS_H
-
-#ifdef WLAN_OPEN_SOURCE
-CDF_STATUS hdd_debugfs_init(hdd_adapter_t *pAdapter);
-void hdd_debugfs_exit(hdd_context_t *pHddCtx);
-#else
-inline CDF_STATUS hdd_debugfs_init(hdd_adapter_t *pAdapter)
-{
-	return CDF_STATUS_SUCCESS;
-}
-
-inline void hdd_debugfs_exit(hdd_context_t *pHddCtx)
-{
-}
-#endif /* #ifdef WLAN_OPEN_SOURCE */
-#endif /* #ifndef _WLAN_HDD_DEBUGFS_H */

+ 0 - 39
core/hdd/inc/wlan_hdd_driver_ops.h

@@ -1,39 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_DRIVER_OPS_H__
-#define __WLAN_HDD_DRIVER_OPS_H__
-
-/**
- * DOC: wlan_hdd_driver_ops.h
- *
- * Functions to register the wlan driver.
-*/
-int wlan_hdd_register_driver(void);
-void wlan_hdd_unregister_driver(void);
-int wlan_hdd_bus_suspend(pm_message_t state);
-#endif /* __WLAN_HDD_DRIVER_OPS_H__ */

+ 0 - 89
core/hdd/inc/wlan_hdd_ether.h

@@ -1,89 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _WLAN_HDD_ETHER_H
-#define _WLAN_HDD_ETHER_H
-/*============================================================================
-   @file wlan_hdd_ether.h
-
-   This module describes Ethernet packet formats for processing by HDD.
-   ============================================================================*/
-/* $Header$ */
-
-/*----------------------------------------------------------------------------
- * Include Files
- * -------------------------------------------------------------------------*/
-#include <linux/version.h>
-#include <linux/byteorder/generic.h>
-#include <linux/if_ether.h>
-#include <linux/if_vlan.h>
-
-/*----------------------------------------------------------------------------
- * Preprocessor Definitions and Constants
- * -------------------------------------------------------------------------*/
-#define WLAN_SNAP_OUI_LEN 3
-#define WLAN_SNAP_DSAP 0xAAU
-#define WLAN_SNAP_SSAP 0xAAU
-#define WLAN_SNAP_CTRL 0x03
-#define WLAN_MIN_PROTO 0x0600
-
-/*----------------------------------------------------------------------------
- * Type Declarations
- * -------------------------------------------------------------------------*/
-struct wlan_snap_hdr {
-	unsigned char dsap;
-	unsigned char ssap;
-	unsigned char ctrl;
-	unsigned char oui[WLAN_SNAP_OUI_LEN];
-} __packed;
-
-struct wlan_8023 {
-	unsigned char h_dest[ETH_ALEN];
-	unsigned char h_source[ETH_ALEN];
-	__be16 h_len;
-	struct wlan_snap_hdr h_snap;
-	__be16 h_proto;
-} __packed;
-
-struct wlan_8023_vlan {
-	unsigned char h_dest[ETH_ALEN];
-	unsigned char h_source[ETH_ALEN];
-	__be16 h_vlan_proto;
-	__be16 h_vlan_TCI;
-	__be16 h_len;
-	struct wlan_snap_hdr h_snap;
-	__be16 h_proto;
-} __packed;
-
-union generic_ethhdr {
-	struct ethhdr eth_II;
-	struct vlan_ethhdr eth_IIv;
-	struct wlan_8023 eth_8023;
-	struct wlan_8023_vlan eth_8023v;
-};
-
-#endif /* #ifndef _WLAN_HDD_ETHER_H */

+ 0 - 68
core/hdd/inc/wlan_hdd_ftm.h

@@ -1,68 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef WLAN_HDD_FTM_H
-#define WLAN_HDD_FTM_H
-
-/**
- * DOC: wlan_hdd_ftm.h
- *
- * WLAN Host Device Driver Factory Test Mode header file
- */
-
-#include "cdf_status.h"
-#include "cds_mq.h"
-#include "cds_api.h"
-#include "msg.h"
-#include "cdf_types.h"
-#include <wlan_ptt_sock_svc.h>
-
-enum wlan_hdd_ftm_state {
-	WLAN_FTM_INITIALIZED,
-	WLAN_FTM_STOPPED,
-	WLAN_FTM_STARTED,
-};
-
-/**
- * struct wlan_hdd_ftm_status - FTM status
- * @ftm_state: The current state of the FTM process
- */
-struct wlan_hdd_ftm_status {
-	enum wlan_hdd_ftm_state ftm_state;
-};
-
-int wlan_hdd_ftm_open(hdd_context_t *hdd_ctx);
-int wlan_hdd_ftm_close(hdd_context_t *hdd_ctx);
-
-#if  defined(QCA_WIFI_FTM)
-CDF_STATUS wlan_hdd_ftm_testmode_cmd(void *data, int len);
-int wlan_hdd_qcmbr_unified_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr);
-int hdd_ftm_start(hdd_context_t *hdd_ctx);
-int hdd_ftm_stop(hdd_context_t *hdd_ctx);
-#endif
-
-#endif

+ 0 - 60
core/hdd/inc/wlan_hdd_host_offload.h

@@ -1,60 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_HOST_OFFLOAD_H__
-#define __WLAN_HDD_HOST_OFFLOAD_H__
-
-/**===========================================================================
-
-   \file  wlan_hdd_host_offload.h
-
-   \brief Android WLAN HDD Host Offload API
-
-   ==========================================================================*/
-
-/* Offload types. */
-#define WLAN_IPV4_ARP_REPLY_OFFLOAD           0
-#define WLAN_IPV6_NEIGHBOR_DISCOVERY_OFFLOAD  1
-
-/* Enable or disable offload. */
-#define WLAN_OFFLOAD_DISABLE                     0
-#define WLAN_OFFLOAD_ENABLE                      0x1
-#define WLAN_OFFLOAD_BC_FILTER_ENABLE            0x2
-#define WLAN_OFFLOAD_ARP_AND_BC_FILTER_ENABLE    (WLAN_OFFLOAD_ENABLE | WLAN_OFFLOAD_BC_FILTER_ENABLE)
-
-/* Offload request. */
-typedef struct {
-	uint8_t offloadType;
-	uint8_t enableOrDisable;
-	union {
-		uint8_t hostIpv4Addr[SIR_IPV4_ADDR_LEN];
-		uint8_t hostIpv6Addr[SIR_MAC_IPV6_ADDR_LEN];
-	} params;
-	struct cdf_mac_addr bssId;
-} tHostOffloadRequest, *tpHostOffloadRequest;
-
-#endif /* __WLAN_HDD_HOST_OFFLOAD_H__ */

+ 0 - 69
core/hdd/inc/wlan_hdd_includes.h

@@ -1,69 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(HDD_INCLUDES_H__)
-#define HDD_INCLUDES_H__
-
-/**===========================================================================
-
-   \file  wlan_hdd_includes.h
-
-   \brief Internal includes for the Linux HDD
-
-   ==========================================================================*/
-
-/* $HEADER$ */
-
-/*---------------------------------------------------------------------------
-   Include files
-   -------------------------------------------------------------------------*/
-
-/* throw all the includes in here f to get the .c files  in the HDD to compile. */
-
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/wireless.h>
-#include <linux/if_arp.h>
-#include "ol_txrx_ctrl_api.h"
-#include <cds_api.h>
-#include <sme_api.h>
-#include "wlan_hdd_assoc.h"
-#include "wlan_hdd_mib.h"
-#include "wlan_hdd_wext.h"
-#include "wlan_hdd_main.h"
-#include "wlan_hdd_tx_rx.h"
-
-
-#ifdef FEATURE_OEM_DATA_SUPPORT
-/*include for oem data req specific structures*/
-/*and function declarations*/
-#include "wlan_hdd_oemdata.h"
-#endif
-
-#endif /* end #if !defined(HDD_INCLUDES_H__) */

+ 0 - 171
core/hdd/inc/wlan_hdd_ipa.h

@@ -1,171 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef HDD_IPA_H__
-#define HDD_IPA_H__
-
-/**
- * DOC: wlan_hdd_ipa.h
- *
- * WLAN IPA interface module headers
- * Originally written by Qualcomm Atheros, Inc
- */
-
-#include <linux/ipa.h>
-
-#ifdef IPA_OFFLOAD
-/* Include files */
-CDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx);
-CDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx);
-CDF_STATUS hdd_ipa_process_rxt(void *cds_context, cdf_nbuf_t rxBuf,
-	uint8_t sta_id);
-int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
-	enum ipa_wlan_event type, uint8_t *mac_addr);
-int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets,
-	uint64_t rx_packets);
-int hdd_ipa_suspend(hdd_context_t *hdd_ctx);
-int hdd_ipa_resume(hdd_context_t *hdd_ctx);
-void hdd_ipa_uc_stat_query(hdd_context_t *hdd_ctx, uint32_t *ipa_tx_diff,
-	uint32_t *ipa_rx_diff);
-void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx);
-void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason);
-bool hdd_ipa_is_enabled(hdd_context_t *pHddCtx);
-bool hdd_ipa_uc_is_enabled(hdd_context_t *pHddCtx);
-int hdd_ipa_send_mcc_scc_msg(hdd_context_t *pHddCtx, bool mcc_mode);
-int hdd_ipa_uc_ssr_reinit(void);
-int hdd_ipa_uc_ssr_deinit(void);
-void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx);
-struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx,
-	struct sk_buff *skb, uint8_t session_id);
-#else
-static inline CDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx)
-{
-	return CDF_STATUS_SUCCESS;
-}
-
-static inline CDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx)
-{
-	return CDF_STATUS_SUCCESS;
-}
-
-static inline CDF_STATUS hdd_ipa_process_rxt(void *cds_context,
-	cdf_nbuf_t rxBuf, uint8_t sta_id)
-{
-	return CDF_STATUS_SUCCESS;
-}
-
-static inline int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
-	enum ipa_wlan_event type, uint8_t *mac_addr)
-{
-	return 0;
-}
-
-static inline int hdd_ipa_send_mcc_scc_msg(hdd_context_t *hdd_ctx,
-	bool mcc_mode)
-{
-	return 0;
-}
-
-static inline int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx,
-	uint64_t tx_packets,
-	uint64_t rx_packets)
-{
-	return 0;
-}
-
-static inline int hdd_ipa_suspend(hdd_context_t *hdd_ctx)
-{
-	return 0;
-}
-
-static inline int hdd_ipa_resume(hdd_context_t *hdd_ctx)
-{
-	return 0;
-}
-
-static inline void hdd_ipa_uc_stat_query(hdd_context_t *hdd_ctx,
-	uint32_t *ipa_tx_diff,
-	uint32_t *ipa_rx_diff)
-{
-	*ipa_tx_diff = 0;
-	*ipa_rx_diff = 0;
-	return;
-}
-
-static inline void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter,
-	uint8_t reason)
-{
-	return;
-}
-
-static inline void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx)
-{
-	return;
-}
-
-static inline bool hdd_ipa_is_enabled(hdd_context_t *pHddCtx)
-{
-	return false;
-}
-
-static inline bool hdd_ipa_uc_is_enabled(hdd_context_t *pHddCtx)
-{
-	return false;
-}
-static inline int hdd_ipa_uc_ssr_reinit(void)
-{
-	return false;
-}
-
-static inline int hdd_ipa_uc_ssr_deinit(void)
-{
-	return false;
-}
-static inline void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx)
-{
-	return;
-}
-
-/**
- * hdd_ipa_tx_packet_ipa() - send packet to IPA
- * @hdd_ctx:    Global HDD context
- * @skb:        skb sent to IPA
- * @session_id: send packet instance session id
- *
- * Send TX packet which generated by system to IPA.
- * This routine only will be used for function verification
- *
- * Return: NULL packet sent to IPA properly
- *         skb packet not sent to IPA. legacy data path should handle
- */
-static inline struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx,
-	struct sk_buff *skb, uint8_t session_id)
-{
-	return skb;
-}
-#endif /* IPA_OFFLOAD */
-#endif /* #ifndef HDD_IPA_H__ */

+ 0 - 145
core/hdd/inc/wlan_hdd_lro.h

@@ -1,145 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_LRO_H__
-#define __WLAN_HDD_LRO_H__
-/**
- * DOC: wlan_hdd_lro.h
- *
- * WLAN LRO interface module headers
- */
-
-/**
- * enum hdd_lro_rx_status - LRO receive frame status
- * @HDD_LRO_RX: frame sent over the LRO interface
- * @HDD_LRO_NO_RX: frame not sent over the LRO interface
- */
-enum hdd_lro_rx_status {
-	HDD_LRO_RX = 0,
-	HDD_LRO_NO_RX = 1,
-};
-
-#if defined(FEATURE_LRO)
-
-#include <linux/inet_lro.h>
-#include <linux/list.h>
-
-/* LRO_DESC_TABLE_SZ must be a power of 2 */
-#define LRO_DESC_TABLE_SZ 16
-#define LRO_DESC_TABLE_SZ_MASK (LRO_DESC_TABLE_SZ - 1)
-#define LRO_DESC_POOL_SZ 10
-
-/**
- * hdd_lro_desc_entry - defines the LRO descriptor
- * element stored in the list
- * @lro_node: node of the list
- * @lro_desc: the LRO descriptor contained in this list entry
- */
-struct hdd_lro_desc_entry {
-	struct list_head lro_node;
-	struct net_lro_desc *lro_desc;
-};
-
-/**
- * hdd_lro_desc_pool - pool of free LRO descriptors
- * @lro_desc_array: array of LRO descriptors allocated
- * @lro_free_list_head: head of the list
- * @lro_pool_lock: lock to protect access to the list
- */
-struct hdd_lro_desc_pool {
-	struct hdd_lro_desc_entry *lro_desc_array;
-	struct list_head lro_free_list_head;
-	cdf_spinlock_t lro_pool_lock;
-};
-
-/**
- * hdd_lro_desc_table - defines each entry of the LRO
- * hash table
- * @lro_desc_list: list of LRO descriptors
- */
-struct hdd_lro_desc_table {
-	struct list_head lro_desc_list;
-};
-
-/**
- * hdd_lro_desc_info - structure containing the LRO
- * descriptor information
- * @lro_hash_table: hash table used for a quick desc. look-up
- * @lro_hash_lock: lock to protect access to the hash table
- * @lro_desc_pool: Free pool of LRO descriptors
- */
-struct hdd_lro_desc_info {
-	struct hdd_lro_desc_table *lro_hash_table;
-	cdf_spinlock_t lro_hash_lock;
-	struct hdd_lro_desc_pool lro_desc_pool;
-};
-
-/**
- * hdd_lro_s - LRO information per HDD adapter
- * @lro_mgr: LRO manager
- * @lro_desc_info: LRO descriptor information
- */
-struct hdd_lro_s {
-	struct net_lro_mgr *lro_mgr;
-	struct hdd_lro_desc_info lro_desc_info;
-};
-
-int hdd_lro_init(hdd_context_t *hdd_ctx);
-
-int hdd_lro_enable(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter);
-
-void hdd_lro_disable(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter);
-
-enum hdd_lro_rx_status hdd_lro_rx(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter, struct sk_buff *skb);
-
-void hdd_lro_flush_all(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter);
-#else
-struct hdd_lro_s {};
-
-static inline int hdd_lro_enable(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter)
-{
-	return 0;
-}
-
-static inline enum hdd_lro_rx_status hdd_lro_rx(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter, struct sk_buff *skb)
-{
-	return HDD_LRO_NO_RX;
-}
-
-static inline int hdd_lro_init(hdd_context_t *hdd_ctx)
-{
-	return 0;
-}
-
-static inline void hdd_lro_disable(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter){}
-#endif /* FEATURE_LRO */
-#endif /* __WLAN_HDD_LRO_H__ */

+ 0 - 1529
core/hdd/inc/wlan_hdd_main.h

@@ -1,1529 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_MAIN_H)
-#define WLAN_HDD_MAIN_H
-/**===========================================================================
-
-   \file  WLAN_HDD_MAIN_H.h
-
-   \brief Linux HDD Adapter Type
-
-   ==========================================================================*/
-
-/*---------------------------------------------------------------------------
-   Include files
-   -------------------------------------------------------------------------*/
-
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <net/cfg80211.h>
-#include <cdf_list.h>
-#include <cdf_types.h>
-#include "sir_mac_prot_def.h"
-#include "csr_api.h"
-#include <wlan_hdd_assoc.h>
-#include <wlan_hdd_wmm.h>
-#include <wlan_hdd_cfg.h>
-#include <linux/spinlock.h>
-#if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)
-#include <linux/wakelock.h>
-#endif
-#include <wlan_hdd_ftm.h>
-#ifdef FEATURE_WLAN_TDLS
-#include "wlan_hdd_tdls.h"
-#endif
-#include "wlan_hdd_cfg80211.h"
-#include <cdf_defer.h>
-#ifdef WLAN_FEATURE_MBSSID
-#include "sap_api.h"
-#endif
-#include "ol_txrx_osif_api.h"
-#include "ol_txrx_ctrl_api.h"
-#include <wlan_hdd_lro.h>
-
-/*---------------------------------------------------------------------------
-   Preprocessor definitions and constants
-   -------------------------------------------------------------------------*/
-/** Number of Tx Queues */
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
-#define NUM_TX_QUEUES 5
-#else
-#define NUM_TX_QUEUES 4
-#endif
-
-/** Length of the TX queue for the netdev */
-#define HDD_NETDEV_TX_QUEUE_LEN (3000)
-
-/** Hdd Tx Time out value */
-#ifdef LIBRA_LINUX_PC
-#define HDD_TX_TIMEOUT          (8000)
-#else
-#define HDD_TX_TIMEOUT          msecs_to_jiffies(5000)
-#endif
-/** Hdd Default MTU */
-#define HDD_DEFAULT_MTU         (1500)
-
-#ifdef QCA_CONFIG_SMP
-#define NUM_CPUS NR_CPUS
-#else
-#define NUM_CPUS 1
-#endif
-
-/**event flags registered net device*/
-#define NET_DEVICE_REGISTERED  (0)
-#define SME_SESSION_OPENED     (1)
-#define INIT_TX_RX_SUCCESS     (2)
-#define WMM_INIT_DONE          (3)
-#define SOFTAP_BSS_STARTED     (4)
-#define DEVICE_IFACE_OPENED    (5)
-#define TDLS_INIT_DONE         (6)
-#define ACS_PENDING            (7)
-
-/* HDD global event flags */
-#define ACS_IN_PROGRESS        (0)
-
-/** Maximum time(ms)to wait for disconnect to complete **/
-#ifdef QCA_WIFI_3_0_EMU
-#define WLAN_WAIT_TIME_DISCONNECT  3000
-#else
-#define WLAN_WAIT_TIME_DISCONNECT  2000
-#endif
-#define WLAN_WAIT_TIME_STATS       800
-#define WLAN_WAIT_TIME_POWER       800
-#define WLAN_WAIT_TIME_COUNTRY     1000
-#define WLAN_WAIT_TIME_LINK_STATUS 800
-/* Amount of time to wait for sme close session callback.
-   This value should be larger than the timeout used by WDI to wait for
-   a response from WCNSS */
-#define WLAN_WAIT_TIME_SESSIONOPENCLOSE  15000
-#define WLAN_WAIT_TIME_ABORTSCAN         2000
-
-/** Maximum time(ms) to wait for mc thread suspend **/
-#define WLAN_WAIT_TIME_MCTHREAD_SUSPEND  1200
-
-/** Maximum time(ms) to wait for target to be ready for suspend **/
-#define WLAN_WAIT_TIME_READY_TO_SUSPEND  2000
-
-/** Maximum time(ms) to wait for tdls add sta to complete **/
-#define WAIT_TIME_TDLS_ADD_STA      1500
-
-/** Maximum time(ms) to wait for tdls del sta to complete **/
-#define WAIT_TIME_TDLS_DEL_STA      1500
-
-/** Maximum time(ms) to wait for Link Establish Req to complete **/
-#define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ      1500
-
-/** Maximum time(ms) to wait for tdls mgmt to complete **/
-#define WAIT_TIME_TDLS_MGMT         11000
-
-/* Scan Req Timeout */
-#define WLAN_WAIT_TIME_SCAN_REQ 100
-
-#define MAX_NUMBER_OF_ADAPTERS 4
-
-#define MAX_CFG_STRING_LEN  255
-
-#define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
-/** Mac Address string **/
-#define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x"
-#define MAC_ADDRESS_STR_LEN 18  /* Including null terminator */
-#define MAX_GENIE_LEN 255
-
-#define WLAN_CHIP_VERSION   "WCNSS"
-
-#ifndef HDD_DISALLOW_LEGACY_HDDLOG
-#define hddLog(level, args ...) CDF_TRACE(CDF_MODULE_ID_HDD, level, ## args)
-#endif
-#define hdd_log(level, args...) CDF_TRACE(CDF_MODULE_ID_HDD, level, ## args)
-#define hdd_logfl(level, format, args...) hdd_log(level, FL(format), ## args)
-
-#define hdd_alert(format, args...) \
-		hdd_logfl(CDF_TRACE_LEVEL_FATAL, format, ## args)
-#define hdd_err(format, args...) \
-		hdd_logfl(CDF_TRACE_LEVEL_ERROR, format, ## args)
-#define hdd_warn(format, args...) \
-		hdd_logfl(CDF_TRACE_LEVEL_WARN, format, ## args)
-#define hdd_notice(format, args...) \
-		hdd_logfl(CDF_TRACE_LEVEL_INFO, format, ## args)
-#define hdd_info(format, args...) \
-		hdd_logfl(CDF_TRACE_LEVEL_INFO_HIGH, format, ## args)
-#define hdd_debug(format, args...) \
-		hdd_logfl(CDF_TRACE_LEVEL_DEBUG, format, ## args)
-
-#define ENTER() hdd_logfl(CDF_TRACE_LEVEL_INFO_LOW, "enter")
-#define EXIT() hdd_logfl(CDF_TRACE_LEVEL_INFO_LOW, "exit")
-
-#define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t *)(netdev_priv((__dev__)))
-
-#define MAX_NO_OF_2_4_CHANNELS 14
-
-#define WLAN_HDD_PUBLIC_ACTION_FRAME 4
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET 24
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET 0
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET 1
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_OFFSET 2
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_TYPE_OFFSET 5
-#define WLAN_HDD_VENDOR_SPECIFIC_ACTION 0x09
-#define WLAN_HDD_WFA_OUI   0x506F9A
-#define WLAN_HDD_WFA_P2P_OUI_TYPE 0x09
-#define WLAN_HDD_P2P_SOCIAL_CHANNELS 3
-#define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1
-#define WLAN_HDD_PUBLIC_ACTION_FRAME_SUB_TYPE_OFFSET 6
-
-#define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq)	\
-	(((center_freq) == 2412) || ((center_freq) == 2437) || ((center_freq) == 2462))
-
-#define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \
-	(((center_freq) == 5180) || ((center_freq) == 5200) \
-	 || ((center_freq) == 5220) || ((center_freq) == 5240))
-
-#ifdef WLAN_FEATURE_11W
-#define WLAN_HDD_SA_QUERY_ACTION_FRAME 8
-#endif
-
-#define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14
-#define WLAN_HDD_TDLS_ACTION_FRAME 12
-#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
-#define HDD_WAKE_LOCK_DURATION 50       /* in msecs */
-#endif
-
-#define WLAN_HDD_QOS_ACTION_FRAME 1
-#define WLAN_HDD_QOS_MAP_CONFIGURE 4
-#define HDD_SAP_WAKE_LOCK_DURATION 10000        /* in msecs */
-
-#define HDD_MOD_EXIT_SSR_MAX_RETRIES 75
-
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-#define GTK_OFFLOAD_ENABLE  0
-#define GTK_OFFLOAD_DISABLE 1
-#endif
-
-#define MAX_USER_COMMAND_SIZE 4096
-
-#define HDD_MIN_TX_POWER (-100) /* minimum tx power */
-#define HDD_MAX_TX_POWER (+100) /* maximum tx power */
-
-/* If IPA UC data path is enabled, target should reserve extra tx descriptors
- * for IPA data path.
- * Then host data path should allow less TX packet pumping in case
- * IPA data path enabled
- */
-#define WLAN_TFC_IPAUC_TX_DESC_RESERVE   100
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-#ifdef CONFIG_CNSS
-#define cfg80211_vendor_cmd_reply(skb) cnss_vendor_cmd_reply(skb)
-#endif
-#endif
-
-#define BSS_WAIT_TIMEOUT 10000
-
-/*
- * Generic asynchronous request/response support
- *
- * Many of the APIs supported by HDD require a call to SME to
- * perform an action or to retrieve some data.  In most cases SME
- * performs the operation asynchronously, and will execute a provided
- * callback function when the request has completed.  In order to
- * synchronize this the HDD API allocates a context which is then
- * passed to SME, and which is then, in turn, passed back to the
- * callback function when the operation completes.  The callback
- * function then sets a completion variable inside the context which
- * the HDD API is waiting on.  In an ideal world the HDD API would
- * wait forever (or at least for a long time) for the response to be
- * received and for the completion variable to be set.  However in
- * most cases these HDD APIs are being invoked in the context of a
- * user space thread which has invoked either a cfg80211 API or a
- * wireless extensions ioctl and which has taken the kernel rtnl_lock.
- * Since this lock is used to synchronize many of the kernel tasks, we
- * do not want to hold it for a long time.  In addition we do not want
- * to block user space threads (such as the wpa supplicant's main
- * thread) for an extended time.  Therefore we only block for a short
- * time waiting for the response before we timeout.  This means that
- * it is possible for the HDD API to timeout, and for the callback to
- * be invoked afterwards.  In order for the callback function to
- * determine if the HDD API is still waiting, a magic value is also
- * stored in the shared context.  Only if the context has a valid
- * magic will the callback routine do any work.  In order to further
- * synchronize these activities a spinlock is used so that if any HDD
- * API timeout coincides with its callback, the operations of the two
- * threads will be serialized.
- */
-
-struct statsContext {
-	struct completion completion;
-	hdd_adapter_t *pAdapter;
-	unsigned int magic;
-};
-
-struct linkspeedContext {
-	struct completion completion;
-	hdd_adapter_t *pAdapter;
-	unsigned int magic;
-};
-
-extern spinlock_t hdd_context_lock;
-
-#define STATS_CONTEXT_MAGIC 0x53544154  /* STAT */
-#define RSSI_CONTEXT_MAGIC  0x52535349  /* RSSI */
-#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) */
-
-/* MAX OS Q block time value in msec
- * Prevent from permanent stall, resume OS Q if timer expired */
-#define WLAN_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 1000
-#define WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 100
-#define WLAN_HDD_TX_FLOW_CONTROL_MAX_24BAND_CH   14
-
-#define HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1       390
-#define HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1       390
-#define HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2       780
-#define HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2       780
-
-
-#define NUM_TX_RX_HISTOGRAM 1024
-#define NUM_TX_RX_HISTOGRAM_MASK (NUM_TX_RX_HISTOGRAM - 1)
-
-/**
- * struct hdd_tx_rx_histogram - structure to keep track of tx and rx packets
- *				received over 100ms intervals
- * @interval_rx:	# of rx packets received in the last 100ms interval
- * @interval_tx:	# of tx packets received in the last 100ms interval
- * @total_rx:		# of total rx packets received on interface
- * @total_tx:		# of total tx packets received on interface
- * @next_vote_level:	cnss_bus_width_type voting level (high or low)
- *			determined on the basis of total tx and rx packets
- *			received in the last 100ms interval
- * @next_rx_level:	cnss_bus_width_type voting level (high or low)
- *			determined on the basis of rx packets received in the
- *			last 100ms interval
- * @next_tx_level:	cnss_bus_width_type voting level (high or low)
- *			determined on the basis of tx packets received in the
- *			last 100ms interval
- *
- * The structure keeps track of throughput requirements of wlan driver in 100ms
- * intervals for later analysis.
- */
-struct hdd_tx_rx_histogram {
-	uint64_t interval_rx;
-	uint64_t interval_tx;
-	uint64_t total_rx;
-	uint64_t total_tx;
-	uint32_t next_vote_level;
-	uint32_t next_rx_level;
-	uint32_t next_tx_level;
-};
-
-typedef struct hdd_tx_rx_stats_s {
-	/* start_xmit stats */
-	__u32    txXmitCalled;
-	__u32    txXmitDropped;
-	__u32    txXmitClassifiedAC[NUM_TX_QUEUES];
-	__u32    txXmitDroppedAC[NUM_TX_QUEUES];
-	/* complete_cbk_stats */
-	__u32    txCompleted;
-	/* rx stats */
-	__u32 rxPackets[NUM_CPUS];
-	__u32 rxDropped[NUM_CPUS];
-	__u32 rxDelivered[NUM_CPUS];
-	__u32 rxRefused[NUM_CPUS];
-
-	/* txflow stats */
-	bool     is_txflow_paused;
-	__u32    txflow_pause_cnt;
-	__u32    txflow_unpause_cnt;
-	__u32    txflow_timer_cnt;
-} hdd_tx_rx_stats_t;
-
-#ifdef WLAN_FEATURE_11W
-typedef struct hdd_pmf_stats_s {
-	uint8_t numUnprotDeauthRx;
-	uint8_t numUnprotDisassocRx;
-} hdd_pmf_stats_t;
-#endif
-
-typedef struct hdd_stats_s {
-	tCsrSummaryStatsInfo summary_stat;
-	tCsrGlobalClassAStatsInfo ClassA_stat;
-	tCsrGlobalClassBStatsInfo ClassB_stat;
-	tCsrGlobalClassCStatsInfo ClassC_stat;
-	tCsrGlobalClassDStatsInfo ClassD_stat;
-	tCsrPerStaStatsInfo perStaStats;
-	hdd_tx_rx_stats_t hddTxRxStats;
-#ifdef WLAN_FEATURE_11W
-	hdd_pmf_stats_t hddPmfStats;
-#endif
-} hdd_stats_t;
-
-typedef enum {
-	HDD_ROAM_STATE_NONE,
-
-	/* Issuing a disconnect due to transition into low power states. */
-	HDD_ROAM_STATE_DISCONNECTING_POWER,
-
-	/* move to this state when HDD sets a key with SME/CSR.  Note this is */
-	/* an important state to get right because we will get calls into our SME */
-	/* callback routine for SetKey activity that we did not initiate! */
-	HDD_ROAM_STATE_SETTING_KEY,
-} HDD_ROAM_STATE;
-
-typedef struct roaming_info_s {
-	HDD_ROAM_STATE roamingState;
-	cdf_event_t roamingEvent;
-
-	tSirMacAddr bssid;
-	tSirMacAddr peerMac;
-	uint32_t roamId;
-	eRoamCmdStatus roamStatus;
-	bool deferKeyComplete;
-
-} roaming_info_t;
-
-#ifdef FEATURE_WLAN_WAPI
-/* Define WAPI macros for Length, BKID count etc*/
-#define MAX_WPI_KEY_LENGTH    16
-#define MAX_NUM_PN            16
-#define MAC_ADDR_LEN           6
-#define MAX_ADDR_INDEX        12
-#define MAX_NUM_AKM_SUITES    16
-#define MAX_NUM_UNI_SUITES    16
-#define MAX_NUM_BKIDS         16
-
-/** WAPI AUTH mode definition */
-enum _WAPIAuthMode {
-	WAPI_AUTH_MODE_OPEN = 0,
-	WAPI_AUTH_MODE_PSK = 1,
-	WAPI_AUTH_MODE_CERT
-} __packed;
-typedef enum _WAPIAuthMode WAPIAuthMode;
-
-/** WAPI Work mode structure definition */
-#define   WZC_ORIGINAL      0
-#define   WAPI_EXTENTION    1
-
-struct _WAPI_FUNCTION_MODE {
-	unsigned char wapiMode;
-} __packed;
-
-typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE;
-
-typedef struct _WAPI_BKID {
-	uint8_t bkid[16];
-} WAPI_BKID, *pWAPI_BKID;
-
-/** WAPI Association information structure definition */
-struct _WAPI_AssocInfo {
-	uint8_t elementID;
-	uint8_t length;
-	uint16_t version;
-	uint16_t akmSuiteCount;
-	uint32_t akmSuite[MAX_NUM_AKM_SUITES];
-	uint16_t unicastSuiteCount;
-	uint32_t unicastSuite[MAX_NUM_UNI_SUITES];
-	uint32_t multicastSuite;
-	uint16_t wapiCability;
-	uint16_t bkidCount;
-	WAPI_BKID bkidList[MAX_NUM_BKIDS];
-} __packed;
-
-typedef struct _WAPI_AssocInfo WAPI_AssocInfo;
-typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo;
-
-/** WAPI KEY Type definition */
-enum _WAPIKeyType {
-	PAIRWISE_KEY,           /* 0 */
-	GROUP_KEY               /* 1 */
-} __packed;
-typedef enum _WAPIKeyType WAPIKeyType;
-
-/** WAPI KEY Direction definition */
-enum _KEY_DIRECTION {
-	None,
-	Rx,
-	Tx,
-	Rx_Tx
-} __packed;
-
-typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION;
-
-/* WAPI KEY structure definition */
-struct WLAN_WAPI_KEY {
-	WAPIKeyType keyType;
-	WAPI_KEY_DIRECTION keyDirection;        /*reserved for future use */
-	uint8_t keyId;
-	uint8_t addrIndex[MAX_ADDR_INDEX];      /*reserved for future use */
-	int wpiekLen;
-	uint8_t wpiek[MAX_WPI_KEY_LENGTH];
-	int wpickLen;
-	uint8_t wpick[MAX_WPI_KEY_LENGTH];
-	uint8_t pn[MAX_NUM_PN]; /*reserved for future use */
-} __packed;
-
-typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY;
-typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY;
-
-#define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0]))
-#define WPA_GET_BE24(a) ((u32) ((a[0] << 16) | (a[1] << 8) | a[2]))
-#define WLAN_EID_WAPI 68
-#define WAPI_PSK_AKM_SUITE  0x02721400
-#define WAPI_CERT_AKM_SUITE 0x01721400
-
-/* WAPI BKID List structure definition */
-struct _WLAN_BKID_LIST {
-	uint32_t length;
-	uint32_t BKIDCount;
-	WAPI_BKID BKID[1];
-} __packed;
-
-typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST;
-typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST;
-
-/* WAPI Information structure definition */
-struct hdd_wapi_info_s {
-	uint32_t nWapiMode;
-	bool fIsWapiSta;
-	struct cdf_mac_addr cachedMacAddr;
-	uint8_t wapiAuthMode;
-} __packed;
-typedef struct hdd_wapi_info_s hdd_wapi_info_t;
-#endif /* FEATURE_WLAN_WAPI */
-
-typedef struct beacon_data_s {
-	u8 *head;
-	u8 *tail;
-	u8 *proberesp_ies;
-	u8 *assocresp_ies;
-	int head_len;
-	int tail_len;
-	int proberesp_ies_len;
-	int assocresp_ies_len;
-	int dtim_period;
-} beacon_data_t;
-
-/**
- * enum device_mode: Maintain one to one correspondence with tCDF_ADAPTER_MODE
- * @WLAN_HDD_INFRA_STATION: station mode
- * @WLAN_HDD_SOFTAP: sap mode
- * @WLAN_HDD_P2P_CLIENT: p2p client mode
- * @WLAN_HDD_P2P_GO: p2p go mode
- * @WLAN_HDD_FTM: ftm mode
- * @WLAN_HDD_IBSS: ibss mode
- * @WLAN_HDD_P2P_DEVICE: p2p device mode
- * @WLAN_HDD_OCB: ocb mode
- */
-typedef enum device_mode {
-	WLAN_HDD_INFRA_STATION,
-	WLAN_HDD_SOFTAP,
-	WLAN_HDD_P2P_CLIENT,
-	WLAN_HDD_P2P_GO,
-	WLAN_HDD_FTM,
-	WLAN_HDD_IBSS,
-	WLAN_HDD_P2P_DEVICE,
-	WLAN_HDD_OCB
-} device_mode_t;
-
-typedef enum rem_on_channel_request_type {
-	REMAIN_ON_CHANNEL_REQUEST,
-	OFF_CHANNEL_ACTION_TX,
-} rem_on_channel_request_type_t;
-
-typedef struct action_pkt_buffer {
-	uint8_t *frame_ptr;
-	uint32_t frame_length;
-	uint16_t freq;
-} action_pkt_buffer_t;
-
-typedef struct hdd_remain_on_chan_ctx {
-	struct net_device *dev;
-	struct ieee80211_channel chan;
-	enum nl80211_channel_type chan_type;
-	unsigned int duration;
-	u64 cookie;
-	rem_on_channel_request_type_t rem_on_chan_request;
-	cdf_mc_timer_t hdd_remain_on_chan_timer;
-	action_pkt_buffer_t action_pkt_buff;
-	bool hdd_remain_on_chan_cancel_in_progress;
-	uint32_t scan_id;
-} hdd_remain_on_chan_ctx_t;
-
-/* RoC Request entry */
-typedef struct hdd_roc_req {
-	cdf_list_node_t node;   /* MUST be first element */
-	hdd_adapter_t *pAdapter;
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx;
-} hdd_roc_req_t;
-
-/**
- * struct hdd_scan_req - Scan Request entry
- * @node : List entry element
- * @adapter: Adapter address
- * @scan_request: scan request holder
- * @scan_id: scan identifier used across host layers which is generated at WMI
- * @cookie: scan request identifier sent to userspace
- * @source: scan request originator (NL/Vendor scan)
- * @timestamp: scan request timestamp
- *
- * Scan request linked list element
- */
-struct hdd_scan_req {
-	cdf_list_node_t node;
-	hdd_adapter_t *adapter;
-	struct cfg80211_scan_request *scan_request;
-	uint32_t scan_id;
-	uint8_t source;
-	uint32_t timestamp;
-};
-
-typedef enum {
-	HDD_IDLE,
-	HDD_PD_REQ_ACK_PENDING,
-	HDD_GO_NEG_REQ_ACK_PENDING,
-	HDD_INVALID_STATE,
-} eP2PActionFrameState;
-
-typedef enum {
-	WLAN_HDD_GO_NEG_REQ,
-	WLAN_HDD_GO_NEG_RESP,
-	WLAN_HDD_GO_NEG_CNF,
-	WLAN_HDD_INVITATION_REQ,
-	WLAN_HDD_INVITATION_RESP,
-	WLAN_HDD_DEV_DIS_REQ,
-	WLAN_HDD_DEV_DIS_RESP,
-	WLAN_HDD_PROV_DIS_REQ,
-	WLAN_HDD_PROV_DIS_RESP,
-} tActionFrmType;
-
-typedef struct hdd_cfg80211_state_s {
-	uint16_t current_freq;
-	u64 action_cookie;
-	uint8_t *buf;
-	size_t len;
-	hdd_remain_on_chan_ctx_t *remain_on_chan_ctx;
-	struct mutex remain_on_chan_ctx_lock;
-	eP2PActionFrameState actionFrmState;
-} hdd_cfg80211_state_t;
-
-struct hdd_station_ctx {
-	/** Handle to the Wireless Extension State */
-	hdd_wext_state_t WextState;
-
-#ifdef FEATURE_WLAN_TDLS
-	tdlsCtx_t *pHddTdlsCtx;
-#endif
-
-	/**Connection information*/
-	connection_info_t conn_info;
-
-	roaming_info_t roam_info;
-
-	int ft_carrier_on;
-
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-	tSirGtkOffloadParams gtkOffloadReqParams;
-#endif
-	/*Increment whenever ibss New peer joins and departs the network */
-	int ibss_sta_generation;
-
-	/* Indication of wep/wpa-none keys installation */
-	bool ibss_enc_key_installed;
-
-	/*Save the wep/wpa-none keys */
-	tCsrRoamSetKey ibss_enc_key;
-
-	bool hdd_ReassocScenario;
-
-	/* STA ctx debug variables */
-	int staDebugState;
-
-	uint8_t broadcast_ibss_staid;
-};
-
-#define BSS_STOP    0
-#define BSS_START   1
-typedef struct hdd_hostapd_state_s {
-	int bssState;
-	cdf_event_t cdf_event;
-	cdf_event_t cdf_stop_bss_event;
-	CDF_STATUS cdf_status;
-	bool bCommit;
-
-} hdd_hostapd_state_t;
-
-/*
- * Per station structure kept in HDD for multiple station support for SoftAP
- */
-typedef struct {
-	/** The station entry is used or not  */
-	bool isUsed;
-
-	/** Station ID reported back from HAL (through SAP). Broadcast
-	 *  uses station ID zero by default in both libra and volans. */
-	uint8_t ucSTAId;
-
-	/** MAC address of the station */
-	struct cdf_mac_addr macAddrSTA;
-
-	/** Current Station state so HDD knows how to deal with packet
-	 *  queue. Most recent states used to change TLSHIM STA state */
-	enum ol_txrx_peer_state tlSTAState;
-
-	/** Track QoS status of station */
-	bool isQosEnabled;
-
-	/** The station entry for which Deauth is in progress  */
-	bool isDeauthInProgress;
-
-	/** Number of spatial streams supported */
-	uint8_t   nss;
-
-	/** Rate Flags for this connection */
-	uint32_t  rate_flags;
-} hdd_station_info_t;
-
-struct hdd_ap_ctx_s {
-	hdd_hostapd_state_t HostapdState;
-
-	/* Memory differentiation mode is enabled */
-	/* uint16_t uMemoryDiffThreshold; */
-	/* uint8_t uNumActiveAC; */
-	/* uint8_t uActiveACMask; */
-
-	/** Packet Count to update uNumActiveAC and uActiveACMask */
-	/* uint16_t uUpdatePktCount; */
-
-	/** Station ID assigned after BSS starts */
-	uint8_t uBCStaId;
-
-	uint8_t uPrivacy;       /* The privacy bits of configuration */
-
-	tSirWPSPBCProbeReq WPSPBCProbeReq;
-
-	tsap_Config_t sapConfig;
-
-	struct semaphore semWpsPBCOverlapInd;
-
-	bool apDisableIntraBssFwd;
-
-	cdf_mc_timer_t hdd_ap_inactivity_timer;
-
-	uint8_t operatingChannel;
-
-	bool uIsAuthenticated;
-
-	eCsrEncryptionType ucEncryptType;
-
-	/* This will point to group key data, if it is received before start bss. */
-	tCsrRoamSetKey groupKey;
-	/* This will have WEP key data, if it is received before start bss */
-	tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY];
-
-	beacon_data_t *beacon;
-
-	bool bApActive;
-#ifdef WLAN_FEATURE_MBSSID
-	/* SAP Context */
-	void *sapContext;
-#endif
-	bool dfs_cac_block_tx;
-};
-
-typedef struct hdd_scaninfo_s {
-	/* The scan pending  */
-	uint32_t mScanPending;
-
-	/* Counter for mScanPending so that the scan pending
-	   error log is not printed for more than 5 times    */
-	uint32_t mScanPendingCounter;
-
-	/* Additional IE for scan */
-	tSirAddie scanAddIE;
-
-	/* Scan mode */
-	tSirScanType scan_mode;
-
-	/* completion variable for abortscan */
-	struct completion abortscan_event_var;
-
-} hdd_scaninfo_t;
-
-#define WLAN_HDD_MAX_MC_ADDR_LIST 10
-
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-typedef struct multicast_addr_list {
-	uint8_t isFilterApplied;
-	uint8_t mc_cnt;
-	uint8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN];
-} t_multicast_add_list;
-#endif
-
-#define WLAN_HDD_MAX_HISTORY_ENTRY		10
-
-/**
- * struct hdd_netif_queue_stats - netif queue operation statistics
- * @pause_count - pause counter
- * @unpause_count - unpause counter
- */
-struct hdd_netif_queue_stats {
-	uint16_t pause_count;
-	uint16_t unpause_count;
-};
-
-/**
- * struct hdd_netif_queue_history - netif queue operation history
- * @time: timestamp
- * @netif_action: action type
- * @netif_reason: reason type
- * @pause_map: pause map
- */
-struct hdd_netif_queue_history {
-	cdf_time_t time;
-	uint16_t netif_action;
-	uint16_t netif_reason;
-	uint32_t pause_map;
-};
-
-
-#define WLAN_HDD_ADAPTER_MAGIC 0x574c414e       /* ASCII "WLAN" */
-
-
-struct hdd_adapter_s {
-	/* Magic cookie for adapter sanity verification.  Note that this
-	 * needs to be at the beginning of the private data structure so
-	 * that it will exists at the beginning of dev->priv and hence
-	 * will always be in mapped memory
-	 */
-	uint32_t magic;
-
-	void *pHddCtx;
-
-	/** Handle to the network device */
-	struct net_device *dev;
-
-	device_mode_t device_mode;
-
-	/** IPv4 notifier callback for handling ARP offload on change in IP */
-	struct work_struct ipv4NotifierWorkQueue;
-#ifdef WLAN_NS_OFFLOAD
-	/** IPv6 notifier callback for handling NS offload on change in IP */
-	struct work_struct ipv6NotifierWorkQueue;
-#endif
-
-	/* TODO Move this to sta Ctx */
-	struct wireless_dev wdev;
-	struct cfg80211_scan_request *request;
-
-	/** ops checks if Opportunistic Power Save is Enable or Not
-	 * ctw stores ctWindow value once we receive Opps command from
-	 * wpa_supplicant then using ctWindow value we need to Enable
-	 * Opportunistic Power Save
-	 */
-	uint8_t ops;
-	uint32_t ctw;
-
-	/** Current MAC Address for the adapter  */
-	struct cdf_mac_addr macAddressCurrent;
-
-	/**Event Flags*/
-	unsigned long event_flags;
-
-	/**Device TX/RX statistics*/
-	struct net_device_stats stats;
-	/** HDD statistics*/
-	hdd_stats_t hdd_stats;
-	/** linkspeed statistics */
-	tSirLinkSpeedInfo ls_stats;
-	/**Mib information*/
-	sHddMib_t hdd_mib;
-
-	uint8_t sessionId;
-
-	/* Completion variable for session close */
-	struct completion session_close_comp_var;
-
-	/* Completion variable for session open */
-	struct completion session_open_comp_var;
-
-	/* TODO: move these to sta ctx. These may not be used in AP */
-	/** completion variable for disconnect callback */
-	struct completion disconnect_comp_var;
-
-	/** Completion of change country code */
-	struct completion change_country_code;
-
-	/* completion variable for Linkup Event */
-	struct completion linkup_event_var;
-
-	/* completion variable for cancel remain on channel Event */
-	struct completion cancel_rem_on_chan_var;
-
-	/* completion variable for off channel  remain on channel Event */
-	struct completion offchannel_tx_event;
-	/* Completion variable for action frame */
-	struct completion tx_action_cnf_event;
-	/* Completion variable for remain on channel ready */
-	struct completion rem_on_chan_ready_event;
-
-	struct completion sta_authorized_event;
-#ifdef FEATURE_WLAN_TDLS
-	struct completion tdls_add_station_comp;
-	struct completion tdls_del_station_comp;
-	struct completion tdls_mgmt_comp;
-	struct completion tdls_link_establish_req_comp;
-	CDF_STATUS tdlsAddStaStatus;
-#endif
-
-	/* Track whether the linkup handling is needed  */
-	bool isLinkUpSvcNeeded;
-
-	/* Mgmt Frames TX completion status code */
-	uint32_t mgmtTxCompletionStatus;
-
-	/* WMM Status */
-	hdd_wmm_status_t hddWmmStatus;
-/*************************************************************
- */
-/*************************************************************
- * TODO - Remove it later
- */
-	/** Multiple station supports */
-	/** Per-station structure */
-	spinlock_t staInfo_lock;        /* To protect access to station Info */
-	hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT];
-	/* uint8_t uNumActiveStation; */
-
-/*************************************************************
- */
-
-#ifdef FEATURE_WLAN_WAPI
-	hdd_wapi_info_t wapi_info;
-#endif
-
-	int8_t rssi;
-#ifdef WLAN_FEATURE_LPSS
-	bool rssi_send;
-#endif
-
-	uint8_t snr;
-
-	struct work_struct monTxWorkQueue;
-	struct sk_buff *skb_to_tx;
-
-	union {
-		hdd_station_ctx_t station;
-		hdd_ap_ctx_t ap;
-	} sessionCtx;
-
-	hdd_cfg80211_state_t cfg80211State;
-
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-	t_multicast_add_list mc_addr_list;
-#endif
-	uint8_t addr_filter_pattern;
-
-	bool higherDtimTransition;
-	bool survey_idx;
-
-	hdd_scaninfo_t scan_info;
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-	tAniTrafStrmMetrics tsmStats;
-#endif
-	/* Flag to ensure PSB is configured through framework */
-	uint8_t psbChanged;
-	/* UAPSD psb value configured through framework */
-	uint8_t configuredPsb;
-#ifdef IPA_OFFLOAD
-	void *ipa_context;
-#endif
-	/* Use delayed work for Sec AP ACS as Pri AP Startup need to complete
-	 * since CSR (PMAC Struct) Config is same for both AP
-	 */
-	struct delayed_work acs_pending_work;
-
-	struct work_struct scan_block_work;
-#ifdef MSM_PLATFORM
-	unsigned long prev_rx_packets;
-	unsigned long prev_tx_packets;
-	int connection;
-#endif
-	bool is_roc_inprogress;
-
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-	cdf_mc_timer_t tx_flow_control_timer;
-	bool tx_flow_timer_initialized;
-	unsigned int tx_flow_low_watermark;
-	unsigned int tx_flow_high_watermark_offset;
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-	bool offloads_configured;
-
-	/* DSCP to UP QoS Mapping */
-	sme_QosWmmUpType hddWmmDscpToUpMap[WLAN_HDD_MAX_DSCP + 1];
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-	bool isLinkLayerStatsSet;
-#endif
-	uint8_t linkStatus;
-
-	/* variable for temperature in Celsius */
-	int temperature;
-
-	/* Time stamp for last completed RoC request */
-	v_TIME_t last_roc_ts;
-
-	/* Time stamp for start RoC request */
-	v_TIME_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 */
-	struct cdf_mac_addr ocb_mac_address[CDF_MAX_CONCURRENCY_PERSONA];
-	int ocb_mac_addr_count;
-
-	/* BITMAP indicating pause reason */
-	uint32_t pause_map;
-	spinlock_t pause_map_lock;
-
-	uint8_t history_index;
-	struct hdd_netif_queue_history
-		 queue_oper_history[WLAN_HDD_MAX_HISTORY_ENTRY];
-	struct hdd_netif_queue_stats queue_oper_stats[WLAN_REASON_TYPE_MAX];
-	struct hdd_lro_s lro_info;
-};
-
-#define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station)
-#define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap)
-#define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter)  (&(pAdapter)->sessionCtx.station.WextState)
-#define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t *)pAdapter->pHddCtx)
-#define WLAN_HDD_GET_HAL_CTX(pAdapter)  (((hdd_context_t *)(pAdapter->pHddCtx))->hHal)
-#define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState)
-#define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter)  (&(pAdapter)->cfg80211State)
-#ifdef WLAN_FEATURE_MBSSID
-#define WLAN_HDD_GET_SAP_CTX_PTR(pAdapter) (pAdapter->sessionCtx.ap.sapContext)
-#endif
-#ifdef FEATURE_WLAN_TDLS
-#define WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter) \
-	(((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) && \
-	  (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode)) ? 0 : 1)
-#define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \
-	((WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) ? \
-	 (tdlsCtx_t *)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL)
-#endif
-
-/* Set mac address locally administered bit */
-#define WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macaddr) (macaddr[0] &= 0xFD)
-
-#define HDD_DEFAULT_MCC_P2P_QUOTA    70
-#define HDD_RESET_MCC_P2P_QUOTA      50
-
-typedef struct hdd_adapter_list_node {
-	cdf_list_node_t node;   /* MUST be first element */
-	hdd_adapter_t *pAdapter;
-} hdd_adapter_list_node_t;
-
-typedef struct hdd_priv_data_s {
-	uint8_t *buf;
-	int used_len;
-	int total_len;
-} hdd_priv_data_t;
-
-#define  MAX_MOD_LOGLEVEL 10
-typedef struct {
-	uint8_t enable;
-	uint8_t dl_type;
-	uint8_t dl_report;
-	uint8_t dl_loglevel;
-	uint8_t index;
-	uint32_t dl_mod_loglevel[MAX_MOD_LOGLEVEL];
-
-} fw_log_info;
-
-#ifdef WLAN_FEATURE_OFFLOAD_PACKETS
-/**
- * struct hdd_offloaded_packets - request id to pattern id mapping
- * @request_id: request id
- * @pattern_id: pattern id
- *
- */
-struct hdd_offloaded_packets {
-	uint32_t request_id;
-	uint8_t  pattern_id;
-};
-
-/**
- * struct hdd_offloaded_packets_ctx - offloaded packets context
- * @op_table: request id to pattern id table
- * @op_lock: mutex lock
- */
-struct hdd_offloaded_packets_ctx {
-	struct hdd_offloaded_packets op_table[MAXNUM_PERIODIC_TX_PTRNS];
-	struct mutex op_lock;
-};
-#endif
-
-/** Adapter structure definition */
-
-struct hdd_context_s {
-	/** Global CDS context  */
-	v_CONTEXT_t pcds_context;
-
-	/** HAL handle...*/
-	tHalHandle hHal;
-
-	struct wiphy *wiphy;
-	/* TODO Remove this from here. */
-
-	cdf_spinlock_t hdd_adapter_lock;
-	cdf_list_t hddAdapters; /* List of adapters */
-
-	/* One per STA: 1 for BCMC_STA_ID, 1 for each SAP_SELF_STA_ID, 1 for WDS_STAID */
-	hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + CDF_MAX_NO_OF_SAP_MODE + 2]; /* One per sta. For quick reference. */
-
-	/** Pointer for firmware image data */
-	const struct firmware *fw;
-
-	/** Pointer for configuration data */
-	const struct firmware *cfg;
-
-	/** Pointer to the parent device */
-	struct device *parent_dev;
-
-	/** Config values read from qcom_cfg.ini file */
-	struct hdd_config *config;
-
-	struct wlan_hdd_ftm_status ftm;
-
-	/* Completion  variable to indicate Mc Thread Suspended */
-	struct completion mc_sus_event_var;
-
-	struct completion reg_init;
-
-	bool isMcThreadSuspended;
-
-#ifdef QCA_CONFIG_SMP
-	bool is_ol_rx_thread_suspended;
-#endif
-
-	/* Track whether Mcast/Bcast Filter is enabled. */
-	bool hdd_mcastbcast_filter_set;
-
-	bool hdd_wlan_suspended;
-	bool suspended;
-
-	/* Lock to avoid race condition during start/stop bss */
-	struct mutex sap_lock;
-
-#ifdef FEATURE_OEM_DATA_SUPPORT
-	/* OEM App registered or not */
-	bool oem_app_registered;
-
-	/* OEM App Process ID */
-	int32_t oem_pid;
-#endif
-
-	/** Concurrency Parameters*/
-	uint32_t concurrency_mode;
-
-	uint8_t no_of_open_sessions[CDF_MAX_NO_OF_MODE];
-	uint8_t no_of_active_sessions[CDF_MAX_NO_OF_MODE];
-
-	/** P2P Device MAC Address for the adapter  */
-	struct cdf_mac_addr p2pDeviceAddress;
-
-#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
-	cdf_wake_lock_t rx_wake_lock;
-#endif
-
-	cdf_wake_lock_t sap_wake_lock;
-
-#ifdef FEATURE_WLAN_TDLS
-	eTDLSSupportMode tdls_mode;
-	eTDLSSupportMode tdls_mode_last;
-	tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA];
-	/* maximum TDLS station number allowed upon runtime condition */
-	uint16_t max_num_tdls_sta;
-	/* TDLS peer connected count */
-	uint16_t connected_peer_count;
-	tdls_scan_context_t tdls_scan_ctxt;
-	/* Lock to avoid race condition during TDLS operations */
-	struct mutex tdls_lock;
-	uint8_t tdls_off_channel;
-	uint16_t tdls_channel_offset;
-	int32_t tdls_fw_off_chan_mode;
-#endif
-
-	void *hdd_ipa;
-
-	/* MC/BC Filter state variable
-	 * This always contains the value that is currently
-	 * configured
-	 * */
-	uint8_t configuredMcastBcastFilter;
-
-	uint8_t sus_res_mcastbcast_filter;
-
-	bool sus_res_mcastbcast_filter_valid;
-
-	/* debugfs entry */
-	struct dentry *debugfs_phy;
-
-	/* Use below lock to protect access to isSchedScanUpdatePending
-	 * since it will be accessed in two different contexts.
-	 */
-	cdf_spinlock_t sched_scan_lock;
-
-	/* Flag keeps track of wiphy suspend/resume */
-	bool isWiphySuspended;
-
-	/* Indicates about pending sched_scan results */
-	bool isSchedScanUpdatePending;
-
-#ifdef MSM_PLATFORM
-	/* DDR bus bandwidth compute timer
-	 */
-	cdf_mc_timer_t bus_bw_timer;
-	int cur_vote_level;
-	spinlock_t bus_bw_lock;
-	int cur_rx_level;
-	uint64_t prev_rx;
-	int cur_tx_level;
-	uint64_t prev_tx;
-#endif
-	/* VHT80 allowed */
-	bool isVHT80Allowed;
-
-	struct completion ready_to_suspend;
-	/* defining the solution type */
-	uint32_t target_type;
-
-	/* defining the firmware version */
-	uint32_t target_fw_version;
-	uint32_t dfs_radar_found;
-
-	/* defining the chip/rom version */
-	uint32_t target_hw_version;
-	/* defining the chip/rom revision */
-	uint32_t target_hw_revision;
-	/* chip/rom name */
-	const char *target_hw_name;
-	struct regulatory reg;
-#ifdef FEATURE_WLAN_CH_AVOID
-	uint16_t unsafe_channel_count;
-	uint16_t unsafe_channel_list[NUM_20MHZ_RF_CHANNELS];
-#endif /* FEATURE_WLAN_CH_AVOID */
-
-	uint8_t max_intf_count;
-	uint8_t current_intf_count;
-#ifdef WLAN_FEATURE_LPSS
-	uint8_t lpss_support;
-#endif
-	uint8_t ap_arpns_support;
-	tSirScanType ioctl_scan_mode;
-
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-	cdf_work_t sta_ap_intf_check_work;
-#endif
-
-	struct work_struct  sap_start_work;
-	bool is_sap_restart_required;
-	bool is_sta_connection_pending;
-	spinlock_t sap_update_info_lock;
-	spinlock_t sta_update_info_lock;
-
-	uint8_t dev_dfs_cac_status;
-
-	bool btCoexModeSet;
-#ifdef FEATURE_GREEN_AP
-	struct hdd_green_ap_ctx *green_ap_ctx;
-#endif
-	fw_log_info fw_log_settings;
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-	cdf_mc_timer_t skip_acs_scan_timer;
-	uint8_t skip_acs_scan_status;
-#endif
-
-	cdf_wake_lock_t sap_dfs_wakelock;
-	atomic_t sap_dfs_ref_cnt;
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-	bool is_extwow_app_type1_param_set;
-	bool is_extwow_app_type2_param_set;
-	bool ext_wow_should_suspend;
-	struct completion ready_to_extwow;
-#endif
-
-	/* Time since boot up to extscan start (in micro seconds) */
-	uint64_t ext_scan_start_since_boot;
-	unsigned long g_event_flags;
-	/* RoC request queue and work */
-	struct delayed_work roc_req_work;
-	cdf_spinlock_t hdd_roc_req_q_lock;
-	cdf_list_t hdd_roc_req_q;
-	cdf_spinlock_t hdd_scan_req_q_lock;
-	cdf_list_t hdd_scan_req_q;
-	uint8_t miracast_value;
-#ifdef WLAN_NS_OFFLOAD
-	/* IPv6 notifier callback for handling NS offload on change in IP */
-	struct notifier_block ipv6_notifier;
-#endif
-	/* IPv4 notifier callback for handling ARP offload on change in IP */
-	struct notifier_block ipv4_notifier;
-
-	/* number of rf chains supported by target */
-	uint32_t  num_rf_chains;
-	/* Is htTxSTBC supported by target */
-	uint8_t   ht_tx_stbc_supported;
-#ifdef WLAN_FEATURE_OFFLOAD_PACKETS
-	struct hdd_offloaded_packets_ctx op_ctx;
-#endif
-	bool mcc_mode;
-#ifdef WLAN_FEATURE_MEMDUMP
-	uint8_t *fw_dump_loc;
-	uint32_t dump_loc_paddr;
-	cdf_mc_timer_t memdump_cleanup_timer;
-	struct mutex memdump_lock;
-	bool memdump_in_progress;
-#endif /* WLAN_FEATURE_MEMDUMP */
-
-	cdf_mc_timer_t dbs_opportunistic_timer;
-	bool connection_in_progress;
-	cdf_spinlock_t connection_status_lock;
-
-	uint16_t hdd_txrx_hist_idx;
-	struct hdd_tx_rx_histogram hdd_txrx_hist[NUM_TX_RX_HISTOGRAM];
-	/*
-	 * Dfs lock used to syncronize on sap channel switch during
-	 * radar found indication and application triggered channel
-	 * switch.
-	 */
-	struct mutex dfs_lock;
-};
-
-/*---------------------------------------------------------------------------
-   Function declarations and documentation
-   -------------------------------------------------------------------------*/
-int hdd_validate_channel_and_bandwidth(hdd_adapter_t *adapter,
-				uint32_t chan_number,
-				phy_ch_width chan_bw);
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *sta_pAdapter);
-#endif
-
-const char *hdd_device_mode_to_string(uint8_t device_mode);
-
-CDF_STATUS hdd_get_front_adapter(hdd_context_t *pHddCtx,
-				 hdd_adapter_list_node_t **ppAdapterNode);
-
-CDF_STATUS hdd_get_next_adapter(hdd_context_t *pHddCtx,
-				hdd_adapter_list_node_t *pAdapterNode,
-				hdd_adapter_list_node_t **pNextAdapterNode);
-
-CDF_STATUS hdd_remove_adapter(hdd_context_t *pHddCtx,
-			      hdd_adapter_list_node_t *pAdapterNode);
-
-CDF_STATUS hdd_remove_front_adapter(hdd_context_t *pHddCtx,
-				    hdd_adapter_list_node_t **ppAdapterNode);
-
-CDF_STATUS hdd_add_adapter_back(hdd_context_t *pHddCtx,
-				hdd_adapter_list_node_t *pAdapterNode);
-
-CDF_STATUS hdd_add_adapter_front(hdd_context_t *pHddCtx,
-				 hdd_adapter_list_node_t *pAdapterNode);
-
-hdd_adapter_t *hdd_open_adapter(hdd_context_t *pHddCtx, uint8_t session_type,
-				const char *name, tSirMacAddr macAddr,
-				bool rtnl_held);
-CDF_STATUS hdd_close_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
-			     bool rtnl_held);
-CDF_STATUS hdd_close_all_adapters(hdd_context_t *pHddCtx, bool rtnl_held);
-CDF_STATUS hdd_stop_all_adapters(hdd_context_t *pHddCtx);
-CDF_STATUS hdd_reset_all_adapters(hdd_context_t *pHddCtx);
-CDF_STATUS hdd_start_all_adapters(hdd_context_t *pHddCtx);
-hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *pHddCtx,
-				       uint32_t vdev_id);
-hdd_adapter_t *hdd_get_adapter_by_macaddr(hdd_context_t *pHddCtx,
-					  tSirMacAddr macAddr);
-CDF_STATUS hdd_init_station_mode(hdd_adapter_t *pAdapter);
-hdd_adapter_t *hdd_get_adapter(hdd_context_t *pHddCtx, device_mode_t mode);
-void hdd_deinit_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
-			bool rtnl_held);
-CDF_STATUS hdd_stop_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter,
-			    const bool bCloseSession);
-void hdd_set_station_ops(struct net_device *pWlanDev);
-uint8_t *wlan_hdd_get_intf_addr(hdd_context_t *pHddCtx);
-void wlan_hdd_release_intf_addr(hdd_context_t *pHddCtx, uint8_t *releaseAddr);
-uint8_t hdd_get_operating_channel(hdd_context_t *pHddCtx, device_mode_t mode);
-
-void hdd_set_conparam(uint32_t con_param);
-enum tCDF_GLOBAL_CON_MODE hdd_get_conparam(void);
-
-void hdd_abort_mac_scan(hdd_context_t *pHddCtx, uint8_t sessionId,
-			eCsrAbortReason reason);
-void hdd_cleanup_actionframe(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter);
-
-void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id);
-void wlan_hdd_reset_prob_rspies(hdd_adapter_t *pHostapdAdapter);
-void hdd_prevent_suspend(uint32_t reason);
-void hdd_allow_suspend(uint32_t reason);
-void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason);
-
-void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy);
-CDF_STATUS hdd_set_ibss_power_save_params(hdd_adapter_t *pAdapter);
-CDF_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx);
-void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx);
-int wlan_hdd_validate_context(hdd_context_t *pHddCtx);
-bool hdd_is_valid_mac_address(const uint8_t *pMacAddr);
-CDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx);
-
-void hdd_checkandupdate_phymode(hdd_context_t *pHddCtx);
-
-#ifdef MSM_PLATFORM
-void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter);
-void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *pAdapter);
-#else
-static inline void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter)
-{
-	return;
-}
-
-static inline void hdd_stop_bus_bw_computer_timer(hdd_adapter_t *pAdapter)
-{
-	return;
-}
-#endif
-
-int hdd_init(void);
-void hdd_deinit(void);
-
-int hdd_wlan_startup(struct device *dev, void *hif_sc);
-void __hdd_wlan_exit(void);
-int hdd_wlan_notify_modem_power_state(int state);
-#ifdef QCA_HT_2040_COEX
-int hdd_wlan_set_ht2040_mode(hdd_adapter_t *pAdapter, uint16_t staId,
-			     struct cdf_mac_addr macAddrSTA, int width);
-#endif
-
-#ifdef WLAN_FEATURE_LPSS
-void wlan_hdd_send_status_pkg(hdd_adapter_t *pAdapter,
-			      hdd_station_ctx_t *pHddStaCtx,
-			      uint8_t is_on, uint8_t is_connected);
-void wlan_hdd_send_version_pkg(uint32_t fw_version,
-			       uint32_t chip_id, const char *chip_name);
-void wlan_hdd_send_all_scan_intf_info(hdd_context_t *pHddCtx);
-#endif
-void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len);
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, bool enable);
-#endif
-
-hdd_adapter_t *hdd_get_con_sap_adapter(hdd_adapter_t *this_sap_adapter,
-							bool check_start_bss);
-
-bool hdd_is_5g_supported(hdd_context_t *pHddCtx);
-
-int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter);
-
-void hdd_get_fw_version(hdd_context_t *hdd_ctx,
-			uint32_t *major_spid, uint32_t *minor_spid,
-			uint32_t *siid, uint32_t *crmid);
-
-#ifdef WLAN_FEATURE_MEMDUMP
-/**
- * hdd_is_memdump_supported() - to check if memdump feature support
- *
- * This function is used to check if memdump feature is supported in
- * the host driver
- *
- * Return: true if supported and false otherwise
- */
-static inline bool hdd_is_memdump_supported(void)
-{
-	return true;
-}
-#else
-static inline bool hdd_is_memdump_supported(void)
-{
-	return false;
-}
-#endif /* WLAN_FEATURE_MEMDUMP */
-
-void hdd_update_macaddr(struct hdd_config *config,
-			struct cdf_mac_addr hw_macaddr);
-void wlan_hdd_disable_roaming(hdd_adapter_t *pAdapter);
-void wlan_hdd_enable_roaming(hdd_adapter_t *pAdapter);
-
-CDF_STATUS hdd_post_cds_enable_config(hdd_context_t *pHddCtx);
-
-CDF_STATUS hdd_abort_mac_scan_all_adapters(hdd_context_t *hdd_ctx);
-
-CDF_STATUS wlan_hdd_check_custom_con_channel_rules(hdd_adapter_t *sta_adapter,
-						  hdd_adapter_t *ap_adapter,
-						  tCsrRoamProfile *roam_profile,
-						  tScanResultHandle *scan_cache,
-						  bool *concurrent_chnl_same);
-#ifdef WLAN_FEATURE_MBSSID
-void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter);
-void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter);
-#else
-static inline void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter) {}
-static inline void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) {}
-#endif
-
-#ifdef QCA_CONFIG_SMP
-int wlan_hdd_get_cpu(void);
-#else
-static inline int wlan_hdd_get_cpu(void)
-{
-	return 0;
-}
-#endif
-
-void wlan_hdd_txrx_pause_cb(uint8_t vdev_id,
-	enum netif_action_type action, enum netif_reason_type reason);
-
-void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value);
-void wlan_hdd_display_tx_rx_histogram(hdd_context_t *pHddCtx);
-void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *pHddCtx);
-void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx);
-void wlan_hdd_clear_netif_queue_history(hdd_context_t *hdd_ctx);
-const char *hdd_get_fwpath(void);
-void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind);
-hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx,
-						uint32_t sme_session_id);
-phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width);
-uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel,
-			uint8_t bw_offset);
-
-#endif /* end #if !defined(WLAN_HDD_MAIN_H) */

+ 0 - 92
core/hdd/inc/wlan_hdd_memdump.h

@@ -1,92 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC : wlan_hdd_memdump.h
- *
- * WLAN Host Device Driver file for dumping firmware memory
- *
- */
-
-#if !defined(WLAN_HDD_MEMDUMP_H)
-#define WLAN_HDD_MEMDUMP_H
-
-#include "wlan_hdd_main.h"
-
-#ifdef WLAN_FEATURE_MEMDUMP
-/**
- * enum qca_wlan_vendor_attr_memory_dump - values for memory dump attributes
- * @QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_INVALID - Invalid
- * @QCA_WLAN_VENDOR_ATTR_REQUEST_ID - Indicate request ID
- * @QCA_WLAN_VENDOR_ATTR_MEMDUMP_SIZE - Indicate size of the memory dump
- * @QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_AFTER_LAST - To keep track of the last enum
- * @QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_MAX - max value possible for this type
- *
- * enum values are used for NL attributes for data used by
- * QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP sub command.
- */
-enum qca_wlan_vendor_attr_memory_dump {
-	QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_REQUEST_ID = 1,
-	QCA_WLAN_VENDOR_ATTR_MEMDUMP_SIZE = 2,
-
-	QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_MAX =
-		QCA_WLAN_VENDOR_ATTR_MEMORY_DUMP_AFTER_LAST - 1,
-};
-
-/* Size of fw memory dump is estimated to be 327680 bytes */
-#define FW_MEM_DUMP_SIZE    327680
-#define FW_DRAM_LOCATION    0x00400000
-#define FW_MEM_DUMP_REQ_ID  1
-#define FW_MEM_DUMP_NUM_SEG 1
-#define MEMDUMP_COMPLETION_TIME_MS 5000
-
-int memdump_init(void);
-void memdump_deinit(void);
-int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
-				      struct wireless_dev *wdev,
-				      const void *data, int data_len);
-#else
-static inline int memdump_init(void)
-{
-	return -ENOTSUPP;
-}
-
-static inline void memdump_deinit(void)
-{
-}
-
-static inline int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	return -ENOTSUPP;
-}
-#endif
-
-#endif /* if !defined(WLAN_HDD_MEMDUMP_H)*/

+ 0 - 190
core/hdd/inc/wlan_hdd_mib.h

@@ -1,190 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_MIB_h__)
-#define WLAN_HDD_MIB_h__
-
-#include <cdf_types.h>
-
-typedef enum {
-	eMib_dot11DesiredBssType_infrastructure = 1,
-	eMib_dot11DesiredBssType_independent = 2,
-	eMib_dot11DesiredBssType_infra_ap = 3,
-	eMib_dot11DesiredBssType_any = 4
-} eMib_dot11DesiredBssType;
-
-/** This is the maximum number of BSSIDs supported in the
-      dot11DesiredBssidList.  All the code operates off of
-      this maximum BSSID list count.  */
-#define MIB_DOT11_DESIRED_BSSID_LIST_MAX_COUNT 1
-
-typedef struct {
-	uint32_t cEntries;
-
-	struct cdf_mac_addr BSSIDs[MIB_DOT11_DESIRED_BSSID_LIST_MAX_COUNT];
-
-} sMib_dot11DesiredBssidList;
-
-/** This is the maximum number of SSIDs supported in the
-     dot11DesiredSsidList.  All the code operates off of
-     this maximum SSID list count.  */
-
-#define MIB_DOT11_DESIRED_SSID_LIST_MAX_COUNT 1
-
-#define MIB_DOT11_SSID_MAX_LENGTH 32
-
-typedef struct {
-	uint32_t ssidLength;
-	uint8_t ssid[MIB_DOT11_SSID_MAX_LENGTH];
-
-} sDot11Ssid;
-
-typedef struct {
-	uint32_t cEntries;
-
-	sDot11Ssid SSIDs[MIB_DOT11_DESIRED_SSID_LIST_MAX_COUNT];
-
-} sMib_dot11DesiredSsidList;
-
-typedef enum {
-	/* these are bitmasks.... */
-	eMib_dot11AutoConfigEnabled_None = 0U,
-	eMib_dot11AutoConfigEnabled_Phy = 0x00000001U,
-	eMib_dot11AutoConfigEnabled_Mac = 0x00000002U
-} eMib_dot11AutoConfigEnabled;
-
-#define MIB_DOT11_SUPPORTED_PHY_TYPES_MAX_COUNT 3
-
-typedef enum tagMib_dot11PhyType {
-	eMib_dot11PhyType_11b,
-	eMib_dot11PhyType_11a,
-	eMib_dot11PhyType_11g,
-	eMib_dot11PhyType_all
-} eMib_dot11PhyType;
-
-typedef struct tagMib_dot11SupportedPhyTypes {
-	uint32_t cEntries;
-	eMib_dot11PhyType phyTypes[MIB_DOT11_SUPPORTED_PHY_TYPES_MAX_COUNT];
-} sMib_dot11SupportedPhyTypes;
-
-typedef enum {
-	eMib_DevicePowerState_D0,
-	eMib_DevicePowerState_D1,
-	eMib_DevicePowerState_D2,
-	eMib_DevicePowerState_D3
-} eMib_DevicePowerState;
-
-typedef enum {
-	eMib_dot11NICPowerState_OFF = false,
-	eMib_dot11NICPowerState_ON = true
-} eMib_dot11NICPowerState;
-
-typedef enum {
-	eMib_dot11HardwarePHYState_OFF = false,
-	eMib_dot11HardwarePHYState_ON = true
-} eMib_dot11HardwarePHYState;
-
-typedef enum {
-	eMib_dot11PowerSavingLevel_None,
-	eMib_dot11PowerSavingLevel_MaxPS,
-	eMib_dot11PowerSavingLevel_FastPS,
-	eMib_dot11PowerSavingLevel_MaximumLevel
-} eMib_dot11PowerSavingLevel;
-
-#define MIB_DOT11_MAC_EXCLUSION_LIST_MAX_COUNT 4
-typedef struct {
-	uint32_t cEntries;
-
-	struct cdf_mac_addr macAddrs[MIB_DOT11_MAC_EXCLUSION_LIST_MAX_COUNT];
-
-} sMib_dot11MacExcludeList;
-
-#define MIB_DOT11_PRIVACY_EXEMPT_LIST_MAX_COUNT 32
-
-typedef enum {
-	eMib_dot11ExemptionAction_Always,
-	eMib_dot11ExemptionAction_OnKeyMapUnavailable
-} eMib_dot11ExemptAction;
-
-typedef enum {
-	eMib_dot11ExemptPacket_Unicast,
-	eMib_dot11ExemptPacket_Multicast,
-	eMib_dot11ExemptPacket_Both
-} eMib_dot11ExemptPacket;
-
-typedef struct {
-	uint16_t uEtherType;
-	eMib_dot11ExemptAction exemptAction;
-	eMib_dot11ExemptPacket exemptPacket;
-
-} sMib_dot11PrivacyExemption;
-
-typedef struct {
-	uint32_t cEntries;
-
-	sMib_dot11PrivacyExemption
-		privacyExemptList[MIB_DOT11_PRIVACY_EXEMPT_LIST_MAX_COUNT];
-
-} sMib_dot11PrivacyExemptionList;
-
-typedef struct sHddMib_s {
-	eMib_dot11DesiredBssType mibDot11DesiredBssType;
-
-	sMib_dot11DesiredBssidList mibDot11DesiredBssidList;
-
-	sMib_dot11DesiredSsidList mibDot11DesiredSsidList;
-
-	eMib_dot11AutoConfigEnabled mibDot11AutoConfigEnabled;
-
-	/* the device power state for the device (the D-state... you know D0, D1, D2, etc. */
-	eMib_DevicePowerState mibDevicePowerState;
-
-	/* dot11NICPowerState is really the on/off state of the PHY.  This can be */
-	/* mamipulated through OIDs like a software control for radio on/off. */
-	eMib_dot11NICPowerState mibDot11NICPowerState;
-
-	/* Hardware PHY state is the on/off state of the hardware PHY. */
-	eMib_dot11HardwarePHYState mibDot11HardwarePHYState;
-
-	/* dot11 Power Saving level is the 802.11 power saving level/state for the 802.11 */
-	/* NIC.  Typically this is mapped to 802.11 BMPS in some fashion.  We are not going */
-	/* to disappoint; the Libra NIC maps these to different BMPS settings. */
-	eMib_dot11PowerSavingLevel mibDot11PowerSavingLevel;
-
-	sMib_dot11MacExcludeList mibDot11MacExcludeList;
-
-	sMib_dot11PrivacyExemptionList mibDot11PrivacyExemptionList;
-
-	sMib_dot11SupportedPhyTypes mibDot11SupportedPhyTypes;
-	eMib_dot11PhyType mibDot11CurrentPhyType;
-
-	bool dot11IbssJoinOnly;
-	bool HiddenNetworkEnabled;
-
-} sHddMib_t;
-
-#endif

+ 0 - 39
core/hdd/inc/wlan_hdd_misc.h

@@ -1,39 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef WLAN_HDD_MISC_H
-#define WLAN_HDD_MISC_H
-
-#ifdef MSM_PLATFORM
-#define WLAN_INI_FILE              "wlan/qca_cld/WCNSS_qcom_cfg.ini"
-#define WLAN_MAC_FILE              "wlan/qca_cld/wlan_mac.bin"
-#else
-#define WLAN_INI_FILE              "wlan/qcom_cfg.ini"
-#define WLAN_MAC_FILE              "wlan/wlan_mac.bin"
-#endif /* MSM_PLATFORM */
-
-#endif /* WLAN_HDD_MISC_H */

+ 0 - 59
core/hdd/inc/wlan_hdd_nan.h

@@ -1,59 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_NAN_H
-#define __WLAN_HDD_NAN_H
-
-/**
- * DOC: wlan_hdd_nan.h
- *
- * WLAN Host Device Driver NAN API specification
- */
-
-struct hdd_context_s;
-
-#ifdef WLAN_FEATURE_NAN
-struct wiphy;
-struct wireless_dev;
-
-int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  const void *data,
-				  int data_len);
-
-bool wlan_hdd_nan_is_supported(void);
-void wlan_hdd_nan_init(struct hdd_context_s *hdd_ctx);
-#else
-static inline bool wlan_hdd_nan_is_supported(void)
-{
-	return false;
-}
-static inline void wlan_hdd_nan_init(struct hdd_context_s *hdd_ctx)
-{
-}
-#endif /* WLAN_FEATURE_NAN */
-#endif /* __WLAN_HDD_NAN_H */

+ 0 - 82
core/hdd/inc/wlan_hdd_napi.h

@@ -1,82 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __HDD_NAPI_H__
-#define __HDD_NAPI_H__
-
-#ifdef FEATURE_NAPI
-/**
- * DOC: wlan_hdd_napi.h
- *
- * WLAN NAPI interface module headers
- */
-
-/* CLD headers */
-#include "hif_napi.h"
-/* Linux headers */
-#include <linux/netdevice.h> /* net_device */
-
-#define HDD_NAPI_ANY (-1)
-
-int hdd_napi_enabled(int id);
-int hdd_napi_create(void);
-int hdd_napi_destroy(int force);
-
-int hdd_napi_stats(char   *buf,
-		   int     max,
-		   char   *indp,
-		   struct qca_napi_data *napid);
-
-/* the following triggers napi_enable/disable as required */
-int hdd_napi_event(enum qca_napi_event event, void *data);
-
-int hdd_napi_poll(struct napi_struct *napi, int budget);
-
-struct qca_napi_data *hdd_napi_get_all(void);
-
-#else /* ! defined(FEATURE_NAPI) */
-#include "hif_napi.h"
-/**
- * Stub API
- *
- */
-
-#define HDD_NAPI_ANY (-1)
-
-static inline int hdd_napi_enabled(int id) { return 0; }
-static inline int hdd_napi_create(void) { return -EPERM; }
-static inline int hdd_napi_destroy(int force) { return 0; }
-static inline int hdd_napi_stats(char *buf, int max, char *indp,
-				 struct qca_napi_data *napid)
-{ return 0; }
-static inline int hdd_napi_event(enum qca_napi_event event, void *data)
-{ return 0; }
-static inline struct qca_napi_data *hdd_napi_get_all(void) { return NULL; }
-
-#endif /* FEATURE_NAPI */
-
-#endif /*  HDD_NAPI_H__ */

+ 0 - 175
core/hdd/inc/wlan_hdd_oemdata.h

@@ -1,175 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_oemdata.h
- *
- * Internal includes for the oem data
- */
-
-#ifndef __WLAN_HDD_OEM_DATA_H__
-#define __WLAN_HDD_OEM_DATA_H__
-
-#ifdef FEATURE_OEM_DATA_SUPPORT
-
-#ifndef OEM_DATA_REQ_SIZE
-#define OEM_DATA_REQ_SIZE 280
-#endif
-
-#ifndef OEM_DATA_RSP_SIZE
-#define OEM_DATA_RSP_SIZE 1724
-#endif
-
-#define OEM_APP_SIGNATURE_LEN      16
-#define OEM_APP_SIGNATURE_STR      "QUALCOMM-OEM-APP"
-
-#define OEM_TARGET_SIGNATURE_LEN   8
-#define OEM_TARGET_SIGNATURE       "QUALCOMM"
-
-#define OEM_CAP_MAX_NUM_CHANNELS   128
-
-/**
- * typedef eOemErrorCode - OEM error codes
- * @OEM_ERR_NULL_CONTEXT: %NULL context
- * @OEM_ERR_APP_NOT_REGISTERED: OEM App is not registered
- * @OEM_ERR_INVALID_SIGNATURE: Invalid signature
- * @OEM_ERR_NULL_MESSAGE_HEADER: Invalid message header
- * @OEM_ERR_INVALID_MESSAGE_TYPE: Invalid message type
- * @OEM_ERR_INVALID_MESSAGE_LENGTH: Invalid length in message body
- */
-typedef enum {
-	OEM_ERR_NULL_CONTEXT = 1,
-	OEM_ERR_APP_NOT_REGISTERED,
-	OEM_ERR_INVALID_SIGNATURE,
-	OEM_ERR_NULL_MESSAGE_HEADER,
-	OEM_ERR_INVALID_MESSAGE_TYPE,
-	OEM_ERR_INVALID_MESSAGE_LENGTH
-} eOemErrorCode;
-
-/**
- * typedef tDriverVersion - Driver version identifier (w.x.y.z)
- * @major: Version ID major number
- * @minor: Version ID minor number
- * @patch: Version ID patch number
- * @build: Version ID build number
- */
-typedef struct cdf_packed {
-	uint8_t major;
-	uint8_t minor;
-	uint8_t patch;
-	uint8_t build;
-} tDriverVersion;
-
-/**
- * typedef t_iw_oem_data_cap - OEM Data Capabilities
- * @oem_target_signature: Signature of chipset vendor, e.g. QUALCOMM
- * @oem_target_type: Chip type
- * @oem_fw_version: Firmware version
- * @driver_version: Host software version
- * @allowed_dwell_time_min: Channel dwell time - allowed minimum
- * @allowed_dwell_time_max: Channel dwell time - allowed maximum
- * @curr_dwell_time_min: Channel dwell time - current minimim
- * @curr_dwell_time_max: Channel dwell time - current maximum
- * @supported_bands: Supported bands, 2.4G or 5G Hz
- * @num_channels: Num of channels IDs to follow
- * @channel_list: List of channel IDs
- */
-typedef struct cdf_packed {
-	uint8_t oem_target_signature[OEM_TARGET_SIGNATURE_LEN];
-	uint32_t oem_target_type;
-	uint32_t oem_fw_version;
-	tDriverVersion driver_version;
-	uint16_t allowed_dwell_time_min;
-	uint16_t allowed_dwell_time_max;
-	uint16_t curr_dwell_time_min;
-	uint16_t curr_dwell_time_max;
-	uint16_t supported_bands;
-	uint16_t num_channels;
-	uint8_t channel_list[OEM_CAP_MAX_NUM_CHANNELS];
-} t_iw_oem_data_cap;
-
-/**
- * typedef tHddChannelInfo - Channel information
- * @chan_id: channel id
- * @reserved0: reserved for padding and future use
- * @mhz: primary 20 MHz channel frequency in mhz
- * @band_center_freq1: Center frequency 1 in MHz
- * @band_center_freq2: Center frequency 2 in MHz, valid only for 11ac
- *	VHT 80+80 mode
- * @info: channel info
- * @reg_info_1: regulatory information field 1 which contains min power,
- *	max power, reg power and reg class id
- * @reg_info_2: regulatory information field 2 which contains antennamax
- */
-typedef struct cdf_packed {
-	uint32_t chan_id;
-	uint32_t reserved0;
-	uint32_t mhz;
-	uint32_t band_center_freq1;
-	uint32_t band_center_freq2;
-	uint32_t info;
-	uint32_t reg_info_1;
-	uint32_t reg_info_2;
-} tHddChannelInfo;
-
-/**
- * typedef tPeerStatusInfo - Status information for a given peer
- * @peer_mac_addr: peer mac address
- * @peer_status: peer status: 1: CONNECTED, 2: DISCONNECTED
- * @vdev_id: vdev_id for the peer mac
- * @peer_capability: peer capability: 0: RTT/RTT2, 1: RTT3. Default is 0
- * @reserved0: reserved0
- * @peer_chan_info: channel info on which peer is connected
- */
-typedef struct cdf_packed {
-	uint8_t peer_mac_addr[ETH_ALEN];
-	uint8_t peer_status;
-	uint8_t vdev_id;
-	uint32_t peer_capability;
-	uint32_t reserved0;
-	tHddChannelInfo peer_chan_info;
-} tPeerStatusInfo;
-
-void hdd_send_peer_status_ind_to_oem_app(struct cdf_mac_addr *peerMac,
-					 uint8_t peerStatus,
-					 uint8_t peerTimingMeasCap,
-					 uint8_t sessionId,
-					 tSirSmeChanInfo *chan_info);
-
-int iw_get_oem_data_cap(struct net_device *dev, struct iw_request_info *info,
-			union iwreq_data *wrqu, char *extra);
-
-int oem_activate_service(struct hdd_context_s *hdd_ctx);
-
-void hdd_send_oem_data_rsp_msg(int length, uint8_t *oemDataRsp);
-#else
-static inline int oem_activate_service(struct hdd_context_s *hdd_ctx)
-{
-	return 0;
-}
-#endif /* FEATURE_OEM_DATA_SUPPORT */
-#endif /* __WLAN_HDD_OEM_DATA_H__ */

+ 0 - 144
core/hdd/inc/wlan_hdd_p2p.h

@@ -1,144 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __P2P_H
-#define __P2P_H
-/**===========================================================================
-
-   \file         wlan_hdd_p2p.h
-
-   \brief       Linux HDD P2P include file
-
-   ==========================================================================*/
-#define ACTION_FRAME_TX_TIMEOUT 2000
-#define WAIT_CANCEL_REM_CHAN    1000
-#define WAIT_REM_CHAN_READY     1000
-#define WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX 3000
-#define COMPLETE_EVENT_PROPOGATE_TIME 10
-
-#ifdef QCA_WIFI_3_0_EMU
-#define ACTION_FRAME_DEFAULT_WAIT 500
-#else
-#define ACTION_FRAME_DEFAULT_WAIT 200
-#endif
-
-#define WLAN_HDD_GET_TYPE_FRM_FC(__fc__)         (((__fc__) & 0x0F) >> 2)
-#define WLAN_HDD_GET_SUBTYPE_FRM_FC(__fc__)      (((__fc__) & 0xF0) >> 4)
-#define WLAN_HDD_80211_FRM_DA_OFFSET             4
-#define P2P_WILDCARD_SSID_LEN                    7
-#define P2P_WILDCARD_SSID                        "DIRECT-"
-
-#ifdef QCA_WIFI_3_0_EMU
-#define P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT   2
-#define P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT    3
-#else
-#define P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT   2
-#define P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT    5
-#endif
-
-#define HDD_P2P_MAX_ROC_DURATION 1000
-#define MAX_ROC_REQ_QUEUE_ENTRY 10
-
-#define P2P_POWER_SAVE_TYPE_OPPORTUNISTIC        (1 << 0)
-#define P2P_POWER_SAVE_TYPE_PERIODIC_NOA         (1 << 1)
-#define P2P_POWER_SAVE_TYPE_SINGLE_NOA           (1 << 2)
-
-#ifdef WLAN_FEATURE_P2P_DEBUG
-typedef enum { P2P_NOT_ACTIVE,
-	       P2P_GO_NEG_PROCESS,
-	       P2P_GO_NEG_COMPLETED,
-	       P2P_CLIENT_CONNECTING_STATE_1,
-	       P2P_GO_COMPLETED_STATE,
-	       P2P_CLIENT_CONNECTED_STATE_1,
-	       P2P_CLIENT_DISCONNECTED_STATE,
-	       P2P_CLIENT_CONNECTING_STATE_2,
-	       P2P_CLIENT_COMPLETED_STATE} tP2PConnectionStatus;
-
-extern tP2PConnectionStatus global_p2p_connection_status;
-#endif
-
-typedef struct p2p_app_setP2pPs {
-	uint8_t opp_ps;
-	uint32_t ctWindow;
-	uint8_t count;
-	uint32_t duration;
-	uint32_t interval;
-	uint32_t single_noa_duration;
-	uint8_t psSelection;
-} p2p_app_setP2pPs_t;
-
-int wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					struct ieee80211_channel *chan,
-					unsigned int duration, u64 *cookie);
-
-int wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
-					       struct wireless_dev *wdev,
-					       u64 cookie);
-
-int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
-					  struct wireless_dev *wdev,
-					  u64 cookie);
-
-int hdd_set_p2p_ps(struct net_device *dev, void *msgData);
-int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command);
-int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command);
-
-void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
-			     uint32_t nFrameLength, uint8_t *pbFrames,
-			     uint8_t frameType, uint32_t rxChan, int8_t rxRssi);
-
-void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter,
-	uint32_t scan_id);
-void hdd_send_action_cnf(hdd_adapter_t *pAdapter, bool actionSendSuccess);
-int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter);
-void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter);
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
-		     struct cfg80211_mgmt_tx_params *params, u64 *cookie);
-#else
-int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
-		     struct ieee80211_channel *chan, bool offchan,
-		     unsigned int wait,
-		     const u8 *buf, size_t len, bool no_cck,
-		     bool dont_wait_for_ack, u64 *cookie);
-#endif
-
-struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
-					       const char *name,
-					       enum nl80211_iftype type,
-					       u32 *flags,
-					       struct vif_params *params);
-
-int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
-
-
-void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_roc_request_dequeue(struct work_struct *work);
-#endif /* __P2P_H */

+ 0 - 174
core/hdd/inc/wlan_hdd_power.h

@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_POWER_H
-#define __WLAN_HDD_POWER_H
-
-/**
- * DOC: wlan_hdd_power.h
- *
- * HDD Power Management API
- */
-
-#include "wlan_hdd_main.h"
-
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-
-#define HDD_MAX_CMP_PER_PACKET_FILTER     5
-
-/**
- * enum pkt_filter_protocol_layer - packet filter protocol layer
- * @HDD_FILTER_PROTO_TYPE_INVALID: Invalid initial value
- * @HDD_FILTER_PROTO_TYPE_MAC: MAC protocol
- * @HDD_FILTER_PROTO_TYPE_ARP: ARP protocol
- * @HDD_FILTER_PROTO_TYPE_IPV4: IP V4 protocol
- * @HDD_FILTER_PROTO_TYPE_IPV6: IP V6 protocol
- * @HDD_FILTER_PROTO_TYPE_UDP: UDP protocol
- * @HDD_FILTER_PROTO_TYPE_INVALID: Max place holder value
- */
-enum pkt_filter_protocol_layer {
-	HDD_FILTER_PROTO_TYPE_INVALID = 0,
-	HDD_FILTER_PROTO_TYPE_MAC = 1,
-	HDD_FILTER_PROTO_TYPE_ARP = 2,
-	HDD_FILTER_PROTO_TYPE_IPV4 = 3,
-	HDD_FILTER_PROTO_TYPE_IPV6 = 4,
-	HDD_FILTER_PROTO_TYPE_UDP = 5,
-	HDD_FILTER_PROTO_TYPE_MAX
-};
-
-/**
- * enum pkt_filter_action - packet filter action
- * @HDD_RCV_FILTER_INVALID: Invalid initial value
- * @HDD_RCV_FILTER_SET: Packet filter set
- * @HDD_RCV_FILTER_CLEAR: Packet filter clear
- * @HDD_RCV_FILTER_MAX: Max place holder value
- */
-enum pkt_filter_action {
-	HDD_RCV_FILTER_INVALID = 0,
-	HDD_RCV_FILTER_SET = 1,
-	HDD_RCV_FILTER_CLEAR = 2,
-	HDD_RCV_FILTER_MAX
-};
-
-/**
- * enum pkt_filter_compare_flag - packet filter compare flag
- * @HDD_FILTER_CMP_TYPE_INVALID: Invalid initial value
- * @HDD_FILTER_CMP_TYPE_EQUAL: Compare if filter is equal
- * @HDD_FILTER_CMP_TYPE_MASK_EQUAL: Compare if filter mask is equal
- * @HDD_FILTER_CMP_TYPE_NOT_EQUAL: Compare if filter is not equal
- * @HDD_FILTER_CMP_TYPE_MASK_NOT_EQUAL: Compare if filter mask is not equal
- * @HDD_FILTER_CMP_TYPE_MAX: Max place holder value
- */
-enum pkt_filter_compare_flag {
-	HDD_FILTER_CMP_TYPE_INVALID = 0,
-	HDD_FILTER_CMP_TYPE_EQUAL = 1,
-	HDD_FILTER_CMP_TYPE_MASK_EQUAL = 2,
-	HDD_FILTER_CMP_TYPE_NOT_EQUAL = 3,
-	HDD_FILTER_CMP_TYPE_MASK_NOT_EQUAL = 4,
-	HDD_FILTER_CMP_TYPE_MAX
-};
-
-/**
- * struct pkt_filter_param_cfg - packet filter parameter config
- * @protocol_layer: Protocol layer
- * @compare_flag: Compare flag
- * @data_fffset: Data offset
- * @data_length: Data length
- * @compare_data: Compare data
- * @data_mask: Data mask
- */
-struct pkt_filter_param_cfg {
-	uint8_t protocol_layer;
-	uint8_t compare_flag;
-	uint8_t data_offset;
-	uint8_t data_length;
-	uint8_t compare_data[SIR_MAX_FILTER_TEST_DATA_LEN];
-	uint8_t data_mask[SIR_MAX_FILTER_TEST_DATA_LEN];
-};
-
-/**
- * struct pkt_filter_cfg - packet filter config received from user space
- * @filter_action: Filter action
- * @filter_id: Filter id
- * @num_params: Number of parameters
- * @params_data: Packet filter parameters detail
- */
-struct pkt_filter_cfg {
-	uint8_t filter_action;
-	uint8_t filter_id;
-	uint8_t num_params;
-	struct pkt_filter_param_cfg params_data[HDD_MAX_CMP_PER_PACKET_FILTER];
-};
-
-#endif
-
-
-/* SSR shutdown & re-init functions */
-CDF_STATUS hdd_wlan_shutdown(void);
-CDF_STATUS hdd_wlan_re_init(void *hif_sc);
-
-void hdd_conf_mcastbcast_filter(hdd_context_t *pHddCtx, bool setfilter);
-CDF_STATUS hdd_conf_arp_offload(hdd_adapter_t *pAdapter, bool fenable);
-void hdd_conf_hostoffload(hdd_adapter_t *pAdapter, bool fenable);
-
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set);
-#else
-static inline void
-wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set)
-{
-}
-#endif
-
-int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
-				   struct cfg80211_wowlan *wow);
-
-int wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy);
-
-void hdd_ipv4_notifier_work_queue(struct work_struct *work);
-#ifdef WLAN_NS_OFFLOAD
-void hdd_ipv6_notifier_work_queue(struct work_struct *work);
-#endif
-
-int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  int *dbm);
-int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  enum nl80211_tx_power_setting type,
-				  int dbm);
-int wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
-				     struct net_device *dev, bool mode,
-				     int timeout);
-
-int wlan_hdd_ipv4_changed(struct notifier_block *nb,
-				unsigned long data, void *arg);
-
-int wlan_hdd_ipv6_changed(struct notifier_block *nb,
-				unsigned long data, void *arg);
-
-#endif /* __WLAN_HDD_POWER_H */

+ 0 - 94
core/hdd/inc/wlan_hdd_softap_tx_rx.h

@@ -1,94 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_SOFTAP_TX_RX_H)
-#define WLAN_HDD_SOFTAP_TX_RX_H
-
-/**
- * DOC: wlan_hdd_softap_tx_rx.h
- *
- *Linux HDD SOFTAP Tx/RX APIs
- */
-
-#include <wlan_hdd_hostapd.h>
-
-int hdd_softap_hard_start_xmit(struct sk_buff *skb,
-			       struct net_device *dev);
-void hdd_softap_tx_timeout(struct net_device *dev);
-CDF_STATUS hdd_softap_init_tx_rx(hdd_adapter_t *pAdapter);
-CDF_STATUS hdd_softap_deinit_tx_rx(hdd_adapter_t *pAdapter);
-CDF_STATUS hdd_softap_init_tx_rx_sta(hdd_adapter_t *pAdapter,
-				     uint8_t STAId,
-				     struct cdf_mac_addr *pmacAddrSTA);
-CDF_STATUS hdd_softap_deinit_tx_rx_sta(hdd_adapter_t *pAdapter,
-				       uint8_t STAId);
-CDF_STATUS hdd_softap_rx_packet_cbk(void *cds_context,
-				    cdf_nbuf_t rxBufChain,
-				    uint8_t staId);
-#ifdef IPA_OFFLOAD
-CDF_STATUS hdd_softap_rx_mul_packet_cbk(void *cds_context,
-					cdf_nbuf_t rx_buf_list, uint8_t staId);
-#endif /* IPA_OFFLOAD */
-
-CDF_STATUS hdd_softap_deregister_sta(hdd_adapter_t *pAdapter,
-				     uint8_t staId);
-CDF_STATUS hdd_softap_register_sta(hdd_adapter_t *pAdapter,
-				   bool fAuthRequired,
-				   bool fPrivacyBit,
-				   uint8_t staId,
-				   uint8_t ucastSig,
-				   uint8_t bcastSig,
-				   struct cdf_mac_addr *pPeerMacAddress,
-				   bool fWmmEnabled);
-CDF_STATUS hdd_softap_register_bc_sta(hdd_adapter_t *pAdapter,
-				      bool fPrivacyBit);
-CDF_STATUS hdd_softap_deregister_bc_sta(hdd_adapter_t *pAdapter);
-CDF_STATUS hdd_softap_stop_bss(hdd_adapter_t *pHostapdAdapter);
-CDF_STATUS hdd_softap_change_sta_state(hdd_adapter_t *pAdapter,
-				       struct cdf_mac_addr *pDestMacAddress,
-				       enum ol_txrx_peer_state state);
-CDF_STATUS hdd_softap_get_sta_id(hdd_adapter_t *pAdapter,
-				 struct cdf_mac_addr *pMacAddress,
-				 uint8_t *staId);
-
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-void hdd_softap_tx_resume_timer_expired_handler(void *adapter_context);
-void hdd_softap_tx_resume_cb(void *adapter_context, bool tx_resume);
-#else
-static inline
-void hdd_softap_tx_resume_timer_expired_handler(void *adapter_context)
-{
-	return;
-}
-static inline
-void hdd_softap_tx_resume_cb(void *adapter_context, bool tx_resume)
-{
-	return;
-}
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-
-#endif /* end #if !defined(WLAN_HDD_SOFTAP_TX_RX_H) */

+ 0 - 628
core/hdd/inc/wlan_hdd_tdls.h

@@ -1,628 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __HDD_TDLS_H
-#define __HDD_TDLS_H
-/**
- * DOC: wlan_hdd_tdls.h
- * WLAN Host Device Driver TDLS include file
- */
-
-#ifdef FEATURE_WLAN_TDLS
-
-/*
- * Before UpdateTimer expires, we want to timeout discovery response
- * should not be more than 2000.
- */
-#define TDLS_DISCOVERY_TIMEOUT_BEFORE_UPDATE     1000
-
-#define TDLS_CTX_MAGIC 0x54444c53       /* "TDLS" */
-
-#define TDLS_MAX_SCAN_SCHEDULE          10
-#define TDLS_MAX_SCAN_REJECT            5
-#define TDLS_DELAY_SCAN_PER_CONNECTION 100
-#define TDLS_MAX_CONNECTED_PEERS_TO_ALLOW_SCAN   1
-
-#define TDLS_IS_CONNECTED(peer)	 \
-	((eTDLS_LINK_CONNECTED == (peer)->link_status) || \
-	 (eTDLS_LINK_TEARING == (peer)->link_status))
-
-/* Bit mask flag for tdls_option to FW */
-#define ENA_TDLS_OFFCHAN      (1 << 0)  /* TDLS Off Channel support */
-#define ENA_TDLS_BUFFER_STA   (1 << 1)  /* TDLS Buffer STA support */
-#define ENA_TDLS_SLEEP_STA    (1 << 2)  /* TDLS Sleep STA support */
-#define TDLS_SEC_OFFCHAN_OFFSET_0        0
-#define TDLS_SEC_OFFCHAN_OFFSET_40PLUS   40
-#define TDLS_SEC_OFFCHAN_OFFSET_40MINUS  (-40)
-#define TDLS_SEC_OFFCHAN_OFFSET_80       80
-#define TDLS_SEC_OFFCHAN_OFFSET_160      160
-
-#define TDLS_PEER_LIST_SIZE   256
-
-#define EXTTDLS_EVENT_BUF_SIZE (4096)
-
-/**
- * struct tdls_config_params_t - tdls config params
- *
- * @tdls: tdls
- * @tx_period_t: tx period
- * @tx_packet_n: tx packets number
- * @discovery_tries_n: discovery tries
- * @idle_packet_n: idle packet number
- * @rssi_trigger_threshold: rssi trigger threshold
- * @rssi_teardown_threshold: rssi tear down threshold
- * @rssi_delta: rssi delta
- */
-typedef struct {
-	uint32_t tdls;
-	uint32_t tx_period_t;
-	uint32_t tx_packet_n;
-	uint32_t discovery_tries_n;
-	uint32_t idle_packet_n;
-	int32_t rssi_trigger_threshold;
-	int32_t rssi_teardown_threshold;
-	int32_t rssi_delta;
-} tdls_config_params_t;
-
-/**
- * struct tdls_scan_context_t - tdls scan context
- *
- * @wiphy: pointer to wiphy structure
- * @dev: pointer to netdev
- * @scan_request: scan request
- * @magic: magic
- * @attempt: attempt
- * @reject: reject
- * @tdls_scan_work: delayed tdls scan work
- */
-typedef struct {
-	struct wiphy *wiphy;
-	struct cfg80211_scan_request *scan_request;
-	int magic;
-	int attempt;
-	int reject;
-	struct delayed_work tdls_scan_work;
-} tdls_scan_context_t;
-
-/**
- * enum eTDLSSupportMode - tdls support mode
- *
- * @eTDLS_SUPPORT_NOT_ENABLED: tdls support not enabled
- * @eTDLS_SUPPORT_DISABLED: suppress implicit trigger and not
- *			respond to the peer
- * @eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY: suppress implicit trigger,
- *			but respond to the peer
- * @eTDLS_SUPPORT_ENABLED: implicit trigger
- * @eTDLS_SUPPORT_EXTERNAL_CONTROL: External control means implicit
- *     trigger but only to a peer mac configured by user space.
- */
-typedef enum {
-	eTDLS_SUPPORT_NOT_ENABLED = 0,
-	eTDLS_SUPPORT_DISABLED,
-	eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY,
-	eTDLS_SUPPORT_ENABLED,
-	eTDLS_SUPPORT_EXTERNAL_CONTROL,
-} eTDLSSupportMode;
-
-/**
- * enum tTDLSCapType - tdls capability type
- *
- * @eTDLS_CAP_NOT_SUPPORTED: tdls not supported
- * @eTDLS_CAP_UNKNOWN: unknown capability
- * @eTDLS_CAP_SUPPORTED: tdls capability supported
- */
-typedef enum eTDLSCapType {
-	eTDLS_CAP_NOT_SUPPORTED = -1,
-	eTDLS_CAP_UNKNOWN = 0,
-	eTDLS_CAP_SUPPORTED = 1,
-} tTDLSCapType;
-
-/**
- * enum tTDLSLinkStatus - tdls link status
- *
- * @eTDLS_LINK_IDLE: tdls link idle
- * @eTDLS_LINK_DISCOVERING: tdls link discovering
- * @eTDLS_LINK_DISCOVERED: tdls link discovered
- * @eTDLS_LINK_CONNECTING: tdls link connecting
- * @eTDLS_LINK_CONNECTED: tdls link connected
- * @eTDLS_LINK_TEARING: tdls link tearing
- */
-typedef enum eTDLSLinkStatus {
-	eTDLS_LINK_IDLE = 0,
-	eTDLS_LINK_DISCOVERING,
-	eTDLS_LINK_DISCOVERED,
-	eTDLS_LINK_CONNECTING,
-	eTDLS_LINK_CONNECTED,
-	eTDLS_LINK_TEARING,
-} tTDLSLinkStatus;
-
-/**
- * enum tTDLSLinkReason - tdls link reason
- *
- * @eTDLS_LINK_SUCCESS: Success
- * @eTDLS_LINK_UNSPECIFIED: Unspecified reason
- * @eTDLS_LINK_NOT_SUPPORTED: Remote side doesn't support TDLS
- * @eTDLS_LINK_UNSUPPORTED_BAND: Remote side doesn't support this band
- * @eTDLS_LINK_NOT_BENEFICIAL: Going to AP is better than direct
- * @eTDLS_LINK_DROPPED_BY_REMOTE: Remote side doesn't want it anymore
- */
-typedef enum {
-	eTDLS_LINK_SUCCESS,
-	eTDLS_LINK_UNSPECIFIED = -1,
-	eTDLS_LINK_NOT_SUPPORTED = -2,
-	eTDLS_LINK_UNSUPPORTED_BAND = -3,
-	eTDLS_LINK_NOT_BENEFICIAL = -4,
-	eTDLS_LINK_DROPPED_BY_REMOTE = -5
-} tTDLSLinkReason;
-
-/**
- * struct tdls_req_params_t - tdls request parameters
- *
- * @channel: channel hint, in channel number (NOT frequency)
- * @global_operating_class: operating class to use
- * @max_latency_ms: max latency that can be tolerated by apps
- * @min_bandwidth_kbps: bandwidth required by apps, in kilo bits per second
- */
-typedef struct {
-	int channel;
-	int global_operating_class;
-	int max_latency_ms;
-	int min_bandwidth_kbps;
-} tdls_req_params_t;
-
-/**
- * enum tdls_state_t - tdls state
- *
- * @QCA_WIFI_HAL_TDLS_DISABLED: TDLS is not enabled, or is disabled now
- * @QCA_WIFI_HAL_TDLS_ENABLED: TDLS is enabled, but not yet tried
- * @QCA_WIFI_HAL_TDLS_ESTABLISHED: Direct link is established
- * @QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL: Direct link established using MCC
- * @QCA_WIFI_HAL_TDLS_DROPPED: Direct link was established, but is now dropped
- * @QCA_WIFI_HAL_TDLS_FAILED: Direct link failed
- */
-typedef enum {
-	QCA_WIFI_HAL_TDLS_DISABLED = 1,
-	QCA_WIFI_HAL_TDLS_ENABLED,
-	QCA_WIFI_HAL_TDLS_ESTABLISHED,
-	QCA_WIFI_HAL_TDLS_ESTABLISHED_OFF_CHANNEL,
-	QCA_WIFI_HAL_TDLS_DROPPED,
-	QCA_WIFI_HAL_TDLS_FAILED
-} tdls_state_t;
-
-typedef int (*cfg80211_exttdls_callback)(const uint8_t *mac,
-					 uint32_t opclass,
-					 uint32_t channel,
-					 uint32_t state,
-					 int32_t reason, void *ctx);
-
-/**
- * struct tdls_tx_tput_config_t - tdls tx throughput config
- *
- * @period: period
- * @bytes: bytes
- */
-typedef struct {
-	uint16_t period;
-	uint16_t bytes;
-} tdls_tx_tput_config_t;
-
-/**
- * struct tdls_discovery_config_t - tdls discovery config
- *
- * @period: period
- * @tries: number of tries
- */
-typedef struct {
-	uint16_t period;
-	uint16_t tries;
-} tdls_discovery_config_t;
-
-/**
- * struct tdls_rx_idle_config_t - tdls rx idle config
- *
- * @timeout: timeout
- */
-typedef struct {
-	uint16_t timeout;
-} tdls_rx_idle_config_t;
-
-/**
- * struct tdls_rssi_config_t - tdls rssi config
- *
- * @rssi_thres: rssi_thres
- */
-typedef struct {
-	uint16_t rssi_thres;
-} tdls_rssi_config_t;
-
-struct _hddTdlsPeer_t;
-
-/**
- * struct tdlsCtx_t - tdls context
- *
- * @peer_list: peer list
- * @pAdapter: pointer to adapter
- * @peerDiscoverTimer: peer discovery timer
- * @peerDiscoveryTimeoutTimer: peer discovery timeout timer
- * @threshold_config: threshold config
- * @discovery_peer_cnt: discovery peer count
- * @discovery_sent_cnt: discovery sent count
- * @ap_rssi: ap rssi
- * @curr_candidate: current candidate
- * @implicit_setup: implicit setup work queue
- * @magic: magic
- *
- */
-typedef struct {
-	struct list_head peer_list[TDLS_PEER_LIST_SIZE];
-	hdd_adapter_t *pAdapter;
-	cdf_mc_timer_t peerDiscoveryTimeoutTimer;
-	tdls_config_params_t threshold_config;
-	int32_t discovery_peer_cnt;
-	uint32_t discovery_sent_cnt;
-	int8_t ap_rssi;
-	struct _hddTdlsPeer_t *curr_candidate;
-	struct work_struct implicit_setup;
-	uint32_t magic;
-} tdlsCtx_t;
-
-/**
- * struct hddTdlsPeer_t - tdls peer data
- *
- * @node: node
- * @pHddTdlsCtx: pointer to tdls context
- * @peerMac: peer mac address
- * @staId: station identifier
- * @rssi: rssi
- * @tdls_support: tdls support
- * @link_status: tdls link status
- * @signature: signature
- * @is_responder: is responder
- * @discovery_processed: discovery processed flag
- * @discovery_attempt: discovery attempt
- * @tx_pkt: tx packet
- * @rx_pkt: rx packet
- * @uapsdQueues: uapsd queues
- * @maxSp: max sp
- * @isBufSta: is buffer sta
- * @isOffChannelSupported: is offchannel supported flag
- * @supported_channels_len: supported channels length
- * @supported_channels: supported channels
- * @supported_oper_classes_len: supported operation classes length
- * @supported_oper_classes: supported operation classes
- * @isForcedPeer: is forced peer
- * @op_class_for_pref_off_chan: op class for preferred off channel
- * @pref_off_chan_num: preferred off channel number
- * @op_class_for_pref_off_chan_is_set: op class for preferred off channel set
- * @reason: reason
- * @state_change_notification: state change notification
- */
-typedef struct _hddTdlsPeer_t {
-	struct list_head node;
-	tdlsCtx_t *pHddTdlsCtx;
-	tSirMacAddr peerMac;
-	uint16_t staId;
-	int8_t rssi;
-	tTDLSCapType tdls_support;
-	tTDLSLinkStatus link_status;
-	uint8_t signature;
-	uint8_t is_responder;
-	uint8_t discovery_processed;
-	uint16_t discovery_attempt;
-	uint16_t tx_pkt;
-	uint16_t rx_pkt;
-	uint8_t uapsdQueues;
-	uint8_t maxSp;
-	uint8_t isBufSta;
-	uint8_t isOffChannelSupported;
-	uint8_t supported_channels_len;
-	uint8_t supported_channels[SIR_MAC_MAX_SUPP_CHANNELS];
-	uint8_t supported_oper_classes_len;
-	uint8_t supported_oper_classes[SIR_MAC_MAX_SUPP_OPER_CLASSES];
-	bool isForcedPeer;
-	uint8_t op_class_for_pref_off_chan;
-	uint8_t pref_off_chan_num;
-	uint8_t op_class_for_pref_off_chan_is_set;
-	tTDLSLinkReason reason;
-	cfg80211_exttdls_callback state_change_notification;
-} hddTdlsPeer_t;
-
-/**
- * struct tdlsConnInfo_t - tdls connection info
- *
- * @sessionId: Session ID
- * @staId: TDLS peer station id
- * @peerMac: peer mac address
- */
-typedef struct {
-	uint8_t sessionId;
-	uint8_t staId;
-	struct cdf_mac_addr peerMac;
-} tdlsConnInfo_t;
-
-/**
- * struct tdlsInfo_t - tdls info
- *
- * @vdev_id: vdev id
- * @tdls_state: tdls state
- * @notification_interval_ms: notification interval in ms
- * @tx_discovery_threshold: tx discovery threshold
- * @tx_teardown_threshold: tx teardown threshold
- * @rssi_teardown_threshold: rx teardown threshold
- * @rssi_delta: rssi delta
- * @tdls_options: tdls options
- * @peer_traffic_ind_window: peer traffic indication window
- * @peer_traffic_response_timeout: peer traffic response timeout
- * @puapsd_mask: puapsd mask
- * @puapsd_inactivity_time: puapsd inactivity time
- * @puapsd_rx_frame_threshold: puapsd rx frame threshold
- * @teardown_notification_ms: tdls teardown notification interval
- * @tdls_peer_kickout_threshold: tdls packets threshold
- *    for peer kickout operation
- */
-typedef struct {
-	uint32_t vdev_id;
-	uint32_t tdls_state;
-	uint32_t notification_interval_ms;
-	uint32_t tx_discovery_threshold;
-	uint32_t tx_teardown_threshold;
-	int32_t rssi_teardown_threshold;
-	int32_t rssi_delta;
-	uint32_t tdls_options;
-	uint32_t peer_traffic_ind_window;
-	uint32_t peer_traffic_response_timeout;
-	uint32_t puapsd_mask;
-	uint32_t puapsd_inactivity_time;
-	uint32_t puapsd_rx_frame_threshold;
-	uint32_t teardown_notification_ms;
-	uint32_t tdls_peer_kickout_threshold;
-} tdlsInfo_t;
-
-int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_tdls_extract_da(struct sk_buff *skb, uint8_t *mac);
-
-void wlan_hdd_tdls_extract_sa(struct sk_buff *skb, uint8_t *mac);
-
-int wlan_hdd_tdls_increment_pkt_count(hdd_adapter_t *pAdapter,
-				      const uint8_t *mac, uint8_t tx);
-
-int wlan_hdd_tdls_set_sta_id(hdd_adapter_t *pAdapter, const uint8_t *mac,
-			     uint8_t staId);
-
-hddTdlsPeer_t *wlan_hdd_tdls_find_peer(hdd_adapter_t *pAdapter,
-				       const uint8_t *mac, bool mutexLock);
-
-hddTdlsPeer_t *wlan_hdd_tdls_find_all_peer(hdd_context_t *pHddCtx,
-					   const uint8_t *mac);
-
-int wlan_hdd_tdls_get_link_establish_params(hdd_adapter_t *pAdapter,
-					    const uint8_t *mac,
-					    tCsrTdlsLinkEstablishParams *
-					    tdlsLinkEstablishParams);
-hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter,
-				      const uint8_t *mac);
-
-int wlan_hdd_tdls_set_cap(hdd_adapter_t *pAdapter, const uint8_t *mac,
-			  tTDLSCapType cap);
-
-void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer,
-					tTDLSLinkStatus status,
-					tTDLSLinkReason reason);
-void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter,
-				   const uint8_t *mac,
-				   tTDLSLinkStatus linkStatus,
-				   tTDLSLinkReason reason);
-
-int wlan_hdd_tdls_recv_discovery_resp(hdd_adapter_t *pAdapter,
-				      const uint8_t *mac);
-
-int wlan_hdd_tdls_set_peer_caps(hdd_adapter_t *pAdapter,
-				const uint8_t *mac,
-				tCsrStaParams *StaParams,
-				bool isBufSta, bool isOffChannelSupported);
-
-int wlan_hdd_tdls_set_rssi(hdd_adapter_t *pAdapter, const uint8_t *mac,
-			   int8_t rxRssi);
-
-int wlan_hdd_tdls_set_responder(hdd_adapter_t *pAdapter, const uint8_t *mac,
-				uint8_t responder);
-
-int wlan_hdd_tdls_set_signature(hdd_adapter_t *pAdapter, const uint8_t *mac,
-				uint8_t uSignature);
-
-int wlan_hdd_tdls_set_params(struct net_device *dev,
-			     tdls_config_params_t *config);
-
-int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, const uint8_t *mac);
-
-uint16_t wlan_hdd_tdls_connected_peers(hdd_adapter_t *pAdapter);
-
-int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf,
-				int buflen);
-
-void wlan_hdd_tdls_connection_callback(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter,
-					    uint32_t statusCode);
-
-void wlan_hdd_tdls_tncrement_peer_count(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter);
-
-hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx,
-					 const uint8_t *mac, uint8_t skip_self);
-
-int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
-				    struct wiphy *wiphy,
-				    struct cfg80211_scan_request *request);
-
-int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
-				struct cfg80211_scan_request *request);
-
-void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_tdls_timer_restart(hdd_adapter_t *pAdapter,
-				 cdf_mc_timer_t *timer,
-				 uint32_t expirationTime);
-void wlan_hdd_tdls_indicate_teardown(hdd_adapter_t *pAdapter,
-				     hddTdlsPeer_t *curr_peer,
-				     uint16_t reason);
-
-void wlan_hdd_tdls_pre_setup_init_work(tdlsCtx_t *pHddTdlsCtx,
-				       hddTdlsPeer_t *curr_candidate);
-
-int wlan_hdd_tdls_set_extctrl_param(hdd_adapter_t *pAdapter,
-				    const uint8_t *mac,
-				    uint32_t chan,
-				    uint32_t max_latency,
-				    uint32_t op_class, uint32_t min_bandwidth);
-int wlan_hdd_tdls_set_force_peer(hdd_adapter_t *pAdapter, const uint8_t *mac,
-				 bool forcePeer);
-
-int wlan_hdd_tdls_update_peer_mac(hdd_adapter_t *adapter,
-				const uint8_t *mac,
-				uint32_t peer_state);
-
-int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter,
-					const uint8_t *peer);
-int wlan_hdd_tdls_extctrl_config_peer(hdd_adapter_t *pAdapter,
-				      const uint8_t *peer,
-				      cfg80211_exttdls_callback callback,
-				      uint32_t chan,
-				      uint32_t max_latency,
-				      uint32_t op_class,
-				      uint32_t min_bandwidth);
-int wlan_hdd_tdls_get_status(hdd_adapter_t *pAdapter,
-			     const uint8_t *mac, uint32_t *opclass,
-			     uint32_t *channel, uint32_t *state,
-			     int32_t *reason);
-void wlan_hdd_tdls_get_wifi_hal_state(hddTdlsPeer_t *curr_peer,
-				      uint32_t *state, int32_t *reason);
-int wlan_hdd_set_callback(hddTdlsPeer_t *curr_peer,
-			  cfg80211_exttdls_callback callback);
-void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited,
-			       bool tdls_chan_swit_prohibited);
-
-int wlan_hdd_tdls_add_station(struct wiphy *wiphy,
-			      struct net_device *dev, const uint8_t *mac,
-			      bool update, tCsrStaParams *StaParams);
-
-int wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy,
-				     struct wireless_dev *wdev,
-				     const void *data,
-				     int data_len);
-
-int wlan_hdd_cfg80211_exttdls_disable(struct wiphy *wiphy,
-				      struct wireless_dev *wdev,
-				      const void *data,
-				      int data_len);
-
-int wlan_hdd_cfg80211_exttdls_get_status(struct wiphy *wiphy,
-					 struct wireless_dev *wdev,
-					 const void *data,
-					 int data_len);
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
-				struct net_device *dev,
-				const uint8_t *peer,
-				enum nl80211_tdls_operation oper);
-#else
-int wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
-				struct net_device *dev,
-				uint8_t *peer,
-				enum nl80211_tdls_operation oper);
-#endif
-
-#ifdef TDLS_MGMT_VERSION2
-int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
-				struct net_device *dev, u8 *peer,
-				u8 action_code, u8 dialog_token,
-				u16 status_code, u32 peer_capability,
-				const u8 *buf, size_t len);
-#else
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
-int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
-				struct net_device *dev, const uint8_t *peer,
-				uint8_t action_code, uint8_t dialog_token,
-				uint16_t status_code, uint32_t peer_capability,
-				bool initiator, const uint8_t *buf,
-				size_t len);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
-				struct net_device *dev, const uint8_t *peer,
-				uint8_t action_code, uint8_t dialog_token,
-				uint16_t status_code, uint32_t peer_capability,
-				const uint8_t *buf, size_t len);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
-int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
-				struct net_device *dev, uint8_t *peer,
-				uint8_t action_code, uint8_t dialog_token,
-				uint16_t status_code, uint32_t peer_capability,
-				const uint8_t *buf, size_t len);
-#else
-int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
-				struct net_device *dev, uint8_t *peer,
-				uint8_t action_code, uint8_t dialog_token,
-				uint16_t status_code, const uint8_t *buf,
-				size_t len);
-#endif
-#endif
-
-void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter,
-				hdd_context_t *hddctx);
-void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx);
-
-hddTdlsPeer_t *wlan_hdd_tdls_find_first_connected_peer(hdd_adapter_t *adapter);
-int hdd_set_tdls_offchannel(hdd_context_t *hdd_ctx, int offchannel);
-int hdd_set_tdls_secoffchanneloffset(hdd_context_t *hdd_ctx, int offchanoffset);
-int hdd_set_tdls_offchannelmode(hdd_adapter_t *adapter, int offchanmode);
-int hdd_set_tdls_scan_type(hdd_context_t *hdd_ctx, int val);
-void hdd_tdls_pre_init(hdd_context_t *hdd_ctx);
-
-#else
-static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter,
-				hdd_context_t *hddctx)
-{
-}
-static inline void
-wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
-{
-}
-static inline void wlan_hdd_tdls_exit(hdd_adapter_t *adapter)
-{
-}
-
-static inline void hdd_tdls_pre_init(hdd_context_t *hdd_ctx) { }
-#endif /* End of FEATURE_WLAN_TDLS */
-
-#endif /* __HDD_TDLS_H */

+ 0 - 147
core/hdd/inc/wlan_hdd_trace.h

@@ -1,147 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_TRACE_H__
-#define __WLAN_HDD_TRACE_H__
-
-#include "mac_trace.h"
-
-#define NO_SESSION 0xFF
-
-#undef ENUMS
-#define ENUMS \
-	ENUM(TRACE_CODE_HDD_OPEN_REQUEST) \
-	ENUM(TRACE_CODE_HDD_STOP_REQUEST) \
-	ENUM(TRACE_CODE_HDD_TX_TIMEOUT) \
-	ENUM(TRACE_CODE_HDD_P2P_DEV_ADDR_IOCTL) \
-	ENUM(TRACE_CODE_HDD_SETSUSPENDMODE_IOCTL) \
-	ENUM(TRACE_CODE_HDD_SETROAMTRIGGER_IOCTL) \
-	ENUM(TRACE_CODE_HDD_GETROAMTRIGGER_IOCTL) \
-	ENUM(TRACE_CODE_HDD_SETROAMSCANPERIOD_IOCTL) \
-	ENUM(TRACE_CODE_HDD_GETROAMSCANPERIOD_IOCTL) \
-	ENUM(TRACE_CODE_HDD_SETROAMDELTA_IOCTL) \
-	ENUM(TRACE_CODE_HDD_GETROAMDELTA_IOCTL) \
-	ENUM(TRACE_CODE_HDD_GETBAND_IOCTL) \
-	ENUM(TRACE_CODE_HDD_GETCOUNTRYREV_IOCTL) \
-	ENUM(TRACE_CODE_HDD_SETROAMSCANCHANNELS_IOCTL) \
-	ENUM(TRACE_CODE_HDD_GETROAMSCANCHANNELS_IOCTL) \
-	ENUM(TRACE_CODE_HDD_HOSTAPD_OPEN_REQUEST) \
-	ENUM(TRACE_CODE_HDD_HOSTAPD_STOP_REQUEST) \
-	ENUM(TRACE_CODE_HDD_HOSTAPD_UNINIT_REQUEST) \
-	ENUM(TRACE_CODE_HDD_SOFTAP_TX_TIMEOUT) \
-	ENUM(TRACE_CODE_HDD_HOSTAPD_SET_MAC_ADDR) \
-	ENUM(TRACE_CODE_HDD_HOSTAPD_P2P_SET_NOA_IOCTL) \
-	ENUM(TRACE_CODE_HDD_HOSTAPD_P2P_SET_PS_IOCTL) \
-	ENUM(TRACE_CODE_HDD_HOSTAPD_SET_SAP_CHANNEL_LIST_IOCTL) \
-	ENUM(TRACE_CODE_HDD_ADD_VIRTUAL_INTF) \
-	ENUM(TRACE_CODE_HDD_DEL_VIRTUAL_INTF) \
-	ENUM(TRACE_CODE_HDD_CHANGE_VIRTUAL_INTF) \
-	ENUM(TRACE_CODE_HDD_CFG80211_START_AP) \
-	ENUM(TRACE_CODE_HDD_CFG80211_CHANGE_BEACON) \
-	ENUM(TRACE_CODE_HDD_CFG80211_STOP_AP) \
-	ENUM(TRACE_CODE_HDD_CFG80211_CHANGE_BSS) \
-	ENUM(TRACE_CODE_HDD_CFG80211_ADD_KEY) \
-	ENUM(TRACE_CODE_HDD_CFG80211_GET_KEY) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_DEFAULT_KEY) \
-	ENUM(TRACE_CODE_HDD_CFG80211_CONNECT) \
-	ENUM(TRACE_CODE_HDD_CFG80211_DISCONNECT) \
-	ENUM(TRACE_CODE_HDD_CFG80211_JOIN_IBSS) \
-	ENUM(TRACE_CODE_HDD_CFG80211_LEAVE_IBSS) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_WIPHY_PARAMS) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_TXPOWER) \
-	ENUM(TRACE_CODE_HDD_CFG80211_GET_TXPOWER) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_CHANNEL) \
-	ENUM(TRACE_CODE_HDD_CFG80211_ADD_BEACON) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_BEACON) \
-	ENUM(TRACE_CODE_HDD_CFG80211_CHANGE_IFACE) \
-	ENUM(TRACE_CODE_HDD_CHANGE_STATION) \
-	ENUM(TRACE_CODE_HDD_CFG80211_UPDATE_BSS) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SCAN) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SCHED_SCAN_START) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SCHED_SCAN_STOP) \
-	ENUM(TRACE_CODE_HDD_REMAIN_ON_CHANNEL) \
-	ENUM(TRACE_CODE_HDD_REMAINCHANREADYHANDLER) \
-	ENUM(TRACE_CODE_HDD_CFG80211_CANCEL_REMAIN_ON_CHANNEL) \
-	ENUM(TRACE_CODE_HDD_ACTION) \
-	ENUM(TRACE_CODE_HDD_MGMT_TX_CANCEL_WAIT) \
-	ENUM(TRACE_CODE_HDD_CFG80211_GET_STA) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_POWER_MGMT) \
-	ENUM(TRACE_CODE_HDD_CFG80211_DEL_STA) \
-	ENUM(TRACE_CODE_HDD_CFG80211_ADD_STA) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_PMKSA) \
-	ENUM(TRACE_CODE_HDD_CFG80211_DEL_PMKSA) \
-	ENUM(TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES) \
-	ENUM(TRACE_CODE_HDD_CFG80211_TDLS_MGMT) \
-	ENUM(TRACE_CODE_HDD_CFG80211_TDLS_OPER) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_REKEY_DATA) \
-	ENUM(TRACE_CODE_HDD_UNSUPPORTED_IOCTL) \
-	ENUM(TRACE_CODE_HDD_SETROAMSCANCHANNELMINTIME_IOCTL) \
-	ENUM(TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL) \
-	ENUM(TRACE_CODE_HDD_STORE_JOIN_REQ) \
-	ENUM(TRACE_CODE_HDD_CLEAR_JOIN_REQ) \
-	ENUM(TRACE_CODE_HDD_ISSUE_JOIN_REQ) \
-	ENUM(TRACE_CODE_HDD_CFG80211_RESUME_WLAN) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SUSPEND_WLAN) \
-	ENUM(TRACE_CODE_HDD_CFG80211_SET_MAC_ACL) \
-	ENUM(TRACE_CODE_HDD_CFG80211_TESTMODE) \
-	ENUM(TRACE_CODE_HDD_CFG80211_DUMP_SURVEY) \
-	ENUM(TRACE_CODE_HDD_RX_SME_MSG)
-
-enum {
-#undef ENUM
-#define ENUM(enum) enum,
-	ENUMS
-};
-
-/**
- * hdd_trace_event_string() - Convert trace event to string
- * @code: trace event enumeration to convert
- *
- * Return: string representation of the input enumeration
- */
-static inline const char *hdd_trace_event_string(uint32_t code)
-{
-	switch (code) {
-	default:
-		return "UNKNOWN";
-		break;
-#undef ENUM
-#define ENUM(enum) CASE_RETURN_STRING(enum)
-	ENUMS
-	}
-}
-
-#undef ENUMS
-#undef ENUM
-
-#ifdef HDD_TRACE_RECORD
-void hdd_trace_init(void);
-#else
-static inline void hdd_trace_init(void) {}
-#endif
-
-#endif

+ 0 - 137
core/hdd/inc/wlan_hdd_tx_rx.h

@@ -1,137 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_TX_RX_H)
-#define WLAN_HDD_TX_RX_H
-
-/**
- *
- * DOC: wlan_hdd_tx_rx.h
- *
- * Linux HDD Tx/RX APIs
- */
-
-#include <wlan_hdd_includes.h>
-#include <cds_api.h>
-#include <linux/skbuff.h>
-#include "ol_txrx_osif_api.h"
-
-#define HDD_ETHERTYPE_802_1_X              0x888E
-#define HDD_ETHERTYPE_802_1_X_FRAME_OFFSET 12
-#ifdef FEATURE_WLAN_WAPI
-#define HDD_ETHERTYPE_WAI                  0x88b4
-#endif
-
-#define HDD_PSB_CFG_INVALID                   0xFF
-#define HDD_PSB_CHANGED                       0xFF
-#define SME_QOS_UAPSD_CFG_BK_CHANGED_MASK     0xF1
-#define SME_QOS_UAPSD_CFG_BE_CHANGED_MASK     0xF2
-#define SME_QOS_UAPSD_CFG_VI_CHANGED_MASK     0xF4
-#define SME_QOS_UAPSD_CFG_VO_CHANGED_MASK     0xF8
-
-int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
-void hdd_tx_timeout(struct net_device *dev);
-CDF_STATUS hdd_init_tx_rx(hdd_adapter_t *pAdapter);
-CDF_STATUS hdd_deinit_tx_rx(hdd_adapter_t *pAdapter);
-CDF_STATUS hdd_rx_packet_cbk(void *cds_context, cdf_nbuf_t rxBufChain,
-			     uint8_t staId);
-
-#ifdef IPA_OFFLOAD
-CDF_STATUS hdd_rx_mul_packet_cbk(void *cds_context,
-				 cdf_nbuf_t rx_buf_list, uint8_t staId);
-#endif /* IPA_OFFLOAD */
-
-CDF_STATUS hdd_ibss_get_sta_id(hdd_station_ctx_t *pHddStaCtx,
-			       struct cdf_mac_addr *pMacAddress,
-			       uint8_t *staId);
-
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-void hdd_tx_resume_cb(void *adapter_context, bool tx_resume);
-void hdd_tx_resume_timer_expired_handler(void *adapter_context);
-void hdd_register_tx_flow_control(hdd_adapter_t *adapter,
-		cdf_mc_timer_callback_t timer_callback,
-		ol_txrx_tx_flow_control_fp flowControl);
-void hdd_deregister_tx_flow_control(hdd_adapter_t *adapter);
-void hdd_get_tx_resource(hdd_adapter_t *adapter,
-			uint8_t STAId, uint16_t timer_value);
-
-#else
-static inline void hdd_tx_resume_cb(void *adapter_context, bool tx_resume)
-{
-	return;
-}
-static inline void hdd_tx_resume_timer_expired_handler(void *adapter_context)
-{
-	return;
-}
-static inline void hdd_register_tx_flow_control(hdd_adapter_t *adapter,
-		cdf_mc_timer_callback_t timer_callback,
-		ol_txrx_tx_flow_control_fp flowControl)
-{
-	return;
-}
-static inline void hdd_deregister_tx_flow_control(hdd_adapter_t *adapter)
-{
-	return;
-}
-static inline void hdd_get_tx_resource(hdd_adapter_t *adapter,
-			uint8_t STAId, uint16_t timer_value)
-{
-	return;
-}
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-
-#ifdef FEATURE_WLAN_DIAG_SUPPORT
-/**
- * wlan_hdd_log_eapol() - Function to check and extract EAPOL params
- * @skb:               skb data
- * @event_type:        One of enum wifi_connectivity_events to indicate Tx/Rx
- *
- * This function parses the input skb data to get the EAPOL params,if the
- * packet is EAPOL and store it in the pointer passed as input
- *
- * Return: None
- *
- */
-void wlan_hdd_log_eapol(struct sk_buff *skb,
-		uint8_t event_type);
-#else
-static inline void wlan_hdd_log_eapol(struct sk_buff *skb,
-		uint8_t event_type)
-{
-
-}
-#endif /* FEATURE_WLAN_DIAG_SUPPORT */
-
-
-const char *hdd_reason_type_to_string(enum netif_reason_type reason);
-const char *hdd_action_type_to_string(enum netif_action_type action);
-void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
-		enum netif_action_type action, enum netif_reason_type reason);
-
-
-#endif /* end #if !defined(WLAN_HDD_TX_RX_H) */

+ 0 - 371
core/hdd/inc/wlan_hdd_wext.h

@@ -1,371 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WEXT_IW_H__
-#define __WEXT_IW_H__
-
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/netdevice.h>
-#include <linux/wireless.h>
-#include <net/iw_handler.h>
-#include <linux/timer.h>
-#include "cdf_event.h"
-
-/*
- * order of parameters in addTs private ioctl
- */
-#define HDD_WLAN_WMM_PARAM_HANDLE                       0
-#define HDD_WLAN_WMM_PARAM_TID                          1
-#define HDD_WLAN_WMM_PARAM_DIRECTION                    2
-#define HDD_WLAN_WMM_PARAM_APSD                         3
-#define HDD_WLAN_WMM_PARAM_USER_PRIORITY                4
-#define HDD_WLAN_WMM_PARAM_NOMINAL_MSDU_SIZE            5
-#define HDD_WLAN_WMM_PARAM_MAXIMUM_MSDU_SIZE            6
-#define HDD_WLAN_WMM_PARAM_MINIMUM_DATA_RATE            7
-#define HDD_WLAN_WMM_PARAM_MEAN_DATA_RATE               8
-#define HDD_WLAN_WMM_PARAM_PEAK_DATA_RATE               9
-#define HDD_WLAN_WMM_PARAM_MAX_BURST_SIZE              10
-#define HDD_WLAN_WMM_PARAM_MINIMUM_PHY_RATE            11
-#define HDD_WLAN_WMM_PARAM_SURPLUS_BANDWIDTH_ALLOWANCE 12
-#define HDD_WLAN_WMM_PARAM_SERVICE_INTERVAL            13
-#define HDD_WLAN_WMM_PARAM_SUSPENSION_INTERVAL         14
-#define HDD_WLAN_WMM_PARAM_BURST_SIZE_DEFN             15
-#define HDD_WLAN_WMM_PARAM_ACK_POLICY                  16
-#define HDD_WLAN_WMM_PARAM_INACTIVITY_INTERVAL         17
-#define HDD_WLAN_WMM_PARAM_MAX_SERVICE_INTERVAL        18
-#define HDD_WLAN_WMM_PARAM_COUNT                       19
-
-#define MHZ 6
-
-#define WE_MAX_STR_LEN                                 IW_PRIV_SIZE_MASK
-#define WLAN_HDD_UI_BAND_AUTO                          0
-#define WLAN_HDD_UI_BAND_5_GHZ                         1
-#define WLAN_HDD_UI_BAND_2_4_GHZ                       2
-/* SETBAND x */
-/* 012345678 */
-#define WLAN_HDD_UI_SET_BAND_VALUE_OFFSET              8
-
-typedef enum {
-	HDD_WLAN_WMM_DIRECTION_UPSTREAM = 0,
-	HDD_WLAN_WMM_DIRECTION_DOWNSTREAM = 1,
-	HDD_WLAN_WMM_DIRECTION_BIDIRECTIONAL = 2,
-} hdd_wlan_wmm_direction_e;
-
-typedef enum {
-	HDD_WLAN_WMM_POWER_SAVE_LEGACY = 0,
-	HDD_WLAN_WMM_POWER_SAVE_UAPSD = 1,
-} hdd_wlan_wmm_power_save_e;
-
-typedef enum {
-	/* TSPEC/re-assoc done, async */
-	HDD_WLAN_WMM_STATUS_SETUP_SUCCESS = 0,
-	/* no need to setup TSPEC since ACM=0 and no UAPSD desired, sync + async */
-	HDD_WLAN_WMM_STATUS_SETUP_SUCCESS_NO_ACM_NO_UAPSD = 1,
-	/* no need to setup TSPEC since ACM=0 and UAPSD already exists, sync + async */
-	HDD_WLAN_WMM_STATUS_SETUP_SUCCESS_NO_ACM_UAPSD_EXISTING = 2,
-	/* TSPEC result pending, sync */
-	HDD_WLAN_WMM_STATUS_SETUP_PENDING = 3,
-	/* TSPEC/re-assoc failed, sync + async */
-	HDD_WLAN_WMM_STATUS_SETUP_FAILED = 4,
-	/* Request rejected due to invalid params, sync + async */
-	HDD_WLAN_WMM_STATUS_SETUP_FAILED_BAD_PARAM = 5,
-	/* TSPEC request rejected since AP!=QAP, sync */
-	HDD_WLAN_WMM_STATUS_SETUP_FAILED_NO_WMM = 6,
-
-	/* TSPEC modification/re-assoc successful, async */
-	HDD_WLAN_WMM_STATUS_MODIFY_SUCCESS = 7,
-	/* TSPEC modification a no-op since ACM=0 and no change in UAPSD, sync + async */
-	HDD_WLAN_WMM_STATUS_MODIFY_SUCCESS_NO_ACM_NO_UAPSD = 8,
-	/* TSPEC modification a no-op since ACM=0 and requested U-APSD already exists, sync + async */
-	HDD_WLAN_WMM_STATUS_MODIFY_SUCCESS_NO_ACM_UAPSD_EXISTING = 9,
-	/* TSPEC result pending, sync */
-	HDD_WLAN_WMM_STATUS_MODIFY_PENDING = 10,
-	/* TSPEC modification failed, prev TSPEC in effect, sync + async */
-	HDD_WLAN_WMM_STATUS_MODIFY_FAILED = 11,
-	/* TSPEC modification request rejected due to invalid params, sync + async */
-	HDD_WLAN_WMM_STATUS_MODIFY_FAILED_BAD_PARAM = 12,
-
-	/* TSPEC release successful, sync and also async */
-	HDD_WLAN_WMM_STATUS_RELEASE_SUCCESS = 13,
-	/* TSPEC release pending, sync */
-	HDD_WLAN_WMM_STATUS_RELEASE_PENDING = 14,
-	/* TSPEC release failed, sync + async */
-	HDD_WLAN_WMM_STATUS_RELEASE_FAILED = 15,
-	/* TSPEC release rejected due to invalid params, sync */
-	HDD_WLAN_WMM_STATUS_RELEASE_FAILED_BAD_PARAM = 16,
-	/* TSPEC modified due to the mux'ing of requests on ACs, async */
-
-	HDD_WLAN_WMM_STATUS_MODIFIED = 17,
-	/* TSPEC revoked by AP, async */
-	HDD_WLAN_WMM_STATUS_LOST = 18,
-	/* some internal failure like memory allocation failure, etc, sync */
-	HDD_WLAN_WMM_STATUS_INTERNAL_FAILURE = 19,
-
-	/* U-APSD failed during setup but OTA setup (whether TSPEC exchnage or */
-	/* re-assoc) was done so app should release this QoS, async */
-	HDD_WLAN_WMM_STATUS_SETUP_UAPSD_SET_FAILED = 20,
-	/* U-APSD failed during modify, but OTA setup (whether TSPEC exchnage or */
-	/* re-assoc) was done so app should release this QoS, async */
-	HDD_WLAN_WMM_STATUS_MODIFY_UAPSD_SET_FAILED = 21
-} hdd_wlan_wmm_status_e;
-
-/** TS Info Ack Policy */
-typedef enum {
-	HDD_WLAN_WMM_TS_INFO_ACK_POLICY_NORMAL_ACK = 0,
-	HDD_WLAN_WMM_TS_INFO_ACK_POLICY_HT_IMMEDIATE_BLOCK_ACK = 1,
-} hdd_wlan_wmm_ts_info_ack_policy_e;
-
-/** Maximum Length of WPA/RSN IE */
-#define MAX_WPA_RSN_IE_LEN 40
-
-/** Enable 11d */
-#define ENABLE_11D  1
-
-/** Disable 11d */
-#define DISABLE_11D 0
-
-/*
-   refer wpa.h in wpa supplicant code for REASON_MICHAEL_MIC_FAILURE
-
-   supplicant sets REASON_MICHAEL_MIC_FAILURE as the reason code when it sends the MLME deauth IOCTL
-   for TKIP counter measures
- */
-#define HDD_REASON_MICHAEL_MIC_FAILURE 14
-
-/*
- * These are for TLV fields in WPS IE
- */
-#define HDD_WPS_UUID_LEN                    16
-#define HDD_WPS_ELEM_VERSION                0x104a
-#define HDD_WPS_ELEM_REQUEST_TYPE           0x103a
-#define HDD_WPS_ELEM_CONFIG_METHODS         0x1008
-#define HDD_WPS_ELEM_UUID_E                 0x1047
-#define HDD_WPS_ELEM_PRIMARY_DEVICE_TYPE    0x1054
-#define HDD_WPS_ELEM_RF_BANDS               0x103c
-#define HDD_WPS_ELEM_ASSOCIATION_STATE      0x1002
-#define HDD_WPS_ELEM_CONFIGURATION_ERROR    0x1009
-#define HDD_WPS_ELEM_DEVICE_PASSWORD_ID     0x1012
-
-#define HDD_WPA_ELEM_VENDOR_EXTENSION       0x1049
-
-#define HDD_WPS_MANUFACTURER_LEN            64
-#define HDD_WPS_MODEL_NAME_LEN              32
-#define HDD_WPS_MODEL_NUM_LEN               32
-#define HDD_WPS_SERIAL_NUM_LEN              32
-#define HDD_WPS_DEVICE_OUI_LEN               4
-#define HDD_WPS_DEVICE_NAME_LEN             32
-
-#define HDD_WPS_ELEM_WPS_STATE              0x1044
-#define HDD_WPS_ELEM_APSETUPLOCK            0x1057
-#define HDD_WPS_ELEM_SELECTEDREGISTRA       0x1041
-#define HDD_WPS_ELEM_RSP_TYPE               0x103B
-#define HDD_WPS_ELEM_MANUFACTURER           0x1021
-#define HDD_WPS_ELEM_MODEL_NAME             0x1023
-#define HDD_WPS_ELEM_MODEL_NUM              0x1024
-#define HDD_WPS_ELEM_SERIAL_NUM             0x1042
-#define HDD_WPS_ELEM_DEVICE_NAME            0x1011
-#define HDD_WPS_ELEM_REGISTRA_CONF_METHODS  0x1053
-
-#define HDD_RTSCTS_EN_MASK                  0xF
-#define HDD_RTSCTS_ENABLE                   1
-#define HDD_CTS_ENABLE                      2
-
-#define WPS_OUI_TYPE   "\x00\x50\xf2\x04"
-#define WPS_OUI_TYPE_SIZE  4
-
-#define SS_OUI_TYPE    "\x00\x16\x32"
-#define SS_OUI_TYPE_SIZE   3
-
-#define P2P_OUI_TYPE   "\x50\x6f\x9a\x09"
-#define P2P_OUI_TYPE_SIZE  4
-
-#define HS20_OUI_TYPE   "\x50\x6f\x9a\x10"
-#define HS20_OUI_TYPE_SIZE  4
-
-#define OSEN_OUI_TYPE   "\x50\x6f\x9a\x12"
-#define OSEN_OUI_TYPE_SIZE  4
-
-#ifdef WLAN_FEATURE_WFD
-#define WFD_OUI_TYPE   "\x50\x6f\x9a\x0a"
-#define WFD_OUI_TYPE_SIZE  4
-#endif
-
-typedef enum {
-	eWEXT_WPS_OFF = 0,
-	eWEXT_WPS_ON = 1,
-} hdd_wps_mode_e;
-
-/*
- * This structure contains the interface level (granularity)
- * configuration information in support of wireless extensions.
- */
-typedef struct hdd_wext_state_s {
-	/** The CSR "desired" Profile */
-	tCsrRoamProfile roamProfile;
-
-	/** BSSID to which connect request is received */
-	struct cdf_mac_addr req_bssId;
-
-	/** The association status code */
-	uint32_t statusCode;
-
-	/** wpa version WPA/WPA2/None*/
-	int32_t wpaVersion;
-
-	/**WPA or RSN IE*/
-	uint8_t WPARSNIE[MAX_WPA_RSN_IE_LEN];
-
-	/**gen IE */
-	tSirAddie genIE;
-
-	/**Additional IE for assoc */
-	tSirAddie assocAddIE;
-
-	/**auth key mgmt */
-	int32_t authKeyMgmt;
-
-	/* cdf event */
-	cdf_event_t hdd_cdf_event;
-
-	cdf_event_t scanevent;
-
-	/**Counter measure state, Started/Stopped*/
-	bool mTKIPCounterMeasures;
-
-	/**Completion Variable*/
-	struct completion completion_var;
-
-#ifdef FEATURE_WLAN_ESE
-	/* ESE state variables */
-	bool isESEConnection;
-	eCsrAuthType collectedAuthType; /* Collected from ALL SIOCSIWAUTH Ioctls. Will be negotiatedAuthType - in tCsrProfile */
-#endif
-} hdd_wext_state_t;
-
-typedef struct ccp_freq_chan_map_s {
-	/* List of frequencies */
-	uint32_t freq;
-	uint32_t chan;
-} hdd_freq_chan_map_t;
-
-/* Packet Types. */
-#define WLAN_KEEP_ALIVE_UNSOLICIT_ARP_RSP     2
-#define WLAN_KEEP_ALIVE_NULL_PKT              1
-
-#define wlan_hdd_get_wps_ie_ptr(ie, ie_len) \
-	wlan_hdd_get_vendor_oui_ie_ptr(WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE, ie, ie_len)
-
-#define wlan_hdd_get_p2p_ie_ptr(ie, ie_len) \
-	wlan_hdd_get_vendor_oui_ie_ptr(P2P_OUI_TYPE, P2P_OUI_TYPE_SIZE, ie, ie_len)
-
-#ifdef WLAN_FEATURE_WFD
-#define wlan_hdd_get_wfd_ie_ptr(ie, ie_len) \
-	wlan_hdd_get_vendor_oui_ie_ptr(WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE, ie, ie_len)
-#endif
-
-extern int hdd_unregister_wext(struct net_device *dev);
-extern int hdd_register_wext(struct net_device *dev);
-extern int hdd_wlan_get_freq(uint32_t chan, uint32_t *freq);
-extern int hdd_wlan_get_rts_threshold(hdd_adapter_t *pAdapter,
-				      union iwreq_data *wrqu);
-extern int hdd_wlan_get_frag_threshold(hdd_adapter_t *pAdapter,
-				       union iwreq_data *wrqu);
-extern void hdd_wlan_get_version(hdd_adapter_t *pAdapter,
-				 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,
-			       char *buffer, uint16_t buf_len);
-
-extern int iw_set_essid(struct net_device *dev,
-			struct iw_request_info *info,
-			union iwreq_data *wrqu, char *extra);
-
-extern int iw_get_essid(struct net_device *dev,
-			struct iw_request_info *info,
-			struct iw_point *dwrq, char *extra);
-
-extern int iw_set_ap_address(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu, char *extra);
-
-extern int iw_get_ap_address(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu, char *extra);
-
-extern int iw_set_auth(struct net_device *dev, struct iw_request_info *info,
-		       union iwreq_data *wrqu, char *extra);
-
-extern int iw_get_auth(struct net_device *dev, struct iw_request_info *info,
-		       union iwreq_data *wrqu, char *extra);
-
-extern int iw_set_var_ints_getnone(struct net_device *dev,
-				   struct iw_request_info *info,
-				   union iwreq_data *wrqu, char *extra);
-
-extern int iw_set_three_ints_getnone(struct net_device *dev,
-				     struct iw_request_info *info,
-				     union iwreq_data *wrqu, char *extra);
-
-extern int hdd_priv_get_data(struct iw_point *p_priv_data,
-			     union iwreq_data *wrqu);
-
-extern void *mem_alloc_copy_from_user_helper(const void *wrqu_data, size_t len);
-
-extern CDF_STATUS wlan_hdd_get_linkspeed_for_peermac(hdd_adapter_t *pAdapter,
-					     struct cdf_mac_addr mac_address);
-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,
-					uint8_t *ie, int ie_len);
-
-CDF_STATUS wlan_hdd_get_class_astats(hdd_adapter_t *pAdapter);
-
-CDF_STATUS wlan_hdd_get_station_stats(hdd_adapter_t *pAdapter);
-
-CDF_STATUS wlan_hdd_get_rssi(hdd_adapter_t *pAdapter, int8_t *rssi_value);
-
-CDF_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, int8_t *snr);
-
-#ifdef FEATURE_WLAN_TDLS
-CDF_STATUS iw_set_tdls_params(struct net_device *dev,
-			      struct iw_request_info *info,
-			      union iwreq_data *wrqu, char *extra, int nOffset);
-#endif
-
-void wlan_hdd_change_country_code_callback(void *pAdapter);
-
-int hdd_set_band(struct net_device *dev, u8 ui_band);
-int hdd_set_band_helper(struct net_device *dev, const char *command);
-int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal,
-			    int new_phymode, hdd_context_t *phddctx);
-
-int wlan_hdd_get_temperature(hdd_adapter_t *pAdapter, int *temperature);
-int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed);
-#endif /* __WEXT_IW_H__ */

+ 0 - 404
core/hdd/inc/wlan_hdd_wmm.h

@@ -1,404 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _WLAN_HDD_WMM_H
-#define _WLAN_HDD_WMM_H
-
-/**
- * DOC: HDD WMM
- *
- * This module (wlan_hdd_wmm.h interface + wlan_hdd_wmm.c implementation)
- * houses all the logic for WMM in HDD.
- *
- * On the control path, it has the logic to setup QoS, modify QoS and delete
- * QoS (QoS here refers to a TSPEC). The setup QoS comes in two flavors: an
- * explicit application invoked and an internal HDD invoked.  The implicit QoS
- * is for applications that do NOT call the custom QCT WLAN OIDs for QoS but
- * which DO mark their traffic for priortization. It also has logic to start,
- * update and stop the U-APSD trigger frame generation. It also has logic to
- * read WMM related config parameters from the registry.
- *
- * On the data path, it has the logic to figure out the WMM AC of an egress
- * packet and when to signal TL to serve a particular AC queue. It also has the
- * logic to retrieve a packet based on WMM priority in response to a fetch from
- * TL.
- *
- * The remaining functions are utility functions for information hiding.
- */
-
-/* Include files */
-#include <linux/workqueue.h>
-#include <linux/list.h>
-#include <wlan_hdd_main.h>
-#include <wlan_hdd_wext.h>
-#include <sme_qos_api.h>
-
-/*Maximum number of ACs */
-#define WLAN_MAX_AC                         4
-
-
-/* Preprocessor Definitions and Constants */
-
-/* #define HDD_WMM_DEBUG 1 */
-
-#define HDD_WMM_CTX_MAGIC 0x574d4d58    /* "WMMX" */
-
-#define HDD_WMM_HANDLE_IMPLICIT 0xFFFFFFFF
-
-#define HDD_WLAN_INVALID_STA_ID 0xFF
-
-/* Type Declarations */
-
-/**
- * enum hdd_wmm_classification: types of classification supported
- */
-typedef enum hdd_wmm_classification {
-	HDD_WMM_CLASSIFICATION_DSCP = 0,
-	HDD_WMM_CLASSIFICATION_802_1Q = 1
-} hdd_wmm_classification_t;
-
-/**
- * enum hdd_wmm_user_mode - WMM modes of operation
- *
- * @HDD_WMM_USER_MODE_AUTO: STA can associate with any AP, & HDD looks at
- *	the SME notification after association to find out if associated
- *	with QAP and acts accordingly
- * @HDD_WMM_USER_MODE_QBSS_ONLY - SME will add the extra logic to make sure
- *	STA associates with a QAP only
- * @HDD_WMM_USER_MODE_NO_QOS - SME will not join a QoS AP, unless the phy
- *	mode setting says "Auto". In that case, STA is free to join 11n AP.
- *	Although from HDD point of view, it will not be doing any packet
- *	classifications.
- */
-typedef enum hdd_wmm_user_mode {
-	HDD_WMM_USER_MODE_AUTO = 0,
-	HDD_WMM_USER_MODE_QBSS_ONLY = 1,
-	HDD_WMM_USER_MODE_NO_QOS = 2,
-} hdd_wmm_user_mode_t;
-
-/* UAPSD Mask bits */
-/* (Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE all other bits are ignored) */
-#define HDD_AC_VO 0x1
-#define HDD_AC_VI 0x2
-#define HDD_AC_BK 0x4
-#define HDD_AC_BE 0x8
-
-/**
- * struct hdd_wmm_qos_context - HDD WMM QoS Context
- *
- * This structure holds the context for a single flow which has either
- * been confgured explicitly from userspace or implicitly via the
- * Implicit QoS feature.
- *
- * @node: list node which can be used to put the context into a list
- *	of contexts
- * @handle: identifer which uniquely identifies this context to userspace
- * @qosFlowID: identifier which uniquely identifies this flow to SME
- * @pAdapter: adapter upon which this flow was configured
- * @acType: access category for this flow
- * @lastStatus: the status of the last operation performed on this flow by SME
- * @wmmAcSetupImplicitQos: work structure used for deferring implicit QoS work
- *	from softirq context to thread context
- * @magic: magic number used to verify that this is a valid context when
- *	referenced anonymously
- */
-typedef struct hdd_wmm_qos_context {
-	struct list_head node;
-	uint32_t handle;
-	uint32_t qosFlowId;
-	hdd_adapter_t *pAdapter;
-	sme_ac_enum_type acType;
-	hdd_wlan_wmm_status_e lastStatus;
-	struct work_struct wmmAcSetupImplicitQos;
-	uint32_t magic;
-	bool is_inactivity_timer_running;
-} hdd_wmm_qos_context_t;
-
-/**
- * struct hdd_wmm_ac_status - WMM related per-AC state & status info
- * @wmmAcAccessRequired - does the AP require access to this AC?
- * @wmmAcAccessNeeded - does the worker thread need to acquire access to
- *	this AC?
- * @wmmAcAccessPending - is implicit QoS negotiation currently taking place?
- * @wmmAcAccessFailed - has implicit QoS negotiation already failed?
- * @wmmAcAccessGranted - has implicit QoS negotiation already succeeded?
- * @wmmAcAccessAllowed - is access to this AC allowed, either because we
- *	are not doing WMM, we are not doing implicit QoS, implict QoS has
- *	completed, or explicit QoS has completed?
- * @wmmAcTspecValid - is the wmmAcTspecInfo valid?
- * @wmmAcUapsdInfoValid - are the wmmAcUapsd* fields valid?
- * @wmmAcTspecInfo - current (possibly aggregate) Tspec for this AC
- * @wmmAcIsUapsdEnabled - is UAPSD enabled on this AC?
- * @wmmAcUapsdServiceInterval - service interval for this AC
- * @wmmAcUapsdSuspensionInterval - suspension interval for this AC
- * @wmmAcUapsdDirection - direction for this AC
- * @wmmInactivityTime - inactivity time for this AC
- * @wmmPrevTrafficCnt - TX counter used for inactivity detection
- * @wmmInactivityTimer - timer used for inactivity detection
- */
-typedef struct hdd_wmm_ac_status {
-	bool wmmAcAccessRequired;
-	bool wmmAcAccessNeeded;
-	bool wmmAcAccessPending;
-	bool wmmAcAccessFailed;
-	bool wmmAcAccessGranted;
-	bool wmmAcAccessAllowed;
-	bool wmmAcTspecValid;
-	bool wmmAcUapsdInfoValid;
-	sme_QosWmmTspecInfo wmmAcTspecInfo;
-	bool wmmAcIsUapsdEnabled;
-	uint32_t wmmAcUapsdServiceInterval;
-	uint32_t wmmAcUapsdSuspensionInterval;
-	sme_QosWmmDirType wmmAcUapsdDirection;
-
-#ifdef FEATURE_WLAN_ESE
-	uint32_t wmmInactivityTime;
-	uint32_t wmmPrevTrafficCnt;
-	cdf_mc_timer_t wmmInactivityTimer;
-#endif
-
-} hdd_wmm_ac_status_t;
-
-/**
- * struct hdd_wmm_status - WMM status maintained per-adapter
- * @wmmContextList - list of WMM contexts active on the adapter
- * @wmmLock - mutex used for exclusive access to this adapter's WMM status
- * @wmmACStatus - per-AC WMM status
- * @wmmQap - is this connected to a QoS-enabled AP?
- * @wmmQosConnection - is this a QoS connection?
- */
-typedef struct hdd_wmm_status {
-	struct list_head wmmContextList;
-	struct mutex wmmLock;
-	hdd_wmm_ac_status_t wmmAcStatus[WLAN_MAX_AC];
-	bool wmmQap;
-	bool wmmQosConnection;
-} hdd_wmm_status_t;
-
-extern const uint8_t hdd_qdisc_ac_to_tl_ac[];
-extern const uint8_t hdd_wmm_up_to_ac_map[];
-extern const uint8_t hdd_linux_up_to_ac_map[];
-
-#define WLAN_HDD_MAX_DSCP 0x3f
-
-/**
- * hdd_wmmps_helper() - Function to set uapsd psb dynamically
- *
- * @pAdapter: [in] pointer to adapter structure
- * @ptr: [in] pointer to command buffer
- *
- * Return: Zero on success, appropriate error on failure.
- */
-int hdd_wmmps_helper(hdd_adapter_t *pAdapter, uint8_t *ptr);
-
-/**
- * hdd_wmm_init() - initialize the WMM DSCP configuation
- * @pAdapter : [in]  pointer to Adapter context
- *
- * This function will initialize the WMM DSCP configuation of an
- * adapter to an initial state.  The configuration can later be
- * overwritten via application APIs or via QoS Map sent OTA.
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_init(hdd_adapter_t *pAdapter);
-
-/**
- * hdd_wmm_adapter_init() - initialize the WMM configuration of an adapter
- * @pAdapter: [in]  pointer to Adapter context
- *
- * This function will initialize the WMM configuation and status of an
- * adapter to an initial state.  The configuration can later be
- * overwritten via application APIs
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_adapter_init(hdd_adapter_t *pAdapter);
-
-/**
- * hdd_wmm_close() - WMM close function
- * @pAdapter: [in]  pointer to adapter context
- *
- * Function which will perform any necessary work to to clean up the
- * WMM functionality prior to the kernel module unload.
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_adapter_close(hdd_adapter_t *pAdapter);
-
-/**
- * hdd_wmm_select_queue() - Function which will classify the packet
- *       according to linux qdisc expectation.
- *
- * @dev: [in] pointer to net_device structure
- * @skb: [in] pointer to os packet
- *
- * Return: Qdisc queue index
- */
-uint16_t hdd_wmm_select_queue(struct net_device *dev, struct sk_buff *skb);
-
-/**
- * hdd_hostapd_select_queue() - Function which will classify the packet
- *       according to linux qdisc expectation.
- *
- * @dev: [in] pointer to net_device structure
- * @skb: [in] pointer to os packet
- *
- * Return: Qdisc queue index
- */
-uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
-				  , void *accel_priv
-#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-				  , select_queue_fallback_t fallback
-#endif
-);
-
-/**
- * hdd_wmm_acquire_access_required() - Function which will determine
- * acquire admittance for a WMM AC is required or not based on psb configuration
- * done in framework
- *
- * @pAdapter: [in] pointer to adapter structure
- * @acType: [in] WMM AC type of OS packet
- *
- * Return: void
- */
-void hdd_wmm_acquire_access_required(hdd_adapter_t *pAdapter,
-				     sme_ac_enum_type acType);
-
-/**
- * hdd_wmm_acquire_access() - Function which will attempt to acquire
- * admittance for a WMM AC
- *
- * @pAdapter: [in]  pointer to adapter context
- * @acType: [in]  WMM AC type of OS packet
- * @pGranted: [out] pointer to bool flag when indicates if access
- *	      has been granted or not
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_acquire_access(hdd_adapter_t *pAdapter,
-				  sme_ac_enum_type acType, bool *pGranted);
-
-/**
- * hdd_wmm_assoc() - Function which will handle the housekeeping
- * required by WMM when association takes place
- *
- * @pAdapter: [in]  pointer to adapter context
- * @pRoamInfo: [in]  pointer to roam information
- * @eBssType: [in]  type of BSS
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_assoc(hdd_adapter_t *pAdapter,
-			 tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType);
-
-/**
- * hdd_wmm_connect() - Function which will handle the housekeeping
- * required by WMM when a connection is established
- *
- * @pAdapter : [in]  pointer to adapter context
- * @pRoamInfo: [in]  pointer to roam information
- * @eBssType : [in]  type of BSS
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_connect(hdd_adapter_t *pAdapter,
-			   tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType);
-
-/**
- * hdd_wmm_get_uapsd_mask() - Function which will calculate the
- * initial value of the UAPSD mask based upon the device configuration
- *
- * @pAdapter  : [in]  pointer to adapter context
- * @pUapsdMask: [out] pointer to where the UAPSD Mask is to be stored
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_get_uapsd_mask(hdd_adapter_t *pAdapter,
-				  uint8_t *pUapsdMask);
-
-/**
- * hdd_wmm_is_active() - Function which will determine if WMM is
- * active on the current connection
- *
- * @pAdapter: [in]  pointer to adapter context
- *
- * Return: true if WMM is enabled, false if WMM is not enabled
- */
-bool hdd_wmm_is_active(hdd_adapter_t *pAdapter);
-
-/**
- * hdd_wmm_addts() - Function which will add a traffic spec at the
- * request of an application
- *
- * @pAdapter  : [in]  pointer to adapter context
- * @handle    : [in]  handle to uniquely identify a TS
- * @pTspec    : [in]  pointer to the traffic spec
- *
- * Return: HDD_WLAN_WMM_STATUS_*
- */
-hdd_wlan_wmm_status_e hdd_wmm_addts(hdd_adapter_t *pAdapter,
-				    uint32_t handle,
-				    sme_QosWmmTspecInfo *pTspec);
-
-/**
- * hdd_wmm_delts() - Function which will delete a traffic spec at the
- * request of an application
- *
- * @pAdapter: [in]  pointer to adapter context
- * @handle: [in]  handle to uniquely identify a TS
- *
- * Return: HDD_WLAN_WMM_STATUS_*
- */
-hdd_wlan_wmm_status_e hdd_wmm_delts(hdd_adapter_t *pAdapter, uint32_t handle);
-
-/**
- * hdd_wmm_checkts() - Function which will return the status of a traffic
- * spec at the request of an application
- *
- * @pAdapter: [in]  pointer to adapter context
- * @handle: [in]  handle to uniquely identify a TS
- *
- * Return: HDD_WLAN_WMM_STATUS_*
- */
-hdd_wlan_wmm_status_e hdd_wmm_checkts(hdd_adapter_t *pAdapter,
-				      uint32_t handle);
-/**
- * hdd_wmm_adapter_clear() - Function which will clear the WMM status
- * for all the ACs
- *
- * @pAdapter: [in]  pointer to Adapter context
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_wmm_adapter_clear(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_process_peer_unauthorised_pause(hdd_adapter_t *adapter);
-#endif /* #ifndef _WLAN_HDD_WMM_H */

+ 0 - 183
core/hdd/inc/wlan_hdd_wowl.h

@@ -1,183 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef _WLAN_HDD_WOWL_H
-#define _WLAN_HDD_WOWL_H
-
-/**
- * DOC: wlan_hdd_wowl
- *
- * This module houses all the logic for WOWL in HDD.
- *
- * It provides the following APIs
- *
- * - Ability to enable/disable following WoWL modes
- *  1) Magic packet (MP) mode
- *  2) Pattern Byte Matching (PBM) mode
- * - Ability to add/remove patterns for PBM
- *
- * A Magic Packet is a packet that contains 6 0xFFs followed by 16
- * contiguous copies of the receiving NIC's Ethernet address. There is
- * no API to configure Magic Packet Pattern.
- *
- * Wakeup pattern (used for PBM) is defined as following:
- * typedef struct
- * {
- *  U8  PatternSize;                  // Non-Zero pattern size
- *  U8  PatternMaskSize;              // Non-zero pattern mask size
- *  U8  PatternMask[PatternMaskSize]; // Pattern mask
- *  U8  Pattern[PatternSize];         // Pattern
- * } hdd_wowl_ptrn_t;
- *
- * PatternSize and PatternMaskSize indicate size of the variable
- * length Pattern and PatternMask. PatternMask indicates which bytes
- * of an incoming packet should be compared with corresponding bytes
- * in the pattern.
- *
- * Maximum allowed pattern size is 128 bytes. Maximum allowed
- * PatternMaskSize is 16 bytes.
- *
- * Maximum number of patterns that can be configured is 8
- *
- * HDD will add following 2 commonly used patterns for PBM by default:
- *  1) ARP Broadcast Pattern
- *  2) Unicast Pattern
- *
- * However note that WoWL will not be enabled by default by HDD. WoWL
- * needs to enabled explcitly by exercising the iwpriv command.
- *
- * HDD will expose an API that accepts patterns as Hex string in the
- * following format:
- * "PatternSize:PatternMaskSize:PatternMask:Pattern"
- *
- * Multiple patterns can be specified by deleimiting each pattern with
- * the ';' token:
- * "PatternSize1:PatternMaskSize1:PatternMask1:Pattern1;PatternSize2:..."
- *
- * Patterns can be configured dynamically via iwpriv cmd or statically
- * via qcom_cfg.ini file
- *
- * PBM (when enabled) can perform filtering on unicast data or
- * broadcast data or both. These configurations are part of factory
- * defaults (cfg.dat) and the deafult behavior is to perform filtering
- * on both unicast and data frames.
- *
- * MP filtering (when enabled) is performed ALWAYS on both unicast and
- * broadcast data frames.
- *
- * Mangement frames are not subjected to WoWL filtering and are
- * discarded when WoWL is enabled.
- *
- * Whenever a patern match succeeds, RX path is restored and packets
- * (both management and data) will be pushed to the host from that
- * point onwards.  Therefore, exit from WoWL is implicit and happens
- * automatically when the first packet match succeeds.
- *
- * WoWL works on top of BMPS. So when WoWL is requested, SME will
- * attempt to put the device in BMPS mode (if not already in BMPS). If
- * attempt to BMPS fails, request for WoWL will be rejected.
- */
-
-#include <cdf_types.h>
-
-#define WOWL_PTRN_MAX_SIZE          146
-#define WOWL_PTRN_MASK_MAX_SIZE      19
-#define WOWL_MAX_PTRNS_ALLOWED       CFG_MAX_WOW_FILTERS_MAX
-
-/**
- * hdd_add_wowl_ptrn() - Function which will add the WoWL pattern to be
- *			 used when PBM filtering is enabled
- * @pAdapter: pointer to the adapter
- * @ptrn: pointer to the pattern string to be added
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_add_wowl_ptrn(hdd_adapter_t *pAdapter, const char *ptrn);
-
-/**
- * hdd_del_wowl_ptrn() - Function which will remove a WoWL pattern
- * @pAdapter: pointer to the adapter
- * @ptrn: pointer to the pattern string to be removed
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_del_wowl_ptrn(hdd_adapter_t *pAdapter, const char *ptrn);
-
-/**
- * hdd_add_wowl_ptrn_debugfs() - Function which will add a WoW pattern
- *				 sent from debugfs interface
- * @pAdapter: pointer to the adapter
- * @pattern_idx: index of the pattern to be added
- * @pattern_offset: offset of the pattern in the frame payload
- * @pattern_buf: pointer to the pattern hex string to be added
- * @pattern_mask: pointer to the pattern mask hex string
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_add_wowl_ptrn_debugfs(hdd_adapter_t *pAdapter, uint8_t pattern_idx,
-			       uint8_t pattern_offset, char *pattern_buf,
-			       char *pattern_mask);
-
-/**
- * hdd_del_wowl_ptrn_debugfs() - Function which will remove a WoW pattern
- *				 sent from debugfs interface
- * @pAdapter: pointer to the adapter
- * @pattern_idx: index of the pattern to be removed
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_del_wowl_ptrn_debugfs(hdd_adapter_t *pAdapter, uint8_t pattern_idx);
-
-/**
- * hdd_enter_wowl() - Function which will enable WoWL. At least one
- *		      of MP and PBM must be enabled
- * @pAdapter: pointer to the adapter
- * @enable_mp: Whether to enable magic packet WoWL mode
- * @enable_pbm: Whether to enable pattern byte matching WoWL mode
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_enter_wowl(hdd_adapter_t *pAdapter, bool enable_mp, bool enable_pbm);
-
-/**
- * hdd_exit_wowl() - Function which will disable WoWL
- * @pAdapter: pointer to the adapter
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_exit_wowl(hdd_adapter_t *pAdapter);
-
-/**
- * hdd_init_wowl() - Init function which will initialize the WoWL module
- *		     and perform any required initial configuration
- * @pAdapter: pointer to the adapter
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_init_wowl(hdd_adapter_t *pAdapter);
-
-#endif /* #ifndef _WLAN_HDD_WOWL_H */

+ 0 - 5491
core/hdd/src/wlan_hdd_assoc.c

@@ -1,5491 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- *  DOC: wlan_hdd_assoc.c
- *
- *  WLAN Host Device Driver implementation
- *
- */
-
-#include "wlan_hdd_includes.h"
-#include <ani_global.h>
-#include "dot11f.h"
-#include "wlan_hdd_power.h"
-#include "wlan_hdd_trace.h"
-#include <linux/ieee80211.h>
-#include <linux/wireless.h>
-#include <linux/etherdevice.h>
-#include <net/cfg80211.h>
-#include "wlan_hdd_cfg80211.h"
-#include "csr_inside_api.h"
-#include "wlan_hdd_p2p.h"
-#ifdef FEATURE_WLAN_TDLS
-#include "wlan_hdd_tdls.h"
-#endif
-#include "sme_api.h"
-#include "wlan_hdd_hostapd.h"
-#include <wlan_hdd_ipa.h>
-#include <cds_sched.h>
-#include "cds_concurrency.h"
-#include "sme_power_save_api.h"
-#include "ol_txrx_ctrl_api.h"
-#include "ol_txrx_types.h"
-
-/* These are needed to recognize WPA and RSN suite types */
-#define HDD_WPA_OUI_SIZE 4
-#define HDD_RSN_OUI_SIZE 4
-uint8_t ccp_wpa_oui00[HDD_WPA_OUI_SIZE] = { 0x00, 0x50, 0xf2, 0x00 };
-uint8_t ccp_wpa_oui01[HDD_WPA_OUI_SIZE] = { 0x00, 0x50, 0xf2, 0x01 };
-uint8_t ccp_wpa_oui02[HDD_WPA_OUI_SIZE] = { 0x00, 0x50, 0xf2, 0x02 };
-uint8_t ccp_wpa_oui03[HDD_WPA_OUI_SIZE] = { 0x00, 0x50, 0xf2, 0x03 };
-uint8_t ccp_wpa_oui04[HDD_WPA_OUI_SIZE] = { 0x00, 0x50, 0xf2, 0x04 };
-uint8_t ccp_wpa_oui05[HDD_WPA_OUI_SIZE] = { 0x00, 0x50, 0xf2, 0x05 };
-
-#ifdef FEATURE_WLAN_ESE
-/* CCKM */
-uint8_t ccp_wpa_oui06[HDD_WPA_OUI_SIZE] = { 0x00, 0x40, 0x96, 0x00 };
-/* CCKM */
-uint8_t ccp_rsn_oui06[HDD_RSN_OUI_SIZE] = { 0x00, 0x40, 0x96, 0x00 };
-#endif /* FEATURE_WLAN_ESE */
-
-/* group cipher */
-uint8_t ccp_rsn_oui00[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x00 };
-
-/* WEP-40 or RSN */
-uint8_t ccp_rsn_oui01[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x01 };
-
-/* TKIP or RSN-PSK */
-uint8_t ccp_rsn_oui02[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x02 };
-
-/* Reserved */
-uint8_t ccp_rsn_oui03[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x03 };
-
-/* AES-CCMP */
-uint8_t ccp_rsn_oui04[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x04 };
-
-/* WEP-104 */
-uint8_t ccp_rsn_oui05[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x05 };
-
-#ifdef WLAN_FEATURE_11W
-/* RSN-PSK-SHA256 */
-uint8_t ccp_rsn_oui07[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x06 };
-
-/* RSN-8021X-SHA256 */
-uint8_t ccp_rsn_oui08[HDD_RSN_OUI_SIZE] = { 0x00, 0x0F, 0xAC, 0x05 };
-#endif
-
-#if defined(WLAN_FEATURE_VOWIFI_11R)
-/* Offset where the EID-Len-IE, start. */
-#define FT_ASSOC_RSP_IES_OFFSET 6  /* Capability(2) + AID(2) + Status Code(2) */
-#define FT_ASSOC_REQ_IES_OFFSET 4  /* Capability(2) + LI(2) */
-#endif
-
-#define BEACON_FRAME_IES_OFFSET 12
-#define HDD_PEER_AUTHORIZE_WAIT 10
-
-/**
- * hdd_conn_set_authenticated() - set authentication state
- * @pAdapter: pointer to the adapter
- * @authState: authentication state
- *
- * This function updates the global HDD station context
- * authentication state.
- *
- * Return: none
- */
-static void
-hdd_conn_set_authenticated(hdd_adapter_t *pAdapter, uint8_t authState)
-{
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	/* save the new connection state */
-	hddLog(LOG1,
-	       FL("Authenticated state Changed from oldState:%d to State:%d"),
-	       pHddStaCtx->conn_info.uIsAuthenticated, authState);
-	pHddStaCtx->conn_info.uIsAuthenticated = authState;
-
-	/* Check is pending ROC request or not when auth state changed */
-	schedule_delayed_work(&pHddCtx->roc_req_work, 0);
-}
-
-/**
- * hdd_conn_set_connection_state() - set connection state
- * @pAdapter: pointer to the adapter
- * @connState: connection state
- *
- * This function updates the global HDD station context connection state.
- *
- * Return: none
- */
-void hdd_conn_set_connection_state(hdd_adapter_t *pAdapter,
-				   eConnectionState connState)
-{
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	/* save the new connection state */
-	hddLog(LOG1, FL("ConnectionState Changed from oldState:%d to State:%d"),
-	       pHddStaCtx->conn_info.connState, connState);
-	pHddStaCtx->conn_info.connState = connState;
-
-	/* Check is pending ROC request or not when connection state changed */
-	schedule_delayed_work(&pHddCtx->roc_req_work, 0);
-}
-
-/**
- * hdd_conn_get_connection_state() - get connection state
- * @pAdapter: pointer to the adapter
- * @pConnState: pointer to connection state
- *
- * This function updates the global HDD station context connection state.
- *
- * Return: true if (Infra Associated or IBSS Connected)
- *	and sets output parameter pConnState;
- *	false otherwise
- */
-static inline bool hdd_conn_get_connection_state(hdd_station_ctx_t *pHddStaCtx,
-						 eConnectionState *pConnState)
-{
-	bool fConnected = false;
-	eConnectionState connState;
-
-	/* get the connection state. */
-	connState = pHddStaCtx->conn_info.connState;
-
-	if (eConnectionState_Associated == connState ||
-	    eConnectionState_IbssConnected == connState ||
-	    eConnectionState_IbssDisconnected == connState) {
-		fConnected = true;
-	}
-
-	if (pConnState)
-		*pConnState = connState;
-
-	return fConnected;
-}
-
-/**
- * hdd_is_connecting() - Function to check connection progress
- * @hdd_sta_ctx:    pointer to global HDD Station context
- *
- * Return: true if connecting, false otherwise
- */
-bool hdd_is_connecting(hdd_station_ctx_t *hdd_sta_ctx)
-{
-	return hdd_sta_ctx->conn_info.connState ==
-		eConnectionState_Connecting;
-}
-
-/**
- * hdd_conn_is_connected() - Function to check connection status
- * @pHddStaCtx:    pointer to global HDD Station context
- *
- * Return: false if any errors encountered, true otherwise
- */
-bool hdd_conn_is_connected(hdd_station_ctx_t *pHddStaCtx)
-{
-	return hdd_conn_get_connection_state(pHddStaCtx, NULL);
-}
-
-/**
- * hdd_conn_get_connected_band() - get current connection radio band
- * @pHddStaCtx:    pointer to global HDD Station context
- *
- * Return: eCSR_BAND_24 or eCSR_BAND_5G based on current AP connection
- *	eCSR_BAND_ALL if not connected
- */
-eCsrBand hdd_conn_get_connected_band(hdd_station_ctx_t *pHddStaCtx)
-{
-	uint8_t staChannel = 0;
-
-	if (eConnectionState_Associated == pHddStaCtx->conn_info.connState)
-		staChannel = pHddStaCtx->conn_info.operationChannel;
-
-	if (staChannel > 0 && staChannel < 14)
-		return eCSR_BAND_24;
-	else if (staChannel >= 36 && staChannel <= 184)
-		return eCSR_BAND_5G;
-	else   /* If station is not connected return as eCSR_BAND_ALL */
-		return eCSR_BAND_ALL;
-}
-
-/**
- * hdd_conn_get_connected_cipher_algo() - get current connection cipher type
- * @pHddStaCtx: pointer to global HDD Station context
- * @pConnectedCipherAlgo: pointer to connected cipher algo
- *
- * Return: false if any errors encountered, true otherwise
- */
-static inline bool
-hdd_conn_get_connected_cipher_algo(hdd_station_ctx_t *pHddStaCtx,
-				   eCsrEncryptionType *pConnectedCipherAlgo)
-{
-	bool fConnected = false;
-
-	fConnected = hdd_conn_get_connection_state(pHddStaCtx, NULL);
-
-	if (pConnectedCipherAlgo)
-		*pConnectedCipherAlgo = pHddStaCtx->conn_info.ucEncryptionType;
-
-	return fConnected;
-}
-
-/**
- * hdd_conn_get_connected_bss_type() - get current bss type
- * @pHddStaCtx: pointer to global HDD Station context
- * @pConnectedBssType: pointer to connected bss type
- *
- * Return: false if any errors encountered, true otherwise
- */
-inline bool
-hdd_conn_get_connected_bss_type(hdd_station_ctx_t *pHddStaCtx,
-				eMib_dot11DesiredBssType *pConnectedBssType)
-{
-	bool fConnected = false;
-
-	fConnected = hdd_conn_get_connection_state(pHddStaCtx, NULL);
-
-	if (pConnectedBssType) {
-		*pConnectedBssType =
-			pHddStaCtx->conn_info.connDot11DesiredBssType;
-	}
-
-	return fConnected;
-}
-
-/**
- * hdd_conn_save_connected_bss_type() - set connected bss type
- * @pHddStaCtx: pointer to global HDD Station context
- * @csr_roamBssType: bss type
- *
- * Return: none
- */
-static inline void
-hdd_conn_save_connected_bss_type(hdd_station_ctx_t *pHddStaCtx,
-				 eCsrRoamBssType csr_roamBssType)
-{
-	switch (csr_roamBssType) {
-	case eCSR_BSS_TYPE_INFRASTRUCTURE:
-		pHddStaCtx->conn_info.connDot11DesiredBssType =
-			eMib_dot11DesiredBssType_infrastructure;
-		break;
-
-	case eCSR_BSS_TYPE_IBSS:
-	case eCSR_BSS_TYPE_START_IBSS:
-		pHddStaCtx->conn_info.connDot11DesiredBssType =
-			eMib_dot11DesiredBssType_independent;
-		break;
-
-	/** We will never set the BssType to 'any' when attempting a connection
-	      so CSR should never send this back to us.*/
-	case eCSR_BSS_TYPE_ANY:
-	default:
-		CDF_ASSERT(0);
-		break;
-	}
-}
-
-/**
- * hdd_conn_save_connect_info() - save current connection information
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @eBssType: bss type
- *
- * Return: none
- */
-static void
-hdd_conn_save_connect_info(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo,
-			   eCsrRoamBssType eBssType)
-{
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	eCsrEncryptionType encryptType = eCSR_ENCRYPT_TYPE_NONE;
-
-	CDF_ASSERT(pRoamInfo);
-
-	if (pRoamInfo) {
-		/* Save the BSSID for the connection */
-		if (eCSR_BSS_TYPE_INFRASTRUCTURE == eBssType) {
-			CDF_ASSERT(pRoamInfo->pBssDesc);
-			cdf_copy_macaddr(&pHddStaCtx->conn_info.bssId,
-					 &pRoamInfo->bssid);
-
-			/*
-			 * Save the Station ID for this station from
-			 * the 'Roam Info'. For IBSS mode, staId is
-			 * assigned in NEW_PEER_IND. For reassoc,
-			 * the staID doesn't change and it may be invalid
-			 * in this structure so no change here.
-			 */
-			if (!pRoamInfo->fReassocReq) {
-				pHddStaCtx->conn_info.staId[0] =
-					pRoamInfo->staId;
-			}
-		} else if (eCSR_BSS_TYPE_IBSS == eBssType) {
-			cdf_copy_macaddr(&pHddStaCtx->conn_info.bssId,
-					 &pRoamInfo->bssid);
-		} else {
-			/*
-			 * can't happen. We need a valid IBSS or Infra setting
-			 * in the BSSDescription or we can't function.
-			 */
-			CDF_ASSERT(0);
-		}
-
-		/* notify WMM */
-		hdd_wmm_connect(pAdapter, pRoamInfo, eBssType);
-
-		if (!pRoamInfo->u.pConnectedProfile) {
-			CDF_ASSERT(pRoamInfo->u.pConnectedProfile);
-		} else {
-			/* Get Multicast Encryption Type */
-			encryptType =
-			    pRoamInfo->u.pConnectedProfile->mcEncryptionType;
-			pHddStaCtx->conn_info.mcEncryptionType = encryptType;
-			/* Get Unicast Encryption Type */
-			encryptType =
-				pRoamInfo->u.pConnectedProfile->EncryptionType;
-			pHddStaCtx->conn_info.ucEncryptionType = encryptType;
-
-			pHddStaCtx->conn_info.authType =
-				pRoamInfo->u.pConnectedProfile->AuthType;
-
-			pHddStaCtx->conn_info.operationChannel =
-			    pRoamInfo->u.pConnectedProfile->operationChannel;
-
-			/* Save the ssid for the connection */
-			cdf_mem_copy(&pHddStaCtx->conn_info.SSID.SSID,
-				     &pRoamInfo->u.pConnectedProfile->SSID,
-				     sizeof(tSirMacSSid));
-
-			/* Save dot11mode in which STA associated to AP */
-			pHddStaCtx->conn_info.dot11Mode =
-				pRoamInfo->u.pConnectedProfile->dot11Mode;
-
-			pHddStaCtx->conn_info.proxyARPService =
-				pRoamInfo->u.pConnectedProfile->proxyARPService;
-
-			pHddStaCtx->conn_info.nss = pRoamInfo->chan_info.nss;
-
-			pHddStaCtx->conn_info.rate_flags =
-				pRoamInfo->chan_info.rate_flags;
-		}
-	}
-	/* save the connected BssType */
-	hdd_conn_save_connected_bss_type(pHddStaCtx, eBssType);
-}
-
-#if defined(WLAN_FEATURE_VOWIFI_11R)
-/**
- * hdd_send_ft_assoc_response() - send fast transition assoc response
- * @dev: pointer to net device
- * @pAdapter: pointer to adapter
- * @pCsrRoamInfo: pointer to roam info
- *
- * Send the 11R key information to the supplicant. Only then can the supplicant
- * generate the PMK-R1. (BTW, the ESE supplicant also needs the Assoc Resp IEs
- * for the same purpose.)
- *
- * Mainly the Assoc Rsp IEs are passed here. For the IMDA this contains the
- * R1KHID, R0KHID and the MDID. For FT, this consists of the Reassoc Rsp FTIEs.
- * This is the Assoc Response.
- *
- * Return: none
- */
-static void
-hdd_send_ft_assoc_response(struct net_device *dev,
-			   hdd_adapter_t *pAdapter,
-			   tCsrRoamInfo *pCsrRoamInfo)
-{
-	union iwreq_data wrqu;
-	char *buff;
-	unsigned int len = 0;
-	u8 *pFTAssocRsp = NULL;
-
-	if (pCsrRoamInfo->nAssocRspLength == 0) {
-		hddLog(LOGE,
-		       FL("pCsrRoamInfo->nAssocRspLength=%d"),
-		       (int)pCsrRoamInfo->nAssocRspLength);
-		return;
-	}
-
-	pFTAssocRsp =
-		(u8 *) (pCsrRoamInfo->pbFrames + pCsrRoamInfo->nBeaconLength +
-			pCsrRoamInfo->nAssocReqLength);
-	if (pFTAssocRsp == NULL) {
-		hddLog(LOGE, FL("AssocReq or AssocRsp is NULL"));
-		return;
-	}
-	/* pFTAssocRsp needs to point to the IEs */
-	pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET;
-	hddLog(LOG1, FL("AssocRsp is now at %02x%02x"),
-	       (unsigned int)pFTAssocRsp[0], (unsigned int)pFTAssocRsp[1]);
-
-	/* We need to send the IEs to the supplicant. */
-	buff = kmalloc(IW_GENERIC_IE_MAX, GFP_ATOMIC);
-	if (buff == NULL) {
-		hddLog(LOGE, FL("kmalloc unable to allocate memory"));
-		return;
-	}
-	/* Send the Assoc Resp, the supplicant needs this for initial Auth. */
-	len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET;
-	wrqu.data.length = len;
-	memset(buff, 0, IW_GENERIC_IE_MAX);
-	memcpy(buff, pFTAssocRsp, len);
-	wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, buff);
-
-	kfree(buff);
-}
-#endif /* WLAN_FEATURE_VOWIFI_11R */
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-/**
- * hdd_send_ft_event() - send fast transition event
- * @pAdapter: pointer to adapter
- *
- * Send the FTIEs, RIC IEs during FT. This is eventually used to send the
- * FT events to the supplicant. At the reception of Auth2 we send the RIC
- * followed by the auth response IEs to the supplicant.
- * Once both are received in the supplicant, an FT event is generated
- * to the supplicant.
- *
- * Return: none
- */
-static void hdd_send_ft_event(hdd_adapter_t *pAdapter)
-{
-	uint16_t auth_resp_len = 0;
-	uint32_t ric_ies_length = 0;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-#if defined(KERNEL_SUPPORT_11R_CFG80211)
-	struct cfg80211_ft_event_params ftEvent;
-	uint8_t ftIe[DOT11F_IE_FTINFO_MAX_LEN];
-	uint8_t ricIe[DOT11F_IE_RICDESCRIPTOR_MAX_LEN];
-	struct net_device *dev = pAdapter->dev;
-#else
-	char *buff;
-	union iwreq_data wrqu;
-	uint16_t str_len;
-#endif
-
-#if defined(KERNEL_SUPPORT_11R_CFG80211)
-	cdf_mem_zero(ftIe, DOT11F_IE_FTINFO_MAX_LEN);
-	cdf_mem_zero(ricIe, DOT11F_IE_RICDESCRIPTOR_MAX_LEN);
-
-	sme_get_rici_es(pHddCtx->hHal, pAdapter->sessionId, (u8 *) ricIe,
-			DOT11F_IE_RICDESCRIPTOR_MAX_LEN, &ric_ies_length);
-	if (ric_ies_length == 0) {
-		hddLog(LOGW,
-		       FL("RIC IEs is of length 0 not sending RIC Information for now"));
-	}
-
-	ftEvent.ric_ies = ricIe;
-	ftEvent.ric_ies_len = ric_ies_length;
-	hddLog(LOG1, FL("RIC IEs is of length %d"), (int)ric_ies_length);
-
-	sme_get_ft_pre_auth_response(pHddCtx->hHal, pAdapter->sessionId,
-				     (u8 *) ftIe, DOT11F_IE_FTINFO_MAX_LEN,
-				     &auth_resp_len);
-
-	if (auth_resp_len == 0) {
-		hddLog(LOGE, FL("AuthRsp FTIES is of length 0"));
-		return;
-	}
-
-	sme_set_ft_pre_auth_state(pHddCtx->hHal, pAdapter->sessionId, true);
-
-	ftEvent.target_ap = ftIe;
-
-	ftEvent.ies = (u8 *) (ftIe + CDF_MAC_ADDR_SIZE);
-	ftEvent.ies_len = auth_resp_len - CDF_MAC_ADDR_SIZE;
-
-	hddLog(LOG1, FL("ftEvent.ies_len %zu"), ftEvent.ies_len);
-	hddLog(LOG1, FL("ftEvent.ric_ies_len %zu"), ftEvent.ric_ies_len);
-	hddLog(LOG1, FL("ftEvent.target_ap %2x-%2x-%2x-%2x-%2x-%2x"),
-	       ftEvent.target_ap[0], ftEvent.target_ap[1],
-	       ftEvent.target_ap[2], ftEvent.target_ap[3], ftEvent.target_ap[4],
-	       ftEvent.target_ap[5]);
-
-	(void)cfg80211_ft_event(dev, &ftEvent);
-
-#else
-	/* We need to send the IEs to the supplicant */
-	buff = kmalloc(IW_CUSTOM_MAX, GFP_ATOMIC);
-	if (buff == NULL) {
-		hddLog(LOGE, FL("kmalloc unable to allocate memory"));
-		return;
-	}
-	cdf_mem_zero(buff, IW_CUSTOM_MAX);
-
-	/* Sme needs to send the RIC IEs first */
-	str_len = strlcpy(buff, "RIC=", IW_CUSTOM_MAX);
-	sme_get_rici_es(pHddCtx->hHal, pAdapter->sessionId,
-			(u8 *) &(buff[str_len]), (IW_CUSTOM_MAX - str_len),
-			&ric_ies_length);
-	if (ric_ies_length == 0) {
-		hddLog(LOGW,
-		       FL("RIC IEs is of length 0 not sending RIC Information for now"));
-	} else {
-		wrqu.data.length = str_len + ric_ies_length;
-		wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff);
-	}
-
-	/* Sme needs to provide the Auth Resp */
-	cdf_mem_zero(buff, IW_CUSTOM_MAX);
-	str_len = strlcpy(buff, "AUTH=", IW_CUSTOM_MAX);
-	sme_get_ft_pre_auth_response(pHddCtx->hHal, pAdapter->sessionId,
-				     (u8 *) &buff[str_len],
-				     (IW_CUSTOM_MAX - str_len), &auth_resp_len);
-
-	if (auth_resp_len == 0) {
-		kfree(buff);
-		hddLog(LOGE, FL("AuthRsp FTIES is of length 0"));
-		return;
-	}
-
-	wrqu.data.length = str_len + auth_resp_len;
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff);
-
-	kfree(buff);
-#endif
-}
-
-#endif /* WLAN_FEATURE_VOWIFI_11R */
-
-#ifdef FEATURE_WLAN_ESE
-/**
- * hdd_send_new_ap_channel_info() - send new ap channel info
- * @dev: pointer to net device
- * @pAdapter: pointer to adapter
- * @pCsrRoamInfo: pointer to roam info
- *
- * Send the ESE required "new AP Channel info" to the supplicant.
- * (This keeps the supplicant "up to date" on the current channel.)
- *
- * The current (new AP) channel information is passed in.
- *
- * Return: none
- */
-static void
-hdd_send_new_ap_channel_info(struct net_device *dev, hdd_adapter_t *pAdapter,
-			     tCsrRoamInfo *pCsrRoamInfo)
-{
-	union iwreq_data wrqu;
-	tSirBssDescription *descriptor = pCsrRoamInfo->pBssDesc;
-
-	if (descriptor == NULL) {
-		hddLog(LOGE, FL("pCsrRoamInfo->pBssDesc(%p)"), descriptor);
-		return;
-	}
-	/*
-	 * Send the Channel event, the supplicant needs this to generate
-	 * the Adjacent AP report.
-	 */
-	hddLog(LOGW, FL("Sending up an SIOCGIWFREQ, channelId(%d)"),
-	       descriptor->channelId);
-	memset(&wrqu, '\0', sizeof(wrqu));
-	wrqu.freq.m = descriptor->channelId;
-	wrqu.freq.e = 0;
-	wrqu.freq.i = 0;
-	wireless_send_event(pAdapter->dev, SIOCGIWFREQ, &wrqu, NULL);
-}
-
-#endif /* FEATURE_WLAN_ESE */
-
-/**
- * hdd_send_update_beacon_ies_event() - send update beacons ie event
- * @pAdapter: pointer to adapter
- * @pCsrRoamInfo: pointer to roam info
- *
- * Return: none
- */
-static void
-hdd_send_update_beacon_ies_event(hdd_adapter_t *pAdapter,
-				  tCsrRoamInfo *pCsrRoamInfo)
-{
-	union iwreq_data wrqu;
-	u8 *pBeaconIes;
-	u8 currentLen = 0;
-	char *buff;
-	int totalIeLen = 0, currentOffset = 0, strLen;
-
-	memset(&wrqu, '\0', sizeof(wrqu));
-
-	if (0 == pCsrRoamInfo->nBeaconLength) {
-		hddLog(LOGW, FL("pCsrRoamInfo->nBeaconFrameLength = 0"));
-		return;
-	}
-	pBeaconIes = (u8 *) (pCsrRoamInfo->pbFrames + BEACON_FRAME_IES_OFFSET);
-	if (pBeaconIes == NULL) {
-		hddLog(LOGW, FL("Beacon IEs is NULL"));
-		return;
-	}
-	/* pBeaconIes needs to point to the IEs */
-	hddLog(LOG1, FL("Beacon IEs is now at %02x%02x"),
-	       (unsigned int)pBeaconIes[0], (unsigned int)pBeaconIes[1]);
-	hddLog(LOG1, FL("Beacon IEs length = %d"),
-	       pCsrRoamInfo->nBeaconLength - BEACON_FRAME_IES_OFFSET);
-
-	/* We need to send the IEs to the supplicant. */
-	buff = kmalloc(IW_CUSTOM_MAX, GFP_ATOMIC);
-	if (buff == NULL) {
-		hddLog(LOGE, FL("kmalloc unable to allocate memory"));
-		return;
-	}
-	cdf_mem_zero(buff, IW_CUSTOM_MAX);
-
-	strLen = strlcpy(buff, "BEACONIEs=", IW_CUSTOM_MAX);
-	currentLen = strLen + 1;
-
-	totalIeLen = pCsrRoamInfo->nBeaconLength - BEACON_FRAME_IES_OFFSET;
-	do {
-		/*
-		 * If the beacon size exceeds max CUSTOM event size, break it
-		 * into chunks of CUSTOM event max size and send it to
-		 * supplicant. Changes are done in supplicant to handle this.
-		 */
-		cdf_mem_zero(&buff[strLen + 1], IW_CUSTOM_MAX - (strLen + 1));
-		currentLen =
-			CDF_MIN(totalIeLen, IW_CUSTOM_MAX - (strLen + 1) - 1);
-		cdf_mem_copy(&buff[strLen + 1], pBeaconIes + currentOffset,
-			     currentLen);
-		currentOffset += currentLen;
-		totalIeLen -= currentLen;
-		wrqu.data.length = strLen + 1 + currentLen;
-		if (totalIeLen)
-			buff[strLen] = 1; /* more chunks pending */
-		else
-			buff[strLen] = 0; /* last chunk */
-
-		hddLog(LOG1, FL("Beacon IEs length to supplicant = %d"),
-		       currentLen);
-		wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff);
-	} while (totalIeLen > 0);
-
-	kfree(buff);
-}
-
-/**
- * hdd_send_association_event() - send association event
- * @dev: pointer to net device
- * @pCsrRoamInfo: pointer to roam info
- *
- * Return: none
- */
-static void hdd_send_association_event(struct net_device *dev,
-				       tCsrRoamInfo *pCsrRoamInfo)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	union iwreq_data wrqu;
-	int we_event;
-	char *msg;
-	struct cdf_mac_addr peerMacAddr;
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	/* Added to find the auth type on the fly at run time */
-	/* rather than with cfg to see if FT is enabled */
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	tCsrRoamProfile *pRoamProfile = &(pWextState->roamProfile);
-#endif
-
-	memset(&wrqu, '\0', sizeof(wrqu));
-	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-	we_event = SIOCGIWAP;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (NULL != pCsrRoamInfo)
-		if (pCsrRoamInfo->roamSynchInProgress)
-			/* change logging before release */
-			hddLog(LOG4, "LFR3:hdd_send_association_event");
-#endif
-	if (eConnectionState_Associated == pHddStaCtx->conn_info.connState) {
-		if (!pCsrRoamInfo) {
-			hddLog(LOGE, FL("STA in associated state but pCsrRoamInfo is null"));
-			return;
-		}
-
-		if (!hdd_is_roam_sync_in_progress(pCsrRoamInfo))
-			cds_incr_active_session(pAdapter->device_mode,
-					pAdapter->sessionId);
-		memcpy(wrqu.ap_addr.sa_data, pCsrRoamInfo->pBssDesc->bssId,
-		       sizeof(pCsrRoamInfo->pBssDesc->bssId));
-
-#ifdef WLAN_FEATURE_P2P_DEBUG
-		if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) {
-			if (global_p2p_connection_status ==
-			    P2P_CLIENT_CONNECTING_STATE_1) {
-				global_p2p_connection_status =
-					P2P_CLIENT_CONNECTED_STATE_1;
-				hddLog(LOGE,
-				       "[P2P State] Changing state from Connecting state to Connected State for 8-way Handshake");
-			} else if (global_p2p_connection_status ==
-				   P2P_CLIENT_CONNECTING_STATE_2) {
-				global_p2p_connection_status =
-					P2P_CLIENT_COMPLETED_STATE;
-				hddLog(LOGE,
-				       "[P2P State] Changing state from Connecting state to P2P Client Connection Completed");
-			}
-		}
-#endif
-		pr_info("wlan: " MAC_ADDRESS_STR " connected to "
-			MAC_ADDRESS_STR "\n",
-			MAC_ADDR_ARRAY(pAdapter->macAddressCurrent.bytes),
-			MAC_ADDR_ARRAY(wrqu.ap_addr.sa_data));
-		hdd_send_update_beacon_ies_event(pAdapter, pCsrRoamInfo);
-
-		/*
-		 * Send IWEVASSOCRESPIE Event if WLAN_FEATURE_CIQ_METRICS
-		 * is Enabled Or Send IWEVASSOCRESPIE Event if
-		 * WLAN_FEATURE_VOWIFI_11R is Enabled and fFTEnable is true.
-		 */
-#ifdef WLAN_FEATURE_VOWIFI_11R
-		/* Send FT Keys to the supplicant when FT is enabled */
-		if ((pRoamProfile->AuthType.authType[0] ==
-		     eCSR_AUTH_TYPE_FT_RSN_PSK)
-		    || (pRoamProfile->AuthType.authType[0] ==
-			eCSR_AUTH_TYPE_FT_RSN)
-#ifdef FEATURE_WLAN_ESE
-		    || (pRoamProfile->AuthType.authType[0] ==
-			eCSR_AUTH_TYPE_CCKM_RSN)
-		    || (pRoamProfile->AuthType.authType[0] ==
-			eCSR_AUTH_TYPE_CCKM_WPA)
-#endif
-		    ) {
-			hdd_send_ft_assoc_response(dev, pAdapter, pCsrRoamInfo);
-		}
-#endif
-		if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) {
-			tSirSmeChanInfo chan_info;
-			cdf_copy_macaddr(&peerMacAddr,
-					 &pHddStaCtx->conn_info.bssId);
-			chan_info.chan_id = pCsrRoamInfo->chan_info.chan_id;
-			chan_info.mhz = pCsrRoamInfo->chan_info.mhz;
-			chan_info.info = pCsrRoamInfo->chan_info.info;
-			chan_info.band_center_freq1 =
-				pCsrRoamInfo->chan_info.band_center_freq1;
-			chan_info.band_center_freq2 =
-				pCsrRoamInfo->chan_info.band_center_freq2;
-			chan_info.reg_info_1 =
-				pCsrRoamInfo->chan_info.reg_info_1;
-			chan_info.reg_info_2 =
-				pCsrRoamInfo->chan_info.reg_info_2;
-
-			/* send peer status indication to oem app */
-			hdd_send_peer_status_ind_to_oem_app(&peerMacAddr,
-							    ePeerConnected,
-							    pCsrRoamInfo->
-							    timingMeasCap,
-							    pAdapter->sessionId,
-							    &chan_info);
-		}
-#ifdef MSM_PLATFORM
-#ifdef CONFIG_CNSS
-		/* start timer in sta/p2p_cli */
-		spin_lock_bh(&pHddCtx->bus_bw_lock);
-		pAdapter->prev_tx_packets = pAdapter->stats.tx_packets;
-		pAdapter->prev_rx_packets = pAdapter->stats.rx_packets;
-		spin_unlock_bh(&pHddCtx->bus_bw_lock);
-		hdd_start_bus_bw_compute_timer(pAdapter);
-#endif
-#endif
-	} else if (eConnectionState_IbssConnected ==    /* IBss Associated */
-			pHddStaCtx->conn_info.connState) {
-		cds_update_connection_info(pAdapter->sessionId);
-		memcpy(wrqu.ap_addr.sa_data, pHddStaCtx->conn_info.bssId.bytes,
-		       ETH_ALEN);
-		pr_info("wlan: new IBSS connection to " MAC_ADDRESS_STR "\n",
-			MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId.bytes));
-	} else {                /* Not Associated */
-
-		pr_info("wlan: disconnected\n");
-		memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
-		cds_decr_session_set_pcl(
-						pAdapter->device_mode,
-						pAdapter->sessionId);
-		wlan_hdd_enable_roaming(pAdapter);
-
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-		wlan_hdd_auto_shutdown_enable(pHddCtx, true);
-#endif
-
-		if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) {
-			cdf_copy_macaddr(&peerMacAddr,
-					 &pHddStaCtx->conn_info.bssId);
-
-			/* send peer status indication to oem app */
-			hdd_send_peer_status_ind_to_oem_app(&peerMacAddr,
-							   ePeerDisconnected, 0,
-							   pAdapter->sessionId,
-							   NULL);
-		}
-#ifdef WLAN_FEATURE_LPSS
-		pAdapter->rssi_send = false;
-		wlan_hdd_send_status_pkg(pAdapter, pHddStaCtx, 1, 0);
-#endif
-#ifdef FEATURE_WLAN_TDLS
-		if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) &&
-		    (pCsrRoamInfo)) {
-			hddLog(LOG4,
-				FL("tdls_prohibited: %d, tdls_chan_swit_prohibited: %d"),
-				pCsrRoamInfo->tdls_prohibited,
-				pCsrRoamInfo->tdls_chan_swit_prohibited);
-
-			wlan_hdd_update_tdls_info(pAdapter,
-				pCsrRoamInfo->tdls_prohibited,
-				pCsrRoamInfo->tdls_chan_swit_prohibited);
-		}
-#endif
-#ifdef MSM_PLATFORM
-		/* stop timer in sta/p2p_cli */
-		spin_lock_bh(&pHddCtx->bus_bw_lock);
-		pAdapter->prev_tx_packets = 0;
-		pAdapter->prev_rx_packets = 0;
-		spin_unlock_bh(&pHddCtx->bus_bw_lock);
-		hdd_stop_bus_bw_compute_timer(pAdapter);
-#endif
-	}
-	cds_dump_concurrency_info();
-	/* Send SCC/MCC Switching event to IPA */
-	hdd_ipa_send_mcc_scc_msg(pHddCtx, pHddCtx->mcc_mode);
-
-	msg = NULL;
-	/*During the WLAN uninitialization,supplicant is stopped before the
-	   driver so not sending the status of the connection to supplicant */
-	if (cds_is_load_or_unload_in_progress()) {
-		wireless_send_event(dev, we_event, &wrqu, msg);
-#ifdef FEATURE_WLAN_ESE
-		if (eConnectionState_Associated ==
-			 pHddStaCtx->conn_info.connState) {
-			if ((pRoamProfile->AuthType.authType[0] ==
-			     eCSR_AUTH_TYPE_CCKM_RSN) ||
-			    (pRoamProfile->AuthType.authType[0] ==
-				eCSR_AUTH_TYPE_CCKM_WPA))
-				hdd_send_new_ap_channel_info(dev, pAdapter,
-							     pCsrRoamInfo);
-		}
-#endif
-	}
-}
-
-/**
- * hdd_conn_remove_connect_info() - remove connection info
- * @pHddStaCtx: pointer to global HDD station context
- * @pCsrRoamInfo: pointer to roam info
- *
- * Return: none
- */
-static void hdd_conn_remove_connect_info(hdd_station_ctx_t *pHddStaCtx)
-{
-	/* Remove staId, bssId and peerMacAddress */
-	pHddStaCtx->conn_info.staId[0] = 0;
-	cdf_mem_zero(&pHddStaCtx->conn_info.bssId, CDF_MAC_ADDR_SIZE);
-	cdf_mem_zero(&pHddStaCtx->conn_info.peerMacAddress[0],
-		     CDF_MAC_ADDR_SIZE);
-
-	/* Clear all security settings */
-	pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM;
-	pHddStaCtx->conn_info.mcEncryptionType = eCSR_ENCRYPT_TYPE_NONE;
-	pHddStaCtx->conn_info.ucEncryptionType = eCSR_ENCRYPT_TYPE_NONE;
-
-	cdf_mem_zero(&pHddStaCtx->conn_info.Keys, sizeof(tCsrKeys));
-	cdf_mem_zero(&pHddStaCtx->ibss_enc_key, sizeof(tCsrRoamSetKey));
-
-	/* Set not-connected state */
-	pHddStaCtx->conn_info.connDot11DesiredBssType = eCSR_BSS_TYPE_ANY;
-	pHddStaCtx->conn_info.proxyARPService = 0;
-
-	cdf_mem_zero(&pHddStaCtx->conn_info.SSID, sizeof(tCsrSSIDInfo));
-}
-
-/**
- * hdd_roam_deregister_sta() - deregister station
- * @pAdapter: pointer to adapter
- * @staId: station identifier
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS
-hdd_roam_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId)
-{
-	CDF_STATUS cdf_status;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	if (eConnectionState_IbssDisconnected ==
-	    pHddStaCtx->conn_info.connState) {
-		/*
-		 * Do not set the carrier off when the last peer leaves.
-		 * We will set the carrier off while stopping the IBSS.
-		 */
-	}
-
-	cdf_status = ol_txrx_clear_peer(staId);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGE,
-			FL("ol_txrx_clear_peer() failed for staID %d. Status(%d) [0x%08X]"),
-			staId, cdf_status, cdf_status);
-	}
-	return cdf_status;
-}
-
-/**
- * hdd_dis_connect_handler() - disconnect event handler
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @roamId: roam identifier
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * This function handles disconnect event:
- * 1. Disable transmit queues;
- * 2. Clean up internal connection states and data structures;
- * 3. Send disconnect indication to supplicant.
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter,
-					  tCsrRoamInfo *pRoamInfo,
-					  uint32_t roamId,
-					  eRoamCmdStatus roamStatus,
-					  eCsrRoamResult roamResult)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	CDF_STATUS vstatus;
-	struct net_device *dev = pAdapter->dev;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	uint8_t sta_id;
-	bool sendDisconInd = true;
-
-	if (dev == NULL) {
-		hddLog(LOGE, FL("net_dev is released return"));
-		return CDF_STATUS_E_FAILURE;
-	}
-	/* notify apps that we can't pass traffic anymore */
-	hddLog(LOG1, FL("Disabling queues"));
-	wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER,
-				   WLAN_CONTROL_PATH);
-
-	if (hdd_ipa_is_enabled(pHddCtx))
-		hdd_ipa_wlan_evt(pAdapter, pHddStaCtx->conn_info.staId[0],
-				 WLAN_STA_DISCONNECT,
-				 pHddStaCtx->conn_info.bssId.bytes);
-
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-	wlan_hdd_auto_shutdown_enable(pHddCtx, true);
-#endif
-
-#ifdef QCA_PKT_PROTO_TRACE
-	/* STA disconnected, update into trace buffer */
-	if (pHddCtx->config->gEnableDebugLog)
-		cds_pkt_trace_buf_update("ST:DISASC");
-#endif /* QCA_PKT_PROTO_TRACE */
-
-	/* HDD has initiated disconnect, do not send disconnect indication
-	 * to kernel. Sending disconnected event to kernel for userspace
-	 * initiated disconnect will be handled by hdd_DisConnectHandler call
-	 * to cfg80211_disconnected.
-	 */
-	if ((eConnectionState_Disconnecting ==
-	    pHddStaCtx->conn_info.connState) ||
-	    (eConnectionState_NotConnected ==
-	    pHddStaCtx->conn_info.connState)) {
-		hddLog(LOG1,
-			FL("HDD has initiated a disconnect, no need to send disconnect indication to kernel"));
-		sendDisconInd = false;
-	}
-
-	if (pHddStaCtx->conn_info.connState != eConnectionState_Disconnecting) {
-		INIT_COMPLETION(pAdapter->disconnect_comp_var);
-		hddLog(LOG1,
-			FL("Set HDD connState to eConnectionState_Disconnecting"));
-		hdd_conn_set_connection_state(pAdapter,
-					      eConnectionState_Disconnecting);
-	}
-
-	hdd_clear_roam_profile_ie(pAdapter);
-	hdd_wmm_init(pAdapter);
-
-	/* indicate 'disconnect' status to wpa_supplicant... */
-	hdd_send_association_event(dev, pRoamInfo);
-	/* indicate disconnected event to nl80211 */
-	if (roamStatus != eCSR_ROAM_IBSS_LEAVE) {
-		/*
-		 * Only send indication to kernel if not initiated
-		 * by kernel
-		 */
-		if (sendDisconInd) {
-			/*
-			 * To avoid wpa_supplicant sending "HANGED" CMD
-			 * to ICS UI.
-			 */
-			if (eCSR_ROAM_LOSTLINK == roamStatus) {
-				if (pRoamInfo->reasonCode ==
-				    eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON)
-					pr_info("wlan: disconnected due to poor signal, rssi is %d dB\n", pRoamInfo->rxRssi);
-				cfg80211_disconnected(dev, pRoamInfo->
-						      reasonCode, NULL,
-						      0, GFP_KERNEL);
-			} else {
-				cfg80211_disconnected(dev,
-					      WLAN_REASON_UNSPECIFIED,
-					      NULL, 0,
-					      GFP_KERNEL);
-			}
-
-			hdd_info("sent disconnected event to nl80211, rssi: %d",
-				pAdapter->rssi);
-		}
-		/*
-		 * During the WLAN uninitialization,supplicant is stopped
-		 * before the driver so not sending the status of the
-		 * connection to supplicant.
-		 */
-		if (cds_is_load_or_unload_in_progress()) {
-#ifdef WLAN_FEATURE_P2P_DEBUG
-			if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) {
-				if (global_p2p_connection_status ==
-				    P2P_CLIENT_CONNECTED_STATE_1) {
-					global_p2p_connection_status =
-						P2P_CLIENT_DISCONNECTED_STATE;
-					hddLog(LOGE,
-					       "[P2P State] 8 way Handshake completed and moved to disconnected state");
-				} else if (global_p2p_connection_status ==
-					   P2P_CLIENT_COMPLETED_STATE) {
-					global_p2p_connection_status =
-						P2P_NOT_ACTIVE;
-					hddLog(LOGE,
-					       "[P2P State] P2P Client is removed and moved to inactive state");
-				}
-			}
-#endif
-
-		}
-	}
-
-	hdd_wmm_adapter_clear(pAdapter);
-#if defined(WLAN_FEATURE_VOWIFI_11R)
-	sme_ft_reset(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId);
-#endif
-	if (eCSR_ROAM_IBSS_LEAVE == roamStatus) {
-		uint8_t i;
-		sta_id = pHddStaCtx->broadcast_ibss_staid;
-		vstatus = hdd_roam_deregister_sta(pAdapter, sta_id);
-		if (!CDF_IS_STATUS_SUCCESS(vstatus)) {
-			hdd_err("hdd_roam_deregister_sta() failed for staID %d Status=%d [0x%x]",
-					sta_id, status, status);
-			status = CDF_STATUS_E_FAILURE;
-		}
-		pHddCtx->sta_to_adapter[sta_id] = NULL;
-		/* Clear all the peer sta register with TL. */
-		for (i = 0; i < MAX_IBSS_PEERS; i++) {
-			if (0 == pHddStaCtx->conn_info.staId[i])
-				continue;
-			sta_id = pHddStaCtx->conn_info.staId[i];
-			hddLog(LOG1, FL("Deregister StaID %d"), sta_id);
-			vstatus = hdd_roam_deregister_sta(pAdapter, sta_id);
-			if (!CDF_IS_STATUS_SUCCESS(vstatus)) {
-				hddLog(LOGE,
-					FL("hdd_roamDeregisterSTA() failed to for staID %d. Status= %d [0x%x]"),
-					sta_id, status, status);
-				status = CDF_STATUS_E_FAILURE;
-			}
-			/* set the staid and peer mac as 0, all other
-			 * reset are done in hdd_connRemoveConnectInfo.
-			 */
-			pHddStaCtx->conn_info.staId[i] = 0;
-			cdf_mem_zero(&pHddStaCtx->conn_info.peerMacAddress[i],
-				sizeof(struct cdf_mac_addr));
-			if (sta_id < (WLAN_MAX_STA_COUNT + 3))
-				pHddCtx->sta_to_adapter[sta_id] = NULL;
-		}
-	} else {
-		sta_id = pHddStaCtx->conn_info.staId[0];
-		/* We should clear all sta register with TL,
-		 * for now, only one.
-		 */
-		vstatus = hdd_roam_deregister_sta(pAdapter, sta_id);
-		if (!CDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(LOGE,
-				FL("hdd_roam_deregister_sta() failed to for staID %d. Status= %d [0x%x]"),
-				sta_id, status, status);
-			status = CDF_STATUS_E_FAILURE;
-		}
-		pHddCtx->sta_to_adapter[sta_id] = NULL;
-	}
-	/* Clear saved connection information in HDD */
-	hdd_conn_remove_connect_info(pHddStaCtx);
-	hddLog(LOG1, FL("Set HDD connState to eConnectionState_NotConnected"));
-	hdd_conn_set_connection_state(pAdapter, eConnectionState_NotConnected);
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) {
-		memset(&pHddStaCtx->gtkOffloadReqParams, 0,
-		       sizeof(tSirGtkOffloadParams));
-		pHddStaCtx->gtkOffloadReqParams.ulFlags = GTK_OFFLOAD_DISABLE;
-	}
-#endif
-
-#ifdef FEATURE_WLAN_TDLS
-	if (eCSR_ROAM_IBSS_LEAVE != roamStatus)
-		wlan_hdd_tdls_disconnection_callback(pAdapter);
-#endif
-
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-			(WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) {
-		sme_ps_disable_auto_ps_timer(WLAN_HDD_GET_HAL_CTX
-				(pAdapter),
-				pAdapter->sessionId);
-	}
-	/* Unblock anyone waiting for disconnect to complete */
-	complete(&pAdapter->disconnect_comp_var);
-	return status;
-}
-
-/**
- * hdd_set_peer_authorized_event() - set peer_authorized_event
- * @vdev_id: vdevid
- *
- * Return: None
- */
-void hdd_set_peer_authorized_event(uint32_t vdev_id)
-{
-	hdd_context_t *hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	hdd_adapter_t *adapter = NULL;
-
-	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
-	if (adapter == NULL) {
-		hddLog(LOGE,
-			"%s: Invalid vdev_id", __func__);
-	}
-	complete(&adapter->sta_authorized_event);
-}
-
-/**
- * hdd_change_peer_state() - change peer state
- * @pAdapter: HDD adapter
- * @sta_state: peer state
- * @roam_synch_in_progress: roam synch in progress
- *
- * Return: CDF status
- */
-CDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter,
-				 uint8_t sta_id,
-				 enum ol_txrx_peer_state sta_state,
-				 bool roam_synch_in_progress)
-{
-	struct ol_txrx_peer_t *peer;
-	CDF_STATUS err;
-	struct ol_txrx_pdev_t *pdev = cds_get_context(CDF_MODULE_ID_TXRX);
-
-	if (!pdev) {
-		hdd_err("Failed to get txrx context");
-		return CDF_STATUS_E_FAULT;
-	}
-
-	if (sta_id >= WLAN_MAX_STA_COUNT) {
-		hddLog(LOGE, "Invalid sta id :%d", sta_id);
-		return CDF_STATUS_E_INVAL;
-	}
-
-	peer = ol_txrx_peer_find_by_local_id(pdev, sta_id);
-	if (!peer)
-		return CDF_STATUS_E_FAULT;
-
-	err = ol_txrx_peer_state_update(pdev,
-			(u_int8_t *) peer->mac_addr.raw, sta_state);
-	if (err != CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, "peer state update failed");
-		return CDF_STATUS_E_FAULT;
-	}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (roam_synch_in_progress)
-		return CDF_STATUS_SUCCESS;
-#endif
-
-	if (sta_state == ol_txrx_peer_state_auth) {
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-		/* make sure event is reset */
-		INIT_COMPLETION(pAdapter->sta_authorized_event);
-#endif
-
-		err = sme_set_peer_authorized(peer->mac_addr.raw,
-				hdd_set_peer_authorized_event,
-				pAdapter->sessionId);
-		if (err != CDF_STATUS_SUCCESS) {
-			hddLog(LOGE, "Failed to set the peer state to authorized");
-			return CDF_STATUS_E_FAULT;
-		}
-
-		if (pAdapter->device_mode == WLAN_HDD_INFRA_STATION ||
-		    pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) {
-#if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
-			unsigned long rc;
-
-			/* wait for event from firmware to set the event */
-			rc = wait_for_completion_timeout(
-				&pAdapter->sta_authorized_event,
-				msecs_to_jiffies(HDD_PEER_AUTHORIZE_WAIT));
-			if (!rc) {
-				hddLog(LOG1, "%s: timeout waiting for sta_authorized_event",
-					__func__);
-			}
-			ol_txrx_vdev_unpause(peer->vdev,
-				OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED);
-#endif
-		}
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_roam_register_sta() - register station
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @staId: station identifier
- * @pPeerMacAddress: peer MAC address
- * @pBssDesc: pointer to BSS description
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS hdd_roam_register_sta(hdd_adapter_t *pAdapter,
-					tCsrRoamInfo *pRoamInfo,
-					uint8_t staId,
-					struct cdf_mac_addr *pPeerMacAddress,
-					tSirBssDescription *pBssDesc)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	struct ol_txrx_desc_type staDesc = { 0 };
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	if (NULL == pBssDesc)
-		return CDF_STATUS_E_FAILURE;
-
-	/* Get the Station ID from the one saved during the association */
-	staDesc.sta_id = staId;
-
-	/* set the QoS field appropriately */
-	if (hdd_wmm_is_active(pAdapter))
-		staDesc.is_qos_enabled = 1;
-	else
-		staDesc.is_qos_enabled = 0;
-
-#ifdef FEATURE_WLAN_WAPI
-	hddLog(LOG1, FL("WAPI STA Registered: %d"),
-	       pAdapter->wapi_info.fIsWapiSta);
-	if (pAdapter->wapi_info.fIsWapiSta)
-		staDesc.is_wapi_supported = 1;
-	else
-		staDesc.is_wapi_supported = 0;
-#endif /* FEATURE_WLAN_WAPI */
-
-	cdf_status = ol_txrx_register_peer(hdd_rx_packet_cbk,
-						&staDesc);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGW,
-			"ol_txrx_register_peer() failed to register. Status=%d [0x%08X]",
-			cdf_status, cdf_status);
-		return cdf_status;
-	}
-
-	if (!pRoamInfo->fAuthRequired) {
-		/*
-		 * Connections that do not need Upper layer auth, transition
-		 * TLSHIM directly to 'Authenticated' state
-		 */
-		cdf_status =
-			hdd_change_peer_state(pAdapter, staDesc.sta_id,
-						ol_txrx_peer_state_auth,
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-						pRoamInfo->roamSynchInProgress
-#else
-						false
-#endif
-						);
-
-		hdd_conn_set_authenticated(pAdapter, true);
-	} else {
-		hddLog(LOG3,
-			"ULA auth StaId= %d. Changing TL state to CONNECTED at Join time",
-			 pHddStaCtx->conn_info.staId[0]);
-		cdf_status =
-			hdd_change_peer_state(pAdapter, staDesc.sta_id,
-						ol_txrx_peer_state_conn,
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-						pRoamInfo->roamSynchInProgress
-#else
-						false
-#endif
-						);
-		hdd_conn_set_authenticated(pAdapter, false);
-	}
-	return cdf_status;
-}
-
-/**
- * hdd_send_re_assoc_event() - send reassoc event
- * @dev: pointer to net device
- * @pAdapter: pointer to adapter
- * @pCsrRoamInfo: pointer to roam info
- * @reqRsnIe: pointer to RSN Information element
- * @reqRsnLength: length of RSN IE
- *
- * Return: none
- */
-static void hdd_send_re_assoc_event(struct net_device *dev,
-	hdd_adapter_t *pAdapter, tCsrRoamInfo *pCsrRoamInfo,
-	uint8_t *reqRsnIe, uint32_t reqRsnLength)
-{
-	unsigned int len = 0;
-	u8 *pFTAssocRsp = NULL;
-	uint8_t *rspRsnIe = kmalloc(IW_GENERIC_IE_MAX, GFP_KERNEL);
-	uint8_t *assoc_req_ies = kmalloc(IW_GENERIC_IE_MAX, GFP_KERNEL);
-	uint32_t rspRsnLength = 0;
-	struct ieee80211_channel *chan;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	uint8_t buf_ssid_ie[2 + SIR_MAC_SSID_EID_MAX]; /* 2 bytes-EID and len */
-	uint8_t *buf_ptr, ssid_ie_len;
-	struct cfg80211_bss *bss = NULL;
-	uint8_t *final_req_ie = NULL;
-	tCsrRoamConnectedProfile roam_profile;
-	tHalHandle hal_handle = WLAN_HDD_GET_HAL_CTX(pAdapter);
-
-	if (!rspRsnIe) {
-		hddLog(LOGE, FL("Unable to allocate RSN IE"));
-		goto done;
-	}
-
-	if (!assoc_req_ies) {
-		hdd_err("Unable to allocate Assoc Req IE");
-		goto done;
-	}
-	if (pCsrRoamInfo == NULL) {
-		hddLog(LOGE, FL("Invalid CSR roam info"));
-		goto done;
-	}
-
-	if (pCsrRoamInfo->nAssocRspLength == 0) {
-		hddLog(LOGE, FL("Invalid assoc response length"));
-		goto done;
-	}
-
-	pFTAssocRsp =
-		(u8 *) (pCsrRoamInfo->pbFrames + pCsrRoamInfo->nBeaconLength +
-			pCsrRoamInfo->nAssocReqLength);
-	if (pFTAssocRsp == NULL)
-		goto done;
-
-	/* pFTAssocRsp needs to point to the IEs */
-	pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET;
-	hddLog(LOG1, FL("AssocRsp is now at %02x%02x"),
-	       (unsigned int)pFTAssocRsp[0], (unsigned int)pFTAssocRsp[1]);
-
-	/*
-	 * Active session count is decremented upon disconnection, but during
-	 * roaming, there is no disconnect indication and hence active session
-	 * count is not decremented.
-	 * After roaming is completed, active session count is incremented
-	 * as a part of connect indication but effectively after roaming the
-	 * active session count should still be the same and hence upon
-	 * successful reassoc decrement the active session count here.
-	 */
-	if (!hdd_is_roam_sync_in_progress(pCsrRoamInfo))
-		cds_decr_session_set_pcl(
-				pAdapter->device_mode,
-				pAdapter->sessionId);
-
-	/* Send the Assoc Resp, the supplicant needs this for initial Auth */
-	len = pCsrRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET;
-	rspRsnLength = len;
-	cdf_mem_copy(rspRsnIe, pFTAssocRsp, len);
-	cdf_mem_zero(rspRsnIe + len, IW_GENERIC_IE_MAX - len);
-
-	chan = ieee80211_get_channel(pAdapter->wdev.wiphy,
-				     (int)pCsrRoamInfo->pBssDesc->channelId);
-	cdf_mem_zero(&roam_profile, sizeof(tCsrRoamConnectedProfile));
-	sme_roam_get_connect_profile(hal_handle, pAdapter->sessionId,
-		&roam_profile);
-	bss = cfg80211_get_bss(pAdapter->wdev.wiphy, chan,
-			pCsrRoamInfo->bssid.bytes,
-			&roam_profile.SSID.ssId[0], roam_profile.SSID.length,
-			WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
-
-	if (bss == NULL)
-		hddLog(LOGE, FL("Get BSS returned NULL"));
-	buf_ptr = buf_ssid_ie;
-	*buf_ptr = SIR_MAC_SSID_EID;
-	buf_ptr++;
-	*buf_ptr = roam_profile.SSID.length; /*len of ssid*/
-	buf_ptr++;
-	cdf_mem_copy(buf_ptr, &roam_profile.SSID.ssId[0],
-			roam_profile.SSID.length);
-	ssid_ie_len = 2 + roam_profile.SSID.length;
-	hdd_notice("SSIDIE:");
-	CDF_TRACE_HEX_DUMP(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_DEBUG,
-			   buf_ssid_ie, ssid_ie_len);
-	final_req_ie = kmalloc(IW_GENERIC_IE_MAX, GFP_KERNEL);
-	if (final_req_ie == NULL)
-		goto done;
-	buf_ptr = final_req_ie;
-	cdf_mem_copy(buf_ptr, buf_ssid_ie, ssid_ie_len);
-	buf_ptr += ssid_ie_len;
-	cdf_mem_copy(buf_ptr, reqRsnIe, reqRsnLength);
-	cdf_mem_copy(rspRsnIe, pFTAssocRsp, len);
-	cdf_mem_zero(final_req_ie + (ssid_ie_len + reqRsnLength),
-		IW_GENERIC_IE_MAX - (ssid_ie_len + reqRsnLength));
-	hdd_notice("Req RSN IE:");
-	CDF_TRACE_HEX_DUMP(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_DEBUG,
-			   final_req_ie, (ssid_ie_len + reqRsnLength));
-	cfg80211_roamed_bss(dev, bss,
-			final_req_ie, (ssid_ie_len + reqRsnLength),
-			rspRsnIe, rspRsnLength, GFP_KERNEL);
-
-	cdf_mem_copy(assoc_req_ies,
-		(u8 *)pCsrRoamInfo->pbFrames + pCsrRoamInfo->nBeaconLength,
-		pCsrRoamInfo->nAssocReqLength);
-
-	hdd_notice("ReAssoc Req IE dump");
-	CDF_TRACE_HEX_DUMP(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_DEBUG,
-		assoc_req_ies, pCsrRoamInfo->nAssocReqLength);
-
-	wlan_hdd_send_roam_auth_event(pHddCtx, pCsrRoamInfo->bssid.bytes,
-			assoc_req_ies, pCsrRoamInfo->nAssocReqLength,
-			rspRsnIe, rspRsnLength,
-			pCsrRoamInfo);
-done:
-	sme_roam_free_connect_profile(&roam_profile);
-	if (final_req_ie)
-		kfree(final_req_ie);
-	kfree(rspRsnIe);
-	kfree(assoc_req_ies);
-}
-
-/**
- * hdd_is_roam_sync_in_progress()- Check if roam offloaded
- * @roaminfo - Roaming Information
- *
- * Return: roam sync status if roaming offloaded else false
- */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-bool hdd_is_roam_sync_in_progress(tCsrRoamInfo *roaminfo)
-{
-	if (roaminfo)
-		return roaminfo->roamSynchInProgress;
-	else
-		return false;
-}
-#endif
-
-
-/**
- * hdd_change_sta_state_authenticated()-
- * This function changes STA state to authenticated
- * @adapter:  pointer to the adapter structure.
- * @roaminfo: pointer to the RoamInfo structure.
- *
- * This is called from hdd_RoamSetKeyCompleteHandler
- * in context to eCSR_ROAM_SET_KEY_COMPLETE event from fw.
- *
- * Return: 0 on success and errno on failure
- */
-static int hdd_change_sta_state_authenticated(hdd_adapter_t *adapter,
-						 tCsrRoamInfo *roaminfo)
-{
-	int ret;
-	hdd_station_ctx_t *hddstactx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-
-	hddLog(LOG1,
-		"Changing TL state to AUTHENTICATED for StaId= %d",
-		hddstactx->conn_info.staId[0]);
-
-	/* Connections that do not need Upper layer authentication,
-	 * transition TL to 'Authenticated' state after the keys are set
-	 */
-	ret = hdd_change_peer_state(adapter,
-			hddstactx->conn_info.staId[0],
-			ol_txrx_peer_state_auth,
-			hdd_is_roam_sync_in_progress(roaminfo));
-	hdd_conn_set_authenticated(adapter, true);
-	if ((WLAN_HDD_INFRA_STATION == adapter->device_mode) ||
-		(WLAN_HDD_P2P_CLIENT == adapter->device_mode)) {
-		sme_ps_enable_auto_ps_timer(
-			WLAN_HDD_GET_HAL_CTX(adapter),
-			adapter->sessionId,
-			hddstactx->hdd_ReassocScenario);
-	}
-
-	return ret;
-}
-
-/**
- * hdd_roam_set_key_complete_handler() - Update the security parameters
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS hdd_roam_set_key_complete_handler(hdd_adapter_t *pAdapter,
-						    tCsrRoamInfo *pRoamInfo,
-						    uint32_t roamId,
-						    eRoamCmdStatus roamStatus,
-						    eCsrRoamResult roamResult)
-{
-	eCsrEncryptionType connectedCipherAlgo;
-	bool fConnected = false;
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	ENTER();
-
-	if (NULL == pRoamInfo) {
-		hddLog(LOG2, FL("pRoamInfo is NULL"));
-		return CDF_STATUS_E_FAILURE;
-	}
-	/*
-	 * if (WPA), tell TL to go to 'authenticated' after the keys are set.
-	 * then go to 'authenticated'.  For all other authentication types
-	 * (those that do not require upper layer authentication) we can put TL
-	 * directly into 'authenticated' state.
-	 */
-	hddLog(LOG2, "Set Key completion roamStatus =%d roamResult=%d "
-		  MAC_ADDRESS_STR, roamStatus, roamResult,
-		  MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes));
-
-	fConnected = hdd_conn_get_connected_cipher_algo(pHddStaCtx,
-						   &connectedCipherAlgo);
-	if (fConnected) {
-		if (WLAN_HDD_IBSS == pAdapter->device_mode) {
-			uint8_t staId;
-
-			if (cdf_is_macaddr_broadcast(&pRoamInfo->peerMac)) {
-				pHddStaCtx->roam_info.roamingState =
-					HDD_ROAM_STATE_NONE;
-			} else {
-				cdf_status = hdd_ibss_get_sta_id(
-							pHddStaCtx,
-							&pRoamInfo->peerMac,
-							&staId);
-				if (CDF_STATUS_SUCCESS == cdf_status) {
-					hddLog(LOG2,
-						"WLAN TL STA Ptk Installed for STAID=%d",
-						staId);
-					pHddStaCtx->roam_info.roamingState =
-						HDD_ROAM_STATE_NONE;
-				}
-			}
-		} else {
-			/*
-			 * TODO: Considering getting a state machine in
-			 * HDD later.This routine is invoked twice.
-			 * 1)set PTK 2)set GTK.The following if
-			 * statement will be TRUE when setting GTK.
-			 * At this time we don't handle the state in detail.
-			 * Related CR: 174048 - TL not in authenticated state
-			*/
-			if (eCSR_ROAM_RESULT_AUTHENTICATED == roamResult)
-				pHddStaCtx->conn_info.gtk_installed = true;
-			else
-				pHddStaCtx->conn_info.ptk_installed = true;
-
-			/* In WPA case move STA to authenticated when
-			 * ptk is installed.Earlier in WEP case STA
-			 * was moved to AUTHENTICATED prior to setting
-			 * the unicast key and it was resulting in sending
-			 * few un-encrypted packet. Now in WEP case
-			 * STA state will be moved to AUTHENTICATED
-			 * after we set the unicast and broadcast key.
-			 */
-			if ((pHddStaCtx->conn_info.ucEncryptionType ==
-			  eCSR_ENCRYPT_TYPE_WEP40) ||
-			  (pHddStaCtx->conn_info.ucEncryptionType ==
-			  eCSR_ENCRYPT_TYPE_WEP104) ||
-			  (pHddStaCtx->conn_info.ucEncryptionType ==
-			  eCSR_ENCRYPT_TYPE_WEP40_STATICKEY) ||
-			  (pHddStaCtx->conn_info.ucEncryptionType ==
-			  eCSR_ENCRYPT_TYPE_WEP104_STATICKEY)) {
-				if (pHddStaCtx->conn_info.gtk_installed &&
-					pHddStaCtx->conn_info.ptk_installed)
-					cdf_status =
-					    hdd_change_sta_state_authenticated(pAdapter,
-						pRoamInfo);
-			} else if (pHddStaCtx->conn_info.ptk_installed) {
-				cdf_status =
-				    hdd_change_sta_state_authenticated(pAdapter,
-					pRoamInfo);
-			}
-
-			if (pHddStaCtx->conn_info.gtk_installed &&
-				pHddStaCtx->conn_info.ptk_installed) {
-				pHddStaCtx->conn_info.gtk_installed = false;
-				pHddStaCtx->conn_info.ptk_installed = false;
-			}
-
-			pHddStaCtx->roam_info.roamingState =
-						HDD_ROAM_STATE_NONE;
-		}
-	} else {
-		/*
-		 * possible disassoc after issuing set key and waiting
-		 * set key complete.
-		 */
-		pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE;
-	}
-
-	EXIT();
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_perform_roam_set_key_complete() - perform set key complete
- * @pAdapter: pointer to adapter
- *
- * Return: none
- */
-void hdd_perform_roam_set_key_complete(hdd_adapter_t *pAdapter)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	tCsrRoamInfo roamInfo;
-	roamInfo.fAuthRequired = false;
-	cdf_mem_copy(roamInfo.bssid.bytes,
-		     pHddStaCtx->roam_info.bssid, CDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(roamInfo.peerMac.bytes,
-		     pHddStaCtx->roam_info.peerMac, CDF_MAC_ADDR_SIZE);
-
-	cdf_ret_status =
-			hdd_roam_set_key_complete_handler(pAdapter,
-					   &roamInfo,
-					   pHddStaCtx->roam_info.roamId,
-					   pHddStaCtx->roam_info.roamStatus,
-					   eCSR_ROAM_RESULT_AUTHENTICATED);
-	if (cdf_ret_status != CDF_STATUS_SUCCESS)
-		hddLog(LOGE, FL("Set Key complete failure"));
-
-	pHddStaCtx->roam_info.deferKeyComplete = false;
-}
-
-/**
- * hdd_association_completion_handler() - association completion handler
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
-						     tCsrRoamInfo *pRoamInfo,
-						     uint32_t roamId,
-						     eRoamCmdStatus roamStatus,
-						     eCsrRoamResult roamResult)
-{
-	struct net_device *dev = pAdapter->dev;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	uint8_t reqRsnIe[DOT11F_IE_RSN_MAX_LEN];
-	uint32_t reqRsnLength = DOT11F_IE_RSN_MAX_LEN;
-	int ft_carrier_on = false;
-	bool hddDisconInProgress = false;
-	unsigned long rc;
-
-	if (!pHddCtx) {
-		hdd_err("HDD context is NULL");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* HDD has initiated disconnect, do not send connect result indication
-	 * to kernel as it will be handled by __cfg80211_disconnect.
-	 */
-	if ((eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState)
-	    && ((eCSR_ROAM_RESULT_ASSOCIATED == roamResult)
-		|| (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus))) {
-		hddLog(LOG1, FL("Disconnect from HDD in progress"));
-		hddDisconInProgress = true;
-	}
-
-	if (eCSR_ROAM_RESULT_ASSOCIATED == roamResult) {
-		if (NULL == pRoamInfo) {
-			hddLog(LOGE, FL("pRoamInfo is NULL"));
-			return CDF_STATUS_E_FAILURE;
-		}
-		if (!hddDisconInProgress) {
-			hddLog(LOG1, FL("Set HDD connState to eConnectionState_Associated"));
-			hdd_conn_set_connection_state(pAdapter,
-						   eConnectionState_Associated);
-		}
-		/* Save the connection info from CSR... */
-		hdd_conn_save_connect_info(pAdapter, pRoamInfo,
-					   eCSR_BSS_TYPE_INFRASTRUCTURE);
-#ifdef FEATURE_WLAN_WAPI
-		if (pRoamInfo->u.pConnectedProfile->AuthType ==
-		    eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE
-		    || pRoamInfo->u.pConnectedProfile->AuthType ==
-		    eCSR_AUTH_TYPE_WAPI_WAI_PSK) {
-			pAdapter->wapi_info.fIsWapiSta = 1;
-		} else {
-			pAdapter->wapi_info.fIsWapiSta = 0;
-		}
-#endif /* FEATURE_WLAN_WAPI */
-
-		/* Indicate 'connect' status to user space */
-		hdd_send_association_event(dev, pRoamInfo);
-
-		if (cds_is_mcc_in_24G()) {
-			if (pHddCtx->miracast_value)
-				cds_set_mas(pAdapter, pHddCtx->miracast_value);
-		}
-
-		/* Initialize the Linkup event completion variable */
-		INIT_COMPLETION(pAdapter->linkup_event_var);
-
-		/*
-		 * Sometimes Switching ON the Carrier is taking time to activate
-		 * the device properly. Before allowing any packet to go up to
-		 * the application, device activation has to be ensured for
-		 * proper queue mapping by the kernel. we have registered net
-		 * device notifier for device change notification. With this we
-		 * will come to know that the device is getting
-		 * activated properly.
-		 */
-		if (pHddStaCtx->ft_carrier_on == false) {
-			/*
-			 * Enable Linkup Event Servicing which allows the net
-			 * device notifier to set the linkup event variable.
-			 */
-			pAdapter->isLinkUpSvcNeeded = true;
-
-			/* Switch on the Carrier to activate the device */
-			wlan_hdd_netif_queue_control(pAdapter,
-						WLAN_NETIF_CARRIER_ON,
-						WLAN_CONTROL_PATH);
-
-			/*
-			 * Wait for the Link to up to ensure all the queues
-			 * are set properly by the kernel.
-			 */
-			rc = wait_for_completion_timeout(
-					&pAdapter->linkup_event_var,
-					msecs_to_jiffies(ASSOC_LINKUP_TIMEOUT)
-					);
-			if (!rc)
-				hdd_warn("Warning:ASSOC_LINKUP_TIMEOUT");
-
-			/*
-			 * Disable Linkup Event Servicing - no more service
-			 * required from the net device notifier call.
-			 */
-			pAdapter->isLinkUpSvcNeeded = false;
-		} else {
-			pHddStaCtx->ft_carrier_on = false;
-			ft_carrier_on = true;
-		}
-		if ((WLAN_MAX_STA_COUNT + 3) > pRoamInfo->staId)
-			pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter;
-		else
-			hddLog(LOGE, "%s: Wrong Staid: %d", __func__,
-						pRoamInfo->staId);
-
-		pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter;
-
-		if (hdd_ipa_is_enabled(pHddCtx))
-			hdd_ipa_wlan_evt(pAdapter, pRoamInfo->staId,
-					 WLAN_STA_CONNECT,
-					 pRoamInfo->bssid.bytes);
-
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-		wlan_hdd_auto_shutdown_enable(pHddCtx, false);
-#endif
-
-		cds_check_concurrent_intf_and_restart_sap(pHddStaCtx,
-							  pAdapter);
-
-#ifdef FEATURE_WLAN_TDLS
-		wlan_hdd_tdls_connection_callback(pAdapter);
-#endif
-
-#ifdef QCA_PKT_PROTO_TRACE
-		/* STA Associated, update into trace buffer */
-		if (pHddCtx->config->gEnableDebugLog)
-			cds_pkt_trace_buf_update("ST:ASSOC");
-#endif /* QCA_PKT_PROTO_TRACE */
-		/*
-		 * For reassoc, the station is already registered, all we need
-		 * is to change the state of the STA in TL.
-		 * If authentication is required (WPA/WPA2/DWEP), change TL to
-		 * CONNECTED instead of AUTHENTICATED.
-		 */
-		if (!pRoamInfo->fReassocReq) {
-			struct cfg80211_bss *bss;
-#ifdef WLAN_FEATURE_VOWIFI_11R
-			u8 *pFTAssocRsp = NULL;
-			unsigned int assocRsplen = 0;
-			u8 *pFTAssocReq = NULL;
-			unsigned int assocReqlen = 0;
-			struct ieee80211_channel *chan;
-#endif
-			uint8_t rspRsnIe[DOT11F_IE_RSN_MAX_LEN];
-			uint32_t rspRsnLength = DOT11F_IE_RSN_MAX_LEN;
-
-			/* add bss_id to cfg80211 data base */
-			bss =
-				wlan_hdd_cfg80211_update_bss_db(pAdapter,
-								pRoamInfo);
-			if (NULL == bss) {
-				pr_err("wlan: Not able to create BSS entry\n");
-				wlan_hdd_netif_queue_control(pAdapter,
-					WLAN_NETIF_CARRIER_OFF,
-					WLAN_CONTROL_PATH);
-				return CDF_STATUS_E_FAILURE;
-			}
-#ifdef WLAN_FEATURE_VOWIFI_11R
-			if (pRoamInfo->u.pConnectedProfile->AuthType ==
-			    eCSR_AUTH_TYPE_FT_RSN
-			    || pRoamInfo->u.pConnectedProfile->AuthType ==
-			    eCSR_AUTH_TYPE_FT_RSN_PSK) {
-
-				/* Association Response */
-				pFTAssocRsp =
-					(u8 *) (pRoamInfo->pbFrames +
-						pRoamInfo->nBeaconLength +
-						pRoamInfo->nAssocReqLength);
-				if (pFTAssocRsp != NULL) {
-					/*
-					 * pFTAssocRsp needs to point to the IEs
-					 */
-					pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET;
-					hddLog(LOG1,
-					       FL("AssocRsp is now at %02x%02x"),
-					       (unsigned int)pFTAssocRsp[0],
-					       (unsigned int)pFTAssocRsp[1]);
-					assocRsplen =
-						pRoamInfo->nAssocRspLength -
-						FT_ASSOC_RSP_IES_OFFSET;
-				} else {
-					hddLog(LOGE, FL("AssocRsp is NULL"));
-					assocRsplen = 0;
-				}
-
-				/* Association Request */
-				pFTAssocReq = (u8 *) (pRoamInfo->pbFrames +
-						      pRoamInfo->nBeaconLength);
-				if (pFTAssocReq != NULL) {
-					if (!ft_carrier_on) {
-						/*
-						 * pFTAssocReq needs to point to
-						 * the IEs
-						 */
-						pFTAssocReq +=
-							FT_ASSOC_REQ_IES_OFFSET;
-						hddLog(LOG1,
-							FL("pFTAssocReq is now at %02x%02x"),
-						       (unsigned int)
-						       pFTAssocReq[0],
-						       (unsigned int)
-						       pFTAssocReq[1]);
-						assocReqlen =
-						    pRoamInfo->nAssocReqLength -
-							FT_ASSOC_REQ_IES_OFFSET;
-					} else {
-						/*
-						 * This should contain only the
-						 * FTIEs
-						 */
-						assocReqlen =
-						    pRoamInfo->nAssocReqLength;
-					}
-				} else {
-					hddLog(LOGE, FL("AssocReq is NULL"));
-					assocReqlen = 0;
-				}
-
-				if (ft_carrier_on) {
-					if (!hddDisconInProgress) {
-						/*
-						 * After roaming is completed,
-						 * active session count is
-						 * incremented as a part of
-						 * connect indication but
-						 * effectively the active
-						 * session count should still
-						 * be the same and hence upon
-						 * successful reassoc
-						 * decrement the active session
-						 * count here.
-						 */
-						if (!hdd_is_roam_sync_in_progress
-								(pRoamInfo))
-							cds_decr_session_set_pcl
-								(pAdapter->device_mode,
-								 pAdapter->sessionId);
-						hddLog(LOG1,
-						       FL("ft_carrier_on is %d, sending roamed indication"),
-						       ft_carrier_on);
-						chan =
-							ieee80211_get_channel
-								(pAdapter->wdev.wiphy,
-								(int)pRoamInfo->pBssDesc->
-								channelId);
-						hddLog(LOG1,
-						       "assocReqlen %d assocRsplen %d",
-						       assocReqlen,
-						       assocRsplen);
-
-						hdd_notice(
-							"Reassoc Req IE dump");
-						CDF_TRACE_HEX_DUMP(
-							CDF_MODULE_ID_HDD,
-							CDF_TRACE_LEVEL_DEBUG,
-							pFTAssocReq,
-							assocReqlen);
-
-						cfg80211_roamed(dev, chan,
-								pRoamInfo->
-								bssid.bytes,
-								pFTAssocReq,
-								assocReqlen,
-								pFTAssocRsp,
-								assocRsplen,
-								GFP_KERNEL);
-						wlan_hdd_send_roam_auth_event(
-								pHddCtx,
-								pRoamInfo->bssid.bytes,
-								pFTAssocReq,
-								assocReqlen,
-								pFTAssocRsp,
-								assocRsplen,
-								pRoamInfo);
-					}
-					if (sme_get_ftptk_state
-						    (WLAN_HDD_GET_HAL_CTX(pAdapter),
-						    pAdapter->sessionId)) {
-						sme_set_ftptk_state
-							(WLAN_HDD_GET_HAL_CTX
-								(pAdapter),
-							pAdapter->sessionId,
-							false);
-						pRoamInfo->fAuthRequired =
-							false;
-
-						cdf_mem_copy(pHddStaCtx->
-							     roam_info.bssid,
-							     pRoamInfo->bssid.bytes,
-							     CDF_MAC_ADDR_SIZE);
-						cdf_mem_copy(pHddStaCtx->
-							     roam_info.peerMac,
-							     pRoamInfo->peerMac.bytes,
-							     CDF_MAC_ADDR_SIZE);
-						pHddStaCtx->roam_info.roamId =
-							roamId;
-						pHddStaCtx->roam_info.
-						roamStatus = roamStatus;
-						pHddStaCtx->roam_info.
-						deferKeyComplete = true;
-					}
-				} else if (!hddDisconInProgress) {
-					hddLog(LOG1,
-					       FL("ft_carrier_on is %d, sending connect indication"),
-					       ft_carrier_on);
-					cfg80211_connect_result(dev,
-								pRoamInfo->
-								bssid.bytes,
-								pFTAssocReq,
-								assocReqlen,
-								pFTAssocRsp,
-								assocRsplen,
-								WLAN_STATUS_SUCCESS,
-								GFP_KERNEL);
-				}
-			} else
-#endif
-			{
-				/*
-				 * wpa supplicant expecting WPA/RSN IE in
-				 * connect result.
-				 */
-				csr_roam_get_wpa_rsn_req_ie(WLAN_HDD_GET_HAL_CTX
-								    (pAdapter),
-							    pAdapter->sessionId,
-							    &reqRsnLength,
-							    reqRsnIe);
-
-				csr_roam_get_wpa_rsn_rsp_ie(WLAN_HDD_GET_HAL_CTX
-								    (pAdapter),
-							    pAdapter->sessionId,
-							    &rspRsnLength,
-							    rspRsnIe);
-				if (!hddDisconInProgress) {
-					if (ft_carrier_on)
-						hdd_send_re_assoc_event(dev,
-									pAdapter,
-									pRoamInfo,
-									reqRsnIe,
-									reqRsnLength);
-					else {
-						hddLog(LOG1,
-						       FL("sending connect indication to nl80211:for bssid "
-						       MAC_ADDRESS_STR
-						       " result:%d and Status:%d"),
-						       MAC_ADDR_ARRAY
-							       (pRoamInfo->bssid.bytes),
-						       roamResult, roamStatus);
-
-						/* inform connect result to nl80211 */
-						cfg80211_connect_result(dev,
-									pRoamInfo->
-									bssid.bytes,
-									reqRsnIe,
-									reqRsnLength,
-									rspRsnIe,
-									rspRsnLength,
-									WLAN_STATUS_SUCCESS,
-									GFP_KERNEL);
-					}
-				}
-			}
-			if (!hddDisconInProgress) {
-				cfg80211_put_bss(
-					pHddCtx->wiphy,
-					bss);
-
-				/*
-				 * Perform any WMM-related association
-				 * processing.
-				 */
-				hdd_wmm_assoc(pAdapter, pRoamInfo,
-					      eCSR_BSS_TYPE_INFRASTRUCTURE);
-
-				/*
-				 * Start the Queue - Start tx queues before
-				 * hdd_roam_register_sta, since
-				 * hdd_roam_register_sta will flush any cached
-				 * data frames immediately.
-				 */
-				hddLog(LOG1, FL("Enabling queues"));
-				wlan_hdd_netif_queue_control(pAdapter,
-						WLAN_WAKE_ALL_NETIF_QUEUE,
-						WLAN_CONTROL_PATH);
-
-				/*
-				 * Register the Station with TL after associated
-				 */
-				cdf_status = hdd_roam_register_sta(pAdapter,
-								   pRoamInfo,
-								   pHddStaCtx->
-								   conn_info.
-								   staId[0],
-								   NULL,
-								   pRoamInfo->
-								   pBssDesc);
-			}
-		} else {
-			/*
-			 * wpa supplicant expecting WPA/RSN IE in connect result
-			 * in case of reassociation also need to indicate it to
-			 * supplicant.
-			 */
-			csr_roam_get_wpa_rsn_req_ie(
-						WLAN_HDD_GET_HAL_CTX(pAdapter),
-						pAdapter->sessionId,
-						&reqRsnLength, reqRsnIe);
-
-			hdd_send_re_assoc_event(dev, pAdapter, pRoamInfo,
-						reqRsnIe, reqRsnLength);
-			/* Reassoc successfully */
-			if (pRoamInfo->fAuthRequired) {
-				cdf_status =
-					hdd_change_peer_state(pAdapter,
-						pHddStaCtx->conn_info.staId[0],
-						ol_txrx_peer_state_conn,
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-						pRoamInfo->roamSynchInProgress
-#else
-						false
-#endif
-						);
-				hdd_conn_set_authenticated(pAdapter, false);
-			} else {
-				hddLog(LOG2,
-					FL("staId: %d Changing TL state to AUTHENTICATED"),
-					  pHddStaCtx->conn_info.staId[0]);
-				cdf_status =
-					hdd_change_peer_state(pAdapter,
-						pHddStaCtx->conn_info.staId[0],
-						ol_txrx_peer_state_auth,
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-						pRoamInfo->roamSynchInProgress
-#else
-						false
-#endif
-						);
-				hdd_conn_set_authenticated(pAdapter, true);
-			}
-
-			if (CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				/*
-				 * Perform any WMM-related association
-				 * processing
-				 */
-				hdd_wmm_assoc(pAdapter, pRoamInfo,
-					      eCSR_BSS_TYPE_INFRASTRUCTURE);
-			}
-
-			/* Start the tx queues */
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-			if (pRoamInfo->roamSynchInProgress)
-				hddLog(LOG3, "LFR3:netif_tx_wake_all_queues");
-#endif
-			hddLog(LOG1, FL("Enabling queues"));
-			wlan_hdd_netif_queue_control(pAdapter,
-						   WLAN_WAKE_ALL_NETIF_QUEUE,
-						   WLAN_CONTROL_PATH);
-		}
-
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOGE,
-				"STA register with TL failed. status(=%d) [%08X]",
-				cdf_status, cdf_status);
-		}
-#ifdef WLAN_FEATURE_11W
-		cdf_mem_zero(&pAdapter->hdd_stats.hddPmfStats,
-			     sizeof(pAdapter->hdd_stats.hddPmfStats));
-#endif
-	} else {
-		hdd_wext_state_t *pWextState =
-			WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-		if (pRoamInfo)
-			pr_info("wlan: connection failed with " MAC_ADDRESS_STR
-				" result:%d and Status:%d\n",
-				MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes),
-				roamResult, roamStatus);
-		else
-			pr_info("wlan: connection failed with " MAC_ADDRESS_STR
-				" result:%d and Status:%d\n",
-				MAC_ADDR_ARRAY(pWextState->req_bssId.bytes),
-				roamResult, roamStatus);
-
-		/*
-		 * CR465478: Only send up a connection failure result when CSR
-		 * has completed operation - with a ASSOCIATION_FAILURE status.
-		 */
-		if (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus
-		    && !hddDisconInProgress) {
-			if (pRoamInfo)
-				hddLog(LOGE,
-				       FL("send connect failure to nl80211: for bssid "
-				       MAC_ADDRESS_STR
-				       " result:%d and Status:%d reasoncode %d"),
-				       MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes),
-				       roamResult, roamStatus,
-				       pRoamInfo->reasonCode);
-			else
-				hddLog(LOGE,
-				       FL("connect failed: for bssid "
-				       MAC_ADDRESS_STR
-				       " result:%d and Status:%d "),
-				       MAC_ADDR_ARRAY(pWextState->req_bssId.bytes),
-				       roamResult, roamStatus);
-
-			/* inform association failure event to nl80211 */
-			if (eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL ==
-			    roamResult) {
-				if (pRoamInfo)
-					cfg80211_connect_result(dev,
-						pRoamInfo->bssid.bytes,
-						NULL, 0, NULL, 0,
-						WLAN_STATUS_ASSOC_DENIED_UNSPEC,
-						GFP_KERNEL);
-				else
-					cfg80211_connect_result(dev,
-						pWextState->req_bssId.bytes,
-						NULL, 0, NULL, 0,
-						WLAN_STATUS_ASSOC_DENIED_UNSPEC,
-						GFP_KERNEL);
-			} else {
-				if (pRoamInfo) {
-					eCsrAuthType authType =
-						pWextState->roamProfile.AuthType.
-						authType[0];
-					eCsrEncryptionType encryption_type =
-						pWextState->roamProfile.
-						EncryptionType.encryptionType[0];
-					bool isWep =
-						(((authType ==
-						eCSR_AUTH_TYPE_OPEN_SYSTEM) ||
-						(authType ==
-						eCSR_AUTH_TYPE_SHARED_KEY)) &&
-						((encryption_type ==
-						eCSR_ENCRYPT_TYPE_WEP40) ||
-						(encryption_type ==
-						eCSR_ENCRYPT_TYPE_WEP104) ||
-						(encryption_type ==
-						eCSR_ENCRYPT_TYPE_WEP40_STATICKEY) ||
-						(encryption_type ==
-						eCSR_ENCRYPT_TYPE_WEP104_STATICKEY)));
-					/*
-					 * In case of OPEN-WEP or SHARED-WEP
-					 * authentication, send exact protocol
-					 * reason code. This enables user
-					 * applications to reconnect the station
-					 * with correct configuration.
-					 */
-					cfg80211_connect_result(dev,
-						pRoamInfo->bssid.bytes, NULL, 0,
-						NULL, 0,
-						(isWep &&
-						 pRoamInfo->reasonCode) ?
-						pRoamInfo->reasonCode :
-						WLAN_STATUS_UNSPECIFIED_FAILURE,
-						GFP_KERNEL);
-				} else
-					cfg80211_connect_result(dev,
-						pWextState->req_bssId.bytes,
-						NULL, 0, NULL, 0,
-						WLAN_STATUS_UNSPECIFIED_FAILURE,
-						GFP_KERNEL);
-			}
-			hdd_clear_roam_profile_ie(pAdapter);
-		}
-
-		if (pRoamInfo) {
-			if ((eSIR_SME_JOIN_TIMEOUT_RESULT_CODE ==
-			     pRoamInfo->statusCode)
-			    || (eSIR_SME_AUTH_TIMEOUT_RESULT_CODE ==
-				pRoamInfo->statusCode)
-			    || (eSIR_SME_ASSOC_TIMEOUT_RESULT_CODE ==
-				pRoamInfo->statusCode)) {
-				wlan_hdd_cfg80211_update_bss_list(pAdapter,
-								  pRoamInfo);
-			}
-		}
-
-		/*
-		 * Set connection state to eConnectionState_NotConnected only
-		 * when CSR has completed operation - with a
-		 * ASSOCIATION_FAILURE status.
-		 */
-		if (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus
-		    && !hddDisconInProgress) {
-			hddLog(LOG1,
-				FL("state to eConnectionState_NotConnected"));
-			hdd_conn_set_connection_state(pAdapter,
-					eConnectionState_NotConnected);
-		}
-		hdd_wmm_init(pAdapter);
-
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter,
-					   WLAN_NETIF_TX_DISABLE_N_CARRIER,
-					   WLAN_CONTROL_PATH);
-	}
-
-	if (CDF_STATUS_SUCCESS != cds_check_and_restart_sap(
-					roamResult, pHddStaCtx))
-		return CDF_STATUS_E_FAILURE;
-
-	if (NULL != pRoamInfo && NULL != pRoamInfo->pBssDesc) {
-		cds_force_sap_on_scc(roamResult,
-				pRoamInfo->pBssDesc->channelId);
-	} else {
-		hdd_err("pRoamInfo profile is not set properly");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_roam_ibss_indication_handler() - update the status of the IBSS
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * Here we update the status of the Ibss when we receive information that we
- * have started/joined an ibss session.
- *
- * Return: none
- */
-static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter,
-					     tCsrRoamInfo *pRoamInfo,
-					     uint32_t roamId,
-					     eRoamCmdStatus roamStatus,
-					     eCsrRoamResult roamResult)
-{
-	hddLog(LOG1, "%s: id %d, status %d, result %d",
-	       pAdapter->dev->name, roamId, roamStatus, roamResult);
-
-	switch (roamResult) {
-	/* both IBSS Started and IBSS Join should come in here. */
-	case eCSR_ROAM_RESULT_IBSS_STARTED:
-	case eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS:
-	case eCSR_ROAM_RESULT_IBSS_COALESCED:
-	{
-		hdd_context_t *pHddCtx =
-			(hdd_context_t *) pAdapter->pHddCtx;
-		hdd_station_ctx_t *hdd_sta_ctx =
-			WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-		struct cdf_mac_addr broadcastMacAddr =
-			CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-
-		if (NULL == pRoamInfo) {
-			CDF_ASSERT(0);
-			return;
-		}
-
-		/* When IBSS Started comes from CSR, we need to move
-		 * connection state to IBSS Disconnected (meaning no peers
-		 * are in the IBSS).
-		 */
-		hddLog(LOG1,
-			FL("Set HDD connState to eConnectionState_IbssDisconnected"));
-		hdd_conn_set_connection_state(pAdapter,
-				      eConnectionState_IbssDisconnected);
-		/* notify wmm */
-		hdd_wmm_connect(pAdapter, pRoamInfo,
-				eCSR_BSS_TYPE_IBSS);
-
-		hdd_sta_ctx->broadcast_ibss_staid = pRoamInfo->staId;
-
-		pHddCtx->sta_to_adapter[pRoamInfo->staId] =
-			pAdapter;
-		hdd_roam_register_sta(pAdapter, pRoamInfo,
-				      pRoamInfo->staId,
-				      &broadcastMacAddr,
-				      pRoamInfo->pBssDesc);
-
-		if (pRoamInfo->pBssDesc) {
-			struct cfg80211_bss *bss;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
-			struct ieee80211_channel *chan;
-			int chan_no;
-			unsigned int freq;
-#endif
-			/* we created the IBSS, notify supplicant */
-			hddLog(LOG1,
-			       FL("%s: created ibss " MAC_ADDRESS_STR),
-			       pAdapter->dev->name,
-			       MAC_ADDR_ARRAY(pRoamInfo->pBssDesc->bssId));
-
-			/* we must first give cfg80211 the BSS information */
-			bss = wlan_hdd_cfg80211_update_bss_db(pAdapter,
-								pRoamInfo);
-			if (NULL == bss) {
-				hddLog(LOGE,
-				       FL("%s: unable to create IBSS entry"),
-				       pAdapter->dev->name);
-				return;
-			}
-			hddLog(LOG1, FL("Enabling queues"));
-			wlan_hdd_netif_queue_control(pAdapter,
-					WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
-					WLAN_CONTROL_PATH);
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
-			chan_no = pRoamInfo->pBssDesc->channelId;
-
-			if (chan_no <= 14)
-				freq = ieee80211_channel_to_frequency(chan_no,
-					  IEEE80211_BAND_2GHZ);
-			else
-				freq = ieee80211_channel_to_frequency(chan_no,
-					  IEEE80211_BAND_5GHZ);
-
-			chan = ieee80211_get_channel(pAdapter->wdev.wiphy, freq);
-
-			if (chan)
-				cfg80211_ibss_joined(pAdapter->dev,
-						     bss->bssid, chan,
-						     GFP_KERNEL);
-			else
-				hddLog(LOGE, FL("%s: chanId: %d, can't find channel"),
-					   pAdapter->dev->name,
-					   (int)pRoamInfo->pBssDesc->channelId);
-#else
-			cfg80211_ibss_joined(pAdapter->dev, bss->bssid,
-					     GFP_KERNEL);
-#endif
-			cfg80211_put_bss(
-				pHddCtx->wiphy,
-				bss);
-		}
-		if (eCSR_ROAM_RESULT_IBSS_STARTED == roamResult) {
-			cds_incr_active_session(pAdapter->device_mode,
-					pAdapter->sessionId);
-		} else if (eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS == roamResult ||
-				eCSR_ROAM_RESULT_IBSS_COALESCED == roamResult) {
-			cds_update_connection_info(pAdapter->sessionId);
-		}
-		break;
-	}
-
-	case eCSR_ROAM_RESULT_IBSS_START_FAILED:
-	{
-		hddLog(LOGE,
-		       FL("%s: unable to create IBSS"), pAdapter->dev->name);
-		break;
-	}
-
-	default:
-		hddLog(LOGE, FL("%s: unexpected result %d"),
-		       pAdapter->dev->name, (int)roamResult);
-		break;
-	}
-
-	return;
-}
-
-/**
- * roam_save_ibss_station() - Save the IBSS peer MAC address in the adapter
- * @pHddStaCtx: pointer to global HDD station context
- * @staId: station id
- * @peerMacAddress: pointer to peer MAC address
- *
- * This information is passed to iwconfig later. The peer that joined
- * last is passed as information to iwconfig.
- *
- * Return:
- *	true if we add MAX_IBSS_PEERS or less STA
- *	false otherwise.
- */
-static bool roam_save_ibss_station(hdd_station_ctx_t *pHddStaCtx, uint8_t staId,
-				  struct cdf_mac_addr *peerMacAddress)
-{
-	bool fSuccess = false;
-	int idx = 0;
-
-	for (idx = 0; idx < MAX_IBSS_PEERS; idx++) {
-		if (0 == pHddStaCtx->conn_info.staId[idx]) {
-			pHddStaCtx->conn_info.staId[idx] = staId;
-
-			cdf_copy_macaddr(&pHddStaCtx->conn_info.
-					 peerMacAddress[idx], peerMacAddress);
-
-			fSuccess = true;
-			break;
-		}
-	}
-
-	return fSuccess;
-}
-
-/**
- * roam_remove_ibss_station() - Remove the IBSS peer MAC address in the adapter
- * @pAdapter: pointer to adapter
- * @staId: station id
- *
- * Return:
- *	true if we remove MAX_IBSS_PEERS or less STA
- *	false otherwise.
- */
-static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId)
-{
-	bool fSuccess = false;
-	int idx = 0;
-	uint8_t valid_idx = 0;
-	uint8_t del_idx = 0;
-	uint8_t empty_slots = 0;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	for (idx = 0; idx < MAX_IBSS_PEERS; idx++) {
-		if (staId == pHddStaCtx->conn_info.staId[idx]) {
-			pHddStaCtx->conn_info.staId[idx] = 0;
-
-			cdf_zero_macaddr(&pHddStaCtx->conn_info.
-					 peerMacAddress[idx]);
-
-			fSuccess = true;
-
-			/*
-			 * Note the deleted Index, if its 0 we need special
-			 * handling.
-			 */
-			del_idx = idx;
-
-			empty_slots++;
-		} else {
-			if (pHddStaCtx->conn_info.staId[idx] != 0) {
-				valid_idx = idx;
-			} else {
-				/* Found an empty slot */
-				empty_slots++;
-			}
-		}
-	}
-
-	if (MAX_IBSS_PEERS == empty_slots) {
-		/* Last peer departed, set the IBSS state appropriately */
-		pHddStaCtx->conn_info.connState =
-			eConnectionState_IbssDisconnected;
-		hddLog(LOGE, "Last IBSS Peer Departed!!!");
-	}
-	/* Find next active staId, to have a valid sta trigger for TL. */
-	if (fSuccess == true) {
-		if (del_idx == 0) {
-			if (pHddStaCtx->conn_info.staId[valid_idx] != 0) {
-				pHddStaCtx->conn_info.staId[0] =
-					pHddStaCtx->conn_info.staId[valid_idx];
-				cdf_copy_macaddr(&pHddStaCtx->conn_info.
-						 peerMacAddress[0],
-						 &pHddStaCtx->conn_info.
-						 peerMacAddress[valid_idx]);
-
-				pHddStaCtx->conn_info.staId[valid_idx] = 0;
-				cdf_zero_macaddr(&pHddStaCtx->conn_info.
-						 peerMacAddress[valid_idx]);
-			}
-		}
-	}
-	return fSuccess;
-}
-
-/**
- * roam_ibss_connect_handler() - IBSS connection handler
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- *
- * We update the status of the IBSS to connected in this function.
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS roam_ibss_connect_handler(hdd_adapter_t *pAdapter,
-					    tCsrRoamInfo *pRoamInfo)
-{
-	struct cfg80211_bss *bss;
-	hddLog(LOG1, FL("IBSS Connect Indication from SME. Set HDD connState to eConnectionState_IbssConnected"));
-	/*
-	 * Set the internal connection state to show 'IBSS Connected' (IBSS with
-	 * a partner stations).
-	 */
-	hdd_conn_set_connection_state(pAdapter, eConnectionState_IbssConnected);
-
-	/* Save the connection info from CSR... */
-	hdd_conn_save_connect_info(pAdapter, pRoamInfo, eCSR_BSS_TYPE_IBSS);
-
-	/* Send the bssid address to the wext. */
-	hdd_send_association_event(pAdapter->dev, pRoamInfo);
-	/* add bss_id to cfg80211 data base */
-	bss = wlan_hdd_cfg80211_update_bss_db(pAdapter, pRoamInfo);
-	if (NULL == bss) {
-		hddLog(LOGE,
-		       FL("%s: unable to create IBSS entry"),
-		       pAdapter->dev->name);
-		return CDF_STATUS_E_FAILURE;
-	}
-	cfg80211_put_bss(
-		WLAN_HDD_GET_CTX(pAdapter)->wiphy,
-		bss);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_roam_mic_error_indication_handler() - MIC error indication handler
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * This function indicates the Mic failure to the supplicant
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS
-hdd_roam_mic_error_indication_handler(hdd_adapter_t *pAdapter,
-				      tCsrRoamInfo *pRoamInfo,
-				      uint32_t roamId,
-				      eRoamCmdStatus roamStatus,
-				      eCsrRoamResult roamResult)
-{
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	if (eConnectionState_Associated == pHddStaCtx->conn_info.connState &&
-	    TKIP_COUNTER_MEASURE_STOPED ==
-	    pHddStaCtx->WextState.mTKIPCounterMeasures) {
-		struct iw_michaelmicfailure msg;
-		union iwreq_data wreq;
-		memset(&msg, '\0', sizeof(msg));
-		msg.src_addr.sa_family = ARPHRD_ETHER;
-		memcpy(msg.src_addr.sa_data,
-		       pRoamInfo->u.pMICFailureInfo->taMacAddr,
-		       sizeof(pRoamInfo->u.pMICFailureInfo->taMacAddr));
-		hddLog(LOG1, "MIC MAC " MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(msg.src_addr.sa_data));
-
-		if (pRoamInfo->u.pMICFailureInfo->multicast == eSIR_TRUE)
-			msg.flags = IW_MICFAILURE_GROUP;
-		else
-			msg.flags = IW_MICFAILURE_PAIRWISE;
-		memset(&wreq, 0, sizeof(wreq));
-		wreq.data.length = sizeof(msg);
-		wireless_send_event(pAdapter->dev, IWEVMICHAELMICFAILURE, &wreq,
-				    (char *)&msg);
-		/* inform mic failure to nl80211 */
-		cfg80211_michael_mic_failure(pAdapter->dev,
-					     pRoamInfo->u.pMICFailureInfo->
-					     taMacAddr,
-					     ((pRoamInfo->u.pMICFailureInfo->
-					       multicast ==
-					       eSIR_TRUE) ?
-					      NL80211_KEYTYPE_GROUP :
-					      NL80211_KEYTYPE_PAIRWISE),
-					     pRoamInfo->u.pMICFailureInfo->
-					     keyId,
-					     pRoamInfo->u.pMICFailureInfo->TSC,
-					     GFP_KERNEL);
-
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * roam_roam_connect_status_update_handler() - IBSS connect status update
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * The Ibss connection status is updated regularly here in this function.
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS
-roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter,
-					tCsrRoamInfo *pRoamInfo,
-					uint32_t roamId,
-					eRoamCmdStatus roamStatus,
-					eCsrRoamResult roamResult)
-{
-	CDF_STATUS cdf_status;
-
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	switch (roamResult) {
-	case eCSR_ROAM_RESULT_IBSS_NEW_PEER:
-	{
-		hdd_station_ctx_t *pHddStaCtx =
-			WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-		struct station_info staInfo;
-
-		pr_info("IBSS New Peer indication from SME "
-			"with peerMac " MAC_ADDRESS_STR " BSSID: "
-			MAC_ADDRESS_STR " and stationID= %d",
-			MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes),
-			MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId.bytes),
-			pRoamInfo->staId);
-
-		if (!roam_save_ibss_station
-			    (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter),
-			    pRoamInfo->staId,
-			    &pRoamInfo->peerMac)) {
-			hddLog(LOGW, "Max reached: Can't register new IBSS peer");
-			break;
-		}
-
-		pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter;
-
-		/* Register the Station with TL for the new peer. */
-		cdf_status = hdd_roam_register_sta(pAdapter,
-						   pRoamInfo,
-						   pRoamInfo->staId,
-						   &pRoamInfo->peerMac,
-						   pRoamInfo->pBssDesc);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOGE,
-				"Cannot register STA with TL for IBSS. Failed with cdf_status = %d [%08X]",
-				cdf_status, cdf_status);
-		}
-		pHddStaCtx->ibss_sta_generation++;
-		memset(&staInfo, 0, sizeof(staInfo));
-		staInfo.filled = 0;
-		staInfo.generation = pHddStaCtx->ibss_sta_generation;
-
-		cfg80211_new_sta(pAdapter->dev,
-				 (const u8 *)pRoamInfo->peerMac.bytes,
-				 &staInfo, GFP_KERNEL);
-
-		if (eCSR_ENCRYPT_TYPE_WEP40_STATICKEY ==
-		    pHddStaCtx->ibss_enc_key.encType
-		    || eCSR_ENCRYPT_TYPE_WEP104_STATICKEY ==
-		    pHddStaCtx->ibss_enc_key.encType
-		    || eCSR_ENCRYPT_TYPE_TKIP ==
-		    pHddStaCtx->ibss_enc_key.encType
-		    || eCSR_ENCRYPT_TYPE_AES ==
-		    pHddStaCtx->ibss_enc_key.encType) {
-			pHddStaCtx->ibss_enc_key.keyDirection =
-				eSIR_TX_RX;
-			cdf_copy_macaddr(&pHddStaCtx->ibss_enc_key.peerMac,
-					 &pRoamInfo->peerMac);
-
-			hddLog(LOG2, "New peer joined set PTK encType=%d",
-				  pHddStaCtx->ibss_enc_key.encType);
-
-			cdf_status =
-				sme_roam_set_key(WLAN_HDD_GET_HAL_CTX
-							 (pAdapter),
-						 pAdapter->sessionId,
-						 &pHddStaCtx->ibss_enc_key,
-						 &roamId);
-
-			if (CDF_STATUS_SUCCESS != cdf_status) {
-				hddLog(LOGE,
-				       FL("sme_roam_set_key failed, status=%d"),
-				       cdf_status);
-				return CDF_STATUS_E_FAILURE;
-			}
-		}
-		hddLog(LOG1, FL("Enabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter,
-					   WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
-					   WLAN_CONTROL_PATH);
-		break;
-	}
-
-	case eCSR_ROAM_RESULT_IBSS_CONNECT:
-	{
-
-		roam_ibss_connect_handler(pAdapter, pRoamInfo);
-
-		break;
-	}
-	case eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED:
-	{
-		hdd_station_ctx_t *pHddStaCtx =
-			WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-		if (!roam_remove_ibss_station(pAdapter, pRoamInfo->staId))
-			hddLog(LOGW,
-				"IBSS peer departed by cannot find peer in our registration table with TL");
-
-		pr_info("IBSS Peer Departed from SME "
-			"with peerMac " MAC_ADDRESS_STR " BSSID: "
-			MAC_ADDRESS_STR " and stationID= %d",
-			MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes),
-			MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId.bytes),
-			pRoamInfo->staId);
-
-		hdd_roam_deregister_sta(pAdapter, pRoamInfo->staId);
-
-		pHddCtx->sta_to_adapter[pRoamInfo->staId] = NULL;
-		pHddStaCtx->ibss_sta_generation++;
-
-		cfg80211_del_sta(pAdapter->dev,
-				 (const u8 *)&pRoamInfo->peerMac.bytes,
-				 GFP_KERNEL);
-		break;
-	}
-	case eCSR_ROAM_RESULT_IBSS_INACTIVE:
-	{
-		hddLog(LOG3,
-			  "Received eCSR_ROAM_RESULT_IBSS_INACTIVE from SME");
-		/* Stop only when we are inactive */
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter,
-					   WLAN_NETIF_TX_DISABLE_N_CARRIER,
-					   WLAN_CONTROL_PATH);
-		hddLog(LOG1,
-			FL("Set HDD connState to eConnectionState_NotConnected"));
-		hdd_conn_set_connection_state(pAdapter,
-					      eConnectionState_NotConnected);
-
-		/* Send the bssid address to the wext. */
-		hdd_send_association_event(pAdapter->dev, pRoamInfo);
-		break;
-	}
-	default:
-		break;
-
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-#ifdef FEATURE_WLAN_TDLS
-/**
- * hdd_roam_register_tdlssta() - register new TDLS station
- * @pAdapter: pointer to adapter
- * @peerMac: pointer to peer MAC address
- * @staId: station identifier
- * @ucastSig: unicast signature
- *
- * Construct the staDesc and register with TL the new STA.
- * This is called as part of ADD_STA in the TDLS setup.
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_roam_register_tdlssta(hdd_adapter_t *pAdapter,
-				     const uint8_t *peerMac, uint16_t staId,
-				     uint8_t ucastSig)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	struct ol_txrx_desc_type staDesc = { 0 };
-
-	/*
-	 * TDLS sta in BSS should be set as STA type TDLS and STA MAC should
-	 * be peer MAC, here we are working on direct Link
-	 */
-	staDesc.sta_id = staId;
-
-	/* set the QoS field appropriately .. */
-	(hdd_wmm_is_active(pAdapter)) ? (staDesc.is_qos_enabled = 1)
-	: (staDesc.is_qos_enabled = 0);
-
-
-	/* Register the Station with TL...  */
-	cdf_status = ol_txrx_register_peer(hdd_rx_packet_cbk,
-						&staDesc);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGE, FL("ol_txrx_register_peer() failed to register. Status=%d [0x%08X]"),
-			cdf_status, cdf_status);
-		return cdf_status;
-	}
-
-	return cdf_status;
-}
-
-/**
- * hdd_roam_deregister_tdlssta() - deregister new TDLS station
- * @pAdapter: pointer to adapter
- * @staId: station identifier
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS hdd_roam_deregister_tdlssta(hdd_adapter_t *pAdapter,
-					      uint8_t staId)
-{
-	CDF_STATUS cdf_status;
-	cdf_status = ol_txrx_clear_peer(staId);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGW, FL("ol_txrx_clear_peer() failed for staID %d. Status=%d [0x%08X]"),
-			staId, cdf_status, cdf_status);
-	}
-	return cdf_status;
-}
-
-/**
- * hdd_roam_tdls_status_update_handler() - TDLS status update handler
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * HDD interface between SME and TL to ensure TDLS client registration with
- * TL in case of new TDLS client is added and deregistration at the time
- * TDLS client is deleted.
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS
-hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter,
-				    tCsrRoamInfo *pRoamInfo,
-				    uint32_t roamId,
-				    eRoamCmdStatus roamStatus,
-				    eCsrRoamResult roamResult)
-{
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	tdlsCtx_t *pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
-	tSmeTdlsPeerStateParams smeTdlsPeerStateParams;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint8_t staIdx;
-	hddTdlsPeer_t *curr_peer;
-	uint32_t reason;
-
-	hddLog(LOG2,
-		  ("hdd_tdlsStatusUpdate: %s staIdx %d " MAC_ADDRESS_STR),
-		  roamResult ==
-		  eCSR_ROAM_RESULT_ADD_TDLS_PEER ? "ADD_TDLS_PEER" : roamResult
-		  ==
-		  eCSR_ROAM_RESULT_DELETE_TDLS_PEER ? "DEL_TDLS_PEER" :
-		  roamResult ==
-		  eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND ? "DEL_TDLS_PEER_IND"
-		  : roamResult ==
-		  eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND ?
-		  "DEL_ALL_TDLS_PEER_IND" : roamResult ==
-		  eCSR_ROAM_RESULT_UPDATE_TDLS_PEER ? "UPDATE_TDLS_PEER" :
-		  roamResult ==
-		  eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP ?
-		  "LINK_ESTABLISH_REQ_RSP" : roamResult ==
-		  eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER ? "TDLS_SHOULD_DISCOVER"
-		  : roamResult ==
-		  eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN ? "TDLS_SHOULD_TEARDOWN"
-		  : roamResult ==
-		  eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED ?
-		  "TDLS_SHOULD_PEER_DISCONNECTED" : "UNKNOWN", pRoamInfo->staId,
-		  MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes));
-
-	if (!pHddTdlsCtx) {
-		hddLog(LOG1,
-			FL("TDLS ctx is null, ignore roamResult (%d)"),
-			roamResult);
-		return status;
-	}
-
-	switch (roamResult) {
-	case eCSR_ROAM_RESULT_ADD_TDLS_PEER:
-	{
-		if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) {
-			hddLog(LOGE, FL("Add Sta failed. status code(=%d)"),
-				pRoamInfo->statusCode);
-		} else {
-			/*
-			 * Check if there is available index for this new TDLS
-			 * STA.
-			 */
-			for (staIdx = 0;
-			     staIdx < pHddCtx->max_num_tdls_sta;
-			     staIdx++) {
-				if (0 ==
-				    pHddCtx->tdlsConnInfo[staIdx].
-				    staId) {
-					pHddCtx->tdlsConnInfo[staIdx].
-					sessionId =
-						pRoamInfo->sessionId;
-					pHddCtx->tdlsConnInfo[staIdx].
-					staId = pRoamInfo->staId;
-
-					hddLog(LOGW,
-						  ("TDLS: STA IDX at %d is %d "
-						   "of mac "
-						   MAC_ADDRESS_STR),
-						  staIdx,
-						  pHddCtx->
-						  tdlsConnInfo[staIdx].
-						  staId,
-						  MAC_ADDR_ARRAY
-							  (pRoamInfo->peerMac.bytes));
-
-					cdf_copy_macaddr(&pHddCtx->
-							 tdlsConnInfo
-							 [staIdx].
-							 peerMac,
-							 &pRoamInfo->
-							 peerMac);
-					status = CDF_STATUS_SUCCESS;
-					break;
-				}
-			}
-			if (staIdx < pHddCtx->max_num_tdls_sta) {
-				if (-1 ==
-				    wlan_hdd_tdls_set_sta_id(pAdapter,
-							     pRoamInfo->
-							     peerMac.bytes,
-							     pRoamInfo->
-							     staId)) {
-					hddLog(LOGE,
-						"wlan_hdd_tdls_set_sta_id() failed");
-					return CDF_STATUS_E_FAILURE;
-				}
-
-				(WLAN_HDD_GET_CTX(pAdapter))->
-				sta_to_adapter[pRoamInfo->staId] =
-					pAdapter;
-				/*
-				 * store the ucast signature,
-				 * if required for further reference.
-				 */
-
-				wlan_hdd_tdls_set_signature(pAdapter,
-							    pRoamInfo->
-							    peerMac.bytes,
-							    pRoamInfo->
-							    ucastSig);
-			} else {
-				status = CDF_STATUS_E_FAILURE;
-				hddLog(LOGE,
-					FL("no available slot in conn_info. staId %d cannot be stored"),
-					pRoamInfo->staId);
-			}
-			pAdapter->tdlsAddStaStatus = status;
-		}
-		complete(&pAdapter->tdls_add_station_comp);
-		break;
-	}
-	case eCSR_ROAM_RESULT_UPDATE_TDLS_PEER:
-	{
-		if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) {
-			hddLog(LOGE,
-				FL("Add Sta failed. status code(=%d)"),
-				pRoamInfo->statusCode);
-		}
-		/* store the ucast signature which will be used later when
-		 * registering to TL
-		 */
-		pAdapter->tdlsAddStaStatus = pRoamInfo->statusCode;
-		complete(&pAdapter->tdls_add_station_comp);
-		break;
-	}
-	case eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP:
-	{
-		if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) {
-			hddLog(LOGE,
-				FL("Link Establish Request failed. status(=%d)"),
-				pRoamInfo->statusCode);
-		}
-		complete(&pAdapter->tdls_link_establish_req_comp);
-		break;
-	}
-	case eCSR_ROAM_RESULT_DELETE_TDLS_PEER:
-	{
-		for (staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta;
-		     staIdx++) {
-			if ((pHddCtx->tdlsConnInfo[staIdx].sessionId ==
-			     pRoamInfo->sessionId)
-			    && pRoamInfo->staId ==
-			    pHddCtx->tdlsConnInfo[staIdx].staId) {
-				hddLog(LOGW,
-					  ("HDD: del STA IDX = %x"),
-					  pRoamInfo->staId);
-
-				curr_peer =
-					wlan_hdd_tdls_find_peer(pAdapter,
-								pRoamInfo->
-								peerMac.bytes,
-								true);
-				if (NULL != curr_peer
-				    && TDLS_IS_CONNECTED(curr_peer)) {
-					hdd_roam_deregister_tdlssta
-						(pAdapter,
-						pRoamInfo->staId);
-					wlan_hdd_tdls_decrement_peer_count
-						(pAdapter);
-				}
-				wlan_hdd_tdls_reset_peer(pAdapter,
-							 pRoamInfo->
-							 peerMac.bytes);
-
-				pHddCtx->tdlsConnInfo[staIdx].staId = 0;
-				pHddCtx->tdlsConnInfo[staIdx].
-				sessionId = 255;
-				cdf_mem_zero(&pHddCtx->
-					     tdlsConnInfo[staIdx].
-					     peerMac,
-					     CDF_MAC_ADDR_SIZE);
-				status = CDF_STATUS_SUCCESS;
-				break;
-			}
-		}
-		complete(&pAdapter->tdls_del_station_comp);
-	}
-	break;
-	case eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND:
-	{
-		hddLog(LOGE,
-			FL("Sending teardown to supplicant with reason code %u"),
-			pRoamInfo->reasonCode);
-
-		curr_peer =
-			wlan_hdd_tdls_find_peer(pAdapter,
-						pRoamInfo->peerMac.bytes, true);
-		wlan_hdd_tdls_indicate_teardown(pAdapter, curr_peer,
-						pRoamInfo->reasonCode);
-		status = CDF_STATUS_SUCCESS;
-		break;
-	}
-	case eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND:
-	{
-		/* 0 staIdx is assigned to AP we dont want to touch that */
-		for (staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta;
-		     staIdx++) {
-			if ((pHddCtx->tdlsConnInfo[staIdx].sessionId ==
-			     pRoamInfo->sessionId)
-			    && pHddCtx->tdlsConnInfo[staIdx].staId) {
-				hddLog(LOGW,
-					  ("hdd_tdlsStatusUpdate: staIdx %d "
-					   MAC_ADDRESS_STR),
-					  pHddCtx->tdlsConnInfo[staIdx].
-					  staId,
-					  MAC_ADDR_ARRAY(pHddCtx->
-							 tdlsConnInfo
-							 [staIdx].
-							 peerMac.
-							 bytes));
-				wlan_hdd_tdls_reset_peer(pAdapter,
-							 pHddCtx->
-							 tdlsConnInfo
-							 [staIdx].
-							 peerMac.bytes);
-				hdd_roam_deregister_tdlssta(pAdapter,
-							    pHddCtx->
-							    tdlsConnInfo
-							    [staIdx].
-							    staId);
-				cdf_mem_zero(&smeTdlsPeerStateParams,
-					     sizeof
-					     (smeTdlsPeerStateParams));
-				smeTdlsPeerStateParams.vdevId =
-					pHddCtx->tdlsConnInfo[staIdx].
-					sessionId;
-				cdf_mem_copy(&smeTdlsPeerStateParams.
-					     peerMacAddr,
-					     &pHddCtx->
-					     tdlsConnInfo[staIdx].
-					     peerMac.bytes,
-					     CDF_MAC_ADDR_SIZE);
-				smeTdlsPeerStateParams.peerState =
-					eSME_TDLS_PEER_STATE_TEARDOWN;
-
-				hddLog(LOG1,
-					FL("calling sme_update_tdls_peer_state for staIdx %d "
-					MAC_ADDRESS_STR),
-					pHddCtx->tdlsConnInfo[staIdx].
-					staId,
-					MAC_ADDR_ARRAY(pHddCtx->
-							 tdlsConnInfo
-							 [staIdx].
-							 peerMac.
-							 bytes));
-				status =
-					sme_update_tdls_peer_state(
-						pHddCtx->hHal,
-						&smeTdlsPeerStateParams);
-				if (CDF_STATUS_SUCCESS != status) {
-					hddLog(LOGE,
-						  FL("sme_update_tdls_peer_state failed for "
-						  MAC_ADDRESS_STR),
-						  MAC_ADDR_ARRAY
-							  (pHddCtx->
-							  tdlsConnInfo[staIdx].
-							  peerMac.bytes));
-				}
-				wlan_hdd_tdls_decrement_peer_count
-					(pAdapter);
-
-				cdf_mem_zero(&pHddCtx->
-					     tdlsConnInfo[staIdx].
-					     peerMac,
-					     CDF_MAC_ADDR_SIZE);
-				pHddCtx->tdlsConnInfo[staIdx].staId = 0;
-				pHddCtx->tdlsConnInfo[staIdx].
-				sessionId = 255;
-
-				status = CDF_STATUS_SUCCESS;
-			}
-		}
-		break;
-	}
-	case eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER:
-	{
-		/* ignore TDLS_SHOULD_DISCOVER if any concurrency detected */
-		if (((1 << CDF_STA_MODE) != pHddCtx->concurrency_mode) ||
-		    (pHddCtx->no_of_active_sessions[CDF_STA_MODE] > 1)) {
-			hddLog(LOG2,
-				FL("concurrency detected. ignore SHOULD_DISCOVER concurrency_mode: 0x%x, active_sessions: %d"),
-				 pHddCtx->concurrency_mode,
-				 pHddCtx->no_of_active_sessions[CDF_STA_MODE]);
-			status = CDF_STATUS_E_FAILURE;
-			break;
-		}
-
-		curr_peer =
-			wlan_hdd_tdls_get_peer(pAdapter,
-					       pRoamInfo->peerMac.bytes);
-		if (!curr_peer) {
-			hddLog(LOGE, FL("curr_peer is null"));
-			status = CDF_STATUS_E_FAILURE;
-		} else {
-			if (eTDLS_LINK_CONNECTED ==
-			    curr_peer->link_status) {
-				hddLog(LOGE,
-					FL("TDLS link status is connected, ignore SHOULD_DISCOVER"));
-			} else {
-				/*
-				 * If external control is enabled then initiate
-				 * TDLS only if forced peer is set otherwise
-				 * ignore should Discover trigger from fw.
-				 */
-				if (pHddCtx->config->
-				    fTDLSExternalControl
-				    && (false ==
-					curr_peer->isForcedPeer)) {
-					hddLog(LOG2,
-						FL
-						("TDLS ExternalControl enabled but curr_peer is not forced, ignore SHOULD_DISCOVER"));
-					status = CDF_STATUS_SUCCESS;
-					break;
-				} else {
-					hddLog(LOG2,
-						FL
-						("initiate TDLS setup on SHOULD_DISCOVER, fTDLSExternalControl: %d, curr_peer->isForcedPeer: %d, reason: %d"),
-						pHddCtx->config->
-						fTDLSExternalControl,
-						curr_peer->isForcedPeer,
-						pRoamInfo->reasonCode);
-				}
-				wlan_hdd_tdls_pre_setup_init_work
-					(pHddTdlsCtx, curr_peer);
-			}
-			status = CDF_STATUS_SUCCESS;
-		}
-		break;
-	}
-
-	case eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN:
-	{
-		curr_peer =
-			wlan_hdd_tdls_find_peer(pAdapter,
-						pRoamInfo->peerMac.bytes, true);
-		if (!curr_peer) {
-			hddLog(LOGE, FL("curr_peer is null"));
-			status = CDF_STATUS_E_FAILURE;
-		} else {
-			if (eTDLS_LINK_CONNECTED ==
-			    curr_peer->link_status) {
-				hddLog(LOGE,
-					  FL
-					  ("Received SHOULD_TEARDOWN for peer "
-					  MAC_ADDRESS_STR
-					  " staId: %d, reason: %d"),
-					  MAC_ADDR_ARRAY(pRoamInfo->
-							 peerMac.bytes),
-					  pRoamInfo->staId,
-					  pRoamInfo->reasonCode);
-
-				if (pRoamInfo->reasonCode ==
-				    eWNI_TDLS_TEARDOWN_REASON_RSSI ||
-				    pRoamInfo->reasonCode ==
-				    eWNI_TDLS_DISCONNECTED_REASON_PEER_DELETE ||
-				    pRoamInfo->reasonCode ==
-				    eWNI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT ||
-				    pRoamInfo->reasonCode ==
-				    eWNI_TDLS_TEARDOWN_REASON_NO_RESPONSE) {
-					reason =
-						eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE;
-				} else
-					reason =
-						eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON;
-
-				wlan_hdd_tdls_indicate_teardown
-					(pHddTdlsCtx->pAdapter, curr_peer,
-					reason);
-			} else {
-				hddLog(LOGE,
-					  FL
-					  ("TDLS link is not connected, ignore SHOULD_TEARDOWN, reason: %d"),
-					  pRoamInfo->reasonCode);
-			}
-			status = CDF_STATUS_SUCCESS;
-		}
-		break;
-	}
-
-	case eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED:
-	{
-		curr_peer =
-			wlan_hdd_tdls_find_peer(pAdapter,
-						pRoamInfo->peerMac.bytes, true);
-		if (!curr_peer) {
-			hddLog(LOGE, FL("curr_peer is null"));
-			status = CDF_STATUS_E_FAILURE;
-		} else {
-			if (eTDLS_LINK_CONNECTED ==
-			    curr_peer->link_status) {
-				hddLog(LOGE,
-					  FL
-					  ("Received SHOULD_PEER_DISCONNECTED for peer "
-					  MAC_ADDRESS_STR
-					  " staId: %d, reason: %d"),
-					  MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes),
-					  pRoamInfo->staId,
-					  pRoamInfo->reasonCode);
-
-				if (pRoamInfo->reasonCode ==
-				    eWNI_TDLS_TEARDOWN_REASON_RSSI ||
-				    pRoamInfo->reasonCode ==
-				    eWNI_TDLS_DISCONNECTED_REASON_PEER_DELETE ||
-				     pRoamInfo->reasonCode ==
-					eWNI_TDLS_TEARDOWN_REASON_PTR_TIMEOUT ||
-				    pRoamInfo->reasonCode ==
-					eWNI_TDLS_TEARDOWN_REASON_NO_RESPONSE) {
-					reason =
-						eSIR_MAC_TDLS_TEARDOWN_PEER_UNREACHABLE;
-				} else
-					reason =
-						eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON;
-
-				wlan_hdd_tdls_indicate_teardown
-					(pHddTdlsCtx->pAdapter, curr_peer,
-					reason);
-			} else {
-				hddLog(LOGE,
-					  FL
-					  ("TDLS link is not connected, ignore SHOULD_PEER_DISCONNECTED, reason: %d"),
-					  pRoamInfo->reasonCode);
-			}
-			status = CDF_STATUS_SUCCESS;
-		}
-		break;
-	}
-	default:
-	{
-		break;
-	}
-	}
-
-	return status;
-}
-#endif
-
-#ifdef WLAN_FEATURE_11W
-/**
- * hdd_indicate_unprot_mgmt_frame() - indicate unprotected management frame
- * @pAdapter:     pointer to the adapter
- * @nFrameLength: Length of the unprotected frame being passed
- * @pbFrames:     Pointer to the frame buffer
- * @frameType:    802.11 frame type
- *
- * This function forwards the unprotected management frame to the supplicant.
- *
- * Return: nothing
- */
-static void
-hdd_indicate_unprot_mgmt_frame(hdd_adapter_t *pAdapter, uint32_t nFrameLength,
-			       uint8_t *pbFrames, uint8_t frameType)
-{
-	uint8_t type = 0;
-	uint8_t subType = 0;
-
-	hddLog(LOG1, FL("Frame Type = %d Frame Length = %d"),
-	       frameType, nFrameLength);
-
-	/* Sanity Checks */
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("pAdapter is NULL"));
-		return;
-	}
-
-	if (NULL == pAdapter->dev) {
-		hddLog(LOGE, FL("pAdapter->dev is NULL"));
-		return;
-	}
-
-	if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) {
-		hddLog(LOGE, FL("pAdapter has invalid magic"));
-		return;
-	}
-
-	if (!nFrameLength) {
-		hddLog(LOGE, FL("Frame Length is Invalid ZERO"));
-		return;
-	}
-
-	if (NULL == pbFrames) {
-		hddLog(LOGE, FL("pbFrames is NULL"));
-		return;
-	}
-
-	type = WLAN_HDD_GET_TYPE_FRM_FC(pbFrames[0]);
-	subType = WLAN_HDD_GET_SUBTYPE_FRM_FC(pbFrames[0]);
-
-	/* Get pAdapter from Destination mac address of the frame */
-	if (type == SIR_MAC_MGMT_FRAME && subType == SIR_MAC_MGMT_DISASSOC) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-		cfg80211_rx_unprot_mlme_mgmt(pAdapter->dev, pbFrames,
-					     nFrameLength);
-#else
-		cfg80211_send_unprot_disassoc(pAdapter->dev, pbFrames,
-					      nFrameLength);
-#endif
-		pAdapter->hdd_stats.hddPmfStats.numUnprotDisassocRx++;
-	} else if (type == SIR_MAC_MGMT_FRAME &&
-		   subType == SIR_MAC_MGMT_DEAUTH) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-		cfg80211_rx_unprot_mlme_mgmt(pAdapter->dev, pbFrames,
-					     nFrameLength);
-#else
-		cfg80211_send_unprot_deauth(pAdapter->dev, pbFrames,
-					    nFrameLength);
-#endif
-		pAdapter->hdd_stats.hddPmfStats.numUnprotDeauthRx++;
-	} else {
-		hddLog(LOGE, FL("Frame type %d and subtype %d are not valid"),
-		       type, subType);
-		return;
-	}
-}
-#endif
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-/**
- * hdd_indicate_tsm_ie() - send traffic stream metrics ie
- * @pAdapter: pointer to adapter
- * @tid: traffic identifier
- * @state: state
- * @measInterval: measurement interval
- *
- * This function sends traffic stream metrics IE information to
- * the supplicant via wireless event.
- *
- * Return: none
- */
-static void
-hdd_indicate_tsm_ie(hdd_adapter_t *pAdapter, uint8_t tid,
-		    uint8_t state, uint16_t measInterval)
-{
-	union iwreq_data wrqu;
-	char buf[IW_CUSTOM_MAX + 1];
-	int nBytes = 0;
-
-	if (NULL == pAdapter)
-		return;
-
-	/* create the event */
-	memset(&wrqu, '\0', sizeof(wrqu));
-	memset(buf, '\0', sizeof(buf));
-
-	hddLog(LOG1, "TSM Ind tid(%d) state(%d) MeasInt(%d)",
-	       tid, state, measInterval);
-
-	nBytes =
-		snprintf(buf, IW_CUSTOM_MAX, "TSMIE=%d:%d:%d", tid, state,
-			 measInterval);
-
-	wrqu.data.pointer = buf;
-	wrqu.data.length = nBytes;
-	/* send the event */
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf);
-}
-
-/**
- * hdd_indicate_cckm_pre_auth() - send cckm preauth indication
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- *
- * This function sends cckm preauth indication to the supplicant
- * via wireless custom event.
- *
- * Return: none
- */
-static void
-hdd_indicate_cckm_pre_auth(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo)
-{
-	union iwreq_data wrqu;
-	char buf[IW_CUSTOM_MAX + 1];
-	char *pos = buf;
-	int nBytes = 0, freeBytes = IW_CUSTOM_MAX;
-
-	if ((NULL == pAdapter) || (NULL == pRoamInfo))
-		return;
-
-	/* create the event */
-	memset(&wrqu, '\0', sizeof(wrqu));
-	memset(buf, '\0', sizeof(buf));
-
-	/* Timestamp0 is lower 32 bits and Timestamp1 is upper 32 bits */
-	hddLog(LOG1,
-	       "CCXPREAUTHNOTIFY=" MAC_ADDRESS_STR " %d:%d",
-	       MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes),
-	       pRoamInfo->timestamp[0], pRoamInfo->timestamp[1]);
-
-	nBytes = snprintf(pos, freeBytes, "CCXPREAUTHNOTIFY=");
-	pos += nBytes;
-	freeBytes -= nBytes;
-
-	cdf_mem_copy(pos, pRoamInfo->bssid.bytes, CDF_MAC_ADDR_SIZE);
-	pos += CDF_MAC_ADDR_SIZE;
-	freeBytes -= CDF_MAC_ADDR_SIZE;
-
-	nBytes = snprintf(pos, freeBytes, " %u:%u",
-			  pRoamInfo->timestamp[0], pRoamInfo->timestamp[1]);
-	freeBytes -= nBytes;
-
-	wrqu.data.pointer = buf;
-	wrqu.data.length = (IW_CUSTOM_MAX - freeBytes);
-
-	/* send the event */
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf);
-}
-
-/**
- * hdd_indicate_ese_adj_ap_rep_ind() - send adjacent AP report indication
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- *
- * Return: none
- */
-static void
-hdd_indicate_ese_adj_ap_rep_ind(hdd_adapter_t *pAdapter,
-				tCsrRoamInfo *pRoamInfo)
-{
-	union iwreq_data wrqu;
-	char buf[IW_CUSTOM_MAX + 1];
-	int nBytes = 0;
-
-	if ((NULL == pAdapter) || (NULL == pRoamInfo))
-		return;
-
-	/* create the event */
-	memset(&wrqu, '\0', sizeof(wrqu));
-	memset(buf, '\0', sizeof(buf));
-
-	hddLog(LOG1, "CCXADJAPREP=%u", pRoamInfo->tsmRoamDelay);
-
-	nBytes =
-		snprintf(buf, IW_CUSTOM_MAX, "CCXADJAPREP=%u",
-			 pRoamInfo->tsmRoamDelay);
-
-	wrqu.data.pointer = buf;
-	wrqu.data.length = nBytes;
-
-	/* send the event */
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf);
-}
-
-/**
- * hdd_indicate_ese_bcn_report_no_results() - beacon report no scan results
- * @pAdapter: pointer to adapter
- * @measurementToken: measurement token
- * @flag: flag
- * @numBss: number of bss
- *
- * If the measurement is none and no scan results found,
- * indicate the supplicant about measurement done.
- *
- * Return: none
- */
-void
-hdd_indicate_ese_bcn_report_no_results(const hdd_adapter_t *pAdapter,
-				       const uint16_t measurementToken,
-				       const bool flag, const uint8_t numBss)
-{
-	union iwreq_data wrqu;
-	char buf[IW_CUSTOM_MAX];
-	char *pos = buf;
-	int nBytes = 0, freeBytes = IW_CUSTOM_MAX;
-
-	memset(&wrqu, '\0', sizeof(wrqu));
-	memset(buf, '\0', sizeof(buf));
-
-	hddLog(LOG1, FL("CCXBCNREP=%d %d %d"), measurementToken,
-	       flag, numBss);
-
-	nBytes =
-		snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d", measurementToken,
-			 flag, numBss);
-
-	wrqu.data.pointer = buf;
-	wrqu.data.length = nBytes;
-	/* send the event */
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buf);
-}
-
-/**
- * hdd_indicate_ese_bcn_report_ind() - send beacon report indication
- * @pAdapter: pointer to adapter
- * @pRoamInfo: pointer to roam info
- *
- * If the measurement is none and no scan results found,
- * indicate the supplicant about measurement done.
- *
- * Return: none
- */
-static void
-hdd_indicate_ese_bcn_report_ind(const hdd_adapter_t *pAdapter,
-				const tCsrRoamInfo *pRoamInfo)
-{
-	union iwreq_data wrqu;
-	char buf[IW_CUSTOM_MAX];
-	char *pos = buf;
-	int nBytes = 0, freeBytes = IW_CUSTOM_MAX;
-	uint8_t i = 0, len = 0;
-	uint8_t tot_bcn_ieLen = 0;  /* total size of the beacon report data */
-	uint8_t lastSent = 0, sendBss = 0;
-	int bcnRepFieldSize =
-		sizeof(pRoamInfo->pEseBcnReportRsp->bcnRepBssInfo[0].
-		       bcnReportFields);
-	uint8_t ieLenByte = 1;
-	/*
-	 * CCXBCNREP=meas_tok<sp>flag<sp>no_of_bss<sp>tot_bcn_ie_len = 18 bytes
-	 */
-#define ESEBCNREPHEADER_LEN  (18)
-
-	if ((NULL == pAdapter) || (NULL == pRoamInfo))
-		return;
-
-	/*
-	 * Custom event can pass maximum of 256 bytes of data,
-	 * based on the IE len we need to identify how many BSS info can
-	 * be filled in to custom event data.
-	 */
-	/*
-	 * meas_tok<sp>flag<sp>no_of_bss<sp>tot_bcn_ie_len bcn_rep_data
-	 * bcn_rep_data will have bcn_rep_fields,ie_len,ie without any spaces
-	 * CCXBCNREP=meas_tok<sp>flag<sp>no_of_bss<sp>tot_bcn_ie_len = 18 bytes
-	 */
-
-	if ((pRoamInfo->pEseBcnReportRsp->flag >> 1)
-	    && (!pRoamInfo->pEseBcnReportRsp->numBss)) {
-		hddLog(LOG1,
-		       "Measurement Done but no scan results");
-		/* If the measurement is none and no scan results found,
-		   indicate the supplicant about measurement done */
-		hdd_indicate_ese_bcn_report_no_results(
-				pAdapter,
-				pRoamInfo->pEseBcnReportRsp->
-				measurementToken,
-				pRoamInfo->pEseBcnReportRsp->flag,
-				pRoamInfo->pEseBcnReportRsp->numBss);
-	} else {
-		while (lastSent < pRoamInfo->pEseBcnReportRsp->numBss) {
-			memset(&wrqu, '\0', sizeof(wrqu));
-			memset(buf, '\0', sizeof(buf));
-			tot_bcn_ieLen = 0;
-			sendBss = 0;
-			pos = buf;
-			freeBytes = IW_CUSTOM_MAX;
-
-			for (i = lastSent;
-			     i < pRoamInfo->pEseBcnReportRsp->numBss; i++) {
-				len =
-					bcnRepFieldSize + ieLenByte +
-					pRoamInfo->pEseBcnReportRsp->
-					bcnRepBssInfo[i].ieLen;
-				if ((len + tot_bcn_ieLen) >
-				    (IW_CUSTOM_MAX - ESEBCNREPHEADER_LEN)) {
-					break;
-				}
-				tot_bcn_ieLen += len;
-				sendBss++;
-				hddLog(LOG1, "i(%d) sizeof bcnReportFields(%d) IeLength(%d) Length of Ie(%d) totLen(%d)",
-				       i, bcnRepFieldSize, 1,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i].ieLen, tot_bcn_ieLen);
-			}
-
-			hddLog(LOG1, "Sending %d BSS Info",
-			       sendBss);
-			hddLog(LOG1, "CCXBCNREP=%d %d %d %d",
-			       pRoamInfo->pEseBcnReportRsp->measurementToken,
-			       pRoamInfo->pEseBcnReportRsp->flag, sendBss,
-			       tot_bcn_ieLen);
-
-			nBytes = snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d ",
-					  pRoamInfo->pEseBcnReportRsp->
-					  measurementToken,
-					  pRoamInfo->pEseBcnReportRsp->flag,
-					  sendBss);
-			pos += nBytes;
-			freeBytes -= nBytes;
-
-			/* Copy total Beacon report data length */
-			cdf_mem_copy(pos, (char *)&tot_bcn_ieLen,
-				     sizeof(tot_bcn_ieLen));
-			pos += sizeof(tot_bcn_ieLen);
-			freeBytes -= sizeof(tot_bcn_ieLen);
-
-			for (i = 0; i < sendBss; i++) {
-				hddLog(LOG1,
-				       "ChanNum(%d) Spare(%d) MeasDuration(%d)"
-				       " PhyType(%d) RecvSigPower(%d) ParentTSF(%u)"
-				       " TargetTSF[0](%u) TargetTSF[1](%u) BeaconInterval(%u)"
-				       " CapabilityInfo(%d) BSSID(%02X:%02X:%02X:%02X:%02X:%02X)",
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       ChanNum,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       Spare,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       MeasDuration,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       PhyType,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       RecvSigPower,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       ParentTsf,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       TargetTsf[0],
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       TargetTsf[1],
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       BcnInterval,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       CapabilityInfo,
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       Bssid[0],
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       Bssid[1],
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       Bssid[2],
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       Bssid[3],
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       Bssid[4],
-				       pRoamInfo->pEseBcnReportRsp->
-				       bcnRepBssInfo[i +
-						     lastSent].bcnReportFields.
-				       Bssid[5]);
-
-				/* bcn report fields are copied */
-				len =
-					sizeof(pRoamInfo->pEseBcnReportRsp->
-					       bcnRepBssInfo[i +
-							     lastSent].
-					       bcnReportFields);
-				cdf_mem_copy(pos,
-					     (char *)&pRoamInfo->
-					     pEseBcnReportRsp->bcnRepBssInfo[i +
-									     lastSent].
-					     bcnReportFields, len);
-				pos += len;
-				freeBytes -= len;
-
-				/* Add 1 byte of ie len */
-				len =
-					pRoamInfo->pEseBcnReportRsp->
-					bcnRepBssInfo[i + lastSent].ieLen;
-				cdf_mem_copy(pos, (char *)&len, sizeof(len));
-				pos += sizeof(len);
-				freeBytes -= sizeof(len);
-
-				/* copy IE from scan results */
-				cdf_mem_copy(pos,
-					     (char *)pRoamInfo->
-					     pEseBcnReportRsp->bcnRepBssInfo[i +
-									     lastSent].
-					     pBuf, len);
-				pos += len;
-				freeBytes -= len;
-			}
-
-			wrqu.data.pointer = buf;
-			wrqu.data.length = IW_CUSTOM_MAX - freeBytes;
-
-			/* send the event */
-			wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu,
-					    buf);
-			lastSent += sendBss;
-		}
-	}
-}
-
-#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
-
-/**
- * hdd_is_8021x_sha256_auth_type() - check authentication type to 8021x_sha256
- * @pHddStaCtx:	Station Context
- *
- * API to check if the connection authentication type is 8021x_sha256.
- *
- * Return: bool
- */
-#ifdef WLAN_FEATURE_11W
-static inline bool hdd_is_8021x_sha256_auth_type(hdd_station_ctx_t *pHddStaCtx)
-{
-	return eCSR_AUTH_TYPE_RSN_8021X_SHA256 ==
-				pHddStaCtx->conn_info.authType;
-}
-#else
-static inline bool hdd_is_8021x_sha256_auth_type(hdd_station_ctx_t *pHddStaCtx)
-{
-	return false;
-}
-#endif
-
-/**
- * hdd_sme_roam_callback() - hdd sme roam callback
- * @pContext: pointer to adapter context
- * @pRoamInfo: pointer to roam info
- * @roamId: roam id
- * @roamStatus: roam status
- * @roamResult: roam result
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS
-hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
-		      eRoamCmdStatus roamStatus, eCsrRoamResult roamResult)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS;
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) pContext;
-	hdd_wext_state_t *pWextState = NULL;
-	hdd_station_ctx_t *pHddStaCtx = NULL;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	hdd_context_t *pHddCtx = NULL;
-
-	hddLog(LOG2,
-		  "CSR Callback: status= %d result= %d roamID=%d",
-		  roamStatus, roamResult, roamId);
-
-	/* Sanity check */
-	if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
-		hddLog(LOGP, "invalid adapter or adapter has invalid magic");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD, TRACE_CODE_HDD_RX_SME_MSG,
-				pAdapter->sessionId, roamStatus));
-
-	switch (roamStatus) {
-	case eCSR_ROAM_SESSION_OPENED:
-		set_bit(SME_SESSION_OPENED, &pAdapter->event_flags);
-		complete(&pAdapter->session_open_comp_var);
-		break;
-
-	/*
-	 * We did pre-auth,then we attempted a 11r or ese reassoc.
-	 * reassoc failed due to failure, timeout, reject from ap
-	 * in any case tell the OS, our carrier is off and mark
-	 * interface down.
-	 */
-	case eCSR_ROAM_FT_REASSOC_FAILED:
-		hddLog(LOGE,
-		       FL
-		       ("Reassoc Failed with roamStatus: %d roamResult: %d SessionID: %d"),
-		       roamStatus, roamResult, pAdapter->sessionId);
-		cdf_ret_status =
-			hdd_dis_connect_handler(pAdapter, pRoamInfo, roamId,
-						roamStatus, roamResult);
-		/*
-		 * Check if Mcast/Bcast Filters are set, if yes
-		 * clear the filters here.
-		 */
-		if ((WLAN_HDD_GET_CTX(pAdapter))->hdd_mcastbcast_filter_set ==
-		    true) {
-			(WLAN_HDD_GET_CTX(pAdapter))->
-			hdd_mcastbcast_filter_set = false;
-		}
-		pHddStaCtx->ft_carrier_on = false;
-		pHddStaCtx->hdd_ReassocScenario = false;
-		hddLog(LOG1,
-		       FL("hdd_ReassocScenario set to: %d, ReAssoc Failed, session: %d"),
-		       pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId);
-		break;
-
-	case eCSR_ROAM_FT_START:
-		/*
-		 * When we roam for ESE and 11r, we dont want the OS to be
-		 * informed that the link is down. So mark the link ready for
-		 * ft_start. After this the eCSR_ROAM_SHOULD_ROAM will
-		 * be received. Where in we will not mark the link down
-		 * Also we want to stop tx at this point when we will be
-		 * doing disassoc at this time. This saves 30-60 msec
-		 * after reassoc.
-		 */
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter,
-				WLAN_NETIF_TX_DISABLE,
-				WLAN_CONTROL_PATH);
-		status = hdd_roam_deregister_sta(pAdapter,
-					pHddStaCtx->conn_info.staId[0]);
-		if (!CDF_IS_STATUS_SUCCESS(status))
-			cdf_ret_status = CDF_STATUS_E_FAILURE;
-		pHddStaCtx->ft_carrier_on = true;
-		pHddStaCtx->hdd_ReassocScenario = true;
-		hddLog(LOG1,
-		       FL("hdd_ReassocScenario set to: %d, due to eCSR_ROAM_FT_START, session: %d"),
-		       pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId);
-		break;
-
-	case eCSR_ROAM_SHOULD_ROAM:
-		/* notify apps that we can't pass traffic anymore */
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter,
-					   WLAN_NETIF_TX_DISABLE,
-					   WLAN_CONTROL_PATH);
-		if (pHddStaCtx->ft_carrier_on == false) {
-			wlan_hdd_netif_queue_control(pAdapter,
-					   WLAN_NETIF_CARRIER_OFF,
-					   WLAN_CONTROL_PATH);
-		}
-		break;
-	case eCSR_ROAM_LOSTLINK:
-		if (roamResult == eCSR_ROAM_RESULT_LOSTLINK) {
-			hddLog(LOG2, "Roaming started due to connection lost");
-			hddLog(LOG1, FL("Disabling queues"));
-			wlan_hdd_netif_queue_control(pAdapter,
-					WLAN_NETIF_TX_DISABLE_N_CARRIER,
-					WLAN_CONTROL_PATH);
-			break;
-		}
-	case eCSR_ROAM_DISASSOCIATED:
-	{
-		hddLog(LOG1, "****eCSR_ROAM_DISASSOCIATED****");
-		cdf_ret_status =
-			hdd_dis_connect_handler(pAdapter, pRoamInfo, roamId,
-						roamStatus, roamResult);
-		/* Check if Mcast/Bcast Filters are set, if yes clear the filters here */
-		pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-		if (pHddCtx->hdd_mcastbcast_filter_set == true) {
-			hdd_conf_mcastbcast_filter(pHddCtx, false);
-
-			if (true ==
-			    pHddCtx->sus_res_mcastbcast_filter_valid) {
-				pHddCtx->configuredMcastBcastFilter =
-					pHddCtx->sus_res_mcastbcast_filter;
-				pHddCtx->
-				sus_res_mcastbcast_filter_valid =
-					false;
-			}
-
-			hddLog(LOG1,
-			       "offload: disassociation happening, restoring configuredMcastBcastFilter");
-			hddLog(LOG1,
-			       "McastBcastFilter = %d",
-			       pHddCtx->configuredMcastBcastFilter);
-			hddLog(LOG1,
-			       "offload: already called mcastbcast filter");
-			(WLAN_HDD_GET_CTX(pAdapter))->
-			hdd_mcastbcast_filter_set = false;
-		}
-		/* Call to clear any MC Addr List filter applied after
-		 * successful connection.
-		 */
-		wlan_hdd_set_mc_addr_list(pAdapter, false);
-	}
-	break;
-	case eCSR_ROAM_IBSS_LEAVE:
-		hddLog(LOG1, "****eCSR_ROAM_IBSS_LEAVE****");
-		cdf_ret_status =
-			hdd_dis_connect_handler(pAdapter, pRoamInfo, roamId,
-						roamStatus, roamResult);
-		break;
-	case eCSR_ROAM_ASSOCIATION_COMPLETION:
-		hddLog(LOG1, "****eCSR_ROAM_ASSOCIATION_COMPLETION****");
-		/*
-		 * To Do - address probable memory leak with WEP encryption upon
-		 * successful association.
-		 */
-		if (eCSR_ROAM_RESULT_ASSOCIATED != roamResult) {
-			/* Clear saved connection information in HDD */
-			hdd_conn_remove_connect_info(
-				WLAN_HDD_GET_STATION_CTX_PTR(pAdapter));
-		}
-		cdf_ret_status =
-			hdd_association_completion_handler(pAdapter, pRoamInfo,
-							   roamId, roamStatus,
-							   roamResult);
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-		if (pRoamInfo)
-			pRoamInfo->roamSynchInProgress = false;
-#endif
-		break;
-	case eCSR_ROAM_ASSOCIATION_FAILURE:
-		cdf_ret_status = hdd_association_completion_handler(pAdapter,
-								    pRoamInfo,
-								    roamId,
-								    roamStatus,
-								    roamResult);
-		break;
-	case eCSR_ROAM_IBSS_IND:
-		hdd_roam_ibss_indication_handler(pAdapter, pRoamInfo, roamId,
-						 roamStatus, roamResult);
-		break;
-
-	case eCSR_ROAM_CONNECT_STATUS_UPDATE:
-		cdf_ret_status =
-			roam_roam_connect_status_update_handler(pAdapter,
-								pRoamInfo,
-								roamId,
-								roamStatus,
-								roamResult);
-		break;
-
-	case eCSR_ROAM_MIC_ERROR_IND:
-		cdf_ret_status =
-			hdd_roam_mic_error_indication_handler(pAdapter,
-							      pRoamInfo,
-							      roamId,
-							      roamStatus,
-							      roamResult);
-		break;
-
-	case eCSR_ROAM_SET_KEY_COMPLETE:
-	{
-		cdf_ret_status =
-			hdd_roam_set_key_complete_handler(pAdapter, pRoamInfo,
-							  roamId, roamStatus,
-							  roamResult);
-		if (eCSR_ROAM_RESULT_AUTHENTICATED == roamResult) {
-			pHddStaCtx->hdd_ReassocScenario = false;
-			hddLog(LOG1,
-			       FL("hdd_ReassocScenario set to: %d, set key complete, session: %d"),
-			       pHddStaCtx->hdd_ReassocScenario,
-			       pAdapter->sessionId);
-		}
-	}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-		if (pRoamInfo != NULL)
-			pRoamInfo->roamSynchInProgress = false;
-#endif
-		break;
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	case eCSR_ROAM_FT_RESPONSE:
-		hdd_send_ft_event(pAdapter);
-		break;
-#endif
-	case eCSR_ROAM_PMK_NOTIFY:
-		if (eCSR_AUTH_TYPE_RSN == pHddStaCtx->conn_info.authType
-				|| hdd_is_8021x_sha256_auth_type(pHddStaCtx)) {
-			/* notify the supplicant of a new candidate */
-			cdf_ret_status =
-				wlan_hdd_cfg80211_pmksa_candidate_notify(
-						pAdapter, pRoamInfo, 1, false);
-		}
-		break;
-
-#ifdef FEATURE_WLAN_LFR_METRICS
-	case eCSR_ROAM_PREAUTH_INIT_NOTIFY:
-		/* This event is to notify pre-auth initiation */
-		if (CDF_STATUS_SUCCESS !=
-		    wlan_hdd_cfg80211_roam_metrics_preauth(pAdapter,
-							   pRoamInfo)) {
-			cdf_ret_status = CDF_STATUS_E_FAILURE;
-		}
-		break;
-	case eCSR_ROAM_PREAUTH_STATUS_SUCCESS:
-		/*
-		 * This event will notify pre-auth completion in case of success
-		 */
-		if (CDF_STATUS_SUCCESS !=
-		    wlan_hdd_cfg80211_roam_metrics_preauth_status(pAdapter,
-							 pRoamInfo, 1)) {
-			cdf_ret_status = CDF_STATUS_E_FAILURE;
-		}
-		break;
-	case eCSR_ROAM_PREAUTH_STATUS_FAILURE:
-		/*
-		 * This event will notify pre-auth completion incase of failure.
-		 */
-		if (CDF_STATUS_SUCCESS !=
-		    wlan_hdd_cfg80211_roam_metrics_preauth_status(pAdapter,
-								pRoamInfo, 0)) {
-			cdf_ret_status = CDF_STATUS_E_FAILURE;
-		}
-		break;
-	case eCSR_ROAM_HANDOVER_SUCCESS:
-		/* This event is to notify handover success.
-		   It will be only invoked on success */
-		if (CDF_STATUS_SUCCESS !=
-		    wlan_hdd_cfg80211_roam_metrics_handover(pAdapter,
-							    pRoamInfo)) {
-			cdf_ret_status = CDF_STATUS_E_FAILURE;
-		}
-		break;
-#endif
-	case eCSR_ROAM_REMAIN_CHAN_READY:
-		hdd_remain_chan_ready_handler(pAdapter, pRoamInfo->roc_scan_id);
-		break;
-	case eCSR_ROAM_SEND_ACTION_CNF:
-		hdd_send_action_cnf(pAdapter,
-				    (roamResult ==
-				     eCSR_ROAM_RESULT_NONE) ? true : false);
-		break;
-#ifdef FEATURE_WLAN_TDLS
-	case eCSR_ROAM_TDLS_STATUS_UPDATE:
-		cdf_ret_status =
-			hdd_roam_tdls_status_update_handler(pAdapter, pRoamInfo,
-							    roamId,
-							    roamStatus,
-							    roamResult);
-		break;
-	case eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND:
-		wlan_hdd_tdls_mgmt_completion_callback(pAdapter,
-						       pRoamInfo->reasonCode);
-		break;
-#endif
-#ifdef WLAN_FEATURE_11W
-	case eCSR_ROAM_UNPROT_MGMT_FRAME_IND:
-		hdd_indicate_unprot_mgmt_frame(pAdapter,
-					       pRoamInfo->nFrameLength,
-					       pRoamInfo->pbFrames,
-					       pRoamInfo->frameType);
-		break;
-#endif
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-	case eCSR_ROAM_TSM_IE_IND:
-		hdd_indicate_tsm_ie(pAdapter, pRoamInfo->tsmIe.tsid,
-				    pRoamInfo->tsmIe.state,
-				    pRoamInfo->tsmIe.msmt_interval);
-		break;
-
-	case eCSR_ROAM_CCKM_PREAUTH_NOTIFY:
-	{
-		if (eCSR_AUTH_TYPE_CCKM_WPA ==
-		    pHddStaCtx->conn_info.authType
-		    || eCSR_AUTH_TYPE_CCKM_RSN ==
-		    pHddStaCtx->conn_info.authType) {
-			hdd_indicate_cckm_pre_auth(pAdapter, pRoamInfo);
-		}
-		break;
-	}
-
-	case eCSR_ROAM_ESE_ADJ_AP_REPORT_IND:
-	{
-		hdd_indicate_ese_adj_ap_rep_ind(pAdapter, pRoamInfo);
-		break;
-	}
-
-	case eCSR_ROAM_ESE_BCN_REPORT_IND:
-	{
-		hdd_indicate_ese_bcn_report_ind(pAdapter, pRoamInfo);
-		break;
-	}
-#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
-	default:
-		break;
-	}
-	return cdf_ret_status;
-}
-
-/**
- * hdd_translate_rsn_to_csr_auth_type() - Translate RSN to CSR auth type
- * @auth_suite: auth suite
- *
- * Return: eCsrAuthType enumeration
- */
-eCsrAuthType hdd_translate_rsn_to_csr_auth_type(uint8_t auth_suite[4])
-{
-	eCsrAuthType auth_type;
-	/* is the auth type supported? */
-	if (memcmp(auth_suite, ccp_rsn_oui01, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_RSN;
-	} else if (memcmp(auth_suite, ccp_rsn_oui02, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_RSN_PSK;
-	} else
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	if (memcmp(auth_suite, ccp_rsn_oui04, 4) == 0) {
-		/* Check for 11r FT Authentication with PSK */
-		auth_type = eCSR_AUTH_TYPE_FT_RSN_PSK;
-	} else if (memcmp(auth_suite, ccp_rsn_oui03, 4) == 0) {
-		/* Check for 11R FT Authentication with 802.1X */
-		auth_type = eCSR_AUTH_TYPE_FT_RSN;
-	} else
-#endif
-#ifdef FEATURE_WLAN_ESE
-	if (memcmp(auth_suite, ccp_rsn_oui06, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_CCKM_RSN;
-	} else
-#endif /* FEATURE_WLAN_ESE */
-#ifdef WLAN_FEATURE_11W
-	if (memcmp(auth_suite, ccp_rsn_oui07, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_RSN_PSK_SHA256;
-	} else if (memcmp(auth_suite, ccp_rsn_oui08, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_RSN_8021X_SHA256;
-	} else
-#endif
-	{
-		auth_type = eCSR_AUTH_TYPE_UNKNOWN;
-	}
-	return auth_type;
-}
-
-/**
- * hdd_translate_wpa_to_csr_auth_type() - Translate WPA to CSR auth type
- * @auth_suite: auth suite
- *
- * Return: eCsrAuthType enumeration
- */
-eCsrAuthType hdd_translate_wpa_to_csr_auth_type(uint8_t auth_suite[4])
-{
-	eCsrAuthType auth_type;
-	/* is the auth type supported? */
-	if (memcmp(auth_suite, ccp_wpa_oui01, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_WPA;
-	} else if (memcmp(auth_suite, ccp_wpa_oui02, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_WPA_PSK;
-	} else
-#ifdef FEATURE_WLAN_ESE
-	if (memcmp(auth_suite, ccp_wpa_oui06, 4) == 0) {
-		auth_type = eCSR_AUTH_TYPE_CCKM_WPA;
-	} else
-#endif /* FEATURE_WLAN_ESE */
-	{
-		auth_type = eCSR_AUTH_TYPE_UNKNOWN;
-	}
-	hddLog(LOG1, FL("auth_type: %d"), auth_type);
-	return auth_type;
-}
-
-/**
- * hdd_translate_rsn_to_csr_encryption_type() -
- *	Translate RSN to CSR encryption type
- * @cipher_suite: cipher suite
- *
- * Return: eCsrEncryptionType enumeration
- */
-eCsrEncryptionType
-hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4])
-{
-	eCsrEncryptionType cipher_type;
-
-	if (memcmp(cipher_suite, ccp_rsn_oui04, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_AES;
-	else if (memcmp(cipher_suite, ccp_rsn_oui02, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_TKIP;
-	else if (memcmp(cipher_suite, ccp_rsn_oui00, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_NONE;
-	else if (memcmp(cipher_suite, ccp_rsn_oui01, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
-	else if (memcmp(cipher_suite, ccp_rsn_oui05, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY;
-	else
-		cipher_type = eCSR_ENCRYPT_TYPE_FAILED;
-
-	hddLog(LOG1, FL("cipher_type: %d"), cipher_type);
-	return cipher_type;
-}
-
-/**
- * hdd_translate_wpa_to_csr_encryption_type() -
- *	Translate WPA to CSR encryption type
- * @cipher_suite: cipher suite
- *
- * Return: eCsrEncryptionType enumeration
- */
-eCsrEncryptionType
-hdd_translate_wpa_to_csr_encryption_type(uint8_t cipher_suite[4])
-{
-	eCsrEncryptionType cipher_type;
-
-	if (memcmp(cipher_suite, ccp_wpa_oui04, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_AES;
-	else if (memcmp(cipher_suite, ccp_wpa_oui02, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_TKIP;
-	else if (memcmp(cipher_suite, ccp_wpa_oui00, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_NONE;
-	else if (memcmp(cipher_suite, ccp_wpa_oui01, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
-	else if (memcmp(cipher_suite, ccp_wpa_oui05, 4) == 0)
-		cipher_type = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY;
-	else
-		cipher_type = eCSR_ENCRYPT_TYPE_FAILED;
-
-	hddLog(LOG1, FL("cipher_type: %d"), cipher_type);
-	return cipher_type;
-}
-
-/**
- * hdd_process_genie() - process gen ie
- * @pAdapter: pointer to adapter
- * @bssid: pointer to mac address
- * @pEncryptType: pointer to encryption type
- * @mcEncryptType: pointer to multicast encryption type
- * @pAuthType: pointer to auth type
- *
- * Return: 0 on success, error number otherwise
- */
-static int32_t hdd_process_genie(hdd_adapter_t *pAdapter,
-				 u8 *bssid,
-				 eCsrEncryptionType *pEncryptType,
-				 eCsrEncryptionType *mcEncryptType,
-				 eCsrAuthType *pAuthType,
-#ifdef WLAN_FEATURE_11W
-				 uint8_t *pMfpRequired, uint8_t *pMfpCapable,
-#endif
-				 uint16_t gen_ie_len, uint8_t *gen_ie)
-{
-	tHalHandle halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	CDF_STATUS result;
-	tDot11fIERSN dot11RSNIE;
-	tDot11fIEWPA dot11WPAIE;
-	uint32_t i;
-	uint8_t *pRsnIe;
-	uint16_t RSNIeLen;
-	tPmkidCacheInfo PMKIDCache[4];  /* Local transfer memory */
-	bool updatePMKCache = false;
-
-	/*
-	 * Clear struct of tDot11fIERSN and tDot11fIEWPA specifically
-	 * setting present flag to 0.
-	 */
-	memset(&dot11WPAIE, 0, sizeof(tDot11fIEWPA));
-	memset(&dot11RSNIE, 0, sizeof(tDot11fIERSN));
-
-	/* Type check */
-	if (gen_ie[0] == DOT11F_EID_RSN) {
-		/* Validity checks */
-		if ((gen_ie_len < DOT11F_IE_RSN_MIN_LEN) ||
-		    (gen_ie_len > DOT11F_IE_RSN_MAX_LEN)) {
-			hddLog(LOGE, FL("Invalid DOT11F RSN IE length :%d"),
-			       gen_ie_len);
-			return -EINVAL;
-		}
-		/* Skip past the EID byte and length byte */
-		pRsnIe = gen_ie + 2;
-		RSNIeLen = gen_ie_len - 2;
-		/* Unpack the RSN IE */
-		dot11f_unpack_ie_rsn((tpAniSirGlobal) halHandle,
-				     pRsnIe, RSNIeLen, &dot11RSNIE);
-		/* Copy out the encryption and authentication types */
-		hddLog(LOG1, FL("pairwise cipher suite count: %d"),
-		       dot11RSNIE.pwise_cipher_suite_count);
-		hddLog(LOG1, FL("authentication suite count: %d"),
-		       dot11RSNIE.akm_suite_count);
-		/*Here we have followed the apple base code,
-		   but probably I suspect we can do something different */
-		/* dot11RSNIE.akm_suite_count */
-		/* Just translate the FIRST one */
-		*pAuthType =
-			hdd_translate_rsn_to_csr_auth_type(
-					dot11RSNIE.akm_suites[0]);
-		/* dot11RSNIE.pwise_cipher_suite_count */
-		*pEncryptType =
-			hdd_translate_rsn_to_csr_encryption_type(
-					dot11RSNIE.pwise_cipher_suites[0]);
-		/* dot11RSNIE.gp_cipher_suite_count */
-		*mcEncryptType =
-			hdd_translate_rsn_to_csr_encryption_type(
-					dot11RSNIE.gp_cipher_suite);
-#ifdef WLAN_FEATURE_11W
-		*pMfpRequired = (dot11RSNIE.RSN_Cap[0] >> 6) & 0x1;
-		*pMfpCapable = (dot11RSNIE.RSN_Cap[0] >> 7) & 0x1;
-#endif
-		/* Set the PMKSA ID Cache for this interface */
-		for (i = 0; i < dot11RSNIE.pmkid_count; i++) {
-			if (is_zero_ether_addr(bssid)) {
-				hddLog(LOGE, FL("MAC address is all zeroes"));
-				break;
-			}
-			updatePMKCache = true;
-			/*
-			 * For right now, I assume setASSOCIATE() has passed
-			 * in the bssid.
-			 */
-			cdf_mem_copy(PMKIDCache[i].BSSID.bytes,
-				     bssid, CDF_MAC_ADDR_SIZE);
-			cdf_mem_copy(PMKIDCache[i].PMKID,
-				     dot11RSNIE.pmkid[i], CSR_RSN_PMKID_SIZE);
-		}
-
-		if (updatePMKCache) {
-			/*
-			 * Calling csr_roam_set_pmkid_cache to configure the
-			 * PMKIDs into the cache.
-			 */
-			hddLog(LOG1,
-				FL("Calling sme_roam_set_pmkid_cache with cache entry %d."),
-				i);
-			/* Finally set the PMKSA ID Cache in CSR */
-			result =
-				sme_roam_set_pmkid_cache(halHandle,
-							 pAdapter->sessionId,
-							 PMKIDCache,
-							 dot11RSNIE.pmkid_count,
-							 false);
-		}
-	} else if (gen_ie[0] == DOT11F_EID_WPA) {
-		/* Validity checks */
-		if ((gen_ie_len < DOT11F_IE_WPA_MIN_LEN) ||
-		    (gen_ie_len > DOT11F_IE_WPA_MAX_LEN)) {
-			hddLog(LOGE, FL("Invalid DOT11F WPA IE length :%d"),
-			       gen_ie_len);
-			return -EINVAL;
-		}
-		/* Skip past the EID and length byte - and four byte WiFi OUI */
-		pRsnIe = gen_ie + 2 + 4;
-		RSNIeLen = gen_ie_len - (2 + 4);
-		/* Unpack the WPA IE */
-		dot11f_unpack_ie_wpa((tpAniSirGlobal) halHandle,
-				     pRsnIe, RSNIeLen, &dot11WPAIE);
-		/* Copy out the encryption and authentication types */
-		hddLog(LOG1, FL("WPA unicast cipher suite count: %d"),
-		       dot11WPAIE.unicast_cipher_count);
-		hddLog(LOG1, FL("WPA authentication suite count: %d"),
-		       dot11WPAIE.auth_suite_count);
-		/* dot11WPAIE.auth_suite_count */
-		/* Just translate the FIRST one */
-		*pAuthType =
-			hdd_translate_wpa_to_csr_auth_type(
-					dot11WPAIE.auth_suites[0]);
-		/* dot11WPAIE.unicast_cipher_count */
-		*pEncryptType =
-			hdd_translate_wpa_to_csr_encryption_type(
-					dot11WPAIE.unicast_ciphers[0]);
-		/* dot11WPAIE.unicast_cipher_count */
-		*mcEncryptType =
-			hdd_translate_wpa_to_csr_encryption_type(
-					dot11WPAIE.multicast_cipher);
-	} else {
-		hddLog(LOGW, FL("gen_ie[0]: %d"), gen_ie[0]);
-		return -EINVAL;
-	}
-	return 0;
-}
-
-/**
- * hdd_set_genie_to_csr() - set genie to csr
- * @pAdapter: pointer to adapter
- * @RSNAuthType: pointer to auth type
- *
- * Return: 0 on success, error number otherwise
- */
-int hdd_set_genie_to_csr(hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType)
-{
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	uint32_t status = 0;
-	eCsrEncryptionType RSNEncryptType;
-	eCsrEncryptionType mcRSNEncryptType;
-#ifdef WLAN_FEATURE_11W
-	uint8_t RSNMfpRequired = 0;
-	uint8_t RSNMfpCapable = 0;
-#endif
-	u8 bssid[ETH_ALEN];        /* MAC address of assoc peer */
-	/* MAC address of assoc peer */
-	/* But, this routine is only called when we are NOT associated. */
-	cdf_mem_copy(bssid,
-		     pWextState->roamProfile.BSSIDs.bssid,
-		     sizeof(bssid));
-	if (pWextState->WPARSNIE[0] == DOT11F_EID_RSN
-	    || pWextState->WPARSNIE[0] == DOT11F_EID_WPA) {
-		/* continue */
-	} else {
-		return 0;
-	}
-	/* The actual processing may eventually be more extensive than this. */
-	/* Right now, just consume any PMKIDs that are  sent in by the app. */
-	status = hdd_process_genie(pAdapter, bssid,
-				   &RSNEncryptType,
-				   &mcRSNEncryptType, RSNAuthType,
-#ifdef WLAN_FEATURE_11W
-				   &RSNMfpRequired, &RSNMfpCapable,
-#endif
-				   pWextState->WPARSNIE[1] + 2,
-				   pWextState->WPARSNIE);
-	if (status == 0) {
-		/*
-		 * Now copy over all the security attributes
-		 * you have parsed out.
-		 */
-		pWextState->roamProfile.EncryptionType.numEntries = 1;
-		pWextState->roamProfile.mcEncryptionType.numEntries = 1;
-
-		pWextState->roamProfile.EncryptionType.encryptionType[0] = RSNEncryptType;      /* Use the cipher type in the RSN IE */
-		pWextState->roamProfile.mcEncryptionType.encryptionType[0] =
-			mcRSNEncryptType;
-
-		if ((WLAN_HDD_IBSS == pAdapter->device_mode) &&
-		    ((eCSR_ENCRYPT_TYPE_AES == mcRSNEncryptType) ||
-		     (eCSR_ENCRYPT_TYPE_TKIP == mcRSNEncryptType))) {
-			/*
-			 * For wpa none supplicant sends the WPA IE with unicast
-			 * cipher as eCSR_ENCRYPT_TYPE_NONE ,where as the
-			 * multicast cipher as either AES/TKIP based on group
-			 * cipher configuration mentioned in the
-			 * wpa_supplicant.conf.
-			 */
-
-			/* Set the unicast cipher same as multicast cipher */
-			pWextState->roamProfile.EncryptionType.encryptionType[0]
-				= mcRSNEncryptType;
-		}
-#ifdef WLAN_FEATURE_11W
-		hddLog(LOG1, FL("RSNMfpRequired = %d, RSNMfpCapable = %d"),
-						RSNMfpRequired, RSNMfpCapable);
-		pWextState->roamProfile.MFPRequired = RSNMfpRequired;
-		pWextState->roamProfile.MFPCapable = RSNMfpCapable;
-#endif
-		hddLog(LOG1,
-		       FL("CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d"),
-		       *RSNAuthType, RSNEncryptType, mcRSNEncryptType);
-	}
-	return 0;
-}
-
-/**
- * hdd_set_csr_auth_type() - set csr auth type
- * @pAdapter: pointer to adapter
- * @RSNAuthType: auth type
- *
- * Return: 0 on success, error number otherwise
- */
-int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType)
-{
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	tCsrRoamProfile *pRoamProfile = &(pWextState->roamProfile);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	ENTER();
-
-	pRoamProfile->AuthType.numEntries = 1;
-	hddLog(LOG1, FL("pHddStaCtx->conn_info.authType = %d"),
-	       pHddStaCtx->conn_info.authType);
-
-	switch (pHddStaCtx->conn_info.authType) {
-	case eCSR_AUTH_TYPE_OPEN_SYSTEM:
-#ifdef FEATURE_WLAN_ESE
-	case eCSR_AUTH_TYPE_CCKM_WPA:
-	case eCSR_AUTH_TYPE_CCKM_RSN:
-#endif
-		if (pWextState->wpaVersion & IW_AUTH_WPA_VERSION_DISABLED) {
-
-			pRoamProfile->AuthType.authType[0] =
-				eCSR_AUTH_TYPE_OPEN_SYSTEM;
-		} else if (pWextState->wpaVersion & IW_AUTH_WPA_VERSION_WPA) {
-
-#ifdef FEATURE_WLAN_ESE
-			if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_WPA) &&
-			    ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
-			     == IW_AUTH_KEY_MGMT_802_1X)) {
-				hddLog(LOG1,
-				       FL("set authType to CCKM WPA. AKM also 802.1X."));
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_CCKM_WPA;
-			} else if (RSNAuthType == eCSR_AUTH_TYPE_CCKM_WPA) {
-				hddLog(LOG1,
-				       FL("Last chance to set authType to CCKM WPA."));
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_CCKM_WPA;
-			} else
-#endif
-			if ((pWextState->
-			     authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
-			    == IW_AUTH_KEY_MGMT_802_1X) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_WPA;
-			} else
-			if ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
-			    == IW_AUTH_KEY_MGMT_PSK) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_WPA_PSK;
-			} else {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_WPA_NONE;
-			}
-		}
-		if (pWextState->wpaVersion & IW_AUTH_WPA_VERSION_WPA2) {
-#ifdef FEATURE_WLAN_ESE
-			if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_RSN) &&
-			    ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
-			     == IW_AUTH_KEY_MGMT_802_1X)) {
-				hddLog(LOG1,
-				       FL("set authType to CCKM RSN. AKM also 802.1X."));
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_CCKM_RSN;
-			} else if (RSNAuthType == eCSR_AUTH_TYPE_CCKM_RSN) {
-				hddLog(LOG1,
-				       FL("Last chance to set authType to CCKM RSN."));
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_CCKM_RSN;
-			} else
-#endif
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-			if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN) &&
-			    ((pWextState->
-			      authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
-			     == IW_AUTH_KEY_MGMT_802_1X)) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_FT_RSN;
-			} else if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN_PSK)
-				   &&
-				   ((pWextState->
-				     authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
-				    == IW_AUTH_KEY_MGMT_PSK)) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_FT_RSN_PSK;
-			} else
-#endif
-
-#ifdef WLAN_FEATURE_11W
-			if (RSNAuthType == eCSR_AUTH_TYPE_RSN_PSK_SHA256) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_RSN_PSK_SHA256;
-			} else if (RSNAuthType ==
-				   eCSR_AUTH_TYPE_RSN_8021X_SHA256) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_RSN_8021X_SHA256;
-			} else
-#endif
-
-			if ((pWextState->
-			     authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)
-			    == IW_AUTH_KEY_MGMT_802_1X) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_RSN;
-			} else
-			if ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
-			    == IW_AUTH_KEY_MGMT_PSK) {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_RSN_PSK;
-			} else {
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_UNKNOWN;
-			}
-		}
-		break;
-
-	case eCSR_AUTH_TYPE_SHARED_KEY:
-
-		pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_SHARED_KEY;
-		break;
-	default:
-
-#ifdef FEATURE_WLAN_ESE
-		hddLog(LOG1, FL("In default, unknown auth type."));
-#endif /* FEATURE_WLAN_ESE */
-		pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_UNKNOWN;
-		break;
-	}
-
-	hddLog(LOG1, FL("Set roam Authtype to %d"),
-	       pWextState->roamProfile.AuthType.authType[0]);
-
-	EXIT();
-	return 0;
-}
-
-/**
- * __iw_set_essid() - This function sets the ssid received from wpa_supplicant
- *		    to the CSR roam profile.
- *
- * @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, error number on failure
- */
-static int __iw_set_essid(struct net_device *dev,
-		 struct iw_request_info *info,
-		 union iwreq_data *wrqu, char *extra)
-{
-	unsigned long rc;
-	uint32_t status = 0;
-	hdd_wext_state_t *pWextState;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	uint32_t roamId;
-	tCsrRoamProfile *pRoamProfile;
-	eMib_dot11DesiredBssType connectedBssType;
-	eCsrAuthType RSNAuthType;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (pAdapter->device_mode != WLAN_HDD_INFRA_STATION &&
-		pAdapter->device_mode != WLAN_HDD_P2P_CLIENT) {
-		hddLog(LOGW, FL("device mode %s(%d) is not allowed"),
-			hdd_device_mode_to_string(pAdapter->device_mode),
-			pAdapter->device_mode);
-		return -EINVAL;
-	}
-
-	pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-
-	if (pWextState->mTKIPCounterMeasures == TKIP_COUNTER_MEASURE_STARTED) {
-		hddLog(LOG2, FL("Counter measure is in progress"));
-		return -EBUSY;
-	}
-	if (SIR_MAC_MAX_SSID_LENGTH < wrqu->essid.length)
-		return -EINVAL;
-
-	pRoamProfile = &pWextState->roamProfile;
-	if (hdd_conn_get_connected_bss_type(pHddStaCtx, &connectedBssType) ||
-	    (eMib_dot11DesiredBssType_independent ==
-	     pHddStaCtx->conn_info.connDot11DesiredBssType)) {
-		CDF_STATUS cdf_status;
-
-		/* Need to issue a disconnect to CSR. */
-		INIT_COMPLETION(pAdapter->disconnect_comp_var);
-		cdf_status = sme_roam_disconnect(hHal, pAdapter->sessionId,
-					 eCSR_DISCONNECT_REASON_UNSPECIFIED);
-
-		if (CDF_STATUS_SUCCESS == cdf_status) {
-			rc = wait_for_completion_timeout(&pAdapter->
-						 disconnect_comp_var,
-						 msecs_to_jiffies
-						 (WLAN_WAIT_TIME_DISCONNECT));
-			if (!rc)
-				hddLog(LOGE, FL("Disconnect event timed out"));
-		}
-	}
-
-	/*
-	 * when cfg80211 defined, wpa_supplicant wext driver uses
-	 * zero-length, null-string ssid for force disconnection.
-	 * after disconnection (if previously connected) and cleaning ssid,
-	 * driver MUST return success.
-	 */
-	if (0 == wrqu->essid.length)
-		return 0;
-
-	status = hdd_wmm_get_uapsd_mask(pAdapter,
-					&pWextState->roamProfile.uapsd_mask);
-	if (CDF_STATUS_SUCCESS != status)
-		pWextState->roamProfile.uapsd_mask = 0;
-
-	pWextState->roamProfile.SSIDs.numOfSSIDs = 1;
-
-	pWextState->roamProfile.SSIDs.SSIDList->SSID.length =
-		wrqu->essid.length;
-
-	cdf_mem_zero(pWextState->roamProfile.SSIDs.SSIDList->SSID.ssId,
-		     sizeof(pWextState->roamProfile.SSIDs.SSIDList->SSID.ssId));
-	cdf_mem_copy((void *)(pWextState->roamProfile.SSIDs.SSIDList->SSID.
-			      ssId), extra, wrqu->essid.length);
-	if (IW_AUTH_WPA_VERSION_WPA == pWextState->wpaVersion
-	    || IW_AUTH_WPA_VERSION_WPA2 == pWextState->wpaVersion) {
-
-		/* set gen ie */
-		hdd_set_genie_to_csr(pAdapter, &RSNAuthType);
-
-		/* set auth */
-		hdd_set_csr_auth_type(pAdapter, RSNAuthType);
-	}
-#ifdef FEATURE_WLAN_WAPI
-	hddLog(LOG1, FL("Setting WAPI AUTH Type and Encryption Mode values"));
-	if (pAdapter->wapi_info.nWapiMode) {
-		switch (pAdapter->wapi_info.wapiAuthMode) {
-		case WAPI_AUTH_MODE_PSK:
-		{
-			hddLog(LOG1, FL("WAPI AUTH TYPE: PSK: %d"),
-			       pAdapter->wapi_info.wapiAuthMode);
-			pRoamProfile->AuthType.numEntries = 1;
-			pRoamProfile->AuthType.authType[0] =
-				eCSR_AUTH_TYPE_WAPI_WAI_PSK;
-			break;
-		}
-		case WAPI_AUTH_MODE_CERT:
-		{
-			hddLog(LOG1, FL("WAPI AUTH TYPE: CERT: %d"),
-			       pAdapter->wapi_info.wapiAuthMode);
-			pRoamProfile->AuthType.numEntries = 1;
-			pRoamProfile->AuthType.authType[0] =
-				eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE;
-			break;
-		}
-		} /* End of switch */
-		if (pAdapter->wapi_info.wapiAuthMode == WAPI_AUTH_MODE_PSK ||
-		    pAdapter->wapi_info.wapiAuthMode == WAPI_AUTH_MODE_CERT) {
-			hddLog(LOG1, FL("WAPI PAIRWISE/GROUP ENCRYPTION: WPI"));
-			pRoamProfile->EncryptionType.numEntries = 1;
-			pRoamProfile->EncryptionType.encryptionType[0] =
-				eCSR_ENCRYPT_TYPE_WPI;
-			pRoamProfile->mcEncryptionType.numEntries = 1;
-			pRoamProfile->mcEncryptionType.encryptionType[0] =
-				eCSR_ENCRYPT_TYPE_WPI;
-		}
-	}
-#endif /* FEATURE_WLAN_WAPI */
-	/* if previous genIE is not NULL, update AssocIE */
-	if (0 != pWextState->genIE.length) {
-		memset(&pWextState->assocAddIE, 0,
-		       sizeof(pWextState->assocAddIE));
-		memcpy(pWextState->assocAddIE.addIEdata,
-		       pWextState->genIE.addIEdata, pWextState->genIE.length);
-		pWextState->assocAddIE.length = pWextState->genIE.length;
-		pWextState->roamProfile.pAddIEAssoc =
-			pWextState->assocAddIE.addIEdata;
-		pWextState->roamProfile.nAddIEAssocLength =
-			pWextState->assocAddIE.length;
-
-		/* clear previous genIE after use it */
-		memset(&pWextState->genIE, 0, sizeof(pWextState->genIE));
-	}
-
-	/*
-	 * Assumes it is not WPS Association by default, except when
-	 * pAddIEAssoc has WPS IE.
-	 */
-	pWextState->roamProfile.bWPSAssociation = false;
-
-	if (NULL != wlan_hdd_get_wps_ie_ptr(pWextState->roamProfile.pAddIEAssoc,
-					    pWextState->roamProfile.
-					    nAddIEAssocLength))
-		pWextState->roamProfile.bWPSAssociation = true;
-
-	/* Disable auto BMPS entry by PMC until DHCP is done */
-	sme_set_dhcp_till_power_active_flag(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						 true);
-
-	pWextState->roamProfile.csrPersona = pAdapter->device_mode;
-
-	if (eCSR_BSS_TYPE_START_IBSS == pRoamProfile->BSSType) {
-		hdd_select_cbmode(pAdapter,
-				  (WLAN_HDD_GET_CTX(pAdapter))->config->
-				  AdHocChannel5G);
-	}
-	status = sme_roam_connect(hHal, pAdapter->sessionId,
-				  &(pWextState->roamProfile), &roamId);
-	pRoamProfile->ChannelInfo.ChannelList = NULL;
-	pRoamProfile->ChannelInfo.numOfChannels = 0;
-
-	EXIT();
-	return status;
-}
-
-/**
- * iw_set_essid() - set essid handler function
- * @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, error number on failure
- */
-int iw_set_essid(struct net_device *dev,
-		 struct iw_request_info *info,
-		 union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_essid(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_get_essid() - This function returns the essid to the wpa_supplicant
- * @dev: pointer to the net device
- * @info: pointer to the iw request info
- * @dwrq: pointer to iw_point
- * @extra: pointer to the data
- *
- * Return: 0 on success, error number otherwise
- */
-static int __iw_get_essid(struct net_device *dev,
-		 struct iw_request_info *info,
-		 struct iw_point *dwrq, char *extra)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	hdd_wext_state_t *wextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if ((pHddStaCtx->conn_info.connState == eConnectionState_Associated &&
-	     wextBuf->roamProfile.SSIDs.SSIDList->SSID.length > 0) ||
-	    ((pHddStaCtx->conn_info.connState == eConnectionState_IbssConnected
-	      || pHddStaCtx->conn_info.connState ==
-	      eConnectionState_IbssDisconnected)
-	     && wextBuf->roamProfile.SSIDs.SSIDList->SSID.length > 0)) {
-		dwrq->length = pHddStaCtx->conn_info.SSID.SSID.length;
-		memcpy(extra, pHddStaCtx->conn_info.SSID.SSID.ssId,
-		       dwrq->length);
-		dwrq->flags = 1;
-	} else {
-		memset(extra, 0, dwrq->length);
-		dwrq->length = 0;
-		dwrq->flags = 0;
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * iw_get_essid() - get essid handler function
- * @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, error number on failure
- */
-int iw_get_essid(struct net_device *dev,
-		 struct iw_request_info *info,
-		 struct iw_point *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_essid(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_set_auth() -
- *	This function sets the auth type received from the wpa_supplicant
- * @dev: pointer to the net device
- * @info: pointer to the iw request info
- * @wrqu: pointer to iwreq_data
- * @extra: pointer to the data
- *
- * Return: 0 on success, error number otherwise
- */
-static int __iw_set_auth(struct net_device *dev, struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile;
-	eCsrEncryptionType mcEncryptionType;
-	eCsrEncryptionType ucEncryptionType;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	switch (wrqu->param.flags & IW_AUTH_INDEX) {
-	case IW_AUTH_WPA_VERSION:
-		pWextState->wpaVersion = wrqu->param.value;
-		break;
-
-	case IW_AUTH_CIPHER_PAIRWISE:
-	{
-		if (wrqu->param.value & IW_AUTH_CIPHER_NONE) {
-			ucEncryptionType = eCSR_ENCRYPT_TYPE_NONE;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_TKIP) {
-			ucEncryptionType = eCSR_ENCRYPT_TYPE_TKIP;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_CCMP) {
-			ucEncryptionType = eCSR_ENCRYPT_TYPE_AES;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_WEP40) {
-			if ((IW_AUTH_KEY_MGMT_802_1X
-			     ==
-			     (pWextState->
-			      authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X))
-			    && (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
-				pHddStaCtx->conn_info.authType))
-				/*Dynamic WEP key */
-				ucEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP40;
-			else
-				/*Static WEP key */
-				ucEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_WEP104) {
-			if ((IW_AUTH_KEY_MGMT_802_1X
-			     ==
-			     (pWextState->
-			      authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X))
-			    && (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
-				pHddStaCtx->conn_info.authType))
-				/*Dynamic WEP key */
-				ucEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP104;
-			else
-				/*Static WEP key */
-				ucEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP104_STATICKEY;
-		} else {
-			hddLog(LOGW, FL("value %d UNKNOWN IW_AUTH_CIPHER"),
-				wrqu->param.value);
-			return -EINVAL;
-		}
-
-		pRoamProfile->EncryptionType.numEntries = 1;
-		pRoamProfile->EncryptionType.encryptionType[0] =
-			ucEncryptionType;
-	}
-	break;
-	case IW_AUTH_CIPHER_GROUP:
-	{
-		if (wrqu->param.value & IW_AUTH_CIPHER_NONE) {
-			mcEncryptionType = eCSR_ENCRYPT_TYPE_NONE;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_TKIP) {
-			mcEncryptionType = eCSR_ENCRYPT_TYPE_TKIP;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_CCMP) {
-			mcEncryptionType = eCSR_ENCRYPT_TYPE_AES;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_WEP40) {
-			if ((IW_AUTH_KEY_MGMT_802_1X
-			     ==
-			     (pWextState->
-			      authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X))
-			    && (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
-				pHddStaCtx->conn_info.authType))
-				mcEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP40;
-			else
-				mcEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
-		} else if (wrqu->param.value & IW_AUTH_CIPHER_WEP104) {
-			/* Dynamic WEP keys won't work with shared keys */
-			if ((IW_AUTH_KEY_MGMT_802_1X
-			     ==
-			     (pWextState->
-			      authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X))
-			    && (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
-				pHddStaCtx->conn_info.authType)) {
-				mcEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP104;
-			} else {
-				mcEncryptionType =
-					eCSR_ENCRYPT_TYPE_WEP104_STATICKEY;
-			}
-		} else {
-			hddLog(LOGW, FL("value %d UNKNOWN IW_AUTH_CIPHER"),
-				wrqu->param.value);
-			return -EINVAL;
-		}
-
-		pRoamProfile->mcEncryptionType.numEntries = 1;
-		pRoamProfile->mcEncryptionType.encryptionType[0] =
-			mcEncryptionType;
-	}
-	break;
-
-	case IW_AUTH_80211_AUTH_ALG:
-	{
-		/* Save the auth algo here and set auth type to SME Roam profile
-		   in the iw_set_ap_address */
-		if (wrqu->param.value & IW_AUTH_ALG_OPEN_SYSTEM)
-			pHddStaCtx->conn_info.authType =
-				eCSR_AUTH_TYPE_OPEN_SYSTEM;
-
-		else if (wrqu->param.value & IW_AUTH_ALG_SHARED_KEY)
-			pHddStaCtx->conn_info.authType =
-				eCSR_AUTH_TYPE_SHARED_KEY;
-
-		else if (wrqu->param.value & IW_AUTH_ALG_LEAP)
-			/*Not supported */
-			pHddStaCtx->conn_info.authType =
-				eCSR_AUTH_TYPE_OPEN_SYSTEM;
-		pWextState->roamProfile.AuthType.authType[0] =
-			pHddStaCtx->conn_info.authType;
-	}
-	break;
-
-	case IW_AUTH_KEY_MGMT:
-	{
-#ifdef FEATURE_WLAN_ESE
-#define IW_AUTH_KEY_MGMT_CCKM       8   /* Should be in linux/wireless.h */
-		/*Check for CCKM AKM type */
-		if (wrqu->param.value & IW_AUTH_KEY_MGMT_CCKM) {
-			hddLog(LOG1, FL("CCKM AKM Set %d"), wrqu->param.value);
-			/* Set the CCKM bit in authKeyMgmt */
-			/*
-			 * Right now, this breaks all ref to authKeyMgmt because
-			 * our code doesn't realize it is a "bitfield"
-			 */
-			pWextState->authKeyMgmt |=
-				IW_AUTH_KEY_MGMT_CCKM;
-			/* Set the key management to 802.1X */
-			/* pWextState->authKeyMgmt = IW_AUTH_KEY_MGMT_802_1X; */
-			pWextState->isESEConnection = true;
-			/*
-			 * This is test code. I need to actually KNOW whether
-			 * this is an RSN Assoc or WPA.
-			 */
-			pWextState->collectedAuthType =
-				eCSR_AUTH_TYPE_CCKM_RSN;
-		} else if (wrqu->param.value & IW_AUTH_KEY_MGMT_PSK) {
-			/* Save the key management */
-			pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_PSK;
-			pWextState->collectedAuthType =
-				eCSR_AUTH_TYPE_RSN;
-		} else
-		if (!(wrqu->param.value & IW_AUTH_KEY_MGMT_802_1X)) {
-			pWextState->collectedAuthType = eCSR_AUTH_TYPE_NONE;
-			/* Save the key management anyway */
-			pWextState->authKeyMgmt = wrqu->param.value;
-		} else {                /* It must be IW_AUTH_KEY_MGMT_802_1X */
-			/* Save the key management */
-			pWextState->authKeyMgmt |=
-				IW_AUTH_KEY_MGMT_802_1X;
-			pWextState->collectedAuthType =
-				eCSR_AUTH_TYPE_RSN;
-		}
-#else
-		/* Save the key management */
-		pWextState->authKeyMgmt = wrqu->param.value;
-#endif /* FEATURE_WLAN_ESE */
-	}
-	break;
-
-	case IW_AUTH_TKIP_COUNTERMEASURES:
-	{
-		if (wrqu->param.value) {
-			hddLog(LOG2,
-			       "Counter Measure started %d",
-			       wrqu->param.value);
-			pWextState->mTKIPCounterMeasures =
-				TKIP_COUNTER_MEASURE_STARTED;
-		} else {
-			hddLog(LOG2,
-			       "Counter Measure stopped=%d",
-			       wrqu->param.value);
-			pWextState->mTKIPCounterMeasures =
-				TKIP_COUNTER_MEASURE_STOPED;
-		}
-	}
-	break;
-	case IW_AUTH_DROP_UNENCRYPTED:
-	case IW_AUTH_WPA_ENABLED:
-	case IW_AUTH_RX_UNENCRYPTED_EAPOL:
-	case IW_AUTH_ROAMING_CONTROL:
-	case IW_AUTH_PRIVACY_INVOKED:
-
-	default:
-
-		hddLog(LOGW, FL("called with unsupported auth type %d"),
-			wrqu->param.flags & IW_AUTH_INDEX);
-		break;
-	}
-
-	EXIT();
-	return 0;
-}
-
-/**
- * iw_set_auth() - set auth callback function
- * @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, error number on failure.
- */
-int iw_set_auth(struct net_device *dev, struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_auth(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_get_auth() -
- *	This function returns the auth type to the wpa_supplicant
- * @dev: pointer to the net device
- * @info: pointer to the iw request info
- * @wrqu: pointer to iwreq_data
- * @extra: pointer to the data
- *
- * Return: 0 on success, error number otherwise
- */
-static int __iw_get_auth(struct net_device *dev, struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	switch (pRoamProfile->negotiatedAuthType) {
-	case eCSR_AUTH_TYPE_WPA_NONE:
-		wrqu->param.flags = IW_AUTH_WPA_VERSION;
-		wrqu->param.value = IW_AUTH_WPA_VERSION_DISABLED;
-		break;
-	case eCSR_AUTH_TYPE_WPA:
-		wrqu->param.flags = IW_AUTH_WPA_VERSION;
-		wrqu->param.value = IW_AUTH_WPA_VERSION_WPA;
-		break;
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	case eCSR_AUTH_TYPE_FT_RSN:
-#endif
-	case eCSR_AUTH_TYPE_RSN:
-		wrqu->param.flags = IW_AUTH_WPA_VERSION;
-		wrqu->param.value = IW_AUTH_WPA_VERSION_WPA2;
-		break;
-	case eCSR_AUTH_TYPE_OPEN_SYSTEM:
-		wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM;
-		break;
-	case eCSR_AUTH_TYPE_SHARED_KEY:
-		wrqu->param.value = IW_AUTH_ALG_SHARED_KEY;
-		break;
-	case eCSR_AUTH_TYPE_UNKNOWN:
-		hddLog(LOG1, FL("called with unknown auth type"));
-		wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM;
-		break;
-	case eCSR_AUTH_TYPE_AUTOSWITCH:
-		wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM;
-		break;
-	case eCSR_AUTH_TYPE_WPA_PSK:
-		hddLog(LOG1, FL("called with WPA PSK auth type"));
-		wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM;
-		return -EIO;
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	case eCSR_AUTH_TYPE_FT_RSN_PSK:
-#endif
-	case eCSR_AUTH_TYPE_RSN_PSK:
-#ifdef WLAN_FEATURE_11W
-	case eCSR_AUTH_TYPE_RSN_PSK_SHA256:
-	case eCSR_AUTH_TYPE_RSN_8021X_SHA256:
-#endif
-		hddLog(LOG1, FL("called with RSN PSK auth type"));
-		wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM;
-		return -EIO;
-	default:
-		hddLog(LOGE, FL("called with unknown auth type"));
-		wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM;
-		return -EIO;
-	}
-	if (((wrqu->param.flags & IW_AUTH_INDEX) == IW_AUTH_CIPHER_PAIRWISE)) {
-		switch (pRoamProfile->negotiatedUCEncryptionType) {
-		case eCSR_ENCRYPT_TYPE_NONE:
-			wrqu->param.value = IW_AUTH_CIPHER_NONE;
-			break;
-		case eCSR_ENCRYPT_TYPE_WEP40:
-		case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY:
-			wrqu->param.value = IW_AUTH_CIPHER_WEP40;
-			break;
-		case eCSR_ENCRYPT_TYPE_TKIP:
-			wrqu->param.value = IW_AUTH_CIPHER_TKIP;
-			break;
-		case eCSR_ENCRYPT_TYPE_WEP104:
-		case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
-			wrqu->param.value = IW_AUTH_CIPHER_WEP104;
-			break;
-		case eCSR_ENCRYPT_TYPE_AES:
-			wrqu->param.value = IW_AUTH_CIPHER_CCMP;
-			break;
-		default:
-			hddLog(LOG1, FL("called with unknown auth type %d"),
-			       pRoamProfile->negotiatedUCEncryptionType);
-			return -EIO;
-		}
-	}
-
-	if (((wrqu->param.flags & IW_AUTH_INDEX) == IW_AUTH_CIPHER_GROUP)) {
-		switch (pRoamProfile->negotiatedMCEncryptionType) {
-		case eCSR_ENCRYPT_TYPE_NONE:
-			wrqu->param.value = IW_AUTH_CIPHER_NONE;
-			break;
-		case eCSR_ENCRYPT_TYPE_WEP40:
-		case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY:
-			wrqu->param.value = IW_AUTH_CIPHER_WEP40;
-			break;
-		case eCSR_ENCRYPT_TYPE_TKIP:
-			wrqu->param.value = IW_AUTH_CIPHER_TKIP;
-			break;
-		case eCSR_ENCRYPT_TYPE_WEP104:
-		case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
-			wrqu->param.value = IW_AUTH_CIPHER_WEP104;
-			break;
-		case eCSR_ENCRYPT_TYPE_AES:
-			wrqu->param.value = IW_AUTH_CIPHER_CCMP;
-			break;
-		default:
-			hddLog(LOG1, FL("called with unknown auth type %d"),
-			       pRoamProfile->negotiatedMCEncryptionType);
-			return -EIO;
-		}
-	}
-
-	hddLog(LOG1, FL("called with auth type %d"),
-		pRoamProfile->AuthType.authType[0]);
-	EXIT();
-	return 0;
-}
-
-/**
- * iw_get_auth() - get auth callback function
- * @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, error number on failure.
- */
-int iw_get_auth(struct net_device *dev, struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_auth(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_set_ap_address() - set ap address
- * @dev: pointer to the net device
- * @info: pointer to the iw request info
- * @wrqu: pointer to iwreq_data
- * @extra: pointer to the data
- *
- * This function updates the HDD global station context connection info
- * BSSID with the MAC address received from the wpa_supplicant.
- *
- * Return: 0 on success, error number otherwise
- */
-static int __iw_set_ap_address(struct net_device *dev,
-		      struct iw_request_info *info,
-		      union iwreq_data *wrqu, char *extra)
-{
-
-	hdd_adapter_t *adapter;
-	hdd_context_t *hdd_ctx;
-	hdd_station_ctx_t *pHddStaCtx =
-		WLAN_HDD_GET_STATION_CTX_PTR(WLAN_HDD_GET_PRIV_PTR(dev));
-	uint8_t *pMacAddress = NULL;
-	int ret;
-
-	ENTER();
-
-	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;
-
-	pMacAddress = (uint8_t *) wrqu->ap_addr.sa_data;
-	hddLog(LOG1, FL(" " MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pMacAddress));
-	cdf_mem_copy(pHddStaCtx->conn_info.bssId.bytes, pMacAddress,
-		     sizeof(struct cdf_mac_addr));
-	EXIT();
-
-	return 0;
-}
-
-/**
- * iw_set_ap_address() - set ap addresses callback function
- * @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, error number on failure.
- */
-int iw_set_ap_address(struct net_device *dev, struct iw_request_info *info,
-			union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_ap_address(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_get_ap_address() - get ap address
- * @dev: pointer to the net device
- * @info: pointer to the iw request info
- * @wrqu: pointer to iwreq_data
- * @extra: pointer to the data
- *
- * This function returns currently associated BSSID.
- *
- * Return: 0 on success, error number otherwise
- */
-static int __iw_get_ap_address(struct net_device *dev,
-		      struct iw_request_info *info,
-		      union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	hdd_station_ctx_t *pHddStaCtx =
-		WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (pHddStaCtx->conn_info.connState == eConnectionState_Associated ||
-	    eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState) {
-		cdf_mem_copy(wrqu->ap_addr.sa_data,
-				pHddStaCtx->conn_info.bssId.bytes,
-				CDF_MAC_ADDR_SIZE);
-	} else {
-		memset(wrqu->ap_addr.sa_data, 0, sizeof(wrqu->ap_addr.sa_data));
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * iw_get_ap_address() - get ap addresses callback function
- * @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, error number on failure.
- */
-int iw_get_ap_address(struct net_device *dev, struct iw_request_info *info,
-			union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_ap_address(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}

+ 0 - 6893
core/hdd/src/wlan_hdd_cfg.c

@@ -1,6893 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC:  wlan_hdd_cfg.c
- *
- * WLAN Host Device Driver configuration interface implementation
- */
-
-/* Include Files */
-
-#include <linux/firmware.h>
-#include <linux/string.h>
-#include <wlan_hdd_includes.h>
-#include <wlan_hdd_main.h>
-#include <wlan_hdd_assoc.h>
-#include <wlan_hdd_cfg.h>
-#include <linux/string.h>
-#include <cdf_types.h>
-#include <csr_api.h>
-#include <wlan_hdd_misc.h>
-#include <wlan_hdd_napi.h>
-
-static void
-cb_notify_set_roam_prefer5_g_hz(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	sme_update_roam_prefer5_g_hz(pHddCtx->hHal,
-				     pHddCtx->config->nRoamPrefer5GHz);
-}
-
-static void
-cb_notify_set_roam_rssi_diff(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	sme_update_roam_rssi_diff(pHddCtx->hHal,
-				  0, pHddCtx->config->RoamRssiDiff);
-}
-
-static void
-cb_notify_set_fast_transition_enabled(hdd_context_t *pHddCtx,
-				      unsigned long notifyId)
-{
-	sme_update_fast_transition_enabled(pHddCtx->hHal,
-					   pHddCtx->config->
-					   isFastTransitionEnabled);
-}
-
-static void
-cb_notify_set_roam_intra_band(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	sme_set_roam_intra_band(pHddCtx->hHal, pHddCtx->config->nRoamIntraBand);
-}
-
-static void cb_notify_set_wes_mode(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_update_wes_mode(pHddCtx->hHal, pHddCtx->config->isWESModeEnabled, 0);
-}
-
-static void
-cb_notify_set_roam_scan_n_probes(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	sme_update_roam_scan_n_probes(pHddCtx->hHal, 0, pHddCtx->config->nProbes);
-}
-
-static void
-cb_notify_set_roam_scan_home_away_time(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	sme_update_roam_scan_home_away_time(pHddCtx->hHal, 0,
-					    pHddCtx->config->nRoamScanHomeAwayTime,
-					    true);
-}
-
-#ifdef FEATURE_WLAN_OKC
-static void
-cb_notify_set_okc_feature_enabled(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-}
-#endif
-
-static void
-notify_is_fast_roam_ini_feature_enabled(hdd_context_t *pHddCtx,
-					unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_update_is_fast_roam_ini_feature_enabled(pHddCtx->hHal, 0,
-						    pHddCtx->config->
-						    isFastRoamIniFeatureEnabled);
-}
-
-static void
-notify_is_mawc_ini_feature_enabled(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_update_is_mawc_ini_feature_enabled(pHddCtx->hHal,
-					       pHddCtx->config->MAWCEnabled);
-}
-
-#ifdef FEATURE_WLAN_ESE
-static void
-cb_notify_set_ese_feature_enabled(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_update_is_ese_feature_enabled(pHddCtx->hHal, 0,
-					  pHddCtx->config->isEseIniFeatureEnabled);
-}
-#endif
-
-static void
-cb_notify_set_fw_rssi_monitoring(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_update_config_fw_rssi_monitoring(pHddCtx->hHal,
-					     pHddCtx->config->
-					     fEnableFwRssiMonitoring);
-}
-
-static void cb_notify_set_opportunistic_scan_threshold_diff(hdd_context_t *pHddCtx,
-							    unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_set_roam_opportunistic_scan_threshold_diff(pHddCtx->hHal, 0,
-						       pHddCtx->config->
-						       nOpportunisticThresholdDiff);
-}
-
-static void cb_notify_set_roam_rescan_rssi_diff(hdd_context_t *pHddCtx,
-						unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_set_roam_rescan_rssi_diff(pHddCtx->hHal,
-				      0, pHddCtx->config->nRoamRescanRssiDiff);
-}
-
-static void
-cb_notify_set_neighbor_lookup_rssi_threshold(hdd_context_t *pHddCtx,
-					     unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_set_neighbor_lookup_rssi_threshold(pHddCtx->hHal, 0,
-					       pHddCtx->config->
-					       nNeighborLookupRssiThreshold);
-}
-
-static void
-cb_notify_set_delay_before_vdev_stop(hdd_context_t *hdd_ctx,
-				     unsigned long notify_id)
-{
-	/*
-	 * At the point this routine is called, the value in the cfg_ini
-	 * table has already been updated
-	 */
-	sme_set_delay_before_vdev_stop(hdd_ctx->hHal, 0,
-				hdd_ctx->config->delay_before_vdev_stop);
-}
-
-static void
-cb_notify_set_neighbor_scan_period(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_set_neighbor_scan_period(pHddCtx->hHal, 0,
-				     pHddCtx->config->nNeighborScanPeriod);
-}
-
-static void
-cb_notify_set_neighbor_results_refresh_period(hdd_context_t *pHddCtx,
-					      unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_set_neighbor_scan_refresh_period(pHddCtx->hHal, 0,
-					     pHddCtx->config->
-					     nNeighborResultsRefreshPeriod);
-}
-
-static void
-cb_notify_set_empty_scan_refresh_period(hdd_context_t *pHddCtx,
-					unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_update_empty_scan_refresh_period(pHddCtx->hHal, 0,
-					     pHddCtx->config->
-					     nEmptyScanRefreshPeriod);
-}
-
-static void
-cb_notify_set_neighbor_scan_min_chan_time(hdd_context_t *pHddCtx,
-					  unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_set_neighbor_scan_min_chan_time(pHddCtx->hHal,
-					    pHddCtx->config->
-					    nNeighborScanMinChanTime, 0);
-}
-
-static void
-cb_notify_set_neighbor_scan_max_chan_time(hdd_context_t *pHddCtx,
-					  unsigned long notifyId)
-{
-	sme_set_neighbor_scan_max_chan_time(pHddCtx->hHal, 0,
-					    pHddCtx->config->
-					    nNeighborScanMaxChanTime);
-}
-
-static void cb_notify_set_roam_bmiss_first_bcnt(hdd_context_t *pHddCtx,
-						unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_set_roam_bmiss_first_bcnt(pHddCtx->hHal,
-				      0, pHddCtx->config->nRoamBmissFirstBcnt);
-}
-
-static void cb_notify_set_roam_bmiss_final_bcnt(hdd_context_t *pHddCtx,
-						unsigned long notifyId)
-{
-	sme_set_roam_bmiss_final_bcnt(pHddCtx->hHal, 0,
-				      pHddCtx->config->nRoamBmissFinalBcnt);
-}
-
-static void cb_notify_set_roam_beacon_rssi_weight(hdd_context_t *pHddCtx,
-						  unsigned long notifyId)
-{
-	sme_set_roam_beacon_rssi_weight(pHddCtx->hHal, 0,
-					pHddCtx->config->nRoamBeaconRssiWeight);
-}
-
-static void
-cb_notify_set_dfs_scan_mode(hdd_context_t *pHddCtx, unsigned long notifyId)
-{
-	/* At the point this routine is called, the value in the hdd config
-	   table has already been updated */
-	sme_update_dfs_scan_mode(pHddCtx->hHal, 0,
-				 pHddCtx->config->allowDFSChannelRoam);
-}
-
-static void cb_notify_set_enable_ssr(hdd_context_t *pHddCtx,
-				     unsigned long notifyId)
-{
-	sme_update_enable_ssr(pHddCtx->hHal, pHddCtx->config->enableSSR);
-}
-
-static void cb_notify_set_g_sap_preferred_chan_location(hdd_context_t *pHddCtx,
-							unsigned long notifyId)
-{
-	wlansap_set_dfs_preferred_channel_location(pHddCtx->hHal,
-						   pHddCtx->config->
-						   gSapPreferredChanLocation);
-}
-static void ch_notify_set_g_disable_dfs_japan_w53(hdd_context_t *pHddCtx,
-						  unsigned long notifyId)
-{
-	wlansap_set_dfs_restrict_japan_w53(pHddCtx->hHal,
-					   pHddCtx->config->
-					   gDisableDfsJapanW53);
-}
-static void
-cb_notify_update_roam_scan_offload_enabled(hdd_context_t *pHddCtx,
-					   unsigned long notifyId)
-{
-	sme_update_roam_scan_offload_enabled(pHddCtx->hHal,
-					     pHddCtx->config->
-					     isRoamOffloadScanEnabled);
-	if (0 == pHddCtx->config->isRoamOffloadScanEnabled) {
-		pHddCtx->config->bFastRoamInConIniFeatureEnabled = 0;
-		sme_update_enable_fast_roam_in_concurrency(pHddCtx->hHal,
-							   pHddCtx->config->
-							   bFastRoamInConIniFeatureEnabled);
-	}
-}
-
-static void
-cb_notify_set_enable_fast_roam_in_concurrency(hdd_context_t *pHddCtx,
-					      unsigned long notifyId)
-{
-	sme_update_enable_fast_roam_in_concurrency(pHddCtx->hHal,
-						   pHddCtx->config->
-						   bFastRoamInConIniFeatureEnabled);
-}
-
-/**
- * cb_notify_set_roam_scan_hi_rssi_scan_params() - configure hi rssi
- * scan params from cfg to sme.
- * @hdd_ctx: HDD context data structure
- * @notify_id: Identifies 1 of the 4 parameters to be modified
- *
- * Picks up the value from hdd configuration and passes it to SME.
- * Return: void
- */
-
-static void
-cb_notify_set_roam_scan_hi_rssi_scan_params(hdd_context_t *hdd_ctx,
-				    unsigned long notify_id)
-{
-	int32_t val;
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is invalid"));
-		return;
-	}
-
-	switch (notify_id) {
-	case eCSR_HI_RSSI_SCAN_MAXCOUNT_ID:
-		val = hdd_ctx->config->nhi_rssi_scan_max_count;
-		break;
-
-	case eCSR_HI_RSSI_SCAN_RSSI_DELTA_ID:
-		val = hdd_ctx->config->nhi_rssi_scan_rssi_delta;
-		break;
-
-	case eCSR_HI_RSSI_SCAN_DELAY_ID:
-		val = hdd_ctx->config->nhi_rssi_scan_delay;
-		break;
-
-	case eCSR_HI_RSSI_SCAN_RSSI_UB_ID:
-		val = hdd_ctx->config->nhi_rssi_scan_rssi_ub;
-		break;
-
-	default:
-		return;
-	}
-
-	sme_update_roam_scan_hi_rssi_scan_params(hdd_ctx->hHal, 0,
-		notify_id, val);
-}
-
-
-REG_TABLE_ENTRY g_registry_table[] = {
-	REG_VARIABLE(CFG_RTS_THRESHOLD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, RTSThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RTS_THRESHOLD_DEFAULT,
-		     CFG_RTS_THRESHOLD_MIN,
-		     CFG_RTS_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_FRAG_THRESHOLD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, FragmentationThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_FRAG_THRESHOLD_DEFAULT,
-		     CFG_FRAG_THRESHOLD_MIN,
-		     CFG_FRAG_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_OPERATING_CHANNEL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, OperatingChannel,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_OPERATING_CHANNEL_DEFAULT,
-		     CFG_OPERATING_CHANNEL_MIN,
-		     CFG_OPERATING_CHANNEL_MAX),
-
-	REG_VARIABLE(CFG_SHORT_SLOT_TIME_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ShortSlotTimeEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SHORT_SLOT_TIME_ENABLED_DEFAULT,
-		     CFG_SHORT_SLOT_TIME_ENABLED_MIN,
-		     CFG_SHORT_SLOT_TIME_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_11D_SUPPORT_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, Is11dSupportEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_11D_SUPPORT_ENABLED_DEFAULT,
-		     CFG_11D_SUPPORT_ENABLED_MIN,
-		     CFG_11D_SUPPORT_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_11H_SUPPORT_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, Is11hSupportEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_11H_SUPPORT_ENABLED_DEFAULT,
-		     CFG_11H_SUPPORT_ENABLED_MIN,
-		     CFG_11H_SUPPORT_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_COUNTRY_CODE_PRIORITY_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fSupplicantCountryCodeHasPriority,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_COUNTRY_CODE_PRIORITY_DEFAULT,
-		     CFG_COUNTRY_CODE_PRIORITY_MIN,
-		     CFG_COUNTRY_CODE_PRIORITY_MAX),
-
-	REG_VARIABLE(CFG_HEARTBEAT_THRESH_24_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, HeartbeatThresh24,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_HEARTBEAT_THRESH_24_DEFAULT,
-		     CFG_HEARTBEAT_THRESH_24_MIN,
-		     CFG_HEARTBEAT_THRESH_24_MAX),
-
-	REG_VARIABLE_STRING(CFG_POWER_USAGE_NAME, WLAN_PARAM_String,
-			    struct hdd_config, PowerUsageControl,
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_POWER_USAGE_DEFAULT),
-
-	REG_VARIABLE(CFG_ENABLE_IMPS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fIsImpsEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_IMPS_DEFAULT,
-		     CFG_ENABLE_IMPS_MIN,
-		     CFG_ENABLE_IMPS_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_PS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, is_ps_enabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_PS_DEFAULT,
-		     CFG_ENABLE_PS_MIN,
-		     CFG_ENABLE_PS_MAX),
-
-	REG_VARIABLE(CFG_BMPS_MINIMUM_LI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nBmpsMinListenInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BMPS_MINIMUM_LI_DEFAULT,
-		     CFG_BMPS_MINIMUM_LI_MIN,
-		     CFG_BMPS_MINIMUM_LI_MAX),
-
-	REG_VARIABLE(CFG_BMPS_MAXIMUM_LI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nBmpsMaxListenInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BMPS_MAXIMUM_LI_DEFAULT,
-		     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,
-		     CFG_DOT11_MODE_DEFAULT,
-		     CFG_DOT11_MODE_MIN,
-		     CFG_DOT11_MODE_MAX),
-
-	REG_VARIABLE(CFG_CHANNEL_BONDING_MODE_24GHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nChannelBondingMode24GHz,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_CHANNEL_BONDING_MODE_DEFAULT,
-		     CFG_CHANNEL_BONDING_MODE_MIN,
-		     CFG_CHANNEL_BONDING_MODE_MAX),
-
-	REG_VARIABLE(CFG_CHANNEL_BONDING_MODE_5GHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nChannelBondingMode5GHz,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_CHANNEL_BONDING_MODE_DEFAULT,
-		     CFG_CHANNEL_BONDING_MODE_MIN,
-		     CFG_CHANNEL_BONDING_MODE_MAX),
-
-	REG_VARIABLE(CFG_MAX_RX_AMPDU_FACTOR_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, MaxRxAmpduFactor,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_MAX_RX_AMPDU_FACTOR_DEFAULT,
-		     CFG_MAX_RX_AMPDU_FACTOR_MIN,
-		     CFG_MAX_RX_AMPDU_FACTOR_MAX),
-
-	REG_VARIABLE(CFG_HT_MPDU_DENSITY_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ht_mpdu_density,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK ,
-		     CFG_HT_MPDU_DENSITY_DEFAULT,
-		     CFG_HT_MPDU_DENSITY_MIN,
-		     CFG_HT_MPDU_DENSITY_MAX),
-
-	REG_VARIABLE(CFG_FIXED_RATE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, TxRate,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_FIXED_RATE_DEFAULT,
-		     CFG_FIXED_RATE_MIN,
-		     CFG_FIXED_RATE_MAX),
-
-	REG_VARIABLE(CFG_SHORT_GI_20MHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ShortGI20MhzEnable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SHORT_GI_20MHZ_DEFAULT,
-		     CFG_SHORT_GI_20MHZ_MIN,
-		     CFG_SHORT_GI_20MHZ_MAX),
-
-	REG_VARIABLE(CFG_SCAN_RESULT_AGE_COUNT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ScanResultAgeCount,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SCAN_RESULT_AGE_COUNT_DEFAULT,
-		     CFG_SCAN_RESULT_AGE_COUNT_MIN,
-		     CFG_SCAN_RESULT_AGE_COUNT_MAX),
-
-	REG_VARIABLE(CFG_SCAN_RESULT_AGE_TIME_NCNPS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nScanAgeTimeNCNPS,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SCAN_RESULT_AGE_TIME_NCNPS_DEFAULT,
-		     CFG_SCAN_RESULT_AGE_TIME_NCNPS_MIN,
-		     CFG_SCAN_RESULT_AGE_TIME_NCNPS_MAX),
-
-	REG_VARIABLE(CFG_SCAN_RESULT_AGE_TIME_NCPS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nScanAgeTimeNCPS,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SCAN_RESULT_AGE_TIME_NCPS_DEFAULT,
-		     CFG_SCAN_RESULT_AGE_TIME_NCPS_MIN,
-		     CFG_SCAN_RESULT_AGE_TIME_NCPS_MAX),
-
-	REG_VARIABLE(CFG_SCAN_RESULT_AGE_TIME_CNPS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nScanAgeTimeCNPS,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SCAN_RESULT_AGE_TIME_CNPS_DEFAULT,
-		     CFG_SCAN_RESULT_AGE_TIME_CNPS_MIN,
-		     CFG_SCAN_RESULT_AGE_TIME_CNPS_MAX),
-
-	REG_VARIABLE(CFG_SCAN_RESULT_AGE_TIME_CPS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nScanAgeTimeCPS,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SCAN_RESULT_AGE_TIME_CPS_DEFAULT,
-		     CFG_SCAN_RESULT_AGE_TIME_CPS_MIN,
-		     CFG_SCAN_RESULT_AGE_TIME_CPS_MAX),
-
-	REG_VARIABLE(CFG_RSSI_CATEGORY_GAP_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nRssiCatGap,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RSSI_CATEGORY_GAP_DEFAULT,
-		     CFG_RSSI_CATEGORY_GAP_MIN,
-		     CFG_RSSI_CATEGORY_GAP_MAX),
-
-	REG_VARIABLE(CFG_SHORT_PREAMBLE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fIsShortPreamble,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SHORT_PREAMBLE_DEFAULT,
-		     CFG_SHORT_PREAMBLE_MIN,
-		     CFG_SHORT_PREAMBLE_MAX),
-
-	REG_VARIABLE_STRING(CFG_IBSS_BSSID_NAME, WLAN_PARAM_MacAddr,
-			    struct hdd_config, IbssBssid,
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_IBSS_BSSID_DEFAULT),
-
-	REG_VARIABLE_STRING(CFG_INTF0_MAC_ADDR_NAME, WLAN_PARAM_MacAddr,
-			    struct hdd_config, intfMacAddr[0],
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_INTF0_MAC_ADDR_DEFAULT),
-
-	REG_VARIABLE_STRING(CFG_INTF1_MAC_ADDR_NAME, WLAN_PARAM_MacAddr,
-			    struct hdd_config, intfMacAddr[1],
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_INTF1_MAC_ADDR_DEFAULT),
-
-	REG_VARIABLE_STRING(CFG_INTF2_MAC_ADDR_NAME, WLAN_PARAM_MacAddr,
-			    struct hdd_config, intfMacAddr[2],
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_INTF2_MAC_ADDR_DEFAULT),
-
-	REG_VARIABLE_STRING(CFG_INTF3_MAC_ADDR_NAME, WLAN_PARAM_MacAddr,
-			    struct hdd_config, intfMacAddr[3],
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_INTF3_MAC_ADDR_DEFAULT),
-
-	REG_VARIABLE(CFG_AP_QOS_UAPSD_MODE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apUapsdEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_QOS_UAPSD_MODE_DEFAULT,
-		     CFG_AP_QOS_UAPSD_MODE_MIN,
-		     CFG_AP_QOS_UAPSD_MODE_MAX),
-
-
-	REG_VARIABLE(CFG_AP_ENABLE_RANDOM_BSSID_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apRandomBssidEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_ENABLE_RANDOM_BSSID_DEFAULT,
-		     CFG_AP_ENABLE_RANDOM_BSSID_MIN,
-		     CFG_AP_ENABLE_RANDOM_BSSID_MAX),
-
-	REG_VARIABLE(CFG_AP_ENABLE_PROTECTION_MODE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apProtEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_ENABLE_PROTECTION_MODE_DEFAULT,
-		     CFG_AP_ENABLE_PROTECTION_MODE_MIN,
-		     CFG_AP_ENABLE_PROTECTION_MODE_MAX),
-
-	REG_VARIABLE(CFG_AP_PROTECTION_MODE_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, apProtection,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_PROTECTION_MODE_DEFAULT,
-		     CFG_AP_PROTECTION_MODE_MIN,
-		     CFG_AP_PROTECTION_MODE_MAX),
-
-	REG_VARIABLE(CFG_AP_OBSS_PROTECTION_MODE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apOBSSProtEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_OBSS_PROTECTION_MODE_DEFAULT,
-		     CFG_AP_OBSS_PROTECTION_MODE_MIN,
-		     CFG_AP_OBSS_PROTECTION_MODE_MAX),
-
-	REG_VARIABLE(CFG_AP_STA_SECURITY_SEPERATION_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apDisableIntraBssFwd,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_STA_SECURITY_SEPERATION_DEFAULT,
-		     CFG_AP_STA_SECURITY_SEPERATION_MIN,
-		     CFG_AP_STA_SECURITY_SEPERATION_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_LTE_COEX, WLAN_PARAM_Integer,
-		     struct hdd_config, enableLTECoex,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_LTE_COEX_DEFAULT,
-		     CFG_ENABLE_LTE_COEX_MIN,
-		     CFG_ENABLE_LTE_COEX_MAX),
-	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),
-
-	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),
-
-	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_AP_KEEP_ALIVE_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apKeepAlivePeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_KEEP_ALIVE_PERIOD_DEFAULT,
-		     CFG_AP_KEEP_ALIVE_PERIOD_MIN,
-		     CFG_AP_KEEP_ALIVE_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_GO_KEEP_ALIVE_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, goKeepAlivePeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_GO_KEEP_ALIVE_PERIOD_DEFAULT,
-		     CFG_GO_KEEP_ALIVE_PERIOD_MIN,
-		     CFG_GO_KEEP_ALIVE_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_AP_LINK_MONITOR_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apLinkMonitorPeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_LINK_MONITOR_PERIOD_DEFAULT,
-		     CFG_AP_LINK_MONITOR_PERIOD_MIN,
-		     CFG_AP_LINK_MONITOR_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_GO_LINK_MONITOR_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, goLinkMonitorPeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_GO_LINK_MONITOR_PERIOD_DEFAULT,
-		     CFG_GO_LINK_MONITOR_PERIOD_MIN,
-		     CFG_GO_LINK_MONITOR_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_DISABLE_PACKET_FILTER, WLAN_PARAM_Integer,
-		     struct hdd_config, disablePacketFilter,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DISABLE_PACKET_FILTER_DEFAULT,
-		     CFG_DISABLE_PACKET_FILTER_MIN,
-		     CFG_DISABLE_PACKET_FILTER_MAX),
-
-	REG_VARIABLE(CFG_BEACON_INTERVAL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nBeaconInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_BEACON_INTERVAL_DEFAULT,
-		     CFG_BEACON_INTERVAL_MIN,
-		     CFG_BEACON_INTERVAL_MAX),
-
-	REG_VARIABLE(CFG_ROAMING_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nRoamingTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ROAMING_TIME_DEFAULT,
-		     CFG_ROAMING_TIME_MIN,
-		     CFG_ROAMING_TIME_MAX),
-
-	REG_VARIABLE(CFG_VCC_RSSI_TRIGGER_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nVccRssiTrigger,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VCC_RSSI_TRIGGER_DEFAULT,
-		     CFG_VCC_RSSI_TRIGGER_MIN,
-		     CFG_VCC_RSSI_TRIGGER_MAX),
-
-	REG_VARIABLE(CFG_VCC_UL_MAC_LOSS_THRESH_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nVccUlMacLossThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VCC_UL_MAC_LOSS_THRESH_DEFAULT,
-		     CFG_VCC_UL_MAC_LOSS_THRESH_MIN,
-		     CFG_VCC_UL_MAC_LOSS_THRESH_MAX),
-
-	REG_VARIABLE(CFG_PASSIVE_MAX_CHANNEL_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nPassiveMaxChnTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PASSIVE_MAX_CHANNEL_TIME_DEFAULT,
-		     CFG_PASSIVE_MAX_CHANNEL_TIME_MIN,
-		     CFG_PASSIVE_MAX_CHANNEL_TIME_MAX),
-
-	REG_VARIABLE(CFG_PASSIVE_MIN_CHANNEL_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nPassiveMinChnTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PASSIVE_MIN_CHANNEL_TIME_DEFAULT,
-		     CFG_PASSIVE_MIN_CHANNEL_TIME_MIN,
-		     CFG_PASSIVE_MIN_CHANNEL_TIME_MAX),
-
-	REG_VARIABLE(CFG_ACTIVE_MAX_CHANNEL_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nActiveMaxChnTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ACTIVE_MAX_CHANNEL_TIME_DEFAULT,
-		     CFG_ACTIVE_MAX_CHANNEL_TIME_MIN,
-		     CFG_ACTIVE_MAX_CHANNEL_TIME_MAX),
-
-	REG_VARIABLE(CFG_ACTIVE_MIN_CHANNEL_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nActiveMinChnTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ACTIVE_MIN_CHANNEL_TIME_DEFAULT,
-		     CFG_ACTIVE_MIN_CHANNEL_TIME_MIN,
-		     CFG_ACTIVE_MIN_CHANNEL_TIME_MAX),
-
-	REG_VARIABLE(CFG_RETRY_LIMIT_ZERO_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, retryLimitZero,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RETRY_LIMIT_ZERO_DEFAULT,
-		     CFG_RETRY_LIMIT_ZERO_MIN,
-		     CFG_RETRY_LIMIT_ZERO_MAX),
-
-	REG_VARIABLE(CFG_RETRY_LIMIT_ONE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, retryLimitOne,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RETRY_LIMIT_ONE_DEFAULT,
-		     CFG_RETRY_LIMIT_ONE_MIN,
-		     CFG_RETRY_LIMIT_ONE_MAX),
-
-	REG_VARIABLE(CFG_RETRY_LIMIT_TWO_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, retryLimitTwo,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RETRY_LIMIT_TWO_DEFAULT,
-		     CFG_RETRY_LIMIT_TWO_MIN,
-		     CFG_RETRY_LIMIT_TWO_MAX),
-
-#ifdef WLAN_AP_STA_CONCURRENCY
-	REG_VARIABLE(CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nPassiveMaxChnTimeConc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_DEFAULT,
-		     CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MIN,
-		     CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MAX),
-
-	REG_VARIABLE(CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nPassiveMinChnTimeConc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_DEFAULT,
-		     CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MIN,
-		     CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MAX),
-
-	REG_VARIABLE(CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nActiveMaxChnTimeConc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_DEFAULT,
-		     CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MIN,
-		     CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MAX),
-
-	REG_VARIABLE(CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nActiveMinChnTimeConc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_DEFAULT,
-		     CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MIN,
-		     CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MAX),
-
-	REG_VARIABLE(CFG_REST_TIME_CONC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nRestTimeConc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_REST_TIME_CONC_DEFAULT,
-		     CFG_REST_TIME_CONC_MIN,
-		     CFG_REST_TIME_CONC_MAX),
-
-	REG_VARIABLE(CFG_NUM_STA_CHAN_COMBINED_CONC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nNumStaChanCombinedConc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_NUM_STA_CHAN_COMBINED_CONC_DEFAULT,
-		     CFG_NUM_STA_CHAN_COMBINED_CONC_MIN,
-		     CFG_NUM_STA_CHAN_COMBINED_CONC_MAX),
-
-	REG_VARIABLE(CFG_NUM_P2P_CHAN_COMBINED_CONC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nNumP2PChanCombinedConc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_NUM_P2P_CHAN_COMBINED_CONC_DEFAULT,
-		     CFG_NUM_P2P_CHAN_COMBINED_CONC_MIN,
-		     CFG_NUM_P2P_CHAN_COMBINED_CONC_MAX),
-#endif
-
-	REG_VARIABLE(CFG_MAX_PS_POLL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nMaxPsPoll,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MAX_PS_POLL_DEFAULT,
-		     CFG_MAX_PS_POLL_MIN,
-		     CFG_MAX_PS_POLL_MAX),
-
-	REG_VARIABLE(CFG_MAX_TX_POWER_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nTxPowerCap,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MAX_TX_POWER_DEFAULT,
-		     CFG_MAX_TX_POWER_MIN,
-		     CFG_MAX_TX_POWER_MAX),
-
-	REG_VARIABLE(CFG_LOW_GAIN_OVERRIDE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fIsLowGainOverride,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LOW_GAIN_OVERRIDE_DEFAULT,
-		     CFG_LOW_GAIN_OVERRIDE_MIN,
-		     CFG_LOW_GAIN_OVERRIDE_MAX),
-
-	REG_VARIABLE(CFG_RSSI_FILTER_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nRssiFilterPeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RSSI_FILTER_PERIOD_DEFAULT,
-		     CFG_RSSI_FILTER_PERIOD_MIN,
-		     CFG_RSSI_FILTER_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_IGNORE_DTIM_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fIgnoreDtim,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IGNORE_DTIM_DEFAULT,
-		     CFG_IGNORE_DTIM_MIN,
-		     CFG_IGNORE_DTIM_MAX),
-
-	REG_VARIABLE(CFG_MAX_LI_MODULATED_DTIM_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fMaxLIModulatedDTIM,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MAX_LI_MODULATED_DTIM_DEFAULT,
-		     CFG_MAX_LI_MODULATED_DTIM_MIN,
-		     CFG_MAX_LI_MODULATED_DTIM_MAX),
-
-	REG_VARIABLE(CFG_RX_ANT_CONFIGURATION_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nRxAnt,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RX_ANT_CONFIGURATION_NAME_DEFAULT,
-		     CFG_RX_ANT_CONFIGURATION_NAME_MIN,
-		     CFG_RX_ANT_CONFIGURATION_NAME_MAX),
-
-	REG_VARIABLE(CFG_FW_HEART_BEAT_MONITORING_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableFwHeartBeatMonitoring,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_FW_HEART_BEAT_MONITORING_DEFAULT,
-		     CFG_FW_HEART_BEAT_MONITORING_MIN,
-		     CFG_FW_HEART_BEAT_MONITORING_MAX),
-
-	REG_VARIABLE(CFG_FW_BEACON_FILTERING_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableFwBeaconFiltering,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_FW_BEACON_FILTERING_DEFAULT,
-		     CFG_FW_BEACON_FILTERING_MIN,
-		     CFG_FW_BEACON_FILTERING_MAX),
-
-	REG_DYNAMIC_VARIABLE(CFG_FW_RSSI_MONITORING_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, fEnableFwRssiMonitoring,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_FW_RSSI_MONITORING_DEFAULT,
-			     CFG_FW_RSSI_MONITORING_MIN,
-			     CFG_FW_RSSI_MONITORING_MAX,
-			     cb_notify_set_fw_rssi_monitoring, 0),
-
-	REG_VARIABLE(CFG_FW_MCC_RTS_CTS_PROT_NAME, WLAN_PARAM_Integer,
-		struct hdd_config, mcc_rts_cts_prot_enable,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_FW_MCC_RTS_CTS_PROT_DEFAULT,
-		CFG_FW_MCC_RTS_CTS_PROT_MIN,
-		CFG_FW_MCC_RTS_CTS_PROT_MAX),
-
-	REG_VARIABLE(CFG_FW_MCC_BCAST_PROB_RESP_NAME, WLAN_PARAM_Integer,
-		struct hdd_config, mcc_bcast_prob_resp_enable,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_FW_MCC_BCAST_PROB_RESP_DEFAULT,
-		CFG_FW_MCC_BCAST_PROB_RESP_MIN,
-		CFG_FW_MCC_BCAST_PROB_RESP_MAX),
-
-	REG_VARIABLE(CFG_DATA_INACTIVITY_TIMEOUT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nDataInactivityTimeout,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DATA_INACTIVITY_TIMEOUT_DEFAULT,
-		     CFG_DATA_INACTIVITY_TIMEOUT_MIN,
-		     CFG_DATA_INACTIVITY_TIMEOUT_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_MODE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, WmmMode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_MODE_DEFAULT,
-		     CFG_QOS_WMM_MODE_MIN,
-		     CFG_QOS_WMM_MODE_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_80211E_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, b80211eIsEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_80211E_ENABLED_DEFAULT,
-		     CFG_QOS_WMM_80211E_ENABLED_MIN,
-		     CFG_QOS_WMM_80211E_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_UAPSD_MASK_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, UapsdMask,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_UAPSD_MASK_DEFAULT,
-		     CFG_QOS_WMM_UAPSD_MASK_MIN,
-		     CFG_QOS_WMM_UAPSD_MASK_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdVoSrvIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_VO_SRV_INTV_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdVoSuspIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_VO_SUS_INTV_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdViSrvIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_VI_SRV_INTV_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdViSuspIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_VI_SUS_INTV_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdBeSrvIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_BE_SRV_INTV_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdBeSuspIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_BE_SUS_INTV_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdBkSrvIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_BK_SRV_INTV_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraUapsdBkSuspIntv,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_DEFAULT,
-		     CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_MIN,
-		     CFG_QOS_WMM_INFRA_UAPSD_BK_SUS_INTV_MAX),
-
-#ifdef FEATURE_WLAN_ESE
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, InfraInactivityInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_DEFAULT,
-		     CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_MIN,
-		     CFG_QOS_WMM_INFRA_INACTIVITY_INTERVAL_MAX),
-
-	REG_DYNAMIC_VARIABLE(CFG_ESE_FEATURE_ENABLED_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, isEseIniFeatureEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ESE_FEATURE_ENABLED_DEFAULT,
-			     CFG_ESE_FEATURE_ENABLED_MIN,
-			     CFG_ESE_FEATURE_ENABLED_MAX,
-			     cb_notify_set_ese_feature_enabled, 0),
-#endif /* FEATURE_WLAN_ESE */
-
-	/* flag to turn ON/OFF Legacy Fast Roaming */
-	REG_DYNAMIC_VARIABLE(CFG_LFR_FEATURE_ENABLED_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, isFastRoamIniFeatureEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LFR_FEATURE_ENABLED_DEFAULT,
-			     CFG_LFR_FEATURE_ENABLED_MIN,
-			     CFG_LFR_FEATURE_ENABLED_MAX,
-			     notify_is_fast_roam_ini_feature_enabled, 0),
-
-	/* flag to turn ON/OFF Motion assistance for Legacy Fast Roaming */
-	REG_DYNAMIC_VARIABLE(CFG_LFR_MAWC_FEATURE_ENABLED_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, MAWCEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LFR_MAWC_FEATURE_ENABLED_DEFAULT,
-			     CFG_LFR_MAWC_FEATURE_ENABLED_MIN,
-			     CFG_LFR_MAWC_FEATURE_ENABLED_MAX,
-			     notify_is_mawc_ini_feature_enabled, 0),
-
-	/* flag to turn ON/OFF 11r and ESE FastTransition */
-	REG_DYNAMIC_VARIABLE(CFG_FAST_TRANSITION_ENABLED_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, isFastTransitionEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_FAST_TRANSITION_ENABLED_NAME_DEFAULT,
-			     CFG_FAST_TRANSITION_ENABLED_NAME_MIN,
-			     CFG_FAST_TRANSITION_ENABLED_NAME_MAX,
-			     cb_notify_set_fast_transition_enabled, 0),
-
-	/* Variable to specify the delta/difference between the RSSI of current AP
-	 * and roamable AP while roaming */
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_RSSI_DIFF_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, RoamRssiDiff,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_RSSI_DIFF_DEFAULT,
-			     CFG_ROAM_RSSI_DIFF_MIN,
-			     CFG_ROAM_RSSI_DIFF_MAX,
-			     cb_notify_set_roam_rssi_diff, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ENABLE_WES_MODE_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, isWESModeEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ENABLE_WES_MODE_NAME_DEFAULT,
-			     CFG_ENABLE_WES_MODE_NAME_MIN,
-			     CFG_ENABLE_WES_MODE_NAME_MAX,
-			     cb_notify_set_wes_mode, 0),
-#ifdef FEATURE_WLAN_OKC
-	REG_DYNAMIC_VARIABLE(CFG_OKC_FEATURE_ENABLED_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, isOkcIniFeatureEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_OKC_FEATURE_ENABLED_DEFAULT,
-			     CFG_OKC_FEATURE_ENABLED_MIN,
-			     CFG_OKC_FEATURE_ENABLED_MAX,
-			     cb_notify_set_okc_feature_enabled, 0),
-#endif
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_OFFLOAD_ENABLED, WLAN_PARAM_Integer,
-			     struct hdd_config, isRoamOffloadScanEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_SCAN_OFFLOAD_ENABLED_DEFAULT,
-			     CFG_ROAM_SCAN_OFFLOAD_ENABLED_MIN,
-			     CFG_ROAM_SCAN_OFFLOAD_ENABLED_MAX,
-			     cb_notify_update_roam_scan_offload_enabled, 0),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_DIR_AC_VO_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, InfraDirAcVo,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_VO_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_VO_MIN,
-		     CFG_QOS_WMM_INFRA_DIR_AC_VO_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraNomMsduSizeAcVo,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_MIN,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VO_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMeanDataRateAcVo,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_MIN,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VO_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMinPhyRateAcVo,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_MIN,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VO_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_SBA_AC_VO_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraSbaAcVo,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_VO_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_VO_MIN,
-		     CFG_QOS_WMM_INFRA_SBA_AC_VO_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_DIR_AC_VI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, InfraDirAcVi,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_VI_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_VI_MIN,
-		     CFG_QOS_WMM_INFRA_DIR_AC_VI_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraNomMsduSizeAcVi,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_MIN,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_VI_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMeanDataRateAcVi,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_MIN,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_VI_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMinPhyRateAcVi,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_MIN,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_VI_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_SBA_AC_VI_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraSbaAcVi,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_VI_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_VI_MIN,
-		     CFG_QOS_WMM_INFRA_SBA_AC_VI_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_DIR_AC_BE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, InfraDirAcBe,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_BE_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_BE_MIN,
-		     CFG_QOS_WMM_INFRA_DIR_AC_BE_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraNomMsduSizeAcBe,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_MIN,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BE_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMeanDataRateAcBe,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_MIN,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BE_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMinPhyRateAcBe,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_MIN,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BE_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_SBA_AC_BE_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraSbaAcBe,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_BE_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_BE_MIN,
-		     CFG_QOS_WMM_INFRA_SBA_AC_BE_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_DIR_AC_BK_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, InfraDirAcBk,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_BK_DEFAULT,
-		     CFG_QOS_WMM_INFRA_DIR_AC_BK_MIN,
-		     CFG_QOS_WMM_INFRA_DIR_AC_BK_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraNomMsduSizeAcBk,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_DEFAULT,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_MIN,
-		     CFG_QOS_WMM_INFRA_NOM_MSDU_SIZE_AC_BK_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMeanDataRateAcBk,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_MIN,
-		     CFG_QOS_WMM_INFRA_MEAN_DATA_RATE_AC_BK_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_NAME,
-		     WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraMinPhyRateAcBk,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_DEFAULT,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_MIN,
-		     CFG_QOS_WMM_INFRA_MIN_PHY_RATE_AC_BK_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_INFRA_SBA_AC_BK_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, InfraSbaAcBk,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_BK_DEFAULT,
-		     CFG_QOS_WMM_INFRA_SBA_AC_BK_MIN,
-		     CFG_QOS_WMM_INFRA_SBA_AC_BK_MAX),
-
-	REG_VARIABLE(CFG_TL_DELAYED_TRGR_FRM_INT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, DelayedTriggerFrmInt,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TL_DELAYED_TRGR_FRM_INT_DEFAULT,
-		     CFG_TL_DELAYED_TRGR_FRM_INT_MIN,
-		     CFG_TL_DELAYED_TRGR_FRM_INT_MAX),
-
-	REG_VARIABLE_STRING(CFG_WOWL_PATTERN_NAME, WLAN_PARAM_String,
-			    struct hdd_config, wowlPattern,
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_WOWL_PATTERN_DEFAULT),
-
-	REG_VARIABLE(CFG_QOS_IMPLICIT_SETUP_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, bImplicitQosEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_IMPLICIT_SETUP_ENABLED_DEFAULT,
-		     CFG_QOS_IMPLICIT_SETUP_ENABLED_MIN,
-		     CFG_QOS_IMPLICIT_SETUP_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_AP_LISTEN_MODE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nEnableListenMode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_LISTEN_MODE_DEFAULT,
-		     CFG_AP_LISTEN_MODE_MIN,
-		     CFG_AP_LISTEN_MODE_MAX),
-
-	REG_VARIABLE(CFG_AP_AUTO_SHUT_OFF, WLAN_PARAM_Integer,
-		     struct hdd_config, nAPAutoShutOff,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_AUTO_SHUT_OFF_DEFAULT,
-		     CFG_AP_AUTO_SHUT_OFF_MIN,
-		     CFG_AP_AUTO_SHUT_OFF_MAX),
-
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-	REG_VARIABLE(CFG_WLAN_MCC_TO_SCC_SWITCH_MODE, WLAN_PARAM_Integer,
-		     struct hdd_config, WlanMccToSccSwitchMode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_DEFAULT,
-		     CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MIN,
-		     CFG_WLAN_MCC_TO_SCC_SWITCH_MODE_MAX),
-#endif
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-	REG_VARIABLE(CFG_WLAN_AUTO_SHUTDOWN, WLAN_PARAM_Integer,
-		     struct hdd_config, WlanAutoShutdown,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_WLAN_AUTO_SHUTDOWN_DEFAULT,
-		     CFG_WLAN_AUTO_SHUTDOWN_MIN,
-		     CFG_WLAN_AUTO_SHUTDOWN_MAX),
-#endif
-#if defined WLAN_FEATURE_VOWIFI
-	REG_VARIABLE(CFG_RRM_ENABLE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fRrmEnable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RRM_ENABLE_DEFAULT,
-		     CFG_RRM_ENABLE_MIN,
-		     CFG_RRM_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_RRM_OPERATING_CHAN_MAX_DURATION_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, nInChanMeasMaxDuration,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RRM_OPERATING_CHAN_MAX_DURATION_DEFAULT,
-		     CFG_RRM_OPERATING_CHAN_MAX_DURATION_MIN,
-		     CFG_RRM_OPERATING_CHAN_MAX_DURATION_MAX),
-
-	REG_VARIABLE(CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, nOutChanMeasMaxDuration,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_DEFAULT,
-		     CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_MIN,
-		     CFG_RRM_NON_OPERATING_CHAN_MAX_DURATION_MAX),
-
-	REG_VARIABLE(CFG_RRM_MEAS_RANDOMIZATION_INTVL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nRrmRandnIntvl,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RRM_MEAS_RANDOMIZATION_INTVL_DEFAULT,
-		     CFG_RRM_MEAS_RANDOMIZATION_INTVL_MIN,
-		     CFG_RRM_MEAS_RANDOMIZATION_INTVL_MAX),
-
-	REG_VARIABLE_STRING(CFG_RM_CAPABILITY_NAME, WLAN_PARAM_String,
-			    struct hdd_config, rm_capability,
-			    VAR_FLAGS_OPTIONAL,
-			    (void *) CFG_RM_CAPABILITY_DEFAULT),
-#endif
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	REG_VARIABLE(CFG_FT_RESOURCE_REQ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fFTResourceReqSupported,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_FT_RESOURCE_REQ_DEFAULT,
-		     CFG_FT_RESOURCE_REQ_MIN,
-		     CFG_FT_RESOURCE_REQ_MAX),
-#endif
-
-	REG_DYNAMIC_VARIABLE(CFG_NEIGHBOR_SCAN_TIMER_PERIOD_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nNeighborScanPeriod,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_TIMER_PERIOD_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN,
-			     CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX,
-			     cb_notify_set_neighbor_scan_period, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nNeighborLookupRssiThreshold,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_DEFAULT,
-			     CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN,
-			     CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX,
-			     cb_notify_set_neighbor_lookup_rssi_threshold, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nOpportunisticThresholdDiff,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_DEFAULT,
-			     CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_MIN,
-			     CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_MAX,
-			     cb_notify_set_opportunistic_scan_threshold_diff, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_RESCAN_RSSI_DIFF_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, nRoamRescanRssiDiff,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_RESCAN_RSSI_DIFF_DEFAULT,
-			     CFG_ROAM_RESCAN_RSSI_DIFF_MIN,
-			     CFG_ROAM_RESCAN_RSSI_DIFF_MAX,
-			     cb_notify_set_roam_rescan_rssi_diff, 0),
-
-	REG_VARIABLE_STRING(CFG_NEIGHBOR_SCAN_CHAN_LIST_NAME, WLAN_PARAM_String,
-			    struct hdd_config, neighborScanChanList,
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_NEIGHBOR_SCAN_CHAN_LIST_DEFAULT),
-
-	REG_DYNAMIC_VARIABLE(CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nNeighborScanMinChanTime,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN,
-			     CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX,
-			     cb_notify_set_neighbor_scan_min_chan_time, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nNeighborScanMaxChanTime,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN,
-			     CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX,
-			     cb_notify_set_neighbor_scan_max_chan_time, 0),
-
-	REG_VARIABLE(CFG_11R_NEIGHBOR_REQ_MAX_TRIES_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nMaxNeighborReqTries,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_11R_NEIGHBOR_REQ_MAX_TRIES_DEFAULT,
-		     CFG_11R_NEIGHBOR_REQ_MAX_TRIES_MIN,
-		     CFG_11R_NEIGHBOR_REQ_MAX_TRIES_MAX),
-
-	REG_DYNAMIC_VARIABLE(CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nNeighborResultsRefreshPeriod,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_DEFAULT,
-			     CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN,
-			     CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX,
-			     cb_notify_set_neighbor_results_refresh_period, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_EMPTY_SCAN_REFRESH_PERIOD_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nEmptyScanRefreshPeriod,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_EMPTY_SCAN_REFRESH_PERIOD_DEFAULT,
-			     CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN,
-			     CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX,
-			     cb_notify_set_empty_scan_refresh_period, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_BMISS_FIRST_BCNT_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, nRoamBmissFirstBcnt,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_BMISS_FIRST_BCNT_DEFAULT,
-			     CFG_ROAM_BMISS_FIRST_BCNT_MIN,
-			     CFG_ROAM_BMISS_FIRST_BCNT_MAX,
-			     cb_notify_set_roam_bmiss_first_bcnt, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_BMISS_FINAL_BCNT_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, nRoamBmissFinalBcnt,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_BMISS_FINAL_BCNT_DEFAULT,
-			     CFG_ROAM_BMISS_FINAL_BCNT_MIN,
-			     CFG_ROAM_BMISS_FINAL_BCNT_MAX,
-			     cb_notify_set_roam_bmiss_final_bcnt, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_BEACON_RSSI_WEIGHT_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, nRoamBeaconRssiWeight,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_BEACON_RSSI_WEIGHT_DEFAULT,
-			     CFG_ROAM_BEACON_RSSI_WEIGHT_MIN,
-			     CFG_ROAM_BEACON_RSSI_WEIGHT_MAX,
-			     cb_notify_set_roam_beacon_rssi_weight, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAMING_DFS_CHANNEL_NAME, WLAN_PARAM_Integer,
-			     struct hdd_config, allowDFSChannelRoam,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAMING_DFS_CHANNEL_DEFAULT,
-			     CFG_ROAMING_DFS_CHANNEL_MIN,
-			     CFG_ROAMING_DFS_CHANNEL_MAX,
-			     cb_notify_set_dfs_scan_mode, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_DELAY_BEFORE_VDEV_STOP_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config,
-			     delay_before_vdev_stop,
-			     VAR_FLAGS_OPTIONAL |
-				VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_DELAY_BEFORE_VDEV_STOP_DEFAULT,
-			     CFG_DELAY_BEFORE_VDEV_STOP_MIN,
-			     CFG_DELAY_BEFORE_VDEV_STOP_MAX,
-			     cb_notify_set_delay_before_vdev_stop,
-			     0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config,
-			     nhi_rssi_scan_max_count,
-			     VAR_FLAGS_OPTIONAL |
-				VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_MIN,
-			     CFG_ROAM_SCAN_HI_RSSI_MAXCOUNT_MAX,
-			     cb_notify_set_roam_scan_hi_rssi_scan_params,
-			     eCSR_HI_RSSI_SCAN_MAXCOUNT_ID),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_HI_RSSI_DELTA_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config,
-			     nhi_rssi_scan_rssi_delta,
-			     VAR_FLAGS_OPTIONAL |
-				VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_DELTA_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_DELTA_MIN,
-			     CFG_ROAM_SCAN_HI_RSSI_DELTA_MAX,
-			     cb_notify_set_roam_scan_hi_rssi_scan_params,
-			     eCSR_HI_RSSI_SCAN_RSSI_DELTA_ID),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_HI_RSSI_DELAY_NAME,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config,
-			     nhi_rssi_scan_delay,
-			     VAR_FLAGS_OPTIONAL |
-				VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_DELAY_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_DELAY_MIN,
-			     CFG_ROAM_SCAN_HI_RSSI_DELAY_MAX,
-			     cb_notify_set_roam_scan_hi_rssi_scan_params,
-			     eCSR_HI_RSSI_SCAN_DELAY_ID),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_HI_RSSI_UB_NAME,
-			     WLAN_PARAM_SignedInteger,
-			     struct hdd_config,
-			     nhi_rssi_scan_rssi_ub,
-			     VAR_FLAGS_OPTIONAL |
-				VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_UB_DEFAULT,
-			     CFG_ROAM_SCAN_HI_RSSI_UB_MIN,
-			     CFG_ROAM_SCAN_HI_RSSI_UB_MAX,
-			     cb_notify_set_roam_scan_hi_rssi_scan_params,
-			     eCSR_HI_RSSI_SCAN_RSSI_UB_ID),
-
-	REG_VARIABLE(CFG_QOS_WMM_BURST_SIZE_DEFN_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, burstSizeDefinition,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_BURST_SIZE_DEFN_DEFAULT,
-		     CFG_QOS_WMM_BURST_SIZE_DEFN_MIN,
-		     CFG_QOS_WMM_BURST_SIZE_DEFN_MAX),
-
-	REG_VARIABLE(CFG_MCAST_BCAST_FILTER_SETTING_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, mcastBcastFilterSetting,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MCAST_BCAST_FILTER_SETTING_DEFAULT,
-		     CFG_MCAST_BCAST_FILTER_SETTING_MIN,
-		     CFG_MCAST_BCAST_FILTER_SETTING_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_HOST_ARPOFFLOAD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fhostArpOffload,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_HOST_ARPOFFLOAD_DEFAULT,
-		     CFG_ENABLE_HOST_ARPOFFLOAD_MIN,
-		     CFG_ENABLE_HOST_ARPOFFLOAD_MAX),
-
-#ifdef FEATURE_WLAN_RA_FILTERING
-	REG_VARIABLE(CFG_RA_FILTER_ENABLE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IsRArateLimitEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RA_FILTER_ENABLE_DEFAULT,
-		     CFG_RA_FILTER_ENABLE_MIN,
-		     CFG_RA_FILTER_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_RA_RATE_LIMIT_INTERVAL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, RArateLimitInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT,
-		     CFG_RA_RATE_LIMIT_INTERVAL_MIN,
-		     CFG_RA_RATE_LIMIT_INTERVAL_MAX),
-#endif
-
-	REG_VARIABLE(CFG_IGNORE_PEER_ERP_INFO_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ignore_peer_erp_info,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IGNORE_PEER_ERP_INFO_DEFAULT,
-		     CFG_IGNORE_PEER_ERP_INFO_MIN,
-		     CFG_IGNORE_PEER_ERP_INFO_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_HOST_SSDP_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ssdp,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_HOST_SSDP_DEFAULT,
-		     CFG_ENABLE_HOST_SSDP_MIN,
-		     CFG_ENABLE_HOST_SSDP_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_HOST_NSOFFLOAD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fhostNSOffload,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_HOST_NSOFFLOAD_DEFAULT,
-		     CFG_ENABLE_HOST_NSOFFLOAD_MIN,
-		     CFG_ENABLE_HOST_NSOFFLOAD_MAX),
-
-	REG_VARIABLE(CFG_QOS_WMM_TS_INFO_ACK_POLICY_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, tsInfoAckPolicy,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_WMM_TS_INFO_ACK_POLICY_DEFAULT,
-		     CFG_QOS_WMM_TS_INFO_ACK_POLICY_MIN,
-		     CFG_QOS_WMM_TS_INFO_ACK_POLICY_MAX),
-
-	REG_VARIABLE(CFG_SINGLE_TID_RC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, bSingleTidRc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SINGLE_TID_RC_DEFAULT,
-		     CFG_SINGLE_TID_RC_MIN,
-		     CFG_SINGLE_TID_RC_MAX),
-
-	REG_VARIABLE(CFG_DYNAMIC_PSPOLL_VALUE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, dynamicPsPollValue,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DYNAMIC_PSPOLL_VALUE_DEFAULT,
-		     CFG_DYNAMIC_PSPOLL_VALUE_MIN,
-		     CFG_DYNAMIC_PSPOLL_VALUE_MAX),
-
-	REG_VARIABLE(CFG_TELE_BCN_WAKEUP_EN_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, teleBcnWakeupEn,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TELE_BCN_WAKEUP_EN_DEFAULT,
-		     CFG_TELE_BCN_WAKEUP_EN_MIN,
-		     CFG_TELE_BCN_WAKEUP_EN_MAX),
-
-	REG_VARIABLE(CFG_INFRA_STA_KEEP_ALIVE_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, infraStaKeepAlivePeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_INFRA_STA_KEEP_ALIVE_PERIOD_DEFAULT,
-		     CFG_INFRA_STA_KEEP_ALIVE_PERIOD_MIN,
-		     CFG_INFRA_STA_KEEP_ALIVE_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, AddTSWhenACMIsOff,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_DEFAULT,
-		     CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_MIN,
-		     CFG_QOS_ADDTS_WHEN_ACM_IS_OFF_MAX),
-
-	REG_VARIABLE(CFG_VALIDATE_SCAN_LIST_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fValidateScanList,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VALIDATE_SCAN_LIST_DEFAULT,
-		     CFG_VALIDATE_SCAN_LIST_MIN,
-		     CFG_VALIDATE_SCAN_LIST_MAX),
-
-	REG_VARIABLE(CFG_NULLDATA_AP_RESP_TIMEOUT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nNullDataApRespTimeout,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_NULLDATA_AP_RESP_TIMEOUT_DEFAULT,
-		     CFG_NULLDATA_AP_RESP_TIMEOUT_MIN,
-		     CFG_NULLDATA_AP_RESP_TIMEOUT_MAX),
-
-	REG_VARIABLE(CFG_AP_DATA_AVAIL_POLL_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apDataAvailPollPeriodInMs,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_DATA_AVAIL_POLL_PERIOD_DEFAULT,
-		     CFG_AP_DATA_AVAIL_POLL_PERIOD_MIN,
-		     CFG_AP_DATA_AVAIL_POLL_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_BAND_CAPABILITY_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nBandCapability,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BAND_CAPABILITY_DEFAULT,
-		     CFG_BAND_CAPABILITY_MIN,
-		     CFG_BAND_CAPABILITY_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_BEACON_EARLY_TERMINATION_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableBeaconEarlyTermination,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_BEACON_EARLY_TERMINATION_DEFAULT,
-		     CFG_ENABLE_BEACON_EARLY_TERMINATION_MIN,
-		     CFG_ENABLE_BEACON_EARLY_TERMINATION_MAX),
-
-/* CFG_CDF_TRACE_ENABLE Parameters */
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_WDI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_wdi,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_HDD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_hdd,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_BMI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_bmi,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_SME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_sme,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_PE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_pe,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_WMA_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_wma,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_SYS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_sys,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_CDF_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_cdf,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_SAP_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_sap,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_HDD_SAP_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_hdd_sap,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_CFG_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_cfg,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_TXRX_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cfd_trace_enable_txrx,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_HTC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_htc,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_HIF_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_hif,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDR_TRACE_ENABLE_HDD_SAP_DATA_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_hdd_sap_data,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_HDD_DATA_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_hdd_data,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_EPPING, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_epping,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_CDF_TRACE_ENABLE_CDF_DEVICES, WLAN_PARAM_Integer,
-		     struct hdd_config, cdf_trace_enable_cdf_devices,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_CDF_TRACE_ENABLE_DEFAULT,
-		     CFG_CDF_TRACE_ENABLE_MIN,
-		     CFG_CDF_TRACE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_TELE_BCN_TRANS_LI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nTeleBcnTransListenInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TELE_BCN_TRANS_LI_DEFAULT,
-		     CFG_TELE_BCN_TRANS_LI_MIN,
-		     CFG_TELE_BCN_TRANS_LI_MAX),
-
-	REG_VARIABLE(CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, nTeleBcnTransLiNumIdleBeacons,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_DEFAULT,
-		     CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_MIN,
-		     CFG_TELE_BCN_TRANS_LI_NUM_IDLE_BCNS_MAX),
-
-	REG_VARIABLE(CFG_TELE_BCN_MAX_LI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nTeleBcnMaxListenInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TELE_BCN_MAX_LI_DEFAULT,
-		     CFG_TELE_BCN_MAX_LI_MIN,
-		     CFG_TELE_BCN_MAX_LI_MAX),
-
-	REG_VARIABLE(CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nTeleBcnMaxLiNumIdleBeacons,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_DEFAULT,
-		     CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_MIN,
-		     CFG_TELE_BCN_MAX_LI_NUM_IDLE_BCNS_MAX),
-
-	REG_VARIABLE(CFG_BCN_EARLY_TERM_WAKE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, bcnEarlyTermWakeInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BCN_EARLY_TERM_WAKE_DEFAULT,
-		     CFG_BCN_EARLY_TERM_WAKE_MIN,
-		     CFG_BCN_EARLY_TERM_WAKE_MAX),
-
-	REG_VARIABLE(CFG_AP_DATA_AVAIL_POLL_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, apDataAvailPollPeriodInMs,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AP_DATA_AVAIL_POLL_PERIOD_DEFAULT,
-		     CFG_AP_DATA_AVAIL_POLL_PERIOD_MIN,
-		     CFG_AP_DATA_AVAIL_POLL_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_CLOSE_LOOP_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableCloseLoop,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_CLOSE_LOOP_DEFAULT,
-		     CFG_ENABLE_CLOSE_LOOP_MIN,
-		     CFG_ENABLE_CLOSE_LOOP_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_BYPASS_11D_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableBypass11d,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_BYPASS_11D_DEFAULT,
-		     CFG_ENABLE_BYPASS_11D_MIN,
-		     CFG_ENABLE_BYPASS_11D_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_DFS_CHNL_SCAN_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableDFSChnlScan,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_DFS_CHNL_SCAN_DEFAULT,
-		     CFG_ENABLE_DFS_CHNL_SCAN_MIN,
-		     CFG_ENABLE_DFS_CHNL_SCAN_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_DFS_PNO_CHNL_SCAN_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_dfs_pno_chnl_scan,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_DFS_PNO_CHNL_SCAN_DEFAULT,
-		     CFG_ENABLE_DFS_PNO_CHNL_SCAN_MIN,
-		     CFG_ENABLE_DFS_PNO_CHNL_SCAN_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_DYNAMIC_DTIM_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableDynamicDTIM,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_DYNAMIC_DTIM_DEFAULT,
-		     CFG_ENABLE_DYNAMIC_DTIM_MIN,
-		     CFG_ENABLE_DYNAMIC_DTIM_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, enableAutomaticTxPowerControl,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_DEFAULT,
-		     CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_MIN,
-		     CFG_ENABLE_AUTOMATIC_TX_POWER_CONTROL_MAX),
-
-	REG_VARIABLE(CFG_SHORT_GI_40MHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ShortGI40MhzEnable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SHORT_GI_40MHZ_DEFAULT,
-		     CFG_SHORT_GI_40MHZ_MIN,
-		     CFG_SHORT_GI_40MHZ_MAX),
-
-	REG_DYNAMIC_VARIABLE(CFG_REPORT_MAX_LINK_SPEED, WLAN_PARAM_Integer,
-			     struct hdd_config, reportMaxLinkSpeed,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_REPORT_MAX_LINK_SPEED_DEFAULT,
-			     CFG_REPORT_MAX_LINK_SPEED_MIN,
-			     CFG_REPORT_MAX_LINK_SPEED_MAX,
-			     NULL, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_LINK_SPEED_RSSI_HIGH, WLAN_PARAM_SignedInteger,
-			     struct hdd_config, linkSpeedRssiHigh,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_HIGH_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_HIGH_MIN,
-			     CFG_LINK_SPEED_RSSI_HIGH_MAX,
-			     NULL, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_LINK_SPEED_RSSI_MID, WLAN_PARAM_SignedInteger,
-			     struct hdd_config, linkSpeedRssiMid,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_MID_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_MID_MIN,
-			     CFG_LINK_SPEED_RSSI_MID_MAX,
-			     NULL, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_LINK_SPEED_RSSI_LOW, WLAN_PARAM_SignedInteger,
-			     struct hdd_config, linkSpeedRssiLow,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_LOW_DEFAULT,
-			     CFG_LINK_SPEED_RSSI_LOW_MIN,
-			     CFG_LINK_SPEED_RSSI_LOW_MAX,
-			     NULL, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_PREFER_5GHZ, WLAN_PARAM_Integer,
-			     struct hdd_config, nRoamPrefer5GHz,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_PREFER_5GHZ_DEFAULT,
-			     CFG_ROAM_PREFER_5GHZ_MIN,
-			     CFG_ROAM_PREFER_5GHZ_MAX,
-			     cb_notify_set_roam_prefer5_g_hz, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_INTRA_BAND, WLAN_PARAM_Integer,
-			     struct hdd_config, nRoamIntraBand,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_INTRA_BAND_DEFAULT,
-			     CFG_ROAM_INTRA_BAND_MIN,
-			     CFG_ROAM_INTRA_BAND_MAX,
-			     cb_notify_set_roam_intra_band, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_N_PROBES, WLAN_PARAM_Integer,
-			     struct hdd_config, nProbes,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_SCAN_N_PROBES_DEFAULT,
-			     CFG_ROAM_SCAN_N_PROBES_MIN,
-			     CFG_ROAM_SCAN_N_PROBES_MAX,
-			     cb_notify_set_roam_scan_n_probes, 0),
-
-	REG_DYNAMIC_VARIABLE(CFG_ROAM_SCAN_HOME_AWAY_TIME, WLAN_PARAM_Integer,
-			     struct hdd_config, nRoamScanHomeAwayTime,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ROAM_SCAN_HOME_AWAY_TIME_DEFAULT,
-			     CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN,
-			     CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX,
-			     cb_notify_set_roam_scan_home_away_time, 0),
-
-	REG_VARIABLE(CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, isP2pDeviceAddrAdministrated,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_DEFAULT,
-		     CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MIN,
-		     CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_MCC_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableMCC,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_MCC_ENABLED_DEFAULT,
-		     CFG_ENABLE_MCC_ENABLED_MIN,
-		     CFG_ENABLE_MCC_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_ALLOW_MCC_GO_DIFF_BI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, allowMCCGODiffBI,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ALLOW_MCC_GO_DIFF_BI_DEFAULT,
-		     CFG_ALLOW_MCC_GO_DIFF_BI_MIN,
-		     CFG_ALLOW_MCC_GO_DIFF_BI_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_MIGRATION_ENABLE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalMitigationEnable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_MIGRATION_ENABLE_DEFAULT,
-		     CFG_THERMAL_MIGRATION_ENABLE_MIN,
-		     CFG_THERMAL_MIGRATION_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_THROTTLE_PERIOD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, throttlePeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THROTTLE_PERIOD_DEFAULT,
-		     CFG_THROTTLE_PERIOD_MIN,
-		     CFG_THROTTLE_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_MODULATED_DTIM_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableModulatedDTIM,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_MODULATED_DTIM_DEFAULT,
-		     CFG_ENABLE_MODULATED_DTIM_MIN,
-		     CFG_ENABLE_MODULATED_DTIM_MAX),
-
-	REG_VARIABLE(CFG_MC_ADDR_LIST_ENABLE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableMCAddrList,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MC_ADDR_LIST_ENABLE_DEFAULT,
-		     CFG_MC_ADDR_LIST_ENABLE_MIN,
-		     CFG_MC_ADDR_LIST_ENABLE_MAX),
-
-#ifdef WLAN_FEATURE_11AC
-	REG_VARIABLE(CFG_VHT_CHANNEL_WIDTH, WLAN_PARAM_Integer,
-		     struct hdd_config, vhtChannelWidth,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_VHT_CHANNEL_WIDTH_DEFAULT,
-		     CFG_VHT_CHANNEL_WIDTH_MIN,
-		     CFG_VHT_CHANNEL_WIDTH_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_RX_MCS_8_9, WLAN_PARAM_Integer,
-		     struct hdd_config, vhtRxMCS,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_VHT_ENABLE_RX_MCS_8_9_DEFAULT,
-		     CFG_VHT_ENABLE_RX_MCS_8_9_MIN,
-		     CFG_VHT_ENABLE_RX_MCS_8_9_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_TX_MCS_8_9, WLAN_PARAM_Integer,
-		     struct hdd_config, vhtTxMCS,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_VHT_ENABLE_TX_MCS_8_9_DEFAULT,
-		     CFG_VHT_ENABLE_TX_MCS_8_9_MIN,
-		     CFG_VHT_ENABLE_TX_MCS_8_9_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_RX_MCS2x2_8_9, WLAN_PARAM_Integer,
-		     struct hdd_config, vhtRxMCS2x2,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_VHT_ENABLE_RX_MCS2x2_8_9_DEFAULT,
-		     CFG_VHT_ENABLE_RX_MCS2x2_8_9_MIN,
-		     CFG_VHT_ENABLE_RX_MCS2x2_8_9_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_TX_MCS2x2_8_9, WLAN_PARAM_Integer,
-		     struct hdd_config, vhtTxMCS2x2,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_VHT_ENABLE_TX_MCS2x2_8_9_DEFAULT,
-		     CFG_VHT_ENABLE_TX_MCS2x2_8_9_MIN,
-		     CFG_VHT_ENABLE_TX_MCS2x2_8_9_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_2x2_CAP_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enable2x2,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_2x2_CAP_FEATURE_DEFAULT,
-		     CFG_VHT_ENABLE_2x2_CAP_FEATURE_MIN,
-		     CFG_VHT_ENABLE_2x2_CAP_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableMuBformee,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE_DEFAULT,
-		     CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE_MIN,
-		     CFG_VHT_ENABLE_MU_BFORMEE_CAP_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_PAID_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableVhtpAid,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_PAID_FEATURE_DEFAULT,
-		     CFG_VHT_ENABLE_PAID_FEATURE_MIN,
-		     CFG_VHT_ENABLE_PAID_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_GID_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableVhtGid,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_GID_FEATURE_DEFAULT,
-		     CFG_VHT_ENABLE_GID_FEATURE_MIN,
-		     CFG_VHT_ENABLE_GID_FEATURE_MAX),
-#endif
-
-	REG_VARIABLE(CFG_VHT_ENABLE_1x1_TX_CHAINMASK, WLAN_PARAM_Integer,
-		     struct hdd_config, txchainmask1x1,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_1x1_TX_CHAINMASK_DEFAULT,
-		     CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MIN,
-		     CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_1x1_RX_CHAINMASK, WLAN_PARAM_Integer,
-		     struct hdd_config, rxchainmask1x1,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_1x1_RX_CHAINMASK_DEFAULT,
-		     CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MIN,
-		     CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_AMPDUPS_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableAmpduPs,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_AMPDUPS_FEATURE_DEFAULT,
-		     CFG_ENABLE_AMPDUPS_FEATURE_MIN,
-		     CFG_ENABLE_AMPDUPS_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_HT_ENABLE_SMPS_CAP_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableHtSmps,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_HT_ENABLE_SMPS_CAP_FEATURE_DEFAULT,
-		     CFG_HT_ENABLE_SMPS_CAP_FEATURE_MIN,
-		     CFG_HT_ENABLE_SMPS_CAP_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_HT_SMPS_CAP_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, htSmps,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_HT_SMPS_CAP_FEATURE_DEFAULT,
-		     CFG_HT_SMPS_CAP_FEATURE_MIN,
-		     CFG_HT_SMPS_CAP_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_DISABLE_DFS_CH_SWITCH, WLAN_PARAM_Integer,
-		     struct hdd_config, disableDFSChSwitch,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DISABLE_DFS_CH_SWITCH_DEFAULT,
-		     CFG_DISABLE_DFS_CH_SWITCH_MIN,
-		     CFG_DISABLE_DFS_CH_SWITCH_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_DFS_MASTER_CAPABILITY, WLAN_PARAM_Integer,
-		     struct hdd_config, enableDFSMasterCap,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_DFS_MASTER_CAPABILITY_DEFAULT,
-		     CFG_ENABLE_DFS_MASTER_CAPABILITY_MIN,
-		     CFG_ENABLE_DFS_MASTER_CAPABILITY_MAX),
-
-	REG_DYNAMIC_VARIABLE(CFG_SAP_PREFERRED_CHANNEL_LOCATION,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, gSapPreferredChanLocation,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_SAP_PREFERRED_CHANNEL_LOCATION_DEFAULT,
-			     CFG_SAP_PREFERRED_CHANNEL_LOCATION_MIN,
-			     CFG_SAP_PREFERRED_CHANNEL_LOCATION_MAX,
-			     cb_notify_set_g_sap_preferred_chan_location, 0),
-	REG_DYNAMIC_VARIABLE(CFG_DISABLE_DFS_JAPAN_W53, WLAN_PARAM_Integer,
-			     struct hdd_config, gDisableDfsJapanW53,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_DISABLE_DFS_JAPAN_W53_DEFAULT,
-			     CFG_DISABLE_DFS_JAPAN_W53_MIN,
-			     CFG_DISABLE_DFS_JAPAN_W53_MAX,
-			     ch_notify_set_g_disable_dfs_japan_w53, 0),
-	REG_VARIABLE(CFG_ENABLE_FIRST_SCAN_2G_ONLY_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableFirstScan2GOnly,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_FIRST_SCAN_2G_ONLY_DEFAULT,
-		     CFG_ENABLE_FIRST_SCAN_2G_ONLY_MIN,
-		     CFG_ENABLE_FIRST_SCAN_2G_ONLY_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, skipDfsChnlInP2pSearch,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_DEFAULT,
-		     CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MIN,
-		     CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH_MAX),
-
-	REG_VARIABLE(CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, ignoreDynamicDtimInP2pMode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_DEFAULT,
-		     CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MIN,
-		     CFG_IGNORE_DYNAMIC_DTIM_IN_P2P_MODE_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_RX_STBC, WLAN_PARAM_Integer,
-		     struct hdd_config, enableRxSTBC,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_RX_STBC_DEFAULT,
-		     CFG_ENABLE_RX_STBC_MIN,
-		     CFG_ENABLE_RX_STBC_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_TX_STBC, WLAN_PARAM_Integer,
-		     struct hdd_config, enableTxSTBC,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_TX_STBC_DEFAULT,
-		     CFG_ENABLE_TX_STBC_MIN,
-		     CFG_ENABLE_TX_STBC_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_RX_LDPC, WLAN_PARAM_Integer,
-		     struct hdd_config, enableRxLDPC,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_RX_LDPC_DEFAULT,
-		     CFG_ENABLE_RX_LDPC_MIN,
-		     CFG_ENABLE_RX_LDPC_MAX),
-
-	REG_VARIABLE(CFG_PPS_ENABLE_5G_EBT, WLAN_PARAM_Integer,
-		     struct hdd_config, enable5gEBT,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PPS_ENABLE_5G_EBT_FEATURE_DEFAULT,
-		     CFG_PPS_ENABLE_5G_EBT_FEATURE_MIN,
-		     CFG_PPS_ENABLE_5G_EBT_FEATURE_MAX),
-
-#ifdef FEATURE_WLAN_TDLS
-	REG_VARIABLE(CFG_TDLS_SUPPORT_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableTDLSSupport,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_SUPPORT_ENABLE_DEFAULT,
-		     CFG_TDLS_SUPPORT_ENABLE_MIN,
-		     CFG_TDLS_SUPPORT_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_TDLS_IMPLICIT_TRIGGER, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableTDLSImplicitTrigger,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_IMPLICIT_TRIGGER_DEFAULT,
-		     CFG_TDLS_IMPLICIT_TRIGGER_MIN,
-		     CFG_TDLS_IMPLICIT_TRIGGER_MAX),
-
-	REG_VARIABLE(CFG_TDLS_TX_STATS_PERIOD, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSTxStatsPeriod,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_TX_STATS_PERIOD_DEFAULT,
-		     CFG_TDLS_TX_STATS_PERIOD_MIN,
-		     CFG_TDLS_TX_STATS_PERIOD_MAX),
-
-	REG_VARIABLE(CFG_TDLS_TX_PACKET_THRESHOLD, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSTxPacketThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_TX_PACKET_THRESHOLD_DEFAULT,
-		     CFG_TDLS_TX_PACKET_THRESHOLD_MIN,
-		     CFG_TDLS_TX_PACKET_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_TDLS_MAX_DISCOVERY_ATTEMPT, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSMaxDiscoveryAttempt,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_MAX_DISCOVERY_ATTEMPT_DEFAULT,
-		     CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MIN,
-		     CFG_TDLS_MAX_DISCOVERY_ATTEMPT_MAX),
-
-	REG_VARIABLE(CFG_TDLS_IDLE_TIMEOUT, WLAN_PARAM_Integer,
-		     struct hdd_config, tdls_idle_timeout,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_IDLE_TIMEOUT_DEFAULT,
-		     CFG_TDLS_IDLE_TIMEOUT_MIN,
-		     CFG_TDLS_IDLE_TIMEOUT_MAX),
-
-	REG_VARIABLE(CFG_TDLS_IDLE_PACKET_THRESHOLD, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSIdlePacketThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_IDLE_PACKET_THRESHOLD_DEFAULT,
-		     CFG_TDLS_IDLE_PACKET_THRESHOLD_MIN,
-		     CFG_TDLS_IDLE_PACKET_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_TDLS_RSSI_TRIGGER_THRESHOLD, WLAN_PARAM_SignedInteger,
-		     struct hdd_config, fTDLSRSSITriggerThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_RSSI_TRIGGER_THRESHOLD_DEFAULT,
-		     CFG_TDLS_RSSI_TRIGGER_THRESHOLD_MIN,
-		     CFG_TDLS_RSSI_TRIGGER_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_TDLS_RSSI_TEARDOWN_THRESHOLD, WLAN_PARAM_SignedInteger,
-		     struct hdd_config, fTDLSRSSITeardownThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_DEFAULT,
-		     CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_MIN,
-		     CFG_TDLS_RSSI_TEARDOWN_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_TDLS_RSSI_DELTA, WLAN_PARAM_SignedInteger,
-		     struct hdd_config, fTDLSRSSIDelta,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_RSSI_DELTA_DEFAULT,
-		     CFG_TDLS_RSSI_DELTA_MIN,
-		     CFG_TDLS_RSSI_DELTA_MAX),
-
-	REG_VARIABLE(CFG_TDLS_QOS_WMM_UAPSD_MASK_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, fTDLSUapsdMask,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_QOS_WMM_UAPSD_MASK_DEFAULT,
-		     CFG_TDLS_QOS_WMM_UAPSD_MASK_MIN,
-		     CFG_TDLS_QOS_WMM_UAPSD_MASK_MAX),
-
-	REG_VARIABLE(CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableTDLSBufferSta,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_DEFAULT,
-		     CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_MIN,
-		     CFG_TDLS_BUFFER_STA_SUPPORT_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableTDLSOffChannel,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_DEFAULT,
-		     CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_MIN,
-		     CFG_TDLS_OFF_CHANNEL_SUPPORT_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSPrefOffChanNum,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_DEFAULT,
-		     CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_MIN,
-		     CFG_TDLS_PREFERRED_OFF_CHANNEL_NUM_MAX),
-
-	REG_VARIABLE(CFG_TDLS_PREFERRED_OFF_CHANNEL_BW, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSPrefOffChanBandwidth,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_PREFERRED_OFF_CHANNEL_BW_DEFAULT,
-		     CFG_TDLS_PREFERRED_OFF_CHANNEL_BW_MIN,
-		     CFG_TDLS_PREFERRED_OFF_CHANNEL_BW_MAX),
-
-	REG_VARIABLE(CFG_TDLS_PUAPSD_INACTIVITY_TIME, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSPuapsdInactivityTimer,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_PUAPSD_INACTIVITY_TIME_DEFAULT,
-		     CFG_TDLS_PUAPSD_INACTIVITY_TIME_MIN,
-		     CFG_TDLS_PUAPSD_INACTIVITY_TIME_MAX),
-
-	REG_VARIABLE(CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSRxFrameThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD_DEFAULT,
-		     CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD_MIN,
-		     CFG_TDLS_PUAPSD_RX_FRAME_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSPuapsdPTIWindow,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW_DEFAULT,
-		     CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW_MIN,
-		     CFG_TDLS_PUAPSD_PEER_TRAFFIC_IND_WINDOW_MAX),
-
-	REG_VARIABLE(CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSPuapsdPTRTimeout,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT_DEFAULT,
-		     CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT_MIN,
-		     CFG_TDLS_PUAPSD_PEER_TRAFFIC_RSP_TIMEOUT_MAX),
-
-	REG_VARIABLE(CFG_TDLS_EXTERNAL_CONTROL, WLAN_PARAM_Integer,
-		     struct hdd_config, fTDLSExternalControl,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_EXTERNAL_CONTROL_DEFAULT,
-		     CFG_TDLS_EXTERNAL_CONTROL_MIN,
-		     CFG_TDLS_EXTERNAL_CONTROL_MAX),
-	REG_VARIABLE(CFG_TDLS_WMM_MODE_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableTDLSWmmMode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_WMM_MODE_ENABLE_DEFAULT,
-		     CFG_TDLS_WMM_MODE_ENABLE_MIN,
-		     CFG_TDLS_WMM_MODE_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_TDLS_SCAN_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_tdls_scan,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_SCAN_ENABLE_DEFAULT,
-		     CFG_TDLS_SCAN_ENABLE_MIN,
-		     CFG_TDLS_SCAN_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_TDLS_PEER_KICKOUT_THRESHOLD, WLAN_PARAM_Integer,
-		     struct hdd_config, tdls_peer_kickout_threshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TDLS_PEER_KICKOUT_THRESHOLD_DEFAULT,
-		     CFG_TDLS_PEER_KICKOUT_THRESHOLD_MIN,
-		     CFG_TDLS_PEER_KICKOUT_THRESHOLD_MAX),
-
-#endif
-
-#ifdef WLAN_SOFTAP_VSTA_FEATURE
-	REG_VARIABLE(CFG_VSTA_SUPPORT_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableVSTASupport,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VSTA_SUPPORT_ENABLE_DEFAULT,
-		     CFG_VSTA_SUPPORT_ENABLE_MIN,
-		     CFG_VSTA_SUPPORT_ENABLE_MAX),
-#endif
-	REG_VARIABLE(CFG_ENABLE_LPWR_IMG_TRANSITION_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableLpwrImgTransition,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_LPWR_IMG_TRANSITION_DEFAULT,
-		     CFG_ENABLE_LPWR_IMG_TRANSITION_MIN,
-		     CFG_ENABLE_LPWR_IMG_TRANSITION_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_LPWR_IMG_TRANSITION_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableLpwrImgTransition,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_LPWR_IMG_TRANSITION_DEFAULT,
-		     CFG_ENABLE_LPWR_IMG_TRANSITION_MIN,
-		     CFG_ENABLE_LPWR_IMG_TRANSITION_MAX),
-
-	REG_VARIABLE(CFG_SCAN_AGING_PARAM_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, scanAgingTimeout,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_SCAN_AGING_PARAM_DEFAULT,
-		     CFG_SCAN_AGING_PARAM_MIN,
-		     CFG_SCAN_AGING_PARAM_MAX),
-
-	REG_VARIABLE(CFG_TX_LDPC_ENABLE_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableTxLdpc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TX_LDPC_ENABLE_FEATURE_DEFAULT,
-		     CFG_TX_LDPC_ENABLE_FEATURE_MIN,
-		     CFG_TX_LDPC_ENABLE_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, enableMCCAdaptiveScheduler,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_DEFAULT,
-		     CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_MIN,
-		     CFG_ENABLE_MCC_ADATIVE_SCHEDULER_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_ANDRIOD_POWER_SAVE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, isAndroidPsEn,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ANDRIOD_POWER_SAVE_DEFAULT,
-		     CFG_ANDRIOD_POWER_SAVE_MIN,
-		     CFG_ANDRIOD_POWER_SAVE_MAX),
-
-	REG_VARIABLE(CFG_IBSS_ADHOC_CHANNEL_5GHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, AdHocChannel5G,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_ADHOC_CHANNEL_5GHZ_DEFAULT,
-		     CFG_IBSS_ADHOC_CHANNEL_5GHZ_MIN,
-		     CFG_IBSS_ADHOC_CHANNEL_5GHZ_MAX),
-
-	REG_VARIABLE(CFG_IBSS_ADHOC_CHANNEL_24GHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, AdHocChannel24G,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_ADHOC_CHANNEL_24GHZ_DEFAULT,
-		     CFG_IBSS_ADHOC_CHANNEL_24GHZ_MIN,
-		     CFG_IBSS_ADHOC_CHANNEL_24GHZ_MAX),
-
-	REG_VARIABLE(CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableTxBF,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE_DEFAULT,
-		     CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE_MIN,
-		     CFG_VHT_SU_BEAMFORMEE_CAP_FEATURE_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_TXBF_SAP_MODE, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_txbf_sap_mode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_TXBF_SAP_MODE_DEFAULT,
-		     CFG_VHT_ENABLE_TXBF_SAP_MODE_MIN,
-		     CFG_VHT_ENABLE_TXBF_SAP_MODE_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_TXBF_IN_20MHZ, WLAN_PARAM_Integer,
-		     struct hdd_config, enableTxBFin20MHz,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_TXBF_IN_20MHZ_DEFAULT,
-		     CFG_VHT_ENABLE_TXBF_IN_20MHZ_MIN,
-		     CFG_VHT_ENABLE_TXBF_IN_20MHZ_MAX),
-
-	REG_VARIABLE(CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, WLAN_PARAM_Integer,
-		     struct hdd_config, txBFCsnValue,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_DEFAULT,
-		     CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_MIN,
-		     CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_MAX),
-
-	REG_VARIABLE(CFG_VHT_ENABLE_TX_SU_BEAM_FORMER, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_su_tx_bformer,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_VHT_ENABLE_TX_SU_BEAM_FORMER_DEFAULT,
-		     CFG_VHT_ENABLE_TX_SU_BEAM_FORMER_MIN,
-		     CFG_VHT_ENABLE_TX_SU_BEAM_FORMER_MAX),
-
-	REG_VARIABLE(CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, sapAllowAllChannel,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_DEFAULT,
-		     CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_MIN,
-		     CFG_SAP_ALLOW_ALL_CHANNEL_PARAM_MAX),
-
-#ifdef WLAN_FEATURE_11AC
-	REG_VARIABLE(CFG_DISABLE_LDPC_WITH_TXBF_AP, WLAN_PARAM_Integer,
-		     struct hdd_config, disableLDPCWithTxbfAP,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DISABLE_LDPC_WITH_TXBF_AP_DEFAULT,
-		     CFG_DISABLE_LDPC_WITH_TXBF_AP_MIN,
-		     CFG_DISABLE_LDPC_WITH_TXBF_AP_MAX),
-#endif
-
-	REG_DYNAMIC_VARIABLE(CFG_ENABLE_SSR, WLAN_PARAM_Integer,
-			     struct hdd_config, enableSSR,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ENABLE_SSR_DEFAULT,
-			     CFG_ENABLE_SSR_MIN,
-			     CFG_ENABLE_SSR_MAX,
-			     cb_notify_set_enable_ssr, 0),
-
-	REG_VARIABLE(CFG_MAX_MEDIUM_TIME, WLAN_PARAM_Integer,
-		     struct hdd_config, cfgMaxMediumTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MAX_MEDIUM_TIME_STADEFAULT,
-		     CFG_MAX_MEDIUM_TIME_STAMIN,
-		     CFG_MAX_MEDIUM_TIME_STAMAX),
-
-
-
-#ifdef WLAN_FEATURE_11AC
-	REG_VARIABLE(CFG_ENABLE_VHT_FOR_24GHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableVhtFor24GHzBand,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_ENABLE_VHT_FOR_24GHZ_DEFAULT,
-		     CFG_ENABLE_VHT_FOR_24GHZ_MIN,
-		     CFG_ENABLE_VHT_FOR_24GHZ_MAX),
-#endif
-
-	REG_DYNAMIC_VARIABLE(CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY,
-			     WLAN_PARAM_Integer,
-			     struct hdd_config, bFastRoamInConIniFeatureEnabled,
-			     VAR_FLAGS_OPTIONAL |
-			     VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			     CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY_DEFAULT,
-			     CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY_MIN,
-			     CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY_MAX,
-			     cb_notify_set_enable_fast_roam_in_concurrency, 0),
-
-	REG_VARIABLE(CFG_ENABLE_ADAPT_RX_DRAIN_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableAdaptRxDrain,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_ADAPT_RX_DRAIN_DEFAULT,
-		     CFG_ENABLE_ADAPT_RX_DRAIN_MIN,
-		     CFG_ENABLE_ADAPT_RX_DRAIN_MAX),
-
-	REG_VARIABLE(CFG_FLEX_CONNECT_POWER_FACTOR_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, flexConnectPowerFactor,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_MINMAX,
-		     CFG_FLEX_CONNECT_POWER_FACTOR_DEFAULT,
-		     CFG_FLEX_CONNECT_POWER_FACTOR_MIN,
-		     CFG_FLEX_CONNECT_POWER_FACTOR_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_HEART_BEAT_OFFLOAD, WLAN_PARAM_Integer,
-		     struct hdd_config, enableIbssHeartBeatOffload,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_HEART_BEAT_OFFLOAD_DEFAULT,
-		     CFG_ENABLE_HEART_BEAT_OFFLOAD_MIN,
-		     CFG_ENABLE_HEART_BEAT_OFFLOAD_MAX),
-
-	REG_VARIABLE(CFG_ANTENNA_DIVERSITY_PARAM_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, antennaDiversity,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ANTENNA_DIVERSITY_PARAM_DEFAULT,
-		     CFG_ANTENNA_DIVERSITY_PARAM_MIN,
-		     CFG_ANTENNA_DIVERSITY_PARAM_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_SNR_MONITORING_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fEnableSNRMonitoring,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_SNR_MONITORING_DEFAULT,
-		     CFG_ENABLE_SNR_MONITORING_MIN,
-		     CFG_ENABLE_SNR_MONITORING_MAX),
-
-#ifdef FEATURE_WLAN_SCAN_PNO
-	REG_VARIABLE(CFG_PNO_SCAN_SUPPORT, WLAN_PARAM_Integer,
-		     struct hdd_config, configPNOScanSupport,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PNO_SCAN_SUPPORT_DEFAULT,
-		     CFG_PNO_SCAN_SUPPORT_DISABLE,
-		     CFG_PNO_SCAN_SUPPORT_ENABLE),
-
-	REG_VARIABLE(CFG_PNO_SCAN_TIMER_REPEAT_VALUE, WLAN_PARAM_Integer,
-		     struct hdd_config, configPNOScanTimerRepeatValue,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PNO_SCAN_TIMER_REPEAT_VALUE_DEFAULT,
-		     CFG_PNO_SCAN_TIMER_REPEAT_VALUE_MIN,
-		     CFG_PNO_SCAN_TIMER_REPEAT_VALUE_MAX),
-
-	REG_VARIABLE(CFG_PNO_SLOW_SCAN_MULTIPLIER, WLAN_PARAM_Integer,
-		     struct hdd_config, pno_slow_scan_multiplier,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PNO_SLOW_SCAN_MULTIPLIER_DEFAULT,
-		     CFG_PNO_SLOW_SCAN_MULTIPLIER_MIN,
-		     CFG_PNO_SLOW_SCAN_MULTIPLIER_MAX),
-#endif
-	REG_VARIABLE(CFG_AMSDU_SUPPORT_IN_AMPDU_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, isAmsduSupportInAMPDU,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_AMSDU_SUPPORT_IN_AMPDU_DEFAULT,
-		     CFG_AMSDU_SUPPORT_IN_AMPDU_MIN,
-		     CFG_AMSDU_SUPPORT_IN_AMPDU_MAX),
-
-	REG_VARIABLE(CFG_STRICT_5GHZ_PREF_BY_MARGIN, WLAN_PARAM_Integer,
-		     struct hdd_config, nSelect5GHzMargin,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_STRICT_5GHZ_PREF_BY_MARGIN_DEFAULT,
-		     CFG_STRICT_5GHZ_PREF_BY_MARGIN_MIN,
-		     CFG_STRICT_5GHZ_PREF_BY_MARGIN_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_ip_tcp_udp_checksum_offload,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD_DEFAULT,
-		     CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD_DISABLE,
-		     CFG_ENABLE_IP_TCP_UDP_CHKSUM_OFFLOAD_ENABLE),
-
-	REG_VARIABLE(CFG_POWERSAVE_OFFLOAD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enablePowersaveOffload,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_POWERSAVE_OFFLOAD_DEFAULT,
-		     CFG_POWERSAVE_OFFLOAD_MIN,
-		     CFG_POWERSAVE_OFFLOAD_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_FW_UART_PRINT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enablefwprint,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_FW_UART_PRINT_DEFAULT,
-		     CFG_ENABLE_FW_UART_PRINT_DISABLE,
-		     CFG_ENABLE_FW_UART_PRINT_ENABLE),
-
-	REG_VARIABLE(CFG_ENABLE_FW_LOG_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enablefwlog,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_FW_LOG_DEFAULT,
-		     CFG_ENABLE_FW_LOG_DISABLE,
-		     CFG_ENABLE_FW_LOG_ENABLE),
-
-#ifdef IPA_OFFLOAD
-	REG_VARIABLE(CFG_IPA_OFFLOAD_CONFIG_NAME, WLAN_PARAM_HexInteger,
-		     struct hdd_config, IpaConfig,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IPA_OFFLOAD_CONFIG_DEFAULT,
-		     CFG_IPA_OFFLOAD_CONFIG_MIN,
-		     CFG_IPA_OFFLOAD_CONFIG_MAX),
-
-	REG_VARIABLE(CFG_IPA_DESC_SIZE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaDescSize,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IPA_DESC_SIZE_DEFAULT,
-		     CFG_IPA_DESC_SIZE_MIN,
-		     CFG_IPA_DESC_SIZE_MAX),
-
-	REG_VARIABLE(CFG_IPA_HIGH_BANDWIDTH_MBPS, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaHighBandwidthMbps,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IPA_HIGH_BANDWIDTH_MBPS_DEFAULT,
-		     CFG_IPA_HIGH_BANDWIDTH_MBPS_MIN,
-		     CFG_IPA_HIGH_BANDWIDTH_MBPS_MAX),
-
-	REG_VARIABLE(CFG_IPA_MEDIUM_BANDWIDTH_MBPS, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaMediumBandwidthMbps,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IPA_MEDIUM_BANDWIDTH_MBPS_DEFAULT,
-		     CFG_IPA_MEDIUM_BANDWIDTH_MBPS_MIN,
-		     CFG_IPA_MEDIUM_BANDWIDTH_MBPS_MAX),
-
-	REG_VARIABLE(CFG_IPA_LOW_BANDWIDTH_MBPS, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaLowBandwidthMbps,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IPA_LOW_BANDWIDTH_MBPS_DEFAULT,
-		     CFG_IPA_LOW_BANDWIDTH_MBPS_MIN,
-		     CFG_IPA_LOW_BANDWIDTH_MBPS_MAX),
-#endif
-
-#ifdef WLAN_FEATURE_11AC
-	REG_VARIABLE(CFG_VHT_AMPDU_LEN_EXPONENT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fVhtAmpduLenExponent,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_VHT_AMPDU_LEN_EXPONENT_DEFAULT,
-		     CFG_VHT_AMPDU_LEN_EXPONENT_MIN,
-		     CFG_VHT_AMPDU_LEN_EXPONENT_MAX),
-
-	REG_VARIABLE(CFG_VHT_MPDU_LEN_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, vhtMpduLen,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_VHT_MPDU_LEN_DEFAULT,
-		     CFG_VHT_MPDU_LEN_MIN,
-		     CFG_VHT_MPDU_LEN_MAX),
-#endif
-
-	REG_VARIABLE(CFG_MAX_WOW_FILTERS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, maxWoWFilters,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_MAX_WOW_FILTERS_DEFAULT,
-		     CFG_MAX_WOW_FILTERS_MIN,
-		     CFG_MAX_WOW_FILTERS_MAX),
-
-	REG_VARIABLE(CFG_WOW_STATUS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, wowEnable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_WOW_STATUS_DEFAULT,
-		     CFG_WOW_ENABLE_MIN,
-		     CFG_WOW_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_COALESING_IN_IBSS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, isCoalesingInIBSSAllowed,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_COALESING_IN_IBSS_DEFAULT,
-		     CFG_COALESING_IN_IBSS_MIN,
-		     CFG_COALESING_IN_IBSS_MAX),
-
-	REG_VARIABLE(CFG_IBSS_ATIM_WIN_SIZE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ibssATIMWinSize,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_ATIM_WIN_SIZE_DEFAULT,
-		     CFG_IBSS_ATIM_WIN_SIZE_MIN,
-		     CFG_IBSS_ATIM_WIN_SIZE_MAX),
-
-	REG_VARIABLE(CFG_SAP_MAX_NO_PEERS, WLAN_PARAM_Integer,
-		     struct hdd_config, maxNumberOfPeers,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SAP_MAX_NO_PEERS_DEFAULT,
-		     CFG_SAP_MAX_NO_PEERS_MIN,
-		     CFG_SAP_MAX_NO_PEERS_MAX),
-
-	REG_VARIABLE(CFG_IBSS_IS_POWER_SAVE_ALLOWED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, isIbssPowerSaveAllowed,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_IS_POWER_SAVE_ALLOWED_DEFAULT,
-		     CFG_IBSS_IS_POWER_SAVE_ALLOWED_MIN,
-		     CFG_IBSS_IS_POWER_SAVE_ALLOWED_MAX),
-
-	REG_VARIABLE(CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, isIbssPowerCollapseAllowed,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_DEFAULT,
-		     CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MIN,
-		     CFG_IBSS_IS_POWER_COLLAPSE_ALLOWED_MAX),
-
-	REG_VARIABLE(CFG_IBSS_AWAKE_ON_TX_RX_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, isIbssAwakeOnTxRx,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_AWAKE_ON_TX_RX_DEFAULT,
-		     CFG_IBSS_AWAKE_ON_TX_RX_MIN,
-		     CFG_IBSS_AWAKE_ON_TX_RX_MAX),
-
-	REG_VARIABLE(CFG_IBSS_INACTIVITY_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ibssInactivityCount,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_INACTIVITY_TIME_DEFAULT,
-		     CFG_IBSS_INACTIVITY_TIME_MIN,
-		     CFG_IBSS_INACTIVITY_TIME_MAX),
-
-	REG_VARIABLE(CFG_IBSS_TXSP_END_INACTIVITY_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ibssTxSpEndInactivityTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_TXSP_END_INACTIVITY_DEFAULT,
-		     CFG_IBSS_TXSP_END_INACTIVITY_MIN,
-		     CFG_IBSS_TXSP_END_INACTIVITY_MAX),
-
-	REG_VARIABLE(CFG_IBSS_PS_WARMUP_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ibssPsWarmupTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_PS_WARMUP_TIME_DEFAULT,
-		     CFG_IBSS_PS_WARMUP_TIME_MIN,
-		     CFG_IBSS_PS_WARMUP_TIME_MAX),
-
-	REG_VARIABLE(CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, ibssPs1RxChainInAtimEnable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_DEFAULT,
-		     CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MIN,
-		     CFG_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MIN_LEVEL0_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMinLevel0,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL0_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL0_MIN,
-		     CFG_THERMAL_TEMP_MIN_LEVEL0_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MAX_LEVEL0_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMaxLevel0,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL0_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL0_MIN,
-		     CFG_THERMAL_TEMP_MAX_LEVEL0_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MIN_LEVEL1_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMinLevel1,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL1_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL1_MIN,
-		     CFG_THERMAL_TEMP_MIN_LEVEL1_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MAX_LEVEL1_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMaxLevel1,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL1_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL1_MIN,
-		     CFG_THERMAL_TEMP_MAX_LEVEL1_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MIN_LEVEL2_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMinLevel2,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL2_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL2_MIN,
-		     CFG_THERMAL_TEMP_MIN_LEVEL2_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MAX_LEVEL2_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMaxLevel2,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL2_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL2_MIN,
-		     CFG_THERMAL_TEMP_MAX_LEVEL2_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MIN_LEVEL3_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMinLevel3,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL3_DEFAULT,
-		     CFG_THERMAL_TEMP_MIN_LEVEL3_MIN,
-		     CFG_THERMAL_TEMP_MIN_LEVEL3_MAX),
-
-	REG_VARIABLE(CFG_THERMAL_TEMP_MAX_LEVEL3_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, thermalTempMaxLevel3,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL3_DEFAULT,
-		     CFG_THERMAL_TEMP_MAX_LEVEL3_MIN,
-		     CFG_THERMAL_TEMP_MAX_LEVEL3_MAX),
-
-	REG_VARIABLE(CFG_SET_TXPOWER_LIMIT2G_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, TxPower2g,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SET_TXPOWER_LIMIT2G_DEFAULT,
-		     CFG_SET_TXPOWER_LIMIT2G_MIN,
-		     CFG_SET_TXPOWER_LIMIT2G_MAX),
-
-	REG_VARIABLE(CFG_SET_TXPOWER_LIMIT5G_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, TxPower5g,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SET_TXPOWER_LIMIT5G_DEFAULT,
-		     CFG_SET_TXPOWER_LIMIT5G_MIN,
-		     CFG_SET_TXPOWER_LIMIT5G_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_DEBUG_CONNECT_ISSUE, WLAN_PARAM_Integer,
-		     struct hdd_config, gEnableDebugLog,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_DEBUG_CONNECT_ISSUE_DEFAULT,
-		     CFG_ENABLE_DEBUG_CONNECT_ISSUE_MIN,
-		     CFG_ENABLE_DEBUG_CONNECT_ISSUE_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_RX_THREAD, WLAN_PARAM_Integer,
-		     struct hdd_config, enableRxThread,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_RX_THREAD_DEFAULT,
-		     CFG_ENABLE_RX_THREAD_MIN,
-		     CFG_ENABLE_RX_THREAD_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, fDfsPhyerrFilterOffload,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_DEFAULT,
-		     CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MIN,
-		     CFG_ENABLE_DFS_PHYERR_FILTEROFFLOAD_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_OVERLAP_CH, WLAN_PARAM_Integer,
-		     struct hdd_config, gEnableOverLapCh,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_OVERLAP_CH_DEFAULT,
-		     CFG_ENABLE_OVERLAP_CH_MIN,
-		     CFG_ENABLE_OVERLAP_CH_MAX),
-
-	REG_VARIABLE(CFG_REG_CHANGE_DEF_COUNTRY_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, fRegChangeDefCountry,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_REG_CHANGE_DEF_COUNTRY_DEFAULT,
-		     CFG_REG_CHANGE_DEF_COUNTRY_MIN,
-		     CFG_REG_CHANGE_DEF_COUNTRY_MAX),
-
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-	REG_VARIABLE(CFG_LL_TX_FLOW_LWM, WLAN_PARAM_Integer,
-		     struct hdd_config, TxFlowLowWaterMark,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_FLOW_LWM_DEFAULT,
-		     CFG_LL_TX_FLOW_LWM_MIN,
-		     CFG_LL_TX_FLOW_LWM_MAX),
-	REG_VARIABLE(CFG_LL_TX_FLOW_HWM_OFFSET, WLAN_PARAM_Integer,
-		     struct hdd_config, TxFlowHighWaterMarkOffset,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_FLOW_HWM_OFFSET_DEFAULT,
-		     CFG_LL_TX_FLOW_HWM_OFFSET_MIN,
-		     CFG_LL_TX_FLOW_HWM_OFFSET_MAX),
-	REG_VARIABLE(CFG_LL_TX_FLOW_MAX_Q_DEPTH, WLAN_PARAM_Integer,
-		     struct hdd_config, TxFlowMaxQueueDepth,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_FLOW_MAX_Q_DEPTH_DEFAULT,
-		     CFG_LL_TX_FLOW_MAX_Q_DEPTH_MIN,
-		     CFG_LL_TX_FLOW_MAX_Q_DEPTH_MAX),
-	REG_VARIABLE(CFG_LL_TX_LBW_FLOW_LWM, WLAN_PARAM_Integer,
-		     struct hdd_config, TxLbwFlowLowWaterMark,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_LBW_FLOW_LWM_DEFAULT,
-		     CFG_LL_TX_LBW_FLOW_LWM_MIN,
-		     CFG_LL_TX_LBW_FLOW_LWM_MAX),
-
-	REG_VARIABLE(CFG_LL_TX_LBW_FLOW_HWM_OFFSET, WLAN_PARAM_Integer,
-		     struct hdd_config, TxLbwFlowHighWaterMarkOffset,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_LBW_FLOW_HWM_OFFSET_DEFAULT,
-		     CFG_LL_TX_LBW_FLOW_HWM_OFFSET_MIN,
-		     CFG_LL_TX_LBW_FLOW_HWM_OFFSET_MAX),
-
-	REG_VARIABLE(CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH, WLAN_PARAM_Integer,
-		     struct hdd_config, TxLbwFlowMaxQueueDepth,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH_DEFAULT,
-		     CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH_MIN,
-		     CFG_LL_TX_LBW_FLOW_MAX_Q_DEPTH_MAX),
-
-	REG_VARIABLE(CFG_LL_TX_HBW_FLOW_LWM, WLAN_PARAM_Integer,
-		     struct hdd_config, TxHbwFlowLowWaterMark,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_HBW_FLOW_LWM_DEFAULT,
-		     CFG_LL_TX_HBW_FLOW_LWM_MIN,
-		     CFG_LL_TX_HBW_FLOW_LWM_MAX),
-
-	REG_VARIABLE(CFG_LL_TX_HBW_FLOW_HWM_OFFSET, WLAN_PARAM_Integer,
-		     struct hdd_config, TxHbwFlowHighWaterMarkOffset,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_HBW_FLOW_HWM_OFFSET_DEFAULT,
-		     CFG_LL_TX_HBW_FLOW_HWM_OFFSET_MIN,
-		     CFG_LL_TX_HBW_FLOW_HWM_OFFSET_MAX),
-
-	REG_VARIABLE(CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH, WLAN_PARAM_Integer,
-		     struct hdd_config, TxHbwFlowMaxQueueDepth,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH_DEFAULT,
-		     CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH_MIN,
-		     CFG_LL_TX_HBW_FLOW_MAX_Q_DEPTH_MAX),
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-#ifdef QCA_LL_TX_FLOW_CONTROL_V2
-
-	REG_VARIABLE(CFG_LL_TX_FLOW_STOP_QUEUE_TH, WLAN_PARAM_Integer,
-		     struct hdd_config, TxFlowStopQueueThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_FLOW_STOP_QUEUE_TH_DEFAULT,
-		     CFG_LL_TX_FLOW_STOP_QUEUE_TH_MIN,
-		     CFG_LL_TX_FLOW_STOP_QUEUE_TH_MAX),
-
-	REG_VARIABLE(CFG_LL_TX_FLOW_START_QUEUE_OFFSET, WLAN_PARAM_Integer,
-		     struct hdd_config, TxFlowStartQueueOffset,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LL_TX_FLOW_START_QUEUE_OFFSET_DEFAULT,
-		     CFG_LL_TX_FLOW_START_QUEUE_OFFSET_MIN,
-		     CFG_LL_TX_FLOW_START_QUEUE_OFFSET_MAX),
-
-#endif
-	REG_VARIABLE(CFG_INITIAL_DWELL_TIME_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nInitialDwellTime,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_INITIAL_DWELL_TIME_DEFAULT,
-		     CFG_INITIAL_DWELL_TIME_MIN,
-		     CFG_INITIAL_DWELL_TIME_MAX),
-
-	REG_VARIABLE(CFG_INITIAL_SCAN_NO_DFS_CHNL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, initial_scan_no_dfs_chnl,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_INITIAL_SCAN_NO_DFS_CHNL_DEFAULT,
-		     CFG_INITIAL_SCAN_NO_DFS_CHNL_MIN,
-		     CFG_INITIAL_SCAN_NO_DFS_CHNL_MAX),
-
-	REG_VARIABLE(CFG_SAP_MAX_OFFLOAD_PEERS, WLAN_PARAM_Integer,
-		     struct hdd_config, apMaxOffloadPeers,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SAP_MAX_OFFLOAD_PEERS_DEFAULT,
-		     CFG_SAP_MAX_OFFLOAD_PEERS_MIN,
-		     CFG_SAP_MAX_OFFLOAD_PEERS_MAX),
-
-	REG_VARIABLE(CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS, WLAN_PARAM_Integer,
-		     struct hdd_config, apMaxOffloadReorderBuffs,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_DEFAULT,
-		     CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_MIN,
-		     CFG_SAP_MAX_OFFLOAD_REORDER_BUFFS_MAX),
-
-	REG_VARIABLE(CFG_ADVERTISE_CONCURRENT_OPERATION_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, advertiseConcurrentOperation,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_ADVERTISE_CONCURRENT_OPERATION_DEFAULT,
-		     CFG_ADVERTISE_CONCURRENT_OPERATION_MIN,
-		     CFG_ADVERTISE_CONCURRENT_OPERATION_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_MEMORY_DEEP_SLEEP, WLAN_PARAM_Integer,
-		     struct hdd_config, enableMemDeepSleep,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_MEMORY_DEEP_SLEEP_DEFAULT,
-		     CFG_ENABLE_MEMORY_DEEP_SLEEP_MIN,
-		     CFG_ENABLE_MEMORY_DEEP_SLEEP_MAX),
-
-	REG_VARIABLE(CFG_DEFAULT_RATE_INDEX_24GH, WLAN_PARAM_Integer,
-		     struct hdd_config, defaultRateIndex24Ghz,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DEFAULT_RATE_INDEX_24GH_DEFAULT,
-		     CFG_DEFAULT_RATE_INDEX_24GH_MIN,
-		     CFG_DEFAULT_RATE_INDEX_24GH_MAX),
-
-#ifdef MEMORY_DEBUG
-	REG_VARIABLE(CFG_ENABLE_MEMORY_DEBUG_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IsMemoryDebugSupportEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_MEMORY_DEBUG_DEFAULT,
-		     CFG_ENABLE_MEMORY_DEBUG_MIN,
-		     CFG_ENABLE_MEMORY_DEBUG_MAX),
-#endif
-
-	REG_VARIABLE(CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, debugP2pRemainOnChannel,
-		     VAR_FLAGS_OPTIONAL,
-		     CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_DEFAULT,
-		     CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_MIN,
-		     CFG_DEBUG_P2P_REMAIN_ON_CHANNEL_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_PACKET_LOG, WLAN_PARAM_Integer,
-		     struct hdd_config, enablePacketLog,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_PACKET_LOG_DEFAULT,
-		     CFG_ENABLE_PACKET_LOG_MIN,
-		     CFG_ENABLE_PACKET_LOG_MAX),
-
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	REG_VARIABLE(CFG_ROAMING_OFFLOAD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, isRoamOffloadEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ROAMING_OFFLOAD_DEFAULT,
-		     CFG_ROAMING_OFFLOAD_MIN,
-		     CFG_ROAMING_OFFLOAD_MAX),
-#endif
-#ifdef MSM_PLATFORM
-	REG_VARIABLE(CFG_BUS_BANDWIDTH_HIGH_THRESHOLD, WLAN_PARAM_Integer,
-		     struct hdd_config, busBandwidthHighThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BUS_BANDWIDTH_HIGH_THRESHOLD_DEFAULT,
-		     CFG_BUS_BANDWIDTH_HIGH_THRESHOLD_MIN,
-		     CFG_BUS_BANDWIDTH_HIGH_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD, WLAN_PARAM_Integer,
-		     struct hdd_config, busBandwidthMediumThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD_DEFAULT,
-		     CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD_MIN,
-		     CFG_BUS_BANDWIDTH_MEDIUM_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_BUS_BANDWIDTH_LOW_THRESHOLD, WLAN_PARAM_Integer,
-		     struct hdd_config, busBandwidthLowThreshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BUS_BANDWIDTH_LOW_THRESHOLD_DEFAULT,
-		     CFG_BUS_BANDWIDTH_LOW_THRESHOLD_MIN,
-		     CFG_BUS_BANDWIDTH_LOW_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL, WLAN_PARAM_Integer,
-		     struct hdd_config, busBandwidthComputeInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_DEFAULT,
-		     CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MIN,
-		     CFG_BUS_BANDWIDTH_COMPUTE_INTERVAL_MAX),
-	REG_VARIABLE(CFG_TCP_DELACK_THRESHOLD_HIGH, WLAN_PARAM_Integer,
-		     struct hdd_config, tcpDelackThresholdHigh,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TCP_DELACK_THRESHOLD_HIGH_DEFAULT,
-		     CFG_TCP_DELACK_THRESHOLD_HIGH_MIN,
-		     CFG_TCP_DELACK_THRESHOLD_HIGH_MAX),
-	REG_VARIABLE(CFG_TCP_DELACK_THRESHOLD_LOW, WLAN_PARAM_Integer,
-		     struct hdd_config, tcpDelackThresholdLow,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TCP_DELACK_THRESHOLD_LOW_DEFAULT,
-		     CFG_TCP_DELACK_THRESHOLD_LOW_MIN,
-		     CFG_TCP_DELACK_THRESHOLD_LOW_MAX),
-
-	REG_VARIABLE(CFG_TCP_TX_HIGH_TPUT_THRESHOLD_NAME, WLAN_PARAM_Integer,
-		struct hdd_config, tcp_tx_high_tput_thres,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_DEFAULT,
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MIN,
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_MAX),
-
-#endif
-
-	REG_VARIABLE(CFG_ENABLE_FW_LOG_TYPE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableFwLogType,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_FW_LOG_TYPE_DEFAULT,
-		     CFG_ENABLE_FW_LOG_TYPE_MIN,
-		     CFG_ENABLE_FW_LOG_TYPE_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_FW_DEBUG_LOG_LEVEL, WLAN_PARAM_Integer,
-		     struct hdd_config, enableFwLogLevel,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_FW_DEBUG_LOG_LEVEL_DEFAULT,
-		     CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MIN,
-		     CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MAX),
-
-	REG_VARIABLE_STRING(CFG_ENABLE_FW_MODULE_LOG_LEVEL, WLAN_PARAM_String,
-			    struct hdd_config, enableFwModuleLogLevel,
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_ENABLE_FW_MODULE_LOG_DEFAULT),
-
-#ifdef WLAN_FEATURE_11W
-	REG_VARIABLE(CFG_PMF_SA_QUERY_MAX_RETRIES_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, pmfSaQueryMaxRetries,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PMF_SA_QUERY_MAX_RETRIES_DEFAULT,
-		     CFG_PMF_SA_QUERY_MAX_RETRIES_MIN,
-		     CFG_PMF_SA_QUERY_MAX_RETRIES_MAX),
-
-	REG_VARIABLE(CFG_PMF_SA_QUERY_RETRY_INTERVAL_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, pmfSaQueryRetryInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PMF_SA_QUERY_RETRY_INTERVAL_DEFAULT,
-		     CFG_PMF_SA_QUERY_RETRY_INTERVAL_MIN,
-		     CFG_PMF_SA_QUERY_RETRY_INTERVAL_MAX),
-#endif
-	REG_VARIABLE(CFG_MAX_CONCURRENT_CONNECTIONS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, gMaxConcurrentActiveSessions,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MAX_CONCURRENT_CONNECTIONS_DEFAULT,
-		     CFG_MAX_CONCURRENT_CONNECTIONS_MIN,
-		     CFG_MAX_CONCURRENT_CONNECTIONS_MAX),
-
-#ifdef FEATURE_GREEN_AP
-	REG_VARIABLE(CFG_ENABLE_GREEN_AP_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enableGreenAP,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_GREEN_AP_FEATURE_DEFAULT,
-		     CFG_ENABLE_GREEN_AP_FEATURE_MIN,
-		     CFG_ENABLE_GREEN_AP_FEATURE_MAX),
-	REG_VARIABLE(CFG_ENABLE_EGAP_ENABLE_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_egap,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_EGAP_ENABLE_FEATURE_DEFAULT,
-		     CFG_ENABLE_EGAP_ENABLE_FEATURE_MIN,
-		     CFG_ENABLE_EGAP_ENABLE_FEATURE_MAX),
-	REG_VARIABLE(CFG_ENABLE_EGAP_INACT_TIME_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, egap_inact_time,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_EGAP_INACT_TIME_FEATURE_DEFAULT,
-		     CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MIN,
-		     CFG_ENABLE_EGAP_INACT_TIME_FEATURE_MAX),
-	REG_VARIABLE(CFG_ENABLE_EGAP_WAIT_TIME_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, egap_wait_time,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_DEFAULT,
-		     CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MIN,
-		     CFG_ENABLE_EGAP_WAIT_TIME_FEATURE_MAX),
-	REG_VARIABLE(CFG_ENABLE_EGAP_FLAGS_FEATURE, WLAN_PARAM_Integer,
-		     struct hdd_config, egap_feature_flag,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_EGAP_FLAGS_FEATURE_DEFAULT,
-		     CFG_ENABLE_EGAP_FLAGS_FEATURE_MIN,
-		     CFG_ENABLE_EGAP_FLAGS_FEATURE_MAX),
-#endif
-
-	REG_VARIABLE(CFG_IGNORE_CAC_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ignoreCAC,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_IGNORE_CAC_DEFAULT,
-		     CFG_IGNORE_CAC_MIN,
-		     CFG_IGNORE_CAC_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IsSapDfsChSifsBurstEnabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_DEFAULT,
-		     CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_MIN,
-		     CFG_ENABLE_SAP_DFS_CH_SIFS_BURST_MAX),
-
-	REG_VARIABLE(CFG_DFS_RADAR_PRI_MULTIPLIER_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, dfsRadarPriMultiplier,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DFS_RADAR_PRI_MULTIPLIER_DEFAULT,
-		     CFG_DFS_RADAR_PRI_MULTIPLIER_MIN,
-		     CFG_DFS_RADAR_PRI_MULTIPLIER_MAX),
-
-	REG_VARIABLE(CFG_REORDER_OFFLOAD_SUPPORT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, reorderOffloadSupport,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_REORDER_OFFLOAD_SUPPORT_DEFAULT,
-		     CFG_REORDER_OFFLOAD_SUPPORT_MIN,
-		     CFG_REORDER_OFFLOAD_SUPPORT_MAX),
-
-	REG_VARIABLE(CFG_IPA_UC_TX_BUF_COUNT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaUcTxBufCount,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_IPA_UC_TX_BUF_COUNT_DEFAULT,
-		     CFG_IPA_UC_TX_BUF_COUNT_MIN,
-		     CFG_IPA_UC_TX_BUF_COUNT_MAX),
-
-	REG_VARIABLE(CFG_IPA_UC_TX_BUF_SIZE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaUcTxBufSize,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_IPA_UC_TX_BUF_SIZE_DEFAULT,
-		     CFG_IPA_UC_TX_BUF_SIZE_MIN,
-		     CFG_IPA_UC_TX_BUF_SIZE_MAX),
-
-	REG_VARIABLE(CFG_IPA_UC_RX_IND_RING_COUNT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaUcRxIndRingCount,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_IPA_UC_RX_IND_RING_COUNT_DEFAULT,
-		     CFG_IPA_UC_RX_IND_RING_COUNT_MIN,
-		     CFG_IPA_UC_RX_IND_RING_COUNT_MAX),
-
-	REG_VARIABLE(CFG_IPA_UC_TX_PARTITION_BASE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, IpaUcTxPartitionBase,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_IPA_UC_TX_PARTITION_BASE_DEFAULT,
-		     CFG_IPA_UC_TX_PARTITION_BASE_MIN,
-		     CFG_IPA_UC_TX_PARTITION_BASE_MAX),
-#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-	REG_VARIABLE(CFG_WLAN_LOGGING_SUPPORT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, wlanLoggingEnable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_WLAN_LOGGING_SUPPORT_DEFAULT,
-		     CFG_WLAN_LOGGING_SUPPORT_DISABLE,
-		     CFG_WLAN_LOGGING_SUPPORT_ENABLE),
-
-	REG_VARIABLE(CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, wlanLoggingFEToConsole,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_DEFAULT,
-		     CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_DISABLE,
-		     CFG_WLAN_LOGGING_FE_CONSOLE_SUPPORT_ENABLE),
-
-	REG_VARIABLE(CFG_WLAN_LOGGING_NUM_BUF_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, wlanLoggingNumBuf,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_WLAN_LOGGING_NUM_BUF_DEFAULT,
-		     CFG_WLAN_LOGGING_NUM_BUF_MIN,
-		     CFG_WLAN_LOGGING_NUM_BUF_MAX),
-#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */
-
-	REG_VARIABLE(CFG_ENABLE_SIFS_BURST, WLAN_PARAM_Integer,
-		     struct hdd_config, enableSifsBurst,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_SIFS_BURST_DEFAULT,
-		     CFG_ENABLE_SIFS_BURST_MIN,
-		     CFG_ENABLE_SIFS_BURST_MAX),
-
-#ifdef WLAN_FEATURE_LPSS
-	REG_VARIABLE(CFG_ENABLE_LPASS_SUPPORT, WLAN_PARAM_Integer,
-		     struct hdd_config, enablelpasssupport,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_LPASS_SUPPORT_DEFAULT,
-		     CFG_ENABLE_LPASS_SUPPORT_MIN,
-		     CFG_ENABLE_LPASS_SUPPORT_MAX),
-#endif
-
-#ifdef WLAN_FEATURE_NAN
-	REG_VARIABLE(CFG_ENABLE_NAN_SUPPORT, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_nan_support,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_NAN_SUPPORT_DEFAULT,
-		     CFG_ENABLE_NAN_SUPPORT_MIN,
-		     CFG_ENABLE_NAN_SUPPORT_MAX),
-#endif
-
-	REG_VARIABLE(CFG_ENABLE_SELF_RECOVERY, WLAN_PARAM_Integer,
-		     struct hdd_config, enableSelfRecovery,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_SELF_RECOVERY_DEFAULT,
-		     CFG_ENABLE_SELF_RECOVERY_MIN,
-		     CFG_ENABLE_SELF_RECOVERY_MAX),
-
-#ifdef FEATURE_WLAN_FORCE_SAP_SCC
-	REG_VARIABLE(CFG_SAP_SCC_CHAN_AVOIDANCE, WLAN_PARAM_Integer,
-		     struct hdd_config, SapSccChanAvoidance,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SAP_SCC_CHAN_AVOIDANCE_DEFAULT,
-		     CFG_SAP_SCC_CHAN_AVOIDANCE_MIN,
-		     CFG_SAP_SCC_CHAN_AVOIDANCE_MAX),
-#endif /* FEATURE_WLAN_FORCE_SAP_SCC */
-
-	REG_VARIABLE(CFG_ENABLE_SAP_SUSPEND, WLAN_PARAM_Integer,
-		     struct hdd_config, enableSapSuspend,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_SAP_SUSPEND_DEFAULT,
-		     CFG_ENABLE_SAP_SUSPEND_MIN,
-		     CFG_ENABLE_SAP_SUSPEND_MAX),
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-	REG_VARIABLE(CFG_EXTWOW_GO_TO_SUSPEND, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowGotoSuspend,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_GO_TO_SUSPEND_DEFAULT,
-		     CFG_EXTWOW_GO_TO_SUSPEND_MIN,
-		     CFG_EXTWOW_GO_TO_SUSPEND_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_APP1_WAKE_PIN_NUMBER, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp1WakeupPinNumber,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_APP1_WAKE_PIN_NUMBER_DEFAULT,
-		     CFG_EXTWOW_APP1_WAKE_PIN_NUMBER_MIN,
-		     CFG_EXTWOW_APP1_WAKE_PIN_NUMBER_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_APP2_WAKE_PIN_NUMBER, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2WakeupPinNumber,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_APP2_WAKE_PIN_NUMBER_DEFAULT,
-		     CFG_EXTWOW_APP2_WAKE_PIN_NUMBER_MIN,
-		     CFG_EXTWOW_APP2_WAKE_PIN_NUMBER_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_KA_INIT_PING_INTERVAL, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2KAInitPingInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_KA_INIT_PING_INTERVAL_DEFAULT,
-		     CFG_EXTWOW_KA_INIT_PING_INTERVAL_MIN,
-		     CFG_EXTWOW_KA_INIT_PING_INTERVAL_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_KA_MIN_PING_INTERVAL, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2KAMinPingInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_KA_MIN_PING_INTERVAL_DEFAULT,
-		     CFG_EXTWOW_KA_MIN_PING_INTERVAL_MIN,
-		     CFG_EXTWOW_KA_MIN_PING_INTERVAL_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_KA_MAX_PING_INTERVAL, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2KAMaxPingInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_KA_MAX_PING_INTERVAL_DEFAULT,
-		     CFG_EXTWOW_KA_MAX_PING_INTERVAL_MIN,
-		     CFG_EXTWOW_KA_MAX_PING_INTERVAL_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_KA_INC_PING_INTERVAL, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2KAIncPingInterval,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_KA_INC_PING_INTERVAL_DEFAULT,
-		     CFG_EXTWOW_KA_INC_PING_INTERVAL_MIN,
-		     CFG_EXTWOW_KA_INC_PING_INTERVAL_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_TCP_SRC_PORT, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2TcpSrcPort,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_TCP_SRC_PORT_DEFAULT,
-		     CFG_EXTWOW_TCP_SRC_PORT_MIN,
-		     CFG_EXTWOW_TCP_SRC_PORT_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_TCP_DST_PORT, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2TcpDstPort,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_TCP_DST_PORT_DEFAULT,
-		     CFG_EXTWOW_TCP_DST_PORT_MIN,
-		     CFG_EXTWOW_TCP_DST_PORT_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_TCP_TX_TIMEOUT, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2TcpTxTimeout,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_TCP_TX_TIMEOUT_DEFAULT,
-		     CFG_EXTWOW_TCP_TX_TIMEOUT_MIN,
-		     CFG_EXTWOW_TCP_TX_TIMEOUT_MAX),
-
-	REG_VARIABLE(CFG_EXTWOW_TCP_RX_TIMEOUT, WLAN_PARAM_Integer,
-		     struct hdd_config, extWowApp2TcpRxTimeout,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTWOW_TCP_RX_TIMEOUT_DEFAULT,
-		     CFG_EXTWOW_TCP_RX_TIMEOUT_MIN,
-		     CFG_EXTWOW_TCP_RX_TIMEOUT_MAX),
-#endif
-	REG_VARIABLE(CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, gEnableDeauthToDisassocMap,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_DEFAULT,
-		     CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_MIN,
-		     CFG_ENABLE_DEAUTH_TO_DISASSOC_MAP_MAX),
-#ifdef DHCP_SERVER_OFFLOAD
-	REG_VARIABLE(CFG_DHCP_SERVER_OFFLOAD_SUPPORT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, enableDHCPServerOffload,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DHCP_SERVER_OFFLOAD_SUPPORT_DEFAULT,
-		     CFG_DHCP_SERVER_OFFLOAD_SUPPORT_MIN,
-		     CFG_DHCP_SERVER_OFFLOAD_SUPPORT_MAX),
-	REG_VARIABLE(CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, dhcpMaxNumClients,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_DEFAULT,
-		     CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_MIN,
-		     CFG_DHCP_SERVER_OFFLOAD_NUM_CLIENT_MAX),
-	REG_VARIABLE_STRING(CFG_DHCP_SERVER_IP_NAME, WLAN_PARAM_String,
-			    struct hdd_config, dhcpServerIP,
-			    VAR_FLAGS_OPTIONAL,
-			    (void *)CFG_DHCP_SERVER_IP_DEFAULT),
-#endif /* DHCP_SERVER_OFFLOAD */
-
-	REG_VARIABLE(CFG_ENABLE_DEAUTH_BEFORE_CONNECTION, WLAN_PARAM_Integer,
-		struct hdd_config, sendDeauthBeforeCon,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_DEFAULT,
-		CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_MIN,
-		CFG_ENABLE_DEAUTH_BEFORE_CONNECTION_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_MAC_ADDR_SPOOFING, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_mac_spoofing,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_MAC_ADDR_SPOOFING_DEFAULT,
-		     CFG_ENABLE_MAC_ADDR_SPOOFING_MIN,
-		     CFG_ENABLE_MAC_ADDR_SPOOFING_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_CUSTOM_CONC_RULE1_NAME,  WLAN_PARAM_Integer,
-		     struct hdd_config, conc_custom_rule1,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_DEFAULT,
-		     CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MIN,
-		     CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_CUSTOM_CONC_RULE2_NAME,  WLAN_PARAM_Integer,
-		     struct hdd_config, conc_custom_rule2,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_DEFAULT,
-		     CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MIN,
-		     CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_STA_CONNECTION_IN_5GHZ,  WLAN_PARAM_Integer,
-		     struct hdd_config, is_sta_connection_in_5gz_enabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_STA_CONNECTION_IN_5GHZ_DEFAULT,
-		     CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MIN,
-		     CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MAX),
-
-	REG_VARIABLE(CFG_STA_MIRACAST_MCC_REST_TIME_VAL, WLAN_PARAM_Integer,
-		     struct hdd_config, sta_miracast_mcc_rest_time_val,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_STA_MIRACAST_MCC_REST_TIME_VAL_DEFAULT,
-		     CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MIN,
-		     CFG_STA_MIRACAST_MCC_REST_TIME_VAL_MAX),
-
-#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-	REG_VARIABLE(CFG_SAP_MCC_CHANNEL_AVOIDANCE_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config,
-		     sap_channel_avoidance,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_SAP_MCC_CHANNEL_AVOIDANCE_DEFAULT,
-		     CFG_SAP_MCC_CHANNEL_AVOIDANCE_MIN,
-		     CFG_SAP_MCC_CHANNEL_AVOIDANCE_MAX),
-#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
-
-	REG_VARIABLE(CFG_SAP_P2P_11AC_OVERRIDE_NAME, WLAN_PARAM_Integer,
-			struct hdd_config, sap_p2p_11ac_override,
-			VAR_FLAGS_OPTIONAL |
-					VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-			CFG_SAP_P2P_11AC_OVERRIDE_DEFAULT,
-			CFG_SAP_P2P_11AC_OVERRIDE_MIN,
-			CFG_SAP_P2P_11AC_OVERRIDE_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_RAMDUMP_COLLECTION, WLAN_PARAM_Integer,
-		     struct hdd_config, is_ramdump_enabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_RAMDUMP_COLLECTION_DEFAULT,
-		     CFG_ENABLE_RAMDUMP_COLLECTION_MIN,
-		     CFG_ENABLE_RAMDUMP_COLLECTION_MAX),
-
-	REG_VARIABLE(CFG_SAP_DOT11MC, WLAN_PARAM_Integer,
-		     struct hdd_config, sap_dot11mc,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SAP_DOT11MC_DEFAULT,
-		     CFG_SAP_DOT11MC_MIN,
-		     CFG_SAP_DOT11MC_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_NON_DFS_CHAN_ON_RADAR, WLAN_PARAM_Integer,
-		     struct hdd_config, prefer_non_dfs_on_radar,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_DEFAULT,
-		     CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MIN,
-		     CFG_ENABLE_NON_DFS_CHAN_ON_RADAR_MAX),
-
-	REG_VARIABLE(CFG_MULTICAST_HOST_FW_MSGS, WLAN_PARAM_Integer,
-		     struct hdd_config, multicast_host_fw_msgs,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MULTICAST_HOST_FW_MSGS_DEFAULT,
-		     CFG_MULTICAST_HOST_FW_MSGS_MIN,
-		     CFG_MULTICAST_HOST_FW_MSGS_MAX),
-
-	REG_VARIABLE(CFG_CONC_SYSTEM_PREF, WLAN_PARAM_Integer,
-		   struct hdd_config, conc_system_pref,
-		   VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		   CFG_CONC_SYSTEM_PREF_DEFAULT,
-		   CFG_CONC_SYSTEM_PREF_MIN,
-		   CFG_CONC_SYSTEM_PREF_MAX),
-
-	REG_VARIABLE(CFG_POLICY_MNGR_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, policy_manager_enabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_POLICY_MNGR_ENABLE_DEFAULT,
-		     CFG_POLICY_MNGR_ENABLE_MIN,
-		     CFG_POLICY_MNGR_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_TSO_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, tso_enable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TSO_ENABLED_DEFAULT,
-		     CFG_TSO_ENABLED_MIN,
-		     CFG_TSO_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_LRO_ENABLED_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, lro_enable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_LRO_ENABLED_DEFAULT,
-		     CFG_LRO_ENABLED_MIN,
-		     CFG_LRO_ENABLED_MAX),
-
-	REG_VARIABLE(CFG_ACTIVE_MODE_OFFLOAD, WLAN_PARAM_Integer,
-		     struct hdd_config, active_mode_offload,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ACTIVE_MODE_OFFLOAD_DEFAULT,
-		     CFG_ACTIVE_MODE_OFFLOAD_MIN,
-		     CFG_ACTIVE_MODE_OFFLOAD_MAX),
-
-	REG_VARIABLE(CFG_FINE_TIME_MEAS_CAPABILITY, WLAN_PARAM_HexInteger,
-		struct hdd_config, fine_time_meas_cap,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_FINE_TIME_MEAS_CAPABILITY_DEFAULT,
-		CFG_FINE_TIME_MEAS_CAPABILITY_MIN,
-		CFG_FINE_TIME_MEAS_CAPABILITY_MAX),
-
-#ifdef WLAN_FEATURE_FASTPATH
-	REG_VARIABLE(CFG_ENABLE_FASTPATH, WLAN_PARAM_Integer,
-		     struct hdd_config, fastpath_enable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_FASTPATH_DEFAULT,
-		     CFG_ENABLE_FASTPATH_MIN,
-		     CFG_ENABLE_FASTPATH_MAX),
-#endif
-	REG_VARIABLE(CFG_MAX_SCAN_COUNT_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, max_scan_count,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_MAX_SCAN_COUNT_DEFAULT,
-		     CFG_MAX_SCAN_COUNT_MIN,
-		     CFG_MAX_SCAN_COUNT_MAX),
-
-	REG_VARIABLE(CFG_DOT11P_MODE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, dot11p_mode,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DOT11P_MODE_DEFAULT,
-		     CFG_DOT11P_MODE_MIN,
-		     CFG_DOT11P_MODE_MAX),
-
-#ifdef FEATURE_NAPI
-	REG_VARIABLE(CFG_NAPI_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, napi_enable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_NAPI_DEFAULT,
-		     CFG_NAPI_MIN,
-		     CFG_NAPI_MAX),
-#endif /* FEATURE_NAPI */
-
-#ifdef FEATURE_WLAN_EXTSCAN
-	REG_VARIABLE(CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, extscan_passive_max_chn_time,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_DEFAULT,
-		     CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_MIN,
-		     CFG_EXTSCAN_PASSIVE_MAX_CHANNEL_TIME_MAX),
-
-	REG_VARIABLE(CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, extscan_passive_min_chn_time,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_DEFAULT,
-		     CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_MIN,
-		     CFG_EXTSCAN_PASSIVE_MIN_CHANNEL_TIME_MAX),
-
-	REG_VARIABLE(CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, extscan_active_max_chn_time,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_DEFAULT,
-		     CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_MIN,
-		     CFG_EXTSCAN_ACTIVE_MAX_CHANNEL_TIME_MAX),
-
-	REG_VARIABLE(CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, extscan_active_min_chn_time,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_DEFAULT,
-		     CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_MIN,
-		     CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_MAX),
-#endif
-
-	REG_VARIABLE(CFG_CE_CLASSIFY_ENABLE_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, ce_classify_enabled,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_CE_CLASSIFY_ENABLE_DEFAULT,
-		     CFG_CE_CLASSIFY_ENABLE_MIN,
-		     CFG_CE_CLASSIFY_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_DUAL_MAC_FEATURE_DISABLE, WLAN_PARAM_HexInteger,
-		     struct hdd_config, dual_mac_feature_disable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_DUAL_MAC_FEATURE_DISABLE_DEFAULT,
-		     CFG_DUAL_MAC_FEATURE_DISABLE_MIN,
-		     CFG_DUAL_MAC_FEATURE_DISABLE_MAX),
-#ifdef FEATURE_WLAN_SCAN_PNO
-	REG_VARIABLE(CFG_PNO_CHANNEL_PREDICTION_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, pno_channel_prediction,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_PNO_CHANNEL_PREDICTION_DEFAULT,
-		     CFG_PNO_CHANNEL_PREDICTION_MIN,
-		     CFG_PNO_CHANNEL_PREDICTION_MAX),
-
-	REG_VARIABLE(CFG_TOP_K_NUM_OF_CHANNELS_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, top_k_num_of_channels,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TOP_K_NUM_OF_CHANNELS_DEFAULT,
-		     CFG_TOP_K_NUM_OF_CHANNELS_MIN,
-		     CFG_TOP_K_NUM_OF_CHANNELS_MAX),
-
-	REG_VARIABLE(CFG_STATIONARY_THRESHOLD_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, stationary_thresh,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_STATIONARY_THRESHOLD_DEFAULT,
-		     CFG_STATIONARY_THRESHOLD_MIN,
-		     CFG_STATIONARY_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_NAME,
-		     WLAN_PARAM_Integer,
-		     struct hdd_config, channel_prediction_full_scan,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_DEFAULT,
-		     CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_MIN,
-		     CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_MAX),
-#endif
-
-	REG_VARIABLE(CFG_TX_CHAIN_MASK_CCK, WLAN_PARAM_Integer,
-		     struct hdd_config, tx_chain_mask_cck,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TX_CHAIN_MASK_CCK_DEFAULT,
-		     CFG_TX_CHAIN_MASK_CCK_MIN,
-		     CFG_TX_CHAIN_MASK_CCK_MAX),
-
-	REG_VARIABLE(CFG_TX_CHAIN_MASK_1SS, WLAN_PARAM_Integer,
-		     struct hdd_config, tx_chain_mask_1ss,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_TX_CHAIN_MASK_1SS_DEFAULT,
-		     CFG_TX_CHAIN_MASK_1SS_MIN,
-		     CFG_TX_CHAIN_MASK_1SS_MAX),
-
-	REG_VARIABLE(CFG_SELF_GEN_FRM_PWR, WLAN_PARAM_Integer,
-		     struct hdd_config, self_gen_frm_pwr,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_SELF_GEN_FRM_PWR_DEFAULT,
-		     CFG_SELF_GEN_FRM_PWR_MIN,
-		     CFG_SELF_GEN_FRM_PWR_MAX),
-
-	REG_VARIABLE(CFG_EARLY_STOP_SCAN_ENABLE, WLAN_PARAM_Integer,
-		     struct hdd_config, early_stop_scan_enable,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EARLY_STOP_SCAN_ENABLE_DEFAULT,
-		     CFG_EARLY_STOP_SCAN_ENABLE_MIN,
-		     CFG_EARLY_STOP_SCAN_ENABLE_MAX),
-
-	REG_VARIABLE(CFG_EARLY_STOP_SCAN_MIN_THRESHOLD,
-		     WLAN_PARAM_SignedInteger, struct hdd_config,
-		     early_stop_scan_min_threshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_DEFAULT,
-		     CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_MIN,
-		     CFG_EARLY_STOP_SCAN_MIN_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_EARLY_STOP_SCAN_MAX_THRESHOLD,
-		     WLAN_PARAM_SignedInteger, struct hdd_config,
-		     early_stop_scan_max_threshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_DEFAULT,
-		     CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_MIN,
-		     CFG_EARLY_STOP_SCAN_MAX_THRESHOLD_MAX),
-
-	REG_VARIABLE(CFG_FIRST_SCAN_BUCKET_THRESHOLD_NAME,
-		     WLAN_PARAM_SignedInteger,
-		     struct hdd_config, first_scan_bucket_threshold,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_FIRST_SCAN_BUCKET_THRESHOLD_DEFAULT,
-		     CFG_FIRST_SCAN_BUCKET_THRESHOLD_MIN,
-		     CFG_FIRST_SCAN_BUCKET_THRESHOLD_MAX),
-
-#ifdef FEATURE_LFR_SUBNET_DETECTION
-	REG_VARIABLE(CFG_ENABLE_LFR_SUBNET_DETECTION, WLAN_PARAM_Integer,
-		     struct hdd_config, enable_lfr_subnet_detection,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		     CFG_ENABLE_LFR_SUBNET_DEFAULT,
-		     CFG_ENABLE_LFR_SUBNET_MIN,
-		     CFG_ENABLE_LFR_SUBNET_MAX),
-#endif
-
-	REG_VARIABLE(CFG_INFORM_BSS_RSSI_RAW_NAME, WLAN_PARAM_Integer,
-		struct hdd_config, inform_bss_rssi_raw,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_INFORM_BSS_RSSI_RAW_DEFAULT,
-		CFG_INFORM_BSS_RSSI_RAW_MIN,
-		CFG_INFORM_BSS_RSSI_RAW_MAX),
-
-#ifdef QCA_WIFI_3_0_EMU
-	REG_VARIABLE(CFG_ENABLE_M2M_LIMITATION, WLAN_PARAM_Integer,
-		struct hdd_config, enable_m2m_limitation,
-		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-		CFG_ENABLE_LFR_SUBNET_DEFAULT,
-		CFG_ENABLE_LFR_SUBNET_MIN,
-		CFG_ENABLE_LFR_SUBNET_MAX),
-#endif
-
-};
-
-
-/**
- * get_next_line() - find and locate the new line pointer
- * @str: pointer to string
- *
- * This function returns a pointer to the character after the occurence
- * of a new line character. It also modifies the original string by replacing
- * the '\n' character with the null character.
- *
- * Return: the pointer to the character at new line,
- *            or NULL if no new line character was found
- */
-static char *get_next_line(char *str)
-{
-	char c;
-
-	if (str == NULL || *str == '\0') {
-		return NULL;
-	}
-
-	c = *str;
-	while (c != '\n' && c != '\0' && c != 0xd) {
-		str = str + 1;
-		c = *str;
-	}
-
-	if (c == '\0') {
-		return NULL;
-	} else {
-		*str = '\0';
-		return str + 1;
-	}
-
-	return NULL;
-}
-
-/** look for space. Ascii values to look are
- * 0x09 == horizontal tab
- * 0x0a == Newline ("\n")
- * 0x0b == vertical tab
- * 0x0c == Newpage or feed form.
- * 0x0d == carriage return (CR or "\r")
- * Null ('\0') should not considered as space.
- */
-#define i_isspace(ch)  (((ch) >= 0x09 && (ch) <= 0x0d) || (ch) == ' ')
-
-/**
- * i_trim() - trims any leading and trailing white spaces
- * @str: pointer to string
- *
- * Return: the pointer of the string
- */
-static char *i_trim(char *str)
-{
-	char *ptr;
-
-	if (*str == '\0')
-		return str;
-
-	/* Find the first non white-space */
-	ptr = str;
-	while (i_isspace(*ptr))
-		ptr++;
-
-	if (*ptr == '\0')
-		return str;
-
-	/* This is the new start of the string */
-	str = ptr;
-
-	/* Find the last non white-space */
-	ptr += strlen(ptr) - 1;
-
-	while (ptr != str && i_isspace(*ptr))
-		ptr--;
-
-	/* Null terminate the following character */
-	ptr[1] = '\0';
-
-	return str;
-}
-
-/* Maximum length of the confgiuration name and value */
-#define CFG_VALUE_MAX_LEN 256
-#define CFG_ENTRY_MAX_LEN (32+CFG_VALUE_MAX_LEN)
-
-/**
- * hdd_cfg_get_config() - get the configuration content
- * @reg_table: pointer to configuration table
- * @cRegTableEntries: number of the configuration entries
- * @ini_struct: pointer to the hdd config knob
- * @pHddCtx: pointer to hdd context
- * @pBuf: buffer to store the configuration
- * @buflen: size of the buffer
- *
- * Return: CDF_STATUS_SUCCESS if the configuration and buffer size can carry
- *		the content, otherwise CDF_STATUS_E_RESOURCES
- */
-static CDF_STATUS hdd_cfg_get_config(REG_TABLE_ENTRY *reg_table,
-				     unsigned long cRegTableEntries,
-				     uint8_t *ini_struct,
-				     hdd_context_t *pHddCtx, char *pBuf,
-				     int buflen)
-{
-	unsigned int idx;
-	REG_TABLE_ENTRY *pRegEntry = reg_table;
-	uint32_t value;
-	char valueStr[CFG_VALUE_MAX_LEN];
-	char configStr[CFG_ENTRY_MAX_LEN];
-	char *fmt;
-	void *pField;
-	struct cdf_mac_addr *pMacAddr;
-	char *pCur = pBuf;
-	int curlen;
-
-	/* start with an empty string */
-	*pCur = '\0';
-
-	for (idx = 0; idx < cRegTableEntries; idx++, pRegEntry++) {
-		pField = ini_struct + pRegEntry->VarOffset;
-
-		if ((WLAN_PARAM_Integer == pRegEntry->RegType) ||
-		    (WLAN_PARAM_SignedInteger == pRegEntry->RegType) ||
-		    (WLAN_PARAM_HexInteger == pRegEntry->RegType)) {
-			value = 0;
-			memcpy(&value, pField, pRegEntry->VarSize);
-			if (WLAN_PARAM_HexInteger == pRegEntry->RegType) {
-				fmt = "%x";
-			} else if (WLAN_PARAM_SignedInteger ==
-				   pRegEntry->RegType) {
-				fmt = "%d";
-			} else {
-				fmt = "%u";
-			}
-			snprintf(valueStr, CFG_VALUE_MAX_LEN, fmt, value);
-		} else if (WLAN_PARAM_String == pRegEntry->RegType) {
-			snprintf(valueStr, CFG_VALUE_MAX_LEN, "%s",
-				 (char *)pField);
-		} else if (WLAN_PARAM_MacAddr == pRegEntry->RegType) {
-			pMacAddr = (struct cdf_mac_addr *) pField;
-			snprintf(valueStr, CFG_VALUE_MAX_LEN,
-				 "%02x:%02x:%02x:%02x:%02x:%02x",
-				 pMacAddr->bytes[0],
-				 pMacAddr->bytes[1],
-				 pMacAddr->bytes[2],
-				 pMacAddr->bytes[3],
-				 pMacAddr->bytes[4], pMacAddr->bytes[5]);
-		} else {
-			snprintf(valueStr, CFG_VALUE_MAX_LEN, "(unhandled)");
-		}
-		curlen = scnprintf(configStr, CFG_ENTRY_MAX_LEN,
-				   "%s=[%s]%s\n",
-				   pRegEntry->RegName,
-				   valueStr,
-				   test_bit(idx,
-					    (void *)&pHddCtx->config->
-					    bExplicitCfg) ? "*" : "");
-
-		/* Ideally we want to return the config to the application,
-		 * however the config is too big so we just printk() for now
-		 */
-#ifdef RETURN_IN_BUFFER
-		if (curlen <= buflen) {
-			/* copy string + '\0' */
-			memcpy(pCur, configStr, curlen + 1);
-
-			/* account for addition; */
-			pCur += curlen;
-			buflen -= curlen;
-		} else {
-			/* buffer space exhausted, return what we have */
-			return CDF_STATUS_E_RESOURCES;
-		}
-#else
-		printk(KERN_INFO "%s", configStr);
-#endif /* RETURN_IN_BUFFER */
-
-	}
-
-#ifndef RETURN_IN_BUFFER
-	/* notify application that output is in system log */
-	snprintf(pCur, buflen, "WLAN configuration written to system log");
-#endif /* RETURN_IN_BUFFER */
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/** struct tCfgIniEntry - ini configuration entry
- *
- * @name: name of the entry
- * @value: value of the entry
- */
-typedef struct {
-	char *name;
-	char *value;
-} tCfgIniEntry;
-
-/**
- * find_cfg_item() - find the configuration item
- * @iniTable: pointer to configuration table
- * @entries: number fo the configuration entries
- * @name: the interested configuration to find
- * @value: the value to read back
- *
- * Return: CDF_STATUS_SUCCESS if the interested configuration is found,
- *		otherwise CDF_STATUS_E_FAILURE
- */
-static CDF_STATUS find_cfg_item(tCfgIniEntry *iniTable, unsigned long entries,
-				char *name, char **value)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	unsigned long i;
-
-	for (i = 0; i < entries; i++) {
-		if (strcmp(iniTable[i].name, name) == 0) {
-			*value = iniTable[i].value;
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-				  "Found %s entry for Name=[%s] Value=[%s] ",
-				  WLAN_INI_FILE, name, *value);
-			return CDF_STATUS_SUCCESS;
-		}
-	}
-
-	return status;
-}
-
-/**
- * parse_hex_digit() - conversion to hex value
- * @c: the character to convert
- *
- * Return: the hex value, otherwise 0
- */
-static int parse_hex_digit(char c)
-{
-	if (c >= '0' && c <= '9')
-		return c - '0';
-	if (c >= 'a' && c <= 'f')
-		return c - 'a' + 10;
-	if (c >= 'A' && c <= 'F')
-		return c - 'A' + 10;
-
-	return 0;
-}
-
-/**
- * update_mac_from_string() - convert string to 6 bytes mac address
- * @pHddCtx: the pointer to hdd context
- * @macTable: the macTable to carry the conversion
- * @num: number of the interface
- *
- * 00AA00BB00CC -> 0x00 0xAA 0x00 0xBB 0x00 0xCC
- *
- * Return: None
- */
-static void update_mac_from_string(hdd_context_t *pHddCtx,
-				   tCfgIniEntry *macTable, int num)
-{
-	int i = 0, j = 0, res = 0;
-	char *candidate = NULL;
-	struct cdf_mac_addr macaddr[CDF_MAX_CONCURRENCY_PERSONA];
-
-	memset(macaddr, 0, sizeof(macaddr));
-
-	for (i = 0; i < num; i++) {
-		candidate = macTable[i].value;
-		for (j = 0; j < CDF_MAC_ADDR_SIZE; j++) {
-			res =
-				hex2bin(&macaddr[i].bytes[j], &candidate[(j << 1)],
-					1);
-			if (res < 0)
-				break;
-		}
-		if (res == 0 && !cdf_is_macaddr_zero(&macaddr[i])) {
-			cdf_mem_copy((uint8_t *) &pHddCtx->config->
-				     intfMacAddr[i].bytes[0],
-				     (uint8_t *) &macaddr[i].bytes[0],
-				     CDF_MAC_ADDR_SIZE);
-		}
-	}
-}
-
-/**
- * hdd_apply_cfg_ini() - apply the ini configuration file
- * @pHddCtx: the pointer to hdd context
- * @iniTable: pointer to configuration table
- * @entries: number fo the configuration entries
- * It overwrites the MAC address if config file exist.
- *
- * Return: CDF_STATUS_SUCCESS if the ini configuration file is correctly parsed,
- *		otherwise CDF_STATUS_E_INVAL
- */
-static CDF_STATUS hdd_apply_cfg_ini(hdd_context_t *pHddCtx,
-				    tCfgIniEntry *iniTable,
-				    unsigned long entries)
-{
-	CDF_STATUS match_status = CDF_STATUS_E_FAILURE;
-	CDF_STATUS ret_status = CDF_STATUS_SUCCESS;
-	unsigned int idx;
-	void *pField;
-	char *value_str = NULL;
-	unsigned long len_value_str;
-	char *candidate;
-	uint32_t value;
-	int32_t svalue;
-	void *pStructBase = pHddCtx->config;
-	REG_TABLE_ENTRY *pRegEntry = g_registry_table;
-	unsigned long cRegTableEntries = CDF_ARRAY_SIZE(g_registry_table);
-	uint32_t cbOutString;
-	int i;
-	int rv;
-
-	if (MAX_CFG_INI_ITEMS < cRegTableEntries) {
-		hddLog(LOGE, FL("MAX_CFG_INI_ITEMS too small, must be at least %ld"),
-		       cRegTableEntries);
-		WARN_ON(1);
-	}
-
-	for (idx = 0; idx < cRegTableEntries; idx++, pRegEntry++) {
-		/* Calculate the address of the destination field in the structure. */
-		pField = ((uint8_t *) pStructBase) + pRegEntry->VarOffset;
-
-		match_status =
-			find_cfg_item(iniTable, entries, pRegEntry->RegName,
-				      &value_str);
-
-		if ((match_status != CDF_STATUS_SUCCESS)
-		    && (pRegEntry->Flags & VAR_FLAGS_REQUIRED)) {
-			/* If we could not read the cfg item and it is required, this is an error. */
-			hddLog(LOGE,
-			       "%s: Failed to read required config parameter %s",
-			       __func__, pRegEntry->RegName);
-			ret_status = CDF_STATUS_E_FAILURE;
-			break;
-		}
-
-		if ((WLAN_PARAM_Integer == pRegEntry->RegType) ||
-		    (WLAN_PARAM_HexInteger == pRegEntry->RegType)) {
-			/* If successfully read from the registry, use the value read.
-			 * If not, use the default value.
-			 */
-			if (match_status == CDF_STATUS_SUCCESS
-			    && (WLAN_PARAM_Integer == pRegEntry->RegType)) {
-				rv = kstrtou32(value_str, 10, &value);
-				if (rv < 0) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s invalid. Enforcing default",
-					       __func__, pRegEntry->RegName);
-					value = pRegEntry->VarDefault;
-				}
-			} else if (match_status == CDF_STATUS_SUCCESS
-				   && (WLAN_PARAM_HexInteger ==
-				       pRegEntry->RegType)) {
-				rv = kstrtou32(value_str, 16, &value);
-				if (rv < 0) {
-					hddLog(LOGE,
-					       "%s: Reg paramter %s invalid. Enforcing default",
-					       __func__, pRegEntry->RegName);
-					value = pRegEntry->VarDefault;
-				}
-			} else {
-				value = pRegEntry->VarDefault;
-			}
-
-			/* If this parameter needs range checking, do it here. */
-			if (pRegEntry->Flags & VAR_FLAGS_RANGE_CHECK) {
-				if (value > pRegEntry->VarMax) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s > allowed Maximum [%u > %lu]. Enforcing Maximum",
-					       __func__, pRegEntry->RegName,
-					       value, pRegEntry->VarMax);
-					value = pRegEntry->VarMax;
-				}
-
-				if (value < pRegEntry->VarMin) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s < allowed Minimum [%u < %lu]. Enforcing Minimum",
-					       __func__, pRegEntry->RegName,
-					       value, pRegEntry->VarMin);
-					value = pRegEntry->VarMin;
-				}
-			}
-			/* If this parameter needs range checking, do it here. */
-			else if (pRegEntry->
-				 Flags & VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT) {
-				if (value > pRegEntry->VarMax) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s > allowed Maximum [%u > %lu]. Enforcing Default= %lu",
-					       __func__, pRegEntry->RegName,
-					       value, pRegEntry->VarMax,
-					       pRegEntry->VarDefault);
-					value = pRegEntry->VarDefault;
-				}
-
-				if (value < pRegEntry->VarMin) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s < allowed Minimum [%u < %lu]. Enforcing Default= %lu",
-					       __func__, pRegEntry->RegName,
-					       value, pRegEntry->VarMin,
-					       pRegEntry->VarDefault);
-					value = pRegEntry->VarDefault;
-				}
-			}
-			/* Move the variable into the output field. */
-			memcpy(pField, &value, pRegEntry->VarSize);
-		} else if (WLAN_PARAM_SignedInteger == pRegEntry->RegType) {
-			/* If successfully read from the registry, use the value read.
-			 * If not, use the default value.
-			 */
-			if (CDF_STATUS_SUCCESS == match_status) {
-				rv = kstrtos32(value_str, 10, &svalue);
-				if (rv < 0) {
-					hddLog(CDF_TRACE_LEVEL_WARN,
-					       "%s: Reg Parameter %s invalid. Enforcing Default",
-					       __func__, pRegEntry->RegName);
-					svalue =
-						(int32_t) pRegEntry->VarDefault;
-				}
-			} else {
-				svalue = (int32_t) pRegEntry->VarDefault;
-			}
-
-			/* If this parameter needs range checking, do it here. */
-			if (pRegEntry->Flags & VAR_FLAGS_RANGE_CHECK) {
-				if (svalue > (int32_t) pRegEntry->VarMax) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s > allowed Maximum "
-					       "[%d > %d]. Enforcing Maximum",
-					       __func__, pRegEntry->RegName,
-					       svalue, (int)pRegEntry->VarMax);
-					svalue = (int32_t) pRegEntry->VarMax;
-				}
-
-				if (svalue < (int32_t) pRegEntry->VarMin) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s < allowed Minimum "
-					       "[%d < %d]. Enforcing Minimum",
-					       __func__, pRegEntry->RegName,
-					       svalue, (int)pRegEntry->VarMin);
-					svalue = (int32_t) pRegEntry->VarMin;
-				}
-			}
-			/* If this parameter needs range checking, do it here. */
-			else if (pRegEntry->
-				 Flags & VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT) {
-				if (svalue > (int32_t) pRegEntry->VarMax) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s > allowed Maximum "
-					       "[%d > %d]. Enforcing Default= %d",
-					       __func__, pRegEntry->RegName,
-					       svalue, (int)pRegEntry->VarMax,
-					       (int)pRegEntry->VarDefault);
-					svalue =
-						(int32_t) pRegEntry->VarDefault;
-				}
-
-				if (svalue < (int32_t) pRegEntry->VarMin) {
-					hddLog(LOGE,
-					       "%s: Reg Parameter %s < allowed Minimum "
-					       "[%d < %d]. Enforcing Default= %d",
-					       __func__, pRegEntry->RegName,
-					       svalue, (int)pRegEntry->VarMin,
-					       (int)pRegEntry->VarDefault);
-					svalue = pRegEntry->VarDefault;
-				}
-			}
-			/* Move the variable into the output field. */
-			memcpy(pField, &svalue, pRegEntry->VarSize);
-		}
-		/* Handle string parameters */
-		else if (WLAN_PARAM_String == pRegEntry->RegType) {
-#ifdef WLAN_CFG_DEBUG
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-				  "RegName = %s, VarOffset %u VarSize %u VarDefault %s",
-				  pRegEntry->RegName, pRegEntry->VarOffset,
-				  pRegEntry->VarSize,
-				  (char *)pRegEntry->VarDefault);
-#endif
-
-			if (match_status == CDF_STATUS_SUCCESS) {
-				len_value_str = strlen(value_str);
-
-				if (len_value_str > (pRegEntry->VarSize - 1)) {
-					hddLog(LOGE,
-					       "%s: Invalid Value=[%s] specified for Name=[%s] in %s",
-					       __func__, value_str,
-					       pRegEntry->RegName,
-					       WLAN_INI_FILE);
-					cbOutString =
-						util_min(strlen
-								 ((char *)pRegEntry->
-								 VarDefault),
-							 pRegEntry->VarSize - 1);
-					memcpy(pField,
-					       (void *)(pRegEntry->VarDefault),
-					       cbOutString);
-					((uint8_t *) pField)[cbOutString] =
-						'\0';
-				} else {
-					memcpy(pField, (void *)(value_str),
-					       len_value_str);
-					((uint8_t *) pField)[len_value_str] =
-						'\0';
-				}
-			} else {
-				/* Failed to read the string parameter from the registry.  Use the default. */
-				cbOutString =
-					util_min(strlen((char *)pRegEntry->VarDefault),
-						 pRegEntry->VarSize - 1);
-				memcpy(pField, (void *)(pRegEntry->VarDefault),
-				       cbOutString);
-				((uint8_t *) pField)[cbOutString] = '\0';
-			}
-		} else if (WLAN_PARAM_MacAddr == pRegEntry->RegType) {
-			if (pRegEntry->VarSize != CDF_MAC_ADDR_SIZE) {
-				hddLog(LOGE,
-				       "%s: Invalid VarSize %u for Name=[%s]",
-				       __func__, pRegEntry->VarSize,
-				       pRegEntry->RegName);
-				continue;
-			}
-			candidate = (char *)pRegEntry->VarDefault;
-			if (match_status == CDF_STATUS_SUCCESS) {
-				len_value_str = strlen(value_str);
-				if (len_value_str != (CDF_MAC_ADDR_SIZE * 2)) {
-					hddLog(LOGE,
-					       "%s: Invalid MAC addr [%s] specified for Name=[%s] in %s",
-					       __func__, value_str,
-					       pRegEntry->RegName,
-					       WLAN_INI_FILE);
-				} else
-					candidate = value_str;
-			}
-			/* parse the string and store it in the byte array */
-			for (i = 0; i < CDF_MAC_ADDR_SIZE; i++) {
-				((char *)pField)[i] =
-					(char)(parse_hex_digit(candidate[i * 2]) *
-					       16 +
-					       parse_hex_digit(candidate[i * 2 + 1]));
-			}
-		} else {
-			hddLog(LOGE,
-			       "%s: Unknown param type for name[%s] in registry table",
-			       __func__, pRegEntry->RegName);
-		}
-
-		/* did we successfully parse a cfg item for this parameter? */
-		if ((match_status == CDF_STATUS_SUCCESS) &&
-		    (idx < MAX_CFG_INI_ITEMS)) {
-			set_bit(idx, (void *)&pHddCtx->config->bExplicitCfg);
-		}
-	}
-
-	return ret_status;
-}
-
-/**
- * hdd_execute_config_command() - executes an arbitrary configuration command
- * @reg_table: the pointer to configuration table
- * @tableSize: the size of the configuration table
- * @ini_struct: pointer to the hdd config knob
- * @pHddCtx: the pointer to hdd context
- * @command: the command to run
- *
- * Return: CDF_STATUS_SUCCESS if the command is found and able to execute,
- *		otherwise the appropriate CDF_STATUS will be returned
- */
-static CDF_STATUS hdd_execute_config_command(REG_TABLE_ENTRY *reg_table,
-					     unsigned long tableSize,
-					     uint8_t *ini_struct,
-					     hdd_context_t *pHddCtx,
-					     char *command)
-{
-	REG_TABLE_ENTRY *pRegEntry;
-	char *clone;
-	char *pCmd;
-	void *pField;
-	char *name;
-	char *value_str;
-	uint32_t value;
-	int32_t svalue;
-	size_t len_value_str;
-	unsigned int idx;
-	unsigned int i;
-	CDF_STATUS vstatus;
-	int rv;
-
-	/* assume failure until proven otherwise */
-	vstatus = CDF_STATUS_E_FAILURE;
-
-	/* clone the command so that we can manipulate it */
-	clone = kstrdup(command, GFP_ATOMIC);
-	if (NULL == clone) {
-		hddLog(LOGE,
-		       "%s: memory allocation failure, unable to process [%s]",
-		       __func__, command);
-		return vstatus;
-	}
-	/* 'clone' will point to the beginning of the string so it can be freed
-	 * 'pCmd' will be used to walk/parse the command
-	 */
-	pCmd = clone;
-
-	/* get rid of leading/trailing whitespace */
-	pCmd = i_trim(pCmd);
-	if ('\0' == *pCmd) {
-		/* only whitespace */
-		hddLog(LOGE, "%s: invalid command, only whitespace:[%s]",
-		       __func__, command);
-		goto done;
-	}
-	/* parse the <name> = <value> */
-	name = pCmd;
-	while (('=' != *pCmd) && ('\0' != *pCmd)) {
-		pCmd++;
-	}
-	if ('\0' == *pCmd) {
-		/* did not find '=' */
-		hddLog(LOGE, "%s: invalid command, no '=':[%s]",
-		       __func__, command);
-		goto done;
-	}
-	/* replace '=' with NUL to terminate the <name> */
-	*pCmd++ = '\0';
-	name = i_trim(name);
-	if ('\0' == *name) {
-		/* did not find a name */
-		hddLog(LOGE, "%s: invalid command, no <name>:[%s]",
-		       __func__, command);
-		goto done;
-	}
-
-	value_str = i_trim(pCmd);
-	if ('\0' == *value_str) {
-		/* did not find a value */
-		hddLog(LOGE, "%s: invalid command, no <value>:[%s]",
-		       __func__, command);
-		goto done;
-	}
-	/* lookup the configuration item */
-	for (idx = 0; idx < tableSize; idx++) {
-		if (0 == strcmp(name, reg_table[idx].RegName)) {
-			/* found a match */
-			break;
-		}
-	}
-	if (tableSize == idx) {
-		/* did not match the name */
-		hddLog(LOGE,
-		       "%s: invalid command, unknown configuration item:[%s]",
-		       __func__, command);
-		goto done;
-	}
-
-	pRegEntry = &reg_table[idx];
-	if (!(pRegEntry->Flags & VAR_FLAGS_DYNAMIC_CFG)) {
-		/* does not support dynamic configuration */
-		hddLog(LOGE, "%s: Global_Registry_Table.%s does not support "
-		       "dynamic configuration", __func__, name);
-		vstatus = CDF_STATUS_E_PERM;
-		goto done;
-	}
-
-	pField = ini_struct + pRegEntry->VarOffset;
-
-	switch (pRegEntry->RegType) {
-	case WLAN_PARAM_Integer:
-		rv = kstrtou32(value_str, 10, &value);
-		if (rv < 0)
-			goto done;
-		if (value < pRegEntry->VarMin) {
-			/* out of range */
-			hddLog(LOGE,
-			       "%s: invalid command, value %u < min value %lu",
-			       __func__, value, pRegEntry->VarMin);
-			goto done;
-		}
-		if (value > pRegEntry->VarMax) {
-			/* out of range */
-			hddLog(LOGE,
-			       "%s: invalid command, value %u > max value %lu",
-			       __func__, value, pRegEntry->VarMax);
-			goto done;
-		}
-		memcpy(pField, &value, pRegEntry->VarSize);
-		break;
-
-	case WLAN_PARAM_HexInteger:
-		rv = kstrtou32(value_str, 16, &value);
-		if (rv < 0)
-			goto done;
-		if (value < pRegEntry->VarMin) {
-			/* out of range */
-			hddLog(LOGE,
-			       "%s: invalid command, value %x < min value %lx",
-			       __func__, value, pRegEntry->VarMin);
-			goto done;
-		}
-		if (value > pRegEntry->VarMax) {
-			/* out of range */
-			hddLog(LOGE,
-			       "%s: invalid command, value %x > max value %lx",
-			       __func__, value, pRegEntry->VarMax);
-			goto done;
-		}
-		memcpy(pField, &value, pRegEntry->VarSize);
-		break;
-
-	case WLAN_PARAM_SignedInteger:
-		rv = kstrtos32(value_str, 10, &svalue);
-		if (rv < 0)
-			goto done;
-		if (svalue < (int32_t) pRegEntry->VarMin) {
-			/* out of range */
-			hddLog(LOGE,
-			       "%s: invalid command, value %d < min value %d",
-			       __func__, svalue, (int)pRegEntry->VarMin);
-			goto done;
-		}
-		if (svalue > (int32_t) pRegEntry->VarMax) {
-			/* out of range */
-			hddLog(LOGE,
-			       "%s: invalid command, value %d > max value %d",
-			       __func__, svalue, (int)pRegEntry->VarMax);
-			goto done;
-		}
-		memcpy(pField, &svalue, pRegEntry->VarSize);
-		break;
-
-	case WLAN_PARAM_String:
-		len_value_str = strlen(value_str);
-		if (len_value_str > (pRegEntry->VarSize - 1)) {
-			/* too big */
-			hddLog(LOGE,
-			       "%s: invalid command, string [%s] length "
-			       "%zu exceeds maximum length %u",
-			       __func__, value_str,
-			       len_value_str, (pRegEntry->VarSize - 1));
-			goto done;
-		}
-		/* copy string plus NUL */
-		memcpy(pField, value_str, (len_value_str + 1));
-		break;
-
-	case WLAN_PARAM_MacAddr:
-		len_value_str = strlen(value_str);
-		if (len_value_str != (CDF_MAC_ADDR_SIZE * 2)) {
-			/* out of range */
-			hddLog(LOGE,
-			       "%s: invalid command, MAC address [%s] length "
-			       "%zu is not expected length %u",
-			       __func__, value_str,
-			       len_value_str, (CDF_MAC_ADDR_SIZE * 2));
-			goto done;
-		}
-		/* parse the string and store it in the byte array */
-		for (i = 0; i < CDF_MAC_ADDR_SIZE; i++) {
-			((char *)pField)[i] = (char)
-					      ((parse_hex_digit(value_str[(i * 2)]) * 16) +
-					       parse_hex_digit(value_str[(i * 2) + 1]));
-		}
-		break;
-
-	default:
-		goto done;
-	}
-
-	/* if we get here, we had a successful modification */
-	vstatus = CDF_STATUS_SUCCESS;
-
-	/* config table has been modified, is there a notifier? */
-	if (NULL != pRegEntry->pfnDynamicnotify) {
-		(pRegEntry->pfnDynamicnotify)(pHddCtx, pRegEntry->notifyId);
-	}
-	/* note that this item was explicitly configured */
-	if (idx < MAX_CFG_INI_ITEMS) {
-		set_bit(idx, (void *)&pHddCtx->config->bExplicitCfg);
-	}
-done:
-	kfree(clone);
-	return vstatus;
-}
-
-/**
- * hdd_set_power_save_offload_config() - set power save offload configuration
- * @pHddCtx: the pointer to hdd context
- *
- * Return: none
- */
-static void hdd_set_power_save_offload_config(hdd_context_t *pHddCtx)
-{
-	struct hdd_config *pConfig = pHddCtx->config;
-	uint32_t listenInterval = 0;
-
-	if (strcmp(pConfig->PowerUsageControl, "Min") == 0) {
-		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
-	 * Otherwise default LI value of 1 will
-	 * be taken
-	 */
-	if (listenInterval) {
-		/*
-		 * setcfg for listenInterval.
-		 * Make sure CFG is updated because PE reads this
-		 * from CFG at the time of assoc or reassoc
-		 */
-		sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_LISTEN_INTERVAL,
-				listenInterval);
-	}
-
-}
-
-/**
- * hdd_cfg_print() - print the hdd configuration
- * @iniTable: pointer to hdd context
- *
- * Return: None
- */
-void hdd_cfg_print(hdd_context_t *pHddCtx)
-{
-	int i;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "*********Config values in HDD Adapter*******");
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [RTSThreshold] Value = %u",
-		  pHddCtx->config->RTSThreshold);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [OperatingChannel] Value = [%u]",
-		  pHddCtx->config->OperatingChannel);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [PowerUsageControl] Value = [%s]",
-		  pHddCtx->config->PowerUsageControl);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fIsImpsEnabled] Value = [%u]",
-		  pHddCtx->config->fIsImpsEnabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nVccRssiTrigger] Value = [%u]",
-		  pHddCtx->config->nVccRssiTrigger);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssBssid] Value =[" MAC_ADDRESS_STR "]",
-		  MAC_ADDR_ARRAY(pHddCtx->config->IbssBssid.bytes));
-
-	for (i = 0; i < CDF_MAX_CONCURRENCY_PERSONA; i++) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "Name = [Intf%dMacAddress] Value =[" MAC_ADDRESS_STR "]",
-			  i, MAC_ADDR_ARRAY(pHddCtx->config->intfMacAddr[i].bytes));
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gApEnableUapsd] value = [%u]",
-		  pHddCtx->config->apUapsdEnabled);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableApProt] value = [%u]",
-		  pHddCtx->config->apProtEnabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gAPAutoShutOff] Value = [%u]",
-		  pHddCtx->config->nAPAutoShutOff);
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gWlanMccToSccSwitchMode] Value = [%u]",
-		  pHddCtx->config->WlanMccToSccSwitchMode);
-#endif
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gWlanAutoShutdown] Value = [%u]",
-		  pHddCtx->config->WlanAutoShutdown);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableListenMode] Value = [%u]",
-		  pHddCtx->config->nEnableListenMode);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gApProtection] value = [%u]",
-		  pHddCtx->config->apProtection);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableApOBSSProt] value = [%u]",
-		  pHddCtx->config->apOBSSProtEnabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		"Name = [%s] value = [%u]", CFG_FORCE_SAP_ACS,
-		pHddCtx->config->force_sap_acs);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		"Name = [%s] value = [%u]", CFG_FORCE_SAP_ACS_START_CH,
-		pHddCtx->config->force_sap_acs_st_ch);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		"Name = [%s] value = [%u]", CFG_FORCE_SAP_ACS_END_CH,
-		pHddCtx->config->force_sap_acs_end_ch);
-#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-	CDF_TRACE(CDF_MODULE_ID_HDD,
-		  CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [sap_channel_avoidance] value = [%u]",
-		  pHddCtx->config->sap_channel_avoidance);
-#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		"Name = [%s] value = [%u]", CFG_SAP_P2P_11AC_OVERRIDE_NAME,
-				pHddCtx->config->sap_p2p_11ac_override);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [ChannelBondingMode] Value = [%u]",
-		  pHddCtx->config->nChannelBondingMode24GHz);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [ChannelBondingMode] Value = [%u]",
-		  pHddCtx->config->nChannelBondingMode5GHz);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [dot11Mode] Value = [%u]",
-		  pHddCtx->config->dot11Mode);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [WmmMode] Value = [%u] ", pHddCtx->config->WmmMode);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [UapsdMask] Value = [0x%x] ",
-		  pHddCtx->config->UapsdMask);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [ImplicitQosIsEnabled] Value = [%u]",
-		  (int)pHddCtx->config->bImplicitQosEnabled);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdVoSrvIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdVoSrvIntv);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdVoSuspIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdVoSuspIntv);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdViSrvIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdViSrvIntv);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdViSuspIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdViSuspIntv);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdBeSrvIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdBeSrvIntv);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdBeSuspIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdBeSuspIntv);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdBkSrvIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdBkSrvIntv);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraUapsdBkSuspIntv] Value = [%u] ",
-		  pHddCtx->config->InfraUapsdBkSuspIntv);
-#ifdef FEATURE_WLAN_ESE
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraInactivityInterval] Value = [%u] ",
-		  pHddCtx->config->InfraInactivityInterval);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [EseEnabled] Value = [%u] ",
-		  pHddCtx->config->isEseIniFeatureEnabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [FastTransitionEnabled] Value = [%u] ",
-		  pHddCtx->config->isFastTransitionEnabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gTxPowerCap] Value = [%u] dBm ",
-		  pHddCtx->config->nTxPowerCap);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [FastRoamEnabled] Value = [%u] ",
-		  pHddCtx->config->isFastRoamIniFeatureEnabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [MAWCEnabled] Value = [%u] ",
-		  pHddCtx->config->MAWCEnabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [RoamRssiDiff] Value = [%u] ",
-		  pHddCtx->config->RoamRssiDiff);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [isWESModeEnabled] Value = [%u] ",
-		  pHddCtx->config->isWESModeEnabled);
-#ifdef FEATURE_WLAN_OKC
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [OkcEnabled] Value = [%u] ",
-		  pHddCtx->config->isOkcIniFeatureEnabled);
-#endif
-#ifdef FEATURE_WLAN_SCAN_PNO
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [configPNOScanSupport] Value = [%u] ",
-		  pHddCtx->config->configPNOScanSupport);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [configPNOScanTimerRepeatValue] Value = [%u] ",
-		  pHddCtx->config->configPNOScanTimerRepeatValue);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gPNOSlowScanMultiplier] Value = [%u] ",
-		  pHddCtx->config->pno_slow_scan_multiplier);
-#endif
-#ifdef FEATURE_WLAN_TDLS
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fEnableTDLSSupport] Value = [%u] ",
-		  pHddCtx->config->fEnableTDLSSupport);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fEnableTDLSImplicitTrigger] Value = [%u] ",
-		  pHddCtx->config->fEnableTDLSImplicitTrigger);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fTDLSExternalControl] Value = [%u] ",
-		  pHddCtx->config->fTDLSExternalControl);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fTDLSUapsdMask] Value = [%u] ",
-		  pHddCtx->config->fTDLSUapsdMask);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fEnableTDLSBufferSta] Value = [%u] ",
-		  pHddCtx->config->fEnableTDLSBufferSta);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fEnableTDLSWmmMode] Value = [%u] ",
-		  pHddCtx->config->fEnableTDLSWmmMode);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [enable_tdls_scan] Value = [%u]",
-		  pHddCtx->config->enable_tdls_scan);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraDirAcVo] Value = [%u] ",
-		  pHddCtx->config->InfraDirAcVo);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraNomMsduSizeAcVo] Value = [0x%x] ",
-		  pHddCtx->config->InfraNomMsduSizeAcVo);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMeanDataRateAcVo] Value = [0x%x] ",
-		  pHddCtx->config->InfraMeanDataRateAcVo);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMinPhyRateAcVo] Value = [0x%x] ",
-		  pHddCtx->config->InfraMinPhyRateAcVo);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraSbaAcVo] Value = [0x%x] ",
-		  pHddCtx->config->InfraSbaAcVo);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraDirAcVi] Value = [%u] ",
-		  pHddCtx->config->InfraDirAcVi);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraNomMsduSizeAcVi] Value = [0x%x] ",
-		  pHddCtx->config->InfraNomMsduSizeAcVi);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMeanDataRateAcVi] Value = [0x%x] ",
-		  pHddCtx->config->InfraMeanDataRateAcVi);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMinPhyRateAcVi] Value = [0x%x] ",
-		  pHddCtx->config->InfraMinPhyRateAcVi);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraSbaAcVi] Value = [0x%x] ",
-		  pHddCtx->config->InfraSbaAcVi);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraDirAcBe] Value = [%u] ",
-		  pHddCtx->config->InfraDirAcBe);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraNomMsduSizeAcBe] Value = [0x%x] ",
-		  pHddCtx->config->InfraNomMsduSizeAcBe);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMeanDataRateAcBe] Value = [0x%x] ",
-		  pHddCtx->config->InfraMeanDataRateAcBe);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMinPhyRateAcBe] Value = [0x%x] ",
-		  pHddCtx->config->InfraMinPhyRateAcBe);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraSbaAcBe] Value = [0x%x] ",
-		  pHddCtx->config->InfraSbaAcBe);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraDirAcBk] Value = [%u] ",
-		  pHddCtx->config->InfraDirAcBk);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraNomMsduSizeAcBk] Value = [0x%x] ",
-		  pHddCtx->config->InfraNomMsduSizeAcBk);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMeanDataRateAcBk] Value = [0x%x] ",
-		  pHddCtx->config->InfraMeanDataRateAcBk);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraMinPhyRateAcBk] Value = [0x%x] ",
-		  pHddCtx->config->InfraMinPhyRateAcBk);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [InfraSbaAcBk] Value = [0x%x] ",
-		  pHddCtx->config->InfraSbaAcBk);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [DelayedTriggerFrmInt] Value = [%u] ",
-		  pHddCtx->config->DelayedTriggerFrmInt);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [mcastBcastFilterSetting] Value = [%u] ",
-		  pHddCtx->config->mcastBcastFilterSetting);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fhostArpOffload] Value = [%u] ",
-		  pHddCtx->config->fhostArpOffload);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [ssdp] Value = [%u] ", pHddCtx->config->ssdp);
-#ifdef FEATURE_WLAN_RA_FILTERING
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [RArateLimitInterval] Value = [%u] ",
-		  pHddCtx->config->RArateLimitInterval);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [IsRArateLimitEnabled] Value = [%u] ",
-		  pHddCtx->config->IsRArateLimitEnabled);
-#endif
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fFTResourceReqSupported] Value = [%u] ",
-		  pHddCtx->config->fFTResourceReqSupported);
-#endif
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nNeighborLookupRssiThreshold] Value = [%u] ",
-		  pHddCtx->config->nNeighborLookupRssiThreshold);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [delay_before_vdev_stop] Value = [%u] ",
-		  pHddCtx->config->delay_before_vdev_stop);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nOpportunisticThresholdDiff] Value = [%u] ",
-		  pHddCtx->config->nOpportunisticThresholdDiff);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nRoamRescanRssiDiff] Value = [%u] ",
-		  pHddCtx->config->nRoamRescanRssiDiff);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nNeighborScanMinChanTime] Value = [%u] ",
-		  pHddCtx->config->nNeighborScanMinChanTime);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nNeighborScanMaxChanTime] Value = [%u] ",
-		  pHddCtx->config->nNeighborScanMaxChanTime);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nMaxNeighborRetries] Value = [%u] ",
-		  pHddCtx->config->nMaxNeighborReqTries);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nNeighborScanPeriod] Value = [%u] ",
-		  pHddCtx->config->nNeighborScanPeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nNeighborScanResultsRefreshPeriod] Value = [%u] ",
-		  pHddCtx->config->nNeighborResultsRefreshPeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nEmptyScanRefreshPeriod] Value = [%u] ",
-		  pHddCtx->config->nEmptyScanRefreshPeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nRoamBmissFirstBcnt] Value = [%u] ",
-		  pHddCtx->config->nRoamBmissFirstBcnt);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nRoamBmissFinalBcnt] Value = [%u] ",
-		  pHddCtx->config->nRoamBmissFinalBcnt);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nRoamBeaconRssiWeight] Value = [%u] ",
-		  pHddCtx->config->nRoamBeaconRssiWeight);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [allowDFSChannelRoam] Value = [%u] ",
-		  pHddCtx->config->allowDFSChannelRoam);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nhi_rssi_scan_max_count] Value = [%u] ",
-		  pHddCtx->config->nhi_rssi_scan_max_count);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nhi_rssi_scan_rssi_delta] Value = [%u] ",
-		  pHddCtx->config->nhi_rssi_scan_rssi_delta);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nhi_rssi_scan_delay] Value = [%u] ",
-		  pHddCtx->config->nhi_rssi_scan_delay);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nhi_rssi_scan_rssi_ub] Value = [%u] ",
-		  pHddCtx->config->nhi_rssi_scan_rssi_ub);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [burstSizeDefinition] Value = [0x%x] ",
-		  pHddCtx->config->burstSizeDefinition);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [tsInfoAckPolicy] Value = [0x%x] ",
-		  pHddCtx->config->tsInfoAckPolicy);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [rfSettlingTimeUs] Value = [%u] ",
-		  pHddCtx->config->rfSettlingTimeUs);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [bSingleTidRc] Value = [%u] ",
-		  pHddCtx->config->bSingleTidRc);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gDynamicPSPollvalue] Value = [%u] ",
-		  pHddCtx->config->dynamicPsPollValue);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gAddTSWhenACMIsOff] Value = [%u] ",
-		  pHddCtx->config->AddTSWhenACMIsOff);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gValidateScanList] Value = [%u] ",
-		  pHddCtx->config->fValidateScanList);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gStaKeepAlivePeriod] Value = [%u] ",
-		  pHddCtx->config->infraStaKeepAlivePeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gApDataAvailPollInterVal] Value = [%u] ",
-		  pHddCtx->config->apDataAvailPollPeriodInMs);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [BandCapability] Value = [%u] ",
-		  pHddCtx->config->nBandCapability);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fEnableBeaconEarlyTermination] Value = [%u] ",
-		  pHddCtx->config->fEnableBeaconEarlyTermination);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [teleBcnWakeupEnable] Value = [%u] ",
-		  pHddCtx->config->teleBcnWakeupEn);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [transListenInterval] Value = [%u] ",
-		  pHddCtx->config->nTeleBcnTransListenInterval);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [transLiNumIdleBeacons] Value = [%u] ",
-		  pHddCtx->config->nTeleBcnTransLiNumIdleBeacons);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [maxListenInterval] Value = [%u] ",
-		  pHddCtx->config->nTeleBcnMaxListenInterval);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [maxLiNumIdleBeacons] Value = [%u] ",
-		  pHddCtx->config->nTeleBcnMaxLiNumIdleBeacons);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [bcnEarlyTermWakeInterval] Value = [%u] ",
-		  pHddCtx->config->bcnEarlyTermWakeInterval);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gApDataAvailPollInterVal] Value = [%u] ",
-		  pHddCtx->config->apDataAvailPollPeriodInMs);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableBypass11d] Value = [%u] ",
-		  pHddCtx->config->enableBypass11d);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableDFSChnlScan] Value = [%u] ",
-		  pHddCtx->config->enableDFSChnlScan);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableDFSPnoChnlScan] Value = [%u] ",
-		  pHddCtx->config->enable_dfs_pno_chnl_scan);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gReportMaxLinkSpeed] Value = [%u] ",
-		  pHddCtx->config->reportMaxLinkSpeed);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [thermalMitigationEnable] Value = [%u] ",
-		  pHddCtx->config->thermalMitigationEnable);
-#ifdef WLAN_FEATURE_11AC
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gVhtChannelWidth] value = [%u]",
-		  pHddCtx->config->vhtChannelWidth);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [enableFirstScan2GOnly] Value = [%u] ",
-		  pHddCtx->config->enableFirstScan2GOnly);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [skipDfsChnlInP2pSearch] Value = [%u] ",
-		  pHddCtx->config->skipDfsChnlInP2pSearch);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [ignoreDynamicDtimInP2pMode] Value = [%u] ",
-		  pHddCtx->config->ignoreDynamicDtimInP2pMode);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [enableRxSTBC] Value = [%u] ",
-		  pHddCtx->config->enableRxSTBC);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableLpwrImgTransition] Value = [%u] ",
-		  pHddCtx->config->enableLpwrImgTransition);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableSSR] Value = [%u] ",
-		  pHddCtx->config->enableSSR);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableVhtFor24GHzBand] Value = [%u] ",
-		  pHddCtx->config->enableVhtFor24GHzBand);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gFlexConnectPowerFactor] Value = [%u] ",
-		  pHddCtx->config->flexConnectPowerFactor);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableIbssHeartBeatOffload] Value = [%u] ",
-		  pHddCtx->config->enableIbssHeartBeatOffload);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gAntennaDiversity] Value = [%u] ",
-		  pHddCtx->config->antennaDiversity);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gGoLinkMonitorPeriod] Value = [%u]",
-		  pHddCtx->config->goLinkMonitorPeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gApLinkMonitorPeriod] Value = [%u]",
-		  pHddCtx->config->apLinkMonitorPeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gGoKeepAlivePeriod] Value = [%u]",
-		  pHddCtx->config->goKeepAlivePeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gApKeepAlivePeriod]Value = [%u]",
-		  pHddCtx->config->apKeepAlivePeriod);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gAmsduSupportInAMPDU] Value = [%u] ",
-		  pHddCtx->config->isAmsduSupportInAMPDU);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [nSelect5GHzMargin] Value = [%u] ",
-		  pHddCtx->config->nSelect5GHzMargin);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gCoalesingInIBSS] Value = [%u] ",
-		  pHddCtx->config->isCoalesingInIBSSAllowed);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssATIMWinSize] Value = [%u] ",
-		  pHddCtx->config->ibssATIMWinSize);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssIsPowerSaveAllowed] Value = [%u] ",
-		  pHddCtx->config->isIbssPowerSaveAllowed);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssIsPowerCollapseAllowed] Value = [%u] ",
-		  pHddCtx->config->isIbssPowerCollapseAllowed);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssAwakeOnTxRx] Value = [%u] ",
-		  pHddCtx->config->isIbssAwakeOnTxRx);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssInactivityTime] Value = [%u] ",
-		  pHddCtx->config->ibssInactivityCount);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssTxSpEndInactivityTime] Value = [%u] ",
-		  pHddCtx->config->ibssTxSpEndInactivityTime);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssPsWarmupTime] Value = [%u] ",
-		  pHddCtx->config->ibssPsWarmupTime);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIbssPs1RxChainInAtim] Value = [%u] ",
-		  pHddCtx->config->ibssPs1RxChainInAtimEnable);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fDfsPhyerrFilterOffload] Value = [%u] ",
-		  pHddCtx->config->fDfsPhyerrFilterOffload);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIgnorePeerErpInfo] Value = [%u] ",
-		  pHddCtx->config->ignore_peer_erp_info);
-#ifdef IPA_OFFLOAD
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIPAConfig] Value = [0x%x] ",
-		  pHddCtx->config->IpaConfig);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIPADescSize] Value = [%u] ",
-		  pHddCtx->config->IpaDescSize);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [IpaHighBandwidthMbpsg] Value = [%u] ",
-		  pHddCtx->config->IpaHighBandwidthMbps);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [IpaMediumBandwidthMbps] Value = [%u] ",
-		  pHddCtx->config->IpaMediumBandwidthMbps);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [IpaLowBandwidthMbps] Value = [%u] ",
-		  pHddCtx->config->IpaLowBandwidthMbps);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableOverLapCh] Value = [%u] ",
-		  pHddCtx->config->gEnableOverLapCh);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gMaxOffloadPeers] Value = [%u] ",
-		  pHddCtx->config->apMaxOffloadPeers);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gMaxOffloadReorderBuffs] value = [%u] ",
-		  pHddCtx->config->apMaxOffloadReorderBuffs);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gAllowDFSChannelRoam] Value = [%u] ",
-		  pHddCtx->config->allowDFSChannelRoam);
-	hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-	       "Name = [gMaxConcurrentActiveSessions] Value = [%u] ",
-	       pHddCtx->config->gMaxConcurrentActiveSessions);
-
-#ifdef MSM_PLATFORM
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gBusBandwidthHighThreshold] Value = [%u] ",
-		  pHddCtx->config->busBandwidthHighThreshold);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gBusBandwidthMediumThreshold] Value = [%u] ",
-		  pHddCtx->config->busBandwidthMediumThreshold);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gBusBandwidthLowThreshold] Value = [%u] ",
-		  pHddCtx->config->busBandwidthLowThreshold);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gbusBandwidthComputeInterval] Value = [%u] ",
-		  pHddCtx->config->busBandwidthComputeInterval);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gTcpDelAckThresholdHigh] Value = [%u] ",
-		  pHddCtx->config->tcpDelackThresholdHigh);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gTcpDelAckThresholdLow] Value = [%u] ",
-		  pHddCtx->config->tcpDelackThresholdLow);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		"Name = [%s] Value = [%u] ",
-		CFG_TCP_TX_HIGH_TPUT_THRESHOLD_NAME,
-		pHddCtx->config->tcp_tx_high_tput_thres);
-
-#endif
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gIgnoreCAC] Value = [%u] ",
-		  pHddCtx->config->ignoreCAC);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gSapPreferredChanLocation] Value = [%u] ",
-		  pHddCtx->config->gSapPreferredChanLocation);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gDisableDfsJapanW53] Value = [%u] ",
-		  pHddCtx->config->gDisableDfsJapanW53);
-#ifdef FEATURE_GREEN_AP
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableGreenAp] Value = [%u] ",
-		  pHddCtx->config->enableGreenAP);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEenableEGAP] Value = [%u] ",
-		  pHddCtx->config->enable_egap);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEGAPInactTime] Value = [%u] ",
-		  pHddCtx->config->egap_inact_time);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEGAPWaitTime] Value = [%u] ",
-		  pHddCtx->config->egap_wait_time);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEGAPFeatures] Value = [%u] ",
-		  pHddCtx->config->egap_feature_flag);
-#endif
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [isRoamOffloadEnabled] Value = [%u]",
-		  pHddCtx->config->isRoamOffloadEnabled);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableSifsBurst] Value = [%u]",
-		  pHddCtx->config->enableSifsBurst);
-
-#ifdef WLAN_FEATURE_LPSS
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableLpassSupport] Value = [%u] ",
-		  pHddCtx->config->enablelpasssupport);
-#endif
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableSelfRecovery] Value = [%u]",
-		  pHddCtx->config->enableSelfRecovery);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableSapSuspend] Value = [%u]",
-		  pHddCtx->config->enableSapSuspend);
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWgotoSuspend] Value = [%u]",
-		  pHddCtx->config->extWowGotoSuspend);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWowApp1WakeupPinNumber] Value = [%u]",
-		  pHddCtx->config->extWowApp1WakeupPinNumber);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWowApp2WakeupPinNumber] Value = [%u]",
-		  pHddCtx->config->extWowApp2WakeupPinNumber);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2KAInitPingInterval] Value = [%u]",
-		  pHddCtx->config->extWowApp2KAInitPingInterval);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2KAMinPingInterval] Value = [%u]",
-		  pHddCtx->config->extWowApp2KAMinPingInterval);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2KAMaxPingInterval] Value = [%u]",
-		  pHddCtx->config->extWowApp2KAMaxPingInterval);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2KAIncPingInterval] Value = [%u]",
-		  pHddCtx->config->extWowApp2KAIncPingInterval);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2TcpSrcPort] Value = [%u]",
-		  pHddCtx->config->extWowApp2TcpSrcPort);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2TcpDstPort] Value = [%u]",
-		  pHddCtx->config->extWowApp2TcpDstPort);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2TcpTxTimeout] Value = [%u]",
-		  pHddCtx->config->extWowApp2TcpTxTimeout);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gExtWoWApp2TcpRxTimeout] Value = [%u]",
-		  pHddCtx->config->extWowApp2TcpRxTimeout);
-#endif
-
-#ifdef DHCP_SERVER_OFFLOAD
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gDHCPServerOffloadEnable] Value = [%u]",
-		  pHddCtx->config->enableDHCPServerOffload);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gDHCPMaxNumClients] Value = [%u]",
-		  pHddCtx->config->dhcpMaxNumClients);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gDHCPServerIP] Value = [%s]",
-		  pHddCtx->config->dhcpServerIP);
-#endif
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gEnableDumpCollect] Value = [%u]",
-			pHddCtx->config->is_ramdump_enabled);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [gP2PListenDeferInterval] Value = [%u]",
-		  pHddCtx->config->p2p_listen_defer_interval);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [is_ps_enabled] value = [%d]",
-		  pHddCtx->config->is_ps_enabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [policy_manager_enabled] value = [%d]",
-		  pHddCtx->config->policy_manager_enabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [tso_enable] value = [%d]",
-		  pHddCtx->config->tso_enable);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [LROEnable] value = [%d]",
-		  pHddCtx->config->lro_enable);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [active_mode_offload] value = [%d]",
-		  pHddCtx->config->active_mode_offload);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [gfine_time_meas_cap] value = [%u]",
-		  pHddCtx->config->fine_time_meas_cap);
-#ifdef WLAN_FEATURE_FASTPATH
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [fastpath_enable] Value = [%u]",
-		  pHddCtx->config->fastpath_enable);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [max_scan_count] value = [%d]",
-		  pHddCtx->config->max_scan_count);
-#ifdef FEATURE_NAPI_DEBUG
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [%s] value = [%d]",
-		  CFG_ENABLE_RX_THREAD, pHddCtx->config->enableRxThread);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [%s] value = [%d]",
-		  CFG_NAPI_NAME, pHddCtx->config->napi_enable);
-#endif
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Name = [%s] Value = [%u]",
-		  CFG_CE_CLASSIFY_ENABLE_NAME,
-		  pHddCtx->config->ce_classify_enabled);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "Name = [%s] value = [%u]",
-		  CFG_DUAL_MAC_FEATURE_DISABLE,
-		  pHddCtx->config->dual_mac_feature_disable);
-#ifdef FEATURE_WLAN_SCAN_PNO
-	hddLog(LOGE, "Name = [%s] Value = [%u]",
-			CFG_PNO_CHANNEL_PREDICTION_NAME,
-			pHddCtx->config->pno_channel_prediction);
-	hddLog(LOGE, "Name = [%s] Value = [%u]",
-			CFG_TOP_K_NUM_OF_CHANNELS_NAME,
-			pHddCtx->config->top_k_num_of_channels);
-	hddLog(LOGE, "Name = [%s] Value = [%u]",
-			CFG_STATIONARY_THRESHOLD_NAME,
-			pHddCtx->config->stationary_thresh);
-	hddLog(LOGE, "Name = [%s] Value = [%u]",
-			CFG_CHANNEL_PREDICTION_FULL_SCAN_MS_NAME,
-			pHddCtx->config->channel_prediction_full_scan);
-#endif
-	hddLog(LOGE, "Name = [%s] Value = [%d]",
-		  CFG_EARLY_STOP_SCAN_ENABLE,
-		  pHddCtx->config->early_stop_scan_enable);
-	hddLog(LOGE, "Name = [%s] Value = [%d]",
-		CFG_EARLY_STOP_SCAN_MIN_THRESHOLD,
-		pHddCtx->config->early_stop_scan_min_threshold);
-	hddLog(LOGE, "Name = [%s] Value = [%d]",
-		CFG_EARLY_STOP_SCAN_MAX_THRESHOLD,
-		pHddCtx->config->early_stop_scan_max_threshold);
-	hddLog(LOGE, "Name = [%s] Value = [%d]",
-		CFG_FIRST_SCAN_BUCKET_THRESHOLD_NAME,
-		pHddCtx->config->first_scan_bucket_threshold);
-	hddLog(LOGE, "Name = [%s] Value = [%u]",
-		CFG_HT_MPDU_DENSITY_NAME,
-		pHddCtx->config->ht_mpdu_density);
-
-
-#ifdef FEATURE_LFR_SUBNET_DETECTION
-	hddLog(LOGE, "Name = [%s] Value = [%d]",
-		CFG_ENABLE_LFR_SUBNET_DETECTION,
-		pHddCtx->config->enable_lfr_subnet_detection);
-#endif
-}
-
-
-/**
- * hdd_update_mac_config() - update MAC address from cfg file
- * @pHddCtx: the pointer to hdd context
- *
- * It overwrites the MAC address if config file exist.
- *
- * Return: CDF_STATUS_SUCCESS if the MAC address is found from cfg file
- *      and overwritten, otherwise CDF_STATUS_E_INVAL
- */
-CDF_STATUS hdd_update_mac_config(hdd_context_t *pHddCtx)
-{
-	int status, i = 0;
-	const struct firmware *fw = NULL;
-	char *line, *buffer = NULL;
-	char *name, *value;
-	tCfgIniEntry macTable[CDF_MAX_CONCURRENCY_PERSONA];
-	tSirMacAddr customMacAddr;
-
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-
-	memset(macTable, 0, sizeof(macTable));
-	status = request_firmware(&fw, WLAN_MAC_FILE, pHddCtx->parent_dev);
-
-	if (status) {
-		hddLog(CDF_TRACE_LEVEL_WARN, "%s: request_firmware failed %d",
-		       __func__, status);
-		cdf_status = CDF_STATUS_E_FAILURE;
-		return cdf_status;
-	}
-	if (!fw || !fw->data || !fw->size) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: invalid firmware", __func__);
-		cdf_status = CDF_STATUS_E_INVAL;
-		goto config_exit;
-	}
-
-	buffer = (char *)fw->data;
-
-	/* data format:
-	 * Intf0MacAddress=00AA00BB00CC
-	 * Intf1MacAddress=00AA00BB00CD
-	 * END
-	 */
-	while (buffer != NULL) {
-		line = get_next_line(buffer);
-		buffer = i_trim(buffer);
-
-		if (strlen((char *)buffer) == 0 || *buffer == '#') {
-			buffer = line;
-			continue;
-		}
-		if (strncmp(buffer, "END", 3) == 0)
-			break;
-
-		name = buffer;
-		buffer = strnchr(buffer, strlen(buffer), '=');
-		if (buffer) {
-			*buffer++ = '\0';
-			i_trim(name);
-			if (strlen(name) != 0) {
-				buffer = i_trim(buffer);
-				if (strlen(buffer) == 12) {
-					value = buffer;
-					macTable[i].name = name;
-					macTable[i++].value = value;
-					if (i >= CDF_MAX_CONCURRENCY_PERSONA)
-						break;
-				}
-			}
-		}
-		buffer = line;
-	}
-	if (i <= CDF_MAX_CONCURRENCY_PERSONA) {
-		hddLog(CDF_TRACE_LEVEL_INFO, "%s: %d Mac addresses provided",
-		       __func__, i);
-	} else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: invalid number of Mac address provided, nMac = %d",
-		       __func__, i);
-		cdf_status = CDF_STATUS_E_INVAL;
-		goto config_exit;
-	}
-
-	update_mac_from_string(pHddCtx, &macTable[0], i);
-
-	cdf_mem_copy(&customMacAddr,
-		     &pHddCtx->config->intfMacAddr[0].bytes[0],
-		     sizeof(tSirMacAddr));
-	sme_set_custom_mac_addr(customMacAddr);
-
-config_exit:
-	release_firmware(fw);
-	return cdf_status;
-}
-
-/**
- * hdd_parse_config_ini() - parse the ini configuration file
- * @pHddCtx: the pointer to hdd context
- *
- * This function reads the qcom_cfg.ini file and
- * parses each 'Name=Value' pair in the ini file
- *
- * Return: CDF_STATUS_SUCCESS if the qcom_cfg.ini is correctly read,
- *		otherwise CDF_STATUS_E_INVAL
- */
-CDF_STATUS hdd_parse_config_ini(hdd_context_t *pHddCtx)
-{
-	int status, i = 0;
-	/** Pointer for firmware image data */
-	const struct firmware *fw = NULL;
-	char *buffer, *line, *pTemp = NULL;
-	size_t size;
-	char *name, *value;
-	/* cfgIniTable is static to avoid excess stack usage */
-	static tCfgIniEntry cfgIniTable[MAX_CFG_INI_ITEMS];
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-
-	memset(cfgIniTable, 0, sizeof(cfgIniTable));
-
-	status = request_firmware(&fw, WLAN_INI_FILE, pHddCtx->parent_dev);
-
-	if (status) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: request_firmware failed %d",
-		       __func__, status);
-		cdf_status = CDF_STATUS_E_FAILURE;
-		goto config_exit;
-	}
-	if (!fw || !fw->data || !fw->size) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: %s download failed",
-		       __func__, WLAN_INI_FILE);
-		cdf_status = CDF_STATUS_E_FAILURE;
-		goto config_exit;
-	}
-
-	hddLog(LOG1, "%s: qcom_cfg.ini Size %zu", __func__, fw->size);
-
-	buffer = (char *)cdf_mem_malloc(fw->size);
-
-	if (NULL == buffer) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("cdf_mem_malloc failure"));
-		release_firmware(fw);
-		return CDF_STATUS_E_NOMEM;
-	}
-	pTemp = buffer;
-
-	cdf_mem_copy((void *)buffer, (void *)fw->data, fw->size);
-	size = fw->size;
-
-	while (buffer != NULL) {
-		line = get_next_line(buffer);
-		buffer = i_trim(buffer);
-
-		hddLog(LOG1, "%s: item", buffer);
-
-		if (strlen((char *)buffer) == 0 || *buffer == '#') {
-			buffer = line;
-			continue;
-		} else if (strncmp(buffer, "END", 3) == 0) {
-			break;
-		} else {
-			name = buffer;
-			while (*buffer != '=' && *buffer != '\0')
-				buffer++;
-			if (*buffer != '\0') {
-				*buffer++ = '\0';
-				i_trim(name);
-				if (strlen(name) != 0) {
-					buffer = i_trim(buffer);
-					if (strlen(buffer) > 0) {
-						value = buffer;
-						while (!i_isspace(*buffer)
-						       && *buffer != '\0')
-							buffer++;
-						*buffer = '\0';
-						cfgIniTable[i].name = name;
-						cfgIniTable[i++].value = value;
-						if (i >= MAX_CFG_INI_ITEMS) {
-							hddLog(LOGE,
-							       "%s: Number of items in %s > %d",
-							       __func__,
-							       WLAN_INI_FILE,
-							       MAX_CFG_INI_ITEMS);
-							break;
-						}
-					}
-				}
-			}
-		}
-		buffer = line;
-	}
-
-	/* Loop through the registry table and apply all these configs */
-	cdf_status = hdd_apply_cfg_ini(pHddCtx, cfgIniTable, i);
-#ifdef FEATURE_NAPI
-	if (CDF_STATUS_SUCCESS == cdf_status)
-		hdd_napi_event(NAPI_EVT_INI_FILE,
-			       (void *)pHddCtx->config->napi_enable);
-#endif /* FEATURE_NAPI */
-
-config_exit:
-	release_firmware(fw);
-	cdf_mem_free(pTemp);
-	return cdf_status;
-}
-
-/**
- * hdd_cfg_xlate_to_csr_phy_mode() - convert PHY mode
- * @dot11Mode: the mode to convert
- *
- * Convert the configuration PHY mode to CSR PHY mode
- *
- * Return: the CSR phy mode value
- */
-eCsrPhyMode hdd_cfg_xlate_to_csr_phy_mode(eHddDot11Mode dot11Mode)
-{
-	switch (dot11Mode) {
-	case (eHDD_DOT11_MODE_abg):
-		return eCSR_DOT11_MODE_abg;
-	case (eHDD_DOT11_MODE_11b):
-		return eCSR_DOT11_MODE_11b;
-	case (eHDD_DOT11_MODE_11g):
-		return eCSR_DOT11_MODE_11g;
-	default:
-	case (eHDD_DOT11_MODE_11n):
-		return eCSR_DOT11_MODE_11n;
-	case (eHDD_DOT11_MODE_11g_ONLY):
-		return eCSR_DOT11_MODE_11g_ONLY;
-	case (eHDD_DOT11_MODE_11n_ONLY):
-		return eCSR_DOT11_MODE_11n_ONLY;
-	case (eHDD_DOT11_MODE_11b_ONLY):
-		return eCSR_DOT11_MODE_11b_ONLY;
-#ifdef WLAN_FEATURE_11AC
-	case (eHDD_DOT11_MODE_11ac_ONLY):
-		return eCSR_DOT11_MODE_11ac_ONLY;
-	case (eHDD_DOT11_MODE_11ac):
-		return eCSR_DOT11_MODE_11ac;
-#else
-	/* If 11AC support is not compiled set Auto mode */
-	case (eHDD_DOT11_MODE_11ac):
-	case (eHDD_DOT11_MODE_11ac_ONLY):
-		return eCSR_DOT11_MODE_AUTO;
-#endif
-	case (eHDD_DOT11_MODE_AUTO):
-		return eCSR_DOT11_MODE_AUTO;
-	case (eHDD_DOT11_MODE_11a):
-		return eCSR_DOT11_MODE_11a;
-	}
-
-}
-
-/**
- * hdd_set_idle_ps_config() - set idle power save configuration
- * @pHddCtx: the pointer to hdd context
- * @val: the value to configure
- *
- * Return: CDF_STATUS_SUCCESS if command set correctly,
- *		otherwise the CDF_STATUS return from SME layer
- */
-CDF_STATUS hdd_set_idle_ps_config(hdd_context_t *pHddCtx, uint32_t val)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	hddLog(LOG1, "hdd_set_idle_ps_config: Enter Val %d", val);
-
-	status = sme_set_idle_powersave_config(pHddCtx->pcds_context,
-			pHddCtx->hHal, val);
-	if (CDF_STATUS_SUCCESS != status)
-		hddLog(LOGE, "Fail to Set Idle PS Config val %d", val);
-	return status;
-}
-
-/**
- * hdd_set_fine_time_meas_cap() - set fine timing measurement capability
- * @hdd_ctx: HDD context
- * @sme_config: pointer to SME config
- *
- * This function is used to pass fine timing measurement capability coming
- * from INI to SME. This function make sure that configure INI is supported
- * by the device. Use bit mask to mask out the unsupported capabilities.
- *
- * Return: None
- */
-static void hdd_set_fine_time_meas_cap(hdd_context_t *hdd_ctx,
-				       tSmeConfigParams *sme_config)
-{
-	struct hdd_config *config = hdd_ctx->config;
-	uint32_t capability = config->fine_time_meas_cap;
-
-	/* Make sure only supported capabilities are enabled in INI */
-	capability &= CFG_FINE_TIME_MEAS_CAPABILITY_MAX;
-	sme_config->csrConfig.fine_time_meas_cap = capability;
-
-	hddLog(LOG1, FL("fine time meas capability - INI: %04x Enabled: %04x"),
-		config->fine_time_meas_cap,
-		sme_config->csrConfig.fine_time_meas_cap);
-
-	return;
-}
-
-/**
- * hdd_convert_string_to_u8_array() - used to convert string into u8 array
- * @str: String to be converted
- * @hex_array: Array where converted value is stored
- * @len: Length of the populated array
- * @array_max_len: Maximum length of the array
- * @to_hex: true, if conversion required for hex string
- *
- * This API is called to convert string (each byte separated by
- * a comma) into an u8 array
- *
- * Return: CDF_STATUS
- */
-
-static CDF_STATUS hdd_convert_string_to_array(char *str, uint8_t *array,
-			       uint8_t *len, uint8_t array_max_len, bool to_hex)
-{
-	char *format, *s = str;
-
-	if (str == NULL || array == NULL || len == NULL)
-		return CDF_STATUS_E_INVAL;
-
-	format = (to_hex) ? "%02x" : "%d";
-
-	*len = 0;
-	while ((s != NULL) && (*len < array_max_len)) {
-		int val;
-		/* Increment length only if sscanf successfully extracted
-		 * one element. Any other return value means error.
-		 * Ignore it. */
-		if (sscanf(s, format, &val) == 1) {
-			array[*len] = (uint8_t) val;
-			*len += 1;
-		}
-
-		s = strpbrk(s, ",");
-		if (s)
-			s++;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_hex_string_to_u8_array() - used to convert hex string into u8 array
- * @str: Hexadecimal string
- * @hex_array: Array where converted value is stored
- * @len: Length of the populated array
- * @array_max_len: Maximum length of the array
- *
- * This API is called to convert hexadecimal string (each byte separated by
- * a comma) into an u8 array
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS hdd_hex_string_to_u8_array(char *str, uint8_t *hex_array,
-				      uint8_t *len, uint8_t array_max_len)
-{
-	return hdd_convert_string_to_array(str, hex_array, len,
-					   array_max_len, true);
-}
-
-/**
- * hdd_string_to_u8_array() - used to convert decimal string into u8 array
- * @str: Decimal string
- * @hex_array: Array where converted value is stored
- * @len: Length of the populated array
- * @array_max_len: Maximum length of the array
- *
- * This API is called to convert decimal string (each byte separated by
- * a comma) into an u8 array
- *
- * Return: CDF_STATUS
- */
-
-CDF_STATUS hdd_string_to_u8_array(char *str, uint8_t *array,
-				  uint8_t *len, uint8_t array_max_len)
-{
-	return hdd_convert_string_to_array(str, array, len,
-					   array_max_len, false);
-}
-
-/**
- * hdd_update_config_dat() - scan the string and convery to u8 array
- * @str: the pointer to the string
- * @intArray: the pointer of buffer to store the u8 value
- * @len: size of the buffer
- *
- * Return: CDF_STATUS_SUCCESS if the configuration could be updated corectly,
- *		otherwise CDF_STATUS_E_INVAL
- */
-bool hdd_update_config_dat(hdd_context_t *pHddCtx)
-{
-	bool fStatus = true;
-	uint32_t val;
-	uint16_t val16;
-
-	struct hdd_config *pConfig = pHddCtx->config;
-	tSirMacHTCapabilityInfo *phtCapInfo;
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_SHORT_GI_20MHZ,
-			    pConfig->ShortGI20MhzEnable) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_SHORT_GI_20MHZ to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FIXED_RATE, pConfig->TxRate)
-			    == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_FIXED_RATE to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_MAX_RX_AMPDU_FACTOR,
-			    pConfig->MaxRxAmpduFactor) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_HT_AMPDU_PARAMS_MAX_RX_AMPDU_FACTOR to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_MPDU_DENSITY,
-			    pConfig->ht_mpdu_density) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_MPDU_DENSITY to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_SHORT_PREAMBLE,
-		     pConfig->fIsShortPreamble) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-			"Could not pass on WNI_CFG_SHORT_PREAMBLE to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal,
-				WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME,
-				pConfig->nPassiveMinChnTime)
-				== CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_PASSIVE_MINIMUM_CHANNEL_TIME"
-		       " to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal,
-				WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME,
-				pConfig->nPassiveMaxChnTime)
-				== CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME"
-		       " to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_BEACON_INTERVAL,
-		     pConfig->nBeaconInterval) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_BEACON_INTERVAL to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_MAX_PS_POLL,
-		     pConfig->nMaxPsPoll) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_MAX_PS_POLL to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_CURRENT_RX_ANTENNA,
-		     pConfig->nRxAnt) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_CURRENT_RX_ANTENNA to CFG");
-	}
-
-	if (sme_cfg_set_int (pHddCtx->hHal, WNI_CFG_LOW_GAIN_OVERRIDE,
-		    pConfig->fIsLowGainOverride) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_LOW_GAIN_OVERRIDE to HAL");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_RSSI_FILTER_PERIOD,
-		    pConfig->nRssiFilterPeriod) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_RSSI_FILTER_PERIOD to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_IGNORE_DTIM,
-		     pConfig->fIgnoreDtim) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_IGNORE_DTIM to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_PS_ENABLE_HEART_BEAT,
-		    pConfig->fEnableFwHeartBeatMonitoring)
-		    == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_PS_HEART_BEAT to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_PS_ENABLE_BCN_FILTER,
-		    pConfig->fEnableFwBeaconFiltering) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_PS_BCN_FILTER to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR,
-		    pConfig->fEnableFwRssiMonitoring) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_PS_RSSI_MONITOR to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT,
-		    pConfig->nDataInactivityTimeout) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_ENABLE_LTE_COEX,
-		     pConfig->enableLTECoex) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ENABLE_LTE_COEX to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE,
-		    pConfig->nEnableListenMode) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ENABLE_PHY_AGC_LISTEN_MODE to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_AP_KEEP_ALIVE_TIMEOUT,
-		    pConfig->apKeepAlivePeriod) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_AP_KEEP_ALIVE_TIMEOUT to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_GO_KEEP_ALIVE_TIMEOUT,
-		    pConfig->goKeepAlivePeriod) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_GO_KEEP_ALIVE_TIMEOUT to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_AP_LINK_MONITOR_TIMEOUT,
-		    pConfig->apLinkMonitorPeriod) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_AP_LINK_MONITOR_TIMEOUT to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_GO_LINK_MONITOR_TIMEOUT,
-		    pConfig->goLinkMonitorPeriod) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_GO_LINK_MONITOR_TIMEOUT to CFG");
-	}
-
-#if defined WLAN_FEATURE_VOWIFI
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_MCAST_BCAST_FILTER_SETTING,
-		    pConfig->mcastBcastFilterSetting) == CDF_STATUS_E_FAILURE)
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_MCAST_BCAST_FILTER_SETTING to CFG");
-#endif
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_SINGLE_TID_RC,
-		    pConfig->bSingleTidRc) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_SINGLE_TID_RC to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_TELE_BCN_WAKEUP_EN,
-		    pConfig->teleBcnWakeupEn) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TELE_BCN_WAKEUP_EN to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_TELE_BCN_TRANS_LI,
-		    pConfig->nTeleBcnTransListenInterval) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TELE_BCN_TRANS_LI to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_TELE_BCN_MAX_LI,
-		    pConfig->nTeleBcnMaxListenInterval) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TELE_BCN_MAX_LI to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS,
-		    pConfig->nTeleBcnTransLiNumIdleBeacons) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TELE_BCN_TRANS_LI_IDLE_BCNS to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS,
-		    pConfig->nTeleBcnMaxLiNumIdleBeacons) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TELE_BCN_MAX_LI_IDLE_BCNS to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_RF_SETTLING_TIME_CLK,
-		    pConfig->rfSettlingTimeUs) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_RF_SETTLING_TIME_CLK to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD,
-		    pConfig->infraStaKeepAlivePeriod) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD to CFG");
-	}
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_DYNAMIC_PS_POLL_VALUE,
-		    pConfig->dynamicPsPollValue) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_DYNAMIC_PS_POLL_VALUE to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_PS_NULLDATA_AP_RESP_TIMEOUT,
-		    pConfig->nNullDataApRespTimeout) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_PS_NULLDATA_DELAY_TIMEOUT to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD,
-		    pConfig->apDataAvailPollPeriodInMs) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD to CFG");
-	}
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_FRAGMENTATION_THRESHOLD,
-		    pConfig->FragmentationThreshold) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_FRAGMENTATION_THRESHOLD to CFG");
-	}
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_RTS_THRESHOLD,
-		     pConfig->RTSThreshold) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_RTS_THRESHOLD to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_11D_ENABLED,
-		     pConfig->Is11dSupportEnabled) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_11D_ENABLED to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_DFS_MASTER_ENABLED,
-			    pConfig->enableDFSMasterCap) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Failure: Could not set value for WNI_CFG_DFS_MASTER_ENABLED");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_ENABLE_TXBF_20MHZ,
-			    pConfig->enableTxBFin20MHz) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not set value for WNI_CFG_VHT_ENABLE_TXBF_20MHZ");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_HEART_BEAT_THRESHOLD,
-		    pConfig->HeartbeatThresh24) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_HEART_BEAT_THRESHOLD to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD,
-		    pConfig->apDataAvailPollPeriodInMs) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_AP_DATA_AVAIL_POLL_PERIOD to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ENABLE_CLOSE_LOOP,
-			    pConfig->enableCloseLoop) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ENABLE_CLOSE_LOOP to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TX_PWR_CTRL_ENABLE,
-			    pConfig->enableAutomaticTxPowerControl)
-			== CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TX_PWR_CTRL_ENABLE to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_SHORT_GI_40MHZ,
-			    pConfig->ShortGI40MhzEnable) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_SHORT_GI_40MHZ to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_ENABLE_MC_ADDR_LIST,
-		    pConfig->fEnableMCAddrList) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ENABLE_MC_ADDR_LIST to CFG");
-	}
-	/* Based on cfg.ini, update the Basic MCS set, RX/TX MCS map
-	 * in the cfg.dat. Valid values are 0(MCS0-7), 1(MCS0-8), 2(MCS0-9)
-	 * we update only the least significant 2 bits in the
-	 * corresponding fields.
-	 */
-	if ((pConfig->dot11Mode == eHDD_DOT11_MODE_AUTO) ||
-	    (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) ||
-	    (pConfig->dot11Mode == eHDD_DOT11_MODE_11ac)) {
-		uint32_t temp = 0;
-
-		sme_cfg_get_int(pHddCtx->hHal,
-				WNI_CFG_VHT_BASIC_MCS_SET, &temp);
-		temp = (temp & 0xFFFC) | pConfig->vhtRxMCS;
-		if (pConfig->enable2x2)
-			temp = (temp & 0xFFF3) | (pConfig->vhtRxMCS2x2 << 2);
-			if (sme_cfg_set_int(pHddCtx->hHal,
-					WNI_CFG_VHT_BASIC_MCS_SET, temp) ==
-					CDF_STATUS_E_FAILURE) {
-			fStatus = false;
-			hddLog(LOGE,
-			       "Could not pass on WNI_CFG_VHT_BASIC_MCS_SET to CFG");
-		}
-
-		sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_VHT_RX_MCS_MAP,
-				&temp);
-		temp = (temp & 0xFFFC) | pConfig->vhtRxMCS;
-		if (pConfig->enable2x2)
-			temp = (temp & 0xFFF3) | (pConfig->vhtRxMCS2x2 << 2);
-			if (sme_cfg_set_int(pHddCtx->hHal,
-					WNI_CFG_VHT_RX_MCS_MAP, temp)
-				== CDF_STATUS_E_FAILURE) {
-			fStatus = false;
-			hddLog(LOGE,
-			       "Could not pass on WNI_CFG_VHT_RX_MCS_MAP to CFG");
-		}
-		sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_VHT_TX_MCS_MAP, &temp);
-		temp = (temp & 0xFFFC) | pConfig->vhtTxMCS;
-		if (pConfig->enable2x2)
-			temp = (temp & 0xFFF3) | (pConfig->vhtTxMCS2x2 << 2);
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "vhtRxMCS2x2 - %x temp - %u enable2x2 %d",
-			  pConfig->vhtRxMCS2x2, temp,
-			  pConfig->enable2x2);
-
-		if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_TX_MCS_MAP,
-					temp) == CDF_STATUS_E_FAILURE) {
-			fStatus = false;
-			hddLog(LOGE,
-			       "Could not pass on WNI_CFG_VHT_TX_MCS_MAP to CFG");
-		}
-		/* Currently shortGI40Mhz is used for shortGI80Mhz */
-		if (sme_cfg_set_int
-			    (pHddCtx->hHal, WNI_CFG_VHT_SHORT_GI_80MHZ,
-			    pConfig->ShortGI40MhzEnable) ==
-			    CDF_STATUS_E_FAILURE) {
-			fStatus = false;
-			hddLog(LOGE,
-			       "Could not pass WNI_VHT_SHORT_GI_80MHZ to CFG");
-		}
-		/* Hardware is capable of doing
-		 * 128K AMPDU in 11AC mode */
-		if (sme_cfg_set_int(pHddCtx->hHal,
-			     WNI_CFG_VHT_AMPDU_LEN_EXPONENT,
-			     pConfig->fVhtAmpduLenExponent) ==
-			    CDF_STATUS_E_FAILURE) {
-			fStatus = false;
-			hddLog(LOGE,
-			       "Could not pass on WNI_CFG_VHT_AMPDU_LEN_EXPONENT to CFG");
-		}
-		/* Change MU Bformee only when TxBF is enabled */
-		if (pConfig->enableTxBF) {
-			sme_cfg_get_int(pHddCtx->hHal,
-				WNI_CFG_VHT_MU_BEAMFORMEE_CAP, &temp);
-
-			if (temp != pConfig->enableMuBformee) {
-				if (sme_cfg_set_int(pHddCtx->hHal,
-					    WNI_CFG_VHT_MU_BEAMFORMEE_CAP,
-					    pConfig->enableMuBformee
-					    ) == CDF_STATUS_E_FAILURE) {
-					fStatus = false;
-					hddLog(LOGE,
-						"Could not pass on WNI_CFG_VHT_MU_BEAMFORMEE_CAP to CFG");
-				}
-			}
-		}
-		if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH,
-			    pConfig->vhtMpduLen) == CDF_STATUS_E_FAILURE) {
-			fStatus = false;
-			hddLog(LOGE,
-			       "Could not pass on WNI_CFG_VHT_MAX_MPDU_LENGTH to CFG");
-		}
-
-		if (pConfig->enable2x2 && pConfig->enable_su_tx_bformer) {
-			if (sme_cfg_set_int(pHddCtx->hHal,
-					WNI_CFG_VHT_SU_BEAMFORMER_CAP,
-					pConfig->enable_su_tx_bformer) ==
-				CDF_STATUS_E_FAILURE) {
-				fStatus = false;
-				hdd_err("set SU_BEAMFORMER_CAP to CFG failed");
-			}
-			if (sme_cfg_set_int(pHddCtx->hHal,
-					WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS,
-					NUM_OF_SOUNDING_DIMENSIONS) ==
-				CDF_STATUS_E_FAILURE) {
-				fStatus = false;
-				hdd_err("failed to set NUM_OF_SOUNDING_DIM");
-			}
-		}
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_RX_STBC,
-			    pConfig->enableRxSTBC) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_HT_RX_STBC to CFG");
-	}
-
-	sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, &val);
-	val16 = (uint16_t) val;
-	phtCapInfo = (tSirMacHTCapabilityInfo *) &val16;
-	phtCapInfo->rxSTBC = pConfig->enableRxSTBC;
-	phtCapInfo->advCodingCap = pConfig->enableRxLDPC;
-	val = val16;
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_HT_CAP_INFO, val)
-			== CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_RXSTBC,
-			    pConfig->enableRxSTBC) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_VHT_RXSTBC to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_TXSTBC,
-			    pConfig->enableTxSTBC) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_VHT_TXSTBC to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP,
-			    pConfig->enableRxLDPC) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_VHT_LDPC_CODING_CAP to CFG");
-	}
-#ifdef WLAN_SOFTAP_VSTA_FEATURE
-	if (pConfig->fEnableVSTASupport) {
-		sme_cfg_get_int(pHddCtx->hHal, WNI_CFG_ASSOC_STA_LIMIT, &val);
-		if (val <= WNI_CFG_ASSOC_STA_LIMIT_STADEF)
-			val = WNI_CFG_ASSOC_STA_LIMIT_STAMAX;
-	} else {
-		val = pConfig->maxNumberOfPeers;
-
-	}
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ASSOC_STA_LIMIT, val) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ASSOC_STA_LIMIT to CFG");
-	}
-#endif
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ENABLE_LPWR_IMG_TRANSITION,
-			    pConfig->enableLpwrImgTransition)
-			== CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ENABLE_LPWR_IMG_TRANSITION to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED,
-		    pConfig->enableMCCAdaptiveScheduler) ==
-		    CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED to CFG");
-	}
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP,
-		    pConfig->disableLDPCWithTxbfAP) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_ZERO,
-		    pConfig->retryLimitZero) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_DYNAMIC_THRESHOLD_ZERO to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_ONE,
-		    pConfig->retryLimitOne) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_DYNAMIC_THRESHOLD_ONE to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_DYNAMIC_THRESHOLD_TWO,
-		    pConfig->retryLimitTwo) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_DYNAMIC_THRESHOLD_TWO to CFG");
-	}
-
-	if (sme_cfg_set_int
-		    (pHddCtx->hHal, WNI_CFG_MAX_MEDIUM_TIME,
-		     pConfig->cfgMaxMediumTime) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_MAX_MEDIUM_TIME to CFG");
-	}
-#ifdef FEATURE_WLAN_TDLS
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK,
-			    pConfig->fTDLSUapsdMask) == CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TDLS_QOS_WMM_UAPSD_MASK to CFG");
-	}
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_BUF_STA_ENABLED,
-			    pConfig->fEnableTDLSBufferSta) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TDLS_BUF_STA_ENABLED to CFG");
-	}
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_PUAPSD_INACT_TIME,
-			    pConfig->fTDLSPuapsdInactivityTimer) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TDLS_PUAPSD_INACT_TIME to CFG");
-	}
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_RX_FRAME_THRESHOLD,
-			    pConfig->fTDLSRxFrameThreshold) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TDLS_RX_FRAME_THRESHOLD to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_OFF_CHANNEL_ENABLED,
-			    pConfig->fEnableTDLSOffChannel) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TDLS_BUF_STA_ENABLED to CFG");
-	}
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_TDLS_WMM_MODE_ENABLED,
-			    pConfig->fEnableTDLSWmmMode) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_TDLS_WMM_MODE_ENABLED to CFG");
-	}
-#endif
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ENABLE_ADAPT_RX_DRAIN,
-			    pConfig->fEnableAdaptRxDrain) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ENABLE_ADAPT_RX_DRAIN to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_FLEX_CONNECT_POWER_FACTOR,
-			    pConfig->flexConnectPowerFactor) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE, "Failure: Could not pass on "
-		       "WNI_CFG_FLEX_CONNECT_POWER_FACTOR to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_ANTENNA_DIVESITY,
-			    pConfig->antennaDiversity) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_ANTENNA_DIVESITY to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal,
-			    WNI_CFG_DEFAULT_RATE_INDEX_24GHZ,
-			    pConfig->defaultRateIndex24Ghz) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_DEFAULT_RATE_INDEX_24GHZ to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal,
-			    WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL,
-			    pConfig->debugP2pRemainOnChannel) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL to CFG");
-	}
-#ifdef WLAN_FEATURE_11W
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_PMF_SA_QUERY_MAX_RETRIES,
-			    pConfig->pmfSaQueryMaxRetries) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_SA_QUERY_MAX_RETRIES to CFG");
-	}
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL,
-			    pConfig->pmfSaQueryRetryInterval) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_SA_QUERY_RETRY_INTERVAL to CFG");
-	}
-#endif
-
-	if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_IBSS_ATIM_WIN_SIZE,
-			    pConfig->ibssATIMWinSize) ==
-			CDF_STATUS_E_FAILURE) {
-		fStatus = false;
-		hddLog(LOGE,
-		       "Could not pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CFG");
-	}
-	return fStatus;
-}
-#ifdef FEATURE_WLAN_SCAN_PNO
-/**
- * hdd_set_pno_channel_prediction_config() - Set PNO configuration
- * @sme_config:         Config params from SME Context
- * @hdd_ctx:            Config params from HDD Context
- *
- * Copy the PNO Channel prediction feature configuration parameters
- * from HDD context to SME context.
- *
- * Return: None
- */
-void hdd_set_pno_channel_prediction_config(
-		tpSmeConfigParams sme_config, hdd_context_t *hdd_ctx)
-{
-	sme_config->csrConfig.dual_mac_feature_disable =
-		hdd_ctx->config->dual_mac_feature_disable;
-	sme_config->csrConfig.pno_channel_prediction =
-		hdd_ctx->config->pno_channel_prediction;
-	sme_config->csrConfig.top_k_num_of_channels =
-		hdd_ctx->config->top_k_num_of_channels;
-	sme_config->csrConfig.stationary_thresh =
-		hdd_ctx->config->stationary_thresh;
-	sme_config->csrConfig.channel_prediction_full_scan =
-		hdd_ctx->config->channel_prediction_full_scan;
-}
-#endif
-/**
- * hdd_set_sme_config() -initializes the sme configuration parameters
- *
- * @pHddCtx: the pointer to hdd context
- *
- * Return: CDF_STATUS_SUCCESS if configuration is correctly applied,
- *		otherwise the appropriate CDF_STATUS would be returned
- */
-CDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	tSmeConfigParams *smeConfig;
-	uint8_t rrm_capab_len;
-
-	struct hdd_config *pConfig = pHddCtx->config;
-
-	smeConfig = cdf_mem_malloc(sizeof(*smeConfig));
-	if (NULL == smeConfig) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: unable to allocate smeConfig", __func__);
-		return CDF_STATUS_E_NOMEM;
-	}
-	cdf_mem_zero(smeConfig, sizeof(*smeConfig));
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s bWmmIsEnabled=%d 802_11e_enabled=%d dot11Mode=%d",
-		  __func__, pConfig->WmmMode, pConfig->b80211eIsEnabled,
-		  pConfig->dot11Mode);
-
-	/* Config params obtained from the registry
-	 * To Do: set regulatory information here
-	 */
-
-	smeConfig->csrConfig.RTSThreshold = pConfig->RTSThreshold;
-	smeConfig->csrConfig.FragmentationThreshold =
-		pConfig->FragmentationThreshold;
-	smeConfig->csrConfig.shortSlotTime = pConfig->ShortSlotTimeEnabled;
-	smeConfig->csrConfig.Is11dSupportEnabled = pConfig->Is11dSupportEnabled;
-	smeConfig->csrConfig.HeartbeatThresh24 = pConfig->HeartbeatThresh24;
-
-	smeConfig->csrConfig.phyMode =
-		hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode);
-
-	if (pConfig->dot11Mode == eHDD_DOT11_MODE_abg ||
-	    pConfig->dot11Mode == eHDD_DOT11_MODE_11b ||
-	    pConfig->dot11Mode == eHDD_DOT11_MODE_11g ||
-	    pConfig->dot11Mode == eHDD_DOT11_MODE_11b_ONLY ||
-	    pConfig->dot11Mode == eHDD_DOT11_MODE_11g_ONLY) {
-		smeConfig->csrConfig.channelBondingMode24GHz = 0;
-		smeConfig->csrConfig.channelBondingMode5GHz = 0;
-	} else {
-		smeConfig->csrConfig.channelBondingMode24GHz =
-			pConfig->nChannelBondingMode24GHz;
-		smeConfig->csrConfig.channelBondingMode5GHz =
-			pConfig->nChannelBondingMode5GHz;
-	}
-	smeConfig->csrConfig.TxRate = pConfig->TxRate;
-	smeConfig->csrConfig.nScanResultAgeCount = pConfig->ScanResultAgeCount;
-	smeConfig->csrConfig.scanAgeTimeNCNPS = pConfig->nScanAgeTimeNCNPS;
-	smeConfig->csrConfig.scanAgeTimeNCPS = pConfig->nScanAgeTimeNCPS;
-	smeConfig->csrConfig.scanAgeTimeCNPS = pConfig->nScanAgeTimeCNPS;
-	smeConfig->csrConfig.scanAgeTimeCPS = pConfig->nScanAgeTimeCPS;
-	smeConfig->csrConfig.AdHocChannel24 = pConfig->OperatingChannel;
-	smeConfig->csrConfig.fSupplicantCountryCodeHasPriority =
-		pConfig->fSupplicantCountryCodeHasPriority;
-	smeConfig->csrConfig.bCatRssiOffset = pConfig->nRssiCatGap;
-	smeConfig->csrConfig.vccRssiThreshold = pConfig->nVccRssiTrigger;
-	smeConfig->csrConfig.vccUlMacLossThreshold =
-		pConfig->nVccUlMacLossThreshold;
-	smeConfig->csrConfig.nRoamingTime = pConfig->nRoamingTime;
-	smeConfig->csrConfig.nInitialDwellTime = pConfig->nInitialDwellTime;
-	smeConfig->csrConfig.initial_scan_no_dfs_chnl =
-					pConfig->initial_scan_no_dfs_chnl;
-	smeConfig->csrConfig.nActiveMaxChnTime = pConfig->nActiveMaxChnTime;
-	smeConfig->csrConfig.nActiveMinChnTime = pConfig->nActiveMinChnTime;
-	smeConfig->csrConfig.nPassiveMaxChnTime = pConfig->nPassiveMaxChnTime;
-	smeConfig->csrConfig.nPassiveMinChnTime = pConfig->nPassiveMinChnTime;
-#ifdef WLAN_AP_STA_CONCURRENCY
-	smeConfig->csrConfig.nActiveMaxChnTimeConc =
-		pConfig->nActiveMaxChnTimeConc;
-	smeConfig->csrConfig.nActiveMinChnTimeConc =
-		pConfig->nActiveMinChnTimeConc;
-	smeConfig->csrConfig.nPassiveMaxChnTimeConc =
-		pConfig->nPassiveMaxChnTimeConc;
-	smeConfig->csrConfig.nPassiveMinChnTimeConc =
-		pConfig->nPassiveMinChnTimeConc;
-	smeConfig->csrConfig.nRestTimeConc = pConfig->nRestTimeConc;
-	smeConfig->csrConfig.nNumStaChanCombinedConc =
-		pConfig->nNumStaChanCombinedConc;
-	smeConfig->csrConfig.nNumP2PChanCombinedConc =
-		pConfig->nNumP2PChanCombinedConc;
-
-#endif
-	smeConfig->csrConfig.Is11eSupportEnabled = pConfig->b80211eIsEnabled;
-	smeConfig->csrConfig.WMMSupportMode = pConfig->WmmMode;
-
-#if defined WLAN_FEATURE_VOWIFI
-	smeConfig->rrmConfig.rrm_enabled = pConfig->fRrmEnable;
-	smeConfig->rrmConfig.max_randn_interval = pConfig->nRrmRandnIntvl;
-	hdd_hex_string_to_u8_array(pConfig->rm_capability,
-			smeConfig->rrmConfig.rm_capability, &rrm_capab_len,
-			DOT11F_IE_RRMENABLEDCAP_MAX_LEN);
-#endif
-	/* Remaining config params not obtained from registry
-	 * On RF EVB beacon using channel 1.
-	 */
-#ifdef WLAN_FEATURE_11AC
-	smeConfig->csrConfig.nVhtChannelWidth = pConfig->vhtChannelWidth;
-	smeConfig->csrConfig.enableTxBF = pConfig->enableTxBF;
-	smeConfig->csrConfig.enable_txbf_sap_mode =
-		pConfig->enable_txbf_sap_mode;
-	smeConfig->csrConfig.txBFCsnValue = pConfig->txBFCsnValue;
-	smeConfig->csrConfig.enable2x2 = pConfig->enable2x2;
-	smeConfig->csrConfig.enableVhtFor24GHz = pConfig->enableVhtFor24GHzBand;
-	smeConfig->csrConfig.enableMuBformee = pConfig->enableMuBformee;
-	smeConfig->csrConfig.enableVhtpAid = pConfig->enableVhtpAid;
-	smeConfig->csrConfig.enableVhtGid = pConfig->enableVhtGid;
-#endif
-	smeConfig->csrConfig.enableAmpduPs = pConfig->enableAmpduPs;
-	smeConfig->csrConfig.enableHtSmps = pConfig->enableHtSmps;
-	smeConfig->csrConfig.htSmps = pConfig->htSmps;
-	smeConfig->csrConfig.AdHocChannel5G = pConfig->AdHocChannel5G;
-	smeConfig->csrConfig.AdHocChannel24 = pConfig->AdHocChannel24G;
-	smeConfig->csrConfig.ProprietaryRatesEnabled = 0;
-	smeConfig->csrConfig.HeartbeatThresh50 = 40;
-	smeConfig->csrConfig.bandCapability = pConfig->nBandCapability;
-	if (pConfig->nBandCapability == eCSR_BAND_24) {
-		smeConfig->csrConfig.Is11hSupportEnabled = 0;
-	} else {
-		smeConfig->csrConfig.Is11hSupportEnabled =
-			pConfig->Is11hSupportEnabled;
-	}
-	smeConfig->csrConfig.cbChoice = 0;
-	smeConfig->csrConfig.eBand = pConfig->nBandCapability;
-	smeConfig->csrConfig.nTxPowerCap = pConfig->nTxPowerCap;
-	smeConfig->csrConfig.fEnableBypass11d = pConfig->enableBypass11d;
-	smeConfig->csrConfig.fEnableDFSChnlScan = pConfig->enableDFSChnlScan;
-	smeConfig->csrConfig.nRoamPrefer5GHz = pConfig->nRoamPrefer5GHz;
-	smeConfig->csrConfig.nRoamIntraBand = pConfig->nRoamIntraBand;
-	smeConfig->csrConfig.nProbes = pConfig->nProbes;
-
-	smeConfig->csrConfig.nRoamScanHomeAwayTime =
-		pConfig->nRoamScanHomeAwayTime;
-	smeConfig->csrConfig.fFirstScanOnly2GChnl =
-		pConfig->enableFirstScan2GOnly;
-
-	smeConfig->csrConfig.Csr11dinfo.Channels.numChannels = 0;
-
-	hdd_set_power_save_offload_config(pHddCtx);
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	smeConfig->csrConfig.csr11rConfig.IsFTResourceReqSupported =
-		pConfig->fFTResourceReqSupported;
-#endif
-	smeConfig->csrConfig.isFastRoamIniFeatureEnabled =
-		pConfig->isFastRoamIniFeatureEnabled;
-	smeConfig->csrConfig.MAWCEnabled = pConfig->MAWCEnabled;
-#ifdef FEATURE_WLAN_ESE
-	smeConfig->csrConfig.isEseIniFeatureEnabled =
-		pConfig->isEseIniFeatureEnabled;
-	if (pConfig->isEseIniFeatureEnabled) {
-		pConfig->isFastTransitionEnabled = true;
-	}
-#endif
-	smeConfig->csrConfig.isFastTransitionEnabled =
-		pConfig->isFastTransitionEnabled;
-	smeConfig->csrConfig.RoamRssiDiff = pConfig->RoamRssiDiff;
-	smeConfig->csrConfig.isWESModeEnabled = pConfig->isWESModeEnabled;
-	smeConfig->csrConfig.isRoamOffloadScanEnabled =
-		pConfig->isRoamOffloadScanEnabled;
-	smeConfig->csrConfig.bFastRoamInConIniFeatureEnabled =
-		pConfig->bFastRoamInConIniFeatureEnabled;
-
-	if (0 == smeConfig->csrConfig.isRoamOffloadScanEnabled) {
-		/* Disable roaming in concurrency if roam scan offload is disabled */
-		smeConfig->csrConfig.bFastRoamInConIniFeatureEnabled = 0;
-	}
-	smeConfig->csrConfig.neighborRoamConfig.nNeighborLookupRssiThreshold =
-		pConfig->nNeighborLookupRssiThreshold;
-	smeConfig->csrConfig.neighborRoamConfig.delay_before_vdev_stop =
-		pConfig->delay_before_vdev_stop;
-	smeConfig->csrConfig.neighborRoamConfig.nOpportunisticThresholdDiff =
-		pConfig->nOpportunisticThresholdDiff;
-	smeConfig->csrConfig.neighborRoamConfig.nRoamRescanRssiDiff =
-		pConfig->nRoamRescanRssiDiff;
-	smeConfig->csrConfig.neighborRoamConfig.nNeighborScanMaxChanTime =
-		pConfig->nNeighborScanMaxChanTime;
-	smeConfig->csrConfig.neighborRoamConfig.nNeighborScanMinChanTime =
-		pConfig->nNeighborScanMinChanTime;
-	smeConfig->csrConfig.neighborRoamConfig.nNeighborScanTimerPeriod =
-		pConfig->nNeighborScanPeriod;
-	smeConfig->csrConfig.neighborRoamConfig.nMaxNeighborRetries =
-		pConfig->nMaxNeighborReqTries;
-	smeConfig->csrConfig.neighborRoamConfig.nNeighborResultsRefreshPeriod =
-		pConfig->nNeighborResultsRefreshPeriod;
-	smeConfig->csrConfig.neighborRoamConfig.nEmptyScanRefreshPeriod =
-		pConfig->nEmptyScanRefreshPeriod;
-	hdd_string_to_u8_array(pConfig->neighborScanChanList,
-			       smeConfig->csrConfig.neighborRoamConfig.
-			       neighborScanChanList.channelList,
-			       &smeConfig->csrConfig.neighborRoamConfig.
-			       neighborScanChanList.numChannels,
-			       WNI_CFG_VALID_CHANNEL_LIST_LEN);
-	smeConfig->csrConfig.neighborRoamConfig.nRoamBmissFirstBcnt =
-		pConfig->nRoamBmissFirstBcnt;
-	smeConfig->csrConfig.neighborRoamConfig.nRoamBmissFinalBcnt =
-		pConfig->nRoamBmissFinalBcnt;
-	smeConfig->csrConfig.neighborRoamConfig.nRoamBeaconRssiWeight =
-		pConfig->nRoamBeaconRssiWeight;
-	smeConfig->csrConfig.neighborRoamConfig.nhi_rssi_scan_max_count =
-		pConfig->nhi_rssi_scan_max_count;
-	smeConfig->csrConfig.neighborRoamConfig.nhi_rssi_scan_rssi_delta =
-		pConfig->nhi_rssi_scan_rssi_delta;
-	smeConfig->csrConfig.neighborRoamConfig.nhi_rssi_scan_delay =
-		pConfig->nhi_rssi_scan_delay;
-	smeConfig->csrConfig.neighborRoamConfig.nhi_rssi_scan_rssi_ub =
-		pConfig->nhi_rssi_scan_rssi_ub;
-	smeConfig->csrConfig.addTSWhenACMIsOff = pConfig->AddTSWhenACMIsOff;
-	smeConfig->csrConfig.fValidateList = pConfig->fValidateScanList;
-	smeConfig->csrConfig.allowDFSChannelRoam = pConfig->allowDFSChannelRoam;
-
-	/* Enable/Disable MCC */
-	smeConfig->csrConfig.fEnableMCCMode = pConfig->enableMCC;
-	smeConfig->csrConfig.mcc_rts_cts_prot_enable =
-					pConfig->mcc_rts_cts_prot_enable;
-	smeConfig->csrConfig.mcc_bcast_prob_resp_enable =
-					pConfig->mcc_bcast_prob_resp_enable;
-	smeConfig->csrConfig.fAllowMCCGODiffBI = pConfig->allowMCCGODiffBI;
-
-	/* Scan Results Aging Time out value */
-	smeConfig->csrConfig.scanCfgAgingTime = pConfig->scanAgingTimeout;
-
-	smeConfig->csrConfig.enableTxLdpc = pConfig->enableTxLdpc;
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-	smeConfig->csrConfig.cc_switch_mode = pConfig->WlanMccToSccSwitchMode;
-#endif
-
-	smeConfig->csrConfig.isAmsduSupportInAMPDU =
-		pConfig->isAmsduSupportInAMPDU;
-	smeConfig->csrConfig.nSelect5GHzMargin = pConfig->nSelect5GHzMargin;
-
-	smeConfig->csrConfig.isCoalesingInIBSSAllowed =
-		pHddCtx->config->isCoalesingInIBSSAllowed;
-	smeConfig->csrConfig.ignore_peer_erp_info =
-						pConfig->ignore_peer_erp_info;
-	/* update SSR config */
-	sme_update_enable_ssr((tHalHandle) (pHddCtx->hHal),
-			      pHddCtx->config->enableSSR);
-
-#ifdef FEATURE_WLAN_SCAN_PNO
-	/* Update PNO offoad status */
-	smeConfig->csrConfig.pnoOffload = pHddCtx->config->PnoOffload;
-#endif
-
-	/* Update maximum interfaces information */
-	smeConfig->csrConfig.max_intf_count = pHddCtx->max_intf_count;
-
-	smeConfig->csrConfig.fEnableDebugLog = pHddCtx->config->gEnableDebugLog;
-
-	smeConfig->csrConfig.enable5gEBT = pHddCtx->config->enable5gEBT;
-
-	smeConfig->csrConfig.enableSelfRecovery =
-			pHddCtx->config->enableSelfRecovery;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	smeConfig->csrConfig.isRoamOffloadEnabled =
-		pHddCtx->config->isRoamOffloadEnabled;
-#endif
-	smeConfig->csrConfig.conc_custom_rule1 =
-		pHddCtx->config->conc_custom_rule1;
-	smeConfig->csrConfig.conc_custom_rule2 =
-		pHddCtx->config->conc_custom_rule2;
-	smeConfig->csrConfig.is_sta_connection_in_5gz_enabled =
-		pHddCtx->config->is_sta_connection_in_5gz_enabled;
-
-	smeConfig->csrConfig.f_sta_miracast_mcc_rest_time_val =
-		pHddCtx->config->sta_miracast_mcc_rest_time_val;
-
-#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-	smeConfig->csrConfig.sap_channel_avoidance =
-		pHddCtx->config->sap_channel_avoidance;
-#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
-
-	smeConfig->csrConfig.f_prefer_non_dfs_on_radar =
-		pHddCtx->config->prefer_non_dfs_on_radar;
-
-	smeConfig->csrConfig.is_ps_enabled = pHddCtx->config->is_ps_enabled;
-	hdd_set_fine_time_meas_cap(pHddCtx, smeConfig);
-
-	cds_set_multicast_logging(pHddCtx->config->multicast_host_fw_msgs);
-
-	smeConfig->csrConfig.sendDeauthBeforeCon = pConfig->sendDeauthBeforeCon;
-
-	smeConfig->csrConfig.policy_manager_enabled =
-			pHddCtx->config->policy_manager_enabled;
-	smeConfig->csrConfig.max_scan_count =
-			pHddCtx->config->max_scan_count;
-
-	/* Update 802.11p config */
-	smeConfig->csrConfig.enable_dot11p =
-		(pHddCtx->config->dot11p_mode != WLAN_HDD_11P_DISABLED);
-	hdd_set_pno_channel_prediction_config(smeConfig, pHddCtx);
-
-	smeConfig->csrConfig.early_stop_scan_enable =
-		pHddCtx->config->early_stop_scan_enable;
-	smeConfig->csrConfig.early_stop_scan_min_threshold =
-		pHddCtx->config->early_stop_scan_min_threshold;
-	smeConfig->csrConfig.early_stop_scan_max_threshold =
-		pHddCtx->config->early_stop_scan_max_threshold;
-	smeConfig->csrConfig.first_scan_bucket_threshold =
-		pHddCtx->config->first_scan_bucket_threshold;
-	status = sme_update_config(pHddCtx->hHal, smeConfig);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, "sme_update_config() return failure %d",
-		       status);
-	}
-
-	cdf_mem_free(smeConfig);
-	return status;
-}
-
-/**
- * hdd_execute_global_config_command() - execute the global config command
- * @pHddCtx: the pointer to hdd context
- * @command: the command to run
- *
- * Return: the CDF_STATUS return from hdd_execute_config_command
- */
-CDF_STATUS hdd_execute_global_config_command(hdd_context_t *pHddCtx,
-					     char *command)
-{
-	return hdd_execute_config_command(g_registry_table,
-					  ARRAY_SIZE(g_registry_table),
-					  (uint8_t *) pHddCtx->config,
-					  pHddCtx, command);
-}
-
-/**
- * hdd_cfg_get_global_config() - get the configuration table
- * @pHddCtx: pointer to hdd context
- * @pBuf: buffer to store the configuration
- * @buflen: size of the buffer
- *
- * Return: CDF_STATUS_SUCCESS if the configuration and buffer size can carry
- *		the content, otherwise CDF_STATUS_E_RESOURCES
- */
-CDF_STATUS hdd_cfg_get_global_config(hdd_context_t *pHddCtx, char *pBuf,
-				     int buflen)
-{
-	return hdd_cfg_get_config(g_registry_table,
-				  ARRAY_SIZE(g_registry_table),
-				  (uint8_t *) pHddCtx->config, pHddCtx, pBuf,
-				  buflen);
-}
-
-/**
- * hdd_is_okc_mode_enabled() - returns whether OKC mode is enabled or not
- * @pHddCtx: the pointer to hdd context
- *
- * Return: true if OKC is enabled, otherwise false
- */
-bool hdd_is_okc_mode_enabled(hdd_context_t *pHddCtx)
-{
-	if (NULL == pHddCtx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: pHddCtx is NULL", __func__);
-		return -EINVAL;
-	}
-#ifdef FEATURE_WLAN_OKC
-	return pHddCtx->config->isOkcIniFeatureEnabled;
-#else
-	return false;
-#endif
-}
-
-/**
- * hdd_update_nss() - Update the number of spatial streams supported.
- * Ensure that nss is either 1 or 2 before calling this.
- *
- * @hdd_ctx: the pointer to hdd context
- * @nss: the number of spatial streams to be updated
- *
- * This function is used to modify the number of spatial streams
- * supported when not in connected state.
- *
- * Return: CDF_STATUS_SUCCESS if nss is correctly updated,
- *              otherwise CDF_STATUS_E_FAILURE would be returned
- */
-CDF_STATUS hdd_update_nss(hdd_context_t *hdd_ctx, uint8_t nss)
-{
-	struct hdd_config *hdd_config = hdd_ctx->config;
-	uint32_t temp = 0;
-	uint32_t rx_supp_data_rate, tx_supp_data_rate;
-	bool status = true;
-	tSirMacHTCapabilityInfo *ht_cap_info;
-	uint8_t mcs_set[SIZE_OF_SUPPORTED_MCS_SET] = {0};
-	uint8_t mcs_set_temp[SIZE_OF_SUPPORTED_MCS_SET];
-	uint32_t val;
-	uint16_t val16;
-	uint8_t enable2x2;
-
-	if ((nss == 2) && (hdd_ctx->num_rf_chains != 2)) {
-		hddLog(LOGE, "No support for 2 spatial streams");
-		return CDF_STATUS_E_INVAL;
-	}
-
-	enable2x2 = (nss == 1) ? 0 : 1;
-
-	if (hdd_config->enable2x2 == enable2x2) {
-		hddLog(LOGE, "NSS same as requested");
-		return CDF_STATUS_SUCCESS;
-	}
-
-	if (true == sme_is_any_session_in_connected_state(hdd_ctx->hHal)) {
-		hddLog(LOGE, "Connected sessions present, Do not change NSS");
-		return CDF_STATUS_E_INVAL;
-	}
-
-	hdd_config->enable2x2 = enable2x2;
-
-	if (!hdd_config->enable2x2) {
-		/* 1x1 */
-		rx_supp_data_rate = HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1;
-		tx_supp_data_rate = HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1;
-	} else {
-		/* 2x2 */
-		rx_supp_data_rate = HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2;
-		tx_supp_data_rate = HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2;
-	}
-
-	/* Update Rx Highest Long GI data Rate */
-	if (sme_cfg_set_int(hdd_ctx->hHal,
-			    WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE,
-			    rx_supp_data_rate) == CDF_STATUS_E_FAILURE) {
-		status = false;
-		hddLog(LOGE,
-			"Could not pass on WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE to CFG");
-	}
-
-	/* Update Tx Highest Long GI data Rate */
-	if (sme_cfg_set_int(hdd_ctx->hHal,
-			    WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE,
-			    tx_supp_data_rate) == CDF_STATUS_E_FAILURE) {
-		status = false;
-		hddLog(LOGE,
-			"Could not pass on WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE to CFG");
-	}
-
-	sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, &temp);
-	val16 = (uint16_t)temp;
-	ht_cap_info = (tSirMacHTCapabilityInfo *)&val16;
-	if (!(hdd_ctx->ht_tx_stbc_supported && hdd_config->enable2x2))
-		ht_cap_info->txSTBC = 0;
-	else
-		ht_cap_info->txSTBC = hdd_config->enableTxSTBC;
-	temp = val16;
-	if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO,
-			    temp) == CDF_STATUS_E_FAILURE) {
-		status = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_HT_CAP_INFO to CFG");
-	}
-
-	sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_BASIC_MCS_SET, &temp);
-	temp = (temp & 0xFFFC) | hdd_config->vhtRxMCS;
-	if (hdd_config->enable2x2)
-		temp = (temp & 0xFFF3) | (hdd_config->vhtRxMCS2x2 << 2);
-	else
-		temp |= 0x000C;
-
-	if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_BASIC_MCS_SET,
-			    temp) == CDF_STATUS_E_FAILURE) {
-		status = false;
-		hddLog(LOGE,
-			"Could not pass on WNI_CFG_VHT_BASIC_MCS_SET to CFG");
-	}
-
-	sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_RX_MCS_MAP, &temp);
-	temp = (temp & 0xFFFC) | hdd_config->vhtRxMCS;
-	if (hdd_config->enable2x2)
-		temp = (temp & 0xFFF3) | (hdd_config->vhtRxMCS2x2 << 2);
-	else
-		temp |= 0x000C;
-
-	if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_RX_MCS_MAP,
-			    temp) == CDF_STATUS_E_FAILURE) {
-		status = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_VHT_RX_MCS_MAP to CFG");
-	}
-
-	sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_TX_MCS_MAP, &temp);
-	temp = (temp & 0xFFFC) | hdd_config->vhtTxMCS;
-	if (hdd_config->enable2x2)
-		temp = (temp & 0xFFF3) | (hdd_config->vhtTxMCS2x2 << 2);
-	else
-		temp |= 0x000C;
-
-	if (sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_TX_MCS_MAP,
-			    temp) == CDF_STATUS_E_FAILURE) {
-		status = false;
-		hddLog(LOGE, "Could not pass on WNI_CFG_VHT_TX_MCS_MAP to CFG");
-	}
-
-#define WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES 0xff
-	val = SIZE_OF_SUPPORTED_MCS_SET;
-	sme_cfg_get_str(hdd_ctx->hHal, WNI_CFG_SUPPORTED_MCS_SET,
-			mcs_set_temp, &val);
-
-	mcs_set[0] = mcs_set_temp[0];
-	if (hdd_config->enable2x2)
-		for (val = 0; val < nss; val++)
-			mcs_set[val] = WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES;
-
-	if (sme_cfg_set_str(hdd_ctx->hHal, WNI_CFG_SUPPORTED_MCS_SET,
-			    mcs_set,
-			    SIZE_OF_SUPPORTED_MCS_SET) ==
-				CDF_STATUS_E_FAILURE) {
-		status = false;
-		hddLog(LOGE, "Could not pass on MCS SET to CFG");
-	}
-#undef WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES
-
-	if (CDF_STATUS_SUCCESS != sme_update_nss(hdd_ctx->hHal, nss))
-		status = false;
-
-	return (status == false) ? CDF_STATUS_E_FAILURE : CDF_STATUS_SUCCESS;
-}

+ 0 - 11325
core/hdd/src/wlan_hdd_cfg80211.c

@@ -1,11325 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_cfg80211.c
- *
- * WLAN Host Device Driver cfg80211 APIs implementation
- *
- */
-
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/etherdevice.h>
-#include <linux/wireless.h>
-#include <wlan_hdd_includes.h>
-#include <net/arp.h>
-#include <net/cfg80211.h>
-#include <cdf_trace.h>
-#ifdef CONFIG_CNSS
-#include <net/cnss.h>
-#endif
-#include <wlan_hdd_wowl.h>
-#include <ani_global.h>
-#include "sir_params.h"
-#include "dot11f.h"
-#include "wlan_hdd_assoc.h"
-#include "wlan_hdd_wext.h"
-#include "sme_api.h"
-#include "sme_power_save_api.h"
-#include "wlan_hdd_p2p.h"
-#include "wlan_hdd_cfg80211.h"
-#include "wlan_hdd_hostapd.h"
-#include "wlan_hdd_softap_tx_rx.h"
-#include "wlan_hdd_main.h"
-#include "wlan_hdd_power.h"
-#include "wlan_hdd_trace.h"
-#include "cdf_types.h"
-#include "cdf_trace.h"
-#include "cds_utils.h"
-#include "cds_sched.h"
-#include "wlan_hdd_scan.h"
-#include <qc_sap_ioctl.h>
-#include "wlan_hdd_tdls.h"
-#include "wlan_hdd_wmm.h"
-#include "wma_types.h"
-#include "wlan_hdd_misc.h"
-#include "wlan_hdd_nan.h"
-#include <wlan_hdd_ipa.h>
-#include "wlan_logging_sock_svc.h"
-
-#ifdef FEATURE_WLAN_EXTSCAN
-#include "wlan_hdd_ext_scan.h"
-#endif
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-#include "wlan_hdd_stats.h"
-#endif
-#include "cds_concurrency.h"
-#include "qwlan_version.h"
-#include "wlan_hdd_memdump.h"
-
-#include "wlan_hdd_ocb.h"
-
-#include "wlan_hdd_subnet_detect.h"
-
-#define g_mode_rates_size (12)
-#define a_mode_rates_size (8)
-#define GET_IE_LEN_IN_BSS_DESC(lenInBss) (lenInBss + sizeof(lenInBss) - \
-					   ((uintptr_t)OFFSET_OF(tSirBssDescription, ieFields)))
-
-/*
- * Android CTS verifier needs atleast this much wait time (in msec)
- */
-#define MAX_REMAIN_ON_CHANNEL_DURATION (5000)
-
-/*
- * Refer @tCfgProtection structure for definition of the bit map.
- * below value is obtained by setting the following bit-fields.
- * enable obss, fromllb, overlapOBSS and overlapFromllb protection.
- */
-#define IBSS_CFG_PROTECTION_ENABLE_MASK 0x8282
-
-#define HDD2GHZCHAN(freq, chan, flag)   {     \
-		.band =  IEEE80211_BAND_2GHZ, \
-		.center_freq = (freq), \
-		.hw_value = (chan), \
-		.flags = (flag), \
-		.max_antenna_gain = 0, \
-		.max_power = 30, \
-}
-
-#define HDD5GHZCHAN(freq, chan, flag)   {     \
-		.band =  IEEE80211_BAND_5GHZ, \
-		.center_freq = (freq), \
-		.hw_value = (chan), \
-		.flags = (flag), \
-		.max_antenna_gain = 0, \
-		.max_power = 30, \
-}
-
-#define HDD_G_MODE_RATETAB(rate, rate_id, flag)	\
-	{ \
-		.bitrate = rate, \
-		.hw_value = rate_id, \
-		.flags = flag, \
-	}
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-#define WLAN_AKM_SUITE_FT_8021X         0x000FAC03
-#define WLAN_AKM_SUITE_FT_PSK           0x000FAC04
-#endif
-
-#define HDD_CHANNEL_14 14
-
-#define MAX_TXPOWER_SCALE 4
-
-static const u32 hdd_cipher_suites[] = {
-	WLAN_CIPHER_SUITE_WEP40,
-	WLAN_CIPHER_SUITE_WEP104,
-	WLAN_CIPHER_SUITE_TKIP,
-#ifdef FEATURE_WLAN_ESE
-#define WLAN_CIPHER_SUITE_BTK 0x004096fe        /* use for BTK */
-#define WLAN_CIPHER_SUITE_KRK 0x004096ff        /* use for KRK */
-	WLAN_CIPHER_SUITE_BTK,
-	WLAN_CIPHER_SUITE_KRK,
-	WLAN_CIPHER_SUITE_CCMP,
-#else
-	WLAN_CIPHER_SUITE_CCMP,
-#endif
-#ifdef FEATURE_WLAN_WAPI
-	WLAN_CIPHER_SUITE_SMS4,
-#endif
-#ifdef WLAN_FEATURE_11W
-	WLAN_CIPHER_SUITE_AES_CMAC,
-#endif
-};
-
-static struct ieee80211_channel hdd_channels_2_4_ghz[] = {
-	HDD2GHZCHAN(2412, 1, 0),
-	HDD2GHZCHAN(2417, 2, 0),
-	HDD2GHZCHAN(2422, 3, 0),
-	HDD2GHZCHAN(2427, 4, 0),
-	HDD2GHZCHAN(2432, 5, 0),
-	HDD2GHZCHAN(2437, 6, 0),
-	HDD2GHZCHAN(2442, 7, 0),
-	HDD2GHZCHAN(2447, 8, 0),
-	HDD2GHZCHAN(2452, 9, 0),
-	HDD2GHZCHAN(2457, 10, 0),
-	HDD2GHZCHAN(2462, 11, 0),
-	HDD2GHZCHAN(2467, 12, 0),
-	HDD2GHZCHAN(2472, 13, 0),
-	HDD2GHZCHAN(2484, 14, 0),
-};
-
-static struct ieee80211_channel hdd_social_channels_2_4_ghz[] = {
-	HDD2GHZCHAN(2412, 1, 0),
-	HDD2GHZCHAN(2437, 6, 0),
-	HDD2GHZCHAN(2462, 11, 0),
-};
-
-static struct ieee80211_channel hdd_channels_5_ghz[] = {
-	HDD5GHZCHAN(5180, 36, 0),
-	HDD5GHZCHAN(5200, 40, 0),
-	HDD5GHZCHAN(5220, 44, 0),
-	HDD5GHZCHAN(5240, 48, 0),
-	HDD5GHZCHAN(5260, 52, 0),
-	HDD5GHZCHAN(5280, 56, 0),
-	HDD5GHZCHAN(5300, 60, 0),
-	HDD5GHZCHAN(5320, 64, 0),
-	HDD5GHZCHAN(5500, 100, 0),
-	HDD5GHZCHAN(5520, 104, 0),
-	HDD5GHZCHAN(5540, 108, 0),
-	HDD5GHZCHAN(5560, 112, 0),
-	HDD5GHZCHAN(5580, 116, 0),
-	HDD5GHZCHAN(5600, 120, 0),
-	HDD5GHZCHAN(5620, 124, 0),
-	HDD5GHZCHAN(5640, 128, 0),
-	HDD5GHZCHAN(5660, 132, 0),
-	HDD5GHZCHAN(5680, 136, 0),
-	HDD5GHZCHAN(5700, 140, 0),
-	HDD5GHZCHAN(5720, 144, 0),
-	HDD5GHZCHAN(5745, 149, 0),
-	HDD5GHZCHAN(5765, 153, 0),
-	HDD5GHZCHAN(5785, 157, 0),
-	HDD5GHZCHAN(5805, 161, 0),
-	HDD5GHZCHAN(5825, 165, 0),
-	HDD5GHZCHAN(5852, 170, 0),
-	HDD5GHZCHAN(5855, 171, 0),
-	HDD5GHZCHAN(5860, 172, 0),
-	HDD5GHZCHAN(5865, 173, 0),
-	HDD5GHZCHAN(5870, 174, 0),
-	HDD5GHZCHAN(5875, 175, 0),
-	HDD5GHZCHAN(5880, 176, 0),
-	HDD5GHZCHAN(5885, 177, 0),
-	HDD5GHZCHAN(5890, 178, 0),
-	HDD5GHZCHAN(5895, 179, 0),
-	HDD5GHZCHAN(5900, 180, 0),
-	HDD5GHZCHAN(5905, 181, 0),
-	HDD5GHZCHAN(5910, 182, 0),
-	HDD5GHZCHAN(5915, 183, 0),
-	HDD5GHZCHAN(5920, 184, 0),
-};
-
-static struct ieee80211_rate g_mode_rates[] = {
-	HDD_G_MODE_RATETAB(10, 0x1, 0),
-	HDD_G_MODE_RATETAB(20, 0x2, 0),
-	HDD_G_MODE_RATETAB(55, 0x4, 0),
-	HDD_G_MODE_RATETAB(110, 0x8, 0),
-	HDD_G_MODE_RATETAB(60, 0x10, 0),
-	HDD_G_MODE_RATETAB(90, 0x20, 0),
-	HDD_G_MODE_RATETAB(120, 0x40, 0),
-	HDD_G_MODE_RATETAB(180, 0x80, 0),
-	HDD_G_MODE_RATETAB(240, 0x100, 0),
-	HDD_G_MODE_RATETAB(360, 0x200, 0),
-	HDD_G_MODE_RATETAB(480, 0x400, 0),
-	HDD_G_MODE_RATETAB(540, 0x800, 0),
-};
-
-static struct ieee80211_rate a_mode_rates[] = {
-	HDD_G_MODE_RATETAB(60, 0x10, 0),
-	HDD_G_MODE_RATETAB(90, 0x20, 0),
-	HDD_G_MODE_RATETAB(120, 0x40, 0),
-	HDD_G_MODE_RATETAB(180, 0x80, 0),
-	HDD_G_MODE_RATETAB(240, 0x100, 0),
-	HDD_G_MODE_RATETAB(360, 0x200, 0),
-	HDD_G_MODE_RATETAB(480, 0x400, 0),
-	HDD_G_MODE_RATETAB(540, 0x800, 0),
-};
-
-static struct ieee80211_supported_band wlan_hdd_band_2_4_ghz = {
-	.channels = hdd_channels_2_4_ghz,
-	.n_channels = ARRAY_SIZE(hdd_channels_2_4_ghz),
-	.band = IEEE80211_BAND_2GHZ,
-	.bitrates = g_mode_rates,
-	.n_bitrates = g_mode_rates_size,
-	.ht_cap.ht_supported = 1,
-	.ht_cap.cap = IEEE80211_HT_CAP_SGI_20
-		      | IEEE80211_HT_CAP_GRN_FLD
-		      | IEEE80211_HT_CAP_DSSSCCK40
-		      | IEEE80211_HT_CAP_LSIG_TXOP_PROT
-		      | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SUP_WIDTH_20_40,
-	.ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
-	.ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
-	.ht_cap.mcs.rx_mask = {0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
-	.ht_cap.mcs.rx_highest = cpu_to_le16(72),
-	.ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED,
-};
-
-static struct ieee80211_supported_band wlan_hdd_band_p2p_2_4_ghz = {
-	.channels = hdd_social_channels_2_4_ghz,
-	.n_channels = ARRAY_SIZE(hdd_social_channels_2_4_ghz),
-	.band = IEEE80211_BAND_2GHZ,
-	.bitrates = g_mode_rates,
-	.n_bitrates = g_mode_rates_size,
-	.ht_cap.ht_supported = 1,
-	.ht_cap.cap = IEEE80211_HT_CAP_SGI_20
-		      | IEEE80211_HT_CAP_GRN_FLD
-		      | IEEE80211_HT_CAP_DSSSCCK40 | IEEE80211_HT_CAP_LSIG_TXOP_PROT,
-	.ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
-	.ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
-	.ht_cap.mcs.rx_mask = {0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
-	.ht_cap.mcs.rx_highest = cpu_to_le16(72),
-	.ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED,
-};
-
-static struct ieee80211_supported_band wlan_hdd_band_5_ghz = {
-	.channels = hdd_channels_5_ghz,
-	.n_channels = ARRAY_SIZE(hdd_channels_5_ghz),
-	.band = IEEE80211_BAND_5GHZ,
-	.bitrates = a_mode_rates,
-	.n_bitrates = a_mode_rates_size,
-	.ht_cap.ht_supported = 1,
-	.ht_cap.cap = IEEE80211_HT_CAP_SGI_20
-		      | IEEE80211_HT_CAP_GRN_FLD
-		      | IEEE80211_HT_CAP_DSSSCCK40
-		      | IEEE80211_HT_CAP_LSIG_TXOP_PROT
-		      | IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SUP_WIDTH_20_40,
-	.ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
-	.ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
-	.ht_cap.mcs.rx_mask = {0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0,},
-	.ht_cap.mcs.rx_highest = cpu_to_le16(72),
-	.ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED,
-	.vht_cap.vht_supported = 1,
-};
-
-/* This structure contain information what kind of frame are expected in
-     TX/RX direction for each kind of interface */
-static const struct ieee80211_txrx_stypes
-	wlan_hdd_txrx_stypes[NUM_NL80211_IFTYPES] = {
-	[NL80211_IFTYPE_STATION] = {
-		.tx = 0xffff,
-		.rx = BIT(SIR_MAC_MGMT_ACTION) |
-		      BIT(SIR_MAC_MGMT_PROBE_REQ),
-	},
-	[NL80211_IFTYPE_AP] = {
-		.tx = 0xffff,
-		.rx = BIT(SIR_MAC_MGMT_ASSOC_REQ) |
-		      BIT(SIR_MAC_MGMT_REASSOC_REQ) |
-		      BIT(SIR_MAC_MGMT_PROBE_REQ) |
-		      BIT(SIR_MAC_MGMT_DISASSOC) |
-		      BIT(SIR_MAC_MGMT_AUTH) |
-		      BIT(SIR_MAC_MGMT_DEAUTH) |
-		      BIT(SIR_MAC_MGMT_ACTION),
-	},
-	[NL80211_IFTYPE_ADHOC] = {
-		.tx = 0xffff,
-		.rx = BIT(SIR_MAC_MGMT_ASSOC_REQ) |
-		      BIT(SIR_MAC_MGMT_REASSOC_REQ) |
-		      BIT(SIR_MAC_MGMT_PROBE_REQ) |
-		      BIT(SIR_MAC_MGMT_DISASSOC) |
-		      BIT(SIR_MAC_MGMT_AUTH) |
-		      BIT(SIR_MAC_MGMT_DEAUTH) |
-		      BIT(SIR_MAC_MGMT_ACTION),
-	},
-	[NL80211_IFTYPE_P2P_CLIENT] = {
-		.tx = 0xffff,
-		.rx = BIT(SIR_MAC_MGMT_ACTION) |
-		      BIT(SIR_MAC_MGMT_PROBE_REQ),
-	},
-	[NL80211_IFTYPE_P2P_GO] = {
-		/* This is also same as for SoftAP */
-		.tx = 0xffff,
-		.rx = BIT(SIR_MAC_MGMT_ASSOC_REQ) |
-		      BIT(SIR_MAC_MGMT_REASSOC_REQ) |
-		      BIT(SIR_MAC_MGMT_PROBE_REQ) |
-		      BIT(SIR_MAC_MGMT_DISASSOC) |
-		      BIT(SIR_MAC_MGMT_AUTH) |
-		      BIT(SIR_MAC_MGMT_DEAUTH) |
-		      BIT(SIR_MAC_MGMT_ACTION),
-	},
-};
-
-/* Interface limits and combinations registered by the driver */
-
-/* STA ( + STA ) combination */
-static const struct ieee80211_iface_limit
-	wlan_hdd_sta_iface_limit[] = {
-	{
-		.max = 3,       /* p2p0 is a STA as well */
-		.types = BIT(NL80211_IFTYPE_STATION),
-	},
-};
-
-#ifndef QCA_WIFI_3_0_EMU
-/* ADHOC (IBSS) limit */
-static const struct ieee80211_iface_limit
-	wlan_hdd_adhoc_iface_limit[] = {
-	{
-		.max = 1,
-		.types = BIT(NL80211_IFTYPE_STATION),
-	},
-	{
-		.max = 1,
-		.types = BIT(NL80211_IFTYPE_ADHOC),
-	},
-};
-#else
-/* ADHOC (IBSS) limit */
-static const struct ieee80211_iface_limit
-	wlan_hdd_adhoc_iface_limit[] = {
-	{
-		.max = 1,
-		.types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP),
-	},
-	{
-		.max = 1,
-		.types = BIT(NL80211_IFTYPE_ADHOC),
-	},
-};
-#endif
-
-/* AP ( + AP ) combination */
-static const struct ieee80211_iface_limit
-	wlan_hdd_ap_iface_limit[] = {
-	{
-		.max = (CDF_MAX_NO_OF_SAP_MODE + SAP_MAX_OBSS_STA_CNT),
-		.types = BIT(NL80211_IFTYPE_AP),
-	},
-};
-
-/* P2P limit */
-static const struct ieee80211_iface_limit
-	wlan_hdd_p2p_iface_limit[] = {
-	{
-		.max = 1,
-		.types = BIT(NL80211_IFTYPE_P2P_CLIENT),
-	},
-	{
-		.max = 1,
-		.types = BIT(NL80211_IFTYPE_P2P_GO),
-	},
-};
-
-static const struct ieee80211_iface_limit
-	wlan_hdd_sta_ap_iface_limit[] = {
-	{
-		/* We need 1 extra STA interface for OBSS scan when SAP starts
-		 * with HT40 in STA+SAP concurrency mode
-		 */
-		.max = (1 + SAP_MAX_OBSS_STA_CNT),
-		.types = BIT(NL80211_IFTYPE_STATION),
-	},
-	{
-		.max = CDF_MAX_NO_OF_SAP_MODE,
-		.types = BIT(NL80211_IFTYPE_AP),
-	},
-};
-
-/* STA + P2P combination */
-static const struct ieee80211_iface_limit
-	wlan_hdd_sta_p2p_iface_limit[] = {
-	{
-		/* One reserved for dedicated P2PDEV usage */
-		.max = 2,
-		.types = BIT(NL80211_IFTYPE_STATION)
-	},
-	{
-		/* Support for two identical (GO + GO or CLI + CLI)
-		 * or dissimilar (GO + CLI) P2P interfaces
-		 */
-		.max = 2,
-		.types = BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_CLIENT),
-	},
-};
-
-/* STA + AP + P2PGO combination */
-static const struct ieee80211_iface_limit
-wlan_hdd_sta_ap_p2pgo_iface_limit[] = {
-	/* Support for AP+P2PGO interfaces */
-	{
-	   .max = 2,
-	   .types = BIT(NL80211_IFTYPE_STATION)
-	},
-	{
-	   .max = 1,
-	   .types = BIT(NL80211_IFTYPE_P2P_GO)
-	},
-	{
-	   .max = 1,
-	   .types = BIT(NL80211_IFTYPE_AP)
-	}
-};
-
-/* SAP + P2P combination */
-static const struct ieee80211_iface_limit
-wlan_hdd_sap_p2p_iface_limit[] = {
-	{
-	   /* 1 dedicated for p2p0 which is a STA type */
-	   .max = 1,
-	   .types = BIT(NL80211_IFTYPE_STATION)
-	},
-	{
-	   /* The p2p interface in SAP+P2P can be GO/CLI.
-	    * The p2p connection can be formed on p2p0 or p2p-p2p0-x.
-	    */
-	   .max = 1,
-	   .types = BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_CLIENT)
-	},
-	{
-	   /* SAP+GO to support only one SAP interface */
-	   .max = 1,
-	   .types = BIT(NL80211_IFTYPE_AP)
-	}
-};
-
-/* P2P + P2P combination */
-static const struct ieee80211_iface_limit
-wlan_hdd_p2p_p2p_iface_limit[] = {
-	{
-	   /* 1 dedicated for p2p0 which is a STA type */
-	   .max = 1,
-	   .types = BIT(NL80211_IFTYPE_STATION)
-	},
-	{
-	   /* The p2p interface in P2P+P2P can be GO/CLI.
-	    * For P2P+P2P, the new interfaces are formed on p2p-p2p0-x.
-	    */
-	   .max = 2,
-	   .types = BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_CLIENT)
-	},
-};
-
-static struct ieee80211_iface_combination
-	wlan_hdd_iface_combination[] = {
-	/* STA */
-	{
-		.limits = wlan_hdd_sta_iface_limit,
-		.num_different_channels = 2,
-		.max_interfaces = 3,
-		.n_limits = ARRAY_SIZE(wlan_hdd_sta_iface_limit),
-	},
-	/* ADHOC */
-	{
-		.limits = wlan_hdd_adhoc_iface_limit,
-		.num_different_channels = 2,
-		.max_interfaces = 2,
-		.n_limits = ARRAY_SIZE(wlan_hdd_adhoc_iface_limit),
-	},
-	/* AP */
-	{
-		.limits = wlan_hdd_ap_iface_limit,
-		.num_different_channels = 2,
-		.max_interfaces = (SAP_MAX_OBSS_STA_CNT + CDF_MAX_NO_OF_SAP_MODE),
-		.n_limits = ARRAY_SIZE(wlan_hdd_ap_iface_limit),
-	},
-	/* P2P */
-	{
-		.limits = wlan_hdd_p2p_iface_limit,
-		.num_different_channels = 2,
-		.max_interfaces = 2,
-		.n_limits = ARRAY_SIZE(wlan_hdd_p2p_iface_limit),
-	},
-	/* STA + AP */
-	{
-		.limits = wlan_hdd_sta_ap_iface_limit,
-		.num_different_channels = 2,
-		.max_interfaces = (1 + SAP_MAX_OBSS_STA_CNT + CDF_MAX_NO_OF_SAP_MODE),
-		.n_limits = ARRAY_SIZE(wlan_hdd_sta_ap_iface_limit),
-		.beacon_int_infra_match = true,
-	},
-	/* STA + P2P */
-	{
-		.limits = wlan_hdd_sta_p2p_iface_limit,
-		.num_different_channels = 2,
-		/* one interface reserved for P2PDEV dedicated usage */
-		.max_interfaces = 4,
-		.n_limits = ARRAY_SIZE(wlan_hdd_sta_p2p_iface_limit),
-		.beacon_int_infra_match = true,
-	},
-	/* STA + P2P GO + SAP */
-	{
-		.limits = wlan_hdd_sta_ap_p2pgo_iface_limit,
-		/* we can allow 3 channels for three different persona
-		 * but due to firmware limitation, allow max 2 concrnt channels.
-		 */
-		.num_different_channels = 2,
-		/* one interface reserved for P2PDEV dedicated usage */
-		.max_interfaces = 4,
-		.n_limits = ARRAY_SIZE(wlan_hdd_sta_ap_p2pgo_iface_limit),
-		.beacon_int_infra_match = true,
-	},
-	/* SAP + P2P */
-	{
-		.limits = wlan_hdd_sap_p2p_iface_limit,
-		.num_different_channels = 2,
-		/* 1-p2p0 + 1-SAP + 1-P2P (on p2p0 or p2p-p2p0-x) */
-		.max_interfaces = 3,
-		.n_limits = ARRAY_SIZE(wlan_hdd_sap_p2p_iface_limit),
-		.beacon_int_infra_match = true,
-	},
-	/* P2P + P2P */
-	{
-		.limits = wlan_hdd_p2p_p2p_iface_limit,
-		.num_different_channels = 2,
-		/* 1-p2p0 + 2-P2P (on p2p-p2p0-x) */
-		.max_interfaces = 3,
-		.n_limits = ARRAY_SIZE(wlan_hdd_p2p_p2p_iface_limit),
-		.beacon_int_infra_match = true,
-	},
-};
-
-static struct cfg80211_ops wlan_hdd_cfg80211_ops;
-
-
-#ifdef WLAN_NL80211_TESTMODE
-enum wlan_hdd_tm_attr {
-	WLAN_HDD_TM_ATTR_INVALID = 0,
-	WLAN_HDD_TM_ATTR_CMD = 1,
-	WLAN_HDD_TM_ATTR_DATA = 2,
-	WLAN_HDD_TM_ATTR_STREAM_ID = 3,
-	WLAN_HDD_TM_ATTR_TYPE = 4,
-	/* keep last */
-	WLAN_HDD_TM_ATTR_AFTER_LAST,
-	WLAN_HDD_TM_ATTR_MAX = WLAN_HDD_TM_ATTR_AFTER_LAST - 1,
-};
-
-enum wlan_hdd_tm_cmd {
-	WLAN_HDD_TM_CMD_WLAN_FTM = 0,
-	WLAN_HDD_TM_CMD_WLAN_HB = 1,
-};
-
-#define WLAN_HDD_TM_DATA_MAX_LEN    5000
-
-static const struct nla_policy wlan_hdd_tm_policy[WLAN_HDD_TM_ATTR_MAX + 1] = {
-	[WLAN_HDD_TM_ATTR_CMD] = {.type = NLA_U32},
-	[WLAN_HDD_TM_ATTR_DATA] = {.type = NLA_BINARY,
-				   .len = WLAN_HDD_TM_DATA_MAX_LEN},
-};
-#endif /* WLAN_NL80211_TESTMODE */
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-static const struct wiphy_wowlan_support wowlan_support_cfg80211_init = {
-	.flags = WIPHY_WOWLAN_MAGIC_PKT,
-	.n_patterns = WOWL_MAX_PTRNS_ALLOWED,
-	.pattern_min_len = 1,
-	.pattern_max_len = WOWL_PTRN_MAX_SIZE,
-};
-#endif
-
-/**
- * hdd_add_channel_switch_support()- Adds Channel Switch flag if supported
- * @flags: Pointer to the flags to Add channel switch flag.
- *
- * This Function adds Channel Switch support flag, if channel switch is
- * supported by kernel.
- * Return: void.
- */
-#ifdef CHANNEL_SWITCH_SUPPORTED
-static inline void hdd_add_channel_switch_support(uint32_t *flags)
-{
-	*flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
-	return;
-}
-#else
-static inline void hdd_add_channel_switch_support(uint32_t *flags)
-{
-	return;
-}
-#endif
-
-#ifdef FEATURE_WLAN_TDLS
-
-/* TDLS capabilities params */
-#define PARAM_MAX_TDLS_SESSION \
-		QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_MAX_CONC_SESSIONS
-#define PARAM_TDLS_FEATURE_SUPPORT \
-		QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_FEATURES_SUPPORTED
-
-/**
- * __wlan_hdd_cfg80211_get_tdls_capabilities() - Provide TDLS Capabilites.
- * @wiphy:    WIPHY structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function provides TDLS capabilities
- *
- * Return: 0 on success and errno on failure
- */
-static int __wlan_hdd_cfg80211_get_tdls_capabilities(struct wiphy *wiphy,
-						     struct wireless_dev *wdev,
-						     const void *data,
-						     int data_len)
-{
-	int status;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct sk_buff *skb;
-	uint32_t set = 0;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (status)
-		return status;
-
-	skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (2 * sizeof(u32)) +
-						   NLMSG_HDRLEN);
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		goto fail;
-	}
-
-	if (false == hdd_ctx->config->fEnableTDLSSupport) {
-		hddLog(LOGE,
-			FL("TDLS feature not Enabled or Not supported in FW"));
-		if (nla_put_u32(skb, PARAM_MAX_TDLS_SESSION, 0) ||
-			nla_put_u32(skb, PARAM_TDLS_FEATURE_SUPPORT, 0)) {
-			hddLog(LOGE, FL("nla put fail"));
-			goto fail;
-		}
-	} else {
-		set = set | WIFI_TDLS_SUPPORT;
-		set = set | (hdd_ctx->config->fTDLSExternalControl ?
-					WIFI_TDLS_EXTERNAL_CONTROL_SUPPORT : 0);
-		set = set | (hdd_ctx->config->fEnableTDLSOffChannel ?
-					WIIF_TDLS_OFFCHANNEL_SUPPORT : 0);
-		hddLog(LOG1, FL("TDLS Feature supported value %x"), set);
-		if (nla_put_u32(skb, PARAM_MAX_TDLS_SESSION,
-				 hdd_ctx->max_num_tdls_sta) ||
-			nla_put_u32(skb, PARAM_TDLS_FEATURE_SUPPORT,
-				 set)) {
-			hddLog(LOGE, FL("nla put fail"));
-			goto fail;
-		}
-	}
-	return cfg80211_vendor_cmd_reply(skb);
-fail:
-	if (skb)
-		kfree_skb(skb);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_get_tdls_capabilities() - Provide TDLS Capabilites.
- * @wiphy:    WIPHY structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function provides TDLS capabilities
- *
- * Return: 0 on success and errno on failure
- */
-static int
-wlan_hdd_cfg80211_get_tdls_capabilities(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_tdls_capabilities(wiphy, wdev,
-							data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-#endif
-
-#ifdef QCA_HT_2040_COEX
-static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work);
-#endif
-
-#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
-/*
- * FUNCTION: wlan_hdd_send_avoid_freq_event
- * This is called when wlan driver needs to send vendor specific
- * avoid frequency range event to userspace
- */
-int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx,
-				   tHddAvoidFreqList *pAvoidFreqList)
-{
-	struct sk_buff *vendor_event;
-
-	ENTER();
-
-	if (!pHddCtx) {
-		hddLog(LOGE, FL("HDD context is null"));
-		return -EINVAL;
-	}
-
-	if (!pAvoidFreqList) {
-		hddLog(LOGE, FL("pAvoidFreqList is null"));
-		return -EINVAL;
-	}
-
-	vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy,
-						   NULL,
-						   sizeof(tHddAvoidFreqList),
-						   QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX,
-						   GFP_KERNEL);
-	if (!vendor_event) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return -EINVAL;
-	}
-
-	memcpy(skb_put(vendor_event, sizeof(tHddAvoidFreqList)),
-	       (void *)pAvoidFreqList, sizeof(tHddAvoidFreqList));
-
-	cfg80211_vendor_event(vendor_event, GFP_KERNEL);
-
-	EXIT();
-	return 0;
-}
-#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
-
-/* vendor specific events */
-static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] = {
-#ifdef FEATURE_WLAN_CH_AVOID
-	[QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY
-	},
-#endif /* FEATURE_WLAN_CH_AVOID */
-
-#ifdef WLAN_FEATURE_NAN
-	[QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_NAN
-	},
-#endif
-
-#ifdef WLAN_FEATURE_STATS_EXT
-	[QCA_NL80211_VENDOR_SUBCMD_STATS_EXT_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_STATS_EXT
-	},
-#endif /* WLAN_FEATURE_STATS_EXT */
-#ifdef FEATURE_WLAN_EXTSCAN
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.
-		subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.
-		subcmd
-			=
-				QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.
-		subcmd
-			=
-				QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.
-		subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.
-		subcmd
-			=
-				QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE_INDEX] = {
-		.
-		vendor_id
-			=
-				QCA_NL80211_VENDOR_ID,
-		.
-		subcmd
-			=
-				QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST
-	},
-#endif /* FEATURE_WLAN_EXTSCAN */
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-	[QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_LL_RADIO_STATS_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_LL_STATS_RADIO_RESULTS
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_LL_IFACE_STATS_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_LL_STATS_IFACE_RESULTS
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_LL_PEER_INFO_STATS_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_LL_STATS_PEERS_RESULTS
-	},
-#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
-	[QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE_CHANGE_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_DO_ACS_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_DO_ACS
-	},
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	[QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH_INDEX] = {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH
-	},
-#endif
-	[QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED_INDEX] =  {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED_INDEX] =  {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED_INDEX] =  {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED_INDEX] =  {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED_INDEX] =  {
-		.vendor_id =
-			QCA_NL80211_VENDOR_ID,
-		.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED
-	},
-#ifdef FEATURE_WLAN_EXTSCAN
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST
-	},
-#endif /* FEATURE_WLAN_EXTSCAN */
-	[QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI
-	},
-#ifdef WLAN_FEATURE_MEMDUMP
-	[QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP
-	},
-#endif /* WLAN_FEATURE_MEMDUMP */
-	[QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE
-	},
-	[QCA_NL80211_VENDOR_SUBCMD_SCAN_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN
-	},
-	/* OCB events */
-	[QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT
-	},
-#ifdef FEATURE_LFR_SUBNET_DETECTION
-	[QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG_INDEX] = {
-		.vendor_id = QCA_NL80211_VENDOR_ID,
-		.subcmd = QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG
-	},
-#endif /*FEATURE_LFR_SUBNET_DETECTION */
-};
-
-/**
- * __is_driver_dfs_capable() - get driver DFS capability
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This function is called by userspace to indicate whether or not
- * the driver supports DFS offload.
- *
- * Return: 0 on success, negative errno on failure
- */
-static int __is_driver_dfs_capable(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data,
-				   int data_len)
-{
-	u32 dfs_capability = 0;
-	struct sk_buff *temp_skbuff;
-	int ret_val;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-
-	ENTER();
-
-	ret_val = wlan_hdd_validate_context(hdd_ctx);
-	if (ret_val)
-		return ret_val;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	dfs_capability = !!(wiphy->flags & WIPHY_FLAG_DFS_OFFLOAD);
-
-	temp_skbuff = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u32) +
-							  NLMSG_HDRLEN);
-
-	if (temp_skbuff != NULL) {
-		ret_val = nla_put_u32(temp_skbuff, QCA_WLAN_VENDOR_ATTR_DFS,
-				      dfs_capability);
-		if (ret_val) {
-			hddLog(LOGE, FL("QCA_WLAN_VENDOR_ATTR_DFS put fail"));
-			kfree_skb(temp_skbuff);
-
-			return ret_val;
-		}
-
-		return cfg80211_vendor_cmd_reply(temp_skbuff);
-	}
-
-	hddLog(LOGE, FL("dfs capability: buffer alloc fail"));
-	return -ENOMEM;
-}
-
-/**
- * is_driver_dfs_capable() - get driver DFS capability
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This function is called by userspace to indicate whether or not
- * the driver supports DFS offload.  This is an SSR-protected
- * wrapper function.
- *
- * Return: 0 on success, negative errno on failure
- */
-static int is_driver_dfs_capable(struct wiphy *wiphy,
-				 struct wireless_dev *wdev,
-				 const void *data,
-				 int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __is_driver_dfs_capable(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_sap_cfg_dfs_override() - DFS MCC restriction check
- *
- * @adapter: SAP adapter pointer
- *
- * DFS in MCC is not supported for Multi bssid SAP mode due to single physical
- * radio. So in case of DFS MCC scenario override current SAP given config
- * to follow concurrent SAP DFS config
- *
- * Return: 0 - No DFS issue, 1 - Override done and negative error codes
- */
-
-#ifdef WLAN_FEATURE_MBSSID
-int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter)
-{
-	hdd_adapter_t *con_sap_adapter;
-	tsap_Config_t *sap_config, *con_sap_config;
-	int con_ch;
-
-	/*
-	 * Check if AP+AP case, once primary AP chooses a DFS
-	 * channel secondary AP should always follow primary APs channel
-	 */
-	if (!cds_concurrent_beaconing_sessions_running())
-		return 0;
-
-	con_sap_adapter = hdd_get_con_sap_adapter(adapter, true);
-	if (!con_sap_adapter)
-		return 0;
-
-	sap_config = &adapter->sessionCtx.ap.sapConfig;
-	con_sap_config = &con_sap_adapter->sessionCtx.ap.sapConfig;
-	con_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
-
-	if (!CDS_IS_DFS_CH(con_ch))
-		return 0;
-
-	hddLog(LOGE, FL("Only SCC AP-AP DFS Permitted (ch=%d, con_ch=%d)"),
-						sap_config->channel, con_ch);
-	hddLog(LOG1, FL("Overriding guest AP's channel"));
-	sap_config->channel = con_ch;
-
-	if (con_sap_config->acs_cfg.acs_mode == true) {
-		if (con_ch != con_sap_config->acs_cfg.pri_ch &&
-				con_ch != con_sap_config->acs_cfg.ht_sec_ch) {
-			hddLog(LOGE, FL("Primary AP channel config error"));
-			hddLog(LOGE, FL("Operating ch: %d ACS ch: %d %d"),
-				con_ch, con_sap_config->acs_cfg.pri_ch,
-				con_sap_config->acs_cfg.ht_sec_ch);
-			return -EINVAL;
-		}
-		/* Sec AP ACS info is overwritten with Pri AP due to DFS
-		 * MCC restriction. So free ch list allocated in do_acs
-		 * func for Sec AP and realloc for Pri AP ch list size
-		 */
-		if (sap_config->acs_cfg.ch_list)
-			cdf_mem_free(sap_config->acs_cfg.ch_list);
-
-		cdf_mem_copy(&sap_config->acs_cfg,
-					&con_sap_config->acs_cfg,
-					sizeof(struct sap_acs_cfg));
-		sap_config->acs_cfg.ch_list = cdf_mem_malloc(
-					sizeof(uint8_t) *
-					con_sap_config->acs_cfg.ch_list_count);
-		if (!sap_config->acs_cfg.ch_list) {
-			hddLog(LOGE, FL("ACS config alloc fail"));
-			return -ENOMEM;
-		}
-
-		cdf_mem_copy(sap_config->acs_cfg.ch_list,
-					con_sap_config->acs_cfg.ch_list,
-					con_sap_config->acs_cfg.ch_list_count);
-
-	} else {
-		sap_config->acs_cfg.pri_ch = con_ch;
-		if (sap_config->acs_cfg.ch_width > eHT_CHANNEL_WIDTH_20MHZ)
-			sap_config->acs_cfg.ht_sec_ch = con_sap_config->sec_ch;
-	}
-
-	return con_ch;
-}
-#else
-int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter)
-{
-	return 0;
-}
-#endif
-
-/**
- * wlan_hdd_set_acs_ch_range : Start ACS channel range values
- * @sap_cfg: pointer to SAP config struct
- *
- * This function sets the default ACS start and end channel for the given band
- * and also parses the given ACS channel list.
- *
- * Return: None
- */
-
-static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled,
-							bool vht_enabled)
-{
-	int i;
-	if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211B) {
-		sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11b;
-		sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_1);
-		sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_14);
-	} else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211G) {
-		sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11g;
-		sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_1);
-		sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_13);
-	} else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211A) {
-		sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11a;
-		sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_36);
-		sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_165);
-	} else if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211ANY) {
-		sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_abg;
-		sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(RF_CHAN_1);
-		sap_cfg->acs_cfg.end_ch = CDS_CHANNEL_NUM(RF_CHAN_165);
-	}
-
-	if (ht_enabled)
-		sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11n;
-
-	if (vht_enabled)
-		sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac;
-
-
-	/* Parse ACS Chan list from hostapd */
-	if (!sap_cfg->acs_cfg.ch_list)
-		return;
-
-	sap_cfg->acs_cfg.start_ch = sap_cfg->acs_cfg.ch_list[0];
-	sap_cfg->acs_cfg.end_ch =
-		sap_cfg->acs_cfg.ch_list[sap_cfg->acs_cfg.ch_list_count - 1];
-	for (i = 0; i < sap_cfg->acs_cfg.ch_list_count; i++) {
-		if (sap_cfg->acs_cfg.start_ch > sap_cfg->acs_cfg.ch_list[i])
-			sap_cfg->acs_cfg.start_ch = sap_cfg->acs_cfg.ch_list[i];
-		if (sap_cfg->acs_cfg.end_ch < sap_cfg->acs_cfg.ch_list[i])
-			sap_cfg->acs_cfg.end_ch = sap_cfg->acs_cfg.ch_list[i];
-	}
-}
-
-
-static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work);
-
-/**
- * wlan_hdd_cfg80211_start_acs : Start ACS Procedure for SAP
- * @adapter: pointer to SAP adapter struct
- *
- * This function starts the ACS procedure if there are no
- * constraints like MBSSID DFS restrictions.
- *
- * Return: Status of ACS Start procedure
- */
-
-static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
-{
-
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	tsap_Config_t *sap_config;
-	tpWLAN_SAPEventCB acs_event_callback;
-	int status;
-
-	sap_config = &adapter->sessionCtx.ap.sapConfig;
-	sap_config->channel = AUTO_CHANNEL_SELECT;
-
-	status = wlan_hdd_sap_cfg_dfs_override(adapter);
-	if (status < 0) {
-		return status;
-	} else {
-		if (status > 0) {
-			/*notify hostapd about channel override */
-			wlan_hdd_cfg80211_acs_ch_select_evt(adapter);
-			clear_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags);
-			return 0;
-		}
-	}
-	status = wlan_hdd_config_acs(hdd_ctx, adapter);
-	if (status) {
-		hddLog(LOGE, FL("ACS config failed"));
-		return -EINVAL;
-	}
-
-	acs_event_callback = hdd_hostapd_sap_event_cb;
-
-	cdf_mem_copy(sap_config->self_macaddr.bytes,
-		adapter->macAddressCurrent.bytes, sizeof(struct cdf_mac_addr));
-	hddLog(LOG1, FL("ACS Started for wlan%d"), adapter->dev->ifindex);
-	status = wlansap_acs_chselect(
-#ifdef WLAN_FEATURE_MBSSID
-		WLAN_HDD_GET_SAP_CTX_PTR(adapter),
-#else
-		hdd_ctx->pcds_context,
-#endif
-		acs_event_callback, sap_config, adapter->dev);
-
-
-	if (status) {
-		hddLog(LOGE, FL("ACS channel select failed"));
-		return -EINVAL;
-	}
-	sap_config->acs_cfg.acs_mode = true;
-	set_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags);
-
-	return 0;
-}
-
-/**
- * __wlan_hdd_cfg80211_do_acs : CFG80211 handler function for DO_ACS Vendor CMD
- * @wiphy:  Linux wiphy struct pointer
- * @wdev:   Linux wireless device struct pointer
- * @data:   ACS information from hostapd
- * @data_len: ACS information length
- *
- * This function handle DO_ACS Vendor command from hostapd, parses ACS config
- * and starts ACS procedure.
- *
- * Return: ACS procedure start status
- */
-
-static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	struct net_device *ndev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	tsap_Config_t *sap_config;
-	struct sk_buff *temp_skbuff;
-	int status = -EINVAL, i = 0;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_ACS_MAX + 1];
-	bool ht_enabled, ht40_enabled, vht_enabled;
-	uint8_t ch_width;
-
-	/* ***Note*** Donot set SME config related to ACS operation here because
-	 * ACS operation is not synchronouse and ACS for Second AP may come when
-	 * ACS operation for first AP is going on. So only do_acs is split to
-	 * seperate start_acs routine. Also SME-PMAC struct that is used to
-	 * pass paremeters from HDD to SAP is global. Thus All ACS related SME
-	 * config shall be set only from start_acs.
-	 */
-
-	/* nla_policy Policy template. Policy not applied as some attributes are
-	 * optional and QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST has variable length
-	 *
-	 * [QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE] = { .type = NLA_U8 },
-	 * [QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED] = { .type = NLA_FLAG },
-	 * [QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED] = { .type = NLA_FLAG },
-	 * [QCA_WLAN_VENDOR_ATTR_ACS_VHT_ENABLED] = { .type = NLA_FLAG },
-	 * [QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH] = { .type = NLA_U16 },
-	 * [QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST] = { .type = NLA_NESTED },
-	 */
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (hdd_ctx->config->force_sap_acs) {
-		hddLog(LOGE, FL("Hostapd ACS rejected as Driver ACS enabled"));
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		goto out;
-	}
-	sap_config = &adapter->sessionCtx.ap.sapConfig;
-	cdf_mem_zero(&sap_config->acs_cfg, sizeof(struct sap_acs_cfg));
-
-	status = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ACS_MAX, data, data_len,
-						NULL);
-	if (status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("Invalid ATTR"));
-		goto out;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE]) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("Attr hw_mode failed"));
-		goto out;
-	}
-	sap_config->acs_cfg.hw_mode = nla_get_u8(
-					tb[QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE]);
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED])
-		ht_enabled =
-			nla_get_flag(tb[QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED]);
-	else
-		ht_enabled = 0;
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED])
-		ht40_enabled =
-			nla_get_flag(tb[QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED]);
-	else
-		ht40_enabled = 0;
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_ACS_VHT_ENABLED])
-		vht_enabled =
-			nla_get_flag(tb[QCA_WLAN_VENDOR_ATTR_ACS_VHT_ENABLED]);
-	else
-		vht_enabled = 0;
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]) {
-		ch_width = nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]);
-	} else {
-		if (ht_enabled && ht40_enabled)
-			ch_width = 40;
-		else
-			ch_width = 20;
-	}
-	if (ch_width == 80)
-		sap_config->acs_cfg.ch_width = CH_WIDTH_80MHZ;
-	else if (ch_width == 40)
-		sap_config->acs_cfg.ch_width = CH_WIDTH_40MHZ;
-	else
-		sap_config->acs_cfg.ch_width = CH_WIDTH_20MHZ;
-
-	/* hw_mode = a/b/g: QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST and
-	 * QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST attrs are present, and
-	 * QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST is used for obtaining the
-	 * channel list, QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST is ignored
-	 * since it contains the frequency values of the channels in
-	 * the channel list.
-	 * hw_mode = any: only QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST attr
-	 * is present
-	 */
-	if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]) {
-		char *tmp = nla_data(tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]);
-		sap_config->acs_cfg.ch_list_count = nla_len(
-					tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]);
-		if (sap_config->acs_cfg.ch_list_count) {
-			sap_config->acs_cfg.ch_list = cdf_mem_malloc(
-					sizeof(uint8_t) *
-					sap_config->acs_cfg.ch_list_count);
-			if (sap_config->acs_cfg.ch_list == NULL)
-				goto out;
-
-			cdf_mem_copy(sap_config->acs_cfg.ch_list, tmp,
-					sap_config->acs_cfg.ch_list_count);
-		}
-	} else if (tb[QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST]) {
-		uint32_t *freq =
-			nla_data(tb[QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST]);
-		sap_config->acs_cfg.ch_list_count = nla_len(
-			tb[QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST]) /
-				sizeof(uint32_t);
-		if (sap_config->acs_cfg.ch_list_count) {
-			sap_config->acs_cfg.ch_list = cdf_mem_malloc(
-				sap_config->acs_cfg.ch_list_count);
-			if (sap_config->acs_cfg.ch_list == NULL) {
-				hddLog(LOGE, FL("ACS config alloc fail"));
-				status = -ENOMEM;
-				goto out;
-			}
-
-			/* convert frequency to channel */
-			for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++)
-				sap_config->acs_cfg.ch_list[i] =
-					ieee80211_frequency_to_channel(freq[i]);
-		}
-	}
-
-	hdd_debug("get pcl for DO_ACS vendor command");
-
-	/* consult policy manager to get PCL */
-	status = cds_get_pcl(CDS_SAP_MODE,
-					sap_config->acs_cfg.pcl_channels,
-					&sap_config->acs_cfg.pcl_ch_count);
-	if (CDF_STATUS_SUCCESS != status)
-		hddLog(LOGE, FL("Get PCL failed"));
-
-	wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled);
-
-	/* ACS override for android */
-	if (hdd_ctx->config->sap_p2p_11ac_override && ht_enabled) {
-		hddLog(LOG1, FL("ACS Config override for 11AC"));
-		vht_enabled = 1;
-		sap_config->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac;
-		sap_config->acs_cfg.ch_width =
-					hdd_ctx->config->vhtChannelWidth;
-		/* No VHT80 in 2.4G so perform ACS accordingly */
-		if (sap_config->acs_cfg.end_ch <= 14 &&
-			sap_config->acs_cfg.ch_width == eHT_CHANNEL_WIDTH_80MHZ)
-			sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_40MHZ;
-	}
-
-	hddLog(LOG1, FL("ACS Config for wlan%d: HW_MODE: %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d"),
-		adapter->dev->ifindex, sap_config->acs_cfg.hw_mode,
-		ch_width, ht_enabled, vht_enabled,
-		sap_config->acs_cfg.start_ch, sap_config->acs_cfg.end_ch);
-
-	if (sap_config->acs_cfg.ch_list_count) {
-		hddLog(LOG1, FL("ACS channel list: len: %d"),
-					sap_config->acs_cfg.ch_list_count);
-		for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++)
-			hddLog(LOG1, "%d ", sap_config->acs_cfg.ch_list[i]);
-	}
-	sap_config->acs_cfg.acs_mode = true;
-	if (test_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags)) {
-		/* ***Note*** Completion variable usage is not allowed here since
-		 * ACS scan operation may take max 2.2 sec for 5G band.
-		 * 9 Active channel X 40 ms active scan time +
-		 * 16 Passive channel X 110ms passive scan time
-		 * Since this CFG80211 call lock rtnl mutex, we cannot hold on
-		 * for this long. So we split up the scanning part.
-		 */
-		set_bit(ACS_PENDING, &adapter->event_flags);
-		hddLog(LOG1, FL("ACS Pending for wlan%d"),
-							adapter->dev->ifindex);
-		status = 0;
-	} else {
-		status = wlan_hdd_cfg80211_start_acs(adapter);
-	}
-
-out:
-	if (0 == status) {
-		temp_skbuff = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
-							      NLMSG_HDRLEN);
-		if (temp_skbuff != NULL)
-			return cfg80211_vendor_cmd_reply(temp_skbuff);
-	}
-
-	clear_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags);
-
-	return status;
-}
-
- /**
- * wlan_hdd_cfg80211_do_acs : CFG80211 handler function for DO_ACS Vendor CMD
- * @wiphy:  Linux wiphy struct pointer
- * @wdev:   Linux wireless device struct pointer
- * @data:   ACS information from hostapd
- * @data_len: ACS information len
- *
- * This function handle DO_ACS Vendor command from hostapd, parses ACS config
- * and starts ACS procedure.
- *
- * Return: ACS procedure start status
- */
-
-static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
-				    struct wireless_dev *wdev,
-				    const void *data, int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_do_acs(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_start_pending_acs : Start pending ACS procedure for SAP
- * @work:  Linux workqueue struct pointer for ACS work
- *
- * This function starts the ACS procedure which was marked pending when an ACS
- * procedure was in progress for a concurrent SAP interface.
- *
- * Return: None
- */
-
-static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work)
-{
-	hdd_adapter_t *adapter = container_of(work, hdd_adapter_t,
-							acs_pending_work.work);
-	wlan_hdd_cfg80211_start_acs(adapter);
-}
-
-/**
- * wlan_hdd_cfg80211_acs_ch_select_evt: Callback function for ACS evt
- * @adapter: Pointer to SAP adapter struct
- * @pri_channel: SAP ACS procedure selected Primary channel
- * @sec_channel: SAP ACS procedure selected secondary channel
- *
- * This is a callback function from SAP module on ACS procedure is completed.
- * This function send the ACS selected channel information to hostapd
- *
- * Return: None
- */
-
-void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	tsap_Config_t *sap_cfg = &(WLAN_HDD_GET_AP_CTX_PTR(adapter))->sapConfig;
-	struct sk_buff *vendor_event;
-	int ret_val;
-	hdd_adapter_t *con_sap_adapter;
-	uint16_t ch_width;
-
-	vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
-			NULL,
-			4 * sizeof(u8) + 1 * sizeof(u16) + 4 + NLMSG_HDRLEN,
-			QCA_NL80211_VENDOR_SUBCMD_DO_ACS_INDEX,
-			GFP_KERNEL);
-
-	if (!vendor_event) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-
-	ret_val = hdd_vendor_put_ifindex(vendor_event, adapter->dev->ifindex);
-	if (ret_val) {
-		hddLog(LOGE, FL("NL80211_ATTR_IFINDEX put fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	ret_val = nla_put_u8(vendor_event,
-				QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL,
-				sap_cfg->acs_cfg.pri_ch);
-	if (ret_val) {
-		hddLog(LOGE,
-			FL("QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL put fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	ret_val = nla_put_u8(vendor_event,
-				QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL,
-				sap_cfg->acs_cfg.ht_sec_ch);
-	if (ret_val) {
-		hddLog(LOGE,
-			FL(
-			"QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL put fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	ret_val = nla_put_u8(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL,
-			sap_cfg->acs_cfg.vht_seg0_center_ch);
-	if (ret_val) {
-		hddLog(LOGE,
-			FL(
-			"QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL put fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	ret_val = nla_put_u8(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL,
-			sap_cfg->acs_cfg.vht_seg1_center_ch);
-	if (ret_val) {
-		hddLog(LOGE,
-			FL(
-			"QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL put fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	if (sap_cfg->acs_cfg.ch_width == CH_WIDTH_80MHZ)
-		ch_width = 80;
-	else if (sap_cfg->acs_cfg.ch_width == CH_WIDTH_40MHZ)
-		ch_width = 40;
-	else
-		ch_width = 20;
-
-	ret_val = nla_put_u16(vendor_event,
-				QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH,
-				ch_width);
-	if (ret_val) {
-		hddLog(LOGE,
-			FL(
-			"QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH put fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-	if (sap_cfg->acs_cfg.pri_ch > 14)
-		ret_val = nla_put_u8(vendor_event,
-					QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE,
-					QCA_ACS_MODE_IEEE80211A);
-	else
-		ret_val = nla_put_u8(vendor_event,
-					QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE,
-					QCA_ACS_MODE_IEEE80211G);
-
-	if (ret_val) {
-		hddLog(LOGE,
-			FL(
-			"QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE put fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	hddLog(LOG1,
-		FL("ACS result for wlan%d: PRI_CH: %d SEC_CH: %d VHT_SEG0: %d VHT_SEG1: %d ACS_BW: %d"),
-		adapter->dev->ifindex, sap_cfg->acs_cfg.pri_ch,
-		sap_cfg->acs_cfg.ht_sec_ch, sap_cfg->acs_cfg.vht_seg0_center_ch,
-		sap_cfg->acs_cfg.vht_seg1_center_ch, ch_width);
-
-	cfg80211_vendor_event(vendor_event, GFP_KERNEL);
-	/* ***Note*** As already mentioned Completion variable usage is not
-	 * allowed here since ACS scan operation may take max 2.2 sec.
-	 * Further in AP-AP mode pending ACS is resumed here to serailize ACS
-	 * operation.
-	 * TODO: Delayed operation is used since SME-PMAC strut is global. Thus
-	 * when Primary AP ACS is complete and secondary AP ACS is started here
-	 * immediately, Primary AP start_bss may come inbetween ACS operation
-	 * and overwrite Sec AP ACS paramters. Thus Sec AP ACS is executed with
-	 * delay. This path and below constraint will be removed on sessionizing
-	 * SAP acs parameters and decoupling SAP from PMAC (WIP).
-	 * As per design constraint user space control application must take
-	 * care of serailizing hostapd start for each VIF in AP-AP mode to avoid
-	 * this code path. Sec AP hostapd should be started after Primary AP
-	 * start beaconing which can be confirmed by getchannel iwpriv command
-	 */
-
-	con_sap_adapter = hdd_get_con_sap_adapter(adapter, false);
-	if (con_sap_adapter &&
-		test_bit(ACS_PENDING, &con_sap_adapter->event_flags)) {
-#ifdef CONFIG_CNSS
-		cnss_init_delayed_work(&con_sap_adapter->acs_pending_work,
-				      wlan_hdd_cfg80211_start_pending_acs);
-#else
-		INIT_DELAYED_WORK(&con_sap_adapter->acs_pending_work,
-				      wlan_hdd_cfg80211_start_pending_acs);
-#endif
-		/* Lets give 500ms for OBSS + START_BSS to complete */
-		schedule_delayed_work(&con_sap_adapter->acs_pending_work,
-							msecs_to_jiffies(500));
-		clear_bit(ACS_PENDING, &con_sap_adapter->event_flags);
-	}
-
-	return;
-}
-
-static int
-__wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
-					 struct wireless_dev *wdev,
-					 const void *data,
-					 int data_len)
-{
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct sk_buff *skb = NULL;
-	uint32_t fset = 0;
-	int ret;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return -EINVAL;
-
-	if (wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) {
-		hddLog(LOG1, FL("Infra Station mode is supported by driver"));
-		fset |= WIFI_FEATURE_INFRA;
-	}
-	if (true == hdd_is_5g_supported(pHddCtx)) {
-		hddLog(LOG1, FL("INFRA_5G is supported by firmware"));
-		fset |= WIFI_FEATURE_INFRA_5G;
-	}
-#ifdef WLAN_FEATURE_P2P
-	if ((wiphy->interface_modes & BIT(NL80211_IFTYPE_P2P_CLIENT)) &&
-	    (wiphy->interface_modes & BIT(NL80211_IFTYPE_P2P_GO))) {
-		hddLog(LOG1, FL("WiFi-Direct is supported by driver"));
-		fset |= WIFI_FEATURE_P2P;
-	}
-#endif
-	fset |= WIFI_FEATURE_SOFT_AP;
-
-	/* HOTSPOT is a supplicant feature, enable it by default */
-	fset |= WIFI_FEATURE_HOTSPOT;
-
-#ifdef FEATURE_WLAN_EXTSCAN
-	if (sme_is_feature_supported_by_fw(EXTENDED_SCAN)) {
-		hddLog(LOG1, FL("EXTScan is supported by firmware"));
-		fset |= WIFI_FEATURE_EXTSCAN | WIFI_FEATURE_HAL_EPNO;
-	}
-#endif
-	if (wlan_hdd_nan_is_supported()) {
-		hddLog(LOG1, FL("NAN is supported by firmware"));
-		fset |= WIFI_FEATURE_NAN;
-	}
-	if (sme_is_feature_supported_by_fw(RTT)) {
-		hddLog(LOG1, FL("RTT is supported by firmware"));
-		fset |= WIFI_FEATURE_D2D_RTT;
-		fset |= WIFI_FEATURE_D2AP_RTT;
-	}
-#ifdef FEATURE_WLAN_SCAN_PNO
-	if (pHddCtx->config->configPNOScanSupport &&
-	    sme_is_feature_supported_by_fw(PNO)) {
-		hddLog(LOG1, FL("PNO is supported by firmware"));
-		fset |= WIFI_FEATURE_PNO;
-	}
-#endif
-	fset |= WIFI_FEATURE_ADDITIONAL_STA;
-#ifdef FEATURE_WLAN_TDLS
-	if ((true == pHddCtx->config->fEnableTDLSSupport) &&
-	    sme_is_feature_supported_by_fw(TDLS)) {
-		hddLog(LOG1, FL("TDLS is supported by firmware"));
-		fset |= WIFI_FEATURE_TDLS;
-	}
-	if (sme_is_feature_supported_by_fw(TDLS) &&
-	    (true == pHddCtx->config->fEnableTDLSOffChannel) &&
-	    sme_is_feature_supported_by_fw(TDLS_OFF_CHANNEL)) {
-		hddLog(LOG1, FL("TDLS off-channel is supported by firmware"));
-		fset |= WIFI_FEATURE_TDLS_OFFCHANNEL;
-	}
-#endif
-#ifdef WLAN_AP_STA_CONCURRENCY
-	fset |= WIFI_FEATURE_AP_STA;
-#endif
-	fset |= WIFI_FEATURE_RSSI_MONITOR;
-
-	if (hdd_link_layer_stats_supported())
-		fset |= WIFI_FEATURE_LINK_LAYER_STATS;
-
-	skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(fset) +
-						  NLMSG_HDRLEN);
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return -EINVAL;
-	}
-	hddLog(LOG1, FL("Supported Features : 0x%x"), fset);
-	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_FEATURE_SET, fset)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto nla_put_failure;
-	}
-	ret = cfg80211_vendor_cmd_reply(skb);
-	EXIT();
-	return ret;
-nla_put_failure:
-	kfree_skb(skb);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_get_supported_features() - get supported features
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_supported_features(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_scanning_mac_oui() - set scan MAC
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * Set the MAC address that is to be used for scanning.
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-__wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy,
-					 struct wireless_dev *wdev,
-					 const void *data,
-					 int data_len)
-{
-	tpSirScanMacOui pReqMsg = NULL;
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX + 1];
-	CDF_STATUS status;
-	int ret;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ret;
-
-	if (false == pHddCtx->config->enable_mac_spoofing) {
-		hddLog(LOGW, FL("MAC address spoofing is not enabled"));
-		return -ENOTSUPP;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX,
-		      data, data_len, NULL)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-	if (!tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI]) {
-		hddLog(LOGE, FL("attr mac oui failed"));
-		goto fail;
-	}
-	nla_memcpy(&pReqMsg->oui[0],
-		   tb[QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI],
-		   sizeof(pReqMsg->oui));
-	hddLog(LOG1, FL("Oui (%02x:%02x:%02x)"), pReqMsg->oui[0],
-	       pReqMsg->oui[1], pReqMsg->oui[2]);
-	status = sme_set_scanning_mac_oui(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("sme_set_scanning_mac_oui failed(err=%d)"), status);
-		goto fail;
-	}
-	return 0;
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_set_scanning_mac_oui() - set scan MAC
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * Set the MAC address that is to be used for scanning.  This is an
- * SSR-protecting wrapper function.
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy,
-				       struct wireless_dev *wdev,
-				       const void *data,
-				       int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_scanning_mac_oui(wiphy, wdev,
-						       data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_set_feature() - Set the bitmask for supported features
- * @feature_flags: pointer to the byte array of features.
- * @feature: Feature to be turned ON in the byte array.
- *
- * Return: None
- *
- * This is called to turn ON or SET the feature flag for the requested feature.
- **/
-#define NUM_BITS_IN_BYTE       8
-void wlan_hdd_cfg80211_set_feature(uint8_t *feature_flags, uint8_t feature)
-{
-	uint32_t index;
-	uint8_t bit_mask;
-
-	index = feature / NUM_BITS_IN_BYTE;
-	bit_mask = 1 << (feature % NUM_BITS_IN_BYTE);
-	feature_flags[index] |= bit_mask;
-}
-
-/**
- * __wlan_hdd_cfg80211_get_features() - Get the Driver Supported features
- * @wiphy: pointer to wireless wiphy structure.
- * @wdev: pointer to wireless_dev structure.
- * @data: Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This is called when wlan driver needs to send supported feature set to
- * supplicant upon a request/query from the supplicant.
- *
- * Return: Return the Success or Failure code.
- **/
-#define MAX_CONCURRENT_CHAN_ON_24G    2
-#define MAX_CONCURRENT_CHAN_ON_5G     2
-static int
-__wlan_hdd_cfg80211_get_features(struct wiphy *wiphy,
-				 struct wireless_dev *wdev,
-				 const void *data, int data_len)
-{
-	struct sk_buff *skb = NULL;
-	uint32_t dbs_capability = 0;
-	bool one_by_one_dbs, two_by_two_dbs;
-	CDF_STATUS ret = CDF_STATUS_E_FAILURE;
-	int ret_val;
-
-	uint8_t feature_flags[(NUM_QCA_WLAN_VENDOR_FEATURES + 7) / 8] = {0};
-	hdd_context_t *hdd_ctx_ptr = wiphy_priv(wiphy);
-
-	ret_val = wlan_hdd_validate_context(hdd_ctx_ptr);
-	if (ret_val)
-		return ret_val;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (hdd_ctx_ptr->config->isRoamOffloadEnabled) {
-		hddLog(LOG1, FL("Key Mgmt Offload is supported"));
-		wlan_hdd_cfg80211_set_feature(feature_flags,
-				QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD);
-	}
-
-	wlan_hdd_cfg80211_set_feature(feature_flags,
-				QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY);
-	if (wma_is_scan_simultaneous_capable())
-		wlan_hdd_cfg80211_set_feature(feature_flags,
-			QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS);
-	skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(feature_flags) +
-			NLMSG_HDRLEN);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return -ENOMEM;
-	}
-
-	if (nla_put(skb, QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS,
-			sizeof(feature_flags), feature_flags))
-		goto nla_put_failure;
-
-	ret = wma_get_dbs_hw_modes(&one_by_one_dbs, &two_by_two_dbs);
-	if (CDF_STATUS_SUCCESS == ret) {
-		if (one_by_one_dbs)
-			dbs_capability = DRV_DBS_CAPABILITY_1X1;
-
-		if (two_by_two_dbs)
-			dbs_capability = DRV_DBS_CAPABILITY_2X2;
-
-		if (!one_by_one_dbs && !two_by_two_dbs)
-			dbs_capability = DRV_DBS_CAPABILITY_DISABLED;
-	} else {
-		hdd_err("wma_get_dbs_hw_mode failed");
-		dbs_capability = DRV_DBS_CAPABILITY_DISABLED;
-	}
-
-	hdd_info("dbs_capability is %d", dbs_capability);
-
-	if (nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_2_4_BAND,
-			MAX_CONCURRENT_CHAN_ON_24G))
-		goto nla_put_failure;
-
-	if (nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_5_0_BAND,
-			MAX_CONCURRENT_CHAN_ON_5G))
-		goto nla_put_failure;
-
-	return cfg80211_vendor_cmd_reply(skb);
-
-nla_put_failure:
-	kfree_skb(skb);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_get_features() - Get the Driver Supported features
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This is called when wlan driver needs to send supported feature set to
- * supplicant upon a request/query from the supplicant.
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-wlan_hdd_cfg80211_get_features(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data, int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_features(wiphy, wdev,
-					       data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-
-/**
- * __wlan_hdd_cfg80211_set_ext_roam_params() - Settings for roaming parameters
- * @wiphy:                 The wiphy structure
- * @wdev:                  The wireless device
- * @data:                  Data passed by framework
- * @data_len:              Parameters to be configured passed as data
- *
- * The roaming related parameters are configured by the framework
- * using this interface.
- *
- * Return: Return either success or failure code.
- */
-static int
-__wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
-	struct wireless_dev *wdev, const void *data, int data_len)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	uint8_t session_id;
-	struct roam_ext_params roam_params;
-	uint32_t cmd_type, req_id;
-	struct nlattr *curr_attr;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX + 1];
-	struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX + 1];
-	int rem, i;
-	uint32_t buf_len = 0;
-	int ret;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX,
-		data, data_len,
-		NULL)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-	/* Parse and fetch Command Type*/
-	if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD]) {
-		hddLog(LOGE, FL("roam cmd type failed"));
-		goto fail;
-	}
-	session_id = pAdapter->sessionId;
-	cdf_mem_set(&roam_params, sizeof(roam_params), 0);
-	cmd_type = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD]);
-	if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-	req_id = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID]);
-	hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Req Id (%d)"), req_id);
-	hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Cmd Type (%d)"), cmd_type);
-	switch (cmd_type) {
-	case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SSID_WHITE_LIST:
-		i = 0;
-		nla_for_each_nested(curr_attr,
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_LIST],
-			rem) {
-			if (nla_parse(tb2,
-				QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_MAX,
-				nla_data(curr_attr), nla_len(curr_attr),
-				NULL)) {
-				hddLog(LOGE,
-					FL("nla_parse failed"));
-				goto fail;
-			}
-			/* Parse and Fetch allowed SSID list*/
-			if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID]) {
-				hddLog(LOGE, FL("attr allowed ssid failed"));
-				goto fail;
-			}
-			buf_len = nla_len(tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID]);
-			/*
-			 * Upper Layers include a null termination character.
-			 * Check for the actual permissible length of SSID and
-			 * also ensure not to copy the NULL termination
-			 * character to the driver buffer.
-			 */
-			if (buf_len && (i < MAX_SSID_ALLOWED_LIST) &&
-				((buf_len - 1) <= SIR_MAC_MAX_SSID_LENGTH)) {
-				nla_memcpy(
-					roam_params.ssid_allowed_list[i].ssId,
-					tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID],
-					buf_len - 1);
-				roam_params.ssid_allowed_list[i].length =
-					buf_len - 1;
-				hddLog(CDF_TRACE_LEVEL_DEBUG,
-					FL("SSID[%d]: %.*s,length = %d"), i,
-					roam_params.ssid_allowed_list[i].length,
-					roam_params.ssid_allowed_list[i].ssId,
-					roam_params.ssid_allowed_list[i].length);
-				i++;
-			} else {
-				hddLog(LOGE, FL("Invalid buffer length"));
-			}
-		}
-		roam_params.num_ssid_allowed_list = i;
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Num of Allowed SSID %d"),
-			roam_params.num_ssid_allowed_list);
-		sme_update_roam_params(pHddCtx->hHal, session_id,
-				roam_params, REASON_ROAM_SET_SSID_ALLOWED);
-		break;
-	case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_EXTSCAN_ROAM_PARAMS:
-		/* Parse and fetch 5G Boost Threshold */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD]) {
-			hddLog(LOGE, FL("5G boost threshold failed"));
-			goto fail;
-		}
-		roam_params.raise_rssi_thresh_5g = nla_get_s32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("5G Boost Threshold (%d)"),
-			roam_params.raise_rssi_thresh_5g);
-		/* Parse and fetch 5G Penalty Threshold */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD]) {
-			hddLog(LOGE, FL("5G penalty threshold failed"));
-			goto fail;
-		}
-		roam_params.drop_rssi_thresh_5g = nla_get_s32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("5G Penalty Threshold (%d)"),
-			roam_params.drop_rssi_thresh_5g);
-		/* Parse and fetch 5G Boost Factor */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR]) {
-			hddLog(LOGE, FL("5G boost Factor failed"));
-			goto fail;
-		}
-		roam_params.raise_factor_5g = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("5G Boost Factor (%d)"),
-			roam_params.raise_factor_5g);
-		/* Parse and fetch 5G Penalty factor */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR]) {
-			hddLog(LOGE, FL("5G Penalty Factor failed"));
-			goto fail;
-		}
-		roam_params.drop_factor_5g = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("5G Penalty factor (%d)"),
-			roam_params.drop_factor_5g);
-		/* Parse and fetch 5G Max Boost */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST]) {
-			hddLog(LOGE, FL("5G Max Boost failed"));
-			goto fail;
-		}
-		roam_params.max_raise_rssi_5g = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("5G Max Boost (%d)"),
-			roam_params.max_raise_rssi_5g);
-		/* Parse and fetch Rssi Diff */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS]) {
-			hddLog(LOGE, FL("Rssi Diff failed"));
-			goto fail;
-		}
-		roam_params.rssi_diff = nla_get_s32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("RSSI Diff (%d)"),
-			roam_params.rssi_diff);
-		/* Parse and fetch Alert Rssi Threshold */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER]) {
-			hddLog(LOGE, FL("Alert Rssi Threshold failed"));
-			goto fail;
-		}
-		roam_params.alert_rssi_threshold = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Alert RSSI Threshold (%d)"),
-			roam_params.alert_rssi_threshold);
-		sme_update_roam_params(pHddCtx->hHal, session_id,
-			roam_params,
-			REASON_ROAM_EXT_SCAN_PARAMS_CHANGED);
-		break;
-	case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_LAZY_ROAM:
-		/* Parse and fetch Activate Good Rssi Roam */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE]) {
-			hddLog(LOGE, FL("Activate Good Rssi Roam failed"));
-			goto fail;
-		}
-		roam_params.good_rssi_roam = nla_get_s32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Activate Good Rssi Roam (%d)"),
-			roam_params.good_rssi_roam);
-		sme_update_roam_params(pHddCtx->hHal, session_id,
-			roam_params, REASON_ROAM_GOOD_RSSI_CHANGED);
-		break;
-	case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS:
-		/* Parse and fetch number of preferred BSSID */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID]) {
-			hddLog(LOGE, FL("attr num of preferred bssid failed"));
-			goto fail;
-		}
-		roam_params.num_bssid_favored = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Num of Preferred BSSID (%d)"),
-			roam_params.num_bssid_favored);
-		i = 0;
-		nla_for_each_nested(curr_attr,
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS],
-			rem) {
-			if (nla_parse(tb2,
-				QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX,
-				nla_data(curr_attr), nla_len(curr_attr),
-				NULL)) {
-				hddLog(LOGE, FL("nla_parse failed"));
-				goto fail;
-			}
-			/* Parse and fetch MAC address */
-			if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID]) {
-				hddLog(LOGE, FL("attr mac address failed"));
-				goto fail;
-			}
-			nla_memcpy(roam_params.bssid_favored[i].bytes,
-				tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID],
-				CDF_MAC_ADDR_SIZE);
-			hdd_debug(MAC_ADDRESS_STR,
-			    MAC_ADDR_ARRAY(roam_params.bssid_favored[i].bytes));
-			/* Parse and fetch preference factor*/
-			if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER]) {
-				hddLog(LOGE, FL("BSSID Preference score failed"));
-				goto fail;
-			}
-			roam_params.bssid_favored_factor[i] = nla_get_u32(
-				tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER]);
-			hddLog(CDF_TRACE_LEVEL_DEBUG, FL("BSSID Preference score (%d)"),
-				roam_params.bssid_favored_factor[i]);
-			i++;
-		}
-		sme_update_roam_params(pHddCtx->hHal, session_id,
-			roam_params, REASON_ROAM_SET_FAVORED_BSSID);
-		break;
-	case QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID:
-		/* Parse and fetch number of blacklist BSSID */
-		if (!tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID]) {
-			hddLog(LOGE, FL("attr num of blacklist bssid failed"));
-			goto fail;
-		}
-		roam_params.num_bssid_avoid_list = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID]);
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Num of blacklist BSSID (%d)"),
-			roam_params.num_bssid_avoid_list);
-		i = 0;
-		nla_for_each_nested(curr_attr,
-			tb[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS],
-			rem) {
-			if (nla_parse(tb2,
-				QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX,
-				nla_data(curr_attr), nla_len(curr_attr),
-				NULL)) {
-				hddLog(LOGE, FL("nla_parse failed"));
-				goto fail;
-			}
-			/* Parse and fetch MAC address */
-			if (!tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID]) {
-				hddLog(LOGE, FL("attr blacklist addr failed"));
-				goto fail;
-			}
-			nla_memcpy(roam_params.bssid_avoid_list[i].bytes,
-				tb2[QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID],
-				CDF_MAC_ADDR_SIZE);
-			hdd_debug(MAC_ADDRESS_STR,
-				MAC_ADDR_ARRAY(
-				roam_params.bssid_avoid_list[i].bytes));
-			i++;
-		}
-		sme_update_roam_params(pHddCtx->hHal, session_id,
-			roam_params, REASON_ROAM_SET_BLACKLIST_BSSID);
-		break;
-	}
-	return 0;
-fail:
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_set_ext_roam_params() - set ext scan roam params
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
-				struct wireless_dev *wdev,
-				const void *data,
-				int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_ext_roam_params(wiphy, wdev,
-							data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct nla_policy
-wlan_hdd_set_no_dfs_flag_config_policy[QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX
-				       +1] = {
-	[QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG] = {.type = NLA_U32 },
-};
-
-/**
- *  wlan_hdd_check_dfs_channel_for_adapter() - check dfs channel in adapter
- *  @hdd_ctx:      HDD context
- *  @device_mode:    device mode
- *  Return:         bool
- */
-static bool wlan_hdd_check_dfs_channel_for_adapter(hdd_context_t *hdd_ctx,
-						   device_mode_t device_mode)
-{
-	hdd_adapter_t *adapter;
-	hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
-	hdd_ap_ctx_t *ap_ctx;
-	hdd_station_ctx_t *sta_ctx;
-	CDF_STATUS cdf_status;
-
-	cdf_status = hdd_get_front_adapter(hdd_ctx,
-					   &adapter_node);
-
-	while ((NULL != adapter_node) &&
-	       (CDF_STATUS_SUCCESS == cdf_status)) {
-		adapter = adapter_node->pAdapter;
-
-		if ((device_mode == adapter->device_mode) &&
-		    (device_mode == WLAN_HDD_SOFTAP)) {
-			ap_ctx =
-				WLAN_HDD_GET_AP_CTX_PTR(adapter);
-
-			/*
-			 *  if there is SAP already running on DFS channel,
-			 *  do not disable scan on dfs channels. Note that
-			 *  with SAP on DFS, there cannot be conurrency on
-			 *  single radio. But then we can have multiple
-			 *  radios !!
-			 */
-			if (CHANNEL_STATE_DFS ==
-			    cds_get_channel_state(
-				    ap_ctx->operatingChannel)) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("SAP running on DFS channel"));
-				return true;
-			}
-		}
-
-		if ((device_mode == adapter->device_mode) &&
-		    (device_mode == WLAN_HDD_INFRA_STATION)) {
-			sta_ctx =
-				WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-
-			/*
-			 *  if STA is already connected on DFS channel,
-			 *  do not disable scan on dfs channels
-			 */
-			if (hdd_conn_is_connected(sta_ctx) &&
-			    (CHANNEL_STATE_DFS ==
-			     cds_get_channel_state(
-				     sta_ctx->conn_info.operationChannel))) {
-				hddLog(LOGE,
-				       FL("client connected on DFS channel"));
-				return true;
-			}
-		}
-
-		cdf_status = hdd_get_next_adapter(hdd_ctx,
-						  adapter_node,
-						  &next);
-		adapter_node = next;
-	}
-
-	return false;
-}
-
-/**
- * wlan_hdd_disable_dfs_chan_scan() - disable/enable DFS channels
- * @hdd_ctx: HDD context within host driver
- * @adapter: Adapter pointer
- * @no_dfs_flag: If TRUE, DFS channels cannot be used for scanning
- *
- * Loops through devices to see who is operating on DFS channels
- * and then disables/enables DFS channels by calling SME API.
- * Fails the disable request if any device is active on a DFS channel.
- *
- * Return: 0 or other error codes.
- */
-
-int wlan_hdd_disable_dfs_chan_scan(hdd_context_t *hdd_ctx,
-				   hdd_adapter_t *adapter,
-				   uint32_t no_dfs_flag)
-{
-	tHalHandle h_hal = WLAN_HDD_GET_HAL_CTX(adapter);
-	CDF_STATUS status;
-	int ret_val = -EPERM;
-
-	if (no_dfs_flag == hdd_ctx->config->enableDFSChnlScan) {
-		if (no_dfs_flag) {
-			status = wlan_hdd_check_dfs_channel_for_adapter(
-				hdd_ctx, WLAN_HDD_INFRA_STATION);
-
-			if (true == status)
-				return -EOPNOTSUPP;
-
-			status = wlan_hdd_check_dfs_channel_for_adapter(
-				hdd_ctx, WLAN_HDD_SOFTAP);
-
-			if (true == status)
-				return -EOPNOTSUPP;
-		}
-
-		hdd_ctx->config->enableDFSChnlScan = !no_dfs_flag;
-
-		hdd_abort_mac_scan_all_adapters(hdd_ctx);
-
-		/*
-		 *  call the SME API to tunnel down the new channel list
-		 *  to the firmware
-		 */
-		status = sme_handle_dfs_chan_scan(
-			h_hal, hdd_ctx->config->enableDFSChnlScan);
-
-		if (CDF_STATUS_SUCCESS == status) {
-			ret_val = 0;
-
-			/*
-			 * Clear the SME scan cache also. Note that the
-			 * clearing of scan results is independent of session;
-			 * so no need to iterate over
-			 * all sessions
-			 */
-			status = sme_scan_flush_result(h_hal);
-			if (CDF_STATUS_SUCCESS != status)
-				ret_val = -EPERM;
-		}
-
-	} else {
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       FL(" the DFS flag has not changed"));
-		ret_val = 0;
-	}
-	return ret_val;
-}
-
-/**
- *  __wlan_hdd_cfg80211_disable_dfs_chan_scan() - DFS channel configuration
- *  @wiphy:          corestack handler
- *  @wdev:           wireless device
- *  @data:           data
- *  @data_len:       data length
- *  Return:         success(0) or reason code for failure
- */
-static int __wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy,
-						     struct wireless_dev *wdev,
-						     const void *data,
-						     int data_len)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx  = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX + 1];
-	int ret_val;
-	uint32_t no_dfs_flag = 0;
-
-	ENTER();
-	ret_val = wlan_hdd_validate_context(hdd_ctx);
-
-	if (ret_val) {
-		hdd_err("HDD context is not valid");
-		return ret_val;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX,
-		      data, data_len,
-		      wlan_hdd_set_no_dfs_flag_config_policy)) {
-		hdd_err("invalid attr");
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG]) {
-		hdd_err("attr dfs flag failed");
-		return -EINVAL;
-	}
-
-	no_dfs_flag = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG]);
-
-	hddLog(LOG1, FL(" DFS flag = %d"), no_dfs_flag);
-
-	if (no_dfs_flag > 1) {
-		hddLog(LOGE, FL("invalid value of dfs flag"));
-		return -EINVAL;
-	}
-
-	ret_val = wlan_hdd_disable_dfs_chan_scan(hdd_ctx, adapter,
-						 no_dfs_flag);
-	return ret_val;
-}
-
-/**
- * wlan_hdd_cfg80211_disable_dfs_chan_scan () - DFS scan vendor command
- *
- * @wiphy: wiphy device pointer
- * @wdev: wireless device pointer
- * @data: Vendof command data buffer
- * @data_len: Buffer length
- *
- * Handles QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX. Validate it and
- * call wlan_hdd_disable_dfs_chan_scan to send it to firmware.
- *
- * Return: EOK or other error codes.
- */
-
-static int wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy,
-						   struct wireless_dev *wdev,
-						   const void *data,
-						   int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_disable_dfs_chan_scan(wiphy, wdev,
-							data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-/**
- * __wlan_hdd_cfg80211_keymgmt_set_key() - Store the Keys in the driver session
- * @wiphy: pointer to wireless wiphy structure.
- * @wdev: pointer to wireless_dev structure.
- * @data: Pointer to the Key data
- * @data_len:Length of the data passed
- *
- * This is called when wlan driver needs to save the keys received via
- * vendor specific command.
- *
- * Return: Return the Success or Failure code.
- */
-static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
-					       struct wireless_dev *wdev,
-					       const void *data, int data_len)
-{
-	uint8_t local_pmk[SIR_ROAM_SCAN_PSK_SIZE];
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *hdd_adapter_ptr = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx_ptr;
-	int status;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if ((data == NULL) || (data_len == 0) ||
-			(data_len > SIR_ROAM_SCAN_PSK_SIZE)) {
-		hddLog(LOGE, FL("Invalid data"));
-		return -EINVAL;
-	}
-
-	hdd_ctx_ptr = WLAN_HDD_GET_CTX(hdd_adapter_ptr);
-	if (!hdd_ctx_ptr) {
-		hddLog(LOGE, FL("HDD context is null"));
-		return -EINVAL;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx_ptr);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is invalid"));
-		return status;
-	}
-	sme_update_roam_key_mgmt_offload_enabled(hdd_ctx_ptr->hHal,
-			hdd_adapter_ptr->sessionId,
-			true);
-	cdf_mem_zero(&local_pmk, SIR_ROAM_SCAN_PSK_SIZE);
-	cdf_mem_copy(local_pmk, data, data_len);
-	sme_roam_set_psk_pmk(WLAN_HDD_GET_HAL_CTX(hdd_adapter_ptr),
-			hdd_adapter_ptr->sessionId, local_pmk, data_len);
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_keymgmt_set_key() - Store the Keys in the driver session
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the Key data
- * @data_len:Length of the data passed
- *
- * This is called when wlan driver needs to save the keys received via
- * vendor specific command.
- *
- * Return:   Return the Success or Failure code.
- */
-static int wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data, int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_keymgmt_set_key(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct nla_policy qca_wlan_vendor_get_wifi_info_policy[
-			QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_DRIVER_VERSION] = {.type = NLA_U8 },
-	[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION] = {.type = NLA_U8 },
-};
-
-/**
- * __wlan_hdd_cfg80211_get_wifi_info() - Get the wifi driver related info
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This is called when wlan driver needs to send wifi driver related info
- * (driver/fw version) to the user space application upon request.
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-__wlan_hdd_cfg80211_get_wifi_info(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  const void *data, int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX + 1];
-	tSirVersionString version;
-	uint32_t version_len;
-	uint32_t major_spid = 0, minor_spid = 0, siid = 0, crmid = 0;
-	uint8_t attr;
-	int status;
-	struct sk_buff *reply_skb = NULL;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX, data,
-		      data_len, qca_wlan_vendor_get_wifi_info_policy)) {
-		hddLog(LOGE, FL("WIFI_INFO_GET NL CMD parsing failed"));
-		return -EINVAL;
-	}
-
-	if (tb_vendor[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_DRIVER_VERSION]) {
-		hddLog(LOG1, FL("Rcvd req for Driver version"));
-		strlcpy(version, QWLAN_VERSIONSTR, sizeof(version));
-		attr = QCA_WLAN_VENDOR_ATTR_WIFI_INFO_DRIVER_VERSION;
-	} else if (tb_vendor[QCA_WLAN_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION]) {
-		hddLog(LOG1, FL("Rcvd req for FW version"));
-		hdd_get_fw_version(hdd_ctx, &major_spid, &minor_spid, &siid,
-				   &crmid);
-		snprintf(version, sizeof(version), "%d:%d:%d:%d",
-			 major_spid, minor_spid, siid, crmid);
-		attr = QCA_WLAN_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION;
-	} else {
-		hddLog(LOGE, FL("Invalid attribute in get wifi info request"));
-		return -EINVAL;
-	}
-
-	version_len = strlen(version);
-	reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
-			version_len + NLA_HDRLEN + NLMSG_HDRLEN);
-	if (!reply_skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return -ENOMEM;
-	}
-
-	if (nla_put(reply_skb, attr, version_len, version)) {
-		hddLog(LOGE, FL("nla put fail"));
-		kfree_skb(reply_skb);
-		return -EINVAL;
-	}
-
-	return cfg80211_vendor_cmd_reply(reply_skb);
-}
-
-/**
- * wlan_hdd_cfg80211_get_wifi_info() - Get the wifi driver related info
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This is called when wlan driver needs to send wifi driver related info
- * (driver/fw version) to the user space application upon request.
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-wlan_hdd_cfg80211_get_wifi_info(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data, int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_wifi_info(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_get_logger_supp_feature() - Get the wifi logger features
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This is called by userspace to know the supported logger features
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-__wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data, int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	int status;
-	uint32_t features;
-	struct sk_buff *reply_skb = NULL;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	features = 0;
-
-	if (hdd_is_memdump_supported())
-		features |= WIFI_LOGGER_MEMORY_DUMP_SUPPORTED;
-	features |= WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED;
-	features |= WIFI_LOGGER_CONNECT_EVENT_SUPPORTED;
-	features |= WIFI_LOGGER_WAKE_LOCK_SUPPORTED;
-
-	reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
-			sizeof(uint32_t) + NLA_HDRLEN + NLMSG_HDRLEN);
-	if (!reply_skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return -ENOMEM;
-	}
-
-	hddLog(LOG1, FL("Supported logger features: 0x%0x"), features);
-	if (nla_put_u32(reply_skb, QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED,
-				   features)) {
-		hddLog(LOGE, FL("nla put fail"));
-		kfree_skb(reply_skb);
-		return -EINVAL;
-	}
-
-	return cfg80211_vendor_cmd_reply(reply_skb);
-}
-
-/**
- * wlan_hdd_cfg80211_get_logger_supp_feature() - Get the wifi logger features
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This is called by userspace to know the supported logger features
- *
- * Return:   Return the Success or Failure code.
- */
-static int
-wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data, int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_logger_supp_feature(wiphy, wdev,
-							  data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_send_roam_auth_event() - Send the roamed and authorized event
- * @hdd_ctx_ptr: pointer to HDD Context.
- * @bssid: pointer to bssid of roamed AP.
- * @req_rsn_ie: Pointer to request RSN IE
- * @req_rsn_len: Length of the request RSN IE
- * @rsp_rsn_ie: Pointer to response RSN IE
- * @rsp_rsn_len: Length of the response RSN IE
- * @roam_info_ptr: Pointer to the roaming related information
- *
- * This is called when wlan driver needs to send the roaming and
- * authorization information after roaming.
- *
- * The information that would be sent is the request RSN IE, response
- * RSN IE and BSSID of the newly roamed AP.
- *
- * If the Authorized status is authenticated, then additional parameters
- * like PTK's KCK and KEK and Replay Counter would also be passed to the
- * supplicant.
- *
- * The supplicant upon receiving this event would ignore the legacy
- * cfg80211_roamed call and use the entire information from this event.
- * The cfg80211_roamed should still co-exist since the kernel will
- * make use of the parameters even if the supplicant ignores it.
- *
- * Return: Return the Success or Failure code.
- */
-int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, uint8_t *bssid,
-		uint8_t *req_rsn_ie, uint32_t req_rsn_len, uint8_t *rsp_rsn_ie,
-		uint32_t rsp_rsn_len, tCsrRoamInfo *roam_info_ptr)
-{
-	struct sk_buff *skb = NULL;
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx_ptr)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid "));
-		return -EINVAL;
-	}
-
-	if (!hdd_ctx_ptr->config->isRoamOffloadEnabled ||
-			!roam_info_ptr->roamSynchInProgress)
-		return 0;
-
-	skb = cfg80211_vendor_event_alloc(hdd_ctx_ptr->wiphy,
-			NULL,
-			ETH_ALEN + req_rsn_len + rsp_rsn_len +
-			sizeof(uint8_t) + SIR_REPLAY_CTR_LEN +
-			SIR_KCK_KEY_LEN + SIR_KCK_KEY_LEN +
-			sizeof(uint8_t) + (8 * NLMSG_HDRLEN),
-			QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH_INDEX,
-			GFP_KERNEL);
-
-	if (!skb) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-				FL("cfg80211_vendor_event_alloc failed"));
-		return -EINVAL;
-	}
-
-	if (nla_put(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_BSSID,
-				ETH_ALEN, bssid) ||
-			nla_put(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_REQ_IE,
-				req_rsn_len, req_rsn_ie) ||
-			nla_put(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_RESP_IE,
-				rsp_rsn_len, rsp_rsn_ie)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("nla put fail"));
-		goto nla_put_failure;
-	}
-	hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Auth Status = %d"),
-			roam_info_ptr->synchAuthStatus);
-	if (roam_info_ptr->synchAuthStatus ==
-			CSR_ROAM_AUTH_STATUS_AUTHENTICATED) {
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Include Auth Params TLV's"));
-		if (nla_put_u8(skb,
-			QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AUTHORIZED, true)) {
-			hdd_err("nla put fail");
-			goto nla_put_failure;
-		}
-		/* if FT connection: dont send ROAM_AUTH_KEY_REPLAY_CTR */
-		if (roam_info_ptr->u.pConnectedProfile->AuthType !=
-			eCSR_AUTH_TYPE_FT_RSN &&
-		    roam_info_ptr->u.pConnectedProfile->AuthType !=
-			eCSR_AUTH_TYPE_FT_RSN_PSK &&
-		    nla_put(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_KEY_REPLAY_CTR,
-			SIR_REPLAY_CTR_LEN, roam_info_ptr->replay_ctr)) {
-			hdd_err("non FT connection.");
-			hdd_err("failed to send replay counter.");
-			goto nla_put_failure;
-		}
-		if (nla_put(skb,
-			QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KCK,
-			SIR_KCK_KEY_LEN, roam_info_ptr->kck) ||
-		    nla_put(skb,
-			QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KEK,
-			SIR_KEK_KEY_LEN, roam_info_ptr->kek)) {
-			hdd_err("nla put fail");
-			goto nla_put_failure;
-		}
-	} else {
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("No Auth Params TLV's"));
-		if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AUTHORIZED,
-					false)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR, FL("nla put fail"));
-			goto nla_put_failure;
-		}
-	}
-
-	hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Subnet Change Status = %d"),
-		roam_info_ptr->subnet_change_status);
-
-	/*
-	 * Add subnet change status if subnet has changed
-	 * 0 = unchanged
-	 * 1 = changed
-	 * 2 = unknown
-	 */
-	if (roam_info_ptr->subnet_change_status) {
-		if (nla_put_u8(skb,
-				QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_SUBNET_STATUS,
-				roam_info_ptr->subnet_change_status)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR, FL("nla put fail"));
-			goto nla_put_failure;
-		}
-	}
-
-	cfg80211_vendor_event(skb, GFP_KERNEL);
-	return 0;
-
-nla_put_failure:
-	kfree_skb(skb);
-	return -EINVAL;
-}
-#endif /* WLAN_FEATURE_ROAM_OFFLOAD */
-
-static const struct nla_policy
-wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = {
-
-	[QCA_WLAN_VENDOR_ATTR_CONFIG_MODULATED_DTIM] = {.type = NLA_U32 },
-	[QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR] = {.type = NLA_U16 },
-	[QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME] = {.type = NLA_U32 },
-};
-
-
-/**
- * __wlan_hdd_cfg80211_wifi_configuration_set() - Wifi configuration
- * vendor command
- *
- * @wiphy: wiphy device pointer
- * @wdev: wireless device pointer
- * @data: Vendor command data buffer
- * @data_len: Buffer length
- *
- * Handles QCA_WLAN_VENDOR_ATTR_CONFIG_MAX.
- *
- * Return: Error code.
- */
-static int
-__wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   const void *data,
-					   int data_len)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx  = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1];
-	int ret_val = 0;
-	u32 modulated_dtim;
-	u16 stats_avg_factor;
-	u32 guard_time;
-	CDF_STATUS status;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret_val = wlan_hdd_validate_context(hdd_ctx);
-	if (ret_val) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return ret_val;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX,
-		      data, data_len,
-		      wlan_hdd_wifi_config_policy)) {
-		hddLog(LOGE, FL("invalid attr"));
-		return -EINVAL;
-	}
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MODULATED_DTIM]) {
-		modulated_dtim = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MODULATED_DTIM]);
-
-		status = sme_configure_modulated_dtim(hdd_ctx->hHal,
-						      adapter->sessionId,
-						      modulated_dtim);
-
-		if (CDF_STATUS_SUCCESS != status)
-			ret_val = -EPERM;
-	}
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR]) {
-		stats_avg_factor = nla_get_u16(
-			tb[QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR]);
-		status = sme_configure_stats_avg_factor(hdd_ctx->hHal,
-							adapter->sessionId,
-							stats_avg_factor);
-
-		if (CDF_STATUS_SUCCESS != status)
-			ret_val = -EPERM;
-	}
-
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME]) {
-		guard_time = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME]);
-		status = sme_configure_guard_time(hdd_ctx->hHal,
-						  adapter->sessionId,
-						  guard_time);
-
-		if (CDF_STATUS_SUCCESS != status)
-			ret_val = -EPERM;
-	}
-
-	return ret_val;
-}
-
-/**
- * wlan_hdd_cfg80211_wifi_configuration_set() - Wifi configuration
- * vendor command
- *
- * @wiphy: wiphy device pointer
- * @wdev: wireless device pointer
- * @data: Vendor command data buffer
- * @data_len: Buffer length
- *
- * Handles QCA_WLAN_VENDOR_ATTR_CONFIG_MAX.
- *
- * Return: EOK or other error codes.
- */
-static int wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
-						    struct wireless_dev *wdev,
-						    const void *data,
-						    int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_wifi_configuration_set(wiphy, wdev,
-							 data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct
-nla_policy
-qca_wlan_vendor_wifi_logger_start_policy
-[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID]
-		= {.type = NLA_U32 },
-	[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL]
-		= {.type = NLA_U32 },
-	[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS]
-		= {.type = NLA_U32 },
-};
-
-/**
- * __wlan_hdd_cfg80211_wifi_logger_start() - This function is used to enable
- * or disable the collection of packet statistics from the firmware
- * @wiphy:    WIPHY structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function enables or disables the collection of packet statistics from
- * the firmware
- *
- * Return: 0 on success and errno on failure
- */
-static int __wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data,
-		int data_len)
-{
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX + 1];
-	struct sir_wifi_start_log start_log;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX,
-				data, data_len,
-				qca_wlan_vendor_wifi_logger_start_policy)) {
-		hddLog(LOGE, FL("Invalid attribute"));
-		return -EINVAL;
-	}
-
-	/* Parse and fetch ring id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID]) {
-		hddLog(LOGE, FL("attr ATTR failed"));
-		return -EINVAL;
-	}
-	start_log.ring_id = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID]);
-	hdd_info("Ring ID=%d", start_log.ring_id);
-
-	/* Parse and fetch verbose level */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL]) {
-		hddLog(LOGE, FL("attr verbose_level failed"));
-		return -EINVAL;
-	}
-	start_log.verbose_level = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL]);
-	hdd_info("verbose_level=%d", start_log.verbose_level);
-
-	/* Parse and fetch flag */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS]) {
-		hddLog(LOGE, FL("attr flag failed"));
-		return -EINVAL;
-	}
-	start_log.flag = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS]);
-	hdd_info("flag=%d", start_log.flag);
-
-	cds_set_ring_log_level(start_log.ring_id, start_log.verbose_level);
-
-	if (start_log.ring_id == RING_ID_WAKELOCK) {
-		/* Start/stop wakelock events */
-		if (start_log.verbose_level > WLAN_LOG_LEVEL_OFF)
-			cds_set_wakelock_logging(true);
-		else
-			cds_set_wakelock_logging(false);
-		return 0;
-	}
-
-	status = sme_wifi_start_logger(hdd_ctx->hHal, start_log);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("sme_wifi_start_logger failed(err=%d)"),
-				status);
-		return -EINVAL;
-	}
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_wifi_logger_start() - Wrapper function used to enable
- * or disable the collection of packet statistics from the firmware
- * @wiphy:    WIPHY structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function is used to enable or disable the collection of packet
- * statistics from the firmware
- *
- * Return: 0 on success and errno on failure
- */
-static int wlan_hdd_cfg80211_wifi_logger_start(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data,
-		int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_wifi_logger_start(wiphy,
-			wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct
-nla_policy
-qca_wlan_vendor_wifi_logger_get_ring_data_policy
-[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_ID]
-		= {.type = NLA_U32 },
-};
-
-/**
- * __wlan_hdd_cfg80211_wifi_logger_get_ring_data() - Flush per packet stats
- * @wiphy:    WIPHY structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function is used to flush or retrieve the per packet statistics from
- * the driver
- *
- * Return: 0 on success and errno on failure
- */
-static int __wlan_hdd_cfg80211_wifi_logger_get_ring_data(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data,
-		int data_len)
-{
-	CDF_STATUS status;
-	uint32_t ring_id;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct nlattr *tb
-		[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX + 1];
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX,
-			data, data_len,
-			qca_wlan_vendor_wifi_logger_get_ring_data_policy)) {
-		hddLog(LOGE, FL("Invalid attribute"));
-		return -EINVAL;
-	}
-
-	/* Parse and fetch ring id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_ID]) {
-		hddLog(LOGE, FL("attr ATTR failed"));
-		return -EINVAL;
-	}
-
-	ring_id = nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_ID]);
-
-	if (ring_id == RING_ID_PER_PACKET_STATS) {
-		wlan_logging_set_per_pkt_stats();
-		hddLog(LOG1, FL("Flushing/Retrieving packet stats"));
-	}
-
-	hddLog(LOG1, FL("Bug report triggered by framework"));
-
-	status = cds_flush_logs(WLAN_LOG_TYPE_NON_FATAL,
-			WLAN_LOG_INDICATOR_FRAMEWORK,
-			WLAN_LOG_REASON_CODE_UNUSED);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGE, FL("Failed to trigger bug report"));
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_wifi_logger_get_ring_data() - Wrapper to flush packet stats
- * @wiphy:    WIPHY structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function is used to flush or retrieve the per packet statistics from
- * the driver
- *
- * Return: 0 on success and errno on failure
- */
-static int wlan_hdd_cfg80211_wifi_logger_get_ring_data(struct wiphy *wiphy,
-		struct wireless_dev *wdev,
-		const void *data,
-		int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_wifi_logger_get_ring_data(wiphy,
-			wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#ifdef WLAN_FEATURE_OFFLOAD_PACKETS
-/**
- * hdd_map_req_id_to_pattern_id() - map request id to pattern id
- * @hdd_ctx: HDD context
- * @request_id: [input] request id
- * @pattern_id: [output] pattern id
- *
- * This function loops through request id to pattern id array
- * if the slot is available, store the request id and return pattern id
- * if entry exists, return the pattern id
- *
- * Return: 0 on success and errno on failure
- */
-static int hdd_map_req_id_to_pattern_id(hdd_context_t *hdd_ctx,
-					  uint32_t request_id,
-					  uint8_t *pattern_id)
-{
-	uint32_t i;
-
-	mutex_lock(&hdd_ctx->op_ctx.op_lock);
-	for (i = 0; i < MAXNUM_PERIODIC_TX_PTRNS; i++) {
-		if (hdd_ctx->op_ctx.op_table[i].request_id == MAX_REQUEST_ID) {
-			hdd_ctx->op_ctx.op_table[i].request_id = request_id;
-			*pattern_id = hdd_ctx->op_ctx.op_table[i].pattern_id;
-			mutex_unlock(&hdd_ctx->op_ctx.op_lock);
-			return 0;
-		} else if (hdd_ctx->op_ctx.op_table[i].request_id ==
-					request_id) {
-			*pattern_id = hdd_ctx->op_ctx.op_table[i].pattern_id;
-			mutex_unlock(&hdd_ctx->op_ctx.op_lock);
-			return 0;
-		}
-	}
-	mutex_unlock(&hdd_ctx->op_ctx.op_lock);
-	return -EINVAL;
-}
-
-/**
- * hdd_unmap_req_id_to_pattern_id() - unmap request id to pattern id
- * @hdd_ctx: HDD context
- * @request_id: [input] request id
- * @pattern_id: [output] pattern id
- *
- * This function loops through request id to pattern id array
- * reset request id to 0 (slot available again) and
- * return pattern id
- *
- * Return: 0 on success and errno on failure
- */
-static int hdd_unmap_req_id_to_pattern_id(hdd_context_t *hdd_ctx,
-					  uint32_t request_id,
-					  uint8_t *pattern_id)
-{
-	uint32_t i;
-
-	mutex_lock(&hdd_ctx->op_ctx.op_lock);
-	for (i = 0; i < MAXNUM_PERIODIC_TX_PTRNS; i++) {
-		if (hdd_ctx->op_ctx.op_table[i].request_id == request_id) {
-			hdd_ctx->op_ctx.op_table[i].request_id = MAX_REQUEST_ID;
-			*pattern_id = hdd_ctx->op_ctx.op_table[i].pattern_id;
-			mutex_unlock(&hdd_ctx->op_ctx.op_lock);
-			return 0;
-		}
-	}
-	mutex_unlock(&hdd_ctx->op_ctx.op_lock);
-	return -EINVAL;
-}
-
-
-/*
- * define short names for the global vendor params
- * used by __wlan_hdd_cfg80211_offloaded_packets()
- */
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_MAX
-#define PARAM_REQUEST_ID \
-		QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_REQUEST_ID
-#define PARAM_CONTROL \
-		QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SENDING_CONTROL
-#define PARAM_IP_PACKET \
-		QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET_DATA
-#define PARAM_SRC_MAC_ADDR \
-		QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SRC_MAC_ADDR
-#define PARAM_DST_MAC_ADDR \
-		QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_DST_MAC_ADDR
-#define PARAM_PERIOD QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_PERIOD
-
-/**
- * wlan_hdd_add_tx_ptrn() - add tx pattern
- * @adapter: adapter pointer
- * @hdd_ctx: hdd context
- * @tb: nl attributes
- *
- * This function reads the NL attributes and forms a AddTxPtrn message
- * posts it to SME.
- *
- */
-static int
-wlan_hdd_add_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
-			struct nlattr **tb)
-{
-	struct sSirAddPeriodicTxPtrn *add_req;
-	CDF_STATUS status;
-	uint32_t request_id, ret, len;
-	uint8_t pattern_id = 0;
-	struct cdf_mac_addr dst_addr;
-	uint16_t eth_type = htons(ETH_P_IP);
-
-	if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
-		hddLog(LOGE, FL("Not in Connected state!"));
-		return -ENOTSUPP;
-	}
-
-	add_req = cdf_mem_malloc(sizeof(*add_req));
-	if (!add_req) {
-		hddLog(LOGE, FL("memory allocation failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	if (request_id == MAX_REQUEST_ID) {
-		hddLog(LOGE, FL("request_id cannot be MAX"));
-		return -EINVAL;
-	}
-	hddLog(LOG1, FL("Request Id: %u"), request_id);
-
-	if (!tb[PARAM_PERIOD]) {
-		hddLog(LOGE, FL("attr period failed"));
-		goto fail;
-	}
-	add_req->usPtrnIntervalMs = nla_get_u32(tb[PARAM_PERIOD]);
-	hddLog(LOG1, FL("Period: %u ms"), add_req->usPtrnIntervalMs);
-	if (add_req->usPtrnIntervalMs == 0) {
-		hddLog(LOGE, FL("Invalid interval zero, return failure"));
-		goto fail;
-	}
-
-	if (!tb[PARAM_SRC_MAC_ADDR]) {
-		hddLog(LOGE, FL("attr source mac address failed"));
-		goto fail;
-	}
-	nla_memcpy(add_req->mac_address.bytes, tb[PARAM_SRC_MAC_ADDR],
-			CDF_MAC_ADDR_SIZE);
-	hddLog(LOG1, "input src mac address: "MAC_ADDRESS_STR,
-			MAC_ADDR_ARRAY(add_req->mac_address.bytes));
-
-	if (!cdf_is_macaddr_equal(&add_req->mac_address,
-				  &adapter->macAddressCurrent)) {
-		hdd_err("input src mac address and connected ap bssid are different");
-		goto fail;
-	}
-
-	if (!tb[PARAM_DST_MAC_ADDR]) {
-		hddLog(LOGE, FL("attr dst mac address failed"));
-		goto fail;
-	}
-	nla_memcpy(dst_addr.bytes, tb[PARAM_DST_MAC_ADDR], CDF_MAC_ADDR_SIZE);
-	hddLog(LOG1, "input dst mac address: "MAC_ADDRESS_STR,
-			MAC_ADDR_ARRAY(dst_addr.bytes));
-
-	if (!tb[PARAM_IP_PACKET]) {
-		hddLog(LOGE, FL("attr ip packet failed"));
-		goto fail;
-	}
-	add_req->ucPtrnSize = nla_len(tb[PARAM_IP_PACKET]);
-	hddLog(LOG1, FL("IP packet len: %u"), add_req->ucPtrnSize);
-
-	if (add_req->ucPtrnSize < 0 ||
-		add_req->ucPtrnSize > (PERIODIC_TX_PTRN_MAX_SIZE -
-					ETH_HLEN)) {
-		hddLog(LOGE, FL("Invalid IP packet len: %d"),
-				add_req->ucPtrnSize);
-		goto fail;
-	}
-
-	len = 0;
-	cdf_mem_copy(&add_req->ucPattern[0], dst_addr.bytes, CDF_MAC_ADDR_SIZE);
-	len += CDF_MAC_ADDR_SIZE;
-	cdf_mem_copy(&add_req->ucPattern[len], add_req->mac_address.bytes,
-			CDF_MAC_ADDR_SIZE);
-	len += CDF_MAC_ADDR_SIZE;
-	cdf_mem_copy(&add_req->ucPattern[len], &eth_type, 2);
-	len += 2;
-
-	/*
-	 * This is the IP packet, add 14 bytes Ethernet (802.3) header
-	 * ------------------------------------------------------------
-	 * | 14 bytes Ethernet (802.3) header | IP header and payload |
-	 * ------------------------------------------------------------
-	 */
-	cdf_mem_copy(&add_req->ucPattern[len],
-			nla_data(tb[PARAM_IP_PACKET]),
-			add_req->ucPtrnSize);
-	add_req->ucPtrnSize += len;
-
-	ret = hdd_map_req_id_to_pattern_id(hdd_ctx, request_id, &pattern_id);
-	if (ret) {
-		hddLog(LOGW, FL("req id to pattern id failed (ret=%d)"), ret);
-		goto fail;
-	}
-	add_req->ucPtrnId = pattern_id;
-	hddLog(LOG1, FL("pattern id: %d"), add_req->ucPtrnId);
-
-	status = sme_add_periodic_tx_ptrn(hdd_ctx->hHal, add_req);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-			FL("sme_add_periodic_tx_ptrn failed (err=%d)"), status);
-		goto fail;
-	}
-
-	EXIT();
-	cdf_mem_free(add_req);
-	return 0;
-
-fail:
-	cdf_mem_free(add_req);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_del_tx_ptrn() - delete tx pattern
- * @adapter: adapter pointer
- * @hdd_ctx: hdd context
- * @tb: nl attributes
- *
- * This function reads the NL attributes and forms a DelTxPtrn message
- * posts it to SME.
- *
- */
-static int
-wlan_hdd_del_tx_ptrn(hdd_adapter_t *adapter, hdd_context_t *hdd_ctx,
-			struct nlattr **tb)
-{
-	struct sSirDelPeriodicTxPtrn *del_req;
-	CDF_STATUS status;
-	uint32_t request_id, ret;
-	uint8_t pattern_id = 0;
-
-	/* Parse and fetch request Id */
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		return -EINVAL;
-	}
-	request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	if (request_id == MAX_REQUEST_ID) {
-		hddLog(LOGE, FL("request_id cannot be MAX"));
-		return -EINVAL;
-	}
-
-	ret = hdd_unmap_req_id_to_pattern_id(hdd_ctx, request_id, &pattern_id);
-	if (ret) {
-		hddLog(LOGW, FL("req id to pattern id failed (ret=%d)"), ret);
-		return -EINVAL;
-	}
-
-	del_req = cdf_mem_malloc(sizeof(*del_req));
-	if (!del_req) {
-		hddLog(LOGE, FL("memory allocation failed"));
-		return -ENOMEM;
-	}
-
-	cdf_copy_macaddr(&del_req->mac_address, &adapter->macAddressCurrent);
-	hdd_info(MAC_ADDRESS_STR, MAC_ADDR_ARRAY(del_req->mac_address.bytes));
-	del_req->ucPtrnId = pattern_id;
-	hddLog(LOG1, FL("Request Id: %u Pattern id: %d"),
-			 request_id, del_req->ucPtrnId);
-
-	status = sme_del_periodic_tx_ptrn(hdd_ctx->hHal, del_req);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-			FL("sme_del_periodic_tx_ptrn failed (err=%d)"), status);
-		goto fail;
-	}
-
-	EXIT();
-	cdf_mem_free(del_req);
-	return 0;
-
-fail:
-	cdf_mem_free(del_req);
-	return -EINVAL;
-}
-
-
-/**
- * __wlan_hdd_cfg80211_offloaded_packets() - send offloaded packets
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int
-__wlan_hdd_cfg80211_offloaded_packets(struct wiphy *wiphy,
-				     struct wireless_dev *wdev,
-				     const void *data,
-				     int data_len)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct nlattr *tb[PARAM_MAX + 1];
-	uint8_t control;
-	int ret;
-	static const struct nla_policy policy[PARAM_MAX + 1] = {
-			[PARAM_REQUEST_ID] = { .type = NLA_U32 },
-			[PARAM_CONTROL] = { .type = NLA_U32 },
-			[PARAM_SRC_MAC_ADDR] = { .type = NLA_BINARY,
-						.len = CDF_MAC_ADDR_SIZE },
-			[PARAM_DST_MAC_ADDR] = { .type = NLA_BINARY,
-						.len = CDF_MAC_ADDR_SIZE },
-			[PARAM_PERIOD] = { .type = NLA_U32 },
-	};
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (!sme_is_feature_supported_by_fw(WLAN_PERIODIC_TX_PTRN)) {
-		hddLog(LOGE,
-			FL("Periodic Tx Pattern Offload feature is not supported in FW!"));
-		return -ENOTSUPP;
-	}
-
-	if (nla_parse(tb, PARAM_MAX, data, data_len, policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	if (!tb[PARAM_CONTROL]) {
-		hddLog(LOGE, FL("attr control failed"));
-		return -EINVAL;
-	}
-	control = nla_get_u32(tb[PARAM_CONTROL]);
-	hddLog(LOG1, FL("Control: %d"), control);
-
-	if (control == WLAN_START_OFFLOADED_PACKETS)
-		return wlan_hdd_add_tx_ptrn(adapter, hdd_ctx, tb);
-	else if (control == WLAN_STOP_OFFLOADED_PACKETS)
-		return wlan_hdd_del_tx_ptrn(adapter, hdd_ctx, tb);
-	else {
-		hddLog(LOGE, FL("Invalid control: %d"), control);
-		return -EINVAL;
-	}
-}
-
-/*
- * done with short names for the global vendor params
- * used by __wlan_hdd_cfg80211_offloaded_packets()
- */
-#undef PARAM_MAX
-#undef PARAM_REQUEST_ID
-#undef PARAM_CONTROL
-#undef PARAM_IP_PACKET
-#undef PARAM_SRC_MAC_ADDR
-#undef PARAM_DST_MAC_ADDR
-#undef PARAM_PERIOD
-
-/**
- * wlan_hdd_cfg80211_offloaded_packets() - Wrapper to offload packets
- * @wiphy:    wiphy structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of @data
- *
- * Return: 0 on success; errno on failure
- */
-static int wlan_hdd_cfg80211_offloaded_packets(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_offloaded_packets(wiphy,
-					wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-#endif
-
-/*
- * define short names for the global vendor params
- * used by __wlan_hdd_cfg80211_monitor_rssi()
- */
-#define PARAM_MAX QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX
-#define PARAM_REQUEST_ID QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_REQUEST_ID
-#define PARAM_CONTROL QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CONTROL
-#define PARAM_MIN_RSSI QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MIN_RSSI
-#define PARAM_MAX_RSSI QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX_RSSI
-
-/**
- * __wlan_hdd_cfg80211_monitor_rssi() - monitor rssi
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int
-__wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy,
-				 struct wireless_dev *wdev,
-				 const void *data,
-				 int data_len)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct nlattr *tb[PARAM_MAX + 1];
-	struct rssi_monitor_req req;
-	CDF_STATUS status;
-	int ret;
-	uint32_t control;
-	static const struct nla_policy policy[PARAM_MAX + 1] = {
-			[PARAM_REQUEST_ID] = { .type = NLA_U32 },
-			[PARAM_CONTROL] = { .type = NLA_U32 },
-			[PARAM_MIN_RSSI] = { .type = NLA_S8 },
-			[PARAM_MAX_RSSI] = { .type = NLA_S8 },
-	};
-
-	ENTER();
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return -EINVAL;
-
-	if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
-		hddLog(LOGE, FL("Not in Connected state!"));
-		return -ENOTSUPP;
-	}
-
-	if (nla_parse(tb, PARAM_MAX, data, data_len, policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		return -EINVAL;
-	}
-
-	if (!tb[PARAM_CONTROL]) {
-		hddLog(LOGE, FL("attr control failed"));
-		return -EINVAL;
-	}
-
-	req.request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	req.session_id = adapter->sessionId;
-	control = nla_get_u32(tb[PARAM_CONTROL]);
-
-	if (control == QCA_WLAN_RSSI_MONITORING_START) {
-		req.control = true;
-		if (!tb[PARAM_MIN_RSSI]) {
-			hddLog(LOGE, FL("attr min rssi failed"));
-			return -EINVAL;
-		}
-
-		if (!tb[PARAM_MAX_RSSI]) {
-			hddLog(LOGE, FL("attr max rssi failed"));
-			return -EINVAL;
-		}
-
-		req.min_rssi = nla_get_s8(tb[PARAM_MIN_RSSI]);
-		req.max_rssi = nla_get_s8(tb[PARAM_MAX_RSSI]);
-
-		if (!(req.min_rssi < req.max_rssi)) {
-			hddLog(LOGW, FL("min_rssi: %d must be less than max_rssi: %d"),
-					req.min_rssi, req.max_rssi);
-			return -EINVAL;
-		}
-		hddLog(LOG1, FL("Min_rssi: %d Max_rssi: %d"),
-			req.min_rssi, req.max_rssi);
-
-	} else if (control == QCA_WLAN_RSSI_MONITORING_STOP)
-		req.control = false;
-	else {
-		hddLog(LOGE, FL("Invalid control cmd: %d"), control);
-		return -EINVAL;
-	}
-	hddLog(LOG1, FL("Request Id: %u Session_id: %d Control: %d"),
-			req.request_id, req.session_id, req.control);
-
-	status = sme_set_rssi_monitoring(hdd_ctx->hHal, &req);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-			FL("sme_set_rssi_monitoring failed(err=%d)"), status);
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/*
- * done with short names for the global vendor params
- * used by __wlan_hdd_cfg80211_monitor_rssi()
- */
-#undef PARAM_MAX
-#undef PARAM_CONTROL
-#undef PARAM_REQUEST_ID
-#undef PARAM_MAX_RSSI
-#undef PARAM_MIN_RSSI
-
-/**
- * wlan_hdd_cfg80211_monitor_rssi() - SSR wrapper to rssi monitoring
- * @wiphy:    wiphy structure pointer
- * @wdev:     Wireless device structure pointer
- * @data:     Pointer to the data received
- * @data_len: Length of @data
- *
- * Return: 0 on success; errno on failure
- */
-static int
-wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy, struct wireless_dev *wdev,
-			       const void *data, int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_monitor_rssi(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_rssi_threshold_breached() - rssi breached NL event
- * @hddctx: HDD context
- * @data: rssi breached event data
- *
- * This function reads the rssi breached event %data and fill in the skb with
- * NL attributes and send up the NL event.
- *
- * Return: none
- */
-void hdd_rssi_threshold_breached(void *hddctx,
-				 struct rssi_breach_event *data)
-{
-	hdd_context_t *hdd_ctx  = hddctx;
-	struct sk_buff *skb;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx))
-		return;
-	if (!data) {
-		hddLog(LOGE, FL("data is null"));
-		return;
-	}
-
-	skb = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
-				  NULL,
-				  EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-				  QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI_INDEX,
-				  GFP_KERNEL);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-
-	hddLog(LOG1, "Req Id: %u Current rssi: %d",
-			data->request_id, data->curr_rssi);
-	hddLog(LOG1, "Current BSSID: "MAC_ADDRESS_STR,
-			MAC_ADDR_ARRAY(data->curr_bssid.bytes));
-
-	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_REQUEST_ID,
-		data->request_id) ||
-	    nla_put(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_BSSID,
-		sizeof(data->curr_bssid), data->curr_bssid.bytes) ||
-	    nla_put_s8(skb, QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_RSSI,
-		data->curr_rssi)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto fail;
-	}
-
-	cfg80211_vendor_event(skb, GFP_KERNEL);
-	return;
-
-fail:
-	kfree_skb(skb);
-	return;
-}
-
-/** __wlan_hdd_cfg80211_get_preferred_freq_list() - get preferred frequency list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * This function return the preferred frequency list generated by the policy
- * manager.
- *
- * Return: success or failure code
- */
-static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
-						 struct wireless_dev
-						 *wdev, const void *data,
-						 int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	int i, ret = 0;
-	CDF_STATUS status;
-	uint8_t pcl[MAX_NUM_CHAN];
-	uint32_t pcl_len = 0;
-	uint32_t freq_list[MAX_NUM_CHAN];
-	enum cds_con_mode intf_mode;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX + 1];
-	struct sk_buff *reply_skb;
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret)
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX,
-		      data, data_len, NULL)) {
-		hdd_err("Invalid ATTR");
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE]) {
-		hdd_err("attr interface type failed");
-		return -EINVAL;
-	}
-
-	intf_mode = nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE]);
-
-	if (intf_mode < CDS_STA_MODE || intf_mode >= CDS_MAX_NUM_OF_MODE) {
-		hdd_err("Invalid interface type");
-		return -EINVAL;
-	}
-
-	hdd_debug("Userspace requested pref freq list");
-
-	status = cds_get_pcl(intf_mode, pcl, &pcl_len);
-	if (status != CDF_STATUS_SUCCESS) {
-		hdd_err("Get pcl failed");
-		return -EINVAL;
-	}
-
-	/* convert channel number to frequency */
-	for (i = 0; i < pcl_len; i++) {
-		if (pcl[i] <= ARRAY_SIZE(hdd_channels_2_4_ghz))
-			freq_list[i] =
-				ieee80211_channel_to_frequency(pcl[i],
-							IEEE80211_BAND_2GHZ);
-		else
-			freq_list[i] =
-				ieee80211_channel_to_frequency(pcl[i],
-							IEEE80211_BAND_5GHZ);
-	}
-
-	/* send the freq_list back to supplicant */
-	reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u32) +
-							sizeof(u32) *
-							pcl_len +
-							NLMSG_HDRLEN);
-
-	if (!reply_skb) {
-		hdd_err("Allocate reply_skb failed");
-		return -EINVAL;
-	}
-
-	if (nla_put_u32(reply_skb,
-		QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE,
-			intf_mode) ||
-		nla_put(reply_skb,
-			QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST,
-			sizeof(uint32_t) * pcl_len,
-			freq_list)) {
-		hdd_err("nla put fail");
-		kfree_skb(reply_skb);
-		return -EINVAL;
-	}
-
-	return cfg80211_vendor_cmd_reply(reply_skb);
-}
-
-/** wlan_hdd_cfg80211_get_preferred_freq_list () - get preferred frequency list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * This function return the preferred frequency list generated by the policy
- * manager.
- *
- * Return: success or failure code
- */
-static int wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy,
-						 struct wireless_dev
-						 *wdev, const void *data,
-						 int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_preferred_freq_list(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_probable_oper_channel () - set probable channel
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	struct net_device *ndev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	int ret = 0;
-	enum cds_con_mode intf_mode;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX + 1];
-	uint32_t channel_hint;
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret)
-		return ret;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_MAX,
-		      data, data_len, NULL)) {
-		hdd_err("Invalid ATTR");
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_IFACE_TYPE]) {
-		hdd_err("attr interface type failed");
-		return -EINVAL;
-	}
-
-	intf_mode = nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_IFACE_TYPE]);
-
-	if (intf_mode < CDS_STA_MODE || intf_mode >= CDS_MAX_NUM_OF_MODE) {
-		hdd_err("Invalid interface type");
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ]) {
-		hdd_err("attr probable freq failed");
-		return -EINVAL;
-	}
-
-	channel_hint = cds_freq_to_chan(nla_get_u32(tb
-			[QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ]));
-
-	/* check pcl table */
-	if (!cds_allow_concurrency(intf_mode,
-					channel_hint, HW_MODE_20_MHZ)) {
-		hdd_err("Set channel hint failed due to concurrency check");
-		return -EINVAL;
-	}
-
-	if (hdd_ctx->config->policy_manager_enabled) {
-		ret = cdf_reset_connection_update();
-		if (!CDF_IS_STATUS_SUCCESS(ret))
-			hdd_err("clearing event failed");
-
-		ret = cds_current_connections_update(adapter->sessionId,
-					channel_hint,
-					CDS_UPDATE_REASON_SET_OPER_CHAN);
-		if (CDF_STATUS_E_FAILURE == ret) {
-			/* return in the failure case */
-			hdd_err("ERROR: connections update failed!!");
-			return -EINVAL;
-		}
-
-		if (CDF_STATUS_SUCCESS == ret) {
-			/*
-			 * Success is the only case for which we expect hw mode
-			 * change to take place, hence we need to wait.
-			 * For any other return value it should be a pass
-			 * through
-			 */
-			ret = cdf_wait_for_connection_update();
-			if (!CDF_IS_STATUS_SUCCESS(ret)) {
-				hdd_err("ERROR: cdf wait for event failed!!");
-				return -EINVAL;
-			}
-
-		}
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_probable_oper_channel () - set probable channel
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_probable_oper_channel(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct
-nla_policy
-qca_wlan_vendor_attr_policy[QCA_WLAN_VENDOR_ATTR_MAX+1] = {
-	[QCA_WLAN_VENDOR_ATTR_MAC_ADDR] = { .type = NLA_UNSPEC },
-};
-
-/**
- * __wlan_hdd_cfg80211_get_link_properties() - Get link properties
- * @wiphy: WIPHY structure pointer
- * @wdev: Wireless device structure pointer
- * @data: Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function is used to get link properties like nss, rate flags and
- * operating frequency for the active connection with the given peer.
- *
- * Return: 0 on success and errno on failure
- */
-static int __wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
-						   struct wireless_dev *wdev,
-						   const void *data,
-						   int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_station_ctx_t *hdd_sta_ctx;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_MAX+1];
-	uint8_t peer_mac[CDF_MAC_ADDR_SIZE];
-	uint32_t sta_id;
-	struct sk_buff *reply_skb;
-	uint32_t rate_flags = 0;
-	uint8_t nss;
-	uint8_t final_rate_flags = 0;
-	uint32_t freq;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (0 != wlan_hdd_validate_context(hdd_ctx))
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX, data, data_len,
-		      qca_wlan_vendor_attr_policy)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("Invalid attribute"));
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_MAC_ADDR]) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Attribute peerMac not provided for mode=%d"),
-		       adapter->device_mode);
-		return -EINVAL;
-	}
-
-	cdf_mem_copy(peer_mac, nla_data(tb[QCA_WLAN_VENDOR_ATTR_MAC_ADDR]),
-		     CDF_MAC_ADDR_SIZE);
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       FL("peerMac="MAC_ADDRESS_STR" for device_mode:%d"),
-	       MAC_ADDR_ARRAY(peer_mac), adapter->device_mode);
-
-	if (adapter->device_mode == WLAN_HDD_INFRA_STATION ||
-	    adapter->device_mode == WLAN_HDD_P2P_CLIENT) {
-		hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-		if ((hdd_sta_ctx->conn_info.connState !=
-			eConnectionState_Associated) ||
-		    !cdf_mem_compare(hdd_sta_ctx->conn_info.bssId.bytes,
-			peer_mac, CDF_MAC_ADDR_SIZE)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("Not Associated to mac "MAC_ADDRESS_STR),
-			       MAC_ADDR_ARRAY(peer_mac));
-			return -EINVAL;
-		}
-
-		nss  = hdd_sta_ctx->conn_info.nss;
-		freq = cds_chan_to_freq(
-				hdd_sta_ctx->conn_info.operationChannel);
-		rate_flags = hdd_sta_ctx->conn_info.rate_flags;
-	} else if (adapter->device_mode == WLAN_HDD_P2P_GO ||
-		   adapter->device_mode == WLAN_HDD_SOFTAP) {
-
-		for (sta_id = 0; sta_id < WLAN_MAX_STA_COUNT; sta_id++) {
-			if (adapter->aStaInfo[sta_id].isUsed &&
-			    !cdf_is_macaddr_broadcast(
-				&adapter->aStaInfo[sta_id].macAddrSTA) &&
-			    cdf_mem_compare(
-				&adapter->aStaInfo[sta_id].macAddrSTA.bytes,
-				peer_mac, CDF_MAC_ADDR_SIZE))
-				break;
-		}
-
-		if (WLAN_MAX_STA_COUNT == sta_id) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("No active peer with mac="MAC_ADDRESS_STR),
-			       MAC_ADDR_ARRAY(peer_mac));
-			return -EINVAL;
-		}
-
-		nss = adapter->aStaInfo[sta_id].nss;
-		freq = cds_chan_to_freq(
-			(WLAN_HDD_GET_AP_CTX_PTR(adapter))->operatingChannel);
-		rate_flags = adapter->aStaInfo[sta_id].rate_flags;
-	} else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Not Associated! with mac "MAC_ADDRESS_STR),
-		       MAC_ADDR_ARRAY(peer_mac));
-		return -EINVAL;
-	}
-
-	if (!(rate_flags & eHAL_TX_RATE_LEGACY)) {
-		if (rate_flags & eHAL_TX_RATE_VHT80) {
-			final_rate_flags |= RATE_INFO_FLAGS_VHT_MCS;
-			final_rate_flags |= RATE_INFO_FLAGS_80_MHZ_WIDTH;
-		} else if (rate_flags & eHAL_TX_RATE_VHT40) {
-			final_rate_flags |= RATE_INFO_FLAGS_VHT_MCS;
-			final_rate_flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
-		} else if (rate_flags & eHAL_TX_RATE_VHT20) {
-			final_rate_flags |= RATE_INFO_FLAGS_VHT_MCS;
-		} else if (rate_flags &
-				(eHAL_TX_RATE_HT20 | eHAL_TX_RATE_HT40)) {
-			final_rate_flags |= RATE_INFO_FLAGS_MCS;
-			if (rate_flags & eHAL_TX_RATE_HT40)
-				final_rate_flags |=
-					RATE_INFO_FLAGS_40_MHZ_WIDTH;
-		}
-
-		if (rate_flags & eHAL_TX_RATE_SGI) {
-			if (!(final_rate_flags & RATE_INFO_FLAGS_VHT_MCS))
-				final_rate_flags |= RATE_INFO_FLAGS_MCS;
-			final_rate_flags |= RATE_INFO_FLAGS_SHORT_GI;
-		}
-	}
-
-	reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
-			sizeof(u8) + sizeof(u8) + sizeof(u32) + NLMSG_HDRLEN);
-
-	if (NULL == reply_skb) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("getLinkProperties: skb alloc failed"));
-		return -EINVAL;
-	}
-
-	if (nla_put_u8(reply_skb,
-		QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_NSS,
-		nss) ||
-	    nla_put_u8(reply_skb,
-		QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_RATE_FLAGS,
-		final_rate_flags) ||
-	    nla_put_u32(reply_skb,
-		QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_FREQ,
-		freq)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("nla_put failed"));
-		kfree_skb(reply_skb);
-		return -EINVAL;
-	}
-
-	return cfg80211_vendor_cmd_reply(reply_skb);
-}
-
-/**
- * wlan_hdd_cfg80211_get_link_properties() - Wrapper function to get link
- * properties.
- * @wiphy: WIPHY structure pointer
- * @wdev: Wireless device structure pointer
- * @data: Pointer to the data received
- * @data_len: Length of the data received
- *
- * This function is used to get link properties like nss, rate flags and
- * operating frequency for the active connection with the given peer.
- *
- * Return: 0 on success and errno on failure
- */
-static int wlan_hdd_cfg80211_get_link_properties(struct wiphy *wiphy,
-						 struct wireless_dev *wdev,
-						 const void *data,
-						 int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_link_properties(wiphy,
-			wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct
-nla_policy
-qca_wlan_vendor_ota_test_policy
-[QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_OTA_TEST_ENABLE] = {.type = NLA_U8 },
-};
-
-/**
- * __wlan_hdd_cfg80211_set_ota_test () - enable/disable OTA test
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int __wlan_hdd_cfg80211_set_ota_test(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	tHalHandle hal = WLAN_HDD_GET_HAL_CTX(adapter);
-	hdd_context_t *hdd_ctx  = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX + 1];
-	uint8_t ota_enable = 0;
-	CDF_STATUS status;
-	uint32_t current_roam_state;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (0 != wlan_hdd_validate_context(hdd_ctx))
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX,
-		      data, data_len,
-		      qca_wlan_vendor_ota_test_policy)) {
-		hdd_err("invalid attr");
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_OTA_TEST_ENABLE]) {
-		hdd_err("attr ota test failed");
-		return -EINVAL;
-	}
-
-	ota_enable = nla_get_u8(
-		tb[QCA_WLAN_VENDOR_ATTR_OTA_TEST_ENABLE]);
-
-	hdd_info(" OTA test enable = %d", ota_enable);
-	if (ota_enable != 1) {
-		hdd_err("Invalid value, only enable test mode is supported!");
-		return -EINVAL;
-	}
-
-	current_roam_state =
-			sme_get_current_roam_state(hal, adapter->sessionId);
-	status = sme_stop_roaming(hal, adapter->sessionId,
-					eCsrHddIssued);
-	if (status != CDF_STATUS_SUCCESS) {
-		hdd_err("Enable/Disable roaming failed");
-		return -EINVAL;
-	}
-
-	status = sme_ps_enable_disable(hal, adapter->sessionId,
-					SME_PS_DISABLE);
-	if (status != CDF_STATUS_SUCCESS) {
-		hdd_err("Enable/Disable power save failed");
-		/* restore previous roaming setting */
-		if (current_roam_state == eCSR_ROAMING_STATE_JOINING ||
-			 current_roam_state == eCSR_ROAMING_STATE_JOINED)
-			status = sme_start_roaming(hal, adapter->sessionId,
-						eCsrHddIssued);
-		else if (current_roam_state == eCSR_ROAMING_STATE_STOP ||
-			 current_roam_state == eCSR_ROAMING_STATE_IDLE)
-			status = sme_stop_roaming(hal, adapter->sessionId,
-						eCsrHddIssued);
-
-		if (status != CDF_STATUS_SUCCESS)
-			hdd_err("Restoring roaming state failed");
-
-		return -EINVAL;
-	}
-
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_ota_test () - Enable or disable OTA test
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int wlan_hdd_cfg80211_set_ota_test(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_ota_test(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_txpower_scale () - txpower scaling
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int __wlan_hdd_cfg80211_txpower_scale(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = NULL;
-	int ret = 0;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_MAX + 1];
-	uint8_t scale_value;
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret)
-		return ret;
-
-	adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_MAX,
-		      data, data_len, NULL)) {
-		hdd_err("Invalid ATTR");
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE]) {
-		hdd_err("attr tx power scale failed");
-		return -EINVAL;
-	}
-
-	scale_value = nla_get_u8(tb
-		    [QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE]);
-
-	if (scale_value > MAX_TXPOWER_SCALE) {
-		hdd_err("Invalid tx power scale level");
-		return -EINVAL;
-	}
-
-	ret = wma_set_tx_power_scale(adapter->sessionId, scale_value);
-
-	if (ret != 0) {
-		hdd_err("Set tx power scale failed");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_txpower_scale () - txpower scaling
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int wlan_hdd_cfg80211_txpower_scale(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_txpower_scale(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_txpower_scale_decr_db () - txpower scaling
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int __wlan_hdd_cfg80211_txpower_scale_decr_db(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = NULL;
-	int ret = 0;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_MAX + 1];
-	uint8_t scale_value;
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret)
-		return ret;
-
-	adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_MAX,
-		      data, data_len, NULL)) {
-		hdd_err("Invalid ATTR");
-		return -EINVAL;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB]) {
-		hdd_err("attr tx power decrease db value failed");
-		return -EINVAL;
-	}
-
-	scale_value = nla_get_u8(tb
-		    [QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB]);
-
-	ret = wma_set_tx_power_scale_decr_db(adapter->sessionId, scale_value);
-
-	if (ret != 0) {
-		hdd_err("Set tx power decrease db failed");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_txpower_scale_decr_db () - txpower scaling
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int wlan_hdd_cfg80211_txpower_scale_decr_db(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_txpower_scale_decr_db(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = {
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = is_driver_dfs_capable
-	},
-
-#ifdef WLAN_FEATURE_NAN
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NAN,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_nan_request
-	},
-#endif
-
-#ifdef WLAN_FEATURE_STATS_EXT
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_STATS_EXT,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_stats_ext_request
-	},
-#endif
-#ifdef FEATURE_WLAN_EXTSCAN
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_start
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_stop
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_extscan_get_valid_channels
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_get_capabilities
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_get_cached_results
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_set_bssid_hotlist
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_reset_bssid_hotlist
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE,
-		.flags =
-			WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_set_significant_change
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE,
-		.flags =
-			WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_reset_significant_change
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_set_epno_list
-	},
-#endif /* FEATURE_WLAN_EXTSCAN */
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ll_stats_clear
-	},
-
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ll_stats_set
-	},
-
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ll_stats_get
-	},
-#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
-#ifdef FEATURE_WLAN_TDLS
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_exttdls_enable
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_exttdls_disable
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_exttdls_get_status
-	},
-#endif
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_get_supported_features
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_set_scanning_mac_oui
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = cds_cfg80211_get_concurrency_matrix
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_disable_dfs_chan_scan
-	},
-
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DO_ACS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				WIPHY_VENDOR_CMD_NEED_NETDEV |
-				WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_do_acs
-	},
-
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_get_features
-	},
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_keymgmt_set_key
-	},
-#endif
-#ifdef FEATURE_WLAN_EXTSCAN
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_set_passpoint_list
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_RESET_PASSPOINT_LIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_reset_passpoint_list
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_set_ssid_hotlist
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_extscan_reset_ssid_hotlist
-	},
-#endif /* FEATURE_WLAN_EXTSCAN */
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_get_wifi_info
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_wifi_configuration_set
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_ROAM,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_set_ext_roam_params
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_START,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_wifi_logger_start
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV,
-		.doit = wlan_hdd_cfg80211_wifi_logger_get_ring_data
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_get_preferred_freq_list
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_SET_PROBABLE_OPER_CHANNEL,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_set_probable_oper_channel
-	},
-#ifdef FEATURE_WLAN_TDLS
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_get_tdls_capabilities
-	},
-#endif
-#ifdef WLAN_FEATURE_OFFLOAD_PACKETS
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_offloaded_packets
-	},
-#endif
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_monitor_rssi
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_get_logger_supp_feature
-	},
-#ifdef WLAN_FEATURE_MEMDUMP
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_get_fw_mem_dump
-	},
-#endif /* WLAN_FEATURE_MEMDUMP */
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			WIPHY_VENDOR_CMD_NEED_NETDEV |
-			WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_vendor_scan
-	},
-
-	/* OCB commands */
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ocb_set_config
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ocb_set_utc_time
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_OCB_START_TIMING_ADVERT,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ocb_start_timing_advert
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_OCB_STOP_TIMING_ADVERT,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ocb_stop_timing_advert
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_OCB_GET_TSF_TIMER,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_ocb_get_tsf_timer
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DCC_GET_STATS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_dcc_get_stats
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DCC_CLEAR_STATS,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_dcc_clear_stats
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DCC_UPDATE_NDL,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_dcc_update_ndl
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-			 WIPHY_VENDOR_CMD_NEED_NETDEV |
-			 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_get_link_properties
-	},
-	{
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_OTA_TEST,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_set_ota_test
-	},
-#ifdef FEATURE_LFR_SUBNET_DETECTION
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				WIPHY_VENDOR_CMD_NEED_NETDEV |
-				WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_set_gateway_params
-	},
-#endif /* FEATURE_LFR_SUBNET_DETECTION */
-	{
-		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_txpower_scale
-	},
-	{
-		.info.vendor_id = QCA_NL80211_VENDOR_ID,
-		.info.subcmd =
-			QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE_DECR_DB,
-		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
-				 WIPHY_VENDOR_CMD_NEED_NETDEV |
-				 WIPHY_VENDOR_CMD_NEED_RUNNING,
-		.doit = wlan_hdd_cfg80211_txpower_scale_decr_db
-	},
-};
-
-/**
- * hdd_cfg80211_wiphy_alloc() - Allocate wiphy context
- * @priv_size:         Size of the hdd context.
- *
- * Allocate wiphy context and hdd context.
- *
- * Return: hdd context on success and NULL on failure.
- */
-hdd_context_t *hdd_cfg80211_wiphy_alloc(int priv_size)
-{
-	struct wiphy *wiphy;
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	wiphy = wiphy_new(&wlan_hdd_cfg80211_ops, priv_size);
-
-	if (!wiphy) {
-		hdd_err("wiphy init failed!\n");
-		return NULL;
-	}
-
-	hdd_ctx = wiphy_priv(wiphy);
-
-	hdd_ctx->wiphy = wiphy;
-
-	return hdd_ctx;
-}
-
-/*
- * FUNCTION: wlan_hdd_cfg80211_update_band
- * This function is called from the supplicant through a
- * private ioctl to change the band value
- */
-int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand)
-{
-	int i, j;
-	enum channel_state channelEnabledState;
-
-	ENTER();
-
-	for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
-
-		if (NULL == wiphy->bands[i])
-			continue;
-
-		for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
-			struct ieee80211_supported_band *band = wiphy->bands[i];
-
-			channelEnabledState =
-				cds_get_channel_state(band->channels[j].
-								 hw_value);
-
-			if (IEEE80211_BAND_2GHZ == i && eCSR_BAND_5G == eBand) {
-				/* 5G only */
-#ifdef WLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY
-				/* Enable Social channels for P2P */
-				if (WLAN_HDD_IS_SOCIAL_CHANNEL
-					    (band->channels[j].center_freq)
-				    && CHANNEL_STATE_ENABLE ==
-				    channelEnabledState)
-					band->channels[j].flags &=
-						~IEEE80211_CHAN_DISABLED;
-				else
-#endif
-				band->channels[j].flags |=
-					IEEE80211_CHAN_DISABLED;
-				continue;
-			} else if (IEEE80211_BAND_5GHZ == i &&
-					eCSR_BAND_24 == eBand) {
-				/* 2G only */
-				band->channels[j].flags |=
-					IEEE80211_CHAN_DISABLED;
-				continue;
-			}
-
-			if (CHANNEL_STATE_DISABLE == channelEnabledState ||
-			    CHANNEL_STATE_INVALID == channelEnabledState) {
-				band->channels[j].flags |=
-					IEEE80211_CHAN_DISABLED;
-			} else if (CHANNEL_STATE_DFS == channelEnabledState) {
-				band->channels[j].flags &=
-					~IEEE80211_CHAN_DISABLED;
-				band->channels[j].flags |= IEEE80211_CHAN_RADAR;
-			} else {
-				band->channels[j].flags &=
-					~(IEEE80211_CHAN_DISABLED |
-					  IEEE80211_CHAN_RADAR);
-			}
-		}
-	}
-	return 0;
-}
-
-/*
- * FUNCTION: wlan_hdd_cfg80211_init
- * This function is called by hdd_wlan_startup()
- * during initialization.
- * This function is used to initialize and register wiphy structure.
- */
-int wlan_hdd_cfg80211_init(struct device *dev,
-			   struct wiphy *wiphy, struct hdd_config *pCfg)
-{
-	int i, j;
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-
-	ENTER();
-
-	/* Now bind the underlying wlan device with wiphy */
-	set_wiphy_dev(wiphy, dev);
-
-	wiphy->mgmt_stypes = wlan_hdd_txrx_stypes;
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-	wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS;
-	wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
-#else
-	wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS;
-	wiphy->country_ie_pref |= NL80211_COUNTRY_IE_IGNORE_CORE;
-#endif
-
-	wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME
-			| WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD
-			| WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL
-#ifdef FEATURE_WLAN_STA_4ADDR_SCHEME
-			| WIPHY_FLAG_4ADDR_STATION
-#endif
-			| WIPHY_FLAG_OFFCHAN_TX;
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-	wiphy->wowlan = &wowlan_support_cfg80211_init;
-#else
-	wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT;
-	wiphy->wowlan.n_patterns = WOWL_MAX_PTRNS_ALLOWED;
-	wiphy->wowlan.pattern_min_len = 1;
-	wiphy->wowlan.pattern_max_len = WOWL_PTRN_MAX_SIZE;
-#endif
-
-	if (pCfg->isFastTransitionEnabled || pCfg->isFastRoamIniFeatureEnabled
-#ifdef FEATURE_WLAN_ESE
-	    || pCfg->isEseIniFeatureEnabled
-#endif
-	    ) {
-		wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
-	}
-#ifdef FEATURE_WLAN_TDLS
-	wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS
-			| WIPHY_FLAG_TDLS_EXTERNAL_SETUP;
-#endif
-
-	wiphy->features |= NL80211_FEATURE_HT_IBSS;
-
-#ifdef FEATURE_WLAN_SCAN_PNO
-	if (pCfg->configPNOScanSupport) {
-		wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
-		wiphy->max_sched_scan_ssids = SIR_PNO_MAX_SUPP_NETWORKS;
-		wiphy->max_match_sets = SIR_PNO_MAX_SUPP_NETWORKS;
-		wiphy->max_sched_scan_ie_len = SIR_MAC_MAX_IE_LENGTH;
-	}
-#endif /*FEATURE_WLAN_SCAN_PNO */
-
-#if  defined QCA_WIFI_FTM
-	if (cds_get_conparam() != CDF_GLOBAL_FTM_MODE) {
-#endif
-
-	/* even with WIPHY_FLAG_CUSTOM_REGULATORY,
-	   driver can still register regulatory callback and
-	   it will get regulatory settings in wiphy->band[], but
-	   driver need to determine what to do with both
-	   regulatory settings */
-
-	wiphy->reg_notifier = hdd_reg_notifier;
-
-#if  defined QCA_WIFI_FTM
-}
-#endif
-
-	wiphy->max_scan_ssids = MAX_SCAN_SSID;
-
-	wiphy->max_scan_ie_len = SIR_MAC_MAX_ADD_IE_LENGTH;
-
-	wiphy->max_acl_mac_addrs = MAX_ACL_MAC_ADDRESS;
-
-	/* Supports STATION & AD-HOC modes right now */
-	wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION)
-				 | BIT(NL80211_IFTYPE_ADHOC)
-				 | BIT(NL80211_IFTYPE_P2P_CLIENT)
-				 | BIT(NL80211_IFTYPE_P2P_GO)
-				 | BIT(NL80211_IFTYPE_AP);
-
-	if (pCfg->advertiseConcurrentOperation) {
-		if (pCfg->enableMCC) {
-			int i;
-			for (i = 0; i < ARRAY_SIZE(wlan_hdd_iface_combination);
-			     i++) {
-				if (!pCfg->allowMCCGODiffBI)
-					wlan_hdd_iface_combination[i].
-					beacon_int_infra_match = true;
-			}
-		}
-		wiphy->n_iface_combinations =
-			ARRAY_SIZE(wlan_hdd_iface_combination);
-		wiphy->iface_combinations = wlan_hdd_iface_combination;
-	}
-
-	/* Before registering we need to update the ht capabilitied based
-	 * on ini values*/
-	if (!pCfg->ShortGI20MhzEnable) {
-		wlan_hdd_band_2_4_ghz.ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_20;
-		wlan_hdd_band_5_ghz.ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_20;
-		wlan_hdd_band_p2p_2_4_ghz.ht_cap.cap &=
-			~IEEE80211_HT_CAP_SGI_20;
-	}
-
-	if (!pCfg->ShortGI40MhzEnable) {
-		wlan_hdd_band_5_ghz.ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
-	}
-
-	if (!pCfg->nChannelBondingMode5GHz) {
-		wlan_hdd_band_5_ghz.ht_cap.cap &=
-			~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
-	}
-
-	wiphy->bands[IEEE80211_BAND_2GHZ] = &wlan_hdd_band_2_4_ghz;
-	if (true == hdd_is_5g_supported(pHddCtx)) {
-		wiphy->bands[IEEE80211_BAND_5GHZ] = &wlan_hdd_band_5_ghz;
-	}
-
-	for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
-
-		if (NULL == wiphy->bands[i])
-			continue;
-
-		for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
-			struct ieee80211_supported_band *band = wiphy->bands[i];
-
-			if (IEEE80211_BAND_2GHZ == i &&
-				eCSR_BAND_5G == pCfg->nBandCapability) {
-				/* 5G only */
-#ifdef WLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY
-				/* Enable social channels for P2P */
-				if (WLAN_HDD_IS_SOCIAL_CHANNEL
-					    (band->channels[j].center_freq))
-					band->channels[j].flags &=
-						~IEEE80211_CHAN_DISABLED;
-				else
-#endif
-				band->channels[j].flags |=
-					IEEE80211_CHAN_DISABLED;
-				continue;
-			} else if (IEEE80211_BAND_5GHZ == i &&
-					eCSR_BAND_24 == pCfg->nBandCapability) {
-				/* 2G only */
-				band->channels[j].flags |=
-					IEEE80211_CHAN_DISABLED;
-				continue;
-			}
-		}
-	}
-	/*Initialise the supported cipher suite details */
-	wiphy->cipher_suites = hdd_cipher_suites;
-	wiphy->n_cipher_suites = ARRAY_SIZE(hdd_cipher_suites);
-
-	/*signal strength in mBm (100*dBm) */
-	wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
-	wiphy->max_remain_on_channel_duration = MAX_REMAIN_ON_CHANNEL_DURATION;
-
-	if (cds_get_conparam() != CDF_GLOBAL_FTM_MODE) {
-		wiphy->n_vendor_commands =
-				ARRAY_SIZE(hdd_wiphy_vendor_commands);
-		wiphy->vendor_commands = hdd_wiphy_vendor_commands;
-
-		wiphy->vendor_events = wlan_hdd_cfg80211_vendor_events;
-		wiphy->n_vendor_events =
-				ARRAY_SIZE(wlan_hdd_cfg80211_vendor_events);
-	}
-
-	if (pCfg->enableDFSMasterCap) {
-		wiphy->flags |= WIPHY_FLAG_DFS_OFFLOAD;
-	}
-
-	wiphy->max_ap_assoc_sta = pCfg->maxNumberOfPeers;
-
-#ifdef QCA_HT_2040_COEX
-	wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE;
-#endif
-
-	hdd_add_channel_switch_support(&wiphy->flags);
-
-	EXIT();
-	return 0;
-}
-
-/*
- * In this function, wiphy structure is updated after CDF
- * initialization. In wlan_hdd_cfg80211_init, only the
- * default values will be initialized. The final initialization
- * of all required members can be done here.
- */
-void wlan_hdd_update_wiphy(struct wiphy *wiphy, struct hdd_config *pCfg)
-{
-	wiphy->max_ap_assoc_sta = pCfg->maxNumberOfPeers;
-}
-
-/* In this function we are registering wiphy. */
-int wlan_hdd_cfg80211_register(struct wiphy *wiphy)
-{
-	ENTER();
-	/* Register our wiphy dev with cfg80211 */
-	if (0 > wiphy_register(wiphy)) {
-		/* print error */
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: wiphy register failed",
-		       __func__);
-		return -EIO;
-	}
-
-	EXIT();
-	return 0;
-}
-
-/*
-   HDD function to update wiphy capability based on target offload status.
-
-   wlan_hdd_cfg80211_init() does initialization of all wiphy related
-   capability even before downloading firmware to the target. In discrete
-   case, host will get know certain offload capability (say sched_scan
-   caps) only after downloading firmware to the target and target boots up.
-   This function is used to override setting done in wlan_hdd_cfg80211_init()
-   based on target capability.
- */
-void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy)
-{
-#ifdef FEATURE_WLAN_SCAN_PNO
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct hdd_config *pCfg = pHddCtx->config;
-
-	/* wlan_hdd_cfg80211_init() sets sched_scan caps already in wiphy before
-	 * control comes here. Here just we need to clear it if firmware doesn't
-	 * have PNO support. */
-	if (!pCfg->PnoOffload) {
-		wiphy->flags &= ~WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
-		wiphy->max_sched_scan_ssids = 0;
-		wiphy->max_match_sets = 0;
-		wiphy->max_sched_scan_ie_len = 0;
-	}
-#endif
-}
-
-/* This function registers for all frame which supplicant is interested in */
-void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter)
-{
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	/* Register for all P2P action, public action etc frames */
-	uint16_t type = (SIR_MAC_MGMT_FRAME << 2) | (SIR_MAC_MGMT_ACTION << 4);
-
-	ENTER();
-
-	/* Register frame indication call back */
-	sme_register_mgmt_frame_ind_callback(hHal, hdd_indicate_mgmt_frame);
-
-	/* Right now we are registering these frame when driver is getting
-	   initialized. Once we will move to 2.6.37 kernel, in which we have
-	   frame register ops, we will move this code as a part of that */
-	/* GAS Initial Request */
-	sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				(uint8_t *) GAS_INITIAL_REQ,
-				GAS_INITIAL_REQ_SIZE);
-
-	/* GAS Initial Response */
-	sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				(uint8_t *) GAS_INITIAL_RSP,
-				GAS_INITIAL_RSP_SIZE);
-
-	/* GAS Comeback Request */
-	sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				(uint8_t *) GAS_COMEBACK_REQ,
-				GAS_COMEBACK_REQ_SIZE);
-
-	/* GAS Comeback Response */
-	sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				(uint8_t *) GAS_COMEBACK_RSP,
-				GAS_COMEBACK_RSP_SIZE);
-
-	/* P2P Public Action */
-	sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				(uint8_t *) P2P_PUBLIC_ACTION_FRAME,
-				P2P_PUBLIC_ACTION_FRAME_SIZE);
-
-	/* P2P Action */
-	sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				(uint8_t *) P2P_ACTION_FRAME,
-				P2P_ACTION_FRAME_SIZE);
-
-	/* WNM BSS Transition Request frame */
-	sme_register_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				(uint8_t *) WNM_BSS_ACTION_FRAME,
-				WNM_BSS_ACTION_FRAME_SIZE);
-
-	/* WNM-Notification */
-	sme_register_mgmt_frame(hHal, pAdapter->sessionId, type,
-				(uint8_t *) WNM_NOTIFICATION_FRAME,
-				WNM_NOTIFICATION_FRAME_SIZE);
-}
-
-void wlan_hdd_cfg80211_deregister_frames(hdd_adapter_t *pAdapter)
-{
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	/* Register for all P2P action, public action etc frames */
-	uint16_t type = (SIR_MAC_MGMT_FRAME << 2) | (SIR_MAC_MGMT_ACTION << 4);
-
-	ENTER();
-
-	/* Right now we are registering these frame when driver is getting
-	   initialized. Once we will move to 2.6.37 kernel, in which we have
-	   frame register ops, we will move this code as a part of that */
-	/* GAS Initial Request */
-
-	sme_deregister_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				  (uint8_t *) GAS_INITIAL_REQ,
-				  GAS_INITIAL_REQ_SIZE);
-
-	/* GAS Initial Response */
-	sme_deregister_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				  (uint8_t *) GAS_INITIAL_RSP,
-				  GAS_INITIAL_RSP_SIZE);
-
-	/* GAS Comeback Request */
-	sme_deregister_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				  (uint8_t *) GAS_COMEBACK_REQ,
-				  GAS_COMEBACK_REQ_SIZE);
-
-	/* GAS Comeback Response */
-	sme_deregister_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				  (uint8_t *) GAS_COMEBACK_RSP,
-				  GAS_COMEBACK_RSP_SIZE);
-
-	/* P2P Public Action */
-	sme_deregister_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				  (uint8_t *) P2P_PUBLIC_ACTION_FRAME,
-				  P2P_PUBLIC_ACTION_FRAME_SIZE);
-
-	/* P2P Action */
-	sme_deregister_mgmt_frame(hHal, SME_SESSION_ID_ANY, type,
-				  (uint8_t *) P2P_ACTION_FRAME,
-				  P2P_ACTION_FRAME_SIZE);
-
-	/* WNM-Notification */
-	sme_deregister_mgmt_frame(hHal, pAdapter->sessionId, type,
-				  (uint8_t *) WNM_NOTIFICATION_FRAME,
-				  WNM_NOTIFICATION_FRAME_SIZE);
-}
-
-#ifdef FEATURE_WLAN_WAPI
-void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
-				    const uint8_t *mac_addr, const uint8_t *key,
-				    int key_Len)
-{
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	tCsrRoamSetKey setKey;
-	bool isConnected = true;
-	int status = 0;
-	uint32_t roamId = 0xFF;
-	uint8_t *pKeyPtr = NULL;
-	int n = 0;
-
-	hddLog(LOG1, "Device_mode %s(%d)",
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-
-	cdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
-	setKey.keyId = key_index;       /* Store Key ID */
-	setKey.encType = eCSR_ENCRYPT_TYPE_WPI; /* SET WAPI Encryption */
-	setKey.keyDirection = eSIR_TX_RX;       /* Key Directionn both TX and RX */
-	setKey.paeRole = 0;     /* the PAE role */
-	if (!mac_addr || is_broadcast_ether_addr(mac_addr)) {
-		cdf_set_macaddr_broadcast(&setKey.peerMac);
-	} else {
-		cdf_mem_copy(setKey.peerMac.bytes, mac_addr, CDF_MAC_ADDR_SIZE);
-	}
-	setKey.keyLength = key_Len;
-	pKeyPtr = setKey.Key;
-	memcpy(pKeyPtr, key, key_Len);
-
-	hddLog(CDF_TRACE_LEVEL_INFO, "%s: WAPI KEY LENGTH:0x%04x",
-	       __func__, key_Len);
-	for (n = 0; n < key_Len; n++)
-		hddLog(CDF_TRACE_LEVEL_INFO, "%s WAPI KEY Data[%d]:%02x ",
-		       __func__, n, setKey.Key[n]);
-
-	pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_SETTING_KEY;
-	if (isConnected) {
-		status = sme_roam_set_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					  pAdapter->sessionId, &setKey, &roamId);
-	}
-	if (status != 0) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "[%4d] sme_roam_set_key returned ERROR status= %d",
-			  __LINE__, status);
-		pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE;
-	}
-}
-#endif /* FEATURE_WLAN_WAPI */
-
-uint8_t *wlan_hdd_cfg80211_get_ie_ptr(const uint8_t *ies_ptr, int length,
-				      uint8_t eid)
-{
-	int left = length;
-	uint8_t *ptr = (uint8_t *)ies_ptr;
-	uint8_t elem_id, elem_len;
-
-	while (left >= 2) {
-		elem_id = ptr[0];
-		elem_len = ptr[1];
-		left -= 2;
-		if (elem_len > left) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("Invalid IEs eid = %d elem_len=%d left=%d"),
-			       eid, elem_len, left);
-			return NULL;
-		}
-		if (elem_id == eid) {
-			return ptr;
-		}
-
-		left -= elem_len;
-		ptr += (elem_len + 2);
-	}
-	return NULL;
-}
-
-/*
- * FUNCTION: wlan_hdd_validate_operation_channel
- * called by wlan_hdd_cfg80211_start_bss() and
- * wlan_hdd_set_channel()
- * This function validates whether given channel is part of valid
- * channel list.
- */
-CDF_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter,
-					       int channel)
-{
-
-	uint32_t num_ch = 0;
-	u8 valid_ch[WNI_CFG_VALID_CHANNEL_LIST_LEN];
-	u32 indx = 0;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	uint8_t fValidChannel = false, count = 0;
-	struct hdd_config *hdd_pConfig_ini = (WLAN_HDD_GET_CTX(pAdapter))->config;
-
-	num_ch = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-
-	if (hdd_pConfig_ini->sapAllowAllChannel) {
-		/* Validate the channel */
-		for (count = RF_CHAN_1; count <= RF_CHAN_165; count++) {
-			if (channel == CDS_CHANNEL_NUM(count)) {
-				fValidChannel = true;
-				break;
-			}
-		}
-		if (fValidChannel != true) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: Invalid Channel [%d]", __func__, channel);
-			return CDF_STATUS_E_FAILURE;
-		}
-	} else {
-		if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
-					 valid_ch, &num_ch)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: failed to get valid channel list",
-			       __func__);
-			return CDF_STATUS_E_FAILURE;
-		}
-		for (indx = 0; indx < num_ch; indx++) {
-			if (channel == valid_ch[indx]) {
-				break;
-			}
-		}
-
-		if (indx >= num_ch) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: Invalid Channel [%d]", __func__, channel);
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-	return CDF_STATUS_SUCCESS;
-
-}
-
-#ifdef DHCP_SERVER_OFFLOAD
-static void wlan_hdd_set_dhcp_server_offload(hdd_adapter_t *pHostapdAdapter)
-{
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	tpSirDhcpSrvOffloadInfo pDhcpSrvInfo;
-	uint8_t numEntries = 0;
-	uint8_t srv_ip[IPADDR_NUM_ENTRIES];
-	uint8_t num;
-	uint32_t temp;
-	pDhcpSrvInfo = cdf_mem_malloc(sizeof(*pDhcpSrvInfo));
-	if (NULL == pDhcpSrvInfo) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: could not allocate tDhcpSrvOffloadInfo!", __func__);
-		return;
-	}
-	cdf_mem_zero(pDhcpSrvInfo, sizeof(*pDhcpSrvInfo));
-	pDhcpSrvInfo->vdev_id = pHostapdAdapter->sessionId;
-	pDhcpSrvInfo->dhcpSrvOffloadEnabled = true;
-	pDhcpSrvInfo->dhcpClientNum = pHddCtx->config->dhcpMaxNumClients;
-	hdd_string_to_u8_array(pHddCtx->config->dhcpServerIP,
-			       srv_ip, &numEntries, IPADDR_NUM_ENTRIES);
-	if (numEntries != IPADDR_NUM_ENTRIES) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: incorrect IP address (%s) assigned for DHCP server!",
-		       __func__, pHddCtx->config->dhcpServerIP);
-		goto end;
-	}
-	if ((srv_ip[0] >= 224) && (srv_ip[0] <= 239)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: invalid IP address (%s)! It could NOT be multicast IP address!",
-		       __func__, pHddCtx->config->dhcpServerIP);
-		goto end;
-	}
-	if (srv_ip[IPADDR_NUM_ENTRIES - 1] >= 100) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: invalid IP address (%s)! The last field must be less than 100!",
-		       __func__, pHddCtx->config->dhcpServerIP);
-		goto end;
-	}
-	for (num = 0; num < numEntries; num++) {
-		temp = srv_ip[num];
-		pDhcpSrvInfo->dhcpSrvIP |= (temp << (8 * num));
-	}
-	if (CDF_STATUS_SUCCESS !=
-	    sme_set_dhcp_srv_offload(pHddCtx->hHal, pDhcpSrvInfo)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: sme_setDHCPSrvOffload fail!", __func__);
-		goto end;
-	}
-	hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-	       "%s: enable DHCP Server offload successfully!", __func__);
-end:
-	cdf_mem_free(pDhcpSrvInfo);
-	return;
-}
-#endif /* DHCP_SERVER_OFFLOAD */
-
-static int __wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
-					  struct net_device *dev,
-					  struct bss_parameters *params)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	int ret = 0;
-	CDF_STATUS cdf_ret_status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_CHANGE_BSS,
-			 pAdapter->sessionId, params->ap_isolate));
-	hddLog(LOG1, FL("Device_mode %s(%d), ap_isolate = %d"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode, params->ap_isolate);
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ret;
-
-	if (!(pAdapter->device_mode == WLAN_HDD_SOFTAP ||
-	      pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
-		return -EOPNOTSUPP;
-	}
-
-	/* ap_isolate == -1 means that in change bss, upper layer doesn't
-	 * want to update this parameter */
-	if (-1 != params->ap_isolate) {
-		pAdapter->sessionCtx.ap.apDisableIntraBssFwd =
-			!!params->ap_isolate;
-
-		cdf_ret_status = sme_ap_disable_intra_bss_fwd(pHddCtx->hHal,
-							      pAdapter->sessionId,
-							      pAdapter->sessionCtx.
-							      ap.
-							      apDisableIntraBssFwd);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_ret_status)) {
-			ret = -EINVAL;
-		}
-	}
-
-	EXIT();
-	return ret;
-}
-
-static int
-wlan_hdd_change_iface_to_adhoc(struct net_device *ndev,
-			       tCsrRoamProfile *pRoamProfile,
-			       enum nl80211_iftype type)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	struct hdd_config *pConfig = pHddCtx->config;
-	struct wireless_dev *wdev = ndev->ieee80211_ptr;
-
-	pRoamProfile->BSSType = eCSR_BSS_TYPE_START_IBSS;
-	pRoamProfile->phyMode =
-		hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode);
-	pAdapter->device_mode = WLAN_HDD_IBSS;
-	wdev->iftype = type;
-
-	return 0;
-}
-
-static int wlan_hdd_change_iface_to_sta_mode(struct net_device *ndev,
-					     enum nl80211_iftype type)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_wext_state_t *wext;
-	struct wireless_dev *wdev;
-	CDF_STATUS status;
-
-	ENTER();
-
-	if (test_bit(ACS_IN_PROGRESS, &pHddCtx->g_event_flags)) {
-		hddLog(LOG1, FL("ACS is in progress, don't change iface!"));
-		return 0;
-	}
-
-	wdev = ndev->ieee80211_ptr;
-	hdd_stop_adapter(pHddCtx, pAdapter, true);
-	hdd_deinit_adapter(pHddCtx, pAdapter, true);
-	wdev->iftype = type;
-	/*Check for sub-string p2p to confirm its a p2p interface */
-	if (NULL != strnstr(ndev->name, "p2p", 3)) {
-		pAdapter->device_mode =
-			(type == NL80211_IFTYPE_STATION) ?
-			WLAN_HDD_P2P_DEVICE : WLAN_HDD_P2P_CLIENT;
-	} else {
-		pAdapter->device_mode =
-			(type == NL80211_IFTYPE_STATION) ?
-			WLAN_HDD_INFRA_STATION : WLAN_HDD_P2P_CLIENT;
-	}
-
-	memset(&pAdapter->sessionCtx, 0, sizeof(pAdapter->sessionCtx));
-	hdd_set_station_ops(pAdapter->dev);
-	status = hdd_init_station_mode(pAdapter);
-	wext = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	wext->roamProfile.pAddIEScan = pAdapter->scan_info.scanAddIE.addIEdata;
-	wext->roamProfile.nAddIEScanLength =
-		pAdapter->scan_info.scanAddIE.length;
-	EXIT();
-	return status;
-}
-
-static int wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
-					struct net_device *dev,
-					struct bss_parameters *params)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_change_bss(wiphy, dev, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/* FUNCTION: wlan_hdd_change_country_code_cd
- *  to wait for contry code completion
- */
-void *wlan_hdd_change_country_code_cb(void *pAdapter)
-{
-	hdd_adapter_t *call_back_pAdapter = pAdapter;
-	complete(&call_back_pAdapter->change_country_code);
-	return NULL;
-}
-
-/**
- * __wlan_hdd_cfg80211_change_iface() - change interface cfg80211 op
- * @wiphy: Pointer to the wiphy structure
- * @ndev: Pointer to the net device
- * @type: Interface type
- * @flags: Flags for change interface
- * @params: Pointer to change interface parameters
- *
- * Return: 0 for success, error number on failure.
- */
-static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
-					    struct net_device *ndev,
-					    enum nl80211_iftype type,
-					    u32 *flags,
-					    struct vif_params *params)
-{
-	struct wireless_dev *wdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *pHddCtx;
-	tCsrRoamProfile *pRoamProfile = NULL;
-	eCsrRoamBssType LastBSSType;
-	struct hdd_config *pConfig = NULL;
-	eMib_dot11DesiredBssType connectedBssType;
-	unsigned long rc;
-	CDF_STATUS vstatus;
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return status;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_CHANGE_IFACE,
-			 pAdapter->sessionId, type));
-
-	hddLog(CDF_TRACE_LEVEL_INFO, FL("Device_mode = %d, IFTYPE = 0x%x"),
-	       pAdapter->device_mode, type);
-
-	if (!cds_allow_concurrency(
-				wlan_hdd_convert_nl_iftype_to_hdd_type(type),
-				0, HW_MODE_20_MHZ)) {
-		hddLog(CDF_TRACE_LEVEL_DEBUG,
-			FL("This concurrency combination is not allowed"));
-		return -EINVAL;
-	}
-
-	pConfig = pHddCtx->config;
-	wdev = ndev->ieee80211_ptr;
-
-	/* Reset the current device mode bit mask */
-	cds_clear_concurrency_mode(pAdapter->device_mode);
-
-	hdd_tdls_notify_mode_change(pAdapter, pHddCtx);
-
-	if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) ||
-	    (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) ||
-	    (pAdapter->device_mode == WLAN_HDD_P2P_DEVICE) ||
-	    (pAdapter->device_mode == WLAN_HDD_IBSS)) {
-		hdd_wext_state_t *pWextState =
-			WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-
-		pRoamProfile = &pWextState->roamProfile;
-		LastBSSType = pRoamProfile->BSSType;
-
-		switch (type) {
-		case NL80211_IFTYPE_STATION:
-		case NL80211_IFTYPE_P2P_CLIENT:
-			vstatus = wlan_hdd_change_iface_to_sta_mode(ndev, type);
-			if (vstatus != CDF_STATUS_SUCCESS)
-				return -EINVAL;
-
-			hdd_register_tx_flow_control(pAdapter,
-					hdd_tx_resume_timer_expired_handler,
-					hdd_tx_resume_cb);
-
-			goto done;
-
-		case NL80211_IFTYPE_ADHOC:
-			wlan_hdd_tdls_exit(pAdapter);
-			hdd_deregister_tx_flow_control(pAdapter);
-			hddLog(LOG1, FL("Setting interface Type to ADHOC"));
-			wlan_hdd_change_iface_to_adhoc(ndev, pRoamProfile,
-						       type);
-			break;
-
-		case NL80211_IFTYPE_AP:
-		case NL80211_IFTYPE_P2P_GO:
-		{
-			hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-			       FL("Setting interface Type to %s"),
-			       (type ==
-				NL80211_IFTYPE_AP) ? "SoftAP" :
-			       "P2pGo");
-
-			/* Cancel any remain on channel for GO mode */
-			if (NL80211_IFTYPE_P2P_GO == type) {
-				wlan_hdd_cancel_existing_remain_on_channel
-					(pAdapter);
-			}
-			hdd_stop_adapter(pHddCtx, pAdapter, true);
-
-			/* De-init the adapter */
-			hdd_deinit_adapter(pHddCtx, pAdapter, true);
-			memset(&pAdapter->sessionCtx, 0,
-			       sizeof(pAdapter->sessionCtx));
-			pAdapter->device_mode =
-				(type ==
-				 NL80211_IFTYPE_AP) ? WLAN_HDD_SOFTAP :
-				WLAN_HDD_P2P_GO;
-
-			/*
-			 * Fw will take care incase of concurrency
-			 */
-
-			if ((WLAN_HDD_SOFTAP == pAdapter->device_mode)
-			    && (pConfig->apRandomBssidEnabled)) {
-				/* To meet Android requirements create a randomized
-				   MAC address of the form 02:1A:11:Fx:xx:xx */
-				get_random_bytes(&ndev->dev_addr[3], 3);
-				ndev->dev_addr[0] = 0x02;
-				ndev->dev_addr[1] = 0x1A;
-				ndev->dev_addr[2] = 0x11;
-				ndev->dev_addr[3] |= 0xF0;
-				memcpy(pAdapter->macAddressCurrent.
-				       bytes, ndev->dev_addr,
-				       CDF_MAC_ADDR_SIZE);
-				pr_info("wlan: Generated HotSpot BSSID "
-					MAC_ADDRESS_STR "\n",
-					MAC_ADDR_ARRAY(ndev->dev_addr));
-			}
-
-			hdd_set_ap_ops(pAdapter->dev);
-
-			vstatus = hdd_init_ap_mode(pAdapter);
-			if (vstatus != CDF_STATUS_SUCCESS) {
-				hddLog(LOGP,
-				       FL
-					       ("Error initializing the ap mode"));
-				return -EINVAL;
-			}
-
-			hdd_register_tx_flow_control(pAdapter,
-				hdd_softap_tx_resume_timer_expired_handler,
-				hdd_softap_tx_resume_cb);
-
-			/* Interface type changed update in wiphy structure */
-			if (wdev) {
-				wdev->iftype = type;
-			} else {
-				hddLog(LOGE,
-				       FL("Wireless dev is NULL"));
-				return -EINVAL;
-			}
-			goto done;
-		}
-
-		default:
-			hddLog(LOGE, FL("Unsupported interface type (%d)"),
-			       type);
-			return -EOPNOTSUPP;
-		}
-	} else if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) ||
-		   (pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
-		switch (type) {
-		case NL80211_IFTYPE_STATION:
-		case NL80211_IFTYPE_P2P_CLIENT:
-		case NL80211_IFTYPE_ADHOC:
-			status = wlan_hdd_change_iface_to_sta_mode(ndev, type);
-			if (status != CDF_STATUS_SUCCESS)
-				return status;
-
-			if ((NL80211_IFTYPE_P2P_CLIENT == type) ||
-			    (NL80211_IFTYPE_STATION == type)) {
-
-				hdd_register_tx_flow_control(pAdapter,
-					hdd_tx_resume_timer_expired_handler,
-					hdd_tx_resume_cb);
-			}
-			goto done;
-
-		case NL80211_IFTYPE_AP:
-		case NL80211_IFTYPE_P2P_GO:
-			wdev->iftype = type;
-			pAdapter->device_mode = (type == NL80211_IFTYPE_AP) ?
-						WLAN_HDD_SOFTAP : WLAN_HDD_P2P_GO;
-
-			hdd_register_tx_flow_control(pAdapter,
-				hdd_softap_tx_resume_timer_expired_handler,
-				hdd_softap_tx_resume_cb);
-			goto done;
-
-		default:
-			hddLog(LOGE, FL("Unsupported interface type(%d)"),
-			       type);
-			return -EOPNOTSUPP;
-		}
-	} else {
-		hddLog(LOGE, FL("Unsupported device mode(%d)"),
-		       pAdapter->device_mode);
-		return -EOPNOTSUPP;
-	}
-
-	if (LastBSSType != pRoamProfile->BSSType) {
-		/* Interface type changed update in wiphy structure */
-		wdev->iftype = type;
-
-		/* The BSS mode changed, We need to issue disconnect
-		   if connected or in IBSS disconnect state */
-		if (hdd_conn_get_connected_bss_type
-			    (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), &connectedBssType)
-		    || (eCSR_BSS_TYPE_START_IBSS == LastBSSType)) {
-			/* Need to issue a disconnect to CSR. */
-			INIT_COMPLETION(pAdapter->disconnect_comp_var);
-			if (CDF_STATUS_SUCCESS ==
-			    sme_roam_disconnect(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						pAdapter->sessionId,
-						eCSR_DISCONNECT_REASON_UNSPECIFIED)) {
-				rc = wait_for_completion_timeout(&pAdapter->
-								 disconnect_comp_var,
-								 msecs_to_jiffies
-									 (WLAN_WAIT_TIME_DISCONNECT));
-				if (!rc) {
-					hddLog(LOGE,
-					       FL
-						       ("Wait on disconnect_comp_var failed"));
-				}
-			}
-		}
-	}
-
-done:
-	/* Set bitmask based on updated value */
-	cds_set_concurrency_mode(pAdapter->device_mode);
-
-#ifdef WLAN_FEATURE_LPSS
-	wlan_hdd_send_all_scan_intf_info(pHddCtx);
-#endif
-
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_change_iface() - change interface cfg80211 op
- * @wiphy: Pointer to the wiphy structure
- * @ndev: Pointer to the net device
- * @type: Interface type
- * @flags: Flags for change interface
- * @params: Pointer to change interface parameters
- *
- * Return: 0 for success, error number on failure.
- */
-static int wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
-					  struct net_device *ndev,
-					  enum nl80211_iftype type,
-					  u32 *flags,
-					  struct vif_params *params)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret =
-		__wlan_hdd_cfg80211_change_iface(wiphy, ndev, type, flags, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#ifdef FEATURE_WLAN_TDLS
-static bool wlan_hdd_is_duplicate_channel(uint8_t *arr,
-					  int index, uint8_t match)
-{
-	int i;
-	for (i = 0; i < index; i++) {
-		if (arr[i] == match)
-			return true;
-	}
-	return false;
-}
-#endif
-
-/**
- * __wlan_hdd_change_station() - change station
- * @wiphy: Pointer to the wiphy structure
- * @dev: Pointer to the net device.
- * @mac: bssid
- * @params: Pointer to station parameters
- *
- * Return: 0 for success, error number on failure.
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-static int __wlan_hdd_change_station(struct wiphy *wiphy,
-				   struct net_device *dev,
-				   const uint8_t *mac,
-				   struct station_parameters *params)
-#else
-static int __wlan_hdd_change_station(struct wiphy *wiphy,
-				   struct net_device *dev,
-				   uint8_t *mac,
-				   struct station_parameters *params)
-#endif
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	hdd_station_ctx_t *pHddStaCtx;
-	struct cdf_mac_addr STAMacAddress;
-#ifdef FEATURE_WLAN_TDLS
-	tCsrStaParams StaParams = { 0 };
-	uint8_t isBufSta = 0;
-	uint8_t isOffChannelSupported = 0;
-#endif
-	int ret;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CHANGE_STATION,
-			 pAdapter->sessionId, params->listen_interval));
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ret;
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	cdf_mem_copy(STAMacAddress.bytes, mac, CDF_MAC_ADDR_SIZE);
-
-	if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) ||
-	    (pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
-		if (params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
-			status =
-				hdd_softap_change_sta_state(pAdapter,
-							    &STAMacAddress,
-							    ol_txrx_peer_state_auth);
-
-			if (status != CDF_STATUS_SUCCESS) {
-				hddLog(CDF_TRACE_LEVEL_INFO,
-				       FL
-					       ("Not able to change TL state to AUTHENTICATED"));
-				return -EINVAL;
-			}
-		}
-	} else if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) ||
-		   (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)) {
-#ifdef FEATURE_WLAN_TDLS
-		if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
-			StaParams.capability = params->capability;
-			StaParams.uapsd_queues = params->uapsd_queues;
-			StaParams.max_sp = params->max_sp;
-
-			/* Convert (first channel , number of channels) tuple to
-			 * the total list of channels. This goes with the assumption
-			 * that if the first channel is < 14, then the next channels
-			 * are an incremental of 1 else an incremental of 4 till the number
-			 * of channels.
-			 */
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				  "%s: params->supported_channels_len: %d",
-				  __func__, params->supported_channels_len);
-			if (0 != params->supported_channels_len) {
-				int i = 0, j = 0, k = 0, no_of_channels = 0;
-				int num_unique_channels;
-				int next;
-				for (i = 0;
-				     i < params->supported_channels_len
-				     && j < SIR_MAC_MAX_SUPP_CHANNELS; i += 2) {
-					int wifi_chan_index;
-					if (!wlan_hdd_is_duplicate_channel
-						    (StaParams.supported_channels, j,
-						    params->supported_channels[i])) {
-						StaParams.
-						supported_channels[j] =
-							params->
-							supported_channels[i];
-					} else {
-						continue;
-					}
-					wifi_chan_index =
-						((StaParams.supported_channels[j] <=
-						  HDD_CHANNEL_14) ? 1 : 4);
-					no_of_channels =
-						params->supported_channels[i + 1];
-
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_INFO,
-						  "%s: i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d, wifi_chan_index: %d, no_of_channels: %d",
-						  __func__, i, j, k, j,
-						  StaParams.
-						  supported_channels[j],
-						  wifi_chan_index,
-						  no_of_channels);
-					for (k = 1; k <= no_of_channels &&
-					     j < SIR_MAC_MAX_SUPP_CHANNELS - 1;
-					     k++) {
-						next =
-								StaParams.
-								supported_channels[j] +
-								wifi_chan_index;
-						if (!wlan_hdd_is_duplicate_channel(StaParams.supported_channels, j + 1, next)) {
-							StaParams.
-							supported_channels[j
-									   +
-									   1]
-								= next;
-						} else {
-							continue;
-						}
-						CDF_TRACE(CDF_MODULE_ID_HDD,
-							  CDF_TRACE_LEVEL_INFO,
-							  "%s: i: %d, j: %d, k: %d, StaParams.supported_channels[%d]: %d",
-							  __func__, i, j, k,
-							  j + 1,
-							  StaParams.
-							  supported_channels[j +
-									     1]);
-						j += 1;
-					}
-				}
-				num_unique_channels = j + 1;
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: Unique Channel List", __func__);
-				for (i = 0; i < num_unique_channels; i++) {
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_INFO,
-						  "%s: StaParams.supported_channels[%d]: %d,",
-						  __func__, i,
-						  StaParams.
-						  supported_channels[i]);
-				}
-				if (MAX_CHANNEL < num_unique_channels)
-					num_unique_channels = MAX_CHANNEL;
-				StaParams.supported_channels_len =
-					num_unique_channels;
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: After removing duplcates StaParams.supported_channels_len: %d",
-					  __func__,
-					  StaParams.supported_channels_len);
-			}
-			cdf_mem_copy(StaParams.supported_oper_classes,
-				     params->supported_oper_classes,
-				     params->supported_oper_classes_len);
-			StaParams.supported_oper_classes_len =
-				params->supported_oper_classes_len;
-
-			if (0 != params->ext_capab_len)
-				cdf_mem_copy(StaParams.extn_capability,
-					     params->ext_capab,
-					     sizeof(StaParams.extn_capability));
-
-			if (NULL != params->ht_capa) {
-				StaParams.htcap_present = 1;
-				cdf_mem_copy(&StaParams.HTCap, params->ht_capa,
-					     sizeof(tSirHTCap));
-			}
-
-			StaParams.supported_rates_len =
-				params->supported_rates_len;
-
-			/* Note : The Maximum sizeof supported_rates sent by the Supplicant is 32.
-			 * The supported_rates array , for all the structures propogating till Add Sta
-			 * to the firmware has to be modified , if the supplicant (ieee80211) is
-			 * modified to send more rates.
-			 */
-
-			/* To avoid Data Currption , set to max length to SIR_MAC_MAX_SUPP_RATES
-			 */
-			if (StaParams.supported_rates_len >
-			    SIR_MAC_MAX_SUPP_RATES)
-				StaParams.supported_rates_len =
-					SIR_MAC_MAX_SUPP_RATES;
-
-			if (0 != StaParams.supported_rates_len) {
-				int i = 0;
-				cdf_mem_copy(StaParams.supported_rates,
-					     params->supported_rates,
-					     StaParams.supported_rates_len);
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_INFO,
-					  "Supported Rates with Length %d",
-					  StaParams.supported_rates_len);
-				for (i = 0; i < StaParams.supported_rates_len;
-				     i++)
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_INFO,
-						  "[%d]: %0x", i,
-						  StaParams.supported_rates[i]);
-			}
-
-			if (NULL != params->vht_capa) {
-				StaParams.vhtcap_present = 1;
-				cdf_mem_copy(&StaParams.VHTCap,
-					     params->vht_capa,
-					     sizeof(tSirVHTCap));
-			}
-
-			if (0 != params->ext_capab_len) {
-				/*Define A Macro : TODO Sunil */
-				if ((1 << 4) & StaParams.extn_capability[3]) {
-					isBufSta = 1;
-				}
-				/* TDLS Channel Switching Support */
-				if ((1 << 6) & StaParams.extn_capability[3]) {
-					isOffChannelSupported = 1;
-				}
-			}
-
-			status = wlan_hdd_tdls_set_peer_caps(pAdapter, mac,
-							     &StaParams,
-							     isBufSta,
-							     isOffChannelSupported);
-			if (CDF_STATUS_SUCCESS != status) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL
-					       ("wlan_hdd_tdls_set_peer_caps failed!"));
-				return -EINVAL;
-			}
-
-			status =
-				wlan_hdd_tdls_add_station(wiphy, dev, mac, 1,
-							  &StaParams);
-			if (CDF_STATUS_SUCCESS != status) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("wlan_hdd_tdls_add_station failed!"));
-				return -EINVAL;
-			}
-		}
-#endif
-	}
-	EXIT();
-	return ret;
-}
-
-/**
- * wlan_hdd_change_station() - cfg80211 change station handler function
- * @wiphy: Pointer to the wiphy structure
- * @dev: Pointer to the net device.
- * @mac: bssid
- * @params: Pointer to station parameters
- *
- * This is the cfg80211 change station handler function which invokes
- * the internal function @__wlan_hdd_change_station with
- * SSR protection.
- *
- * Return: 0 for success, error number on failure.
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) || defined(WITH_BACKPORTS)
-static int wlan_hdd_change_station(struct wiphy *wiphy,
-				   struct net_device *dev,
-				   const u8 *mac,
-				   struct station_parameters *params)
-#else
-static int wlan_hdd_change_station(struct wiphy *wiphy,
-				   struct net_device *dev,
-				   u8 *mac,
-				   struct station_parameters *params)
-#endif
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_change_station(wiphy, dev, mac, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/*
- * FUNCTION: __wlan_hdd_cfg80211_add_key
- * This function is used to initialize the key information
- */
-static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
-				       struct net_device *ndev,
-				       u8 key_index, bool pairwise,
-				       const u8 *mac_addr,
-				       struct key_params *params)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	tCsrRoamSetKey setKey;
-	int status;
-	uint32_t roamId = 0xFF;
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t p_cds_context = (WLAN_HDD_GET_CTX(pAdapter))->pcds_context;
-#endif
-	hdd_hostapd_state_t *pHostapdState;
-	CDF_STATUS cdf_ret_status;
-	hdd_context_t *pHddCtx;
-	hdd_ap_ctx_t *ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_ADD_KEY,
-			 pAdapter->sessionId, params->key_len));
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-
-	if (CSR_MAX_NUM_KEY <= key_index) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: Invalid key index %d",
-		       __func__, key_index);
-
-		return -EINVAL;
-	}
-
-	if (CSR_MAX_KEY_LEN < params->key_len) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: Invalid key length %d",
-		       __func__, params->key_len);
-
-		return -EINVAL;
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "%s: called with key index = %d & key length %d",
-	       __func__, key_index, params->key_len);
-
-	/*extract key idx, key len and key */
-	cdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
-	setKey.keyId = key_index;
-	setKey.keyLength = params->key_len;
-	cdf_mem_copy(&setKey.Key[0], params->key, params->key_len);
-
-	switch (params->cipher) {
-	case WLAN_CIPHER_SUITE_WEP40:
-		setKey.encType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
-		break;
-
-	case WLAN_CIPHER_SUITE_WEP104:
-		setKey.encType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY;
-		break;
-
-	case WLAN_CIPHER_SUITE_TKIP:
-	{
-		u8 *pKey = &setKey.Key[0];
-		setKey.encType = eCSR_ENCRYPT_TYPE_TKIP;
-
-		cdf_mem_zero(pKey, CSR_MAX_KEY_LEN);
-
-		/*Supplicant sends the 32bytes key in this order
-
-		   |--------------|----------|----------|
-		 |   Tk1        |TX-MIC    |  RX Mic  |
-		 |||--------------|----------|----------|
-		   <---16bytes---><--8bytes--><--8bytes-->
-
-		 */
-		/*Sme expects the 32 bytes key to be in the below order
-
-		   |--------------|----------|----------|
-		 |   Tk1        |RX-MIC    |  TX Mic  |
-		 |||--------------|----------|----------|
-		   <---16bytes---><--8bytes--><--8bytes-->
-		 */
-		/* Copy the Temporal Key 1 (TK1) */
-		cdf_mem_copy(pKey, params->key, 16);
-
-		/*Copy the rx mic first */
-		cdf_mem_copy(&pKey[16], &params->key[24], 8);
-
-		/*Copy the tx mic */
-		cdf_mem_copy(&pKey[24], &params->key[16], 8);
-
-		break;
-	}
-
-	case WLAN_CIPHER_SUITE_CCMP:
-		setKey.encType = eCSR_ENCRYPT_TYPE_AES;
-		break;
-
-#ifdef FEATURE_WLAN_WAPI
-	case WLAN_CIPHER_SUITE_SMS4:
-	{
-		cdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
-		wlan_hdd_cfg80211_set_key_wapi(pAdapter, key_index,
-					       mac_addr, params->key,
-					       params->key_len);
-		return 0;
-	}
-#endif
-
-#ifdef FEATURE_WLAN_ESE
-	case WLAN_CIPHER_SUITE_KRK:
-		setKey.encType = eCSR_ENCRYPT_TYPE_KRK;
-		break;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	case WLAN_CIPHER_SUITE_BTK:
-		setKey.encType = eCSR_ENCRYPT_TYPE_BTK;
-		break;
-#endif
-#endif
-
-#ifdef WLAN_FEATURE_11W
-	case WLAN_CIPHER_SUITE_AES_CMAC:
-		setKey.encType = eCSR_ENCRYPT_TYPE_AES_CMAC;
-		break;
-#endif
-
-	default:
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: unsupported cipher type %u",
-		       __func__, params->cipher);
-		return -EOPNOTSUPP;
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO_MED, "%s: encryption type %d",
-	       __func__, setKey.encType);
-
-	if (!pairwise) {
-		/* set group key */
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-			  "%s- %d: setting Broadcast key", __func__, __LINE__);
-		setKey.keyDirection = eSIR_RX_ONLY;
-		cdf_set_macaddr_broadcast(&setKey.peerMac);
-	} else {
-		/* set pairwise key */
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-			  "%s- %d: setting pairwise key", __func__, __LINE__);
-		setKey.keyDirection = eSIR_TX_RX;
-		cdf_mem_copy(setKey.peerMac.bytes, mac_addr, CDF_MAC_ADDR_SIZE);
-	}
-	if ((WLAN_HDD_IBSS == pAdapter->device_mode) && !pairwise) {
-		/* if a key is already installed, block all subsequent ones */
-		if (pAdapter->sessionCtx.station.ibss_enc_key_installed) {
-			hddLog(CDF_TRACE_LEVEL_INFO_MED,
-			       "%s: IBSS key installed already", __func__);
-			return 0;
-		}
-
-		setKey.keyDirection = eSIR_TX_RX;
-		/*Set the group key */
-		status = sme_roam_set_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					  pAdapter->sessionId, &setKey, &roamId);
-
-		if (0 != status) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: sme_roam_set_key failed, returned %d",
-			       __func__, status);
-			return -EINVAL;
-		}
-		/*Save the keys here and call sme_roam_set_key for setting
-		   the PTK after peer joins the IBSS network */
-		cdf_mem_copy(&pAdapter->sessionCtx.station.ibss_enc_key,
-			     &setKey, sizeof(tCsrRoamSetKey));
-
-		pAdapter->sessionCtx.station.ibss_enc_key_installed = 1;
-		return status;
-	}
-	if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) ||
-	    (pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
-		pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-		if (pHostapdState->bssState == BSS_START) {
-#ifdef WLAN_FEATURE_MBSSID
-			status =
-				wlansap_set_key_sta(WLAN_HDD_GET_SAP_CTX_PTR
-							    (pAdapter), &setKey);
-#else
-			status = wlansap_set_key_sta(p_cds_context, &setKey);
-#endif
-			if (status != CDF_STATUS_SUCCESS) {
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_ERROR,
-					  "[%4d] wlansap_set_key_sta returned ERROR status= %d",
-					  __LINE__, status);
-			}
-		}
-
-		/* Save the key in ap ctx for use on START_BASS and restart */
-		if (pairwise ||
-			eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == setKey.encType ||
-			eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == setKey.encType)
-			cdf_mem_copy(&ap_ctx->wepKey[key_index], &setKey,
-				     sizeof(tCsrRoamSetKey));
-		else
-			cdf_mem_copy(&ap_ctx->groupKey, &setKey,
-				     sizeof(tCsrRoamSetKey));
-
-	} else if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) ||
-		   (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)) {
-		hdd_wext_state_t *pWextState =
-			WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-		hdd_station_ctx_t *pHddStaCtx =
-			WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-		if (!pairwise) {
-			/* set group key */
-			if (pHddStaCtx->roam_info.deferKeyComplete) {
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s- %d: Perform Set key Complete",
-					  __func__, __LINE__);
-				hdd_perform_roam_set_key_complete(pAdapter);
-			}
-		}
-
-		pWextState->roamProfile.Keys.KeyLength[key_index] =
-			(u8) params->key_len;
-
-		pWextState->roamProfile.Keys.defaultIndex = key_index;
-
-		cdf_mem_copy(&pWextState->roamProfile.Keys.
-			     KeyMaterial[key_index][0], params->key,
-			     params->key_len);
-
-		pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_SETTING_KEY;
-
-		hddLog(LOG2,
-		       FL("Set key for peerMac "MAC_ADDRESS_STR" direction %d"),
-		       MAC_ADDR_ARRAY(setKey.peerMac.bytes),
-		       setKey.keyDirection);
-
-#ifdef WLAN_FEATURE_VOWIFI_11R
-		/* The supplicant may attempt to set the PTK once pre-authentication
-		   is done. Save the key in the UMAC and include it in the ADD BSS
-		   request */
-		cdf_ret_status = sme_ft_update_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						   pAdapter->sessionId, &setKey);
-		if (cdf_ret_status == CDF_STATUS_FT_PREAUTH_KEY_SUCCESS) {
-			hddLog(CDF_TRACE_LEVEL_INFO_MED,
-			       "%s: Update PreAuth Key success", __func__);
-			return 0;
-		} else if (cdf_ret_status == CDF_STATUS_FT_PREAUTH_KEY_FAILED) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: Update PreAuth Key failed", __func__);
-			return -EINVAL;
-		}
-#endif /* WLAN_FEATURE_VOWIFI_11R */
-
-		/* issue set key request to SME */
-		status = sme_roam_set_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					  pAdapter->sessionId, &setKey, &roamId);
-
-		if (0 != status) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: sme_roam_set_key failed, returned %d",
-			       __func__, status);
-			pHddStaCtx->roam_info.roamingState =
-				HDD_ROAM_STATE_NONE;
-			return -EINVAL;
-		}
-
-		/* in case of IBSS as there was no information available about WEP keys during
-		 * IBSS join, group key intialized with NULL key, so re-initialize group key
-		 * with correct value*/
-		if ((eCSR_BSS_TYPE_START_IBSS ==
-		     pWextState->roamProfile.BSSType)
-		    &&
-		    !((IW_AUTH_KEY_MGMT_802_1X ==
-		       (pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X))
-		      && (eCSR_AUTH_TYPE_OPEN_SYSTEM ==
-			  pHddStaCtx->conn_info.authType)
-		      )
-		    && ((WLAN_CIPHER_SUITE_WEP40 == params->cipher)
-			|| (WLAN_CIPHER_SUITE_WEP104 == params->cipher)
-			)
-		    ) {
-			setKey.keyDirection = eSIR_RX_ONLY;
-			cdf_set_macaddr_broadcast(&setKey.peerMac);
-
-			hddLog(LOG2,
-			       FL("Set key peerMac "MAC_ADDRESS_STR" direction %d"),
-			       MAC_ADDR_ARRAY(setKey.peerMac.bytes),
-			       setKey.keyDirection);
-
-			status = sme_roam_set_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						  pAdapter->sessionId, &setKey,
-						  &roamId);
-
-			if (0 != status) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       "%s: sme_roam_set_key failed for group key (IBSS), returned %d",
-				       __func__, status);
-				pHddStaCtx->roam_info.roamingState =
-					HDD_ROAM_STATE_NONE;
-				return -EINVAL;
-			}
-		}
-	}
-	EXIT();
-	return 0;
-}
-
-static int wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
-				     struct net_device *ndev,
-				     u8 key_index, bool pairwise,
-				     const u8 *mac_addr,
-				     struct key_params *params)
-{
-	int ret;
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_add_key(wiphy, ndev, key_index, pairwise,
-					  mac_addr, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/*
- * FUNCTION: __wlan_hdd_cfg80211_get_key
- * This function is used to get the key information
- */
-static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
-				       struct net_device *ndev,
-				       u8 key_index, bool pairwise,
-				       const u8 *mac_addr, void *cookie,
-				       void (*callback)(void *cookie,
-							struct key_params *)
-				       )
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	tCsrRoamProfile *pRoamProfile = &(pWextState->roamProfile);
-	struct key_params params;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-
-	memset(&params, 0, sizeof(params));
-
-	if (CSR_MAX_NUM_KEY <= key_index) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("invalid key index %d"),
-		       key_index);
-		return -EINVAL;
-	}
-
-	switch (pRoamProfile->EncryptionType.encryptionType[0]) {
-	case eCSR_ENCRYPT_TYPE_NONE:
-		params.cipher = IW_AUTH_CIPHER_NONE;
-		break;
-
-	case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY:
-	case eCSR_ENCRYPT_TYPE_WEP40:
-		params.cipher = WLAN_CIPHER_SUITE_WEP40;
-		break;
-
-	case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
-	case eCSR_ENCRYPT_TYPE_WEP104:
-		params.cipher = WLAN_CIPHER_SUITE_WEP104;
-		break;
-
-	case eCSR_ENCRYPT_TYPE_TKIP:
-		params.cipher = WLAN_CIPHER_SUITE_TKIP;
-		break;
-
-	case eCSR_ENCRYPT_TYPE_AES:
-		params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
-		break;
-
-	default:
-		params.cipher = IW_AUTH_CIPHER_NONE;
-		break;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_GET_KEY,
-			 pAdapter->sessionId, params.cipher));
-
-	params.key_len = pRoamProfile->Keys.KeyLength[key_index];
-	params.seq_len = 0;
-	params.seq = NULL;
-	params.key = &pRoamProfile->Keys.KeyMaterial[key_index][0];
-	callback(cookie, &params);
-
-	EXIT();
-	return 0;
-}
-
-static int wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
-				     struct net_device *ndev,
-				     u8 key_index, bool pairwise,
-				     const u8 *mac_addr, void *cookie,
-				     void (*callback)(void *cookie,
-						      struct key_params *)
-				     )
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_key(wiphy, ndev, key_index, pairwise,
-					  mac_addr, cookie, callback);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_del_key() - Delete the encryption key for station
- * @wiphy: wiphy interface context
- * @ndev: pointer to net device
- * @key_index: Key index used in 802.11 frames
- * @unicast: true if it is unicast key
- * @multicast: true if it is multicast key
- *
- * This function is required for cfg80211_ops API.
- * It is used to delete the key information
- * Underlying hardware implementation does not have API to delete the
- * encryption key. It is automatically deleted when the peer is
- * removed. Hence this function currently does nothing.
- * Future implementation may interprete delete key operation to
- * replacing the key with a random junk value, effectively making it
- * useless.
- *
- * Return: status code, always 0.
- */
-
-static int __wlan_hdd_cfg80211_del_key(struct wiphy *wiphy,
-				     struct net_device *ndev,
-				     u8 key_index,
-				     bool pairwise, const u8 *mac_addr)
-{
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_del_key() - cfg80211 delete key handler function
- * @wiphy: Pointer to wiphy structure.
- * @dev: Pointer to net_device structure.
- * @key_index: key index
- * @pairwise: pairwise
- * @mac_addr: mac address
- *
- * This is the cfg80211 delete key handler function which invokes
- * the internal function @__wlan_hdd_cfg80211_del_key with
- * SSR protection.
- *
- * Return: 0 for success, error number on failure.
- */
-static int wlan_hdd_cfg80211_del_key(struct wiphy *wiphy,
-					struct net_device *dev,
-					u8 key_index,
-					bool pairwise, const u8 *mac_addr)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_del_key(wiphy, dev, key_index,
-					  pairwise, mac_addr);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/*
- * FUNCTION: __wlan_hdd_cfg80211_set_default_key
- * This function is used to set the default tx key index
- */
-static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
-					       struct net_device *ndev,
-					       u8 key_index,
-					       bool unicast, bool multicast)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	hdd_context_t *pHddCtx;
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_DEFAULT_KEY,
-			 pAdapter->sessionId, key_index));
-
-	hddLog(LOG1, FL("Device_mode %s(%d) key_index = %d"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode, key_index);
-
-	if (CSR_MAX_NUM_KEY <= key_index) {
-		hddLog(LOGE, FL("Invalid key index %d"), key_index);
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) ||
-	    (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)) {
-		if ((eCSR_ENCRYPT_TYPE_TKIP !=
-		     pHddStaCtx->conn_info.ucEncryptionType) &&
-		    (eCSR_ENCRYPT_TYPE_AES !=
-		     pHddStaCtx->conn_info.ucEncryptionType)) {
-			/* If default key index is not same as previous one,
-			 * then update the default key index */
-
-			tCsrRoamSetKey setKey;
-			uint32_t roamId = 0xFF;
-			tCsrKeys *Keys = &pWextState->roamProfile.Keys;
-
-			hddLog(LOG2, FL("Default tx key index %d"), key_index);
-
-			Keys->defaultIndex = (u8) key_index;
-			cdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
-			setKey.keyId = key_index;
-			setKey.keyLength = Keys->KeyLength[key_index];
-
-			cdf_mem_copy(&setKey.Key[0],
-				     &Keys->KeyMaterial[key_index][0],
-				     Keys->KeyLength[key_index]);
-
-			setKey.keyDirection = eSIR_TX_RX;
-
-			cdf_copy_macaddr(&setKey.peerMac,
-					 &pHddStaCtx->conn_info.bssId);
-
-			if (Keys->KeyLength[key_index] == CSR_WEP40_KEY_LEN &&
-			    pWextState->roamProfile.EncryptionType.
-			    encryptionType[0] == eCSR_ENCRYPT_TYPE_WEP104) {
-				/* In the case of dynamic wep supplicant hardcodes DWEP type
-				* to eCSR_ENCRYPT_TYPE_WEP104 even though ap is configured for
-				* WEP-40 encryption. In this canse the key length is 5 but the
-				* encryption type is 104 hence checking the key langht(5) and
-				* encryption type(104) and switching encryption type to 40*/
-				pWextState->roamProfile.EncryptionType.
-				encryptionType[0] = eCSR_ENCRYPT_TYPE_WEP40;
-				pWextState->roamProfile.mcEncryptionType.
-				encryptionType[0] = eCSR_ENCRYPT_TYPE_WEP40;
-			}
-
-			setKey.encType =
-				pWextState->roamProfile.EncryptionType.
-				encryptionType[0];
-
-			/* Issue set key request */
-			status = sme_roam_set_key(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						  pAdapter->sessionId, &setKey,
-						  &roamId);
-
-			if (0 != status) {
-				hddLog(LOGE,
-				       FL("sme_roam_set_key failed, returned %d"),
-				       status);
-				return -EINVAL;
-			}
-		}
-	} else if (WLAN_HDD_SOFTAP == pAdapter->device_mode) {
-		/* In SoftAp mode setting key direction for default mode */
-		if ((eCSR_ENCRYPT_TYPE_TKIP !=
-		     pWextState->roamProfile.EncryptionType.encryptionType[0])
-		    && (eCSR_ENCRYPT_TYPE_AES !=
-			pWextState->roamProfile.EncryptionType.
-			encryptionType[0])) {
-			/* Saving key direction for default key index to TX default */
-			hdd_ap_ctx_t *pAPCtx =
-				WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
-			pAPCtx->wepKey[key_index].keyDirection =
-				eSIR_TX_DEFAULT;
-		}
-	}
-
-	EXIT();
-	return status;
-}
-
-static int wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
-					     struct net_device *ndev,
-					     u8 key_index,
-					     bool unicast, bool multicast)
-{
-	int ret;
-	cds_ssr_protect(__func__);
-	ret =
-		__wlan_hdd_cfg80211_set_default_key(wiphy, ndev, key_index, unicast,
-						    multicast);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_update_bss_list() - update bss list to NL80211
- * @pAdapter: Pointer to adapter
- * @pRoamInfo: Pointer to roam info
- *
- * Return: struct cfg80211_bss pointer
- */
-struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(hdd_adapter_t *pAdapter,
-						       tCsrRoamInfo *pRoamInfo)
-{
-	struct net_device *dev = pAdapter->dev;
-	struct wireless_dev *wdev = dev->ieee80211_ptr;
-	struct wiphy *wiphy = wdev->wiphy;
-	tSirBssDescription *pBssDesc = pRoamInfo->pBssDesc;
-	int chan_no;
-	unsigned int freq;
-	struct ieee80211_channel *chan;
-	struct cfg80211_bss *bss = NULL;
-
-	ENTER();
-
-	if (NULL == pBssDesc) {
-		hddLog(LOGE, FL("pBssDesc is NULL"));
-		return bss;
-	}
-
-	if (NULL == pRoamInfo->pProfile) {
-		hddLog(LOGE, FL("Roam profile is NULL"));
-		return bss;
-	}
-
-	chan_no = pBssDesc->channelId;
-
-	if (chan_no <= ARRAY_SIZE(hdd_channels_2_4_ghz)) {
-		freq =
-			ieee80211_channel_to_frequency(chan_no,
-						       IEEE80211_BAND_2GHZ);
-	} else {
-		freq =
-			ieee80211_channel_to_frequency(chan_no,
-						       IEEE80211_BAND_5GHZ);
-	}
-
-	chan = __ieee80211_get_channel(wiphy, freq);
-
-	if (!chan) {
-		hddLog(LOGE, FL("chan pointer is NULL"));
-		return NULL;
-	}
-
-	bss = cfg80211_get_bss(wiphy, chan, pBssDesc->bssId,
-			       &pRoamInfo->pProfile->SSIDs.SSIDList->SSID.
-			       ssId[0],
-			       pRoamInfo->pProfile->SSIDs.SSIDList->SSID.length,
-			       WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
-	if (bss == NULL) {
-		hddLog(LOGE, FL("BSS not present"));
-	} else {
-		hddLog(LOG1, FL("cfg80211_unlink_bss called for BSSID "
-				MAC_ADDRESS_STR),
-		       MAC_ADDR_ARRAY(pBssDesc->bssId));
-		cfg80211_unlink_bss(wiphy, bss);
-	}
-	return bss;
-}
-
-/**
- * wlan_hdd_cfg80211_inform_bss_frame() - inform bss details to NL80211
- * @pAdapter: Pointer to adapter
- * @bss_desc: Pointer to bss descriptor
- *
- * This function is used to inform the BSS details to nl80211 interface.
- *
- * Return: struct cfg80211_bss pointer
- */
-static struct cfg80211_bss *
-wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
-				   tSirBssDescription *bss_desc)
-{
-	/*
-	 * cfg80211_inform_bss() is not updating ie field of bss entry, if entry
-	 * already exists in bss data base of cfg80211 for that particular BSS
-	 * ID. Using cfg80211_inform_bss_frame to update the bss entry instead
-	 * of cfg80211_inform_bss, But this call expects mgmt packet as input.
-	 * As of now there is no possibility to get the mgmt(probe response)
-	 * frame from PE, converting bss_desc to ieee80211_mgmt(probe response)
-	 * and passing to cfg80211_inform_bss_frame.
-	 */
-	struct net_device *dev = pAdapter->dev;
-	struct wireless_dev *wdev = dev->ieee80211_ptr;
-	struct wiphy *wiphy = wdev->wiphy;
-	int chan_no = bss_desc->channelId;
-#ifdef WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS
-	qcom_ie_age *qie_age = NULL;
-	int ie_length =
-		GET_IE_LEN_IN_BSS_DESC(bss_desc->length) + sizeof(qcom_ie_age);
-#else
-	int ie_length = GET_IE_LEN_IN_BSS_DESC(bss_desc->length);
-#endif
-	const char *ie =
-		((ie_length != 0) ? (const char *)&bss_desc->ieFields : NULL);
-	unsigned int freq;
-	struct ieee80211_channel *chan;
-	struct ieee80211_mgmt *mgmt = NULL;
-	struct cfg80211_bss *bss_status = NULL;
-	size_t frame_len = sizeof(struct ieee80211_mgmt) + ie_length;
-	int rssi = 0;
-	hdd_context_t *pHddCtx;
-	int status;
-#ifdef CONFIG_CNSS
-	struct timespec ts;
-#endif
-	struct hdd_config *cfg_param;
-
-	ENTER();
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return NULL;
-
-	cfg_param = pHddCtx->config;
-	mgmt = kzalloc((sizeof(struct ieee80211_mgmt) + ie_length), GFP_KERNEL);
-	if (!mgmt) {
-		hddLog(LOGE, FL("memory allocation failed"));
-		return NULL;
-	}
-
-	memcpy(mgmt->bssid, bss_desc->bssId, ETH_ALEN);
-
-#ifdef CONFIG_CNSS
-	/* Android does not want the timestamp from the frame.
-	   Instead it wants a monotonic increasing value */
-	cnss_get_monotonic_boottime(&ts);
-	mgmt->u.probe_resp.timestamp =
-		((u64) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
-#else
-	/* keep old behavior for non-open source (for now) */
-	memcpy(&mgmt->u.probe_resp.timestamp, bss_desc->timeStamp,
-	       sizeof(bss_desc->timeStamp));
-
-#endif
-
-	mgmt->u.probe_resp.beacon_int = bss_desc->beaconInterval;
-	mgmt->u.probe_resp.capab_info = bss_desc->capabilityInfo;
-
-#ifdef WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS
-	/* GPS Requirement: need age ie per entry. Using vendor specific. */
-	/* Assuming this is the last IE, copy at the end */
-	ie_length -= sizeof(qcom_ie_age);
-	qie_age = (qcom_ie_age *) (mgmt->u.probe_resp.variable + ie_length);
-	qie_age->element_id = QCOM_VENDOR_IE_ID;
-	qie_age->len = QCOM_VENDOR_IE_AGE_LEN;
-	qie_age->oui_1 = QCOM_OUI1;
-	qie_age->oui_2 = QCOM_OUI2;
-	qie_age->oui_3 = QCOM_OUI3;
-	qie_age->type = QCOM_VENDOR_IE_AGE_TYPE;
-	qie_age->age =
-		cdf_mc_timer_get_system_ticks() - bss_desc->nReceivedTime;
-	qie_age->tsf_delta = bss_desc->tsf_delta;
-#endif
-
-	memcpy(mgmt->u.probe_resp.variable, ie, ie_length);
-	if (bss_desc->fProbeRsp) {
-		mgmt->frame_control |=
-			(u16) (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP);
-	} else {
-		mgmt->frame_control |=
-			(u16) (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON);
-	}
-
-	if (chan_no <= ARRAY_SIZE(hdd_channels_2_4_ghz) &&
-	    (wiphy->bands[IEEE80211_BAND_2GHZ] != NULL)) {
-		freq =
-			ieee80211_channel_to_frequency(chan_no,
-						       IEEE80211_BAND_2GHZ);
-	} else if ((chan_no > ARRAY_SIZE(hdd_channels_2_4_ghz))
-		   && (wiphy->bands[IEEE80211_BAND_5GHZ] != NULL)) {
-		freq =
-			ieee80211_channel_to_frequency(chan_no,
-						       IEEE80211_BAND_5GHZ);
-	} else {
-		hddLog(LOGE, FL("Invalid chan_no %d"), chan_no);
-		kfree(mgmt);
-		return NULL;
-	}
-
-	chan = __ieee80211_get_channel(wiphy, freq);
-	/* When the band is changed on the fly using the GUI, three things are done
-	 * 1. scan abort
-	 * 2. flush scan results from cache
-	 * 3. update the band with the new band user specified (refer to the
-	 * hdd_set_band_helper function) as part of the scan abort, message will be
-	 * queued to PE and we proceed with flushing and changinh the band.
-	 * PE will stop the scanning further and report back the results what ever
-	 * it had till now by calling the call back function.
-	 * if the time between update band and scandone call back is sufficient
-	 * enough the band change reflects in SME, SME validates the channels
-	 * and discards the channels correponding to previous band and calls back
-	 * with zero bss results. but if the time between band update and scan done
-	 * callback is very small then band change will not reflect in SME and SME
-	 * reports to HDD all the channels correponding to previous band.this is due
-	 * to race condition.but those channels are invalid to the new band and so
-	 * this function __ieee80211_get_channel will return NULL.Each time we
-	 * report scan result with this pointer null warning kernel trace is printed.
-	 * if the scan results contain large number of APs continuosly kernel
-	 * warning trace is printed and it will lead to apps watch dog bark.
-	 * So drop the bss and continue to next bss.
-	 */
-	if (chan == NULL) {
-		hddLog(LOGE, FL("chan pointer is NULL"));
-		kfree(mgmt);
-		return NULL;
-	}
-
-	/* Based on .ini configuration, raw rssi can be reported for bss.
-	 * Raw rssi is typically used for estimating power.
-	 */
-
-	rssi = (cfg_param->inform_bss_rssi_raw) ? bss_desc->rssi_raw :
-			bss_desc->rssi;
-
-	/* Supplicant takes the signal strength in terms of mBm(100*dBm) */
-	rssi = CDF_MIN(rssi, 0) * 100;
-
-	hddLog(LOG1, FL("BSSID: " MAC_ADDRESS_STR " Channel:%d RSSI:%d"),
-	       MAC_ADDR_ARRAY(mgmt->bssid), chan->center_freq,
-	       (int)(rssi / 100));
-
-	bss_status =
-		cfg80211_inform_bss_frame(wiphy, chan, mgmt, frame_len, rssi,
-					  GFP_KERNEL);
-	kfree(mgmt);
-	EXIT();
-	return bss_status;
-}
-
-/**
- * wlan_hdd_cfg80211_update_bss_db() - update bss database of CF80211
- * @pAdapter: Pointer to adapter
- * @pRoamInfo: Pointer to roam info
- *
- * This function is used to update the BSS data base of CFG8011
- *
- * Return: struct cfg80211_bss pointer
- */
-struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_db(hdd_adapter_t *pAdapter,
-						     tCsrRoamInfo *pRoamInfo)
-{
-	tCsrRoamConnectedProfile roamProfile;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	struct cfg80211_bss *bss = NULL;
-
-	ENTER();
-
-	memset(&roamProfile, 0, sizeof(tCsrRoamConnectedProfile));
-	sme_roam_get_connect_profile(hHal, pAdapter->sessionId, &roamProfile);
-
-	if (NULL != roamProfile.pBssDesc) {
-		bss = wlan_hdd_cfg80211_inform_bss_frame(pAdapter,
-							 roamProfile.pBssDesc);
-
-		if (NULL == bss)
-			hddLog(LOG1,
-				FL("wlan_hdd_cfg80211_inform_bss_frame returned NULL"));
-
-		sme_roam_free_connect_profile(&roamProfile);
-	} else {
-		hddLog(LOGE, FL("roamProfile.pBssDesc is NULL"));
-	}
-	EXIT();
-	return bss;
-}
-/**
- * wlan_hdd_cfg80211_update_bss() - update bss
- * @wiphy: Pointer to wiphy
- * @pAdapter: Pointer to adapter
- * @scan_time: scan request timestamp
- *
- * Return: zero if success, non-zero otherwise
- */
-int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy,
-				 hdd_adapter_t *pAdapter,
-				 uint32_t scan_time)
-{
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	tCsrScanResultInfo *pScanResult;
-	CDF_STATUS status = 0;
-	tScanResultHandle pResult;
-	struct cfg80211_bss *bss_status = NULL;
-	hdd_context_t *pHddCtx;
-	int ret;
-
-	ENTER();
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_UPDATE_BSS,
-			 NO_SESSION, pAdapter->sessionId));
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ret;
-
-	/* start getting scan results and populate cgf80211 BSS database */
-	status = sme_scan_get_result(hHal, pAdapter->sessionId, NULL, &pResult);
-
-	/* no scan results */
-	if (NULL == pResult) {
-		hddLog(LOGE, FL("No scan result Status %d"), status);
-		return status;
-	}
-
-	pScanResult = sme_scan_result_get_first(hHal, pResult);
-
-	while (pScanResult) {
-		/*
-		 * - cfg80211_inform_bss() is not updating ie field of bss
-		 * entry if entry already exists in bss data base of cfg80211
-		 * for that particular BSS ID.  Using cfg80211_inform_bss_frame
-		 * to update thebss entry instead of cfg80211_inform_bss,
-		 * But this call expects mgmt packet as input. As of now
-		 * there is no possibility to get the mgmt(probe response)
-		 * frame from PE, converting bss_desc to
-		 * ieee80211_mgmt(probe response) and passing to c
-		 * fg80211_inform_bss_frame.
-		 * - Update BSS only if beacon timestamp is later than
-		 * scan request timestamp.
-		 */
-		if ((scan_time == 0) ||
-			(scan_time <
-				pScanResult->BssDescriptor.nReceivedTime)) {
-			bss_status =
-				wlan_hdd_cfg80211_inform_bss_frame(pAdapter,
-						&pScanResult->BssDescriptor);
-
-			if (NULL == bss_status) {
-				hdd_info("NULL returned by cfg80211_inform_bss_frame");
-			} else {
-				cfg80211_put_bss(
-					wiphy,
-					bss_status);
-			}
-		} else {
-			hdd_info("BSSID: " MAC_ADDRESS_STR " Skipped",
-			MAC_ADDR_ARRAY(pScanResult->BssDescriptor.bssId));
-		}
-		pScanResult = sme_scan_result_get_next(hHal, pResult);
-	}
-
-	sme_scan_result_purge(hHal, pResult);
-	/*
-	 * For SAP mode, scan is invoked by hostapd during SAP start
-	 * if hostapd is restarted, we need to flush previous scan
-	 * result so that it will reflect environment change
-	 */
-	if (pAdapter->device_mode == WLAN_HDD_SOFTAP
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-		&& pHddCtx->skip_acs_scan_status != eSAP_SKIP_ACS_SCAN
-#endif
-	)
-		sme_scan_flush_result(hHal);
-
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_pmksa_candidate_notify() - notify a new PMSKA candidate
- * @pAdapter: Pointer to adapter
- * @pRoamInfo: Pointer to roam info
- * @index: Index
- * @preauth: Preauth flag
- *
- * This function is used to notify the supplicant of a new PMKSA candidate.
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_pmksa_candidate_notify(hdd_adapter_t *pAdapter,
-					     tCsrRoamInfo *pRoamInfo,
-					     int index, bool preauth)
-{
-#ifdef FEATURE_WLAN_OKC
-	struct net_device *dev = pAdapter->dev;
-	hdd_context_t *pHddCtx = (hdd_context_t *) pAdapter->pHddCtx;
-
-	ENTER();
-	hddLog(LOG1, FL("is going to notify supplicant of:"));
-
-	if (NULL == pRoamInfo) {
-		hddLog(LOGP, FL("pRoamInfo is NULL"));
-		return -EINVAL;
-	}
-
-	if (true == hdd_is_okc_mode_enabled(pHddCtx)) {
-		hddLog(LOG1, MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes));
-		cfg80211_pmksa_candidate_notify(dev, index,
-						pRoamInfo->bssid.bytes,
-						preauth, GFP_KERNEL);
-	}
-#endif /* FEATURE_WLAN_OKC */
-	return 0;
-}
-
-#ifdef FEATURE_WLAN_LFR_METRICS
-/**
- * wlan_hdd_cfg80211_roam_metrics_preauth() - roam metrics preauth
- * @pAdapter: Pointer to adapter
- * @pRoamInfo: Pointer to roam info
- *
- * 802.11r/LFR metrics reporting function to report preauth initiation
- *
- * Return: CDF status
- */
-#define MAX_LFR_METRICS_EVENT_LENGTH 100
-CDF_STATUS wlan_hdd_cfg80211_roam_metrics_preauth(hdd_adapter_t *pAdapter,
-						  tCsrRoamInfo *pRoamInfo)
-{
-	unsigned char metrics_notification[MAX_LFR_METRICS_EVENT_LENGTH + 1];
-	union iwreq_data wrqu;
-
-	ENTER();
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("pAdapter is NULL!"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* create the event */
-	memset(&wrqu, 0, sizeof(wrqu));
-	memset(metrics_notification, 0, sizeof(metrics_notification));
-
-	wrqu.data.pointer = metrics_notification;
-	wrqu.data.length = scnprintf(metrics_notification,
-				     sizeof(metrics_notification),
-				     "QCOM: LFR_PREAUTH_INIT " MAC_ADDRESS_STR,
-				     MAC_ADDR_ARRAY(pRoamInfo->bssid));
-
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu,
-			    metrics_notification);
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_hdd_cfg80211_roam_metrics_handover() - roam metrics hand over
- * @pAdapter: Pointer to adapter
- * @pRoamInfo: Pointer to roam info
- * @preauth_status: Preauth status
- *
- * 802.11r/LFR metrics reporting function to report handover initiation
- *
- * Return: CDF status
- */
-CDF_STATUS
-wlan_hdd_cfg80211_roam_metrics_preauth_status(hdd_adapter_t *pAdapter,
-					      tCsrRoamInfo *pRoamInfo,
-					      bool preauth_status)
-{
-	unsigned char metrics_notification[MAX_LFR_METRICS_EVENT_LENGTH + 1];
-	union iwreq_data wrqu;
-
-	ENTER();
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("pAdapter is NULL!"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* create the event */
-	memset(&wrqu, 0, sizeof(wrqu));
-	memset(metrics_notification, 0, sizeof(metrics_notification));
-
-	scnprintf(metrics_notification, sizeof(metrics_notification),
-		  "QCOM: LFR_PREAUTH_STATUS " MAC_ADDRESS_STR,
-		  MAC_ADDR_ARRAY(pRoamInfo->bssid));
-
-	if (1 == preauth_status)
-		strlcat(metrics_notification, " true",
-				sizeof(metrics_notification));
-	else
-		strlcat(metrics_notification, " false",
-				sizeof(metrics_notification));
-
-	wrqu.data.pointer = metrics_notification;
-	wrqu.data.length = strlen(metrics_notification);
-
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu,
-			    metrics_notification);
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_hdd_cfg80211_roam_metrics_handover() - roam metrics hand over
- * @pAdapter: Pointer to adapter
- * @pRoamInfo: Pointer to roam info
- *
- * 802.11r/LFR metrics reporting function to report handover initiation
- *
- * Return: CDF status
- */
-CDF_STATUS wlan_hdd_cfg80211_roam_metrics_handover(hdd_adapter_t *pAdapter,
-						   tCsrRoamInfo *pRoamInfo)
-{
-	unsigned char metrics_notification[MAX_LFR_METRICS_EVENT_LENGTH + 1];
-	union iwreq_data wrqu;
-
-	ENTER();
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("pAdapter is NULL!"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* create the event */
-	memset(&wrqu, 0, sizeof(wrqu));
-	memset(metrics_notification, 0, sizeof(metrics_notification));
-
-	wrqu.data.pointer = metrics_notification;
-	wrqu.data.length = scnprintf(metrics_notification,
-				     sizeof(metrics_notification),
-				     "QCOM: LFR_PREAUTH_HANDOVER "
-				     MAC_ADDRESS_STR,
-				     MAC_ADDR_ARRAY(pRoamInfo->bssid));
-
-	wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu,
-			    metrics_notification);
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-#endif
-
-/**
- * hdd_select_cbmode() - select channel bonding mode
- * @pAdapter: Pointer to adapter
- * @operatingChannel: Operating channel
- *
- * Return: none
- */
-void hdd_select_cbmode(hdd_adapter_t *pAdapter, uint8_t operationChannel)
-{
-	uint8_t iniDot11Mode = (WLAN_HDD_GET_CTX(pAdapter))->config->dot11Mode;
-	eHddDot11Mode hddDot11Mode = iniDot11Mode;
-	chan_params_t ch_params;
-	ch_params.ch_width =
-			(WLAN_HDD_GET_CTX(pAdapter))->config->vhtChannelWidth;
-
-	hddLog(LOG1, FL("Channel Bonding Mode Selected is %u"), iniDot11Mode);
-	switch (iniDot11Mode) {
-	case eHDD_DOT11_MODE_AUTO:
-	case eHDD_DOT11_MODE_11ac:
-	case eHDD_DOT11_MODE_11ac_ONLY:
-#ifdef WLAN_FEATURE_11AC
-		if (sme_is_feature_supported_by_fw(DOT11AC))
-			hddDot11Mode = eHDD_DOT11_MODE_11ac;
-		else
-			hddDot11Mode = eHDD_DOT11_MODE_11n;
-#else
-		hddDot11Mode = eHDD_DOT11_MODE_11n;
-#endif
-		break;
-	case eHDD_DOT11_MODE_11n:
-	case eHDD_DOT11_MODE_11n_ONLY:
-		hddDot11Mode = eHDD_DOT11_MODE_11n;
-		break;
-	default:
-		hddDot11Mode = iniDot11Mode;
-		break;
-	}
-	/* This call decides required channel bonding mode */
-	sme_set_ch_params((WLAN_HDD_GET_CTX(pAdapter)->hHal),
-				hdd_cfg_xlate_to_csr_phy_mode(hddDot11Mode),
-				operationChannel, 0,
-				&ch_params);
-}
-
-
-/*
- * FUNCTION: wlan_hdd_cfg80211_connect_start
- * wlan_hdd_cfg80211_connect_start() - start connection
- * @pAdapter: Pointer to adapter
- * @ssid: Pointer ot ssid
- * @ssid_len: Length of ssid
- * @bssid: Pointer to bssid
- * @operatingChannel: Operating channel
- *
- * This function is used to start the association process
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
-				    const u8 *ssid, size_t ssid_len,
-				    const u8 *bssid_hint, const u8 *bssid,
-				    u8 operatingChannel)
-{
-	int status = 0;
-	hdd_wext_state_t *pWextState;
-	hdd_context_t *pHddCtx;
-	uint32_t roamId;
-	tCsrRoamProfile *pRoamProfile;
-	eCsrAuthType RSNAuthType;
-	tSmeConfigParams *sme_config;
-
-	ENTER();
-
-	pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (status)
-		return status;
-
-	if (SIR_MAC_MAX_SSID_LENGTH < ssid_len) {
-		hddLog(LOGE, FL("wrong SSID len"));
-		return -EINVAL;
-	}
-
-	pRoamProfile = &pWextState->roamProfile;
-
-	if (pRoamProfile) {
-		hdd_station_ctx_t *pHddStaCtx;
-		pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-		if (HDD_WMM_USER_MODE_NO_QOS ==
-		    (WLAN_HDD_GET_CTX(pAdapter))->config->WmmMode) {
-			/*QoS not enabled in cfg file */
-			pRoamProfile->uapsd_mask = 0;
-		} else {
-			/*QoS enabled, update uapsd mask from cfg file */
-			pRoamProfile->uapsd_mask =
-				(WLAN_HDD_GET_CTX(pAdapter))->config->UapsdMask;
-		}
-
-		pRoamProfile->SSIDs.numOfSSIDs = 1;
-		pRoamProfile->SSIDs.SSIDList->SSID.length = ssid_len;
-		cdf_mem_zero(pRoamProfile->SSIDs.SSIDList->SSID.ssId,
-			     sizeof(pRoamProfile->SSIDs.SSIDList->SSID.ssId));
-		cdf_mem_copy((void *)(pRoamProfile->SSIDs.SSIDList->SSID.ssId),
-			     ssid, ssid_len);
-
-		if (bssid) {
-			pRoamProfile->BSSIDs.numOfBSSIDs = 1;
-			cdf_mem_copy((void *)(pRoamProfile->BSSIDs.bssid),
-				     bssid, CDF_MAC_ADDR_SIZE);
-			/* Save BSSID in seperate variable as well, as RoamProfile
-			   BSSID is getting zeroed out in the association process. And in
-			   case of join failure we should send valid BSSID to supplicant
-			 */
-			cdf_mem_copy((void *)(pWextState->req_bssId.bytes),
-					bssid, CDF_MAC_ADDR_SIZE);
-		} else if (bssid_hint) {
-			pRoamProfile->BSSIDs.numOfBSSIDs = 1;
-			cdf_mem_copy((void *)(pRoamProfile->BSSIDs.bssid),
-						bssid_hint, CDF_MAC_ADDR_SIZE);
-			/* Save BSSID in separate variable as well, as
-			   RoamProfile BSSID is getting zeroed out in the
-			   association process. And in case of join failure
-			   we should send valid BSSID to supplicant
-			 */
-			cdf_mem_copy((void *)(pWextState->req_bssId.bytes),
-					bssid_hint, CDF_MAC_ADDR_SIZE);
-			hddLog(LOGW, FL(" bssid_hint "MAC_ADDRESS_STR),
-					MAC_ADDR_ARRAY(bssid_hint));
-		} else {
-			cdf_mem_zero((void *)(pRoamProfile->BSSIDs.bssid),
-				     CDF_MAC_ADDR_SIZE);
-		}
-
-		hddLog(LOG1, FL("Connect to SSID: %.*s operating Channel: %u"),
-		       pRoamProfile->SSIDs.SSIDList->SSID.length,
-		       pRoamProfile->SSIDs.SSIDList->SSID.ssId,
-		       operatingChannel);
-
-		if ((IW_AUTH_WPA_VERSION_WPA == pWextState->wpaVersion) ||
-		    (IW_AUTH_WPA_VERSION_WPA2 == pWextState->wpaVersion)) {
-			/*set gen ie */
-			hdd_set_genie_to_csr(pAdapter, &RSNAuthType);
-			/*set auth */
-			hdd_set_csr_auth_type(pAdapter, RSNAuthType);
-		}
-#ifdef FEATURE_WLAN_WAPI
-		if (pAdapter->wapi_info.nWapiMode) {
-			hddLog(LOG1,
-				FL("Setting WAPI AUTH Type and Encryption Mode values"));
-			switch (pAdapter->wapi_info.wapiAuthMode) {
-			case WAPI_AUTH_MODE_PSK:
-			{
-				hddLog(LOG1,
-				       FL("WAPI AUTH TYPE: PSK: %d"),
-				       pAdapter->wapi_info.wapiAuthMode);
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_WAPI_WAI_PSK;
-				break;
-			}
-			case WAPI_AUTH_MODE_CERT:
-			{
-				hddLog(LOG1,
-				       FL("WAPI AUTH TYPE: CERT: %d"),
-				       pAdapter->wapi_info.wapiAuthMode);
-				pRoamProfile->AuthType.authType[0] =
-					eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE;
-				break;
-			}
-			} /* End of switch */
-			if (pAdapter->wapi_info.wapiAuthMode ==
-			    WAPI_AUTH_MODE_PSK
-			    || pAdapter->wapi_info.wapiAuthMode ==
-			    WAPI_AUTH_MODE_CERT) {
-				hddLog(LOG1,
-				       FL("WAPI PAIRWISE/GROUP ENCRYPTION: WPI"));
-				pRoamProfile->AuthType.numEntries = 1;
-				pRoamProfile->EncryptionType.numEntries = 1;
-				pRoamProfile->EncryptionType.encryptionType[0] =
-					eCSR_ENCRYPT_TYPE_WPI;
-				pRoamProfile->mcEncryptionType.numEntries = 1;
-				pRoamProfile->mcEncryptionType.
-				encryptionType[0] = eCSR_ENCRYPT_TYPE_WPI;
-			}
-		}
-#endif /* FEATURE_WLAN_WAPI */
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-		/* Initializing gtkOffloadReqParams */
-		if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-		    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) {
-			memset(&pHddStaCtx->gtkOffloadReqParams, 0,
-			       sizeof(tSirGtkOffloadParams));
-			pHddStaCtx->gtkOffloadReqParams.ulFlags =
-				GTK_OFFLOAD_DISABLE;
-		}
-#endif
-		pRoamProfile->csrPersona = pAdapter->device_mode;
-
-		if (operatingChannel) {
-			pRoamProfile->ChannelInfo.ChannelList =
-				&operatingChannel;
-			pRoamProfile->ChannelInfo.numOfChannels = 1;
-		} else {
-			pRoamProfile->ChannelInfo.ChannelList = NULL;
-			pRoamProfile->ChannelInfo.numOfChannels = 0;
-		}
-		if ((WLAN_HDD_IBSS == pAdapter->device_mode)
-		    && operatingChannel) {
-			/*
-			 * Need to post the IBSS power save parameters
-			 * to WMA. WMA will configure this parameters
-			 * to firmware if power save is enabled by the
-			 * firmware.
-			 */
-			status = hdd_set_ibss_power_save_params(pAdapter);
-
-			if (CDF_STATUS_SUCCESS != status) {
-				hddLog(LOGE,
-				       FL("Set IBSS Power Save Params Failed"));
-				return -EINVAL;
-			}
-			hdd_select_cbmode(pAdapter, operatingChannel);
-		}
-
-		if (pHddCtx->config->policy_manager_enabled &&
-			(true == cds_is_connection_in_progress())) {
-			hdd_err("Connection refused: conn in progress");
-			return -EINVAL;
-		}
-
-		/* change conn_state to connecting before sme_roam_connect(), because sme_roam_connect()
-		 * has a direct path to call hdd_sme_roam_callback(), which will change the conn_state
-		 * If direct path, conn_state will be accordingly changed to NotConnected or Associated
-		 * by either hdd_association_completion_handler() or hdd_dis_connect_handler() in sme_RoamCallback()
-		 * if sme_RomConnect is to be queued, Connecting state will remain until it is completed.
-		 */
-		if (WLAN_HDD_INFRA_STATION == pAdapter->device_mode ||
-		    WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) {
-			hddLog(LOG1,
-				FL("Set HDD connState to eConnectionState_Connecting"));
-			hdd_conn_set_connection_state(pAdapter,
-						      eConnectionState_Connecting);
-		}
-
-		/* After 8-way handshake supplicant should give the scan command
-		 * in that it update the additional IEs, But because of scan
-		 * enhancements, the supplicant is not issuing the scan command now.
-		 * So the unicast frames which are sent from the host are not having
-		 * the additional IEs. If it is P2P CLIENT and there is no additional
-		 * IE present in roamProfile, then use the addtional IE form scan_info
-		 */
-
-		if ((pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) &&
-		    (!pRoamProfile->pAddIEScan)) {
-			pRoamProfile->pAddIEScan =
-				&pAdapter->scan_info.scanAddIE.addIEdata[0];
-			pRoamProfile->nAddIEScanLength =
-				pAdapter->scan_info.scanAddIE.length;
-		}
-		/*
-		 * When policy manager is enabled from ini file, we shouldn't
-		 * check for other concurrency rules.
-		 */
-		if (!pHddCtx->config->policy_manager_enabled) {
-			cds_handle_conc_rule1(pAdapter, pRoamProfile);
-			if (true != cds_handle_conc_rule2(
-					pAdapter, pRoamProfile, &roamId))
-				return 0;
-		}
-
-		sme_config = cdf_mem_malloc(sizeof(*sme_config));
-		if (!sme_config) {
-			hdd_err("unable to allocate sme_config");
-			return -ENOMEM;
-		}
-		cdf_mem_zero(sme_config, sizeof(*sme_config));
-		sme_get_config_param(pHddCtx->hHal, sme_config);
-		/* These values are not sessionized. So, any change in these SME
-		 * configs on an older or parallel interface will affect the
-		 * cb mode. So, restoring the default INI params before starting
-		 * interfaces such as sta, cli etc.,
-		 */
-		sme_config->csrConfig.channelBondingMode5GHz =
-			pHddCtx->config->nChannelBondingMode5GHz;
-		sme_config->csrConfig.channelBondingMode24GHz =
-			pHddCtx->config->nChannelBondingMode24GHz;
-		sme_update_config(pHddCtx->hHal, sme_config);
-		cdf_mem_free(sme_config);
-
-		status = sme_roam_connect(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					  pAdapter->sessionId, pRoamProfile,
-					  &roamId);
-
-		if ((CDF_STATUS_SUCCESS != status) &&
-		    (WLAN_HDD_INFRA_STATION == pAdapter->device_mode ||
-		     WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) {
-			hddLog(LOGE,
-			       FL("sme_roam_connect (session %d) failed with "
-			       "status %d. -> NotConnected"),
-			       pAdapter->sessionId, status);
-			/* change back to NotAssociated */
-			hdd_conn_set_connection_state(pAdapter,
-						      eConnectionState_NotConnected);
-		}
-
-		pRoamProfile->ChannelInfo.ChannelList = NULL;
-		pRoamProfile->ChannelInfo.numOfChannels = 0;
-
-	} else {
-		hddLog(LOGE, FL("No valid Roam profile"));
-		return -EINVAL;
-	}
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_set_auth_type() - set auth type
- * @pAdapter: Pointer to adapter
- * @auth_type: Auth type
- *
- * This function is used to set the authentication type (OPEN/SHARED).
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_set_auth_type(hdd_adapter_t *pAdapter,
-					   enum nl80211_auth_type auth_type)
-{
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	ENTER();
-
-	/*set authentication type */
-	switch (auth_type) {
-	case NL80211_AUTHTYPE_AUTOMATIC:
-		hddLog(LOG1,
-		       FL("set authentication type to AUTOSWITCH"));
-		pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_AUTOSWITCH;
-		break;
-
-	case NL80211_AUTHTYPE_OPEN_SYSTEM:
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	case NL80211_AUTHTYPE_FT:
-#endif /* WLAN_FEATURE_VOWIFI_11R */
-		hddLog(LOG1,
-		       FL("set authentication type to OPEN"));
-		pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM;
-		break;
-
-	case NL80211_AUTHTYPE_SHARED_KEY:
-		hddLog(LOG1,
-		       FL("set authentication type to SHARED"));
-		pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_SHARED_KEY;
-		break;
-#ifdef FEATURE_WLAN_ESE
-	case NL80211_AUTHTYPE_NETWORK_EAP:
-		hddLog(LOG1,
-		       FL("set authentication type to CCKM WPA"));
-		pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_CCKM_WPA;
-		break;
-#endif
-
-	default:
-		hddLog(LOGE,
-		       FL("Unsupported authentication type %d"), auth_type);
-		pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_UNKNOWN;
-		return -EINVAL;
-	}
-
-	pWextState->roamProfile.AuthType.authType[0] =
-		pHddStaCtx->conn_info.authType;
-	return 0;
-}
-
-/**
- * wlan_hdd_set_akm_suite() - set key management type
- * @pAdapter: Pointer to adapter
- * @key_mgmt: Key management type
- *
- * This function is used to set the key mgmt type(PSK/8021x).
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_set_akm_suite(hdd_adapter_t *pAdapter, u32 key_mgmt)
-{
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-
-	ENTER();
-
-#define WLAN_AKM_SUITE_8021X_SHA256 0x000FAC05
-#define WLAN_AKM_SUITE_PSK_SHA256   0x000FAC06
-	/*set key mgmt type */
-	switch (key_mgmt) {
-	case WLAN_AKM_SUITE_PSK:
-	case WLAN_AKM_SUITE_PSK_SHA256:
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	case WLAN_AKM_SUITE_FT_PSK:
-#endif
-		hddLog(LOG1, FL("setting key mgmt type to PSK"));
-		pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_PSK;
-		break;
-
-	case WLAN_AKM_SUITE_8021X_SHA256:
-	case WLAN_AKM_SUITE_8021X:
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	case WLAN_AKM_SUITE_FT_8021X:
-#endif
-		hddLog(LOG1,
-		       FL("setting key mgmt type to 8021x"));
-		pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
-		break;
-#ifdef FEATURE_WLAN_ESE
-#define WLAN_AKM_SUITE_CCKM         0x00409600  /* Should be in ieee802_11_defs.h */
-#define IW_AUTH_KEY_MGMT_CCKM       8   /* Should be in linux/wireless.h */
-	case WLAN_AKM_SUITE_CCKM:
-		hddLog(LOG1,
-		       FL("setting key mgmt type to CCKM"));
-		pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_CCKM;
-		break;
-#endif
-#ifndef WLAN_AKM_SUITE_OSEN
-#define WLAN_AKM_SUITE_OSEN         0x506f9a01  /* Should be in ieee802_11_defs.h */
-#endif
-	case WLAN_AKM_SUITE_OSEN:
-		hddLog(LOG1,
-		       FL("setting key mgmt type to OSEN"));
-		pWextState->authKeyMgmt |= IW_AUTH_KEY_MGMT_802_1X;
-		break;
-
-	default:
-		hddLog(LOGE,
-		       FL("Unsupported key mgmt type %d"), key_mgmt);
-		return -EINVAL;
-
-	}
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_cipher() - set encryption type
- * @pAdapter: Pointer to adapter
- * @cipher: Cipher type
- * @ucast: Unicast flag
- *
- * This function is used to set the encryption type
- * (NONE/WEP40/WEP104/TKIP/CCMP).
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_set_cipher(hdd_adapter_t *pAdapter,
-					u32 cipher, bool ucast)
-{
-	eCsrEncryptionType encryptionType = eCSR_ENCRYPT_TYPE_NONE;
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	ENTER();
-
-	if (!cipher) {
-		hdd_info("received cipher %d - considering none", cipher);
-		encryptionType = eCSR_ENCRYPT_TYPE_NONE;
-	} else {
-
-		/*set encryption method */
-		switch (cipher) {
-		case IW_AUTH_CIPHER_NONE:
-			encryptionType = eCSR_ENCRYPT_TYPE_NONE;
-			break;
-
-		case WLAN_CIPHER_SUITE_WEP40:
-			encryptionType = eCSR_ENCRYPT_TYPE_WEP40;
-			break;
-
-		case WLAN_CIPHER_SUITE_WEP104:
-			encryptionType = eCSR_ENCRYPT_TYPE_WEP104;
-			break;
-
-		case WLAN_CIPHER_SUITE_TKIP:
-			encryptionType = eCSR_ENCRYPT_TYPE_TKIP;
-			break;
-
-		case WLAN_CIPHER_SUITE_CCMP:
-			encryptionType = eCSR_ENCRYPT_TYPE_AES;
-			break;
-#ifdef FEATURE_WLAN_WAPI
-		case WLAN_CIPHER_SUITE_SMS4:
-			encryptionType = eCSR_ENCRYPT_TYPE_WPI;
-			break;
-#endif
-
-#ifdef FEATURE_WLAN_ESE
-		case WLAN_CIPHER_SUITE_KRK:
-			encryptionType = eCSR_ENCRYPT_TYPE_KRK;
-			break;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-		case WLAN_CIPHER_SUITE_BTK:
-			encryptionType = eCSR_ENCRYPT_TYPE_BTK;
-			break;
-#endif
-#endif
-		default:
-			hddLog(LOGE,
-			       FL("Unsupported cipher type %d"), cipher);
-			return -EOPNOTSUPP;
-		}
-	}
-
-	if (ucast) {
-		hddLog(LOG1,
-		       FL("setting unicast cipher type to %d"), encryptionType);
-		pHddStaCtx->conn_info.ucEncryptionType = encryptionType;
-		pWextState->roamProfile.EncryptionType.numEntries = 1;
-		pWextState->roamProfile.EncryptionType.encryptionType[0] =
-			encryptionType;
-	} else {
-		hddLog(LOG1,
-		       FL("setting mcast cipher type to %d"), encryptionType);
-		pHddStaCtx->conn_info.mcEncryptionType = encryptionType;
-		pWextState->roamProfile.mcEncryptionType.numEntries = 1;
-		pWextState->roamProfile.mcEncryptionType.encryptionType[0] =
-			encryptionType;
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_ie() - set IEs
- * @pAdapter: Pointer to adapter
- * @ie: Pointer ot ie
- * @ie: IE length
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
-			     size_t ie_len)
-{
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	const uint8_t *genie = ie;
-	uint16_t remLen = ie_len;
-#ifdef FEATURE_WLAN_WAPI
-	uint32_t akmsuite[MAX_NUM_AKM_SUITES];
-	u16 *tmp;
-	uint16_t akmsuiteCount;
-	int *akmlist;
-#endif
-	ENTER();
-
-	/* clear previous assocAddIE */
-	pWextState->assocAddIE.length = 0;
-	pWextState->roamProfile.bWPSAssociation = false;
-	pWextState->roamProfile.bOSENAssociation = false;
-
-	while (remLen >= 2) {
-		uint16_t eLen = 0;
-		uint8_t elementId;
-		elementId = *genie++;
-		eLen = *genie++;
-		remLen -= 2;
-
-		hddLog(LOG1, FL("IE[0x%X], LEN[%d]"), elementId, eLen);
-
-		switch (elementId) {
-		case DOT11F_EID_WPA:
-			if (4 > eLen) { /* should have at least OUI which is 4 bytes so extra 2 bytes not needed */
-				hddLog(LOGE, FL("Invalid WPA IE"));
-				return -EINVAL;
-			} else if (0 ==
-				   memcmp(&genie[0], "\x00\x50\xf2\x04", 4)) {
-				uint16_t curAddIELen =
-					pWextState->assocAddIE.length;
-				hddLog(LOG1,
-					FL("Set WPS IE(len %d)"), eLen + 2);
-
-				if (SIR_MAC_MAX_ADD_IE_LENGTH <
-				    (pWextState->assocAddIE.length + eLen)) {
-					hddLog(LOGE,
-					       FL("Cannot accommodate assocAddIE. Need bigger buffer space"));
-					CDF_ASSERT(0);
-					return -ENOMEM;
-				}
-				/* WSC IE is saved to Additional IE ; it should be accumulated to handle WPS IE + P2P IE */
-				memcpy(pWextState->assocAddIE.addIEdata +
-				       curAddIELen, genie - 2, eLen + 2);
-				pWextState->assocAddIE.length += eLen + 2;
-
-				pWextState->roamProfile.bWPSAssociation = true;
-				pWextState->roamProfile.pAddIEAssoc =
-					pWextState->assocAddIE.addIEdata;
-				pWextState->roamProfile.nAddIEAssocLength =
-					pWextState->assocAddIE.length;
-			} else if (0 == memcmp(&genie[0], "\x00\x50\xf2", 3)) {
-				hddLog(LOG1,
-				       FL("Set WPA IE (len %d)"), eLen + 2);
-				memset(pWextState->WPARSNIE, 0,
-				       MAX_WPA_RSN_IE_LEN);
-				memcpy(pWextState->WPARSNIE, genie - 2,
-				       (eLen + 2));
-				pWextState->roamProfile.pWPAReqIE =
-					pWextState->WPARSNIE;
-				pWextState->roamProfile.nWPAReqIELength = eLen + 2;     /* ie_len; */
-			} else if ((0 == memcmp(&genie[0], P2P_OUI_TYPE,
-						P2P_OUI_TYPE_SIZE))) {
-				uint16_t curAddIELen =
-					pWextState->assocAddIE.length;
-				hddLog(LOG1,
-				       FL("Set P2P IE(len %d)"), eLen + 2);
-
-				if (SIR_MAC_MAX_ADD_IE_LENGTH <
-				    (pWextState->assocAddIE.length + eLen)) {
-					hddLog(LOGE,
-					       FL("Cannot accommodate assocAddIE Need bigger buffer space"));
-					CDF_ASSERT(0);
-					return -ENOMEM;
-				}
-				/* P2P IE is saved to Additional IE ; it should be accumulated to handle WPS IE + P2P IE */
-				memcpy(pWextState->assocAddIE.addIEdata +
-				       curAddIELen, genie - 2, eLen + 2);
-				pWextState->assocAddIE.length += eLen + 2;
-
-				pWextState->roamProfile.pAddIEAssoc =
-					pWextState->assocAddIE.addIEdata;
-				pWextState->roamProfile.nAddIEAssocLength =
-					pWextState->assocAddIE.length;
-			}
-#ifdef WLAN_FEATURE_WFD
-			else if ((0 == memcmp(&genie[0], WFD_OUI_TYPE,
-					      WFD_OUI_TYPE_SIZE)) &&
-				/* Consider WFD IE, only for P2P Client */
-				 (WLAN_HDD_P2P_CLIENT ==
-				     pAdapter->device_mode)) {
-				uint16_t curAddIELen =
-					pWextState->assocAddIE.length;
-				hddLog(LOG1,
-				       FL("Set WFD IE(len %d)"), eLen + 2);
-
-				if (SIR_MAC_MAX_ADD_IE_LENGTH <
-				    (pWextState->assocAddIE.length + eLen)) {
-					hddLog(LOGE,
-						FL("Cannot accommodate assocAddIE Need bigger buffer space"));
-					CDF_ASSERT(0);
-					return -ENOMEM;
-				}
-				/* WFD IE is saved to Additional IE ; it should
-				 * be accumulated to handle WPS IE + P2P IE +
-				 * WFD IE */
-				memcpy(pWextState->assocAddIE.addIEdata +
-				       curAddIELen, genie - 2, eLen + 2);
-				pWextState->assocAddIE.length += eLen + 2;
-
-				pWextState->roamProfile.pAddIEAssoc =
-					pWextState->assocAddIE.addIEdata;
-				pWextState->roamProfile.nAddIEAssocLength =
-					pWextState->assocAddIE.length;
-			}
-#endif
-			/* Appending HS 2.0 Indication Element in Assiciation Request */
-			else if ((0 == memcmp(&genie[0], HS20_OUI_TYPE,
-					      HS20_OUI_TYPE_SIZE))) {
-				uint16_t curAddIELen =
-					pWextState->assocAddIE.length;
-				hddLog(LOG1,
-				       FL("Set HS20 IE(len %d)"), eLen + 2);
-
-				if (SIR_MAC_MAX_ADD_IE_LENGTH <
-				    (pWextState->assocAddIE.length + eLen)) {
-					hddLog(LOGE,
-					       FL("Cannot accommodate assocAddIE Need bigger buffer space"));
-					CDF_ASSERT(0);
-					return -ENOMEM;
-				}
-				memcpy(pWextState->assocAddIE.addIEdata +
-				       curAddIELen, genie - 2, eLen + 2);
-				pWextState->assocAddIE.length += eLen + 2;
-
-				pWextState->roamProfile.pAddIEAssoc =
-					pWextState->assocAddIE.addIEdata;
-				pWextState->roamProfile.nAddIEAssocLength =
-					pWextState->assocAddIE.length;
-			}
-			/* Appending OSEN Information  Element in Assiciation Request */
-			else if ((0 == memcmp(&genie[0], OSEN_OUI_TYPE,
-					      OSEN_OUI_TYPE_SIZE))) {
-				uint16_t curAddIELen =
-					pWextState->assocAddIE.length;
-				hddLog(LOG1,
-				       FL("Set OSEN IE(len %d)"), eLen + 2);
-
-				if (SIR_MAC_MAX_ADD_IE_LENGTH <
-				    (pWextState->assocAddIE.length + eLen)) {
-					hddLog(LOGE,
-					       FL("Cannot accommodate assocAddIE Need bigger buffer space"));
-					CDF_ASSERT(0);
-					return -ENOMEM;
-				}
-				memcpy(pWextState->assocAddIE.addIEdata +
-				       curAddIELen, genie - 2, eLen + 2);
-				pWextState->assocAddIE.length += eLen + 2;
-
-				pWextState->roamProfile.bOSENAssociation = true;
-				pWextState->roamProfile.pAddIEAssoc =
-					pWextState->assocAddIE.addIEdata;
-				pWextState->roamProfile.nAddIEAssocLength =
-					pWextState->assocAddIE.length;
-			} else {
-				uint16_t add_ie_len =
-					pWextState->assocAddIE.length;
-
-				hdd_info("Set OSEN IE(len %d)", eLen + 2);
-
-				if (SIR_MAC_MAX_ADD_IE_LENGTH <
-				    (pWextState->assocAddIE.length + eLen)) {
-					hdd_err("Cannot accommodate assocAddIE Need bigger buffer space");
-					CDF_ASSERT(0);
-					return -ENOMEM;
-				}
-
-				memcpy(pWextState->assocAddIE.addIEdata +
-				       add_ie_len, genie - 2, eLen + 2);
-				pWextState->assocAddIE.length += eLen + 2;
-
-				pWextState->roamProfile.pAddIEAssoc =
-					pWextState->assocAddIE.addIEdata;
-				pWextState->roamProfile.nAddIEAssocLength =
-					pWextState->assocAddIE.length;
-			}
-			break;
-		case DOT11F_EID_RSN:
-			hddLog(LOG1, FL("Set RSN IE(len %d)"), eLen + 2);
-			memset(pWextState->WPARSNIE, 0, MAX_WPA_RSN_IE_LEN);
-			memcpy(pWextState->WPARSNIE, genie - 2,
-			       (eLen + 2));
-			pWextState->roamProfile.pRSNReqIE =
-				pWextState->WPARSNIE;
-			pWextState->roamProfile.nRSNReqIELength = eLen + 2;     /* ie_len; */
-			break;
-		/*
-		 * Appending Extended Capabilities with Interworking bit set
-		 * in Assoc Req.
-		 *
-		 * In assoc req this EXT Cap will only be taken into account if
-		 * interworkingService bit is set to 1. Currently
-		 * driver is only interested in interworkingService capability
-		 * from supplicant. If in future any other EXT Cap info is
-		 * required from supplicat, it needs to be handled while
-		 * sending Assoc Req in LIM.
-		 */
-		case DOT11F_EID_EXTCAP:
-		{
-			uint16_t curAddIELen =
-				pWextState->assocAddIE.length;
-			hddLog(LOG1,
-			       FL("Set Extended CAPS IE(len %d)"), eLen + 2);
-
-			if (SIR_MAC_MAX_ADD_IE_LENGTH <
-			    (pWextState->assocAddIE.length + eLen)) {
-				hddLog(LOGE, FL("Cannot accommodate assocAddIE Need bigger buffer space"));
-				CDF_ASSERT(0);
-				return -ENOMEM;
-			}
-			memcpy(pWextState->assocAddIE.addIEdata +
-			       curAddIELen, genie - 2, eLen + 2);
-			pWextState->assocAddIE.length += eLen + 2;
-
-			pWextState->roamProfile.pAddIEAssoc =
-				pWextState->assocAddIE.addIEdata;
-			pWextState->roamProfile.nAddIEAssocLength =
-				pWextState->assocAddIE.length;
-			break;
-		}
-#ifdef FEATURE_WLAN_WAPI
-		case WLAN_EID_WAPI:
-			/* Setting WAPI Mode to ON=1 */
-			pAdapter->wapi_info.nWapiMode = 1;
-			hddLog(LOG1,
-				FL("WAPI MODE IS %u"), pAdapter->wapi_info.nWapiMode);
-			tmp = (u16 *) ie;
-			tmp = tmp + 2;  /* Skip element Id and Len, Version */
-			akmsuiteCount = WPA_GET_LE16(tmp);
-			tmp = tmp + 1;
-			akmlist = (int *)(tmp);
-			if (akmsuiteCount <= MAX_NUM_AKM_SUITES) {
-				memcpy(akmsuite, akmlist, (4 * akmsuiteCount));
-			} else {
-				hddLog(LOGE,
-				       FL("Invalid akmSuite count"));
-				CDF_ASSERT(0);
-				return -EINVAL;
-			}
-
-			if (WAPI_PSK_AKM_SUITE == akmsuite[0]) {
-				hddLog(LOG1,
-				       FL("WAPI AUTH MODE SET TO PSK"));
-				pAdapter->wapi_info.wapiAuthMode =
-					WAPI_AUTH_MODE_PSK;
-			}
-			if (WAPI_CERT_AKM_SUITE == akmsuite[0]) {
-				hddLog(LOG1,
-				       FL("WAPI AUTH MODE SET TO CERTIFICATE"));
-				pAdapter->wapi_info.wapiAuthMode =
-					WAPI_AUTH_MODE_CERT;
-			}
-			break;
-#endif
-		default:
-			hddLog(LOGE,
-			       FL("Set UNKNOWN IE %X"), elementId);
-			/* when Unknown IE is received we should break and continue
-			 * to the next IE in the buffer instead we were returning
-			 * so changing this to break */
-			break;
-		}
-		genie += eLen;
-		remLen -= eLen;
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * hdd_is_wpaie_present() - check for WPA ie
- * @ie: Pointer to ie
- * @ie_len: Ie length
- *
- * Parse the received IE to find the WPA IE
- *
- * Return: true if wpa ie is found else false
- */
-static bool hdd_is_wpaie_present(const uint8_t *ie, uint8_t ie_len)
-{
-	uint8_t eLen = 0;
-	uint16_t remLen = ie_len;
-	uint8_t elementId = 0;
-
-	while (remLen >= 2) {
-		elementId = *ie++;
-		eLen = *ie++;
-		remLen -= 2;
-		if (eLen > remLen) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: IE length is wrong %d", __func__, eLen);
-			return false;
-		}
-		if ((elementId == DOT11F_EID_WPA) && (remLen > 5)) {
-			/* OUI - 0x00 0X50 0XF2
-			 * WPA Information Element - 0x01
-			 * WPA version - 0x01
-			 */
-			if (0 == memcmp(&ie[0], "\x00\x50\xf2\x01\x01", 5))
-				return true;
-		}
-		ie += eLen;
-		remLen -= eLen;
-	}
-	return false;
-}
-
-/**
- * wlan_hdd_cfg80211_set_privacy() - set security parameters during connection
- * @pAdapter: Pointer to adapter
- * @req: Pointer to security parameters
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
-				  struct cfg80211_connect_params *req)
-{
-	int status = 0;
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	ENTER();
-
-	/*set wpa version */
-	pWextState->wpaVersion = IW_AUTH_WPA_VERSION_DISABLED;
-
-	if (req->crypto.wpa_versions) {
-		if (NL80211_WPA_VERSION_1 == req->crypto.wpa_versions) {
-			pWextState->wpaVersion = IW_AUTH_WPA_VERSION_WPA;
-		} else if (NL80211_WPA_VERSION_2 == req->crypto.wpa_versions) {
-			pWextState->wpaVersion = IW_AUTH_WPA_VERSION_WPA2;
-		}
-	}
-
-	hddLog(LOG1, FL("set wpa version to %d"), pWextState->wpaVersion);
-
-	/*set authentication type */
-	status = wlan_hdd_cfg80211_set_auth_type(pAdapter, req->auth_type);
-
-	if (0 > status) {
-		hddLog(LOGE, FL("failed to set authentication type "));
-		return status;
-	}
-
-	/*set key mgmt type */
-	if (req->crypto.n_akm_suites) {
-		status =
-			wlan_hdd_set_akm_suite(pAdapter, req->crypto.akm_suites[0]);
-		if (0 > status) {
-			hddLog(LOGE, FL("failed to set akm suite"));
-			return status;
-		}
-	}
-
-	/*set pairwise cipher type */
-	if (req->crypto.n_ciphers_pairwise) {
-		status = wlan_hdd_cfg80211_set_cipher(pAdapter,
-						      req->crypto.
-						      ciphers_pairwise[0],
-						      true);
-		if (0 > status) {
-			hddLog(LOGE, FL("failed to set unicast cipher type"));
-			return status;
-		}
-	} else {
-		/*Reset previous cipher suite to none */
-		status = wlan_hdd_cfg80211_set_cipher(pAdapter, 0, true);
-		if (0 > status) {
-			hddLog(LOGE, FL("failed to set unicast cipher type"));
-			return status;
-		}
-	}
-
-	/*set group cipher type */
-	status =
-		wlan_hdd_cfg80211_set_cipher(pAdapter, req->crypto.cipher_group,
-					     false);
-
-	if (0 > status) {
-		hddLog(LOGE, FL("failed to set mcast cipher type"));
-		return status;
-	}
-#ifdef WLAN_FEATURE_11W
-	pWextState->roamProfile.MFPEnabled = (req->mfp == NL80211_MFP_REQUIRED);
-#endif
-
-	/*parse WPA/RSN IE, and set the correspoing fileds in Roam profile */
-	if (req->ie_len) {
-		status =
-			wlan_hdd_cfg80211_set_ie(pAdapter, req->ie, req->ie_len);
-		if (0 > status) {
-			hddLog(LOGE, FL("failed to parse the WPA/RSN IE"));
-			return status;
-		}
-	}
-
-	/*incase of WEP set default key information */
-	if (req->key && req->key_len) {
-		if ((WLAN_CIPHER_SUITE_WEP40 == req->crypto.ciphers_pairwise[0])
-		    || (WLAN_CIPHER_SUITE_WEP104 ==
-			req->crypto.ciphers_pairwise[0])
-		    ) {
-			if (IW_AUTH_KEY_MGMT_802_1X
-			    ==
-			    (pWextState->
-			     authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X)) {
-				hddLog(LOGE,
-				       FL("Dynamic WEP not supported"));
-				return -EOPNOTSUPP;
-			} else {
-				u8 key_len = req->key_len;
-				u8 key_idx = req->key_idx;
-
-				if ((eCSR_SECURITY_WEP_KEYSIZE_MAX_BYTES >=
-				     key_len)
-				    && (CSR_MAX_NUM_KEY > key_idx)
-				    ) {
-					hddLog(LOG1,
-						FL("setting default wep key, key_idx = %hu key_len %hu"),
-						key_idx, key_len);
-					cdf_mem_copy(&pWextState->roamProfile.
-						     Keys.
-						     KeyMaterial[key_idx][0],
-						     req->key, key_len);
-					pWextState->roamProfile.Keys.
-					KeyLength[key_idx] = (u8) key_len;
-					pWextState->roamProfile.Keys.
-					defaultIndex = (u8) key_idx;
-				}
-			}
-		}
-	}
-
-	return status;
-}
-
-/**
- * wlan_hdd_try_disconnect() - try disconnnect from previous connection
- * @pAdapter: Pointer to adapter
- *
- * This function is used to disconnect from previous connection
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_try_disconnect(hdd_adapter_t *pAdapter)
-{
-	unsigned long rc;
-	hdd_station_ctx_t *pHddStaCtx;
-	eMib_dot11DesiredBssType connectedBssType;
-	int status, result = 0;
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	hdd_conn_get_connected_bss_type(pHddStaCtx, &connectedBssType);
-
-	if ((eMib_dot11DesiredBssType_independent == connectedBssType) ||
-	  (eConnectionState_Associated == pHddStaCtx->conn_info.connState) ||
-	  (eConnectionState_Connecting == pHddStaCtx->conn_info.connState) ||
-	  (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState)) {
-		hdd_conn_set_connection_state(pAdapter,
-						eConnectionState_Disconnecting);
-		/* Issue disconnect to CSR */
-		INIT_COMPLETION(pAdapter->disconnect_comp_var);
-
-		status = sme_roam_disconnect(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				pAdapter->sessionId,
-				eCSR_DISCONNECT_REASON_UNSPECIFIED);
-		/*
-		 * Wait here instead of returning directly, this will block the
-		 * next connect command and allow processing of the scan for
-		 * ssid and the previous connect command in CSR. Else we might
-		 * hit some race conditions leading to SME and HDD out of sync.
-		 */
-		if (CDF_STATUS_CMD_NOT_QUEUED == status) {
-			hdd_info("Already disconnected or connect was in sme/roam pending list and removed by disconnect");
-		} else if (0 != status) {
-			hdd_err("csrRoamDisconnect failure, returned %d",
-				(int)status);
-			pHddStaCtx->staDebugState = status;
-			result = -EINVAL;
-			goto disconnected;
-		}
-
-		rc = wait_for_completion_timeout(
-			&pAdapter->disconnect_comp_var,
-			msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
-		if (!rc && (CDF_STATUS_CMD_NOT_QUEUED != status)) {
-			hdd_err("Sme disconnect event timed out session Id %d staDebugState %d",
-				pAdapter->sessionId, pHddStaCtx->staDebugState);
-			result = -ETIMEDOUT;
-		}
-	} else if (eConnectionState_Disconnecting ==
-				pHddStaCtx->conn_info.connState) {
-		rc = wait_for_completion_timeout(&pAdapter->disconnect_comp_var,
-				msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
-		if (!rc) {
-			hdd_err("Disconnect event timed out session Id %d staDebugState %d",
-				pAdapter->sessionId, pHddStaCtx->staDebugState);
-			result = -ETIMEDOUT;
-		}
-	}
-disconnected:
-	hdd_info("Set HDD connState to eConnectionState_NotConnected");
-	hdd_conn_set_connection_state(pAdapter, eConnectionState_NotConnected);
-	return result;
-}
-
-/**
- * __wlan_hdd_cfg80211_connect() - cfg80211 connect api
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @req: Pointer to cfg80211 connect request
- *
- * This function is used to start the association process
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
-				       struct net_device *ndev,
-				       struct cfg80211_connect_params *req)
-{
-	int status;
-	u16 channel;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
-	const u8 *bssid_hint = req->bssid_hint;
-#else
-	const u8 *bssid_hint = NULL;
-#endif
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *pHddCtx;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_CONNECT,
-			 pAdapter->sessionId, pAdapter->device_mode));
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-
-	if (pAdapter->device_mode != WLAN_HDD_INFRA_STATION &&
-		pAdapter->device_mode != WLAN_HDD_P2P_CLIENT) {
-		hddLog(LOGE, FL("Device_mode %s(%d) is not supported"),
-			hdd_device_mode_to_string(pAdapter->device_mode),
-			pAdapter->device_mode);
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	if (!pHddCtx) {
-		hddLog(LOGE, FL("HDD context is null"));
-		return -EINVAL;
-	}
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return status;
-	if (req->channel) {
-		if (!cds_allow_concurrency(
-				cds_convert_device_mode_to_hdd_type(
-				pAdapter->device_mode),
-				req->channel->hw_value, HW_MODE_20_MHZ)) {
-			hdd_err("This concurrency combination is not allowed");
-			return -ECONNREFUSED;
-		}
-	} else {
-		if (!cds_allow_concurrency(
-				cds_convert_device_mode_to_hdd_type(
-				pAdapter->device_mode), 0, HW_MODE_20_MHZ)) {
-			hdd_err("This concurrency combination is not allowed");
-			return -ECONNREFUSED;
-		}
-	}
-	wlan_hdd_disable_roaming(pAdapter);
-
-	/*Try disconnecting if already in connected state */
-	status = wlan_hdd_try_disconnect(pAdapter);
-	if (0 > status) {
-		hddLog(LOGE,
-			FL("Failed to disconnect the existing connection"));
-		return -EALREADY;
-	}
-
-	/*initialise security parameters */
-	status = wlan_hdd_cfg80211_set_privacy(pAdapter, req);
-
-	if (0 > status) {
-		hddLog(LOGE,
-			FL("failed to set security params"));
-		return status;
-	}
-
-	if (req->channel)
-		channel = req->channel->hw_value;
-	else
-		channel = 0;
-	status = wlan_hdd_cfg80211_connect_start(pAdapter, req->ssid,
-						 req->ssid_len, req->bssid,
-						 bssid_hint, channel);
-	if (0 > status) {
-		hddLog(LOGE, FL("connect failed"));
-		return status;
-	}
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_connect() - cfg80211 connect api
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @req: Pointer to cfg80211 connect request
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
-				     struct net_device *ndev,
-				     struct cfg80211_connect_params *req)
-{
-	int ret;
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_connect(wiphy, ndev, req);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_disconnect() - hdd disconnect api
- * @pAdapter: Pointer to adapter
- * @reason: Disconnect reason code
- *
- * This function is used to issue a disconnect request to SME
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason)
-{
-	int status, result = 0;
-	unsigned long rc;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	ENTER();
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	/*stop tx queues */
-	hddLog(LOG1, FL("Disabling queues"));
-	wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER,
-				   WLAN_CONTROL_PATH);
-	hddLog(LOG1,
-		FL("Set HDD connState to eConnectionState_Disconnecting"));
-	pHddStaCtx->conn_info.connState = eConnectionState_Disconnecting;
-	INIT_COMPLETION(pAdapter->disconnect_comp_var);
-
-	/*issue disconnect */
-
-	status = sme_roam_disconnect(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				     pAdapter->sessionId, reason);
-	/*
-	 * Wait here instead of returning directly, this will block the next
-	 * connect command and allow processing of the scan for ssid and
-	 * the previous connect command in CSR. Else we might hit some
-	 * race conditions leading to SME and HDD out of sync.
-	 */
-	if (CDF_STATUS_CMD_NOT_QUEUED == status) {
-		hdd_info("Already disconnected or connect was in sme/roam pending list and removed by disconnect");
-	} else if (0 != status) {
-		hddLog(LOGE,
-			FL("csr_roam_disconnect failure, returned %d"),
-			(int)status);
-		pHddStaCtx->staDebugState = status;
-		result = -EINVAL;
-		goto disconnected;
-	}
-	rc = wait_for_completion_timeout(&pAdapter->disconnect_comp_var,
-					 msecs_to_jiffies
-						 (WLAN_WAIT_TIME_DISCONNECT));
-
-	if (!rc && (CDF_STATUS_CMD_NOT_QUEUED != status)) {
-		hddLog(LOGE,
-			FL("Failed to disconnect, timed out"));
-		result = -ETIMEDOUT;
-	}
-disconnected:
-	hddLog(LOG1,
-		FL("Set HDD connState to eConnectionState_NotConnected"));
-	hdd_conn_set_connection_state(pAdapter, eConnectionState_NotConnected);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
-	/* Sending disconnect event to userspace for kernel version < 3.11
-	 * is handled by __cfg80211_disconnect call to __cfg80211_disconnected
-	 */
-	hddLog(LOG1, FL("Send disconnected event to userspace"));
-	cfg80211_disconnected(pAdapter->dev, WLAN_REASON_UNSPECIFIED,
-				NULL, 0, GFP_KERNEL);
-#endif
-
-	return result;
-}
-
-/**
- * hdd_ieee80211_reason_code_to_str() - return string conversion of reason code
- * @reason: ieee80211 reason code.
- *
- * This utility function helps log string conversion of reason code.
- *
- * Return: string conversion of reason code, if match found;
- *         "Unknown" otherwise.
- */
-static const char *hdd_ieee80211_reason_code_to_str(uint16_t reason)
-{
-	switch (reason) {
-	CASE_RETURN_STRING(WLAN_REASON_UNSPECIFIED);
-	CASE_RETURN_STRING(WLAN_REASON_PREV_AUTH_NOT_VALID);
-	CASE_RETURN_STRING(WLAN_REASON_DEAUTH_LEAVING);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_AP_BUSY);
-	CASE_RETURN_STRING(WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA);
-	CASE_RETURN_STRING(WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_STA_HAS_LEFT);
-	CASE_RETURN_STRING(WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_BAD_POWER);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_BAD_SUPP_CHAN);
-	CASE_RETURN_STRING(WLAN_REASON_INVALID_IE);
-	CASE_RETURN_STRING(WLAN_REASON_MIC_FAILURE);
-	CASE_RETURN_STRING(WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT);
-	CASE_RETURN_STRING(WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT);
-	CASE_RETURN_STRING(WLAN_REASON_IE_DIFFERENT);
-	CASE_RETURN_STRING(WLAN_REASON_INVALID_GROUP_CIPHER);
-	CASE_RETURN_STRING(WLAN_REASON_INVALID_PAIRWISE_CIPHER);
-	CASE_RETURN_STRING(WLAN_REASON_INVALID_AKMP);
-	CASE_RETURN_STRING(WLAN_REASON_UNSUPP_RSN_VERSION);
-	CASE_RETURN_STRING(WLAN_REASON_INVALID_RSN_IE_CAP);
-	CASE_RETURN_STRING(WLAN_REASON_IEEE8021X_FAILED);
-	CASE_RETURN_STRING(WLAN_REASON_CIPHER_SUITE_REJECTED);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_UNSPECIFIED_QOS);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_LOW_ACK);
-	CASE_RETURN_STRING(WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP);
-	CASE_RETURN_STRING(WLAN_REASON_QSTA_LEAVE_QBSS);
-	CASE_RETURN_STRING(WLAN_REASON_QSTA_NOT_USE);
-	CASE_RETURN_STRING(WLAN_REASON_QSTA_REQUIRE_SETUP);
-	CASE_RETURN_STRING(WLAN_REASON_QSTA_TIMEOUT);
-	CASE_RETURN_STRING(WLAN_REASON_QSTA_CIPHER_NOT_SUPP);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_PEER_CANCELED);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_MAX_PEERS);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_CONFIG);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_CLOSE);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_MAX_RETRIES);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_CONFIRM_TIMEOUT);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_INVALID_GTK);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_INCONSISTENT_PARAM);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_INVALID_SECURITY);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_PATH_ERROR);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_PATH_NOFORWARD);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_PATH_DEST_UNREACHABLE);
-	CASE_RETURN_STRING(WLAN_REASON_MAC_EXISTS_IN_MBSS);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_CHAN_REGULATORY);
-	CASE_RETURN_STRING(WLAN_REASON_MESH_CHAN);
-	default:
-		return "Unknown";
-	}
-}
-
-/**
- * __wlan_hdd_cfg80211_disconnect() - cfg80211 disconnect api
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @reason: Disconnect reason code
- *
- * This function is used to issue a disconnect request to SME
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
-					  struct net_device *dev, u16 reason)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	int status;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-#ifdef FEATURE_WLAN_TDLS
-	uint8_t staIdx;
-#endif
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_DISCONNECT,
-			 pAdapter->sessionId, reason));
-	hddLog(LOG1, FL("Device_mode %s(%d) reason code(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode, reason);
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	/* Issue disconnect request to SME, if station is in connected state */
-	if ((pHddStaCtx->conn_info.connState == eConnectionState_Associated) ||
-	    (pHddStaCtx->conn_info.connState == eConnectionState_Connecting)) {
-		eCsrRoamDisconnectReason reasonCode =
-			eCSR_DISCONNECT_REASON_UNSPECIFIED;
-		hdd_scaninfo_t *pScanInfo;
-
-		switch (reason) {
-		case WLAN_REASON_MIC_FAILURE:
-			reasonCode = eCSR_DISCONNECT_REASON_MIC_ERROR;
-			break;
-
-		case WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY:
-		case WLAN_REASON_DISASSOC_AP_BUSY:
-		case WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA:
-			reasonCode = eCSR_DISCONNECT_REASON_DISASSOC;
-			break;
-
-		case WLAN_REASON_PREV_AUTH_NOT_VALID:
-		case WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA:
-			reasonCode = eCSR_DISCONNECT_REASON_DEAUTH;
-			break;
-
-		case WLAN_REASON_DEAUTH_LEAVING:
-			reasonCode =
-				pHddCtx->config->
-				gEnableDeauthToDisassocMap ?
-				eCSR_DISCONNECT_REASON_STA_HAS_LEFT :
-				eCSR_DISCONNECT_REASON_DEAUTH;
-			break;
-		case WLAN_REASON_DISASSOC_STA_HAS_LEFT:
-			reasonCode = eCSR_DISCONNECT_REASON_STA_HAS_LEFT;
-			break;
-		default:
-			reasonCode = eCSR_DISCONNECT_REASON_UNSPECIFIED;
-			break;
-		}
-		hddLog(LOG1,
-			FL("convert to internal reason %d to reasonCode %d"),
-			reason, reasonCode);
-		pScanInfo = &pAdapter->scan_info;
-		if (pScanInfo->mScanPending) {
-			hddLog(LOG1,
-				FL("Disconnect is in progress, Aborting Scan"));
-			hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId,
-					   eCSR_SCAN_ABORT_DEFAULT);
-		}
-#ifdef FEATURE_WLAN_TDLS
-		/* First clean up the tdls peers if any */
-		for (staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta; staIdx++) {
-			if ((pHddCtx->tdlsConnInfo[staIdx].sessionId ==
-			     pAdapter->sessionId)
-			    && (pHddCtx->tdlsConnInfo[staIdx].staId)) {
-				uint8_t *mac;
-				mac =
-					pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes;
-				hddLog(LOG1,
-				       "%s: call sme_delete_tdls_peer_sta staId %d sessionId %d "
-				       MAC_ADDRESS_STR, __func__,
-				       pHddCtx->tdlsConnInfo[staIdx].staId,
-				       pAdapter->sessionId,
-				       MAC_ADDR_ARRAY(mac));
-				sme_delete_tdls_peer_sta(WLAN_HDD_GET_HAL_CTX
-								 (pAdapter),
-							 pAdapter->sessionId, mac);
-			}
-		}
-#endif
-		hddLog(LOG1, FL("Disconnecting with reasoncode:%u"),
-		       reasonCode);
-		hdd_info("Disconnect request from user space with reason: %s",
-			hdd_ieee80211_reason_code_to_str(reason));
-		status = wlan_hdd_disconnect(pAdapter, reasonCode);
-		if (0 != status) {
-			hddLog(LOGE,
-			       FL("failure, returned %d"), status);
-			return -EINVAL;
-		}
-	} else {
-		hddLog(LOGE,
-		       FL("unexpected cfg disconnect called while in state (%d)"),
-		       pHddStaCtx->conn_info.connState);
-	}
-
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_disconnect() - cfg80211 disconnect api
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @reason: Disconnect reason code
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
-					struct net_device *dev, u16 reason)
-{
-	int ret;
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_disconnect(wiphy, dev, reason);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_set_privacy_ibss() - set ibss privacy
- * @pAdapter: Pointer to adapter
- * @param: Pointer to IBSS parameters
- *
- * This function is used to initialize the security settings in IBSS mode
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_set_privacy_ibss(hdd_adapter_t *pAdapter,
-					      struct cfg80211_ibss_params
-					      *params)
-{
-	int status = 0;
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	eCsrEncryptionType encryptionType = eCSR_ENCRYPT_TYPE_NONE;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	ENTER();
-
-	pWextState->wpaVersion = IW_AUTH_WPA_VERSION_DISABLED;
-	cdf_mem_zero(&pHddStaCtx->ibss_enc_key, sizeof(tCsrRoamSetKey));
-	pHddStaCtx->ibss_enc_key_installed = 0;
-
-	if (params->ie_len && (NULL != params->ie)) {
-		if (wlan_hdd_cfg80211_get_ie_ptr(params->ie,
-					 params->ie_len, WLAN_EID_RSN)) {
-			pWextState->wpaVersion = IW_AUTH_WPA_VERSION_WPA2;
-			encryptionType = eCSR_ENCRYPT_TYPE_AES;
-		} else if (hdd_is_wpaie_present(params->ie, params->ie_len)) {
-			tDot11fIEWPA dot11WPAIE;
-			tHalHandle halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
-			u8 *ie;
-
-			memset(&dot11WPAIE, 0, sizeof(dot11WPAIE));
-			ie = wlan_hdd_cfg80211_get_ie_ptr(params->ie,
-							  params->ie_len,
-							  DOT11F_EID_WPA);
-			if (NULL != ie) {
-				pWextState->wpaVersion =
-					IW_AUTH_WPA_VERSION_WPA;
-				/* Unpack the WPA IE */
-				/* Skip past the EID byte and length byte - and four byte WiFi OUI */
-				dot11f_unpack_ie_wpa((tpAniSirGlobal) halHandle,
-						     &ie[2 + 4],
-						     ie[1] - 4, &dot11WPAIE);
-				/*Extract the multicast cipher, the encType for unicast
-				   cipher for wpa-none is none */
-				encryptionType =
-					hdd_translate_wpa_to_csr_encryption_type
-						(dot11WPAIE.multicast_cipher);
-			}
-		}
-
-		status =
-			wlan_hdd_cfg80211_set_ie(pAdapter, params->ie,
-						 params->ie_len);
-
-		if (0 > status) {
-			hddLog(LOGE, FL("failed to parse WPA/RSN IE"));
-			return status;
-		}
-	}
-
-	pWextState->roamProfile.AuthType.authType[0] =
-		pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM;
-
-	if (params->privacy) {
-		/* Security enabled IBSS, At this time there is no information
-		 * available about the security paramters, so initialise the
-		 * encryption type to eCSR_ENCRYPT_TYPE_WEP40_STATICKEY.
-		 * The correct security parameters will be updated later in
-		 * wlan_hdd_cfg80211_add_key Hal expects encryption type to be
-		 * set inorder enable privacy bit in beacons
-		 */
-
-		encryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
-	}
-	hddLog(LOG2, FL("encryptionType=%d"), encryptionType);
-	pHddStaCtx->conn_info.ucEncryptionType = encryptionType;
-	pWextState->roamProfile.EncryptionType.numEntries = 1;
-	pWextState->roamProfile.EncryptionType.encryptionType[0] =
-		encryptionType;
-	return status;
-}
-
-/**
- * __wlan_hdd_cfg80211_join_ibss() - join ibss
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @param: Pointer to IBSS join parameters
- *
- * This function is used to create/join an IBSS network
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
-					 struct net_device *dev,
-					 struct cfg80211_ibss_params *params)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	tCsrRoamProfile *pRoamProfile;
-	int status;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	struct cdf_mac_addr bssid;
-	u8 channelNum = 0;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_JOIN_IBSS,
-			 pAdapter->sessionId, pAdapter->device_mode));
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	if (NULL !=
-		params->chandef.chan)
-	{
-		uint32_t numChans = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-		uint8_t validChan[WNI_CFG_VALID_CHANNEL_LIST_LEN];
-		tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-		int indx;
-
-		/* Get channel number */
-		channelNum = ieee80211_frequency_to_channel(
-			params->
-			chandef.
-			chan->
-			center_freq);
-
-		if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
-					 validChan, &numChans)) {
-			hddLog(LOGE, FL("No valid channel list"));
-			return -EOPNOTSUPP;
-		}
-
-		for (indx = 0; indx < numChans; indx++) {
-			if (channelNum == validChan[indx]) {
-				break;
-			}
-		}
-		if (indx >= numChans) {
-			hddLog(LOGE,
-				FL("Not valid Channel %d"), channelNum);
-			return -EINVAL;
-		}
-	}
-
-	if (!cds_allow_concurrency(CDS_IBSS_MODE, channelNum,
-		HW_MODE_20_MHZ)) {
-		hdd_err("This concurrency combination is not allowed");
-		return -ECONNREFUSED;
-	}
-	if (pHddCtx->config->policy_manager_enabled) {
-		status = cdf_reset_connection_update();
-		if (!CDF_IS_STATUS_SUCCESS(status))
-			hdd_err("ERR: clear event failed");
-
-		status = cds_current_connections_update(pAdapter->sessionId,
-						channelNum,
-						CDS_UPDATE_REASON_JOIN_IBSS);
-		if (CDF_STATUS_E_FAILURE == status) {
-			hdd_err("ERROR: connections update failed!!");
-			return -EINVAL;
-		}
-
-		if (CDF_STATUS_SUCCESS == status) {
-			status = cdf_wait_for_connection_update();
-			if (!CDF_IS_STATUS_SUCCESS(status)) {
-				hdd_err("ERROR: cdf wait for event failed!!");
-				return -EINVAL;
-			}
-		}
-	}
-
-	/*Try disconnecting if already in connected state */
-	status = wlan_hdd_try_disconnect(pAdapter);
-	if (0 > status) {
-		hddLog(LOGE,
-		       FL("Failed to disconnect the existing IBSS connection"));
-		return -EALREADY;
-	}
-
-	pRoamProfile = &pWextState->roamProfile;
-
-	if (eCSR_BSS_TYPE_START_IBSS != pRoamProfile->BSSType) {
-		hddLog(LOGE,
-			FL("Interface type is not set to IBSS"));
-		return -EINVAL;
-	}
-
-	/* enable selected protection checks in IBSS mode */
-	pRoamProfile->cfg_protection = IBSS_CFG_PROTECTION_ENABLE_MASK;
-
-	if (CDF_STATUS_E_FAILURE == sme_cfg_set_int(pHddCtx->hHal,
-						    WNI_CFG_IBSS_ATIM_WIN_SIZE,
-						    pHddCtx->config->
-						    ibssATIMWinSize)) {
-		hddLog(LOGE,
-			FL("Could not pass on WNI_CFG_IBSS_ATIM_WIN_SIZE to CCM"));
-	}
-
-	/* BSSID is provided by upper layers hence no need to AUTO generate */
-	if (NULL != params->bssid) {
-		if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_IBSS_AUTO_BSSID, 0)
-				== CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE,
-				FL("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID"));
-			return -EIO;
-		}
-		cdf_mem_copy(bssid.bytes, params->bssid, CDF_MAC_ADDR_SIZE);
-	} else if (pHddCtx->config->isCoalesingInIBSSAllowed == 0) {
-		if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_IBSS_AUTO_BSSID, 0)
-				== CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE,
-				FL("ccmCfgStInt failed for WNI_CFG_IBSS_AUTO_BSSID"));
-			return -EIO;
-		}
-		cdf_copy_macaddr(&bssid, &pHddCtx->config->IbssBssid);
-	}
-	if ((params->beacon_interval > CFG_BEACON_INTERVAL_MIN)
-	    && (params->beacon_interval <= CFG_BEACON_INTERVAL_MAX))
-		pRoamProfile->beaconInterval = params->beacon_interval;
-	else {
-		pRoamProfile->beaconInterval = CFG_BEACON_INTERVAL_DEFAULT;
-		hddLog(LOG2,
-		       FL("input beacon interval %d TU is invalid, use default %d TU"),
-			params->beacon_interval, pRoamProfile->beaconInterval);
-	}
-
-	/* Set Channel */
-	if (channelNum)	{
-		/* Set the Operational Channel */
-		hddLog(LOG2, FL("set channel %d"), channelNum);
-		pRoamProfile->ChannelInfo.numOfChannels = 1;
-		pHddStaCtx->conn_info.operationChannel = channelNum;
-		pRoamProfile->ChannelInfo.ChannelList =
-			&pHddStaCtx->conn_info.operationChannel;
-	}
-
-	/* Initialize security parameters */
-	status = wlan_hdd_cfg80211_set_privacy_ibss(pAdapter, params);
-	if (status < 0) {
-		hddLog(LOGE,
-			FL("failed to set security parameters"));
-		return status;
-	}
-
-	/* Issue connect start */
-	status = wlan_hdd_cfg80211_connect_start(pAdapter, params->ssid,
-						 params->ssid_len,
-						 bssid.bytes,
-						 NULL,
-						 pHddStaCtx->conn_info.
-						 operationChannel);
-
-	if (0 > status) {
-		hddLog(LOGE, FL("connect failed"));
-		return status;
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_join_ibss() - join ibss
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @param: Pointer to IBSS join parameters
- *
- * This function is used to create/join an IBSS network
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
-				       struct net_device *dev,
-				       struct cfg80211_ibss_params *params)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_join_ibss(wiphy, dev, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_leave_ibss() - leave ibss
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- *
- * This function is used to leave an IBSS network
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
-					  struct net_device *dev)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	tCsrRoamProfile *pRoamProfile;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	int status;
-	CDF_STATUS hal_status;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_LEAVE_IBSS,
-			 pAdapter->sessionId,
-			 eCSR_DISCONNECT_REASON_IBSS_LEAVE));
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return status;
-
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-	if (NULL == pWextState) {
-		hddLog(LOGE, FL("Data Storage Corruption"));
-		return -EIO;
-	}
-
-	pRoamProfile = &pWextState->roamProfile;
-
-	/* Issue disconnect only if interface type is set to IBSS */
-	if (eCSR_BSS_TYPE_START_IBSS != pRoamProfile->BSSType) {
-		hddLog(LOGE,
-		       FL("BSS Type is not set to IBSS"));
-		return -EINVAL;
-	}
-
-	/* Issue Disconnect request */
-	INIT_COMPLETION(pAdapter->disconnect_comp_var);
-	hal_status = sme_roam_disconnect(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					 pAdapter->sessionId,
-					 eCSR_DISCONNECT_REASON_IBSS_LEAVE);
-	if (!CDF_IS_STATUS_SUCCESS(hal_status)) {
-		hddLog(LOGE,
-		       FL("sme_roam_disconnect failed hal_status(%d)"),
-		       hal_status);
-		return -EAGAIN;
-	}
-
-	/* wait for mc thread to cleanup and then return to upper stack
-	 * so by the time upper layer calls the change interface, we are
-	 * all set to proceed further
-	 */
-	rc = wait_for_completion_timeout(&pAdapter->disconnect_comp_var,
-			msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
-	if (!rc) {
-		hdd_err("Failed to disconnect, timed out");
-		return -ETIMEDOUT;
-	}
-
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_leave_ibss() - leave ibss
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- *
- * This function is used to leave an IBSS network
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
-					struct net_device *dev)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_leave_ibss(wiphy, dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_wiphy_params() - set wiphy parameters
- * @wiphy: Pointer to wiphy
- * @changed: Parameters changed
- *
- * This function is used to set the phy parameters. RTS Threshold/FRAG
- * Threshold/Retry Count etc.
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy,
-						u32 changed)
-{
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	tHalHandle hHal = pHddCtx->hHal;
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_WIPHY_PARAMS,
-			 NO_SESSION, wiphy->rts_threshold));
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
-		u32 rts_threshold = (wiphy->rts_threshold == -1) ?
-				    WNI_CFG_RTS_THRESHOLD_STAMAX : wiphy->rts_threshold;
-
-		if ((WNI_CFG_RTS_THRESHOLD_STAMIN > rts_threshold) ||
-		    (WNI_CFG_RTS_THRESHOLD_STAMAX < rts_threshold)) {
-			hddLog(LOGE,
-				FL("Invalid RTS Threshold value %u"),
-				rts_threshold);
-			return -EINVAL;
-		}
-
-		if (0 != sme_cfg_set_int(hHal, WNI_CFG_RTS_THRESHOLD,
-					rts_threshold)) {
-			hddLog(LOGE,
-				FL("sme_cfg_set_int failed for rts_threshold value %u"),
-				rts_threshold);
-			return -EIO;
-		}
-
-		hddLog(LOG2, FL("set rts threshold %u"), rts_threshold);
-	}
-
-	if (changed & WIPHY_PARAM_FRAG_THRESHOLD) {
-		u16 frag_threshold = (wiphy->frag_threshold == -1) ?
-				     WNI_CFG_FRAGMENTATION_THRESHOLD_STAMAX :
-				     wiphy->frag_threshold;
-
-		if ((WNI_CFG_FRAGMENTATION_THRESHOLD_STAMIN > frag_threshold) ||
-		    (WNI_CFG_FRAGMENTATION_THRESHOLD_STAMAX < frag_threshold)) {
-			hddLog(LOGE,
-				FL("Invalid frag_threshold value %hu"),
-				frag_threshold);
-			return -EINVAL;
-		}
-
-		if (0 != sme_cfg_set_int(hHal, WNI_CFG_FRAGMENTATION_THRESHOLD,
-					 frag_threshold)) {
-			hddLog(LOGE,
-				FL("sme_cfg_set_int failed for frag_threshold value %hu"),
-				frag_threshold);
-			return -EIO;
-		}
-
-		hddLog(LOG2, FL("set frag threshold %hu"), frag_threshold);
-	}
-
-	if ((changed & WIPHY_PARAM_RETRY_SHORT)
-	    || (changed & WIPHY_PARAM_RETRY_LONG)) {
-		u8 retry_value = (changed & WIPHY_PARAM_RETRY_SHORT) ?
-				 wiphy->retry_short : wiphy->retry_long;
-
-		if ((WNI_CFG_LONG_RETRY_LIMIT_STAMIN > retry_value) ||
-		    (WNI_CFG_LONG_RETRY_LIMIT_STAMAX < retry_value)) {
-			hddLog(LOGE,
-				FL("Invalid Retry count %hu"), retry_value);
-			return -EINVAL;
-		}
-
-		if (changed & WIPHY_PARAM_RETRY_SHORT) {
-			if (0 != sme_cfg_set_int(hHal,
-						WNI_CFG_LONG_RETRY_LIMIT,
-						retry_value)) {
-				hddLog(LOGE,
-					FL("sme_cfg_set_int failed for long retry count %hu"),
-					retry_value);
-				return -EIO;
-			}
-			hddLog(LOG2,
-				FL("set long retry count %hu"), retry_value);
-		} else if (changed & WIPHY_PARAM_RETRY_SHORT) {
-			if (0 != sme_cfg_set_int(hHal,
-						WNI_CFG_SHORT_RETRY_LIMIT,
-						retry_value)) {
-				hddLog(LOGE,
-					FL("sme_cfg_set_int failed for short retry count %hu"),
-					retry_value);
-				return -EIO;
-			}
-			hddLog(LOG2,
-			       FL("set short retry count %hu"), retry_value);
-		}
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_wiphy_params() - set wiphy parameters
- * @wiphy: Pointer to wiphy
- * @changed: Parameters changed
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_wiphy_params(wiphy, changed);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_set_default_mgmt_key() - dummy implementation of set default mgmt
- *				     key
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @key_index: Key index
- *
- * Return: 0
- */
-static int __wlan_hdd_set_default_mgmt_key(struct wiphy *wiphy,
-					 struct net_device *netdev,
-					 u8 key_index)
-{
-	ENTER();
-	return 0;
-}
-
-/**
- * wlan_hdd_set_default_mgmt_key() - SSR wrapper for
- *				wlan_hdd_set_default_mgmt_key
- * @wiphy: pointer to wiphy
- * @netdev: pointer to net_device structure
- * @key_index: key index
- *
- * Return: 0 on success, error number on failure
- */
-static int wlan_hdd_set_default_mgmt_key(struct wiphy *wiphy,
-					   struct net_device *netdev,
-					   u8 key_index)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_set_default_mgmt_key(wiphy, netdev, key_index);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_set_txq_params() - dummy implementation of set tx queue params
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @params: Pointer to tx queue parameters
- *
- * Return: 0
- */
-static int __wlan_hdd_set_txq_params(struct wiphy *wiphy,
-				   struct net_device *dev,
-				   struct ieee80211_txq_params *params)
-{
-	ENTER();
-	return 0;
-}
-
-/**
- * wlan_hdd_set_txq_params() - SSR wrapper for wlan_hdd_set_txq_params
- * @wiphy: pointer to wiphy
- * @netdev: pointer to net_device structure
- * @params: pointer to ieee80211_txq_params
- *
- * Return: 0 on success, error number on failure
- */
-static int wlan_hdd_set_txq_params(struct wiphy *wiphy,
-				   struct net_device *dev,
-				   struct ieee80211_txq_params *params)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_set_txq_params(wiphy, dev, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_del_station() - delete station v2
- * @wiphy: Pointer to wiphy
- * @param: Pointer to delete station parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static
-int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				    struct net_device *dev,
-				    struct tagCsrDelStaParams *pDelStaParams)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	hdd_hostapd_state_t *hapd_state;
-	int status;
-	uint8_t staId;
-	uint8_t *mac;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_DEL_STA,
-			 pAdapter->sessionId, pAdapter->device_mode));
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	mac = (uint8_t *) pDelStaParams->peerMacAddr.bytes;
-
-	if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_GO == pAdapter->device_mode)) {
-
-		hapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-		if (!hapd_state) {
-			hddLog(LOGE, "%s: Hostapd State is Null", __func__);
-			return 0;
-		}
-
-		if (cdf_is_macaddr_broadcast((struct cdf_mac_addr *) mac)) {
-			uint16_t i;
-			for (i = 0; i < WLAN_MAX_STA_COUNT; i++) {
-				if ((pAdapter->aStaInfo[i].isUsed) &&
-				    (!pAdapter->aStaInfo[i].
-				     isDeauthInProgress)) {
-					cdf_mem_copy(
-						mac,
-						pAdapter->aStaInfo[i].
-							macAddrSTA.bytes,
-						CDF_MAC_ADDR_SIZE);
-					if (hdd_ipa_uc_is_enabled(pHddCtx)) {
-						hdd_ipa_wlan_evt(pAdapter,
-							pAdapter->
-								 aStaInfo[i].
-								 ucSTAId,
-							WLAN_CLIENT_DISCONNECT,
-							mac);
-					}
-					hddLog(LOG1,
-					       FL("Delete STA with MAC::"
-						  MAC_ADDRESS_STR),
-					       MAC_ADDR_ARRAY(mac));
-
-					if (pHddCtx->dev_dfs_cac_status ==
-							DFS_CAC_IN_PROGRESS)
-						goto fn_end;
-
-					cdf_event_reset(&hapd_state->cdf_event);
-					hdd_softap_sta_disassoc(pAdapter,
-								mac);
-					cdf_status =
-						hdd_softap_sta_deauth(pAdapter,
-							pDelStaParams);
-					if (CDF_IS_STATUS_SUCCESS(cdf_status)) {
-						pAdapter->aStaInfo[i].
-						isDeauthInProgress = true;
-						cdf_status =
-							cdf_wait_single_event(
-								&hapd_state->cdf_event,
-								1000);
-						if (!CDF_IS_STATUS_SUCCESS(
-								cdf_status))
-							hddLog(LOGE,
-								"%s: Deauth wait time expired",
-								__func__);
-					}
-				}
-			}
-		} else {
-			cdf_status =
-				hdd_softap_get_sta_id(pAdapter,
-					      (struct cdf_mac_addr *) mac,
-					      &staId);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				hddLog(LOG1,
-				       FL("Skip DEL STA as this is not used::"
-					  MAC_ADDRESS_STR),
-				       MAC_ADDR_ARRAY(mac));
-				return -ENOENT;
-			}
-
-			if (hdd_ipa_uc_is_enabled(pHddCtx)) {
-				hdd_ipa_wlan_evt(pAdapter, staId,
-						 WLAN_CLIENT_DISCONNECT, mac);
-			}
-
-			if (pAdapter->aStaInfo[staId].isDeauthInProgress ==
-			    true) {
-				hddLog(LOG1,
-				       FL("Skip DEL STA as deauth is in progress::"
-					  MAC_ADDRESS_STR),
-					  MAC_ADDR_ARRAY(mac));
-				return -ENOENT;
-			}
-
-			pAdapter->aStaInfo[staId].isDeauthInProgress = true;
-
-			hddLog(LOG1,
-			       FL("Delete STA with MAC::" MAC_ADDRESS_STR),
-			       MAC_ADDR_ARRAY(mac));
-
-			/* Case: SAP in ACS selected DFS ch and client connected
-			 * Now Radar detected. Then if random channel is another
-			 * DFS ch then new CAC is initiated and no TX allowed.
-			 * So do not send any mgmt frames as it will timeout
-			 * during CAC.
-			 */
-
-			if (pHddCtx->dev_dfs_cac_status == DFS_CAC_IN_PROGRESS)
-				goto fn_end;
-
-			cdf_event_reset(&hapd_state->cdf_event);
-			hdd_softap_sta_disassoc(pAdapter, mac);
-			cdf_status = hdd_softap_sta_deauth(pAdapter,
-							   pDelStaParams);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				pAdapter->aStaInfo[staId].isDeauthInProgress =
-					false;
-				hddLog(LOG1,
-				       FL("STA removal failed for ::"
-					  MAC_ADDRESS_STR),
-				       MAC_ADDR_ARRAY(mac));
-				return -ENOENT;
-			} else {
-				cdf_status = cdf_wait_single_event(
-							&hapd_state->cdf_event,
-							1000);
-				if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-					hddLog(LOGE,
-						"%s: Deauth wait time expired",
-						__func__);
-			}
-		}
-	}
-
-fn_end:
-	EXIT();
-	return 0;
-}
-
-#ifdef CFG80211_DEL_STA_V2
-/**
- * wlan_hdd_cfg80211_del_station() - delete station v2
- * @wiphy: Pointer to wiphy
- * @param: Pointer to delete station parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  struct station_del_parameters *param)
-#else
-/**
- * wlan_hdd_cfg80211_del_station() - delete station
- * @wiphy: Pointer to wiphy
- * @mac: Pointer to station mac address
- *
- * Return: 0 for success, non-zero for failure
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  const uint8_t *mac)
-#else
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  uint8_t *mac)
-#endif
-#endif
-{
-	int ret;
-	struct tagCsrDelStaParams delStaParams;
-
-	cds_ssr_protect(__func__);
-#ifdef CFG80211_DEL_STA_V2
-	if (NULL == param) {
-		hddLog(LOGE, FL("Invalid argumet passed"));
-		return -EINVAL;
-	}
-	wlansap_populate_del_sta_params(param->mac, param->reason_code,
-					param->subtype, &delStaParams);
-#else
-	wlansap_populate_del_sta_params(mac, eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
-					(SIR_MAC_MGMT_DEAUTH >> 4),
-					&delStaParams);
-#endif
-	ret = __wlan_hdd_cfg80211_del_station(wiphy, dev, &delStaParams);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_add_station() - add station
- * @wiphy: Pointer to wiphy
- * @mac: Pointer to station mac address
- * @pmksa: Pointer to add station parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
-					   struct net_device *dev,
-					   const uint8_t *mac,
-					   struct station_parameters *params)
-{
-	int status = -EPERM;
-#ifdef FEATURE_WLAN_TDLS
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	u32 mask, set;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_ADD_STA,
-			 pAdapter->sessionId, params->listen_interval));
-
-	if (0 != wlan_hdd_validate_context(pHddCtx))
-		return -EINVAL;
-
-	mask = params->sta_flags_mask;
-
-	set = params->sta_flags_set;
-
-	hddLog(LOG1, FL("mask 0x%x set 0x%x " MAC_ADDRESS_STR), mask, set,
-		MAC_ADDR_ARRAY(mac));
-
-	if (mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
-		if (set & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
-			status =
-				wlan_hdd_tdls_add_station(wiphy, dev, mac, 0, NULL);
-		}
-	}
-#endif
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_add_station() - add station
- * @wiphy: Pointer to wiphy
- * @mac: Pointer to station mac address
- * @pmksa: Pointer to add station parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
-					 struct net_device *dev,
-					 const uint8_t *mac,
-					 struct station_parameters *params)
-#else
-static int wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
-					 struct net_device *dev, uint8_t *mac,
-					 struct station_parameters *params)
-#endif
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_add_station(wiphy, dev, mac, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_pmksa() - set pmksa
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @pmksa: Pointer to set pmksa parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy,
-					 struct net_device *dev,
-					 struct cfg80211_pmksa *pmksa)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	tHalHandle halHandle;
-	CDF_STATUS result = CDF_STATUS_SUCCESS;
-	int status;
-	tPmkidCacheInfo pmk_id;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	if (!pmksa) {
-		hddLog(LOGE, FL("pmksa is NULL"));
-		return -EINVAL;
-	}
-
-	if (!pmksa->bssid || !pmksa->pmkid) {
-		hddLog(LOGE, FL("pmksa->bssid(%p) or pmksa->pmkid(%p) is NULL"),
-		       pmksa->bssid, pmksa->pmkid);
-		return -EINVAL;
-	}
-
-	hddLog(LOGW, FL("set PMKSA for " MAC_ADDRESS_STR),
-		MAC_ADDR_ARRAY(pmksa->bssid));
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
-
-	cdf_mem_copy(pmk_id.BSSID.bytes, pmksa->bssid, CDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(pmk_id.PMKID, pmksa->pmkid, CSR_RSN_PMKID_SIZE);
-
-	/* Add to the PMKSA ID Cache in CSR */
-	result = sme_roam_set_pmkid_cache(halHandle, pAdapter->sessionId,
-					  &pmk_id, 1, false);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_PMKSA,
-			 pAdapter->sessionId, result));
-
-	EXIT();
-	return CDF_IS_STATUS_SUCCESS(result) ? 0 : -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_set_pmksa() - set pmksa
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @pmksa: Pointer to set pmksa parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy,
-				       struct net_device *dev,
-				       struct cfg80211_pmksa *pmksa)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_pmksa(wiphy, dev, pmksa);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_del_pmksa() - delete pmksa
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @pmksa: Pointer to pmksa parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,
-					 struct net_device *dev,
-					 struct cfg80211_pmksa *pmksa)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	tHalHandle halHandle;
-	int status = 0;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	if (!pmksa) {
-		hddLog(LOGE, FL("pmksa is NULL"));
-		return -EINVAL;
-	}
-
-	if (!pmksa->bssid) {
-		hddLog(LOGE, FL("pmksa->bssid is NULL"));
-		return -EINVAL;
-	}
-
-	hddLog(CDF_TRACE_LEVEL_DEBUG, FL("Deleting PMKSA for " MAC_ADDRESS_STR),
-	       MAC_ADDR_ARRAY(pmksa->bssid));
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_DEL_PMKSA,
-			 pAdapter->sessionId, 0));
-	/* Delete the PMKID CSR cache */
-	if (CDF_STATUS_SUCCESS !=
-	    sme_roam_del_pmkid_from_cache(halHandle,
-					  pAdapter->sessionId, pmksa->bssid,
-					  false)) {
-		hddLog(LOGE, FL("Failed to delete PMKSA for " MAC_ADDRESS_STR),
-		       MAC_ADDR_ARRAY(pmksa->bssid));
-		status = -EINVAL;
-	}
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_del_pmksa() - delete pmksa
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @pmksa: Pointer to pmksa parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,
-				       struct net_device *dev,
-				       struct cfg80211_pmksa *pmksa)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_del_pmksa(wiphy, dev, pmksa);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-
-}
-
-/**
- * __wlan_hdd_cfg80211_flush_pmksa() - flush pmksa
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy,
-					   struct net_device *dev)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	tHalHandle halHandle;
-	int status = 0;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	hddLog(LOGW, FL("Flushing PMKSA"));
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	/* Retrieve halHandle */
-	halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
-
-	/* Flush the PMKID cache in CSR */
-	if (CDF_STATUS_SUCCESS !=
-	    sme_roam_del_pmkid_from_cache(halHandle, pAdapter->sessionId, NULL,
-					  true)) {
-		hddLog(LOGE, FL("Cannot flush PMKIDCache"));
-		status = -EINVAL;
-	}
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_flush_pmksa() - flush pmksa
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy,
-					 struct net_device *dev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_flush_pmksa(wiphy, dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#if defined(WLAN_FEATURE_VOWIFI_11R) && defined(KERNEL_SUPPORT_11R_CFG80211)
-/**
- * __wlan_hdd_cfg80211_update_ft_ies() - update fast transition ies
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @ftie: Pointer to fast transition ie parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int
-__wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  struct cfg80211_update_ft_ies_params *ftie)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	int status;
-
-	ENTER();
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (status)
-		return status;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES,
-			 pAdapter->sessionId, pHddStaCtx->conn_info.connState));
-	/* Added for debug on reception of Re-assoc Req. */
-	if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
-		hddLog(LOGE,
-		       FL("Called with Ie of length = %zu when not associated"),
-		       ftie->ie_len);
-		hddLog(LOGE, FL("Should be Re-assoc Req IEs"));
-	}
-#ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
-	hddLog(LOG1, FL("%s called with Ie of length = %zu"), __func__,
-	       ftie->ie_len);
-#endif
-
-	/* Pass the received FT IEs to SME */
-	sme_set_ft_ies(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId,
-		       (const u8 *)ftie->ie, ftie->ie_len);
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_update_ft_ies() - update fast transition ies
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @ftie: Pointer to fast transition ie parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int
-wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy,
-				struct net_device *dev,
-				struct cfg80211_update_ft_ies_params *ftie)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_update_ft_ies(wiphy, dev, ftie);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-#endif
-
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-/**
- * wlan_hdd_cfg80211_update_replay_counter_callback() - replay counter callback
- * @callbackContext: Callback context
- * @pGtkOffloadGetInfoRsp: Pointer to gtk offload response parameter
- *
- * Callback rountine called upon receiving response for get offload info
- *
- * Return: none
- */
-void wlan_hdd_cfg80211_update_replay_counter_callback(void *callbackContext,
-						tpSirGtkOffloadGetInfoRspParams
-						pGtkOffloadGetInfoRsp)
-{
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) callbackContext;
-	uint8_t tempReplayCounter[8];
-	hdd_station_ctx_t *pHddStaCtx;
-
-	ENTER();
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("HDD adapter is Null"));
-		return;
-	}
-
-	if (NULL == pGtkOffloadGetInfoRsp) {
-		hddLog(LOGE, FL("pGtkOffloadGetInfoRsp is Null"));
-		return;
-	}
-
-	if (CDF_STATUS_SUCCESS != pGtkOffloadGetInfoRsp->ulStatus) {
-		hddLog(LOGE, FL("wlan Failed to get replay counter value"));
-		return;
-	}
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	/* Update replay counter */
-	pHddStaCtx->gtkOffloadReqParams.ullKeyReplayCounter =
-		pGtkOffloadGetInfoRsp->ullKeyReplayCounter;
-
-	{
-		/* changing from little to big endian since supplicant
-		 * works on big endian format
-		 */
-		int i;
-		uint8_t *p =
-			(uint8_t *) &pGtkOffloadGetInfoRsp->ullKeyReplayCounter;
-
-		for (i = 0; i < 8; i++) {
-			tempReplayCounter[7 - i] = (uint8_t) p[i];
-		}
-	}
-
-	/* Update replay counter to NL */
-	cfg80211_gtk_rekey_notify(pAdapter->dev,
-				  pGtkOffloadGetInfoRsp->bssid.bytes,
-				  tempReplayCounter, GFP_KERNEL);
-}
-
-/**
- * __wlan_hdd_cfg80211_set_rekey_data() - set rekey data
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @data: Pointer to rekey data
- *
- * This function is used to offload GTK rekeying job to the firmware.
- *
- * Return: 0 for success, non-zero for failure
- */
-int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
-				       struct net_device *dev,
-				       struct cfg80211_gtk_rekey_data *data)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	hdd_station_ctx_t *pHddStaCtx;
-	tHalHandle hHal;
-	int result;
-	tSirGtkOffloadParams hddGtkOffloadReqParams;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_REKEY_DATA,
-			 pAdapter->sessionId, pAdapter->device_mode));
-
-	result = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != result)
-		return result;
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	if (NULL == hHal) {
-		hddLog(LOGE, FL("HAL context is Null!!!"));
-		return -EAGAIN;
-	}
-
-	pHddStaCtx->gtkOffloadReqParams.ulFlags = GTK_OFFLOAD_ENABLE;
-	memcpy(pHddStaCtx->gtkOffloadReqParams.aKCK, data->kck,
-	       NL80211_KCK_LEN);
-	memcpy(pHddStaCtx->gtkOffloadReqParams.aKEK, data->kek,
-	       NL80211_KEK_LEN);
-	cdf_copy_macaddr(&pHddStaCtx->gtkOffloadReqParams.bssid,
-			 &pHddStaCtx->conn_info.bssId);
-	{
-		/* changing from big to little endian since driver
-		 * works on little endian format
-		 */
-		uint8_t *p =
-			(uint8_t *) &pHddStaCtx->gtkOffloadReqParams.
-			ullKeyReplayCounter;
-		int i;
-
-		for (i = 0; i < 8; i++) {
-			p[7 - i] = data->replay_ctr[i];
-		}
-	}
-
-	if (true == pHddCtx->hdd_wlan_suspended) {
-		/* if wlan is suspended, enable GTK offload directly from here */
-		memcpy(&hddGtkOffloadReqParams,
-		       &pHddStaCtx->gtkOffloadReqParams,
-		       sizeof(tSirGtkOffloadParams));
-		status =
-			sme_set_gtk_offload(hHal, &hddGtkOffloadReqParams,
-					    pAdapter->sessionId);
-
-		if (CDF_STATUS_SUCCESS != status) {
-			hddLog(LOGE, FL("sme_set_gtk_offload failed, status(%d)"),
-			       status);
-			return -EINVAL;
-		}
-		hddLog(LOG1, FL("sme_set_gtk_offload successful"));
-	} else {
-		hddLog(LOG1,
-		       FL("wlan not suspended GTKOffload request is stored"));
-	}
-	EXIT();
-	return result;
-}
-
-/**
- * wlan_hdd_cfg80211_set_rekey_data() - set rekey data
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @data: Pointer to rekey data
- *
- * This function is used to offload GTK rekeying job to the firmware.
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
-				     struct net_device *dev,
-				     struct cfg80211_gtk_rekey_data *data)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_rekey_data(wiphy, dev, data);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-#endif /*WLAN_FEATURE_GTK_OFFLOAD */
-
-/**
- * __wlan_hdd_cfg80211_set_mac_acl() - set access control policy
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @param: Pointer to access control parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
-					 struct net_device *dev,
-					 const struct cfg80211_acl_data *params)
-{
-	int i;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_hostapd_state_t *pHostapdState;
-	tsap_Config_t *pConfig;
-	v_CONTEXT_t p_cds_context = NULL;
-	hdd_context_t *pHddCtx;
-	int status;
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	if (NULL == params) {
-		hddLog(LOGE, FL("params is Null"));
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	p_cds_context = pHddCtx->pcds_context;
-	pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-
-	if (NULL == pHostapdState) {
-		hddLog(LOGE, FL("pHostapdState is Null"));
-		return -EINVAL;
-	}
-
-	hddLog(LOGE, "acl policy: = %d no acl entries = %d", params->acl_policy,
-		params->n_acl_entries);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_MAC_ACL,
-			 pAdapter->sessionId, pAdapter->device_mode));
-	if (WLAN_HDD_SOFTAP == pAdapter->device_mode) {
-		pConfig = &pAdapter->sessionCtx.ap.sapConfig;
-
-		/* default value */
-		pConfig->num_accept_mac = 0;
-		pConfig->num_deny_mac = 0;
-
-		/**
-		 * access control policy
-		 * @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are
-		 *   listed in hostapd.deny file.
-		 * @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow stations which are
-		 *   listed in hostapd.accept file.
-		 */
-		if (NL80211_ACL_POLICY_DENY_UNLESS_LISTED == params->acl_policy) {
-			pConfig->SapMacaddr_acl = eSAP_DENY_UNLESS_ACCEPTED;
-		} else if (NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED ==
-			   params->acl_policy) {
-			pConfig->SapMacaddr_acl = eSAP_ACCEPT_UNLESS_DENIED;
-		} else {
-			hddLog(LOGE, FL("Acl Policy : %d is not supported"),
-				params->acl_policy);
-			return -ENOTSUPP;
-		}
-
-		if (eSAP_DENY_UNLESS_ACCEPTED == pConfig->SapMacaddr_acl) {
-			pConfig->num_accept_mac = params->n_acl_entries;
-			for (i = 0; i < params->n_acl_entries; i++) {
-				hddLog(LOG1,
-					FL("** Add ACL MAC entry %i in WhiletList :"
-					MAC_ADDRESS_STR), i,
-					MAC_ADDR_ARRAY(
-						params->mac_addrs[i].addr));
-
-				cdf_mem_copy(&pConfig->accept_mac[i],
-					     params->mac_addrs[i].addr,
-					     sizeof(qcmacaddr));
-			}
-		} else if (eSAP_ACCEPT_UNLESS_DENIED == pConfig->SapMacaddr_acl) {
-			pConfig->num_deny_mac = params->n_acl_entries;
-			for (i = 0; i < params->n_acl_entries; i++) {
-				hddLog(LOG1,
-					FL("** Add ACL MAC entry %i in BlackList :"
-					MAC_ADDRESS_STR), i,
-					MAC_ADDR_ARRAY(
-						params->mac_addrs[i].addr));
-
-				cdf_mem_copy(&pConfig->deny_mac[i],
-					     params->mac_addrs[i].addr,
-					     sizeof(qcmacaddr));
-			}
-		}
-#ifdef WLAN_FEATURE_MBSSID
-		cdf_status =
-			wlansap_set_mac_acl(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
-					    pConfig);
-#else
-		cdf_status = wlansap_set_mac_acl(p_cds_context, pConfig);
-#endif
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOGE, FL("SAP Set Mac Acl fail"));
-			return -EINVAL;
-		}
-	} else {
-		hddLog(LOG1, FL("Invalid device_mode %s(%d)"),
-			hdd_device_mode_to_string(pAdapter->device_mode),
-			pAdapter->device_mode);
-		return -EINVAL;
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_mac_acl() - SSR wrapper for
- *				__wlan_hdd_cfg80211_set_mac_acl
- * @wiphy: pointer to wiphy structure
- * @dev: pointer to net_device
- * @params: pointer to cfg80211_acl_data
- *
- * Return; 0 on success, error number otherwise
- */
-static int
-wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy,
-			      struct net_device *dev,
-			      const struct cfg80211_acl_data *params)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_mac_acl(wiphy, dev, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#ifdef WLAN_NL80211_TESTMODE
-#ifdef FEATURE_WLAN_LPHB
-/**
- * wlan_hdd_cfg80211_lphb_ind_handler() - handle low power heart beat indication
- * @pHddCtx: Pointer to hdd context
- * @lphbInd: Pointer to low power heart beat indication parameter
- *
- * Return: none
- */
-void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx, tSirLPHBInd *lphbInd)
-{
-	struct sk_buff *skb;
-
-	hddLog(LOGE, FL("LPHB indication arrived"));
-
-	if (0 != wlan_hdd_validate_context((hdd_context_t *) pHddCtx))
-		return;
-
-	if (NULL == lphbInd) {
-		hddLog(LOGE, FL("invalid argument lphbInd"));
-		return;
-	}
-
-	skb = cfg80211_testmode_alloc_event_skb(((hdd_context_t *) pHddCtx)->
-						wiphy, sizeof(tSirLPHBInd),
-						GFP_ATOMIC);
-	if (!skb) {
-		hddLog(LOGE, FL("LPHB timeout, NL buffer alloc fail"));
-		return;
-	}
-
-	if (nla_put_u32(skb, WLAN_HDD_TM_ATTR_CMD, WLAN_HDD_TM_CMD_WLAN_HB)) {
-		hddLog(LOGE, FL("WLAN_HDD_TM_ATTR_CMD put fail"));
-		goto nla_put_failure;
-	}
-	if (nla_put_u32(skb, WLAN_HDD_TM_ATTR_TYPE, lphbInd->protocolType)) {
-		hddLog(LOGE, FL("WLAN_HDD_TM_ATTR_TYPE put fail"));
-		goto nla_put_failure;
-	}
-	if (nla_put(skb, WLAN_HDD_TM_ATTR_DATA, sizeof(tSirLPHBInd), lphbInd)) {
-		hddLog(LOGE, FL("WLAN_HDD_TM_ATTR_DATA put fail"));
-		goto nla_put_failure;
-	}
-	cfg80211_testmode_event(skb, GFP_ATOMIC);
-	return;
-
-nla_put_failure:
-	hddLog(LOGE, FL("NLA Put fail"));
-	kfree_skb(skb);
-
-	return;
-}
-#endif /* FEATURE_WLAN_LPHB */
-
-/**
- * __wlan_hdd_cfg80211_testmode() - test mode
- * @wiphy: Pointer to wiphy
- * @data: Data pointer
- * @len: Data length
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
-					void *data, int len)
-{
-	struct nlattr *tb[WLAN_HDD_TM_ATTR_MAX + 1];
-	int err;
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-
-	ENTER();
-
-	err = wlan_hdd_validate_context(pHddCtx);
-	if (err)
-		return err;
-
-	err = nla_parse(tb, WLAN_HDD_TM_ATTR_MAX, data,
-			len, wlan_hdd_tm_policy);
-	if (err) {
-		hddLog(LOGE, FL("Testmode INV ATTR"));
-		return err;
-	}
-
-	if (!tb[WLAN_HDD_TM_ATTR_CMD]) {
-		hddLog(LOGE, FL("Testmode INV CMD"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_TESTMODE,
-			 NO_SESSION, nla_get_u32(tb[WLAN_HDD_TM_ATTR_CMD])));
-	switch (nla_get_u32(tb[WLAN_HDD_TM_ATTR_CMD])) {
-#ifdef FEATURE_WLAN_LPHB
-	/* Low Power Heartbeat configuration request */
-	case WLAN_HDD_TM_CMD_WLAN_HB:
-	{
-		int buf_len;
-		void *buf;
-		tSirLPHBReq *hb_params = NULL;
-		tSirLPHBReq *hb_params_temp = NULL;
-		CDF_STATUS smeStatus;
-
-		if (!tb[WLAN_HDD_TM_ATTR_DATA]) {
-			hddLog(LOGE, FL("Testmode INV DATA"));
-			return -EINVAL;
-		}
-
-		buf = nla_data(tb[WLAN_HDD_TM_ATTR_DATA]);
-		buf_len = nla_len(tb[WLAN_HDD_TM_ATTR_DATA]);
-
-		hb_params_temp = (tSirLPHBReq *) buf;
-		if ((hb_params_temp->cmd == LPHB_SET_TCP_PARAMS_INDID)
-		    && (hb_params_temp->params.lphbTcpParamReq.
-			timePeriodSec == 0))
-			return -EINVAL;
-
-		hb_params =
-			(tSirLPHBReq *) cdf_mem_malloc(sizeof(tSirLPHBReq));
-		if (NULL == hb_params) {
-			hddLog(LOGE, FL("Request Buffer Alloc Fail"));
-			return -ENOMEM;
-		}
-
-		cdf_mem_copy(hb_params, buf, buf_len);
-		smeStatus =
-			sme_lphb_config_req((tHalHandle) (pHddCtx->hHal),
-					    hb_params,
-					    wlan_hdd_cfg80211_lphb_ind_handler);
-		if (CDF_STATUS_SUCCESS != smeStatus) {
-			hddLog(LOGE, "LPHB Config Fail, disable");
-			cdf_mem_free(hb_params);
-		}
-		return 0;
-	}
-#endif /* FEATURE_WLAN_LPHB */
-
-#if  defined(QCA_WIFI_FTM)
-	case WLAN_HDD_TM_CMD_WLAN_FTM:
-	{
-		int buf_len;
-		void *buf;
-		CDF_STATUS status;
-		if (!tb[WLAN_HDD_TM_ATTR_DATA]) {
-			hddLog(LOGE,
-			       FL
-				       ("WLAN_HDD_TM_ATTR_DATA attribute is invalid"));
-			return -EINVAL;
-		}
-
-		buf = nla_data(tb[WLAN_HDD_TM_ATTR_DATA]);
-		buf_len = nla_len(tb[WLAN_HDD_TM_ATTR_DATA]);
-
-		pr_info("****FTM Tx cmd len = %d*****\n", buf_len);
-
-		status = wlan_hdd_ftm_testmode_cmd(buf, buf_len);
-
-		if (status != CDF_STATUS_SUCCESS)
-			err = -EBUSY;
-		break;
-	}
-#endif
-
-	default:
-		hddLog(LOGE, FL("command %d not supported"),
-		       nla_get_u32(tb[WLAN_HDD_TM_ATTR_CMD]));
-		return -EOPNOTSUPP;
-	}
-	EXIT();
-	return err;
-}
-
-/**
- * wlan_hdd_cfg80211_testmode() - test mode
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @data: Data pointer
- * @len: Data length
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-				      struct wireless_dev *wdev,
-#endif
-				      void *data, int len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_testmode(wiphy, data, len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#if  defined(QCA_WIFI_FTM)
-/**
- * wlan_hdd_testmode_rx_event() - test mode rx event handler
- * @buf: Pointer to buffer
- * @buf_len: Buffer length
- *
- * Return: none
- */
-void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len)
-{
-	struct sk_buff *skb;
-	hdd_context_t *hdd_ctx;
-
-	if (!buf || !buf_len) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: buf or buf_len invalid, buf = %p buf_len = %zu",
-			  __func__, buf, buf_len);
-		return;
-	}
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: hdd context invalid", __func__);
-		return;
-	}
-
-	skb = cfg80211_testmode_alloc_event_skb(hdd_ctx->wiphy,
-						buf_len, GFP_KERNEL);
-	if (!skb) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to allocate testmode rx skb!", __func__);
-		return;
-	}
-
-	if (nla_put_u32(skb, WLAN_HDD_TM_ATTR_CMD, WLAN_HDD_TM_CMD_WLAN_FTM) ||
-	    nla_put(skb, WLAN_HDD_TM_ATTR_DATA, buf_len, buf))
-		goto nla_put_failure;
-
-	pr_info("****FTM Rx cmd len = %zu*****\n", buf_len);
-
-	cfg80211_testmode_event(skb, GFP_KERNEL);
-	return;
-
-nla_put_failure:
-	kfree_skb(skb);
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		  "%s: nla_put failed on testmode rx skb!", __func__);
-}
-#endif
-#endif /* CONFIG_NL80211_TESTMODE */
-
-#ifdef QCA_HT_2040_COEX
-/**
- * __wlan_hdd_cfg80211_set_ap_channel_width() - set ap channel bandwidth
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @chandef: Pointer to channel definition parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int
-__wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy,
-					 struct net_device *dev,
-					 struct cfg80211_chan_def *chandef)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	CDF_STATUS status;
-	tSmeConfigParams sme_config;
-	bool cbModeChange;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return status;
-	}
-
-	cdf_mem_zero(&sme_config, sizeof(tSmeConfigParams));
-	sme_get_config_param(pHddCtx->hHal, &sme_config);
-	switch (chandef->width) {
-	case NL80211_CHAN_WIDTH_20:
-		if (sme_config.csrConfig.channelBondingMode24GHz !=
-		    eCSR_INI_SINGLE_CHANNEL_CENTERED) {
-			sme_config.csrConfig.channelBondingMode24GHz =
-				eCSR_INI_SINGLE_CHANNEL_CENTERED;
-			sme_update_config(pHddCtx->hHal, &sme_config);
-			cbModeChange = true;
-		}
-		break;
-
-	case NL80211_CHAN_WIDTH_40:
-		if (sme_config.csrConfig.channelBondingMode24GHz ==
-		    eCSR_INI_SINGLE_CHANNEL_CENTERED) {
-			if (NL80211_CHAN_HT40MINUS ==
-			    cfg80211_get_chandef_type(chandef))
-				sme_config.csrConfig.channelBondingMode24GHz =
-					eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
-			else
-				sme_config.csrConfig.channelBondingMode24GHz =
-					eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
-			sme_update_config(pHddCtx->hHal, &sme_config);
-			cbModeChange = true;
-		}
-		break;
-
-	default:
-		hddLog(LOGE, FL("Error!!! Invalid HT20/40 mode !"));
-		return -EINVAL;
-	}
-
-	if (!cbModeChange)
-		return 0;
-
-	if (WLAN_HDD_SOFTAP != pAdapter->device_mode)
-		return 0;
-
-	hddLog(LOG1, FL("Channel bonding changed to %d"),
-	       sme_config.csrConfig.channelBondingMode24GHz);
-
-	/* Change SAP ht2040 mode */
-	status = hdd_set_sap_ht2040_mode(pAdapter,
-					 cfg80211_get_chandef_type(chandef));
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("Error!!! Cannot set SAP HT20/40 mode!"));
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_ap_channel_width() - set ap channel bandwidth
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @chandef: Pointer to channel definition parameter
- *
- * Return: 0 for success, non-zero for failure
- */
-static int
-wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy,
-				       struct net_device *dev,
-				       struct cfg80211_chan_def *chandef)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_ap_channel_width(wiphy, dev, chandef);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-#endif
-
-#ifdef CHANNEL_SWITCH_SUPPORTED
-/**
- * __wlan_hdd_cfg80211_channel_switch()- function to switch
- * channel in SAP/GO
- * @wiphy:  wiphy pointer
- * @dev: dev pointer.
- * @csa_params: Change channel params
- *
- * This function is called to switch channel in SAP/GO
- *
- * Return: 0 if success else return non zero
- */
-static int __wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
-				struct net_device *dev,
-				struct cfg80211_csa_settings *csa_params)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	uint8_t channel;
-	uint16_t freq;
-	int ret;
-	phy_ch_width ch_width;
-
-	hddLog(LOG1, FL("Set Freq %d"),
-		  csa_params->chandef.chan->center_freq);
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-
-	if (0 != ret)
-		return ret;
-
-	if ((WLAN_HDD_P2P_GO != adapter->device_mode) &&
-		(WLAN_HDD_SOFTAP != adapter->device_mode))
-		return -ENOTSUPP;
-
-	freq = csa_params->chandef.chan->center_freq;
-	channel = cds_freq_to_chan(freq);
-
-	ch_width = hdd_map_nl_chan_width(csa_params->chandef.width);
-
-	ret = hdd_softap_set_channel_change(dev, channel, ch_width);
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_channel_switch()- function to switch
- * channel in SAP/GO
- * @wiphy:  wiphy pointer
- * @dev: dev pointer.
- * @csa_params: Change channel params
- *
- * This function is called to switch channel in SAP/GO
- *
- * Return: 0 if success else return non zero
- */
-static int wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
-				struct net_device *dev,
-				struct cfg80211_csa_settings *csa_params)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_channel_switch(wiphy, dev, csa_params);
-	cds_ssr_unprotect(__func__);
-	return ret;
-}
-#endif
-
-/**
- * wlan_hdd_convert_nl_iftype_to_hdd_type() - provides the type
- * translation from NL to policy manager type
- * @type: Generic connection mode type defined in NL
- *
- *
- * This function provides the type translation
- *
- * Return: cds_con_mode enum
- */
-enum cds_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
-						enum nl80211_iftype type)
-{
-	enum cds_con_mode mode = CDS_MAX_NUM_OF_MODE;
-	switch (type) {
-	case NL80211_IFTYPE_STATION:
-		mode = CDS_STA_MODE;
-		break;
-	case NL80211_IFTYPE_P2P_CLIENT:
-		mode = CDS_P2P_CLIENT_MODE;
-		break;
-	case NL80211_IFTYPE_P2P_GO:
-		mode = CDS_P2P_GO_MODE;
-		break;
-	case NL80211_IFTYPE_AP:
-		mode = CDS_SAP_MODE;
-		break;
-	case NL80211_IFTYPE_ADHOC:
-		mode = CDS_IBSS_MODE;
-		break;
-	default:
-		hddLog(LOGE, FL("Unsupported interface type (%d)"),
-			   type);
-	}
-	return mode;
-}
-
-/**
- * struct cfg80211_ops - cfg80211_ops
- *
- * @add_virtual_intf: Add virtual interface
- * @del_virtual_intf: Delete virtual interface
- * @change_virtual_intf: Change virtual interface
- * @change_station: Change station
- * @add_beacon: Add beacon in sap mode
- * @del_beacon: Delete beacon in sap mode
- * @set_beacon: Set beacon in sap mode
- * @start_ap: Start ap
- * @change_beacon: Change beacon
- * @stop_ap: Stop ap
- * @change_bss: Change bss
- * @add_key: Add key
- * @get_key: Get key
- * @del_key: Delete key
- * @set_default_key: Set default key
- * @set_channel: Set channel
- * @scan: Scan
- * @connect: Connect
- * @disconnect: Disconnect
- * @join_ibss = Join ibss
- * @leave_ibss = Leave ibss
- * @set_wiphy_params = Set wiphy params
- * @set_tx_power = Set tx power
- * @get_tx_power = get tx power
- * @remain_on_channel = Remain on channel
- * @cancel_remain_on_channel = Cancel remain on channel
- * @mgmt_tx = Tx management frame
- * @mgmt_tx_cancel_wait = Cancel management tx wait
- * @set_default_mgmt_key = Set default management key
- * @set_txq_params = Set tx queue parameters
- * @get_station = Get station
- * @set_power_mgmt = Set power management
- * @del_station = Delete station
- * @add_station = Add station
- * @set_pmksa = Set pmksa
- * @del_pmksa = Delete pmksa
- * @flush_pmksa = Flush pmksa
- * @update_ft_ies = Update FT IEs
- * @tdls_mgmt = Tdls management
- * @tdls_oper = Tdls operation
- * @set_rekey_data = Set rekey data
- * @sched_scan_start = Scheduled scan start
- * @sched_scan_stop = Scheduled scan stop
- * @resume = Resume wlan
- * @suspend = Suspend wlan
- * @set_mac_acl = Set mac acl
- * @testmode_cmd = Test mode command
- * @set_ap_chanwidth = Set AP channel bandwidth
- * @dump_survey = Dump survey
- * @key_mgmt_set_pmk = Set pmk key management
- */
-static struct cfg80211_ops wlan_hdd_cfg80211_ops = {
-	.add_virtual_intf = wlan_hdd_add_virtual_intf,
-	.del_virtual_intf = wlan_hdd_del_virtual_intf,
-	.change_virtual_intf = wlan_hdd_cfg80211_change_iface,
-	.change_station = wlan_hdd_change_station,
-	.start_ap = wlan_hdd_cfg80211_start_ap,
-	.change_beacon = wlan_hdd_cfg80211_change_beacon,
-	.stop_ap = wlan_hdd_cfg80211_stop_ap,
-	.change_bss = wlan_hdd_cfg80211_change_bss,
-	.add_key = wlan_hdd_cfg80211_add_key,
-	.get_key = wlan_hdd_cfg80211_get_key,
-	.del_key = wlan_hdd_cfg80211_del_key,
-	.set_default_key = wlan_hdd_cfg80211_set_default_key,
-	.scan = wlan_hdd_cfg80211_scan,
-	.connect = wlan_hdd_cfg80211_connect,
-	.disconnect = wlan_hdd_cfg80211_disconnect,
-	.join_ibss = wlan_hdd_cfg80211_join_ibss,
-	.leave_ibss = wlan_hdd_cfg80211_leave_ibss,
-	.set_wiphy_params = wlan_hdd_cfg80211_set_wiphy_params,
-	.set_tx_power = wlan_hdd_cfg80211_set_txpower,
-	.get_tx_power = wlan_hdd_cfg80211_get_txpower,
-	.remain_on_channel = wlan_hdd_cfg80211_remain_on_channel,
-	.cancel_remain_on_channel = wlan_hdd_cfg80211_cancel_remain_on_channel,
-	.mgmt_tx = wlan_hdd_mgmt_tx,
-	.mgmt_tx_cancel_wait = wlan_hdd_cfg80211_mgmt_tx_cancel_wait,
-	.set_default_mgmt_key = wlan_hdd_set_default_mgmt_key,
-	.set_txq_params = wlan_hdd_set_txq_params,
-	.get_station = wlan_hdd_cfg80211_get_station,
-	.set_power_mgmt = wlan_hdd_cfg80211_set_power_mgmt,
-	.del_station = wlan_hdd_cfg80211_del_station,
-	.add_station = wlan_hdd_cfg80211_add_station,
-	.set_pmksa = wlan_hdd_cfg80211_set_pmksa,
-	.del_pmksa = wlan_hdd_cfg80211_del_pmksa,
-	.flush_pmksa = wlan_hdd_cfg80211_flush_pmksa,
-#if defined(WLAN_FEATURE_VOWIFI_11R) && defined(KERNEL_SUPPORT_11R_CFG80211)
-	.update_ft_ies = wlan_hdd_cfg80211_update_ft_ies,
-#endif
-#ifdef FEATURE_WLAN_TDLS
-	.tdls_mgmt = wlan_hdd_cfg80211_tdls_mgmt,
-	.tdls_oper = wlan_hdd_cfg80211_tdls_oper,
-#endif
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-	.set_rekey_data = wlan_hdd_cfg80211_set_rekey_data,
-#endif /* WLAN_FEATURE_GTK_OFFLOAD */
-#ifdef FEATURE_WLAN_SCAN_PNO
-	.sched_scan_start = wlan_hdd_cfg80211_sched_scan_start,
-	.sched_scan_stop = wlan_hdd_cfg80211_sched_scan_stop,
-#endif /*FEATURE_WLAN_SCAN_PNO */
-	.resume = wlan_hdd_cfg80211_resume_wlan,
-	.suspend = wlan_hdd_cfg80211_suspend_wlan,
-	.set_mac_acl = wlan_hdd_cfg80211_set_mac_acl,
-#ifdef WLAN_NL80211_TESTMODE
-	.testmode_cmd = wlan_hdd_cfg80211_testmode,
-#endif
-#ifdef QCA_HT_2040_COEX
-	.set_ap_chanwidth = wlan_hdd_cfg80211_set_ap_channel_width,
-#endif
-	.dump_survey = wlan_hdd_cfg80211_dump_survey,
-#ifdef CHANNEL_SWITCH_SUPPORTED
-	.channel_switch = wlan_hdd_cfg80211_channel_switch,
-#endif
-};

+ 0 - 2404
core/hdd/src/wlan_hdd_cfg80211.h

@@ -1,2404 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_cfg80211.h
- *
- * WLAN host device driver cfg80211 functions declaration
- */
-
-#if !defined(HDD_CFG80211_H__)
-#define HDD_CFG80211_H__
-
-/* value for initial part of frames and number of bytes to be compared */
-#define GAS_INITIAL_REQ "\x04\x0a"
-#define GAS_INITIAL_REQ_SIZE 2
-
-#define GAS_INITIAL_RSP "\x04\x0b"
-#define GAS_INITIAL_RSP_SIZE 2
-
-#define GAS_COMEBACK_REQ "\x04\x0c"
-#define GAS_COMEBACK_REQ_SIZE 2
-
-#define GAS_COMEBACK_RSP "\x04\x0d"
-#define GAS_COMEBACK_RSP_SIZE 2
-
-#define P2P_PUBLIC_ACTION_FRAME "\x04\x09\x50\x6f\x9a\x09"
-#define P2P_PUBLIC_ACTION_FRAME_SIZE 6
-
-#define P2P_ACTION_FRAME "\x7f\x50\x6f\x9a\x09"
-#define P2P_ACTION_FRAME_SIZE 5
-
-#define SA_QUERY_FRAME_REQ "\x08\x00"
-#define SA_QUERY_FRAME_REQ_SIZE 2
-
-#define SA_QUERY_FRAME_RSP "\x08\x01"
-#define SA_QUERY_FRAME_RSP_SIZE 2
-
-#define HDD_P2P_WILDCARD_SSID "DIRECT-"
-#define HDD_P2P_WILDCARD_SSID_LEN 7
-
-#define WNM_BSS_ACTION_FRAME "\x0a\x07"
-#define WNM_BSS_ACTION_FRAME_SIZE 2
-
-#define WNM_NOTIFICATION_FRAME "\x0a\x1a"
-#define WNM_NOTIFICATION_FRAME_SIZE 2
-
-#define WPA_OUI_TYPE   "\x00\x50\xf2\x01"
-#define BLACKLIST_OUI_TYPE   "\x00\x50\x00\x00"
-#define WHITELIST_OUI_TYPE   "\x00\x50\x00\x01"
-#define WPA_OUI_TYPE_SIZE  4
-#define WMM_OUI_TYPE   "\x00\x50\xf2\x02\x01"
-#define WMM_OUI_TYPE_SIZE  5
-
-#define WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
-#define WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
-#define BASIC_RATE_MASK   0x80
-#define RATE_MASK         0x7f
-
-#ifdef WLAN_ENABLE_AGEIE_ON_SCAN_RESULTS
-/* GPS application requirement */
-#define QCOM_VENDOR_IE_ID 221
-#define QCOM_OUI1         0x00
-#define QCOM_OUI2         0xA0
-#define QCOM_OUI3         0xC6
-#define QCOM_VENDOR_IE_AGE_TYPE  0x100
-#define QCOM_VENDOR_IE_AGE_LEN   (sizeof(qcom_ie_age) - 2)
-
-#ifdef FEATURE_WLAN_TDLS
-#define WLAN_IS_TDLS_SETUP_ACTION(action) \
-	((SIR_MAC_TDLS_SETUP_REQ <= action) && \
-	(SIR_MAC_TDLS_SETUP_CNF >= action))
-#if !defined (TDLS_MGMT_VERSION2)
-#define TDLS_MGMT_VERSION2 0
-#endif
-#endif
-
-#define MAX_CHANNEL (NUM_24GHZ_CHANNELS + NUM_5GHZ_CHANNELS)
-#define MAX_SCAN_SSID 10
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) \
-	|| defined(BACKPORTED_CHANNEL_SWITCH_PRESENT)
-#define CHANNEL_SWITCH_SUPPORTED
-#endif
-
-/**
- * typedef struct qcom_ie_age - age ie
- *
- * @element_id: Element id
- * @len: Length
- * @oui_1: OUI 1
- * @oui_2: OUI 2
- * @oui_3: OUI 3
- * @type: Type
- * @age: Age
- * @tsf_delta: tsf delta from FW
- */
-typedef struct {
-	u8 element_id;
-	u8 len;
-	u8 oui_1;
-	u8 oui_2;
-	u8 oui_3;
-	u32 type;
-	u32 age;
-	u32 tsf_delta;
-} __attribute__ ((packed)) qcom_ie_age;
-#endif
-
-/**
- * enum eDFS_CAC_STATUS: CAC status
- *
- * @DFS_CAC_NEVER_DONE: CAC never done
- * @DFS_CAC_IN_PROGRESS: CAC is in progress
- * @DFS_CAC_IN_PROGRESS: CAC already done
- */
-typedef enum {
-	DFS_CAC_NEVER_DONE,
-	DFS_CAC_IN_PROGRESS,
-	DFS_CAC_ALREADY_DONE,
-} eDFS_CAC_STATUS;
-
-/* Vendor id to be used in vendor specific command and events
- * to user space.
- * NOTE: The authoritative place for definition of QCA_NL80211_VENDOR_ID,
- * vendor subcmd definitions prefixed with QCA_NL80211_VENDOR_SUBCMD, and
- * qca_wlan_vendor_attr is open source file src/common/qca-vendor.h in
- * git://w1.fi/srv/git/hostap.git; the values here are just a copy of that
- */
-
-#define QCA_NL80211_VENDOR_ID           0x001374
-#define MAX_REQUEST_ID			0xFFFFFFFF
-
-/**
- * enum qca_nl80211_vendor_subcmds: NL 80211 vendor sub command
- *
- * @QCA_NL80211_VENDOR_SUBCMD_UNSPEC: Unspecified
- * @QCA_NL80211_VENDOR_SUBCMD_TEST: Test
- * @QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY: Avoid frequency.
- *	Sub commands 2 to 9 are not used
- * @QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY: DFS capability
- * @QCA_NL80211_VENDOR_SUBCMD_NAN: Nan
- * @QCA_NL80211_VENDOR_SUBCMD_STATS_EXT: Ext stats
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET: Link layer stats set
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET: Link layer stats get
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR: Link layer stats clear
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_RADIO_RESULTS: Link layer stats radio
- *	results
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_IFACE_RESULTS: Link layer stats interface
- *	results
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_PEERS_RESULTS: Link layer stats peer
- *	results
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START: Ext scan start
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP: Ext scan stop
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS: Ext scan get valid
- *	channels
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES: Ext scan get capability
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS: Ext scan get cached
- *	results
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE: Ext scan results
- *	available. Used when report_threshold is reached in scan cache.
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT: Ext scan full scan
- *	result. Used to report scan results when each probe rsp. is received,
- *	if report_events enabled in wifi_scan_cmd_params.
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT: Ext scan event from target.
- *	Indicates progress of scanning state-machine.
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND: Ext scan hotlist
- *	ap found
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST: Ext scan set hotlist
- *	bssid
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST: Ext scan reset
- *	hotlist bssid
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE: Ext scan significant
- *	change
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE: Ext scan set
- *	significant change
- *	ap found
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE: Ext scan reset
- *	significant change
- * @QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE: Ext tdls enable
- * @QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE: Ext tdls disable
- * @QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS: Ext tdls get status
- * @QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE: Ext tdls state
- * @QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES: Get supported features
- * @QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI: Set scanning_mac_oui
- * @QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG: No DFS flag
- * @QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX: Get Concurrency Matrix
- * @QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY: Get the key mgmt offload keys
- * @QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH: After roaming, send the
- * roaming and auth information.
- * @QCA_NL80211_VENDOR_SUBCMD_OCB_SET_SCHED: Set OCB schedule
- * @QCA_NL80211_VENDOR_SUBCMD_DO_ACS: ACS offload flag
- * @QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES: Get the supported features by the
- * driver.
- * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED: Indicate that driver
- *	started CAC on DFS channel
- * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED: Indicate that driver
- * 	completed the CAC check on DFS channel
- * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED: Indicate that the CAC
- * 	check was aborted by the driver
- * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED: Indicate that the
- * 	driver completed NOP
- * @QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED: Indicate that the
- * 	driver detected radar signal on the current operating channel
- * @QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO: get wlan driver information
- * @QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_START: start wifi logger
- * @QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP: memory dump request
- * @QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET: get logger feature set
- * @QCA_NL80211_VENDOR_SUBCMD_ROAM: roam
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST: extscan set ssid hotlist
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST:
- *	extscan reset ssid hotlist
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND: hotlist ssid found
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST: hotlist ssid lost
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST: set pno list
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST: set passpoint list
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_RESET_PASSPOINT_LIST:
- *	reset passpoint list
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND: pno network found
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND:
- *	passpoint network found
- * @QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION: set wifi config
- * @QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION: get wifi config
- * @QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET: get logging features
- * @QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES: get link properties
- * @QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN: venodr scan command
- * @QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE: vendor scan complete
- * @QCA_NL80211_VENDOR_SUBCMD_OTA_TEST: enable OTA test
- * @QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG: set gateway parameters
- * @QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE: set tx power by percentage
- * @QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE_DECR_DB: reduce tx power by DB
- */
-
-enum qca_nl80211_vendor_subcmds {
-	QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
-	QCA_NL80211_VENDOR_SUBCMD_TEST = 1,
-	QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY = 10,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY = 11,
-	QCA_NL80211_VENDOR_SUBCMD_NAN = 12,
-	QCA_NL80211_VENDOR_SUBCMD_STATS_EXT = 13,
-
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET = 14,
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET = 15,
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR = 16,
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_RADIO_RESULTS = 17,
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_IFACE_RESULTS = 18,
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_PEERS_RESULTS = 19,
-
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START = 20,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP = 21,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS = 22,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES = 23,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS = 24,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE = 25,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT = 26,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT = 27,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND = 28,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST = 29,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST = 30,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE = 31,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE = 32,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE = 33,
-
-	QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE = 34,
-	QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE = 35,
-	QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS = 36,
-	QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE = 37,
-
-	QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES = 38,
-
-	QCA_NL80211_VENDOR_SUBCMD_SCANNING_MAC_OUI = 39,
-	QCA_NL80211_VENDOR_SUBCMD_NO_DFS_FLAG = 40,
-
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST = 41,
-
-	/* Get Concurrency Matrix */
-	QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42,
-
-	QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_SET_KEY = 50,
-	QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH = 51,
-
-	/* Deprecated */
-	QCA_NL80211_VENDOR_SUBCMD_OCB_SET_SCHED = 53,
-
-	QCA_NL80211_VENDOR_SUBCMD_DO_ACS = 54,
-
-	QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES = 55,
-
-	/* Off loaded DFS events */
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED = 56,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED = 57,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED = 58,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED = 59,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED = 60,
-
-	QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_INFO = 61,
-	QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_START = 62,
-	QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP = 63,
-	QCA_NL80211_VENDOR_SUBCMD_ROAM = 64,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST = 65,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST = 66,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND = 67,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST = 68,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_LIST = 69,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_SET_PASSPOINT_LIST = 70,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_RESET_PASSPOINT_LIST = 71,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND = 72,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND = 73,
-
-	/* Wi-Fi Configuration subcommands */
-	QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
-	QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75,
-	QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76,
-	QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA = 77,
-
-	QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_CAPABILITIES = 78,
-	QCA_NL80211_VENDOR_SUBCMD_OFFLOADED_PACKETS = 79,
-	QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI = 80,
-
-	/* OCB commands */
-	QCA_NL80211_VENDOR_SUBCMD_OCB_SET_CONFIG = 92,
-	QCA_NL80211_VENDOR_SUBCMD_OCB_SET_UTC_TIME = 93,
-	QCA_NL80211_VENDOR_SUBCMD_OCB_START_TIMING_ADVERT = 94,
-	QCA_NL80211_VENDOR_SUBCMD_OCB_STOP_TIMING_ADVERT = 95,
-	QCA_NL80211_VENDOR_SUBCMD_OCB_GET_TSF_TIMER = 96,
-	QCA_NL80211_VENDOR_SUBCMD_DCC_GET_STATS = 97,
-	QCA_NL80211_VENDOR_SUBCMD_DCC_CLEAR_STATS = 98,
-	QCA_NL80211_VENDOR_SUBCMD_DCC_UPDATE_NDL = 99,
-	QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT = 100,
-
-	/* subcommand to get link properties */
-	QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES = 101,
-	/* LFR Subnet Detection */
-	QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG = 102,
-
-	/* DBS subcommands */
-	QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST = 103,
-	QCA_NL80211_VENDOR_SUBCMD_SET_PROBABLE_OPER_CHANNEL = 104,
-
-	/* Vendor scan commands */
-	QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN = 106,
-	QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE = 107,
-
-	/* OTA test subcommand */
-	QCA_NL80211_VENDOR_SUBCMD_OTA_TEST = 108,
-	/* Tx power scaling subcommands */
-	QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE = 109,
-	/* Tx power scaling in db subcommands */
-	QCA_NL80211_VENDOR_SUBCMD_SET_TXPOWER_SCALE_DECR_DB = 115,
-
-};
-
-/**
- * enum qca_nl80211_vendor_subcmds_index - vendor sub commands index
- *
- * @QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX: Avoid frequency
- * @QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX: Nan
- * @QCA_NL80211_VENDOR_SUBCMD_STATS_EXT_INDEX: Ext stats
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START_INDEX: Ext scan start
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP_INDEX: Ext scan stop
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES_INDEX: Ext scan get
- *	capability
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS_INDEX: Ext scan get
- *	cached results
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE_INDEX: Ext scan
- *	results available
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT_INDEX: Ext scan full
- *	scan result
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT_INDEX: Ext scan event
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND_INDEX: Ext scan hot list
- *	AP found
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST_INDEX: Ext scan set
- *	bssid hotlist
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST_INDEX: Ext scan reset
- *	bssid hotlist
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE_INDEX: Ext scan
- *	significant change
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE_INDEX: Ext scan
- *	set significant change
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE_INDEX: Ext scan
- *	reset significant change
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET_INDEX: Set stats
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET_INDEX: Get stats
- * @QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR_INDEX: Clear stats
- * @QCA_NL80211_VENDOR_SUBCMD_LL_RADIO_STATS_INDEX: Radio stats
- * @QCA_NL80211_VENDOR_SUBCMD_LL_IFACE_STATS_INDEX: Iface stats
- * @QCA_NL80211_VENDOR_SUBCMD_LL_PEER_INFO_STATS_INDEX: Peer info stats
- * @QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE_CHANGE_INDEX: Ext tdls state change
- * @QCA_NL80211_VENDOR_SUBCMD_DO_ACS_INDEX: ACS command
- * @QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH_INDEX: Pass Roam and Auth info
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST_INDEX: hotlist ap lost
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND_INDEX:
- *	pno network found index
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND_INDEX:
- *	passpoint match found index
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST_INDEX:
- *	set ssid hotlist index
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST_INDEX:
- *	reset ssid hotlist index
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND_INDEX:
- *	hotlist ssid found index
- * @QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST_INDEX:
- *	hotlist ssid lost index
- * @QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT_INDEX
- *	dcc stats event index
- * @QCA_NL80211_VENDOR_SUBCMD_SCAN_INDEX: vendor scan index
- * @QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX:
- *	vendor scan complete event  index
- * @QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG_INDEX:
- *	update gateway parameters index
- */
-
-enum qca_nl80211_vendor_subcmds_index {
-#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
-	QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_INDEX = 0,
-#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
-
-#ifdef WLAN_FEATURE_NAN
-	QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX,
-#endif /* WLAN_FEATURE_NAN */
-
-#ifdef WLAN_FEATURE_STATS_EXT
-	QCA_NL80211_VENDOR_SUBCMD_STATS_EXT_INDEX,
-#endif /* WLAN_FEATURE_STATS_EXT */
-
-#ifdef FEATURE_WLAN_EXTSCAN
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CAPABILITIES_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_BSSID_HOTLIST_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_BSSID_HOTLIST_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SIGNIFICANT_CHANGE_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SIGNIFICANT_CHANGE_INDEX,
-#endif /* FEATURE_WLAN_EXTSCAN */
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_LL_RADIO_STATS_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_LL_IFACE_STATS_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_LL_PEER_INFO_STATS_INDEX,
-#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
-
-	QCA_NL80211_VENDOR_SUBCMD_TDLS_STATE_CHANGE_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_DO_ACS_INDEX,
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH_INDEX,
-#endif
-	/* DFS */
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_ABORTED_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_NOP_FINISHED_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED_INDEX,
-#ifdef FEATURE_WLAN_EXTSCAN
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SET_SSID_HOTLIST_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_RESET_SSID_HOTLIST_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST_INDEX,
-#endif /* FEATURE_WLAN_EXTSCAN */
-	QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI_INDEX,
-#ifdef WLAN_FEATURE_MEMDUMP
-	QCA_NL80211_VENDOR_SUBCMD_WIFI_LOGGER_MEMORY_DUMP_INDEX,
-#endif /* WLAN_FEATURE_MEMDUMP */
-	/* OCB events */
-	QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_SCAN_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX,
-	QCA_NL80211_VENDOR_SUBCMD_GW_PARAM_CONFIG_INDEX,
-};
-
-/**
- * enum qca_wlan_vendor_attr_tdls_enable - TDLS enable attribute
- *
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAC_ADDR: An array of 6 x Unsigned 8-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_CHANNEL: Signed 32-bit value, but lets
- *	keep as unsigned for now
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_GLOBAL_OPERATING_CLASS: operating class
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX_LATENCY_MS: Enable max latency in ms
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MIN_BANDWIDTH_KBPS: Enable min bandwidth
- *	in KBPS
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX: Max value
- */
-enum qca_wlan_vendor_attr_tdls_enable {
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_GLOBAL_OPERATING_CLASS,
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX_LATENCY_MS,
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MIN_BANDWIDTH_KBPS,
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX =
-		QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_tdls_disable: tdls disable attribute
- *
- * @QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAC_ADDR: An array of 6 x Unsigned
- *	8-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX: Max value
- */
-enum qca_wlan_vendor_attr_tdls_disable {
-	QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_MAX =
-		QCA_WLAN_VENDOR_ATTR_TDLS_DISABLE_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_tdls_get_status - tdls get status attribute
- *
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAC_ADDR: An array of 6 x Unsigned
- *	8-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_STATE: get status state,
- *	unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_REASON: get status reason
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_CHANNEL: get status channel,
- *	unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_GLOBAL_OPERATING_CLASS: get operating
- *	class, unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAX: Max value
- */
-enum qca_wlan_vendor_attr_tdls_get_status {
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_STATE,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_REASON,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_GLOBAL_OPERATING_CLASS,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_MAX =
-		QCA_WLAN_VENDOR_ATTR_TDLS_GET_STATUS_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_tdls_state - tdls state attribute
- *
- * @QCA_WLAN_VENDOR_ATTR_TDLS_STATE_INVALID: Initial invalid value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_STATE_MAC_ADDR: An array of 6 x Unsigned
- *	8-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_NEW_STATE: TDLS new state,
- *	unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_STATE_REASON: TDLS state reason
- * @QCA_WLAN_VENDOR_ATTR_TDLS_STATE_CHANNEL: TDLS state channel,
- *	unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_STATE_GLOBAL_OPERATING_CLASS: TDLS state
- *	operating class, unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_TDLS_STATE_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_TDLS_STATE_MAX: Max value
- */
-enum qca_wlan_vendor_attr_tdls_state {
-	QCA_WLAN_VENDOR_ATTR_TDLS_STATE_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_TDLS_STATE_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_TDLS_NEW_STATE,
-	QCA_WLAN_VENDOR_ATTR_TDLS_STATE_REASON,
-	QCA_WLAN_VENDOR_ATTR_TDLS_STATE_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_TDLS_STATE_GLOBAL_OPERATING_CLASS,
-	QCA_WLAN_VENDOR_ATTR_TDLS_STATE_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_TDLS_STATE_MAX =
-		QCA_WLAN_VENDOR_ATTR_TDLS_STATE_AFTER_LAST - 1,
-};
-
-/* enum's to provide TDLS capabilites */
-enum qca_wlan_vendor_attr_get_tdls_capabilities {
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_MAX_CONC_SESSIONS = 1,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_FEATURES_SUPPORTED = 2,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_MAX =
-	QCA_WLAN_VENDOR_ATTR_TDLS_GET_CAPS_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr - wlan vendor attribute
- *
- * @QCA_WLAN_VENDOR_ATTR_INVALID: Initial invalid value
- * @QCA_WLAN_VENDOR_ATTR_DFS: DFS attribute which is used by
- *	QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY
- * @QCA_WLAN_VENDOR_ATTR_NAN: NAN attribute which is used by
- *	QCA_NL80211_VENDOR_SUBCMD_NAN
- * @QCA_WLAN_VENDOR_ATTR_STATS_EXT: Ext stats attribute which is used by
- *	QCA_NL80211_VENDOR_SUBCMD_STATS_EXT
- * @QCA_WLAN_VENDOR_ATTR_IFINDEX: After IFINDEX
- * @QCA_WLAN_VENDOR_ATTR_MAC_ADDR: MAC Address attribute which is used by
- *	QCA_NL80211_VENDOR_SUBCMD_LINK_PROPERTIES
- * @QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS: Supported Features
- * @QCA_WLAN_VENDOR_ATTR_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_MAX: Max value
- */
-enum qca_wlan_vendor_attr {
-	QCA_WLAN_VENDOR_ATTR_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_DFS = 1,
-	QCA_WLAN_VENDOR_ATTR_NAN = 2,
-	QCA_WLAN_VENDOR_ATTR_STATS_EXT = 3,
-	QCA_WLAN_VENDOR_ATTR_IFINDEX = 4,
-	QCA_WLAN_VENDOR_ATTR_MAC_ADDR = 6,
-	QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS = 7,
-	QCA_WLAN_VENDOR_ATTR_CONCURRENCY_CAPA = 9,
-	QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_2_4_BAND = 10,
-	QCA_WLAN_VENDOR_ATTR_MAX_CONCURRENT_CHANNELS_5_0_BAND = 11,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1
-};
-
-#ifdef FEATURE_WLAN_EXTSCAN
-/**
- * enum qca_wlan_vendor_attr_extscan_config_params - ext scan config params
- *
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_INVALID: Invalid initial
- *								value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID:
- *	Unsigned 32-bit value; Middleware provides it to the driver. Middle ware
- *	either gets it from caller, e.g., framework, or generates one if
- *	framework doesn't provide it.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND:
- *	NL attributes for data used by
- *	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_VALID_CHANNELS sub command.
- *	It is unsigned 32-bit value.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS:
- *	Unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL:
- *	NL attributes for input params used by
- *	QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START sub command. Unsigned 32-bit
- *	value; channel frequency
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME: Unsigned 32-bit value;
- *	dwell time in ms
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE: Unsigned 8-bit value:
- *	0: active; 1: passive; N/A for DFS
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CLASS: Unsigned 8-bit value
- *	channel class
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX: Unsigned 8-bit value
- *	bucket index, 0 based
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND: Unsigned 8-bit value; band
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD: Unsigned 32-bit value;
- *	desired period, in ms
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS: Unsigned 8-bit
- *	value; report events semantics
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS: Unsigned 32-bit
- *	value. Followed by a nested array of EXTSCAN_CHANNEL_SPEC_* attributes.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC:
- *	Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_* attributes.
- *	Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD: Unsigned 32-bit
- *	value; base timer period in ms
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN: Unsigned
- *	32-bit value; number of APs to store in each scan in the
- *	BSSID/RSSI history buffer (keep the highest RSSI APs)
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT:
- *	Unsigned 8-bit value; in %, when scan buffer is this much full,
- *	wake up APPS.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS: Unsigned 8-bit
- *	value; number of scan bucket specs; followed by a nested array
- *	of_EXTSCAN_BUCKET_SPEC_* attributes and values. The size of the array
- *	is determined by NUM_BUCKETS
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC: Array of
- *	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_* attributes. Array size:
- *	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH:
- *	Unsigned 8-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX:
- *	Unsigned 32-bit value; maximum number of results to be returned
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID: An array of
- *	6 x Unsigned 8-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW: Signed 32-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH: Signed 32-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL: Signed 32-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP: Number of hotlist
- *	APs as unsigned 32-bit value, followed by a nested array of
- *	AP_THRESHOLD_PARAM attributes and values. The size of the array is
- *	determined by NUM_AP.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM: Array of
- *	QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_* attributes.
- *	Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE:
- *	Unsigned 32bit value; number of samples for averaging RSSI
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE:
- *	Unsigned 32bit value; number of samples to confirm AP loss
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING:
- *	Unsigned 32bit value; number of APs breaching threshold.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP:
- *	Unsigned 32bit value; number of APs. Followed by an array of
- *	AP_THRESHOLD_PARAM attributes. Size of the array is NUM_AP.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE:
- *	Unsigned 32bit value; number of samples to confirm AP loss.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD:
- *	Unsigned 32-bit value. If max_period is non zero or different than
- *	period, then this bucket is an exponential backoff bucket.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_EXPONENT:
- *	Unsigned 32-bit value. For exponential back off bucket,
- *	number of scans performed at a given period and until the
- *	exponent is applied.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT:
- *	Unsigned 8-bit value; in number of scans, wake up AP after these
- *	many scans.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS:
- *	Unsigned 8-bit value; in number of scans, wake up AP after these
- *	many scans.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE:
- *	Unsigned 32bit value; number of samples to confirm SSID loss
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID:
- *	Number of hotlist SSIDs as unsigned 32-bit value, followed by a nested
- *	array of SSID_THRESHOLD_PARAM_* attributes and values. The size of the
- *	array is determined by NUM_SSID
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM:
- *	Array of QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_* attributes
- *	Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID:
- *	An array of 33 x Unsigned 8-bit value; NULL terminated SSID
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND:
- *	 Signed 32-bit value; band
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW:
- *	Signed 32-bit value; low rssi
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH:
- *	Signed 32-bit value; high rssi
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS:
- *	Unsigned 32-bit value; a bitmask w/additional extscan config flag.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX: Max value
- */
-enum qca_wlan_vendor_attr_extscan_config_params {
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_INVALID = 0,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CLASS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_EXPONENT,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX =
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_extscan_results - vendor attribute ext scan results
- *
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID: Unsigned 32-bit value
- *	must match the request Id supplied by Wi-Fi HAL in the corresponding
- *	subcmd NL msg
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS: Unsigned 32-bit value used to
- *	indicate the status response from firmware/driver for the vendor
- *	sub-command
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_CHANNELS: EXTSCAN Valid Channels
- *	attributes. Unsigned 32bit value followed by a nested array of CHANNELS
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CHANNELS: An array of NUM_CHANNELS x
- *	Unsigned 32bit value integers representing channel numbers.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_CACHE_SIZE:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_BUCKETS:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_AP_CACHE_PER_SCAN:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_RSSI_SAMPLE_SIZE:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_REPORTING_THRESHOLD:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_APS:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SIGNIFICANT_WIFI_CHANGE_APS:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_BSSID_HISTORY_ENTRIES:
- *	Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE: Unsigned 32-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST: An array of
- *	NUM_RESULTS_AVAILABLE x QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_*
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP: Unsigned
- *	64-bit value age of sample at the time of retrieval
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID: 33 x unsigned 8-bit
- *	value; NULL terminated SSID
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID: An array of 6 x
- *	Unsigned 8-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL: Unsigned 32-bit
- *	value; channel frequency in MHz
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI: Signed 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT: Unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD: Unsigned 32-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD:
- *	Unsigned 16-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY:
- *	Unsigned 16-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH:
- *	Unsigned 32-bit value; size of the IE DATA blob
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA:
- *	An array of IE_LENGTH x Unsigned 8-bit value; blob of all the
- *	information elements found in the beacon; this data should be
- *	a packed list of wifi_information_element objects, one after
- *	the other.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA:
- *	Unsigned 8-bit value; set by driver to indicate more scan results are
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_TYPE: Unsigned 8-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_STATUS: Unsigned 32-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_BSSID:
- *	An array of 6 x Unsigned 8-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_CHANNEL:
- *	Unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_NUM_RSSI:
- *	Unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_RSSI_LIST:
- *	A nested array of signed 32-bit RSSI values. Size of the array is
- *	determined by (NUM_RSSI of SIGNIFICANT_CHANGE_RESULT_NUM_RSSI.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST:
- *	An array of NUM_RESULTS_AVAILABLE x
- *	QCA_NL80211_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_*
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID:
- *	Unsigned 32-bit value; a unique identifier for the scan unit
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_FLAGS:
- *	Unsigned 32-bit value; a bitmask w/additional information about scan
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES:
- *	 Unsigned 32-bit value; number of found network matches
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_RESULT_LIST:
- *	A nested array of
- *	QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_*
- *	attributes. Array size =
- *	*_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ID:
- *	Unsigned 32-bit value; network block id for the matched network
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP_LEN:
- *	Unsigned 32-bit value; ANQP length
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP:
- *	An array size of PASSPOINT_MATCH_ANQP_LEN of unsigned 8-bit values;
- *	ANQP data in the information_element format.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_SSIDS:
- *	Unsigned 32bit value; Max hotlist ssids.
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS:
- *	Unsigned 32bit value; Max number of epno networks
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS_BY_SSID:
- *	Unsigned 32bit value; Max number of epno networks by ssid
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_WHITELISTED_SSID:
- *	Unsigned 32bit value; Max number of whitelisted ssids
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_MAX: Max value
- */
-enum qca_wlan_vendor_attr_extscan_results {
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_INVALID = 0,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_CHANNELS,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CHANNELS,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_CACHE_SIZE,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_BUCKETS,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_AP_CACHE_PER_SCAN,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_RSSI_SAMPLE_SIZE,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_REPORTING_THRESHOLD,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_BSSIDS,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SIGNIFICANT_WIFI_CHANGE_APS,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_BSSID_HISTORY_ENTRIES,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-
-	/* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-	 * to indicate number of wifi scan results/bssids retrieved by the scan.
-	 * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the
-	 * list of wifi scan results returned for each cached result block.
-	 */
-
-	/* EXTSCAN attributes for
-	 * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT sub-command.
-	 */
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_TYPE,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_STATUS,
-
-	/* EXTSCAN attributes for
-	 * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND sub-command.
-	 */
-	/* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-	 * to indicate number of results.
-	 */
-
-	/* EXTSCAN attributes for
-	 * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE sub-command.
-	 */
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_BSSID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_NUM_RSSI,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_RSSI_LIST,
-
-	/* EXTSCAN attributes used with
-	 * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_GET_CACHED_RESULTS sub-command.
-	 */
-	/* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-	 * to indicate number of gscan cached results returned.
-	 * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST to
-	 * indicate the list of gscan cached results.
-	 */
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_FLAGS,
-	/* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-	 * to indicate number of wifi scan results/bssids retrieved by the scan.
-	 * Also, use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the
-	 * list of wifi scan results returned for each cached result block.
-	 */
-
-	/* EXTSCAN attributes for
-	 * QCA_NL80211_VENDOR_SUBCMD_PNO_NETWORK_FOUND sub-command.
-	 */
-	/* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE for number
-	 * of results.
-	 * Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested
-	 * list of wifi scan results returned for each
-	 * wifi_passpoint_match_result block.
-	 * Array size: QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE.
-	 */
-
-	/* EXTSCAN attributes for
-	 * QCA_NL80211_VENDOR_SUBCMD_PNO_PASSPOINT_NETWORK_FOUND sub-command.
-	 */
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_RESULT_LIST,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ID,
-	/* Use QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST to indicate the nested
-	 * list of wifi scan results returned for each
-	 * wifi_passpoint_match_result block.
-	 */
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP_LEN,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP,
-
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_SSIDS,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS_BY_SSID,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_WHITELISTED_SSID,
-
-	/* EXTSCAN attributes for
-	 * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND sub-command &
-	 * QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST sub-command
-	 */
-	/* Use attr QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE
-	 * to indicate number of results.
-	 */
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_MAX =
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_AFTER_LAST - 1,
-};
-
-#endif
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-
-/**
- * enum qca_wlan_vendor_attr_ll_stats_set - vendor attribute set stats
- *
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_MPDU_SIZE_THRESHOLD: Size threshold
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING:
- *	Aggresive stats gathering
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX: Max value
- */
-enum qca_wlan_vendor_attr_ll_stats_set {
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_MPDU_SIZE_THRESHOLD = 1,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX =
-		QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_attr_ll_stats_get - vendor attribute get stats
- *
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_ID: Unsigned 32bit value
- *	provided by the caller issuing the GET stats command. When reporting
- *	the stats results, the driver uses the same value to indicate which
- *	GET request the results correspond to.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK: Get config request mask
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_RSP_MASK: Config response mask
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_RSP: Config stop response
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX: Max value
- */
-enum qca_wlan_vendor_attr_ll_stats_get {
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_ID,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX =
-		QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_attr_ll_stats_clr - vendor attribute clear stats
- *
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_REQ_MASK: Config request mask
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_REQ: Config stop mask
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_RSP_MASK: Config response mask
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_RSP: Config stop response
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX: Max value
- */
-enum qca_wlan_vendor_attr_ll_stats_clr {
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_REQ_MASK,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_REQ,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_RSP_MASK,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_RSP,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX =
-		QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_attr_ll_stats_results_type - ll stats result type
- *
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_INVALID: Initial invalid value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_RADIO: Link layer stats type radio
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_IFACE: Link layer stats type interface
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_PEER: Link layer stats type peer
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_AFTER_LAST: Last value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_MAX: Max value
- */
-enum qca_wlan_vendor_attr_ll_stats_results_type {
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_INVALID = 0,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_RADIO = 1,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_IFACE,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_PEER,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_MAX =
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_attr_ll_stats_results - vendor attribute stats results
- *
- * Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_* are nested
- * within the interface stats.
- *
- * Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_* could be nested
- * within the interface stats.
- *
- * Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_* are nested
- * within the interface stats.
- *
- * Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_* could be nested
- * within the peer info stats.
- *
- * Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_* could be
- * nested within the channel stats.
- *
- * Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_ could be nested
- * within the radio stats.
- *
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_REQ_ID: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_BEACON_RX: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_RX: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_RX: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_TX: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_MGMT: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_DATA: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_ACK: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MODE: Interface mode, e.g., STA,
- *	SOFTAP, IBSS, etc. Type = enum wifi_interface_mode
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MAC_ADDR: Interface MAC address.
- *	An array of 6 Unsigned int8_t
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_STATE:
- *	Type = enum wifi_connection_state,  e.g., DISCONNECTED, AUTHENTICATING,
- *	etc. Valid for STA, CLI only
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_ROAMING:
- *	Type = enum wifi_roam_state. Roaming state, e.g., IDLE or ACTIVE
- *	(is that valid for STA only?)
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_CAPABILITIES: Unsigned 32bit value.
- *	WIFI_CAPABILITY_XXX
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_SSID: NULL terminated SSID. An
- *	array of 33 Unsigned 8bit values
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_BSSID: BSSID. An array of 6
- *	Unsigned 8bit values
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_AP_COUNTRY_STR: Country string
- *	advertised by AP. An array of 3 Unsigned 8bit values
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_COUNTRY_STR: Country string for
- *	this association. An array of 3 Unsigned 8bit values
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_AC: Type = enum wifi_traffic_ac e.g.
- *	V0, VI, BE and BK
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MPDU: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MPDU: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MCAST: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MCAST: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_AMPDU: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_AMPDU: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_MPDU_LOST: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES_SHORT: Unsigned int 32 value
- *	corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MIN: Unsigned int 32
- *	value corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MAX: Unsigned int 32
- *	value corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_AVG: Unsigned int 32
- *	value corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_NUM_SAMPLES: Unsigned int 32
- *	value corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS: Unsigned int 32
- *	value corresponding to respective AC
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_TYPE: Type = enum wifi_peer_type
- *	Peer type, e.g., STA, AP, P2P GO etc
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_MAC_ADDRESS: MAC addr corresponding
- *	to respective peer. An array of 6 Unsigned 8bit values
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_CAPABILITIES: Unsigned int 32bit
- *	value representing capabilities corresponding to respective peer.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_NUM_RATES: Unsigned 32bit value.
- *	Number of rates
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_PREAMBLE: Unsigned int 8bit value:
- *	0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_NSS: Unsigned int 8bit value:
- *	0:1x1, 1:2x2, 3:3x3, 4:4x4
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BW: Unsigned int 8bit value:
- *	0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MCS_INDEX: Unsigned int 8bit value:
- *	OFDM/CCK rate code would be as per IEEE Std in the units of 0.5mbps
- *	HT/VHT it would be mcs index
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BIT_RATE: Unsigned 32bit value.
- *	Bit rate in units of 100Kbps
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_TX_MPDU: Unsigned int 32bit value.
- *	Number of successfully transmitted data pkts i.e., with ACK received
- *	corresponding to the respective rate
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RX_MPDU: Unsigned int 32bit value.
- *	Number of received data pkts corresponding to the respective rate
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MPDU_LOST: Unsigned int 32bit value.
- *	Number of data pkts losses, i.e., no ACK received corresponding to
- *	the respective rate
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES: Unsigned int 32bit value.
- *	Total number of data pkt retries for the respective rate
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_SHORT: Unsigned int 32bit value.
- *	Total number of short data pkt retries for the respective rate
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_LONG: Unsigned int 32bit value.
- *	Total number of long data pkt retries for the respective rate
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ID: Radio id
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME: Unsigned 32bit value.
- *	Total number of msecs the radio is awake accruing over time
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_TX_TIME: Unsigned 32bit value.
- *	Total number of msecs the radio is transmitting accruing over time
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_RX_TIME: Unsigned 32bit value.
- *	Total number of msecs the radio is in active receive accruing over time
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_SCAN: Unsigned 32bit value.
- *	Total number of msecs the radio is awake due to all scan accruing
- *	over time
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_NBD: Unsigned 32bit value.
- *	Total number of msecs the radio is awake due to NAN accruing over time.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_GSCAN: Unsigned 32bit value.
- *	Total number of msecs the radio is awake due to GSCAN accruing over time
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_ROAM_SCAN: Unsigned 32bit value.
- *	Total number of msecs the radio is awake due to roam scan accruing over
- *	time.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_PNO_SCAN: Unsigned 32bit value.
- *	Total number of msecs the radio is awake due to PNO scan accruing over
- *	time.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_HS20: Unsigned 32bit value.
- *	Total number of msecs the radio is awake due to HS2.0 scans and GAS
- *	exchange accruing over time.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_NUM_CHANNELS: Unsigned 32bit value.
- *	Number of channels
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_WIDTH:
- *	Type = enum wifi_channel_width. Channel width, e.g., 20, 40, 80, etc.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ:
- *	Unsigned 32bit value. Primary 20MHz channel.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ0:
- *	Unsigned 32bit value. Center frequency (MHz) first segment.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ1:
- *	Unsigned 32bit value. Center frequency (MHz) second segment.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_ON_TIME: Unsigned int 32bit value
- *	representing total number of msecs the radio is awake on that channel
- *	accruing over time, corresponding to the respective channel.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_CCA_BUSY_TIME:  Unsigned int 32bit
- *	value representing total number of msecs the CCA register is busy
- *	accruing  over time corresponding to the respective channel.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_NUM_RADIOS: Number of radios
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO: Channel info
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO: Peer info
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_RATE_INFO: Peer rate info
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_INFO: WMM info
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA: Unsigned 8bit value.
- *	Used by the driver; if set to 1, it indicates that more stats, e.g.,
- *	peers or radio, are to follow in the next
- *	QCA_NL80211_VENDOR_SUBCMD_LL_STATS_*_RESULTS event. Otherwise, it
- *	is set to 0.
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET: tsf offset
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_DETECTED: leaky ap detected
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED:
- *	average number of frames leaked
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME: guard time
- * @QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_FEATURE_SET_MAX: Max value
- */
-
-enum qca_wlan_vendor_attr_ll_stats_results {
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_REQ_ID = 1,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_BEACON_RX,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_RX,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_RX,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_TX,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_MGMT,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_DATA,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_ACK,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MODE,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_STATE,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_ROAMING,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_CAPABILITIES,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_SSID,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_BSSID,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_AP_COUNTRY_STR,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_COUNTRY_STR,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_AC,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MPDU,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MPDU,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MCAST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MCAST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_AMPDU,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_AMPDU,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_MPDU_LOST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES_SHORT,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES_LONG,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MIN,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MAX,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_AVG,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_NUM_SAMPLES,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_TYPE,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_MAC_ADDRESS,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_CAPABILITIES,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_NUM_RATES,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_PREAMBLE,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_NSS,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BW,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MCS_INDEX,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BIT_RATE,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_TX_MPDU,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RX_MPDU,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MPDU_LOST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_SHORT,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_LONG,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ID,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_TX_TIME,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_RX_TIME,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_SCAN,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_NBD,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_GSCAN,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_ROAM_SCAN,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_PNO_SCAN,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_HS20,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_NUM_CHANNELS,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_WIDTH,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ0,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ1,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_ON_TIME,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_CCA_BUSY_TIME,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_NUM_RADIOS,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_RATE_INFO,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_INFO,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA,
-
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_DETECTED,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME,
-
-	/* Unsigned 32bit value to indicate ll stats result type */
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_LL_STATS_MAX =
-		QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST - 1
-};
-
-#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
-
-/**
- * enum qca_wlan_vendor_attr_get_supported_features - get supported feature
- *
- * @QCA_WLAN_VENDOR_ATTR_FEATURE_SET_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_FEATURE_SET: Unsigned 32bit value
- * @QCA_WLAN_VENDOR_ATTR_FEATURE_SET_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_FEATURE_SET_MAX: Max value
- */
-enum qca_wlan_vendor_attr_get_supported_features {
-	QCA_WLAN_VENDOR_ATTR_FEATURE_SET_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_FEATURE_SET = 1,
-	QCA_WLAN_VENDOR_ATTR_FEATURE_SET_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_FEATURE_SET_MAX =
-		QCA_WLAN_VENDOR_ATTR_FEATURE_SET_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_set_scanning_mac_oui - set scanning mac oui
- *
- * @QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI: An array of 3 x Unsigned 8-bit
- *	value
- * @QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX: Max value
- */
-enum qca_wlan_vendor_attr_set_scanning_mac_oui {
-	QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI = 1,
-	QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_MAX =
-		QCA_WLAN_VENDOR_ATTR_SET_SCANNING_MAC_OUI_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_scan - Specifies vendor scan attributes
- *
- * @QCA_WLAN_VENDOR_ATTR_SCAN_IE: IEs that should be included as part of scan
- * @QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES: Nested unsigned 32-bit attributes
- *	with frequencies to be scanned (in MHz)
- * @QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS: Nested attribute with SSIDs to be scanned
- * @QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES: Nested array attribute of supported
- *	rates to be included
- * @QCA_WLAN_VENDOR_ATTR_SCAN_TX_NO_CCK_RATE: flag used to send probe requests
- *	at non CCK rate in 2GHz band
- * @QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS: Unsigned 32-bit scan flags
- * @QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE: Unsigned 64-bit cookie provided by the
- *	driver for the specific scan request
- * @QCA_WLAN_VENDOR_ATTR_SCAN_STATUS: Unsigned 8-bit status of the scan
- *	request decoded as in enum scan_status
- * @QCA_WLAN_VENDOR_ATTR_SCAN_MAC: 6-byte MAC address to use when randomisation
- *	scan flag is set
- * @QCA_WLAN_VENDOR_ATTR_SCAN_MAC_MASK: 6-byte MAC address mask to be used with
- *	randomisation
- */
-enum qca_wlan_vendor_attr_scan {
-	QCA_WLAN_VENDOR_ATTR_SCAN_INVALID_PARAM = 0,
-	QCA_WLAN_VENDOR_ATTR_SCAN_IE,
-	QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES,
-	QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS,
-	QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES,
-	QCA_WLAN_VENDOR_ATTR_SCAN_TX_NO_CCK_RATE,
-	QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS,
-	QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE,
-	QCA_WLAN_VENDOR_ATTR_SCAN_STATUS,
-	QCA_WLAN_VENDOR_ATTR_SCAN_MAC,
-	QCA_WLAN_VENDOR_ATTR_SCAN_MAC_MASK,
-	QCA_WLAN_VENDOR_ATTR_SCAN_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_SCAN_MAX =
-		QCA_WLAN_VENDOR_ATTR_SCAN_AFTER_LAST - 1
-};
-
-/**
- * enum scan_status - Specifies the valid values the vendor scan attribute
- *	QCA_WLAN_VENDOR_ATTR_SCAN_STATUS can take
- * @VENDOR_SCAN_STATUS_NEW_RESULTS: implies the vendor scan is successful with
- *	new scan results
- * @VENDOR_SCAN_STATUS_ABORTED: implies the vendor scan was aborted in-between
- */
-enum scan_status {
-	VENDOR_SCAN_STATUS_NEW_RESULTS,
-	VENDOR_SCAN_STATUS_ABORTED,
-	VENDOR_SCAN_STATUS_MAX,
-};
-
-/**
- * enum qca_wlan_vendor_attr_get_concurrency_matrix - get concurrency matrix
- *
- * NL attributes for data used by
- * QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX sub command.
- *
- * @QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX:
- *	Unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET_SIZE:
- *	Unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET: Set results. An
- *	array of SET_SIZE x Unsigned 32bit values representing concurrency
- *	combinations
- * @QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX: Max value
- */
-enum qca_wlan_vendor_attr_get_concurrency_matrix {
-	QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX
-									= 1,
-	QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET_SIZE = 2,
-	QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET = 3,
-	QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX =
-	QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_set_no_dfs_flag - vendor attribute set no dfs flag
- *
- * @QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG: Unsigned 32-bit value
- * @QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX: Max value
- */
-enum qca_wlan_vendor_attr_set_no_dfs_flag {
-	QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG = 1,
-	QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_MAX =
-		QCA_WLAN_VENDOR_ATTR_SET_NO_DFS_FLAG_AFTER_LAST - 1,
-};
-
-
-/**
- * enum qca_wlan_vendor_attr_roam_auth - vendor event for roaming
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_BSSID: BSSID of the roamed AP
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_REQ_IE: Request IE
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_RESP_IE: Response IE
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AUTHORIZED: Authorization Status
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_KEY_REPLAY_CTR: Replay Counter
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KCK: KCK of the PTK
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KEK: KEK of the PTK
- * @QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_SUBNET_STATUS: subnet change status
- */
-enum qca_wlan_vendor_attr_roam_auth {
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_BSSID,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_REQ_IE,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_RESP_IE,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AUTHORIZED,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_KEY_REPLAY_CTR,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KCK,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_PTK_KEK,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_SUBNET_STATUS,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_MAX =
-		QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_attr_wifi_config - wifi config
- *
- * @QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_DYNAMIC_DTIM: dynamic DTIM
- * @QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_STATS_AVG_FACTOR: avg factor
- * @QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_GUARD_TIME: guard time
- * @QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_MAX: max value
- */
-enum qca_wlan_vendor_attr_wifi_config {
-	QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_DYNAMIC_DTIM = 1,
-	QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_STATS_AVG_FACTOR = 2,
-	QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_GUARD_TIME = 3,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_MAX =
-		QCA_WLAN_VENDOR_ATTR_WIFI_CONFIG_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_epno_type - the type of request to the EPNO command
- * @QCA_WLAN_EPNO: epno type request
- * @QCA_WLAN_PNO: pno type request
- */
-enum qca_wlan_epno_type {
-	QCA_WLAN_EPNO,
-	QCA_WLAN_PNO
-};
-
-/**
- * enum qca_wlan_vendor_attr_pno_config_params - pno config params
- *
- * @QCA_WLAN_VENDOR_ATTR_PNO_INVALID - Invalid initial value
- *
- *	NL attributes for data used by
- *	QCA_NL80211_VENDOR_SUBCMD_PNO_SET_PASSPOINT_LIST sub command.
- * @QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM:
- *	Unsigned 32-bit value; pno passpoint number of networks
- * @QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY:
- *	Array of nested QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_*
- *	attributes. Array size =
- *	QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM.
- * @QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID:
- *	Unsigned 32-bit value; network id
- * @QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM:
- *	An array of 256 x Unsigned 8-bit value; NULL terminated UTF8 encoded
- *	realm, 0 if unspecified.
- * @QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID:
- *	An array of 16 x Unsigned 32-bit value; roaming consortium ids
- *	to match, 0 if unspecified.
- * @QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN:
- *	An array of 6 x Unsigned 8-bit value; mcc/mnc combination, 0s if
- *	unspecified.
- *
- *	NL attributes for data used by
- *	QCA_NL80211_VENDOR_SUBCMD_PNO_SET_LIST sub command.
- * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS:
- *	Unsigned 32-bit value; set pno number of networks
- * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST:
- *	Array of nested
- *	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_*
- *	attributes. Array size =
- *		QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS
- * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID:
- *	An array of 33 x Unsigned 8-bit value; NULL terminated SSID
- * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD:
- *	Signed 8-bit value; threshold for considering this SSID as found,
- *	required granularity for this threshold is 4dBm to 8dBm
- * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS:
- *	Unsigned 8-bit value; WIFI_PNO_FLAG_XXX
- * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT:
- *	Unsigned 8-bit value; auth bit field for matching WPA IE
- * @QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE
- *	Unsigned 8-bit to indicate ePNO type; values from qca_wlan_epno_type
- * @QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_PNO_MAX: max
- */
-enum qca_wlan_vendor_attr_pno_config_params {
-	QCA_WLAN_VENDOR_ATTR_PNO_INVALID = 0,
-
-	QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM = 1,
-	QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY = 2,
-	QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID = 3,
-	QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM = 4,
-	QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID = 5,
-	QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN = 6,
-
-	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS = 7,
-	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST = 8,
-	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID = 9,
-	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD = 10,
-	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS = 11,
-	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT = 12,
-	QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_TYPE = 13,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_PNO_MAX =
-		QCA_WLAN_VENDOR_ATTR_PNO_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_roaming_config_params - roaming config params
- *
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD: roaming sub command
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID: Request id
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_NUM_NETWORKS:
- *	number of whitelist networks
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_LIST:
- *	Whitelist ssid list
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID:
- *	white list ssid
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD:
- *	'a' band boost threshold
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD:
- *	'a' band penalty threshold
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR:
- *	'a' band boost factor
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR:
- *	'a' band penalty factor
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST:
- *	'a' band max boost
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS:
- *	lazy roam histeresys
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER:
- *	alert roam rssi trigger
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE:
- *	set lazy roam enable
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS:
- *	set bssid preference
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID:
- *	set lazy roam number of bssid
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID:
- *	set lazy roam bssid
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER:
- *	set lazy roam rssi modifier
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS:
- *	set bssid params
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID:
- *	set bssid params num bssid
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID:
- *	set bssid params bssid
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST: After last
- * @QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX: Max
- */
-enum qca_wlan_vendor_attr_roaming_config_params {
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_INVALID = 0,
-
-	QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD = 1,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_REQ_ID = 2,
-
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_NUM_NETWORKS = 3,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID_LIST = 4,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_WHITE_LIST_SSID = 5,
-
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_THRESHOLD = 6,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_THRESHOLD = 7,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_BOOST_FACTOR = 8,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_PENALTY_FACTOR = 9,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_A_BAND_MAX_BOOST = 10,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_LAZY_ROAM_HISTERESYS = 11,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_ALERT_ROAM_RSSI_TRIGGER = 12,
-
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_ENABLE = 13,
-
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PREFS = 14,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_NUM_BSSID = 15,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_BSSID = 16,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_LAZY_ROAM_RSSI_MODIFIER = 17,
-
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS = 18,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_NUM_BSSID = 19,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_SET_BSSID_PARAMS_BSSID = 20,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_MAX =
-		QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_roam_subcmd - roam sub commands
- *
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SSID_WHITE_LIST: ssid white list
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_EXTSCAN_ROAM_PARAMS: roam params
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_LAZY_ROAM: set lazy roam
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS: set bssid prefs
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PARAMS: set bssid params
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID: set blacklist bssid
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_MAX: subcmd max
- */
-enum qca_wlan_vendor_attr_roam_subcmd {
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SSID_WHITE_LIST = 1,
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_EXTSCAN_ROAM_PARAMS = 2,
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_LAZY_ROAM = 3,
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PREFS = 4,
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BSSID_PARAMS = 5,
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_SET_BLACKLIST_BSSID = 6,
-
-	/* KEEP LAST */
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_MAX =
-		QCA_WLAN_VENDOR_ATTR_ROAM_SUBCMD_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_get_wifi_info - wifi driver information
- *
- * @QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_WIFI_INFO_DRIVER_VERSION: get host driver version
- * @QCA_WLAN_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION: ger firmware version
- * @QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX: subcmd max
- */
-enum qca_wlan_vendor_attr_get_wifi_info {
-	QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_WIFI_INFO_DRIVER_VERSION     = 1,
-	QCA_WLAN_VENDOR_ATTR_WIFI_INFO_FIRMWARE_VERSION   = 2,
-
-	/* KEEP LAST */
-	QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_MAX  =
-		QCA_WLAN_VENDOR_ATTR_WIFI_INFO_GET_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_get_logger_features - value for logger
- *                                                 supported features
- * @QCA_WLAN_VENDOR_ATTR_LOGGER_INVALID - Invalid
- * @QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED - Indicate the supported features
- * @QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST - To keep track of the last enum
- * @QCA_WLAN_VENDOR_ATTR_LOGGER_MAX - max value possible for this type
- *
- * enum values are used for NL attributes for data used by
- * QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET sub command.
- */
-enum qca_wlan_vendor_attr_get_logger_features {
-	QCA_WLAN_VENDOR_ATTR_LOGGER_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED = 1,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_LOGGER_MAX =
-		QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_link_properties - link properties
- *
- * @QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_INVALID: Invalid initial value
- * @QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_NSS: Unsigned 8-bit value to
- *	specify the number of spatial streams negotiated
- * @QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_RATE_FLAGS: Unsigned 8-bit value
- *	to specify negotiated rate flags i.e. ht, vht and channel width
- * @QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_FREQ: Unsigned 32bit value to
- *	specify the operating frequency
- * @QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_MAX: max value
- */
-enum qca_wlan_vendor_attr_link_properties {
-	QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_NSS = 1,
-	QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_RATE_FLAGS = 2,
-	QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_FREQ = 3,
-
-	/* KEEP LAST */
-	QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_MAX =
-		QCA_WLAN_VENDOR_ATTR_LINK_PROPERTIES_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_features - vendor device/driver features
- * @QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD: Device supports key
- * management offload, a mechanism where the station's firmware
- * does the exchange with the AP to establish the temporal keys
- * after roaming, rather than having the supplicant do it.
- * @QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS: Device supports
- *        simultaneous off-channel operations.
- */
-enum qca_wlan_vendor_features {
-	QCA_WLAN_VENDOR_FEATURE_KEY_MGMT_OFFLOAD = 0,
-	QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY = 1,
-	QCA_WLAN_VENDOR_FEATURE_OFFCHANNEL_SIMULTANEOUS = 2,
-	/* Additional features need to be added above this */
-	NUM_QCA_WLAN_VENDOR_FEATURES
-};
-
-/* Feature defines */
-#define WIFI_FEATURE_INFRA              0x0001  /* Basic infrastructure mode */
-#define WIFI_FEATURE_INFRA_5G           0x0002  /* Support for 5 GHz Band */
-#define WIFI_FEATURE_HOTSPOT            0x0004  /* Support for GAS/ANQP */
-#define WIFI_FEATURE_P2P                0x0008  /* Wifi-Direct */
-#define WIFI_FEATURE_SOFT_AP            0x0010  /* Soft AP */
-#define WIFI_FEATURE_EXTSCAN            0x0020  /* Extended Scan APIs */
-#define WIFI_FEATURE_NAN                0x0040  /* Neighbor Awareness
-						   Networking */
-#define WIFI_FEATURE_D2D_RTT		0x0080  /* Device-to-device RTT */
-#define WIFI_FEATURE_D2AP_RTT           0x0100  /* Device-to-AP RTT */
-#define WIFI_FEATURE_BATCH_SCAN         0x0200  /* Batched Scan (legacy) */
-#define WIFI_FEATURE_PNO                0x0400  /* Preferred network offload */
-#define WIFI_FEATURE_ADDITIONAL_STA     0x0800  /* Support for two STAs */
-#define WIFI_FEATURE_TDLS               0x1000  /* Tunnel directed link
-						   setup */
-#define WIFI_FEATURE_TDLS_OFFCHANNEL	0x2000  /* Support for TDLS off
-						   channel */
-#define WIFI_FEATURE_EPR                0x4000  /* Enhanced power reporting */
-#define WIFI_FEATURE_AP_STA             0x8000  /* Support for AP STA
-						   Concurrency */
-#define WIFI_FEATURE_LINK_LAYER_STATS   0x10000  /* Link layer stats */
-#define WIFI_FEATURE_LOGGER             0x20000  /* WiFi Logger */
-#define WIFI_FEATURE_HAL_EPNO           0x40000  /* WiFi PNO enhanced */
-#define WIFI_FEATURE_RSSI_MONITOR       0x80000  /* RSSI Monitor */
-
-/**
- * enum wifi_logger_supported_features - values for supported logger features
- * @WIFI_LOGGER_MEMORY_DUMP_SUPPORTED - Memory dump of FW
- * @WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED - Per packet statistics
- * @WIFI_LOGGER_CONNECT_EVENT_SUPPORTED - Logging of Connectivity events
- * @WIFI_LOGGER_POWER_EVENT_SUPPORTED - Power of driver
- * @WIFI_LOGGER_WAKE_LOCK_SUPPORTED - Wakelock of driver
- * @WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED - monitor FW health
- */
-enum wifi_logger_supported_features {
-	WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)),
-	WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)),
-	WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)),
-	WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)),
-	WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)),
-	WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)),
-	WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)),
-};
-
-/* Add more features here */
-#define WIFI_TDLS_SUPPORT			BIT(0)
-#define WIFI_TDLS_EXTERNAL_CONTROL_SUPPORT	BIT(1)
-#define WIIF_TDLS_OFFCHANNEL_SUPPORT		BIT(2)
-
-#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
-#define HDD_MAX_AVOID_FREQ_RANGES   4
-/**
- * typedef struct sHddAvoidFreqRange - avoid frequency range
- *
- * @startFreq: Start frequency range
- * @endFreq: End frequency range
- */
-typedef struct sHddAvoidFreqRange {
-	u32 startFreq;
-	u32 endFreq;
-} tHddAvoidFreqRange;
-
-/**
- * typedef struct sHddAvoidFreqList - avoid frequency list
- *
- * @avoidFreqRangeCount: Avoid frequency range count
- * @avoidFreqRange: Avoid frequency list
- */
-typedef struct sHddAvoidFreqList {
-	u32 avoidFreqRangeCount;
-	tHddAvoidFreqRange avoidFreqRange[HDD_MAX_AVOID_FREQ_RANGES];
-} tHddAvoidFreqList;
-#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
-
-/**
- * enum qca_wlan_vendor_attr_acs_offload
- *
- * @QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL: ACS selected primary channel
- * @QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL: ACS selected secondary channel
- * @QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE: hw_mode for ACS
- * @QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED: indicate if HT capability is enabled
- * @QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED: indicate HT capability
- */
-enum qca_wlan_vendor_attr_acs_offload {
-	QCA_WLAN_VENDOR_ATTR_ACS_CHANNEL_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_ACS_PRIMARY_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_ACS_SECONDARY_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_ACS_HW_MODE,
-	QCA_WLAN_VENDOR_ATTR_ACS_HT_ENABLED,
-	QCA_WLAN_VENDOR_ATTR_ACS_HT40_ENABLED,
-	QCA_WLAN_VENDOR_ATTR_ACS_VHT_ENABLED,
-	QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH,
-	QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST,
-	QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL,
-	QCA_WLAN_VENDOR_ATTR_ACS_FREQ_LIST,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_ACS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_ACS_MAX =
-	QCA_WLAN_VENDOR_ATTR_ACS_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_acs_hw_mode
- *
- * @QCA_ACS_MODE_IEEE80211B: 11b mode
- * @QCA_ACS_MODE_IEEE80211G: 11g mode
- * @QCA_ACS_MODE_IEEE80211A: 11a mode
- * @QCA_ACS_MODE_IEEE80211AD: 11ad mode
- */
-enum qca_wlan_vendor_acs_hw_mode {
-	QCA_ACS_MODE_IEEE80211B,
-	QCA_ACS_MODE_IEEE80211G,
-	QCA_ACS_MODE_IEEE80211A,
-	QCA_ACS_MODE_IEEE80211AD,
-	QCA_ACS_MODE_IEEE80211ANY,
-};
-
-/**
- * enum qca_wlan_vendor_config: wifi config attr
- *
- * @QCA_WLAN_VENDOR_ATTR_CONFIG_INVALID: invalid config
- * @QCA_WLAN_VENDOR_ATTR_CONFIG_MODULATED_DTIM: modulated dtim
- * @QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR: stats avg. factor
- * @QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME: guard time
- * @QCA_WLAN_VENDOR_ATTR_CONFIG_LAST: last config
- * @QCA_WLAN_VENDOR_ATTR_CONFIG_MAX: max config
- */
-enum qca_wlan_vendor_config {
-	QCA_WLAN_VENDOR_ATTR_CONFIG_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_CONFIG_MODULATED_DTIM,
-	QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR,
-	QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_CONFIG_LAST,
-	QCA_WLAN_VENDOR_ATTR_CONFIG_MAX =
-		QCA_WLAN_VENDOR_ATTR_CONFIG_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_attr_wifi_logger_start - Enum for wifi logger starting
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_INVALID: Invalid attribute
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID: Ring ID
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL: Verbose level
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS: Flag
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_AFTER_LAST: Last value
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX: Max value
- */
-enum qca_wlan_vendor_attr_wifi_logger_start {
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID = 1,
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL = 2,
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS = 3,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_MAX =
-		QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_START_AFTER_LAST - 1,
-};
-
-/*
- * enum qca_wlan_vendor_attr_wifi_logger_get_ring_data - Get ring data
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_INVALID: Invalid attribute
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_ID: Ring ID
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_AFTER_LAST: Last value
- * @QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX: Max value
- */
-enum qca_wlan_vendor_attr_wifi_logger_get_ring_data {
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_ID = 1,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_MAX =
-		QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_GET_RING_DATA_AFTER_LAST - 1,
-};
-
-#ifdef WLAN_FEATURE_OFFLOAD_PACKETS
-/**
- * enum wlan_offloaded_packets_control - control commands
- * @WLAN_START_OFFLOADED_PACKETS: start offloaded packets
- * @WLAN_STOP_OFFLOADED_PACKETS: stop offloaded packets
- *
- */
-enum wlan_offloaded_packets_control {
-	WLAN_START_OFFLOADED_PACKETS = 1,
-	WLAN_STOP_OFFLOADED_PACKETS  = 2
-};
-
-/**
- * enum qca_wlan_vendor_attr_offloaded_packets - offloaded packets
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_INVALID: invalid
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SENDING_CONTROL: control
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_REQUEST_ID: request id
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET_DATA: ip packet data
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SRC_MAC_ADDR: src mac address
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_DST_MAC_ADDR: destination mac address
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_PERIOD: period in milli seconds
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_MAX: max
- */
-enum qca_wlan_vendor_attr_offloaded_packets {
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SENDING_CONTROL,
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_REQUEST_ID,
-
-	/* Packet in hex format */
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_IP_PACKET_DATA,
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_SRC_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_DST_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_PERIOD,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_MAX =
-		QCA_WLAN_VENDOR_ATTR_OFFLOADED_PACKETS_AFTER_LAST - 1,
-};
-#endif
-
-/**
- * enum qca_wlan_rssi_monitoring_control - rssi control commands
- * @QCA_WLAN_RSSI_MONITORING_CONTROL_INVALID: invalid
- * @QCA_WLAN_RSSI_MONITORING_START: rssi monitoring start
- * @QCA_WLAN_RSSI_MONITORING_STOP: rssi monitoring stop
- */
-enum qca_wlan_rssi_monitoring_control {
-	QCA_WLAN_RSSI_MONITORING_CONTROL_INVALID = 0,
-	QCA_WLAN_RSSI_MONITORING_START,
-	QCA_WLAN_RSSI_MONITORING_STOP,
-};
-
-/**
- * enum qca_wlan_vendor_attr_rssi_monitoring - rssi monitoring
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_INVALID: Invalid
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CONTROL: control
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX_RSSI: max rssi
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MIN_RSSI: min rssi
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_BSSID: current bssid
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_RSSI: current rssi
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX: max
- */
-enum qca_wlan_vendor_attr_rssi_monitoring {
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_INVALID = 0,
-
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CONTROL,
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_REQUEST_ID,
-
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX_RSSI,
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MIN_RSSI,
-
-	/* attributes to be used/received in callback */
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_BSSID,
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_CUR_RSSI,
-
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_MAX =
-		QCA_WLAN_VENDOR_ATTR_RSSI_MONITORING_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_vendor_attr_get_preferred_freq_list - get preferred channel list
- * @QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_INVALID: invalid value
- * @QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE: interface type
- * @QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST: preferred frequency list
- * @QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX: max
- */
-enum qca_vendor_attr_get_preferred_freq_list {
-	QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_INVALID,
-	/* A 32-unsigned value; the interface type/mode for which the preferred
-	 * frequency list is requested (see enum qca_iface_type for possible
-	 * values); used in both south- and north-bound.
-	 */
-	QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_IFACE_TYPE,
-	/* An array of 32-unsigned values; values are frequency (MHz); used
-	 * in north-bound only.
-	 */
-	QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_MAX =
-	QCA_WLAN_VENDOR_ATTR_GET_PREFERRED_FREQ_LIST_AFTER_LAST - 1
-};
-
-/**
- * enum qca_vendor_attr_probable_oper_channel - channel hint
- * @QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_INVALID: invalid value
- * @QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_IFACE_TYPE: interface type
- * @QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ: frequency hint value
- * @QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_AFTER_LAST: last
- * @QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_MAX: max
- */
-enum qca_vendor_attr_probable_oper_channel {
-	QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_INVALID,
-	/* 32-bit unsigned value; indicates the connection/iface type likely to
-	  * come on this channel (see enum qca_iface_type).
-	  */
-	QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_IFACE_TYPE,
-	/* 32-bit unsigned value; the frequency (MHz) of the probable channel */
-	QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_MAX =
-	QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_attr_gw_param_config - gateway param config
- * @QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_INVALID: Invalid
- * @QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_GW_MAC_ADDR: gateway mac addr
- * @QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_IPV4_ADDR: ipv4 addr
- * @QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_IPV6_ADDR: ipv6 addr
- */
-enum qca_wlan_vendor_attr_gw_param_config {
-	QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_GW_MAC_ADDR,
-	QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_IPV4_ADDR,
-	QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_IPV6_ADDR,
-	QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_MAX =
-		QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_AFTER_LAST - 1,
-};
-
-/**
- * enum drv_dbs_capability - DBS capability
- * @DRV_DBS_CAPABILITY_DISABLED: DBS disabled
- * @DRV_DBS_CAPABILITY_1X1: 1x1
- * @DRV_DBS_CAPABILITY_2X2: 2x2
- */
-enum drv_dbs_capability {
-	DRV_DBS_CAPABILITY_DISABLED, /* not supported or disabled */
-	DRV_DBS_CAPABILITY_1X1,
-	DRV_DBS_CAPABILITY_2X2,
-};
-
-/**
- * enum qca_vendor_attr_ota_test - Enable OTA test
- * @QCA_WLAN_VENDOR_ATTR_OTA_TEST_INVALID: invalid value
- * @QCA_WLAN_VENDOR_ATTR_OTA_TEST_ENABLE: enable OTA test
- * @QCA_WLAN_VENDOR_ATTR_OTA_TEST_AFTER_LAST: after last
- * @QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX: max
- */
-enum qca_vendor_attr_ota_test {
-	QCA_WLAN_VENDOR_ATTR_OTA_TEST_INVALID,
-	/* 8-bit unsigned value to indicate if OTA test is enabled */
-	QCA_WLAN_VENDOR_ATTR_OTA_TEST_ENABLE,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_OTA_TEST_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_OTA_TEST_MAX =
-	QCA_WLAN_VENDOR_ATTR_OTA_TEST_AFTER_LAST - 1
-};
-
-/** enum qca_vendor_attr_txpower_scale - vendor sub commands index
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_INVALID: invalid value
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE: scaling value
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_AFTER_LAST: last value
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_MAX: max value
- */
-enum qca_vendor_attr_txpower_scale {
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_INVALID,
-	/* 8-bit unsigned value to indicate the scaling of tx power */
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_MAX =
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_AFTER_LAST - 1
-};
-
-/**
- * enum qca_vendor_attr_txpower_scale_decr_db - vendor sub commands index
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_INVALID: invalid value
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB: scaling value
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_AFTER_LAST: last value
- * @QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_MAX: max value
- */
-enum qca_vendor_attr_txpower_scale_decr_db {
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_INVALID,
-	/* 8-bit unsigned value to indicate the scaling of tx power */
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB,
-	/* keep last */
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_MAX =
-	QCA_WLAN_VENDOR_ATTR_TXPOWER_SCALE_DECR_DB_AFTER_LAST - 1
-};
-
-struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_db(hdd_adapter_t *pAdapter,
-						tCsrRoamInfo *pRoamInfo);
-
-int wlan_hdd_cfg80211_pmksa_candidate_notify(hdd_adapter_t *pAdapter,
-					tCsrRoamInfo *pRoamInfo,
-					int index, bool preauth);
-
-#ifdef FEATURE_WLAN_LFR_METRICS
-CDF_STATUS wlan_hdd_cfg80211_roam_metrics_preauth(hdd_adapter_t *pAdapter,
-						tCsrRoamInfo *pRoamInfo);
-
-CDF_STATUS wlan_hdd_cfg80211_roam_metrics_preauth_status(hdd_adapter_t *
-							 pAdapter,
-							 tCsrRoamInfo *
-							 pRoamInfo,
-							 bool preauth_status);
-
-CDF_STATUS wlan_hdd_cfg80211_roam_metrics_handover(hdd_adapter_t *pAdapter,
-						   tCsrRoamInfo *pRoamInfo);
-#endif
-
-#ifdef FEATURE_WLAN_WAPI
-void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
-				    const uint8_t *mac_addr, const uint8_t *key,
-				    int key_Len);
-#endif
-hdd_context_t *hdd_cfg80211_wiphy_alloc(int priv_size);
-
-int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
-			   struct cfg80211_scan_request *request);
-
-int wlan_hdd_cfg80211_init(struct device *dev,
-			   struct wiphy *wiphy, struct hdd_config *pCfg);
-
-void wlan_hdd_update_wiphy(struct wiphy *wiphy, struct hdd_config *pCfg);
-
-int wlan_hdd_cfg80211_register(struct wiphy *wiphy);
-void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter);
-
-void wlan_hdd_cfg80211_deregister_frames(hdd_adapter_t *pAdapter);
-
-void hdd_reg_notifier(struct wiphy *wiphy,
-				 struct regulatory_request *request);
-
-extern void hdd_conn_set_connection_state(hdd_adapter_t *pAdapter,
-					  eConnectionState connState);
-CDF_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter,
-					       int channel);
-#ifdef FEATURE_WLAN_TDLS
-int wlan_hdd_cfg80211_send_tdls_discover_req(struct wiphy *wiphy,
-					     struct net_device *dev, u8 *peer);
-#endif
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-extern void wlan_hdd_cfg80211_update_replay_counter_callback(void
-							     *callbackContext,
-							     tpSirGtkOffloadGetInfoRspParams
-							     pGtkOffloadGetInfoRsp);
-#endif
-void *wlan_hdd_change_country_code_cb(void *pAdapter);
-void hdd_select_cbmode(hdd_adapter_t *pAdapter, uint8_t operationChannel);
-
-uint8_t *wlan_hdd_cfg80211_get_ie_ptr(const uint8_t *ies_ptr, int length,
-				      uint8_t eid);
-
-#ifdef CFG80211_DEL_STA_V2
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  struct station_del_parameters *param);
-#else
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  const uint8_t *mac);
-#else
-int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  uint8_t *mac);
-#endif
-#endif
-
-#if  defined(QCA_WIFI_FTM)     && defined(CONFIG_NL80211_TESTMODE)
-void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len);
-#endif
-
-#if defined(FEATURE_WLAN_CH_AVOID) || defined(FEATURE_WLAN_FORCE_SAP_SCC)
-int wlan_hdd_send_avoid_freq_event(hdd_context_t *pHddCtx,
-				tHddAvoidFreqList * pAvoidFreqList);
-#endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */
-
-#ifdef FEATURE_WLAN_EXTSCAN
-void wlan_hdd_cfg80211_extscan_callback(void *ctx,
-					const uint16_t evType, void *pMsg);
-#endif /* FEATURE_WLAN_EXTSCAN */
-
-void hdd_rssi_threshold_breached(void *hddctx,
-				 struct rssi_breach_event *data);
-
-struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(hdd_adapter_t *pAdapter,
-						       tCsrRoamInfo *pRoamInfo);
-
-int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy,
-						hdd_adapter_t *pAdapter,
-						uint32_t scan_timestamp);
-
-void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter);
-
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr, uint8_t *bssid,
-		uint8_t *req_rsn_ie, uint32_t req_rsn_length, uint8_t
-		*rsp_rsn_ie, uint32_t rsp_rsn_length, tCsrRoamInfo
-		*roam_info_ptr);
-#else
-static inline int wlan_hdd_send_roam_auth_event(hdd_context_t *hdd_ctx_ptr,
-		uint8_t *bssid, uint8_t *req_rsn_ie, uint32_t req_rsn_length,
-		uint8_t *rsp_rsn_ie, uint32_t rsp_rsn_length, tCsrRoamInfo
-		*roam_info_ptr)
-{
-	return 0;
-}
-#endif
-
-int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter);
-
-#if !(defined (SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC))
-static inline struct sk_buff *
-backported_cfg80211_vendor_event_alloc(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					int approxlen,
-					int event_idx, gfp_t gfp)
-{
-	return cfg80211_vendor_event_alloc(wiphy, approxlen, event_idx, gfp);
-}
-#define cfg80211_vendor_event_alloc backported_cfg80211_vendor_event_alloc
-#endif
-int wlan_hdd_sap_cfg_dfs_override(hdd_adapter_t *adapter);
-
-enum cds_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
-					enum nl80211_iftype type);
-
-int wlan_hdd_disable_dfs_chan_scan(hdd_context_t *hdd_ctx,
-				   hdd_adapter_t *adapter,
-				   uint32_t no_dfs_flag);
-
-#endif

+ 0 - 863
core/hdd/src/wlan_hdd_conc_ut.c

@@ -1,863 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/* Include files */
-
-#include <wlan_hdd_includes.h>
-#include <cds_api.h>
-#include <cds_sched.h>
-#include <wni_api.h>
-#include <wlan_hdd_cfg.h>
-#include "wlan_hdd_trace.h"
-#include "cds_concurrency.h"
-#include "wlan_hdd_conc_ut.h"
-#include "cdf_types.h"
-#include "cdf_trace.h"
-#include "cds_utils.h"
-#include "cds_reg_service.h"
-#include "wma_types.h"
-#include "wma.h"
-#include "wma_api.h"
-
-#define NUMBER_OF_SCENARIO 300
-#define MAX_ALLOWED_CHAR_IN_REPORT 50
-
-/**
- * struct report_t: Data structure to fill report
- *
- * @title: title of the concurrency case scenario
- * @first_persona: device type of first persona
- * @second_persona: device type of second persona
- * @third_persona: device type of third persona
- * @dbs_value: string to mention whether dbs enable or disable
- * @system_conf: string to mention what is system's configuration
- * @status: status field
- * @result_code: string to mention whether test case passed or failed
- * @reason: reason why test case failed
- * @pcl: preferred channel list
- *
- * This structure will be used by unit test framework to fill
- * report after running various concurrency scenarios.
- */
-struct report_t {
-	char title[2 * MAX_ALLOWED_CHAR_IN_REPORT];
-	char first_persona[MAX_ALLOWED_CHAR_IN_REPORT];
-	char second_persona[MAX_ALLOWED_CHAR_IN_REPORT];
-	char third_persona[MAX_ALLOWED_CHAR_IN_REPORT];
-	char dbs_value[MAX_ALLOWED_CHAR_IN_REPORT];
-	char system_conf[MAX_ALLOWED_CHAR_IN_REPORT];
-	bool status;
-	char result_code[MAX_ALLOWED_CHAR_IN_REPORT];
-	char reason[MAX_ALLOWED_CHAR_IN_REPORT];
-	char pcl[2 * MAX_NUM_CHAN];
-};
-
-static struct report_t report[NUMBER_OF_SCENARIO];
-static uint32_t report_idx;
-
-static uint8_t wlan_hdd_valid_type_of_persona(uint32_t sub_type)
-{
-	switch (sub_type) {
-	case CDS_STA_MODE:
-		return WMI_VDEV_TYPE_STA;
-	case CDS_IBSS_MODE:
-		return WMI_VDEV_TYPE_IBSS;
-	case CDS_SAP_MODE:
-	case CDS_P2P_CLIENT_MODE:
-	case CDS_P2P_GO_MODE:
-		return WMI_VDEV_TYPE_AP;
-	default:
-		return WMI_VDEV_TYPE_STA;
-	}
-}
-
-static const char *system_config_to_string(uint8_t idx)
-{
-	switch (idx) {
-	CASE_RETURN_STRING(CDS_THROUGHPUT);
-	CASE_RETURN_STRING(CDS_POWERSAVE);
-	CASE_RETURN_STRING(CDS_LATENCY);
-	default:
-		return "Unknown";
-	}
-
-}
-
-static const char *device_mode_to_string(uint8_t idx)
-{
-	switch (idx) {
-	CASE_RETURN_STRING(CDS_STA_MODE);
-	CASE_RETURN_STRING(CDS_SAP_MODE);
-	CASE_RETURN_STRING(CDS_P2P_CLIENT_MODE);
-	CASE_RETURN_STRING(CDS_P2P_GO_MODE);
-	CASE_RETURN_STRING(CDS_IBSS_MODE);
-	default:
-		return "none";
-	}
-}
-
-static const char *pcl_type_to_string(uint8_t idx)
-{
-	switch (idx) {
-	CASE_RETURN_STRING(CDS_NONE);
-	CASE_RETURN_STRING(CDS_24G);
-	CASE_RETURN_STRING(CDS_5G);
-	CASE_RETURN_STRING(CDS_SCC_CH);
-	CASE_RETURN_STRING(CDS_MCC_CH);
-	CASE_RETURN_STRING(CDS_SCC_CH_24G);
-	CASE_RETURN_STRING(CDS_SCC_CH_5G);
-	CASE_RETURN_STRING(CDS_24G_SCC_CH);
-	CASE_RETURN_STRING(CDS_5G_SCC_CH);
-	CASE_RETURN_STRING(CDS_SCC_ON_5_SCC_ON_24_24G);
-	CASE_RETURN_STRING(CDS_SCC_ON_5_SCC_ON_24_5G);
-	CASE_RETURN_STRING(CDS_SCC_ON_24_SCC_ON_5_24G);
-	CASE_RETURN_STRING(CDS_SCC_ON_24_SCC_ON_5_5G);
-	CASE_RETURN_STRING(CDS_SCC_ON_5_SCC_ON_24);
-	CASE_RETURN_STRING(CDS_SCC_ON_24_SCC_ON_5);
-	CASE_RETURN_STRING(CDS_MCC_CH_24G);
-	CASE_RETURN_STRING(CDS_MCC_CH_5G);
-	CASE_RETURN_STRING(CDS_24G_MCC_CH);
-	CASE_RETURN_STRING(CDS_5G_MCC_CH);
-	default:
-		return "Unknown";
-	}
-}
-
-void clean_report(hdd_context_t *hdd_ctx)
-{
-	uint32_t idx = 0;
-	while (idx < NUMBER_OF_SCENARIO) {
-		cdf_mem_zero(&report[idx], sizeof(struct report_t));
-		idx++;
-	}
-	report_idx = 0;
-}
-
-void print_report(hdd_context_t *hdd_ctx)
-{
-	uint32_t idx = 0;
-	pr_info("+----------Report start -----------+\n");
-	while (idx < report_idx) {
-		pr_info("Idx:[%d]\nTitle:%s\nResult:[%s]\n\t1st_person[%s]\n\t2nd_persona[%s]\n\t3rd_persona[%s]\n\tDBS[%s]\n\tsystem_config[%s]\n\treason[%s]\n\tpcl[%s]\n",
-			idx,
-			report[idx].title, report[idx].result_code,
-			report[idx].first_persona, report[idx].second_persona,
-			report[idx].third_persona, report[idx].dbs_value,
-			report[idx].system_conf, report[idx].reason,
-			report[idx].pcl);
-		idx++;
-	}
-	pr_info("+----------Report end -----------+\n");
-}
-
-void fill_report(hdd_context_t *hdd_ctx, char *title,
-	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
-	uint32_t chnl_1st_conn, uint32_t chnl_2nd_conn, uint32_t chnl_3rd_conn,
-	bool status, enum cds_pcl_type pcl_type, char *reason, uint8_t *pcl)
-{
-	int i;
-	char buf[4] = {0};
-
-	if (report_idx >= NUMBER_OF_SCENARIO)
-		return;
-	snprintf(report[report_idx].title,
-		2 * MAX_ALLOWED_CHAR_IN_REPORT, "pcl for[%s] pcl_type[%s]",
-		title, pcl_type_to_string(pcl_type));
-	if (chnl_1st_conn == 0)
-		snprintf(report[report_idx].first_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			device_mode_to_string(first_persona));
-	else
-		snprintf(report[report_idx].first_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			"%s-chnl{%d}",
-			device_mode_to_string(first_persona), chnl_1st_conn);
-	if (chnl_2nd_conn == 0)
-		snprintf(report[report_idx].second_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			device_mode_to_string(second_persona));
-	else
-		snprintf(report[report_idx].second_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			"%s-chnl{%d}",
-			device_mode_to_string(second_persona), chnl_2nd_conn);
-	if (chnl_3rd_conn == 0)
-		snprintf(report[report_idx].third_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			device_mode_to_string(third_persona));
-	else
-		snprintf(report[report_idx].third_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			"%s-chnl{%d}",
-			device_mode_to_string(third_persona), chnl_3rd_conn);
-
-	report[report_idx].status = status;
-	snprintf(report[report_idx].dbs_value,
-		MAX_ALLOWED_CHAR_IN_REPORT,
-		wma_is_hw_dbs_capable() ? "enable" : "disable");
-	snprintf(report[report_idx].system_conf,
-		MAX_ALLOWED_CHAR_IN_REPORT,
-		system_config_to_string(hdd_ctx->config->conc_system_pref));
-	snprintf(report[report_idx].result_code,
-		MAX_ALLOWED_CHAR_IN_REPORT,
-		status ? "PASS" : "FAIL");
-	snprintf(report[report_idx].reason,
-		MAX_ALLOWED_CHAR_IN_REPORT,
-		reason);
-	if (pcl) {
-		cdf_mem_zero(report[report_idx].pcl,
-				sizeof(report[report_idx].pcl));
-		for (i = 0; i < MAX_NUM_CHAN; i++) {
-			if (pcl[i] == 0)
-				break;
-			cdf_mem_zero(buf, sizeof(buf));
-			snprintf(buf, sizeof(buf), "%d ", pcl[i]);
-			strlcat(report[report_idx].pcl, buf,
-				sizeof(report[report_idx].pcl));
-			strlcat(report[report_idx].pcl, ", ",
-				sizeof(report[report_idx].pcl));
-		}
-	}
-	report_idx++;
-}
-
-static bool wlan_hdd_validate_pcl(hdd_context_t *hdd_ctx,
-	enum cds_pcl_type pcl_type, uint8_t *pcl, uint32_t pcl_len,
-	uint8_t first_connection_chnl, uint8_t second_connection_chnl,
-	char *reason, uint32_t reason_length)
-{
-	bool status = true;
-	uint32_t first_idx = 0;
-
-	if ((pcl_type != CDS_NONE) && (pcl_len == 0)) {
-		snprintf(reason, reason_length, "no of channels = 0");
-		return false;
-	}
-
-	switch (pcl_type) {
-	case CDS_NONE:
-		if (pcl_len != 0) {
-			snprintf(reason, reason_length, "no of channels>0");
-			return false;
-		}
-		break;
-	case CDS_5G:
-		for (first_idx = 0; first_idx < pcl_len; first_idx++) {
-			if (!CDS_IS_CHANNEL_5GHZ(pcl[first_idx])) {
-				snprintf(reason, reason_length,
-					"2G channel found");
-				return false;
-			}
-		}
-		break;
-	case CDS_24G:
-		for (first_idx = 0; first_idx < pcl_len; first_idx++) {
-			if (!CDS_IS_CHANNEL_24GHZ(pcl[first_idx])) {
-				snprintf(reason, reason_length,
-					"5G channel found");
-				return false;
-			}
-		}
-		break;
-	case CDS_SCC_CH:
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl[0] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		break;
-	case CDS_MCC_CH:
-		if ((pcl[0] != first_connection_chnl) &&
-				((second_connection_chnl > 0) &&
-				 (pcl[0] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-				(pcl[1] != first_connection_chnl &&
-				 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		break;
-	case CDS_SCC_CH_24G:
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl[0] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 2.4Ghz chnl");
-			return false;
-		}
-		break;
-	case CDS_SCC_CH_5G:
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl[0] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		break;
-	case CDS_24G_SCC_CH:
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[0])) {
-			snprintf(reason, reason_length,
-				"No 2.4Ghz chnl");
-			return false;
-		}
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl[pcl_len-1] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		break;
-	case CDS_5G_SCC_CH:
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[0])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl[pcl_len-1] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		break;
-	case CDS_MCC_CH_24G:
-		if ((pcl[0] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl[0] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl");
-			return false;
-		}
-		break;
-	case CDS_MCC_CH_5G:
-		if ((pcl[0] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl[0] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		break;
-	case CDS_24G_MCC_CH:
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[0])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl");
-			return false;
-		}
-		if ((pcl[pcl_len-1] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl[pcl_len-1] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl[pcl_len-2] != first_connection_chnl &&
-			 pcl[pcl_len-2] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		break;
-	case CDS_5G_MCC_CH:
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[0])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		if ((pcl[pcl_len-1] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl[pcl_len-1] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl[pcl_len-2] != first_connection_chnl &&
-			 pcl[pcl_len-2] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		break;
-	case CDS_SCC_ON_5_SCC_ON_24_24G:
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[0]) ||
-			(pcl[0] != first_connection_chnl &&
-			 pcl[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[1]) ||
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnls");
-			return false;
-		}
-		break;
-	case CDS_SCC_ON_5_SCC_ON_24_5G:
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[0]) ||
-			(pcl[0] != first_connection_chnl &&
-			 pcl[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[1]) ||
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnls");
-			return false;
-		}
-		break;
-	case CDS_SCC_ON_24_SCC_ON_5_24G:
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[0]) ||
-			(pcl[0] != first_connection_chnl &&
-			 pcl[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[1]) ||
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnls");
-			return false;
-		}
-		break;
-	case CDS_SCC_ON_24_SCC_ON_5_5G:
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[0]) ||
-			(pcl[0] != first_connection_chnl &&
-			 pcl[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[1]) ||
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[pcl_len-1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnls");
-			return false;
-		}
-		break;
-	case CDS_SCC_ON_5_SCC_ON_24:
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[0]) ||
-			(pcl[0] != first_connection_chnl &&
-			 pcl[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[1]) ||
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (pcl_len != 2) {
-			snprintf(reason, reason_length,
-				"more than 2 chnls");
-			return false;
-		}
-		break;
-	case CDS_SCC_ON_24_SCC_ON_5:
-		if (!CDS_IS_CHANNEL_24GHZ(pcl[0]) ||
-			(pcl[0] != first_connection_chnl &&
-			 pcl[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (!CDS_IS_CHANNEL_5GHZ(pcl[1]) ||
-			(pcl[1] != first_connection_chnl &&
-			 pcl[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (pcl_len != 2) {
-			snprintf(reason, reason_length,
-				"more than 2 chnls");
-			return false;
-		}
-		break;
-	default:
-		snprintf(reason, reason_length,
-			"Unknown option");
-		status = false;
-	}
-	if (status == true) {
-		snprintf(reason, reason_length,
-			"success");
-	}
-	return status;
-}
-
-static void wlan_hdd_map_subtypes_hdd_wma(enum cds_con_mode *dst,
-		enum cds_con_mode *src)
-{
-	/*
-	 * wma defined sap subtype as 0
-	 * Rest of the mappings are same
-	 * In future, if mapping gets changed then re-map it here
-	 */
-	if (*src == CDS_SAP_MODE)
-		*dst = 0;
-	else
-		*dst = *src;
-}
-
-void wlan_hdd_one_connection_scenario(hdd_context_t *hdd_ctx)
-{
-	enum cds_con_mode sub_type;
-	enum cds_conc_priority_mode system_pref =
-			hdd_ctx->config->conc_system_pref;
-	uint8_t pcl[MAX_NUM_CHAN] = {0};
-	uint32_t pcl_len = 0;
-	bool status = false;
-	enum cds_pcl_type pcl_type;
-	char reason[20] = {0};
-	CDF_STATUS ret;
-
-	/* flush the entire table first */
-	ret = cds_init_policy_mgr();
-	if (!CDF_IS_STATUS_SUCCESS(ret)) {
-		hdd_err("Policy manager initialization failed");
-		return;
-	}
-
-	for (sub_type = 0; sub_type < CDS_MAX_NUM_OF_MODE; sub_type++) {
-		/* validate one connection is created or no */
-		if (cds_get_connection_count() != 0) {
-			hddLog(LOGE,
-				FL("Test failed - No. of connection is not 0"));
-			return;
-		}
-		cdf_mem_zero(pcl, sizeof(pcl));
-		pcl_len = 0;
-		pcl_type = get_pcl_from_first_conn_table(sub_type, system_pref);
-
-		/* check PCL value for second connection is correct or no */
-		cds_get_pcl(sub_type, pcl, &pcl_len);
-		status = wlan_hdd_validate_pcl(hdd_ctx,
-				pcl_type, pcl, pcl_len, 0, 0,
-				reason, sizeof(reason));
-		if ((pcl_type == CDS_MAX_PCL_TYPE) && (pcl[0] == 0))
-			continue;
-
-		fill_report(hdd_ctx, "1 connection", sub_type,
-				CDS_MAX_NUM_OF_MODE,
-				CDS_MAX_NUM_OF_MODE,
-				0, 0, 0,
-				status, pcl_type, reason, pcl);
-	}
-}
-
-void wlan_hdd_two_connections_scenario(hdd_context_t *hdd_ctx,
-		uint8_t first_chnl, enum cds_chain_mode first_chain_mask)
-{
-	uint8_t vdevid = 0, tx_stream = 2, rx_stream = 2;
-	uint8_t type = WMI_VDEV_TYPE_STA, channel_id = first_chnl, mac_id = 1;
-	uint8_t pcl[MAX_NUM_CHAN] = {0};
-	uint32_t pcl_len = 0;
-	enum cds_chain_mode chain_mask = first_chain_mask;
-	enum cds_con_mode sub_type, next_sub_type, dummy_type;
-	enum cds_conc_priority_mode system_pref =
-			hdd_ctx->config->conc_system_pref;
-	enum cds_pcl_type pcl_type;
-	enum cds_one_connection_mode second_index;
-	char reason[20] = {0};
-	bool status = false;
-	CDF_STATUS ret;
-
-	for (sub_type = CDS_STA_MODE;
-		sub_type < CDS_MAX_NUM_OF_MODE; sub_type++) {
-		type = wlan_hdd_valid_type_of_persona(sub_type);
-
-		/* flush the entire table first */
-		ret = cds_init_policy_mgr();
-		if (!CDF_IS_STATUS_SUCCESS(ret)) {
-			hdd_err("Policy manager initialization failed");
-			return;
-		}
-
-		/* sub_type mapping between HDD and WMA are different */
-		wlan_hdd_map_subtypes_hdd_wma(&dummy_type, &sub_type);
-		/* add first connection as STA */
-		cds_incr_connection_count_utfw(vdevid, tx_stream,
-				rx_stream, chain_mask, type, dummy_type,
-				channel_id, mac_id);
-		/* validate one connection is created or no */
-		if (cds_get_connection_count() != 1) {
-			hddLog(LOGE,
-				FL("Test failed - No. of connection is not 1"));
-			return;
-		}
-		next_sub_type = CDS_STA_MODE;
-		while (next_sub_type < CDS_MAX_NUM_OF_MODE) {
-			/* get the PCL value & check the channels accordingly */
-			second_index =
-				cds_get_second_connection_pcl_table_index();
-			if (CDS_MAX_ONE_CONNECTION_MODE == second_index) {
-				/* not valid combination*/
-				hddLog(LOGE, FL("couldn't find index for 2nd connection pcl table"));
-				next_sub_type++;
-				continue;
-			}
-			cdf_mem_zero(pcl, sizeof(pcl));
-			pcl_len = 0;
-			pcl_type = get_pcl_from_second_conn_table(second_index,
-					next_sub_type, system_pref,
-					wma_is_hw_dbs_capable());
-			/* check PCL for second connection is correct or no */
-			cds_get_pcl(next_sub_type, pcl, &pcl_len);
-			status = wlan_hdd_validate_pcl(hdd_ctx,
-					pcl_type, pcl, pcl_len, channel_id, 0,
-					reason, sizeof(reason));
-			if ((pcl_type == CDS_MAX_PCL_TYPE) && (pcl[0] == 0)) {
-				next_sub_type++;
-				continue;
-			}
-			fill_report(hdd_ctx, "2 connections", sub_type,
-					next_sub_type,
-					CDS_MAX_NUM_OF_MODE, first_chnl,
-					0, 0, status, pcl_type, reason, pcl);
-			next_sub_type++;
-		}
-	}
-}
-
-void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
-		uint8_t first_chnl, uint8_t second_chnl,
-		enum cds_chain_mode chain_mask, uint8_t use_same_mac)
-{
-	uint8_t vdevid_1 = 0, tx_stream_1 = 2, rx_stream_1 = 2;
-	uint8_t vdevid_2 = 1, tx_stream_2 = 2, rx_stream_2 = 2;
-	uint8_t channel_id_1 = first_chnl, channel_id_2 = second_chnl;
-	uint8_t mac_id_1, mac_id_2;
-	uint8_t type_1 = WMI_VDEV_TYPE_STA, type_2 = WMI_VDEV_TYPE_STA;
-	uint8_t pcl[MAX_NUM_CHAN] = {0};
-	uint32_t pcl_len = 0;
-	enum cds_chain_mode chain_mask_1;
-	enum cds_chain_mode chain_mask_2;
-	enum cds_con_mode sub_type_1, sub_type_2, next_sub_type;
-	enum cds_con_mode dummy_type_1, dummy_type_2;
-	enum cds_conc_priority_mode system_pref =
-			hdd_ctx->config->conc_system_pref;
-	enum cds_pcl_type pcl_type;
-	enum cds_two_connection_mode third_index;
-	char reason[20] = {0};
-	bool status = false;
-	CDF_STATUS ret;
-
-	/* let's set the chain_mask, mac_ids*/
-	if (chain_mask == CDS_TWO_TWO) {
-		mac_id_1 = 1;
-		mac_id_2 = 1;
-		chain_mask_1 = CDS_TWO_TWO;
-		chain_mask_2 = CDS_TWO_TWO;
-	} else if (use_same_mac == 1) {
-		mac_id_1 = 1;
-		mac_id_2 = 1;
-		chain_mask_1 = CDS_ONE_ONE;
-		chain_mask_2 = CDS_ONE_ONE;
-	} else {
-		mac_id_1 = 1;
-		mac_id_2 = 2;
-		chain_mask_1 = CDS_ONE_ONE;
-		chain_mask_2 = CDS_ONE_ONE;
-	}
-
-	for (sub_type_1 = CDS_STA_MODE;
-		sub_type_1 < CDS_MAX_NUM_OF_MODE; sub_type_1++) {
-
-		type_1 = wlan_hdd_valid_type_of_persona(sub_type_1);
-		/* flush the entire table first */
-		ret = cds_init_policy_mgr();
-		if (!CDF_IS_STATUS_SUCCESS(ret)) {
-			hdd_err("Policy manager initialization failed");
-			return;
-		}
-
-		/* sub_type mapping between HDD and WMA are different */
-		wlan_hdd_map_subtypes_hdd_wma(&dummy_type_1, &sub_type_1);
-		/* add first connection as STA */
-		cds_incr_connection_count_utfw(vdevid_1,
-			tx_stream_1, rx_stream_1, chain_mask_1, type_1,
-			dummy_type_1, channel_id_1, mac_id_1);
-		/* validate one connection is created or no */
-		if (cds_get_connection_count() != 1) {
-			hddLog(LOGE,
-				FL("Test fail - No. of connection not 1"));
-			return;
-		}
-		for (sub_type_2 = CDS_STA_MODE;
-			sub_type_2 < CDS_MAX_NUM_OF_MODE; sub_type_2++) {
-
-			type_2 = wlan_hdd_valid_type_of_persona(sub_type_2);
-			/* sub_type mapping between HDD and WMA are different */
-			wlan_hdd_map_subtypes_hdd_wma(&dummy_type_2,
-					&sub_type_2);
-			cds_incr_connection_count_utfw(vdevid_2,
-				tx_stream_2, rx_stream_2, chain_mask_2, type_2,
-				dummy_type_2, channel_id_2, mac_id_2);
-			/* validate two connections are created or no */
-			if (cds_get_connection_count() != 2) {
-				hddLog(LOGE,
-					FL("Test fail - No. connection not 2"));
-				return;
-			}
-			next_sub_type = CDS_STA_MODE;
-			while (next_sub_type < CDS_MAX_NUM_OF_MODE) {
-				third_index =
-				  cds_get_third_connection_pcl_table_index();
-				if (CDS_MAX_TWO_CONNECTION_MODE ==
-						third_index) {
-					/* not valid combination */
-					next_sub_type++;
-					continue;
-				}
-				cdf_mem_zero(pcl, sizeof(pcl));
-				pcl_len = 0;
-				pcl_type =
-					get_pcl_from_third_conn_table(
-					   third_index, next_sub_type,
-					   system_pref,
-					   wma_is_hw_dbs_capable());
-				cds_get_pcl(next_sub_type,
-						pcl, &pcl_len);
-				status = wlan_hdd_validate_pcl(hdd_ctx,
-						pcl_type, pcl, pcl_len,
-						channel_id_1, channel_id_2,
-						reason, sizeof(reason));
-				if ((pcl_type == CDS_MAX_PCL_TYPE) &&
-					(pcl[0] == 0)) {
-					next_sub_type++;
-					continue;
-				}
-				fill_report(hdd_ctx, "3 connections",
-					sub_type_1, sub_type_2,
-					next_sub_type, first_chnl,
-					second_chnl, 0, status,
-					pcl_type, reason, pcl);
-				next_sub_type++;
-			}
-			/* remove entry to make a room for next iteration */
-			cds_decr_connection_count(vdevid_2);
-		}
-		next_sub_type = CDS_STA_MODE;
-	}
-}

+ 0 - 654
core/hdd/src/wlan_hdd_debugfs.c

@@ -1,654 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_debugfs.c
- *
- * This driver currently supports the following debugfs files:
- * wlan_wcnss/wow_enable to enable/disable WoWL.
- * wlan_wcnss/wow_pattern to configure WoWL patterns.
- * wlan_wcnss/pattern_gen to configure periodic TX patterns.
- */
-
-#ifdef WLAN_OPEN_SOURCE
-#include <wlan_hdd_includes.h>
-#include <wlan_hdd_wowl.h>
-#include <cds_sched.h>
-
-#define MAX_USER_COMMAND_SIZE_WOWL_ENABLE 8
-#define MAX_USER_COMMAND_SIZE_WOWL_PATTERN 512
-#define MAX_USER_COMMAND_SIZE_FRAME 4096
-
-/**
- * __wcnss_wowenable_write() - wow_enable debugfs handler
- * @file: debugfs file handle
- * @buf: text being written to the debugfs
- * @count: size of @buf
- * @ppos: (unused) offset into the virtual file system
- *
- * Return: number of bytes processed
- */
-static ssize_t __wcnss_wowenable_write(struct file *file,
-				     const char __user *buf, size_t count,
-				     loff_t *ppos)
-{
-	hdd_adapter_t *pAdapter;
-	hdd_context_t *hdd_ctx;
-	char cmd[MAX_USER_COMMAND_SIZE_WOWL_ENABLE + 1];
-	char *sptr, *token;
-	uint8_t wow_enable = 0;
-	uint8_t wow_mp = 0;
-	uint8_t wow_pbm = 0;
-	int ret;
-
-	ENTER();
-
-	pAdapter = (hdd_adapter_t *)file->private_data;
-	if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Invalid adapter or adapter has invalid magic.",
-			  __func__);
-
-		return -EINVAL;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-
-	if (!sme_is_feature_supported_by_fw(WOW)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Wake-on-Wireless feature is not supported in firmware!",
-			  __func__);
-
-		return -EINVAL;
-	}
-
-	if (count > MAX_USER_COMMAND_SIZE_WOWL_ENABLE) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Command length is larger than %d bytes.",
-			  __func__, MAX_USER_COMMAND_SIZE_WOWL_ENABLE);
-
-		return -EINVAL;
-	}
-
-	/* Get command from user */
-	if (copy_from_user(cmd, buf, count))
-		return -EFAULT;
-	cmd[count] = '\0';
-	sptr = cmd;
-
-	/* Get enable or disable wow */
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-	if (kstrtou8(token, 0, &wow_enable))
-		return -EINVAL;
-
-	/* Disable wow */
-	if (!wow_enable) {
-		if (!hdd_exit_wowl(pAdapter)) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: hdd_exit_wowl failed!", __func__);
-
-			return -EFAULT;
-		}
-
-		return count;
-	}
-
-	/* Get enable or disable magic packet mode */
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-	if (kstrtou8(token, 0, &wow_mp))
-		return -EINVAL;
-	if (wow_mp > 1)
-		wow_mp = 1;
-
-	/* Get enable or disable pattern byte matching mode */
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-	if (kstrtou8(token, 0, &wow_pbm))
-		return -EINVAL;
-	if (wow_pbm > 1)
-		wow_pbm = 1;
-
-	if (!hdd_enter_wowl(pAdapter, wow_mp, wow_pbm)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: hdd_enter_wowl failed!", __func__);
-
-		return -EFAULT;
-	}
-	EXIT();
-	return count;
-}
-
-/**
- * wcnss_wowenable_write() - SSR wrapper for wcnss_wowenable_write
- * @file: file pointer
- * @buf: buffer
- * @count: count
- * @ppos: position pointer
- *
- * Return: 0 on success, error number otherwise
- */
-static ssize_t wcnss_wowenable_write(struct file *file,
-				 const char __user *buf,
-				 size_t count, loff_t *ppos)
-{
-	ssize_t ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wcnss_wowenable_write(file, buf, count, ppos);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wcnss_wowpattern_write() - wow_pattern debugfs handler
- * @file: debugfs file handle
- * @buf: text being written to the debugfs
- * @count: size of @buf
- * @ppos: (unused) offset into the virtual file system
- *
- * Return: number of bytes processed
- */
-static ssize_t __wcnss_wowpattern_write(struct file *file,
-				      const char __user *buf, size_t count,
-				      loff_t *ppos)
-{
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) file->private_data;
-	hdd_context_t *hdd_ctx;
-	char cmd[MAX_USER_COMMAND_SIZE_WOWL_PATTERN + 1];
-	char *sptr, *token;
-	uint8_t pattern_idx = 0;
-	uint8_t pattern_offset = 0;
-	char *pattern_buf;
-	char *pattern_mask;
-	int ret;
-
-	ENTER();
-
-	if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Invalid adapter or adapter has invalid magic.",
-			  __func__);
-
-		return -EINVAL;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (!sme_is_feature_supported_by_fw(WOW)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Wake-on-Wireless feature is not supported in firmware!",
-			  __func__);
-
-		return -EINVAL;
-	}
-
-	if (count > MAX_USER_COMMAND_SIZE_WOWL_PATTERN) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Command length is larger than %d bytes.",
-			  __func__, MAX_USER_COMMAND_SIZE_WOWL_PATTERN);
-
-		return -EINVAL;
-	}
-
-	/* Get command from user */
-	if (copy_from_user(cmd, buf, count))
-		return -EFAULT;
-	cmd[count] = '\0';
-	sptr = cmd;
-
-	/* Get pattern idx */
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-
-	if (kstrtou8(token, 0, &pattern_idx))
-		return -EINVAL;
-
-	/* Get pattern offset */
-	token = strsep(&sptr, " ");
-
-	/* Delete pattern if no further argument */
-	if (!token) {
-		hdd_del_wowl_ptrn_debugfs(pAdapter, pattern_idx);
-
-		return count;
-	}
-
-	if (kstrtou8(token, 0, &pattern_offset))
-		return -EINVAL;
-
-	/* Get pattern */
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-
-	pattern_buf = token;
-
-	/* Get pattern mask */
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-
-	pattern_mask = token;
-	pattern_mask[strlen(pattern_mask) - 1] = '\0';
-
-	hdd_add_wowl_ptrn_debugfs(pAdapter, pattern_idx, pattern_offset,
-				  pattern_buf, pattern_mask);
-	EXIT();
-	return count;
-}
-
-/**
- * wcnss_wowpattern_write() - SSR wrapper for __wcnss_wowpattern_write
- * @file: file pointer
- * @buf: buffer
- * @count: count
- * @ppos: position pointer
- *
- * Return: 0 on success, error number otherwise
- */
-static ssize_t wcnss_wowpattern_write(struct file *file,
-				      const char __user *buf,
-				      size_t count, loff_t *ppos)
-{
-	ssize_t ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wcnss_wowpattern_write(file, buf, count, ppos);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wcnss_patterngen_write() - pattern_gen debugfs handler
- * @file: debugfs file handle
- * @buf: text being written to the debugfs
- * @count: size of @buf
- * @ppos: (unused) offset into the virtual file system
- *
- * Return: number of bytes processed
- */
-static ssize_t __wcnss_patterngen_write(struct file *file,
-				      const char __user *buf, size_t count,
-				      loff_t *ppos)
-{
-	hdd_adapter_t *pAdapter;
-	hdd_context_t *pHddCtx;
-	tSirAddPeriodicTxPtrn *addPeriodicTxPtrnParams;
-	tSirDelPeriodicTxPtrn *delPeriodicTxPtrnParams;
-
-	char *cmd, *sptr, *token;
-	uint8_t pattern_idx = 0;
-	uint8_t pattern_duration = 0;
-	char *pattern_buf;
-	uint16_t pattern_len = 0;
-	uint16_t i = 0;
-	CDF_STATUS status;
-	int ret;
-
-	ENTER();
-
-	pAdapter = (hdd_adapter_t *)file->private_data;
-	if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Invalid adapter or adapter has invalid magic.",
-			  __func__);
-
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ret;
-
-	if (!sme_is_feature_supported_by_fw(WLAN_PERIODIC_TX_PTRN)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Periodic Tx Pattern Offload feature is not supported in firmware!",
-			  __func__);
-		return -EINVAL;
-	}
-
-	/* Get command from user */
-	if (count <= MAX_USER_COMMAND_SIZE_FRAME)
-		cmd = cdf_mem_malloc(count + 1);
-	else {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Command length is larger than %d bytes.",
-			  __func__, MAX_USER_COMMAND_SIZE_FRAME);
-
-		return -EINVAL;
-	}
-
-	if (!cmd) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  FL("Memory allocation for cmd failed!"));
-		return -ENOMEM;
-	}
-
-	if (copy_from_user(cmd, buf, count)) {
-		cdf_mem_free(cmd);
-		return -EFAULT;
-	}
-	cmd[count] = '\0';
-	sptr = cmd;
-
-	/* Get pattern idx */
-	token = strsep(&sptr, " ");
-	if (!token)
-		goto failure;
-	if (kstrtou8(token, 0, &pattern_idx))
-		goto failure;
-
-	if (pattern_idx > (MAXNUM_PERIODIC_TX_PTRNS - 1)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Pattern index %d is not in the range (0 ~ %d).",
-			  __func__, pattern_idx, MAXNUM_PERIODIC_TX_PTRNS - 1);
-
-		goto failure;
-	}
-
-	/* Get pattern duration */
-	token = strsep(&sptr, " ");
-	if (!token)
-		goto failure;
-	if (kstrtou8(token, 0, &pattern_duration))
-		goto failure;
-
-	/* Delete pattern using index if duration is 0 */
-	if (!pattern_duration) {
-		delPeriodicTxPtrnParams =
-			cdf_mem_malloc(sizeof(tSirDelPeriodicTxPtrn));
-		if (!delPeriodicTxPtrnParams) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  FL("Memory allocation failed!"));
-			cdf_mem_free(cmd);
-			return -ENOMEM;
-		}
-		delPeriodicTxPtrnParams->ucPtrnId = pattern_idx;
-		delPeriodicTxPtrnParams->ucPatternIdBitmap = 1 << pattern_idx;
-		cdf_copy_macaddr(&delPeriodicTxPtrnParams->mac_address,
-				 &pAdapter->macAddressCurrent);
-
-		/* Delete pattern */
-		status = sme_del_periodic_tx_ptrn(pHddCtx->hHal,
-						  delPeriodicTxPtrnParams);
-		if (CDF_STATUS_SUCCESS != status) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: sme_del_periodic_tx_ptrn() failed!",
-				  __func__);
-
-			cdf_mem_free(delPeriodicTxPtrnParams);
-			goto failure;
-		}
-		cdf_mem_free(cmd);
-		cdf_mem_free(delPeriodicTxPtrnParams);
-		return count;
-	}
-
-	/*
-	 * In SAP mode allow configuration without any connection check
-	 * In STA mode check if it's in connected state before adding
-	 * patterns
-	 */
-	hdd_info("device mode %d", pAdapter->device_mode);
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) &&
-	    (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter)))) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				"%s: Not in Connected state!", __func__);
-			goto failure;
-	}
-
-	/* Get pattern */
-	token = strsep(&sptr, " ");
-	if (!token)
-		goto failure;
-
-	pattern_buf = token;
-	pattern_buf[strlen(pattern_buf) - 1] = '\0';
-	pattern_len = strlen(pattern_buf);
-
-	/* Since the pattern is a hex string, 2 characters represent 1 byte. */
-	if (pattern_len % 2) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Malformed pattern!", __func__);
-
-		goto failure;
-	} else
-		pattern_len >>= 1;
-
-	if (pattern_len < 14 || pattern_len > PERIODIC_TX_PTRN_MAX_SIZE) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Not an 802.3 frame!", __func__);
-
-		goto failure;
-	}
-
-	addPeriodicTxPtrnParams = cdf_mem_malloc(sizeof(tSirAddPeriodicTxPtrn));
-	if (!addPeriodicTxPtrnParams) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  FL("Memory allocation failed!"));
-		cdf_mem_free(cmd);
-		return -ENOMEM;
-	}
-
-	addPeriodicTxPtrnParams->ucPtrnId = pattern_idx;
-	addPeriodicTxPtrnParams->usPtrnIntervalMs = pattern_duration * 500;
-	addPeriodicTxPtrnParams->ucPtrnSize = pattern_len;
-	cdf_copy_macaddr(&addPeriodicTxPtrnParams->mac_address,
-			 &pAdapter->macAddressCurrent);
-
-	/* Extract the pattern */
-	for (i = 0; i < addPeriodicTxPtrnParams->ucPtrnSize; i++) {
-		addPeriodicTxPtrnParams->ucPattern[i] =
-			(hex_to_bin(pattern_buf[0]) << 4) +
-			hex_to_bin(pattern_buf[1]);
-
-		/* Skip to next byte */
-		pattern_buf += 2;
-	}
-
-	/* Add pattern */
-	status = sme_add_periodic_tx_ptrn(pHddCtx->hHal,
-					  addPeriodicTxPtrnParams);
-	if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: sme_add_periodic_tx_ptrn() failed!", __func__);
-
-		cdf_mem_free(addPeriodicTxPtrnParams);
-		goto failure;
-	}
-	cdf_mem_free(cmd);
-	cdf_mem_free(addPeriodicTxPtrnParams);
-	EXIT();
-	return count;
-
-failure:
-	cdf_mem_free(cmd);
-	return -EINVAL;
-}
-
-/**
- * wcnss_patterngen_write() - SSR wrapper for __wcnss_patterngen_write
- * @file: file pointer
- * @buf: buffer
- * @count: count
- * @ppos: position pointer
- *
- * Return: 0 on success, error number otherwise
- */
-static ssize_t wcnss_patterngen_write(struct file *file,
-				      const char __user *buf,
-				      size_t count, loff_t *ppos)
-{
-	ssize_t ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wcnss_patterngen_write(file, buf, count, ppos);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wcnss_debugfs_open() - Generic debugfs open() handler
- * @inode: inode of the debugfs file
- * @file: file handle of the debugfs file
- *
- * Return: 0
- */
-static int __wcnss_debugfs_open(struct inode *inode, struct file *file)
-{
-	hdd_adapter_t *adapter;
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	if (inode->i_private)
-		file->private_data = inode->i_private;
-
-	adapter = (hdd_adapter_t *)file->private_data;
-	if ((NULL == adapter) || (WLAN_HDD_ADAPTER_MAGIC != adapter->magic)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Invalid adapter or adapter has invalid magic.",
-			  __func__);
-		return -EINVAL;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-	EXIT();
-	return 0;
-}
-
-/**
- * wcnss_debugfs_open() - SSR wrapper for __wcnss_debugfs_open
- * @inode: inode pointer
- * @file: file pointer
- *
- * Return: 0 on success, error number otherwise
- */
-static int wcnss_debugfs_open(struct inode *inode, struct file *file)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wcnss_debugfs_open(inode, file);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct file_operations fops_wowenable = {
-	.write = wcnss_wowenable_write,
-	.open = wcnss_debugfs_open,
-	.owner = THIS_MODULE,
-	.llseek = default_llseek,
-};
-
-static const struct file_operations fops_wowpattern = {
-	.write = wcnss_wowpattern_write,
-	.open = wcnss_debugfs_open,
-	.owner = THIS_MODULE,
-	.llseek = default_llseek,
-};
-
-static const struct file_operations fops_patterngen = {
-	.write = wcnss_patterngen_write,
-	.open = wcnss_debugfs_open,
-	.owner = THIS_MODULE,
-	.llseek = default_llseek,
-};
-
-/**
- * hdd_debugfs_init() - Initialize debugfs interface
- * @pAdapter: primary wlan adapter
- *
- * Register support for the debugfs files supported by the driver.
- *
- * NB: The current implementation only supports debugfs operations
- * on the primary interface, i.e. wlan0
- *
- * Return: CDF_STATUS_SUCCESS if all files registered,
- *	   CDF_STATUS_E_FAILURE on failure
- */
-CDF_STATUS hdd_debugfs_init(hdd_adapter_t *pAdapter)
-{
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	pHddCtx->debugfs_phy = debugfs_create_dir("wlan_wcnss", 0);
-
-	if (NULL == pHddCtx->debugfs_phy)
-		return CDF_STATUS_E_FAILURE;
-
-	if (NULL == debugfs_create_file("wow_enable", S_IRUSR | S_IWUSR,
-					pHddCtx->debugfs_phy, pAdapter,
-					&fops_wowenable))
-		return CDF_STATUS_E_FAILURE;
-
-	if (NULL == debugfs_create_file("wow_pattern", S_IRUSR | S_IWUSR,
-					pHddCtx->debugfs_phy, pAdapter,
-					&fops_wowpattern))
-		return CDF_STATUS_E_FAILURE;
-
-	if (NULL == debugfs_create_file("pattern_gen", S_IRUSR | S_IWUSR,
-					pHddCtx->debugfs_phy, pAdapter,
-					&fops_patterngen))
-		return CDF_STATUS_E_FAILURE;
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_debugfs_exit() - Shutdown debugfs interface
- * @pHddCtx: the global HDD context
- *
- * Unregister support for the debugfs files supported by the driver.
- *
- * Return: None
- */
-void hdd_debugfs_exit(hdd_context_t *pHddCtx)
-{
-	debugfs_remove_recursive(pHddCtx->debugfs_phy);
-}
-#endif /* #ifdef WLAN_OPEN_SOURCE */

+ 0 - 924
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1,924 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/* denote that this file does not allow legacy hddLog */
-#define HDD_DISALLOW_LEGACY_HDDLOG 1
-
-#include <linux/platform_device.h>
-#include <linux/pci.h>
-#ifdef HIF_PCI
-#ifdef CONFIG_CNSS
-#include <net/cnss.h>
-#endif /* CONFIG_CNSS */
-#else
-#include <soc/qcom/icnss.h>
-#endif /* HIF_PCI */
-#include "cds_api.h"
-#include "cdf_status.h"
-#include "cdf_lock.h"
-#include "cds_sched.h"
-#include "osdep.h"
-#include "hif.h"
-#include "htc.h"
-#include "epping_main.h"
-#include "wlan_hdd_main.h"
-#include "wlan_hdd_power.h"
-#include "wlan_logging_sock_svc.h"
-#include "wma_api.h"
-#include "wlan_hdd_napi.h"
-#include "cds_concurrency.h"
-#include "qwlan_version.h"
-
-#ifdef MODULE
-#define WLAN_MODULE_NAME  module_name(THIS_MODULE)
-#else
-#define WLAN_MODULE_NAME  "wlan"
-#endif
-
-#ifdef HIF_PCI
-#ifdef CONFIG_CNSS
-#define WLAN_HDD_REGISTER_DRIVER(wlan_drv_ops) \
-	cnss_wlan_register_driver(wlan_drv_ops)
-#define WLAN_HDD_UNREGISTER_DRIVER(wlan_drv_ops) \
-	cnss_wlan_unregister_driver(wlan_drv_ops)
-#else
-#define WLAN_HDD_REGISTER_DRIVER(wlan_drv_ops) \
-	pci_register_driver(wlan_drv_ops)
-#define WLAN_HDD_UNREGISTER_DRIVER(wlan_drv_ops) \
-	pci_unregister_driver(wlan_drv_ops)
-#endif /* CONFIG_CNSS */
-#else
-#define WLAN_HDD_REGISTER_DRIVER(wlan_drv_ops) \
-	icnss_register_driver(wlan_drv_ops)
-#define WLAN_HDD_UNREGISTER_DRIVER(wlan_drv_ops) \
-	icnss_unregister_driver(wlan_drv_ops)
-#endif /* HIF_PCI */
-#define DISABLE_KRAIT_IDLE_PS_VAL	1
-
-/*
- * In BMI Phase we are only sending small chunk (256 bytes) of the FW image at
- * a time, and wait for the completion interrupt to start the next transfer.
- * During this phase, the KRAIT is entering IDLE/StandAlone(SA) Power Save(PS).
- * The delay incurred for resuming from IDLE/SA PS is huge during driver load.
- * So prevent APPS IDLE/SA PS durint driver load for reducing interrupt latency.
- */
-#ifdef CONFIG_CNSS
-static inline void hdd_request_pm_qos(int val)
-{
-	cnss_request_pm_qos(val);
-}
-
-static inline void hdd_remove_pm_qos(void)
-{
-	cnss_remove_pm_qos();
-}
-#else
-static inline void hdd_request_pm_qos(int val)
-{
-}
-
-static inline void hdd_remove_pm_qos(void)
-{
-}
-#endif
-
-/**
- * hdd_hif_open() - HIF open helper
- * @dev: wlan device structure
- * @bdev: bus device structure
- * @bid: bus identifier for shared busses
- * @bus_type: underlying bus type
- * @reinit: true if we are reinitializing the driver during recovery phase
- *
- * This function brings-up HIF layer during load/recovery phase.
- *
- * Return: 0 on success and errno on failure.
- */
-static int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid,
-			enum ath_hal_bus_type bus_type, bool reinit)
-{
-	CDF_STATUS status;
-	int ret = 0;
-	void *hif_ctx;
-
-	status = hif_open(bus_type);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hdd_err("hif_open error = %d", status);
-		return cdf_status_to_os_return(status);
-	}
-
-	hif_ctx = cds_get_context(CDF_MODULE_ID_HIF);
-
-	ret = hdd_napi_create();
-	if (hdd_napi_enabled(HDD_NAPI_ANY)) {
-		hdd_info("hdd_napi_create returned: %d", status);
-		if (ret <= 0) {
-			hdd_err("NAPI creation error, rc: 0x%x, reinit = %d",
-				status, reinit);
-			ret = -EFAULT;
-			goto err_hif_close;
-		}
-	}
-
-	status = hif_enable(hif_ctx, dev, bdev, bid, bus_type,
-			    (reinit == true) ?  HIF_ENABLE_TYPE_REINIT :
-			    HIF_ENABLE_TYPE_PROBE);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hdd_err("hif_enable error = %d, reinit = %d",
-			status, reinit);
-		ret = cdf_status_to_os_return(status);
-		goto err_napi_destroy;
-	}
-
-	return 0;
-
-err_napi_destroy:
-	hdd_napi_destroy(true);
-
-err_hif_close:
-	hif_close(hif_ctx);
-
-	return ret;
-
-}
-
-/**
- * hdd_hif_close() - HIF close helper
- * @hif_ctx:	HIF context
- *
- * Helper function to close HIF
- */
-static void hdd_hif_close(void *hif_ctx)
-{
-	if (hif_ctx == NULL)
-		return;
-
-	hif_disable(hif_ctx, HIF_DISABLE_TYPE_REMOVE);
-
-	hdd_napi_destroy(true);
-
-	hif_close(hif_ctx);
-}
-
-/**
- * wlan_hdd_probe() - handles probe request
- *
- * This function is called to probe the wlan driver
- *
- * @dev: wlan device structure
- * @bdev: bus device structure
- * @bid: bus identifier for shared busses
- * @bus_type: underlying bus type
- * @reinit: true if we are reinitiallizing the driver after a subsystem restart
- *
- * Return: 0 on successfull probe
- */
-static int wlan_hdd_probe(struct device *dev, void *bdev, const hif_bus_id *bid,
-	enum ath_hal_bus_type bus_type, bool reinit)
-{
-	void *hif_ctx;
-	CDF_STATUS status;
-	int ret = 0;
-
-	pr_info("%s: %sprobing driver v%s\n", WLAN_MODULE_NAME,
-		reinit ? "re-" : "", QWLAN_VERSIONSTR);
-
-	hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT);
-
-	/*
-	* The Krait is going to Idle/Stand Alone Power Save
-	* more aggressively which is resulting in the longer driver load time.
-	* The Fix is to not allow Krait to enter Idle Power Save during driver
-	* load.
-	*/
-	hdd_request_pm_qos(DISABLE_KRAIT_IDLE_PS_VAL);
-
-	if (reinit) {
-		cds_set_recovery_in_progress(true);
-	} else {
-		ret = hdd_init();
-
-		if (ret)
-			goto out;
-		cds_set_load_in_progress(true);
-	}
-
-	if (WLAN_IS_EPPING_ENABLED(cds_get_conparam())) {
-		status = epping_open();
-		if (status != CDF_STATUS_SUCCESS)
-			goto err_hdd_deinit;
-	}
-
-	ret = hdd_hif_open(dev, bdev, bid, bus_type, reinit);
-
-	if (ret)
-		goto err_epping_close;
-
-	hif_ctx = cds_get_context(CDF_MODULE_ID_HIF);
-
-	if (reinit)
-		ret = hdd_wlan_re_init(hif_ctx);
-	else
-		ret = hdd_wlan_startup(dev, hif_ctx);
-
-	if (ret)
-		goto err_hif_close;
-
-	hif_enable_power_management(hif_ctx);
-
-	if (reinit) {
-		cds_set_recovery_in_progress(false);
-	} else {
-		cds_set_load_in_progress(false);
-		cds_set_driver_loaded(true);
-	}
-
-	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT);
-	hdd_remove_pm_qos();
-
-	return 0;
-
-err_hif_close:
-	hdd_hif_close(hif_ctx);
-err_epping_close:
-	if (WLAN_IS_EPPING_ENABLED(cds_get_conparam()))
-		epping_close();
-err_hdd_deinit:
-	cds_set_load_in_progress(false);
-	hdd_deinit();
-out:
-	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT);
-	hdd_remove_pm_qos();
-	return ret;
-}
-
-#ifdef CONFIG_CNSS
-static inline void hdd_cnss_driver_unloading(void)
-{
-	cnss_set_driver_status(CNSS_LOAD_UNLOAD);
-}
-#else
-static inline void hdd_cnss_driver_unloading(void) { }
-#endif
-
-
-/**
- * wlan_hdd_remove() - wlan_hdd_remove
- *
- * This function is called by the platform driver to remove the
- * driver
- *
- * Return: void
- */
-static void wlan_hdd_remove(void)
-{
-	void *hif_ctx;
-
-	pr_info("%s: Removing driver v%s\n", WLAN_MODULE_NAME,
-		QWLAN_VERSIONSTR);
-
-	/* Wait for recovery to complete */
-	while (cds_is_driver_recovering()) {
-		hdd_alert("Recovery in progress; wait here!!!");
-		msleep(1000);
-	}
-
-	cds_set_driver_loaded(false);
-	cds_set_unload_in_progress(true);
-
-	if (!cds_wait_for_external_threads_completion(__func__))
-		hdd_err("External threads are still active attempting driver unload anyway");
-
-	hdd_cnss_driver_unloading();
-
-	hif_ctx = cds_get_context(CDF_MODULE_ID_HIF);
-
-	hif_disable_power_management(hif_ctx);
-	hif_pktlogmod_exit(hif_ctx);
-
-	if (WLAN_IS_EPPING_ENABLED(cds_get_conparam())) {
-		epping_disable();
-		epping_close();
-	} else {
-		__hdd_wlan_exit();
-	}
-
-	hdd_hif_close(hif_ctx);
-
-	hdd_deinit();
-
-	pr_info("%s: Driver Removed\n", WLAN_MODULE_NAME);
-}
-
-/**
- * wlan_hdd_shutdown() - wlan_hdd_shutdown
- *
- * This is routine is called by platform driver to shutdown the
- * driver
- *
- * Return: void
- */
-static void wlan_hdd_shutdown(void)
-{
-	void *hif_ctx = cds_get_context(CDF_MODULE_ID_HIF);
-
-	if (cds_is_load_or_unload_in_progress()) {
-		hdd_err("Load/unload in progress, ignore SSR shutdown");
-		return;
-	}
-	/* this is for cases, where shutdown invoked from CNSS */
-	cds_set_recovery_in_progress(true);
-
-	if (cds_get_conparam() != CDF_GLOBAL_FTM_MODE &&
-	    !WLAN_IS_EPPING_ENABLED(cds_get_conparam()))
-		hif_pktlogmod_exit(hif_ctx);
-
-	if (!cds_wait_for_external_threads_completion(__func__))
-		hdd_err("Host is not ready for SSR, attempting anyway");
-
-	if (!WLAN_IS_EPPING_ENABLED(cds_get_conparam())) {
-		hif_disable_isr(hif_ctx);
-		hdd_wlan_shutdown();
-	}
-
-	hdd_hif_close(hif_ctx);
-}
-
-/**
- * wlan_hdd_crash_shutdown() - wlan_hdd_crash_shutdown
- *
- * HDD crash shutdown funtion: This function is called by
- * platfrom driver's crash shutdown routine
- *
- * Return: void
- */
-void wlan_hdd_crash_shutdown(void)
-{
-	hif_crash_shutdown(cds_get_context(CDF_MODULE_ID_HIF));
-}
-
-/**
- * wlan_hdd_notify_handler() - wlan_hdd_notify_handler
- *
- * This function is called by the platform driver to notify the
- * COEX
- *
- * @state: state
- *
- * Return: void
- */
-void wlan_hdd_notify_handler(int state)
-{
-	if (!WLAN_IS_EPPING_ENABLED(cds_get_conparam())) {
-		int ret = 0;
-		ret = hdd_wlan_notify_modem_power_state(state);
-		if (ret < 0)
-			hdd_err("Fail to send notify");
-	}
-}
-
-/**
- * __wlan_hdd_bus_suspend() - handles platform supsend
- * @state: suspend message from the kernel
- *
- * Does precondtion validation. Ensures that a subsystem restart isn't in
- * progress.  Ensures that no load or unload is in progress.
- * Calls ol_txrx_bus_suspend to ensure the layer is ready for a bus suspend.
- * Calls wma_suspend to configure offloads.
- * Calls hif_suspend to suspend the bus.
- *
- * Return: 0 for success, -EFAULT for null pointers,
- *     -EBUSY or -EAGAIN if another opperation is in progress and
- *     wlan will not be ready to suspend in time.
- */
-static int __wlan_hdd_bus_suspend(pm_message_t state)
-{
-	void *hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	int err = wlan_hdd_validate_context(hdd_ctx);
-	int status;
-
-	hdd_info("event %d", state.event);
-
-	if (err)
-		goto done;
-
-	err = cdf_status_to_os_return(
-			ol_txrx_bus_suspend());
-	if (err)
-		goto done;
-
-	err = wma_bus_suspend();
-	if (err)
-		goto resume_oltxrx;
-
-	err = hif_bus_suspend();
-	if (err)
-		goto resume_wma;
-
-	hdd_info("suspend done, status = %d", err);
-	return err;
-
-resume_wma:
-	status = wma_bus_resume();
-	CDF_BUG(!status);
-resume_oltxrx:
-	status = ol_txrx_bus_resume();
-	CDF_BUG(!status);
-done:
-	hdd_err("suspend done, status = %d", err);
-	return err;
-}
-
-/**
- * wlan_hdd_bus_suspend() - suspend the wlan bus
- *
- * This function is called by the platform driver to suspend the
- * wlan bus
- *
- * @state: state
- *
- * Return: CDF_STATUS
- */
-int wlan_hdd_bus_suspend(pm_message_t state)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_bus_suspend(state);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_bus_resume() - handles platform resume
- *
- * Does precondtion validation. Ensures that a subsystem restart isn't in
- * progress.  Ensures that no load or unload is in progress.  Ensures that
- * it has valid pointers for the required contexts.
- * Calls into hif to resume the bus opperation.
- * Calls into wma to handshake with firmware and notify it that the bus is up.
- * Calls into ol_txrx for symetry.
- * Failures are treated as catastrophic.
- *
- * return: error code or 0 for success
- */
-static int __wlan_hdd_bus_resume(void)
-{
-	void *hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	int status = wlan_hdd_validate_context(hdd_ctx);
-
-	if (0 != status) {
-		hdd_err("HDD context is not valid");
-		return status;
-	}
-
-	status = hif_bus_resume();
-	CDF_BUG(!status);
-
-	status = wma_bus_resume();
-	CDF_BUG(!status);
-
-	status = ol_txrx_bus_resume();
-	CDF_BUG(!status);
-
-	hdd_info("resume done");
-	return status;
-}
-
-/**
- * wlan_hdd_bus_resume(): wake up the bus
- *
- * This function is called by the platform driver to resume wlan
- * bus
- *
- * Return: void
- */
-static int wlan_hdd_bus_resume(void)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_bus_resume();
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#ifdef FEATURE_RUNTIME_PM
-/**
- * __wlan_hdd_runtime_suspend() - suspend the wlan bus without apps suspend
- *
- * Each layer is responsible for its own suspend actions.  wma_runtime_suspend
- * takes care of the parts of the 802.11 suspend that we want to do for runtime
- * suspend.
- *
- * Return: 0 or errno
- */
-static int __wlan_hdd_runtime_suspend(void)
-{
-	void *hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	int status = wlan_hdd_validate_context(hdd_ctx);
-
-	if (0 != status)
-		goto process_failure;
-
-	status = hif_pre_runtime_suspend();
-	if (status)
-		goto process_failure;
-
-	status = htc_runtime_suspend();
-	if (status)
-		goto process_failure;
-
-	status = wma_runtime_suspend();
-	if (status)
-		goto resume_htc;
-
-	status = hif_runtime_suspend();
-	if (status)
-		goto resume_wma;
-
-	status = cnss_auto_suspend();
-	if (status)
-		goto resume_hif;
-
-	hif_process_runtime_suspend_success();
-	return status;
-
-resume_hif:
-	CDF_BUG(!hif_runtime_resume());
-resume_wma:
-	CDF_BUG(!wma_runtime_resume());
-resume_htc:
-	CDF_BUG(!htc_runtime_resume());
-process_failure:
-	hif_process_runtime_suspend_failure();
-	return status;
-}
-
-
-/**
- * wlan_hdd_runtime_suspend() - suspend the wlan bus without apps suspend
- *
- * This function is called by the platform driver to suspend the
- * wlan bus separately from system suspend
- *
- * Return: 0 or errno
- */
-static int wlan_hdd_runtime_suspend(void)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_runtime_suspend();
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_runtime_resume() - resume the wlan bus from runtime suspend
- *
- * Sets the runtime pm state and coordinates resume between hif wma and
- * ol_txrx.
- *
- * Return: success since failure is a bug
- */
-static int __wlan_hdd_runtime_resume(void)
-{
-	hif_pre_runtime_resume();
-	CDF_BUG(!cnss_auto_resume());
-	CDF_BUG(!hif_runtime_resume());
-	CDF_BUG(!wma_runtime_resume());
-	CDF_BUG(!htc_runtime_resume());
-	hif_process_runtime_resume_success();
-	return 0;
-}
-
-/**
- * wlan_hdd_runtime_resume() - resume the wlan bus from runtime suspend
- *
- * This function is called by the platform driver to resume the
- * wlan bus separately from system suspend
- *
- * Return: success since failure is a bug
- */
-static int wlan_hdd_runtime_resume(void)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_runtime_resume();
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-#endif
-
-#ifdef HIF_PCI
-/**
- * wlan_hdd_pci_probe() - probe callback for pci platform driver
- * @pdev: bus dev
- *
- * Return: void
- */
-static int wlan_hdd_pci_probe(struct pci_dev *pdev,
-	const struct pci_device_id *id)
-{
-	return wlan_hdd_probe(&pdev->dev, pdev, (void *)id,
-			HAL_BUS_TYPE_PCI, false);
-}
-
-/**
- * wlan_hdd_pci_remove() - wlan_hdd_pci_remove
- *
- * Return: void
- */
-void wlan_hdd_pci_remove(struct pci_dev *pdev)
-{
-	wlan_hdd_remove();
-}
-
-/**
- * wlan_hdd_pci_reinit() - wlan_hdd_pci_reinit
- * @pdev: bus dev
- * @id: bus id
- *
- * Return: int
- */
-int wlan_hdd_pci_reinit(struct pci_dev *pdev,
-	const struct pci_device_id *id)
-{
-	return wlan_hdd_probe(&pdev->dev, pdev, id,
-			HAL_BUS_TYPE_PCI, true);
-}
-
-/**
- * wlan_hdd_pci_shutdown() - wlan_hdd_pci_shutdown
- * @pdev: pdev
- *
- * Return: void
- */
-void wlan_hdd_pci_shutdown(struct pci_dev *pdev)
-{
-	wlan_hdd_shutdown();
-}
-
-/**
- * wlan_hdd_pci_crash_shutdown() - wlan_hdd_pci_crash_shutdown
- * @pdev: pdev
- *
- * Return: void
- */
-void wlan_hdd_pci_crash_shutdown(struct pci_dev *pdev)
-{
-	wlan_hdd_crash_shutdown();
-}
-
-/**
- * wlan_hdd_pci_notify_handler() - wlan_hdd_pci_notify_handler
- * @pdev: pdev
- * @state: state
- *
- * Return: void
- */
-void wlan_hdd_pci_notify_handler(struct pci_dev *pdev, int state)
-{
-	wlan_hdd_notify_handler(state);
-}
-
-/**
- * wlan_hdd_pci_suspend() - wlan_hdd_pci_suspend
- * @pdev: pdev
- * @state: state
- *
- * Return: void
- */
-static int wlan_hdd_pci_suspend(struct pci_dev *pdev, pm_message_t state)
-{
-	return wlan_hdd_bus_suspend(state);
-}
-
-/**
- * wlan_hdd_pci_resume() - wlan_hdd_pci_resume
- * @pdev: pdev
- *
- * Return: void
- */
-static int wlan_hdd_pci_resume(struct pci_dev *pdev)
-{
-	return wlan_hdd_bus_resume();
-}
-
-#ifdef FEATURE_RUNTIME_PM
-/**
- * wlan_hdd_pci_runtime_suspend() - wlan_hdd_pci_suspend
- * @pdev: pdev
- * @state: state
- *
- * Return: success or errno
- */
-static int wlan_hdd_pci_runtime_suspend(struct pci_dev *pdev)
-{
-	return wlan_hdd_runtime_suspend();
-}
-
-/**
- * wlan_hdd_pci_runtime_resume() - runtime resume callback to register with pci
- * @pdev: pci device id
- *
- * Return: success or errno
- */
-static int wlan_hdd_pci_runtime_resume(struct pci_dev *pdev)
-{
-	return wlan_hdd_runtime_resume();
-}
-#endif
-
-#else
-/**
- * wlan_hdd_snoc_probe() - wlan_hdd_snoc_probe
- * @dev: dev
- *
- * Return: int
- */
-static int wlan_hdd_snoc_probe(struct device *dev)
-{
-	return wlan_hdd_probe(dev, NULL, NULL, HAL_BUS_TYPE_SNOC, false);
-}
-
-/**
- * wlan_hdd_snoc_remove() - wlan_hdd_snoc_remove
- * @dev: dev
- *
- * Return: void
- */
-void wlan_hdd_snoc_remove(struct device *dev)
-{
-	wlan_hdd_remove();
-}
-
-/**
- * wlan_hdd_snoc_shutdown() - wlan_hdd_snoc_shutdown
- * @dev: dev
- *
- * Return: void
- */
-void wlan_hdd_snoc_shutdown(struct device *dev)
-{
-	wlan_hdd_shutdown();
-}
-
-/**
- * wlan_hdd_snoc_reinit() - wlan_hdd_snoc_reinit
- * @dev: dev
- *
- * Return: int
- */
-int wlan_hdd_snoc_reinit(struct device *dev)
-{
-	return wlan_hdd_probe(dev, NULL, NULL, HAL_BUS_TYPE_SNOC, true);
-}
-
-/**
- * wlan_hdd_snoc_crash_shutdown() - wlan_hdd_snoc_crash_shutdown
- * @dev: dev
- *
- * Return: void
- */
-void wlan_hdd_snoc_crash_shutdown(void *pdev)
-{
-	wlan_hdd_crash_shutdown();
-}
-
-/**
- * wlan_hdd_snoc_suspend() - wlan_hdd_snoc_suspend
- * @dev: dev
- * @state: state
- *
- * Return: int
- */
-static int wlan_hdd_snoc_suspend(struct device *dev, pm_message_t state)
-{
-	return wlan_hdd_bus_suspend(state);
-}
-
-/**
- * wlan_hdd_snoc_resume() - wlan_hdd_snoc_resume
- * @dev: dev
- *
- * Return: int
- */
-static int wlan_hdd_snoc_resume(struct device *dev)
-{
-	return wlan_hdd_bus_resume();
-}
-#endif /* HIF_PCI */
-
-#ifdef HIF_PCI
-static struct pci_device_id wlan_hdd_pci_id_table[] = {
-	{ 0x168c, 0x003c, PCI_ANY_ID, PCI_ANY_ID },
-	{ 0x168c, 0x003e, PCI_ANY_ID, PCI_ANY_ID },
-	{ 0x168c, 0x0041, PCI_ANY_ID, PCI_ANY_ID },
-	{ 0x168c, 0xabcd, PCI_ANY_ID, PCI_ANY_ID },
-	{ 0x168c, 0x7021, PCI_ANY_ID, PCI_ANY_ID },
-	{ 0 }
-};
-
-#ifdef CONFIG_CNSS
-
-#ifdef FEATURE_RUNTIME_PM
-struct cnss_wlan_runtime_ops runtime_pm_ops = {
-	.runtime_suspend = wlan_hdd_pci_runtime_suspend,
-	.runtime_resume = wlan_hdd_pci_runtime_resume,
-};
-#endif
-
-struct cnss_wlan_driver wlan_drv_ops = {
-	.name       = "wlan_hdd_pci",
-	.id_table   = wlan_hdd_pci_id_table,
-	.probe      = wlan_hdd_pci_probe,
-	.remove     = wlan_hdd_pci_remove,
-	.reinit     = wlan_hdd_pci_reinit,
-	.shutdown   = wlan_hdd_pci_shutdown,
-	.crash_shutdown = wlan_hdd_pci_crash_shutdown,
-	.modem_status   = wlan_hdd_pci_notify_handler,
-#ifdef ATH_BUS_PM
-	.suspend    = wlan_hdd_pci_suspend,
-	.resume     = wlan_hdd_pci_resume,
-#endif /* ATH_BUS_PM */
-#ifdef FEATURE_RUNTIME_PM
-	.runtime_ops = &runtime_pm_ops,
-#endif
-};
-#else
-MODULE_DEVICE_TABLE(pci, wlan_hdd_pci_id_table);
-struct pci_driver wlan_drv_ops = {
-	.name       = "wlan_hdd_pci",
-	.id_table   = wlan_hdd_pci_id_table,
-	.probe      = wlan_hdd_pci_probe,
-	.remove     = wlan_hdd_pci_remove,
-#ifdef ATH_BUS_PM
-	.suspend    = wlan_hdd_pci_suspend,
-	.resume     = wlan_hdd_pci_resume,
-#endif /* ATH_BUS_PM */
-
-};
-#endif /* CONFIG_CNSS */
-#else
-struct icnss_driver_ops wlan_drv_ops = {
-	.name       = "wlan_hdd_drv",
-	.probe      = wlan_hdd_snoc_probe,
-	.remove     = wlan_hdd_snoc_remove,
-	.shutdown   = wlan_hdd_snoc_shutdown,
-	.reinit     = wlan_hdd_snoc_reinit,
-	.crash_shutdown = wlan_hdd_snoc_crash_shutdown,
-	.suspend    = wlan_hdd_snoc_suspend,
-	.resume     = wlan_hdd_snoc_resume,
-};
-#endif
-
-/**
- * wlan_hdd_register_driver() - wlan_hdd_register_driver
- *
- * Return: int
- */
-int wlan_hdd_register_driver(void)
-{
-	return WLAN_HDD_REGISTER_DRIVER(&wlan_drv_ops);
-}
-
-/**
- * wlan_hdd_unregister_driver() - wlan_hdd_unregister_driver
- *
- * Return: void
- */
-void wlan_hdd_unregister_driver(void)
-{
-	WLAN_HDD_UNREGISTER_DRIVER(&wlan_drv_ops);
-}

+ 0 - 4631
core/hdd/src/wlan_hdd_ext_scan.c

@@ -1,4631 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_ext_scan.c
- *
- * WLAN Host Device Driver EXT SCAN feature implementation
- *
- */
-
-#ifdef FEATURE_WLAN_EXTSCAN
-
-#include "wlan_hdd_ext_scan.h"
-#include "cds_utils.h"
-#include "cds_sched.h"
-
-/* amount of time to wait for a synchronous request/response operation */
-#define WLAN_WAIT_TIME_EXTSCAN  1000
-
-/**
- * struct hdd_ext_scan_context - hdd ext scan context
- * @request_id: userspace-assigned ID associated with the request
- * @response_event: Ext scan wait event
- * @response_status: Status returned by FW in response to a request
- * @ignore_cached_results: Flag to ignore cached results or not
- * @context_lock: Spinlock to serialize all context accesses
- * @capability_response: Ext scan capability response data from target
- */
-struct hdd_ext_scan_context {
-	uint32_t request_id;
-	int response_status;
-	bool ignore_cached_results;
-	struct completion response_event;
-	spinlock_t context_lock;
-	struct ext_scan_capabilities_response capability_response;
-};
-static struct hdd_ext_scan_context ext_scan_context;
-
-static const struct nla_policy wlan_hdd_extscan_config_policy
-[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL] = {.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE] = {.type = NLA_U8},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CLASS] = {.type = NLA_U8},
-
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX] = {.type = NLA_U8},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND] = {.type = NLA_U8},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD] = {.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS] = {
-				.type = NLA_U8},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT] = {
-				.type = NLA_U8},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS] = {
-				.type = NLA_U8 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS] = {
-				.type = NLA_U8},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH] = {
-				.type = NLA_U8},
-
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_MAX] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID] = {
-				.type = NLA_UNSPEC},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW] = {
-				.type = NLA_S32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH] = {
-				.type = NLA_S32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_CHANNEL] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP] = {
-				.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS] = {
-				.type = NLA_U32 },
-	[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID] = {
-				.type = NLA_BINARY,
-				.len = IEEE80211_MAX_SSID_LEN },
-	[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD] = {
-				.type = NLA_S8 },
-	[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS] = {
-				.type = NLA_U8 },
-	[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT] = {
-				.type = NLA_U8 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID] = {
-				.type = NLA_BINARY,
-				.len = IEEE80211_MAX_SSID_LEN + 1 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE] = {
-				.type = NLA_U32 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID] = {
-				.type = NLA_U32 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND] = {
-				.type = NLA_U8 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW] = {
-				.type = NLA_S32 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH] = {
-				.type = NLA_S32 },
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS] = {
-				.type = NLA_U32 },
-};
-
-static const struct nla_policy
-wlan_hdd_extscan_results_policy[QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD] = {
-				.type = NLA_U16},
-	[QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY] = {
-				.type = NLA_U16},
-};
-
-/**
- * wlan_hdd_cfg80211_extscan_get_capabilities_rsp() - response from target
- * @ctx: Pointer to hdd context
- * @data: Pointer to ext scan capabilities response from fw
- *
- * Return: None
- */
-static void
-wlan_hdd_cfg80211_extscan_get_capabilities_rsp(void *ctx,
-	struct ext_scan_capabilities_response *data)
-{
-	struct hdd_ext_scan_context *context;
-	hdd_context_t *hdd_ctx  = ctx;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx))
-		return;
-	if (!data) {
-		hddLog(LOGE, FL("data is null"));
-		return;
-	}
-
-	context = &ext_scan_context;
-
-	spin_lock(&context->context_lock);
-	/* validate response received from target*/
-	if (context->request_id != data->requestId) {
-		spin_unlock(&context->context_lock);
-		hddLog(LOGE,
-			FL("Target response id did not match: request_id %d response_id %d"),
-			context->request_id, data->requestId);
-		return;
-	} else {
-		context->capability_response = *data;
-		complete(&context->response_event);
-	}
-
-	spin_unlock(&context->context_lock);
-
-	return;
-}
-
-/*
- * define short names for the global vendor params
- * used by hdd_extscan_nl_fill_bss()
- */
-#define PARAM_TIME_STAMP \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP
-#define PARAM_SSID \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID
-#define PARAM_BSSID \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID
-#define PARAM_CHANNEL \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL
-#define PARAM_RSSI \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI
-#define PARAM_RTT \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT
-#define PARAM_RTT_SD \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD
-#define PARAM_BEACON_PERIOD \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD
-#define PARAM_CAPABILITY \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY
-#define PARAM_IE_LENGTH \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH
-#define PARAM_IE_DATA \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA
-
-/** hdd_extscan_nl_fill_bss() - extscan nl fill bss
- * @skb: socket buffer
- * @ap: bss information
- * @idx: nesting index
- *
- * Return: 0 on success; error number otherwise
- */
-static int hdd_extscan_nl_fill_bss(struct sk_buff *skb, tSirWifiScanResult *ap,
-					int idx)
-{
-	struct nlattr *nla_ap;
-
-	nla_ap = nla_nest_start(skb, idx);
-	if (!nla_ap)
-		return -EINVAL;
-
-	if (nla_put_u64(skb, PARAM_TIME_STAMP, ap->ts) ||
-	    nla_put(skb, PARAM_SSID, sizeof(ap->ssid), ap->ssid) ||
-	    nla_put(skb, PARAM_BSSID, sizeof(ap->bssid), ap->bssid.bytes) ||
-	    nla_put_u32(skb, PARAM_CHANNEL, ap->channel) ||
-	    nla_put_s32(skb, PARAM_RSSI, ap->rssi) ||
-	    nla_put_u32(skb, PARAM_RTT, ap->rtt) ||
-	    nla_put_u32(skb, PARAM_RTT_SD, ap->rtt_sd) ||
-	    nla_put_u16(skb, PARAM_BEACON_PERIOD, ap->beaconPeriod) ||
-	    nla_put_u16(skb, PARAM_CAPABILITY, ap->capability) ||
-	    nla_put_u16(skb, PARAM_IE_LENGTH, ap->ieLength)) {
-		hddLog(LOGE, FL("put fail"));
-		return -EINVAL;
-	}
-
-	if (ap->ieLength)
-		if (nla_put(skb, PARAM_IE_DATA, ap->ieLength, ap->ieData)) {
-			hddLog(LOGE, FL("put fail"));
-			return -EINVAL;
-		}
-
-	nla_nest_end(skb, nla_ap);
-
-	return 0;
-}
-/*
- * done with short names for the global vendor params
- * used by hdd_extscan_nl_fill_bss()
- */
-#undef PARAM_TIME_STAMP
-#undef PARAM_SSID
-#undef PARAM_BSSID
-#undef PARAM_CHANNEL
-#undef PARAM_RSSI
-#undef PARAM_RTT
-#undef PARAM_RTT_SD
-#undef PARAM_BEACON_PERIOD
-#undef PARAM_CAPABILITY
-#undef PARAM_IE_LENGTH
-#undef PARAM_IE_DATA
-
-/** wlan_hdd_cfg80211_extscan_cached_results_ind() - get cached results
- * @ctx: hdd global context
- * @data: cached results
- *
- * This function reads the cached results %data, populated the NL
- * attributes and sends the NL event to the upper layer.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_cached_results_ind(void *ctx,
-				struct extscan_cached_scan_results *data)
-{
-	hdd_context_t *pHddCtx = ctx;
-	struct sk_buff *skb = NULL;
-	struct hdd_ext_scan_context *context;
-	struct extscan_cached_scan_result *result;
-	tSirWifiScanResult *ap;
-	uint32_t i, j, nl_buf_len;
-	bool ignore_cached_results = false;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!data) {
-		hddLog(LOGE, FL("data is null"));
-		return;
-	}
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	ignore_cached_results = context->ignore_cached_results;
-	spin_unlock(&context->context_lock);
-
-	if (ignore_cached_results) {
-		hddLog(LOGE,
-			FL("Ignore the cached results received after timeout"));
-		return;
-	}
-
-#define EXTSCAN_CACHED_NEST_HDRLEN NLA_HDRLEN
-#define EXTSCAN_CACHED_NL_FIXED_TLV \
-		((sizeof(data->request_id) + NLA_HDRLEN) + \
-		(sizeof(data->num_scan_ids) + NLA_HDRLEN) + \
-		(sizeof(data->more_data) + NLA_HDRLEN))
-#define EXTSCAN_CACHED_NL_SCAN_ID_TLV \
-		((sizeof(result->scan_id) + NLA_HDRLEN) + \
-		(sizeof(result->flags) + NLA_HDRLEN) + \
-		(sizeof(result->num_results) + NLA_HDRLEN))
-#define EXTSCAN_CACHED_NL_SCAN_RESULTS_TLV \
-		((sizeof(ap->ts) + NLA_HDRLEN) + \
-		(sizeof(ap->ssid) + NLA_HDRLEN) + \
-		(sizeof(ap->bssid) + NLA_HDRLEN) + \
-		(sizeof(ap->channel) + NLA_HDRLEN) + \
-		(sizeof(ap->rssi) + NLA_HDRLEN) + \
-		(sizeof(ap->rtt) + NLA_HDRLEN) + \
-		(sizeof(ap->rtt_sd) + NLA_HDRLEN) + \
-		(sizeof(ap->beaconPeriod) + NLA_HDRLEN) + \
-		(sizeof(ap->capability) + NLA_HDRLEN) + \
-		(sizeof(ap->ieLength) + NLA_HDRLEN))
-#define EXTSCAN_CACHED_NL_SCAN_RESULTS_IE_DATA_TLV \
-		(ap->ieLength + NLA_HDRLEN)
-
-	nl_buf_len = NLMSG_HDRLEN;
-	nl_buf_len += EXTSCAN_CACHED_NL_FIXED_TLV;
-	if (data->num_scan_ids) {
-		nl_buf_len += sizeof(result->scan_id) + NLA_HDRLEN;
-		nl_buf_len += EXTSCAN_CACHED_NEST_HDRLEN;
-		result = &data->result[0];
-		for (i = 0; i < data->num_scan_ids; i++) {
-			nl_buf_len += EXTSCAN_CACHED_NEST_HDRLEN;
-			nl_buf_len += EXTSCAN_CACHED_NL_SCAN_ID_TLV;
-			nl_buf_len += EXTSCAN_CACHED_NEST_HDRLEN;
-
-			ap = &result->ap[0];
-			for (j = 0; j < result->num_results; j++) {
-				nl_buf_len += EXTSCAN_CACHED_NEST_HDRLEN;
-				nl_buf_len +=
-					EXTSCAN_CACHED_NL_SCAN_RESULTS_TLV;
-				if (ap->ieLength)
-					nl_buf_len +=
-					EXTSCAN_CACHED_NL_SCAN_RESULTS_IE_DATA_TLV;
-				ap++;
-			}
-			result++;
-		}
-	}
-
-	hddLog(LOG1, FL("nl_buf_len = %u"), nl_buf_len);
-	skb = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy, nl_buf_len);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		goto fail;
-	}
-	hddLog(LOG1, "Req Id %u Num_scan_ids %u More Data %u",
-		data->request_id, data->num_scan_ids, data->more_data);
-
-	result = &data->result[0];
-	for (i = 0; i < data->num_scan_ids; i++) {
-		hddLog(LOG1, "[i=%d] scan_id %u flags %u num_results %u",
-			i, result->scan_id, result->flags, result->num_results);
-
-		ap = &result->ap[0];
-		for (j = 0; j < result->num_results; j++) {
-			/*
-			 * Firmware returns timestamp from ext scan start till
-			 * BSSID was cached (in micro seconds). Add this with
-			 * time gap between system boot up to ext scan start
-			 * to derive the time since boot when the
-			 * BSSID was cached.
-			 */
-			ap->ts += pHddCtx->ext_scan_start_since_boot;
-			hddLog(LOG1, "Timestamp %llu "
-				"Ssid: %s "
-				"Bssid (" MAC_ADDRESS_STR ") "
-				"Channel %u "
-				"Rssi %d "
-				"RTT %u "
-				"RTT_SD %u "
-				"Beacon Period %u "
-				"Capability 0x%x "
-				"Ie length %d",
-				ap->ts,
-				ap->ssid,
-				MAC_ADDR_ARRAY(ap->bssid.bytes),
-				ap->channel,
-				ap->rssi,
-				ap->rtt,
-				ap->rtt_sd,
-				ap->beaconPeriod,
-				ap->capability,
-				ap->ieLength);
-			ap++;
-		}
-		result++;
-	}
-
-	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-		data->request_id) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-		data->num_scan_ids) ||
-	    nla_put_u8(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-		data->more_data)) {
-		hddLog(LOGE, FL("put fail"));
-		goto fail;
-	}
-
-	if (data->num_scan_ids) {
-		struct nlattr *nla_results;
-		result = &data->result[0];
-
-		if (nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID,
-			result->scan_id)) {
-			hddLog(LOGE, FL("put fail"));
-			goto fail;
-		}
-		nla_results = nla_nest_start(skb,
-			      QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_LIST);
-		if (!nla_results)
-			goto fail;
-
-		for (i = 0; i < data->num_scan_ids; i++) {
-			struct nlattr *nla_result;
-			struct nlattr *nla_aps;
-
-			nla_result = nla_nest_start(skb, i);
-			if (!nla_result)
-				goto fail;
-
-			if (nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_SCAN_ID,
-				result->scan_id) ||
-			    nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CACHED_RESULTS_FLAGS,
-				result->flags) ||
-			    nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-				result->num_results)) {
-				hddLog(LOGE, FL("put fail"));
-				goto fail;
-			}
-
-			nla_aps = nla_nest_start(skb,
-				     QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST);
-			if (!nla_aps)
-				goto fail;
-
-			ap = &result->ap[0];
-			for (j = 0; j < result->num_results; j++) {
-				if (hdd_extscan_nl_fill_bss(skb, ap, j))
-					goto fail;
-
-				ap++;
-			}
-			nla_nest_end(skb, nla_aps);
-			nla_nest_end(skb, nla_result);
-			result++;
-		}
-		nla_nest_end(skb, nla_results);
-	}
-
-	cfg80211_vendor_cmd_reply(skb);
-
-	if (!data->more_data) {
-		spin_lock(&context->context_lock);
-		context->response_status = 0;
-		complete(&context->response_event);
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return;
-
-fail:
-	if (skb)
-		kfree_skb(skb);
-
-	spin_lock(&context->context_lock);
-	context->response_status = -EINVAL;
-	spin_unlock(&context->context_lock);
-
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_hotlist_match_ind() - hot list match ind
- * @ctx: Pointer to hdd context
- * @pData: Pointer to ext scan result event
- *
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_hotlist_match_ind(void *ctx,
-					    struct extscan_hotlist_match *data)
-{
-	hdd_context_t *pHddCtx = ctx;
-	struct sk_buff *skb = NULL;
-	uint32_t i, index;
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!data) {
-		hddLog(LOGE, FL("data is null"));
-		return;
-	}
-
-	if (data->ap_found)
-		index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_FOUND_INDEX;
-	else
-		index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_AP_LOST_INDEX;
-
-	skb = cfg80211_vendor_event_alloc(
-		  pHddCtx->wiphy,
-		  NULL,
-		  EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-		  index, flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-	hdd_info("Req Id: %u Num_APs: %u MoreData: %u ap_found: %u",
-			data->requestId, data->numOfAps, data->moreData,
-			data->ap_found);
-
-	for (i = 0; i < data->numOfAps; i++) {
-		data->ap[i].ts = cdf_get_monotonic_boottime();
-
-		hddLog(LOG1, "[i=%d] Timestamp %llu "
-		       "Ssid: %s "
-		       "Bssid (" MAC_ADDRESS_STR ") "
-		       "Channel %u "
-		       "Rssi %d "
-		       "RTT %u "
-		       "RTT_SD %u",
-		       i,
-		       data->ap[i].ts,
-		       data->ap[i].ssid,
-		       MAC_ADDR_ARRAY(data->ap[i].bssid.bytes),
-		       data->ap[i].channel,
-		       data->ap[i].rssi,
-		       data->ap[i].rtt, data->ap[i].rtt_sd);
-	}
-
-	if (nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-		data->requestId) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-		data->numOfAps)) {
-		hddLog(LOGE, FL("put fail"));
-		goto fail;
-	}
-
-	if (data->numOfAps) {
-		struct nlattr *aps;
-
-		aps = nla_nest_start(skb,
-			       QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST);
-		if (!aps)
-			goto fail;
-
-		for (i = 0; i < data->numOfAps; i++) {
-			struct nlattr *ap;
-
-			ap = nla_nest_start(skb, i);
-			if (!ap)
-				goto fail;
-
-			if (nla_put_u64(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP,
-				data->ap[i].ts) ||
-			    nla_put(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID,
-				sizeof(data->ap[i].ssid),
-				data->ap[i].ssid) ||
-			    nla_put(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID,
-				sizeof(data->ap[i].bssid),
-				data->ap[i].bssid.bytes) ||
-			    nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL,
-				data->ap[i].channel) ||
-			    nla_put_s32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI,
-				data->ap[i].rssi) ||
-			    nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT,
-				data->ap[i].rtt) ||
-			    nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD,
-				data->ap[i].rtt_sd))
-				goto fail;
-
-			nla_nest_end(skb, ap);
-		}
-		nla_nest_end(skb, aps);
-
-		if (nla_put_u8(skb,
-		       QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-		       data->moreData))
-			goto fail;
-	}
-
-	cfg80211_vendor_event(skb, flags);
-	EXIT();
-	return;
-
-fail:
-	kfree_skb(skb);
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_signif_wifi_change_results_ind() -
- *	significant wifi change results indication
- * @ctx: Pointer to hdd context
- * @pData: Pointer to signif wifi change event
- *
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_signif_wifi_change_results_ind(
-			void *ctx,
-			tpSirWifiSignificantChangeEvent pData)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) ctx;
-	struct sk_buff *skb = NULL;
-	tSirWifiSignificantChange *ap_info;
-	int32_t *rssi;
-	uint32_t i, j;
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!pData) {
-		hddLog(LOGE, FL("pData is null"));
-		return;
-	}
-
-	skb = cfg80211_vendor_event_alloc(
-		pHddCtx->wiphy,
-		NULL,
-		EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-		QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SIGNIFICANT_CHANGE_INDEX,
-		flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-	hddLog(LOG1, "Req Id %u Num results %u More Data %u",
-		pData->requestId, pData->numResults, pData->moreData);
-
-	ap_info = &pData->ap[0];
-	for (i = 0; i < pData->numResults; i++) {
-		hddLog(LOG1, "[i=%d] "
-		       "Bssid (" MAC_ADDRESS_STR ") "
-		       "Channel %u "
-		       "numOfRssi %d",
-		       i,
-		       MAC_ADDR_ARRAY(ap_info->bssid.bytes),
-		       ap_info->channel, ap_info->numOfRssi);
-		rssi = &(ap_info)->rssi[0];
-		for (j = 0; j < ap_info->numOfRssi; j++)
-			hddLog(LOG1, "Rssi %d", *rssi++);
-
-		ap_info += ap_info->numOfRssi * sizeof(*rssi);
-	}
-
-	if (nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-		pData->requestId) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-		pData->numResults)) {
-		hddLog(LOGE, FL("put fail"));
-		goto fail;
-	}
-
-	if (pData->numResults) {
-		struct nlattr *aps;
-
-		aps = nla_nest_start(skb,
-			       QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST);
-		if (!aps)
-			goto fail;
-
-		ap_info = &pData->ap[0];
-		for (i = 0; i < pData->numResults; i++) {
-			struct nlattr *ap;
-
-			ap = nla_nest_start(skb, i);
-			if (!ap)
-				goto fail;
-
-			if (nla_put(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_BSSID,
-				CDF_MAC_ADDR_SIZE, ap_info->bssid.bytes) ||
-			    nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_CHANNEL,
-				ap_info->channel) ||
-			    nla_put_u32(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_NUM_RSSI,
-				ap_info->numOfRssi) ||
-			    nla_put(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SIGNIFICANT_CHANGE_RESULT_RSSI_LIST,
-				sizeof(s32) * ap_info->numOfRssi,
-				&(ap_info)->rssi[0]))
-				goto fail;
-
-			nla_nest_end(skb, ap);
-
-			ap_info += ap_info->numOfRssi * sizeof(*rssi);
-		}
-		nla_nest_end(skb, aps);
-
-		if (nla_put_u8(skb,
-		     QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-		     pData->moreData))
-			goto fail;
-	}
-
-	cfg80211_vendor_event(skb, flags);
-	return;
-
-fail:
-	kfree_skb(skb);
-	return;
-
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_full_scan_result_event() - full scan result event
- * @ctx: Pointer to hdd context
- * @pData: Pointer to full scan result event
- *
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_full_scan_result_event(void *ctx,
-						 tpSirWifiFullScanResultEvent
-						 pData)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) ctx;
-	struct sk_buff *skb = NULL;
-#ifdef CONFIG_CNSS
-	struct timespec ts;
-#endif
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!pData) {
-		hddLog(LOGE, FL("pData is null"));
-		return;
-	}
-
-	if ((sizeof(*pData) + pData->ap.ieLength) >= EXTSCAN_EVENT_BUF_SIZE) {
-		hddLog(LOGE,
-		       FL("Frame exceeded NL size limitation, drop it!!"));
-		return;
-	}
-	skb = cfg80211_vendor_event_alloc(
-		  pHddCtx->wiphy,
-		  NULL,
-		  EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-		  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_FULL_SCAN_RESULT_INDEX,
-		  flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-
-	pData->ap.channel = cds_chan_to_freq(pData->ap.channel);
-#ifdef CONFIG_CNSS
-	/* Android does not want the time stamp from the frame.
-	   Instead it wants a monotonic increasing value since boot */
-	cnss_get_monotonic_boottime(&ts);
-	pData->ap.ts = ((u64)ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
-#endif
-	hddLog(LOG1, "Req Id %u More Data %u", pData->requestId,
-	       pData->moreData);
-	hddLog(LOG1, "AP Info: Timestamp %llu Ssid: %s "
-	       "Bssid (" MAC_ADDRESS_STR ") "
-	       "Channel %u "
-	       "Rssi %d "
-	       "RTT %u "
-	       "RTT_SD %u "
-	       "Bcn Period %d "
-	       "Capability 0x%X "
-	       "IE Length %d",
-	       pData->ap.ts,
-	       pData->ap.ssid,
-	       MAC_ADDR_ARRAY(pData->ap.bssid.bytes),
-	       pData->ap.channel,
-	       pData->ap.rssi,
-	       pData->ap.rtt,
-	       pData->ap.rtt_sd,
-	       pData->ap.beaconPeriod,
-	       pData->ap.capability, pData->ap.ieLength);
-
-	if (nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-		pData->requestId) ||
-	    nla_put_u64(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP,
-		pData->ap.ts) ||
-	    nla_put(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID,
-		sizeof(pData->ap.ssid),
-		pData->ap.ssid) ||
-	    nla_put(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID,
-		sizeof(pData->ap.bssid),
-		pData->ap.bssid.bytes) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL,
-		pData->ap.channel) ||
-	    nla_put_s32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI,
-		pData->ap.rssi) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT,
-		pData->ap.rtt) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD,
-		pData->ap.rtt_sd) ||
-	    nla_put_u16(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BEACON_PERIOD,
-		pData->ap.beaconPeriod) ||
-	    nla_put_u16(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CAPABILITY,
-		pData->ap.capability) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_LENGTH,
-		pData->ap.ieLength) ||
-	    nla_put_u8(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-		pData->moreData)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto nla_put_failure;
-	}
-
-	if (pData->ap.ieLength) {
-		if (nla_put(skb,
-		    QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_IE_DATA,
-		    pData->ap.ieLength, pData->ap.ieData))
-			goto nla_put_failure;
-	}
-
-	cfg80211_vendor_event(skb, flags);
-	EXIT();
-	return;
-
-nla_put_failure:
-	kfree_skb(skb);
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_scan_res_available_event() - scan result event
- * @ctx: Pointer to hdd context
- * @pData: Pointer to scan results available indication param
- *
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_scan_res_available_event(
-			void *ctx,
-			tpSirExtScanResultsAvailableIndParams pData)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) ctx;
-	struct sk_buff *skb = NULL;
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!pData) {
-		hddLog(LOGE, FL("pData is null"));
-		return;
-	}
-
-	skb = cfg80211_vendor_event_alloc(
-		 pHddCtx->wiphy,
-		 NULL,
-		 EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-		 QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_RESULTS_AVAILABLE_INDEX,
-		 flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-
-	hddLog(LOG1, "Req Id %u Num results %u",
-	       pData->requestId, pData->numResultsAvailable);
-	if (nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-		pData->requestId) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-		pData->numResultsAvailable)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto nla_put_failure;
-	}
-
-	cfg80211_vendor_event(skb, flags);
-	EXIT();
-	return;
-
-nla_put_failure:
-	kfree_skb(skb);
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_scan_progress_event() - scan progress event
- * @ctx: Pointer to hdd context
- * @pData: Pointer to scan event indication param
- *
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_scan_progress_event(void *ctx,
-					      tpSirExtScanOnScanEventIndParams
-					      pData)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) ctx;
-	struct sk_buff *skb = NULL;
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!pData) {
-		hddLog(LOGE, FL("pData is null"));
-		return;
-	}
-
-	skb = cfg80211_vendor_event_alloc(
-			pHddCtx->wiphy,
-			NULL,
-			EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-			QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_SCAN_EVENT_INDEX,
-			flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-	hddLog(LOG1, "Req Id %u Scan event type %u Scan event status %u",
-		pData->requestId, pData->scanEventType, pData->status);
-
-	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-			pData->requestId) ||
-	    nla_put_u8(skb,
-		       QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_TYPE,
-		       pData->scanEventType) ||
-	    nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_EVENT_STATUS,
-			pData->status)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto nla_put_failure;
-	}
-
-	cfg80211_vendor_event(skb, flags);
-	EXIT();
-	return;
-
-nla_put_failure:
-	kfree_skb(skb);
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_epno_match_found() - pno match found
- * @hddctx: HDD context
- * @data: matched network data
- *
- * This function reads the matched network data and fills NL vendor attributes
- * and send it to upper layer.
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: 0 on success, error number otherwise
- */
-static void
-wlan_hdd_cfg80211_extscan_epno_match_found(void *ctx,
-					struct pno_match_found *data)
-{
-	hdd_context_t *pHddCtx  = (hdd_context_t *)ctx;
-	struct sk_buff *skb     = NULL;
-	uint32_t len, i;
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!data) {
-		hddLog(LOGE, FL("data is null"));
-		return;
-	}
-
-	/*
-	 * If the number of match found APs including IE data exceeds NL 4K size
-	 * limitation, drop that beacon/probe rsp frame.
-	 */
-	len = sizeof(*data) +
-			(data->num_results + sizeof(tSirWifiScanResult));
-	for (i = 0; i < data->num_results; i++)
-		len += data->ap[i].ieLength;
-
-	if (len >= EXTSCAN_EVENT_BUF_SIZE) {
-		hddLog(LOGE, FL("Frame exceeded NL size limitation, drop it!"));
-		return;
-	}
-
-	skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy,
-		  NULL,
-		  EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-		QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_NETWORK_FOUND_INDEX,
-		  flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-
-	hddLog(LOG1, "Req Id %u More Data %u num_results %d",
-		data->request_id, data->more_data, data->num_results);
-	for (i = 0; i < data->num_results; i++) {
-		data->ap[i].channel = cds_chan_to_freq(data->ap[i].channel);
-		hddLog(LOG1, "AP Info: Timestamp %llu) Ssid: %s "
-					"Bssid (" MAC_ADDRESS_STR ") "
-					"Channel %u "
-					"Rssi %d "
-					"RTT %u "
-					"RTT_SD %u "
-					"Bcn Period %d "
-					"Capability 0x%X "
-					"IE Length %d",
-					data->ap[i].ts,
-					data->ap[i].ssid,
-					MAC_ADDR_ARRAY(data->ap[i].bssid.bytes),
-					data->ap[i].channel,
-					data->ap[i].rssi,
-					data->ap[i].rtt,
-					data->ap[i].rtt_sd,
-					data->ap[i].beaconPeriod,
-					data->ap[i].capability,
-					data->ap[i].ieLength);
-	}
-
-	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-		data->request_id) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-		data->num_results) ||
-	    nla_put_u8(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-		data->more_data)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto fail;
-	}
-
-	if (data->num_results) {
-		struct nlattr *nla_aps;
-		nla_aps = nla_nest_start(skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST);
-		if (!nla_aps)
-			goto fail;
-
-		for (i = 0; i < data->num_results; i++) {
-			if (hdd_extscan_nl_fill_bss(skb, &data->ap[i], i))
-				goto fail;
-		}
-		nla_nest_end(skb, nla_aps);
-	}
-
-	cfg80211_vendor_event(skb, flags);
-	return;
-
-fail:
-	kfree_skb(skb);
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_passpoint_match_found() - passpoint match found
- * @hddctx: HDD context
- * @data: matched network data
- *
- * This function reads the match network %data and fill in the skb with
- * NL attributes and send up the NL event
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_passpoint_match_found(void *ctx,
-					struct wifi_passpoint_match *data)
-{
-	hdd_context_t *pHddCtx  = ctx;
-	struct sk_buff *skb     = NULL;
-	uint32_t len, i, num_matches = 1, more_data = 0;
-	struct nlattr *nla_aps, *nla_bss;
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-	if (!data) {
-		hddLog(LOGE, FL("data is null"));
-		return;
-	}
-
-	len = sizeof(*data) + data->ap.ieLength + data->anqp_len;
-	if (len >= EXTSCAN_EVENT_BUF_SIZE) {
-		hddLog(LOGE, FL("Result exceeded NL size limitation, drop it"));
-		return;
-	}
-
-	skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy,
-		  NULL,
-		  EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-		  QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_PNO_PASSPOINT_NETWORK_FOUND_INDEX,
-		  flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-
-	hddLog(LOG1, "Req Id %u Id %u ANQP length %u num_matches %u",
-		data->request_id, data->id, data->anqp_len, num_matches);
-	for (i = 0; i < num_matches; i++) {
-		hddLog(LOG1, "AP Info: Timestamp %llu Ssid: %s "
-					"Bssid (" MAC_ADDRESS_STR ") "
-					"Channel %u "
-					"Rssi %d "
-					"RTT %u "
-					"RTT_SD %u "
-					"Bcn Period %d "
-					"Capability 0x%X "
-					"IE Length %d",
-					data->ap.ts,
-					data->ap.ssid,
-					MAC_ADDR_ARRAY(data->ap.bssid.bytes),
-					data->ap.channel,
-					data->ap.rssi,
-					data->ap.rtt,
-					data->ap.rtt_sd,
-					data->ap.beaconPeriod,
-					data->ap.capability,
-					data->ap.ieLength);
-	}
-
-	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-		data->request_id) ||
-	    nla_put_u32(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_NETWORK_FOUND_NUM_MATCHES,
-		num_matches) ||
-	    nla_put_u8(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-		more_data)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto fail;
-	}
-
-	nla_aps = nla_nest_start(skb,
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_RESULT_LIST);
-	if (!nla_aps)
-		goto fail;
-
-	for (i = 0; i < num_matches; i++) {
-		struct nlattr *nla_ap;
-
-		nla_ap = nla_nest_start(skb, i);
-		if (!nla_ap)
-			goto fail;
-
-		if (nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ID,
-			data->id) ||
-		    nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP_LEN,
-			data->anqp_len)) {
-			goto fail;
-		}
-
-		if (data->anqp_len)
-			if (nla_put(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_PNO_RESULTS_PASSPOINT_MATCH_ANQP,
-				data->anqp_len, data->anqp))
-				goto fail;
-
-		nla_bss = nla_nest_start(skb,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST);
-		if (!nla_bss)
-			goto fail;
-
-		if (hdd_extscan_nl_fill_bss(skb, &data->ap, 0))
-			goto fail;
-
-		nla_nest_end(skb, nla_bss);
-		nla_nest_end(skb, nla_ap);
-	}
-	nla_nest_end(skb, nla_aps);
-
-	cfg80211_vendor_event(skb, flags);
-	return;
-
-fail:
-	kfree_skb(skb);
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_hotlist_ssid_match_ind() -
- *	Handle an SSID hotlist match event
- * @ctx: HDD context registered with SME
- * @event: The SSID hotlist match event
- *
- * This function will take an SSID match event that was generated by
- * firmware and will convert it into a cfg80211 vendor event which is
- * sent to userspace.
- * This callback execute in atomic context and must not invoke any
- * blocking calls.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_hotlist_ssid_match_ind(void *ctx,
-						 tpSirWifiScanResultEvent event)
-{
-	hdd_context_t *hdd_ctx = ctx;
-	struct sk_buff *skb;
-	uint32_t i, index;
-	int flags = cds_get_gfp_flags();
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx))
-		return;
-	if (!event) {
-		hddLog(LOGE, FL("event is null"));
-		return;
-	}
-
-	if (event->ap_found) {
-		index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND_INDEX;
-		hddLog(LOG1, "SSID hotlist found");
-	} else {
-		index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST_INDEX;
-		hddLog(LOG1, "SSID hotlist lost");
-	}
-
-	skb = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
-		NULL,
-		EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
-		index, flags);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-	hddLog(LOG1, "Req Id %u, Num results %u, More Data %u",
-	       event->requestId, event->numOfAps, event->moreData);
-
-	for (i = 0; i < event->numOfAps; i++) {
-		hddLog(LOG1, "[i=%d] Timestamp %llu "
-		       "Ssid: %s "
-		       "Bssid (" MAC_ADDRESS_STR ") "
-		       "Channel %u "
-		       "Rssi %d "
-		       "RTT %u "
-		       "RTT_SD %u",
-		       i,
-		       event->ap[i].ts,
-		       event->ap[i].ssid,
-		       MAC_ADDR_ARRAY(event->ap[i].bssid.bytes),
-		       event->ap[i].channel,
-		       event->ap[i].rssi,
-		       event->ap[i].rtt,
-		       event->ap[i].rtt_sd);
-	}
-
-	if (nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
-			event->requestId) ||
-	    nla_put_u32(skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
-			event->numOfAps)) {
-		hddLog(LOGE, FL("put fail"));
-		goto fail;
-	}
-
-	if (event->numOfAps) {
-		struct nlattr *aps;
-		aps = nla_nest_start(skb,
-				     QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST);
-		if (!aps) {
-			hddLog(LOGE, FL("nest fail"));
-			goto fail;
-		}
-
-		for (i = 0; i < event->numOfAps; i++) {
-			struct nlattr *ap;
-
-			ap = nla_nest_start(skb, i);
-			if (!ap) {
-				hddLog(LOGE, FL("nest fail"));
-				goto fail;
-			}
-
-			if (nla_put_u64(skb,
-					QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP,
-					event->ap[i].ts) ||
-			    nla_put(skb,
-				    QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID,
-				    sizeof(event->ap[i].ssid),
-				    event->ap[i].ssid) ||
-			    nla_put(skb,
-				    QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID,
-				    sizeof(event->ap[i].bssid),
-				    event->ap[i].bssid.bytes) ||
-			    nla_put_u32(skb,
-					QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL,
-					event->ap[i].channel) ||
-			    nla_put_s32(skb,
-					QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI,
-					event->ap[i].rssi) ||
-			    nla_put_u32(skb,
-					QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT,
-					event->ap[i].rtt) ||
-			    nla_put_u32(skb,
-					QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD,
-					event->ap[i].rtt_sd)) {
-				hddLog(LOGE, FL("put fail"));
-				goto fail;
-			}
-			nla_nest_end(skb, ap);
-		}
-		nla_nest_end(skb, aps);
-
-		if (nla_put_u8(skb,
-			       QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
-			       event->moreData)) {
-			hddLog(LOGE, FL("put fail"));
-			goto fail;
-		}
-	}
-
-	cfg80211_vendor_event(skb, flags);
-	return;
-
-fail:
-	kfree_skb(skb);
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_generic_rsp() -
- *	Handle a generic ExtScan Response message
- * @ctx: HDD context registered with SME
- * @response: The ExtScan response from firmware
- *
- * This function will handle a generic ExtScan response message from
- * firmware and will communicate the result to the userspace thread
- * that is waiting for the response.
- *
- * Return: none
- */
-static void
-wlan_hdd_cfg80211_extscan_generic_rsp
-	(void *ctx,
-	 struct sir_extscan_generic_response *response)
-{
-	hdd_context_t *hdd_ctx = ctx;
-	struct hdd_ext_scan_context *context;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx) || !response) {
-		hddLog(LOGE,
-		       FL("HDD context is not valid or response(%p) is null"),
-		       response);
-		return;
-	}
-
-	hddLog(LOG1, FL("request %u status %u"),
-	       response->request_id, response->status);
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	if (context->request_id == response->request_id) {
-		context->response_status = response->status ? -EINVAL : 0;
-		complete(&context->response_event);
-	}
-	spin_unlock(&context->context_lock);
-
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_callback() - ext scan callback
- * @ctx: Pointer to hdd context
- * @evType: Event type
- * @pMag: Pointer to message
- *
- * Return: none
- */
-void wlan_hdd_cfg80211_extscan_callback(void *ctx, const uint16_t evType,
-					void *pMsg)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) ctx;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(pHddCtx))
-		return;
-
-	hddLog(LOG1, FL("Rcvd Event %d"), evType);
-
-	switch (evType) {
-	case eSIR_EXTSCAN_CACHED_RESULTS_RSP:
-		/* There is no need to send this response to upper layer
-		   Just log the message */
-		hddLog(LOG1,
-		       FL("Rcvd eSIR_EXTSCAN_CACHED_RESULTS_RSP"));
-		break;
-
-	case eSIR_EXTSCAN_GET_CAPABILITIES_IND:
-		wlan_hdd_cfg80211_extscan_get_capabilities_rsp(ctx,
-			(struct ext_scan_capabilities_response *) pMsg);
-		break;
-
-	case eSIR_EXTSCAN_HOTLIST_MATCH_IND:
-		wlan_hdd_cfg80211_extscan_hotlist_match_ind(ctx, pMsg);
-		break;
-
-	case eSIR_EXTSCAN_SIGNIFICANT_WIFI_CHANGE_RESULTS_IND:
-		wlan_hdd_cfg80211_extscan_signif_wifi_change_results_ind(ctx,
-					(tpSirWifiSignificantChangeEvent) pMsg);
-		break;
-
-	case eSIR_EXTSCAN_CACHED_RESULTS_IND:
-		wlan_hdd_cfg80211_extscan_cached_results_ind(ctx, pMsg);
-		break;
-
-	case eSIR_EXTSCAN_SCAN_RES_AVAILABLE_IND:
-		wlan_hdd_cfg80211_extscan_scan_res_available_event(ctx,
-			   (tpSirExtScanResultsAvailableIndParams) pMsg);
-		break;
-
-	case eSIR_EXTSCAN_FULL_SCAN_RESULT_IND:
-		wlan_hdd_cfg80211_extscan_full_scan_result_event(ctx,
-					 (tpSirWifiFullScanResultEvent) pMsg);
-		break;
-
-	case eSIR_EPNO_NETWORK_FOUND_IND:
-		wlan_hdd_cfg80211_extscan_epno_match_found(ctx,
-					(struct pno_match_found *)pMsg);
-		break;
-
-	case eSIR_EXTSCAN_HOTLIST_SSID_MATCH_IND:
-		wlan_hdd_cfg80211_extscan_hotlist_ssid_match_ind(ctx,
-					(tpSirWifiScanResultEvent)pMsg);
-		break;
-
-	case eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND:
-		wlan_hdd_cfg80211_extscan_scan_progress_event(ctx,
-			      (tpSirExtScanOnScanEventIndParams) pMsg);
-		break;
-
-	case eSIR_PASSPOINT_NETWORK_FOUND_IND:
-		wlan_hdd_cfg80211_passpoint_match_found(ctx,
-					(struct wifi_passpoint_match *) pMsg);
-		break;
-
-	case eSIR_EXTSCAN_START_RSP:
-	case eSIR_EXTSCAN_STOP_RSP:
-	case eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP:
-	case eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP:
-	case eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP:
-	case eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP:
-	case eSIR_EXTSCAN_SET_SSID_HOTLIST_RSP:
-	case eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP:
-		wlan_hdd_cfg80211_extscan_generic_rsp(ctx, pMsg);
-		break;
-
-	default:
-		hddLog(LOGE, FL("Unknown event type %u"), evType);
-		break;
-	}
-	EXIT();
-}
-
-/*
- * define short names for the global vendor params
- * used by wlan_hdd_send_ext_scan_capability()
- */
-#define PARAM_REQUEST_ID \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAM_STATUS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS
-#define MAX_SCAN_CACHE_SIZE \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_CACHE_SIZE
-#define MAX_SCAN_BUCKETS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_BUCKETS
-#define MAX_AP_CACHE_PER_SCAN \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_AP_CACHE_PER_SCAN
-#define MAX_RSSI_SAMPLE_SIZE \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_RSSI_SAMPLE_SIZE
-#define MAX_SCAN_RPT_THRHOLD \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SCAN_REPORTING_THRESHOLD
-#define MAX_HOTLIST_BSSIDS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_BSSIDS
-#define MAX_SIGNIFICANT_WIFI_CHANGE_APS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_SIGNIFICANT_WIFI_CHANGE_APS
-#define MAX_BSSID_HISTORY_ENTRIES \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_BSSID_HISTORY_ENTRIES
-#define MAX_HOTLIST_SSIDS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_HOTLIST_SSIDS
-#define MAX_NUM_EPNO_NETS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS
-#define MAX_NUM_EPNO_NETS_BY_SSID \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_EPNO_NETS_BY_SSID
-#define MAX_NUM_WHITELISTED_SSID \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CAPABILITIES_MAX_NUM_WHITELISTED_SSID
-
-/**
- * wlan_hdd_send_ext_scan_capability - send ext scan capability to user space
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: 0 for success, non-zero for failure
- */
-static int wlan_hdd_send_ext_scan_capability(hdd_context_t *hdd_ctx)
-{
-	int ret;
-	struct sk_buff *skb;
-	struct ext_scan_capabilities_response *data;
-	uint32_t nl_buf_len;
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	data = &(ext_scan_context.capability_response);
-
-	nl_buf_len = NLMSG_HDRLEN;
-	nl_buf_len += (sizeof(data->requestId) + NLA_HDRLEN) +
-	(sizeof(data->status) + NLA_HDRLEN) +
-	(sizeof(data->max_scan_cache_size) + NLA_HDRLEN) +
-	(sizeof(data->max_scan_buckets) + NLA_HDRLEN) +
-	(sizeof(data->max_ap_cache_per_scan) + NLA_HDRLEN) +
-	(sizeof(data->max_rssi_sample_size) + NLA_HDRLEN) +
-	(sizeof(data->max_scan_reporting_threshold) + NLA_HDRLEN) +
-	(sizeof(data->max_hotlist_bssids) + NLA_HDRLEN) +
-	(sizeof(data->max_significant_wifi_change_aps) + NLA_HDRLEN) +
-	(sizeof(data->max_bssid_history_entries) + NLA_HDRLEN) +
-	(sizeof(data->max_hotlist_ssids) + NLA_HDRLEN) +
-	(sizeof(data->max_number_epno_networks) + NLA_HDRLEN) +
-	(sizeof(data->max_number_epno_networks_by_ssid) + NLA_HDRLEN) +
-	(sizeof(data->max_number_of_white_listed_ssid) + NLA_HDRLEN);
-
-	skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len);
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return -ENOMEM;
-	}
-
-
-	hddLog(LOG1, "Req Id %u", data->requestId);
-	hddLog(LOG1, "Status %u", data->status);
-	hddLog(LOG1, "Scan cache size %u",
-	       data->max_scan_cache_size);
-	hddLog(LOG1, "Scan buckets %u", data->max_scan_buckets);
-	hddLog(LOG1, "Max AP per scan %u",
-	       data->max_ap_cache_per_scan);
-	hddLog(LOG1, "max_rssi_sample_size %u",
-	       data->max_rssi_sample_size);
-	hddLog(LOG1, "max_scan_reporting_threshold %u",
-	       data->max_scan_reporting_threshold);
-	hddLog(LOG1, "max_hotlist_bssids %u",
-	       data->max_hotlist_bssids);
-	hddLog(LOG1, "max_significant_wifi_change_aps %u",
-	       data->max_significant_wifi_change_aps);
-	hddLog(LOG1, "max_bssid_history_entries %u",
-	       data->max_bssid_history_entries);
-	hddLog(LOG1, "max_hotlist_ssids %u", data->max_hotlist_ssids);
-	hddLog(LOG1, "max_number_epno_networks %u",
-					data->max_number_epno_networks);
-	hddLog(LOG1, "max_number_epno_networks_by_ssid %u",
-					data->max_number_epno_networks_by_ssid);
-	hddLog(LOG1, "max_number_of_white_listed_ssid %u",
-					data->max_number_of_white_listed_ssid);
-
-	if (nla_put_u32(skb, PARAM_REQUEST_ID, data->requestId) ||
-	    nla_put_u32(skb, PARAM_STATUS, data->status) ||
-	    nla_put_u32(skb, MAX_SCAN_CACHE_SIZE, data->max_scan_cache_size) ||
-	    nla_put_u32(skb, MAX_SCAN_BUCKETS, data->max_scan_buckets) ||
-	    nla_put_u32(skb, MAX_AP_CACHE_PER_SCAN,
-			data->max_ap_cache_per_scan) ||
-	    nla_put_u32(skb, MAX_RSSI_SAMPLE_SIZE,
-			data->max_rssi_sample_size) ||
-	    nla_put_u32(skb, MAX_SCAN_RPT_THRHOLD,
-			data->max_scan_reporting_threshold) ||
-	    nla_put_u32(skb, MAX_HOTLIST_BSSIDS, data->max_hotlist_bssids) ||
-	    nla_put_u32(skb, MAX_SIGNIFICANT_WIFI_CHANGE_APS,
-			data->max_significant_wifi_change_aps) ||
-	    nla_put_u32(skb, MAX_BSSID_HISTORY_ENTRIES,
-			data->max_bssid_history_entries) ||
-	    nla_put_u32(skb, MAX_HOTLIST_SSIDS,	data->max_hotlist_ssids) ||
-	    nla_put_u32(skb, MAX_NUM_EPNO_NETS,
-			data->max_number_epno_networks) ||
-	    nla_put_u32(skb, MAX_NUM_EPNO_NETS_BY_SSID,
-			data->max_number_epno_networks_by_ssid) ||
-	    nla_put_u32(skb, MAX_NUM_WHITELISTED_SSID,
-		data->max_number_of_white_listed_ssid)) {
-			hddLog(LOGE, FL("nla put fail"));
-			goto nla_put_failure;
-	}
-
-	cfg80211_vendor_cmd_reply(skb);
-	return 0;
-
-nla_put_failure:
-	kfree_skb(skb);
-	return -EINVAL;
-}
-/*
- * done with short names for the global vendor params
- * used by wlan_hdd_send_ext_scan_capability()
- */
-#undef PARAM_REQUEST_ID
-#undef PARAM_STATUS
-#undef MAX_SCAN_CACHE_SIZE
-#undef MAX_SCAN_BUCKETS
-#undef MAX_AP_CACHE_PER_SCAN
-#undef MAX_RSSI_SAMPLE_SIZE
-#undef MAX_SCAN_RPT_THRHOLD
-#undef MAX_HOTLIST_BSSIDS
-#undef MAX_SIGNIFICANT_WIFI_CHANGE_APS
-#undef MAX_BSSID_HISTORY_ENTRIES
-#undef MAX_HOTLIST_SSIDS
-#undef MAX_NUM_EPNO_NETS
-#undef MAX_NUM_EPNO_NETS_BY_SSID
-#undef MAX_NUM_WHITELISTED_SSID
-
-/**
- * __wlan_hdd_cfg80211_extscan_get_capabilities() - get ext scan capabilities
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: none
- */
-static int __wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy,
-					       struct wireless_dev *wdev,
-					       const void *data, int data_len)
-{
-	int ret;
-	unsigned long rc;
-	struct hdd_ext_scan_context *context;
-	tpSirGetExtScanCapabilitiesReqParams pReqMsg = NULL;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
-			  1];
-	CDF_STATUS status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		      data, data_len, wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId =
-		nla_get_u32(tb
-		 [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Req Id %d Session Id %d"),
-		pReqMsg->requestId, pReqMsg->sessionId);
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	context->request_id = pReqMsg->requestId;
-	INIT_COMPLETION(context->response_event);
-	spin_unlock(&context->context_lock);
-
-	status = sme_ext_scan_get_capabilities(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("sme_ext_scan_get_capabilities failed(err=%d)"),
-			status);
-		goto fail;
-	}
-
-	rc = wait_for_completion_timeout(&context->response_event,
-		msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-	if (!rc) {
-		hddLog(LOGE, FL("Target response timed out"));
-		return -ETIMEDOUT;
-	}
-
-	ret = wlan_hdd_send_ext_scan_capability(pHddCtx);
-	if (ret)
-		hddLog(LOGE, FL("Failed to send ext scan capability to user space"));
-	EXIT();
-	return ret;
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_get_capabilities() - get ext scan capabilities
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_get_capabilities(wiphy, wdev, data,
-		data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/*
- * define short names for the global vendor params
- * used by wlan_hdd_cfg80211_extscan_get_cached_results()
- */
-#define PARAM_MAX \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAM_FLUSH \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_CACHED_SCAN_RESULTS_CONFIG_PARAM_FLUSH
-/**
- * __wlan_hdd_cfg80211_extscan_get_cached_results() - extscan get cached results
- * @wiphy: wiphy pointer
- * @wdev: pointer to struct wireless_dev
- * @data: pointer to incoming NL vendor data
- * @data_len: length of @data
- *
- * This function parses the incoming NL vendor command data attributes and
- * invokes the SME Api and blocks on a completion variable.
- * Each WMI event with cached scan results data chunk results in
- * function call wlan_hdd_cfg80211_extscan_cached_results_ind and each
- * data chunk is sent up the layer in cfg80211_vendor_cmd_alloc_reply_skb.
- *
- * If timeout happens before receiving all of the data, this function sets
- * a context variable @ignore_cached_results to %true, all of the next data
- * chunks are checked against this variable and dropped.
- *
- * Return: 0 on success; error number otherwise.
- */
-static int __wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy,
-						 struct wireless_dev
-						 *wdev, const void *data,
-						 int data_len)
-{
-	tpSirExtScanGetCachedResultsReqParams pReqMsg = NULL;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
-			  1];
-	struct hdd_ext_scan_context *context;
-	CDF_STATUS status;
-	int retval = 0;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(pHddCtx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, PARAM_MAX, data, data_len,
-		wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Req Id %d Session Id %d"),
-		pReqMsg->requestId, pReqMsg->sessionId);
-
-	/* Parse and fetch flush parameter */
-	if (!tb[PARAM_FLUSH]) {
-		hddLog(LOGE, FL("attr flush failed"));
-		goto fail;
-	}
-	pReqMsg->flush = nla_get_u8(tb[PARAM_FLUSH]);
-	hddLog(LOG1, FL("Flush %d"), pReqMsg->flush);
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	context->request_id = pReqMsg->requestId;
-	context->ignore_cached_results = false;
-	INIT_COMPLETION(context->response_event);
-	spin_unlock(&context->context_lock);
-
-	status = sme_get_cached_results(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-		       FL("sme_get_cached_results failed(err=%d)"), status);
-		goto fail;
-	}
-
-	rc = wait_for_completion_timeout(&context->response_event,
-			msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-	if (!rc) {
-		hddLog(LOGE, FL("Target response timed out"));
-		retval = -ETIMEDOUT;
-		spin_lock(&context->context_lock);
-		context->ignore_cached_results = true;
-		spin_unlock(&context->context_lock);
-	} else {
-		spin_lock(&context->context_lock);
-		retval = context->response_status;
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return retval;
-
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-/*
- * done with short names for the global vendor params
- * used by wlan_hdd_cfg80211_extscan_get_cached_results()
- */
-#undef PARAM_MAX
-#undef PARAM_REQUEST_ID
-#undef PARAM_FLUSH
-
-/**
- * wlan_hdd_cfg80211_extscan_get_cached_results() - extscan get cached results
- * @wiphy: wiphy pointer
- * @wdev: pointer to struct wireless_dev
- * @data: pointer to incoming NL vendor data
- * @data_len: length of @data
- *
- * This function parses the incoming NL vendor command data attributes and
- * invokes the SME Api and blocks on a completion variable.
- * Each WMI event with cached scan results data chunk results in
- * function call wlan_hdd_cfg80211_extscan_cached_results_ind and each
- * data chunk is sent up the layer in cfg80211_vendor_cmd_alloc_reply_skb.
- *
- * If timeout happens before receiving all of the data, this function sets
- * a context variable @ignore_cached_results to %true, all of the next data
- * chunks are checked against this variable and dropped.
- *
- * Return: 0 on success; error number otherwise.
- */
-int wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_get_cached_results(wiphy, wdev, data,
-								data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_extscan_set_bssid_hotlist() - set bssid hot list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: none
- */
-static int
-__wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy,
-						struct wireless_dev
-						*wdev, const void *data,
-						int data_len)
-{
-	tpSirExtScanSetBssidHotListReqParams pReqMsg = NULL;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
-			  1];
-	struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-			   + 1];
-	struct nlattr *apTh;
-	struct hdd_ext_scan_context *context;
-	uint32_t request_id;
-	CDF_STATUS status;
-	uint8_t i;
-	int rem, retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(pHddCtx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		      data, data_len, wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId =
-		nla_get_u32(tb
-		 [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-	hddLog(LOG1, FL("Req Id %d"), pReqMsg->requestId);
-
-	/* Parse and fetch number of APs */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP]) {
-		hddLog(LOGE, FL("attr number of AP failed"));
-		goto fail;
-	}
-	pReqMsg->numAp =
-		nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_NUM_AP]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Number of AP %d Session Id %d"),
-		pReqMsg->numAp, pReqMsg->sessionId);
-
-	/* Parse and fetch lost ap sample size */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE]) {
-		hddLog(LOGE, FL("attr lost ap sample size failed"));
-		goto fail;
-	}
-
-	pReqMsg->lost_ap_sample_size = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BSSID_HOTLIST_PARAMS_LOST_AP_SAMPLE_SIZE]);
-	hddLog(LOG1, FL("Lost ap sample size %d"),
-			pReqMsg->lost_ap_sample_size);
-
-	i = 0;
-	nla_for_each_nested(apTh,
-			    tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM],
-			    rem) {
-		if (nla_parse
-		    (tb2, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		    nla_data(apTh), nla_len(apTh),
-		    wlan_hdd_extscan_config_policy)) {
-			hddLog(LOGE, FL("nla_parse failed"));
-			goto fail;
-		}
-
-		/* Parse and fetch MAC address */
-		if (!tb2[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID]) {
-			hddLog(LOGE, FL("attr mac address failed"));
-			goto fail;
-		}
-		nla_memcpy(pReqMsg->ap[i].bssid.bytes,
-			tb2
-			[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID],
-			   CDF_MAC_ADDR_SIZE);
-		hddLog(LOG1, MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(pReqMsg->ap[i].bssid.bytes));
-
-		/* Parse and fetch low RSSI */
-		if (!tb2
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW]) {
-			hddLog(LOGE, FL("attr low RSSI failed"));
-			goto fail;
-		}
-		pReqMsg->ap[i].low =
-			nla_get_s32(tb2
-			    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW]);
-		hddLog(LOG1, FL("RSSI low %d"), pReqMsg->ap[i].low);
-
-		/* Parse and fetch high RSSI */
-		if (!tb2
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH]) {
-			hddLog(LOGE, FL("attr high RSSI failed"));
-			goto fail;
-		}
-		pReqMsg->ap[i].high =
-			nla_get_s32(tb2
-			    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH]);
-		hddLog(LOG1, FL("RSSI High %d"), pReqMsg->ap[i].high);
-
-		i++;
-	}
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = pReqMsg->requestId;
-	spin_unlock(&context->context_lock);
-
-	status = sme_set_bss_hotlist(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("sme_set_bss_hotlist failed(err=%d)"), status);
-		goto fail;
-	}
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout
-		(&context->response_event,
-		 msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-
-	if (!rc) {
-		hddLog(LOGE, FL("sme_set_bss_hotlist timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return retval;
-
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_set_bssid_hotlist() - set ext scan bssid hotlist
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_set_bssid_hotlist(wiphy, wdev, data,
-					data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-
-/**
- * __wlan_hdd_cfg80211_extscan_set_significant_change () - set significant change
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: none
- */
-static int
-__wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy,
-						     struct wireless_dev
-						     *wdev, const void *data,
-						     int data_len)
-{
-	tpSirExtScanSetSigChangeReqParams pReqMsg = NULL;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
-			  1];
-	struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-			   + 1];
-	struct nlattr *apTh;
-	struct hdd_ext_scan_context *context;
-	uint32_t request_id;
-	CDF_STATUS status;
-	uint8_t i;
-	int rem, retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(pHddCtx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		      data, data_len, wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId =
-		nla_get_u32(tb
-		 [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-	hddLog(LOG1, FL("Req Id %d"), pReqMsg->requestId);
-
-	/* Parse and fetch RSSI sample size */
-	if (!tb
-	    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE]) {
-		hddLog(LOGE, FL("attr RSSI sample size failed"));
-		goto fail;
-	}
-	pReqMsg->rssiSampleSize =
-		nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_RSSI_SAMPLE_SIZE]);
-	hddLog(LOG1, FL("RSSI sample size %u"), pReqMsg->rssiSampleSize);
-
-	/* Parse and fetch lost AP sample size */
-	if (!tb
-	    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE]) {
-		hddLog(LOGE, FL("attr lost AP sample size failed"));
-		goto fail;
-	}
-	pReqMsg->lostApSampleSize =
-		nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_LOST_AP_SAMPLE_SIZE]);
-	hddLog(LOG1, FL("Lost AP sample size %u"), pReqMsg->lostApSampleSize);
-
-	/* Parse and fetch AP min breacing */
-	if (!tb
-	    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING]) {
-		hddLog(LOGE, FL("attr AP min breaching"));
-		goto fail;
-	}
-	pReqMsg->minBreaching =
-		nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_MIN_BREACHING]);
-	hddLog(LOG1, FL("AP min breaching %u"), pReqMsg->minBreaching);
-
-	/* Parse and fetch number of APs */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP]) {
-		hddLog(LOGE, FL("attr number of AP failed"));
-		goto fail;
-	}
-	pReqMsg->numAp =
-		nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SIGNIFICANT_CHANGE_PARAMS_NUM_AP]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Number of AP %d Session Id %d"),
-		pReqMsg->numAp, pReqMsg->sessionId);
-
-	i = 0;
-	nla_for_each_nested(apTh,
-			    tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM],
-			    rem) {
-		if (nla_parse
-		    (tb2, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		    nla_data(apTh), nla_len(apTh),
-		    wlan_hdd_extscan_config_policy)) {
-			hddLog(LOGE, FL("nla_parse failed"));
-			goto fail;
-		}
-
-		/* Parse and fetch MAC address */
-		if (!tb2[QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID]) {
-			hddLog(LOGE, FL("attr mac address failed"));
-			goto fail;
-		}
-		nla_memcpy(pReqMsg->ap[i].bssid.bytes,
-			   tb2
-			   [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_BSSID],
-			   CDF_MAC_ADDR_SIZE);
-		hddLog(LOG1, MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(pReqMsg->ap[i].bssid.bytes));
-
-		/* Parse and fetch low RSSI */
-		if (!tb2
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW]) {
-			hddLog(LOGE, FL("attr low RSSI failed"));
-			goto fail;
-		}
-		pReqMsg->ap[i].low =
-			nla_get_s32(tb2
-			    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_LOW]);
-		hddLog(LOG1, FL("RSSI low %d"), pReqMsg->ap[i].low);
-
-		/* Parse and fetch high RSSI */
-		if (!tb2
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH]) {
-			hddLog(LOGE, FL("attr high RSSI failed"));
-			goto fail;
-		}
-		pReqMsg->ap[i].high =
-			nla_get_s32(tb2
-			    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_AP_THRESHOLD_PARAM_RSSI_HIGH]);
-		hddLog(LOG1, FL("RSSI High %d"), pReqMsg->ap[i].high);
-
-		i++;
-	}
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = pReqMsg->requestId;
-	spin_unlock(&context->context_lock);
-
-	status = sme_set_significant_change(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-		       FL("sme_set_significant_change failed(err=%d)"), status);
-		cdf_mem_free(pReqMsg);
-		return -EINVAL;
-	}
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout(&context->response_event,
-				 msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-
-	if (!rc) {
-		hddLog(LOGE, FL("sme_set_significant_change timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return retval;
-
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_set_significant_change() - set significant change
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy,
-				struct wireless_dev *wdev,
-				const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_set_significant_change(wiphy, wdev,
-					data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_remove_dsrc_channels () - remove dsrc chanels
- * @wiphy: Pointer to wireless phy
- * @chan_list: channel list
- * @num_channels: number of channels
- *
- * Return: none
- */
-void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list,
-				 uint8_t *num_channels)
-{
-	uint8_t num_chan_temp = 0;
-	int i;
-
-	for (i = 0; i < *num_channels; i++) {
-		if (!cds_is_dsrc_channel(chan_list[i])) {
-			chan_list[num_chan_temp] = chan_list[i];
-			num_chan_temp++;
-		}
-	}
-
-	*num_channels = num_chan_temp;
-}
-
-/**
- * hdd_remove_indoor_channels () - remove indoor channels
- * @wiphy: Pointer to wireless phy
- * @chan_list: channel list
- * @num_channels: number of channels
- *
- * Return: none
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list,
-				 uint8_t *num_channels)
-{
-	uint8_t num_chan_temp = 0;
-	int i, j, k;
-
-	for (i = 0; i < *num_channels; i++)
-		for (j = 0; j < IEEE80211_NUM_BANDS; j++) {
-			if (wiphy->bands[j] == NULL)
-				continue;
-			for (k = 0; k < wiphy->bands[j]->n_channels; k++) {
-				if ((chan_list[i] ==
-				     wiphy->bands[j]->channels[k].center_freq)
-				    && (!(wiphy->bands[j]->channels[k].flags &
-				       IEEE80211_CHAN_INDOOR_ONLY))
-				) {
-					chan_list[num_chan_temp] = chan_list[i];
-					num_chan_temp++;
-				}
-			}
-		}
-
-	*num_channels = num_chan_temp;
-}
-#else
-void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list,
-				 uint8_t *num_channels)
-{
-	*num_channels = 0;
-}
-#endif
-
-/**
- * __wlan_hdd_cfg80211_extscan_get_valid_channels () - get valid channels
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: none
- */
-static int
-__wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy,
-						 struct wireless_dev
-						 *wdev, const void *data,
-						 int data_len)
-{
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	uint32_t chan_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0};
-	uint8_t num_channels  = 0;
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
-			  1];
-	uint32_t requestId, maxChannels;
-	tWifiBand wifiBand;
-	CDF_STATUS status;
-	struct sk_buff *reply_skb;
-	uint8_t i;
-	int ret;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		      data, data_len, wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		return -EINVAL;
-	}
-	requestId =
-		nla_get_u32(tb
-		 [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-	hddLog(LOG1, FL("Req Id %d"), requestId);
-
-	/* Parse and fetch wifi band */
-	if (!tb
-	    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND]) {
-		hddLog(LOGE, FL("attr wifi band failed"));
-		return -EINVAL;
-	}
-	wifiBand =
-		nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_WIFI_BAND]);
-	hddLog(LOG1, FL("Wifi band %d"), wifiBand);
-
-	if (!tb
-	    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS]) {
-		hddLog(LOGE, FL("attr max channels failed"));
-		return -EINVAL;
-	}
-	maxChannels =
-		nla_get_u32(tb
-		    [QCA_WLAN_VENDOR_ATTR_EXTSCAN_GET_VALID_CHANNELS_CONFIG_PARAM_MAX_CHANNELS]);
-	hddLog(LOG1, FL("Max channels %d"), maxChannels);
-	status = sme_get_valid_channels_by_band((tHalHandle) (pHddCtx->hHal),
-						wifiBand, chan_list,
-						&num_channels);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGE,
-		       FL("sme_get_valid_channels_by_band failed (err=%d)"),
-		       status);
-		return -EINVAL;
-	}
-
-	num_channels = CDF_MIN(num_channels, maxChannels);
-
-	hdd_remove_dsrc_channels(wiphy, chan_list, &num_channels);
-
-	if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
-	    !strncmp(hdd_get_fwpath(), "ap", 2))
-		hdd_remove_indoor_channels(wiphy, chan_list, &num_channels);
-
-	hddLog(LOG1, FL("Number of channels %d"), num_channels);
-	for (i = 0; i < num_channels; i++)
-		hddLog(LOG1, "Channel: %u ", chan_list[i]);
-
-	reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u32) +
-							sizeof(u32) *
-							num_channels +
-							NLMSG_HDRLEN);
-
-	if (reply_skb) {
-		if (nla_put_u32(reply_skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_NUM_CHANNELS,
-			num_channels) ||
-		    nla_put(reply_skb,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_CHANNELS,
-			sizeof(u32) * num_channels, chan_list)) {
-			hddLog(LOGE, FL("nla put fail"));
-			kfree_skb(reply_skb);
-			return -EINVAL;
-		}
-		ret = cfg80211_vendor_cmd_reply(reply_skb);
-		EXIT();
-		return ret;
-	}
-
-	hddLog(LOGE, FL("valid channels: buffer alloc fail"));
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_get_valid_channels() - get ext scan valid channels
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-int wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_get_valid_channels(wiphy, wdev, data,
-			data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_extscan_update_dwell_time_limits() - update dwell times
- * @req_msg: Pointer to request message
- * @bkt_idx: Index of current bucket being processed
- * @active_min: minimum active dwell time
- * @active_max: maximum active dwell time
- * @passive_min: minimum passive dwell time
- * @passive_max: maximum passive dwell time
- *
- * Return: none
- */
-static void hdd_extscan_update_dwell_time_limits(
-			tpSirWifiScanCmdReqParams req_msg, uint32_t bkt_idx,
-			uint32_t active_min, uint32_t active_max,
-			uint32_t passive_min, uint32_t passive_max)
-{
-	/* update per-bucket dwell times */
-	if (req_msg->buckets[bkt_idx].min_dwell_time_active >
-			active_min) {
-		req_msg->buckets[bkt_idx].min_dwell_time_active =
-			active_min;
-	}
-	if (req_msg->buckets[bkt_idx].max_dwell_time_active <
-			active_max) {
-		req_msg->buckets[bkt_idx].max_dwell_time_active =
-			active_max;
-	}
-	if (req_msg->buckets[bkt_idx].min_dwell_time_passive >
-			passive_min) {
-		req_msg->buckets[bkt_idx].min_dwell_time_passive =
-			passive_min;
-	}
-	if (req_msg->buckets[bkt_idx].max_dwell_time_passive <
-			passive_max) {
-		req_msg->buckets[bkt_idx].max_dwell_time_passive =
-			passive_max;
-	}
-	/* update dwell-time across all buckets */
-	if (req_msg->min_dwell_time_active >
-			req_msg->buckets[bkt_idx].min_dwell_time_active) {
-		req_msg->min_dwell_time_active =
-			req_msg->buckets[bkt_idx].min_dwell_time_active;
-	}
-	if (req_msg->max_dwell_time_active <
-			req_msg->buckets[bkt_idx].max_dwell_time_active) {
-		req_msg->max_dwell_time_active =
-			req_msg->buckets[bkt_idx].max_dwell_time_active;
-	}
-	if (req_msg->min_dwell_time_passive >
-			req_msg->buckets[bkt_idx].min_dwell_time_passive) {
-		req_msg->min_dwell_time_passive =
-			req_msg->buckets[bkt_idx].min_dwell_time_passive;
-	}
-	if (req_msg->max_dwell_time_passive >
-			req_msg->buckets[bkt_idx].max_dwell_time_passive) {
-		req_msg->max_dwell_time_passive =
-			req_msg->buckets[bkt_idx].max_dwell_time_passive;
-	}
-}
-
-/**
- * hdd_extscan_channel_max_reached() - channel max reached
- * @req: extscan request structure
- * @total_channels: total number of channels
- *
- * Return: true if total channels reached max, false otherwise
- */
-static bool hdd_extscan_channel_max_reached(tSirWifiScanCmdReqParams *req,
-					    uint8_t total_channels)
-{
-	if (total_channels == WLAN_EXTSCAN_MAX_CHANNELS) {
-		hdd_warn(
-		   "max #of channels %d reached, take only first %d bucket(s)",
-		   total_channels, req->numBuckets);
-		return true;
-	}
-	return false;
-}
-
-/**
- * hdd_extscan_start_fill_bucket_channel_spec() - fill bucket channel spec
- * @hdd_ctx: HDD global context
- * @req_msg: Pointer to request structure
- * @tb: pointer to NL attributes
- *
- * Return: 0 on success; error number otherwise
- */
-static int hdd_extscan_start_fill_bucket_channel_spec(
-			hdd_context_t *hdd_ctx,
-			tpSirWifiScanCmdReqParams req_msg,
-			struct nlattr **tb)
-{
-	struct nlattr *bucket[
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1];
-	struct nlattr *channel[
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1];
-	struct nlattr *buckets;
-	struct nlattr *channels;
-	int rem1, rem2;
-	CDF_STATUS status;
-	uint8_t bkt_index, j, num_channels, total_channels = 0;
-	uint32_t chan_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0};
-
-	uint32_t min_dwell_time_active_bucket =
-		hdd_ctx->config->extscan_active_max_chn_time;
-	uint32_t max_dwell_time_active_bucket =
-		hdd_ctx->config->extscan_active_max_chn_time;
-	uint32_t min_dwell_time_passive_bucket =
-		hdd_ctx->config->extscan_passive_max_chn_time;
-	uint32_t max_dwell_time_passive_bucket =
-		hdd_ctx->config->extscan_passive_max_chn_time;
-
-	bkt_index = 0;
-	req_msg->min_dwell_time_active =
-		req_msg->max_dwell_time_active =
-			hdd_ctx->config->extscan_active_max_chn_time;
-
-	req_msg->min_dwell_time_passive =
-		req_msg->max_dwell_time_passive =
-			hdd_ctx->config->extscan_passive_max_chn_time;
-	req_msg->numBuckets = 0;
-
-	nla_for_each_nested(buckets,
-			tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC], rem1) {
-		if (nla_parse(bucket,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-			nla_data(buckets), nla_len(buckets), NULL)) {
-			hddLog(LOGE, FL("nla_parse failed"));
-			return -EINVAL;
-		}
-
-		/* Parse and fetch bucket spec */
-		if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX]) {
-			hddLog(LOGE, FL("attr bucket index failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].bucket = nla_get_u8(
-			bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_INDEX]);
-		hddLog(LOG1, FL("Bucket spec Index %d"),
-				req_msg->buckets[bkt_index].bucket);
-
-		/* Parse and fetch wifi band */
-		if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]) {
-			hddLog(LOGE, FL("attr wifi band failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].band = nla_get_u8(
-			bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_BAND]);
-		hddLog(LOG1, FL("Wifi band %d"),
-			req_msg->buckets[bkt_index].band);
-
-		/* Parse and fetch period */
-		if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]) {
-			hddLog(LOGE, FL("attr period failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].period = nla_get_u32(
-		bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_PERIOD]);
-		hddLog(LOG1, FL("period %d"),
-			req_msg->buckets[bkt_index].period);
-
-		/* Parse and fetch report events */
-		if (!bucket[
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS]) {
-			hddLog(LOGE, FL("attr report events failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].reportEvents = nla_get_u8(
-			bucket[
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_REPORT_EVENTS]);
-		hddLog(LOG1, FL("report events %d"),
-				req_msg->buckets[bkt_index].reportEvents);
-
-		/* Parse and fetch max period */
-		if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD]) {
-			hddLog(LOGE, FL("attr max period failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].max_period = nla_get_u32(
-			bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_MAX_PERIOD]);
-		hddLog(LOG1, FL("max period %u"),
-			req_msg->buckets[bkt_index].max_period);
-
-		/* Parse and fetch exponent */
-		if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_EXPONENT]) {
-			hddLog(LOGE, FL("attr exponent failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].exponent = nla_get_u32(
-			bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_EXPONENT]);
-		hddLog(LOG1, FL("exponent %u"),
-			req_msg->buckets[bkt_index].exponent);
-
-		/* Parse and fetch step count */
-		if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT]) {
-			hddLog(LOGE, FL("attr step count failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].step_count = nla_get_u32(
-			bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_STEP_COUNT]);
-		hddLog(LOG1, FL("Step count %u"),
-			req_msg->buckets[bkt_index].step_count);
-
-		/* start with known good values for bucket dwell times */
-		req_msg->buckets[bkt_index].min_dwell_time_active =
-		req_msg->buckets[bkt_index].max_dwell_time_active =
-			hdd_ctx->config->extscan_active_max_chn_time;
-
-		req_msg->buckets[bkt_index].min_dwell_time_passive =
-		req_msg->buckets[bkt_index].max_dwell_time_passive =
-			hdd_ctx->config->extscan_passive_max_chn_time;
-
-		/* Framework shall pass the channel list if the input WiFi band
-		 * is WIFI_BAND_UNSPECIFIED.
-		 * If the input WiFi band is specified (any value other than
-		 * WIFI_BAND_UNSPECIFIED) then driver populates the channel list
-		 */
-		if (req_msg->buckets[bkt_index].band != WIFI_BAND_UNSPECIFIED) {
-			if (hdd_extscan_channel_max_reached(req_msg,
-							    total_channels))
-				return 0;
-
-			num_channels = 0;
-			hddLog(LOG1, "WiFi band is specified, driver to fill channel list");
-			status = sme_get_valid_channels_by_band(hdd_ctx->hHal,
-						req_msg->buckets[bkt_index].band,
-						chan_list, &num_channels);
-			if (!CDF_IS_STATUS_SUCCESS(status)) {
-				hddLog(LOGE,
-				       FL("sme_GetValidChannelsByBand failed (err=%d)"),
-				       status);
-				return -EINVAL;
-			}
-			hddLog(LOG1, FL("before trimming, num_channels: %d"),
-				num_channels);
-
-			req_msg->buckets[bkt_index].numChannels =
-				CDF_MIN(num_channels,
-					(WLAN_EXTSCAN_MAX_CHANNELS -
-						total_channels));
-			hdd_info("Adj Num channels/bucket: %d total_channels: %d",
-				req_msg->buckets[bkt_index].numChannels,
-				total_channels);
-			total_channels +=
-				req_msg->buckets[bkt_index].numChannels;
-
-			for (j = 0; j < req_msg->buckets[bkt_index].numChannels;
-				j++) {
-				req_msg->buckets[bkt_index].channels[j].channel =
-							chan_list[j];
-				req_msg->buckets[bkt_index].channels[j].
-							chnlClass = 0;
-				if (CDS_IS_PASSIVE_OR_DISABLE_CH(
-					cds_freq_to_chan(chan_list[j]))) {
-					req_msg->buckets[bkt_index].channels[j].
-								passive = 1;
-					req_msg->buckets[bkt_index].channels[j].
-					dwellTimeMs =
-						hdd_ctx->config->
-						extscan_passive_max_chn_time;
-					/* reconfigure per-bucket dwell time */
-					if (min_dwell_time_passive_bucket >
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-						min_dwell_time_passive_bucket =
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-					}
-					if (max_dwell_time_passive_bucket <
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-						max_dwell_time_passive_bucket =
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-					}
-
-				} else {
-					req_msg->buckets[bkt_index].channels[j].
-							passive = 0;
-					req_msg->buckets[bkt_index].channels[j].
-					dwellTimeMs =
-						hdd_ctx->config->extscan_active_max_chn_time;
-					/* reconfigure per-bucket dwell times */
-					if (min_dwell_time_active_bucket >
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-						min_dwell_time_active_bucket =
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-					}
-					if (max_dwell_time_active_bucket <
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-						max_dwell_time_active_bucket =
-							req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-					}
-
-				}
-
-				hddLog(LOG1,
-					"Channel: %u Passive: %u Dwell time: %u ms Class: %u",
-					req_msg->buckets[bkt_index].channels[j].channel,
-					req_msg->buckets[bkt_index].channels[j].passive,
-					req_msg->buckets[bkt_index].channels[j].dwellTimeMs,
-					req_msg->buckets[bkt_index].channels[j].chnlClass);
-			}
-
-			hdd_extscan_update_dwell_time_limits(
-					req_msg, bkt_index,
-					min_dwell_time_active_bucket,
-					max_dwell_time_active_bucket,
-					min_dwell_time_passive_bucket,
-					max_dwell_time_passive_bucket);
-
-			hddLog(LOG1, FL("bkt_index:%d actv_min:%d actv_max:%d pass_min:%d pass_max:%d"),
-					bkt_index,
-					req_msg->buckets[bkt_index].min_dwell_time_active,
-					req_msg->buckets[bkt_index].max_dwell_time_active,
-					req_msg->buckets[bkt_index].min_dwell_time_passive,
-					req_msg->buckets[bkt_index].max_dwell_time_passive);
-
-			bkt_index++;
-			req_msg->numBuckets++;
-			continue;
-		}
-
-		/* Parse and fetch number of channels */
-		if (!bucket[
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS]) {
-			hddLog(LOGE, FL("attr num channels failed"));
-			return -EINVAL;
-		}
-		req_msg->buckets[bkt_index].numChannels =
-		nla_get_u32(bucket[
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC_NUM_CHANNEL_SPECS]);
-		hdd_info("before trimming: num channels %d",
-			req_msg->buckets[bkt_index].numChannels);
-
-		req_msg->buckets[bkt_index].numChannels =
-			CDF_MIN(req_msg->buckets[bkt_index].numChannels,
-				(WLAN_EXTSCAN_MAX_CHANNELS - total_channels));
-		hdd_info("Num channels/bucket: %d total_channels: %d",
-			req_msg->buckets[bkt_index].numChannels,
-			total_channels);
-		if (hdd_extscan_channel_max_reached(req_msg, total_channels))
-			return 0;
-
-		if (!bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC]) {
-			hddLog(LOGE, FL("attr channel spec failed"));
-			return -EINVAL;
-		}
-
-		j = 0;
-		nla_for_each_nested(channels,
-			bucket[QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC], rem2) {
-			if ((j >= req_msg->buckets[bkt_index].numChannels) ||
-			    hdd_extscan_channel_max_reached(req_msg,
-							    total_channels))
-				break;
-
-			if (nla_parse(channel,
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-				nla_data(channels), nla_len(channels),
-				wlan_hdd_extscan_config_policy)) {
-				hddLog(LOGE, FL("nla_parse failed"));
-				return -EINVAL;
-			}
-
-			/* Parse and fetch channel */
-			if (!channel[
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL]) {
-				hddLog(LOGE, FL("attr channel failed"));
-				return -EINVAL;
-			}
-			req_msg->buckets[bkt_index].channels[j].channel =
-				nla_get_u32(channel[
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_CHANNEL]);
-			hddLog(LOG1, FL("channel %u"),
-				req_msg->buckets[bkt_index].channels[j].channel);
-
-			/* Parse and fetch dwell time */
-			if (!channel[
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME]) {
-				hddLog(LOGE, FL("attr dwelltime failed"));
-				return -EINVAL;
-			}
-			req_msg->buckets[bkt_index].channels[j].dwellTimeMs =
-				nla_get_u32(channel[
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_DWELL_TIME]);
-
-			/* Override dwell time if required */
-			if (req_msg->buckets[bkt_index].channels[j].dwellTimeMs <
-				hdd_ctx->config->extscan_active_min_chn_time ||
-				req_msg->buckets[bkt_index].channels[j].dwellTimeMs >
-				hdd_ctx->config->extscan_active_max_chn_time) {
-				hddLog(LOG1, FL("WiFi band is unspecified, dwellTime:%d"),
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs);
-
-				if (CDS_IS_PASSIVE_OR_DISABLE_CH(
-					cds_freq_to_chan(
-						req_msg->buckets[bkt_index].channels[j].channel))) {
-					req_msg->buckets[bkt_index].channels[j].dwellTimeMs =
-						hdd_ctx->config->extscan_passive_max_chn_time;
-				} else {
-					req_msg->buckets[bkt_index].channels[j].dwellTimeMs =
-						hdd_ctx->config->extscan_active_max_chn_time;
-				}
-			}
-
-			hddLog(LOG1, FL("New Dwell time %u ms"),
-				req_msg->buckets[bkt_index].channels[j].dwellTimeMs);
-
-			if (CDS_IS_PASSIVE_OR_DISABLE_CH(
-						cds_freq_to_chan(
-						req_msg->buckets[bkt_index].channels[j].channel))) {
-				if (min_dwell_time_passive_bucket >
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-					min_dwell_time_passive_bucket =
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-				}
-				if (max_dwell_time_passive_bucket <
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-					max_dwell_time_passive_bucket =
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-				}
-			} else {
-				if (min_dwell_time_active_bucket >
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-					min_dwell_time_active_bucket =
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-				}
-				if (max_dwell_time_active_bucket <
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs) {
-					max_dwell_time_active_bucket =
-						req_msg->buckets[bkt_index].channels[j].dwellTimeMs;
-				}
-			}
-
-			/* Parse and fetch channel spec passive */
-			if (!channel[
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE]) {
-				hddLog(LOGE,
-					FL("attr channel spec passive failed"));
-				return -EINVAL;
-			}
-			req_msg->buckets[bkt_index].channels[j].passive =
-				nla_get_u8(channel[
-				QCA_WLAN_VENDOR_ATTR_EXTSCAN_CHANNEL_SPEC_PASSIVE]);
-			hddLog(LOG1, FL("Chnl spec passive %u"),
-				req_msg->buckets[bkt_index].channels[j].passive);
-			/* Override scan type if required */
-			if (CDS_IS_PASSIVE_OR_DISABLE_CH(
-				cds_freq_to_chan(
-					req_msg->buckets[bkt_index].channels[j].channel))) {
-				req_msg->buckets[bkt_index].channels[j].passive = true;
-			} else {
-				req_msg->buckets[bkt_index].channels[j].passive = false;
-			}
-			j++;
-			total_channels++;
-		}
-
-		hdd_extscan_update_dwell_time_limits(
-					req_msg, bkt_index,
-					min_dwell_time_active_bucket,
-					max_dwell_time_active_bucket,
-					min_dwell_time_passive_bucket,
-					max_dwell_time_passive_bucket);
-
-		hddLog(LOG1, FL("bktIndex:%d actv_min:%d actv_max:%d pass_min:%d pass_max:%d"),
-				bkt_index,
-				req_msg->buckets[bkt_index].min_dwell_time_active,
-				req_msg->buckets[bkt_index].max_dwell_time_active,
-				req_msg->buckets[bkt_index].min_dwell_time_passive,
-				req_msg->buckets[bkt_index].max_dwell_time_passive);
-
-		bkt_index++;
-		req_msg->numBuckets++;
-	}
-
-	hddLog(LOG1, FL("Global: actv_min:%d actv_max:%d pass_min:%d pass_max:%d"),
-				req_msg->min_dwell_time_active,
-				req_msg->max_dwell_time_active,
-				req_msg->min_dwell_time_passive,
-				req_msg->max_dwell_time_passive);
-
-	return 0;
-}
-
-/*
- * hdd_extscan_map_usr_drv_config_flags() - map userspace to driver config flags
- * @config_flags - [input] configuration flags.
- *
- * This function maps user space received configuration flags to
- * driver representation.
- *
- * Return: configuration flags
- */
-static uint32_t hdd_extscan_map_usr_drv_config_flags(uint32_t config_flags)
-{
-	uint32_t configuration_flags = 0;
-
-	if (config_flags & EXTSCAN_LP_EXTENDED_BATCHING)
-		configuration_flags |= EXTSCAN_LP_EXTENDED_BATCHING;
-
-	return configuration_flags;
-}
-
-/*
- * define short names for the global vendor params
- * used by __wlan_hdd_cfg80211_extscan_start()
- */
-#define PARAM_MAX \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAM_BASE_PERIOD \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD
-#define PARAM_MAX_AP_PER_SCAN \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN
-#define PARAM_RPT_THRHLD_PERCENT \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT
-#define PARAM_RPT_THRHLD_NUM_SCANS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS
-#define PARAM_NUM_BUCKETS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS
-#define PARAM_CONFIG_FLAGS \
-	QCA_WLAN_VENDOR_ATTR_EXTSCAN_CONFIGURATION_FLAGS
-
-/**
- * __wlan_hdd_cfg80211_extscan_start() - ext scan start
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Length of @data
- *
- * Return: 0 on success; error number otherwise
- */
-static int
-__wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
-				    struct wireless_dev *wdev,
-				    const void *data,
-				    int data_len)
-{
-	tpSirWifiScanCmdReqParams pReqMsg       = NULL;
-	struct net_device *dev                  = wdev->netdev;
-	hdd_adapter_t *pAdapter                 = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx                  = wiphy_priv(wiphy);
-	struct nlattr *tb[PARAM_MAX + 1];
-	struct hdd_ext_scan_context *context;
-	uint32_t request_id, num_buckets;
-	CDF_STATUS status;
-	int retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(pHddCtx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, PARAM_MAX, data, data_len,
-		wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("memory allocation failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Req Id %d Session Id %d"),
-			pReqMsg->requestId,
-			pReqMsg->sessionId);
-
-	/* Parse and fetch base period */
-	if (!tb[PARAM_BASE_PERIOD]) {
-		hddLog(LOGE, FL("attr base period failed"));
-		goto fail;
-	}
-	pReqMsg->basePeriod = nla_get_u32(tb[PARAM_BASE_PERIOD]);
-	hddLog(LOG1, FL("Base Period %d"),
-				pReqMsg->basePeriod);
-
-	/* Parse and fetch max AP per scan */
-	if (!tb[PARAM_MAX_AP_PER_SCAN]) {
-		hddLog(LOGE, FL("attr max_ap_per_scan failed"));
-		goto fail;
-	}
-	pReqMsg->maxAPperScan = nla_get_u32(tb[PARAM_MAX_AP_PER_SCAN]);
-	hddLog(LOG1, FL("Max AP per Scan %d"), pReqMsg->maxAPperScan);
-
-	/* Parse and fetch report threshold percent */
-	if (!tb[PARAM_RPT_THRHLD_PERCENT]) {
-		hddLog(LOGE, FL("attr report_threshold percent failed"));
-		goto fail;
-	}
-	pReqMsg->report_threshold_percent = nla_get_u8(tb[PARAM_RPT_THRHLD_PERCENT]);
-	hddLog(LOG1, FL("Report Threshold percent %d"),
-			pReqMsg->report_threshold_percent);
-
-	/* Parse and fetch report threshold num scans */
-	if (!tb[PARAM_RPT_THRHLD_NUM_SCANS]) {
-		hddLog(LOGE, FL("attr report_threshold num scans failed"));
-		goto fail;
-	}
-	pReqMsg->report_threshold_num_scans = nla_get_u8(tb[PARAM_RPT_THRHLD_NUM_SCANS]);
-	hddLog(LOG1, FL("Report Threshold num scans %d"),
-		pReqMsg->report_threshold_num_scans);
-
-	/* Parse and fetch number of buckets */
-	if (!tb[PARAM_NUM_BUCKETS]) {
-		hddLog(LOGE, FL("attr number of buckets failed"));
-		goto fail;
-	}
-	num_buckets = nla_get_u8(tb[PARAM_NUM_BUCKETS]);
-	if (num_buckets > WLAN_EXTSCAN_MAX_BUCKETS) {
-		hdd_warn("Exceeded MAX number of buckets: %d",
-				WLAN_EXTSCAN_MAX_BUCKETS);
-	}
-	hdd_info("Input: Number of Buckets %d", num_buckets);
-
-	/* This is optional attribute, if not present set it to 0 */
-	if (!tb[PARAM_CONFIG_FLAGS])
-		pReqMsg->configuration_flags = 0;
-	else
-		pReqMsg->configuration_flags =
-			hdd_extscan_map_usr_drv_config_flags(
-				nla_get_u32(tb[PARAM_CONFIG_FLAGS]));
-
-	hddLog(LOG1, FL("Configuration flags: %u"),
-				pReqMsg->configuration_flags);
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_BUCKET_SPEC]) {
-		hddLog(LOGE, FL("attr bucket spec failed"));
-		goto fail;
-	}
-
-	if (hdd_extscan_start_fill_bucket_channel_spec(pHddCtx, pReqMsg, tb))
-		goto fail;
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = pReqMsg->requestId;
-	spin_unlock(&context->context_lock);
-
-	status = sme_ext_scan_start(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-			FL("sme_ext_scan_start failed(err=%d)"), status);
-		goto fail;
-	}
-
-	pHddCtx->ext_scan_start_since_boot = cdf_get_monotonic_boottime();
-	hddLog(LOG1, FL("Timestamp since boot: %llu"),
-			pHddCtx->ext_scan_start_since_boot);
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout(&context->response_event,
-				msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-
-	if (!rc) {
-		hddLog(LOGE, FL("sme_ext_scan_start timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return retval;
-
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-/*
- * done with short names for the global vendor params
- * used by __wlan_hdd_cfg80211_extscan_start()
- */
-#undef PARAM_MAX
-#undef PARAM_REQUEST_ID
-#undef PARAM_BASE_PERIOD
-#undef PARAMS_MAX_AP_PER_SCAN
-#undef PARAMS_RPT_THRHLD_PERCENT
-#undef PARAMS_RPT_THRHLD_NUM_SCANS
-#undef PARAMS_NUM_BUCKETS
-#undef PARAM_CONFIG_FLAGS
-
-/**
- * wlan_hdd_cfg80211_extscan_start() - start extscan
- * @wiphy: Pointer to wireless phy.
- * @wdev: Pointer to wireless device.
- * @data: Pointer to input data.
- * @data_len: Length of @data.
- *
- * Return: 0 on success, negative errno on failure
- */
-int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_start(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-
-/*
- * define short names for the global vendor params
- * used by __wlan_hdd_cfg80211_extscan_stop()
- */
-#define PARAM_MAX \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-
-/**
- * __wlan_hdd_cfg80211_extscan_stop() - ext scan stop
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: none
- */
-static int
-__wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data, int data_len)
-{
-	tpSirExtScanStopReqParams pReqMsg = NULL;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[PARAM_MAX + 1];
-	struct hdd_ext_scan_context *context;
-	CDF_STATUS status;
-	uint32_t request_id;
-	int retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(pHddCtx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, PARAM_MAX, data, data_len,
-			wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Req Id %d Session Id %d"),
-		pReqMsg->requestId, pReqMsg->sessionId);
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = pReqMsg->requestId;
-	spin_unlock(&context->context_lock);
-
-	status = sme_ext_scan_stop(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-		       FL("sme_ext_scan_stop failed(err=%d)"), status);
-		goto fail;
-	}
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout(&context->response_event,
-				msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-
-	if (!rc) {
-		hddLog(LOGE, FL("sme_ext_scan_stop timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return retval;
-
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-/*
- * done with short names for the global vendor params
- * used by wlan_hdd_cfg80211_extscan_stop()
- */
-#undef PARAM_MAX
-#undef PARAM_REQUEST_ID
-
-
-/**
- * wlan_hdd_cfg80211_extscan_stop() - stop extscan
- * @wiphy: Pointer to wireless phy.
- * @wdev: Pointer to wireless device.
- * @data: Pointer to input data.
- * @data_len: Length of @data.
- *
- * Return: 0 on success, negative errno on failure
- */
-int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy,
-				struct wireless_dev *wdev,
-				const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_stop(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-
-/**
- * __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist() - reset bssid hotlist
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: none
- */
-static int
-__wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
-						  struct wireless_dev
-						  *wdev, const void *data,
-						  int data_len)
-{
-	tpSirExtScanResetBssidHotlistReqParams pReqMsg = NULL;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
-			  1];
-	struct hdd_ext_scan_context *context;
-	uint32_t request_id;
-	CDF_STATUS status;
-	int retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(pHddCtx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		      data, data_len, wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId =
-		nla_get_u32(tb
-		 [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Req Id %d Session Id %d"),
-		pReqMsg->requestId, pReqMsg->sessionId);
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = pReqMsg->requestId;
-	spin_unlock(&context->context_lock);
-
-	status = sme_reset_bss_hotlist(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-		       FL("sme_reset_bss_hotlist failed(err=%d)"), status);
-		goto fail;
-	}
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout
-		(&context->response_event,
-		 msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-	if (!rc) {
-		hddLog(LOGE, FL("sme_reset_bss_hotlist timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return retval;
-
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_reset_bssid_hotlist() - reset bssid hot list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(wiphy, wdev,
-								data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_extscan_reset_significant_change() -
- *		reset significant change
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: none
- */
-static int
-__wlan_hdd_cfg80211_extscan_reset_significant_change(struct wiphy
-						       *wiphy,
-						       struct
-						       wireless_dev
-						       *wdev, const void *data,
-						       int data_len)
-{
-	tpSirExtScanResetSignificantChangeReqParams pReqMsg = NULL;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
-			  1];
-	struct hdd_ext_scan_context *context;
-	uint32_t request_id;
-	CDF_STATUS status;
-	int retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(pHddCtx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-		      data, data_len, wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	pReqMsg = cdf_mem_malloc(sizeof(*pReqMsg));
-	if (!pReqMsg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	pReqMsg->requestId =
-		nla_get_u32(tb
-		 [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-	pReqMsg->sessionId = pAdapter->sessionId;
-	hddLog(LOG1, FL("Req Id %d Session Id %d"),
-		pReqMsg->requestId, pReqMsg->sessionId);
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = pReqMsg->requestId;
-	spin_unlock(&context->context_lock);
-
-	status = sme_reset_significant_change(pHddCtx->hHal, pReqMsg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("sme_reset_significant_change failed(err=%d)"),
-			status);
-		cdf_mem_free(pReqMsg);
-		return -EINVAL;
-	}
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout(&context->response_event,
-				msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN));
-
-	if (!rc) {
-		hddLog(LOGE, FL("sme_ResetSignificantChange timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-	EXIT();
-	return retval;
-
-fail:
-	cdf_mem_free(pReqMsg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_extscan_reset_significant_change() - reset significant
- *							change
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-int wlan_hdd_cfg80211_extscan_reset_significant_change(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data, int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_reset_significant_change(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-
-/**
- * hdd_extscan_epno_fill_network_list() - epno fill network list
- * @hddctx: HDD context
- * @req_msg: request message
- * @tb: vendor attribute table
- *
- * This function reads the network block NL vendor attributes from %tb and
- * fill in the epno request message.
- *
- * Return: 0 on success, error number otherwise
- */
-static int hdd_extscan_epno_fill_network_list(
-			hdd_context_t *hddctx,
-			struct wifi_epno_params *req_msg,
-			struct nlattr **tb)
-{
-	struct nlattr *network[
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1];
-	struct nlattr *networks;
-	int rem1, ssid_len;
-	uint8_t index, *ssid;
-
-	index = 0;
-	nla_for_each_nested(networks,
-		tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST],
-		rem1) {
-		if (nla_parse(network,
-			QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
-			nla_data(networks), nla_len(networks), NULL)) {
-			hddLog(LOGE, FL("nla_parse failed"));
-			return -EINVAL;
-		}
-
-		/* Parse and fetch ssid */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]) {
-			hddLog(LOGE, FL("attr network ssid failed"));
-			return -EINVAL;
-		}
-		ssid_len = nla_len(
-			network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]);
-
-		/* Decrement by 1, don't count null character */
-		ssid_len--;
-
-		req_msg->networks[index].ssid.length = ssid_len;
-		hddLog(LOG1, FL("network ssid length %d"), ssid_len);
-		ssid = nla_data(network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]);
-		cdf_mem_copy(req_msg->networks[index].ssid.ssId,
-				ssid, ssid_len);
-		hddLog(LOG1, FL("Ssid (%.*s)"),
-			req_msg->networks[index].ssid.length,
-			req_msg->networks[index].ssid.ssId);
-
-		/* Parse and fetch rssi threshold */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD]) {
-			hddLog(LOGE, FL("attr rssi threshold failed"));
-			return -EINVAL;
-		}
-		req_msg->networks[index].rssi_threshold = nla_get_s8(
-			network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_RSSI_THRESHOLD]);
-		hddLog(LOG1, FL("rssi threshold %d"),
-			req_msg->networks[index].rssi_threshold);
-
-		/* Parse and fetch epno flags */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS]) {
-			hddLog(LOGE, FL("attr epno flags failed"));
-			return -EINVAL;
-		}
-		req_msg->networks[index].flags = nla_get_u8(
-			network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS]);
-		hddLog(LOG1, FL("flags %u"), req_msg->networks[index].flags);
-
-		/* Parse and fetch auth bit */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT]) {
-			hddLog(LOGE, FL("attr auth bit failed"));
-			return -EINVAL;
-		}
-		req_msg->networks[index].auth_bit_field = nla_get_u8(
-			network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT]);
-		hddLog(LOG1, FL("auth bit %u"),
-			req_msg->networks[index].auth_bit_field);
-
-		index++;
-	}
-	return 0;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_epno_list() - epno set network list
- * @wiphy: wiphy
- * @wdev: pointer to wireless dev
- * @data: data pointer
- * @data_len: data length
- *
- * This function reads the NL vendor attributes from %tb and
- * fill in the epno request message.
- *
- * Return: 0 on success, error number otherwise
- */
-static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data,
-					     int data_len)
-{
-	struct wifi_epno_params *req_msg = NULL;
-	struct net_device *dev           = wdev->netdev;
-	hdd_adapter_t *adapter           = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx           = wiphy_priv(wiphy);
-	struct nlattr *tb[
-		QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
-	CDF_STATUS status;
-	uint32_t num_networks, len;
-	int ret_val;
-
-	ENTER();
-
-	ret_val = wlan_hdd_validate_context(hdd_ctx);
-	if (ret_val)
-		return ret_val;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX,
-		data, data_len,
-		wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	/* Parse and fetch number of networks */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS]) {
-		hddLog(LOGE, FL("attr num networks failed"));
-		return -EINVAL;
-	}
-	num_networks = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS]);
-	hddLog(LOG1, FL("num networks %u"), num_networks);
-
-	len = sizeof(*req_msg) +
-		(num_networks * sizeof(struct wifi_epno_network));
-	req_msg = cdf_mem_malloc(len);
-	if (!req_msg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-	cdf_mem_zero(req_msg, len);
-	req_msg->num_networks = num_networks;
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-	req_msg->request_id = nla_get_u32(
-	    tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-	hddLog(LOG1, FL("Req Id %u"), req_msg->request_id);
-
-	req_msg->session_id = adapter->sessionId;
-	hddLog(LOG1, FL("Session Id %d"), req_msg->session_id);
-
-	if (hdd_extscan_epno_fill_network_list(hdd_ctx, req_msg, tb))
-		goto fail;
-
-	status = sme_set_epno_list(hdd_ctx->hHal, req_msg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("sme_set_epno_list failed(err=%d)"), status);
-		goto fail;
-	}
-
-	EXIT();
-	cdf_mem_free(req_msg);
-	return 0;
-
-fail:
-	cdf_mem_free(req_msg);
-	return -EINVAL;
-}
-
- /**
- * wlan_hdd_cfg80211_set_epno_list() - epno set network list
- * @wiphy: wiphy
- * @wdev: pointer to wireless dev
- * @data: data pointer
- * @data_len: data length
- *
- * This function reads the NL vendor attributes from %tb and
- * fill in the epno request message.
- *
- * Return: 0 on success, error number otherwise
- */
-int wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
-				    struct wireless_dev *wdev,
-				    const void *data,
-				    int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_epno_list(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_extscan_passpoint_fill_network_list() - passpoint fill network list
- * @hddctx: HDD context
- * @req_msg: request message
- * @tb: vendor attribute table
- *
- * This function reads the network block NL vendor attributes from %tb and
- * fill in the passpoint request message.
- *
- * Return: 0 on success, error number otherwise
- */
-static int hdd_extscan_passpoint_fill_network_list(
-			hdd_context_t *hddctx,
-			struct wifi_passpoint_req *req_msg,
-			struct nlattr **tb)
-{
-	struct nlattr *network[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
-	struct nlattr *networks;
-	int rem1, len;
-	uint8_t index;
-
-	index = 0;
-	nla_for_each_nested(networks,
-		tb[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY],
-		rem1) {
-		if (nla_parse(network,
-			QCA_WLAN_VENDOR_ATTR_PNO_MAX,
-			nla_data(networks), nla_len(networks), NULL)) {
-			hddLog(LOGE, FL("nla_parse failed"));
-			return -EINVAL;
-		}
-
-		/* Parse and fetch identifier */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID]) {
-			hddLog(LOGE, FL("attr passpoint id failed"));
-			return -EINVAL;
-		}
-		req_msg->networks[index].id = nla_get_u32(
-			network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID]);
-		hddLog(LOG1, FL("Id %u"), req_msg->networks[index].id);
-
-		/* Parse and fetch realm */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM]) {
-			hddLog(LOGE, FL("attr realm failed"));
-			return -EINVAL;
-		}
-		len = nla_len(
-			network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM]);
-		if (len < 0 || len > SIR_PASSPOINT_REALM_LEN) {
-			hddLog(LOGE, FL("Invalid realm size %d"), len);
-			return -EINVAL;
-		}
-		cdf_mem_copy(req_msg->networks[index].realm,
-				nla_data(network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM]),
-				len);
-		hddLog(LOG1, FL("realm len %d"), len);
-		hddLog(LOG1, FL("realm: %s"), req_msg->networks[index].realm);
-
-		/* Parse and fetch roaming consortium ids */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID]) {
-			hddLog(LOGE, FL("attr roaming consortium ids failed"));
-			return -EINVAL;
-		}
-		nla_memcpy(&req_msg->networks[index].roaming_consortium_ids,
-			network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID],
-			sizeof(req_msg->networks[0].roaming_consortium_ids));
-		hddLog(LOG1, FL("roaming consortium ids"));
-
-		/* Parse and fetch plmn */
-		if (!network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN]) {
-			hddLog(LOGE, FL("attr plmn failed"));
-			return -EINVAL;
-		}
-		nla_memcpy(&req_msg->networks[index].plmn,
-			network[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN],
-			SIR_PASSPOINT_PLMN_LEN);
-		hddLog(LOG1, FL("plmn %02x:%02x:%02x)"),
-			req_msg->networks[index].plmn[0],
-			req_msg->networks[index].plmn[1],
-			req_msg->networks[index].plmn[2]);
-
-		index++;
-	}
-	return 0;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_passpoint_list() - set passpoint network list
- * @wiphy: wiphy
- * @wdev: pointer to wireless dev
- * @data: data pointer
- * @data_len: data length
- *
- * This function reads the NL vendor attributes from %tb and
- * fill in the passpoint request message.
- *
- * Return: 0 on success, error number otherwise
- */
-static int __wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
-						  struct wireless_dev *wdev,
-						  const void *data,
-						  int data_len)
-{
-	struct wifi_passpoint_req *req_msg = NULL;
-	struct net_device *dev             = wdev->netdev;
-	hdd_adapter_t *adapter             = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx             = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
-	CDF_STATUS status;
-	uint32_t num_networks = 0;
-	int ret;
-
-	ENTER();
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret)
-		return ret;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, data, data_len,
-		wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	/* Parse and fetch number of networks */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM]) {
-		hddLog(LOGE, FL("attr num networks failed"));
-		return -EINVAL;
-	}
-	num_networks = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM]);
-	hddLog(LOG1, FL("num networks %u"), num_networks);
-
-	req_msg = cdf_mem_malloc(sizeof(*req_msg) +
-			(num_networks * sizeof(req_msg->networks[0])));
-	if (!req_msg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-	req_msg->num_networks = num_networks;
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-	req_msg->request_id = nla_get_u32(
-	    tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-
-	req_msg->session_id = adapter->sessionId;
-	hddLog(LOG1, FL("Req Id %u Session Id %d"), req_msg->request_id,
-			req_msg->session_id);
-
-	if (hdd_extscan_passpoint_fill_network_list(hdd_ctx, req_msg, tb))
-		goto fail;
-
-	status = sme_set_passpoint_list(hdd_ctx->hHal, req_msg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-			FL("sme_set_passpoint_list failed(err=%d)"), status);
-		goto fail;
-	}
-
-	EXIT();
-	cdf_mem_free(req_msg);
-	return 0;
-
-fail:
-	cdf_mem_free(req_msg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_set_passpoint_list() - set passpoint network list
- * @wiphy: wiphy
- * @wdev: pointer to wireless dev
- * @data: data pointer
- * @data_len: data length
- *
- * This function reads the NL vendor attributes from %tb and
- * fill in the passpoint request message.
- *
- * Return: 0 on success, error number otherwise
- */
-int wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
-					 struct wireless_dev *wdev,
-					 const void *data,
-					 int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_passpoint_list(wiphy, wdev,
-						     data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_reset_passpoint_list() - reset passpoint network list
- * @wiphy: wiphy
- * @wdev: pointer to wireless dev
- * @data: data pointer
- * @data_len: data length
- *
- * This function resets passpoint networks list
- *
- * Return: 0 on success, error number otherwise
- */
-static int __wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
-						    struct wireless_dev *wdev,
-						    const void *data,
-						    int data_len)
-{
-	struct wifi_passpoint_req *req_msg = NULL;
-	struct net_device *dev             = wdev->netdev;
-	hdd_adapter_t *adapter             = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx             = wiphy_priv(wiphy);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
-	CDF_STATUS status;
-	int ret;
-
-	ENTER();
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret)
-		return ret;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX, data, data_len,
-		wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	req_msg = cdf_mem_malloc(sizeof(*req_msg));
-	if (!req_msg) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-	req_msg->request_id = nla_get_u32(
-	    tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
-
-	req_msg->session_id = adapter->sessionId;
-	hddLog(LOG1, FL("Req Id %u Session Id %d"),
-			req_msg->request_id, req_msg->session_id);
-
-	status = sme_reset_passpoint_list(hdd_ctx->hHal, req_msg);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-			FL("sme_reset_passpoint_list failed(err=%d)"), status);
-		goto fail;
-	}
-
-	EXIT();
-	cdf_mem_free(req_msg);
-	return 0;
-
-fail:
-	cdf_mem_free(req_msg);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_reset_passpoint_list() - reset passpoint network list
- * @wiphy: wiphy
- * @wdev: pointer to wireless dev
- * @data: data pointer
- * @data_len: data length
- *
- * This function resets passpoint networks list
- *
- * Return: 0 on success, error number otherwise
- */
-int wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   const void *data,
-					   int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_reset_passpoint_list(wiphy, wdev,
-						       data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/*
- * define short names for the global vendor params
- * used by __wlan_hdd_cfg80211_extscan_set_ssid_hotlist()
- */
-#define PARAM_MAX \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-#define PARAMS_LOST_SSID_SAMPLE_SIZE \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE
-#define PARAMS_NUM_SSID \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
-#define THRESHOLD_PARAM \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM
-#define PARAM_SSID \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID
-#define PARAM_BAND \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND
-#define PARAM_RSSI_LOW \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW
-#define PARAM_RSSI_HIGH \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH
-
-/**
- * __wlan_hdd_cfg80211_extscan_set_ssid_hotlist() - set ssid hot list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int
-__wlan_hdd_cfg80211_extscan_set_ssid_hotlist(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   const void *data,
-					   int data_len)
-{
-	struct sir_set_ssid_hotlist_request *request;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct nlattr *tb[PARAM_MAX + 1];
-	struct nlattr *tb2[PARAM_MAX + 1];
-	struct nlattr *ssids;
-	struct hdd_ext_scan_context *context;
-	uint32_t request_id;
-	char ssid_string[SIR_MAC_MAX_SSID_LENGTH + 1];
-	int ssid_len, i, rem;
-	CDF_STATUS status;
-	int retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, PARAM_MAX,
-		      data, data_len,
-		      wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	request = cdf_mem_malloc(sizeof(*request));
-	if (!request) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	request->request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	hddLog(LOG1, FL("Request Id %d"), request->request_id);
-
-	/* Parse and fetch lost SSID sample size */
-	if (!tb[PARAMS_LOST_SSID_SAMPLE_SIZE]) {
-		hddLog(LOGE, FL("attr number of Ssid failed"));
-		goto fail;
-	}
-	request->lost_ssid_sample_size =
-		nla_get_u32(tb[PARAMS_LOST_SSID_SAMPLE_SIZE]);
-	hddLog(LOG1, FL("Lost SSID Sample Size %d"),
-	       request->lost_ssid_sample_size);
-
-	/* Parse and fetch number of hotlist SSID */
-	if (!tb[PARAMS_NUM_SSID]) {
-		hddLog(LOGE, FL("attr number of Ssid failed"));
-		goto fail;
-	}
-	request->ssid_count = nla_get_u32(tb[PARAMS_NUM_SSID]);
-	hddLog(LOG1, FL("Number of SSID %d"), request->ssid_count);
-
-	request->session_id = adapter->sessionId;
-	hddLog(LOG1, FL("Session Id %d"), request->session_id);
-
-	i = 0;
-	nla_for_each_nested(ssids, tb[THRESHOLD_PARAM], rem) {
-		if (i >= WLAN_EXTSCAN_MAX_HOTLIST_SSIDS) {
-			hddLog(LOGE,
-			       FL("Too Many SSIDs, %d exceeds %d"),
-			       i, WLAN_EXTSCAN_MAX_HOTLIST_SSIDS);
-			break;
-		}
-		if (nla_parse(tb2, PARAM_MAX,
-			      nla_data(ssids), nla_len(ssids),
-			      wlan_hdd_extscan_config_policy)) {
-			hddLog(LOGE, FL("nla_parse failed"));
-			goto fail;
-		}
-
-		/* Parse and fetch SSID */
-		if (!tb2[PARAM_SSID]) {
-			hddLog(LOGE, FL("attr ssid failed"));
-			goto fail;
-		}
-		nla_memcpy(ssid_string,
-			   tb2[PARAM_SSID],
-			   sizeof(ssid_string));
-		hddLog(LOG1, FL("SSID %s"),
-		       ssid_string);
-		ssid_len = strlen(ssid_string);
-		memcpy(request->ssids[i].ssid.ssId, ssid_string, ssid_len);
-		request->ssids[i].ssid.length = ssid_len;
-
-		/* Parse and fetch low RSSI */
-		if (!tb2[PARAM_BAND]) {
-			hddLog(LOGE, FL("attr band failed"));
-			goto fail;
-		}
-		request->ssids[i].band = nla_get_u8(tb2[PARAM_BAND]);
-		hddLog(LOG1, FL("band %d"), request->ssids[i].band);
-
-		/* Parse and fetch low RSSI */
-		if (!tb2[PARAM_RSSI_LOW]) {
-			hddLog(LOGE, FL("attr low RSSI failed"));
-			goto fail;
-		}
-		request->ssids[i].rssi_low = nla_get_s32(tb2[PARAM_RSSI_LOW]);
-		hddLog(LOG1, FL("RSSI low %d"), request->ssids[i].rssi_low);
-
-		/* Parse and fetch high RSSI */
-		if (!tb2[PARAM_RSSI_HIGH]) {
-			hddLog(LOGE, FL("attr high RSSI failed"));
-			goto fail;
-		}
-		request->ssids[i].rssi_high = nla_get_u32(tb2[PARAM_RSSI_HIGH]);
-		hddLog(LOG1, FL("RSSI high %d"), request->ssids[i].rssi_high);
-		i++;
-	}
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = request->request_id;
-	spin_unlock(&context->context_lock);
-
-	status = sme_set_ssid_hotlist(hdd_ctx->hHal, request);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-		       FL("sme_set_ssid_hotlist failed(err=%d)"), status);
-		goto fail;
-	}
-
-	cdf_mem_free(request);
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout(&context->response_event,
-					 msecs_to_jiffies
-						(WLAN_WAIT_TIME_EXTSCAN));
-	if (!rc) {
-		hddLog(LOGE, FL("sme_set_ssid_hotlist timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-
-	return retval;
-
-fail:
-	cdf_mem_free(request);
-	return -EINVAL;
-}
-
-/*
- * done with short names for the global vendor params
- * used by wlan_hdd_cfg80211_extscan_set_ssid_hotlist()
- */
-#undef PARAM_MAX
-#undef PARAM_REQUEST_ID
-#undef PARAMS_NUM_SSID
-#undef THRESHOLD_PARAM
-#undef PARAM_SSID
-#undef PARAM_BAND
-#undef PARAM_RSSI_LOW
-#undef PARAM_RSSI_HIGH
-
-/**
- * wlan_hdd_cfg80211_extscan_set_ssid_hotlist() - set ssid hot list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-int
-wlan_hdd_cfg80211_extscan_set_ssid_hotlist(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   const void *data,
-					   int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_set_ssid_hotlist(wiphy, wdev, data,
-							data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/*
- * define short names for the global vendor params
- * used by __wlan_hdd_cfg80211_extscan_reset_ssid_hotlist()
- */
-#define PARAM_MAX \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
-#define PARAM_REQUEST_ID \
-		QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
-
-/**
- * __wlan_hdd_cfg80211_extscan_reset_ssid_hotlist() - reset ssid hot list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-static int
-__wlan_hdd_cfg80211_extscan_reset_ssid_hotlist(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data,
-					     int data_len)
-{
-	struct sir_set_ssid_hotlist_request *request;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct nlattr *tb[PARAM_MAX + 1];
-	struct hdd_ext_scan_context *context;
-	uint32_t request_id;
-	CDF_STATUS status;
-	int retval;
-	unsigned long rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	retval = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != retval)
-		return -EINVAL;
-
-	if (nla_parse(tb, PARAM_MAX,
-		      data, data_len,
-		      wlan_hdd_extscan_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	request = cdf_mem_malloc(sizeof(*request));
-	if (!request) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	/* Parse and fetch request Id */
-	if (!tb[PARAM_REQUEST_ID]) {
-		hddLog(LOGE, FL("attr request id failed"));
-		goto fail;
-	}
-
-	request->request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
-	hddLog(LOG1, FL("Request Id %d"), request->request_id);
-
-	request->session_id = adapter->sessionId;
-	hddLog(LOG1, FL("Session Id %d"), request->session_id);
-
-	request->lost_ssid_sample_size = 0;
-	request->ssid_count = 0;
-
-	context = &ext_scan_context;
-	spin_lock(&context->context_lock);
-	INIT_COMPLETION(context->response_event);
-	context->request_id = request_id = request->request_id;
-	spin_unlock(&context->context_lock);
-
-	status = sme_set_ssid_hotlist(hdd_ctx->hHal, request);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-		       FL("sme_reset_ssid_hotlist failed(err=%d)"), status);
-		goto fail;
-	}
-
-	cdf_mem_free(request);
-
-	/* request was sent -- wait for the response */
-	rc = wait_for_completion_timeout(&context->response_event,
-					 msecs_to_jiffies
-						(WLAN_WAIT_TIME_EXTSCAN));
-	if (!rc) {
-		hddLog(LOGE, FL("sme_reset_ssid_hotlist timed out"));
-		retval = -ETIMEDOUT;
-	} else {
-		spin_lock(&context->context_lock);
-		if (context->request_id == request_id)
-			retval = context->response_status;
-		else
-			retval = -EINVAL;
-		spin_unlock(&context->context_lock);
-	}
-
-	return retval;
-
-fail:
-	cdf_mem_free(request);
-	return -EINVAL;
-}
-
-/*
- * done with short names for the global vendor params
- * used by wlan_hdd_cfg80211_extscan_reset_ssid_hotlist()
- */
-#undef PARAM_MAX
-#undef PARAM_REQUEST_ID
-
-/**
- * wlan_hdd_cfg80211_extscan_reset_ssid_hotlist() - reset ssid hot list
- * @wiphy: Pointer to wireless phy
- * @wdev: Pointer to wireless device
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 on success, negative errno on failure
- */
-int
-wlan_hdd_cfg80211_extscan_reset_ssid_hotlist(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data,
-					     int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_extscan_reset_ssid_hotlist(wiphy, wdev,
-							data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_init_completion_extwow() - Initialize ext wow variable
- * @hdd_ctx: Global HDD context
- *
- * Return: none
- */
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-static inline void wlan_hdd_init_completion_extwow(hdd_context_t *pHddCtx)
-{
-	init_completion(&pHddCtx->ready_to_extwow);
-}
-#else
-static inline void wlan_hdd_init_completion_extwow(hdd_context_t *pHddCtx)
-{
-	return;
-}
-#endif
-
-/**
- * wlan_hdd_cfg80211_extscan_init() - Initialize the ExtScan feature
- * @hdd_ctx: Global HDD context
- *
- * Return: none
- */
-void wlan_hdd_cfg80211_extscan_init(hdd_context_t *hdd_ctx)
-{
-	wlan_hdd_init_completion_extwow(hdd_ctx);
-	init_completion(&ext_scan_context.response_event);
-	spin_lock_init(&ext_scan_context.context_lock);
-}
-
-#endif /* FEATURE_WLAN_EXTSCAN */

+ 0 - 127
core/hdd/src/wlan_hdd_ext_scan.h

@@ -1,127 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_EXT_SCAN_H)
-#define WLAN_HDD_EXT_SCAN_H
-
-/**
- * DOC: wlan_hdd_ext_scan.h
- *
- * WLAN Host Device Driver EXT SCAN feature implementation
- *
- */
-
-#ifdef FEATURE_WLAN_EXTSCAN
-
-#include "wlan_hdd_main.h"
-
-/*
- * Used to allocate the size of 4096 for the EXTScan NL data.
- * The size of 4096 is considered assuming that all data per
- * respective event fit with in the limit.Please take a call
- * on the limit based on the data requirements.
- */
-
-#define EXTSCAN_EVENT_BUF_SIZE 4096
-
-int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
-				    struct wireless_dev *wdev,
-				    const void *data, int data_len);
-
-int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data, int data_len);
-
-int wlan_hdd_cfg80211_extscan_get_valid_channels(struct wiphy *wiphy,
-						 struct wireless_dev
-						 *wdev, const void *data,
-						 int data_len);
-
-int wlan_hdd_cfg80211_extscan_get_capabilities(struct wiphy *wiphy,
-					       struct wireless_dev *wdev,
-					       const void *data, int data_len);
-
-int wlan_hdd_cfg80211_extscan_get_cached_results(struct wiphy *wiphy,
-						 struct wireless_dev
-						 *wdev, const void *data,
-						 int data_len);
-
-int wlan_hdd_cfg80211_extscan_set_bssid_hotlist(struct wiphy *wiphy,
-						struct wireless_dev
-						*wdev, const void *data,
-						int data_len);
-
-int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
-						  struct wireless_dev
-						  *wdev, const void *data,
-						  int data_len);
-
-int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy,
-						     struct wireless_dev
-						     *wdev, const void *data,
-						     int data_len);
-
-int wlan_hdd_cfg80211_extscan_reset_significant_change(struct wiphy
-						       *wiphy,
-						       struct
-						       wireless_dev
-						       *wdev, const void *data,
-						       int data_len);
-
-int wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data,
-				   int data_len);
-
-int wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len);
-
-int wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len);
-
-int
-wlan_hdd_cfg80211_extscan_set_ssid_hotlist(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   const void *data,
-					   int data_len);
-
-int
-wlan_hdd_cfg80211_extscan_reset_ssid_hotlist(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data,
-					     int data_len);
-
-void wlan_hdd_cfg80211_extscan_init(hdd_context_t *hdd_ctx);
-
-#else /* FEATURE_WLAN_EXTSCAN */
-
-static void wlan_hdd_cfg80211_extscan_init(hdd_context_t *hdd_ctx)
-{
-}
-
-#endif /* End of FEATURE_WLAN_EXTSCAN */
-
-#endif /* end #if !defined(WLAN_HDD_EXT_SCAN_H) */
-

+ 0 - 1037
core/hdd/src/wlan_hdd_ftm.c

@@ -1,1037 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_ftm.c
- *
- * This file contains the WLAN factory test mode implementation
- */
-
-#include <cds_mq.h>
-#include "cds_sched.h"
-#include <cds_api.h>
-#include "sir_types.h"
-#include "cdf_types.h"
-#include "sir_api.h"
-#include "sir_mac_prot_def.h"
-#include "sme_api.h"
-#include "mac_init_api.h"
-#include "wlan_qct_sys.h"
-#include "wlan_hdd_misc.h"
-#include "i_cds_packet.h"
-#include "cds_reg_service.h"
-#include "wlan_hdd_main.h"
-#include "qwlan_version.h"
-#include "wma_types.h"
-#include "cfg_api.h"
-
-#if  defined(QCA_WIFI_FTM)
-#include "bmi.h"
-#include "ol_fw.h"
-#include "wlan_hdd_cfg80211.h"
-#include "wlan_hdd_main.h"
-#include "hif.h"
-#endif
-
-#define HDD_FTM_WMA_PRE_START_TIMEOUT (30000) /* 30 seconds */
-
-#if  defined(QCA_WIFI_FTM)
-#if defined(LINUX_QCMBR)
-#define ATH_XIOCTL_UNIFIED_UTF_CMD  0x1000
-#define ATH_XIOCTL_UNIFIED_UTF_RSP  0x1001
-#define MAX_UTF_LENGTH              1024
-typedef struct qcmbr_data_s {
-	unsigned int cmd;
-	unsigned int length;
-	unsigned char buf[MAX_UTF_LENGTH + 4];
-	unsigned int copy_to_user;
-} qcmbr_data_t;
-typedef struct qcmbr_queue_s {
-	unsigned char utf_buf[MAX_UTF_LENGTH + 4];
-	struct list_head list;
-} qcmbr_queue_t;
-LIST_HEAD(qcmbr_queue_head);
-DEFINE_SPINLOCK(qcmbr_queue_lock);
-#endif
-#endif
-
-/**
- * wlan_ftm_postmsg() - Post FTM message
- * @cmd_ptr: Pointer to FTM command buffer
- * @cmd_len: Length of command in @cmd_ptr
- *
- * This function is used to send FTM commands to firmware
- *
- * Return: 0 for success, non zero for failure
- */
-static uint32_t wlan_ftm_postmsg(uint8_t *cmd_ptr, uint16_t cmd_len)
-{
-	cds_msg_t ftmMsg;
-
-	ENTER();
-
-	ftmMsg.type = WMA_FTM_CMD_REQ;
-	ftmMsg.reserved = 0;
-	ftmMsg.bodyptr = (uint8_t *) cmd_ptr;
-	ftmMsg.bodyval = 0;
-
-	if (CDF_STATUS_SUCCESS != cds_mq_post_message(CDF_MODULE_ID_WMA,
-						      &ftmMsg)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: : Failed to post Msg to HAL",
-		       __func__);
-
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	EXIT();
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_hdd_ftm_update_tgt_cfg() - Update target configuration
- * @context: context registered with WMA
- * @param: target configuration
- *
- * This function is registered with WMA via wma_open(), and is
- * invoked via callback when target parameters are received
- * from firmware.
- *
- * Return: None
- */
-static void wlan_hdd_ftm_update_tgt_cfg(void *context, void *param)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *) context;
-	struct wma_tgt_cfg *cfg = (struct wma_tgt_cfg *)param;
-
-	if (!cdf_is_macaddr_zero(&cfg->hw_macaddr)) {
-		hdd_update_macaddr(hdd_ctx->config, cfg->hw_macaddr);
-	} else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: Invalid MAC passed from target, using MAC from ini file"
-		       MAC_ADDRESS_STR, __func__,
-		       MAC_ADDR_ARRAY(hdd_ctx->config->intfMacAddr[0].bytes));
-	}
-}
-
-/**
- * wlan_ftm_cds_open() - Open the CDS Module in FTM mode
- * @p_cds_context: pointer to the global CDS context
- * @hddContextSize: Size of the HDD context to allocate.
- *
- * The wlan_ftm_cds_open() function opens the CDF Scheduler
- * Upon successful initialization:
- * - All CDS submodules should have been initialized
- * - The CDS scheduler should have opened
- * - All the WLAN SW components should have been opened. This includes MAC.
- *
- * Returns:
- *	CDF_STATUS_SUCCESS - Scheduler was successfully initialized and
- *	is ready to be used.
- *	CDF_STATUS_E_RESOURCES - System resources (other than memory)
- *	are unavailable to initialize the scheduler
- *	CDF_STATUS_E_FAILURE - Failure to initialize the scheduler
- */
-static CDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context,
-				    uint32_t hddContextSize)
-{
-	CDF_STATUS vStatus = CDF_STATUS_SUCCESS;
-	int iter = 0;
-	tSirRetStatus sirStatus = eSIR_SUCCESS;
-	tMacOpenParameters mac_openParms;
-	p_cds_contextType gp_cds_context = (p_cds_contextType) p_cds_context;
-#if  defined(QCA_WIFI_FTM)
-	cdf_device_t cdf_ctx;
-	HTC_INIT_INFO htcInfo;
-	void *pHifContext = NULL;
-	void *pHtcContext = NULL;
-#endif
-	hdd_context_t *hdd_ctx;
-
-	CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Opening CDS", __func__);
-
-	if (NULL == gp_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Trying to open CDS without a PreOpen", __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Initialize the probe event */
-	if (cdf_event_init(&gp_cds_context->ProbeEvent) != CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Unable to init probeEvent", __func__);
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (cdf_event_init(&(gp_cds_context->wmaCompleteEvent)) !=
-	    CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Unable to init wmaCompleteEvent", __func__);
-		CDF_ASSERT(0);
-
-		goto err_probe_event;
-	}
-
-	/* Initialize the free message queue */
-	vStatus = cds_mq_init(&gp_cds_context->freeVosMq);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to initialize CDS free message queue %d",
-			  __func__, vStatus);
-		CDF_ASSERT(0);
-		goto err_wma_complete_event;
-	}
-
-	for (iter = 0; iter < CDS_CORE_MAX_MESSAGES; iter++) {
-		(gp_cds_context->aMsgWrappers[iter]).pVosMsg =
-			&(gp_cds_context->aMsgBuffers[iter]);
-		INIT_LIST_HEAD(&gp_cds_context->aMsgWrappers[iter].msgNode);
-		cds_mq_put(&gp_cds_context->freeVosMq,
-			   &(gp_cds_context->aMsgWrappers[iter]));
-	}
-
-	/* Now Open the CDS Scheduler */
-	vStatus = cds_sched_open(gp_cds_context, &gp_cds_context->cdf_sched,
-				 sizeof(cds_sched_context));
-
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to open CDS Scheduler %d", __func__,
-			  vStatus);
-		CDF_ASSERT(0);
-		goto err_msg_queue;
-	}
-#if  defined(QCA_WIFI_FTM)
-	/* Initialize BMI and Download firmware */
-	pHifContext = cds_get_context(CDF_MODULE_ID_HIF);
-	if (!pHifContext) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: failed to get HIF context", __func__);
-		goto err_sched_close;
-	}
-
-	if (bmi_download_firmware(pHifContext)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: BMI failed to download target", __func__);
-		goto err_bmi_close;
-	}
-	htcInfo.pContext = gp_cds_context->pHIFContext;
-	htcInfo.TargetFailure = ol_target_failure;
-	htcInfo.TargetSendSuspendComplete = wma_target_suspend_acknowledge;
-	cdf_ctx = cds_get_context(CDF_MODULE_ID_CDF_DEVICE);
-
-	/* Create HTC */
-	gp_cds_context->htc_ctx =
-		htc_create(htcInfo.pContext, &htcInfo, cdf_ctx);
-	if (!gp_cds_context->htc_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to Create HTC", __func__);
-		goto err_bmi_close;
-	}
-
-	if (bmi_done(pHifContext)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to complete BMI phase", __func__);
-		goto err_htc_close;
-	}
-#endif /* QCA_WIFI_FTM */
-
-	/*Open the WMA module */
-	cdf_mem_set(&mac_openParms, sizeof(mac_openParms), 0);
-	mac_openParms.driverType = eDRIVER_TYPE_MFG;
-
-	hdd_ctx = (hdd_context_t *) (gp_cds_context->pHDDContext);
-	if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Hdd Context is Null", __func__);
-		CDF_ASSERT(0);
-		goto err_htc_close;
-	}
-
-	mac_openParms.powersaveOffloadEnabled =
-		hdd_ctx->config->enablePowersaveOffload;
-
-#ifdef WLAN_FEATURE_LPSS
-	mac_openParms.is_lpass_enabled = hdd_ctx->config->enablelpasssupport;
-#endif
-
-	vStatus = wma_open(gp_cds_context,
-			   wlan_hdd_ftm_update_tgt_cfg, NULL, &mac_openParms);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to open WMA module %d", __func__,
-			  vStatus);
-		CDF_ASSERT(0);
-		goto err_htc_close;
-	}
-#if  defined(QCA_WIFI_FTM)
-	((struct ol_softc *)pHifContext)->enable_ramdump_collection =
-				hdd_ctx->config->is_ramdump_enabled;
-
-	pHtcContext = cds_get_context(CDF_MODULE_ID_HTC);
-	if (!pHtcContext) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: failed to get HTC context", __func__);
-		goto err_wma_close;
-	}
-	if (htc_wait_target(pHtcContext)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Failed to complete BMI phase", __func__);
-		goto err_wma_close;
-	}
-#endif
-
-	/* Now proceed to open the MAC */
-
-	/* UMA is supported in hardware for performing the
-	 * frame translation 802.11 <-> 802.3
-	 */
-	mac_openParms.frameTransRequired = 1;
-
-	sirStatus =
-		mac_open(&(gp_cds_context->pMACContext),
-			 gp_cds_context->pHDDContext,
-			 &mac_openParms);
-
-	if (eSIR_SUCCESS != sirStatus) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to open MAC %d", __func__, sirStatus);
-		CDF_ASSERT(0);
-		goto err_wma_close;
-	}
-#ifndef QCA_WIFI_FTM
-	/* Now proceed to open the SME */
-	vStatus = sme_open(gp_cds_context->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		/* Critical Error ...  Cannot proceed further */
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to open SME %d", __func__, vStatus);
-		goto err_mac_close;
-	}
-
-	vStatus = sme_init_chan_list(gp_cds_context->pMACContext,
-				     hdd_ctx->reg.alpha2, hdd_ctx->reg.cc_src);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to init sme channel list", __func__);
-	} else {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "%s: CDS successfully Opened", __func__);
-		return CDF_STATUS_SUCCESS;
-	}
-#else
-	return CDF_STATUS_SUCCESS;
-#endif
-
-#ifndef QCA_WIFI_FTM
-err_mac_close:
-#endif
-	mac_close(gp_cds_context->pMACContext);
-
-err_wma_close:
-	wma_close(gp_cds_context);
-
-err_htc_close:
-#if  defined(QCA_WIFI_FTM)
-	if (gp_cds_context->htc_ctx) {
-		htc_destroy(gp_cds_context->htc_ctx);
-		gp_cds_context->htc_ctx = NULL;
-	}
-
-err_bmi_close:
-	bmi_cleanup(pHifContext);
-#endif /* QCA_WIFI_FTM */
-
-err_sched_close:
-	cds_sched_close(gp_cds_context);
-err_msg_queue:
-	cds_mq_deinit(&gp_cds_context->freeVosMq);
-
-err_wma_complete_event:
-	cdf_event_destroy(&gp_cds_context->wmaCompleteEvent);
-
-err_probe_event:
-	cdf_event_destroy(&gp_cds_context->ProbeEvent);
-
-	return CDF_STATUS_E_FAILURE;
-
-} /* wlan_ftm_cds_open() */
-
-/**
- * wlan_ftm_cds_close() - Close the CDF Module in FTM mode
- * @cds_context:  context of cds
- *
- * The wlan_ftm_cds_close() function closes the CDF Module
- *
- * Return: CDF_STATUS_SUCCESS - successfully closed
- */
-static CDF_STATUS wlan_ftm_cds_close(v_CONTEXT_t cds_context)
-{
-	CDF_STATUS cdf_status;
-	p_cds_contextType gp_cds_context = (p_cds_contextType) cds_context;
-
-#ifndef QCA_WIFI_FTM
-	cdf_status = sme_close(((p_cds_contextType) cds_context)->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close SME %d", __func__, cdf_status);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-#endif
-
-	cdf_status = mac_close(((p_cds_contextType) cds_context)->pMACContext);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close MAC %d", __func__, cdf_status);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	((p_cds_contextType) cds_context)->pMACContext = NULL;
-
-
-	cdf_status = wma_close(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close WMA %d", __func__, cdf_status);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-#if  defined(QCA_WIFI_FTM)
-	if (gp_cds_context->htc_ctx) {
-		htc_stop(gp_cds_context->htc_ctx);
-		htc_destroy(gp_cds_context->htc_ctx);
-		gp_cds_context->htc_ctx = NULL;
-	}
-	cdf_status = wma_wmi_service_close(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close wma_wmi_service", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	hif_disable_isr(gp_cds_context->pHIFContext);
-#endif
-
-	cds_mq_deinit(&((p_cds_contextType) cds_context)->freeVosMq);
-
-	cdf_status = cdf_event_destroy(&gp_cds_context->ProbeEvent);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to destroy ProbeEvent %d", __func__,
-			  cdf_status);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	cdf_status = cdf_event_destroy(&gp_cds_context->wmaCompleteEvent);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to destroy wmaCompleteEvent %d", __func__,
-			  cdf_status);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * cds_ftm_pre_start() - Pre-start CDS Module in FTM Mode
- * @cds_context: The CDS context
- *
- * The cds_ftm_pre_start() function performs all pre-start activities
- * in FTM mode.
- *
- * Return: CDF_STATUS_SUCCESS if pre-start was successful, an
- *	   appropriate CDF_STATUS_E_* error code otherwise
- */
-static CDF_STATUS cds_ftm_pre_start(v_CONTEXT_t cds_context)
-{
-	CDF_STATUS vStatus = CDF_STATUS_SUCCESS;
-	p_cds_contextType p_cds_context = (p_cds_contextType) cds_context;
-#if  defined(QCA_WIFI_FTM)
-	p_cds_contextType gp_cds_context =
-		cds_get_global_context();
-#endif
-
-	CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_INFO, "cds prestart");
-	if (NULL == p_cds_context->pWMAContext) {
-		CDF_ASSERT(0);
-		CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_ERROR,
-			  "%s: WMA NULL context", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Reset WMA wait event */
-	cdf_event_reset(&p_cds_context->wmaCompleteEvent);
-
-	/*call WMA pre start */
-	vStatus = wma_pre_start(p_cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_ERROR,
-			  "Failed to WMA prestart ");
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Need to update time out of complete */
-	vStatus = cdf_wait_single_event(&p_cds_context->wmaCompleteEvent,
-					HDD_FTM_WMA_PRE_START_TIMEOUT);
-	if (vStatus != CDF_STATUS_SUCCESS) {
-		if (vStatus == CDF_STATUS_E_TIMEOUT) {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Timeout occurred before WMA complete",
-				  __func__);
-		} else {
-			CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-				  "%s: wma_pre_start reporting  other error",
-				  __func__);
-		}
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-#if  defined(QCA_WIFI_FTM)
-	vStatus = htc_start(gp_cds_context->htc_ctx);
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		CDF_TRACE(CDF_MODULE_ID_SYS, CDF_TRACE_LEVEL_FATAL,
-			  "Failed to Start HTC");
-		CDF_ASSERT(0);
-		return CDF_STATUS_E_FAILURE;
-	}
-	wma_wait_for_ready_event(gp_cds_context->pWMAContext);
-#endif /* QCA_WIFI_FTM */
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_hdd_ftm_open() - Open HDD in FTM Mode
- * @hdd_ctx: global HDD context
- *
- * The function hdd_wlan_startup calls this function to initialize the
- * FTM specific modules.
- *
- * Return: 0 on success, non-zero on error
- */
-int wlan_hdd_ftm_open(hdd_context_t *hdd_ctx)
-{
-	CDF_STATUS vStatus = CDF_STATUS_SUCCESS;
-	p_cds_contextType p_cds_context = NULL;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: Opening CDS", __func__);
-
-	p_cds_context = cds_get_global_context();
-
-	if (NULL == p_cds_context) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Trying to open CDS without a PreOpen", __func__);
-		CDF_ASSERT(0);
-		goto err_cdf_status_failure;
-	}
-
-	vStatus = wlan_ftm_cds_open(p_cds_context, 0);
-
-	if (!CDF_IS_STATUS_SUCCESS(vStatus)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: cds_open failed", __func__);
-		goto err_cdf_status_failure;
-	}
-
-	/*
-	 * only needed to start WMA, which happens in wlan_hdd_ftm_start()
-	 */
-
-	/* Save the hal context in Adapter */
-	hdd_ctx->hHal =
-		(tHalHandle) cds_get_context(CDF_MODULE_ID_SME);
-
-	if (NULL == hdd_ctx->hHal) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: HAL context is null",
-		       __func__);
-		goto err_ftm_close;
-	}
-
-	return 0;
-
-err_ftm_close:
-	wlan_ftm_cds_close(p_cds_context);
-
-err_cdf_status_failure:
-	return -EPERM;
-}
-
-/**
- * hdd_ftm_service_registration() - Register FTM service
- * @hdd_ctx: global HDD context
- *
- * Return: 0 on success, non-zero on failure
- */
-static int hdd_ftm_service_registration(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_t *adapter;
-	adapter = hdd_open_adapter(hdd_ctx, WLAN_HDD_FTM, "wlan%d",
-				    wlan_hdd_get_intf_addr(hdd_ctx), false);
-	if (NULL == adapter) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: hdd_open_adapter failed",
-		       __func__);
-		goto err_adapter_open_failure;
-	}
-
-	hdd_ctx->ftm.ftm_state = WLAN_FTM_INITIALIZED;
-
-	return 0;
-
-err_adapter_open_failure:
-
-	return -EPERM;
-}
-
-/**
- * wlan_ftm_stop() - Stop HDD in FTM mode
- * @hdd_ctx: pointer to HDD context
- *
- * This function stops the following modules
- * WMA
- *
- * Return: 0 on success, non-zero on failure
- */
-static int wlan_ftm_stop(hdd_context_t *hdd_ctx)
-{
-	if (hdd_ctx->ftm.ftm_state != WLAN_FTM_STARTED) {
-		hddLog(LOGP, FL("FTM has not started. No need to stop"));
-		return -EPERM;
-	}
-	wma_stop(hdd_ctx->pcds_context, HAL_STOP_TYPE_RF_KILL);
-	return 0;
-}
-
-/**
- * wlan_hdd_ftm_close() - Close HDD in FTM mode
- * @hdd_ctx: pointer to HDD context
- *
- * Return: 0 on success, non-zero on failure
- */
-int wlan_hdd_ftm_close(hdd_context_t *hdd_ctx)
-{
-	CDF_STATUS cdf_status;
-	v_CONTEXT_t cds_context = hdd_ctx->pcds_context;
-
-	hdd_adapter_t *adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_FTM);
-	ENTER();
-	if (adapter == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s:adapter is NULL", __func__);
-		return -ENXIO;
-	}
-
-	if (WLAN_FTM_STARTED == hdd_ctx->ftm.ftm_state) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s: Ftm has been started. stopping ftm", __func__);
-		wlan_ftm_stop(hdd_ctx);
-	}
-
-	hdd_close_all_adapters(hdd_ctx, false);
-
-	cdf_status = cds_sched_close(cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to close CDS Scheduler", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-	/* Close CDS */
-	wlan_ftm_cds_close(cds_context);
-
-#if defined(QCA_WIFI_FTM) && defined(LINUX_QCMBR)
-	spin_lock_bh(&qcmbr_queue_lock);
-	if (!list_empty(&qcmbr_queue_head)) {
-		qcmbr_queue_t *msg_buf, *tmp_buf;
-		list_for_each_entry_safe(msg_buf, tmp_buf, &qcmbr_queue_head,
-					 list) {
-			list_del(&msg_buf->list);
-			kfree(msg_buf);
-		}
-	}
-	spin_unlock_bh(&qcmbr_queue_lock);
-#endif
-
-	return 0;
-
-}
-
-
-/**
- * hdd_ftm_mc_process_msg() - Process FTM mailbox message
- * @message: FTM response message
- *
- * Process FTM mailbox message
- *
- * Return: void
- */
-static void hdd_ftm_mc_process_msg(void *message)
-{
-	void *data;
-	uint32_t data_len;
-
-	if (!message) {
-		hdd_err("Message is NULL, nothing to process.");
-		return;
-	}
-
-	data_len = *((uint32_t *) message);
-	data = (uint32_t *) message + 1;
-
-#if defined(LINUX_QCMBR)
-	wlanqcmbr_mc_process_msg(message);
-#else
-#ifdef CONFIG_NL80211_TESTMODE
-	wlan_hdd_testmode_rx_event(data, (size_t) data_len);
-#endif
-#endif
-	return;
-}
-
-/**
- * wlan_hdd_ftm_start() - Start HDD in FTM mode
- * @hdd_ctx: Global HDD context
- *
- * This function  starts the following modules.
- * 1) WMA Start.
- * 2) HTC Start.
- * 3) MAC Start to download the firmware.
- *
- * Return: 0 for success, non zero for failure
- */
-static int wlan_hdd_ftm_start(hdd_context_t *hdd_ctx)
-{
-	CDF_STATUS vStatus = CDF_STATUS_SUCCESS;
-	p_cds_contextType p_cds_context =
-		(p_cds_contextType) (hdd_ctx->pcds_context);
-
-	if (WLAN_FTM_STARTED == hdd_ctx->ftm.ftm_state) {
-		return 0;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Starting CLD SW", __func__);
-
-	/* We support only one instance for now ... */
-	if (p_cds_context == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: mismatch in context", __func__);
-		goto err_status_failure;
-	}
-
-	if (p_cds_context->pMACContext == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: MAC NULL context", __func__);
-		goto err_status_failure;
-	}
-
-	/* Vos preStart is calling */
-	if (!CDF_IS_STATUS_SUCCESS(cds_ftm_pre_start(hdd_ctx->pcds_context))) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: cds_pre_enable failed",
-		       __func__);
-		goto err_status_failure;
-	}
-
-	sme_register_ftm_msg_processor(hdd_ctx->hHal, hdd_ftm_mc_process_msg);
-
-	vStatus = wma_start(p_cds_context);
-	if (vStatus != CDF_STATUS_SUCCESS) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to start WMA", __func__);
-		goto err_status_failure;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: MAC correctly started", __func__);
-
-	if (hdd_ftm_service_registration(hdd_ctx)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed", __func__);
-		goto err_ftm_service_reg;
-	}
-
-	hdd_ctx->ftm.ftm_state = WLAN_FTM_STARTED;
-
-	return 0;
-
-err_ftm_service_reg:
-	wlan_hdd_ftm_close(hdd_ctx);
-
-err_status_failure:
-
-	return -EPERM;
-
-}
-
-#if  defined(QCA_WIFI_FTM)
-/**
- * hdd_ftm_start() - Start HDD in FTM mode
- * @hdd_ctx: Global HDD context
- *
- * Return: 0 for success, non zero for failure
- */
-int hdd_ftm_start(hdd_context_t *hdd_ctx)
-{
-	return wlan_hdd_ftm_start(hdd_ctx);
-}
-#endif
-
-#if  defined(QCA_WIFI_FTM)
-/**
- * hdd_ftm_stop() - Stop HDD in FTM mode
- * @hdd_ctx: Global HDD context
- *
- * Return: 0 for success, non zero for failure
- */
-int hdd_ftm_stop(hdd_context_t *hdd_ctx)
-{
-	return wlan_ftm_stop(hdd_ctx);
-}
-#endif
-
-#if  defined(QCA_WIFI_FTM)
-#if defined(LINUX_QCMBR)
-/**
- * wlan_hdd_qcmbr_command() - QCMBR command handler
- * @adapter: adapter upon which the command was received
- * @pqcmbr_data: QCMBR command
- *
- * Return: 0 on success, non-zero on error
- */
-static int wlan_hdd_qcmbr_command(hdd_adapter_t *adapter,
-				  qcmbr_data_t *pqcmbr_data)
-{
-	int ret = 0;
-	qcmbr_queue_t *qcmbr_buf = NULL;
-
-	switch (pqcmbr_data->cmd) {
-	case ATH_XIOCTL_UNIFIED_UTF_CMD: {
-		pqcmbr_data->copy_to_user = 0;
-		if (pqcmbr_data->length) {
-			if (wlan_hdd_ftm_testmode_cmd(pqcmbr_data->buf,
-						      pqcmbr_data->
-						      length)
-			    != CDF_STATUS_SUCCESS) {
-				ret = -EBUSY;
-			} else {
-				ret = 0;
-			}
-		}
-	}
-	break;
-
-	case ATH_XIOCTL_UNIFIED_UTF_RSP: {
-		pqcmbr_data->copy_to_user = 1;
-		if (!list_empty(&qcmbr_queue_head)) {
-			spin_lock_bh(&qcmbr_queue_lock);
-			qcmbr_buf = list_first_entry(&qcmbr_queue_head,
-						     qcmbr_queue_t,
-						     list);
-			list_del(&qcmbr_buf->list);
-			spin_unlock_bh(&qcmbr_queue_lock);
-			ret = 0;
-		} else {
-			ret = -1;
-		}
-
-		if (!ret) {
-			memcpy(pqcmbr_data->buf, qcmbr_buf->utf_buf,
-			       (MAX_UTF_LENGTH + 4));
-			kfree(qcmbr_buf);
-		} else {
-			ret = -EAGAIN;
-		}
-	}
-	break;
-	}
-
-	return ret;
-}
-
-#ifdef CONFIG_COMPAT
-/**
- * wlan_hdd_qcmbr_ioctl() - Compatability-mode QCMBR ioctl handler
- * @adapter: adapter upon which the ioctl was received
- * @ifr: the ioctl request
- *
- * Return: 0 on success, non-zero on error
- */
-static int wlan_hdd_qcmbr_compat_ioctl(hdd_adapter_t *adapter,
-				       struct ifreq *ifr)
-{
-	qcmbr_data_t *qcmbr_data;
-	int ret = 0;
-
-	qcmbr_data = kzalloc(sizeof(qcmbr_data_t), GFP_KERNEL);
-	if (qcmbr_data == NULL)
-		return -ENOMEM;
-
-	if (copy_from_user(qcmbr_data, ifr->ifr_data, sizeof(*qcmbr_data))) {
-		ret = -EFAULT;
-		goto exit;
-	}
-
-	ret = wlan_hdd_qcmbr_command(adapter, qcmbr_data);
-	if (qcmbr_data->copy_to_user) {
-		ret = copy_to_user(ifr->ifr_data, qcmbr_data->buf,
-				   (MAX_UTF_LENGTH + 4));
-	}
-
-exit:
-	kfree(qcmbr_data);
-	return ret;
-}
-#else                           /* CONFIG_COMPAT */
-static int wlan_hdd_qcmbr_compat_ioctl(hdd_adapter_t *adapter,
-				       struct ifreq *ifr)
-{
-	return 0;
-}
-#endif /* CONFIG_COMPAT */
-
-/**
- * wlan_hdd_qcmbr_ioctl() - Standard QCMBR ioctl handler
- * @adapter: adapter upon which the ioctl was received
- * @ifr: the ioctl request
- *
- * Return: 0 on success, non-zero on error
- */
-static int wlan_hdd_qcmbr_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr)
-{
-	qcmbr_data_t *qcmbr_data;
-	int ret = 0;
-
-	qcmbr_data = kzalloc(sizeof(qcmbr_data_t), GFP_KERNEL);
-	if (qcmbr_data == NULL)
-		return -ENOMEM;
-
-	if (copy_from_user(qcmbr_data, ifr->ifr_data, sizeof(*qcmbr_data))) {
-		ret = -EFAULT;
-		goto exit;
-	}
-
-	ret = wlan_hdd_qcmbr_command(adapter, qcmbr_data);
-	if (qcmbr_data->copy_to_user) {
-		ret = copy_to_user(ifr->ifr_data, qcmbr_data->buf,
-				   (MAX_UTF_LENGTH + 4));
-	}
-
-exit:
-	kfree(qcmbr_data);
-	return ret;
-}
-
-/**
- * wlan_hdd_qcmbr_unified_ioctl() - Unified QCMBR ioctl handler
- * @adapter: adapter upon which the ioctl was received
- * @ifr: the ioctl request
- *
- * Return: 0 on success, non-zero on error
- */
-int wlan_hdd_qcmbr_unified_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr)
-{
-	int ret = 0;
-
-	if (is_compat_task()) {
-		ret = wlan_hdd_qcmbr_compat_ioctl(adapter, ifr);
-	} else {
-		ret = wlan_hdd_qcmbr_ioctl(adapter, ifr);
-	}
-
-	return ret;
-}
-
-/**
- * wlanqcmbr_mc_process_msg() - Process QCMBR response message
- * @message: QCMBR message
- *
- * Return: None
- */
-static void wlanqcmbr_mc_process_msg(void *message)
-{
-	qcmbr_queue_t *qcmbr_buf = NULL;
-	uint32_t data_len;
-
-	data_len = *((uint32_t *) message) + sizeof(uint32_t);
-	qcmbr_buf = kzalloc(sizeof(qcmbr_queue_t), GFP_KERNEL);
-	if (qcmbr_buf != NULL) {
-		memcpy(qcmbr_buf->utf_buf, message, data_len);
-		spin_lock_bh(&qcmbr_queue_lock);
-		list_add_tail(&(qcmbr_buf->list), &qcmbr_queue_head);
-		spin_unlock_bh(&qcmbr_queue_lock);
-	}
-}
-#endif /*LINUX_QCMBR */
-
-/**
- * wlan_hdd_ftm_testmode_cmd() - Process FTM testmode command
- * @data: FTM testmode command
- * @len: length of @data
- *
- * Return: CDF_STATUS_SUCCESS on success, CDF_STATUS_E_* on error
- */
-CDF_STATUS wlan_hdd_ftm_testmode_cmd(void *data, int len)
-{
-	struct ar6k_testmode_cmd_data *cmd_data;
-
-	cmd_data = (struct ar6k_testmode_cmd_data *)
-		   cdf_mem_malloc(sizeof(*cmd_data));
-
-	if (!cmd_data) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  ("Failed to allocate FTM command data"));
-		return CDF_STATUS_E_NOMEM;
-	}
-
-	cmd_data->data = cdf_mem_malloc(len);
-
-	if (!cmd_data->data) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  ("Failed to allocate FTM command data buffer"));
-		cdf_mem_free(cmd_data);
-		return CDF_STATUS_E_NOMEM;
-	}
-
-	cmd_data->len = len;
-	cdf_mem_copy(cmd_data->data, data, len);
-
-	if (wlan_ftm_postmsg((uint8_t *) cmd_data, sizeof(*cmd_data))) {
-		cdf_mem_free(cmd_data->data);
-		cdf_mem_free(cmd_data);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-#endif /*QCA_WIFI_FTM */

+ 0 - 492
core/hdd/src/wlan_hdd_green_ap.c

@@ -1,492 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- *  DOC: wlan_hdd_green_ap.c
- *
- *  WLAN Host Device Driver Green AP implementation
- *
- */
-
-/* denote that this file does not allow legacy hddLog */
-#define HDD_DISALLOW_LEGACY_HDDLOG 1
-
-/* Include Files */
-#include <wlan_hdd_main.h>
-#include <wlan_hdd_misc.h>
-#include "wlan_hdd_green_ap.h"
-#include "wma_api.h"
-#include "cds_concurrency.h"
-
-#define GREEN_AP_PS_ON_TIME        (0)
-#define GREEN_AP_PS_DELAY_TIME     (20)
-
-/**
- * enum hdd_green_ap_ps_state - Green-AP power save states
- * @GREEN_AP_PS_IDLE_STATE: the Green_AP is not enabled
- * @GREEN_AP_PS_OFF_STATE: in Power Saving OFF state
- * @GREEN_AP_PS_WAIT_STATE: in transition to Power Saving ON state
- * @GREEN_AP_PS_ON_STATE: in Power Saving ON state
- */
-enum hdd_green_ap_ps_state {
-	GREEN_AP_PS_IDLE_STATE = 1,
-	GREEN_AP_PS_OFF_STATE,
-	GREEN_AP_PS_WAIT_STATE,
-	GREEN_AP_PS_ON_STATE,
-};
-
-/**
- * enum hdd_green_ap_event - Green-AP power save events
- * @GREEN_AP_PS_START_EVENT: event to indicate to enable Green_AP
- * @GREEN_AP_PS_START_EVENT: event to indicate to disable Green_AP
- * @GREEN_AP_ADD_STA_EVENT: event to indicate a new STA connected
- * @GREEN_AP_DEL_STA_EVENT: event to indicate a STA disconnected
- * @GREEN_AP_PS_ON_EVENT: event to indicate to enter Power Saving state
- * @GREEN_AP_PS_WAIT_EVENT: event to indicate in the transition to Power Saving
- */
-enum hdd_green_ap_event {
-	GREEN_AP_PS_START_EVENT = 1,
-	GREEN_AP_PS_STOP_EVENT,
-	GREEN_AP_ADD_STA_EVENT,
-	GREEN_AP_DEL_STA_EVENT,
-	GREEN_AP_PS_ON_EVENT,
-	GREEN_AP_PS_WAIT_EVENT,
-};
-
-/**
- * struct hdd_green_ap_ctx - Green-AP context
- * @ps_enable: Whether or not Green AP is enabled
- * @ps_on_time: Amount of time to stay in Green AP power saving state
- * @ps_delay_time: Amount of time to delay when changing states
- * @num_nodes: Number of connected clients
- * @ps_state: Current state
- * @ps_event: Event to trigger when timer expires
- * @ps_timer: Event timer
- * @egap_support: Enhanced Green AP support flag
- */
-struct hdd_green_ap_ctx {
-	uint8_t ps_enable;
-	uint32_t ps_on_time;
-	uint32_t ps_delay_time;
-	uint32_t num_nodes;
-
-	enum hdd_green_ap_ps_state ps_state;
-	enum hdd_green_ap_event ps_event;
-
-	cdf_mc_timer_t ps_timer;
-
-	bool egap_support;
-};
-
-/**
- * hdd_wlan_green_ap_update() - update the current State and Event
- * @hdd_ctx: Global HDD context
- * @state: New state
- * @event: New event
- *
- * Return: none
- */
-static void hdd_wlan_green_ap_update(struct hdd_context_s *hdd_ctx,
-				     enum hdd_green_ap_ps_state state,
-				     enum hdd_green_ap_event event)
-{
-	struct hdd_green_ap_ctx *green_ap = hdd_ctx->green_ap_ctx;
-
-	green_ap->ps_state = state;
-	green_ap->ps_event = event;
-}
-
-/**
- * hdd_wlan_green_ap_enable() - Send Green AP configuration to firmware
- * @adapter: Adapter upon which Green AP is being configured
- * @enable: Flag which indicates if Green AP is being enabled or disabled
- *
- * Return: 0 upon success, non-zero upon failure
- */
-static int hdd_wlan_green_ap_enable(hdd_adapter_t *adapter,
-				    uint8_t enable)
-{
-	int ret;
-
-	hdd_notice("Set Green-AP val: %d", enable);
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID,
-				  enable, DBG_CMD);
-
-	return ret;
-}
-
-/**
- * hdd_wlan_green_ap_mc() - Green AP state machine
- * @hdd_ctx: HDD global context
- * @event: New event being processed
- *
- * Return: none
- */
-static void hdd_wlan_green_ap_mc(struct hdd_context_s *hdd_ctx,
-				 enum hdd_green_ap_event event)
-{
-	struct hdd_green_ap_ctx *green_ap;
-	hdd_adapter_t *adapter;
-
-	green_ap = hdd_ctx->green_ap_ctx;
-	if (green_ap == NULL)
-		return;
-
-	hdd_notice("Green-AP event: %d, state: %d, num_nodes: %d",
-		   event, green_ap->ps_state, green_ap->num_nodes);
-
-	/* handle the green ap ps event */
-	switch (event) {
-	case GREEN_AP_PS_START_EVENT:
-		green_ap->ps_enable = 1;
-		break;
-
-	case GREEN_AP_PS_STOP_EVENT:
-		if (!(cds_get_concurrency_mode() & CDF_SAP_MASK))
-			green_ap->ps_enable = 0;
-		break;
-
-	case GREEN_AP_ADD_STA_EVENT:
-		green_ap->num_nodes++;
-		break;
-
-	case GREEN_AP_DEL_STA_EVENT:
-		if (green_ap->num_nodes)
-			green_ap->num_nodes--;
-		break;
-
-	case GREEN_AP_PS_ON_EVENT:
-	case GREEN_AP_PS_WAIT_EVENT:
-		break;
-
-	default:
-		hdd_err("invalid event %d", event);
-		break;
-	}
-
-	/* Confirm that power save is enabled before doing state transitions */
-	if (!green_ap->ps_enable) {
-		hdd_notice("Green-AP is disabled");
-		hdd_wlan_green_ap_update(hdd_ctx,
-					 GREEN_AP_PS_IDLE_STATE,
-					 GREEN_AP_PS_WAIT_EVENT);
-		goto done;
-	}
-
-	adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP);
-	if (adapter == NULL) {
-		hdd_err("Green-AP no SAP adapter");
-		goto done;
-	}
-
-	/* handle the green ap ps state */
-	switch (green_ap->ps_state) {
-	case GREEN_AP_PS_IDLE_STATE:
-		hdd_wlan_green_ap_update(hdd_ctx,
-					 GREEN_AP_PS_OFF_STATE,
-					 GREEN_AP_PS_WAIT_EVENT);
-		break;
-
-	case GREEN_AP_PS_OFF_STATE:
-		if (!green_ap->num_nodes) {
-			hdd_wlan_green_ap_update(hdd_ctx,
-						 GREEN_AP_PS_WAIT_STATE,
-						 GREEN_AP_PS_WAIT_EVENT);
-			cdf_mc_timer_start(&green_ap->ps_timer,
-					   green_ap->ps_delay_time);
-		}
-		break;
-
-	case GREEN_AP_PS_WAIT_STATE:
-		if (!green_ap->num_nodes) {
-			hdd_wlan_green_ap_update(hdd_ctx,
-						 GREEN_AP_PS_ON_STATE,
-						 GREEN_AP_PS_WAIT_EVENT);
-
-			hdd_wlan_green_ap_enable(adapter, 1);
-
-			if (green_ap->ps_on_time) {
-				hdd_wlan_green_ap_update(hdd_ctx,
-							 0,
-							 GREEN_AP_PS_WAIT_EVENT);
-				cdf_mc_timer_start(&green_ap->ps_timer,
-						   green_ap->ps_on_time);
-			}
-		} else {
-			hdd_wlan_green_ap_update(hdd_ctx,
-						 GREEN_AP_PS_OFF_STATE,
-						 GREEN_AP_PS_WAIT_EVENT);
-		}
-		break;
-
-	case GREEN_AP_PS_ON_STATE:
-		if (green_ap->num_nodes) {
-			if (hdd_wlan_green_ap_enable(adapter, 0)) {
-				hdd_err("FAILED TO SET GREEN-AP mode");
-				goto done;
-			}
-			hdd_wlan_green_ap_update(hdd_ctx,
-						 GREEN_AP_PS_OFF_STATE,
-						 GREEN_AP_PS_WAIT_EVENT);
-		} else if ((green_ap->ps_event == GREEN_AP_PS_WAIT_EVENT)
-			   && (green_ap->ps_on_time)) {
-
-			/* ps_on_time timeout, switch to ps off */
-			hdd_wlan_green_ap_update(hdd_ctx,
-						 GREEN_AP_PS_WAIT_STATE,
-						 GREEN_AP_PS_ON_EVENT);
-
-			if (hdd_wlan_green_ap_enable(adapter, 0)) {
-				hdd_err("FAILED TO SET GREEN-AP mode");
-				goto done;
-			}
-
-			cdf_mc_timer_start(&green_ap->ps_timer,
-					   green_ap->ps_delay_time);
-		}
-		break;
-
-	default:
-		hdd_err("invalid state %d", green_ap->ps_state);
-		hdd_wlan_green_ap_update(hdd_ctx, GREEN_AP_PS_OFF_STATE,
-					 GREEN_AP_PS_WAIT_EVENT);
-		break;
-	}
-
-done:
-	return;
-}
-
-/**
- * hdd_wlan_green_ap_timer_fn() - Green AP Timer handler
- * @ctx: Global HDD context
- *
- * Return: none
- */
-static void hdd_wlan_green_ap_timer_fn(void *ctx)
-{
-	struct hdd_context_s *hdd_ctx = ctx;
-	struct hdd_green_ap_ctx *green_ap;
-
-	if (0 != wlan_hdd_validate_context(hdd_ctx)) {
-		hdd_err("HDD context is not valid");
-		return;
-	}
-
-	green_ap = hdd_ctx->green_ap_ctx;
-	if (green_ap)
-		hdd_wlan_green_ap_mc(hdd_ctx, green_ap->ps_event);
-}
-
-/**
- * hdd_wlan_green_ap_attach() - Attach Green AP context to HDD context
- * @hdd_ctx: Global HDD contect
- *
- * Return: CDF_STATUS_SUCCESS on success, otherwise CDF_STATUS_E_* error
- */
-static CDF_STATUS hdd_wlan_green_ap_attach(struct hdd_context_s *hdd_ctx)
-{
-	struct hdd_green_ap_ctx *green_ap;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	ENTER();
-
-	green_ap = cdf_mem_malloc(sizeof(*green_ap));
-	if (!green_ap) {
-		hdd_alert("Memory allocation for Green-AP failed!");
-		status = CDF_STATUS_E_NOMEM;
-		goto error;
-	}
-
-	cdf_mem_zero(green_ap, sizeof(*green_ap));
-	green_ap->ps_state = GREEN_AP_PS_OFF_STATE;
-	green_ap->ps_event = 0;
-	green_ap->num_nodes = 0;
-	green_ap->ps_on_time = GREEN_AP_PS_ON_TIME;
-	green_ap->ps_delay_time = GREEN_AP_PS_DELAY_TIME;
-
-	cdf_mc_timer_init(&green_ap->ps_timer,
-			  CDF_TIMER_TYPE_SW,
-			  hdd_wlan_green_ap_timer_fn, hdd_ctx);
-
-error:
-	hdd_ctx->green_ap_ctx = green_ap;
-
-	EXIT();
-	return status;
-}
-
-/**
- * hdd_wlan_green_ap_deattach() - Detach Green AP context from HDD context
- * @hdd_ctx: Global HDD contect
- *
- * Return: CDF_STATUS_SUCCESS on success, otherwise CDF_STATUS_E_* error
- */
-static CDF_STATUS hdd_wlan_green_ap_deattach(struct hdd_context_s *hdd_ctx)
-{
-	struct hdd_green_ap_ctx *green_ap = hdd_ctx->green_ap_ctx;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	ENTER();
-
-	if (green_ap == NULL) {
-		hdd_notice("Green-AP is not enabled");
-		status = CDF_STATUS_E_NOSUPPORT;
-		goto done;
-	}
-
-	/* check if the timer status is destroyed */
-	if (CDF_TIMER_STATE_RUNNING ==
-	    cdf_mc_timer_get_current_state(&green_ap->ps_timer))
-		cdf_mc_timer_stop(&green_ap->ps_timer);
-
-	/* Destroy the Green AP timer */
-	if (!CDF_IS_STATUS_SUCCESS(cdf_mc_timer_destroy(&green_ap->ps_timer)))
-		hdd_notice("Cannot deallocate Green-AP's timer");
-
-	/* release memory */
-	cdf_mem_zero(green_ap, sizeof(*green_ap));
-	cdf_mem_free(green_ap);
-	hdd_ctx->green_ap_ctx = NULL;
-
-done:
-
-	EXIT();
-	return status;
-}
-
-/**
- * hdd_wlan_green_ap_init() - Initialize Green AP feature
- * @hdd_ctx: HDD global context
- *
- * Return: none
- */
-void hdd_wlan_green_ap_init(struct hdd_context_s *hdd_ctx)
-{
-	if (!CDF_IS_STATUS_SUCCESS(hdd_wlan_green_ap_attach(hdd_ctx)))
-		hdd_err("Failed to allocate Green-AP resource");
-}
-
-/**
- * hdd_wlan_green_ap_deinit() - De-initialize Green AP feature
- * @hdd_ctx: HDD global context
- *
- * Return: none
- */
-void hdd_wlan_green_ap_deinit(struct hdd_context_s *hdd_ctx)
-{
-	if (!CDF_IS_STATUS_SUCCESS(hdd_wlan_green_ap_deattach(hdd_ctx)))
-		hdd_err("Cannot deallocate Green-AP resource");
-}
-
-/**
- * hdd_wlan_green_ap_start_bss() - Notify Green AP of Start BSS event
- * @hdd_ctx: HDD global context
- *
- * Return: none
- */
-void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx)
-{
-	struct hdd_config *cfg = hdd_ctx->config;
-
-	/* check if the firmware and ini are both enabled the egap,
-	 * and also the feature_flag enable, then we enable the egap
-	 */
-	if (hdd_ctx->green_ap_ctx->egap_support && cfg->enable_egap &&
-	    cfg->egap_feature_flag) {
-		hdd_notice("Set EGAP - enabled: %d, flag: %x, inact_time: %d, wait_time: %d",
-			   cfg->enable_egap, cfg->egap_feature_flag,
-			   cfg->egap_inact_time, cfg->egap_wait_time);
-		if (!sme_send_egap_conf_params(cfg->enable_egap,
-					       cfg->egap_inact_time,
-					       cfg->egap_wait_time,
-					       cfg->egap_feature_flag)) {
-			/* EGAP is enabled, disable host GAP */
-			hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT);
-			goto exit;
-		}
-		/* fall through, if send_egap_conf_params() failed,
-		 * then check host GAP and enable it accordingly
-		 */
-	}
-
-	if (!(CDF_STA_MASK & hdd_ctx->concurrency_mode) &&
-	    cfg->enable2x2 && cfg->enableGreenAP) {
-		hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_START_EVENT);
-	} else {
-		hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT);
-		hdd_notice("Green-AP: is disabled, due to sta_concurrency: %d, enable2x2: %d, enableGreenAP: %d",
-			   CDF_STA_MASK & hdd_ctx->concurrency_mode,
-			   cfg->enable2x2, cfg->enableGreenAP);
-	}
-exit:
-	return;
-}
-
-/**
- * hdd_wlan_green_ap_stop_bss() - Notify Green AP of Stop BSS event
- * @hdd_ctx: HDD global context
- *
- * Return: none
- */
-void hdd_wlan_green_ap_stop_bss(struct hdd_context_s *hdd_ctx)
-{
-	hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_PS_STOP_EVENT);
-}
-
-/**
- * hdd_wlan_green_ap_add_sta() - Notify Green AP of Add Station  event
- * @hdd_ctx: HDD global context
- *
- * Return: none
- */
-void hdd_wlan_green_ap_add_sta(struct hdd_context_s *hdd_ctx)
-{
-	hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_ADD_STA_EVENT);
-}
-
-/**
- * hdd_wlan_green_ap_del_sta() - Notify Green AP of Delete Station event
- * @hdd_ctx: HDD global context
- *
- * Return: none
- */
-void hdd_wlan_green_ap_del_sta(struct hdd_context_s *hdd_ctx)
-{
-	hdd_wlan_green_ap_mc(hdd_ctx, GREEN_AP_DEL_STA_EVENT);
-}
-
-/**
- * hdd_wlan_set_egap_support() - helper function to set egap support flag
- * @hdd_ctx:   pointer to hdd context
- * @param:     pointer to target configuration
- *
- * Return:     None
- */
-void hdd_wlan_set_egap_support(hdd_context_t *hdd_ctx, void *param)
-{
-	struct wma_tgt_cfg *cfg = (struct wma_tgt_cfg *) param;
-
-	if (hdd_ctx && cfg)
-		hdd_ctx->green_ap_ctx->egap_support = cfg->egap_support;
-}

+ 0 - 58
core/hdd/src/wlan_hdd_green_ap.h

@@ -1,58 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_GREEN_AP_H
-#define __WLAN_HDD_GREEN_AP_H
-
-/**
- * DOC: wlan_hdd_green_ap.h
- *
- * WLAN Host Device Driver Green AP API specification
- */
-
-struct hdd_context_s;
-
-#ifdef FEATURE_GREEN_AP
-void hdd_wlan_green_ap_init(struct hdd_context_s *hdd_ctx);
-void hdd_wlan_green_ap_deinit(struct hdd_context_s *hdd_ctx);
-void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx);
-void hdd_wlan_green_ap_stop_bss(struct hdd_context_s *hdd_ctx);
-void hdd_wlan_green_ap_add_sta(struct hdd_context_s *hdd_ctx);
-void hdd_wlan_green_ap_del_sta(struct hdd_context_s *hdd_ctx);
-void hdd_wlan_set_egap_support(struct hdd_context_s *hdd_ctx, void *param);
-#else
-static inline void hdd_wlan_green_ap_init(struct hdd_context_s *hdd_ctx) {}
-static inline void hdd_wlan_green_ap_deinit(struct hdd_context_s *hdd_ctx) {}
-static inline void hdd_wlan_green_ap_start_bss(struct hdd_context_s *hdd_ctx) {}
-static inline void hdd_wlan_green_ap_stop_bss(struct hdd_context_s *hdd_ctx) {}
-static inline void hdd_wlan_green_ap_add_sta(struct hdd_context_s *hdd_ctx) {}
-static inline void hdd_wlan_green_ap_del_sta(struct hdd_context_s *hdd_ctx) {}
-static inline void hdd_wlan_set_egap_support(struct hdd_context_s *hdd_ctx,
-					     void *param) {}
-
-#endif /* FEATURE_GREEN_AP */
-#endif /* __WLAN_HDD_GREEN_AP_H */

+ 0 - 8320
core/hdd/src/wlan_hdd_hostapd.c

@@ -1,8320 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC:  wlan_hdd_hostapd.c
- *
- * WLAN Host Device Driver implementation
- */
-
-/* Include Files */
-
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/wireless.h>
-#include <linux/semaphore.h>
-#include <linux/compat.h>
-#include <cds_api.h>
-#include <cds_sched.h>
-#include <linux/etherdevice.h>
-#include <wlan_hdd_includes.h>
-#include <qc_sap_ioctl.h>
-#include <wlan_hdd_hostapd.h>
-#include <sap_api.h>
-#include <sap_internal.h>
-#include <wlan_hdd_softap_tx_rx.h>
-#include <wlan_hdd_main.h>
-#include <wlan_hdd_ioctl.h>
-#include <wlan_hdd_stats.h>
-#include <linux/netdevice.h>
-#include <linux/rtnetlink.h>
-#include <linux/mmc/sdio_func.h>
-#include "wlan_hdd_p2p.h"
-#include <wlan_hdd_ipa.h>
-#include "cfg_api.h"
-#include "wni_cfg.h"
-#include "wlan_hdd_misc.h"
-#include <cds_utils.h>
-#if defined CONFIG_CNSS
-#include <net/cnss.h>
-#endif
-
-#include "wma.h"
-#ifdef DEBUG
-#include "wma_api.h"
-#endif
-#include "wlan_hdd_trace.h"
-#include "cdf_types.h"
-#include "cdf_trace.h"
-#include "wlan_hdd_cfg.h"
-#include "cds_concurrency.h"
-#include "wlan_hdd_green_ap.h"
-
-#define    IS_UP(_dev) \
-	(((_dev)->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP))
-#define    IS_UP_AUTO(_ic) \
-	(IS_UP((_ic)->ic_dev) && (_ic)->ic_roaming == IEEE80211_ROAMING_AUTO)
-#define WE_WLAN_VERSION     1
-#define WE_GET_STA_INFO_SIZE 30
-/* WEXT limitation: MAX allowed buf len for any *
- * IW_PRIV_TYPE_CHAR is 2Kbytes *
- */
-#define WE_SAP_MAX_STA_INFO 0x7FF
-
-#define RC_2_RATE_IDX(_rc)        ((_rc) & 0x7)
-#define HT_RC_2_STREAMS(_rc)    ((((_rc) & 0x78) >> 3) + 1)
-#define RC_2_RATE_IDX_11AC(_rc)        ((_rc) & 0xf)
-#define HT_RC_2_STREAMS_11AC(_rc)    ((((_rc) & 0x30) >> 4) + 1)
-
-#define SAP_24GHZ_CH_COUNT (14)
-#define ACS_SCAN_EXPIRY_TIMEOUT_S 4
-
-#define DUMP_DP_TRACE       0
-
-/* Function definitions */
-
-/**
- * hdd_hostapd_channel_wakelock_init() - init the channel wakelock
- * @pHddCtx: pointer to hdd context
- *
- * Return: None
- */
-void hdd_hostapd_channel_wakelock_init(hdd_context_t *pHddCtx)
-{
-	/* Initialize the wakelock */
-	cdf_wake_lock_init(&pHddCtx->sap_dfs_wakelock, "sap_dfs_wakelock");
-	atomic_set(&pHddCtx->sap_dfs_ref_cnt, 0);
-}
-
-/**
- * hdd_hostapd_channel_allow_suspend() - allow suspend in a channel.
- * Called when, 1. bss stopped, 2. channel switch
- *
- * @pAdapter: pointer to hdd adapter
- * @channel: current channel
- *
- * Return: None
- */
-void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter,
-				       uint8_t channel)
-{
-
-	hdd_context_t *pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx);
-	hdd_hostapd_state_t *pHostapdState =
-		WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-
-	hddLog(LOG1, FL("bssState: %d, channel: %d, dfs_ref_cnt: %d"),
-	       pHostapdState->bssState, channel,
-	       atomic_read(&pHddCtx->sap_dfs_ref_cnt));
-
-	/* Return if BSS is already stopped */
-	if (pHostapdState->bssState == BSS_STOP)
-		return;
-
-	/* Release wakelock when no more DFS channels are used */
-	if (CHANNEL_STATE_DFS == cds_get_channel_state(channel)) {
-		if (atomic_dec_and_test(&pHddCtx->sap_dfs_ref_cnt)) {
-			hddLog(LOGE, FL("DFS: allowing suspend (chan %d)"),
-			       channel);
-			cdf_wake_lock_release(&pHddCtx->sap_dfs_wakelock,
-					      WIFI_POWER_EVENT_WAKELOCK_DFS);
-		}
-	}
-}
-
-/**
- * hdd_hostapd_channel_prevent_suspend() - prevent suspend in a channel.
- * Called when, 1. bss started, 2. channel switch
- *
- * @pAdapter: pointer to hdd adapter
- * @channel: current channel
- *
- * Return - None
- */
-void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter,
-					 uint8_t channel)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx);
-	hdd_hostapd_state_t *pHostapdState =
-		WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-
-	hddLog(LOG1, FL("bssState: %d, channel: %d, dfs_ref_cnt: %d"),
-	       pHostapdState->bssState, channel,
-	       atomic_read(&pHddCtx->sap_dfs_ref_cnt));
-
-	/* Return if BSS is already started && wakelock is acquired */
-	if ((pHostapdState->bssState == BSS_START) &&
-		(atomic_read(&pHddCtx->sap_dfs_ref_cnt) >= 1))
-		return;
-
-	/* Acquire wakelock if we have at least one DFS channel in use */
-	if (CHANNEL_STATE_DFS == cds_get_channel_state(channel)) {
-		if (atomic_inc_return(&pHddCtx->sap_dfs_ref_cnt) == 1) {
-			hddLog(LOGE, FL("DFS: preventing suspend (chan %d)"),
-			       channel);
-			cdf_wake_lock_acquire(&pHddCtx->sap_dfs_wakelock,
-					      WIFI_POWER_EVENT_WAKELOCK_DFS);
-		}
-	}
-}
-
-/**
- * hdd_hostapd_channel_wakelock_deinit() - destroy the channel wakelock
- *
- * @pHddCtx: pointer to hdd context
- *
- * Return: None
- */
-void hdd_hostapd_channel_wakelock_deinit(hdd_context_t *pHddCtx)
-{
-	if (atomic_read(&pHddCtx->sap_dfs_ref_cnt)) {
-		/* Release wakelock */
-		cdf_wake_lock_release(&pHddCtx->sap_dfs_wakelock,
-				      WIFI_POWER_EVENT_WAKELOCK_DRIVER_EXIT);
-		/* Reset the reference count */
-		atomic_set(&pHddCtx->sap_dfs_ref_cnt, 0);
-		hddLog(LOGE, FL("DFS: allowing suspend"));
-	}
-
-	/* Destroy lock */
-	cdf_wake_lock_destroy(&pHddCtx->sap_dfs_wakelock);
-}
-
-/**
- * __hdd_hostapd_open() - hdd open function for hostapd interface
- * This is called in response to ifconfig up
- * @dev: pointer to net_device structure
- *
- * Return - 0 for success non-zero for failure
- */
-static int __hdd_hostapd_open(struct net_device *dev)
-{
-	hdd_adapter_t *pAdapter = netdev_priv(dev);
-
-	ENTER();
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_HOSTAPD_OPEN_REQUEST, NO_SESSION, 0));
-
-	if (cds_is_load_or_unload_in_progress()) {
-		hdd_err("Driver load/unload in progress, ignore, state: 0x%x",
-			cds_get_driver_state());
-		goto done;
-	}
-
-	/* Enable all Tx queues */
-	hddLog(LOG1, FL("Enabling queues"));
-	wlan_hdd_netif_queue_control(pAdapter,
-				   WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
-				   WLAN_CONTROL_PATH);
-done:
-	EXIT();
-	return 0;
-}
-
-/**
- * hdd_hostapd_open() - SSR wrapper for __hdd_hostapd_open
- * @dev: pointer to net device
- *
- * Return: 0 on success, error number otherwise
- */
-static int hdd_hostapd_open(struct net_device *dev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_hostapd_open(dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __hdd_hostapd_stop() - hdd stop function for hostapd interface
- * This is called in response to ifconfig down
- *
- * @dev: pointer to net_device structure
- *
- * Return - 0 for success non-zero for failure
- */
-static int __hdd_hostapd_stop(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	ENTER();
-
-	/* Stop all tx queues */
-	hddLog(LOG1, FL("Disabling queues"));
-	wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_TX_DISABLE_N_CARRIER,
-				   WLAN_CONTROL_PATH);
-
-	EXIT();
-	return 0;
-}
-
-/**
- * hdd_hostapd_stop() - SSR wrapper for__hdd_hostapd_stop
- * @dev: pointer to net_device
- *
- * This is called in response to ifconfig down
- *
- * Return: 0 on success, error number otherwise
- */
-int hdd_hostapd_stop(struct net_device *dev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_hostapd_stop(dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __hdd_hostapd_uninit() - hdd uninit function
- * This is called during the netdev unregister to uninitialize all data
- * associated with the device.
- *
- * @dev: pointer to net_device structure
- *
- * Return: None
- */
-static void __hdd_hostapd_uninit(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = netdev_priv(dev);
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
-		hddLog(LOGE, FL("Invalid magic"));
-		return;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (NULL == hdd_ctx) {
-		hddLog(LOGE, FL("NULL hdd_ctx"));
-		return;
-	}
-
-	hdd_deinit_adapter(hdd_ctx, adapter, true);
-
-	/* after uninit our adapter structure will no longer be valid */
-	adapter->dev = NULL;
-	adapter->magic = 0;
-
-	EXIT();
-}
-
-/**
- * hdd_hostapd_uninit() - SSR wrapper for __hdd_hostapd_uninit
- * @dev: pointer to net_device
- *
- * Return: 0 on success, error number otherwise
- */
-static void hdd_hostapd_uninit(struct net_device *dev)
-{
-	cds_ssr_protect(__func__);
-	__hdd_hostapd_uninit(dev);
-	cds_ssr_unprotect(__func__);
-}
-
-/**
- * __hdd_hostapd_change_mtu() - change mtu
- * @dev: pointer to net_device
- * @new_mtu: new mtu
- *
- * Return: 0 on success, error number otherwise
- */
-static int __hdd_hostapd_change_mtu(struct net_device *dev, int new_mtu)
-{
-	return 0;
-}
-
-/**
- * hdd_hostapd_change_mtu() - SSR wrapper for __hdd_hostapd_change_mtu
- * @dev: pointer to net_device
- * @new_mtu: new mtu
- *
- * Return: 0 on success, error number otherwise
- */
-static int hdd_hostapd_change_mtu(struct net_device *dev, int new_mtu)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_hostapd_change_mtu(dev, new_mtu);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#ifdef QCA_HT_2040_COEX
-CDF_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter,
-				   uint8_t channel_type)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-	void *hHal = NULL;
-
-	hddLog(LOGE, FL("change HT20/40 mode"));
-
-	if (WLAN_HDD_SOFTAP == pHostapdAdapter->device_mode) {
-		hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-		if (NULL == hHal) {
-			hddLog(LOGE, FL("Hal ctx is null"));
-			return CDF_STATUS_E_FAULT;
-		}
-		cdf_ret_status =
-			sme_set_ht2040_mode(hHal, pHostapdAdapter->sessionId,
-					channel_type, true);
-		if (cdf_ret_status == CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE, FL("Failed to change HT20/40 mode"));
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-	return CDF_STATUS_SUCCESS;
-}
-#endif
-
-/**
- * __hdd_hostapd_set_mac_address() -
- * This function sets the user specified mac address using
- * the command ifconfig wlanX hw ether <mac address>.
- *
- * @dev: pointer to the net device.
- * @addr: pointer to the sockaddr.
- *
- * Return: 0 for success, non zero for failure
- */
-static int __hdd_hostapd_set_mac_address(struct net_device *dev, void *addr)
-{
-	struct sockaddr *psta_mac_addr = addr;
-	hdd_adapter_t *adapter;
-	hdd_context_t *hdd_ctx;
-	int ret = 0;
-
-	ENTER();
-
-	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;
-
-	memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN);
-	EXIT();
-	return 0;
-}
-
-/**
- * hdd_hostapd_set_mac_address() - set mac address
- * @dev: pointer to net_device
- * @addr: mac address
- *
- * Return: 0 on success, error number otherwise
- */
-static int hdd_hostapd_set_mac_address(struct net_device *dev, void *addr)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_hostapd_set_mac_address(dev, addr);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-void hdd_hostapd_inactivity_timer_cb(void *usrDataForCallback)
-{
-	struct net_device *dev = (struct net_device *)usrDataForCallback;
-	uint8_t we_custom_event[64];
-	union iwreq_data wrqu;
-#ifdef DISABLE_CONCURRENCY_AUTOSAVE
-	CDF_STATUS cdf_status;
-	hdd_adapter_t *pHostapdAdapter;
-	hdd_ap_ctx_t *pHddApCtx;
-#endif /* DISABLE_CONCURRENCY_AUTOSAVE */
-
-	/* event_name space-delimiter driver_module_name
-	 * Format of the event is "AUTO-SHUT.indication" " " "module_name"
-	 */
-	char *autoShutEvent = "AUTO-SHUT.indication" " " KBUILD_MODNAME;
-
-	/* For the NULL at the end */
-	int event_len = strlen(autoShutEvent) + 1;
-
-	ENTER();
-
-#ifdef DISABLE_CONCURRENCY_AUTOSAVE
-	if (cds_concurrent_open_sessions_running()) {
-		/*
-		 * This timer routine is going to be called only when AP
-		 * persona is up.
-		 * If there are concurrent sessions running we do not want
-		 * to shut down the Bss.Instead we run the timer again so
-		 * that if Autosave is enabled next time and other session
-		   was down only then we bring down AP
-		 */
-		pHostapdAdapter = netdev_priv(dev);
-		pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter);
-		cdf_status =
-			cdf_mc_timer_start(&pHddApCtx->hdd_ap_inactivity_timer,
-					(WLAN_HDD_GET_CTX(pHostapdAdapter))->
-					config->nAPAutoShutOff * 1000);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOGE, FL("Failed to init AP inactivity timer"));
-		}
-		EXIT();
-		return;
-	}
-#endif /* DISABLE_CONCURRENCY_AUTOSAVE */
-	memset(&we_custom_event, '\0', sizeof(we_custom_event));
-	memcpy(&we_custom_event, autoShutEvent, event_len);
-
-	memset(&wrqu, 0, sizeof(wrqu));
-	wrqu.data.length = event_len;
-
-	hddLog(LOG1, FL("Shutting down AP interface due to inactivity"));
-	wireless_send_event(dev, IWEVCUSTOM, &wrqu, (char *)we_custom_event);
-
-	EXIT();
-}
-
-void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter,
-		       void *usrDataForCallback)
-{
-	uint8_t staId = 0;
-	struct net_device *dev;
-	dev = (struct net_device *)usrDataForCallback;
-
-	hddLog(LOGE, FL("Clearing all the STA entry...."));
-	for (staId = 0; staId < WLAN_MAX_STA_COUNT; staId++) {
-		if (pHostapdAdapter->aStaInfo[staId].isUsed &&
-		    (staId !=
-		     (WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->uBCStaId)) {
-			/* Disconnect all the stations */
-			hdd_softap_sta_disassoc(pHostapdAdapter,
-						&pHostapdAdapter->
-						aStaInfo[staId].macAddrSTA.
-						bytes[0]);
-		}
-	}
-}
-
-static int hdd_stop_bss_link(hdd_adapter_t *pHostapdAdapter,
-			     void *usrDataForCallback)
-{
-	struct net_device *dev;
-	hdd_context_t *pHddCtx = NULL;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	dev = (struct net_device *)usrDataForCallback;
-	ENTER();
-
-	pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) {
-#ifdef WLAN_FEATURE_MBSSID
-		status =
-			wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(
-					 pHostapdAdapter));
-#else
-		status =
-			wlansap_stop_bss((WLAN_HDD_GET_CTX(pHostapdAdapter))->
-					 pcds_context);
-#endif
-		if (CDF_IS_STATUS_SUCCESS(status))
-			hddLog(LOGE, FL("Deleting SAP/P2P link!!!!!!"));
-
-		clear_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags);
-		cds_decr_session_set_pcl(pHostapdAdapter->device_mode,
-					     pHostapdAdapter->sessionId);
-	}
-	EXIT();
-	return (status == CDF_STATUS_SUCCESS) ? 0 : -EBUSY;
-}
-
-/**
- * hdd_issue_stored_joinreq() - This function will trigger stations's
- *                              cached connect request to proceed.
- * @hdd_ctx: pointer to hdd context.
- * @sta_adater: pointer to station adapter.
- *
- * This function will call SME to release station's stored/cached connect
- * request to proceed.
- *
- * Return: none.
- */
-static void hdd_issue_stored_joinreq(hdd_adapter_t *sta_adapter,
-		hdd_context_t *hdd_ctx)
-{
-	tHalHandle hal_handle;
-	uint32_t roam_id;
-
-	if (NULL == sta_adapter) {
-		hddLog(LOGE,
-			FL
-			("Invalid station adapter, ignore issueing join req"));
-		return;
-	}
-	hal_handle = WLAN_HDD_GET_HAL_CTX(sta_adapter);
-
-	if (true ==  cds_is_sta_connection_pending()) {
-		MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-				TRACE_CODE_HDD_ISSUE_JOIN_REQ,
-				sta_adapter->sessionId, roam_id));
-		if (CDF_STATUS_SUCCESS !=
-			sme_issue_stored_joinreq(hal_handle,
-				&roam_id,
-				sta_adapter->sessionId)) {
-			/* change back to NotAssociated */
-			hdd_conn_set_connection_state(sta_adapter,
-				eConnectionState_NotConnected);
-		}
-		cds_change_sta_conn_pending_status(false);
-	}
-}
-
-#ifdef WLAN_FEATURE_MBSSID
-static eCsrPhyMode
-hdd_sap_get_phymode(hdd_adapter_t *hostapd_adapter)
-{
-	return wlansap_get_phymode(WLAN_HDD_GET_SAP_CTX_PTR(hostapd_adapter));
-}
-#else
-static eCsrPhyMode
-hdd_sap_get_phymode(hdd_adapter_t *hostapd_adapter)
-{
-	return wlansap_get_phymode(
-		(WLAN_HDD_GET_CTX(hostapd_adapter))->pcds_context);
-}
-#endif
-
-/**
- * hdd_update_chandef() - Function to update channel width and center freq
- * @hostapd_adapter:	hostapd adapter
- * @chandef:		cfg80211 chan def
- * @cb_mode:		chan offset
- *
- * This function will be called to update channel width and center freq
- *
- * Return: None
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) || defined(WITH_BACKPORTS)
-static inline void
-hdd_update_chandef(hdd_adapter_t *hostapd_adapter,
-		struct cfg80211_chan_def *chandef,
-		ePhyChanBondState cb_mode)
-{
-	uint16_t   ch_width;
-	hdd_ap_ctx_t *phdd_ap_ctx;
-	uint8_t  center_chan, chan;
-
-	phdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(hostapd_adapter);
-	ch_width = phdd_ap_ctx->sapConfig.acs_cfg.ch_width;
-
-	switch (ch_width) {
-	case eHT_CHANNEL_WIDTH_20MHZ:
-	case eHT_CHANNEL_WIDTH_40MHZ:
-		hdd_info("ch_width %d, won't update", ch_width);
-		break;
-	case eHT_CHANNEL_WIDTH_80MHZ:
-		chan = cds_freq_to_chan(chandef->chan->center_freq);
-		chandef->width = NL80211_CHAN_WIDTH_80;
-
-		switch (cb_mode) {
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
-			center_chan = chan + 2;
-			break;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
-			center_chan = chan + 6;
-			break;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
-			center_chan = chan - 2;
-			break;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
-			center_chan = chan - 6;
-			break;
-		default:
-			center_chan = chan;
-			break;
-		}
-
-		chandef->center_freq1 = cds_chan_to_freq(center_chan);
-		break;
-	case eHT_CHANNEL_WIDTH_160MHZ:
-	default:
-		/* Todo, please add related codes if support 160MHZ or others */
-		hdd_err("unsupport ch_width %d", ch_width);
-		break;
-	}
-
-}
-#else
-static inline void
-hdd_update_chandef(hdd_adapter_t *hostapd_adapter,
-		struct cfg80211_chan_def *chandef,
-		ePhyChanBondState cb_mode)
-{
-}
-#endif
-
-/**
- * hdd_chan_change_notify() - Function to notify hostapd about channel change
- * @hostapd_adapter	hostapd adapter
- * @dev:		Net device structure
- * @oper_chan:		New operating channel
- *
- * This function is used to notify hostapd about the channel change
- *
- * Return: Success on intimating userspace
- *
- */
-CDF_STATUS hdd_chan_change_notify(hdd_adapter_t *hostapd_adapter,
-		struct net_device *dev,
-		uint8_t oper_chan)
-{
-	struct ieee80211_channel *chan;
-	struct cfg80211_chan_def chandef;
-	enum nl80211_channel_type channel_type;
-	eCsrPhyMode phy_mode;
-	ePhyChanBondState cb_mode;
-	uint32_t freq;
-	tHalHandle  hal = WLAN_HDD_GET_HAL_CTX(hostapd_adapter);
-
-	if (NULL == hal) {
-		hdd_err("hal is NULL");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	freq = cds_chan_to_freq(oper_chan);
-
-	chan = __ieee80211_get_channel(hostapd_adapter->wdev.wiphy, freq);
-
-	if (!chan) {
-		hdd_err("Invalid input frequency for channel conversion");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	phy_mode = hdd_sap_get_phymode(hostapd_adapter);
-
-	if (oper_chan <= 14)
-		cb_mode = sme_get_cb_phy_state_from_cb_ini_value(
-				sme_get_channel_bonding_mode24_g(hal));
-	else
-		cb_mode = sme_get_cb_phy_state_from_cb_ini_value(
-				sme_get_channel_bonding_mode5_g(hal));
-
-	switch (phy_mode) {
-	case eCSR_DOT11_MODE_11n:
-	case eCSR_DOT11_MODE_11n_ONLY:
-	case eCSR_DOT11_MODE_11ac:
-	case eCSR_DOT11_MODE_11ac_ONLY:
-		if (cb_mode == PHY_SINGLE_CHANNEL_CENTERED)
-			channel_type = NL80211_CHAN_HT20;
-		else if (cb_mode == PHY_DOUBLE_CHANNEL_HIGH_PRIMARY)
-			channel_type = NL80211_CHAN_HT40MINUS;
-		else if (cb_mode == PHY_DOUBLE_CHANNEL_LOW_PRIMARY)
-			channel_type = NL80211_CHAN_HT40PLUS;
-		else
-			channel_type = NL80211_CHAN_HT40PLUS;
-		break;
-	default:
-		channel_type = NL80211_CHAN_NO_HT;
-		break;
-	}
-
-	hdd_info("%s: phy_mode %d cb_mode %d chann_type %d oper_chan %d",
-		__func__, phy_mode, cb_mode, channel_type, oper_chan);
-
-	cfg80211_chandef_create(&chandef, chan, channel_type);
-
-	if ((phy_mode == eCSR_DOT11_MODE_11ac) ||
-	    (phy_mode == eCSR_DOT11_MODE_11ac_ONLY))
-		hdd_update_chandef(hostapd_adapter, &chandef, cb_mode);
-
-	cfg80211_ch_switch_notify(dev, &chandef);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_send_radar_event() - Function to send radar events to user space
- * @hdd_context:	HDD context
- * @event:		Type of radar event
- * @dfs_info:		Structure containing DFS channel and country
- * @wdev:		Wireless device structure
- *
- * This function is used to send radar events such as CAC start, CAC
- * end etc., to userspace
- *
- * Return: Success on sending notifying userspace
- *
- */
-CDF_STATUS hdd_send_radar_event(hdd_context_t *hdd_context,
-		eSapHddEvent event,
-		struct wlan_dfs_info dfs_info,
-		struct wireless_dev *wdev)
-{
-
-	struct sk_buff *vendor_event;
-	enum qca_nl80211_vendor_subcmds_index index;
-	uint32_t freq, ret;
-	uint32_t data_size;
-
-	if (!hdd_context) {
-		hddLog(LOGE, FL("HDD context is NULL"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	freq = cds_chan_to_freq(dfs_info.channel);
-
-	switch (event) {
-	case eSAP_DFS_CAC_START:
-		index =
-		    QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_STARTED_INDEX;
-		data_size = sizeof(uint32_t);
-		break;
-	case eSAP_DFS_CAC_END:
-		index =
-		    QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_CAC_FINISHED_INDEX;
-		data_size = sizeof(uint32_t);
-		break;
-	case eSAP_DFS_RADAR_DETECT:
-		index =
-		    QCA_NL80211_VENDOR_SUBCMD_DFS_OFFLOAD_RADAR_DETECTED_INDEX;
-		data_size = sizeof(uint32_t);
-		break;
-	default:
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	vendor_event = cfg80211_vendor_event_alloc(hdd_context->wiphy,
-			wdev,
-			data_size + NLMSG_HDRLEN,
-			index,
-			GFP_KERNEL);
-	if (!vendor_event) {
-		hddLog(LOGE,
-			FL("cfg80211_vendor_event_alloc failed for %d"), index);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = nla_put_u32(vendor_event, NL80211_ATTR_WIPHY_FREQ, freq);
-
-	if (ret) {
-		hddLog(LOGE, FL("NL80211_ATTR_WIPHY_FREQ put fail"));
-		kfree_skb(vendor_event);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cfg80211_vendor_event(vendor_event, GFP_KERNEL);
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
-				    void *usrDataForCallback)
-{
-	hdd_adapter_t *pHostapdAdapter;
-	hdd_ap_ctx_t *pHddApCtx;
-	hdd_hostapd_state_t *pHostapdState;
-	struct net_device *dev;
-	eSapHddEvent sapEvent;
-	union iwreq_data wrqu;
-	uint8_t *we_custom_event_generic = NULL;
-	int we_event = 0;
-	int i = 0;
-	uint8_t staId;
-	CDF_STATUS cdf_status;
-	bool bWPSState;
-	bool bAuthRequired = true;
-	tpSap_AssocMacAddr pAssocStasArray = NULL;
-	char unknownSTAEvent[IW_CUSTOM_MAX + 1];
-	char maxAssocExceededEvent[IW_CUSTOM_MAX + 1];
-	uint8_t we_custom_start_event[64];
-	char *startBssEvent;
-	hdd_context_t *pHddCtx;
-	hdd_scaninfo_t *pScanInfo = NULL;
-	struct iw_michaelmicfailure msg;
-	uint8_t ignoreCAC = 0;
-	struct hdd_config *cfg = NULL;
-	struct wlan_dfs_info dfs_info;
-	uint8_t cc_len = WLAN_SVC_COUNTRY_CODE_LEN;
-	hdd_adapter_t *con_sap_adapter;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-#if defined CONFIG_CNSS
-	int ret = 0;
-#endif
-
-	dev = (struct net_device *)usrDataForCallback;
-	if (!dev) {
-		hddLog(LOGE, FL("usrDataForCallback is null"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	pHostapdAdapter = netdev_priv(dev);
-
-	if ((NULL == pHostapdAdapter) ||
-	    (WLAN_HDD_ADAPTER_MAGIC != pHostapdAdapter->magic)) {
-		hddLog(LOGE, "invalid adapter or adapter has invalid magic");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
-	pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter);
-
-	if (!pSapEvent) {
-		hddLog(LOGE, FL("pSapEvent is null"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	sapEvent = pSapEvent->sapHddEventCode;
-	memset(&wrqu, '\0', sizeof(wrqu));
-	pHddCtx = (hdd_context_t *) (pHostapdAdapter->pHddCtx);
-
-	if (!pHddCtx) {
-		hddLog(LOGE, FL("HDD context is null"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cfg = pHddCtx->config;
-
-	if (!cfg) {
-		hddLog(LOGE, FL("HDD config is null"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	dfs_info.channel = pHddApCtx->operatingChannel;
-	sme_get_country_code(pHddCtx->hHal, dfs_info.country_code, &cc_len);
-
-	switch (sapEvent) {
-	case eSAP_START_BSS_EVENT:
-		hddLog(LOG1,
-		       FL("BSS status = %s, channel = %u, bc sta Id = %d"),
-		       pSapEvent->sapevt.sapStartBssCompleteEvent.
-		       status ? "eSAP_STATUS_FAILURE" : "eSAP_STATUS_SUCCESS",
-		       pSapEvent->sapevt.sapStartBssCompleteEvent.
-		       operatingChannel,
-		       pSapEvent->sapevt.sapStartBssCompleteEvent.staId);
-
-		pHostapdAdapter->sessionId =
-			pSapEvent->sapevt.sapStartBssCompleteEvent.sessionId;
-
-		pHostapdState->cdf_status =
-			pSapEvent->sapevt.sapStartBssCompleteEvent.status;
-		cdf_status = cdf_event_set(&pHostapdState->cdf_event);
-
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)
-		    || pHostapdState->cdf_status) {
-			hddLog(LOGE, ("ERROR: startbss event failed!!"));
-			goto stopbss;
-		} else {
-			sme_ch_avoid_update_req(pHddCtx->hHal);
-
-			pHddApCtx->uBCStaId =
-				pSapEvent->sapevt.sapStartBssCompleteEvent.staId;
-
-			hdd_register_tx_flow_control(pHostapdAdapter,
-				hdd_softap_tx_resume_timer_expired_handler,
-				hdd_softap_tx_resume_cb);
-
-			/* @@@ need wep logic here to set privacy bit */
-			cdf_status =
-				hdd_softap_register_bc_sta(pHostapdAdapter,
-							   pHddApCtx->uPrivacy);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				hddLog(LOGW, FL("Failed to register BC STA %d"),
-				       cdf_status);
-				hdd_stop_bss_link(pHostapdAdapter,
-						  usrDataForCallback);
-			}
-		}
-
-		if (hdd_ipa_is_enabled(pHddCtx)) {
-			status = hdd_ipa_wlan_evt(pHostapdAdapter,
-					pHddApCtx->uBCStaId,
-					WLAN_AP_CONNECT,
-					pHostapdAdapter->dev->dev_addr);
-			if (status) {
-				hddLog(LOGE,
-					("WLAN_AP_CONNECT event failed!!"));
-				goto stopbss;
-			}
-		}
-
-		if (0 !=
-		    (WLAN_HDD_GET_CTX(pHostapdAdapter))->config->
-		     nAPAutoShutOff) {
-			/* AP Inactivity timer init and start */
-			cdf_status =
-				cdf_mc_timer_init(&pHddApCtx->
-						  hdd_ap_inactivity_timer,
-						  CDF_TIMER_TYPE_SW,
-						  hdd_hostapd_inactivity_timer_cb,
-						  dev);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-				hddLog(LOGE,
-					FL("Failed to init inactivity timer"));
-
-			cdf_status =
-				cdf_mc_timer_start(&pHddApCtx->
-						   hdd_ap_inactivity_timer,
-						   (WLAN_HDD_GET_CTX
-						    (pHostapdAdapter))->config->
-						    nAPAutoShutOff * 1000);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-				hddLog(LOGE,
-					FL("Failed to init inactivity timer"));
-
-		}
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-		wlan_hdd_auto_shutdown_enable(pHddCtx, true);
-#endif
-		pHddApCtx->operatingChannel =
-			pSapEvent->sapevt.sapStartBssCompleteEvent.operatingChannel;
-
-		hdd_hostapd_channel_prevent_suspend(pHostapdAdapter,
-						    pHddApCtx->
-						    operatingChannel);
-
-		pHostapdState->bssState = BSS_START;
-		hdd_wlan_green_ap_start_bss(pHddCtx);
-
-		/* Set group key / WEP key every time when BSS is restarted */
-		if (pHddApCtx->groupKey.keyLength) {
-			status = wlansap_set_key_sta(
-#ifdef WLAN_FEATURE_MBSSID
-				WLAN_HDD_GET_SAP_CTX_PTR
-					(pHostapdAdapter),
-#else
-				(WLAN_HDD_GET_CTX
-					 (pHostapdAdapter))->
-				pcds_context,
-#endif
-				&pHddApCtx->groupKey);
-			if (!CDF_IS_STATUS_SUCCESS(status))
-				hddLog(LOGE, FL("wlansap_set_key_sta failed"));
-		} else {
-			for (i = 0; i < CSR_MAX_NUM_KEY; i++) {
-				if (!pHddApCtx->wepKey[i].keyLength)
-					continue;
-
-				status = wlansap_set_key_sta(
-#ifdef WLAN_FEATURE_MBSSID
-					WLAN_HDD_GET_SAP_CTX_PTR
-						(pHostapdAdapter),
-#else
-					(WLAN_HDD_GET_CTX(pHostapdAdapter))->
-					 pcds_context,
-#endif
-					&pHddApCtx->
-					wepKey[i]);
-				if (!CDF_IS_STATUS_SUCCESS(status)) {
-					hddLog(LOGE,
-					       FL("set_key failed idx %d"), i);
-				}
-			}
-		}
-
-		mutex_lock(&pHddCtx->dfs_lock);
-		pHddCtx->dfs_radar_found = false;
-		mutex_unlock(&pHddCtx->dfs_lock);
-
-		wlansap_get_dfs_ignore_cac(pHddCtx->hHal, &ignoreCAC);
-
-		/* DFS requirement: DO NOT transmit during CAC. */
-		if ((CHANNEL_STATE_DFS !=
-			cds_get_channel_state(pHddApCtx->operatingChannel))
-			|| ignoreCAC
-			|| pHddCtx->dev_dfs_cac_status == DFS_CAC_ALREADY_DONE)
-			pHddApCtx->dfs_cac_block_tx = false;
-		else
-			pHddApCtx->dfs_cac_block_tx = true;
-
-		hddLog(LOG3, "The value of dfs_cac_block_tx[%d] for ApCtx[%p]",
-		       pHddApCtx->dfs_cac_block_tx, pHddApCtx);
-
-		if ((CHANNEL_STATE_DFS ==
-		     cds_get_channel_state(pHddApCtx->operatingChannel))
-		    && (pHddCtx->config->IsSapDfsChSifsBurstEnabled == 0)) {
-
-			hddLog(LOG1,
-			       FL("Set SIFS Burst disable for DFS channel %d"),
-			       pHddApCtx->operatingChannel);
-
-			if (wma_cli_set_command(pHostapdAdapter->sessionId,
-						WMI_PDEV_PARAM_BURST_ENABLE,
-						0, PDEV_CMD)) {
-				hddLog(LOGE,
-				       FL("Failed to Set SIFS Burst %d"),
-				       pHddApCtx->operatingChannel);
-			}
-		}
-		/* Fill the params for sending IWEVCUSTOM Event with SOFTAP.enabled */
-		startBssEvent = "SOFTAP.enabled";
-		memset(&we_custom_start_event, '\0',
-		       sizeof(we_custom_start_event));
-		memcpy(&we_custom_start_event, startBssEvent,
-		       strlen(startBssEvent));
-		memset(&wrqu, 0, sizeof(wrqu));
-		wrqu.data.length = strlen(startBssEvent);
-		we_event = IWEVCUSTOM;
-		we_custom_event_generic = we_custom_start_event;
-		cds_dump_concurrency_info();
-		/* Send SCC/MCC Switching event to IPA */
-		hdd_ipa_send_mcc_scc_msg(pHddCtx, pHddCtx->mcc_mode);
-		break;          /* Event will be sent after Switch-Case stmt */
-
-	case eSAP_STOP_BSS_EVENT:
-		hddLog(LOG1, FL("BSS stop status = %s"),
-		       pSapEvent->sapevt.sapStopBssCompleteEvent.
-		       status ? "eSAP_STATUS_FAILURE" : "eSAP_STATUS_SUCCESS");
-
-		hdd_hostapd_channel_allow_suspend(pHostapdAdapter,
-						  pHddApCtx->operatingChannel);
-
-		hdd_wlan_green_ap_stop_bss(pHddCtx);
-
-		/* Free up Channel List incase if it is set */
-#ifdef WLAN_FEATURE_MBSSID
-		sap_cleanup_channel_list(WLAN_HDD_GET_SAP_CTX_PTR
-					 (pHostapdAdapter));
-#else
-		sap_cleanup_channel_list();
-#endif
-		/* Invalidate the channel info. */
-		pHddApCtx->operatingChannel = 0;
-		if (hdd_ipa_is_enabled(pHddCtx)) {
-			status = hdd_ipa_wlan_evt(pHostapdAdapter,
-					pHddApCtx->uBCStaId,
-					WLAN_AP_DISCONNECT,
-					pHostapdAdapter->dev->dev_addr);
-			if (status) {
-				hddLog(LOGE,
-				       ("WLAN_AP_DISCONNECT event failed!!"));
-				goto stopbss;
-			}
-		}
-
-		/* reset the dfs_cac_status and dfs_cac_block_tx flag only when
-		 * the last BSS is stopped
-		 */
-		con_sap_adapter = hdd_get_con_sap_adapter(pHostapdAdapter, true);
-		if (!con_sap_adapter) {
-			pHddApCtx->dfs_cac_block_tx = true;
-			pHddCtx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE;
-		}
-		if (pHddCtx->config->conc_custom_rule2 &&
-			(WLAN_HDD_P2P_GO == pHostapdAdapter->device_mode)) {
-			hdd_adapter_t *sta_adapter = hdd_get_adapter(pHddCtx,
-					WLAN_HDD_INFRA_STATION);
-			hddLog(LOG2,
-				FL("P2PGO is going down now"));
-			hdd_issue_stored_joinreq(sta_adapter, pHddCtx);
-		}
-		goto stopbss;
-
-	case eSAP_DFS_CAC_START:
-		wlan_hdd_send_svc_nlink_msg(WLAN_SVC_DFS_CAC_START_IND,
-					    &dfs_info,
-					    sizeof(struct wlan_dfs_info));
-		pHddCtx->dev_dfs_cac_status = DFS_CAC_IN_PROGRESS;
-		if (CDF_STATUS_SUCCESS !=
-			hdd_send_radar_event(pHddCtx, eSAP_DFS_CAC_START,
-				dfs_info, &pHostapdAdapter->wdev)) {
-			hddLog(LOGE, FL("Unable to indicate CAC start NL event"));
-		} else {
-			hdd_info("Sent CAC start to user space");
-		}
-
-		mutex_lock(&pHddCtx->dfs_lock);
-		pHddCtx->dfs_radar_found = false;
-		mutex_unlock(&pHddCtx->dfs_lock);
-		break;
-	case eSAP_DFS_CAC_INTERRUPTED:
-		/*
-		 * The CAC timer did not run completely and a radar was detected
-		 * during the CAC time. This new state will keep the tx path
-		 * blocked since we do not want any transmission on the DFS
-		 * channel. CAC end will only be reported here since the user
-		 * space applications are waiting on CAC end for their state
-		 * management.
-		 */
-		if (CDF_STATUS_SUCCESS !=
-			hdd_send_radar_event(pHddCtx, eSAP_DFS_CAC_END,
-				dfs_info, &pHostapdAdapter->wdev)) {
-			hdd_err("Unable to indicate CAC end (interrupted) event");
-		} else {
-			hdd_info("Sent CAC end (interrupted) to user space");
-		}
-		break;
-	case eSAP_DFS_CAC_END:
-		wlan_hdd_send_svc_nlink_msg(WLAN_SVC_DFS_CAC_END_IND,
-					    &dfs_info,
-					    sizeof(struct wlan_dfs_info));
-		pHddApCtx->dfs_cac_block_tx = false;
-		pHddCtx->dev_dfs_cac_status = DFS_CAC_ALREADY_DONE;
-		if (CDF_STATUS_SUCCESS !=
-			hdd_send_radar_event(pHddCtx, eSAP_DFS_CAC_END,
-				dfs_info, &pHostapdAdapter->wdev)) {
-			hddLog(LOGE, FL("Unable to indicate CAC end NL event"));
-		} else {
-			hdd_info("Sent CAC end to user space");
-		}
-		break;
-
-	case eSAP_DFS_RADAR_DETECT:
-		wlan_hdd_send_svc_nlink_msg(WLAN_SVC_DFS_RADAR_DETECT_IND,
-					    &dfs_info,
-					    sizeof(struct wlan_dfs_info));
-		pHddCtx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE;
-		if (CDF_STATUS_SUCCESS !=
-			hdd_send_radar_event(pHddCtx, eSAP_DFS_RADAR_DETECT,
-				dfs_info, &pHostapdAdapter->wdev)) {
-			hddLog(LOGE, FL("Unable to indicate Radar detect NL event"));
-		} else {
-			hdd_info("Sent radar detected to user space");
-		}
-		break;
-
-	case eSAP_DFS_NO_AVAILABLE_CHANNEL:
-		wlan_hdd_send_svc_nlink_msg
-			(WLAN_SVC_DFS_ALL_CHANNEL_UNAVAIL_IND, &dfs_info,
-			sizeof(struct wlan_dfs_info));
-		break;
-
-	case eSAP_STA_SET_KEY_EVENT:
-		/* TODO:
-		 * forward the message to hostapd once implementation
-		 * is done for now just print
-		 */
-		hddLog(LOG1, FL("SET Key: configured status = %s"),
-		       pSapEvent->sapevt.sapStationSetKeyCompleteEvent.
-		       status ? "eSAP_STATUS_FAILURE" : "eSAP_STATUS_SUCCESS");
-		return CDF_STATUS_SUCCESS;
-	case eSAP_STA_MIC_FAILURE_EVENT:
-	{
-		memset(&msg, '\0', sizeof(msg));
-		msg.src_addr.sa_family = ARPHRD_ETHER;
-		memcpy(msg.src_addr.sa_data,
-		       &pSapEvent->sapevt.sapStationMICFailureEvent.
-		       staMac, CDF_MAC_ADDR_SIZE);
-		hddLog(LOG1, "MIC MAC " MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(msg.src_addr.sa_data));
-		if (pSapEvent->sapevt.sapStationMICFailureEvent.
-		    multicast == eSAP_TRUE)
-			msg.flags = IW_MICFAILURE_GROUP;
-		else
-			msg.flags = IW_MICFAILURE_PAIRWISE;
-		memset(&wrqu, 0, sizeof(wrqu));
-		wrqu.data.length = sizeof(msg);
-		we_event = IWEVMICHAELMICFAILURE;
-		we_custom_event_generic = (uint8_t *) &msg;
-	}
-		/* inform mic failure to nl80211 */
-		cfg80211_michael_mic_failure(dev,
-					     pSapEvent->
-					     sapevt.sapStationMICFailureEvent.
-					     staMac.bytes,
-					     ((pSapEvent->sapevt.
-					       sapStationMICFailureEvent.
-					       multicast ==
-					       eSAP_TRUE) ?
-					      NL80211_KEYTYPE_GROUP :
-					      NL80211_KEYTYPE_PAIRWISE),
-					     pSapEvent->sapevt.
-					     sapStationMICFailureEvent.keyId,
-					     pSapEvent->sapevt.
-					     sapStationMICFailureEvent.TSC,
-					     GFP_KERNEL);
-		break;
-
-	case eSAP_STA_ASSOC_EVENT:
-	case eSAP_STA_REASSOC_EVENT:
-		wrqu.addr.sa_family = ARPHRD_ETHER;
-		memcpy(wrqu.addr.sa_data,
-		       &pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.
-		       staMac, CDF_MAC_ADDR_SIZE);
-		hddLog(LOG1, " associated " MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(wrqu.addr.sa_data));
-		we_event = IWEVREGISTERED;
-
-#ifdef WLAN_FEATURE_MBSSID
-		wlansap_get_wps_state(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter),
-				      &bWPSState);
-#else
-		wlansap_get_wps_state((WLAN_HDD_GET_CTX(pHostapdAdapter))->
-				      pcds_context, &bWPSState);
-#endif
-
-		if ((eCSR_ENCRYPT_TYPE_NONE == pHddApCtx->ucEncryptType) ||
-		    (eCSR_ENCRYPT_TYPE_WEP40_STATICKEY ==
-		     pHddApCtx->ucEncryptType)
-		    || (eCSR_ENCRYPT_TYPE_WEP104_STATICKEY ==
-			pHddApCtx->ucEncryptType)) {
-			bAuthRequired = false;
-		}
-
-		if (bAuthRequired || bWPSState == true) {
-			cdf_status = hdd_softap_register_sta(
-						pHostapdAdapter,
-						true,
-						pHddApCtx->uPrivacy,
-						pSapEvent->sapevt.
-						sapStationAssocReassocCompleteEvent.
-						staId, 0, 0,
-						(struct cdf_mac_addr *)
-						wrqu.addr.sa_data,
-						pSapEvent->sapevt.
-						sapStationAssocReassocCompleteEvent.
-						wmmEnabled);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-				hddLog(LOGW,
-				       FL("Failed to register STA %d "
-					  MAC_ADDRESS_STR ""), cdf_status,
-				       MAC_ADDR_ARRAY(wrqu.addr.sa_data));
-		} else {
-			cdf_status = hdd_softap_register_sta(
-						pHostapdAdapter,
-						false,
-						pHddApCtx->uPrivacy,
-						pSapEvent->sapevt.
-						sapStationAssocReassocCompleteEvent.
-						staId, 0, 0,
-						(struct cdf_mac_addr *)
-						wrqu.addr.sa_data,
-						pSapEvent->sapevt.
-						sapStationAssocReassocCompleteEvent.
-						wmmEnabled);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-				hddLog(LOGW,
-				       FL("Failed to register STA %d "
-					  MAC_ADDRESS_STR ""), cdf_status,
-				       MAC_ADDR_ARRAY(wrqu.addr.sa_data));
-		}
-
-		staId =
-		   pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.staId;
-		if (CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			pHostapdAdapter->aStaInfo[staId].nss =
-				pSapEvent->sapevt.
-				sapStationAssocReassocCompleteEvent.
-				chan_info.nss;
-			pHostapdAdapter->aStaInfo[staId].rate_flags =
-				pSapEvent->sapevt.
-				sapStationAssocReassocCompleteEvent.
-				chan_info.rate_flags;
-		}
-
-		if (hdd_ipa_is_enabled(pHddCtx)) {
-			status = hdd_ipa_wlan_evt(pHostapdAdapter,
-					pSapEvent->sapevt.
-					sapStationAssocReassocCompleteEvent.
-					staId, WLAN_CLIENT_CONNECT_EX,
-					pSapEvent->sapevt.
-					sapStationAssocReassocCompleteEvent.
-					staMac.bytes);
-			if (status) {
-				hddLog(LOGE,
-				     FL("WLAN_CLIENT_CONNECT_EX event failed"));
-				goto stopbss;
-			}
-		}
-
-#ifdef QCA_PKT_PROTO_TRACE
-		/* Peer associated, update into trace buffer */
-		if (pHddCtx->config->gEnableDebugLog) {
-			cds_pkt_trace_buf_update("HA:ASSOC");
-		}
-#endif /* QCA_PKT_PROTO_TRACE */
-
-#ifdef MSM_PLATFORM
-		/* start timer in sap/p2p_go */
-		if (pHddApCtx->bApActive == false) {
-			spin_lock_bh(&pHddCtx->bus_bw_lock);
-			pHostapdAdapter->prev_tx_packets =
-				pHostapdAdapter->stats.tx_packets;
-			pHostapdAdapter->prev_rx_packets =
-				pHostapdAdapter->stats.rx_packets;
-			spin_unlock_bh(&pHddCtx->bus_bw_lock);
-			hdd_start_bus_bw_compute_timer(pHostapdAdapter);
-		}
-#endif
-		pHddApCtx->bApActive = true;
-		/* Stop AP inactivity timer */
-		if (pHddApCtx->hdd_ap_inactivity_timer.state ==
-		    CDF_TIMER_STATE_RUNNING) {
-			cdf_status =
-				cdf_mc_timer_stop(&pHddApCtx->
-						  hdd_ap_inactivity_timer);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				hddLog(LOGE,
-				       FL("Failed to start inactivity timer"));
-			}
-		}
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-		wlan_hdd_auto_shutdown_enable(pHddCtx, false);
-#endif
-		cdf_wake_lock_timeout_acquire(&pHddCtx->sap_wake_lock,
-					      HDD_SAP_WAKE_LOCK_DURATION,
-					      WIFI_POWER_EVENT_WAKELOCK_SAP);
-		{
-			struct station_info staInfo;
-			uint16_t iesLen =
-				pSapEvent->sapevt.
-				sapStationAssocReassocCompleteEvent.iesLen;
-
-			memset(&staInfo, 0, sizeof(staInfo));
-			if (iesLen <= MAX_ASSOC_IND_IE_LEN) {
-				staInfo.assoc_req_ies =
-					(const u8 *)&pSapEvent->sapevt.
-					sapStationAssocReassocCompleteEvent.ies[0];
-				staInfo.assoc_req_ies_len = iesLen;
-				staInfo.filled |= STATION_INFO_ASSOC_REQ_IES;
-				cfg80211_new_sta(dev,
-						 (const u8 *)&pSapEvent->sapevt.
-						 sapStationAssocReassocCompleteEvent.
-						 staMac.bytes[0], &staInfo,
-						 GFP_KERNEL);
-			} else {
-				hddLog(LOGE,
-				       FL("Assoc Ie length is too long"));
-			}
-		}
-
-		pScanInfo = &pHostapdAdapter->scan_info;
-		/* Lets do abort scan to ensure smooth authentication for client */
-		if ((pScanInfo != NULL) && pScanInfo->mScanPending) {
-			hdd_abort_mac_scan(pHddCtx, pHostapdAdapter->sessionId,
-					   eCSR_SCAN_ABORT_DEFAULT);
-		}
-		if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) {
-			/* send peer status indication to oem app */
-			hdd_send_peer_status_ind_to_oem_app(&pSapEvent->sapevt.
-							    sapStationAssocReassocCompleteEvent.
-							    staMac, ePeerConnected,
-							    pSapEvent->sapevt.
-							    sapStationAssocReassocCompleteEvent.
-							    timingMeasCap,
-							    pHostapdAdapter->
-							    sessionId,
-							    &pSapEvent->sapevt.
-							    sapStationAssocReassocCompleteEvent.
-							    chan_info);
-		}
-		hdd_wlan_green_ap_add_sta(pHddCtx);
-		break;
-
-	case eSAP_STA_DISASSOC_EVENT:
-		memcpy(wrqu.addr.sa_data,
-		       &pSapEvent->sapevt.sapStationDisassocCompleteEvent.
-		       staMac, CDF_MAC_ADDR_SIZE);
-		hddLog(LOG1, " disassociated " MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(wrqu.addr.sa_data));
-
-		cdf_status = cdf_event_set(&pHostapdState->cdf_event);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-			hddLog(LOGE, "ERR: Station Deauth event Set failed");
-
-		if (pSapEvent->sapevt.sapStationDisassocCompleteEvent.reason ==
-		    eSAP_USR_INITATED_DISASSOC)
-			hddLog(LOG1, " User initiated disassociation");
-		else
-			hddLog(LOG1, " MAC initiated disassociation");
-		we_event = IWEVEXPIRED;
-		cdf_status =
-			hdd_softap_get_sta_id(pHostapdAdapter,
-					      &pSapEvent->sapevt.
-					      sapStationDisassocCompleteEvent.staMac,
-					      &staId);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOGE, FL("ERROR: HDD Failed to find sta id!!"));
-			return CDF_STATUS_E_FAILURE;
-		}
-#ifdef IPA_OFFLOAD
-		if (hdd_ipa_is_enabled(pHddCtx)) {
-			status = hdd_ipa_wlan_evt(pHostapdAdapter, staId,
-					WLAN_CLIENT_DISCONNECT,
-					pSapEvent->sapevt.
-					sapStationDisassocCompleteEvent.
-					staMac.bytes);
-
-			if (status) {
-				hddLog(LOGE,
-				       ("ERROR: WLAN_CLIENT_DISCONNECT event failed!!"));
-				goto stopbss;
-			}
-		}
-#endif
-#ifdef QCA_PKT_PROTO_TRACE
-		/* Peer dis-associated, update into trace buffer */
-		if (pHddCtx->config->gEnableDebugLog) {
-			cds_pkt_trace_buf_update("HA:DISASC");
-		}
-#endif /* QCA_PKT_PROTO_TRACE */
-		hdd_softap_deregister_sta(pHostapdAdapter, staId);
-
-		pHddApCtx->bApActive = false;
-		spin_lock_bh(&pHostapdAdapter->staInfo_lock);
-		for (i = 0; i < WLAN_MAX_STA_COUNT; i++) {
-			if (pHostapdAdapter->aStaInfo[i].isUsed
-			    && i !=
-			    (WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->
-			    uBCStaId) {
-				pHddApCtx->bApActive = true;
-				break;
-			}
-		}
-		spin_unlock_bh(&pHostapdAdapter->staInfo_lock);
-
-		/* Start AP inactivity timer if no stations associated with it */
-		if ((0 !=
-		     (WLAN_HDD_GET_CTX(pHostapdAdapter))->config->
-		     nAPAutoShutOff)) {
-			if (pHddApCtx->bApActive == false) {
-				if (pHddApCtx->hdd_ap_inactivity_timer.state ==
-				    CDF_TIMER_STATE_STOPPED) {
-					cdf_status =
-						cdf_mc_timer_start(&pHddApCtx->
-								   hdd_ap_inactivity_timer,
-								   (WLAN_HDD_GET_CTX
-								    (pHostapdAdapter))->
-								   config->
-								   nAPAutoShutOff *
-								   1000);
-					if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-						hddLog(LOGE,
-						       FL("Failed to init AP inactivity timer"));
-				} else
-					CDF_ASSERT
-						(cdf_mc_timer_get_current_state
-							(&pHddApCtx->
-							hdd_ap_inactivity_timer) ==
-						CDF_TIMER_STATE_STOPPED);
-			}
-		}
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-		wlan_hdd_auto_shutdown_enable(pHddCtx, true);
-#endif
-
-		cfg80211_del_sta(dev,
-				 (const u8 *)&pSapEvent->sapevt.
-				 sapStationDisassocCompleteEvent.staMac.
-				 bytes[0], GFP_KERNEL);
-
-		/* Update the beacon Interval if it is P2P GO */
-		cdf_status = cds_change_mcc_go_beacon_interval(pHostapdAdapter);
-		if (CDF_STATUS_SUCCESS != cdf_status) {
-			hddLog(LOGE, FL("failed to update Beacon interval %d"),
-				cdf_status);
-		}
-		if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) {
-			/* send peer status indication to oem app */
-			hdd_send_peer_status_ind_to_oem_app(&pSapEvent->sapevt.
-							    sapStationDisassocCompleteEvent.
-							    staMac, ePeerDisconnected,
-							    0,
-							    pHostapdAdapter->
-							    sessionId, NULL);
-		}
-#ifdef MSM_PLATFORM
-		/*stop timer in sap/p2p_go */
-		if (pHddApCtx->bApActive == false) {
-			spin_lock_bh(&pHddCtx->bus_bw_lock);
-			pHostapdAdapter->prev_tx_packets = 0;
-			pHostapdAdapter->prev_rx_packets = 0;
-			spin_unlock_bh(&pHddCtx->bus_bw_lock);
-			hdd_stop_bus_bw_compute_timer(pHostapdAdapter);
-		}
-#endif
-		hdd_wlan_green_ap_del_sta(pHddCtx);
-		break;
-
-	case eSAP_WPS_PBC_PROBE_REQ_EVENT:
-	{
-		static const char *message =
-			"MLMEWPSPBCPROBEREQ.indication";
-		union iwreq_data wreq;
-
-		down(&pHddApCtx->semWpsPBCOverlapInd);
-		pHddApCtx->WPSPBCProbeReq.probeReqIELen =
-			pSapEvent->sapevt.sapPBCProbeReqEvent.
-			WPSPBCProbeReq.probeReqIELen;
-
-		cdf_mem_copy(pHddApCtx->WPSPBCProbeReq.probeReqIE,
-			     pSapEvent->sapevt.sapPBCProbeReqEvent.
-			     WPSPBCProbeReq.probeReqIE,
-			     pHddApCtx->WPSPBCProbeReq.probeReqIELen);
-
-		cdf_copy_macaddr(&pHddApCtx->WPSPBCProbeReq.peer_macaddr,
-			     &pSapEvent->sapevt.sapPBCProbeReqEvent.
-			     WPSPBCProbeReq.peer_macaddr);
-		hddLog(LOG1, "WPS PBC probe req " MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(pHddApCtx->WPSPBCProbeReq.
-				      peer_macaddr.bytes));
-		memset(&wreq, 0, sizeof(wreq));
-		wreq.data.length = strlen(message);             /* This is length of message */
-		wireless_send_event(dev, IWEVCUSTOM, &wreq,
-				    (char *)message);
-
-		return CDF_STATUS_SUCCESS;
-	}
-	case eSAP_ASSOC_STA_CALLBACK_EVENT:
-		pAssocStasArray =
-			pSapEvent->sapevt.sapAssocStaListEvent.pAssocStas;
-		if (pSapEvent->sapevt.sapAssocStaListEvent.noOfAssocSta != 0) { /* List of associated stations */
-			for (i = 0;
-			     i <
-			     pSapEvent->sapevt.sapAssocStaListEvent.
-			     noOfAssocSta; i++) {
-				hddLog(LOG1,
-				       "Associated Sta Num %d:assocId=%d, staId=%d, staMac="
-				       MAC_ADDRESS_STR, i + 1,
-				       pAssocStasArray->assocId,
-				       pAssocStasArray->staId,
-				       MAC_ADDR_ARRAY(pAssocStasArray->staMac.
-						      bytes));
-				pAssocStasArray++;
-			}
-		}
-		cdf_mem_free(pSapEvent->sapevt.sapAssocStaListEvent.pAssocStas);        /* Release caller allocated memory here */
-		pSapEvent->sapevt.sapAssocStaListEvent.pAssocStas = NULL;
-		return CDF_STATUS_SUCCESS;
-	case eSAP_REMAIN_CHAN_READY:
-		hdd_remain_chan_ready_handler(pHostapdAdapter,
-			pSapEvent->sapevt.sap_roc_ind.scan_id);
-		return CDF_STATUS_SUCCESS;
-	case eSAP_SEND_ACTION_CNF:
-		hdd_send_action_cnf(pHostapdAdapter,
-				    (eSAP_STATUS_SUCCESS ==
-				     pSapEvent->sapevt.sapActionCnf.
-				     actionSendSuccess) ? true : false);
-		return CDF_STATUS_SUCCESS;
-	case eSAP_UNKNOWN_STA_JOIN:
-		snprintf(unknownSTAEvent, IW_CUSTOM_MAX,
-			 "JOIN_UNKNOWN_STA-%02x:%02x:%02x:%02x:%02x:%02x",
-			 pSapEvent->sapevt.sapUnknownSTAJoin.macaddr.bytes[0],
-			 pSapEvent->sapevt.sapUnknownSTAJoin.macaddr.bytes[1],
-			 pSapEvent->sapevt.sapUnknownSTAJoin.macaddr.bytes[2],
-			 pSapEvent->sapevt.sapUnknownSTAJoin.macaddr.bytes[3],
-			 pSapEvent->sapevt.sapUnknownSTAJoin.macaddr.bytes[4],
-			 pSapEvent->sapevt.sapUnknownSTAJoin.macaddr.bytes[5]);
-		we_event = IWEVCUSTOM;  /* Discovered a new node (AP mode). */
-		wrqu.data.pointer = unknownSTAEvent;
-		wrqu.data.length = strlen(unknownSTAEvent);
-		we_custom_event_generic = (uint8_t *) unknownSTAEvent;
-		hddLog(LOGE, "%s", unknownSTAEvent);
-		break;
-
-	case eSAP_MAX_ASSOC_EXCEEDED:
-		snprintf(maxAssocExceededEvent, IW_CUSTOM_MAX,
-			 "Peer %02x:%02x:%02x:%02x:%02x:%02x denied"
-			 " assoc due to Maximum Mobile Hotspot connections reached. Please disconnect"
-			 " one or more devices to enable the new device connection",
-			 pSapEvent->sapevt.sapMaxAssocExceeded.macaddr.bytes[0],
-			 pSapEvent->sapevt.sapMaxAssocExceeded.macaddr.bytes[1],
-			 pSapEvent->sapevt.sapMaxAssocExceeded.macaddr.bytes[2],
-			 pSapEvent->sapevt.sapMaxAssocExceeded.macaddr.bytes[3],
-			 pSapEvent->sapevt.sapMaxAssocExceeded.macaddr.bytes[4],
-			 pSapEvent->sapevt.sapMaxAssocExceeded.macaddr.
-			 bytes[5]);
-		we_event = IWEVCUSTOM;  /* Discovered a new node (AP mode). */
-		wrqu.data.pointer = maxAssocExceededEvent;
-		wrqu.data.length = strlen(maxAssocExceededEvent);
-		we_custom_event_generic = (uint8_t *) maxAssocExceededEvent;
-		hddLog(LOG1, "%s", maxAssocExceededEvent);
-		break;
-	case eSAP_STA_ASSOC_IND:
-		return CDF_STATUS_SUCCESS;
-
-	case eSAP_DISCONNECT_ALL_P2P_CLIENT:
-		hddLog(LOG1, FL(" Disconnecting all the P2P Clients...."));
-		hdd_clear_all_sta(pHostapdAdapter, usrDataForCallback);
-		return CDF_STATUS_SUCCESS;
-
-	case eSAP_MAC_TRIG_STOP_BSS_EVENT:
-		cdf_status =
-			hdd_stop_bss_link(pHostapdAdapter, usrDataForCallback);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOGW, FL("hdd_stop_bss_link failed %d"),
-			       cdf_status);
-		}
-		return CDF_STATUS_SUCCESS;
-
-	case eSAP_CHANNEL_CHANGE_EVENT:
-		hddLog(LOG1, FL("Received eSAP_CHANNEL_CHANGE_EVENT event"));
-		/* Prevent suspend for new channel */
-		hdd_hostapd_channel_prevent_suspend(pHostapdAdapter,
-					pSapEvent->sapevt.sap_ch_selected.pri_ch);
-		/* Allow suspend for old channel */
-		hdd_hostapd_channel_allow_suspend(pHostapdAdapter,
-					pHddApCtx->operatingChannel);
-		/* SME/PE is already updated for new operation channel. So update
-		* HDD layer also here. This resolves issue in AP-AP mode where
-		* AP1 channel is changed due to RADAR then CAC is going on and
-		* START_BSS on new channel has not come to HDD. At this case if
-		* AP2 is start it needs current operation channel for MCC DFS
-		* restiction
-		*/
-		pHddApCtx->operatingChannel =
-			pSapEvent->sapevt.sap_ch_selected.pri_ch;
-		pHddApCtx->sapConfig.acs_cfg.pri_ch =
-			pSapEvent->sapevt.sap_ch_selected.pri_ch;
-		pHddApCtx->sapConfig.acs_cfg.ht_sec_ch =
-			pSapEvent->sapevt.sap_ch_selected.ht_sec_ch;
-		pHddApCtx->sapConfig.acs_cfg.vht_seg0_center_ch =
-			pSapEvent->sapevt.sap_ch_selected.vht_seg0_center_ch;
-		pHddApCtx->sapConfig.acs_cfg.vht_seg1_center_ch =
-			pSapEvent->sapevt.sap_ch_selected.vht_seg1_center_ch;
-		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 == WLAN_HDD_SOFTAP &&
-						pHddCtx->config->force_sap_acs)
-			return CDF_STATUS_SUCCESS;
-		else
-			return hdd_chan_change_notify(pHostapdAdapter, dev,
-				   pSapEvent->sapevt.sap_ch_selected.pri_ch);
-
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-	case eSAP_ACS_SCAN_SUCCESS_EVENT:
-		pHddCtx->skip_acs_scan_status = eSAP_SKIP_ACS_SCAN;
-		hddLog(LOG1, FL("Reusing Last ACS scan result for %d sec"),
-		       ACS_SCAN_EXPIRY_TIMEOUT_S);
-		cdf_mc_timer_stop(&pHddCtx->skip_acs_scan_timer);
-		cdf_status = cdf_mc_timer_start(&pHddCtx->skip_acs_scan_timer,
-						ACS_SCAN_EXPIRY_TIMEOUT_S *
-						1000);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-			hddLog(LOGE,
-			       FL("Failed to start ACS scan expiry timer"));
-		return CDF_STATUS_SUCCESS;
-#endif
-
-	case eSAP_DFS_NOL_GET:
-		hddLog(LOG1,
-		       FL("Received eSAP_DFS_NOL_GET event"));
-#if defined CONFIG_CNSS
-		/* get the dfs nol from cnss */
-		ret =
-			cnss_wlan_get_dfs_nol(pSapEvent->sapevt.sapDfsNolInfo.
-					      pDfsList,
-					      pSapEvent->sapevt.sapDfsNolInfo.
-					      sDfsList);
-
-		if (ret > 0) {
-			hddLog(LOG2,
-				FL("Get %d bytes of dfs nol from cnss"), ret);
-			return CDF_STATUS_SUCCESS;
-		} else {
-			hddLog(LOG2,
-				FL("No dfs nol entry in CNSS, ret: %d"), ret);
-			return CDF_STATUS_E_FAULT;
-		}
-#else
-		return CDF_STATUS_E_FAILURE;
-#endif
-	case eSAP_DFS_NOL_SET:
-		hddLog(LOG1, FL("Received eSAP_DFS_NOL_SET event"));
-#if defined CONFIG_CNSS
-		/* set the dfs nol to cnss */
-		ret =
-			cnss_wlan_set_dfs_nol(pSapEvent->sapevt.sapDfsNolInfo.
-					      pDfsList,
-					      pSapEvent->sapevt.sapDfsNolInfo.
-					      sDfsList);
-
-		if (ret) {
-			hddLog(LOG2,
-			       FL("Failed to set dfs nol - ret: %d"),
-			       ret);
-		} else {
-			hddLog(LOG2, FL(" Set %d bytes dfs nol to cnss"),
-			       pSapEvent->sapevt.sapDfsNolInfo.sDfsList);
-		}
-#else
-		return CDF_STATUS_E_FAILURE;
-#endif
-		return CDF_STATUS_SUCCESS;
-	case eSAP_ACS_CHANNEL_SELECTED:
-		hddLog(LOG1, FL("ACS Completed for wlan%d"),
-					pHostapdAdapter->dev->ifindex);
-		clear_bit(ACS_PENDING, &pHostapdAdapter->event_flags);
-		clear_bit(ACS_IN_PROGRESS, &pHddCtx->g_event_flags);
-		pHddApCtx->sapConfig.acs_cfg.pri_ch =
-			pSapEvent->sapevt.sap_ch_selected.pri_ch;
-		pHddApCtx->sapConfig.acs_cfg.ht_sec_ch =
-			pSapEvent->sapevt.sap_ch_selected.ht_sec_ch;
-		pHddApCtx->sapConfig.acs_cfg.vht_seg0_center_ch =
-			pSapEvent->sapevt.sap_ch_selected.vht_seg0_center_ch;
-		pHddApCtx->sapConfig.acs_cfg.vht_seg1_center_ch =
-			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);
-		return CDF_STATUS_SUCCESS;
-	case eSAP_ECSA_CHANGE_CHAN_IND:
-		hddLog(LOG1,
-		  FL("Channel change indication from peer for channel %d"),
-				pSapEvent->sapevt.sap_chan_cng_ind.new_chan);
-		if (hdd_softap_set_channel_change(dev,
-			 pSapEvent->sapevt.sap_chan_cng_ind.new_chan,
-			 CH_WIDTH_MAX))
-			return CDF_STATUS_E_FAILURE;
-		else
-			return CDF_STATUS_SUCCESS;
-
-	default:
-		hddLog(LOG1, "SAP message is not handled");
-		goto stopbss;
-		return CDF_STATUS_SUCCESS;
-	}
-	wireless_send_event(dev, we_event, &wrqu,
-			    (char *)we_custom_event_generic);
-	return CDF_STATUS_SUCCESS;
-
-stopbss:
-	{
-		uint8_t we_custom_event[64];
-		char *stopBssEvent = "STOP-BSS.response";       /* 17 */
-		int event_len = strlen(stopBssEvent);
-
-		hddLog(LOG1, FL("BSS stop status = %s"),
-		       pSapEvent->sapevt.sapStopBssCompleteEvent.status ?
-		       "eSAP_STATUS_FAILURE" : "eSAP_STATUS_SUCCESS");
-
-		/* Change the BSS state now since, as we are shutting things down,
-		 * we don't want interfaces to become re-enabled */
-		pHostapdState->bssState = BSS_STOP;
-
-		if (0 !=
-		    (WLAN_HDD_GET_CTX(pHostapdAdapter))->config->
-		    nAPAutoShutOff) {
-			if (CDF_TIMER_STATE_RUNNING ==
-			    pHddApCtx->hdd_ap_inactivity_timer.state) {
-				cdf_status =
-					cdf_mc_timer_stop(&pHddApCtx->
-							  hdd_ap_inactivity_timer);
-				if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-					hddLog(LOGE,
-					       FL("Failed to stop AP inactivity timer"));
-				}
-			}
-
-			cdf_status =
-				cdf_mc_timer_destroy(&pHddApCtx->
-						hdd_ap_inactivity_timer);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-				hddLog(LOGE, FL("Failed to Destroy AP inactivity timer"));
-		}
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-		wlan_hdd_auto_shutdown_enable(pHddCtx, true);
-#endif
-
-		/* Stop the pkts from n/w stack as we are going to free all of
-		 * the TX WMM queues for all STAID's */
-		hdd_hostapd_stop(dev);
-
-		/* reclaim all resources allocated to the BSS */
-		cdf_status = hdd_softap_stop_bss(pHostapdAdapter);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOGW,
-			       FL("hdd_softap_stop_bss failed %d"),
-			       cdf_status);
-		}
-
-		/* once the event is set, structure dev/pHostapdAdapter should
-		 * not be touched since they are now subject to being deleted
-		 * by another thread */
-		if (eSAP_STOP_BSS_EVENT == sapEvent)
-			cdf_event_set(&pHostapdState->cdf_stop_bss_event);
-
-		/* notify userspace that the BSS has stopped */
-		memset(&we_custom_event, '\0', sizeof(we_custom_event));
-		memcpy(&we_custom_event, stopBssEvent, event_len);
-		memset(&wrqu, 0, sizeof(wrqu));
-		wrqu.data.length = event_len;
-		we_event = IWEVCUSTOM;
-		we_custom_event_generic = we_custom_event;
-		wireless_send_event(dev, we_event, &wrqu,
-				    (char *)we_custom_event_generic);
-		cds_dump_concurrency_info();
-		/* Send SCC/MCC Switching event to IPA */
-		hdd_ipa_send_mcc_scc_msg(pHddCtx, pHddCtx->mcc_mode);
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-int hdd_softap_unpack_ie(tHalHandle halHandle,
-			 eCsrEncryptionType *pEncryptType,
-			 eCsrEncryptionType *mcEncryptType,
-			 eCsrAuthType *pAuthType,
-			 bool *pMFPCapable,
-			 bool *pMFPRequired,
-			 uint16_t gen_ie_len, uint8_t *gen_ie)
-{
-	tDot11fIERSN dot11RSNIE;
-	tDot11fIEWPA dot11WPAIE;
-
-	uint8_t *pRsnIe;
-	uint16_t RSNIeLen;
-
-	if (NULL == halHandle) {
-		hddLog(LOGE, FL("Error haHandle returned NULL"));
-		return -EINVAL;
-	}
-	/* Validity checks */
-	if ((gen_ie_len < CDF_MIN(DOT11F_IE_RSN_MIN_LEN, DOT11F_IE_WPA_MIN_LEN))
-	    || (gen_ie_len >
-		CDF_MAX(DOT11F_IE_RSN_MAX_LEN, DOT11F_IE_WPA_MAX_LEN)))
-		return -EINVAL;
-	/* Type check */
-	if (gen_ie[0] == DOT11F_EID_RSN) {
-		/* Validity checks */
-		if ((gen_ie_len < DOT11F_IE_RSN_MIN_LEN) ||
-		    (gen_ie_len > DOT11F_IE_RSN_MAX_LEN)) {
-			return CDF_STATUS_E_FAILURE;
-		}
-		/* Skip past the EID byte and length byte */
-		pRsnIe = gen_ie + 2;
-		RSNIeLen = gen_ie_len - 2;
-		/* Unpack the RSN IE */
-		memset(&dot11RSNIE, 0, sizeof(tDot11fIERSN));
-		dot11f_unpack_ie_rsn((tpAniSirGlobal) halHandle,
-				     pRsnIe, RSNIeLen, &dot11RSNIE);
-		/* Copy out the encryption and authentication types */
-		hddLog(LOG1, FL("pairwise cipher suite count: %d"),
-		       dot11RSNIE.pwise_cipher_suite_count);
-		hddLog(LOG1, FL("authentication suite count: %d"),
-		       dot11RSNIE.akm_suite_count);
-		/*Here we have followed the apple base code,
-		   but probably I suspect we can do something different */
-		/* dot11RSNIE.akm_suite_count */
-		/* Just translate the FIRST one */
-		*pAuthType =
-			hdd_translate_rsn_to_csr_auth_type(dot11RSNIE.akm_suites[0]);
-		/* dot11RSNIE.pwise_cipher_suite_count */
-		*pEncryptType =
-			hdd_translate_rsn_to_csr_encryption_type(dot11RSNIE.
-								 pwise_cipher_suites[0]);
-		/* dot11RSNIE.gp_cipher_suite_count */
-		*mcEncryptType =
-			hdd_translate_rsn_to_csr_encryption_type(dot11RSNIE.
-								 gp_cipher_suite);
-		/* Set the PMKSA ID Cache for this interface */
-		*pMFPCapable = 0 != (dot11RSNIE.RSN_Cap[0] & 0x80);
-		*pMFPRequired = 0 != (dot11RSNIE.RSN_Cap[0] & 0x40);
-		/* Calling csr_roam_set_pmkid_cache to configure the PMKIDs into the cache */
-	} else if (gen_ie[0] == DOT11F_EID_WPA) {
-		/* Validity checks */
-		if ((gen_ie_len < DOT11F_IE_WPA_MIN_LEN) ||
-		    (gen_ie_len > DOT11F_IE_WPA_MAX_LEN)) {
-			return CDF_STATUS_E_FAILURE;
-		}
-		/* Skip past the EID byte and length byte - and four byte WiFi OUI */
-		pRsnIe = gen_ie + 2 + 4;
-		RSNIeLen = gen_ie_len - (2 + 4);
-		/* Unpack the WPA IE */
-		memset(&dot11WPAIE, 0, sizeof(tDot11fIEWPA));
-		dot11f_unpack_ie_wpa((tpAniSirGlobal) halHandle,
-				     pRsnIe, RSNIeLen, &dot11WPAIE);
-		/* Copy out the encryption and authentication types */
-		hddLog(LOG1, FL("WPA unicast cipher suite count: %d"),
-		       dot11WPAIE.unicast_cipher_count);
-		hddLog(LOG1, FL("WPA authentication suite count: %d"),
-		       dot11WPAIE.auth_suite_count);
-		/* dot11WPAIE.auth_suite_count */
-		/* Just translate the FIRST one */
-		*pAuthType =
-			hdd_translate_wpa_to_csr_auth_type(dot11WPAIE.auth_suites[0]);
-		/* dot11WPAIE.unicast_cipher_count */
-		*pEncryptType =
-			hdd_translate_wpa_to_csr_encryption_type(dot11WPAIE.
-								 unicast_ciphers[0]);
-		/* dot11WPAIE.unicast_cipher_count */
-		*mcEncryptType =
-			hdd_translate_wpa_to_csr_encryption_type(dot11WPAIE.
-								 multicast_cipher);
-		*pMFPCapable = false;
-		*pMFPRequired = false;
-	} else {
-		hddLog(LOGW, FL("gen_ie[0]: %d"), gen_ie[0]);
-		return CDF_STATUS_E_FAILURE;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_softap_set_channel_change() -
- * This function to support SAP channel change with CSA IE
- * set in the beacons.
- *
- * @dev: pointer to the net device.
- * @target_channel: target channel number.
- * @target_bw: Target bandwidth to move.
- * If no bandwidth is specified, the value is CH_WIDTH_MAX
- *
- * Return: 0 for success, non zero for failure
- */
-int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
-				 phy_ch_width target_bw)
-{
-	CDF_STATUS status;
-	int ret = 0;
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_context_t *pHddCtx = NULL;
-	hdd_adapter_t *sta_adapter;
-	hdd_station_ctx_t *sta_ctx;
-
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t p_cds_context =
-		(WLAN_HDD_GET_CTX(pHostapdAdapter))->pcds_context;
-#endif
-
-	pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (ret) {
-		hddLog(LOGE, FL("invalid HDD context"));
-		return ret;
-	}
-
-	ret = hdd_validate_channel_and_bandwidth(pHostapdAdapter,
-						target_channel, target_bw);
-	if (ret) {
-		hdd_err("Invalid CH and BW combo");
-		return ret;
-	}
-
-	sta_adapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION);
-	/*
-	 * conc_custom_rule1:
-	 * Force SCC for SAP + STA
-	 * if STA is already connected then we shouldn't allow
-	 * channel switch in SAP interface.
-	 */
-	if (sta_adapter && pHddCtx->config->conc_custom_rule1) {
-		sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(sta_adapter);
-		if (hdd_conn_is_connected(sta_ctx)) {
-			hdd_err("Channel switch not allowed after STA connection with conc_custom_rule1 enabled");
-			return -EBUSY;
-		}
-	}
-
-	mutex_lock(&pHddCtx->dfs_lock);
-	if (pHddCtx->dfs_radar_found == true) {
-		mutex_unlock(&pHddCtx->dfs_lock);
-		hddLog(LOGE, FL("Channel switch in progress!!"));
-		return -EBUSY;
-	}
-	/*
-	 * Set the dfs_radar_found flag to mimic channel change
-	 * when a radar is found. This will enable synchronizing
-	 * SAP and HDD states similar to that of radar indication.
-	 * Suspend the netif queues to stop queuing Tx frames
-	 * from upper layers.  netif queues will be resumed
-	 * once the channel change is completed and SAP will
-	 * post eSAP_START_BSS_EVENT success event to HDD.
-	 */
-	pHddCtx->dfs_radar_found = true;
-	mutex_unlock(&pHddCtx->dfs_lock);
-	/*
-	 * Post the Channel Change request to SAP.
-	 */
-	status = wlansap_set_channel_change_with_csa(
-#ifdef WLAN_FEATURE_MBSSID
-		WLAN_HDD_GET_SAP_CTX_PTR
-			(pHostapdAdapter),
-#else
-		p_cds_context,
-#endif
-		(uint32_t)
-		target_channel,
-		target_bw);
-
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGE,
-		       FL("SAP set channel failed for channel = %d, bw:%d"),
-		       target_channel, target_bw);
-		/*
-		 * If channel change command fails then clear the
-		 * radar found flag and also restart the netif
-		 * queues.
-		 */
-		mutex_lock(&pHddCtx->dfs_lock);
-		pHddCtx->dfs_radar_found = false;
-		mutex_unlock(&pHddCtx->dfs_lock);
-
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-int
-static __iw_softap_set_ini_cfg(struct net_device *dev,
-			       struct iw_request_info *info,
-			       union iwreq_data *wrqu, char *extra)
-{
-	CDF_STATUS vstatus;
-	int ret = 0;            /* success */
-	hdd_adapter_t *pAdapter = (netdev_priv(dev));
-	hdd_context_t *pHddCtx;
-
-	if (pAdapter == NULL) {
-		hddLog(LOGE, FL("pAdapter is NULL!"));
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (ret != 0) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return ret;
-	}
-
-	hddLog(LOG1, FL("Received data %s"), extra);
-
-	vstatus = hdd_execute_global_config_command(pHddCtx, extra);
-	if (CDF_STATUS_SUCCESS != vstatus) {
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-int
-static iw_softap_set_ini_cfg(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_set_ini_cfg(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-int
-static __iw_softap_get_ini_cfg(struct net_device *dev,
-			       struct iw_request_info *info,
-			       union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	int ret = 0;
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (ret != 0) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return ret;
-	}
-	hddLog(LOG1, FL("Printing CLD global INI Config"));
-	hdd_cfg_get_global_config(pHddCtx, extra, QCSAP_IOCTL_MAX_STR_LEN);
-	wrqu->data.length = strlen(extra) + 1;
-
-	return 0;
-}
-
-int
-static iw_softap_get_ini_cfg(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_get_ini_cfg(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * iw_softap_set_two_ints_getnone() - Generic "set two integer" 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_softap_set_two_ints_getnone(struct net_device *dev,
-					    struct iw_request_info *info,
-					    union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	int ret;
-	int *value = (int *)extra;
-	int sub_cmd = value[0];
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret != 0)
-		goto out;
-
-	switch (sub_cmd) {
-#ifdef DEBUG
-	case QCSAP_IOCTL_SET_FW_CRASH_INJECT:
-		hddLog(LOGE, "WE_SET_FW_CRASH_INJECT: %d %d",
-		       value[1], value[2]);
-		ret = wma_cli_set2_command(adapter->sessionId,
-					   GEN_PARAM_CRASH_INJECT,
-					   value[1], value[2],
-					   GEN_CMD);
-		break;
-#endif
-	case QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL:
-		hdd_info("WE_DUMP_DP_TRACE: %d %d",
-		       value[1], value[2]);
-		if (value[1] == DUMP_DP_TRACE)
-			cdf_dp_trace_dump_all(value[2]);
-		break;
-	case QCSAP_ENABLE_FW_PROFILE:
-		hddLog(LOG1, "QCSAP_ENABLE_FW_PROFILE: %d %d",
-		       value[1], value[2]);
-		ret = wma_cli_set2_command(adapter->sessionId,
-				 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
-					value[1], value[2], DBG_CMD);
-		break;
-	case QCSAP_SET_FW_PROFILE_HIST_INTVL:
-		hddLog(LOG1, "QCSAP_SET_FW_PROFILE_HIST_INTVL: %d %d",
-		       value[1], value[2]);
-		ret = wma_cli_set2_command(adapter->sessionId,
-					WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
-					value[1], value[2], DBG_CMD);
-	default:
-		hddLog(LOGE, FL("Invalid IOCTL command %d"), sub_cmd);
-		break;
-	}
-
-out:
-	return ret;
-}
-
-static int iw_softap_set_two_ints_getnone(struct net_device *dev,
-					  struct iw_request_info *info,
-					  union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_set_two_ints_getnone(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static void print_mac_list(struct cdf_mac_addr *macList, uint8_t size)
-{
-	int i;
-	uint8_t *macArray;
-
-	for (i = 0; i < size; i++) {
-		macArray = (macList + i)->bytes;
-		pr_info("** ACL entry %i - %02x:%02x:%02x:%02x:%02x:%02x \n",
-			i, MAC_ADDR_ARRAY(macArray));
-	}
-	return;
-}
-
-static CDF_STATUS hdd_print_acl(hdd_adapter_t *pHostapdAdapter)
-{
-	eSapMacAddrACL acl_mode;
-	struct cdf_mac_addr MacList[MAX_ACL_MAC_ADDRESS];
-	uint8_t listnum;
-	void *p_cds_gctx = NULL;
-
-#ifdef WLAN_FEATURE_MBSSID
-	p_cds_gctx = WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter);
-#else
-	p_cds_gctx = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pcds_context;
-#endif
-	cdf_mem_zero(&MacList[0], sizeof(MacList));
-	if (CDF_STATUS_SUCCESS == wlansap_get_acl_mode(p_cds_gctx, &acl_mode)) {
-		pr_info("******** ACL MODE *********\n");
-		switch (acl_mode) {
-		case eSAP_ACCEPT_UNLESS_DENIED:
-			pr_info("ACL Mode = ACCEPT_UNLESS_DENIED\n");
-			break;
-		case eSAP_DENY_UNLESS_ACCEPTED:
-			pr_info("ACL Mode = DENY_UNLESS_ACCEPTED\n");
-			break;
-		case eSAP_SUPPORT_ACCEPT_AND_DENY:
-			pr_info("ACL Mode = ACCEPT_AND_DENY\n");
-			break;
-		case eSAP_ALLOW_ALL:
-			pr_info("ACL Mode = ALLOW_ALL\n");
-			break;
-		default:
-			pr_info("Invalid SAP ACL Mode = %d\n", acl_mode);
-			return CDF_STATUS_E_FAILURE;
-		}
-	} else {
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (CDF_STATUS_SUCCESS == wlansap_get_acl_accept_list(p_cds_gctx,
-							      &MacList[0],
-							      &listnum)) {
-		pr_info("******* WHITE LIST ***********\n");
-		if (listnum <= MAX_ACL_MAC_ADDRESS)
-			print_mac_list(&MacList[0], listnum);
-	} else {
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (CDF_STATUS_SUCCESS == wlansap_get_acl_deny_list(p_cds_gctx,
-							    &MacList[0],
-							    &listnum)) {
-		pr_info("******* BLACK LIST ***********\n");
-		if (listnum <= MAX_ACL_MAC_ADDRESS)
-			print_mac_list(&MacList[0], listnum);
-	} else {
-		return CDF_STATUS_E_FAILURE;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-int
-static __iw_softap_setparam(struct net_device *dev,
-			    struct iw_request_info *info,
-			    union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	tHalHandle hHal;
-	int *value = (int *)extra;
-	int sub_cmd = value[0];
-	int set_value = value[1];
-	CDF_STATUS status;
-	int ret = 0;            /* success */
-	v_CONTEXT_t p_cds_context;
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return -EINVAL;
-
-	hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-	if (!hHal) {
-		hddLog(LOGE, FL("Hal ctx is null"));
-		return -EINVAL;
-	}
-
-	p_cds_context = hdd_ctx->pcds_context;
-	if (!p_cds_context) {
-		hddLog(LOGE, FL("cds ctx is null"));
-		return -ENOENT;
-	}
-
-	switch (sub_cmd) {
-	case QCASAP_SET_RADAR_DBG:
-		hddLog(LOG1, FL("QCASAP_SET_RADAR_DBG called with: value: %d"),
-		       set_value);
-		wlan_sap_enable_phy_error_logs(hHal, (bool) set_value);
-		break;
-
-	case QCSAP_PARAM_CLR_ACL:
-		if (CDF_STATUS_SUCCESS != wlansap_clear_acl(
-#ifdef WLAN_FEATURE_MBSSID
-			    WLAN_HDD_GET_SAP_CTX_PTR
-				    (pHostapdAdapter)
-#else
-			    p_cds_context
-#endif
-			    )) {
-			ret = -EIO;
-		}
-		break;
-
-	case QCSAP_PARAM_ACL_MODE:
-		if ((eSAP_ALLOW_ALL < (eSapMacAddrACL) set_value) ||
-		    (eSAP_ACCEPT_UNLESS_DENIED > (eSapMacAddrACL) set_value)) {
-			hddLog(LOGE, FL("Invalid ACL Mode value %d"),
-			       set_value);
-			ret = -EINVAL;
-		} else {
-#ifdef WLAN_FEATURE_MBSSID
-			wlansap_set_mode(WLAN_HDD_GET_SAP_CTX_PTR
-						 (pHostapdAdapter), set_value);
-#else
-			wlansap_set_mode(p_cds_context, set_value);
-#endif
-
-		}
-		break;
-
-	case QCSAP_PARAM_SET_CHANNEL_CHANGE:
-		if ((WLAN_HDD_SOFTAP == pHostapdAdapter->device_mode) ||
-		   (WLAN_HDD_P2P_GO == pHostapdAdapter->device_mode)) {
-			hddLog(LOG1,
-			       "SET Channel Change to new channel= %d",
-			       set_value);
-			ret = hdd_softap_set_channel_change(dev, set_value,
-								CH_WIDTH_MAX);
-		} else {
-			hddLog(LOGE,
-			       FL("Channel Change Failed, Device in test mode"));
-			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_MAX_ASSOC:
-		if (WNI_CFG_ASSOC_STA_LIMIT_STAMIN > set_value) {
-			hddLog(LOGE, FL("Invalid setMaxAssoc value %d"),
-			       set_value);
-			ret = -EINVAL;
-		} else {
-			if (WNI_CFG_ASSOC_STA_LIMIT_STAMAX < set_value) {
-				hddLog(LOGW,
-				       FL("setMaxAssoc %d > max allowed %d."),
-				       set_value,
-				       WNI_CFG_ASSOC_STA_LIMIT_STAMAX);
-				hddLog(LOGW,
-				       FL("Setting it to max allowed and continuing"));
-				set_value = WNI_CFG_ASSOC_STA_LIMIT_STAMAX;
-			}
-			status = sme_cfg_set_int(hHal, WNI_CFG_ASSOC_STA_LIMIT,
-					set_value);
-			if (status != CDF_STATUS_SUCCESS) {
-				hddLog(LOGE,
-				       FL("setMaxAssoc failure, status %d"),
-				       status);
-				ret = -EIO;
-			}
-		}
-		break;
-
-	case QCSAP_PARAM_HIDE_SSID:
-	{
-		CDF_STATUS status = CDF_STATUS_SUCCESS;
-		status =
-			sme_hide_ssid(hHal, pHostapdAdapter->sessionId,
-				      set_value);
-		if (CDF_STATUS_SUCCESS != status) {
-			hddLog(LOGE, FL("QCSAP_PARAM_HIDE_SSID failed"));
-			return status;
-		}
-		break;
-	}
-	case QCSAP_PARAM_SET_MC_RATE:
-	{
-		tSirRateUpdateInd rateUpdate = {0};
-		struct hdd_config *pConfig = hdd_ctx->config;
-
-		hddLog(LOG1, "MC Target rate %d", set_value);
-		cdf_copy_macaddr(&rateUpdate.bssid,
-				 &pHostapdAdapter->macAddressCurrent);
-		rateUpdate.nss = (pConfig->enable2x2 == 0) ? 0 : 1;
-		rateUpdate.dev_mode = pHostapdAdapter->device_mode;
-		rateUpdate.mcastDataRate24GHz = set_value;
-		rateUpdate.mcastDataRate24GHzTxFlag = 1;
-		rateUpdate.mcastDataRate5GHz = set_value;
-		rateUpdate.bcastDataRate = -1;
-		status = sme_send_rate_update_ind(hHal, &rateUpdate);
-		if (CDF_STATUS_SUCCESS != status) {
-			hddLog(LOGE, FL("SET_MC_RATE failed"));
-			ret = -1;
-		}
-		break;
-	}
-
-	case QCSAP_PARAM_SET_TXRX_FW_STATS:
-	{
-		hddLog(LOG1, "QCSAP_PARAM_SET_TXRX_FW_STATS val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMA_VDEV_TXRX_FWSTATS_ENABLE_CMDID,
-					  set_value, VDEV_CMD);
-		break;
-	}
-	/* Firmware debug log */
-	case QCSAP_DBGLOG_LOG_LEVEL:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_LOG_LEVEL val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_LOG_LEVEL,
-					  set_value, DBG_CMD);
-		break;
-	}
-
-	case QCSAP_DBGLOG_VAP_ENABLE:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_VAP_ENABLE val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_VAP_ENABLE,
-					  set_value, DBG_CMD);
-		break;
-	}
-
-	case QCSAP_DBGLOG_VAP_DISABLE:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_VAP_DISABLE val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_VAP_DISABLE,
-					  set_value, DBG_CMD);
-		break;
-	}
-
-	case QCSAP_DBGLOG_MODULE_ENABLE:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_MODULE_ENABLE val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_MODULE_ENABLE,
-					  set_value, DBG_CMD);
-		break;
-	}
-
-	case QCSAP_DBGLOG_MODULE_DISABLE:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_MODULE_DISABLE val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_MODULE_DISABLE,
-					  set_value, DBG_CMD);
-		break;
-	}
-
-	case QCSAP_DBGLOG_MOD_LOG_LEVEL:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_MOD_LOG_LEVEL val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_MOD_LOG_LEVEL,
-					  set_value, DBG_CMD);
-		break;
-	}
-
-	case QCSAP_DBGLOG_TYPE:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_TYPE val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_TYPE,
-					  set_value, DBG_CMD);
-		break;
-	}
-	case QCSAP_DBGLOG_REPORT_ENABLE:
-	{
-		hddLog(LOG1, "QCSAP_DBGLOG_REPORT_ENABLE val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_DBGLOG_REPORT_ENABLE,
-					  set_value, DBG_CMD);
-		break;
-	}
-	case QCSAP_PARAM_SET_MCC_CHANNEL_LATENCY:
-	{
-		cds_set_mcc_latency(pHostapdAdapter, set_value);
-		break;
-	}
-
-	case QCSAP_PARAM_SET_MCC_CHANNEL_QUOTA:
-	{
-		hddLog(LOG1,
-		       FL("iwpriv cmd to set MCC quota value %dms"),
-		       set_value);
-		ret = cds_go_set_mcc_p2p_quota(pHostapdAdapter,
-						    set_value);
-		break;
-	}
-
-	case QCASAP_TXRX_FWSTATS_RESET:
-	{
-		hddLog(LOG1, "WE_TXRX_FWSTATS_RESET val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMA_VDEV_TXRX_FWSTATS_RESET_CMDID,
-					  set_value, VDEV_CMD);
-		break;
-	}
-
-	case QCSAP_PARAM_RTSCTS:
-	{
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_ENABLE_RTSCTS,
-					  set_value, VDEV_CMD);
-		if (ret) {
-			hddLog(LOGE, "FAILED TO SET RTSCTS at SAP");
-			ret = -EIO;
-		}
-		break;
-	}
-	case QCASAP_SET_11N_RATE:
-	{
-		uint8_t preamble = 0, nss = 0, rix = 0;
-		tsap_Config_t *pConfig =
-			&pHostapdAdapter->sessionCtx.ap.sapConfig;
-
-		hddLog(LOG1, "SET_HT_RATE val %d", set_value);
-
-		if (set_value != 0xff) {
-			rix = RC_2_RATE_IDX(set_value);
-			if (set_value & 0x80) {
-				if (pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11b
-				    || pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11b_ONLY
-				    || pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11g
-				    || pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11g_ONLY
-				    || pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_abg
-				    || pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11a) {
-					hddLog(LOGE,
-					       "Not valid mode for HT");
-					ret = -EIO;
-					break;
-				}
-				preamble = WMI_RATE_PREAMBLE_HT;
-				nss = HT_RC_2_STREAMS(set_value) - 1;
-			} else if (set_value & 0x10) {
-				if (pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11a) {
-					hddLog(LOGE, "Not valid for cck");
-					ret = -EIO;
-					break;
-				}
-				preamble = WMI_RATE_PREAMBLE_CCK;
-				/* Enable Short preamble always
-				 * for CCK except 1mbps
-				 */
-				if (rix != 0x3)
-					rix |= 0x4;
-			} else {
-				if (pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11b
-				    || pConfig->SapHw_mode ==
-				    eCSR_DOT11_MODE_11b_ONLY) {
-					hddLog(LOGE, "Not valid for OFDM");
-					ret = -EIO;
-					break;
-				}
-				preamble = WMI_RATE_PREAMBLE_OFDM;
-			}
-			set_value = (preamble << 6) | (nss << 4) | rix;
-		}
-		hddLog(LOG1, "SET_HT_RATE val %d rix %d preamble %x nss %d",
-		       set_value, rix, preamble, nss);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_FIXED_RATE,
-					  set_value, VDEV_CMD);
-		break;
-	}
-
-	case QCASAP_SET_VHT_RATE:
-	{
-		uint8_t preamble = 0, nss = 0, rix = 0;
-		tsap_Config_t *pConfig =
-			&pHostapdAdapter->sessionCtx.ap.sapConfig;
-
-		if (pConfig->SapHw_mode != eCSR_DOT11_MODE_11ac &&
-		    pConfig->SapHw_mode != eCSR_DOT11_MODE_11ac_ONLY) {
-			hddLog(LOGE,
-			       FL("SET_VHT_RATE error: SapHw_mode= 0x%x, ch = %d"),
-			       pConfig->SapHw_mode, pConfig->channel);
-			ret = -EIO;
-			break;
-		}
-
-		if (set_value != 0xff) {
-		rix = RC_2_RATE_IDX_11AC(set_value);
-		preamble = WMI_RATE_PREAMBLE_VHT;
-		nss = HT_RC_2_STREAMS_11AC(set_value) - 1;
-
-			set_value = (preamble << 6) | (nss << 4) | rix;
-		}
-		hddLog(LOG1, "SET_VHT_RATE val %d rix %d preamble %x nss %d",
-		       set_value, rix, preamble, nss);
-
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_FIXED_RATE,
-					  set_value, VDEV_CMD);
-		break;
-	}
-
-	case QCASAP_SHORT_GI:
-	{
-		hddLog(LOG1, "QCASAP_SET_SHORT_GI val %d", set_value);
-
-		/* same as 40MHZ */
-		ret = sme_update_ht_config(hHal, pHostapdAdapter->sessionId,
-					   WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ,
-					   set_value);
-		if (ret)
-			hddLog(LOGE,
-			       "Failed to set ShortGI value ret(%d)", ret);
-		break;
-	}
-
-	case QCSAP_SET_AMPDU:
-	{
-		hddLog(LOG1, "QCSAP_SET_AMPDU %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  GEN_VDEV_PARAM_AMPDU,
-					  set_value, GEN_CMD);
-		break;
-	}
-
-	case QCSAP_SET_AMSDU:
-	{
-		hddLog(LOG1, "QCSAP_SET_AMSDU %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  GEN_VDEV_PARAM_AMSDU,
-					  set_value, GEN_CMD);
-		break;
-	}
-	case QCSAP_GTX_HT_MCS:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_HT_MCS %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_HT_MCS,
-					  set_value, GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_VHT_MCS:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_VHT_MCS %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_VHT_MCS,
-						set_value, GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_USRCFG:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_USR_CFG %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_USR_CFG,
-					  set_value, GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_THRE:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_THRE %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_THRE,
-					  set_value, GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_MARGIN:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_MARGIN %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_MARGIN,
-					  set_value, GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_STEP:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_STEP %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_STEP,
-					  set_value, GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_MINTPC:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_MINTPC %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_MINTPC,
-					  set_value, GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_BWMASK:
-	{
-		hddLog(LOG1, "WMI_VDEV_PARAM_GTX_BWMASK %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_GTX_BW_MASK,
-					  set_value, GTX_CMD);
-		break;
-	}
-
-#ifdef QCA_PKT_PROTO_TRACE
-	case QCASAP_SET_DEBUG_LOG:
-	{
-		hdd_context_t *pHddCtx =
-			WLAN_HDD_GET_CTX(pHostapdAdapter);
-
-		hddLog(LOG1, "QCASAP_SET_DEBUG_LOG val %d", set_value);
-		/* Trace buffer dump only */
-		if (CDS_PKT_TRAC_DUMP_CMD == set_value) {
-			cds_pkt_trace_buf_dump();
-			break;
-		}
-		pHddCtx->config->gEnableDebugLog = set_value;
-		break;
-	}
-#endif /* QCA_PKT_PROTO_TRACE */
-
-	case QCASAP_SET_TM_LEVEL:
-	{
-		hddLog(LOG1, "Set Thermal Mitigation Level %d", set_value);
-		(void)sme_set_thermal_level(hHal, set_value);
-		break;
-	}
-
-	case QCASAP_SET_DFS_IGNORE_CAC:
-	{
-		hddLog(LOG1, "Set Dfs ignore CAC  %d", set_value);
-
-		if (pHostapdAdapter->device_mode != WLAN_HDD_SOFTAP)
-			return -EINVAL;
-
-		ret = wlansap_set_dfs_ignore_cac(hHal, set_value);
-		break;
-	}
-
-	case QCASAP_SET_DFS_TARGET_CHNL:
-	{
-		hddLog(LOG1, "Set Dfs target channel  %d", set_value);
-
-		if (pHostapdAdapter->device_mode != WLAN_HDD_SOFTAP)
-			return -EINVAL;
-
-		ret = wlansap_set_dfs_target_chnl(hHal, set_value);
-		break;
-	}
-
-	case QCASAP_SET_DFS_NOL:
-		wlansap_set_dfs_nol(
-#ifdef WLAN_FEATURE_MBSSID
-			WLAN_HDD_GET_SAP_CTX_PTR
-				(pHostapdAdapter),
-#else
-			p_cds_context,
-#endif
-			(eSapDfsNolType) set_value);
-		break;
-
-	case QCASAP_SET_RADAR_CMD:
-	{
-		hdd_context_t *pHddCtx =
-			WLAN_HDD_GET_CTX(pHostapdAdapter);
-		uint8_t ch =
-			(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->
-			operatingChannel;
-		bool isDfsch;
-
-		isDfsch = (CHANNEL_STATE_DFS ==
-			   cds_get_channel_state(ch));
-
-		hddLog(LOG1, FL("Set QCASAP_SET_RADAR_CMD val %d"), set_value);
-
-		if (!pHddCtx->dfs_radar_found && isDfsch) {
-			ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-						  WMA_VDEV_DFS_CONTROL_CMDID,
-						  set_value, VDEV_CMD);
-		} else {
-			hddLog(LOGE,
-			       FL("Ignore, radar_found: %d,  dfs_channel: %d"),
-			       pHddCtx->dfs_radar_found, isDfsch);
-		}
-		break;
-	}
-	case QCASAP_TX_CHAINMASK_CMD:
-	{
-		hddLog(LOG1, "QCASAP_TX_CHAINMASK_CMD val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_PDEV_PARAM_TX_CHAIN_MASK,
-					  set_value, PDEV_CMD);
-		break;
-	}
-
-	case QCASAP_RX_CHAINMASK_CMD:
-	{
-		hddLog(LOG1, "QCASAP_RX_CHAINMASK_CMD val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_PDEV_PARAM_RX_CHAIN_MASK,
-					  set_value, PDEV_CMD);
-		break;
-	}
-
-	case QCASAP_NSS_CMD:
-	{
-		hddLog(LOG1, "QCASAP_NSS_CMD val %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					  WMI_VDEV_PARAM_NSS,
-					  set_value, VDEV_CMD);
-		break;
-	}
-
-	case QCSAP_IPA_UC_STAT:
-	{
-		/* If input value is non-zero get stats */
-		switch (set_value) {
-		case 1:
-			hdd_ipa_uc_stat_request(pHostapdAdapter, set_value);
-			break;
-		case 3:
-			hdd_ipa_uc_rt_debug_host_dump(
-					WLAN_HDD_GET_CTX(pHostapdAdapter));
-			break;
-		default:
-			/* place holder for stats clean up
-			 * Stats clean not implemented yet on firmware and ipa
-			 */
-			break;
-		}
-		return ret;
-	}
-
-	case QCASAP_SET_PHYMODE:
-	{
-		hdd_context_t *phddctx =
-			WLAN_HDD_GET_CTX(pHostapdAdapter);
-
-		ret =
-			wlan_hdd_update_phymode(dev, hHal, set_value,
-						phddctx);
-		break;
-	}
-	case QCASAP_DUMP_STATS:
-	{
-		hddLog(LOG1, "QCASAP_DUMP_STATS val %d", set_value);
-		hdd_wlan_dump_stats(pHostapdAdapter, set_value);
-		break;
-	}
-	case QCASAP_CLEAR_STATS:
-	{
-		hdd_context_t *hdd_ctx =
-			WLAN_HDD_GET_CTX(pHostapdAdapter);
-		hddLog(LOG1, "QCASAP_CLEAR_STATS val %d", set_value);
-		switch (set_value) {
-		case WLAN_HDD_STATS:
-			memset(&pHostapdAdapter->stats, 0,
-						sizeof(pHostapdAdapter->stats));
-			memset(&pHostapdAdapter->hdd_stats, 0,
-					sizeof(pHostapdAdapter->hdd_stats));
-			break;
-		case WLAN_TXRX_HIST_STATS:
-			wlan_hdd_clear_tx_rx_histogram(hdd_ctx);
-			break;
-		case WLAN_HDD_NETIF_OPER_HISTORY:
-			wlan_hdd_clear_netif_queue_history(hdd_ctx);
-			break;
-		default:
-			ol_txrx_clear_stats(set_value);
-		}
-		break;
-	}
-	case QCSAP_START_FW_PROFILING:
-		hddLog(LOG1, "QCSAP_START_FW_PROFILING %d", set_value);
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-					WMI_WLAN_PROFILE_TRIGGER_CMDID,
-					set_value, DBG_CMD);
-		break;
-	default:
-		hddLog(LOGE, FL("Invalid setparam command %d value %d"),
-		       sub_cmd, set_value);
-		ret = -EINVAL;
-		break;
-	}
-	EXIT();
-	return ret;
-}
-
-int
-static iw_softap_setparam(struct net_device *dev,
-			  struct iw_request_info *info,
-			  union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_setparam(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-int
-static __iw_softap_getparam(struct net_device *dev,
-			    struct iw_request_info *info,
-			    union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-	int *value = (int *)extra;
-	int sub_cmd = value[0];
-	CDF_STATUS status;
-	int ret;
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	switch (sub_cmd) {
-	case QCSAP_PARAM_MAX_ASSOC:
-		status =
-			sme_cfg_get_int(hHal, WNI_CFG_ASSOC_STA_LIMIT,
-					(uint32_t *) value);
-		if (CDF_STATUS_SUCCESS != status) {
-			hddLog(LOGE,
-			       FL("failed to get WNI_CFG_ASSOC_STA_LIMIT from cfg %d"),
-			       status);
-			ret = -EIO;
-		}
-		break;
-
-	case QCSAP_PARAM_AUTO_CHANNEL:
-		*value = (WLAN_HDD_GET_CTX
-			(pHostapdAdapter))->config->force_sap_acs;
-		break;
-
-	case QCSAP_PARAM_GET_WLAN_DBG:
-	{
-		cdf_trace_display();
-		*value = 0;
-		break;
-	}
-
-	case QCSAP_PARAM_RTSCTS:
-	{
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_ENABLE_RTSCTS,
-					     VDEV_CMD);
-		break;
-	}
-
-	case QCASAP_SHORT_GI:
-	{
-		*value = (int)sme_get_ht_config(hHal,
-						pHostapdAdapter->
-						sessionId,
-						WNI_CFG_HT_CAP_INFO_SHORT_GI_20MHZ);
-		break;
-	}
-
-	case QCSAP_GTX_HT_MCS:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_HT_MCS");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_HT_MCS,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_VHT_MCS:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_VHT_MCS");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_VHT_MCS,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_USRCFG:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_USR_CFG");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_USR_CFG,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_THRE:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_THRE");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_THRE,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_MARGIN:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_MARGIN");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_MARGIN,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_STEP:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_STEP");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_STEP,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_MINTPC:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_MINTPC");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_MINTPC,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCSAP_GTX_BWMASK:
-	{
-		hddLog(LOG1, "GET WMI_VDEV_PARAM_GTX_BW_MASK");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_GTX_BW_MASK,
-					     GTX_CMD);
-		break;
-	}
-
-	case QCASAP_GET_DFS_NOL:
-	{
-		wlansap_get_dfs_nol(
-#ifdef WLAN_FEATURE_MBSSID
-			WLAN_HDD_GET_SAP_CTX_PTR
-				(pHostapdAdapter)
-#else
-			pHddCtx->pcds_context
-#endif
-			);
-	}
-	break;
-
-	case QCSAP_GET_ACL:
-	{
-		hddLog(LOG1, FL("QCSAP_GET_ACL"));
-		if (hdd_print_acl(pHostapdAdapter) !=
-		    CDF_STATUS_SUCCESS) {
-			hddLog(LOGE,
-			       FL
-			       ("QCSAP_GET_ACL returned Error: not completed"));
-		}
-		*value = 0;
-		break;
-	}
-
-	case QCASAP_TX_CHAINMASK_CMD:
-	{
-		hddLog(LOG1, "QCASAP_TX_CHAINMASK_CMD");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_PDEV_PARAM_TX_CHAIN_MASK,
-					     PDEV_CMD);
-		break;
-	}
-
-	case QCASAP_RX_CHAINMASK_CMD:
-	{
-		hddLog(LOG1, "QCASAP_RX_CHAINMASK_CMD");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_PDEV_PARAM_RX_CHAIN_MASK,
-					     PDEV_CMD);
-		break;
-	}
-
-	case QCASAP_NSS_CMD:
-	{
-		hddLog(LOG1, "QCASAP_NSS_CMD");
-		*value = wma_cli_get_command(pHostapdAdapter->sessionId,
-					     WMI_VDEV_PARAM_NSS,
-					     VDEV_CMD);
-		break;
-	}
-	case QCASAP_GET_TEMP_CMD:
-	{
-		hddLog(LOG1, "QCASAP_GET_TEMP_CMD");
-		ret = wlan_hdd_get_temperature(pHostapdAdapter, value);
-		break;
-	}
-	case QCSAP_GET_FW_PROFILE_DATA:
-		hddLog(LOG1, "QCSAP_GET_FW_PROFILE_DATA");
-		ret = wma_cli_set_command(pHostapdAdapter->sessionId,
-				WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
-				0, DBG_CMD);
-		break;
-	default:
-		hddLog(LOGE, FL("Invalid getparam command %d"), sub_cmd);
-		ret = -EINVAL;
-		break;
-
-	}
-	EXIT();
-	return ret;
-}
-
-int
-static iw_softap_getparam(struct net_device *dev,
-			  struct iw_request_info *info,
-			  union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_getparam(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/* Usage:
-    BLACK_LIST  = 0
-    WHITE_LIST  = 1
-    ADD MAC = 0
-    REMOVE MAC  = 1
-
-    mac addr will be accepted as a 6 octet mac address with each octet inputted in hex
-    for e.g. 00:0a:f5:11:22:33 will be represented as 0x00 0x0a 0xf5 0x11 0x22 0x33
-    while using this ioctl
-
-    Syntax:
-    iwpriv softap.0 modify_acl
-    <6 octet mac addr> <list type> <cmd type>
-
-    Examples:
-    eg 1. to add a mac addr 00:0a:f5:89:89:90 to the black list
-    iwpriv softap.0 modify_acl 0x00 0x0a 0xf5 0x89 0x89 0x90 0 0
-    eg 2. to delete a mac addr 00:0a:f5:89:89:90 from white list
-    iwpriv softap.0 modify_acl 0x00 0x0a 0xf5 0x89 0x89 0x90 1 1
- */
-static
-int __iw_softap_modify_acl(struct net_device *dev,
-			   struct iw_request_info *info,
-			   union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t cds_ctx;
-#endif
-	uint8_t *value = (uint8_t *) extra;
-	uint8_t pPeerStaMac[CDF_MAC_ADDR_SIZE];
-	int listType, cmd, i;
-	int ret;
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-#ifndef WLAN_FEATURE_MBSSID
-	cds_ctx =  hdd_ctx->pcds_context;
-	if (NULL == cds_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Vos Context is NULL", __func__);
-		return -EINVAL;
-	}
-#endif
-
-	for (i = 0; i < CDF_MAC_ADDR_SIZE; i++)
-		pPeerStaMac[i] = *(value + i);
-
-	listType = (int)(*(value + i));
-	i++;
-	cmd = (int)(*(value + i));
-
-	hddLog(LOG1, FL("Modify ACL mac:" MAC_ADDRESS_STR " type: %d cmd: %d"),
-	       MAC_ADDR_ARRAY(pPeerStaMac), listType, cmd);
-
-#ifdef WLAN_FEATURE_MBSSID
-	cdf_status =
-		wlansap_modify_acl(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter),
-				   pPeerStaMac, (eSapACLType) listType,
-				   (eSapACLCmdType) cmd);
-#else
-	cdf_status =
-		wlansap_modify_acl(p_cds_context, pPeerStaMac,
-				   (eSapACLType) listType, (eSapACLCmdType) cmd);
-#endif
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGE, FL("Modify ACL failed"));
-		ret = -EIO;
-	}
-	EXIT();
-	return ret;
-}
-
-static
-int iw_softap_modify_acl(struct net_device *dev,
-			 struct iw_request_info *info,
-			 union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_modify_acl(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-int
-static __iw_softap_getchannel(struct net_device *dev,
-			      struct iw_request_info *info,
-			      union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_context_t *hdd_ctx;
-	int *value = (int *)extra;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	*value = 0;
-	if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags))
-		*value = (WLAN_HDD_GET_AP_CTX_PTR(
-					pHostapdAdapter))->operatingChannel;
-	EXIT();
-	return 0;
-}
-
-int
-static iw_softap_getchannel(struct net_device *dev,
-			    struct iw_request_info *info,
-			    union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_getchannel(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-int
-static __iw_softap_set_max_tx_power(struct net_device *dev,
-				    struct iw_request_info *info,
-				    union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_context_t *hdd_ctx;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-	int *value = (int *)extra;
-	int set_value;
-	int ret;
-	struct cdf_mac_addr bssid = CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-	struct cdf_mac_addr selfMac = CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-
-	ENTER();
-
-	if (NULL == value)
-		return -ENOMEM;
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	/* Assign correct slef MAC address */
-	cdf_copy_macaddr(&bssid, &pHostapdAdapter->macAddressCurrent);
-	cdf_copy_macaddr(&selfMac, &pHostapdAdapter->macAddressCurrent);
-
-	set_value = value[0];
-	if (CDF_STATUS_SUCCESS !=
-	    sme_set_max_tx_power(hHal, bssid, selfMac, set_value)) {
-		hddLog(LOGE, FL("Setting maximum tx power failed"));
-		return -EIO;
-	}
-	EXIT();
-	return 0;
-}
-
-int
-static iw_softap_set_max_tx_power(struct net_device *dev,
-				  struct iw_request_info *info,
-				  union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_set_max_tx_power(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-int
-static __iw_softap_set_tx_power(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-	hdd_context_t *hdd_ctx;
-	int *value = (int *)extra;
-	int set_value;
-	struct cdf_mac_addr bssid;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (NULL == value)
-		return -ENOMEM;
-
-	cdf_copy_macaddr(&bssid, &pHostapdAdapter->macAddressCurrent);
-
-	set_value = value[0];
-	if (CDF_STATUS_SUCCESS !=
-	    sme_set_tx_power(hHal, pHostapdAdapter->sessionId, bssid,
-			     pHostapdAdapter->device_mode, set_value)) {
-		hddLog(LOGE, FL("Setting tx power failed"));
-		return -EIO;
-	}
-	EXIT();
-	return 0;
-}
-
-int
-static iw_softap_set_tx_power(struct net_device *dev,
-			      struct iw_request_info *info,
-			      union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_set_tx_power(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#define IS_BROADCAST_MAC(x) (((x[0] & x[1] & x[2] & x[3] & x[4] & x[5]) == 0xff) ? 1 : 0)
-
-int
-static __iw_softap_getassoc_stamacaddr(struct net_device *dev,
-				       struct iw_request_info *info,
-				       union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_station_info_t *pStaInfo = pHostapdAdapter->aStaInfo;
-	hdd_context_t *hdd_ctx;
-	char *buf;
-	int cnt = 0;
-	int left;
-	int ret;
-	/* maclist_index must be u32 to match userspace */
-	u32 maclist_index;
-
-	ENTER();
-
-	/*
-	 * NOTE WELL: this is a "get" ioctl but it uses an even ioctl
-	 * number, and even numbered iocts are supposed to have "set"
-	 * semantics.  Hence the wireless extensions support in the kernel
-	 * won't correctly copy the result to userspace, so the ioctl
-	 * handler itself must copy the data.  Output format is 32-bit
-	 * record length, followed by 0 or more 6-byte STA MAC addresses.
-	 *
-	 * Further note that due to the incorrect semantics, the "iwpriv"
-	 * userspace application is unable to correctly invoke this API,
-	 * hence it is not registered in the hostapd_private_args.  This
-	 * API can only be invoked by directly invoking the ioctl() system
-	 * call.
-	 */
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	/* make sure userspace allocated a reasonable buffer size */
-	if (wrqu->data.length < sizeof(maclist_index)) {
-		hddLog(LOG1, FL("invalid userspace buffer"));
-		return -EINVAL;
-	}
-
-	/* allocate local buffer to build the response */
-	buf = kmalloc(wrqu->data.length, GFP_KERNEL);
-	if (!buf) {
-		hddLog(LOG1, FL("failed to allocate response buffer"));
-		return -ENOMEM;
-	}
-
-	/* start indexing beyond where the record count will be written */
-	maclist_index = sizeof(maclist_index);
-	left = wrqu->data.length - maclist_index;
-
-	spin_lock_bh(&pHostapdAdapter->staInfo_lock);
-	while ((cnt < WLAN_MAX_STA_COUNT) && (left >= CDF_MAC_ADDR_SIZE)) {
-		if ((pStaInfo[cnt].isUsed) &&
-		    (!IS_BROADCAST_MAC(pStaInfo[cnt].macAddrSTA.bytes))) {
-			memcpy(&buf[maclist_index], &(pStaInfo[cnt].macAddrSTA),
-			       CDF_MAC_ADDR_SIZE);
-			maclist_index += CDF_MAC_ADDR_SIZE;
-			left -= CDF_MAC_ADDR_SIZE;
-		}
-		cnt++;
-	}
-	spin_unlock_bh(&pHostapdAdapter->staInfo_lock);
-
-	*((u32 *) buf) = maclist_index;
-	wrqu->data.length = maclist_index;
-	if (copy_to_user(wrqu->data.pointer, buf, maclist_index)) {
-		hddLog(LOG1, FL("failed to copy response to user buffer"));
-		ret = -EFAULT;
-	}
-	kfree(buf);
-	EXIT();
-	return ret;
-}
-
-int
-static iw_softap_getassoc_stamacaddr(struct net_device *dev,
-				     struct iw_request_info *info,
-				     union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_getassoc_stamacaddr(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/* Usage:
-    mac addr will be accepted as a 6 octet mac address with each octet inputted in hex
-    for e.g. 00:0a:f5:11:22:33 will be represented as 0x00 0x0a 0xf5 0x11 0x22 0x33
-    while using this ioctl
-
-    Syntax:
-    iwpriv softap.0 disassoc_sta <6 octet mac address>
-
-    e.g.
-    disassociate sta with mac addr 00:0a:f5:11:22:33 from softap
-    iwpriv softap.0 disassoc_sta 0x00 0x0a 0xf5 0x11 0x22 0x33
- */
-
-int
-static __iw_softap_disassoc_sta(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_context_t *hdd_ctx;
-	uint8_t *peerMacAddr;
-	int ret;
-
-	ENTER();
-
-	if (!capable(CAP_NET_ADMIN)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			FL("permission check failed"));
-		return -EPERM;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	/* iwpriv tool or framework calls this ioctl with
-	 * data passed in extra (less than 16 octets);
-	 */
-	peerMacAddr = (uint8_t *) (extra);
-
-	hddLog(LOG1, FL("data " MAC_ADDRESS_STR),
-	       MAC_ADDR_ARRAY(peerMacAddr));
-	hdd_softap_sta_disassoc(pHostapdAdapter, peerMacAddr);
-	EXIT();
-	return 0;
-}
-
-int
-static iw_softap_disassoc_sta(struct net_device *dev,
-			      struct iw_request_info *info,
-			      union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_disassoc_sta(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * iw_get_char_setnone() - Generic "get char" private 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_char_setnone(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	int ret;
-	int sub_cmd = wrqu->data.flags;
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret != 0)
-		return ret;
-
-	switch (sub_cmd) {
-	case QCSAP_GET_STATS:
-		hdd_wlan_get_stats(adapter, &(wrqu->data.length),
-					extra, WE_MAX_STR_LEN);
-		break;
-	case QCSAP_LIST_FW_PROFILE:
-		hdd_wlan_list_fw_profile(&(wrqu->data.length),
-					extra, WE_MAX_STR_LEN);
-		break;
-	}
-
-	EXIT();
-	return ret;
-}
-
-static int iw_get_char_setnone(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_char_setnone(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	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;
-
-	if (!capable(CAP_NET_ADMIN)) {
-		hddLog(LOGE, FL("permission check failed"));
-		return -EPERM;
-	}
-
-	if (wlan_hdd_validate_operation_channel(adapter, value[0]) !=
-					 CDF_STATUS_SUCCESS ||
-		wlan_hdd_validate_operation_channel(adapter, value[1]) !=
-					 CDF_STATUS_SUCCESS) {
-		return -EINVAL;
-	} else {
-		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_softap_get_channel_list(struct net_device *dev,
-					struct iw_request_info *info,
-					union iwreq_data *wrqu, char *extra)
-{
-	uint32_t num_channels = 0;
-	uint8_t i = 0;
-	uint8_t bandStartChannel = RF_CHAN_1;
-	uint8_t bandEndChannel = RF_CHAN_184;
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-	tpChannelListInfo channel_list = (tpChannelListInfo) extra;
-	eCsrBand curBand = eCSR_BAND_ALL;
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (CDF_STATUS_SUCCESS != sme_get_freq_band(hHal, &curBand)) {
-		hddLog(LOGE, FL("not able get the current frequency band"));
-		return -EIO;
-	}
-	wrqu->data.length = sizeof(tChannelListInfo);
-	ENTER();
-
-	if (eCSR_BAND_24 == curBand) {
-		bandStartChannel = RF_CHAN_1;
-		bandEndChannel = RF_CHAN_14;
-	} else if (eCSR_BAND_5G == curBand) {
-		bandStartChannel = RF_CHAN_36;
-		bandEndChannel = RF_CHAN_184;
-	}
-
-	hddLog(LOG1, FL("curBand = %d, StartChannel = %hu, EndChannel = %hu "),
-	       curBand, bandStartChannel, bandEndChannel);
-
-	for (i = bandStartChannel; i <= bandEndChannel; i++) {
-		if ((CHANNEL_STATE_ENABLE == CDS_CHANNEL_STATE(i)) ||
-		    (CHANNEL_STATE_DFS == CDS_CHANNEL_STATE(i))) {
-			channel_list->channels[num_channels] =
-				CDS_CHANNEL_NUM(i);
-			num_channels++;
-		}
-	}
-
-	hddLog(LOG1, FL(" number of channels %d"), num_channels);
-
-	if (num_channels > IW_MAX_FREQUENCIES) {
-		num_channels = IW_MAX_FREQUENCIES;
-	}
-
-	channel_list->num_channels = num_channels;
-	EXIT();
-
-	return 0;
-}
-
-int iw_softap_get_channel_list(struct net_device *dev,
-			       struct iw_request_info *info,
-			       union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_get_channel_list(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static
-int __iw_get_genie(struct net_device *dev,
-		   struct iw_request_info *info,
-		   union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_context_t *hdd_ctx;
-	int ret;
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t cds_ctx;
-#endif
-	CDF_STATUS status;
-	uint32_t length = DOT11F_IE_RSN_MAX_LEN;
-	uint8_t genIeBytes[DOT11F_IE_RSN_MAX_LEN];
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-#ifndef WLAN_FEATURE_MBSSID
-	cds_ctx = hdd_ctx->pcds_context;
-	if (NULL == cds_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: vos context is not valid ", __func__);
-		return -EINVAL;
-	}
-#endif
-
-	/*
-	 * Actually retrieve the RSN IE from CSR.
-	 * (We previously sent it down in the CSR Roam Profile.)
-	 */
-	status = wlan_sap_getstation_ie_information(
-#ifdef WLAN_FEATURE_MBSSID
-		WLAN_HDD_GET_SAP_CTX_PTR
-			(pHostapdAdapter),
-#else
-		cds_ctx,
-#endif
-		&length, genIeBytes);
-	if (status == CDF_STATUS_SUCCESS) {
-		length = CDF_MIN(length, DOT11F_IE_RSN_MAX_LEN);
-		if (wrqu->data.length < length ||
-		copy_to_user(wrqu->data.pointer, (void *)genIeBytes, length)) {
-			hddLog(LOG1, FL("failed to copy data to user buffer"));
-			return -EFAULT;
-		}
-		wrqu->data.length = length;
-		hddLog(LOG1, FL(" RSN IE of %d bytes returned"),
-				wrqu->data.length);
-	} else {
-		wrqu->data.length = 0;
-		hddLog(LOG1, FL(" RSN IE failed to populate"));
-	}
-
-	EXIT();
-	return 0;
-}
-
-static
-int iw_get_genie(struct net_device *dev,
-		 struct iw_request_info *info,
-		 union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_genie(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static
-int __iw_get_wpspbc_probe_req_ies(struct net_device *dev,
-				  struct iw_request_info *info,
-				  union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	sQcSapreq_WPSPBCProbeReqIES_t WPSPBCProbeReqIEs;
-	hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter);
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	hddLog(LOG1, FL("get_WPSPBCProbeReqIEs ioctl"));
-	memset((void *)&WPSPBCProbeReqIEs, 0, sizeof(WPSPBCProbeReqIEs));
-
-	WPSPBCProbeReqIEs.probeReqIELen =
-		pHddApCtx->WPSPBCProbeReq.probeReqIELen;
-	cdf_mem_copy(&WPSPBCProbeReqIEs.probeReqIE,
-		     pHddApCtx->WPSPBCProbeReq.probeReqIE,
-		     WPSPBCProbeReqIEs.probeReqIELen);
-	cdf_copy_macaddr(&WPSPBCProbeReqIEs.macaddr,
-			 &pHddApCtx->WPSPBCProbeReq.peer_macaddr);
-	if (copy_to_user(wrqu->data.pointer,
-			 (void *)&WPSPBCProbeReqIEs,
-			 sizeof(WPSPBCProbeReqIEs))) {
-		hddLog(LOG1, FL("failed to copy data to user buffer"));
-		return -EFAULT;
-	}
-	wrqu->data.length = 12 + WPSPBCProbeReqIEs.probeReqIELen;
-	hdd_info("Macaddress : " MAC_ADDRESS_STR,
-	       MAC_ADDR_ARRAY(WPSPBCProbeReqIEs.macaddr.bytes));
-	up(&pHddApCtx->semWpsPBCOverlapInd);
-	EXIT();
-	return 0;
-}
-
-static
-int iw_get_wpspbc_probe_req_ies(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_wpspbc_probe_req_ies(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_set_auth_hostap() -
- * This function sets the auth type received from the wpa_supplicant.
- *
- * @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_set_auth_hostap(struct net_device *dev, struct iw_request_info *info,
-		       union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	switch (wrqu->param.flags & IW_AUTH_INDEX) {
-	case IW_AUTH_TKIP_COUNTERMEASURES:
-	{
-		if (wrqu->param.value) {
-			hddLog(LOG2,
-			       "Counter Measure started %d", wrqu->param.value);
-			pWextState->mTKIPCounterMeasures =
-				TKIP_COUNTER_MEASURE_STARTED;
-		} else {
-			hddLog(LOG2,
-			       "Counter Measure stopped=%d", wrqu->param.value);
-			pWextState->mTKIPCounterMeasures =
-				TKIP_COUNTER_MEASURE_STOPED;
-		}
-
-		hdd_softap_tkip_mic_fail_counter_measure(pAdapter,
-							 wrqu->param.
-							 value);
-	}
-	break;
-
-	default:
-
-		hddLog(LOGW, FL("called with unsupported auth type %d"),
-		       wrqu->param.flags & IW_AUTH_INDEX);
-		break;
-	}
-
-	EXIT();
-	return 0;
-}
-
-/**
- * iw_set_auth_hostap() - Wrapper function to protect __iw_set_auth_hostap
- *			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_set_auth_hostap(struct net_device *dev,
-			struct iw_request_info *info,
-			union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_auth_hostap(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_set_ap_encodeext() - set ap encode
- *
- * @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_set_ap_encodeext(struct net_device *dev,
-			       struct iw_request_info *info,
-			       union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t cds_ctx;
-#endif
-	hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter);
-	hdd_context_t *hdd_ctx;
-	int ret;
-	CDF_STATUS vstatus;
-	struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
-	int key_index;
-	struct iw_point *encoding = &wrqu->encoding;
-	tCsrRoamSetKey setKey;
-	int i;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-#ifndef WLAN_FEATURE_MBSSID
-	cds_ctx = hdd_ctx->pcds_context;
-	if (NULL == cds_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: pVosContext is NULL", __func__);
-		return -EINVAL;
-	}
-#endif
-
-	key_index = encoding->flags & IW_ENCODE_INDEX;
-
-	if (key_index > 0) {
-		/*Convert from 1-based to 0-based keying */
-		key_index--;
-	}
-	if (!ext->key_len)
-		return ret;
-
-	cdf_mem_zero(&setKey, sizeof(tCsrRoamSetKey));
-
-	setKey.keyId = key_index;
-	setKey.keyLength = ext->key_len;
-
-	if (ext->key_len <= CSR_MAX_KEY_LEN) {
-		cdf_mem_copy(&setKey.Key[0], ext->key, ext->key_len);
-	}
-
-	if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
-		/*Key direction for group is RX only */
-		setKey.keyDirection = eSIR_RX_ONLY;
-		cdf_set_macaddr_broadcast(&setKey.peerMac);
-	} else {
-
-		setKey.keyDirection = eSIR_TX_RX;
-		cdf_mem_copy(setKey.peerMac.bytes, ext->addr.sa_data,
-			     CDF_MAC_ADDR_SIZE);
-	}
-	if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
-		setKey.keyDirection = eSIR_TX_DEFAULT;
-		cdf_mem_copy(setKey.peerMac.bytes, ext->addr.sa_data,
-			     CDF_MAC_ADDR_SIZE);
-	}
-
-	/*For supplicant pae role is zero */
-	setKey.paeRole = 0;
-
-	switch (ext->alg) {
-	case IW_ENCODE_ALG_NONE:
-		setKey.encType = eCSR_ENCRYPT_TYPE_NONE;
-		break;
-
-	case IW_ENCODE_ALG_WEP:
-		setKey.encType =
-			(ext->key_len ==
-			 5) ? eCSR_ENCRYPT_TYPE_WEP40 : eCSR_ENCRYPT_TYPE_WEP104;
-		pHddApCtx->uPrivacy = 1;
-		hddLog(LOG1, FL("uPrivacy=%d"), pHddApCtx->uPrivacy);
-		break;
-
-	case IW_ENCODE_ALG_TKIP:
-	{
-		uint8_t *pKey = &setKey.Key[0];
-
-		setKey.encType = eCSR_ENCRYPT_TYPE_TKIP;
-
-		cdf_mem_zero(pKey, CSR_MAX_KEY_LEN);
-
-		/*Supplicant sends the 32bytes key in this order
-
-		   |--------------|----------|----------|
-		 |   Tk1        |TX-MIC    |  RX Mic  |
-		 |||--------------|----------|----------|
-		   <---16bytes---><--8bytes--><--8bytes-->
-
-		 */
-		/*Sme expects the 32 bytes key to be in the below order
-
-		   |--------------|----------|----------|
-		 |   Tk1        |RX-MIC    |  TX Mic  |
-		 |||--------------|----------|----------|
-		   <---16bytes---><--8bytes--><--8bytes-->
-		 */
-		/* Copy the Temporal Key 1 (TK1) */
-		cdf_mem_copy(pKey, ext->key, 16);
-
-		/*Copy the rx mic first */
-		cdf_mem_copy(&pKey[16], &ext->key[24], 8);
-
-		/*Copy the tx mic */
-		cdf_mem_copy(&pKey[24], &ext->key[16], 8);
-
-	}
-	break;
-
-	case IW_ENCODE_ALG_CCMP:
-		setKey.encType = eCSR_ENCRYPT_TYPE_AES;
-		break;
-
-	default:
-		setKey.encType = eCSR_ENCRYPT_TYPE_NONE;
-		break;
-	}
-
-	hddLog(LOG1, FL(":EncryptionType:%d key_len:%d, KeyId:%d"),
-	       setKey.encType, setKey.keyLength, setKey.keyId);
-	for (i = 0; i < ext->key_len; i++)
-		hddLog(LOG1, "%02x", setKey.Key[i]);
-
-#ifdef WLAN_FEATURE_MBSSID
-	vstatus =
-		wlansap_set_key_sta(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter),
-				    &setKey);
-#else
-	vstatus = wlansap_set_key_sta(cds_ctx, &setKey);
-#endif
-
-	if (vstatus != CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("wlansap_set_key_sta failed, status= %d"),
-		       vstatus);
-		ret = -EINVAL;
-	}
-	EXIT();
-	return ret;
-}
-
-/**
- * iw_set_ap_encodeext() - Wrapper function to protect __iw_set_ap_encodeext
- *			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_set_ap_encodeext(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_ap_encodeext(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_set_ap_mlme() - set ap mlme
- * @dev: pointer to net_device
- * @info: pointer to iw_request_info
- * @wrqu; pointer to iwreq_data
- * @extra: extra
- *
- * Return; 0 on success, error number otherwise
- */
-static int __iw_set_ap_mlme(struct net_device *dev,
-			  struct iw_request_info *info,
-			  union iwreq_data *wrqu, char *extra)
-{
-	return 0;
-}
-
-/**
- * iw_set_ap_mlme() - SSR wrapper for __iw_set_ap_mlme
- * @dev: pointer to net_device
- * @info: pointer to iw_request_info
- * @wrqu; pointer to iwreq_data
- * @extra: extra
- *
- * Return; 0 on success, error number otherwise
- */
-static int iw_set_ap_mlme(struct net_device *dev,
-			  struct iw_request_info *info,
-			  union iwreq_data *wrqu,
-			  char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_ap_mlme(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_get_ap_rts_threshold() - get ap rts threshold
- * @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_ap_rts_threshold(struct net_device *dev,
-				   struct iw_request_info *info,
-				   union iwreq_data *wrqu, char *extra) {
-
-	hdd_adapter_t *pHostapdAdapter = netdev_priv(dev);
-	int ret;
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-	ret = hdd_wlan_get_rts_threshold(pHostapdAdapter, wrqu);
-
-	return ret;
-}
-
-/**
- * iw_get_ap_rts_threshold() - Wrapper function to protect
- *			__iw_get_ap_rts_threshold 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_ap_rts_threshold(struct net_device *dev,
-				   struct iw_request_info *info,
-				   union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_ap_rts_threshold(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_get_ap_frag_threshold() - get ap fragmentation threshold
- * @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_ap_frag_threshold(struct net_device *dev,
-				    struct iw_request_info *info,
-				    union iwreq_data *wrqu, char *extra) {
-
-	hdd_adapter_t *pHostapdAdapter = netdev_priv(dev);
-	hdd_context_t *hdd_ctx;
-	int ret = 0;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	ret = hdd_wlan_get_frag_threshold(pHostapdAdapter, wrqu);
-
-	return ret;
-}
-
-/**
- * iw_get_ap_frag_threshold() - Wrapper function to protect
- *			__iw_get_ap_frag_threshold 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_ap_frag_threshold(struct net_device *dev,
-				    struct iw_request_info *info,
-				    union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_ap_frag_threshold(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_get_ap_freq() - get ap frequency
- * @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_ap_freq(struct net_device *dev,
-			  struct iw_request_info *info, struct iw_freq *fwrq,
-			  char *extra) {
-	uint32_t status = false, channel = 0, freq = 0;
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_context_t *hdd_ctx;
-	tHalHandle hHal;
-	hdd_hostapd_state_t *pHostapdState;
-	hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter);
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
-	hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-
-	if (pHostapdState->bssState == BSS_STOP) {
-		if (sme_cfg_get_int(hHal, WNI_CFG_CURRENT_CHANNEL, &channel)
-		    != CDF_STATUS_SUCCESS) {
-			return -EIO;
-		} else {
-			status = hdd_wlan_get_freq(channel, &freq);
-			if (true == status) {
-				/* Set Exponent parameter as 6 (MHZ) in struct
-				 * iw_freq * iwlist & iwconfig command
-				 * shows frequency into proper
-				 * format (2.412 GHz instead of 246.2 MHz)
-				 */
-				fwrq->m = freq;
-				fwrq->e = MHZ;
-			}
-		}
-	} else {
-		channel = pHddApCtx->operatingChannel;
-		status = hdd_wlan_get_freq(channel, &freq);
-		if (true == status) {
-			/* Set Exponent parameter as 6 (MHZ) in struct iw_freq
-			 * iwlist & iwconfig command shows frequency into proper
-			 * format (2.412 GHz instead of 246.2 MHz)*/
-			fwrq->m = freq;
-			fwrq->e = MHZ;
-		}
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * iw_get_ap_freq() - Wrapper function to protect
- *                    __iw_get_ap_freq 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_ap_freq(struct net_device *dev,
-			  struct iw_request_info *info,
-			  struct iw_freq *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_ap_freq(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	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;
-
-	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_setwpsie(struct net_device *dev,
-		     struct iw_request_info *info,
-		     union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t cds_ctx;
-#endif
-	hdd_hostapd_state_t *pHostapdState;
-	CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS;
-	uint8_t *wps_genie;
-	uint8_t *fwps_genie;
-	uint8_t *pos;
-	tpSap_WPSIE pSap_WPSIe;
-	uint8_t WPSIeType;
-	uint16_t length;
-	struct iw_point s_priv_data;
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	if (!capable(CAP_NET_ADMIN)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			FL("permission check failed"));
-		return -EPERM;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-#ifndef WLAN_FEATURE_MBSSID
-	cds_ctx = hdd_ctx->pcds_context;
-	if (NULL == cds_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: HDD context is not valid ", __func__);
-		return -EINVAL;
-	}
-#endif
-
-	/* helper function to get iwreq_data with compat handling. */
-	if (hdd_priv_get_data(&s_priv_data, wrqu)) {
-		return -EINVAL;
-	}
-
-	if ((NULL == s_priv_data.pointer) ||
-	    (s_priv_data.length < QCSAP_MAX_WSC_IE)) {
-		return -EINVAL;
-	}
-
-	wps_genie = mem_alloc_copy_from_user_helper(s_priv_data.pointer,
-						    s_priv_data.length);
-
-	if (NULL == wps_genie) {
-		hddLog(LOG1, FL("failed to alloc mem and copy data"));
-		return -EFAULT;
-	}
-
-	fwps_genie = wps_genie;
-
-	pSap_WPSIe = cdf_mem_malloc(sizeof(tSap_WPSIE));
-	if (NULL == pSap_WPSIe) {
-		hddLog(LOGE, "CDF unable to allocate memory");
-		kfree(fwps_genie);
-		return -ENOMEM;
-	}
-	cdf_mem_zero(pSap_WPSIe, sizeof(tSap_WPSIE));
-
-	hddLog(LOG1, FL("WPS IE type[0x%X] IE[0x%X], LEN[%d]"),
-		wps_genie[0], wps_genie[1], wps_genie[2]);
-	WPSIeType = wps_genie[0];
-	if (wps_genie[0] == eQC_WPS_BEACON_IE) {
-		pSap_WPSIe->sapWPSIECode = eSAP_WPS_BEACON_IE;
-		wps_genie = wps_genie + 1;
-		switch (wps_genie[0]) {
-		case DOT11F_EID_WPA:
-			if (wps_genie[1] < 2 + 4) {
-				cdf_mem_free(pSap_WPSIe);
-				kfree(fwps_genie);
-				return -EINVAL;
-			} else if (memcmp(&wps_genie[2],
-				   "\x00\x50\xf2\x04", 4) == 0) {
-				hddLog(LOG1, FL("Set WPS BEACON IE(len %d)"),
-				       wps_genie[1] + 2);
-				pos = &wps_genie[6];
-				while (((size_t) pos -
-					(size_t) &wps_genie[6]) <
-				       (wps_genie[1] - 4)) {
-					switch ((uint16_t) (*pos << 8) |
-						*(pos + 1)) {
-					case HDD_WPS_ELEM_VERSION:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.Version =
-							*pos;
-						hddLog(LOG1, "WPS version %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSBeaconIE.Version);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_VER_PRESENT;
-						pos += 1;
-						break;
-
-					case HDD_WPS_ELEM_WPS_STATE:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.wpsState =
-							*pos;
-						hddLog(LOG1, "WPS State %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSBeaconIE.wpsState);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_STATE_PRESENT;
-						pos += 1;
-						break;
-					case HDD_WPS_ELEM_APSETUPLOCK:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						APSetupLocked = *pos;
-						hddLog(LOG1, "AP setup lock %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSBeaconIE.
-						       APSetupLocked);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_APSETUPLOCK_PRESENT;
-						pos += 1;
-						break;
-					case HDD_WPS_ELEM_SELECTEDREGISTRA:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						SelectedRegistra = *pos;
-						hddLog(LOG1,
-						       "Selected Registra %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSBeaconIE.
-						       SelectedRegistra);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_SELECTEDREGISTRA_PRESENT;
-						pos += 1;
-						break;
-					case HDD_WPS_ELEM_DEVICE_PASSWORD_ID:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						DevicePasswordID =
-							(*pos << 8) | *(pos + 1);
-						hddLog(LOG1, "Password ID: %x",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSBeaconIE.
-						       DevicePasswordID);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_DEVICEPASSWORDID_PRESENT;
-						pos += 2;
-						break;
-					case HDD_WPS_ELEM_REGISTRA_CONF_METHODS:
-						pos +=
-							4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						SelectedRegistraCfgMethod =
-							(*pos << 8) | *(pos + 1);
-						hddLog(LOG1,
-						       "Select Registra Config Methods: %x",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSBeaconIE.
-						       SelectedRegistraCfgMethod);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_SELECTEDREGISTRACFGMETHOD_PRESENT;
-						pos += 2;
-						break;
-
-					case HDD_WPS_ELEM_UUID_E:
-						pos += 2;
-						length = *pos << 8 | *(pos + 1);
-						pos += 2;
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSBeaconIE.
-							     UUID_E, pos,
-							     length);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_UUIDE_PRESENT;
-						pos += length;
-						break;
-					case HDD_WPS_ELEM_RF_BANDS:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.RFBand =
-							*pos;
-						hddLog(LOG1, "RF band: %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSBeaconIE.RFBand);
-						pSap_WPSIe->sapwpsie.
-						sapWPSBeaconIE.
-						FieldPresent |=
-							WPS_BEACON_RF_BANDS_PRESENT;
-						pos += 1;
-						break;
-
-					default:
-						hddLog(LOGW,
-						       "UNKNOWN TLV in WPS IE(%x)",
-						       (*pos << 8 |
-							*(pos + 1)));
-						cdf_mem_free(pSap_WPSIe);
-						kfree(fwps_genie);
-						return -EINVAL;
-					}
-				}
-			} else {
-				hddLog(LOGE, FL("WPS IE Mismatch %X"),
-				       wps_genie[0]);
-			}
-			break;
-
-		default:
-			hddLog(LOGE, FL("Set UNKNOWN IE %X"), wps_genie[0]);
-			cdf_mem_free(pSap_WPSIe);
-			kfree(fwps_genie);
-			return 0;
-		}
-	} else if (wps_genie[0] == eQC_WPS_PROBE_RSP_IE) {
-		pSap_WPSIe->sapWPSIECode = eSAP_WPS_PROBE_RSP_IE;
-		wps_genie = wps_genie + 1;
-		switch (wps_genie[0]) {
-		case DOT11F_EID_WPA:
-			if (wps_genie[1] < 2 + 4) {
-				cdf_mem_free(pSap_WPSIe);
-				kfree(fwps_genie);
-				return -EINVAL;
-			} else if (memcmp(&wps_genie[2], "\x00\x50\xf2\x04", 4)
-				   == 0) {
-				hddLog(LOG1, FL("Set WPS PROBE RSP IE(len %d)"),
-				       wps_genie[1] + 2);
-				pos = &wps_genie[6];
-				while (((size_t) pos -
-					(size_t) &wps_genie[6]) <
-				       (wps_genie[1] - 4)) {
-					switch ((uint16_t) (*pos << 8) |
-						*(pos + 1)) {
-					case HDD_WPS_ELEM_VERSION:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.Version =
-							*pos;
-						hddLog(LOG1, "WPS version %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       Version);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_VER_PRESENT;
-						pos += 1;
-						break;
-
-					case HDD_WPS_ELEM_WPS_STATE:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.wpsState =
-							*pos;
-						hddLog(LOG1, "WPS State %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       wpsState);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_STATE_PRESENT;
-						pos += 1;
-						break;
-					case HDD_WPS_ELEM_APSETUPLOCK:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						APSetupLocked = *pos;
-						hddLog(LOG1, "AP setup lock %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       APSetupLocked);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_APSETUPLOCK_PRESENT;
-						pos += 1;
-						break;
-					case HDD_WPS_ELEM_SELECTEDREGISTRA:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						SelectedRegistra = *pos;
-						hddLog(LOG1,
-						       "Selected Registra %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       SelectedRegistra);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_SELECTEDREGISTRA_PRESENT;
-						pos += 1;
-						break;
-					case HDD_WPS_ELEM_DEVICE_PASSWORD_ID:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						DevicePasswordID =
-							(*pos << 8) | *(pos + 1);
-						hddLog(LOG1, "Password ID: %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       DevicePasswordID);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_DEVICEPASSWORDID_PRESENT;
-						pos += 2;
-						break;
-					case HDD_WPS_ELEM_REGISTRA_CONF_METHODS:
-						pos +=
-							4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						SelectedRegistraCfgMethod =
-							(*pos << 8) | *(pos + 1);
-						hddLog(LOG1,
-						       "Select Registra Config Methods: %x",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       SelectedRegistraCfgMethod);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_SELECTEDREGISTRACFGMETHOD_PRESENT;
-						pos += 2;
-						break;
-					case HDD_WPS_ELEM_RSP_TYPE:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						ResponseType = *pos;
-						hddLog(LOG1,
-						       "Config Methods: %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       ResponseType);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_RESPONSETYPE_PRESENT;
-						pos += 1;
-						break;
-					case HDD_WPS_ELEM_UUID_E:
-						pos += 2;
-						length = *pos << 8 | *(pos + 1);
-						pos += 2;
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSProbeRspIE.
-							     UUID_E, pos,
-							     length);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_UUIDE_PRESENT;
-						pos += length;
-						break;
-
-					case HDD_WPS_ELEM_MANUFACTURER:
-						pos += 2;
-						length = *pos << 8 | *(pos + 1);
-						pos += 2;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						Manufacture.num_name =
-							length;
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSProbeRspIE.
-							     Manufacture.name,
-							     pos, length);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_MANUFACTURE_PRESENT;
-						pos += length;
-						break;
-
-					case HDD_WPS_ELEM_MODEL_NAME:
-						pos += 2;
-						length = *pos << 8 | *(pos + 1);
-						pos += 2;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.ModelName.
-						num_text = length;
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSProbeRspIE.
-							     ModelName.text,
-							     pos, length);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_MODELNAME_PRESENT;
-						pos += length;
-						break;
-					case HDD_WPS_ELEM_MODEL_NUM:
-						pos += 2;
-						length = *pos << 8 | *(pos + 1);
-						pos += 2;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						ModelNumber.num_text =
-							length;
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSProbeRspIE.
-							     ModelNumber.text,
-							     pos, length);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_MODELNUMBER_PRESENT;
-						pos += length;
-						break;
-					case HDD_WPS_ELEM_SERIAL_NUM:
-						pos += 2;
-						length = *pos << 8 | *(pos + 1);
-						pos += 2;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						SerialNumber.num_text =
-							length;
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSProbeRspIE.
-							     SerialNumber.text,
-							     pos, length);
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_SERIALNUMBER_PRESENT;
-						pos += length;
-						break;
-					case HDD_WPS_ELEM_PRIMARY_DEVICE_TYPE:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						PrimaryDeviceCategory =
-							(*pos << 8 | *(pos + 1));
-						hddLog(LOG1,
-						       "primary dev category: %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       PrimaryDeviceCategory);
-						pos += 2;
-
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSProbeRspIE.
-							     PrimaryDeviceOUI,
-							     pos,
-							     HDD_WPS_DEVICE_OUI_LEN);
-						hddLog(LOG1,
-						       "primary dev oui: %02x, %02x, %02x, %02x",
-						       pos[0], pos[1], pos[2],
-						       pos[3]);
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						DeviceSubCategory =
-							(*pos << 8 | *(pos + 1));
-						hddLog(LOG1,
-						       "primary dev sub category: %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       DeviceSubCategory);
-						pos += 2;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT;
-						break;
-					case HDD_WPS_ELEM_DEVICE_NAME:
-						pos += 2;
-						length = *pos << 8 | *(pos + 1);
-						pos += 2;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.DeviceName.
-						num_text = length;
-						cdf_mem_copy(pSap_WPSIe->
-							     sapwpsie.
-							     sapWPSProbeRspIE.
-							     DeviceName.text,
-							     pos, length);
-						pos += length;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_DEVICENAME_PRESENT;
-						break;
-					case HDD_WPS_ELEM_CONFIG_METHODS:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						ConfigMethod =
-							(*pos << 8) | *(pos + 1);
-						hddLog(LOG1,
-						       "Config Methods: %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.
-						       SelectedRegistraCfgMethod);
-						pos += 2;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_CONFIGMETHODS_PRESENT;
-						break;
-
-					case HDD_WPS_ELEM_RF_BANDS:
-						pos += 4;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.RFBand =
-							*pos;
-						hddLog(LOG1, "RF band: %d",
-						       pSap_WPSIe->sapwpsie.
-						       sapWPSProbeRspIE.RFBand);
-						pos += 1;
-						pSap_WPSIe->sapwpsie.
-						sapWPSProbeRspIE.
-						FieldPresent |=
-							WPS_PROBRSP_RF_BANDS_PRESENT;
-						break;
-					} /* switch */
-				}
-			} else {
-				hddLog(LOGE,
-				       FL("WPS IE Mismatch %X"), wps_genie[0]);
-			}
-
-		} /* switch */
-	}
-#ifdef WLAN_FEATURE_MBSSID
-	cdf_ret_status =
-		wlansap_set_wps_ie(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter),
-				   pSap_WPSIe);
-#else
-	cdf_ret_status = wlansap_set_wps_ie(p_cds_context, pSap_WPSIe);
-#endif
-	pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
-	if (pHostapdState->bCommit && WPSIeType == eQC_WPS_PROBE_RSP_IE) {
-#ifdef WLAN_FEATURE_MBSSID
-		wlansap_update_wps_ie(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
-#else
-		wlansap_update_wps_ie(p_cds_context);
-#endif
-	}
-
-	cdf_mem_free(pSap_WPSIe);
-	kfree(fwps_genie);
-	EXIT();
-	return cdf_ret_status;
-}
-
-static int iw_softap_setwpsie(struct net_device *dev,
-			      struct iw_request_info *info,
-			      union iwreq_data *wrqu,
-			      char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_setwpsie(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static int
-__iw_softap_stopbss(struct net_device *dev,
-		    struct iw_request_info *info,
-		    union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status)
-		return status;
-
-	if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) {
-		hdd_hostapd_state_t *pHostapdState =
-			WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
-
-		cdf_event_reset(&pHostapdState->cdf_stop_bss_event);
-#ifdef WLAN_FEATURE_MBSSID
-		status =
-			wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
-#else
-		status =
-			wlansap_stop_bss((WLAN_HDD_GET_CTX(pHostapdAdapter))->
-					 pcds_context);
-#endif
-		if (CDF_IS_STATUS_SUCCESS(status)) {
-			status =
-				cdf_wait_single_event(&pHostapdState->
-						      cdf_stop_bss_event,
-						      10000);
-
-			if (!CDF_IS_STATUS_SUCCESS(status)) {
-				hddLog(LOGE,
-				       FL("wait for single_event failed!!"));
-				CDF_ASSERT(0);
-			}
-		}
-		clear_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags);
-		cds_decr_session_set_pcl(pHostapdAdapter->device_mode,
-					     pHostapdAdapter->sessionId);
-	}
-	EXIT();
-	return (status == CDF_STATUS_SUCCESS) ? 0 : -EBUSY;
-}
-
-static int iw_softap_stopbss(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu,
-			     char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_stopbss(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static int
-__iw_softap_version(struct net_device *dev,
-		    struct iw_request_info *info,
-		    union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = netdev_priv(dev);
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	hdd_wlan_get_version(pHostapdAdapter, wrqu, extra);
-	EXIT();
-	return 0;
-}
-
-static int iw_softap_version(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu,
-			     char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_version(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static
-CDF_STATUS hdd_softap_get_sta_info(hdd_adapter_t *pAdapter, uint8_t *pBuf,
-				   int buf_len) {
-	uint8_t i;
-	uint8_t maxSta = 0;
-	int len = 0;
-	const char sta_info_header[] = "staId staAddress";
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	if (NULL == pAdapter) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Adapter is NULL", __func__);
-		return -EINVAL;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	if (0 != wlan_hdd_validate_context(hdd_ctx))
-		return CDF_STATUS_E_FAULT;
-
-	len = scnprintf(pBuf, buf_len, sta_info_header);
-	pBuf += len;
-	buf_len -= len;
-
-	maxSta = hdd_ctx->config->maxNumberOfPeers;
-
-	for (i = 0; i <= maxSta; i++) {
-		if (pAdapter->aStaInfo[i].isUsed) {
-			len =
-				scnprintf(pBuf, buf_len,
-					  "%5d .%02x:%02x:%02x:%02x:%02x:%02x",
-					  pAdapter->aStaInfo[i].ucSTAId,
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[0],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[1],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[2],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[3],
-					  pAdapter->aStaInfo[i].macAddrSTA.bytes[4],
-					  pAdapter->aStaInfo[i].macAddrSTA.
-					  bytes[5]);
-			pBuf += len;
-			buf_len -= len;
-		}
-		if (WE_GET_STA_INFO_SIZE > buf_len) {
-			break;
-		}
-	}
-	EXIT();
-	return CDF_STATUS_SUCCESS;
-}
-
-static int __iw_softap_get_sta_info(struct net_device *dev,
-				    struct iw_request_info *info,
-				    union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = netdev_priv(dev);
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	status =
-		hdd_softap_get_sta_info(pHostapdAdapter, extra,
-					WE_SAP_MAX_STA_INFO);
-
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("Failed to get sta info: %d"), status);
-		return -EINVAL;
-	}
-	wrqu->data.length = strlen(extra);
-	EXIT();
-	return 0;
-}
-
-static int iw_softap_get_sta_info(struct net_device *dev,
-				  struct iw_request_info *info,
-				  union iwreq_data *wrqu,
-				  char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_softap_get_sta_info(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_set_ap_genie() - set ap wpa/rsn ie
- *
- * @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_set_ap_genie(struct net_device *dev,
-			   struct iw_request_info *info,
-			   union iwreq_data *wrqu, char *extra) {
-
-	hdd_adapter_t *pHostapdAdapter = netdev_priv(dev);
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t cds_ctx;
-#endif
-	hdd_context_t *hdd_ctx;
-	CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS;
-	uint8_t *genie = (uint8_t *)extra;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-#ifndef WLAN_FEATURE_MBSSID
-	cds_ctx = hdd_ctx->pcds_context;
-	if (NULL == cds_ctx) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: CDF Context is NULL", __func__);
-		return -EINVAL;
-	}
-#endif
-
-	if (!wrqu->data.length) {
-		EXIT();
-		return 0;
-	}
-
-	switch (genie[0]) {
-	case DOT11F_EID_WPA:
-	case DOT11F_EID_RSN:
-		if ((WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->uPrivacy == 0) {
-			hdd_softap_deregister_bc_sta(pHostapdAdapter);
-			hdd_softap_register_bc_sta(pHostapdAdapter, 1);
-		}
-		(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->uPrivacy = 1;
-#ifdef WLAN_FEATURE_MBSSID
-		cdf_ret_status =
-			wlansap_set_wparsn_ies(WLAN_HDD_GET_SAP_CTX_PTR
-						       (pHostapdAdapter), genie,
-					       wrqu->data.length);
-#else
-		cdf_ret_status =
-			wlansap_set_wparsn_ies(cds_ctx, genie,
-					       wrqu->data.length);
-#endif
-		break;
-
-	default:
-		hddLog(LOGE, FL("Set UNKNOWN IE %X"), genie[0]);
-		cdf_ret_status = 0;
-	}
-
-	EXIT();
-	return cdf_ret_status;
-}
-
-/**
- * iw_set_ap_genie() - Wrapper function to protect __iw_set_ap_genie
- *                      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_set_ap_genie(struct net_device *dev,
-		struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_ap_genie(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static
-int __iw_get_softap_linkspeed(struct net_device *dev,
-			      struct iw_request_info *info,
-			      union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
-	hdd_context_t *hdd_ctx;
-	char *pLinkSpeed = (char *)extra;
-	uint32_t link_speed = 0;
-	int len = sizeof(uint32_t) + 1;
-	struct cdf_mac_addr macAddress;
-	char pmacAddress[MAC_ADDRESS_STR_LEN + 1];
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	int rc, valid, i;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	valid = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != valid)
-		return valid;
-
-	hddLog(LOG1, FL("wrqu->data.length(%d)"), wrqu->data.length);
-
-	if (wrqu->data.length >= MAC_ADDRESS_STR_LEN - 1) {
-		if (copy_from_user((void *)pmacAddress,
-				   wrqu->data.pointer, MAC_ADDRESS_STR_LEN)) {
-			hddLog(LOG1, FL("failed to copy data to user buffer"));
-			return -EFAULT;
-		}
-		pmacAddress[MAC_ADDRESS_STR_LEN] = '\0';
-
-		if (!mac_pton(pmacAddress, macAddress.bytes)) {
-			hddLog(LOGE, FL("String to Hex conversion Failed"));
-			return -EINVAL;
-		}
-	}
-	/* If no mac address is passed and/or its length is less than 17,
-	 * link speed for first connected client will be returned.
-	 */
-	if (wrqu->data.length < 17 || !CDF_IS_STATUS_SUCCESS(status)) {
-		for (i = 0; i < WLAN_MAX_STA_COUNT; i++) {
-			if (pHostapdAdapter->aStaInfo[i].isUsed &&
-			    (!cdf_is_macaddr_broadcast
-				  (&pHostapdAdapter->aStaInfo[i].macAddrSTA))) {
-				cdf_copy_macaddr(
-					&macAddress,
-					&pHostapdAdapter->aStaInfo[i].
-					 macAddrSTA);
-				status = CDF_STATUS_SUCCESS;
-				break;
-			}
-		}
-	}
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("Invalid peer macaddress"));
-		return -EINVAL;
-	}
-	status = wlan_hdd_get_linkspeed_for_peermac(pHostapdAdapter,
-						    macAddress);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, FL("Unable to retrieve SME linkspeed"));
-		return -EINVAL;
-	}
-
-	link_speed = pHostapdAdapter->ls_stats.estLinkSpeed;
-
-	/* linkspeed in units of 500 kbps */
-	link_speed = link_speed / 500;
-	wrqu->data.length = len;
-	rc = snprintf(pLinkSpeed, len, "%u", link_speed);
-	if ((rc < 0) || (rc >= len)) {
-		/* encoding or length error? */
-		hddLog(LOGE, FL("Unable to encode link speed"));
-		return -EIO;
-	}
-	EXIT();
-	return 0;
-}
-
-static int
-iw_get_softap_linkspeed(struct net_device *dev,
-			struct iw_request_info *info,
-			union iwreq_data *wrqu,
-			char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_softap_linkspeed(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const iw_handler hostapd_handler[] = {
-	(iw_handler) NULL,      /* SIOCSIWCOMMIT */
-	(iw_handler) NULL,      /* SIOCGIWNAME */
-	(iw_handler) NULL,      /* SIOCSIWNWID */
-	(iw_handler) NULL,      /* SIOCGIWNWID */
-	(iw_handler) NULL,      /* SIOCSIWFREQ */
-	(iw_handler) iw_get_ap_freq,            /* SIOCGIWFREQ */
-	(iw_handler) NULL,      /* SIOCSIWMODE */
-	(iw_handler) iw_get_mode,       /* SIOCGIWMODE */
-	(iw_handler) NULL,      /* SIOCSIWSENS */
-	(iw_handler) NULL,      /* SIOCGIWSENS */
-	(iw_handler) NULL,      /* SIOCSIWRANGE */
-	(iw_handler) NULL,      /* SIOCGIWRANGE */
-	(iw_handler) NULL,      /* SIOCSIWPRIV */
-	(iw_handler) NULL,      /* SIOCGIWPRIV */
-	(iw_handler) NULL,      /* SIOCSIWSTATS */
-	(iw_handler) NULL,      /* SIOCGIWSTATS */
-	(iw_handler) NULL,      /* SIOCSIWSPY */
-	(iw_handler) NULL,      /* SIOCGIWSPY */
-	(iw_handler) NULL,      /* SIOCSIWTHRSPY */
-	(iw_handler) NULL,      /* SIOCGIWTHRSPY */
-	(iw_handler) NULL,      /* SIOCSIWAP */
-	(iw_handler) NULL,      /* SIOCGIWAP */
-	(iw_handler) iw_set_ap_mlme,            /* SIOCSIWMLME */
-	(iw_handler) NULL,      /* SIOCGIWAPLIST */
-	(iw_handler) NULL,      /* SIOCSIWSCAN */
-	(iw_handler) NULL,      /* SIOCGIWSCAN */
-	(iw_handler) NULL,      /* SIOCSIWESSID */
-	(iw_handler) NULL,      /* SIOCGIWESSID */
-	(iw_handler) NULL,      /* SIOCSIWNICKN */
-	(iw_handler) NULL,      /* SIOCGIWNICKN */
-	(iw_handler) NULL,      /* -- hole -- */
-	(iw_handler) NULL,      /* -- hole -- */
-	(iw_handler) NULL,      /* SIOCSIWRATE */
-	(iw_handler) NULL,      /* SIOCGIWRATE */
-	(iw_handler) NULL,      /* SIOCSIWRTS */
-	(iw_handler) iw_get_ap_rts_threshold,           /* SIOCGIWRTS */
-	(iw_handler) NULL,      /* SIOCSIWFRAG */
-	(iw_handler) iw_get_ap_frag_threshold,          /* SIOCGIWFRAG */
-	(iw_handler) NULL,      /* SIOCSIWTXPOW */
-	(iw_handler) NULL,      /* SIOCGIWTXPOW */
-	(iw_handler) NULL,      /* SIOCSIWRETRY */
-	(iw_handler) NULL,      /* SIOCGIWRETRY */
-	(iw_handler) NULL,      /* SIOCSIWENCODE */
-	(iw_handler) NULL,      /* SIOCGIWENCODE */
-	(iw_handler) NULL,      /* SIOCSIWPOWER */
-	(iw_handler) NULL,      /* SIOCGIWPOWER */
-	(iw_handler) NULL,      /* -- hole -- */
-	(iw_handler) NULL,      /* -- hole -- */
-	(iw_handler) iw_set_ap_genie,           /* SIOCSIWGENIE */
-	(iw_handler) NULL,      /* SIOCGIWGENIE */
-	(iw_handler) iw_set_auth_hostap,        /* SIOCSIWAUTH */
-	(iw_handler) NULL,      /* SIOCGIWAUTH */
-	(iw_handler) iw_set_ap_encodeext,       /* SIOCSIWENCODEEXT */
-	(iw_handler) NULL,      /* SIOCGIWENCODEEXT */
-	(iw_handler) NULL,      /* SIOCSIWPMKSA */
-};
-
-/*
- * Note that the following ioctls were defined with semantics which
- * cannot be handled by the "iwpriv" userspace application and hence
- * they are not included in the hostapd_private_args array
- *     QCSAP_IOCTL_ASSOC_STA_MACADDR
- */
-
-static const struct iw_priv_args hostapd_private_args[] = {
-	{
-		QCSAP_IOCTL_SETPARAM,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setparam"
-	}, {
-		QCSAP_IOCTL_SETPARAM,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, ""
-	}, {
-		QCSAP_PARAM_MAX_ASSOC,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
-		"setMaxAssoc"
-	}, {
-		QCSAP_PARAM_HIDE_SSID,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "hideSSID"
-	}, {
-		QCSAP_PARAM_SET_MC_RATE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setMcRate"
-	},
-	{
-		QCSAP_PARAM_SET_TXRX_FW_STATS,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
-		"txrx_fw_stats"
-	}, {
-		QCSAP_PARAM_SET_MCC_CHANNEL_LATENCY,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
-		"setMccLatency"
-	}, {
-		QCSAP_PARAM_SET_MCC_CHANNEL_QUOTA,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
-		"setMccQuota"
-	}, {
-		QCSAP_PARAM_SET_CHANNEL_CHANGE,
-		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"
-	},
-	/* Sub-cmds DBGLOG specific commands */
-	{
-		QCSAP_DBGLOG_LOG_LEVEL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "dl_loglevel"
-	}, {
-		QCSAP_DBGLOG_VAP_ENABLE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "dl_vapon"
-	}, {
-		QCSAP_DBGLOG_VAP_DISABLE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "dl_vapoff"
-	}, {
-		QCSAP_DBGLOG_MODULE_ENABLE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "dl_modon"
-	}, {
-		QCSAP_DBGLOG_MODULE_DISABLE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "dl_modoff"
-	}, {
-		QCSAP_DBGLOG_MOD_LOG_LEVEL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "dl_mod_loglevel"
-	}, {
-		QCSAP_DBGLOG_TYPE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "dl_type"
-	}, {
-		QCSAP_DBGLOG_REPORT_ENABLE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "dl_report"
-	}, {
-		QCASAP_TXRX_FWSTATS_RESET,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "txrx_fw_st_rst"
-	}, {
-		QCSAP_PARAM_RTSCTS,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "enablertscts"
-	}, {
-		QCASAP_SET_11N_RATE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "set11NRates"
-	}, {
-		QCASAP_SET_VHT_RATE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "set11ACRates"
-	}, {
-		QCASAP_SHORT_GI,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "enable_short_gi"
-	}, {
-		QCSAP_SET_AMPDU,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "ampdu"
-	}, {
-		QCSAP_SET_AMSDU,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "amsdu"
-	}, {
-		QCSAP_GTX_HT_MCS,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "gtxHTMcs"
-	}, {
-		QCSAP_GTX_VHT_MCS,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "gtxVHTMcs"
-	}, {
-		QCSAP_GTX_USRCFG,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "gtxUsrCfg"
-	}, {
-		QCSAP_GTX_THRE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "gtxThre"
-	}, {
-		QCSAP_GTX_MARGIN,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "gtxMargin"
-	}, {
-		QCSAP_GTX_STEP,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "gtxStep"
-	}, {
-		QCSAP_GTX_MINTPC,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "gtxMinTpc"
-	}, {
-		QCSAP_GTX_BWMASK,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "gtxBWMask"
-	}, {
-		QCSAP_PARAM_CLR_ACL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "setClearAcl"
-	}, {
-		QCSAP_PARAM_ACL_MODE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setAclMode"
-	},
-#ifdef QCA_PKT_PROTO_TRACE
-	{
-		QCASAP_SET_DEBUG_LOG,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setDbgLvl"
-	},
-#endif /* QCA_PKT_PROTO_TRACE */
-	{
-		QCASAP_SET_TM_LEVEL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "setTmLevel"
-	}, {
-		QCASAP_SET_DFS_IGNORE_CAC,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "setDfsIgnoreCAC"
-	}, {
-		QCASAP_SET_DFS_NOL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "setdfsnol"
-	}, {
-		QCASAP_SET_DFS_TARGET_CHNL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "setNextChnl"
-	}, {
-		QCASAP_SET_RADAR_CMD,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setRadar"
-	},
-	{
-		QCSAP_IPA_UC_STAT,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "ipaucstat"
-	},
-	{
-		QCASAP_TX_CHAINMASK_CMD,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "set_txchainmask"
-	}, {
-		QCASAP_RX_CHAINMASK_CMD,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "set_rxchainmask"
-	}, {
-		QCASAP_NSS_CMD,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_nss"
-	}, {
-		QCASAP_SET_PHYMODE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "setphymode"
-	}, {
-		QCASAP_DUMP_STATS,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "dumpStats"
-	}, {
-		QCASAP_CLEAR_STATS,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "clearStats"
-	}, {
-		QCSAP_START_FW_PROFILING,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "startProfile"
-	}, {
-		QCSAP_IOCTL_GETPARAM, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getparam"
-	}, {
-		QCSAP_IOCTL_GETPARAM, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, ""
-	}, {
-		QCSAP_PARAM_MAX_ASSOC, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getMaxAssoc"
-	}, {
-		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"
-	}, {
-		QCSAP_GTX_MINTPC, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_gtxMinTpc"
-	}, {
-		QCSAP_GTX_STEP, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_gtxStep"
-	}, {
-		QCSAP_GTX_MARGIN, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_gtxMargin"
-	}, {
-		QCSAP_GTX_THRE, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_gtxThre"
-	}, {
-		QCSAP_GTX_USRCFG, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_gtxUsrCfg"
-	}, {
-		QCSAP_GTX_VHT_MCS, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_gtxVHTMcs"
-	}, {
-		QCSAP_GTX_HT_MCS, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_gtxHTMcs"
-	}, {
-		QCASAP_SHORT_GI, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_short_gi"
-	}, {
-		QCSAP_PARAM_RTSCTS, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_rtscts"
-	}, {
-		QCASAP_GET_DFS_NOL, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getdfsnol"
-	}, {
-		QCSAP_GET_ACL, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_acl_list"
-	}, {
-		QCASAP_TX_CHAINMASK_CMD, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_txchainmask"
-	}, {
-		QCASAP_RX_CHAINMASK_CMD, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_rxchainmask"
-	}, {
-		QCASAP_NSS_CMD, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		"get_nss"
-	}, {
-		QCASAP_GET_TEMP_CMD, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_temp"
-	}, {
-		QCSAP_GET_FW_PROFILE_DATA, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getProfileData"
-	}, {
-		QCSAP_IOCTL_GET_STAWPAIE,
-		IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1, 0,
-		"get_staWPAIE"
-	}, {
-		QCSAP_IOCTL_SETWPAIE,
-		IW_PRIV_TYPE_BYTE | QCSAP_MAX_WSC_IE |
-		IW_PRIV_SIZE_FIXED, 0, "setwpaie"
-	}, {
-		QCSAP_IOCTL_STOPBSS, IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED, 0,
-		"stopbss"
-	}, {
-		QCSAP_IOCTL_VERSION, 0, IW_PRIV_TYPE_CHAR | QCSAP_MAX_WSC_IE,
-		"version"
-	}, {
-		QCSAP_IOCTL_GET_STA_INFO, 0,
-		IW_PRIV_TYPE_CHAR | WE_SAP_MAX_STA_INFO, "get_sta_info"
-	}, {
-		QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES,
-		IW_PRIV_TYPE_BYTE |
-		sizeof(sQcSapreq_WPSPBCProbeReqIES_t) |
-		IW_PRIV_SIZE_FIXED, 0, "getProbeReqIEs"
-	}
-	, {
-		QCSAP_IOCTL_GET_CHANNEL, 0,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getchannel"
-	}
-	, {
-		QCSAP_IOCTL_DISASSOC_STA,
-		IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 6, 0,
-		"disassoc_sta"
-	}
-	/* handler for main ioctl */
-	, {
-		QCSAP_PRIV_GET_CHAR_SET_NONE, 0,
-		IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, ""
-	}
-	/* handler for sub-ioctl */
-	, {
-		QCSAP_GET_STATS, 0,
-		IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, "getStats"
-	}
-	, {
-		QCSAP_LIST_FW_PROFILE, 0,
-		IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN, "listProfile"
-	}
-	, {
-		QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED,
-		IW_PRIV_TYPE_CHAR | 18,
-		IW_PRIV_TYPE_CHAR | 5, "getLinkSpeed"
-	}
-	, {
-		QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, ""
-	}
-	,
-	/* handlers for sub-ioctl */
-	{
-		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 */
-	{
-		WE_SET_DP_TRACE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "set_dp_trace"
-	}
-	,
-	/* handlers for main ioctl */
-	{
-		QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE,
-		IW_PRIV_TYPE_INT | MAX_VAR_ARGS, 0, ""
-	}
-	, {
-		WE_P2P_NOA_CMD, IW_PRIV_TYPE_INT | MAX_VAR_ARGS, 0, "SetP2pPs"
-	}
-	, {
-		WE_UNIT_TEST_CMD, IW_PRIV_TYPE_INT | MAX_VAR_ARGS, 0,
-		"setUnitTestCmd"
-	}
-	,
-	/* handlers for main ioctl */
-	{
-		QCSAP_IOCTL_MODIFY_ACL,
-		IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 8, 0, "modify_acl"
-	}
-	,
-	/* handlers for main ioctl */
-	{
-		QCSAP_IOCTL_GET_CHANNEL_LIST,
-		0,
-		IW_PRIV_TYPE_BYTE | sizeof(tChannelListInfo),
-		"getChannelList"
-	}
-	,
-	/* handlers for main ioctl */
-	{
-		QCSAP_IOCTL_SET_TX_POWER,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "setTxPower"
-	}
-	,
-	/* handlers for main ioctl */
-	{
-		QCSAP_IOCTL_SET_MAX_TX_POWER,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0, "setTxMaxPower"
-	}
-	,
-	/* Set HDD CFG Ini param */
-	{
-		QCSAP_IOCTL_SET_INI_CFG,
-		IW_PRIV_TYPE_CHAR | QCSAP_IOCTL_MAX_STR_LEN, 0, "setConfig"
-	}
-	,
-	/* Get HDD CFG Ini param */
-	{
-		QCSAP_IOCTL_GET_INI_CFG,
-		0, IW_PRIV_TYPE_CHAR | QCSAP_IOCTL_MAX_STR_LEN, "getConfig"
-	}
-	,
-	/* handlers for main ioctl */
-	{
-	/* handlers for main ioctl */
-		QCSAP_IOCTL_SET_TWO_INT_GET_NONE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, ""
-	}
-	,
-	/* handlers for sub-ioctl */
-#ifdef DEBUG
-	{
-		QCSAP_IOCTL_SET_FW_CRASH_INJECT,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
-		0, "crash_inject"
-	}
-	,
-#endif
-	{
-		QCASAP_SET_RADAR_DBG,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
-		0,  "setRadarDbg"
-	}
-	,
-	/* dump dp trace - descriptor or dp trace records */
-	{
-		QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
-		0, "dump_dp_trace"
-	}
-	,
-	{
-		QCSAP_ENABLE_FW_PROFILE,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
-		0, "enableProfile"
-	}
-	,
-	{
-		QCSAP_SET_FW_PROFILE_HIST_INTVL,
-		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
-		0, "set_hist_intvl"
-	}
-};
-
-static const iw_handler hostapd_private[] = {
-	/* set priv ioctl */
-	[QCSAP_IOCTL_SETPARAM - SIOCIWFIRSTPRIV] = iw_softap_setparam,
-	/* get priv ioctl */
-	[QCSAP_IOCTL_GETPARAM - SIOCIWFIRSTPRIV] = iw_softap_getparam,
-	/* get station genIE */
-	[QCSAP_IOCTL_GET_STAWPAIE - SIOCIWFIRSTPRIV] = iw_get_genie,
-	[QCSAP_IOCTL_SETWPAIE - SIOCIWFIRSTPRIV] = iw_softap_setwpsie,
-	/* stop bss */
-	[QCSAP_IOCTL_STOPBSS - SIOCIWFIRSTPRIV] = iw_softap_stopbss,
-	/* get driver version */
-	[QCSAP_IOCTL_VERSION - SIOCIWFIRSTPRIV] = iw_softap_version,
-	[QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES - SIOCIWFIRSTPRIV] =
-		iw_get_wpspbc_probe_req_ies,
-	[QCSAP_IOCTL_GET_CHANNEL - SIOCIWFIRSTPRIV] =
-		iw_softap_getchannel,
-	[QCSAP_IOCTL_ASSOC_STA_MACADDR - SIOCIWFIRSTPRIV] =
-		iw_softap_getassoc_stamacaddr,
-	[QCSAP_IOCTL_DISASSOC_STA - SIOCIWFIRSTPRIV] =
-		iw_softap_disassoc_sta,
-	[QCSAP_PRIV_GET_CHAR_SET_NONE - SIOCIWFIRSTPRIV] =
-		iw_get_char_setnone,
-	[QCSAP_IOCTL_PRIV_SET_THREE_INT_GET_NONE -
-	 SIOCIWFIRSTPRIV] =
-		iw_set_three_ints_getnone,
-	[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] =
-		iw_softap_get_channel_list,
-	[QCSAP_IOCTL_GET_STA_INFO - SIOCIWFIRSTPRIV] =
-		iw_softap_get_sta_info,
-	[QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED -
-	 SIOCIWFIRSTPRIV] =
-		iw_get_softap_linkspeed,
-	[QCSAP_IOCTL_SET_TX_POWER - SIOCIWFIRSTPRIV] =
-		iw_softap_set_tx_power,
-	[QCSAP_IOCTL_SET_MAX_TX_POWER - SIOCIWFIRSTPRIV] =
-		iw_softap_set_max_tx_power,
-	[QCSAP_IOCTL_SET_INI_CFG - SIOCIWFIRSTPRIV] =
-		iw_softap_set_ini_cfg,
-	[QCSAP_IOCTL_GET_INI_CFG - SIOCIWFIRSTPRIV] =
-		iw_softap_get_ini_cfg,
-	[QCSAP_IOCTL_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] =
-		iw_softap_set_two_ints_getnone,
-};
-const struct iw_handler_def hostapd_handler_def = {
-	.num_standard = CDF_ARRAY_SIZE(hostapd_handler),
-	.num_private = CDF_ARRAY_SIZE(hostapd_private),
-	.num_private_args = CDF_ARRAY_SIZE(hostapd_private_args),
-	.standard = (iw_handler *) hostapd_handler,
-	.private = (iw_handler *) hostapd_private,
-	.private_args = hostapd_private_args,
-	.get_wireless_stats = NULL,
-};
-
-struct net_device_ops net_ops_struct = {
-	.ndo_open = hdd_hostapd_open,
-	.ndo_stop = hdd_hostapd_stop,
-	.ndo_uninit = hdd_hostapd_uninit,
-	.ndo_start_xmit = hdd_softap_hard_start_xmit,
-	.ndo_tx_timeout = hdd_softap_tx_timeout,
-	.ndo_get_stats = hdd_get_stats,
-	.ndo_set_mac_address = hdd_hostapd_set_mac_address,
-	.ndo_do_ioctl = hdd_ioctl,
-	.ndo_change_mtu = hdd_hostapd_change_mtu,
-	.ndo_select_queue = hdd_hostapd_select_queue,
-};
-
-static int hdd_set_hostapd(hdd_adapter_t *pAdapter)
-{
-	return CDF_STATUS_SUCCESS;
-}
-
-void hdd_set_ap_ops(struct net_device *pWlanHostapdDev)
-{
-	pWlanHostapdDev->netdev_ops = &net_ops_struct;
-}
-
-CDF_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter)
-{
-	hdd_hostapd_state_t *phostapdBuf;
-	struct net_device *dev = pAdapter->dev;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	CDF_STATUS status;
-#ifdef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t p_cds_context = (WLAN_HDD_GET_CTX(pAdapter))->pcds_context;
-	v_CONTEXT_t sapContext = NULL;
-#endif
-	int ret;
-
-	ENTER();
-
-#ifdef WLAN_FEATURE_MBSSID
-	sapContext = wlansap_open(p_cds_context);
-	if (sapContext == NULL) {
-		hddLog(LOGE, ("ERROR: wlansap_open failed!!"));
-		return CDF_STATUS_E_FAULT;
-	}
-
-	pAdapter->sessionCtx.ap.sapContext = sapContext;
-
-	status = wlansap_start(sapContext);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, ("ERROR: wlansap_start failed!!"));
-		wlansap_close(sapContext);
-		return status;
-	}
-#endif
-
-	/* Allocate the Wireless Extensions state structure */
-	phostapdBuf = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-
-	sme_set_curr_device_mode(pHddCtx->hHal, pAdapter->device_mode);
-
-	/* Zero the memory.  This zeros the profile structure. */
-	memset(phostapdBuf, 0, sizeof(hdd_hostapd_state_t));
-
-	/* Set up the pointer to the Wireless Extensions state structure */
-	/* NOP */
-	status = hdd_set_hostapd(pAdapter);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, ("ERROR: hdd_set_hostapd failed!!"));
-#ifdef WLAN_FEATURE_MBSSID
-		wlansap_close(sapContext);
-#endif
-		return status;
-	}
-
-	status = cdf_event_init(&phostapdBuf->cdf_event);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE, ("ERROR: Hostapd HDD cdf event init failed!!"));
-#ifdef WLAN_FEATURE_MBSSID
-		wlansap_close(sapContext);
-#endif
-		return status;
-	}
-
-	status = cdf_event_init(&phostapdBuf->cdf_stop_bss_event);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  ("ERROR: Hostapd HDD stop bss event init failed!!"));
-#ifdef WLAN_FEATURE_MBSSID
-		wlansap_close(sapContext);
-#endif
-		return status;
-	}
-
-	init_completion(&pAdapter->session_close_comp_var);
-	init_completion(&pAdapter->session_open_comp_var);
-
-	sema_init(&(WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->semWpsPBCOverlapInd, 1);
-
-	/* Register as a wireless device */
-	dev->wireless_handlers = (struct iw_handler_def *)&hostapd_handler_def;
-
-	/* Initialize the data path module */
-	status = hdd_softap_init_tx_rx(pAdapter);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGP, FL("hdd_softap_init_tx_rx failed"));
-	}
-
-	status = hdd_wmm_adapter_init(pAdapter);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-		       "hdd_wmm_adapter_init() failed code %08d [x%08x]",
-		       status, status);
-		goto error_wmm_init;
-	}
-
-	set_bit(WMM_INIT_DONE, &pAdapter->event_flags);
-
-	ret = wma_cli_set_command(pAdapter->sessionId,
-				  WMI_PDEV_PARAM_BURST_ENABLE,
-				  pHddCtx->config->enableSifsBurst,
-				  PDEV_CMD);
-
-	if (0 != ret) {
-		hddLog(LOGE,
-		       FL("WMI_PDEV_PARAM_BURST_ENABLE set failed %d"), ret);
-	}
-	pAdapter->sessionCtx.ap.sapConfig.acs_cfg.acs_mode = false;
-	cdf_mem_free(pAdapter->sessionCtx.ap.sapConfig.acs_cfg.ch_list);
-	cdf_mem_zero(&pAdapter->sessionCtx.ap.sapConfig.acs_cfg,
-						sizeof(struct sap_acs_cfg));
-	return status;
-
-error_wmm_init:
-	hdd_softap_deinit_tx_rx(pAdapter);
-#ifdef WLAN_FEATURE_MBSSID
-	wlansap_close(sapContext);
-#endif
-	EXIT();
-	return status;
-}
-
-/**
- * hdd_wlan_create_ap_dev() - create an AP-mode device
- * @pHddCtx: Global HDD context
- * @macAddr: MAC address to assign to the interface
- * @iface_name: User-visible name of the interface
- *
- * This function will allocate a Linux net_device and configuration it
- * for an AP mode of operation.  Note that the device is NOT actually
- * registered with the kernel at this time.
- *
- * Return: A pointer to the private data portion of the net_device if
- * the allocation and initialization was successful, NULL otherwise.
- */
-hdd_adapter_t *hdd_wlan_create_ap_dev(hdd_context_t *pHddCtx,
-				      tSirMacAddr macAddr,
-				      uint8_t *iface_name) {
-	struct net_device *pWlanHostapdDev = NULL;
-	hdd_adapter_t *pHostapdAdapter = NULL;
-
-	hddLog(LOG4, FL("iface_name = %s"), iface_name);
-
-	pWlanHostapdDev =
-		alloc_netdev_mq(sizeof(hdd_adapter_t), iface_name,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
-				NET_NAME_UNKNOWN,
-#endif
-				ether_setup,
-				NUM_TX_QUEUES);
-
-	if (pWlanHostapdDev != NULL) {
-		pHostapdAdapter = netdev_priv(pWlanHostapdDev);
-
-		/* Init the net_device structure */
-		ether_setup(pWlanHostapdDev);
-
-		/* Initialize the adapter context to zeros. */
-		cdf_mem_zero(pHostapdAdapter, sizeof(hdd_adapter_t));
-		pHostapdAdapter->dev = pWlanHostapdDev;
-		pHostapdAdapter->pHddCtx = pHddCtx;
-		pHostapdAdapter->magic = WLAN_HDD_ADAPTER_MAGIC;
-
-		hddLog(LOG4,
-		       FL("pWlanHostapdDev = %p, pHostapdAdapter = %p, concurrency_mode=0x%x"),
-		       pWlanHostapdDev,
-		       pHostapdAdapter,
-		       (int)cds_get_concurrency_mode());
-
-		/* Init the net_device structure */
-		strlcpy(pWlanHostapdDev->name, (const char *)iface_name,
-			IFNAMSIZ);
-
-		hdd_set_ap_ops(pHostapdAdapter->dev);
-
-		pWlanHostapdDev->watchdog_timeo = HDD_TX_TIMEOUT;
-		pWlanHostapdDev->mtu = HDD_DEFAULT_MTU;
-		pWlanHostapdDev->tx_queue_len = HDD_NETDEV_TX_QUEUE_LEN;
-
-		cdf_mem_copy(pWlanHostapdDev->dev_addr, (void *)macAddr,
-			     sizeof(tSirMacAddr));
-		cdf_mem_copy(pHostapdAdapter->macAddressCurrent.bytes,
-			     (void *)macAddr, sizeof(tSirMacAddr));
-
-		pHostapdAdapter->offloads_configured = false;
-		pWlanHostapdDev->destructor = free_netdev;
-		pWlanHostapdDev->ieee80211_ptr = &pHostapdAdapter->wdev;
-		pHostapdAdapter->wdev.wiphy = pHddCtx->wiphy;
-		pHostapdAdapter->wdev.netdev = pWlanHostapdDev;
-		init_completion(&pHostapdAdapter->tx_action_cnf_event);
-		init_completion(&pHostapdAdapter->cancel_rem_on_chan_var);
-		init_completion(&pHostapdAdapter->rem_on_chan_ready_event);
-		init_completion(&pHostapdAdapter->sta_authorized_event);
-		init_completion(&pHostapdAdapter->offchannel_tx_event);
-		init_completion(&pHostapdAdapter->scan_info.
-				abortscan_event_var);
-
-		SET_NETDEV_DEV(pWlanHostapdDev, pHddCtx->parent_dev);
-		spin_lock_init(&pHostapdAdapter->pause_map_lock);
-	}
-	return pHostapdAdapter;
-}
-
-/**
- * hdd_register_hostapd() - register hostapd
- * @pAdapter: Pointer to hostapd adapter
- * @rtnl_lock_held: RTNL lock held
- *
- * Return: CDF status
- */
-CDF_STATUS hdd_register_hostapd(hdd_adapter_t *pAdapter,
-				uint8_t rtnl_lock_held) {
-	struct net_device *dev = pAdapter->dev;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	ENTER();
-
-	if (rtnl_lock_held) {
-		if (strnchr(dev->name, strlen(dev->name), '%')) {
-			if (dev_alloc_name(dev, dev->name) < 0) {
-				hddLog(LOGE, FL("Failed:dev_alloc_name"));
-				return CDF_STATUS_E_FAILURE;
-			}
-		}
-		if (register_netdevice(dev)) {
-			hddLog(LOGE, FL("Failed:register_netdevice"));
-			return CDF_STATUS_E_FAILURE;
-		}
-	} else {
-		if (register_netdev(dev)) {
-			hddLog(LOGE, FL("Failed:register_netdev"));
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-	set_bit(NET_DEVICE_REGISTERED, &pAdapter->event_flags);
-
-	EXIT();
-	return status;
-}
-
-/**
- * hdd_unregister_hostapd() - unregister hostapd
- * @pAdapter: Pointer to hostapd adapter
- * @rtnl_held: true if rtnl lock held; false otherwise
- *
- * Return: CDF_STATUS enumaration
- */
-CDF_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter, bool rtnl_held)
-{
-#ifdef WLAN_FEATURE_MBSSID
-	CDF_STATUS status;
-	void *sapContext = WLAN_HDD_GET_SAP_CTX_PTR(pAdapter);
-#endif
-
-	ENTER();
-
-	hdd_softap_deinit_tx_rx(pAdapter);
-
-	/* if we are being called during driver unload,
-	 * then the dev has already been invalidated.
-	 * if we are being called at other times, then we can
-	 * detach the wireless device handlers
-	 */
-	if (pAdapter->dev) {
-		if (rtnl_held)
-			pAdapter->dev->wireless_handlers = NULL;
-		else {
-			rtnl_lock();
-			pAdapter->dev->wireless_handlers = NULL;
-			rtnl_unlock();
-		}
-	}
-
-#ifdef WLAN_FEATURE_MBSSID
-	status = wlansap_stop(sapContext);
-	if (!CDF_IS_STATUS_SUCCESS(status))
-		hddLog(LOGE, FL("Failed:wlansap_stop"));
-
-	status = wlansap_close(sapContext);
-	if (!CDF_IS_STATUS_SUCCESS(status))
-		hddLog(LOGE, FL("Failed:WLANSAP_close"));
-	pAdapter->sessionCtx.ap.sapContext = NULL;
-#endif
-
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_rate_is_11g() - check if rate is 11g rate or not
- * @rate: Rate to be checked
- *
- * Return: true if rate if 11g else false
- */
-static bool wlan_hdd_rate_is_11g(u8 rate)
-{
-	static const u8 gRateArray[8] = {12, 18, 24, 36, 48, 72,
-					 96, 108}; /* actual rate * 2 */
-	u8 i;
-	for (i = 0; i < 8; i++) {
-		if (rate == gRateArray[i])
-			return true;
-	}
-	return false;
-}
-
-#ifdef QCA_HT_2040_COEX
-/**
- * wlan_hdd_get_sap_obss() - Get SAP OBSS enable config based on HT_CAPAB IE
- * @pHostapdAdapter: Pointer to hostapd adapter
- *
- * Return: HT support channel width config value
- */
-static bool wlan_hdd_get_sap_obss(hdd_adapter_t *pHostapdAdapter)
-{
-	uint8_t ht_cap_ie[DOT11F_IE_HTCAPS_MAX_LEN];
-	tDot11fIEHTCaps dot11_ht_cap_ie = {0};
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	beacon_data_t *beacon = pHostapdAdapter->sessionCtx.ap.beacon;
-	uint8_t *ie = NULL;
-
-	ie = wlan_hdd_cfg80211_get_ie_ptr(beacon->tail, beacon->tail_len,
-						WLAN_EID_HT_CAPABILITY);
-	if (ie && ie[1]) {
-		cdf_mem_copy(ht_cap_ie, &ie[2], DOT11F_IE_HTCAPS_MAX_LEN);
-		dot11f_unpack_ie_ht_caps((tpAniSirGlobal)hdd_ctx->hHal,
-					ht_cap_ie, ie[1], &dot11_ht_cap_ie);
-		return dot11_ht_cap_ie.supportedChannelWidthSet;
-	}
-
-	return false;
-}
-#else
-static bool wlan_hdd_get_sap_obss(hdd_adapter_t *pHostapdAdapter)
-{
-	return false;
-}
-#endif
-/**
- * wlan_hdd_set_channel() - set channel in sap mode
- * @wiphy: Pointer to wiphy structure
- * @dev: Pointer to net_device structure
- * @chandef: Pointer to channel definition structure
- * @channel_type: Channel type
- *
- * Return: 0 for success non-zero for failure
- */
-static int wlan_hdd_set_channel(struct wiphy *wiphy,
-				struct net_device *dev,
-				struct cfg80211_chan_def *chandef,
-				enum nl80211_channel_type channel_type)
-{
-	hdd_adapter_t *pAdapter = NULL;
-	uint32_t num_ch = 0;
-	int channel = 0;
-	int channel_seg2 = 0;
-	hdd_context_t *pHddCtx;
-	int status;
-
-	tSmeConfigParams smeConfig;
-	tsap_Config_t *sap_config;
-
-	ENTER();
-
-
-	if (NULL == dev) {
-		hddLog(LOGE, FL("Called with dev = NULL."));
-		return -ENODEV;
-	}
-	pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_CHANNEL,
-			 pAdapter->sessionId, channel_type));
-
-	hddLog(LOG1, FL("Device_mode %s(%d)  freq = %d"),
-	       hdd_device_mode_to_string(pAdapter->device_mode),
-	       pAdapter->device_mode, chandef->chan->center_freq);
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return status;
-	}
-
-	/*
-	 * Do freq to chan conversion
-	 * TODO: for 11a
-	 */
-
-	channel = ieee80211_frequency_to_channel(chandef->chan->center_freq);
-	if (NL80211_CHAN_WIDTH_80P80 == chandef->width)
-		channel_seg2 = ieee80211_frequency_to_channel(chandef->center_freq2);
-	else
-		channel_seg2 = 0;
-
-	/* Check freq range */
-	if ((WNI_CFG_CURRENT_CHANNEL_STAMIN > channel) ||
-	    (WNI_CFG_CURRENT_CHANNEL_STAMAX < channel)) {
-		hddLog(LOGE,
-		       FL("Channel [%d] is outside valid range from %d to %d"),
-		       channel, WNI_CFG_CURRENT_CHANNEL_STAMIN,
-		       WNI_CFG_CURRENT_CHANNEL_STAMAX);
-		return -EINVAL;
-	}
-
-	/* Check freq range */
-
-	if ((WNI_CFG_CURRENT_CHANNEL_STAMIN > channel_seg2) ||
-	    (WNI_CFG_CURRENT_CHANNEL_STAMAX < channel_seg2)) {
-		hddLog(LOGE,
-		       FL("Channel [%d] is outside valid range from %d to %d"),
-		       channel_seg2, WNI_CFG_CURRENT_CHANNEL_STAMIN,
-		       WNI_CFG_CURRENT_CHANNEL_STAMAX);
-		return -EINVAL;
-	}
-
-	num_ch = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-
-	if ((WLAN_HDD_SOFTAP != pAdapter->device_mode) &&
-	    (WLAN_HDD_P2P_GO != pAdapter->device_mode)) {
-		if (CDF_STATUS_SUCCESS !=
-		    wlan_hdd_validate_operation_channel(pAdapter, channel)) {
-			hddLog(LOGE, FL("Invalid Channel [%d]"), channel);
-			return -EINVAL;
-		}
-		hddLog(LOG2,
-		       FL("set channel to [%d] for device mode %s(%d)"),
-		       channel,
-		       hdd_device_mode_to_string(pAdapter->device_mode),
-		       pAdapter->device_mode);
-	}
-
-	if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION)
-	    || (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)
-	    ) {
-		hdd_wext_state_t *pWextState =
-			WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-		tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile;
-		hdd_station_ctx_t *pHddStaCtx =
-			WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-		if (eConnectionState_IbssConnected ==
-		    pHddStaCtx->conn_info.connState) {
-			/* Link is up then return cant set channel */
-			hddLog(LOGE,
-			       FL("IBSS Associated, can't set the channel"));
-			return -EINVAL;
-		}
-
-		num_ch = pRoamProfile->ChannelInfo.numOfChannels = 1;
-		pHddStaCtx->conn_info.operationChannel = channel;
-		pRoamProfile->ChannelInfo.ChannelList =
-			&pHddStaCtx->conn_info.operationChannel;
-	} else if ((pAdapter->device_mode == WLAN_HDD_SOFTAP)
-		   || (pAdapter->device_mode == WLAN_HDD_P2P_GO)
-		   ) {
-		sap_config = &((WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->sapConfig);
-		if (WLAN_HDD_P2P_GO == pAdapter->device_mode) {
-			if (CDF_STATUS_SUCCESS !=
-			    wlan_hdd_validate_operation_channel(pAdapter,
-								channel)) {
-				hddLog(LOGE,
-				       FL("Invalid Channel [%d]"), channel);
-				return -EINVAL;
-			}
-			sap_config->channel = channel;
-			sap_config->ch_params.center_freq_seg1 = channel_seg2;
-		} else {
-			/* set channel to what hostapd configured */
-			if (CDF_STATUS_SUCCESS !=
-				wlan_hdd_validate_operation_channel(pAdapter,
-								channel)) {
-				hddLog(LOGE,
-				       FL("Invalid Channel [%d]"), channel);
-				return -EINVAL;
-			}
-
-			sap_config->channel = channel;
-			sap_config->ch_params.center_freq_seg1 = channel_seg2;
-
-			cdf_mem_zero(&smeConfig, sizeof(smeConfig));
-			sme_get_config_param(pHddCtx->hHal, &smeConfig);
-			switch (channel_type) {
-			case NL80211_CHAN_HT20:
-			case NL80211_CHAN_NO_HT:
-				smeConfig.csrConfig.obssEnabled = false;
-				if (channel <= 14)
-					smeConfig.csrConfig.
-						channelBondingMode24GHz =
-					eCSR_INI_SINGLE_CHANNEL_CENTERED;
-				else
-					smeConfig.csrConfig.
-						channelBondingMode5GHz =
-					eCSR_INI_SINGLE_CHANNEL_CENTERED;
-				sap_config->sec_ch = 0;
-				break;
-
-			case NL80211_CHAN_HT40MINUS:
-				if (channel <= 14)
-					smeConfig.csrConfig.
-					channelBondingMode24GHz =
-					eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
-				else
-					smeConfig.csrConfig.
-					channelBondingMode5GHz =
-					eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
-				sap_config->sec_ch = sap_config->channel - 4;
-				break;
-			case NL80211_CHAN_HT40PLUS:
-				if (channel <= 14)
-					smeConfig.csrConfig.
-					channelBondingMode24GHz =
-					eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
-				else
-					smeConfig.csrConfig.
-					channelBondingMode5GHz =
-					eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
-				sap_config->sec_ch = sap_config->channel + 4;
-				break;
-			default:
-				hddLog(LOGE,
-				       FL("Error!!! Invalid HT20/40 mode !"));
-				return -EINVAL;
-			}
-			smeConfig.csrConfig.obssEnabled = wlan_hdd_get_sap_obss(
-								pAdapter);
-			sme_update_config(pHddCtx->hHal, &smeConfig);
-		}
-	} else {
-		hddLog(LOGE,
-		       FL("Invalid device mode failed to set valid channel"));
-		return -EINVAL;
-	}
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_check_11gmode() - check for 11g mode
- * @pIe: Pointer to IE
- * @require_ht: Pointer to require ht
- * @require_vht: Pointer to require vht
- * @pCheckRatesfor11g: Pointer to check rates for 11g mode
- * @pSapHw_mode: SAP HW mode
- *
- * Check for 11g rate and set proper 11g only mode
- *
- * Return: none
- */
-static void wlan_hdd_check_11gmode(u8 *pIe, u8 *require_ht, u8 *require_vht,
-				   u8 *pCheckRatesfor11g,
-				   eCsrPhyMode *pSapHw_mode)
-{
-	u8 i, num_rates = pIe[0];
-
-	pIe += 1;
-	for (i = 0; i < num_rates; i++) {
-		if (*pCheckRatesfor11g
-		    && (true == wlan_hdd_rate_is_11g(pIe[i] & RATE_MASK))) {
-			/* If rate set have 11g rate than change the mode
-			 * to 11G
-			 */
-			*pSapHw_mode = eCSR_DOT11_MODE_11g;
-			if (pIe[i] & BASIC_RATE_MASK) {
-				/* If we have 11g rate as  basic rate, it
-				 * means mode is 11g only mode.
-				 */
-				*pSapHw_mode = eCSR_DOT11_MODE_11g_ONLY;
-				*pCheckRatesfor11g = false;
-			}
-		} else {
-			if ((BASIC_RATE_MASK |
-				WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY) == pIe[i])
-				*require_ht = true;
-			else if ((BASIC_RATE_MASK |
-				WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY) == pIe[i])
-				*require_vht = true;
-		}
-	}
-	return;
-}
-
-/**
- * wlan_hdd_add_ie() - add ie
- * @pHostapdAdapter: Pointer to hostapd adapter
- * @genie: Pointer to ie to be added
- * @total_ielen: Pointer to store total ie length
- * @oui: Pointer to oui
- * @oui_size: Size of oui
- *
- * Return: 0 for success non-zero for failure
- */
-static int wlan_hdd_add_ie(hdd_adapter_t *pHostapdAdapter, uint8_t *genie,
-			   uint8_t *total_ielen, uint8_t *oui,
-			   uint8_t oui_size)
-{
-	uint16_t ielen = 0;
-	uint8_t *pIe = NULL;
-	beacon_data_t *pBeacon = pHostapdAdapter->sessionCtx.ap.beacon;
-
-	pIe = wlan_hdd_get_vendor_oui_ie_ptr(oui, oui_size,
-					     pBeacon->tail, pBeacon->tail_len);
-
-	if (pIe) {
-		ielen = pIe[1] + 2;
-		if ((*total_ielen + ielen) <= MAX_GENIE_LEN) {
-			cdf_mem_copy(&genie[*total_ielen], pIe, ielen);
-		} else {
-			hddLog(LOGE,
-			       "**Ie Length is too big***");
-			return -EINVAL;
-		}
-		*total_ielen += ielen;
-	}
-	return 0;
-}
-
-/**
- * wlan_hdd_add_hostapd_conf_vsie() - configure vsie in sap mode
- * @pHostapdAdapter: Pointer to hostapd adapter
- * @genie: Pointer to vsie
- * @total_ielen: Pointer to store total ie length
- *
- * Return: none
- */
-static void wlan_hdd_add_hostapd_conf_vsie(hdd_adapter_t *pHostapdAdapter,
-					   uint8_t *genie,
-					   uint8_t *total_ielen)
-{
-	beacon_data_t *pBeacon = pHostapdAdapter->sessionCtx.ap.beacon;
-	int left = pBeacon->tail_len;
-	uint8_t *ptr = pBeacon->tail;
-	uint8_t elem_id, elem_len;
-	uint16_t ielen = 0;
-
-	if (NULL == ptr || 0 == left)
-		return;
-
-	while (left >= 2) {
-		elem_id = ptr[0];
-		elem_len = ptr[1];
-		left -= 2;
-		if (elem_len > left) {
-			hddLog(LOGE,
-				FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"),
-				elem_id, elem_len, left);
-			return;
-		}
-		if (IE_EID_VENDOR == elem_id) {
-			/* skipping the VSIE's which we don't want to include or
-			 * it will be included by existing code
-			 */
-			if ((memcmp(&ptr[2], WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE) !=
-			     0) &&
-#ifdef WLAN_FEATURE_WFD
-			    (memcmp(&ptr[2], WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE) !=
-			     0) &&
-#endif
-			    (memcmp
-				     (&ptr[2], WHITELIST_OUI_TYPE,
-				     WPA_OUI_TYPE_SIZE) != 0)
-			    &&
-			    (memcmp
-				     (&ptr[2], BLACKLIST_OUI_TYPE,
-				     WPA_OUI_TYPE_SIZE) != 0)
-			    &&
-			    (memcmp
-				     (&ptr[2], "\x00\x50\xf2\x02",
-				     WPA_OUI_TYPE_SIZE) != 0)
-			    && (memcmp(&ptr[2], WPA_OUI_TYPE, WPA_OUI_TYPE_SIZE)
-				!= 0)
-			    && (memcmp(&ptr[2], P2P_OUI_TYPE, P2P_OUI_TYPE_SIZE)
-				!= 0)) {
-				ielen = ptr[1] + 2;
-				if ((*total_ielen + ielen) <= MAX_GENIE_LEN) {
-					cdf_mem_copy(&genie[*total_ielen], ptr,
-						     ielen);
-					*total_ielen += ielen;
-				} else {
-					hddLog(LOGE,
-					       FL("IE Length is too big IEs eid=%d elem_len=%d total_ie_lent=%d"),
-					       elem_id, elem_len, *total_ielen);
-				}
-			}
-		}
-
-		left -= elem_len;
-		ptr += (elem_len + 2);
-	}
-	return;
-}
-
-/**
- * wlan_hdd_add_extra_ie() - add extra ies in beacon
- * @pHostapdAdapter: Pointer to hostapd adapter
- * @genie: Pointer to extra ie
- * @total_ielen: Pointer to store total ie length
- * @temp_ie_id: ID of extra ie
- *
- * Return: none
- */
-static void wlan_hdd_add_extra_ie(hdd_adapter_t *pHostapdAdapter,
-				  uint8_t *genie, uint8_t *total_ielen,
-				  uint8_t temp_ie_id)
-{
-	beacon_data_t *pBeacon = pHostapdAdapter->sessionCtx.ap.beacon;
-	int left = pBeacon->tail_len;
-	uint8_t *ptr = pBeacon->tail;
-	uint8_t elem_id, elem_len;
-	uint16_t ielen = 0;
-
-	if (NULL == ptr || 0 == left)
-		return;
-
-	while (left >= 2) {
-		elem_id = ptr[0];
-		elem_len = ptr[1];
-		left -= 2;
-		if (elem_len > left) {
-			hddLog(LOGE,
-			       FL("****Invalid IEs eid = %d elem_len=%d left=%d*****"),
-			       elem_id, elem_len, left);
-			return;
-		}
-
-		if (temp_ie_id == elem_id) {
-			ielen = ptr[1] + 2;
-			if ((*total_ielen + ielen) <= MAX_GENIE_LEN) {
-				cdf_mem_copy(&genie[*total_ielen], ptr, ielen);
-				*total_ielen += ielen;
-			} else {
-				hddLog(LOGE,
-				       FL("IE Length is too big IEs eid=%d elem_len=%d total_ie_lent=%d"),
-				       elem_id, elem_len, *total_ielen);
-			}
-		}
-
-		left -= elem_len;
-		ptr += (elem_len + 2);
-	}
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_alloc_new_beacon() - alloc beacon in ap mode
- * @pAdapter: Pointer to hostapd adapter
- * @ppBeacon: Pointer to pointer to beacon data
- * @params: Pointer to beacon parameters
- * @dtim_period: DTIM period
- *
- * Return: 0 for success non-zero for failure
- */
-int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter,
-				       beacon_data_t **ppBeacon,
-				       struct cfg80211_beacon_data *params,
-				       int dtim_period)
-{
-	int size;
-	beacon_data_t *beacon = NULL;
-	beacon_data_t *old = NULL;
-	int head_len, tail_len, proberesp_ies_len, assocresp_ies_len;
-	const u8 *head, *tail, *proberesp_ies, *assocresp_ies;
-
-	ENTER();
-	if (params->head && !params->head_len) {
-		hddLog(LOGE, FL("head_len is NULL"));
-		return -EINVAL;
-	}
-
-	old = pAdapter->sessionCtx.ap.beacon;
-
-	if (!params->head && !old) {
-		hddLog(LOGE, FL("session(%d) old and new heads points to NULL"),
-		       pAdapter->sessionId);
-		return -EINVAL;
-	}
-
-	if (params->head) {
-		head_len = params->head_len;
-		head = params->head;
-	} else {
-		head_len = old->head_len;
-		head = old->head;
-	}
-
-	if (params->tail || !old) {
-		tail_len = params->tail_len;
-		tail = params->tail;
-	} else {
-		tail_len = old->tail_len;
-		tail = old->tail;
-	}
-
-	if (params->proberesp_ies || !old) {
-		proberesp_ies_len = params->proberesp_ies_len;
-		proberesp_ies = params->proberesp_ies;
-	} else {
-		proberesp_ies_len = old->proberesp_ies_len;
-		proberesp_ies = old->proberesp_ies;
-	}
-
-	if (params->assocresp_ies || !old) {
-		assocresp_ies_len = params->assocresp_ies_len;
-		assocresp_ies = params->assocresp_ies;
-	} else {
-		assocresp_ies_len = old->assocresp_ies_len;
-		assocresp_ies = old->assocresp_ies;
-	}
-
-	size = sizeof(beacon_data_t) + head_len + tail_len +
-		proberesp_ies_len + assocresp_ies_len;
-
-	beacon = kzalloc(size, GFP_KERNEL);
-
-	if (beacon == NULL) {
-		hddLog(LOGE,
-		       FL("Mem allocation for beacon failed"));
-		return -ENOMEM;
-	}
-	if (dtim_period)
-		beacon->dtim_period = dtim_period;
-	else if (old)
-		beacon->dtim_period = old->dtim_period;
-	/* -----------------------------------------------
-	 * | head | tail | proberesp_ies | assocresp_ies |
-	 * -----------------------------------------------
-	 */
-	beacon->head = ((u8 *) beacon) + sizeof(beacon_data_t);
-	beacon->tail = beacon->head + head_len;
-	beacon->proberesp_ies = beacon->tail + tail_len;
-	beacon->assocresp_ies = beacon->proberesp_ies + proberesp_ies_len;
-
-	beacon->head_len = head_len;
-	beacon->tail_len = tail_len;
-	beacon->proberesp_ies_len = proberesp_ies_len;
-	beacon->assocresp_ies_len = assocresp_ies_len;
-
-	if (head && head_len)
-		memcpy(beacon->head, head, head_len);
-	if (tail && tail_len)
-		memcpy(beacon->tail, tail, tail_len);
-	if (proberesp_ies && proberesp_ies_len)
-		memcpy(beacon->proberesp_ies, proberesp_ies, proberesp_ies_len);
-	if (assocresp_ies && assocresp_ies_len)
-		memcpy(beacon->assocresp_ies, assocresp_ies, assocresp_ies_len);
-
-	*ppBeacon = beacon;
-
-	kfree(old);
-
-	return 0;
-
-}
-
-/**
- * wlan_hdd_cfg80211_update_apies() - update ap mode ies
- * @adapter: Pointer to hostapd adapter
- *
- * Return: 0 for success non-zero for failure
- */
-int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter)
-{
-	uint8_t *genie;
-	uint8_t total_ielen = 0;
-	int ret = 0;
-	tsap_Config_t *pConfig;
-	tSirUpdateIE updateIE;
-	beacon_data_t *beacon = NULL;
-
-	pConfig = &adapter->sessionCtx.ap.sapConfig;
-	beacon = adapter->sessionCtx.ap.beacon;
-
-	genie = cdf_mem_malloc(MAX_GENIE_LEN);
-
-	if (genie == NULL)
-		return -ENOMEM;
-
-	if (0 != wlan_hdd_add_ie(adapter, genie,
-		&total_ielen, WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE)) {
-		hddLog(LOGE, FL("Adding WPS IE failed"));
-		ret = -EINVAL;
-		goto done;
-	}
-#ifdef WLAN_FEATURE_WFD
-	if (0 != wlan_hdd_add_ie(adapter, genie,
-		&total_ielen, WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE)) {
-		hddLog(LOGE, FL("Adding WFD IE failed"));
-		ret = -EINVAL;
-		goto done;
-	}
-#endif
-
-#ifdef FEATURE_WLAN_WAPI
-	if (WLAN_HDD_SOFTAP == adapter->device_mode) {
-		wlan_hdd_add_extra_ie(adapter, genie, &total_ielen,
-				      WLAN_EID_WAPI);
-	}
-#endif
-
-	if (adapter->device_mode == WLAN_HDD_SOFTAP ||
-		adapter->device_mode == WLAN_HDD_P2P_GO)
-		wlan_hdd_add_hostapd_conf_vsie(adapter, genie,
-					       &total_ielen);
-
-	if (wlan_hdd_add_ie(adapter, genie,
-		&total_ielen, P2P_OUI_TYPE, P2P_OUI_TYPE_SIZE) != 0) {
-		hddLog(LOGE, FL("Adding P2P IE failed"));
-		ret = -EINVAL;
-		goto done;
-	}
-
-#ifdef QCA_HT_2040_COEX
-	if (WLAN_HDD_SOFTAP == adapter->device_mode) {
-		tSmeConfigParams smeConfig;
-		cdf_mem_zero(&smeConfig, sizeof(smeConfig));
-		sme_get_config_param(WLAN_HDD_GET_HAL_CTX(adapter),
-				     &smeConfig);
-		if (smeConfig.csrConfig.obssEnabled)
-			wlan_hdd_add_extra_ie(adapter, genie,
-					      &total_ielen,
-					      WLAN_EID_OVERLAP_BSS_SCAN_PARAM);
-	}
-#endif
-	cdf_copy_macaddr(&updateIE.bssid, &adapter->macAddressCurrent);
-	updateIE.smeSessionId = adapter->sessionId;
-
-	if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
-		updateIE.ieBufferlength = total_ielen;
-		updateIE.pAdditionIEBuffer = genie;
-		updateIE.append = false;
-		updateIE.notify = true;
-		if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
-				      &updateIE,
-				      eUPDATE_IE_PROBE_BCN) ==
-		    CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE,
-			       FL("Could not pass on Add Ie probe beacon data"));
-			ret = -EINVAL;
-			goto done;
-		}
-		wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_PROBE_BCN);
-	} else {
-		wlansap_update_sap_config_add_ie(pConfig,
-						 genie,
-						 total_ielen,
-						 eUPDATE_IE_PROBE_BCN);
-	}
-
-	/* Added for Probe Response IE */
-	if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
-		updateIE.ieBufferlength = beacon->proberesp_ies_len;
-		updateIE.pAdditionIEBuffer = (uint8_t *) beacon->proberesp_ies;
-		updateIE.append = false;
-		updateIE.notify = false;
-		if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
-				      &updateIE,
-				      eUPDATE_IE_PROBE_RESP) ==
-		    CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE,
-			       FL("Could not pass on PROBE_RESP add Ie data"));
-			ret = -EINVAL;
-			goto done;
-		}
-		wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_PROBE_RESP);
-	} else {
-		wlansap_update_sap_config_add_ie(pConfig,
-						 beacon->proberesp_ies,
-						 beacon->proberesp_ies_len,
-						 eUPDATE_IE_PROBE_RESP);
-	}
-
-	/* Assoc resp Add ie Data */
-	if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
-		updateIE.ieBufferlength = beacon->assocresp_ies_len;
-		updateIE.pAdditionIEBuffer = (uint8_t *) beacon->assocresp_ies;
-		updateIE.append = false;
-		updateIE.notify = false;
-		if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
-				      &updateIE,
-				      eUPDATE_IE_ASSOC_RESP) ==
-		    CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE,
-				FL("Could not pass on Add Ie Assoc Response data"));
-			ret = -EINVAL;
-			goto done;
-		}
-		wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_ASSOC_RESP);
-	} else {
-		wlansap_update_sap_config_add_ie(pConfig,
-						 beacon->assocresp_ies,
-						 beacon->assocresp_ies_len,
-						 eUPDATE_IE_ASSOC_RESP);
-	}
-
-done:
-	cdf_mem_free(genie);
-	return ret;
-}
-
-/**
- * wlan_hdd_set_sap_hwmode() - set sap hw mode
- * @pHostapdAdapter: Pointer to hostapd adapter
- *
- * Return: none
- */
-static void wlan_hdd_set_sap_hwmode(hdd_adapter_t *pHostapdAdapter)
-{
-	tsap_Config_t *pConfig = &pHostapdAdapter->sessionCtx.ap.sapConfig;
-	beacon_data_t *pBeacon = pHostapdAdapter->sessionCtx.ap.beacon;
-	struct ieee80211_mgmt *pMgmt_frame =
-		(struct ieee80211_mgmt *)pBeacon->head;
-	u8 checkRatesfor11g = true;
-	u8 require_ht = false, require_vht = false;
-	u8 *pIe = NULL;
-
-	pConfig->SapHw_mode = eCSR_DOT11_MODE_11b;
-
-	pIe = wlan_hdd_cfg80211_get_ie_ptr(&pMgmt_frame->u.beacon.variable[0],
-					   pBeacon->head_len,
-					   WLAN_EID_SUPP_RATES);
-	if (pIe != NULL) {
-		pIe += 1;
-		wlan_hdd_check_11gmode(pIe, &require_ht, &require_vht,
-			&checkRatesfor11g, &pConfig->SapHw_mode);
-	}
-
-	pIe = wlan_hdd_cfg80211_get_ie_ptr(pBeacon->tail, pBeacon->tail_len,
-					   WLAN_EID_EXT_SUPP_RATES);
-	if (pIe != NULL) {
-		pIe += 1;
-		wlan_hdd_check_11gmode(pIe, &require_ht, &require_vht,
-			&checkRatesfor11g, &pConfig->SapHw_mode);
-	}
-
-	if (pConfig->channel > 14)
-		pConfig->SapHw_mode = eCSR_DOT11_MODE_11a;
-
-	pIe = wlan_hdd_cfg80211_get_ie_ptr(pBeacon->tail, pBeacon->tail_len,
-					   WLAN_EID_HT_CAPABILITY);
-
-	if (pIe) {
-		pConfig->SapHw_mode = eCSR_DOT11_MODE_11n;
-		if (require_ht)
-			pConfig->SapHw_mode = eCSR_DOT11_MODE_11n_ONLY;
-	}
-
-	pIe = wlan_hdd_cfg80211_get_ie_ptr(pBeacon->tail, pBeacon->tail_len,
-					   WLAN_EID_VHT_CAPABILITY);
-
-	if (pIe) {
-		pConfig->SapHw_mode = eCSR_DOT11_MODE_11ac;
-		if (require_vht)
-			pConfig->SapHw_mode = eCSR_DOT11_MODE_11ac_ONLY;
-	}
-}
-
-/**
- * wlan_hdd_config_acs() - config ACS needed parameters
- * @hdd_ctx: HDD context
- * @adapter: Adapter pointer
- *
- * This function get ACS related INI paramters and populated
- * sap config and smeConfig for ACS needed configurations.
- *
- * Return: The CDF_STATUS code associated with performing the operation.
- */
-CDF_STATUS wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
-{
-	tsap_Config_t *sap_config;
-	struct hdd_config *ini_config;
-	tHalHandle hal;
-
-	hal = WLAN_HDD_GET_HAL_CTX(adapter);
-	sap_config = &adapter->sessionCtx.ap.sapConfig;
-	ini_config = hdd_ctx->config;
-
-	sap_config->enOverLapCh = !!hdd_ctx->config->gEnableOverLapCh;
-
-#if defined(WLAN_FEATURE_MBSSID) && defined(FEATURE_WLAN_AP_AP_ACS_OPTIMIZE)
-	hddLog(LOG1, FL("HDD_ACS_SKIP_STATUS = %d"),
-						hdd_ctx->skip_acs_scan_status);
-	if (hdd_ctx->skip_acs_scan_status == eSAP_SKIP_ACS_SCAN) {
-		hdd_adapter_t *con_sap_adapter;
-		tsap_Config_t *con_sap_config = NULL;
-
-		con_sap_adapter = hdd_get_con_sap_adapter(adapter, false);
-
-		if (con_sap_adapter)
-			con_sap_config =
-				&con_sap_adapter->sessionCtx.ap.sapConfig;
-
-		sap_config->acs_cfg.skip_scan_status = eSAP_DO_NEW_ACS_SCAN;
-
-		if (con_sap_config &&
-			con_sap_config->acs_cfg.acs_mode == true &&
-			hdd_ctx->skip_acs_scan_status == eSAP_SKIP_ACS_SCAN &&
-			con_sap_config->acs_cfg.hw_mode ==
-						sap_config->acs_cfg.hw_mode) {
-			uint8_t con_sap_st_ch, con_sap_end_ch;
-			uint8_t cur_sap_st_ch, cur_sap_end_ch;
-			uint8_t bandStartChannel, bandEndChannel;
-
-			con_sap_st_ch =
-					con_sap_config->acs_cfg.start_ch;
-			con_sap_end_ch =
-					con_sap_config->acs_cfg.end_ch;
-			cur_sap_st_ch = sap_config->acs_cfg.start_ch;
-			cur_sap_end_ch = sap_config->acs_cfg.end_ch;
-
-			wlansap_extend_to_acs_range(
-					&cur_sap_st_ch, &cur_sap_end_ch,
-					&bandStartChannel, &bandEndChannel);
-
-			wlansap_extend_to_acs_range(
-					&con_sap_st_ch, &con_sap_end_ch,
-					&bandStartChannel, &bandEndChannel);
-
-			if (con_sap_st_ch <= cur_sap_st_ch &&
-					con_sap_end_ch >= cur_sap_end_ch) {
-				sap_config->acs_cfg.skip_scan_status =
-							eSAP_SKIP_ACS_SCAN;
-
-			} else if (con_sap_st_ch >= cur_sap_st_ch &&
-					con_sap_end_ch >= cur_sap_end_ch) {
-				sap_config->acs_cfg.skip_scan_status =
-							eSAP_DO_PAR_ACS_SCAN;
-
-				sap_config->acs_cfg.skip_scan_range1_stch =
-							cur_sap_st_ch;
-				sap_config->acs_cfg.skip_scan_range1_endch =
-							con_sap_st_ch - 1;
-				sap_config->acs_cfg.skip_scan_range2_stch =
-							0;
-				sap_config->acs_cfg.skip_scan_range2_endch =
-							0;
-
-			} else if (con_sap_st_ch <= cur_sap_st_ch &&
-				con_sap_end_ch <= cur_sap_end_ch) {
-				sap_config->acs_cfg.skip_scan_status =
-							eSAP_DO_PAR_ACS_SCAN;
-
-				sap_config->acs_cfg.skip_scan_range1_stch =
-							con_sap_end_ch + 1;
-				sap_config->acs_cfg.skip_scan_range1_endch =
-							cur_sap_end_ch;
-				sap_config->acs_cfg.skip_scan_range2_stch =
-							0;
-				sap_config->acs_cfg.skip_scan_range2_endch =
-							0;
-
-			} else if (con_sap_st_ch >= cur_sap_st_ch &&
-				con_sap_end_ch <= cur_sap_end_ch) {
-				sap_config->acs_cfg.skip_scan_status =
-							eSAP_DO_PAR_ACS_SCAN;
-
-				sap_config->acs_cfg.skip_scan_range1_stch =
-							cur_sap_st_ch;
-				sap_config->acs_cfg.skip_scan_range1_endch =
-							con_sap_st_ch - 1;
-				sap_config->acs_cfg.skip_scan_range2_stch =
-							con_sap_end_ch;
-				sap_config->acs_cfg.skip_scan_range2_endch =
-							cur_sap_end_ch + 1;
-
-			} else
-				sap_config->acs_cfg.skip_scan_status =
-							eSAP_DO_NEW_ACS_SCAN;
-
-
-			hddLog(LOG1, FL(
-				"SecAP ACS Skip=%d, ACS CH RANGE=%d-%d, %d-%d"),
-				sap_config->acs_cfg.skip_scan_status,
-				sap_config->acs_cfg.skip_scan_range1_stch,
-				sap_config->acs_cfg.skip_scan_range1_endch,
-				sap_config->acs_cfg.skip_scan_range2_stch,
-				sap_config->acs_cfg.skip_scan_range2_endch);
-		}
-	}
-#endif
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_hdd_setup_driver_overrides : Overrides SAP / P2P GO Params
- * @adapter: pointer to adapter struct
- *
- * This function overrides SAP / P2P Go configuration based on driver INI
- * parameters for 11AC override and ACS. This overrides are done to support
- * android legacy configuration method.
- *
- * NOTE: Non android platform supports concurrency and these overrides shall
- * not be used. Also future driver based overrides shall be consolidated in this
- * function only. Avoid random overrides in other location based on ini.
- *
- * Return: 0 for Success or Negative error codes.
- */
-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);
-	tHalHandle h_hal = WLAN_HDD_GET_HAL_CTX(ap_adapter);
-
-	if (ap_adapter->device_mode == WLAN_HDD_SOFTAP &&
-				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
-	 *    configured to setup VHT channel width in wpa_supplicant
-	 * 2. Android UI does not provide advanced configuration options for SAP
-	 *
-	 * Default override enabled (for android). MDM shall disable this in ini
-	 */
-	if (hdd_ctx->config->sap_p2p_11ac_override &&
-			(sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n ||
-			sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac ||
-			sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY)) {
-		hddLog(LOG1, FL("** Driver force 11AC override for SAP/Go **"));
-
-		/* 11n only shall not be overridden since it may be on purpose*/
-		if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n)
-			sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11ac;
-
-		if (sap_cfg->channel >= 36)
-			sap_cfg->ch_width_orig =
-					hdd_ctx->config->vhtChannelWidth;
-		else
-			sap_cfg->ch_width_orig =
-				hdd_ctx->config->nChannelBondingMode24GHz ?
-				eHT_CHANNEL_WIDTH_40MHZ :
-				eHT_CHANNEL_WIDTH_20MHZ;
-	}
-	sap_cfg->ch_params.ch_width = sap_cfg->ch_width_orig;
-	sme_set_ch_params(h_hal, sap_cfg->SapHw_mode, sap_cfg->channel,
-				sap_cfg->sec_ch, &sap_cfg->ch_params);
-
-	return 0;
-
-setup_acs_overrides:
-	hddLog(LOGE, FL("** 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) {
-		hddLog(LOGE, FL("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 ((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) {
-		hddLog(LOGE, FL("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;
-
-	hddLog(LOG1, FL("Force ACS Config: HW_MODE: %d ACS_BW: %d"),
-		sap_cfg->acs_cfg.hw_mode, sap_cfg->acs_cfg.ch_width);
-	hddLog(LOG1, FL("Force ACS Config: ST_CH: %d END_CH: %d"),
-		sap_cfg->acs_cfg.start_ch, sap_cfg->acs_cfg.end_ch);
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_start_bss() - start bss
- * @pHostapdAdapter: Pointer to hostapd adapter
- * @params: Pointer to start bss beacon parameters
- * @ssid: Pointer ssid
- * @ssid_len: Length of ssid
- * @hidden_ssid: Hidden SSID parameter
- *
- * Return: 0 for success non-zero for failure
- */
-static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
-				       struct cfg80211_beacon_data *params,
-				       const u8 *ssid, size_t ssid_len,
-				       enum nl80211_hidden_ssid hidden_ssid)
-{
-	tsap_Config_t *pConfig;
-	beacon_data_t *pBeacon = NULL;
-	struct ieee80211_mgmt *pMgmt_frame;
-	uint8_t *pIe = NULL;
-	uint16_t capab_info;
-	eCsrAuthType RSNAuthType;
-	eCsrEncryptionType RSNEncryptType;
-	eCsrEncryptionType mcRSNEncryptType;
-	int status = CDF_STATUS_SUCCESS, ret;
-	tpWLAN_SAPEventCB pSapEventCallback;
-	hdd_hostapd_state_t *pHostapdState;
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t p_cds_context =
-		(WLAN_HDD_GET_CTX(pHostapdAdapter))->pcds_context;
-#endif
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
-	struct qc_mac_acl_entry *acl_entry = NULL;
-	int32_t i;
-	struct hdd_config *iniConfig;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter);
-	tSmeConfigParams sme_config;
-	bool MFPCapable = false;
-	bool MFPRequired = false;
-	uint16_t prev_rsn_length = 0;
-	ENTER();
-
-	if (cds_is_connection_in_progress()) {
-		hdd_err("Can't start BSS: connection is in progress");
-		return -EINVAL;
-	}
-
-	iniConfig = pHddCtx->config;
-	pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pHostapdAdapter);
-
-	clear_bit(ACS_PENDING, &pHostapdAdapter->event_flags);
-	clear_bit(ACS_IN_PROGRESS, &pHddCtx->g_event_flags);
-
-	pConfig = &pHostapdAdapter->sessionCtx.ap.sapConfig;
-
-	pBeacon = pHostapdAdapter->sessionCtx.ap.beacon;
-
-	pMgmt_frame = (struct ieee80211_mgmt *)pBeacon->head;
-
-	pConfig->beacon_int = pMgmt_frame->u.beacon.beacon_int;
-
-	pConfig->disableDFSChSwitch = iniConfig->disableDFSChSwitch;
-
-	/* channel is already set in the set_channel Call back */
-	/* pConfig->channel = pCommitConfig->channel; */
-
-	/* Protection parameter to enable or disable */
-	pConfig->protEnabled = iniConfig->apProtEnabled;
-
-	pConfig->dtim_period = pBeacon->dtim_period;
-
-	hddLog(LOG2, FL("****pConfig->dtim_period=%d***"),
-		pConfig->dtim_period);
-
-	if (pHostapdAdapter->device_mode == WLAN_HDD_SOFTAP) {
-		pIe =
-			wlan_hdd_cfg80211_get_ie_ptr(pBeacon->tail,
-						     pBeacon->tail_len,
-						     WLAN_EID_COUNTRY);
-		if (pIe) {
-			pConfig->ieee80211d = 1;
-			cdf_mem_copy(pConfig->countryCode, &pIe[2], 3);
-			sme_set_reg_info(hHal, pConfig->countryCode);
-			sme_apply_channel_power_info_to_fw(hHal);
-		} else {
-			pConfig->countryCode[0] = pHddCtx->reg.alpha2[0];
-			pConfig->countryCode[1] = pHddCtx->reg.alpha2[1];
-			pConfig->ieee80211d = 0;
-		}
-
-		ret = wlan_hdd_sap_cfg_dfs_override(pHostapdAdapter);
-		if (ret < 0) {
-			return ret;
-		} else {
-			if (ret == 0) {
-				if (CDS_IS_DFS_CH(pConfig->channel))
-					pHddCtx->dev_dfs_cac_status =
-							DFS_CAC_NEVER_DONE;
-			}
-		}
-
-		if (CDF_STATUS_SUCCESS !=
-			    wlan_hdd_validate_operation_channel(pHostapdAdapter,
-							pConfig->channel)) {
-			hddLog(LOGE, FL("Invalid Channel [%d]"),
-							pConfig->channel);
-				return -EINVAL;
-		}
-
-		/* reject SAP if DFS channel scan is not allowed */
-		if (!(pHddCtx->config->enableDFSChnlScan) &&
-		    (CHANNEL_STATE_DFS == cds_get_channel_state(
-					     pConfig->channel))) {
-			hddLog(LOGE,
-				FL("not allowed to start SAP on DFS channel"));
-				return -EOPNOTSUPP;
-		}
-		wlansap_set_dfs_ignore_cac(hHal, iniConfig->ignoreCAC);
-		wlansap_set_dfs_restrict_japan_w53(hHal,
-			iniConfig->gDisableDfsJapanW53);
-		wlansap_set_dfs_preferred_channel_location(hHal,
-			iniConfig->gSapPreferredChanLocation);
-#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-		wlan_sap_set_channel_avoidance(hHal,
-					iniConfig->sap_channel_avoidance);
-#endif
-	} else if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) {
-		pConfig->countryCode[0] = pHddCtx->reg.alpha2[0];
-		pConfig->countryCode[1] = pHddCtx->reg.alpha2[1];
-		pConfig->ieee80211d = 0;
-	} else {
-		pConfig->ieee80211d = 0;
-	}
-
-	capab_info = pMgmt_frame->u.beacon.capab_info;
-
-	pConfig->privacy = (pMgmt_frame->u.beacon.capab_info &
-			    WLAN_CAPABILITY_PRIVACY) ? true : false;
-
-	(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->uPrivacy = pConfig->privacy;
-
-	/*Set wps station to configured */
-	pIe = wlan_hdd_get_wps_ie_ptr(pBeacon->tail, pBeacon->tail_len);
-
-	if (pIe) {
-		if (pIe[1] < (2 + WPS_OUI_TYPE_SIZE)) {
-			hddLog(LOGE,
-			       FL("**Wps Ie Length is too small***"));
-			return -EINVAL;
-		} else if (memcmp(&pIe[2], WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE) ==
-			   0) {
-			hddLog(LOG1, FL("** WPS IE(len %d) ***"), (pIe[1] + 2));
-			/* Check 15 bit of WPS IE as it contain information for
-			 * wps state
-			 */
-			if (SAP_WPS_ENABLED_UNCONFIGURED == pIe[15]) {
-				pConfig->wps_state =
-					SAP_WPS_ENABLED_UNCONFIGURED;
-			} else if (SAP_WPS_ENABLED_CONFIGURED == pIe[15]) {
-				pConfig->wps_state = SAP_WPS_ENABLED_CONFIGURED;
-			}
-		}
-	} else {
-		hdd_info("WPS disabled");
-		pConfig->wps_state = SAP_WPS_DISABLED;
-	}
-	/* Forward WPS PBC probe request frame up */
-	pConfig->fwdWPSPBCProbeReq = 1;
-
-	pConfig->RSNEncryptType = eCSR_ENCRYPT_TYPE_NONE;
-	pConfig->mcRSNEncryptType = eCSR_ENCRYPT_TYPE_NONE;
-	(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->ucEncryptType =
-		eCSR_ENCRYPT_TYPE_NONE;
-
-	pConfig->RSNWPAReqIELength = 0;
-	memset(&pConfig->RSNWPAReqIE[0], 0, sizeof(pConfig->RSNWPAReqIE));
-	pIe = wlan_hdd_cfg80211_get_ie_ptr(pBeacon->tail, pBeacon->tail_len,
-					   WLAN_EID_RSN);
-	if (pIe && pIe[1]) {
-		pConfig->RSNWPAReqIELength = pIe[1] + 2;
-		if (pConfig->RSNWPAReqIELength < sizeof(pConfig->RSNWPAReqIE))
-			memcpy(&pConfig->RSNWPAReqIE[0], pIe,
-			       pConfig->RSNWPAReqIELength);
-		else
-			hddLog(LOGE,
-			       FL("RSNWPA IE MAX Length exceeded; length =%d"),
-			       pConfig->RSNWPAReqIELength);
-		/* The actual processing may eventually be more extensive than
-		 * this. Right now, just consume any PMKIDs that are  sent in
-		 * by the app.
-		 * */
-		status =
-			hdd_softap_unpack_ie(cds_get_context
-						     (CDF_MODULE_ID_SME),
-					     &RSNEncryptType, &mcRSNEncryptType,
-					     &RSNAuthType, &MFPCapable,
-					     &MFPRequired,
-					     pConfig->RSNWPAReqIE[1] + 2,
-					     pConfig->RSNWPAReqIE);
-
-		if (CDF_STATUS_SUCCESS == status) {
-			/* Now copy over all the security attributes you have
-			 * parsed out. Use the cipher type in the RSN IE
-			 */
-			pConfig->RSNEncryptType = RSNEncryptType;
-			pConfig->mcRSNEncryptType = mcRSNEncryptType;
-			(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->
-			ucEncryptType = RSNEncryptType;
-			hddLog(LOG1,
-			       FL("CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d"),
-			       RSNAuthType, RSNEncryptType, mcRSNEncryptType);
-		}
-	}
-
-	pIe = wlan_hdd_get_vendor_oui_ie_ptr(WPA_OUI_TYPE, WPA_OUI_TYPE_SIZE,
-					     pBeacon->tail, pBeacon->tail_len);
-
-	if (pIe && pIe[1] && (pIe[0] == DOT11F_EID_WPA)) {
-		if (pConfig->RSNWPAReqIE[0]) {
-			/*Mixed mode WPA/WPA2 */
-			prev_rsn_length = pConfig->RSNWPAReqIELength;
-			pConfig->RSNWPAReqIELength += pIe[1] + 2;
-			if (pConfig->RSNWPAReqIELength <
-			    sizeof(pConfig->RSNWPAReqIE))
-				memcpy(&pConfig->RSNWPAReqIE[0] +
-				       prev_rsn_length, pIe, pIe[1] + 2);
-			else
-				hddLog(LOGE,
-				       "RSNWPA IE MAX Length exceeded; length =%d",
-				       pConfig->RSNWPAReqIELength);
-		} else {
-			pConfig->RSNWPAReqIELength = pIe[1] + 2;
-			if (pConfig->RSNWPAReqIELength <
-			    sizeof(pConfig->RSNWPAReqIE))
-				memcpy(&pConfig->RSNWPAReqIE[0], pIe,
-				       pConfig->RSNWPAReqIELength);
-			else
-				hddLog(LOGE,
-				       "RSNWPA IE MAX Length exceeded; length =%d",
-				       pConfig->RSNWPAReqIELength);
-			status = hdd_softap_unpack_ie
-					(cds_get_context(CDF_MODULE_ID_SME),
-					 &RSNEncryptType,
-					 &mcRSNEncryptType, &RSNAuthType,
-					 &MFPCapable, &MFPRequired,
-					 pConfig->RSNWPAReqIE[1] + 2,
-					 pConfig->RSNWPAReqIE);
-
-			if (CDF_STATUS_SUCCESS == status) {
-				/* Now copy over all the security attributes
-				 * you have parsed out. Use the cipher type
-				 * in the RSN IE
-				 */
-				pConfig->RSNEncryptType = RSNEncryptType;
-				pConfig->mcRSNEncryptType = mcRSNEncryptType;
-				(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->
-				ucEncryptType = RSNEncryptType;
-				hddLog(LOG1,
-				       FL("CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d"),
-				       RSNAuthType, RSNEncryptType,
-				       mcRSNEncryptType);
-			}
-		}
-	}
-
-	if (pConfig->RSNWPAReqIELength > sizeof(pConfig->RSNWPAReqIE)) {
-		hddLog(LOGE,
-		       FL("**RSNWPAReqIELength is too large***"));
-		return -EINVAL;
-	}
-
-	pConfig->SSIDinfo.ssidHidden = false;
-
-	if (ssid != NULL) {
-		cdf_mem_copy(pConfig->SSIDinfo.ssid.ssId, ssid, ssid_len);
-		pConfig->SSIDinfo.ssid.length = ssid_len;
-
-		switch (hidden_ssid) {
-		case NL80211_HIDDEN_SSID_NOT_IN_USE:
-			hddLog(LOG1, "HIDDEN_SSID_NOT_IN_USE");
-			pConfig->SSIDinfo.ssidHidden = eHIDDEN_SSID_NOT_IN_USE;
-			break;
-		case NL80211_HIDDEN_SSID_ZERO_LEN:
-			hddLog(LOG1, "HIDDEN_SSID_ZERO_LEN");
-			pConfig->SSIDinfo.ssidHidden = eHIDDEN_SSID_ZERO_LEN;
-			break;
-		case NL80211_HIDDEN_SSID_ZERO_CONTENTS:
-			hddLog(LOG1, "HIDDEN_SSID_ZERO_CONTENTS");
-			pConfig->SSIDinfo.ssidHidden =
-				eHIDDEN_SSID_ZERO_CONTENTS;
-			break;
-		default:
-			hddLog(LOGE, "Wrong hidden_ssid param %d", hidden_ssid);
-			break;
-		}
-	}
-
-	cdf_mem_copy(pConfig->self_macaddr.bytes,
-		     pHostapdAdapter->macAddressCurrent.bytes,
-		     CDF_MAC_ADDR_SIZE);
-
-	/* default value */
-	pConfig->SapMacaddr_acl = eSAP_ACCEPT_UNLESS_DENIED;
-	pConfig->num_accept_mac = 0;
-	pConfig->num_deny_mac = 0;
-#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-	/*
-	 * We don't want P2PGO to follow STA's channel
-	 * so lets limit the logic for SAP only.
-	 * Later if we decide to make p2pgo follow STA's
-	 * channel then remove this check.
-	 */
-	if ((0 == pHddCtx->config->conc_custom_rule1) ||
-		(pHddCtx->config->conc_custom_rule1 &&
-		WLAN_HDD_SOFTAP == pHostapdAdapter->device_mode))
-		pConfig->cc_switch_mode = iniConfig->WlanMccToSccSwitchMode;
-#endif
-
-	pIe =
-		wlan_hdd_get_vendor_oui_ie_ptr(BLACKLIST_OUI_TYPE,
-					       WPA_OUI_TYPE_SIZE, pBeacon->tail,
-					       pBeacon->tail_len);
-
-	/* pIe for black list is following form:
-	 * type    : 1 byte
-	 * length  : 1 byte
-	 * OUI     : 4 bytes
-	 * acl type : 1 byte
-	 * no of mac addr in black list: 1 byte
-	 * list of mac_acl_entries: variable, 6 bytes per mac
-	 * address + sizeof(int) for vlan id
-	 */
-	if ((pIe != NULL) && (pIe[1] != 0)) {
-		pConfig->SapMacaddr_acl = pIe[6];
-		pConfig->num_deny_mac = pIe[7];
-		hddLog(LOG1,
-			FL("acl type = %d no deny mac = %d"), pIe[6], pIe[7]);
-		if (pConfig->num_deny_mac > MAX_ACL_MAC_ADDRESS)
-			pConfig->num_deny_mac = MAX_ACL_MAC_ADDRESS;
-		acl_entry = (struct qc_mac_acl_entry *)(pIe + 8);
-		for (i = 0; i < pConfig->num_deny_mac; i++) {
-			cdf_mem_copy(&pConfig->deny_mac[i], acl_entry->addr,
-				     sizeof(qcmacaddr));
-			acl_entry++;
-		}
-	}
-	pIe = wlan_hdd_get_vendor_oui_ie_ptr(WHITELIST_OUI_TYPE,
-			WPA_OUI_TYPE_SIZE, pBeacon->tail,
-			pBeacon->tail_len);
-
-	/* pIe for white list is following form:
-	 * type    : 1 byte
-	 * length  : 1 byte
-	 * OUI     : 4 bytes
-	 * acl type : 1 byte
-	 * no of mac addr in white list: 1 byte
-	 * list of mac_acl_entries: variable, 6 bytes per mac
-	 * address + sizeof(int) for vlan id
-	 */
-	if ((pIe != NULL) && (pIe[1] != 0)) {
-		pConfig->SapMacaddr_acl = pIe[6];
-		pConfig->num_accept_mac = pIe[7];
-		hddLog(LOG1, FL("acl type = %d no accept mac = %d"),
-		       pIe[6], pIe[7]);
-		if (pConfig->num_accept_mac > MAX_ACL_MAC_ADDRESS)
-			pConfig->num_accept_mac = MAX_ACL_MAC_ADDRESS;
-		acl_entry = (struct qc_mac_acl_entry *)(pIe + 8);
-		for (i = 0; i < pConfig->num_accept_mac; i++) {
-			cdf_mem_copy(&pConfig->accept_mac[i], acl_entry->addr,
-				     sizeof(qcmacaddr));
-			acl_entry++;
-		}
-	}
-
-	wlan_hdd_set_sap_hwmode(pHostapdAdapter);
-	cdf_mem_zero(&sme_config, sizeof(tSmeConfigParams));
-	sme_get_config_param(pHddCtx->hHal, &sme_config);
-	/* Override hostapd.conf wmm_enabled only for 11n and 11AC configs (IOT)
-	 * As per spec 11N/AC STA are QOS STA and may not connect or throughput
-	 * may not be good with non QOS 11N AP
-	 * Default: enable QOS for SAP unless WMM IE not present for 11bga
-	 */
-	sme_config.csrConfig.WMMSupportMode = eCsrRoamWmmAuto;
-	pIe = wlan_hdd_get_vendor_oui_ie_ptr(WMM_OUI_TYPE, WMM_OUI_TYPE_SIZE,
-					pBeacon->tail, pBeacon->tail_len);
-	if (!pIe && (pConfig->SapHw_mode == eCSR_DOT11_MODE_11a ||
-		pConfig->SapHw_mode == eCSR_DOT11_MODE_11g ||
-		pConfig->SapHw_mode == eCSR_DOT11_MODE_11b))
-		sme_config.csrConfig.WMMSupportMode = eCsrRoamWmmNoQos;
-	sme_update_config(pHddCtx->hHal, &sme_config);
-
-	if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80P80) {
-		if (pHddCtx->isVHT80Allowed == false)
-			pConfig->ch_width_orig = CH_WIDTH_40MHZ;
-		else
-			pConfig->ch_width_orig = CH_WIDTH_80P80MHZ;
-	} else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_160) {
-		if (pHddCtx->isVHT80Allowed == false)
-			pConfig->ch_width_orig = CH_WIDTH_40MHZ;
-		else
-			pConfig->ch_width_orig = CH_WIDTH_160MHZ;
-	} else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80) {
-		if (pHddCtx->isVHT80Allowed == false)
-			pConfig->ch_width_orig = CH_WIDTH_40MHZ;
-		else
-			pConfig->ch_width_orig = CH_WIDTH_80MHZ;
-	} else if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_40) {
-		pConfig->ch_width_orig = CH_WIDTH_40MHZ;
-	} else {
-		pConfig->ch_width_orig = CH_WIDTH_20MHZ;
-	}
-
-	if (wlan_hdd_setup_driver_overrides(pHostapdAdapter))
-		return -EINVAL;
-
-	/* ht_capab is not what the name conveys,this is used for protection
-	 * bitmap */
-	pConfig->ht_capab = iniConfig->apProtection;
-
-	if (0 != wlan_hdd_cfg80211_update_apies(pHostapdAdapter)) {
-		hddLog(LOGE, FL("SAP Not able to set AP IEs"));
-		wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_ALL);
-		return -EINVAL;
-	}
-	/* Uapsd Enabled Bit */
-	pConfig->UapsdEnable = iniConfig->apUapsdEnabled;
-	/* Enable OBSS protection */
-	pConfig->obssProtEnabled = iniConfig->apOBSSProtEnabled;
-
-	if (pHostapdAdapter->device_mode == WLAN_HDD_SOFTAP)
-		pConfig->sap_dot11mc =
-		    (WLAN_HDD_GET_CTX(pHostapdAdapter))->config->sap_dot11mc;
-	else /* for P2P-Go case */
-		pConfig->sap_dot11mc = 1;
-
-	hddLog(LOG1, FL("11MC Support Enabled : %d\n"),
-		pConfig->sap_dot11mc);
-
-#ifdef WLAN_FEATURE_11W
-	pConfig->mfpCapable = MFPCapable;
-	pConfig->mfpRequired = MFPRequired;
-	hddLog(LOG1, FL("Soft AP MFP capable %d, MFP required %d"),
-	       pConfig->mfpCapable, pConfig->mfpRequired);
-#endif
-
-	hddLog(LOGW, FL("SOftAP macaddress : " MAC_ADDRESS_STR),
-	       MAC_ADDR_ARRAY(pHostapdAdapter->macAddressCurrent.bytes));
-	hddLog(LOGW, FL("ssid =%s, beaconint=%d, channel=%d"),
-	       pConfig->SSIDinfo.ssid.ssId, (int)pConfig->beacon_int,
-	       (int)pConfig->channel);
-	hddLog(LOGW, FL("hw_mode=%x, privacy=%d, authType=%d"),
-	       pConfig->SapHw_mode, pConfig->privacy, pConfig->authType);
-	hddLog(LOGW, FL("RSN/WPALen=%d, Uapsd = %d"),
-	       (int)pConfig->RSNWPAReqIELength, pConfig->UapsdEnable);
-	hddLog(LOGW, FL("ProtEnabled = %d, OBSSProtEnabled = %d"),
-	       pConfig->protEnabled, pConfig->obssProtEnabled);
-
-	if (test_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags)) {
-		wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_ALL);
-		/* Bss already started. just return. */
-		/* TODO Probably it should update some beacon params. */
-		hddLog(LOGE, "Bss Already started...Ignore the request");
-		EXIT();
-		return 0;
-	}
-
-	if (!cds_allow_concurrency(
-				cds_convert_device_mode_to_hdd_type(
-				pHostapdAdapter->device_mode),
-				pConfig->channel, HW_MODE_20_MHZ)) {
-		hddLog(LOGW,
-			FL("This concurrency combination is not allowed"));
-		return -EINVAL;
-	}
-
-	if (!cds_set_connection_in_progress(true)) {
-		hdd_err("Can't start BSS: set connnection in progress failed");
-		return -EINVAL;
-	}
-
-	pConfig->persona = pHostapdAdapter->device_mode;
-
-	pSapEventCallback = hdd_hostapd_sap_event_cb;
-
-	(WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->dfs_cac_block_tx = true;
-
-	cdf_event_reset(&pHostapdState->cdf_event);
-	status = wlansap_start_bss(
-#ifdef WLAN_FEATURE_MBSSID
-		WLAN_HDD_GET_SAP_CTX_PTR
-			(pHostapdAdapter),
-#else
-		p_cds_context,
-#endif
-		pSapEventCallback, pConfig,
-		pHostapdAdapter->dev);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_ALL);
-		cds_set_connection_in_progress(false);
-		hddLog(LOGE, FL("SAP Start Bss fail"));
-		return -EINVAL;
-	}
-
-	hddLog(LOG1,
-	       FL("Waiting for Scan to complete(auto mode) and BSS to start"));
-
-	status = cdf_wait_single_event(&pHostapdState->cdf_event, 10000);
-
-	wlansap_reset_sap_config_add_ie(pConfig, eUPDATE_IE_ALL);
-
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(LOGE,
-			FL("ERROR: HDD cdf wait for single_event failed!!"));
-		cds_set_connection_in_progress(false);
-		sme_get_command_q_status(hHal);
-#ifdef WLAN_FEATURE_MBSSID
-		wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(pHostapdAdapter));
-#else
-		wlansap_stop_bss(p_cds_context);
-#endif
-		CDF_ASSERT(0);
-		return -EINVAL;
-	}
-	/* Succesfully started Bss update the state bit. */
-	set_bit(SOFTAP_BSS_STARTED, &pHostapdAdapter->event_flags);
-	/* Initialize WMM configuation */
-	hdd_wmm_init(pHostapdAdapter);
-	cds_incr_active_session(pHostapdAdapter->device_mode,
-					 pHostapdAdapter->sessionId);
-#ifdef DHCP_SERVER_OFFLOAD
-	if (iniConfig->enableDHCPServerOffload)
-		wlan_hdd_set_dhcp_server_offload(pHostapdAdapter);
-#endif /* DHCP_SERVER_OFFLOAD */
-
-#ifdef WLAN_FEATURE_P2P_DEBUG
-	if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) {
-		if (global_p2p_connection_status == P2P_GO_NEG_COMPLETED) {
-			global_p2p_connection_status = P2P_GO_COMPLETED_STATE;
-			hddLog(LOGE,
-				FL("[P2P State] From Go nego completed to Non-autonomous Group started"));
-		} else if (global_p2p_connection_status == P2P_NOT_ACTIVE) {
-			global_p2p_connection_status = P2P_GO_COMPLETED_STATE;
-			hddLog(LOGE,
-				FL("[P2P State] From Inactive to Autonomous Group started"));
-		}
-	}
-#endif
-
-	cds_set_connection_in_progress(false);
-	pHostapdState->bCommit = true;
-	EXIT();
-
-	return 0;
-}
-
-/**
- * __wlan_hdd_cfg80211_stop_ap() - stop soft ap
- * @wiphy: Pointer to wiphy structure
- * @dev: Pointer to net_device structure
- *
- * Return: 0 for success non-zero for failure
- */
-static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
-					struct net_device *dev)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = NULL;
-	hdd_scaninfo_t *pScanInfo = NULL;
-	hdd_adapter_t *staAdapter = NULL;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	tSirUpdateIE updateIE;
-	beacon_data_t *old;
-	int ret;
-	unsigned long rc;
-	hdd_adapter_list_node_t *pAdapterNode = NULL;
-	hdd_adapter_list_node_t *pNext = NULL;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_STOP_AP,
-			 pAdapter->sessionId, pAdapter->device_mode));
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ret;
-
-	if (!(pAdapter->device_mode == WLAN_HDD_SOFTAP ||
-	      pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
-		return -EOPNOTSUPP;
-	}
-
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-
-	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
-	while (NULL != pAdapterNode && CDF_STATUS_SUCCESS == status) {
-		staAdapter = pAdapterNode->pAdapter;
-
-		if (WLAN_HDD_INFRA_STATION == staAdapter->device_mode ||
-		    (WLAN_HDD_P2P_CLIENT == staAdapter->device_mode) ||
-		    (WLAN_HDD_P2P_GO == staAdapter->device_mode)) {
-			pScanInfo = &staAdapter->scan_info;
-
-			if (pScanInfo && pScanInfo->mScanPending) {
-				hddLog(LOG1, FL("Aborting pending scan for device mode:%d"),
-				       staAdapter->device_mode);
-				INIT_COMPLETION(pScanInfo->abortscan_event_var);
-				hdd_abort_mac_scan(staAdapter->pHddCtx,
-						   staAdapter->sessionId,
-						   eCSR_SCAN_ABORT_DEFAULT);
-				rc = wait_for_completion_timeout(
-					&pScanInfo->abortscan_event_var,
-					msecs_to_jiffies(
-						WLAN_WAIT_TIME_ABORTSCAN));
-				if (!rc) {
-					hddLog(LOGE,
-					       FL("Timeout occurred while waiting for abortscan"));
-					CDF_ASSERT(pScanInfo->mScanPending);
-				}
-			}
-		}
-
-		status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
-		pAdapterNode = pNext;
-	}
-	/*
-	 * When ever stop ap adapter gets called, we need to check
-	 * whether any restart AP work is pending. If any restart is pending
-	 * then lets finish it and go ahead from there.
-	 */
-	if (pHddCtx->config->conc_custom_rule1 &&
-	    (WLAN_HDD_SOFTAP == pAdapter->device_mode)) {
-		cds_flush_work(&pHddCtx->sap_start_work);
-		hddLog(LOGW, FL("Canceled the pending restart work"));
-		spin_lock(&pHddCtx->sap_update_info_lock);
-		pHddCtx->is_sap_restart_required = false;
-		spin_unlock(&pHddCtx->sap_update_info_lock);
-	}
-	pAdapter->sessionCtx.ap.sapConfig.acs_cfg.acs_mode = false;
-	if (pAdapter->sessionCtx.ap.sapConfig.acs_cfg.ch_list)
-		cdf_mem_free(pAdapter->sessionCtx.ap.sapConfig.acs_cfg.ch_list);
-	cdf_mem_zero(&pAdapter->sessionCtx.ap.sapConfig.acs_cfg,
-						sizeof(struct sap_acs_cfg));
-	hdd_hostapd_stop(dev);
-
-	old = pAdapter->sessionCtx.ap.beacon;
-	if (!old) {
-		hddLog(LOGE,
-		       FL("Session(%d) beacon data points to NULL"),
-		       pAdapter->sessionId);
-		return -EINVAL;
-	}
-
-	hdd_cleanup_actionframe(pHddCtx, pAdapter);
-
-	mutex_lock(&pHddCtx->sap_lock);
-	if (test_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags)) {
-		hdd_hostapd_state_t *pHostapdState =
-			WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-
-		cdf_event_reset(&pHostapdState->cdf_stop_bss_event);
-#ifdef WLAN_FEATURE_MBSSID
-		status = wlansap_stop_bss(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter));
-#else
-		status = wlansap_stop_bss(pHddCtx->pcds_context);
-#endif
-		if (CDF_IS_STATUS_SUCCESS(status)) {
-			status =
-				cdf_wait_single_event(&pHostapdState->
-						      cdf_stop_bss_event,
-						      10000);
-
-			if (!CDF_IS_STATUS_SUCCESS(status)) {
-				hddLog(LOGE,
-				       FL("HDD cdf wait for single_event failed!!"));
-				CDF_ASSERT(0);
-			}
-		}
-		clear_bit(SOFTAP_BSS_STARTED, &pAdapter->event_flags);
-		/*BSS stopped, clear the active sessions for this device mode*/
-		cds_decr_session_set_pcl(pAdapter->device_mode,
-						pAdapter->sessionId);
-		pAdapter->sessionCtx.ap.beacon = NULL;
-		kfree(old);
-	}
-	mutex_unlock(&pHddCtx->sap_lock);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("Stopping the BSS"));
-		return -EINVAL;
-	}
-
-	cdf_copy_macaddr(&updateIE.bssid, &pAdapter->macAddressCurrent);
-	updateIE.smeSessionId = pAdapter->sessionId;
-	updateIE.ieBufferlength = 0;
-	updateIE.pAdditionIEBuffer = NULL;
-	updateIE.append = true;
-	updateIE.notify = true;
-	if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(pAdapter),
-			      &updateIE,
-			      eUPDATE_IE_PROBE_BCN) == CDF_STATUS_E_FAILURE) {
-		hddLog(LOGE, FL("Could not pass on PROBE_RSP_BCN data to PE"));
-	}
-
-	if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(pAdapter),
-			      &updateIE,
-			      eUPDATE_IE_ASSOC_RESP) == CDF_STATUS_E_FAILURE) {
-		hddLog(LOGE, FL("Could not pass on ASSOC_RSP data to PE"));
-	}
-	/* Reset WNI_CFG_PROBE_RSP Flags */
-	wlan_hdd_reset_prob_rspies(pAdapter);
-
-#ifdef WLAN_FEATURE_P2P_DEBUG
-	if ((pAdapter->device_mode == WLAN_HDD_P2P_GO) &&
-	    (global_p2p_connection_status == P2P_GO_COMPLETED_STATE)) {
-		hddLog(LOGE,
-			"[P2P State] From GO completed to Inactive state GO got removed");
-		global_p2p_connection_status = P2P_NOT_ACTIVE;
-	}
-#endif
-	EXIT();
-	return ret;
-}
-
-/**
- * wlan_hdd_get_channel_bw() - get channel bandwidth
- * @width: input channel width in nl80211_chan_width value
- *
- * Return: channel width value defined by driver
- */
-static enum hw_mode_bandwidth wlan_hdd_get_channel_bw(
-					enum nl80211_chan_width width)
-{
-	enum hw_mode_bandwidth ch_bw = HW_MODE_20_MHZ;
-
-	switch (width) {
-	case NL80211_CHAN_WIDTH_20_NOHT:
-	case NL80211_CHAN_WIDTH_20:
-		ch_bw = HW_MODE_20_MHZ;
-		break;
-	case NL80211_CHAN_WIDTH_40:
-		ch_bw = HW_MODE_40_MHZ;
-		break;
-	case NL80211_CHAN_WIDTH_80:
-		ch_bw = HW_MODE_80_MHZ;
-		break;
-	case NL80211_CHAN_WIDTH_80P80:
-		ch_bw = HW_MODE_80_PLUS_80_MHZ;
-		break;
-	case NL80211_CHAN_WIDTH_160:
-		ch_bw = HW_MODE_160_MHZ;
-		break;
-	default:
-		hdd_err("Invalid width: %d, using default 20MHz", width);
-		break;
-	}
-
-	return ch_bw;
-}
-
-/**
- * wlan_hdd_cfg80211_stop_ap() - stop sap
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to netdev
- *
- * Return: zero for success non-zero for failure
- */
-int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
-				struct net_device *dev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_stop_ap(wiphy, dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_start_ap() - start soft ap mode
- * @wiphy: Pointer to wiphy structure
- * @dev: Pointer to net_device structure
- * @params: Pointer to AP settings parameters
- *
- * Return: 0 for success non-zero for failure
- */
-static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
-					struct net_device *dev,
-					struct cfg80211_ap_settings *params)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	enum hw_mode_bandwidth channel_width;
-	int status;
-	uint8_t channel;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_START_AP, pAdapter->sessionId,
-			 params->beacon_interval));
-	if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) {
-		hddLog(LOGE, FL("HDD adapter magic is invalid"));
-		return -ENODEV;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	hddLog(LOG2, FL("pAdapter = %p, Device mode %s(%d)"), pAdapter,
-	       hdd_device_mode_to_string(pAdapter->device_mode),
-	       pAdapter->device_mode);
-
-	channel_width = wlan_hdd_get_channel_bw(params->chandef.width);
-	channel = ieee80211_frequency_to_channel(
-				params->chandef.chan->center_freq);
-
-	/* check if concurrency is allowed */
-	if (!cds_allow_concurrency(
-				cds_convert_device_mode_to_hdd_type(
-				pAdapter->device_mode),
-				channel,
-				channel_width)) {
-		hdd_err("Connection failed due to concurrency check failure");
-		return -EINVAL;
-	}
-	if (pHddCtx->config->policy_manager_enabled) {
-		status = cdf_reset_connection_update();
-		if (!CDF_IS_STATUS_SUCCESS(status))
-			hdd_err("ERR: clear event failed");
-
-		status = cds_current_connections_update(pAdapter->sessionId,
-				channel,
-				CDS_UPDATE_REASON_START_AP);
-		if (CDF_STATUS_E_FAILURE == status) {
-			hdd_err("ERROR: connections update failed!!");
-			return -EINVAL;
-		}
-
-		if (CDF_STATUS_SUCCESS == status) {
-			status = cdf_wait_for_connection_update();
-			if (!CDF_IS_STATUS_SUCCESS(status)) {
-				hdd_err("ERROR: cdf wait for event failed!!");
-				return -EINVAL;
-			}
-		}
-	}
-
-	if ((pAdapter->device_mode == WLAN_HDD_SOFTAP)
-	    || (pAdapter->device_mode == WLAN_HDD_P2P_GO)
-	    ) {
-		beacon_data_t *old, *new;
-		enum nl80211_channel_type channel_type;
-
-		old = pAdapter->sessionCtx.ap.beacon;
-
-		if (old)
-			return -EALREADY;
-
-		status =
-			wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new,
-							   &params->beacon,
-							   params->dtim_period);
-
-		if (status != 0) {
-			hddLog(LOGE, FL("Error!!! Allocating the new beacon"));
-			return -EINVAL;
-		}
-		pAdapter->sessionCtx.ap.beacon = new;
-
-		if (params->chandef.width < NL80211_CHAN_WIDTH_80)
-			channel_type = cfg80211_get_chandef_type(
-						&(params->chandef));
-		else
-			channel_type = NL80211_CHAN_HT40PLUS;
-
-
-		wlan_hdd_set_channel(wiphy, dev,
-				     &params->chandef,
-				     channel_type);
-
-		/* set authentication type */
-		switch (params->auth_type) {
-		case NL80211_AUTHTYPE_OPEN_SYSTEM:
-			pAdapter->sessionCtx.ap.sapConfig.authType =
-				eSAP_OPEN_SYSTEM;
-			break;
-		case NL80211_AUTHTYPE_SHARED_KEY:
-			pAdapter->sessionCtx.ap.sapConfig.authType =
-				eSAP_SHARED_KEY;
-			break;
-		default:
-			pAdapter->sessionCtx.ap.sapConfig.authType =
-				eSAP_AUTO_SWITCH;
-		}
-		pAdapter->sessionCtx.ap.sapConfig.ch_width_orig =
-						params->chandef.width;
-		status =
-			wlan_hdd_cfg80211_start_bss(pAdapter,
-				&params->beacon,
-				params->ssid, params->ssid_len,
-				params->hidden_ssid);
-	}
-
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_start_ap() - start sap
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to netdev
- * @params: Pointer to start ap configuration parameters
- *
- * Return: zero for success non-zero for failure
- */
-int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
-				struct net_device *dev,
-				struct cfg80211_ap_settings *params)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_start_ap(wiphy, dev, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_change_beacon() - change beacon for sofatap/p2p go
- * @wiphy: Pointer to wiphy structure
- * @dev: Pointer to net_device structure
- * @params: Pointer to change beacon parameters
- *
- * Return: 0 for success non-zero for failure
- */
-static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
-					struct net_device *dev,
-					struct cfg80211_beacon_data *params)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	beacon_data_t *old, *new;
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_CHANGE_BEACON,
-			 pAdapter->sessionId, pAdapter->device_mode));
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-	       hdd_device_mode_to_string(pAdapter->device_mode),
-	       pAdapter->device_mode);
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	if (!(pAdapter->device_mode == WLAN_HDD_SOFTAP ||
-	      pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
-		return -EOPNOTSUPP;
-	}
-
-	old = pAdapter->sessionCtx.ap.beacon;
-
-	if (!old) {
-		hddLog(LOGE, FL("session(%d) beacon data points to NULL"),
-		       pAdapter->sessionId);
-		return -EINVAL;
-	}
-
-	status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, params, 0);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("new beacon alloc failed"));
-		return -EINVAL;
-	}
-
-	pAdapter->sessionCtx.ap.beacon = new;
-	status = wlan_hdd_cfg80211_start_bss(pAdapter, params, NULL, 0, 0);
-
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_change_beacon() - change beacon content in sap mode
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to netdev
- * @params: Pointer to change beacon parameters
- *
- * Return: zero for success non-zero for failure
- */
-int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
-				struct net_device *dev,
-				struct cfg80211_beacon_data *params)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_change_beacon(wiphy, dev, params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}

+ 0 - 116
core/hdd/src/wlan_hdd_hostapd.h

@@ -1,116 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_HOSTAPD_H)
-#define WLAN_HDD_HOSTAPD_H
-
-/**
- * DOC: wlan_hdd_hostapd.h
- *
- * WLAN Host Device driver hostapd header file
- */
-
-/* Include files */
-
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <cdf_list.h>
-#include <cdf_types.h>
-#include <wlan_hdd_main.h>
-
-/* Preprocessor definitions and constants */
-
-/* max length of command string in hostapd ioctl */
-#define HOSTAPD_IOCTL_COMMAND_STRLEN_MAX   8192
-
-hdd_adapter_t *hdd_wlan_create_ap_dev(hdd_context_t *pHddCtx,
-				      tSirMacAddr macAddr, uint8_t *name);
-
-CDF_STATUS hdd_register_hostapd(hdd_adapter_t *pAdapter, uint8_t rtnl_held);
-
-CDF_STATUS hdd_unregister_hostapd(hdd_adapter_t *pAdapter, bool rtnl_held);
-
-eCsrAuthType
-hdd_translate_rsn_to_csr_auth_type(uint8_t auth_suite[4]);
-
-int hdd_softap_set_channel_change(struct net_device *dev,
-				int target_channel,
-				phy_ch_width target_bw);
-
-eCsrEncryptionType
-hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]);
-
-eCsrEncryptionType
-hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]);
-
-eCsrAuthType
-hdd_translate_wpa_to_csr_auth_type(uint8_t auth_suite[4]);
-
-eCsrEncryptionType
-hdd_translate_wpa_to_csr_encryption_type(uint8_t cipher_suite[4]);
-
-CDF_STATUS hdd_softap_sta_deauth(hdd_adapter_t *,
-		struct tagCsrDelStaParams *);
-void hdd_softap_sta_disassoc(hdd_adapter_t *, uint8_t *);
-void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t *, bool);
-int hdd_softap_unpack_ie(tHalHandle halHandle,
-			 eCsrEncryptionType *pEncryptType,
-			 eCsrEncryptionType *mcEncryptType,
-			 eCsrAuthType *pAuthType,
-			 bool *pMFPCapable,
-			 bool *pMFPRequired,
-			 uint16_t gen_ie_len, uint8_t *gen_ie);
-
-CDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
-				    void *usrDataForCallback);
-CDF_STATUS hdd_init_ap_mode(hdd_adapter_t *pAdapter);
-void hdd_set_ap_ops(struct net_device *pWlanHostapdDev);
-int hdd_hostapd_stop(struct net_device *dev);
-void hdd_hostapd_channel_wakelock_init(hdd_context_t *pHddCtx);
-void hdd_hostapd_channel_wakelock_deinit(hdd_context_t *pHddCtx);
-#ifdef FEATURE_WLAN_FORCE_SAP_SCC
-void hdd_restart_softap(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter);
-#endif /* FEATURE_WLAN_FORCE_SAP_SCC */
-#ifdef QCA_HT_2040_COEX
-CDF_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter,
-				   uint8_t channel_type);
-#endif
-
-
-int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
-			      struct net_device *dev);
-
-int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
-			       struct net_device *dev,
-			       struct cfg80211_ap_settings *params);
-
-int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
-				    struct net_device *dev,
-				    struct cfg80211_beacon_data *params);
-
-CDF_STATUS wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter);
-#endif /* end #if !defined(WLAN_HDD_HOSTAPD_H) */

+ 0 - 6428
core/hdd/src/wlan_hdd_ioctl.c

@@ -1,6428 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/* Include Files */
-
-#include <wlan_hdd_includes.h>
-#include <wlan_hdd_wowl.h>
-#include "wlan_hdd_trace.h"
-#include "wlan_hdd_ioctl.h"
-#include "wlan_hdd_power.h"
-#include "wlan_hdd_driver_ops.h"
-#include "cds_concurrency.h"
-#include "wlan_hdd_hostapd.h"
-
-#include "wlan_hdd_p2p.h"
-#include <linux/ctype.h>
-#include "wma.h"
-#include "wlan_hdd_napi.h"
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-#include <sme_api.h>
-#include <sir_api.h>
-#endif
-#include "hif.h"
-
-#if defined(LINUX_QCMBR)
-#define SIOCIOCTLTX99 (SIOCDEVPRIVATE+13)
-#endif
-
-/*
- * Size of Driver command strings from upper layer
- */
-#define SIZE_OF_SETROAMMODE             11      /* size of SETROAMMODE */
-#define SIZE_OF_GETROAMMODE             11      /* size of GETROAMMODE */
-
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-#define TID_MIN_VALUE 0
-#define TID_MAX_VALUE 15
-#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
-
-/*
- * Maximum buffer size used for returning the data back to user space
- */
-#define WLAN_MAX_BUF_SIZE 1024
-#define WLAN_PRIV_DATA_MAX_LEN    8192
-
-/*
- * Driver miracast parameters 0-Disabled
- * 1-Source, 2-Sink
- */
-#define WLAN_HDD_DRIVER_MIRACAST_CFG_MIN_VAL 0
-#define WLAN_HDD_DRIVER_MIRACAST_CFG_MAX_VAL 2
-
-/*
- * When ever we need to print IBSSPEERINFOALL for more than 16 STA
- * we will split the printing.
- */
-#define NUM_OF_STA_DATA_TO_PRINT 16
-
-/*
- * Android DRIVER command structures
- */
-struct android_wifi_reassoc_params {
-	unsigned char bssid[18];
-	int channel;
-};
-
-#define ANDROID_WIFI_ACTION_FRAME_SIZE 1040
-struct android_wifi_af_params {
-	unsigned char bssid[18];
-	int channel;
-	int dwell_time;
-	int len;
-	unsigned char data[ANDROID_WIFI_ACTION_FRAME_SIZE];
-};
-
-/*
- * Define HDD driver command handling entry, each contains a command
- * string and the handler.
- */
-typedef int (*hdd_drv_cmd_handler_t)(hdd_adapter_t *adapter,
-				     hdd_context_t *hdd_ctx,
-				     uint8_t *cmd,
-				     uint8_t cmd_name_len,
-				     hdd_priv_data_t *priv_data);
-
-typedef struct {
-	const char *cmd;
-	hdd_drv_cmd_handler_t handler;
-} hdd_drv_cmd_t;
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-#define WLAN_WAIT_TIME_READY_TO_EXTWOW   2000
-#define WLAN_HDD_MAX_TCP_PORT            65535
-#endif
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-static void hdd_get_tsm_stats_cb(tAniTrafStrmMetrics tsm_metrics,
-				 const uint32_t staId, void *context)
-{
-	struct statsContext *stats_context = NULL;
-	hdd_adapter_t *adapter = NULL;
-
-	if (NULL == context) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: Bad param, context [%p]", __func__, context);
-		return;
-	}
-
-	/*
-	 * there is a race condition that exists between this callback
-	 * function and the caller since the caller could time out either
-	 * before or while this code is executing.  we use a spinlock to
-	 * serialize these actions
-	 */
-	spin_lock(&hdd_context_lock);
-
-	stats_context = context;
-	adapter = stats_context->pAdapter;
-	if ((NULL == adapter) ||
-	    (STATS_CONTEXT_MAGIC != stats_context->magic)) {
-		/*
-		 * the caller presumably timed out so there is
-		 * nothing we can do
-		 */
-		spin_unlock(&hdd_context_lock);
-		hddLog(CDF_TRACE_LEVEL_WARN,
-		       "%s: Invalid context, adapter [%p] magic [%08x]",
-		       __func__, adapter, stats_context->magic);
-		return;
-	}
-
-	/* context is valid so caller is still waiting */
-
-	/* paranoia: invalidate the magic */
-	stats_context->magic = 0;
-
-	/* copy over the tsm stats */
-	adapter->tsmStats.UplinkPktQueueDly = tsm_metrics.UplinkPktQueueDly;
-	cdf_mem_copy(adapter->tsmStats.UplinkPktQueueDlyHist,
-		     tsm_metrics.UplinkPktQueueDlyHist,
-		     sizeof(adapter->tsmStats.UplinkPktQueueDlyHist) /
-		     sizeof(adapter->tsmStats.UplinkPktQueueDlyHist[0]));
-	adapter->tsmStats.UplinkPktTxDly = tsm_metrics.UplinkPktTxDly;
-	adapter->tsmStats.UplinkPktLoss = tsm_metrics.UplinkPktLoss;
-	adapter->tsmStats.UplinkPktCount = tsm_metrics.UplinkPktCount;
-	adapter->tsmStats.RoamingCount = tsm_metrics.RoamingCount;
-	adapter->tsmStats.RoamingDly = tsm_metrics.RoamingDly;
-
-	/* notify the caller */
-	complete(&stats_context->completion);
-
-	/* serialization is complete */
-	spin_unlock(&hdd_context_lock);
-}
-
-static
-CDF_STATUS hdd_get_tsm_stats(hdd_adapter_t *adapter,
-			     const uint8_t tid,
-			     tAniTrafStrmMetrics *tsm_metrics)
-{
-	hdd_station_ctx_t *hdd_sta_ctx = NULL;
-	CDF_STATUS hstatus;
-	CDF_STATUS vstatus = CDF_STATUS_SUCCESS;
-	unsigned long rc;
-	struct statsContext context;
-	hdd_context_t *hdd_ctx = NULL;
-
-	if (NULL == adapter) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: adapter is NULL", __func__);
-		return CDF_STATUS_E_FAULT;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-
-	/* we are connected prepare our callback context */
-	init_completion(&context.completion);
-	context.pAdapter = adapter;
-	context.magic = STATS_CONTEXT_MAGIC;
-
-	/* query tsm stats */
-	hstatus = sme_get_tsm_stats(hdd_ctx->hHal, hdd_get_tsm_stats_cb,
-				    hdd_sta_ctx->conn_info.staId[0],
-				    hdd_sta_ctx->conn_info.bssId,
-				    &context, hdd_ctx->pcds_context, tid);
-	if (CDF_STATUS_SUCCESS != hstatus) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: Unable to retrieve statistics", __func__);
-		vstatus = CDF_STATUS_E_FAULT;
-	} else {
-		/* request was sent -- wait for the response */
-		rc = wait_for_completion_timeout(&context.completion,
-				msecs_to_jiffies(WLAN_WAIT_TIME_STATS));
-		if (!rc) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: SME timed out while retrieving statistics",
-			       __func__);
-			vstatus = CDF_STATUS_E_TIMEOUT;
-		}
-	}
-
-	/*
-	 * either we never sent a request, we sent a request and received a
-	 * response or we sent a request and timed out.  if we never sent a
-	 * request or if we sent a request and got a response, we want to
-	 * clear the magic out of paranoia.  if we timed out there is a
-	 * race condition such that the callback function could be
-	 * executing at the same time we are. of primary concern is if the
-	 * callback function had already verified the "magic" but had not
-	 * yet set the completion variable when a timeout occurred. we
-	 * serialize these activities by invalidating the magic while
-	 * holding a shared spinlock which will cause us to block if the
-	 * callback is currently executing
-	 */
-	spin_lock(&hdd_context_lock);
-	context.magic = 0;
-	spin_unlock(&hdd_context_lock);
-
-	if (CDF_STATUS_SUCCESS == vstatus) {
-		tsm_metrics->UplinkPktQueueDly =
-			adapter->tsmStats.UplinkPktQueueDly;
-		cdf_mem_copy(tsm_metrics->UplinkPktQueueDlyHist,
-			     adapter->tsmStats.UplinkPktQueueDlyHist,
-			     sizeof(adapter->tsmStats.UplinkPktQueueDlyHist) /
-			     sizeof(adapter->tsmStats.
-				    UplinkPktQueueDlyHist[0]));
-		tsm_metrics->UplinkPktTxDly = adapter->tsmStats.UplinkPktTxDly;
-		tsm_metrics->UplinkPktLoss = adapter->tsmStats.UplinkPktLoss;
-		tsm_metrics->UplinkPktCount = adapter->tsmStats.UplinkPktCount;
-		tsm_metrics->RoamingCount = adapter->tsmStats.RoamingCount;
-		tsm_metrics->RoamingDly = adapter->tsmStats.RoamingDly;
-	}
-	return vstatus;
-}
-#endif /*FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
-
-static void hdd_get_band_helper(hdd_context_t *hdd_ctx, int *pBand)
-{
-	eCsrBand band = -1;
-	sme_get_freq_band((tHalHandle) (hdd_ctx->hHal), &band);
-	switch (band) {
-	case eCSR_BAND_ALL:
-		*pBand = WLAN_HDD_UI_BAND_AUTO;
-		break;
-
-	case eCSR_BAND_24:
-		*pBand = WLAN_HDD_UI_BAND_2_4_GHZ;
-		break;
-
-	case eCSR_BAND_5G:
-		*pBand = WLAN_HDD_UI_BAND_5_GHZ;
-		break;
-
-	default:
-		hddLog(CDF_TRACE_LEVEL_WARN, "%s: Invalid Band %d", __func__,
-		       band);
-		*pBand = -1;
-		break;
-	}
-}
-
-/**
- * _hdd_parse_bssid_and_chan() - helper function to parse bssid and channel
- * @data:            input data
- * @target_ap_bssid: pointer to bssid (output parameter)
- * @channel:         pointer to channel (output parameter)
- *
- * Return: 0 if parsing is successful; -EINVAL otherwise
- */
-static int _hdd_parse_bssid_and_chan(const uint8_t **data,
-				     uint8_t *bssid,
-				     uint8_t *channel)
-{
-	const uint8_t *in_ptr;
-	int            v = 0;
-	int            temp_int;
-	uint8_t        temp_buf[32];
-
-	/* 12 hexa decimal digits, 5 ':' and '\0' */
-	uint8_t        mac_addr[18];
-
-	if (!data || !*data)
-		return -EINVAL;
-
-	in_ptr = *data;
-
-	in_ptr = strnchr(in_ptr, strlen(in_ptr), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == in_ptr)
-		goto error;
-	/* no space after the command */
-	else if (SPACE_ASCII_VALUE != *in_ptr)
-		goto error;
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *in_ptr) && ('\0' != *in_ptr))
-		in_ptr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *in_ptr)
-		goto error;
-
-	v = sscanf(in_ptr, "%17s", mac_addr);
-	if (!((1 == v) && hdd_is_valid_mac_address(mac_addr))) {
-		hddLog(LOGE,
-			FL(
-			   "Invalid MAC address or All hex inputs are not read (%d)"
-			),
-			v);
-		goto error;
-	}
-
-	bssid[0] = hex_to_bin(mac_addr[0]) << 4 |
-			hex_to_bin(mac_addr[1]);
-	bssid[1] = hex_to_bin(mac_addr[3]) << 4 |
-			hex_to_bin(mac_addr[4]);
-	bssid[2] = hex_to_bin(mac_addr[6]) << 4 |
-			hex_to_bin(mac_addr[7]);
-	bssid[3] = hex_to_bin(mac_addr[9]) << 4 |
-			hex_to_bin(mac_addr[10]);
-	bssid[4] = hex_to_bin(mac_addr[12]) << 4 |
-			hex_to_bin(mac_addr[13]);
-	bssid[5] = hex_to_bin(mac_addr[15]) << 4 |
-			hex_to_bin(mac_addr[16]);
-
-	/* point to the next argument */
-	in_ptr = strnchr(in_ptr, strlen(in_ptr), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == in_ptr)
-		goto error;
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *in_ptr) && ('\0' != *in_ptr))
-		in_ptr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *in_ptr)
-		goto error;
-
-	/* get the next argument ie the channel number */
-	v = sscanf(in_ptr, "%31s ", temp_buf);
-	if (1 != v)
-		goto error;
-
-	v = kstrtos32(temp_buf, 10, &temp_int);
-	if ((v < 0) || (temp_int < 0) ||
-	    (temp_int > WNI_CFG_CURRENT_CHANNEL_STAMAX))
-		return -EINVAL;
-
-	*channel = temp_int;
-	*data = in_ptr;
-	return 0;
-error:
-	*data = in_ptr;
-	return -EINVAL;
-}
-
-/**
- * hdd_parse_send_action_frame_data() - HDD Parse send action frame data
- * @pValue:         Pointer to input data
- * @pTargetApBssid: Pointer to target Ap bssid
- * @pChannel:       Pointer to the Target AP channel
- * @pDwellTime:     Pointer to the time to stay off-channel
- *                  after transmitting action frame
- * @pBuf:           Pointer to data
- * @pBufLen:        Pointer to data length
- *
- * This function parses the send action frame data passed in the format
- * SENDACTIONFRAME<space><bssid><space><channel><space><dwelltime><space><data>
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_send_action_frame_v1_data(const uint8_t *pValue,
-				    uint8_t *pTargetApBssid,
-				    uint8_t *pChannel, uint8_t *pDwellTime,
-				    uint8_t **pBuf, uint8_t *pBufLen)
-{
-	const uint8_t *inPtr = pValue;
-	const uint8_t *dataEnd;
-	int tempInt;
-	int j = 0;
-	int i = 0;
-	int v = 0;
-	uint8_t tempBuf[32];
-	uint8_t tempByte = 0;
-
-	if (_hdd_parse_bssid_and_chan(&inPtr, pTargetApBssid, pChannel))
-		return -EINVAL;
-
-	/* point to the next argument */
-	inPtr = strnchr(inPtr, strlen(inPtr), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == inPtr)
-		return -EINVAL;
-	/* removing empty spaces */
-	while ((SPACE_ASCII_VALUE == *inPtr) && ('\0' != *inPtr))
-		inPtr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *inPtr) {
-		return -EINVAL;
-	}
-
-	/* getting the next argument ie the dwell time */
-	v = sscanf(inPtr, "%31s ", tempBuf);
-	if (1 != v)
-		return -EINVAL;
-
-	v = kstrtos32(tempBuf, 10, &tempInt);
-	if (v < 0 || tempInt < 0)
-		return -EINVAL;
-
-	*pDwellTime = tempInt;
-
-	/* point to the next argument */
-	inPtr = strnchr(inPtr, strlen(inPtr), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == inPtr)
-		return -EINVAL;
-	/* removing empty spaces */
-	while ((SPACE_ASCII_VALUE == *inPtr) && ('\0' != *inPtr))
-		inPtr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *inPtr) {
-		return -EINVAL;
-	}
-
-	/* find the length of data */
-	dataEnd = inPtr;
-	while (('\0' != *dataEnd)) {
-		dataEnd++;
-	}
-	*pBufLen = dataEnd - inPtr;
-	if (*pBufLen <= 0)
-		return -EINVAL;
-
-	/*
-	 * Allocate the number of bytes based on the number of input characters
-	 * whether it is even or odd.
-	 * if the number of input characters are even, then we need N/2 byte.
-	 * if the number of input characters are odd, then we need do (N+1)/2
-	 * to compensate rounding off.
-	 * For example, if N = 18, then (18 + 1)/2 = 9 bytes are enough.
-	 * If N = 19, then we need 10 bytes, hence (19 + 1)/2 = 10 bytes
-	 */
-	*pBuf = cdf_mem_malloc((*pBufLen + 1) / 2);
-	if (NULL == *pBuf) {
-		hddLog(LOGE, FL("cdf_mem_alloc failed"));
-		return -ENOMEM;
-	}
-
-	/* the buffer received from the upper layer is character buffer,
-	 * we need to prepare the buffer taking 2 characters in to a U8 hex
-	 * decimal number for example 7f0000f0...form a buffer to contain 7f
-	 * in 0th location, 00 in 1st and f0 in 3rd location
-	 */
-	for (i = 0, j = 0; j < *pBufLen; j += 2) {
-		if (j + 1 == *pBufLen) {
-			tempByte = hex_to_bin(inPtr[j]);
-		} else {
-			tempByte =
-				(hex_to_bin(inPtr[j]) << 4) |
-				(hex_to_bin(inPtr[j + 1]));
-		}
-		(*pBuf)[i++] = tempByte;
-	}
-	*pBufLen = i;
-	return 0;
-}
-
-/**
- * hdd_parse_reassoc_command_data() - HDD Parse reassoc command data
- * @pValue:         Pointer to input data (its a NULL terminated string)
- * @pTargetApBssid: Pointer to target Ap bssid
- * @pChannel:       Pointer to the Target AP channel
- *
- * This function parses the reasoc command data passed in the format
- * REASSOC<space><bssid><space><channel>
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_parse_reassoc_command_v1_data(const uint8_t *pValue,
-					     uint8_t *pTargetApBssid,
-					     uint8_t *pChannel)
-{
-	const uint8_t *inPtr = pValue;
-
-	if (_hdd_parse_bssid_and_chan(&inPtr, pTargetApBssid, pChannel))
-		return -EINVAL;
-
-	return 0;
-}
-
-/**
- * hdd_reassoc() - perform a userspace-directed reassoc
- * @adapter:	Adapter upon which the command was received
- * @bssid:	BSSID with which to reassociate
- * @channel:	channel upon which to reassociate
- *
- * This function performs a userspace-directed reassoc operation
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid,
-	    const uint8_t channel)
-{
-	hdd_station_ctx_t *pHddStaCtx;
-	int ret = 0;
-
-	if (WLAN_HDD_INFRA_STATION != adapter->device_mode) {
-		hdd_warn("Unsupported in mode %s(%d)",
-			 hdd_device_mode_to_string(adapter->device_mode),
-			 adapter->device_mode);
-		return -EINVAL;
-	}
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-
-	/* if not associated, no need to proceed with reassoc */
-	if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
-		hddLog(CDF_TRACE_LEVEL_INFO, "%s: Not associated", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	/*
-	 * if the target bssid is same as currently associated AP,
-	 * then no need to proceed with reassoc
-	 */
-	if (!memcmp(bssid, pHddStaCtx->conn_info.bssId.bytes,
-			CDF_MAC_ADDR_SIZE)) {
-		hddLog(LOG1,
-		       FL("Reassoc BSSID is same as currently associated AP bssid"));
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	/* Check channel number is a valid channel number */
-	if (CDF_STATUS_SUCCESS !=
-	    wlan_hdd_validate_operation_channel(adapter, channel)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: Invalid Channel %d",
-		       __func__, channel);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	/* Proceed with reassoc */
-	{
-		tCsrHandoffRequest handoffInfo;
-		hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-		handoffInfo.channel = channel;
-		handoffInfo.src = REASSOC;
-		cdf_mem_copy(handoffInfo.bssid.bytes, bssid, CDF_MAC_ADDR_SIZE);
-		sme_handoff_request(hdd_ctx->hHal, adapter->sessionId,
-				    &handoffInfo);
-	}
-exit:
-	return ret;
-}
-
-/**
- * hdd_parse_reassoc_v1() - parse version 1 of the REASSOC command
- * @adapter:	Adapter upon which the command was received
- * @command:	ASCII text command that was received
- *
- * This function parses the v1 REASSOC command with the format
- *
- *    REASSOC xx:xx:xx:xx:xx:xx CH
- *
- * Where "xx:xx:xx:xx:xx:xx" is the Hex-ASCII representation of the
- * BSSID and CH is the ASCII representation of the channel.  For
- * example
- *
- *    REASSOC 00:0a:0b:11:22:33 48
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_parse_reassoc_v1(hdd_adapter_t *adapter, const char *command)
-{
-	uint8_t channel = 0;
-	tSirMacAddr bssid;
-	int ret;
-
-	ret = hdd_parse_reassoc_command_v1_data(command, bssid, &channel);
-	if (ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: Failed to parse reassoc command data", __func__);
-	} else {
-		ret = hdd_reassoc(adapter, bssid, channel);
-	}
-	return ret;
-}
-
-/**
- * hdd_parse_reassoc_v2() - parse version 2 of the REASSOC command
- * @adapter:	Adapter upon which the command was received
- * @command:	Command that was received, ASCII command
- *      	     followed by binary data
- *
- * This function parses the v2 REASSOC command with the format
- *
- *    REASSOC <android_wifi_reassoc_params>
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_parse_reassoc_v2(hdd_adapter_t *adapter, const char *command)
-{
-	struct android_wifi_reassoc_params params;
-	tSirMacAddr bssid;
-	int ret;
-
-	/* The params are located after "REASSOC " */
-	memcpy(&params, command + 8, sizeof(params));
-
-	if (!mac_pton(params.bssid, (u8 *) &bssid)) {
-		hddLog(LOGE, "%s: MAC address parsing failed", __func__);
-		ret = -EINVAL;
-	} else {
-		ret = hdd_reassoc(adapter, bssid, params.channel);
-	}
-	return ret;
-}
-
-/**
- * hdd_parse_reassoc() - parse the REASSOC command
- * @adapter:	Adapter upon which the command was received
- * @command:	Command that was received
- *
- * There are two different versions of the REASSOC command.  Version 1
- * of the command contains a parameter list that is ASCII characters
- * whereas version 2 contains a combination of ASCII and binary
- * payload.  Determine if a version 1 or a version 2 command is being
- * parsed by examining the parameters, and then dispatch the parser
- * that is appropriate for the command.
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_parse_reassoc(hdd_adapter_t *adapter, const char *command)
-{
-	int ret;
-
-	/* both versions start with "REASSOC "
-	 * v1 has a bssid and channel # as an ASCII string
-	 *    REASSOC xx:xx:xx:xx:xx:xx CH
-	 * v2 has a C struct
-	 *    REASSOC <binary c struct>
-	 *
-	 * The first field in the v2 struct is also the bssid in ASCII.
-	 * But in the case of a v2 message the BSSID is NUL-terminated.
-	 * Hence we can peek at that offset to see if this is V1 or V2
-	 * REASSOC xx:xx:xx:xx:xx:xx*
-	 *           1111111111222222
-	 * 01234567890123456789012345
-	 */
-	if (command[25]) {
-		ret = hdd_parse_reassoc_v1(adapter, command);
-	} else {
-		ret = hdd_parse_reassoc_v2(adapter, command);
-	}
-
-	return ret;
-}
-
-/**
- * hdd_sendactionframe() - send a userspace-supplied action frame
- * @adapter:	Adapter upon which the command was received
- * @bssid:	BSSID target of the action frame
- * @channel:	Channel upon which to send the frame
- * @dwell_time:	Amount of time to dwell when the frame is sent
- * @payload_len:Length of the payload
- * @payload:	Payload of the frame
- *
- * This function sends a userspace-supplied action frame
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid,
-		    const uint8_t channel, const uint8_t dwell_time,
-		    const uint8_t payload_len, const uint8_t *payload)
-{
-	struct ieee80211_channel chan;
-	uint8_t frame_len;
-	uint8_t *frame;
-	struct ieee80211_hdr_3addr *hdr;
-	u64 cookie;
-	hdd_station_ctx_t *pHddStaCtx;
-	hdd_context_t *hdd_ctx;
-	int ret = 0;
-	tpSirMacVendorSpecificFrameHdr pVendorSpecific =
-		(tpSirMacVendorSpecificFrameHdr) payload;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-	struct cfg80211_mgmt_tx_params params;
-#endif
-
-	if (WLAN_HDD_INFRA_STATION != adapter->device_mode) {
-		hdd_warn("Unsupported in mode %s(%d)",
-			 hdd_device_mode_to_string(adapter->device_mode),
-			 adapter->device_mode);
-		return -EINVAL;
-	}
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-	/* if not associated, no need to send action frame */
-	if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
-		hddLog(CDF_TRACE_LEVEL_INFO, "%s: Not associated", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	/*
-	 * if the target bssid is different from currently associated AP,
-	 * then no need to send action frame
-	 */
-	if (memcmp(bssid, pHddStaCtx->conn_info.bssId.bytes,
-			CDF_MAC_ADDR_SIZE)) {
-		hddLog(LOG1, FL("STA is not associated to this AP"));
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	chan.center_freq = sme_chn_to_freq(channel);
-	/* Check if it is specific action frame */
-	if (pVendorSpecific->category ==
-	    SIR_MAC_ACTION_VENDOR_SPECIFIC_CATEGORY) {
-		static const uint8_t Oui[] = { 0x00, 0x00, 0xf0 };
-		if (cdf_mem_compare(pVendorSpecific->Oui, (void *)Oui, 3)) {
-			/*
-			 * if the channel number is different from operating
-			 * channel then no need to send action frame
-			 */
-			if (channel != 0) {
-				if (channel !=
-				    pHddStaCtx->conn_info.operationChannel) {
-					hddLog(CDF_TRACE_LEVEL_INFO,
-					       "%s: channel(%d) is different from operating channel(%d)",
-					       __func__, channel,
-					       pHddStaCtx->conn_info.
-					       operationChannel);
-					ret = -EINVAL;
-					goto exit;
-				}
-				/*
-				 * If channel number is specified and same
-				 * as home channel, ensure that action frame
-				 * is sent immediately by cancelling
-				 * roaming scans. Otherwise large dwell times
-				 * may cause long delays in sending action
-				 * frames.
-				 */
-				sme_abort_roam_scan(hdd_ctx->hHal,
-						    adapter->sessionId);
-			} else {
-				/*
-				 * 0 is accepted as current home channel,
-				 * delayed transmission of action frame is ok.
-				 */
-				chan.center_freq =
-					sme_chn_to_freq(pHddStaCtx->conn_info.
-							operationChannel);
-			}
-		}
-	}
-	if (chan.center_freq == 0) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s:invalid channel number %d",
-		       __func__, channel);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	frame_len = payload_len + 24;
-	frame = cdf_mem_malloc(frame_len);
-	if (!frame) {
-		hddLog(LOGE, FL("memory allocation failed"));
-		ret = -ENOMEM;
-		goto exit;
-	}
-	cdf_mem_zero(frame, frame_len);
-
-	hdr = (struct ieee80211_hdr_3addr *)frame;
-	hdr->frame_control =
-		cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION);
-	cdf_mem_copy(hdr->addr1, bssid, CDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(hdr->addr2, adapter->macAddressCurrent.bytes,
-		     CDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(hdr->addr3, bssid, CDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(hdr + 1, payload, payload_len);
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-	params.chan = &chan;
-	params.offchan = 0;
-	params.wait = dwell_time;
-	params.buf = frame;
-	params.len = frame_len;
-	params.no_cck = 1;
-	params.dont_wait_for_ack = 1;
-	ret = wlan_hdd_mgmt_tx(NULL, &adapter->wdev, &params, &cookie);
-#else
-	ret = wlan_hdd_mgmt_tx(NULL,
-			       &(adapter->wdev),
-			       &chan, 0,
-
-			       dwell_time, frame, frame_len, 1, 1, &cookie);
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) */
-
-	cdf_mem_free(frame);
-exit:
-	return ret;
-}
-
-/**
- * hdd_parse_sendactionframe_v1() - parse version 1 of the
- *       SENDACTIONFRAME command
- * @adapter:	Adapter upon which the command was received
- * @command:	ASCII text command that was received
- *
- * This function parses the v1 SENDACTIONFRAME command with the format
- *
- *    SENDACTIONFRAME xx:xx:xx:xx:xx:xx CH DW xxxxxx
- *
- * Where "xx:xx:xx:xx:xx:xx" is the Hex-ASCII representation of the
- * BSSID, CH is the ASCII representation of the channel, DW is the
- * ASCII representation of the dwell time, and xxxxxx is the Hex-ASCII
- * payload.  For example
- *
- *    SENDACTIONFRAME 00:0a:0b:11:22:33 48 40 aabbccddee
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_sendactionframe_v1(hdd_adapter_t *adapter, const char *command)
-{
-	uint8_t channel = 0;
-	uint8_t dwell_time = 0;
-	uint8_t payload_len = 0;
-	uint8_t *payload = NULL;
-	tSirMacAddr bssid;
-	int ret;
-
-	ret = hdd_parse_send_action_frame_v1_data(command, bssid, &channel,
-						  &dwell_time, &payload,
-						  &payload_len);
-	if (ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: Failed to parse send action frame data", __func__);
-	} else {
-		ret = hdd_sendactionframe(adapter, bssid, channel,
-					  dwell_time, payload_len, payload);
-		cdf_mem_free(payload);
-	}
-
-	return ret;
-}
-
-/**
- * hdd_parse_sendactionframe_v2() - parse version 2 of the
- *       SENDACTIONFRAME command
- * @adapter:	Adapter upon which the command was received
- * @command:	Command that was received, ASCII command
- *      	     followed by binary data
- *
- * This function parses the v2 SENDACTIONFRAME command with the format
- *
- *    SENDACTIONFRAME <android_wifi_af_params>
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_sendactionframe_v2(hdd_adapter_t *adapter, const char *command)
-{
-	struct android_wifi_af_params *params;
-	tSirMacAddr bssid;
-	int ret;
-
-	/* params are large so keep off the stack */
-	params = kmalloc(sizeof(*params), GFP_KERNEL);
-	if (!params)
-		return -ENOMEM;
-
-	/* The params are located after "SENDACTIONFRAME " */
-	memcpy(params, command + 16, sizeof(*params));
-
-	if (!mac_pton(params->bssid, (u8 *) &bssid)) {
-		hddLog(LOGE, "%s: MAC address parsing failed", __func__);
-		ret = -EINVAL;
-	} else {
-		ret = hdd_sendactionframe(adapter, bssid, params->channel,
-					  params->dwell_time, params->len,
-					  params->data);
-	}
-	kfree(params);
-	return ret;
-}
-
-/**
- * hdd_parse_sendactionframe() - parse the SENDACTIONFRAME command
- * @adapter:	Adapter upon which the command was received
- * @command:	Command that was received
- *
- * There are two different versions of the SENDACTIONFRAME command.
- * Version 1 of the command contains a parameter list that is ASCII
- * characters whereas version 2 contains a combination of ASCII and
- * binary payload.  Determine if a version 1 or a version 2 command is
- * being parsed by examining the parameters, and then dispatch the
- * parser that is appropriate for the version of the command.
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_sendactionframe(hdd_adapter_t *adapter, const char *command)
-{
-	int ret;
-
-	/*
-	 * both versions start with "SENDACTIONFRAME "
-	 * v1 has a bssid and other parameters as an ASCII string
-	 *    SENDACTIONFRAME xx:xx:xx:xx:xx:xx CH DWELL LEN FRAME
-	 * v2 has a C struct
-	 *    SENDACTIONFRAME <binary c struct>
-	 *
-	 * The first field in the v2 struct is also the bssid in ASCII.
-	 * But in the case of a v2 message the BSSID is NUL-terminated.
-	 * Hence we can peek at that offset to see if this is V1 or V2
-	 * SENDACTIONFRAME xx:xx:xx:xx:xx:xx*
-	 *           111111111122222222223333
-	 * 0123456789012345678901234567890123
-	 */
-	if (command[33]) {
-		ret = hdd_parse_sendactionframe_v1(adapter, command);
-	} else {
-		ret = hdd_parse_sendactionframe_v2(adapter, command);
-	}
-
-	return ret;
-}
-
-/**
- * hdd_parse_channellist() - HDD Parse channel list
- * @pValue:		Pointer to input channel list
- * @ChannelList:	Pointer to local output array to record
- *      	       channel list
- * @pNumChannels:	Pointer to number of roam scan channels
- *
- * This function parses the channel list passed in the format
- * SETROAMSCANCHANNELS<space><Number of channels><space>Channel 1<space>Channel 2<space>Channel N
- * if the Number of channels (N) does not match with the actual number
- * of channels passed then take the minimum of N and count of
- * (Ch1, Ch2, ...Ch M). For example, if SETROAMSCANCHANNELS 3 36 40 44 48,
- * only 36, 40 and 44 shall be taken. If SETROAMSCANCHANNELS 5 36 40 44 48,
- * ignore 5 and take 36, 40, 44 and 48. This function does not take care of
- * removing duplicate channels from the list
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_channellist(const uint8_t *pValue, uint8_t *pChannelList,
-		      uint8_t *pNumChannels)
-{
-	const uint8_t *inPtr = pValue;
-	int tempInt;
-	int j = 0;
-	int v = 0;
-	char buf[32];
-
-	inPtr = strnchr(pValue, strlen(pValue), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == inPtr) {
-		return -EINVAL;
-	}
-
-	/* no space after the command */
-	else if (SPACE_ASCII_VALUE != *inPtr) {
-		return -EINVAL;
-	}
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *inPtr) && ('\0' != *inPtr))
-		inPtr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *inPtr) {
-		return -EINVAL;
-	}
-
-	/* get the first argument ie the number of channels */
-	v = sscanf(inPtr, "%31s ", buf);
-	if (1 != v)
-		return -EINVAL;
-
-	v = kstrtos32(buf, 10, &tempInt);
-	if ((v < 0) ||
-	    (tempInt <= 0) || (tempInt > WNI_CFG_VALID_CHANNEL_LIST_LEN)) {
-		return -EINVAL;
-	}
-
-	*pNumChannels = tempInt;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Number of channels are: %d", *pNumChannels);
-
-	for (j = 0; j < (*pNumChannels); j++) {
-		/*
-		 * inPtr pointing to the beginning of first space after number
-		 * of channels
-		 */
-		inPtr = strpbrk(inPtr, " ");
-		/* no channel list after the number of channels argument */
-		if (NULL == inPtr) {
-			if (0 != j) {
-				*pNumChannels = j;
-				return 0;
-			} else {
-				return -EINVAL;
-			}
-		}
-
-		/* remove empty space */
-		while ((SPACE_ASCII_VALUE == *inPtr) && ('\0' != *inPtr))
-			inPtr++;
-
-		/*
-		 * no channel list after the number of channels
-		 * argument and spaces
-		 */
-		if ('\0' == *inPtr) {
-			if (0 != j) {
-				*pNumChannels = j;
-				return 0;
-			} else {
-				return -EINVAL;
-			}
-		}
-
-		v = sscanf(inPtr, "%31s ", buf);
-		if (1 != v)
-			return -EINVAL;
-
-		v = kstrtos32(buf, 10, &tempInt);
-		if ((v < 0) ||
-		    (tempInt <= 0) ||
-		    (tempInt > WNI_CFG_CURRENT_CHANNEL_STAMAX)) {
-			return -EINVAL;
-		}
-		pChannelList[j] = tempInt;
-
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "Channel %d added to preferred channel list",
-			  pChannelList[j]);
-	}
-
-	return 0;
-}
-
-/**
- * hdd_parse_set_roam_scan_channels_v1() - parse version 1 of the
- * SETROAMSCANCHANNELS command
- * @adapter:	Adapter upon which the command was received
- * @command:	ASCII text command that was received
- *
- * This function parses the v1 SETROAMSCANCHANNELS command with the format
- *
- *    SETROAMSCANCHANNELS N C1 C2 ... Cn
- *
- * Where "N" is the ASCII representation of the number of channels and
- * C1 thru Cn is the ASCII representation of the channels.  For example
- *
- *    SETROAMSCANCHANNELS 4 36 40 44 48
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_set_roam_scan_channels_v1(hdd_adapter_t *adapter,
-				    const char *command)
-{
-	uint8_t channel_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
-	uint8_t num_chan = 0;
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	int ret;
-
-	ret = hdd_parse_channellist(command, channel_list, &num_chan);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to parse channel list information",
-			  __func__);
-		goto exit;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_SETROAMSCANCHANNELS_IOCTL,
-			 adapter->sessionId, num_chan));
-
-	if (num_chan > WNI_CFG_VALID_CHANNEL_LIST_LEN) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: number of channels (%d) supported exceeded max (%d)",
-			  __func__, num_chan, WNI_CFG_VALID_CHANNEL_LIST_LEN);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	status =
-		sme_change_roam_scan_channel_list(hdd_ctx->hHal,
-						  adapter->sessionId,
-						  channel_list, num_chan);
-	if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to update channel list information",
-			  __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-exit:
-	return ret;
-}
-
-/**
- * hdd_parse_set_roam_scan_channels_v2() - parse version 2 of the
- * SETROAMSCANCHANNELS command
- * @adapter:	Adapter upon which the command was received
- * @command:	Command that was received, ASCII command
- *      	     followed by binary data
- *
- * This function parses the v2 SETROAMSCANCHANNELS command with the format
- *
- *    SETROAMSCANCHANNELS [N][C1][C2][Cn]
- *
- * The command begins with SETROAMSCANCHANNELS followed by a space, but
- * what follows the space is an array of u08 parameters.  For example
- *
- *    SETROAMSCANCHANNELS [0x04 0x24 0x28 0x2c 0x30]
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_set_roam_scan_channels_v2(hdd_adapter_t *adapter,
-				    const char *command)
-{
-	const uint8_t *value;
-	uint8_t channel_list[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
-	uint8_t channel;
-	uint8_t num_chan;
-	int i;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	CDF_STATUS status;
-	int ret = 0;
-
-	/* array of values begins after "SETROAMSCANCHANNELS " */
-	value = command + 20;
-
-	num_chan = *value++;
-	if (num_chan > WNI_CFG_VALID_CHANNEL_LIST_LEN) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: number of channels (%d) supported exceeded max (%d)",
-			  __func__, num_chan, WNI_CFG_VALID_CHANNEL_LIST_LEN);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_SETROAMSCANCHANNELS_IOCTL,
-			 adapter->sessionId, num_chan));
-
-	for (i = 0; i < num_chan; i++) {
-		channel = *value++;
-		if (channel > WNI_CFG_CURRENT_CHANNEL_STAMAX) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: index %d invalid channel %d", __func__,
-				  i, channel);
-			ret = -EINVAL;
-			goto exit;
-		}
-		channel_list[i] = channel;
-	}
-	status =
-		sme_change_roam_scan_channel_list(hdd_ctx->hHal,
-						  adapter->sessionId,
-						  channel_list, num_chan);
-	if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to update channel list information",
-			  __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-exit:
-	return ret;
-}
-
-/**
- * hdd_parse_set_roam_scan_channels() - parse the
- * SETROAMSCANCHANNELS command
- * @adapter:	Adapter upon which the command was received
- * @command:	Command that was received
- *
- * There are two different versions of the SETROAMSCANCHANNELS command.
- * Version 1 of the command contains a parameter list that is ASCII
- * characters whereas version 2 contains a binary payload.  Determine
- * if a version 1 or a version 2 command is being parsed by examining
- * the parameters, and then dispatch the parser that is appropriate for
- * the command.
- *
- * Return: 0 for success non-zero for failure
- */
-static int
-hdd_parse_set_roam_scan_channels(hdd_adapter_t *adapter, const char *command)
-{
-	const char *cursor;
-	char ch;
-	bool v1;
-	int ret;
-
-	/* start after "SETROAMSCANCHANNELS " */
-	cursor = command + 20;
-
-	/* assume we have a version 1 command until proven otherwise */
-	v1 = true;
-
-	/* v1 params will only contain ASCII digits and space */
-	while ((ch = *cursor++) && v1) {
-		if (!(isdigit(ch) || isspace(ch))) {
-			v1 = false;
-		}
-	}
-	if (v1) {
-		ret = hdd_parse_set_roam_scan_channels_v1(adapter, command);
-	} else {
-		ret = hdd_parse_set_roam_scan_channels_v2(adapter, command);
-	}
-
-	return ret;
-}
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-/**
- * hdd_parse_plm_cmd() - HDD Parse Plm command
- * @pValue:	Pointer to input data
- * @pPlmRequest:Pointer to output struct tpSirPlmReq
- *
- * This function parses the plm command passed in the format
- * CCXPLMREQ<space><enable><space><dialog_token><space>
- * <meas_token><space><num_of_bursts><space><burst_int><space>
- * <measu duration><space><burst_len><space><desired_tx_pwr>
- * <space><multcast_addr><space><number_of_channels>
- * <space><channel_numbers>
- *
- * Return: 0 for success non-zero for failure
- */
-CDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest)
-{
-	uint8_t *cmdPtr = NULL;
-	int count, content = 0, ret = 0;
-	char buf[32];
-
-	/* move to argument list */
-	cmdPtr = strnchr(pValue, strlen(pValue), SPACE_ASCII_VALUE);
-	if (NULL == cmdPtr)
-		return CDF_STATUS_E_FAILURE;
-
-	/* no space after the command */
-	if (SPACE_ASCII_VALUE != *cmdPtr)
-		return CDF_STATUS_E_FAILURE;
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-		cmdPtr++;
-
-	/* START/STOP PLM req */
-	ret = sscanf(cmdPtr, "%31s ", buf);
-	if (1 != ret)
-		return CDF_STATUS_E_FAILURE;
-
-	ret = kstrtos32(buf, 10, &content);
-	if (ret < 0)
-		return CDF_STATUS_E_FAILURE;
-
-	pPlmRequest->enable = content;
-	cmdPtr = strpbrk(cmdPtr, " ");
-
-	if (NULL == cmdPtr)
-		return CDF_STATUS_E_FAILURE;
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-		cmdPtr++;
-
-	/* Dialog token of radio meas req containing meas reqIE */
-	ret = sscanf(cmdPtr, "%31s ", buf);
-	if (1 != ret)
-		return CDF_STATUS_E_FAILURE;
-
-	ret = kstrtos32(buf, 10, &content);
-	if (ret < 0)
-		return CDF_STATUS_E_FAILURE;
-
-	pPlmRequest->diag_token = content;
-	hddLog(CDF_TRACE_LEVEL_DEBUG, "diag token %d",
-	       pPlmRequest->diag_token);
-	cmdPtr = strpbrk(cmdPtr, " ");
-
-	if (NULL == cmdPtr)
-		return CDF_STATUS_E_FAILURE;
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-		cmdPtr++;
-
-	/* measurement token of meas req IE */
-	ret = sscanf(cmdPtr, "%31s ", buf);
-	if (1 != ret)
-		return CDF_STATUS_E_FAILURE;
-
-	ret = kstrtos32(buf, 10, &content);
-	if (ret < 0)
-		return CDF_STATUS_E_FAILURE;
-
-	pPlmRequest->meas_token = content;
-	hddLog(CDF_TRACE_LEVEL_DEBUG, "meas token %d",
-	       pPlmRequest->meas_token);
-
-	hddLog(CDF_TRACE_LEVEL_ERROR,
-	       "PLM req %s", pPlmRequest->enable ? "START" : "STOP");
-	if (pPlmRequest->enable) {
-
-		cmdPtr = strpbrk(cmdPtr, " ");
-
-		if (NULL == cmdPtr)
-			return CDF_STATUS_E_FAILURE;
-
-		/* remove empty spaces */
-		while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-			cmdPtr++;
-
-		/* total number of bursts after which STA stops sending */
-		ret = sscanf(cmdPtr, "%31s ", buf);
-		if (1 != ret)
-			return CDF_STATUS_E_FAILURE;
-
-		ret = kstrtos32(buf, 10, &content);
-		if (ret < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		if (content < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		pPlmRequest->numBursts = content;
-		hddLog(CDF_TRACE_LEVEL_DEBUG, "num burst %d",
-		       pPlmRequest->numBursts);
-		cmdPtr = strpbrk(cmdPtr, " ");
-
-		if (NULL == cmdPtr)
-			return CDF_STATUS_E_FAILURE;
-
-		/* remove empty spaces */
-		while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-			cmdPtr++;
-
-		/* burst interval in seconds */
-		ret = sscanf(cmdPtr, "%31s ", buf);
-		if (1 != ret)
-			return CDF_STATUS_E_FAILURE;
-
-		ret = kstrtos32(buf, 10, &content);
-		if (ret < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		if (content <= 0)
-			return CDF_STATUS_E_FAILURE;
-
-		pPlmRequest->burstInt = content;
-		hddLog(CDF_TRACE_LEVEL_DEBUG, "burst Int %d",
-		       pPlmRequest->burstInt);
-		cmdPtr = strpbrk(cmdPtr, " ");
-
-		if (NULL == cmdPtr)
-			return CDF_STATUS_E_FAILURE;
-
-		/* remove empty spaces */
-		while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-			cmdPtr++;
-
-		/* Meas dur in TU's,STA goes off-ch and transmit PLM bursts */
-		ret = sscanf(cmdPtr, "%31s ", buf);
-		if (1 != ret)
-			return CDF_STATUS_E_FAILURE;
-
-		ret = kstrtos32(buf, 10, &content);
-		if (ret < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		if (content <= 0)
-			return CDF_STATUS_E_FAILURE;
-
-		pPlmRequest->measDuration = content;
-		hddLog(CDF_TRACE_LEVEL_DEBUG, "measDur %d",
-		       pPlmRequest->measDuration);
-		cmdPtr = strpbrk(cmdPtr, " ");
-
-		if (NULL == cmdPtr)
-			return CDF_STATUS_E_FAILURE;
-
-		/* remove empty spaces */
-		while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-			cmdPtr++;
-
-		/* burst length of PLM bursts */
-		ret = sscanf(cmdPtr, "%31s ", buf);
-		if (1 != ret)
-			return CDF_STATUS_E_FAILURE;
-
-		ret = kstrtos32(buf, 10, &content);
-		if (ret < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		if (content <= 0)
-			return CDF_STATUS_E_FAILURE;
-
-		pPlmRequest->burstLen = content;
-		hddLog(CDF_TRACE_LEVEL_DEBUG, "burstLen %d",
-		       pPlmRequest->burstLen);
-		cmdPtr = strpbrk(cmdPtr, " ");
-
-		if (NULL == cmdPtr)
-			return CDF_STATUS_E_FAILURE;
-
-		/* remove empty spaces */
-		while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-			cmdPtr++;
-
-		/* desired tx power for transmission of PLM bursts */
-		ret = sscanf(cmdPtr, "%31s ", buf);
-		if (1 != ret)
-			return CDF_STATUS_E_FAILURE;
-
-		ret = kstrtos32(buf, 10, &content);
-		if (ret < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		if (content <= 0)
-			return CDF_STATUS_E_FAILURE;
-
-		pPlmRequest->desiredTxPwr = content;
-		hddLog(CDF_TRACE_LEVEL_DEBUG,
-		       "desiredTxPwr %d", pPlmRequest->desiredTxPwr);
-
-		for (count = 0; count < CDF_MAC_ADDR_SIZE; count++) {
-			cmdPtr = strpbrk(cmdPtr, " ");
-
-			if (NULL == cmdPtr)
-				return CDF_STATUS_E_FAILURE;
-
-			/* remove empty spaces */
-			while ((SPACE_ASCII_VALUE == *cmdPtr)
-			       && ('\0' != *cmdPtr))
-				cmdPtr++;
-
-			ret = sscanf(cmdPtr, "%31s ", buf);
-			if (1 != ret)
-				return CDF_STATUS_E_FAILURE;
-
-			ret = kstrtos32(buf, 16, &content);
-			if (ret < 0)
-				return CDF_STATUS_E_FAILURE;
-
-			pPlmRequest->mac_addr.bytes[count] = content;
-		}
-
-		hdd_debug("MC addr " MAC_ADDRESS_STR,
-		       MAC_ADDR_ARRAY(pPlmRequest->mac_addr.bytes));
-
-		cmdPtr = strpbrk(cmdPtr, " ");
-
-		if (NULL == cmdPtr)
-			return CDF_STATUS_E_FAILURE;
-
-		/* remove empty spaces */
-		while ((SPACE_ASCII_VALUE == *cmdPtr) && ('\0' != *cmdPtr))
-			cmdPtr++;
-
-		/* number of channels */
-		ret = sscanf(cmdPtr, "%31s ", buf);
-		if (1 != ret)
-			return CDF_STATUS_E_FAILURE;
-
-		ret = kstrtos32(buf, 10, &content);
-		if (ret < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		if (content < 0)
-			return CDF_STATUS_E_FAILURE;
-
-		pPlmRequest->plmNumCh = content;
-		hddLog(CDF_TRACE_LEVEL_DEBUG, "numch %d",
-		       pPlmRequest->plmNumCh);
-
-		/* Channel numbers */
-		for (count = 0; count < pPlmRequest->plmNumCh; count++) {
-			cmdPtr = strpbrk(cmdPtr, " ");
-
-			if (NULL == cmdPtr)
-				return CDF_STATUS_E_FAILURE;
-
-			/* remove empty spaces */
-			while ((SPACE_ASCII_VALUE == *cmdPtr)
-			       && ('\0' != *cmdPtr))
-				cmdPtr++;
-
-			ret = sscanf(cmdPtr, "%31s ", buf);
-			if (1 != ret)
-				return CDF_STATUS_E_FAILURE;
-
-			ret = kstrtos32(buf, 10, &content);
-			if (ret < 0)
-				return CDF_STATUS_E_FAILURE;
-
-			if (content <= 0)
-				return CDF_STATUS_E_FAILURE;
-
-			pPlmRequest->plmChList[count] = content;
-			hddLog(CDF_TRACE_LEVEL_DEBUG, " ch- %d",
-			       pPlmRequest->plmChList[count]);
-		}
-	}
-	/* If PLM START */
-	return CDF_STATUS_SUCCESS;
-}
-#endif
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-static void wlan_hdd_ready_to_extwow(void *callbackContext, bool is_success)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *) callbackContext;
-	int rc;
-
-	rc = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != rc) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid"));
-		return;
-	}
-	hdd_ctx->ext_wow_should_suspend = is_success;
-	complete(&hdd_ctx->ready_to_extwow);
-}
-
-static int hdd_enable_ext_wow(hdd_adapter_t *adapter,
-			      tpSirExtWoWParams arg_params)
-{
-	tSirExtWoWParams params;
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
-	int rc;
-
-	cdf_mem_copy(&params, arg_params, sizeof(params));
-
-	INIT_COMPLETION(hdd_ctx->ready_to_extwow);
-
-	cdf_ret_status = sme_configure_ext_wow(hHal, &params,
-						&wlan_hdd_ready_to_extwow,
-						hdd_ctx);
-	if (CDF_STATUS_SUCCESS != cdf_ret_status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("sme_configure_ext_wow returned failure %d"),
-		       cdf_ret_status);
-		return -EPERM;
-	}
-
-	rc = wait_for_completion_timeout(&hdd_ctx->ready_to_extwow,
-			msecs_to_jiffies(WLAN_WAIT_TIME_READY_TO_EXTWOW));
-	if (!rc) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to get ready to extwow", __func__);
-		return -EPERM;
-	}
-
-	if (hdd_ctx->ext_wow_should_suspend) {
-		if (hdd_ctx->config->extWowGotoSuspend) {
-			pm_message_t state;
-
-			state.event = PM_EVENT_SUSPEND;
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				  "%s: Received ready to ExtWoW. Going to suspend",
-				  __func__);
-
-			rc = wlan_hdd_cfg80211_suspend_wlan(hdd_ctx->wiphy, NULL);
-			if (rc < 0) {
-				CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-					"%s: wlan_hdd_cfg80211_suspend_wlan failed, error = %d",
-					__func__, rc);
-				return rc;
-			}
-			cdf_ret_status = wlan_hdd_bus_suspend(state);
-			if (cdf_ret_status != CDF_STATUS_SUCCESS) {
-				CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-					"%s: wlan_hdd_suspend failed, status = %d",
-					__func__, cdf_ret_status);
-				wlan_hdd_cfg80211_resume_wlan(hdd_ctx->wiphy);
-				return -EPERM;
-			}
-		}
-	} else {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Received ready to ExtWoW failure", __func__);
-		return -EPERM;
-	}
-
-	return 0;
-}
-
-static int hdd_enable_ext_wow_parser(hdd_adapter_t *adapter, int vdev_id,
-				     int value)
-{
-	tSirExtWoWParams params;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	int rc;
-
-	rc = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != rc) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (value < EXT_WOW_TYPE_APP_TYPE1 ||
-	    value > EXT_WOW_TYPE_APP_TYPE1_2) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("Invalid type"));
-		return -EINVAL;
-	}
-
-	if (value == EXT_WOW_TYPE_APP_TYPE1 &&
-	    hdd_ctx->is_extwow_app_type1_param_set)
-		params.type = value;
-	else if (value == EXT_WOW_TYPE_APP_TYPE2 &&
-		 hdd_ctx->is_extwow_app_type2_param_set)
-		params.type = value;
-	else if (value == EXT_WOW_TYPE_APP_TYPE1_2 &&
-		 hdd_ctx->is_extwow_app_type1_param_set &&
-		 hdd_ctx->is_extwow_app_type2_param_set)
-		params.type = value;
-	else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Set app params before enable it value %d"), value);
-		return -EINVAL;
-	}
-
-	params.vdev_id = vdev_id;
-	params.wakeup_pin_num = hdd_ctx->config->extWowApp1WakeupPinNumber |
-				(hdd_ctx->config->extWowApp2WakeupPinNumber
-					<< 8);
-
-	return hdd_enable_ext_wow(adapter, &params);
-}
-
-static int hdd_set_app_type1_params(tHalHandle hHal,
-				    tpSirAppType1Params arg_params)
-{
-	tSirAppType1Params params;
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-
-	cdf_mem_copy(&params, arg_params, sizeof(params));
-
-	cdf_ret_status = sme_configure_app_type1_params(hHal, &params);
-	if (CDF_STATUS_SUCCESS != cdf_ret_status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("sme_configure_app_type1_params returned failure %d"),
-		       cdf_ret_status);
-		return -EPERM;
-	}
-
-	return 0;
-}
-
-static int hdd_set_app_type1_parser(hdd_adapter_t *adapter,
-				    char *arg, int len)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
-	char id[20], password[20];
-	tSirAppType1Params params;
-	int rc;
-
-	rc = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != rc) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (2 != sscanf(arg, "%8s %16s", id, password)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  FL("Invalid Number of arguments"));
-		return -EINVAL;
-	}
-
-	memset(&params, 0, sizeof(tSirAppType1Params));
-	params.vdev_id = adapter->sessionId;
-	cdf_copy_macaddr(&params.wakee_mac_addr, &adapter->macAddressCurrent);
-
-	params.id_length = strlen(id);
-	cdf_mem_copy(params.identification_id, id, params.id_length);
-	params.pass_length = strlen(password);
-	cdf_mem_copy(params.password, password, params.pass_length);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: %d %pM %.8s %u %.16s %u",
-		  __func__, params.vdev_id, params.wakee_mac_addr.bytes,
-		  params.identification_id, params.id_length,
-		  params.password, params.pass_length);
-
-	return hdd_set_app_type1_params(hHal, &params);
-}
-
-static int hdd_set_app_type2_params(tHalHandle hHal,
-				    tpSirAppType2Params arg_params)
-{
-	tSirAppType2Params params;
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-
-	cdf_mem_copy(&params, arg_params, sizeof(params));
-
-	cdf_ret_status = sme_configure_app_type2_params(hHal, &params);
-	if (CDF_STATUS_SUCCESS != cdf_ret_status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("sme_configure_app_type2_params returned failure %d"),
-		       cdf_ret_status);
-		return -EPERM;
-	}
-
-	return 0;
-}
-
-static int hdd_set_app_type2_parser(hdd_adapter_t *adapter,
-				    char *arg, int len)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
-	char mac_addr[20], rc4_key[20];
-	unsigned int gateway_mac[CDF_MAC_ADDR_SIZE];
-	tSirAppType2Params params;
-	int ret;
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	memset(&params, 0, sizeof(tSirAppType2Params));
-
-	ret = sscanf(arg, "%17s %16s %x %x %x %u %u %hu %hu %u %u %u %u %u %u",
-		     mac_addr, rc4_key, (unsigned int *)&params.ip_id,
-		     (unsigned int *)&params.ip_device_ip,
-		     (unsigned int *)&params.ip_server_ip,
-		     (unsigned int *)&params.tcp_seq,
-		     (unsigned int *)&params.tcp_ack_seq,
-		     (uint16_t *)&params.tcp_src_port,
-		     (uint16_t *)&params.tcp_dst_port,
-		     (unsigned int *)&params.keepalive_init,
-		     (unsigned int *)&params.keepalive_min,
-		     (unsigned int *)&params.keepalive_max,
-		     (unsigned int *)&params.keepalive_inc,
-		     (unsigned int *)&params.tcp_tx_timeout_val,
-		     (unsigned int *)&params.tcp_rx_timeout_val);
-
-	if (ret != 15 && ret != 7) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "Invalid Number of arguments");
-		return -EINVAL;
-	}
-
-	if (6 !=
-	    sscanf(mac_addr, "%02x:%02x:%02x:%02x:%02x:%02x", &gateway_mac[0],
-		   &gateway_mac[1], &gateway_mac[2], &gateway_mac[3],
-		   &gateway_mac[4], &gateway_mac[5])) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "Invalid MacAddress Input %s", mac_addr);
-		return -EINVAL;
-	}
-
-	if (params.tcp_src_port > WLAN_HDD_MAX_TCP_PORT ||
-	    params.tcp_dst_port > WLAN_HDD_MAX_TCP_PORT) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "Invalid TCP Port Number");
-		return -EINVAL;
-	}
-
-	cdf_mem_copy(&params.gateway_mac.bytes, (uint8_t *) &gateway_mac,
-			CDF_MAC_ADDR_SIZE);
-
-	params.rc4_key_len = strlen(rc4_key);
-	cdf_mem_copy(params.rc4_key, rc4_key, params.rc4_key_len);
-
-	params.vdev_id = adapter->sessionId;
-	params.tcp_src_port = (params.tcp_src_port != 0) ?
-		params.tcp_src_port : hdd_ctx->config->extWowApp2TcpSrcPort;
-	params.tcp_dst_port = (params.tcp_dst_port != 0) ?
-		params.tcp_dst_port : hdd_ctx->config->extWowApp2TcpDstPort;
-	params.keepalive_init = (params.keepalive_init != 0) ?
-		params.keepalive_init : hdd_ctx->config->
-						extWowApp2KAInitPingInterval;
-	params.keepalive_min =
-		(params.keepalive_min != 0) ?
-			params.keepalive_min :
-			hdd_ctx->config->extWowApp2KAMinPingInterval;
-	params.keepalive_max =
-		(params.keepalive_max != 0) ?
-			params.keepalive_max :
-			hdd_ctx->config->extWowApp2KAMaxPingInterval;
-	params.keepalive_inc =
-		(params.keepalive_inc != 0) ?
-			params.keepalive_inc :
-			hdd_ctx->config->extWowApp2KAIncPingInterval;
-	params.tcp_tx_timeout_val =
-		(params.tcp_tx_timeout_val != 0) ?
-			params.tcp_tx_timeout_val :
-			hdd_ctx->config->extWowApp2TcpTxTimeout;
-	params.tcp_rx_timeout_val =
-		(params.tcp_rx_timeout_val != 0) ?
-			params.tcp_rx_timeout_val :
-			hdd_ctx->config->extWowApp2TcpRxTimeout;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: %pM %.16s %u %u %u %u %u %u %u %u %u %u %u %u %u",
-		  __func__, gateway_mac, rc4_key, params.ip_id,
-		  params.ip_device_ip, params.ip_server_ip, params.tcp_seq,
-		  params.tcp_ack_seq, params.tcp_src_port, params.tcp_dst_port,
-		  params.keepalive_init, params.keepalive_min,
-		  params.keepalive_max, params.keepalive_inc,
-		  params.tcp_tx_timeout_val, params.tcp_rx_timeout_val);
-
-	return hdd_set_app_type2_params(hHal, &params);
-}
-#endif /* WLAN_FEATURE_EXTWOW_SUPPORT */
-
-/**
- * hdd_parse_setmaxtxpower_command() - HDD Parse MAXTXPOWER command
- * @pValue:	Pointer to MAXTXPOWER command
- * @pDbm:	Pointer to tx power
- *
- * This function parses the MAXTXPOWER command passed in the format
- * MAXTXPOWER<space>X(Tx power in dbm)
- *
- * For example input commands:
- * 1) MAXTXPOWER -8 -> This is translated into set max TX power to -8 dbm
- * 2) MAXTXPOWER -23 -> This is translated into set max TX power to -23 dbm
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_parse_setmaxtxpower_command(uint8_t *pValue, int *pTxPower)
-{
-	uint8_t *inPtr = pValue;
-	int tempInt;
-	int v = 0;
-	*pTxPower = 0;
-
-	inPtr = strnchr(pValue, strlen(pValue), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == inPtr) {
-		return -EINVAL;
-	}
-
-	/* no space after the command */
-	else if (SPACE_ASCII_VALUE != *inPtr) {
-		return -EINVAL;
-	}
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *inPtr) && ('\0' != *inPtr))
-		inPtr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *inPtr) {
-		return 0;
-	}
-
-	v = kstrtos32(inPtr, 10, &tempInt);
-
-	/* Range checking for passed parameter */
-	if ((tempInt < HDD_MIN_TX_POWER) || (tempInt > HDD_MAX_TX_POWER)) {
-		return -EINVAL;
-	}
-
-	*pTxPower = tempInt;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "SETMAXTXPOWER: %d", *pTxPower);
-
-	return 0;
-} /* End of hdd_parse_setmaxtxpower_command */
-
-static int hdd_get_dwell_time(struct hdd_config *pCfg, uint8_t *command,
-			      char *extra, uint8_t n, uint8_t *len)
-{
-	int ret = 0;
-
-	if (!pCfg || !command || !extra || !len) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: argument passed for GETDWELLTIME is incorrect",
-			  __func__);
-		ret = -EINVAL;
-		return ret;
-	}
-
-	if (strncmp(command, "GETDWELLTIME ACTIVE MAX", 23) == 0) {
-		*len = scnprintf(extra, n, "GETDWELLTIME ACTIVE MAX %u\n",
-				 (int)pCfg->nActiveMaxChnTime);
-		return ret;
-	} else if (strncmp(command, "GETDWELLTIME ACTIVE MIN", 23) == 0) {
-		*len = scnprintf(extra, n, "GETDWELLTIME ACTIVE MIN %u\n",
-				 (int)pCfg->nActiveMinChnTime);
-		return ret;
-	} else if (strncmp(command, "GETDWELLTIME PASSIVE MAX", 24) == 0) {
-		*len = scnprintf(extra, n, "GETDWELLTIME PASSIVE MAX %u\n",
-				 (int)pCfg->nPassiveMaxChnTime);
-		return ret;
-	} else if (strncmp(command, "GETDWELLTIME PASSIVE MIN", 24) == 0) {
-		*len = scnprintf(extra, n, "GETDWELLTIME PASSIVE MIN %u\n",
-				 (int)pCfg->nPassiveMinChnTime);
-		return ret;
-	} else if (strncmp(command, "GETDWELLTIME", 12) == 0) {
-		*len = scnprintf(extra, n, "GETDWELLTIME %u \n",
-				 (int)pCfg->nActiveMaxChnTime);
-		return ret;
-	} else {
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-static int hdd_set_dwell_time(hdd_adapter_t *adapter, uint8_t *command)
-{
-	tHalHandle hHal;
-	struct hdd_config *pCfg;
-	uint8_t *value = command;
-	tSmeConfigParams smeConfig;
-	int val = 0, temp = 0;
-
-	pCfg = (WLAN_HDD_GET_CTX(adapter))->config;
-	hHal = WLAN_HDD_GET_HAL_CTX(adapter);
-	if (!pCfg || !hHal) {
-		hddLog(LOGE,
-			FL("argument passed for SETDWELLTIME is incorrect"));
-		return -EINVAL;
-	}
-
-	cdf_mem_zero(&smeConfig, sizeof(smeConfig));
-	sme_get_config_param(hHal, &smeConfig);
-
-	if (strncmp(command, "SETDWELLTIME ACTIVE MAX", 23) == 0) {
-		value = value + 24;
-		temp = kstrtou32(value, 10, &val);
-		if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_MIN ||
-		    val > CFG_ACTIVE_MAX_CHANNEL_TIME_MAX) {
-			hddLog(LOGE,
-				FL("argument passed for SETDWELLTIME ACTIVE MAX is incorrect"));
-			return -EFAULT;
-		}
-		pCfg->nActiveMaxChnTime = val;
-		smeConfig.csrConfig.nActiveMaxChnTime = val;
-		sme_update_config(hHal, &smeConfig);
-	} else if (strncmp(command, "SETDWELLTIME ACTIVE MIN", 23) == 0) {
-		value = value + 24;
-		temp = kstrtou32(value, 10, &val);
-		if (temp != 0 || val < CFG_ACTIVE_MIN_CHANNEL_TIME_MIN ||
-		    val > CFG_ACTIVE_MIN_CHANNEL_TIME_MAX) {
-			hddLog(LOGE,
-				FL("argument passed for SETDWELLTIME ACTIVE MIN is incorrect"));
-			return -EFAULT;
-		}
-		pCfg->nActiveMinChnTime = val;
-		smeConfig.csrConfig.nActiveMinChnTime = val;
-		sme_update_config(hHal, &smeConfig);
-	} else if (strncmp(command, "SETDWELLTIME PASSIVE MAX", 24) == 0) {
-		value = value + 25;
-		temp = kstrtou32(value, 10, &val);
-		if (temp != 0 || val < CFG_PASSIVE_MAX_CHANNEL_TIME_MIN ||
-		    val > CFG_PASSIVE_MAX_CHANNEL_TIME_MAX) {
-			hddLog(LOGE,
-				FL("argument passed for SETDWELLTIME PASSIVE MAX is incorrect"));
-			return -EFAULT;
-		}
-		pCfg->nPassiveMaxChnTime = val;
-		smeConfig.csrConfig.nPassiveMaxChnTime = val;
-		sme_update_config(hHal, &smeConfig);
-	} else if (strncmp(command, "SETDWELLTIME PASSIVE MIN", 24) == 0) {
-		value = value + 25;
-		temp = kstrtou32(value, 10, &val);
-		if (temp != 0 || val < CFG_PASSIVE_MIN_CHANNEL_TIME_MIN ||
-		    val > CFG_PASSIVE_MIN_CHANNEL_TIME_MAX) {
-			hddLog(LOGE,
-				FL("argument passed for SETDWELLTIME PASSIVE MIN is incorrect"));
-			return -EFAULT;
-		}
-		pCfg->nPassiveMinChnTime = val;
-		smeConfig.csrConfig.nPassiveMinChnTime = val;
-		sme_update_config(hHal, &smeConfig);
-	} else if (strncmp(command, "SETDWELLTIME", 12) == 0) {
-		value = value + 13;
-		temp = kstrtou32(value, 10, &val);
-		if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_MIN ||
-		    val > CFG_ACTIVE_MAX_CHANNEL_TIME_MAX) {
-			hddLog(LOGE,
-				FL("argument passed for SETDWELLTIME is incorrect"));
-			return -EFAULT;
-		}
-		pCfg->nActiveMaxChnTime = val;
-		smeConfig.csrConfig.nActiveMaxChnTime = val;
-		sme_update_config(hHal, &smeConfig);
-	} else {
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static void hdd_get_link_status_cb(uint8_t status, void *context)
-{
-	struct statsContext *pLinkContext;
-	hdd_adapter_t *adapter;
-
-	if (NULL == context) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: Bad context [%p]",
-		       __func__, context);
-		return;
-	}
-
-	pLinkContext = context;
-	adapter = pLinkContext->pAdapter;
-
-	spin_lock(&hdd_context_lock);
-
-	if ((NULL == adapter) ||
-	    (LINK_STATUS_MAGIC != pLinkContext->magic)) {
-		/*
-		 * the caller presumably timed out so there is
-		 * nothing we can do
-		 */
-		spin_unlock(&hdd_context_lock);
-		hddLog(CDF_TRACE_LEVEL_WARN,
-		       "%s: Invalid context, adapter [%p] magic [%08x]",
-		       __func__, adapter, pLinkContext->magic);
-		return;
-	}
-
-	/* context is valid so caller is still waiting */
-
-	/* paranoia: invalidate the magic */
-	pLinkContext->magic = 0;
-
-	/* copy over the status */
-	adapter->linkStatus = status;
-
-	/* notify the caller */
-	complete(&pLinkContext->completion);
-
-	/* serialization is complete */
-	spin_unlock(&hdd_context_lock);
-}
-
-/**
- * wlan_hdd_get_link_status() - get link status
- * @pAdapter:     pointer to the adapter
- *
- * This function sends a request to query the link status and waits
- * on a timer to invoke the callback. if the callback is invoked then
- * latest link status shall be returned or otherwise cached value
- * will be returned.
- *
- * Return: On success, link status shall be returned.
- *         On error or not associated, link status 0 will be returned.
- */
-static int wlan_hdd_get_link_status(hdd_adapter_t *adapter)
-{
-
-	hdd_station_ctx_t *pHddStaCtx =
-				WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-	struct statsContext context;
-	CDF_STATUS hstatus;
-	unsigned long rc;
-
-	if (cds_is_driver_recovering()) {
-		hdd_warn("Recovery in Progress. State: 0x%x Ignore!!!",
-			 cds_get_driver_state());
-		return 0;
-	}
-
-	if ((WLAN_HDD_INFRA_STATION != adapter->device_mode) &&
-	    (WLAN_HDD_P2P_CLIENT != adapter->device_mode)) {
-		hdd_warn("Unsupported in mode %s(%d)",
-			 hdd_device_mode_to_string(adapter->device_mode),
-			 adapter->device_mode);
-		return 0;
-	}
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-	if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
-		/* If not associated, then expected link status return
-		 * value is 0
-		 */
-		hddLog(LOG1, FL("Not associated!"));
-		return 0;
-	}
-
-	init_completion(&context.completion);
-	context.pAdapter = adapter;
-	context.magic = LINK_STATUS_MAGIC;
-	hstatus = sme_get_link_status(WLAN_HDD_GET_HAL_CTX(adapter),
-				      hdd_get_link_status_cb,
-				      &context, adapter->sessionId);
-	if (CDF_STATUS_SUCCESS != hstatus) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: Unable to retrieve link status", __func__);
-		/* return a cached value */
-	} else {
-		/* request is sent -- wait for the response */
-		rc = wait_for_completion_timeout(&context.completion,
-				msecs_to_jiffies(WLAN_WAIT_TIME_LINK_STATUS));
-		if (!rc)
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("SME timed out while retrieving link status"));
-	}
-
-	spin_lock(&hdd_context_lock);
-	context.magic = 0;
-	spin_unlock(&hdd_context_lock);
-
-	/* either callback updated adapter stats or it has cached data */
-	return adapter->linkStatus;
-}
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-/**
- * hdd_parse_ese_beacon_req() - Parse ese beacon request
- * @pValue:	Pointer to data
- * @pEseBcnReq:	Output pointer to store parsed ie information
- *
- * This function parses the ese beacon request passed in the format
- * CCXBEACONREQ<space><Number of fields><space><Measurement token>
- * <space>Channel 1<space>Scan Mode <space>Meas Duration<space>Channel N
- * <space>Scan Mode N<space>Meas Duration N
- *
- * If the Number of bcn req fields (N) does not match with the
- * actual number of fields passed then take N.
- * <Meas Token><Channel><Scan Mode> and <Meas Duration> are treated
- * as one pair. For example, CCXBEACONREQ 2 1 1 1 30 2 44 0 40.
- * This function does not take care of removing duplicate channels from the
- * list
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_parse_ese_beacon_req(uint8_t *pValue,
-					tCsrEseBeaconReq *pEseBcnReq)
-{
-	uint8_t *inPtr = pValue;
-	int tempInt = 0;
-	int j = 0, i = 0, v = 0;
-	char buf[32];
-
-	inPtr = strnchr(pValue, strlen(pValue), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == inPtr) {
-		return -EINVAL;
-	}
-	/* no space after the command */
-	else if (SPACE_ASCII_VALUE != *inPtr) {
-		return -EINVAL;
-	}
-
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *inPtr) && ('\0' != *inPtr))
-		inPtr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *inPtr)
-		return -EINVAL;
-
-	/* get the first argument ie measurement token */
-	v = sscanf(inPtr, "%31s ", buf);
-	if (1 != v)
-		return -EINVAL;
-
-	v = kstrtos32(buf, 10, &tempInt);
-	if (v < 0)
-		return -EINVAL;
-
-	pEseBcnReq->numBcnReqIe = tempInt;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "Number of Bcn Req Ie fields(%d)", pEseBcnReq->numBcnReqIe);
-
-	for (j = 0; j < (pEseBcnReq->numBcnReqIe); j++) {
-		for (i = 0; i < 4; i++) {
-			/*
-			 * inPtr pointing to the beginning of 1st space
-			 * after number of ie fields
-			 */
-			inPtr = strpbrk(inPtr, " ");
-			/* no ie data after the number of ie fields argument */
-			if (NULL == inPtr)
-				return -EINVAL;
-
-			/* remove empty space */
-			while ((SPACE_ASCII_VALUE == *inPtr)
-			       && ('\0' != *inPtr))
-				inPtr++;
-
-			/*
-			 * no ie data after the number of ie fields
-			 * argument and spaces
-			 */
-			if ('\0' == *inPtr)
-				return -EINVAL;
-
-			v = sscanf(inPtr, "%31s ", buf);
-			if (1 != v)
-				return -EINVAL;
-
-			v = kstrtos32(buf, 10, &tempInt);
-			if (v < 0)
-				return -EINVAL;
-
-			switch (i) {
-			case 0: /* Measurement token */
-				if (tempInt <= 0) {
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "Invalid Measurement Token(%d)",
-						  tempInt);
-					return -EINVAL;
-				}
-				pEseBcnReq->bcnReq[j].measurementToken =
-					tempInt;
-				break;
-
-			case 1: /* Channel number */
-				if ((tempInt <= 0) ||
-				    (tempInt >
-				     WNI_CFG_CURRENT_CHANNEL_STAMAX)) {
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "Invalid Channel Number(%d)",
-						  tempInt);
-					return -EINVAL;
-				}
-				pEseBcnReq->bcnReq[j].channel = tempInt;
-				break;
-
-			case 2: /* Scan mode */
-				if ((tempInt < eSIR_PASSIVE_SCAN)
-				    || (tempInt > eSIR_BEACON_TABLE)) {
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "Invalid Scan Mode(%d) Expected{0|1|2}",
-						  tempInt);
-					return -EINVAL;
-				}
-				pEseBcnReq->bcnReq[j].scanMode = tempInt;
-				break;
-
-			case 3: /* Measurement duration */
-				if (((tempInt <= 0)
-				     && (pEseBcnReq->bcnReq[j].scanMode !=
-					 eSIR_BEACON_TABLE)) ||
-				    ((tempInt < 0) &&
-				     (pEseBcnReq->bcnReq[j].scanMode ==
-						eSIR_BEACON_TABLE))) {
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "Invalid Measurement Duration(%d)",
-						  tempInt);
-					return -EINVAL;
-				}
-				pEseBcnReq->bcnReq[j].measurementDuration =
-					tempInt;
-				break;
-			}
-		}
-	}
-
-	for (j = 0; j < pEseBcnReq->numBcnReqIe; j++) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-			  "Index(%d) Measurement Token(%u) Channel(%u) Scan Mode(%u) Measurement Duration(%u)",
-			  j,
-			  pEseBcnReq->bcnReq[j].measurementToken,
-			  pEseBcnReq->bcnReq[j].channel,
-			  pEseBcnReq->bcnReq[j].scanMode,
-			  pEseBcnReq->bcnReq[j].measurementDuration);
-	}
-
-	return 0;
-}
-#endif /* defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) */
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-/**
- * hdd_parse_get_cckm_ie() - HDD Parse and fetch the CCKM IE
- * @pValue:	Pointer to input data
- * @pCckmIe:	Pointer to output cckm Ie
- * @pCckmIeLen:	Pointer to output cckm ie length
- *
- * This function parses the SETCCKM IE command
- * SETCCKMIE<space><ie data>
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_parse_get_cckm_ie(uint8_t *pValue, uint8_t **pCckmIe,
-				 uint8_t *pCckmIeLen)
-{
-	uint8_t *inPtr = pValue;
-	uint8_t *dataEnd;
-	int j = 0;
-	int i = 0;
-	uint8_t tempByte = 0;
-	inPtr = strnchr(pValue, strlen(pValue), SPACE_ASCII_VALUE);
-	/* no argument after the command */
-	if (NULL == inPtr) {
-		return -EINVAL;
-	}
-	/* no space after the command */
-	else if (SPACE_ASCII_VALUE != *inPtr) {
-		return -EINVAL;
-	}
-	/* remove empty spaces */
-	while ((SPACE_ASCII_VALUE == *inPtr) && ('\0' != *inPtr))
-		inPtr++;
-	/* no argument followed by spaces */
-	if ('\0' == *inPtr) {
-		return -EINVAL;
-	}
-	/* find the length of data */
-	dataEnd = inPtr;
-	while (('\0' != *dataEnd)) {
-		dataEnd++;
-		++(*pCckmIeLen);
-	}
-	if (*pCckmIeLen <= 0)
-		return -EINVAL;
-	/*
-	 * Allocate the number of bytes based on the number of input characters
-	 * whether it is even or odd.
-	 * if the number of input characters are even, then we need N / 2 byte.
-	 * if the number of input characters are odd, then we need do
-	 * (N + 1) / 2 to compensate rounding off.
-	 * For example, if N = 18, then (18 + 1) / 2 = 9 bytes are enough.
-	 * If N = 19, then we need 10 bytes, hence (19 + 1) / 2 = 10 bytes
-	 */
-	*pCckmIe = cdf_mem_malloc((*pCckmIeLen + 1) / 2);
-	if (NULL == *pCckmIe) {
-		hddLog(LOGE, FL("cdf_mem_alloc failed"));
-		return -ENOMEM;
-	}
-	cdf_mem_zero(*pCckmIe, (*pCckmIeLen + 1) / 2);
-	/*
-	 * the buffer received from the upper layer is character buffer,
-	 * we need to prepare the buffer taking 2 characters in to a U8 hex
-	 * decimal number for example 7f0000f0...form a buffer to contain
-	 * 7f in 0th location, 00 in 1st and f0 in 3rd location
-	 */
-	for (i = 0, j = 0; j < *pCckmIeLen; j += 2) {
-		tempByte = (hex_to_bin(inPtr[j]) << 4) |
-			   (hex_to_bin(inPtr[j + 1]));
-		(*pCckmIe)[i++] = tempByte;
-	}
-	*pCckmIeLen = i;
-	return 0;
-}
-#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
-
-int wlan_hdd_set_mc_rate(hdd_adapter_t *pAdapter, int targetRate)
-{
-	tSirRateUpdateInd rateUpdate = {0};
-	CDF_STATUS status;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	struct hdd_config *pConfig = NULL;
-
-	if (pHddCtx == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: HDD context is null", __func__);
-		return -EINVAL;
-	}
-	if ((WLAN_HDD_IBSS != pAdapter->device_mode) &&
-	    (WLAN_HDD_SOFTAP != pAdapter->device_mode) &&
-	    (WLAN_HDD_INFRA_STATION != pAdapter->device_mode)) {
-		hddLog(LOGE,
-			FL("Received SETMCRATE cmd in invalid mode %s(%d)"),
-			hdd_device_mode_to_string(pAdapter->device_mode),
-			pAdapter->device_mode);
-		hddLog(LOGE,
-			FL("SETMCRATE cmd is allowed only in STA, IBSS or SOFTAP mode"));
-		return -EINVAL;
-	}
-	pConfig = pHddCtx->config;
-	rateUpdate.nss = (pConfig->enable2x2 == 0) ? 0 : 1;
-	rateUpdate.dev_mode = pAdapter->device_mode;
-	rateUpdate.mcastDataRate24GHz = targetRate;
-	rateUpdate.mcastDataRate24GHzTxFlag = 1;
-	rateUpdate.mcastDataRate5GHz = targetRate;
-	rateUpdate.bcastDataRate = -1;
-	cdf_copy_macaddr(&rateUpdate.bssid, &pAdapter->macAddressCurrent);
-	hddLog(LOG1,
-		FL("MC Target rate %d, mac = %pM, dev_mode %s(%d)"),
-		rateUpdate.mcastDataRate24GHz, rateUpdate.bssid.bytes,
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-	status = sme_send_rate_update_ind(pHddCtx->hHal, &rateUpdate);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: SETMCRATE failed",
-		       __func__);
-		return -EFAULT;
-	}
-	return 0;
-}
-
-static int drv_cmd_p2p_dev_addr(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_P2P_DEV_ADDR_IOCTL,
-			 adapter->sessionId,
-			(unsigned)(*(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))) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: failed to copy data to user buffer",
-		       __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-/**
- * drv_cmd_p2p_set_noa() - Handler for P2P_SET_NOA driver command
- * @adapter: Adapter on which the command was received
- * @hdd_ctx: HDD global context
- * @command: Entire driver command received from userspace
- * @command_len: Length of @command
- * @priv_data: Pointer to ioctl private data structure
- *
- * This is a trivial command hander function which simply forwards the
- * command to the actual command processor within the P2P module.
- *
- * Return: 0 on success, non-zero on failure
- */
-static int drv_cmd_p2p_set_noa(hdd_adapter_t *adapter,
-			       hdd_context_t *hdd_ctx,
-			       uint8_t *command,
-			       uint8_t command_len,
-			       hdd_priv_data_t *priv_data)
-{
-	return hdd_set_p2p_noa(adapter->dev, command);
-}
-
-/**
- * drv_cmd_p2p_set_ps() - Handler for P2P_SET_PS driver command
- * @adapter: Adapter on which the command was received
- * @hdd_ctx: HDD global context
- * @command: Entire driver command received from userspace
- * @command_len: Length of @command
- * @priv_data: Pointer to ioctl private data structure
- *
- * This is a trivial command hander function which simply forwards the
- * command to the actual command processor within the P2P module.
- *
- * Return: 0 on success, non-zero on failure
- */
-static int drv_cmd_p2p_set_ps(hdd_adapter_t *adapter,
-			      hdd_context_t *hdd_ctx,
-			      uint8_t *command,
-			      uint8_t command_len,
-			      hdd_priv_data_t *priv_data)
-{
-	return hdd_set_p2p_opps(adapter->dev, command);
-}
-
-static int drv_cmd_set_band(hdd_adapter_t *adapter,
-			    hdd_context_t *hdd_ctx,
-			    uint8_t *command,
-			    uint8_t command_len,
-			    hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-
-	uint8_t *ptr = command;
-
-	/* Change band request received */
-
-	/*
-	 * First 8 bytes will have "SETBAND " and
-	 * 9 byte will have band setting value
-	 */
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "%s: SetBandCommand Info  comm %s UL %d, TL %d",
-	       __func__, command, priv_data->used_len,
-	       priv_data->total_len);
-
-	/* Change band request received */
-	ret = hdd_set_band_helper(adapter->dev, ptr);
-
-	return ret;
-}
-
-static int drv_cmd_set_wmmps(hdd_adapter_t *adapter,
-			     hdd_context_t *hdd_ctx,
-			     uint8_t *command,
-			     uint8_t command_len,
-			     hdd_priv_data_t *priv_data)
-{
-	return hdd_wmmps_helper(adapter, command);
-}
-
-static int drv_cmd_country(hdd_adapter_t *adapter,
-			   hdd_context_t *hdd_ctx,
-			   uint8_t *command,
-			   uint8_t command_len,
-			   hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	CDF_STATUS status;
-	unsigned long rc;
-	char *country_code;
-
-	country_code = command + 8;
-
-	INIT_COMPLETION(adapter->change_country_code);
-
-	status = sme_change_country_code(hdd_ctx->hHal,
-			wlan_hdd_change_country_code_callback,
-			country_code,
-			adapter,
-			hdd_ctx->pcds_context,
-			eSIR_TRUE,
-			eSIR_TRUE);
-	if (status == CDF_STATUS_SUCCESS) {
-		rc = wait_for_completion_timeout(
-			&adapter->change_country_code,
-			 msecs_to_jiffies(WLAN_WAIT_TIME_COUNTRY));
-		if (!rc)
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: SME while setting country code timed out",
-			       __func__);
-	} else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: SME Change Country code fail, status=%d",
-		       __func__, status);
-		ret = -EINVAL;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_trigger(hdd_adapter_t *adapter,
-				    hdd_context_t *hdd_ctx,
-				    uint8_t *command,
-				    uint8_t command_len,
-				    hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	int8_t rssi = 0;
-	uint8_t lookUpThreshold = CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_DEFAULT;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	/* Move pointer to ahead of SETROAMTRIGGER<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtos8(value, 10, &rssi);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed Input value may be out of range[%d - %d]",
-			  __func__,
-			  CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN,
-			  CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	lookUpThreshold = abs(rssi);
-
-	if ((lookUpThreshold < CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN)
-	    || (lookUpThreshold > CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Neighbor lookup threshold value %d is out of range (Min: %d Max: %d)",
-			  lookUpThreshold,
-			  CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MIN,
-			  CFG_NEIGHBOR_LOOKUP_RSSI_THRESHOLD_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_SETROAMTRIGGER_IOCTL,
-			 adapter->sessionId, lookUpThreshold));
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set Roam trigger (Neighbor lookup threshold) = %d",
-		  __func__,
-		  lookUpThreshold);
-
-	hdd_ctx->config->nNeighborLookupRssiThreshold = lookUpThreshold;
-	status = sme_set_neighbor_lookup_rssi_threshold(hdd_ctx->hHal,
-							adapter->sessionId,
-							lookUpThreshold);
-	if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to set roam trigger, try again",
-			  __func__);
-		ret = -EPERM;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_trigger(hdd_adapter_t *adapter,
-				    hdd_context_t *hdd_ctx,
-				    uint8_t *command,
-				    uint8_t command_len,
-				    hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t lookUpThreshold =
-		sme_get_neighbor_lookup_rssi_threshold(hdd_ctx->hHal);
-	int rssi = (-1) * lookUpThreshold;
-	char extra[32];
-	uint8_t len = 0;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_GETROAMTRIGGER_IOCTL,
-			 adapter->sessionId, lookUpThreshold));
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, rssi);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_scan_period(hdd_adapter_t *adapter,
-					hdd_context_t *hdd_ctx,
-					uint8_t *command,
-					uint8_t command_len,
-					hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t roamScanPeriod = 0;
-	uint16_t neighborEmptyScanRefreshPeriod =
-		CFG_EMPTY_SCAN_REFRESH_PERIOD_DEFAULT;
-
-	/* input refresh period is in terms of seconds */
-
-	/* Move pointer to ahead of SETROAMSCANPERIOD<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &roamScanPeriod);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed Input value may be out of range[%d - %d]",
-			  __func__,
-			  (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000),
-			  (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000));
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((roamScanPeriod < (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000))
-	    || (roamScanPeriod > (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000))) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Roam scan period value %d is out of range (Min: %d Max: %d)",
-			  roamScanPeriod,
-			  (CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN / 1000),
-			  (CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX / 1000));
-		ret = -EINVAL;
-		goto exit;
-	}
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_SETROAMSCANPERIOD_IOCTL,
-			 adapter->sessionId, roamScanPeriod));
-	neighborEmptyScanRefreshPeriod = roamScanPeriod * 1000;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set roam scan period (Empty Scan refresh period) = %d",
-		  __func__,
-		  roamScanPeriod);
-
-	hdd_ctx->config->nEmptyScanRefreshPeriod =
-		neighborEmptyScanRefreshPeriod;
-	sme_update_empty_scan_refresh_period(hdd_ctx->hHal,
-					     adapter->sessionId,
-					     neighborEmptyScanRefreshPeriod);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_scan_period(hdd_adapter_t *adapter,
-					hdd_context_t *hdd_ctx,
-					uint8_t *command,
-					uint8_t command_len,
-					hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint16_t nEmptyScanRefreshPeriod =
-		sme_get_empty_scan_refresh_period(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_GETROAMSCANPERIOD_IOCTL,
-			 adapter->sessionId,
-			 nEmptyScanRefreshPeriod));
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETROAMSCANPERIOD",
-			(nEmptyScanRefreshPeriod / 1000));
-	/* Returned value is in units of seconds */
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		hddLog(LOGE,
-			FL("failed to copy data to user buffer"));
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_scan_refresh_period(hdd_adapter_t *adapter,
-						hdd_context_t *hdd_ctx,
-						uint8_t *command,
-						uint8_t command_len,
-						hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t roamScanRefreshPeriod = 0;
-	uint16_t neighborScanRefreshPeriod =
-		CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_DEFAULT;
-
-	/* input refresh period is in terms of seconds */
-	/* Move pointer to ahead of SETROAMSCANREFRESHPERIOD<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &roamScanRefreshPeriod);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed Input value may be out of range[%d - %d]",
-			  __func__,
-			  CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN / 1000,
-			  CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX / 1000);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((roamScanRefreshPeriod <
-		(CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN / 1000))
-	    || (roamScanRefreshPeriod >
-		(CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX / 1000))) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Neighbor scan results refresh period value %d is out of range (Min: %d Max: %d)",
-			  roamScanRefreshPeriod,
-			  (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN
-					   / 1000),
-			  (CFG_NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX
-					   / 1000));
-		ret = -EINVAL;
-		goto exit;
-	}
-	neighborScanRefreshPeriod = roamScanRefreshPeriod * 1000;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set roam scan refresh period (Scan refresh period) = %d",
-		  __func__,
-		  roamScanRefreshPeriod);
-
-	hdd_ctx->config->nNeighborResultsRefreshPeriod =
-				neighborScanRefreshPeriod;
-	sme_set_neighbor_scan_refresh_period(hdd_ctx->hHal,
-					     adapter->sessionId,
-					     neighborScanRefreshPeriod);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_scan_refresh_period(hdd_adapter_t *adapter,
-						hdd_context_t *hdd_ctx,
-						uint8_t *command,
-						uint8_t command_len,
-						hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint16_t value =
-		sme_get_neighbor_scan_refresh_period(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETROAMSCANREFRESHPERIOD",
-			(value / 1000));
-	/* Returned value is in units of seconds */
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_mode(hdd_adapter_t *adapter,
-				 hdd_context_t *hdd_ctx,
-				 uint8_t *command,
-				 uint8_t command_len,
-				 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t roamMode = CFG_LFR_FEATURE_ENABLED_DEFAULT;
-
-	/* Move pointer to ahead of SETROAMMODE<delimiter> */
-	value = value + SIZE_OF_SETROAMMODE + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, SIZE_OF_SETROAMMODE, &roamMode);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_LFR_FEATURE_ENABLED_MIN,
-			  CFG_LFR_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-	if ((roamMode < CFG_LFR_FEATURE_ENABLED_MIN) ||
-	    (roamMode > CFG_LFR_FEATURE_ENABLED_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Roam Mode value %d is out of range (Min: %d Max: %d)",
-			  roamMode,
-			  CFG_LFR_FEATURE_ENABLED_MIN,
-			  CFG_LFR_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_DEBUG,
-		  "%s: Received Command to Set Roam Mode = %d",
-		  __func__, roamMode);
-	/*
-	 * Note that
-	 *     SETROAMMODE 0 is to enable LFR while
-	 *     SETROAMMODE 1 is to disable LFR, but
-	 *     notify_is_fast_roam_ini_feature_enabled 0/1 is to
-	 *     enable/disable. So, we have to invert the value
-	 *     to call sme_update_is_fast_roam_ini_feature_enabled.
-	 */
-	if (CFG_LFR_FEATURE_ENABLED_MIN == roamMode)
-		roamMode = CFG_LFR_FEATURE_ENABLED_MAX;  /* Roam enable */
-	else
-		roamMode = CFG_LFR_FEATURE_ENABLED_MIN;  /* Roam disable */
-
-	hdd_ctx->config->isFastRoamIniFeatureEnabled = roamMode;
-	if (roamMode) {
-		hdd_ctx->config->isRoamOffloadScanEnabled = roamMode;
-		sme_update_roam_scan_offload_enabled(
-			(tHalHandle)(hdd_ctx->hHal),
-			hdd_ctx->config->isRoamOffloadScanEnabled);
-		sme_update_is_fast_roam_ini_feature_enabled(
-			hdd_ctx->hHal,
-			adapter->sessionId,
-			roamMode);
-	} else {
-		sme_update_is_fast_roam_ini_feature_enabled(
-			hdd_ctx->hHal,
-			adapter->sessionId,
-			roamMode);
-		hdd_ctx->config->isRoamOffloadScanEnabled = roamMode;
-		sme_update_roam_scan_offload_enabled(
-			(tHalHandle)(hdd_ctx->hHal),
-			hdd_ctx->config->isRoamOffloadScanEnabled);
-	}
-
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_mode(hdd_adapter_t *adapter,
-				 hdd_context_t *hdd_ctx,
-				 uint8_t *command,
-				 uint8_t command_len,
-				 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	bool roamMode = sme_get_is_lfr_feature_enabled(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	/*
-	 * roamMode value shall be inverted because the sementics is different.
-	 */
-	if (CFG_LFR_FEATURE_ENABLED_MIN == roamMode)
-		roamMode = CFG_LFR_FEATURE_ENABLED_MAX;
-	else
-		roamMode = CFG_LFR_FEATURE_ENABLED_MIN;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, roamMode);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_delta(hdd_adapter_t *adapter,
-				  hdd_context_t *hdd_ctx,
-				  uint8_t *command,
-				  uint8_t command_len,
-				  hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t roamRssiDiff = CFG_ROAM_RSSI_DIFF_DEFAULT;
-
-	/* Move pointer to ahead of SETROAMDELTA<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &roamRssiDiff);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_ROAM_RSSI_DIFF_MIN,
-			  CFG_ROAM_RSSI_DIFF_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((roamRssiDiff < CFG_ROAM_RSSI_DIFF_MIN) ||
-	    (roamRssiDiff > CFG_ROAM_RSSI_DIFF_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Roam rssi diff value %d is out of range (Min: %d Max: %d)",
-			  roamRssiDiff,
-			  CFG_ROAM_RSSI_DIFF_MIN,
-			  CFG_ROAM_RSSI_DIFF_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set roam rssi diff = %d",
-		  __func__, roamRssiDiff);
-
-	hdd_ctx->config->RoamRssiDiff = roamRssiDiff;
-	sme_update_roam_rssi_diff(hdd_ctx->hHal,
-				  adapter->sessionId,
-				  roamRssiDiff);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_delta(hdd_adapter_t *adapter,
-				  hdd_context_t *hdd_ctx,
-				  uint8_t *command,
-				  uint8_t command_len,
-				  hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t roamRssiDiff =
-		sme_get_roam_rssi_diff(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_GETROAMDELTA_IOCTL,
-			 adapter->sessionId, roamRssiDiff));
-
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			command, roamRssiDiff);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_get_band(hdd_adapter_t *adapter,
-			    hdd_context_t *hdd_ctx,
-			    uint8_t *command,
-			    uint8_t command_len,
-			    hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	int band = -1;
-	char extra[32];
-	uint8_t len = 0;
-
-	hdd_get_band_helper(hdd_ctx, &band);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_GETBAND_IOCTL,
-			 adapter->sessionId, band));
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, band);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_scan_channels(hdd_adapter_t *adapter,
-					  hdd_context_t *hdd_ctx,
-					  uint8_t *command,
-					  uint8_t command_len,
-					  hdd_priv_data_t *priv_data)
-{
-	return hdd_parse_set_roam_scan_channels(adapter, command);
-}
-
-static int drv_cmd_get_roam_scan_channels(hdd_adapter_t *adapter,
-					  hdd_context_t *hdd_ctx,
-					  uint8_t *command,
-					  uint8_t command_len,
-					  hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t ChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
-	uint8_t numChannels = 0;
-	uint8_t j = 0;
-	char extra[128] = { 0 };
-	int len;
-
-	if (CDF_STATUS_SUCCESS !=
-		sme_get_roam_scan_channel_list(hdd_ctx->hHal,
-					       ChannelList,
-					       &numChannels,
-					       adapter->sessionId)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_FATAL,
-			  "%s: failed to get roam scan channel list",
-			  __func__);
-		ret = -EFAULT;
-		goto exit;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_GETROAMSCANCHANNELS_IOCTL,
-			 adapter->sessionId, numChannels));
-	/*
-	 * output channel list is of the format
-	 * [Number of roam scan channels][Channel1][Channel2]...
-	 * copy the number of channels in the 0th index
-	 */
-	len = scnprintf(extra, sizeof(extra), "%s %d", command,
-			numChannels);
-	for (j = 0; (j < numChannels); j++)
-		len += scnprintf(extra + len, sizeof(extra) - len,
-				 " %d", ChannelList[j]);
-
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_ccx_mode(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	bool eseMode = sme_get_is_ese_feature_enabled(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	/*
-	 * Check if the features OKC/ESE/11R are supported simultaneously,
-	 * then this operation is not permitted (return FAILURE)
-	 */
-	if (eseMode &&
-	    hdd_is_okc_mode_enabled(hdd_ctx) &&
-	    sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_WARN,
-			  "%s: OKC/ESE/11R are supported simultaneously hence this operation is not permitted!",
-			  __func__);
-		ret = -EPERM;
-		goto exit;
-	}
-
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETCCXMODE", eseMode);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_okc_mode(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	bool okcMode = hdd_is_okc_mode_enabled(hdd_ctx);
-	char extra[32];
-	uint8_t len = 0;
-
-	/*
-	 * Check if the features OKC/ESE/11R are supported simultaneously,
-	 * then this operation is not permitted (return FAILURE)
-	 */
-	if (okcMode &&
-	    sme_get_is_ese_feature_enabled(hdd_ctx->hHal) &&
-	    sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_WARN,
-			  "%s: OKC/ESE/11R are supported simultaneously hence this operation is not permitted!",
-			  __func__);
-		ret = -EPERM;
-		goto exit;
-	}
-
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETOKCMODE", okcMode);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_fast_roam(hdd_adapter_t *adapter,
-				 hdd_context_t *hdd_ctx,
-				 uint8_t *command,
-				 uint8_t command_len,
-				 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	bool lfrMode = sme_get_is_lfr_feature_enabled(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETFASTROAM", lfrMode);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_get_fast_transition(hdd_adapter_t *adapter,
-				       hdd_context_t *hdd_ctx,
-				       uint8_t *command,
-				       uint8_t command_len,
-				       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	bool ft = sme_get_is_ft_feature_enabled(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-					"GETFASTTRANSITION", ft);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_scan_channel_min_time(hdd_adapter_t *adapter,
-						  hdd_context_t *hdd_ctx,
-						  uint8_t *command,
-						  uint8_t command_len,
-						  hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t minTime = CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_DEFAULT;
-
-	/* Move pointer to ahead of SETROAMSCANCHANNELMINTIME<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &minTime);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__,
-			  CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN,
-			  CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((minTime < CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN) ||
-	    (minTime > CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "scan min channel time value %d is out of range (Min: %d Max: %d)",
-			  minTime,
-			  CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MIN,
-			  CFG_NEIGHBOR_SCAN_MIN_CHAN_TIME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_SETROAMSCANCHANNELMINTIME_IOCTL,
-			 adapter->sessionId, minTime));
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change channel min time = %d",
-		  __func__, minTime);
-
-	hdd_ctx->config->nNeighborScanMinChanTime = minTime;
-	sme_set_neighbor_scan_min_chan_time(hdd_ctx->hHal,
-					    minTime,
-					    adapter->sessionId);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_send_action_frame(hdd_adapter_t *adapter,
-				     hdd_context_t *hdd_ctx,
-				     uint8_t *command,
-				     uint8_t command_len,
-				     hdd_priv_data_t *priv_data)
-{
-	return hdd_parse_sendactionframe(adapter, command);
-}
-
-static int drv_cmd_get_roam_scan_channel_min_time(hdd_adapter_t *adapter,
-						  hdd_context_t *hdd_ctx,
-						  uint8_t *command,
-						  uint8_t command_len,
-						  hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint16_t val = sme_get_neighbor_scan_min_chan_time(hdd_ctx->hHal,
-						adapter->sessionId);
-	char extra[32];
-	uint8_t len = 0;
-
-	/* value is interms of msec */
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETROAMSCANCHANNELMINTIME", val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL,
-			 adapter->sessionId, val));
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_scan_channel_time(hdd_adapter_t *adapter,
-					 hdd_context_t *hdd_ctx,
-					 uint8_t *command,
-					 uint8_t command_len,
-					 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint16_t maxTime = CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_DEFAULT;
-
-	/* Move pointer to ahead of SETSCANCHANNELTIME<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou16(value, 10, &maxTime);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou16 failed range [%d - %d]",
-			  __func__,
-			  CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN,
-			  CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((maxTime < CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN) ||
-	    (maxTime > CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "lfr mode value %d is out of range (Min: %d Max: %d)",
-			  maxTime,
-			  CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MIN,
-			  CFG_NEIGHBOR_SCAN_MAX_CHAN_TIME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change channel max time = %d",
-		  __func__, maxTime);
-
-	hdd_ctx->config->nNeighborScanMaxChanTime = maxTime;
-	sme_set_neighbor_scan_max_chan_time(hdd_ctx->hHal,
-					    adapter->sessionId,
-					    maxTime);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_scan_channel_time(hdd_adapter_t *adapter,
-					 hdd_context_t *hdd_ctx,
-					 uint8_t *command,
-					 uint8_t command_len,
-					 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint16_t val = sme_get_neighbor_scan_max_chan_time(hdd_ctx->hHal,
-				adapter->sessionId);
-	char extra[32];
-	uint8_t len = 0;
-
-	/* value is interms of msec */
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETSCANCHANNELTIME", val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-			 CDF_TRACE(CDF_MODULE_ID_HDD,
-			 CDF_TRACE_LEVEL_ERROR,
-			 "%s: failed to copy data to user buffer",
-			 __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_scan_home_time(hdd_adapter_t *adapter,
-				      hdd_context_t *hdd_ctx,
-				      uint8_t *command,
-				      uint8_t command_len,
-				      hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint16_t val = CFG_NEIGHBOR_SCAN_TIMER_PERIOD_DEFAULT;
-
-	/* Move pointer to ahead of SETSCANHOMETIME<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou16(value, 10, &val);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou16 failed range [%d - %d]",
-			  __func__,
-			  CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN,
-			  CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((val < CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN) ||
-	    (val > CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "scan home time value %d is out of range (Min: %d Max: %d)",
-			  val,
-			  CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MIN,
-			  CFG_NEIGHBOR_SCAN_TIMER_PERIOD_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change scan home time = %d",
-		  __func__, val);
-
-	hdd_ctx->config->nNeighborScanPeriod = val;
-	sme_set_neighbor_scan_period(hdd_ctx->hHal,
-				     adapter->sessionId, val);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_scan_home_time(hdd_adapter_t *adapter,
-				      hdd_context_t *hdd_ctx,
-				      uint8_t *command,
-				      uint8_t command_len,
-				      hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint16_t val = sme_get_neighbor_scan_period(hdd_ctx->hHal,
-						    adapter->
-						    sessionId);
-	char extra[32];
-	uint8_t len = 0;
-
-	/* value is interms of msec */
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETSCANHOMETIME", val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_intra_band(hdd_adapter_t *adapter,
-				       hdd_context_t *hdd_ctx,
-				       uint8_t *command,
-				       uint8_t command_len,
-				       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t val = CFG_ROAM_INTRA_BAND_DEFAULT;
-
-	/* Move pointer to ahead of SETROAMINTRABAND<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &val);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_ROAM_INTRA_BAND_MIN,
-			  CFG_ROAM_INTRA_BAND_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((val < CFG_ROAM_INTRA_BAND_MIN) ||
-	    (val > CFG_ROAM_INTRA_BAND_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "intra band mode value %d is out of range (Min: %d Max: %d)",
-			  val,
-			  CFG_ROAM_INTRA_BAND_MIN,
-			  CFG_ROAM_INTRA_BAND_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change intra band = %d",
-		  __func__, val);
-
-	hdd_ctx->config->nRoamIntraBand = val;
-	sme_set_roam_intra_band(hdd_ctx->hHal, val);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_intra_band(hdd_adapter_t *adapter,
-				       hdd_context_t *hdd_ctx,
-				       uint8_t *command,
-				       uint8_t command_len,
-				       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint16_t val = sme_get_roam_intra_band(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	/* value is interms of msec */
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			"GETROAMINTRABAND", val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_scan_n_probes(hdd_adapter_t *adapter,
-				     hdd_context_t *hdd_ctx,
-				     uint8_t *command,
-				     uint8_t command_len,
-				     hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t nProbes = CFG_ROAM_SCAN_N_PROBES_DEFAULT;
-
-	/* Move pointer to ahead of SETSCANNPROBES<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &nProbes);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_ROAM_SCAN_N_PROBES_MIN,
-			  CFG_ROAM_SCAN_N_PROBES_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((nProbes < CFG_ROAM_SCAN_N_PROBES_MIN) ||
-	    (nProbes > CFG_ROAM_SCAN_N_PROBES_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "NProbes value %d is out of range (Min: %d Max: %d)",
-			  nProbes,
-			  CFG_ROAM_SCAN_N_PROBES_MIN,
-			  CFG_ROAM_SCAN_N_PROBES_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set nProbes = %d",
-		  __func__, nProbes);
-
-	hdd_ctx->config->nProbes = nProbes;
-	sme_update_roam_scan_n_probes(hdd_ctx->hHal,
-				      adapter->sessionId, nProbes);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_scan_n_probes(hdd_adapter_t *adapter,
-				     hdd_context_t *hdd_ctx,
-				     uint8_t *command,
-				     uint8_t command_len,
-				     hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t val = sme_get_roam_scan_n_probes(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_scan_home_away_time(hdd_adapter_t *adapter,
-					   hdd_context_t *hdd_ctx,
-					   uint8_t *command,
-					   uint8_t command_len,
-					   hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint16_t homeAwayTime = CFG_ROAM_SCAN_HOME_AWAY_TIME_DEFAULT;
-
-	/* input value is in units of msec */
-
-	/* Move pointer to ahead of SETSCANHOMEAWAYTIME<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou16(value, 10, &homeAwayTime);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__,
-			  CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN,
-			  CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((homeAwayTime < CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN) ||
-	    (homeAwayTime > CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "homeAwayTime value %d is out of range (Min: %d Max: %d)",
-			  homeAwayTime,
-			  CFG_ROAM_SCAN_HOME_AWAY_TIME_MIN,
-			  CFG_ROAM_SCAN_HOME_AWAY_TIME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set scan away time = %d",
-		  __func__, homeAwayTime);
-
-	if (hdd_ctx->config->nRoamScanHomeAwayTime !=
-	    homeAwayTime) {
-		hdd_ctx->config->nRoamScanHomeAwayTime = homeAwayTime;
-		sme_update_roam_scan_home_away_time(hdd_ctx->hHal,
-						    adapter->sessionId,
-						    homeAwayTime,
-						    true);
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_scan_home_away_time(hdd_adapter_t *adapter,
-					   hdd_context_t *hdd_ctx,
-					   uint8_t *command,
-					   uint8_t command_len,
-					   hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint16_t val = sme_get_roam_scan_home_away_time(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_reassoc(hdd_adapter_t *adapter,
-			   hdd_context_t *hdd_ctx,
-			   uint8_t *command,
-			   uint8_t command_len,
-			   hdd_priv_data_t *priv_data)
-{
-	return hdd_parse_reassoc(adapter, command);
-}
-
-static int drv_cmd_set_wes_mode(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t wesMode = CFG_ENABLE_WES_MODE_NAME_DEFAULT;
-
-	/* Move pointer to ahead of SETWESMODE<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &wesMode);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__,
-			  CFG_ENABLE_WES_MODE_NAME_MIN,
-			  CFG_ENABLE_WES_MODE_NAME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((wesMode < CFG_ENABLE_WES_MODE_NAME_MIN) ||
-	    (wesMode > CFG_ENABLE_WES_MODE_NAME_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "WES Mode value %d is out of range (Min: %d Max: %d)",
-			  wesMode,
-			  CFG_ENABLE_WES_MODE_NAME_MIN,
-			  CFG_ENABLE_WES_MODE_NAME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set WES Mode rssi diff = %d",
-		  __func__, wesMode);
-
-	hdd_ctx->config->isWESModeEnabled = wesMode;
-	sme_update_wes_mode(hdd_ctx->hHal, wesMode, adapter->sessionId);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_wes_mode(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	bool wesMode = sme_get_wes_mode(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, wesMode);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_opportunistic_rssi_diff(hdd_adapter_t *adapter,
-					       hdd_context_t *hdd_ctx,
-					       uint8_t *command,
-					       uint8_t command_len,
-					       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t nOpportunisticThresholdDiff =
-		CFG_OPPORTUNISTIC_SCAN_THRESHOLD_DIFF_DEFAULT;
-
-	/* Move pointer to ahead of SETOPPORTUNISTICRSSIDIFF<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &nOpportunisticThresholdDiff);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed.", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set Opportunistic Threshold diff = %d",
-		  __func__, nOpportunisticThresholdDiff);
-
-	sme_set_roam_opportunistic_scan_threshold_diff(hdd_ctx->hHal,
-				adapter->sessionId,
-				nOpportunisticThresholdDiff);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_opportunistic_rssi_diff(hdd_adapter_t *adapter,
-					       hdd_context_t *hdd_ctx,
-					       uint8_t *command,
-					       uint8_t command_len,
-					       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	int8_t val = sme_get_roam_opportunistic_scan_threshold_diff(
-			hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_roam_rescan_rssi_diff(hdd_adapter_t *adapter,
-					     hdd_context_t *hdd_ctx,
-					     uint8_t *command,
-					     uint8_t command_len,
-					     hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t nRoamRescanRssiDiff = CFG_ROAM_RESCAN_RSSI_DIFF_DEFAULT;
-
-	/* Move pointer to ahead of SETROAMRESCANRSSIDIFF<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &nRoamRescanRssiDiff);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed.", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set Roam Rescan RSSI Diff = %d",
-		  __func__, nRoamRescanRssiDiff);
-
-	sme_set_roam_rescan_rssi_diff(hdd_ctx->hHal,
-				      adapter->sessionId,
-				      nRoamRescanRssiDiff);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_rescan_rssi_diff(hdd_adapter_t *adapter,
-					     hdd_context_t *hdd_ctx,
-					     uint8_t *command,
-					     uint8_t command_len,
-					     hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t val = sme_get_roam_rescan_rssi_diff(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, val);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_set_fast_roam(hdd_adapter_t *adapter,
-				 hdd_context_t *hdd_ctx,
-				 uint8_t *command,
-				 uint8_t command_len,
-				 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t lfrMode = CFG_LFR_FEATURE_ENABLED_DEFAULT;
-
-	/* Move pointer to ahead of SETFASTROAM<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &lfrMode);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_LFR_FEATURE_ENABLED_MIN,
-			  CFG_LFR_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((lfrMode < CFG_LFR_FEATURE_ENABLED_MIN) ||
-	    (lfrMode > CFG_LFR_FEATURE_ENABLED_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "lfr mode value %d is out of range (Min: %d Max: %d)",
-			  lfrMode,
-			  CFG_LFR_FEATURE_ENABLED_MIN,
-			  CFG_LFR_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change lfr mode = %d",
-		  __func__, lfrMode);
-
-	hdd_ctx->config->isFastRoamIniFeatureEnabled = lfrMode;
-	sme_update_is_fast_roam_ini_feature_enabled(hdd_ctx->hHal,
-						    adapter->
-						    sessionId,
-						    lfrMode);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_set_fast_transition(hdd_adapter_t *adapter,
-				       hdd_context_t *hdd_ctx,
-				       uint8_t *command,
-				       uint8_t command_len,
-				       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t ft = CFG_FAST_TRANSITION_ENABLED_NAME_DEFAULT;
-
-	/* Move pointer to ahead of SETFASTROAM<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &ft);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__,
-			  CFG_FAST_TRANSITION_ENABLED_NAME_MIN,
-			  CFG_FAST_TRANSITION_ENABLED_NAME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((ft < CFG_FAST_TRANSITION_ENABLED_NAME_MIN) ||
-	    (ft > CFG_FAST_TRANSITION_ENABLED_NAME_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "ft mode value %d is out of range (Min: %d Max: %d)",
-			  ft,
-			  CFG_FAST_TRANSITION_ENABLED_NAME_MIN,
-			  CFG_FAST_TRANSITION_ENABLED_NAME_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change ft mode = %d",
-		  __func__, ft);
-
-	hdd_ctx->config->isFastTransitionEnabled = ft;
-	sme_update_fast_transition_enabled(hdd_ctx->hHal, ft);
-
-exit:
-	return ret;
-}
-
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-static void hdd_wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssid,
-							int channel)
-{
-	struct wma_roam_invoke_cmd *fastreassoc;
-	cds_msg_t msg = {0};
-
-	fastreassoc = cdf_mem_malloc(sizeof(*fastreassoc));
-	if (NULL == fastreassoc) {
-		hddLog(LOGE, FL("cdf_mem_alloc failed for fastreassoc"));
-		return;
-	}
-	fastreassoc->vdev_id = sessionId;
-	fastreassoc->channel = channel;
-	fastreassoc->bssid[0] = bssid[0];
-	fastreassoc->bssid[1] = bssid[1];
-	fastreassoc->bssid[2] = bssid[2];
-	fastreassoc->bssid[3] = bssid[3];
-	fastreassoc->bssid[4] = bssid[4];
-	fastreassoc->bssid[5] = bssid[5];
-
-	msg.type = SIR_HAL_ROAM_INVOKE;
-	msg.reserved = 0;
-	msg.bodyptr = fastreassoc;
-	if (CDF_STATUS_SUCCESS != cds_mq_post_message(CDF_MODULE_ID_WMA,
-								&msg)) {
-		cdf_mem_free(fastreassoc);
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-		FL("Not able to post ROAM_INVOKE_CMD message to WMA"));
-	}
-}
-#endif
-static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t channel = 0;
-	tSirMacAddr targetApBssid;
-	uint32_t roamId = 0;
-	tCsrRoamModifyProfileFields modProfileFields;
-#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
-	tCsrHandoffRequest handoffInfo;
-#endif
-	hdd_station_ctx_t *pHddStaCtx;
-
-	if (WLAN_HDD_INFRA_STATION != adapter->device_mode) {
-		hdd_warn("Unsupported in mode %s(%d)",
-			 hdd_device_mode_to_string(adapter->device_mode),
-			 adapter->device_mode);
-		return -EINVAL;
-	}
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-
-	/* if not associated, no need to proceed with reassoc */
-	if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_INFO,
-			  "%s:Not associated!", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	ret = hdd_parse_reassoc_command_v1_data(value, targetApBssid,
-						&channel);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to parse reassoc command data",
-			  __func__);
-		goto exit;
-	}
-
-	/*
-	 * if the target bssid is same as currently associated AP,
-	 * issue reassoc to same AP
-	 */
-	if (true == cdf_mem_compare(targetApBssid,
-				    pHddStaCtx->conn_info.bssId.bytes,
-				    CDF_MAC_ADDR_SIZE)) {
-		/* Reassoc to same AP, only supported for Open Security*/
-		if ((pHddStaCtx->conn_info.ucEncryptionType ||
-			  pHddStaCtx->conn_info.mcEncryptionType)) {
-			hddLog(LOGE,
-			  FL("Reassoc to same AP, only supported for Open Security"));
-			return -ENOTSUPP;
-		}
-		hddLog(LOG1,
-		  FL("Reassoc BSSID is same as currently associated AP bssid"));
-		sme_get_modify_profile_fields(hdd_ctx->hHal, adapter->sessionId,
-				&modProfileFields);
-		sme_roam_reassoc(hdd_ctx->hHal, adapter->sessionId,
-			NULL, modProfileFields, &roamId, 1);
-		return 0;
-	}
-
-	/* Check channel number is a valid channel number */
-	if (CDF_STATUS_SUCCESS !=
-		wlan_hdd_validate_operation_channel(adapter, channel)) {
-		hddLog(LOGE, FL("Invalid Channel [%d]"), channel);
-		return -EINVAL;
-	}
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	if (hdd_ctx->config->isRoamOffloadEnabled) {
-		hdd_wma_send_fastreassoc_cmd((int)adapter->sessionId,
-					targetApBssid, (int)channel);
-		goto exit;
-	}
-#endif
-	/* Proceed with reassoc */
-#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
-	handoffInfo.channel = channel;
-	handoffInfo.src = FASTREASSOC;
-	cdf_mem_copy(handoffInfo.bssid, targetApBssid,
-		     sizeof(tSirMacAddr));
-	sme_handoff_request(hdd_ctx->hHal, adapter->sessionId,
-			    &handoffInfo);
-#endif
-
-exit:
-	return ret;
-}
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-static int drv_cmd_ccx_plm_req(hdd_adapter_t *adapter,
-			       hdd_context_t *hdd_ctx,
-			       uint8_t *command,
-			       uint8_t command_len,
-			       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	tpSirPlmReq pPlmRequest = NULL;
-
-	pPlmRequest = cdf_mem_malloc(sizeof(tSirPlmReq));
-	if (NULL == pPlmRequest) {
-		ret = -ENOMEM;
-		goto exit;
-	}
-
-	status = hdd_parse_plm_cmd(value, pPlmRequest);
-	if (CDF_STATUS_SUCCESS != status) {
-		cdf_mem_free(pPlmRequest);
-		pPlmRequest = NULL;
-		ret = -EINVAL;
-		goto exit;
-	}
-	pPlmRequest->sessionId = adapter->sessionId;
-
-	status = sme_set_plm_request(hdd_ctx->hHal, pPlmRequest);
-	if (CDF_STATUS_SUCCESS != status) {
-		cdf_mem_free(pPlmRequest);
-		pPlmRequest = NULL;
-		ret = -EINVAL;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-#endif
-
-#ifdef FEATURE_WLAN_ESE
-static int drv_cmd_set_ccx_mode(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t eseMode = CFG_ESE_FEATURE_ENABLED_DEFAULT;
-
-	/*
-	 * Check if the features OKC/ESE/11R are supported simultaneously,
-	 * then this operation is not permitted (return FAILURE)
-	 */
-	if (sme_get_is_ese_feature_enabled(hdd_ctx->hHal) &&
-	    hdd_is_okc_mode_enabled(hdd_ctx) &&
-	    sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_WARN,
-			  "%s: OKC/ESE/11R are supported simultaneously hence this operation is not permitted!",
-			  __func__);
-		ret = -EPERM;
-		goto exit;
-	}
-
-	/* Move pointer to ahead of SETCCXMODE<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &eseMode);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_ESE_FEATURE_ENABLED_MIN,
-			  CFG_ESE_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((eseMode < CFG_ESE_FEATURE_ENABLED_MIN) ||
-	    (eseMode > CFG_ESE_FEATURE_ENABLED_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Ese mode value %d is out of range (Min: %d Max: %d)",
-			  eseMode,
-			  CFG_ESE_FEATURE_ENABLED_MIN,
-			  CFG_ESE_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change ese mode = %d",
-		  __func__, eseMode);
-
-	hdd_ctx->config->isEseIniFeatureEnabled = eseMode;
-	sme_update_is_ese_feature_enabled(hdd_ctx->hHal,
-					  adapter->sessionId,
-					  eseMode);
-
-exit:
-	return ret;
-}
-#endif
-
-static int drv_cmd_set_roam_scan_control(hdd_adapter_t *adapter,
-					 hdd_context_t *hdd_ctx,
-					 uint8_t *command,
-					 uint8_t command_len,
-					 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t roamScanControl = 0;
-
-	/* Move pointer to ahead of SETROAMSCANCONTROL<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &roamScanControl);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed ", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set roam scan control = %d",
-		  __func__, roamScanControl);
-
-	if (0 != roamScanControl) {
-		ret = 0; /* return success but ignore param value "true" */
-		goto exit;
-	}
-
-	sme_set_roam_scan_control(hdd_ctx->hHal,
-				  adapter->sessionId,
-				  roamScanControl);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_set_okc_mode(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t okcMode = CFG_OKC_FEATURE_ENABLED_DEFAULT;
-
-	/*
-	 * Check if the features OKC/ESE/11R are supported simultaneously,
-	 * then this operation is not permitted (return FAILURE)
-	 */
-	if (sme_get_is_ese_feature_enabled(hdd_ctx->hHal) &&
-	    hdd_is_okc_mode_enabled(hdd_ctx) &&
-	    sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_WARN,
-			  "%s: OKC/ESE/11R are supported simultaneously hence this operation is not permitted!",
-			  __func__);
-		ret = -EPERM;
-		goto exit;
-	}
-
-	/* Move pointer to ahead of SETOKCMODE<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &okcMode);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_OKC_FEATURE_ENABLED_MIN,
-			  CFG_OKC_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((okcMode < CFG_OKC_FEATURE_ENABLED_MIN) ||
-	    (okcMode > CFG_OKC_FEATURE_ENABLED_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Okc mode value %d is out of range (Min: %d Max: %d)",
-			  okcMode,
-			  CFG_OKC_FEATURE_ENABLED_MIN,
-			  CFG_OKC_FEATURE_ENABLED_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to change okc mode = %d",
-		  __func__, okcMode);
-
-	hdd_ctx->config->isOkcIniFeatureEnabled = okcMode;
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_roam_scan_control(hdd_adapter_t *adapter,
-					 hdd_context_t *hdd_ctx,
-					 uint8_t *command,
-					 uint8_t command_len,
-					 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	bool roamScanControl = sme_get_roam_scan_control(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d",
-			command, roamScanControl);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_bt_coex_mode(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	char *bcMode;
-
-	bcMode = command + 11;
-	if ('1' == *bcMode) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_DEBUG,
-			  FL("BTCOEXMODE %d"), *bcMode);
-		hdd_ctx->btCoexModeSet = true;
-		ret = wlan_hdd_scan_abort(adapter);
-		if (ret < 0) {
-			hddLog(LOGE,
-			    FL("Failed to abort existing scan status:%d"), ret);
-		}
-	} else if ('2' == *bcMode) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_DEBUG,
-			  FL("BTCOEXMODE %d"), *bcMode);
-		hdd_ctx->btCoexModeSet = false;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_scan_active(hdd_adapter_t *adapter,
-			       hdd_context_t *hdd_ctx,
-			       uint8_t *command,
-			       uint8_t command_len,
-			       hdd_priv_data_t *priv_data)
-{
-	hdd_ctx->ioctl_scan_mode = eSIR_ACTIVE_SCAN;
-	return 0;
-}
-
-static int drv_cmd_scan_passive(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	hdd_ctx->ioctl_scan_mode = eSIR_PASSIVE_SCAN;
-	return 0;
-}
-
-static int drv_cmd_get_dwell_time(hdd_adapter_t *adapter,
-				  hdd_context_t *hdd_ctx,
-				  uint8_t *command,
-				  uint8_t command_len,
-				  hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	struct hdd_config *pCfg =
-		(WLAN_HDD_GET_CTX(adapter))->config;
-	char extra[32];
-	uint8_t len = 0;
-
-	memset(extra, 0, sizeof(extra));
-	ret = hdd_get_dwell_time(pCfg, command, extra, sizeof(extra), &len);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (ret != 0 || copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-		goto exit;
-	}
-	ret = len;
-exit:
-	return ret;
-}
-
-static int drv_cmd_set_dwell_time(hdd_adapter_t *adapter,
-				  hdd_context_t *hdd_ctx,
-				  uint8_t *command,
-				  uint8_t command_len,
-				  hdd_priv_data_t *priv_data)
-{
-	return hdd_set_dwell_time(adapter, command);
-}
-
-static int drv_cmd_miracast(hdd_adapter_t *adapter,
-			    hdd_context_t *hdd_ctx,
-			    uint8_t *command,
-			    uint8_t command_len,
-			    hdd_priv_data_t *priv_data)
-{
-	CDF_STATUS ret_status;
-	int ret = 0;
-	tHalHandle hHal;
-	uint8_t filterType = 0;
-	hdd_context_t *pHddCtx = NULL;
-	uint8_t *value;
-
-	pHddCtx = WLAN_HDD_GET_CTX(adapter);
-	if (0 != wlan_hdd_validate_context(pHddCtx)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			"%s pHddCtx is not valid, Unable to set miracast mode",
-			 __func__);
-		return -EINVAL;
-	}
-
-	hHal = pHddCtx->hHal;
-	value = command + 9;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &filterType);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range ",
-			  __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-	if ((filterType < WLAN_HDD_DRIVER_MIRACAST_CFG_MIN_VAL)
-	    || (filterType >
-		WLAN_HDD_DRIVER_MIRACAST_CFG_MAX_VAL)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: Accepted Values are 0 to 2. 0-Disabled, 1-Source, 2-Sink ",
-			  __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-	/* Filtertype value should be either 0-Disabled, 1-Source, 2-sink */
-	pHddCtx->miracast_value = filterType;
-
-	ret_status = sme_set_miracast(hHal, filterType);
-	if (CDF_STATUS_SUCCESS != ret_status) {
-		hddLog(LOGE, "Failed to set miracast");
-		return -EBUSY;
-	}
-
-	if (cds_is_mcc_in_24G())
-		return cds_set_mas(adapter, filterType);
-
-exit:
-	return ret;
-}
-
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-static int drv_cmd_set_ccx_roam_scan_channels(hdd_adapter_t *adapter,
-					      hdd_context_t *hdd_ctx,
-					      uint8_t *command,
-					      uint8_t command_len,
-					      hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t ChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
-	uint8_t numChannels = 0;
-	CDF_STATUS status;
-
-	ret = hdd_parse_channellist(value, ChannelList, &numChannels);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to parse channel list information",
-			  __func__);
-		goto exit;
-	}
-	if (numChannels > WNI_CFG_VALID_CHANNEL_LIST_LEN) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: number of channels (%d) supported exceeded max (%d)",
-			  __func__,
-			  numChannels,
-			  WNI_CFG_VALID_CHANNEL_LIST_LEN);
-		ret = -EINVAL;
-		goto exit;
-	}
-	status = sme_set_ese_roam_scan_channel_list(hdd_ctx->hHal,
-						    adapter->sessionId,
-						    ChannelList,
-						    numChannels);
-	if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to update channel list information",
-			  __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_tsm_stats(hdd_adapter_t *adapter,
-				 hdd_context_t *hdd_ctx,
-				 uint8_t *command,
-				 uint8_t command_len,
-				 hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	char extra[128] = { 0 };
-	int len = 0;
-	uint8_t tid = 0;
-	hdd_station_ctx_t *pHddStaCtx;
-	tAniTrafStrmMetrics tsm_metrics;
-
-	if ((WLAN_HDD_INFRA_STATION != adapter->device_mode) &&
-	    (WLAN_HDD_P2P_CLIENT != adapter->device_mode)) {
-		hdd_warn("Unsupported in mode %s(%d)",
-			 hdd_device_mode_to_string(adapter->device_mode),
-			 adapter->device_mode);
-		return -EINVAL;
-	}
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-
-	/* if not associated, return error */
-	if (eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s:Not associated!", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	/* Move pointer to ahead of GETTSMSTATS<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &tid);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, TID_MIN_VALUE,
-			  TID_MAX_VALUE);
-		ret = -EINVAL;
-		goto exit;
-	}
-	if ((tid < TID_MIN_VALUE) || (tid > TID_MAX_VALUE)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "tid value %d is out of range (Min: %d Max: %d)",
-			  tid, TID_MIN_VALUE, TID_MAX_VALUE);
-		ret = -EINVAL;
-		goto exit;
-	}
-	CDF_TRACE(CDF_MODULE_ID_HDD,
-		  CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to get tsm stats tid = %d",
-		  __func__, tid);
-	if (CDF_STATUS_SUCCESS !=
-	    hdd_get_tsm_stats(adapter, tid, &tsm_metrics)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to get tsm stats",
-			  __func__);
-		ret = -EFAULT;
-		goto exit;
-	}
-	CDF_TRACE(CDF_MODULE_ID_HDD,
-		  CDF_TRACE_LEVEL_INFO,
-		  "UplinkPktQueueDly(%d) UplinkPktQueueDlyHist[0](%d) UplinkPktQueueDlyHist[1](%d) UplinkPktQueueDlyHist[2](%d) UplinkPktQueueDlyHist[3](%d) UplinkPktTxDly(%u) UplinkPktLoss(%d) UplinkPktCount(%d) RoamingCount(%d) RoamingDly(%d)",
-		  tsm_metrics.UplinkPktQueueDly,
-		  tsm_metrics.UplinkPktQueueDlyHist[0],
-		  tsm_metrics.UplinkPktQueueDlyHist[1],
-		  tsm_metrics.UplinkPktQueueDlyHist[2],
-		  tsm_metrics.UplinkPktQueueDlyHist[3],
-		  tsm_metrics.UplinkPktTxDly,
-		  tsm_metrics.UplinkPktLoss,
-		  tsm_metrics.UplinkPktCount,
-		  tsm_metrics.RoamingCount,
-		  tsm_metrics.RoamingDly);
-	/*
-	 * Output TSM stats is of the format
-	 * GETTSMSTATS [PktQueueDly]
-	 * [PktQueueDlyHist[0]]:[PktQueueDlyHist[1]] ...[RoamingDly]
-	 * eg., GETTSMSTATS 10 1:0:0:161 20 1 17 8 39800
-	 */
-	len = scnprintf(extra,
-			sizeof(extra),
-			"%s %d %d:%d:%d:%d %u %d %d %d %d",
-			command,
-			tsm_metrics.UplinkPktQueueDly,
-			tsm_metrics.UplinkPktQueueDlyHist[0],
-			tsm_metrics.UplinkPktQueueDlyHist[1],
-			tsm_metrics.UplinkPktQueueDlyHist[2],
-			tsm_metrics.UplinkPktQueueDlyHist[3],
-			tsm_metrics.UplinkPktTxDly,
-			tsm_metrics.UplinkPktLoss,
-			tsm_metrics.UplinkPktCount,
-			tsm_metrics.RoamingCount,
-			tsm_metrics.RoamingDly);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_set_cckm_ie(hdd_adapter_t *adapter,
-			       hdd_context_t *hdd_ctx,
-			       uint8_t *command,
-			       uint8_t command_len,
-			       hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-	uint8_t *cckmIe = NULL;
-	uint8_t cckmIeLen = 0;
-
-	ret = hdd_parse_get_cckm_ie(value, &cckmIe, &cckmIeLen);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to parse cckm ie data",
-			  __func__);
-		goto exit;
-	}
-
-	if (cckmIeLen > DOT11F_IE_RSN_MAX_LEN) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: CCKM Ie input length is more than max[%d]",
-			  __func__, DOT11F_IE_RSN_MAX_LEN);
-		if (NULL != cckmIe) {
-			cdf_mem_free(cckmIe);
-			cckmIe = NULL;
-		}
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	sme_set_cckm_ie(hdd_ctx->hHal, adapter->sessionId,
-			cckmIe, cckmIeLen);
-	if (NULL != cckmIe) {
-		cdf_mem_free(cckmIe);
-		cckmIe = NULL;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_ccx_beacon_req(hdd_adapter_t *adapter,
-				  hdd_context_t *hdd_ctx,
-				  uint8_t *command,
-				  uint8_t command_len,
-				  hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-	tCsrEseBeaconReq eseBcnReq;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	if (WLAN_HDD_INFRA_STATION != adapter->device_mode) {
-		hdd_warn("Unsupported in mode %s(%d)",
-			 hdd_device_mode_to_string(adapter->device_mode),
-			 adapter->device_mode);
-		return -EINVAL;
-	}
-
-	ret = hdd_parse_ese_beacon_req(value, &eseBcnReq);
-	if (ret) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to parse ese beacon req",
-			  __func__);
-		goto exit;
-	}
-
-	if (!hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
-		hddLog(CDF_TRACE_LEVEL_INFO, FL("Not associated"));
-		hdd_indicate_ese_bcn_report_no_results(adapter,
-			eseBcnReq.bcnReq[0].measurementToken,
-			0x02, /* BIT(1) set for measurement done */
-			0);   /* no BSS */
-		goto exit;
-	}
-
-	status = sme_set_ese_beacon_request(hdd_ctx->hHal,
-					    adapter->sessionId,
-					    &eseBcnReq);
-
-	if (CDF_STATUS_E_RESOURCES == status) {
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       FL("sme_set_ese_beacon_request failed (%d), a request already in progress"),
-		       status);
-		ret = -EBUSY;
-		goto exit;
-	} else if (CDF_STATUS_SUCCESS != status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: sme_set_ese_beacon_request failed (%d)",
-			  __func__, status);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-exit:
-	return ret;
-}
-#endif /* #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) */
-
-static int drv_cmd_set_mc_rate(hdd_adapter_t *adapter,
-			       hdd_context_t *hdd_ctx,
-			       uint8_t *command,
-			       uint8_t command_len,
-			       hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	int targetRate;
-
-	/* input value is in units of hundred kbps */
-
-	/* Move pointer to ahead of SETMCRATE<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer, decimal base */
-	ret = kstrtouint(value, 10, &targetRate);
-
-	ret = wlan_hdd_set_mc_rate(adapter, targetRate);
-	return ret;
-}
-
-static int drv_cmd_max_tx_power(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	int status;
-	int txPower;
-	CDF_STATUS cdf_status;
-	CDF_STATUS smeStatus;
-	uint8_t *value = command;
-	struct cdf_mac_addr bssid = CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-	struct cdf_mac_addr selfMac = CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-	hdd_adapter_list_node_t *pAdapterNode = NULL;
-	hdd_adapter_list_node_t *pNext = NULL;
-
-	status = hdd_parse_setmaxtxpower_command(value, &txPower);
-	if (status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "Invalid MAXTXPOWER command ");
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	cdf_status = hdd_get_front_adapter(hdd_ctx, &pAdapterNode);
-	while (NULL != pAdapterNode
-	       && CDF_STATUS_SUCCESS == cdf_status) {
-		adapter = pAdapterNode->pAdapter;
-		/* Assign correct self MAC address */
-		cdf_copy_macaddr(&bssid,
-				 &adapter->macAddressCurrent);
-		cdf_copy_macaddr(&selfMac,
-				 &adapter->macAddressCurrent);
-
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       "Device mode %d max tx power %d selfMac: " MAC_ADDRESS_STR " bssId: " MAC_ADDRESS_STR " ",
-		       adapter->device_mode, txPower,
-		       MAC_ADDR_ARRAY(selfMac.bytes),
-		       MAC_ADDR_ARRAY(bssid.bytes));
-
-		smeStatus = sme_set_max_tx_power(hdd_ctx->hHal,
-						 bssid, selfMac, txPower);
-		if (CDF_STATUS_SUCCESS != status) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s:Set max tx power failed",
-			       __func__);
-			ret = -EINVAL;
-			goto exit;
-		}
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       "%s: Set max tx power success",
-		       __func__);
-		cdf_status = hdd_get_next_adapter(hdd_ctx, pAdapterNode,
-						  &pNext);
-		pAdapterNode = pNext;
-	}
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_set_dfs_scan_mode(hdd_adapter_t *adapter,
-				    hdd_context_t *hdd_ctx,
-				    uint8_t *command,
-				    uint8_t command_len,
-				    hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t *value = command;
-	uint8_t dfsScanMode = CFG_ROAMING_DFS_CHANNEL_DEFAULT;
-
-	/* Move pointer to ahead of SETDFSSCANMODE<delimiter> */
-	value = value + command_len + 1;
-
-	/* Convert the value from ascii to integer */
-	ret = kstrtou8(value, 10, &dfsScanMode);
-	if (ret < 0) {
-		/*
-		 * If the input value is greater than max value of datatype,
-		 * then also kstrtou8 fails
-		 */
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: kstrtou8 failed range [%d - %d]",
-			  __func__, CFG_ROAMING_DFS_CHANNEL_MIN,
-			  CFG_ROAMING_DFS_CHANNEL_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	if ((dfsScanMode < CFG_ROAMING_DFS_CHANNEL_MIN) ||
-	    (dfsScanMode > CFG_ROAMING_DFS_CHANNEL_MAX)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "dfsScanMode value %d is out of range (Min: %d Max: %d)",
-			  dfsScanMode,
-			  CFG_ROAMING_DFS_CHANNEL_MIN,
-			  CFG_ROAMING_DFS_CHANNEL_MAX);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Received Command to Set DFS Scan Mode = %d",
-		  __func__, dfsScanMode);
-
-	/* When DFS scanning is disabled, the DFS channels need to be
-	 * removed from the operation of device.
-	 */
-	ret = wlan_hdd_disable_dfs_chan_scan(hdd_ctx, adapter,
-			(dfsScanMode == CFG_ROAMING_DFS_CHANNEL_DISABLED));
-	if (ret < 0) {
-		/* Some conditions prevented it from disabling DFS channels */
-		hddLog(LOGE,
-		       FL("disable/enable DFS channel request was denied"));
-		goto exit;
-	}
-
-	hdd_ctx->config->allowDFSChannelRoam = dfsScanMode;
-	sme_update_dfs_scan_mode(hdd_ctx->hHal, adapter->sessionId,
-				 dfsScanMode);
-
-exit:
-	return ret;
-}
-
-static int drv_cmd_get_dfs_scan_mode(hdd_adapter_t *adapter,
-				     hdd_context_t *hdd_ctx,
-				     uint8_t *command,
-				     uint8_t command_len,
-				     hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	uint8_t dfsScanMode = sme_get_dfs_scan_mode(hdd_ctx->hHal);
-	char extra[32];
-	uint8_t len = 0;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, dfsScanMode);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_get_link_status(hdd_adapter_t *adapter,
-				   hdd_context_t *hdd_ctx,
-				   uint8_t *command,
-				   uint8_t command_len,
-				   hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	int value = wlan_hdd_get_link_status(adapter);
-	char extra[32];
-	uint8_t len;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, value);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-			  CDF_TRACE_LEVEL_ERROR,
-			  "%s: failed to copy data to user buffer",
-			  __func__);
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-static int drv_cmd_enable_ext_wow(hdd_adapter_t *adapter,
-				  hdd_context_t *hdd_ctx,
-				  uint8_t *command,
-				  uint8_t command_len,
-				  hdd_priv_data_t *priv_data)
-{
-	uint8_t *value = command;
-	int set_value;
-
-	/* Move pointer to ahead of ENABLEEXTWOW */
-	value = value + command_len;
-
-	sscanf(value, "%d", &set_value);
-
-	return hdd_enable_ext_wow_parser(adapter,
-					 adapter->sessionId,
-					 set_value);
-}
-
-static int drv_cmd_set_app1_params(hdd_adapter_t *adapter,
-				   hdd_context_t *hdd_ctx,
-				   uint8_t *command,
-				   uint8_t command_len,
-				   hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-
-	/* Move pointer to ahead of SETAPP1PARAMS */
-	value = value + command_len;
-
-	ret = hdd_set_app_type1_parser(adapter,
-				       value, strlen(value));
-	if (ret >= 0)
-		hdd_ctx->is_extwow_app_type1_param_set = true;
-
-	return ret;
-}
-
-static int drv_cmd_set_app2_params(hdd_adapter_t *adapter,
-				   hdd_context_t *hdd_ctx,
-				   uint8_t *command,
-				   uint8_t command_len,
-				   hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-
-	/* Move pointer to ahead of SETAPP2PARAMS */
-	value = value + command_len;
-
-	ret = hdd_set_app_type2_parser(adapter, value, strlen(value));
-	if (ret >= 0)
-		hdd_ctx->is_extwow_app_type2_param_set = true;
-
-	return ret;
-}
-#endif /* WLAN_FEATURE_EXTWOW_SUPPORT */
-
-#ifdef FEATURE_WLAN_TDLS
-/**
- * drv_cmd_tdls_secondary_channel_offset() - secondary tdls off channel offset
- * @adapter:     Pointer to the HDD adapter
- * @hdd_ctx:     Pointer to the HDD context
- * @command:     Driver command string
- * @command_len: Driver command string length
- * @priv_data:   Private data coming with the driver command. Unused here
- *
- * This function handles driver command that sets the secondary tdls off channel
- * offset
- *
- * Return: 0 on success; negative errno otherwise
- */
-static int drv_cmd_tdls_secondary_channel_offset(hdd_adapter_t *adapter,
-						 hdd_context_t *hdd_ctx,
-						 uint8_t *command,
-						 uint8_t command_len,
-						 hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-	int set_value;
-
-	/* Move pointer to point the string */
-	value += command_len;
-
-	ret = sscanf(value, "%d", &set_value);
-	if (ret != 1)
-		return -EINVAL;
-
-	hddLog(LOG1, FL("Tdls offchannel offset:%d"), set_value);
-
-	ret = hdd_set_tdls_secoffchanneloffset(hdd_ctx, set_value);
-
-	return ret;
-}
-
-/**
- * drv_cmd_tdls_off_channel_mode() - set tdls off channel mode
- * @adapter:     Pointer to the HDD adapter
- * @hdd_ctx:     Pointer to the HDD context
- * @command:     Driver command string
- * @command_len: Driver command string length
- * @priv_data:   Private data coming with the driver command. Unused here
- *
- * This function handles driver command that sets tdls off channel mode
- *
- * Return: 0 on success; negative errno otherwise
- */
-static int drv_cmd_tdls_off_channel_mode(hdd_adapter_t *adapter,
-					 hdd_context_t *hdd_ctx,
-					 uint8_t *command,
-					 uint8_t command_len,
-					 hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-	int set_value;
-
-	/* Move pointer to point the string */
-	value += command_len;
-
-	ret = sscanf(value, "%d", &set_value);
-	if (ret != 1)
-		return -EINVAL;
-
-	hddLog(LOG1, FL("Tdls offchannel mode:%d"), set_value);
-
-	ret = hdd_set_tdls_offchannelmode(adapter, set_value);
-
-	return ret;
-}
-
-/**
- * drv_cmd_tdls_off_channel() - set tdls off channel number
- * @adapter:     Pointer to the HDD adapter
- * @hdd_ctx:     Pointer to the HDD context
- * @command:     Driver command string
- * @command_len: Driver command string length
- * @priv_data:   Private data coming with the driver command. Unused here
- *
- * This function handles driver command that sets tdls off channel number
- *
- * Return: 0 on success; negative errno otherwise
- */
-static int drv_cmd_tdls_off_channel(hdd_adapter_t *adapter,
-				    hdd_context_t *hdd_ctx,
-				    uint8_t *command,
-				    uint8_t command_len,
-				    hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-	int set_value;
-
-	/* Move pointer to point the string */
-	value += command_len;
-
-	ret = sscanf(value, "%d", &set_value);
-	if (ret != 1)
-		return -EINVAL;
-
-	if (CDS_IS_DFS_CH(set_value)) {
-		hdd_err("DFS channel %d is passed for hdd_set_tdls_offchannel",
-		    set_value);
-		return -EINVAL;
-	}
-
-	hddLog(LOG1, FL("Tdls offchannel num: %d"), set_value);
-
-	ret = hdd_set_tdls_offchannel(hdd_ctx, set_value);
-
-	return ret;
-}
-
-/**
- * drv_cmd_tdls_scan() - set tdls scan type
- * @adapter:     Pointer to the HDD adapter
- * @hdd_ctx:     Pointer to the HDD context
- * @command:     Driver command string
- * @command_len: Driver command string length
- * @priv_data:   Private data coming with the driver command. Unused here
- *
- * This function handles driver command that sets tdls scan type
- *
- * Return: 0 on success; negative errno otherwise
- */
-static int drv_cmd_tdls_scan(hdd_adapter_t *adapter,
-				    hdd_context_t *hdd_ctx,
-				    uint8_t *command,
-				    uint8_t command_len,
-				    hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint8_t *value = command;
-	int set_value;
-
-	/* Move pointer to point the string */
-	value += command_len;
-
-	ret = sscanf(value, "%d", &set_value);
-	if (ret != 1)
-		return -EINVAL;
-
-	hddLog(LOG1, FL("Tdls scan type val: %d"), set_value);
-
-	ret = hdd_set_tdls_scan_type(hdd_ctx, set_value);
-
-	return ret;
-}
-#endif
-
-static int drv_cmd_get_rssi(hdd_adapter_t *adapter,
-			    hdd_context_t *hdd_ctx,
-			    uint8_t *command,
-			    uint8_t command_len,
-			    hdd_priv_data_t *priv_data)
-{
-	int ret = 0;
-	int8_t rssi = 0;
-	char extra[32];
-
-	uint8_t len = 0;
-
-	wlan_hdd_get_rssi(adapter, &rssi);
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, rssi);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		hddLog(LOGE, FL("Failed to copy data to user buffer"));
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-static int drv_cmd_get_linkspeed(hdd_adapter_t *adapter,
-				 hdd_context_t *hdd_ctx,
-				 uint8_t *command,
-				 uint8_t command_len,
-				 hdd_priv_data_t *priv_data)
-{
-	int ret;
-	uint32_t link_speed = 0;
-	char extra[32];
-	uint8_t len = 0;
-
-	ret = wlan_hdd_get_link_speed(adapter, &link_speed);
-	if (0 != ret)
-		return ret;
-
-	len = scnprintf(extra, sizeof(extra), "%s %d", command, link_speed);
-	len = CDF_MIN(priv_data->total_len, len + 1);
-	if (copy_to_user(priv_data->buf, &extra, len)) {
-		hddLog(LOGE, FL("Failed to copy data to user buffer"));
-		ret = -EFAULT;
-	}
-
-	return ret;
-}
-
-#ifdef FEATURE_NAPI
-/**
- * hdd_parse_napi() - helper functions to drv_cmd_napi
- * @str : source string to parse
- * @cmd : pointer to cmd part after parsing
- * @sub : pointer to subcmd part after parsing
- * @aux : pointer to optional aux part after parsing
- *
- * Example:
- * NAPI SCALE <n>  +-- IN  str
- *  |    |     +------ OUT aux
- *  |    +------------ OUT subcmd
- *  +----------------- OUT cmd
- *
- * Return: ==0: success; !=0: failure
- */
-static int hdd_parse_napi(char **str, char **cmd, char **sub, char **aux)
-{
-	int rc;
-	char *token, *lcmd = NULL, *lsub = NULL, *laux = NULL;
-
-	NAPI_DEBUG("-->\n");
-
-	token = strsep(str, " \t");
-	if (NULL == token) {
-		hdd_err("cannot parse cmd");
-		goto parse_end;
-	}
-	lcmd = token;
-
-	token = strsep(str, " \t");
-	if (NULL == token) {
-		hdd_err("cannot parse subcmd");
-		goto parse_end;
-	}
-	lsub = token;
-
-	token = strsep(str, " \t");
-	if (NULL == token)
-		hdd_warn("cannot parse aux\n");
-	else
-		laux = token;
-
-parse_end:
-	if ((NULL == lcmd) || (NULL == lsub))
-		rc = -EINVAL;
-	else {
-		rc = 0;
-		*cmd = lcmd;
-		*sub = lsub;
-		if (NULL != aux)
-			*aux = laux;
-	}
-	NAPI_DEBUG("<--[rc=%d]\n", rc);
-	return rc;
-}
-
-
-/**
- * hdd_parse_stats() - print NAPI stats into a buffer
- * @buf : buffer to write stats into
- * @max : "size of buffer"
- * @idp : NULL: all stats, otherwise, ptr to the NAPI instance
- * @napid: binary structure to retrieve the stats from
- *
- * Return: number of bytes written into the buffer
- */
-int hdd_napi_stats(char   *buf,
-		   int     max,
-		   char   *indp,
-		   struct qca_napi_data *napid)
-{
-	int n = 0;
-	int i, j, k; /* NAPI, CPU, bucket indices */
-	int from, to;
-	struct qca_napi_info *napii;
-	struct qca_napi_stat *napis;
-
-	NAPI_DEBUG("-->\n");
-
-	if (NULL == napid)
-		return n;
-	if (NULL == indp) {
-		from = 0;
-		to = CE_COUNT_MAX;
-	} else {
-		if (0 > kstrtoint(indp, 10, &to)) {
-			from = 0;
-			to = CE_COUNT_MAX;
-		} else
-			from = to;
-	}
-
-	for (i = from; i < to; i++)
-		if (napid->ce_map & (0x01 << i)) {
-			napii = &(napid->napis[i]);
-			for (j = 0; j < NR_CPUS; j++) {
-				napis = &(napii->stats[j]);
-				n += scnprintf(buf + n, max - n,
-					       "STATS: NAPI[%d] CPU: %d scheds: %d polls: %d completes: %d done: %d ",
-					       i, j,
-					       napis->napi_schedules,
-					       napis->napi_polls,
-					       napis->napi_completes,
-					       napis->napi_workdone);
-
-				for (k = 0; k < QCA_NAPI_NUM_BUCKETS; k++) {
-					n += scnprintf(
-						buf + n, max - n,
-						" %d",
-						napis->napi_budget_uses[k]);
-				}
-				n += scnprintf(buf+n, max - n, "\n");
-			}
-		}
-
-	NAPI_DEBUG("<--[n=%d]\n", n);
-	return n;
-}
-
-/**
- * napi_set_scale() - sets the scale attribute in all NAPI entries
- * @sc : scale to set
- *
- * Return: void
- */
-static void napi_set_scale(uint8_t sc)
-{
-	uint32_t  i;
-	struct qca_napi_data *napi_data;
-
-	napi_data = hdd_napi_get_all();
-	if (likely(NULL != napi_data))
-	    for (i = 0; i < CE_COUNT_MAX; i++)
-		    if (napi_data->ce_map & (0x01 << i))
-			    napi_data->napis[i].scale = sc;
-
-	return;
-}
-/**
- * drv_cmd_napi() - processes NAPI commands
- * @adapter    : net_device
- * @hdd_ctx    : HDD context
- * @command    : command string from user command (including "NAPI")
- * @command_len: length of command
- * @priv_data  : ifr_data
- *
- * Commands supported:
- * NAPI ENABLE      : enables NAPI administratively. Note that this may not
- *                    enable NAPI functionally, as some other conditions
- *                    may not have been satisfied yet
- * NAPI DISABLE     : reverse operation of "enable"
- * NAPI STATUS      : get global status of NAPI instances
- * NAPI STATS [<n>] : get the stats for a given NAPI instance
- * NAPI SCALE <n>   : set the scale factor
- *
- * Return: 0: success; !0: failure
- */
-static int drv_cmd_napi(hdd_adapter_t *adapter,
-			hdd_context_t *hdd_ctx,
-			uint8_t *command,
-			uint8_t command_len,
-			hdd_priv_data_t *priv_data)
-{
-	int  rc = 0;
-	int  n, l;
-	char *cmd = NULL, *subcmd = NULL, *aux = NULL;
-	char *synopsis = "NAPI ENABLE\n"
-		"NAPI DISABLE\n"
-		"NAPI STATUS\n"
-		"NAPI STATS [<n>] -- if no <n> then all\n"
-		"NAPI SCALE <n>   -- set the scale\n";
-	char *reply = NULL;
-
-	/* make a local copy, as strsep modifies the str in place */
-	char *str = NULL;
-
-	NAPI_DEBUG("-->\n");
-
-	/**
-	 * NOTE TO MAINTAINER: from this point to the end of the function,
-	 * please do not return anywhere in the code except the very end
-	 * to avoid memory leakage (goto end_drv_napi instead)
-	 * or make sure that reply+str is freed
-	 */
-	reply = kmalloc(MAX_USER_COMMAND_SIZE, GFP_KERNEL);
-	if (NULL == reply) {
-		hdd_err("could not allocate reply buffer");
-		rc = -ENOMEM;
-		goto end_drv_napi;
-	}
-
-	str = kmalloc(strlen(command) + 1, GFP_KERNEL);
-	if (NULL == str) {
-		hdd_err("could not allocate copy of input buffer");
-		rc = -ENOMEM;
-		goto end_drv_napi;
-	}
-
-	strlcpy(str, command, strlen(command) + 1);
-	hdd_debug("parsing command into cmd=0x%p sub=0x%p aux=0x%p\n",
-		  cmd, subcmd, aux);
-
-
-	rc = hdd_parse_napi(&str, &cmd, &subcmd, &aux);
-
-	if (0 != rc) {
-		const char *msg = "unknown or badly formatted cmd\n%s";
-		l = CDF_MIN(MAX_USER_COMMAND_SIZE,
-			    strlen(msg)+strlen(synopsis));
-		n = scnprintf(reply, l, msg, synopsis);
-
-		if (copy_to_user(priv_data->buf, reply,
-				 CDF_MIN(priv_data->total_len, l)))
-			hdd_err("failed to copy data to user buffer");
-		hdd_debug("reply: %s", reply);
-
-		rc = -EINVAL;
-	} else {
-		hdd_debug("cmd=(%s) subcmd=(%s) aux=(%s)\n",
-			cmd, subcmd, aux);
-		if (!strcmp(subcmd, "ENABLE"))
-			hdd_napi_event(NAPI_EVT_CMD_STATE, (void *)1);
-		else if (!strcmp(subcmd, "DISABLE"))
-			hdd_napi_event(NAPI_EVT_CMD_STATE, (void *)0);
-		else if (!strcmp(subcmd, "STATUS")) {
-			int n = 0;
-			uint32_t  i;
-			struct qca_napi_data *napi_data;
-
-			napi_data = hdd_napi_get_all();
-			if (unlikely(NULL == napi_data))
-				goto status_end;
-			n += scnprintf(reply+n, MAX_USER_COMMAND_SIZE - n,
-				       "NAPI state: 0x%08x map: 0x%08x\n",
-				       napi_data->state,
-				       napi_data->ce_map);
-
-			for (i = 0; i < CE_COUNT_MAX; i++)
-				if (napi_data->ce_map & (0x01 << i)) {
-					n += scnprintf(
-						reply + n,
-						MAX_USER_COMMAND_SIZE - n,
-						"#%d: id: %d, scale=%d\n",
-						i,
-						napi_data->napis[i].id,
-						napi_data->napis[i].scale);
-				}
-		status_end:
-			hdd_info("wlan: STATUS DATA:\n%s", reply);
-			if (copy_to_user(priv_data->buf, reply,
-					 CDF_MIN(n, priv_data->total_len)))
-				rc = -EINVAL;
-		} else if (!strcmp(subcmd, "STATS")) {
-			int n = 0;
-			struct qca_napi_data *napi_data;
-
-			napi_data = hdd_napi_get_all();
-			if (NULL != napi_data) {
-				n = hdd_napi_stats(reply, MAX_USER_COMMAND_SIZE,
-						   aux, napi_data);
-				NAPI_DEBUG("STATS: returns %d\n", n);
-			}
-			if (n > 0) {
-				if (copy_to_user(priv_data->buf, reply,
-						 CDF_MIN(priv_data->total_len,
-							 n)))
-					rc = -EINVAL;
-				hdd_info("wlan: STATS_DATA\n%s\n", reply);
-			} else
-				rc = -EINVAL;
-		} else if (!strcmp(subcmd, "SCALE")) {
-			if (NULL == aux) {
-				rc = -EINVAL;
-				hdd_err("wlan: SCALE cmd requires <n>");
-			} else {
-				uint8_t sc;
-				rc = kstrtou8(aux, 10, &sc);
-				if (rc) {
-					hdd_err("wlan: bad scale (%s)", aux);
-					rc = -EINVAL;
-				} else
-					napi_set_scale(sc);
-			}
-		} /* SCALE */
-	}
-end_drv_napi:
-	if (NULL != str)
-		kfree(str);
-	if (NULL != reply)
-		kfree(reply);
-
-	NAPI_DEBUG("<--[rc=%d]\n", rc);
-	return rc;
-}
-#endif /* FEATURE_NAPI */
-
-/**
- * hdd_set_rx_filter() - set RX filter
- * @adapter: Pointer to adapter
- * @action: Filter action
- * @pattern: Address pattern
- *
- * Address pattern is most significant byte of address for example
- * 0x01 for IPV4 multicast address
- * 0x33 for IPV6 multicast address
- * 0xFF for broadcast address
- *
- * Return: 0 for success, non-zero for failure
- */
-static int hdd_set_rx_filter(hdd_adapter_t *adapter, bool action,
-			uint8_t pattern)
-{
-	int ret;
-	uint8_t i;
-	tHalHandle handle;
-	tSirRcvFltMcAddrList *filter;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	handle = hdd_ctx->hHal;
-
-	if (NULL == handle) {
-		hdd_err("HAL Handle is NULL");
-		return -EINVAL;
-	}
-
-	/*
-	 * If action is false it means start dropping packets
-	 * Set addr_filter_pattern which will be used when sending
-	 * MC/BC address list to target
-	 */
-	if (!action)
-		adapter->addr_filter_pattern = pattern;
-	else
-		adapter->addr_filter_pattern = 0;
-
-	if (((adapter->device_mode == WLAN_HDD_INFRA_STATION) ||
-		(adapter->device_mode == WLAN_HDD_P2P_CLIENT)) &&
-		adapter->mc_addr_list.mc_cnt &&
-		hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
-
-
-		filter = cdf_mem_malloc(sizeof(*filter));
-		if (NULL == filter) {
-			hdd_err("Could not allocate Memory");
-			return -ENOMEM;
-		}
-		filter->action = action;
-		for (i = 0; i < adapter->mc_addr_list.mc_cnt; i++) {
-			if (!memcmp(adapter->mc_addr_list.addr[i],
-				&pattern, 1)) {
-				memcpy(filter->multicastAddr[i].bytes,
-					adapter->mc_addr_list.addr[i],
-					sizeof(adapter->mc_addr_list.addr[i]));
-				filter->ulMulticastAddrCnt++;
-				hdd_info("%s RX filter : addr ="
-				    MAC_ADDRESS_STR,
-				    action ? "setting" : "clearing",
-				    MAC_ADDR_ARRAY(filter->multicastAddr[i].bytes));
-			}
-		}
-		/* Set rx filter */
-		sme_8023_multicast_list(handle, adapter->sessionId, filter);
-		cdf_mem_free(filter);
-	} else {
-		hdd_info("mode %d mc_cnt %d",
-			adapter->device_mode, adapter->mc_addr_list.mc_cnt);
-	}
-
-	return 0;
-}
-
-/**
- * hdd_driver_rxfilter_comand_handler() - RXFILTER driver command handler
- * @command: Pointer to input string driver command
- * @adapter: Pointer to adapter
- * @action: Action to enable/disable filtering
- *
- * If action == false
- * Start filtering out data packets based on type
- * RXFILTER-REMOVE 0 -> Start filtering out unicast data packets
- * RXFILTER-REMOVE 1 -> Start filtering out broadcast data packets
- * RXFILTER-REMOVE 2 -> Start filtering out IPV4 mcast data packets
- * RXFILTER-REMOVE 3 -> Start filtering out IPV6 mcast data packets
- *
- * if action == true
- * Stop filtering data packets based on type
- * RXFILTER-ADD 0 -> Stop filtering unicast data packets
- * RXFILTER-ADD 1 -> Stop filtering broadcast data packets
- * RXFILTER-ADD 2 -> Stop filtering IPV4 mcast data packets
- * RXFILTER-ADD 3 -> Stop filtering IPV6 mcast data packets
- *
- * Current implementation only supports IPV4 address filtering by
- * selectively allowing IPV4 multicast data packest based on
- * address list received in .ndo_set_rx_mode
- *
- * Return: 0 for success, non-zero for failure
- */
-static int hdd_driver_rxfilter_comand_handler(uint8_t *command,
-						hdd_adapter_t *adapter,
-						bool action)
-{
-	int ret = 0;
-	uint8_t *value;
-	uint8_t type;
-
-	value = command;
-	/* Skip space after RXFILTER-REMOVE OR RXFILTER-ADD based on action */
-	if (!action)
-		value = command + 16;
-	else
-		value = command + 13;
-	ret = kstrtou8(value, 10, &type);
-	if (ret < 0) {
-		hdd_err("kstrtou8 failed invalid input value %d", type);
-		return -EINVAL;
-	}
-
-	switch (type) {
-	case 2:
-		/* Set rx filter for IPV4 multicast data packets */
-		ret = hdd_set_rx_filter(adapter, action, 0x01);
-		break;
-	default:
-		hdd_info("Unsupported RXFILTER type %d", type);
-		break;
-	}
-
-	return ret;
-}
-
-/**
- * drv_cmd_rx_filter_remove() - RXFILTER REMOVE driver command handler
- * @adapter: Pointer to network adapter
- * @hdd_ctx: Pointer to hdd context
- * @command: Pointer to input command
- * @command_len: Command length
- * @priv_data: Pointer to private data in command
- */
-static int drv_cmd_rx_filter_remove(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	return hdd_driver_rxfilter_comand_handler(command, adapter, false);
-}
-
-/**
- * drv_cmd_rx_filter_add() - RXFILTER ADD driver command handler
- * @adapter: Pointer to network adapter
- * @hdd_ctx: Pointer to hdd context
- * @command: Pointer to input command
- * @command_len: Command length
- * @priv_data: Pointer to private data in command
- */
-static int drv_cmd_rx_filter_add(hdd_adapter_t *adapter,
-				hdd_context_t *hdd_ctx,
-				uint8_t *command,
-				uint8_t command_len,
-				hdd_priv_data_t *priv_data)
-{
-	return hdd_driver_rxfilter_comand_handler(command, adapter, true);
-}
-
-/*
- * dummy (no-op) hdd driver command handler
- */
-static int drv_cmd_dummy(hdd_adapter_t *adapter,
-			 hdd_context_t *hdd_ctx,
-			 uint8_t *command,
-			 uint8_t command_len,
-			 hdd_priv_data_t *priv_data)
-{
-	hdd_info("%s: Ignoring driver command \"%s\"",
-		 adapter->dev->name, command);
-	return 0;
-}
-
-/*
- * handler for any unsupported wlan hdd driver command
- */
-static int drv_cmd_invalid(hdd_adapter_t *adapter,
-			   hdd_context_t *hdd_ctx,
-			   uint8_t *command,
-			   uint8_t command_len,
-			   hdd_priv_data_t *priv_data)
-{
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_UNSUPPORTED_IOCTL,
-			 adapter->sessionId, 0));
-
-	hdd_warn("%s: Unsupported driver command \"%s\"",
-		 adapter->dev->name, command);
-
-	return -ENOTSUPP;
-}
-
-/**
- * drv_cmd_set_fcc_channel() - handle fcc constraint request
- * @adapter: HDD adapter
- * @hdd_ctx: HDD context
- * @command: command ptr, SET_FCC_CHANNEL 0/1 is the command
- * @command_len: command len
- * @priv_data: private data
- *
- * Return: status
- */
-static int drv_cmd_set_fcc_channel(hdd_adapter_t *adapter,
-				   hdd_context_t *hdd_ctx,
-				   uint8_t *command,
-				   uint8_t command_len,
-				   hdd_priv_data_t *priv_data)
-{
-	uint8_t *value;
-	uint8_t fcc_constraint;
-	CDF_STATUS status;
-	int ret = 0;
-
-	/*
-	 * this command would be called by user-space when it detects WLAN
-	 * ON after airplane mode is set. When APM is set, WLAN turns off.
-	 * But it can be turned back on. Otherwise; when APM is turned back
-	 * off, WLAN would turn back on. So at that point the command is
-	 * expected to come down. 0 means disable, 1 means enable. The
-	 * constraint is removed when parameter 1 is set or different
-	 * country code is set
-	 */
-
-	value =  command + command_len + 1;
-
-	ret = kstrtou8(value, 10, &fcc_constraint);
-	if ((ret < 0) || (fcc_constraint > 1)) {
-		/*
-		 *  If the input value is greater than max value of datatype,
-		 *  then also it is a failure
-		 */
-		hdd_err("value out of range");
-		return -EINVAL;
-	}
-
-	status = sme_disable_non_fcc_channel(hdd_ctx->hHal, !fcc_constraint);
-	if (status != CDF_STATUS_SUCCESS) {
-		hdd_err("sme disable fn. returned err");
-		ret = -EPERM;
-	}
-
-	return ret;
-}
-
-/**
- * hdd_parse_set_channel_switch_command() - Parse and validate CHANNEL_SWITCH
- * command
- * @value: Pointer to the command
- * @chan_number: Pointer to the channel number
- * @chan_bw: Pointer to the channel bandwidth
- *
- * Parses and provides the channel number and channel width from the input
- * command which is expected to be of the format: CHANNEL_SWITCH <CH> <BW>
- * <CH> is channel number to move (where 1 = channel 1, 149 = channel 149, ...)
- * <BW> is bandwidth to move (where 20 = BW 20, 40 = BW 40, 80 = BW 80)
- *
- * Return: 0 for success, non-zero for failure
- */
-static int hdd_parse_set_channel_switch_command(uint8_t *value,
-					 uint32_t *chan_number,
-					 uint32_t *chan_bw)
-{
-	const uint8_t *in_ptr = value;
-	int ret;
-
-	in_ptr = strnchr(value, strlen(value), SPACE_ASCII_VALUE);
-
-	/* no argument after the command */
-	if (NULL == in_ptr) {
-		hdd_err("No argument after the command");
-		return -EINVAL;
-	}
-
-	/* no space after the command */
-	if (SPACE_ASCII_VALUE != *in_ptr) {
-		hdd_err("No space after the command ");
-		return -EINVAL;
-	}
-
-	/* remove empty spaces and move the next argument */
-	while ((SPACE_ASCII_VALUE == *in_ptr) && ('\0' != *in_ptr))
-		in_ptr++;
-
-	/* no argument followed by spaces */
-	if ('\0' == *in_ptr) {
-		hdd_err("No argument followed by spaces");
-		return -EINVAL;
-	}
-
-	/* get the two arguments: channel number and bandwidth */
-	ret = sscanf(in_ptr, "%u %u", chan_number, chan_bw);
-	if (ret != 2) {
-		hdd_err("Arguments retrieval from cmd string failed");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * drv_cmd_set_channel_switch() - Switch SAP/P2P-GO operating channel
- * @adapter: HDD adapter
- * @hdd_ctx: HDD context
- * @command: Pointer to the input command CHANNEL_SWITCH
- * @command_len: Command len
- * @priv_data: Private data
- *
- * Handles private IOCTL CHANNEL_SWITCH command to switch the operating channel
- * of SAP/P2P-GO
- *
- * Return: 0 for success, non-zero for failure
- */
-static int drv_cmd_set_channel_switch(hdd_adapter_t *adapter,
-				   hdd_context_t *hdd_ctx,
-				   uint8_t *command,
-				   uint8_t command_len,
-				   hdd_priv_data_t *priv_data)
-{
-	struct net_device *dev = adapter->dev;
-	int status;
-	uint32_t chan_number = 0, chan_bw = 0;
-	uint8_t *value = command;
-	phy_ch_width width;
-
-	if ((adapter->device_mode != WLAN_HDD_P2P_GO) &&
-		(adapter->device_mode != WLAN_HDD_SOFTAP)) {
-		hdd_err("IOCTL CHANNEL_SWITCH not supported for mode %d",
-			adapter->device_mode);
-		return -EINVAL;
-	}
-
-	status = hdd_parse_set_channel_switch_command(value,
-							&chan_number, &chan_bw);
-	if (status) {
-		hdd_err("Invalid CHANNEL_SWITCH command");
-		return status;
-	}
-
-	if ((chan_bw != 20) && (chan_bw != 40) && (chan_bw != 80)) {
-		hdd_err("BW %d is not allowed for CHANNEL_SWITCH", chan_bw);
-		return -EINVAL;
-	}
-
-	if (chan_bw == 80)
-		width = CH_WIDTH_80MHZ;
-	else if (chan_bw == 40)
-		width = CH_WIDTH_40MHZ;
-	else
-		width = CH_WIDTH_20MHZ;
-
-	hdd_info("CH:%d BW:%d", chan_number, chan_bw);
-
-	status = hdd_softap_set_channel_change(dev, chan_number, width);
-	if (status) {
-		hdd_err("Set channel change fail");
-		return status;
-	}
-
-	return 0;
-}
-
-/*
- * The following table contains all supported WLAN HDD
- * IOCTL driver commands and the handler for each of them.
- */
-static const hdd_drv_cmd_t hdd_drv_cmds[] = {
-	{"P2P_DEV_ADDR",              drv_cmd_p2p_dev_addr},
-	{"P2P_SET_NOA",               drv_cmd_p2p_set_noa},
-	{"P2P_SET_PS",                drv_cmd_p2p_set_ps},
-	{"SETBAND",                   drv_cmd_set_band},
-	{"SETWMMPS",                  drv_cmd_set_wmmps},
-	{"COUNTRY",                   drv_cmd_country},
-	{"SETSUSPENDMODE",            drv_cmd_dummy},
-	{"SET_AP_WPS_P2P_IE",         drv_cmd_dummy},
-	{"BTCOEXSCAN",                drv_cmd_dummy},
-	{"RXFILTER",                  drv_cmd_dummy},
-	{"SETROAMTRIGGER",            drv_cmd_set_roam_trigger},
-	{"GETROAMTRIGGER",            drv_cmd_get_roam_trigger},
-	{"SETROAMSCANPERIOD",         drv_cmd_set_roam_scan_period},
-	{"GETROAMSCANPERIOD",         drv_cmd_get_roam_scan_period},
-	{"SETROAMSCANREFRESHPERIOD",  drv_cmd_set_roam_scan_refresh_period},
-	{"GETROAMSCANREFRESHPERIOD",  drv_cmd_get_roam_scan_refresh_period},
-	{"SETROAMMODE",               drv_cmd_set_roam_mode},
-	{"GETROAMMODE",               drv_cmd_get_roam_mode},
-	{"SETROAMDELTA",              drv_cmd_set_roam_delta},
-	{"GETROAMDELTA",              drv_cmd_get_roam_delta},
-	{"GETBAND",                   drv_cmd_get_band},
-	{"SETROAMSCANCHANNELS",       drv_cmd_set_roam_scan_channels},
-	{"GETROAMSCANCHANNELS",       drv_cmd_get_roam_scan_channels},
-	{"GETCCXMODE",                drv_cmd_get_ccx_mode},
-	{"GETOKCMODE",                drv_cmd_get_okc_mode},
-	{"GETFASTROAM",               drv_cmd_get_fast_roam},
-	{"GETFASTTRANSITION",         drv_cmd_get_fast_transition},
-	{"SETROAMSCANCHANNELMINTIME", drv_cmd_set_roam_scan_channel_min_time},
-	{"SENDACTIONFRAME",           drv_cmd_send_action_frame},
-	{"GETROAMSCANCHANNELMINTIME", drv_cmd_get_roam_scan_channel_min_time},
-	{"SETSCANCHANNELTIME",        drv_cmd_set_scan_channel_time},
-	{"GETSCANCHANNELTIME",        drv_cmd_get_scan_channel_time},
-	{"SETSCANHOMETIME",           drv_cmd_set_scan_home_time},
-	{"GETSCANHOMETIME",           drv_cmd_get_scan_home_time},
-	{"SETROAMINTRABAND",          drv_cmd_set_roam_intra_band},
-	{"GETROAMINTRABAND",          drv_cmd_get_roam_intra_band},
-	{"SETSCANNPROBES",            drv_cmd_set_scan_n_probes},
-	{"GETSCANNPROBES",            drv_cmd_get_scan_n_probes},
-	{"SETSCANHOMEAWAYTIME",       drv_cmd_set_scan_home_away_time},
-	{"GETSCANHOMEAWAYTIME",       drv_cmd_get_scan_home_away_time},
-	{"REASSOC",                   drv_cmd_reassoc},
-	{"SETWESMODE",                drv_cmd_set_wes_mode},
-	{"GETWESMODE",                drv_cmd_get_wes_mode},
-	{"SETOPPORTUNISTICRSSIDIFF",  drv_cmd_set_opportunistic_rssi_diff},
-	{"GETOPPORTUNISTICRSSIDIFF",  drv_cmd_get_opportunistic_rssi_diff},
-	{"SETROAMRESCANRSSIDIFF",     drv_cmd_set_roam_rescan_rssi_diff},
-	{"GETROAMRESCANRSSIDIFF",     drv_cmd_get_roam_rescan_rssi_diff},
-	{"SETFASTROAM",               drv_cmd_set_fast_roam},
-#ifdef WLAN_FEATURE_VOWIFI_11R
-	{"SETFASTTRANSITION",         drv_cmd_set_fast_transition},
-	{"FASTREASSOC",               drv_cmd_fast_reassoc},
-#endif
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-	{"CCXPLMREQ",                 drv_cmd_ccx_plm_req},
-#endif
-#ifdef FEATURE_WLAN_ESE
-	{"SETCCXMODE",                drv_cmd_set_ccx_mode},
-#endif
-	{"SETROAMSCANCONTROL",        drv_cmd_set_roam_scan_control},
-#ifdef FEATURE_WLAN_OKC
-	{"SETOKCMODE",                drv_cmd_set_okc_mode},
-#endif /* FEATURE_WLAN_OKC */
-	{"GETROAMSCANCONTROL",        drv_cmd_get_roam_scan_control},
-	{"BTCOEXMODE",                drv_cmd_bt_coex_mode},
-	{"SCAN-ACTIVE",               drv_cmd_scan_active},
-	{"SCAN-PASSIVE",              drv_cmd_scan_passive},
-	{"GETDWELLTIME",              drv_cmd_get_dwell_time},
-	{"SETDWELLTIME",              drv_cmd_set_dwell_time},
-	{"MIRACAST",                  drv_cmd_miracast},
-#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
-	{"SETCCXROAMSCANCHANNELS",    drv_cmd_set_ccx_roam_scan_channels},
-	{"GETTSMSTATS",               drv_cmd_get_tsm_stats},
-	{"SETCCKMIE",                 drv_cmd_set_cckm_ie},
-	{"CCXBEACONREQ",  drv_cmd_ccx_beacon_req},
-#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
-	{"SETMCRATE",                 drv_cmd_set_mc_rate},
-	{"MAXTXPOWER",                drv_cmd_max_tx_power},
-	{"SETDFSSCANMODE",            drv_cmd_set_dfs_scan_mode},
-	{"GETDFSSCANMODE",            drv_cmd_get_dfs_scan_mode},
-	{"GETLINKSTATUS",             drv_cmd_get_link_status},
-#ifdef WLAN_FEATURE_EXTWOW_SUPPORT
-	{"ENABLEEXTWOW",              drv_cmd_enable_ext_wow},
-	{"SETAPP1PARAMS",             drv_cmd_set_app1_params},
-	{"SETAPP2PARAMS",             drv_cmd_set_app2_params},
-#endif
-#ifdef FEATURE_WLAN_TDLS
-	{"TDLSSECONDARYCHANNELOFFSET", drv_cmd_tdls_secondary_channel_offset},
-	{"TDLSOFFCHANNELMODE",        drv_cmd_tdls_off_channel_mode},
-	{"TDLSOFFCHANNEL",            drv_cmd_tdls_off_channel},
-	{"TDLSSCAN",                  drv_cmd_tdls_scan},
-#endif
-	{"RSSI",                      drv_cmd_get_rssi},
-	{"LINKSPEED",                 drv_cmd_get_linkspeed},
-#ifdef FEATURE_NAPI
-	{"NAPI",                      drv_cmd_napi},
-#endif /* FEATURE_NAPI */
-	{"RXFILTER-REMOVE",           drv_cmd_rx_filter_remove},
-	{"RXFILTER-ADD",              drv_cmd_rx_filter_add},
-	{"SET_FCC_CHANNEL",           drv_cmd_set_fcc_channel},
-	{"CHANNEL_SWITCH",            drv_cmd_set_channel_switch},
-};
-
-/**
- * hdd_drv_cmd_process() - chooses and runs the proper
- *                                handler based on the input command
- * @adapter:	Pointer to the hdd adapter
- * @cmd:	Pointer to the driver command
- * @priv_data:	Pointer to the data associated with the command
- *
- * This function parses the input hdd driver command and runs
- * the proper handler
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_drv_cmd_process(hdd_adapter_t *adapter,
-			       uint8_t *cmd,
-			       hdd_priv_data_t *priv_data)
-{
-	hdd_context_t *hdd_ctx;
-	int i;
-	const int cmd_num_total = ARRAY_SIZE(hdd_drv_cmds);
-	uint8_t *cmd_i = NULL;
-	hdd_drv_cmd_handler_t handler = NULL;
-	int len = 0;
-
-	if (!adapter || !cmd || !priv_data) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: at least 1 param is NULL", __func__);
-		return -EINVAL;
-	}
-
-	hdd_ctx = (hdd_context_t *)adapter->pHddCtx;
-
-	for (i = 0; i < cmd_num_total; i++) {
-
-		cmd_i = (uint8_t *)hdd_drv_cmds[i].cmd;
-		handler = hdd_drv_cmds[i].handler;
-		len = strlen(cmd_i);
-
-		if (!handler) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: no. %d handler is NULL", __func__, i);
-			return -EINVAL;
-		}
-
-		if (strncasecmp(cmd, cmd_i, len) == 0)
-			return handler(adapter, hdd_ctx,
-				       cmd, len, priv_data);
-	}
-
-	return drv_cmd_invalid(adapter, hdd_ctx, cmd, len, priv_data);
-}
-
-/**
- * hdd_driver_command() - top level wlan hdd driver command handler
- * @adapter:	Pointer to the hdd adapter
- * @priv_data:	Pointer to the raw command data
- *
- * This function is the top level wlan hdd driver command handler. It
- * handles the command with the help of hdd_drv_cmd_process()
- *
- * Return: 0 for success non-zero for failure
- */
-static int hdd_driver_command(hdd_adapter_t *adapter,
-			      hdd_priv_data_t *priv_data)
-{
-	uint8_t *command = NULL;
-	int ret = 0;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	/*
-	 * Note that valid pointers are provided by caller
-	 */
-
-	/* copy to local struct to avoid numerous changes to legacy code */
-	if (priv_data->total_len <= 0 ||
-	    priv_data->total_len > WLAN_PRIV_DATA_MAX_LEN) {
-		hddLog(CDF_TRACE_LEVEL_WARN,
-		       "%s:invalid priv_data.total_len(%d)!!!", __func__,
-		       priv_data->total_len);
-		ret = -EINVAL;
-		goto exit;
-	}
-
-	/* Allocate +1 for '\0' */
-	command = kmalloc(priv_data->total_len + 1, GFP_KERNEL);
-	if (!command) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: failed to allocate memory", __func__);
-		ret = -ENOMEM;
-		goto exit;
-	}
-
-	if (copy_from_user(command, priv_data->buf, priv_data->total_len)) {
-		ret = -EFAULT;
-		goto exit;
-	}
-
-	/* Make sure the command is NUL-terminated */
-	command[priv_data->total_len] = '\0';
-
-	hdd_info("%s: %s", adapter->dev->name, command);
-	ret = hdd_drv_cmd_process(adapter, command, priv_data);
-
-exit:
-	if (command)
-		kfree(command);
-	EXIT();
-	return ret;
-}
-
-#ifdef CONFIG_COMPAT
-static int hdd_driver_compat_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr)
-{
-	struct {
-		compat_uptr_t buf;
-		int used_len;
-		int total_len;
-	} compat_priv_data;
-	hdd_priv_data_t priv_data;
-	int ret = 0;
-
-	/*
-	 * Note that adapter and ifr have already been verified by caller,
-	 * and HDD context has also been validated
-	 */
-	if (copy_from_user(&compat_priv_data, ifr->ifr_data,
-			   sizeof(compat_priv_data))) {
-		ret = -EFAULT;
-		goto exit;
-	}
-	priv_data.buf = compat_ptr(compat_priv_data.buf);
-	priv_data.used_len = compat_priv_data.used_len;
-	priv_data.total_len = compat_priv_data.total_len;
-	ret = hdd_driver_command(adapter, &priv_data);
-exit:
-	return ret;
-}
-#else /* CONFIG_COMPAT */
-static int hdd_driver_compat_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr)
-{
-	/* will never be invoked */
-	return 0;
-}
-#endif /* CONFIG_COMPAT */
-
-static int hdd_driver_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr)
-{
-	hdd_priv_data_t priv_data;
-	int ret = 0;
-
-	/*
-	 * Note that adapter and ifr have already been verified by caller,
-	 * and HDD context has also been validated
-	 */
-	if (copy_from_user(&priv_data, ifr->ifr_data, sizeof(priv_data)))
-		ret = -EFAULT;
-	else
-		ret = hdd_driver_command(adapter, &priv_data);
-
-	return ret;
-}
-
-/**
- * __hdd_ioctl() - ioctl handler for wlan network interfaces
- * @dev: device upon which the ioctl was received
- * @ifr: ioctl request information
- * @cmd: ioctl command
- *
- * This function does initial processing of wlan device ioctls.
- * Currently two flavors of ioctls are supported.  The primary ioctl
- * that is supported is the (SIOCDEVPRIVATE + 1) ioctl which is used
- * for Android "DRIVER" commands.  The other ioctl that is
- * conditionally supported is the SIOCIOCTLTX99 ioctl which is used
- * for FTM on some platforms.  This function simply verifies that the
- * driver is in a sane state, and that the ioctl is one of the
- * supported flavors, in which case flavor-specific handlers are
- * dispatched.
- *
- * Return: 0 on success, non-zero on error
- */
-static int __hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	if (dev != adapter->dev) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s: HDD adapter/dev inconsistency", __func__);
-		ret = -ENODEV;
-		goto exit;
-	}
-
-	if ((!ifr) || (!ifr->ifr_data)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: invalid data", __func__);
-		ret = -EINVAL;
-		goto exit;
-	}
-#if  defined(QCA_WIFI_FTM) && defined(LINUX_QCMBR)
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		if (SIOCIOCTLTX99 == cmd) {
-			ret = wlan_hdd_qcmbr_unified_ioctl(adapter, ifr);
-			goto exit;
-		}
-	}
-#endif
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret)
-		goto exit;
-
-	switch (cmd) {
-	case (SIOCDEVPRIVATE + 1):
-		if (is_compat_task())
-			ret = hdd_driver_compat_ioctl(adapter, ifr);
-		else
-			ret = hdd_driver_ioctl(adapter, ifr);
-		break;
-	default:
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: unknown ioctl %d",
-		       __func__, cmd);
-		ret = -EINVAL;
-		break;
-	}
-exit:
-	EXIT();
-	return ret;
-}
-
-/**
- * hdd_ioctl() - ioctl handler (wrapper) for wlan network interfaces
- * @dev: device upon which the ioctl was received
- * @ifr: ioctl request information
- * @cmd: ioctl command
- *
- * This function acts as an SSR-protecting wrapper to __hdd_ioctl()
- * which is where the ioctls are really handled.
- *
- * Return: 0 on success, non-zero on error
- */
-int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_ioctl(dev, ifr, cmd);
-	cds_ssr_unprotect(__func__);
-	return ret;
-}

+ 0 - 39
core/hdd/src/wlan_hdd_ioctl.h

@@ -1,39 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#if !defined(WLAN_HDD_IOCTL_H)
-#define WLAN_HDD_IOCTL_H
-
-#include <netdevice.h>
-#include <uapi/linux/if.h>
-#include "wlan_hdd_main.h"
-
-int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
-int wlan_hdd_set_mc_rate(hdd_adapter_t *pAdapter, int targetRate);
-
-#endif /* end #if !defined(WLAN_HDD_IOCTL_H) */
-

+ 0 - 4199
core/hdd/src/wlan_hdd_ipa.c

@@ -1,4199 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_ipa.c
- *
- * WLAN HDD and ipa interface implementation
- * Originally written by Qualcomm Atheros, Inc
- */
-
-#ifdef IPA_OFFLOAD
-
-/* Include Files */
-#include <wlan_hdd_includes.h>
-#include <wlan_hdd_ipa.h>
-
-#include <linux/etherdevice.h>
-#include <linux/atomic.h>
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <linux/list.h>
-#include <linux/debugfs.h>
-#include <linux/inetdevice.h>
-#include <linux/ip.h>
-#include <wlan_hdd_softap_tx_rx.h>
-#include <ol_txrx_osif_api.h>
-
-#include "cds_sched.h"
-
-#include "wma.h"
-#include "wma_api.h"
-
-#define HDD_IPA_DESC_BUFFER_RATIO          4
-#define HDD_IPA_IPV4_NAME_EXT              "_ipv4"
-#define HDD_IPA_IPV6_NAME_EXT              "_ipv6"
-
-#define HDD_IPA_RX_INACTIVITY_MSEC_DELAY   1000
-#define HDD_IPA_UC_WLAN_HDR_DES_MAC_OFFSET 12
-#define HDD_IPA_UC_WLAN_8023_HDR_SIZE      14
-/* WDI TX and RX PIPE */
-#define HDD_IPA_UC_NUM_WDI_PIPE            2
-#define HDD_IPA_UC_MAX_PENDING_EVENT       33
-
-#define HDD_IPA_UC_DEBUG_DUMMY_MEM_SIZE    32000
-#define HDD_IPA_UC_RT_DEBUG_PERIOD         300
-#define HDD_IPA_UC_RT_DEBUG_BUF_COUNT      30
-#define HDD_IPA_UC_RT_DEBUG_FILL_INTERVAL  10000
-
-#define HDD_IPA_WLAN_HDR_DES_MAC_OFFSET    0
-#define HDD_IPA_MAX_IFACE                  3
-#define HDD_IPA_MAX_SYSBAM_PIPE            4
-#define HDD_IPA_RX_PIPE                    HDD_IPA_MAX_IFACE
-#define HDD_IPA_ENABLE_MASK                BIT(0)
-#define HDD_IPA_PRE_FILTER_ENABLE_MASK     BIT(1)
-#define HDD_IPA_IPV6_ENABLE_MASK           BIT(2)
-#define HDD_IPA_RM_ENABLE_MASK             BIT(3)
-#define HDD_IPA_CLK_SCALING_ENABLE_MASK    BIT(4)
-#define HDD_IPA_UC_ENABLE_MASK             BIT(5)
-#define HDD_IPA_UC_STA_ENABLE_MASK         BIT(6)
-#define HDD_IPA_REAL_TIME_DEBUGGING        BIT(8)
-
-#define HDD_IPA_MAX_PENDING_EVENT_COUNT    20
-
-typedef enum {
-	HDD_IPA_UC_OPCODE_TX_SUSPEND = 0,
-	HDD_IPA_UC_OPCODE_TX_RESUME = 1,
-	HDD_IPA_UC_OPCODE_RX_SUSPEND = 2,
-	HDD_IPA_UC_OPCODE_RX_RESUME = 3,
-	HDD_IPA_UC_OPCODE_STATS = 4,
-	/* keep this last */
-	HDD_IPA_UC_OPCODE_MAX
-} hdd_ipa_uc_op_code;
-
-/**
- * enum - Reason codes for stat query
- *
- * @HDD_IPA_UC_STAT_REASON_NONE: Initial value
- * @HDD_IPA_UC_STAT_REASON_DEBUG: For debug/info
- * @HDD_IPA_UC_STAT_REASON_BW_CAL: For bandwidth calibration
- */
-enum {
-	HDD_IPA_UC_STAT_REASON_NONE,
-	HDD_IPA_UC_STAT_REASON_DEBUG,
-	HDD_IPA_UC_STAT_REASON_BW_CAL
-};
-
-/**
- * enum hdd_ipa_rm_state - IPA resource manager state
- * @HDD_IPA_RM_RELEASED:      PROD pipe resource released
- * @HDD_IPA_RM_GRANT_PENDING: PROD pipe resource requested but not granted yet
- * @HDD_IPA_RM_GRANTED:       PROD pipe resource granted
- */
-enum hdd_ipa_rm_state {
-	HDD_IPA_RM_RELEASED,
-	HDD_IPA_RM_GRANT_PENDING,
-	HDD_IPA_RM_GRANTED,
-};
-
-struct llc_snap_hdr {
-	uint8_t dsap;
-	uint8_t ssap;
-	uint8_t resv[4];
-	__be16 eth_type;
-} __packed;
-
-/**
- * struct hdd_ipa_tx_hdr - header type which IPA should handle to TX packet
- * @eth:      ether II header
- * @llc_snap: LLC snap header
- *
- */
-struct hdd_ipa_tx_hdr {
-	struct ethhdr eth;
-	struct llc_snap_hdr llc_snap;
-} __packed;
-
-/**
- * struct frag_header - fragment header type registered to IPA hardware
- * @length:    fragment length
- * @reserved1: Reserved not used
- * @reserved2: Reserved not used
- *
- */
-struct frag_header {
-	uint16_t length;
-	uint32_t reserved1;
-	uint32_t reserved2;
-} __packed;
-
-/**
- * struct ipa_header - ipa header type registered to IPA hardware
- * @vdev_id:  vdev id
- * @reserved: Reserved not used
- *
- */
-struct ipa_header {
-	uint32_t
-		vdev_id:8,	/* vdev_id field is LSB of IPA DESC */
-		reserved:24;
-} __packed;
-
-/**
- * struct hdd_ipa_uc_tx_hdr - full tx header registered to IPA hardware
- * @frag_hd: fragment header
- * @ipa_hd:  ipa header
- * @eth:     ether II header
- *
- */
-struct hdd_ipa_uc_tx_hdr {
-	struct frag_header frag_hd;
-	struct ipa_header ipa_hd;
-	struct ethhdr eth;
-} __packed;
-
-#define HDD_IPA_WLAN_FRAG_HEADER       sizeof(struct frag_header)
-#define HDD_IPA_WLAN_IPA_HEADER        sizeof(struct frag_header)
-
-/**
- * struct hdd_ipa_cld_hdr - IPA CLD Header
- * @reserved: reserved fields
- * @iface_id: interface ID
- * @sta_id: Station ID
- *
- * Packed 32-bit structure
- * +----------+----------+--------------+--------+
- * | Reserved | QCMAP ID | interface id | STA ID |
- * +----------+----------+--------------+--------+
- */
-struct hdd_ipa_cld_hdr {
-	uint8_t reserved[2];
-	uint8_t iface_id;
-	uint8_t sta_id;
-} __packed;
-
-struct hdd_ipa_rx_hdr {
-	struct hdd_ipa_cld_hdr cld_hdr;
-	struct ethhdr eth;
-} __packed;
-
-struct hdd_ipa_pm_tx_cb {
-	struct hdd_ipa_iface_context *iface_context;
-	struct ipa_rx_data *ipa_tx_desc;
-};
-
-struct hdd_ipa_uc_rx_hdr {
-	struct ethhdr eth;
-} __packed;
-
-struct hdd_ipa_sys_pipe {
-	uint32_t conn_hdl;
-	uint8_t conn_hdl_valid;
-	struct ipa_sys_connect_params ipa_sys_params;
-};
-
-struct hdd_ipa_iface_stats {
-	uint64_t num_tx;
-	uint64_t num_tx_drop;
-	uint64_t num_tx_err;
-	uint64_t num_tx_cac_drop;
-	uint64_t num_rx_prefilter;
-	uint64_t num_rx_ipa_excep;
-	uint64_t num_rx_recv;
-	uint64_t num_rx_recv_mul;
-	uint64_t num_rx_send_desc_err;
-	uint64_t max_rx_mul;
-};
-
-struct hdd_ipa_priv;
-
-struct hdd_ipa_iface_context {
-	struct hdd_ipa_priv *hdd_ipa;
-	hdd_adapter_t *adapter;
-	void *tl_context;
-
-	enum ipa_client_type cons_client;
-	enum ipa_client_type prod_client;
-
-	uint8_t iface_id;       /* This iface ID */
-	uint8_t sta_id;         /* This iface station ID */
-	cdf_spinlock_t interface_lock;
-	uint32_t ifa_address;
-	struct hdd_ipa_iface_stats stats;
-};
-
-struct hdd_ipa_stats {
-	uint32_t event[IPA_WLAN_EVENT_MAX];
-	uint64_t num_send_msg;
-	uint64_t num_free_msg;
-
-	uint64_t num_rm_grant;
-	uint64_t num_rm_release;
-	uint64_t num_rm_grant_imm;
-	uint64_t num_cons_perf_req;
-	uint64_t num_prod_perf_req;
-
-	uint64_t num_rx_drop;
-	uint64_t num_rx_ipa_tx_dp;
-	uint64_t num_rx_ipa_splice;
-	uint64_t num_rx_ipa_loop;
-	uint64_t num_rx_ipa_tx_dp_err;
-	uint64_t num_rx_ipa_write_done;
-	uint64_t num_max_ipa_tx_mul;
-	uint64_t num_rx_ipa_hw_maxed_out;
-	uint64_t max_pend_q_cnt;
-
-	uint64_t num_tx_comp_cnt;
-	uint64_t num_tx_queued;
-	uint64_t num_tx_dequeued;
-	uint64_t num_max_pm_queue;
-
-	uint64_t num_freeq_empty;
-	uint64_t num_pri_freeq_empty;
-	uint64_t num_rx_excep;
-	uint64_t num_tx_bcmc;
-	uint64_t num_tx_bcmc_err;
-};
-
-struct ipa_uc_stas_map {
-	bool is_reserved;
-	uint8_t sta_id;
-};
-struct op_msg_type {
-	uint8_t msg_t;
-	uint8_t rsvd;
-	uint16_t op_code;
-	uint16_t len;
-	uint16_t rsvd_snd;
-};
-
-struct ipa_uc_fw_stats {
-	uint32_t tx_comp_ring_base;
-	uint32_t tx_comp_ring_size;
-	uint32_t tx_comp_ring_dbell_addr;
-	uint32_t tx_comp_ring_dbell_ind_val;
-	uint32_t tx_comp_ring_dbell_cached_val;
-	uint32_t tx_pkts_enqueued;
-	uint32_t tx_pkts_completed;
-	uint32_t tx_is_suspend;
-	uint32_t tx_reserved;
-	uint32_t rx_ind_ring_base;
-	uint32_t rx_ind_ring_size;
-	uint32_t rx_ind_ring_dbell_addr;
-	uint32_t rx_ind_ring_dbell_ind_val;
-	uint32_t rx_ind_ring_dbell_ind_cached_val;
-	uint32_t rx_ind_ring_rdidx_addr;
-	uint32_t rx_ind_ring_rd_idx_cached_val;
-	uint32_t rx_refill_idx;
-	uint32_t rx_num_pkts_indicated;
-	uint32_t rx_buf_refilled;
-	uint32_t rx_num_ind_drop_no_space;
-	uint32_t rx_num_ind_drop_no_buf;
-	uint32_t rx_is_suspend;
-	uint32_t rx_reserved;
-};
-
-struct ipa_uc_pending_event {
-	cdf_list_node_t node;
-	hdd_adapter_t *adapter;
-	enum ipa_wlan_event type;
-	uint8_t sta_id;
-	uint8_t mac_addr[CDF_MAC_ADDR_SIZE];
-};
-
-/**
- * struct uc_rm_work_struct
- * @work: uC RM work
- * @event: IPA RM event
- */
-struct uc_rm_work_struct {
-	struct work_struct work;
-	enum ipa_rm_event event;
-};
-
-/**
- * struct uc_op_work_struct
- * @work: uC OP work
- * @msg: OP message
- */
-struct uc_op_work_struct {
-	struct work_struct work;
-	struct op_msg_type *msg;
-};
-static uint8_t vdev_to_iface[CSR_ROAM_SESSION_MAX];
-
-/**
- * struct uc_rt_debug_info
- * @time: system time
- * @ipa_excep_count: IPA exception packet count
- * @rx_drop_count: IPA Rx drop packet count
- * @net_sent_count: IPA Rx packet sent to network stack count
- * @rx_discard_count: IPA Rx discard packet count
- * @rx_mcbc_count: IPA Rx BCMC packet count
- * @tx_mcbc_count: IPA Tx BCMC packet countt
- * @tx_fwd_count: IPA Tx forward packet count
- * @rx_destructor_call: IPA Rx packet destructor count
- */
-struct uc_rt_debug_info {
-	v_TIME_t time;
-	uint64_t ipa_excep_count;
-	uint64_t rx_drop_count;
-	uint64_t net_sent_count;
-	uint64_t rx_discard_count;
-	uint64_t rx_mcbc_count;
-	uint64_t tx_mcbc_count;
-	uint64_t tx_fwd_count;
-	uint64_t rx_destructor_call;
-};
-
-struct hdd_ipa_priv {
-	struct hdd_ipa_sys_pipe sys_pipe[HDD_IPA_MAX_SYSBAM_PIPE];
-	struct hdd_ipa_iface_context iface_context[HDD_IPA_MAX_IFACE];
-	uint8_t num_iface;
-	enum hdd_ipa_rm_state rm_state;
-	/*
-	 * IPA driver can send RM notifications with IRQ disabled so using cdf
-	 * APIs as it is taken care gracefully. Without this, kernel would throw
-	 * an warning if spin_lock_bh is used while IRQ is disabled
-	 */
-	cdf_spinlock_t rm_lock;
-	struct uc_rm_work_struct uc_rm_work;
-	struct uc_op_work_struct uc_op_work[HDD_IPA_UC_OPCODE_MAX];
-	cdf_wake_lock_t wake_lock;
-	struct delayed_work wake_lock_work;
-	bool wake_lock_released;
-
-	enum ipa_client_type prod_client;
-
-	atomic_t tx_ref_cnt;
-	cdf_nbuf_queue_t pm_queue_head;
-	struct work_struct pm_work;
-	cdf_spinlock_t pm_lock;
-	bool suspended;
-
-	uint32_t pending_hw_desc_cnt;
-	uint32_t hw_desc_cnt;
-	spinlock_t q_lock;
-	uint32_t freeq_cnt;
-	struct list_head free_desc_head;
-
-	uint32_t pend_q_cnt;
-	struct list_head pend_desc_head;
-
-	hdd_context_t *hdd_ctx;
-
-	struct dentry *debugfs_dir;
-	struct hdd_ipa_stats stats;
-
-	struct notifier_block ipv4_notifier;
-	uint32_t curr_prod_bw;
-	uint32_t curr_cons_bw;
-
-	uint8_t activated_fw_pipe;
-	uint8_t sap_num_connected_sta;
-	uint8_t sta_connected;
-	uint32_t tx_pipe_handle;
-	uint32_t rx_pipe_handle;
-	bool resource_loading;
-	bool resource_unloading;
-	bool pending_cons_req;
-	struct ipa_uc_stas_map assoc_stas_map[WLAN_MAX_STA_COUNT];
-	cdf_list_t pending_event;
-	cdf_mutex_t event_lock;
-	bool ipa_pipes_down;
-	uint32_t ipa_tx_packets_diff;
-	uint32_t ipa_rx_packets_diff;
-	uint32_t ipa_p_tx_packets;
-	uint32_t ipa_p_rx_packets;
-	uint32_t stat_req_reason;
-	uint64_t ipa_tx_forward;
-	uint64_t ipa_rx_discard;
-	uint64_t ipa_rx_net_send_count;
-	uint64_t ipa_rx_internel_drop_count;
-	uint64_t ipa_rx_destructor_count;
-	cdf_mc_timer_t rt_debug_timer;
-	struct uc_rt_debug_info rt_bug_buffer[HDD_IPA_UC_RT_DEBUG_BUF_COUNT];
-	unsigned int rt_buf_fill_index;
-	cdf_mc_timer_t rt_debug_fill_timer;
-	cdf_mutex_t rt_debug_lock;
-	cdf_mutex_t ipa_lock;
-
-	/* CE resources */
-	cdf_dma_addr_t ce_sr_base_paddr;
-	uint32_t ce_sr_ring_size;
-	cdf_dma_addr_t ce_reg_paddr;
-
-	/* WLAN TX:IPA->WLAN */
-	cdf_dma_addr_t tx_comp_ring_base_paddr;
-	uint32_t tx_comp_ring_size;
-	uint32_t tx_num_alloc_buffer;
-
-	/* WLAN RX:WLAN->IPA */
-	cdf_dma_addr_t rx_rdy_ring_base_paddr;
-	uint32_t rx_rdy_ring_size;
-	cdf_dma_addr_t rx_proc_done_idx_paddr;
-	void *rx_proc_done_idx_vaddr;
-
-	/* WLAN RX2:WLAN->IPA */
-	cdf_dma_addr_t rx2_rdy_ring_base_paddr;
-	uint32_t rx2_rdy_ring_size;
-	cdf_dma_addr_t rx2_proc_done_idx_paddr;
-	void *rx2_proc_done_idx_vaddr;
-
-	/* IPA UC doorbell registers paddr */
-	cdf_dma_addr_t tx_comp_doorbell_paddr;
-	cdf_dma_addr_t rx_ready_doorbell_paddr;
-};
-
-#define HDD_IPA_WLAN_CLD_HDR_LEN        sizeof(struct hdd_ipa_cld_hdr)
-#define HDD_IPA_UC_WLAN_CLD_HDR_LEN     0
-#define HDD_IPA_WLAN_TX_HDR_LEN         sizeof(struct hdd_ipa_tx_hdr)
-#define HDD_IPA_UC_WLAN_TX_HDR_LEN      sizeof(struct hdd_ipa_uc_tx_hdr)
-#define HDD_IPA_WLAN_RX_HDR_LEN         sizeof(struct hdd_ipa_rx_hdr)
-#define HDD_IPA_UC_WLAN_RX_HDR_LEN      sizeof(struct hdd_ipa_uc_rx_hdr)
-
-#define HDD_IPA_FW_RX_DESC_DISCARD_M 0x1
-#define HDD_IPA_FW_RX_DESC_FORWARD_M 0x2
-
-#define HDD_IPA_GET_IFACE_ID(_data) \
-	(((struct hdd_ipa_cld_hdr *) (_data))->iface_id)
-
-#define HDD_IPA_LOG(LVL, fmt, args ...) \
-	CDF_TRACE(CDF_MODULE_ID_HDD, LVL, \
-		  "%s:%d: "fmt, __func__, __LINE__, ## args)
-
-#define HDD_IPA_DBG_DUMP(_lvl, _prefix, _buf, _len) \
-	do { \
-		CDF_TRACE(CDF_MODULE_ID_HDD, _lvl, "%s:", _prefix); \
-		CDF_TRACE_HEX_DUMP(CDF_MODULE_ID_HDD, _lvl, _buf, _len); \
-	} while (0)
-
-#define HDD_IPA_IS_CONFIG_ENABLED(_hdd_ctx, _mask) \
-	(((_hdd_ctx)->config->IpaConfig & (_mask)) == (_mask))
-
-#define HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa) \
-			do { \
-				hdd_ipa->ipa_rx_internel_drop_count++; \
-			} while (0)
-#define HDD_IPA_INCREASE_NET_SEND_COUNT(hdd_ipa) \
-			do { \
-				hdd_ipa->ipa_rx_net_send_count++; \
-			} while (0)
-#define HDD_BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1)
-
-/* Temporary macro to make a build without IPA V2 */
-#ifdef IPA_V2
-#define HDD_IPA_WDI2_SET(pipe_in, ipa_ctxt)                                    \
-do {                                                                           \
-	pipe_in.u.ul.rdy_ring_rp_va = ipa_ctxt->rx_proc_done_idx_vaddr;        \
-	pipe_in.u.ul.rdy_comp_ring_base_pa = ipa_ctxt->rx2_rdy_ring_base_paddr;\
-	pipe_in.u.ul.rdy_comp_ring_size = ipa_ctxt->rx2_rdy_ring_size;         \
-	pipe_in.u.ul.rdy_comp_ring_wp_pa = ipa_ctxt->rx2_proc_done_idx_paddr;  \
-	pipe_in.u.ul.rdy_comp_ring_wp_va = ipa_ctxt->rx2_proc_done_idx_vaddr;  \
-} while (0)
-#else
-/* Do nothing */
-#define HDD_IPA_WDI2_SET(pipe_in, ipa_ctxt)
-#endif /* IPA_V2 */
-
-static struct hdd_ipa_adapter_2_client {
-	enum ipa_client_type cons_client;
-	enum ipa_client_type prod_client;
-} hdd_ipa_adapter_2_client[HDD_IPA_MAX_IFACE] = {
-	{
-		IPA_CLIENT_WLAN2_CONS, IPA_CLIENT_WLAN1_PROD
-	}, {
-		IPA_CLIENT_WLAN3_CONS, IPA_CLIENT_WLAN1_PROD
-	}, {
-		IPA_CLIENT_WLAN4_CONS, IPA_CLIENT_WLAN1_PROD
-	},
-};
-
-/* For Tx pipes, use Ethernet-II Header format */
-struct hdd_ipa_uc_tx_hdr ipa_uc_tx_hdr = {
-	{
-		0x0000,
-		0x00000000,
-		0x00000000
-	},
-	{
-		0x00000000
-	},
-	{
-		{0x00, 0x03, 0x7f, 0xaa, 0xbb, 0xcc},
-		{0x00, 0x03, 0x7f, 0xdd, 0xee, 0xff},
-		0x0008
-	}
-};
-
-/* For Tx pipes, use 802.3 Header format */
-static struct hdd_ipa_tx_hdr ipa_tx_hdr = {
-	{
-		{0xDE, 0xAD, 0xBE, 0xEF, 0xFF, 0xFF},
-		{0xDE, 0xAD, 0xBE, 0xEF, 0xFF, 0xFF},
-		0x00            /* length can be zero */
-	},
-	{
-		/* LLC SNAP header 8 bytes */
-		0xaa, 0xaa,
-		{0x03, 0x00, 0x00, 0x00},
-		0x0008          /* type value(2 bytes) ,filled by wlan  */
-		/* 0x0800 - IPV4, 0x86dd - IPV6 */
-	}
-};
-
-static const char *op_string[] = {
-	"TX_SUSPEND",
-	"TX_RESUME",
-	"RX_SUSPEND",
-	"RX_RESUME",
-	"STATS",
-};
-
-static struct hdd_ipa_priv *ghdd_ipa;
-
-/* Local Function Prototypes */
-static void hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
-			   unsigned long data);
-static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
-			   unsigned long data);
-
-static void hdd_ipa_cleanup_iface(struct hdd_ipa_iface_context *iface_context);
-
-/**
- * hdd_ipa_is_enabled() - Is IPA enabled?
- * @hdd_ctx: Global HDD context
- *
- * Return: true if IPA is enabled, false otherwise
- */
-bool hdd_ipa_is_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx, HDD_IPA_ENABLE_MASK);
-}
-
-/**
- * hdd_ipa_uc_is_enabled() - Is IPA uC offload enabled?
- * @hdd_ctx: Global HDD context
- *
- * Return: true if IPA uC offload is enabled, false otherwise
- */
-bool hdd_ipa_uc_is_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx, HDD_IPA_UC_ENABLE_MASK);
-}
-
-/**
- * hdd_ipa_uc_sta_is_enabled() - Is STA mode IPA uC offload enabled?
- * @hdd_ctx: Global HDD context
- *
- * Return: true if STA mode IPA uC offload is enabled, false otherwise
- */
-static inline bool hdd_ipa_uc_sta_is_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx, HDD_IPA_UC_STA_ENABLE_MASK);
-}
-
-/**
- * hdd_ipa_is_pre_filter_enabled() - Is IPA pre-filter enabled?
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: true if pre-filter is enabled, otherwise false
- */
-static inline bool hdd_ipa_is_pre_filter_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx,
-					 HDD_IPA_PRE_FILTER_ENABLE_MASK);
-}
-
-/**
- * hdd_ipa_is_ipv6_enabled() - Is IPA IPv6 enabled?
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: true if IPv6 is enabled, otherwise false
- */
-static inline bool hdd_ipa_is_ipv6_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx, HDD_IPA_IPV6_ENABLE_MASK);
-}
-
-/**
- * hdd_ipa_is_rm_enabled() - Is IPA resource manager enabled?
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: true if resource manager is enabled, otherwise false
- */
-static inline bool hdd_ipa_is_rm_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx, HDD_IPA_RM_ENABLE_MASK);
-}
-
-/**
- * hdd_ipa_is_rt_debugging_enabled() - Is IPA real-time debug enabled?
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: true if resource manager is enabled, otherwise false
- */
-static inline bool hdd_ipa_is_rt_debugging_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx, HDD_IPA_REAL_TIME_DEBUGGING);
-}
-
-/**
- * hdd_ipa_is_clk_scaling_enabled() - Is IPA clock scaling enabled?
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: true if clock scaling is enabled, otherwise false
- */
-static inline bool hdd_ipa_is_clk_scaling_enabled(hdd_context_t *hdd_ctx)
-{
-	return HDD_IPA_IS_CONFIG_ENABLED(hdd_ctx,
-					 HDD_IPA_CLK_SCALING_ENABLE_MASK |
-					 HDD_IPA_RM_ENABLE_MASK);
-}
-
-/**
- * hdd_ipa_uc_rt_debug_host_fill - fill rt debug buffer
- * @ctext: pointer to hdd context.
- *
- * If rt debug enabled, periodically called, and fill debug buffer
- *
- * Return: none
- */
-static void hdd_ipa_uc_rt_debug_host_fill(void *ctext)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *)ctext;
-	struct hdd_ipa_priv *hdd_ipa;
-	struct uc_rt_debug_info *dump_info = NULL;
-
-	if (wlan_hdd_validate_context(hdd_ctx))
-		return;
-
-	if (!hdd_ctx->hdd_ipa || !hdd_ipa_uc_is_enabled(hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: IPA UC is not enabled", __func__);
-		return;
-	}
-
-	hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa;
-
-	cdf_mutex_acquire(&hdd_ipa->rt_debug_lock);
-	dump_info = &hdd_ipa->rt_bug_buffer[
-		hdd_ipa->rt_buf_fill_index % HDD_IPA_UC_RT_DEBUG_BUF_COUNT];
-
-	dump_info->time = cdf_mc_timer_get_system_time();
-	dump_info->ipa_excep_count = hdd_ipa->stats.num_rx_excep;
-	dump_info->rx_drop_count = hdd_ipa->ipa_rx_internel_drop_count;
-	dump_info->net_sent_count = hdd_ipa->ipa_rx_net_send_count;
-	dump_info->rx_discard_count = hdd_ipa->ipa_rx_discard;
-	dump_info->tx_mcbc_count = hdd_ipa->stats.num_tx_bcmc;
-	dump_info->tx_fwd_count = hdd_ipa->ipa_tx_forward;
-	dump_info->rx_destructor_call = hdd_ipa->ipa_rx_destructor_count;
-	hdd_ipa->rt_buf_fill_index++;
-	cdf_mutex_release(&hdd_ipa->rt_debug_lock);
-
-	cdf_mc_timer_start(&hdd_ipa->rt_debug_fill_timer,
-		HDD_IPA_UC_RT_DEBUG_FILL_INTERVAL);
-}
-
-/**
- * hdd_ipa_uc_rt_debug_host_dump - dump rt debug buffer
- * @hdd_ctx: pointer to hdd context.
- *
- * If rt debug enabled, dump debug buffer contents based on requirement
- *
- * Return: none
- */
-void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa;
-	unsigned int dump_count;
-	unsigned int dump_index;
-	struct uc_rt_debug_info *dump_info = NULL;
-
-	if (wlan_hdd_validate_context(hdd_ctx))
-		return;
-
-	hdd_ipa = hdd_ctx->hdd_ipa;
-	if (!hdd_ipa || !hdd_ipa_uc_is_enabled(hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: IPA UC is not enabled", __func__);
-		return;
-	}
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-		"========= WLAN-IPA DEBUG BUF DUMP ==========\n");
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-		"     TM     :   EXEP   :   DROP   :   NETS   :   MCBC   :   TXFD   :   DSTR   :   DSCD\n");
-
-	cdf_mutex_acquire(&hdd_ipa->rt_debug_lock);
-	for (dump_count = 0;
-		dump_count < HDD_IPA_UC_RT_DEBUG_BUF_COUNT;
-		dump_count++) {
-		dump_index = (hdd_ipa->rt_buf_fill_index + dump_count) %
-			HDD_IPA_UC_RT_DEBUG_BUF_COUNT;
-		dump_info = &hdd_ipa->rt_bug_buffer[dump_index];
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			"%12lu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu:%10llu\n",
-			dump_info->time, dump_info->ipa_excep_count,
-			dump_info->rx_drop_count, dump_info->net_sent_count,
-			dump_info->tx_mcbc_count, dump_info->tx_fwd_count,
-			dump_info->rx_destructor_call,
-			dump_info->rx_discard_count);
-	}
-	cdf_mutex_release(&hdd_ipa->rt_debug_lock);
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-		"======= WLAN-IPA DEBUG BUF DUMP END ========\n");
-}
-
-/**
- * hdd_ipa_uc_rt_debug_handler - periodic memory health monitor handler
- * @ctext: pointer to hdd context.
- *
- * periodically called by timer expire
- * will try to alloc dummy memory and detect out of memory condition
- * if out of memory detected, dump wlan-ipa stats
- *
- * Return: none
- */
-static void hdd_ipa_uc_rt_debug_handler(void *ctext)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *)ctext;
-	struct hdd_ipa_priv *hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa;
-	void *dummy_ptr = NULL;
-
-	if (wlan_hdd_validate_context(hdd_ctx))
-		return;
-
-	if (!hdd_ipa_is_rt_debugging_enabled(hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: IPA RT debug is not enabled", __func__);
-		return;
-	}
-
-	/* Allocate dummy buffer periodically and free immediately. this will
-	 * proactively detect OOM and if allocation fails dump ipa stats
-	 */
-	dummy_ptr = kmalloc(HDD_IPA_UC_DEBUG_DUMMY_MEM_SIZE,
-		GFP_KERNEL | GFP_ATOMIC);
-	if (!dummy_ptr) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_FATAL,
-			"%s: Dummy alloc fail", __func__);
-		hdd_ipa_uc_rt_debug_host_dump(hdd_ctx);
-		hdd_ipa_uc_stat_request(
-			hdd_get_adapter(hdd_ctx, WLAN_HDD_SOFTAP), 1);
-	} else {
-		kfree(dummy_ptr);
-	}
-
-	cdf_mc_timer_start(&hdd_ipa->rt_debug_timer,
-		HDD_IPA_UC_RT_DEBUG_PERIOD);
-}
-
-/**
- * hdd_ipa_uc_rt_debug_destructor - called by data packet free
- * @skb: packet pinter
- *
- * when free data packet, will be invoked by wlan client and will increase
- * free counter
- *
- * Return: none
- */
-void hdd_ipa_uc_rt_debug_destructor(struct sk_buff *skb)
-{
-	if (!ghdd_ipa) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			"%s: invalid hdd context", __func__);
-		return;
-	}
-
-	ghdd_ipa->ipa_rx_destructor_count++;
-}
-
-/**
- * hdd_ipa_uc_rt_debug_deinit - remove resources to handle rt debugging
- * @hdd_ctx: hdd main context
- *
- * free all rt debugging resources
- *
- * Return: none
- */
-static void hdd_ipa_uc_rt_debug_deinit(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa;
-
-	if (CDF_TIMER_STATE_STOPPED !=
-		cdf_mc_timer_get_current_state(&hdd_ipa->rt_debug_fill_timer)) {
-		cdf_mc_timer_stop(&hdd_ipa->rt_debug_fill_timer);
-	}
-	cdf_mc_timer_destroy(&hdd_ipa->rt_debug_fill_timer);
-	cdf_mutex_destroy(&hdd_ipa->rt_debug_lock);
-
-	if (!hdd_ipa_is_rt_debugging_enabled(hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: IPA RT debug is not enabled", __func__);
-		return;
-	}
-
-	if (CDF_TIMER_STATE_STOPPED !=
-		cdf_mc_timer_get_current_state(&hdd_ipa->rt_debug_timer)) {
-		cdf_mc_timer_stop(&hdd_ipa->rt_debug_timer);
-	}
-	cdf_mc_timer_destroy(&hdd_ipa->rt_debug_timer);
-}
-
-/**
- * hdd_ipa_uc_rt_debug_init - intialize resources to handle rt debugging
- * @hdd_ctx: hdd main context
- *
- * alloc and initialize all rt debugging resources
- *
- * Return: none
- */
-static void hdd_ipa_uc_rt_debug_init(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa;
-
-	cdf_mutex_init(&hdd_ipa->rt_debug_lock);
-	cdf_mc_timer_init(&hdd_ipa->rt_debug_fill_timer, CDF_TIMER_TYPE_SW,
-		hdd_ipa_uc_rt_debug_host_fill, (void *)hdd_ctx);
-	hdd_ipa->rt_buf_fill_index = 0;
-	cdf_mem_zero(hdd_ipa->rt_bug_buffer,
-		sizeof(struct uc_rt_debug_info) *
-		HDD_IPA_UC_RT_DEBUG_BUF_COUNT);
-	hdd_ipa->ipa_tx_forward = 0;
-	hdd_ipa->ipa_rx_discard = 0;
-	hdd_ipa->ipa_rx_net_send_count = 0;
-	hdd_ipa->ipa_rx_internel_drop_count = 0;
-	hdd_ipa->ipa_rx_destructor_count = 0;
-
-	cdf_mc_timer_start(&hdd_ipa->rt_debug_fill_timer,
-		HDD_IPA_UC_RT_DEBUG_FILL_INTERVAL);
-
-	/* Reatime debug enable on feature enable */
-	if (!hdd_ipa_is_rt_debugging_enabled(hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: IPA RT debug is not enabled", __func__);
-		return;
-	}
-	cdf_mc_timer_init(&hdd_ipa->rt_debug_timer, CDF_TIMER_TYPE_SW,
-		hdd_ipa_uc_rt_debug_handler, (void *)hdd_ctx);
-	cdf_mc_timer_start(&hdd_ipa->rt_debug_timer,
-		HDD_IPA_UC_RT_DEBUG_PERIOD);
-
-}
-
-/**
- * hdd_ipa_uc_stat_query() - Query the IPA stats
- * @hdd_ctx: Global HDD context
- * @ipa_tx_diff: tx packet count diff from previous
- * 		 tx packet count
- * @ipa_rx_diff: rx packet count diff from previous
- * 		 rx packet count
- *
- * Return: true if IPA is enabled, false otherwise
- */
-void hdd_ipa_uc_stat_query(hdd_context_t *pHddCtx,
-	uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff)
-{
-	struct hdd_ipa_priv *hdd_ipa;
-
-	hdd_ipa = (struct hdd_ipa_priv *)pHddCtx->hdd_ipa;
-	*ipa_tx_diff = 0;
-	*ipa_rx_diff = 0;
-
-	if (!hdd_ipa_is_enabled(pHddCtx) ||
-		!(hdd_ipa_uc_is_enabled(pHddCtx))) {
-		return;
-	}
-
-	cdf_mutex_acquire(&hdd_ipa->ipa_lock);
-	if ((HDD_IPA_UC_NUM_WDI_PIPE == hdd_ipa->activated_fw_pipe) &&
-		(false == hdd_ipa->resource_loading)) {
-		*ipa_tx_diff = hdd_ipa->ipa_tx_packets_diff;
-		*ipa_rx_diff = hdd_ipa->ipa_rx_packets_diff;
-		HDD_IPA_LOG(LOG1, "STAT Query TX DIFF %d, RX DIFF %d",
-			    *ipa_tx_diff, *ipa_rx_diff);
-	}
-	cdf_mutex_release(&hdd_ipa->ipa_lock);
-	return;
-}
-
-/**
- * hdd_ipa_uc_stat_request() - Get IPA stats from IPA.
- * @adapter: network adapter
- * @reason: STAT REQ Reason
- *
- * Return: None
- */
-void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason)
-{
-	hdd_context_t *pHddCtx;
-	struct hdd_ipa_priv *hdd_ipa;
-
-	if (!adapter) {
-		return;
-	}
-
-	pHddCtx = (hdd_context_t *)adapter->pHddCtx;
-	hdd_ipa = (struct hdd_ipa_priv *)pHddCtx->hdd_ipa;
-	if (!hdd_ipa_is_enabled(pHddCtx) ||
-		!(hdd_ipa_uc_is_enabled(pHddCtx))) {
-		return;
-	}
-
-	HDD_IPA_LOG(LOG1, "STAT REQ Reason %d", reason);
-	cdf_mutex_acquire(&hdd_ipa->ipa_lock);
-	if ((HDD_IPA_UC_NUM_WDI_PIPE == hdd_ipa->activated_fw_pipe) &&
-		(false == hdd_ipa->resource_loading)) {
-		hdd_ipa->stat_req_reason = reason;
-		wma_cli_set_command(
-			(int)adapter->sessionId,
-			(int)WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID,
-			0, VDEV_CMD);
-	}
-	cdf_mutex_release(&hdd_ipa->ipa_lock);
-}
-
-/**
- * hdd_ipa_uc_find_add_assoc_sta() - Find associated station
- * @hdd_ipa: Global HDD IPA context
- * @sta_add: Should station be added
- * @sta_id: ID of the station being queried
- *
- * Return: true if the station was found
- */
-static bool hdd_ipa_uc_find_add_assoc_sta(struct hdd_ipa_priv *hdd_ipa,
-					  bool sta_add, uint8_t sta_id)
-{
-	bool sta_found = false;
-	uint8_t idx;
-	for (idx = 0; idx < WLAN_MAX_STA_COUNT; idx++) {
-		if ((hdd_ipa->assoc_stas_map[idx].is_reserved) &&
-		    (hdd_ipa->assoc_stas_map[idx].sta_id == sta_id)) {
-			sta_found = true;
-			break;
-		}
-	}
-	if (sta_add && sta_found) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: STA ID %d already exist, cannot add",
-			    __func__, sta_id);
-		return sta_found;
-	}
-	if (sta_add) {
-		for (idx = 0; idx < WLAN_MAX_STA_COUNT; idx++) {
-			if (!hdd_ipa->assoc_stas_map[idx].is_reserved) {
-				hdd_ipa->assoc_stas_map[idx].is_reserved = true;
-				hdd_ipa->assoc_stas_map[idx].sta_id = sta_id;
-				return sta_found;
-			}
-		}
-	}
-	if (!sta_add && !sta_found) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: STA ID %d does not exist, cannot delete",
-			    __func__, sta_id);
-		return sta_found;
-	}
-	if (!sta_add) {
-		for (idx = 0; idx < WLAN_MAX_STA_COUNT; idx++) {
-			if ((hdd_ipa->assoc_stas_map[idx].is_reserved) &&
-			    (hdd_ipa->assoc_stas_map[idx].sta_id == sta_id)) {
-				hdd_ipa->assoc_stas_map[idx].is_reserved =
-					false;
-				hdd_ipa->assoc_stas_map[idx].sta_id = 0xFF;
-				return sta_found;
-			}
-		}
-	}
-	return sta_found;
-}
-
-/**
- * hdd_ipa_uc_enable_pipes() - Enable IPA uC pipes
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: 0 on success, negative errno if error
- */
-static int hdd_ipa_uc_enable_pipes(struct hdd_ipa_priv *hdd_ipa)
-{
-	int result;
-	p_cds_contextType cds_ctx = hdd_ipa->hdd_ctx->pcds_context;
-
-	/* ACTIVATE TX PIPE */
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: Enable TX PIPE(tx_pipe_handle=%d)",
-			__func__, hdd_ipa->tx_pipe_handle);
-	result = ipa_enable_wdi_pipe(hdd_ipa->tx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Enable TX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-	result = ipa_resume_wdi_pipe(hdd_ipa->tx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Resume TX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-	ol_txrx_ipa_uc_set_active(cds_ctx->pdev_txrx_ctx, true, true);
-
-	/* ACTIVATE RX PIPE */
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: Enable RX PIPE(rx_pipe_handle=%d)",
-			__func__, hdd_ipa->rx_pipe_handle);
-	result = ipa_enable_wdi_pipe(hdd_ipa->rx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Enable RX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-	result = ipa_resume_wdi_pipe(hdd_ipa->rx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Resume RX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-	ol_txrx_ipa_uc_set_active(cds_ctx->pdev_txrx_ctx, true, false);
-	hdd_ipa->ipa_pipes_down = false;
-	return 0;
-}
-
-/**
- * hdd_ipa_uc_disable_pipes() - Disable IPA uC pipes
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: 0 on success, negative errno if error
- */
-static int hdd_ipa_uc_disable_pipes(struct hdd_ipa_priv *hdd_ipa)
-{
-	int result;
-
-	hdd_ipa->ipa_pipes_down = true;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: Disable RX PIPE", __func__);
-	result = ipa_suspend_wdi_pipe(hdd_ipa->rx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Suspend RX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-	result = ipa_disable_wdi_pipe(hdd_ipa->rx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Disable RX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: Disable TX PIPE", __func__);
-	result = ipa_suspend_wdi_pipe(hdd_ipa->tx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Suspend TX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-	result = ipa_disable_wdi_pipe(hdd_ipa->tx_pipe_handle);
-	if (result) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: Disable TX PIPE fail, code %d",
-			    __func__, result);
-		return result;
-	}
-
-	return 0;
-}
-
-/**
- * hdd_ipa_uc_handle_first_con() - Handle first uC IPA connection
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: 0 on success, negative errno if error
- */
-static int hdd_ipa_uc_handle_first_con(struct hdd_ipa_priv *hdd_ipa)
-{
-	hdd_ipa->activated_fw_pipe = 0;
-	hdd_ipa->resource_loading = true;
-
-	/* If RM feature enabled
-	 * Request PROD Resource first
-	 * PROD resource may return sync or async manners */
-	if (hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx)) {
-		if (!ipa_rm_request_resource(IPA_RM_RESOURCE_WLAN_PROD)) {
-			/* RM PROD request sync return
-			 * enable pipe immediately
-			 */
-			if (hdd_ipa_uc_enable_pipes(hdd_ipa)) {
-				HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-					"%s: IPA WDI Pipe activation failed",
-					__func__);
-				hdd_ipa->resource_loading = false;
-				return -EBUSY;
-			}
-		}
-	} else {
-		/* RM Disabled
-		 * Just enabled all the PIPEs
-		 */
-		if (hdd_ipa_uc_enable_pipes(hdd_ipa)) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				    "%s: IPA WDI Pipe activation failed",
-				    __func__);
-			hdd_ipa->resource_loading = false;
-			return -EBUSY;
-		}
-		hdd_ipa->resource_loading = false;
-	}
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s: IPA WDI Pipes activated successfully", __func__);
-	return 0;
-}
-
-/**
- * hdd_ipa_uc_handle_last_discon() - Handle last uC IPA disconnection
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: None
- */
-static void hdd_ipa_uc_handle_last_discon(struct hdd_ipa_priv *hdd_ipa)
-{
-	p_cds_contextType cds_ctx = hdd_ipa->hdd_ctx->pcds_context;
-
-	hdd_ipa->resource_unloading = true;
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: Disable FW RX PIPE", __func__);
-	ol_txrx_ipa_uc_set_active(cds_ctx->pdev_txrx_ctx, false, false);
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: Disable FW TX PIPE", __func__);
-	ol_txrx_ipa_uc_set_active(cds_ctx->pdev_txrx_ctx, false, true);
-}
-
-/**
- * hdd_ipa_uc_rm_notify_handler() - IPA uC resource notification handler
- * @context: User context registered with TL (the IPA Global context is
- *	registered
- * @rxpkt: Packet containing the notification
- * @staid: ID of the station associated with the packet
- *
- * Return: None
- */
-static void
-hdd_ipa_uc_rm_notify_handler(void *context, enum ipa_rm_event event)
-{
-	struct hdd_ipa_priv *hdd_ipa = context;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	/*
-	 * When SSR is going on or driver is unloading, just return.
-	 */
-	status = wlan_hdd_validate_context(hdd_ipa->hdd_ctx);
-	if (0 != status) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "HDD context is not valid");
-		return;
-	}
-
-	if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-		return;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s, event code %d",
-		    __func__, event);
-
-	switch (event) {
-	case IPA_RM_RESOURCE_GRANTED:
-		/* Differed RM Granted */
-		hdd_ipa_uc_enable_pipes(hdd_ipa);
-		cdf_mutex_acquire(&hdd_ipa->ipa_lock);
-		if ((false == hdd_ipa->resource_unloading) &&
-			(!hdd_ipa->activated_fw_pipe)) {
-			hdd_ipa_uc_enable_pipes(hdd_ipa);
-		}
-		cdf_mutex_release(&hdd_ipa->ipa_lock);
-		break;
-
-	case IPA_RM_RESOURCE_RELEASED:
-		/* Differed RM Released */
-		hdd_ipa->resource_unloading = false;
-		break;
-
-	default:
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s, invalid event code %d", __func__, event);
-		break;
-	}
-}
-
-/**
- * hdd_ipa_uc_rm_notify_defer() - Defer IPA uC notification
- * @hdd_ipa: Global HDD IPA context
- * @event: IPA resource manager event to be deferred
- *
- * This function is called when a resource manager event is received
- * from firmware in interrupt context.  This function will defer the
- * handling to the OL RX thread
- *
- * Return: None
- */
-static void hdd_ipa_uc_rm_notify_defer(struct work_struct *work)
-{
-	enum ipa_rm_event event;
-	struct uc_rm_work_struct *uc_rm_work = container_of(work,
-			struct uc_rm_work_struct, work);
-	struct hdd_ipa_priv *hdd_ipa = container_of(uc_rm_work,
-			struct hdd_ipa_priv, uc_rm_work);
-
-	cds_ssr_protect(__func__);
-	event = uc_rm_work->event;
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO_HIGH,
-		"%s, posted event %d", __func__, event);
-
-	hdd_ipa_uc_rm_notify_handler(hdd_ipa, event);
-	cds_ssr_unprotect(__func__);
-
-	return;
-}
-
-/**
- * hdd_ipa_uc_proc_pending_event() - Process IPA uC pending events
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: None
- */
-static void hdd_ipa_uc_proc_pending_event(struct hdd_ipa_priv *hdd_ipa)
-{
-	unsigned int pending_event_count;
-	struct ipa_uc_pending_event *pending_event = NULL;
-
-	cdf_list_size(&hdd_ipa->pending_event, &pending_event_count);
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-		"%s, Pending Event Count %d", __func__, pending_event_count);
-	if (!pending_event_count) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			"%s, No Pending Event", __func__);
-		return;
-	}
-
-	cdf_list_remove_front(&hdd_ipa->pending_event,
-			(cdf_list_node_t **)&pending_event);
-	while (pending_event != NULL) {
-		hdd_ipa_wlan_evt(pending_event->adapter,
-			pending_event->type,
-			pending_event->sta_id,
-			pending_event->mac_addr);
-		cdf_mem_free(pending_event);
-		pending_event = NULL;
-		cdf_list_remove_front(&hdd_ipa->pending_event,
-			(cdf_list_node_t **)&pending_event);
-	}
-}
-
-/**
- * hdd_ipa_uc_op_cb() - IPA uC operation callback
- * @op_msg: operation message received from firmware
- * @usr_ctxt: user context registered with TL (we register the HDD Global
- *	context)
- *
- * Return: None
- */
-static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt)
-{
-	struct op_msg_type *msg = op_msg;
-	struct ipa_uc_fw_stats *uc_fw_stat;
-	struct IpaHwStatsWDIInfoData_t ipa_stat;
-	struct hdd_ipa_priv *hdd_ipa;
-	hdd_context_t *hdd_ctx;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	if (!op_msg || !usr_ctxt) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "%s, INVALID ARG", __func__);
-		return;
-	}
-
-	if (HDD_IPA_UC_OPCODE_MAX <= msg->op_code) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s, INVALID OPCODE %d", __func__, msg->op_code);
-		return;
-	}
-
-	hdd_ctx = (hdd_context_t *) usr_ctxt;
-
-	/*
-	 * When SSR is going on or driver is unloading, just return.
-	 */
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "HDD context is not valid");
-		cdf_mem_free(op_msg);
-		return;
-	}
-
-	hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_DEBUG,
-		    "%s, OPCODE %s", __func__, op_string[msg->op_code]);
-
-	if ((HDD_IPA_UC_OPCODE_TX_RESUME == msg->op_code) ||
-	    (HDD_IPA_UC_OPCODE_RX_RESUME == msg->op_code)) {
-		cdf_mutex_acquire(&hdd_ipa->ipa_lock);
-		hdd_ipa->activated_fw_pipe++;
-		if (HDD_IPA_UC_NUM_WDI_PIPE == hdd_ipa->activated_fw_pipe) {
-			hdd_ipa->resource_loading = false;
-			hdd_ipa_uc_proc_pending_event(hdd_ipa);
-			if (hdd_ipa->pending_cons_req)
-				ipa_rm_notify_completion(
-						IPA_RM_RESOURCE_GRANTED,
-						IPA_RM_RESOURCE_WLAN_CONS);
-			hdd_ipa->pending_cons_req = false;
-		}
-		cdf_mutex_release(&hdd_ipa->ipa_lock);
-	}
-
-	if ((HDD_IPA_UC_OPCODE_TX_SUSPEND == msg->op_code) ||
-	    (HDD_IPA_UC_OPCODE_RX_SUSPEND == msg->op_code)) {
-		cdf_mutex_acquire(&hdd_ipa->ipa_lock);
-		hdd_ipa->activated_fw_pipe--;
-		if (!hdd_ipa->activated_fw_pipe) {
-			hdd_ipa_uc_disable_pipes(hdd_ipa);
-			if (hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-				ipa_rm_release_resource(
-					IPA_RM_RESOURCE_WLAN_PROD);
-			/* Sync return success from IPA
-			* Enable/resume all the PIPEs */
-			hdd_ipa->resource_unloading = false;
-			hdd_ipa_uc_proc_pending_event(hdd_ipa);
-			hdd_ipa->pending_cons_req = false;
-		}
-		cdf_mutex_release(&hdd_ipa->ipa_lock);
-	}
-
-	if ((HDD_IPA_UC_OPCODE_STATS == msg->op_code) &&
-		(HDD_IPA_UC_STAT_REASON_DEBUG == hdd_ipa->stat_req_reason)) {
-
-		/* STATs from host */
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC WLAN_HOST CE ====\n"
-			  "CE RING BASE: 0x%llx\n"
-			  "CE RING SIZE: %d\n"
-			  "CE REG ADDR : 0x%llx",
-			  (unsigned long long)hdd_ipa->ce_sr_base_paddr,
-			  hdd_ipa->ce_sr_ring_size,
-			  (unsigned long long)hdd_ipa->ce_reg_paddr);
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC WLAN_HOST TX ====\n"
-			  "COMP RING BASE: 0x%llx\n"
-			  "COMP RING SIZE: %d\n"
-			  "NUM ALLOC BUF: %d\n"
-			  "COMP RING DBELL : 0x%llx",
-			  (unsigned long long)hdd_ipa->tx_comp_ring_base_paddr,
-			  hdd_ipa->tx_comp_ring_size,
-			  hdd_ipa->tx_num_alloc_buffer,
-			  (unsigned long long)hdd_ipa->tx_comp_doorbell_paddr);
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC WLAN_HOST RX ====\n"
-			  "IND RING BASE: 0x%llx\n"
-			  "IND RING SIZE: %d\n"
-			  "IND RING DBELL : 0x%llx\n"
-			  "PROC DONE IND ADDR : 0x%llx\n"
-			  "NUM EXCP PKT : %llu\n"
-			  "NUM TX BCMC : %llu\n"
-			  "NUM TX BCMC ERR : %llu",
-			  (unsigned long long)hdd_ipa->rx_rdy_ring_base_paddr,
-			  hdd_ipa->rx_rdy_ring_size,
-			  (unsigned long long)hdd_ipa->rx_ready_doorbell_paddr,
-			  (unsigned long long)hdd_ipa->rx_proc_done_idx_paddr,
-			  hdd_ipa->stats.num_rx_excep,
-			  hdd_ipa->stats.num_tx_bcmc,
-			  (unsigned long long)hdd_ipa->stats.num_tx_bcmc_err);
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC WLAN_HOST CONTROL ====\n"
-			  "SAP NUM STAs: %d\n"
-			  "STA CONNECTED: %d\n"
-			  "TX PIPE HDL: %d\n"
-			  "RX PIPE HDL : %d\n"
-			  "RSC LOADING : %d\n"
-			  "RSC UNLOADING : %d\n"
-			  "PNDNG CNS RQT : %d",
-			  hdd_ipa->sap_num_connected_sta,
-			  hdd_ipa->sta_connected,
-			  hdd_ipa->tx_pipe_handle,
-			  hdd_ipa->rx_pipe_handle,
-			  (unsigned int)hdd_ipa->resource_loading,
-			  (unsigned int)hdd_ipa->resource_unloading,
-			  (unsigned int)hdd_ipa->pending_cons_req);
-
-		/* STATs from FW */
-		uc_fw_stat = (struct ipa_uc_fw_stats *)
-			     ((uint8_t *)op_msg + sizeof(struct op_msg_type));
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC WLAN_FW TX ====\n"
-			  "COMP RING BASE: 0x%x\n"
-			  "COMP RING SIZE: %d\n"
-			  "COMP RING DBELL : 0x%x\n"
-			  "COMP RING DBELL IND VAL : %d\n"
-			  "COMP RING DBELL CACHED VAL : %d\n"
-			  "COMP RING DBELL CACHED VAL : %d\n"
-			  "PKTS ENQ : %d\n"
-			  "PKTS COMP : %d\n"
-			  "IS SUSPEND : %d\n"
-			  "RSVD : 0x%x",
-			  uc_fw_stat->tx_comp_ring_base,
-			  uc_fw_stat->tx_comp_ring_size,
-			  uc_fw_stat->tx_comp_ring_dbell_addr,
-			  uc_fw_stat->tx_comp_ring_dbell_ind_val,
-			  uc_fw_stat->tx_comp_ring_dbell_cached_val,
-			  uc_fw_stat->tx_comp_ring_dbell_cached_val,
-			  uc_fw_stat->tx_pkts_enqueued,
-			  uc_fw_stat->tx_pkts_completed,
-			  uc_fw_stat->tx_is_suspend, uc_fw_stat->tx_reserved);
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC WLAN_FW RX ====\n"
-			  "IND RING BASE: 0x%x\n"
-			  "IND RING SIZE: %d\n"
-			  "IND RING DBELL : 0x%x\n"
-			  "IND RING DBELL IND VAL : %d\n"
-			  "IND RING DBELL CACHED VAL : %d\n"
-			  "RDY IND ADDR : 0x%x\n"
-			  "RDY IND CACHE VAL : %d\n"
-			  "RFIL IND : %d\n"
-			  "NUM PKT INDICAT : %d\n"
-			  "BUF REFIL : %d\n"
-			  "NUM DROP NO SPC : %d\n"
-			  "NUM DROP NO BUF : %d\n"
-			  "IS SUSPND : %d\n"
-			  "RSVD : 0x%x\n",
-			  uc_fw_stat->rx_ind_ring_base,
-			  uc_fw_stat->rx_ind_ring_size,
-			  uc_fw_stat->rx_ind_ring_dbell_addr,
-			  uc_fw_stat->rx_ind_ring_dbell_ind_val,
-			  uc_fw_stat->rx_ind_ring_dbell_ind_cached_val,
-			  uc_fw_stat->rx_ind_ring_rdidx_addr,
-			  uc_fw_stat->rx_ind_ring_rd_idx_cached_val,
-			  uc_fw_stat->rx_refill_idx,
-			  uc_fw_stat->rx_num_pkts_indicated,
-			  uc_fw_stat->rx_buf_refilled,
-			  uc_fw_stat->rx_num_ind_drop_no_space,
-			  uc_fw_stat->rx_num_ind_drop_no_buf,
-			  uc_fw_stat->rx_is_suspend, uc_fw_stat->rx_reserved);
-		/* STATs from IPA */
-		ipa_get_wdi_stats(&ipa_stat);
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC IPA TX ====\n"
-			  "NUM PROCD : %d\n"
-			  "CE DBELL : 0x%x\n"
-			  "NUM DBELL FIRED : %d\n"
-			  "COMP RNG FULL : %d\n"
-			  "COMP RNG EMPT : %d\n"
-			  "COMP RNG USE HGH : %d\n"
-			  "COMP RNG USE LOW : %d\n"
-			  "BAM FIFO FULL : %d\n"
-			  "BAM FIFO EMPT : %d\n"
-			  "BAM FIFO USE HGH : %d\n"
-			  "BAM FIFO USE LOW : %d\n"
-			  "NUM DBELL : %d\n"
-			  "NUM UNEXP DBELL : %d\n"
-			  "NUM BAM INT HDL : 0x%x\n"
-			  "NUM BAM INT NON-RUN : 0x%x\n"
-			  "NUM QMB INT HDL : 0x%x",
-			  ipa_stat.tx_ch_stats.num_pkts_processed,
-			  ipa_stat.tx_ch_stats.copy_engine_doorbell_value,
-			  ipa_stat.tx_ch_stats.num_db_fired,
-			  ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringFull,
-			  ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringEmpty,
-			  ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringUsageHigh,
-			  ipa_stat.tx_ch_stats.tx_comp_ring_stats.ringUsageLow,
-			  ipa_stat.tx_ch_stats.bam_stats.bamFifoFull,
-			  ipa_stat.tx_ch_stats.bam_stats.bamFifoEmpty,
-			  ipa_stat.tx_ch_stats.bam_stats.bamFifoUsageHigh,
-			  ipa_stat.tx_ch_stats.bam_stats.bamFifoUsageLow,
-			  ipa_stat.tx_ch_stats.num_db,
-			  ipa_stat.tx_ch_stats.num_unexpected_db,
-			  ipa_stat.tx_ch_stats.num_bam_int_handled,
-			  ipa_stat.tx_ch_stats.
-			  num_bam_int_in_non_runnning_state,
-			  ipa_stat.tx_ch_stats.num_qmb_int_handled);
-
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "==== IPA_UC IPA RX ====\n"
-			  "MAX OST PKT : %d\n"
-			  "NUM PKT PRCSD : %d\n"
-			  "RNG RP : 0x%x\n"
-			  "COMP RNG FULL : %d\n"
-			  "COMP RNG EMPT : %d\n"
-			  "COMP RNG USE HGH : %d\n"
-			  "COMP RNG USE LOW : %d\n"
-			  "BAM FIFO FULL : %d\n"
-			  "BAM FIFO EMPT : %d\n"
-			  "BAM FIFO USE HGH : %d\n"
-			  "BAM FIFO USE LOW : %d\n"
-			  "NUM DB : %d\n"
-			  "NUM UNEXP DB : %d\n"
-			  "NUM BAM INT HNDL : 0x%x\n",
-			  ipa_stat.rx_ch_stats.max_outstanding_pkts,
-			  ipa_stat.rx_ch_stats.num_pkts_processed,
-			  ipa_stat.rx_ch_stats.rx_ring_rp_value,
-			  ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringFull,
-			  ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringEmpty,
-			  ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringUsageHigh,
-			  ipa_stat.rx_ch_stats.rx_ind_ring_stats.ringUsageLow,
-			  ipa_stat.rx_ch_stats.bam_stats.bamFifoFull,
-			  ipa_stat.rx_ch_stats.bam_stats.bamFifoEmpty,
-			  ipa_stat.rx_ch_stats.bam_stats.bamFifoUsageHigh,
-			  ipa_stat.rx_ch_stats.bam_stats.bamFifoUsageLow,
-			  ipa_stat.rx_ch_stats.num_db,
-			  ipa_stat.rx_ch_stats.num_unexpected_db,
-			  ipa_stat.rx_ch_stats.num_bam_int_handled);
-	} else if ((HDD_IPA_UC_OPCODE_STATS == msg->op_code) &&
-		(HDD_IPA_UC_STAT_REASON_BW_CAL == hdd_ipa->stat_req_reason)) {
-		/* STATs from FW */
-		uc_fw_stat = (struct ipa_uc_fw_stats *)
-			((uint8_t *)op_msg + sizeof(struct op_msg_type));
-		cdf_mutex_acquire(&hdd_ipa->ipa_lock);
-		hdd_ipa->ipa_tx_packets_diff = HDD_BW_GET_DIFF(
-			uc_fw_stat->tx_pkts_completed,
-			hdd_ipa->ipa_p_tx_packets);
-		hdd_ipa->ipa_rx_packets_diff = HDD_BW_GET_DIFF(
-			(uc_fw_stat->rx_num_ind_drop_no_space +
-			uc_fw_stat->rx_num_ind_drop_no_buf +
-			uc_fw_stat->rx_num_pkts_indicated),
-			hdd_ipa->ipa_p_rx_packets);
-
-		hdd_ipa->ipa_p_tx_packets = uc_fw_stat->tx_pkts_completed;
-		hdd_ipa->ipa_p_rx_packets =
-			(uc_fw_stat->rx_num_ind_drop_no_space +
-			uc_fw_stat->rx_num_ind_drop_no_buf +
-			uc_fw_stat->rx_num_pkts_indicated);
-		cdf_mutex_release(&hdd_ipa->ipa_lock);
-	} else {
-		HDD_IPA_LOG(LOGE, "INVALID REASON %d",
-			    hdd_ipa->stat_req_reason);
-	}
-	cdf_mem_free(op_msg);
-}
-
-
-/**
- * hdd_ipa_uc_offload_enable_disable() - wdi enable/disable notify to fw
- * @adapter: device adapter instance
- * @offload_type: MCC or SCC
- * @enable: TX offload enable or disable
- *
- * Return: none
- */
-static void hdd_ipa_uc_offload_enable_disable(hdd_adapter_t *adapter,
-			uint32_t offload_type, uint32_t enable)
-{
-	struct sir_ipa_offload_enable_disable ipa_offload_enable_disable;
-
-	/* Lower layer may send multiple START_BSS_EVENT in DFS mode or during
-	 * channel change indication. Since these indications are sent by lower
-	 * layer as SAP updates and IPA doesn't have to do anything for these
-	 * updates so ignoring!
-	 */
-	if (WLAN_HDD_SOFTAP == adapter->device_mode && adapter->ipa_context)
-		return;
-
-	/* Lower layer may send multiple START_BSS_EVENT in DFS mode or during
-	 * channel change indication. Since these indications are sent by lower
-	 * layer as SAP updates and IPA doesn't have to do anything for these
-	 * updates so ignoring!
-	*/
-	if (adapter->ipa_context)
-		return;
-
-	cdf_mem_zero(&ipa_offload_enable_disable,
-		sizeof(ipa_offload_enable_disable));
-	ipa_offload_enable_disable.offload_type = offload_type;
-	ipa_offload_enable_disable.vdev_id = adapter->sessionId;
-	ipa_offload_enable_disable.enable = enable;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-		"%s: offload_type=%d, vdev_id=%d, enable=%d", __func__,
-		ipa_offload_enable_disable.offload_type,
-		ipa_offload_enable_disable.vdev_id,
-		ipa_offload_enable_disable.enable);
-
-	if (CDF_STATUS_SUCCESS !=
-		sme_ipa_offload_enable_disable(WLAN_HDD_GET_HAL_CTX(adapter),
-			adapter->sessionId, &ipa_offload_enable_disable)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			"%s: Failure to enable IPA offload \
-			(offload_type=%d, vdev_id=%d, enable=%d)", __func__,
-			ipa_offload_enable_disable.offload_type,
-			ipa_offload_enable_disable.vdev_id,
-			ipa_offload_enable_disable.enable);
-	}
-}
-
-/**
- * hdd_ipa_uc_fw_op_event_handler - IPA uC FW OPvent handler
- * @work: uC OP work
- *
- * Return: None
- */
-static void hdd_ipa_uc_fw_op_event_handler(struct work_struct *work)
-{
-	struct op_msg_type *msg;
-	struct uc_op_work_struct *uc_op_work = container_of(work,
-			struct uc_op_work_struct, work);
-	struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
-
-	cds_ssr_protect(__func__);
-
-	msg = uc_op_work->msg;
-	uc_op_work->msg = NULL;
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO_HIGH,
-			"%s, posted msg %d", __func__, msg->op_code);
-
-	hdd_ipa_uc_op_cb(msg, hdd_ipa->hdd_ctx);
-
-	cds_ssr_unprotect(__func__);
-
-	return;
-}
-
-/**
- * hdd_ipa_uc_op_event_handler() - Adapter lookup
- * hdd_ipa_uc_fw_op_event_handler - IPA uC FW OPvent handler
- * @op_msg: operation message received from firmware
- * @hdd_ctx: Global HDD context
- *
- * Return: None
- */
-static void hdd_ipa_uc_op_event_handler(uint8_t *op_msg, void *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa;
-	struct op_msg_type *msg;
-	struct uc_op_work_struct *uc_op_work;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "HDD context is not valid");
-		goto end;
-	}
-
-	msg = (struct op_msg_type *)op_msg;
-	hdd_ipa = ((hdd_context_t *)hdd_ctx)->hdd_ipa;
-
-	if (unlikely(!hdd_ipa))
-		goto end;
-
-	if (HDD_IPA_UC_OPCODE_MAX <= msg->op_code) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "%s: Invalid OP Code (%d)",
-				__func__, msg->op_code);
-		goto end;
-	}
-
-	uc_op_work = &hdd_ipa->uc_op_work[msg->op_code];
-	if (uc_op_work->msg)
-		/* When the same uC OPCODE is already pended, just return */
-		goto end;
-
-	uc_op_work->msg = msg;
-	schedule_work(&uc_op_work->work);
-	return;
-
-end:
-	cdf_mem_free(op_msg);
-}
-
-/**
- * hdd_ipa_init_uc_op_work - init ipa uc op work
- * @work: struct work_struct
- * @work_handler: work_handler
- *
- * Return: none
- */
-#ifdef CONFIG_CNSS
-static void hdd_ipa_init_uc_op_work(struct work_struct *work,
-					work_func_t work_handler)
-{
-	cnss_init_work(work, work_handler);
-}
-#else
-static void hdd_ipa_init_uc_op_work(struct work_struct *work,
-					work_func_t work_handler)
-{
-	INIT_WORK(work, work_handler);
-}
-#endif
-
-
-/**
- * hdd_ipa_uc_ol_init() - Initialize IPA uC offload
- * @hdd_ctx: Global HDD context
- *
- * Return: CDF_STATUS
- */
-static CDF_STATUS hdd_ipa_uc_ol_init(hdd_context_t *hdd_ctx)
-{
-	struct ipa_wdi_in_params pipe_in;
-	struct ipa_wdi_out_params pipe_out;
-	struct hdd_ipa_priv *ipa_ctxt = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa;
-	p_cds_contextType cds_ctx = hdd_ctx->pcds_context;
-	uint8_t i;
-
-	cdf_mem_zero(&pipe_in, sizeof(struct ipa_wdi_in_params));
-	cdf_mem_zero(&pipe_out, sizeof(struct ipa_wdi_out_params));
-
-	cdf_list_init(&ipa_ctxt->pending_event, 1000);
-	cdf_mutex_init(&ipa_ctxt->event_lock);
-	cdf_mutex_init(&ipa_ctxt->ipa_lock);
-
-	/* TX PIPE */
-	pipe_in.sys.ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
-	pipe_in.sys.ipa_ep_cfg.hdr.hdr_len = HDD_IPA_UC_WLAN_TX_HDR_LEN;
-	pipe_in.sys.ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid = 1;
-	pipe_in.sys.ipa_ep_cfg.hdr.hdr_ofst_pkt_size = 0;
-	pipe_in.sys.ipa_ep_cfg.hdr.hdr_additional_const_len =
-		HDD_IPA_UC_WLAN_8023_HDR_SIZE;
-	pipe_in.sys.ipa_ep_cfg.mode.mode = IPA_BASIC;
-	pipe_in.sys.client = IPA_CLIENT_WLAN1_CONS;
-	pipe_in.sys.desc_fifo_sz = hdd_ctx->config->IpaDescSize;
-	pipe_in.sys.priv = hdd_ctx->hdd_ipa;
-	pipe_in.sys.ipa_ep_cfg.hdr_ext.hdr_little_endian = true;
-	pipe_in.sys.notify = hdd_ipa_i2w_cb;
-	if (!hdd_ipa_is_rm_enabled(hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			    "%s: IPA RM DISABLED, IPA AWAKE", __func__);
-		pipe_in.sys.keep_ipa_awake = true;
-	}
-
-	pipe_in.u.dl.comp_ring_base_pa = ipa_ctxt->tx_comp_ring_base_paddr;
-	pipe_in.u.dl.comp_ring_size =
-		ipa_ctxt->tx_comp_ring_size * sizeof(cdf_dma_addr_t);
-	pipe_in.u.dl.ce_ring_base_pa = ipa_ctxt->ce_sr_base_paddr;
-	pipe_in.u.dl.ce_door_bell_pa = ipa_ctxt->ce_reg_paddr;
-	pipe_in.u.dl.ce_ring_size = ipa_ctxt->ce_sr_ring_size;
-	pipe_in.u.dl.num_tx_buffers = ipa_ctxt->tx_num_alloc_buffer;
-
-	/* Connect WDI IPA PIPE */
-	ipa_connect_wdi_pipe(&pipe_in, &pipe_out);
-	/* Micro Controller Doorbell register */
-	ipa_ctxt->tx_comp_doorbell_paddr = pipe_out.uc_door_bell_pa;
-	/* WLAN TX PIPE Handle */
-	ipa_ctxt->tx_pipe_handle = pipe_out.clnt_hdl;
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO_HIGH,
-		    "TX : CRBPA 0x%x, CRS %d, CERBPA 0x%x, CEDPA 0x%x,"
-		    " CERZ %d, NB %d, CDBPAD 0x%x",
-		    (unsigned int)pipe_in.u.dl.comp_ring_base_pa,
-		    pipe_in.u.dl.comp_ring_size,
-		    (unsigned int)pipe_in.u.dl.ce_ring_base_pa,
-		    (unsigned int)pipe_in.u.dl.ce_door_bell_pa,
-		    pipe_in.u.dl.ce_ring_size,
-		    pipe_in.u.dl.num_tx_buffers,
-		    (unsigned int)ipa_ctxt->tx_comp_doorbell_paddr);
-
-	/* RX PIPE */
-	pipe_in.sys.ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
-	pipe_in.sys.ipa_ep_cfg.hdr.hdr_len = HDD_IPA_UC_WLAN_RX_HDR_LEN;
-	pipe_in.sys.ipa_ep_cfg.hdr.hdr_ofst_metadata_valid = 0;
-	pipe_in.sys.ipa_ep_cfg.hdr.hdr_metadata_reg_valid = 1;
-	pipe_in.sys.ipa_ep_cfg.mode.mode = IPA_BASIC;
-	pipe_in.sys.client = IPA_CLIENT_WLAN1_PROD;
-	pipe_in.sys.desc_fifo_sz = hdd_ctx->config->IpaDescSize +
-				   sizeof(struct sps_iovec);
-	pipe_in.sys.notify = hdd_ipa_w2i_cb;
-	if (!hdd_ipa_is_rm_enabled(hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: IPA RM DISABLED, IPA AWAKE", __func__);
-		pipe_in.sys.keep_ipa_awake = true;
-	}
-
-	pipe_in.u.ul.rdy_ring_base_pa = ipa_ctxt->rx_rdy_ring_base_paddr;
-	pipe_in.u.ul.rdy_ring_size = ipa_ctxt->rx_rdy_ring_size;
-	pipe_in.u.ul.rdy_ring_rp_pa = ipa_ctxt->rx_proc_done_idx_paddr;
-	HDD_IPA_WDI2_SET(pipe_in, ipa_ctxt);
-	ipa_connect_wdi_pipe(&pipe_in, &pipe_out);
-	ipa_ctxt->rx_ready_doorbell_paddr = pipe_out.uc_door_bell_pa;
-	ipa_ctxt->rx_pipe_handle = pipe_out.clnt_hdl;
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO_HIGH,
-		    "RX : RRBPA 0x%x, RRS %d, PDIPA 0x%x, RDY_DB_PAD 0x%x",
-		    (unsigned int)pipe_in.u.ul.rdy_ring_base_pa,
-		    pipe_in.u.ul.rdy_ring_size,
-		    (unsigned int)pipe_in.u.ul.rdy_ring_rp_pa,
-		    (unsigned int)ipa_ctxt->rx_ready_doorbell_paddr);
-
-	ol_txrx_ipa_uc_set_doorbell_paddr(cds_ctx->pdev_txrx_ctx,
-				     ipa_ctxt->tx_comp_doorbell_paddr,
-				     ipa_ctxt->rx_ready_doorbell_paddr);
-
-	ol_txrx_ipa_uc_register_op_cb(cds_ctx->pdev_txrx_ctx,
-				  hdd_ipa_uc_op_event_handler, (void *)hdd_ctx);
-
-	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);
-		ipa_ctxt->uc_op_work[i].msg = NULL;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_ipa_uc_force_pipe_shutdown() - Force shutdown IPA pipe
- * @hdd_ctx: hdd main context
- *
- * Force shutdown IPA pipe
- * Independent of FW pipe status, IPA pipe shutdonw progress
- * in case, any STA does not leave properly, IPA HW pipe should cleaned up
- * independent from FW pipe status
- *
- * Return: NONE
- */
-void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa;
-
-	if (!hdd_ipa_is_enabled(hdd_ctx) || !hdd_ctx->hdd_ipa)
-		return;
-
-	hdd_ipa = (struct hdd_ipa_priv *)hdd_ctx->hdd_ipa;
-	if (false == hdd_ipa->ipa_pipes_down) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				"IPA pipes are not down yet, force shutdown");
-		hdd_ipa_uc_disable_pipes(hdd_ipa);
-	} else {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-				"IPA pipes are down, do nothing");
-	}
-
-	return;
-}
-
-/**
- * hdd_ipa_uc_ssr_deinit() - handle ipa deinit for SSR
- *
- * Deinit basic IPA UC host side to be in sync reloaded FW during
- * SSR
- *
- * Return: 0 - Success
- */
-int hdd_ipa_uc_ssr_deinit(void)
-{
-	struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
-	int idx;
-	struct hdd_ipa_iface_context *iface_context;
-
-	if ((!hdd_ipa) || (!hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)))
-		return 0;
-
-	/* Clean up HDD IPA interfaces */
-	for (idx = 0; (hdd_ipa->num_iface > 0) &&
-		(idx < HDD_IPA_MAX_IFACE); idx++) {
-		iface_context = &hdd_ipa->iface_context[idx];
-		if (iface_context && iface_context->adapter)
-			hdd_ipa_cleanup_iface(iface_context);
-	}
-
-	/* After SSR, wlan driver reloads FW again. But we need to protect
-	 * IPA submodule during SSR transient state. So deinit basic IPA
-	 * UC host side to be in sync with reloaded FW during SSR
-	 */
-	if (!hdd_ipa->ipa_pipes_down)
-		hdd_ipa_uc_disable_pipes(hdd_ipa);
-
-	cdf_mutex_acquire(&hdd_ipa->ipa_lock);
-	for (idx = 0; idx < WLAN_MAX_STA_COUNT; idx++) {
-		hdd_ipa->assoc_stas_map[idx].is_reserved = false;
-		hdd_ipa->assoc_stas_map[idx].sta_id = 0xFF;
-	}
-	cdf_mutex_release(&hdd_ipa->ipa_lock);
-
-	/* Full IPA driver cleanup not required since wlan driver is now
-	 * unloaded and reloaded after SSR.
-	 */
-	return 0;
-}
-
-/**
- * hdd_ipa_uc_ssr_reinit() - handle ipa reinit after SSR
- *
- * Init basic IPA UC host side to be in sync with reloaded FW after
- * SSR to resume IPA UC operations
- *
- * Return: 0 - Success
- */
-int hdd_ipa_uc_ssr_reinit(void)
-{
-
-	/* After SSR is complete, IPA UC can resume operation. But now wlan
-	 * driver will be unloaded and reloaded, which takes care of IPA cleanup
-	 * and initialization. This is a placeholder func if IPA has to resume
-	 * operations without driver reload.
-	 */
-	return 0;
-}
-
-/**
- * hdd_ipa_tx_packet_ipa() - send packet to IPA
- * @hdd_ctx:    Global HDD context
- * @skb:        skb sent to IPA
- * @session_id: send packet instance session id
- *
- * Send TX packet which generated by system to IPA.
- * This routine only will be used for function verification
- *
- * Return: NULL packet sent to IPA properly
- *         NULL invalid packet drop
- *         skb packet not sent to IPA. legacy data path should handle
- */
-struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx,
-	struct sk_buff *skb, uint8_t session_id)
-{
-	struct ipa_header *ipa_header;
-	struct frag_header *frag_header;
-
-	if (!hdd_ipa_uc_is_enabled(hdd_ctx))
-		return skb;
-
-	ipa_header = (struct ipa_header *) skb_push(skb,
-		sizeof(struct ipa_header));
-	if (!ipa_header) {
-		/* No headroom, legacy */
-		return skb;
-	}
-	memset(ipa_header, 0, sizeof(*ipa_header));
-	ipa_header->vdev_id = 0;
-
-	frag_header = (struct frag_header *) skb_push(skb,
-		sizeof(struct frag_header));
-	if (!frag_header) {
-		/* No headroom, drop */
-		kfree_skb(skb);
-		return NULL;
-	}
-	memset(frag_header, 0, sizeof(*frag_header));
-	frag_header->length = skb->len - sizeof(struct frag_header)
-		- sizeof(struct ipa_header);
-
-	ipa_tx_dp(IPA_CLIENT_WLAN1_CONS, skb, NULL);
-	return NULL;
-}
-
-/**
- * hdd_ipa_wake_lock_timer_func() - Wake lock work handler
- * @work: scheduled work
- *
- * When IPA resources are released in hdd_ipa_rm_try_release() we do
- * not want to immediately release the wake lock since the system
- * would then potentially try to suspend when there is a healthy data
- * rate.  Deferred work is scheduled and this function handles the
- * work.  When this function is called, if the IPA resource is still
- * released then we release the wake lock.
- *
- * Return: None
- */
-static void hdd_ipa_wake_lock_timer_func(struct work_struct *work)
-{
-	struct hdd_ipa_priv *hdd_ipa = container_of(to_delayed_work(work),
-						    struct hdd_ipa_priv,
-						    wake_lock_work);
-
-	cdf_spin_lock_bh(&hdd_ipa->rm_lock);
-
-	if (hdd_ipa->rm_state != HDD_IPA_RM_RELEASED)
-		goto end;
-
-	hdd_ipa->wake_lock_released = true;
-	cdf_wake_lock_release(&hdd_ipa->wake_lock,
-			      WIFI_POWER_EVENT_WAKELOCK_IPA);
-
-end:
-	cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-}
-
-/**
- * hdd_ipa_rm_request() - Request resource from IPA
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: 0 on success, negative errno on error
- */
-static int hdd_ipa_rm_request(struct hdd_ipa_priv *hdd_ipa)
-{
-	int ret = 0;
-
-	if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-		return 0;
-
-	cdf_spin_lock_bh(&hdd_ipa->rm_lock);
-
-	switch (hdd_ipa->rm_state) {
-	case HDD_IPA_RM_GRANTED:
-		cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-		return 0;
-	case HDD_IPA_RM_GRANT_PENDING:
-		cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-		return -EINPROGRESS;
-	case HDD_IPA_RM_RELEASED:
-		hdd_ipa->rm_state = HDD_IPA_RM_GRANT_PENDING;
-		break;
-	}
-
-	cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-
-	ret = ipa_rm_inactivity_timer_request_resource(
-			IPA_RM_RESOURCE_WLAN_PROD);
-
-	cdf_spin_lock_bh(&hdd_ipa->rm_lock);
-	if (ret == 0) {
-		hdd_ipa->rm_state = HDD_IPA_RM_GRANTED;
-		hdd_ipa->stats.num_rm_grant_imm++;
-	}
-
-	cancel_delayed_work(&hdd_ipa->wake_lock_work);
-	if (hdd_ipa->wake_lock_released) {
-		cdf_wake_lock_acquire(&hdd_ipa->wake_lock,
-				      WIFI_POWER_EVENT_WAKELOCK_IPA);
-		hdd_ipa->wake_lock_released = false;
-	}
-	cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-
-	return ret;
-}
-
-/**
- * hdd_ipa_rm_try_release() - Attempt to release IPA resource
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: 0 if resources released, negative errno otherwise
- */
-static int hdd_ipa_rm_try_release(struct hdd_ipa_priv *hdd_ipa)
-{
-	int ret = 0;
-
-	if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-		return 0;
-
-	if (atomic_read(&hdd_ipa->tx_ref_cnt))
-		return -EAGAIN;
-
-	spin_lock_bh(&hdd_ipa->q_lock);
-	if (!hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) &&
-		(hdd_ipa->pending_hw_desc_cnt || hdd_ipa->pend_q_cnt)) {
-		spin_unlock_bh(&hdd_ipa->q_lock);
-		return -EAGAIN;
-	}
-	spin_unlock_bh(&hdd_ipa->q_lock);
-
-	cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-
-	if (!cdf_nbuf_is_queue_empty(&hdd_ipa->pm_queue_head)) {
-		cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-		return -EAGAIN;
-	}
-	cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-
-	cdf_spin_lock_bh(&hdd_ipa->rm_lock);
-	switch (hdd_ipa->rm_state) {
-	case HDD_IPA_RM_GRANTED:
-		break;
-	case HDD_IPA_RM_GRANT_PENDING:
-		cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-		return -EINPROGRESS;
-	case HDD_IPA_RM_RELEASED:
-		cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-		return 0;
-	}
-
-	/* IPA driver returns immediately so set the state here to avoid any
-	 * race condition.
-	 */
-	hdd_ipa->rm_state = HDD_IPA_RM_RELEASED;
-	hdd_ipa->stats.num_rm_release++;
-	cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-
-	ret =
-		ipa_rm_inactivity_timer_release_resource(IPA_RM_RESOURCE_WLAN_PROD);
-
-	cdf_spin_lock_bh(&hdd_ipa->rm_lock);
-	if (unlikely(ret != 0)) {
-		hdd_ipa->rm_state = HDD_IPA_RM_GRANTED;
-		WARN_ON(1);
-	}
-
-	/*
-	 * If wake_lock is released immediately, kernel would try to suspend
-	 * immediately as well, Just avoid ping-pong between suspend-resume
-	 * while there is healthy amount of data transfer going on by
-	 * releasing the wake_lock after some delay.
-	 */
-	schedule_delayed_work(&hdd_ipa->wake_lock_work,
-			      msecs_to_jiffies
-				      (HDD_IPA_RX_INACTIVITY_MSEC_DELAY));
-
-	cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-
-	return ret;
-}
-
-/**
- * hdd_ipa_rm_notify() - IPA resource manager notifier callback
- * @user_data: user data registered with IPA
- * @event: the IPA resource manager event that occurred
- * @data: the data associated with the event
- *
- * Return: None
- */
-static void hdd_ipa_rm_notify(void *user_data, enum ipa_rm_event event,
-			      unsigned long data)
-{
-	struct hdd_ipa_priv *hdd_ipa = user_data;
-
-	if (unlikely(!hdd_ipa))
-		return;
-
-	if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-		return;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "Evt: %d", event);
-
-	switch (event) {
-	case IPA_RM_RESOURCE_GRANTED:
-		if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			/* RM Notification comes with ISR context
-			 * it should be serialized into work queue to avoid
-			 * ISR sleep problem
-			 */
-			hdd_ipa->uc_rm_work.event = event;
-			schedule_work(&hdd_ipa->uc_rm_work.work);
-			break;
-		}
-		cdf_spin_lock_bh(&hdd_ipa->rm_lock);
-		hdd_ipa->rm_state = HDD_IPA_RM_GRANTED;
-		cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-		hdd_ipa->stats.num_rm_grant++;
-		break;
-
-	case IPA_RM_RESOURCE_RELEASED:
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "RM Release");
-		hdd_ipa->resource_unloading = false;
-		break;
-
-	default:
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "Unknown RM Evt: %d", event);
-		break;
-	}
-}
-
-/**
- * hdd_ipa_rm_cons_release() - WLAN consumer resource release handler
- *
- * Callback function registered with IPA that is called when IPA wants
- * to release the WLAN consumer resource
- *
- * Return: 0 if the request is granted, negative errno otherwise
- */
-static int hdd_ipa_rm_cons_release(void)
-{
-	return 0;
-}
-
-/**
- * hdd_ipa_rm_cons_request() - WLAN consumer resource request handler
- *
- * Callback function registered with IPA that is called when IPA wants
- * to access the WLAN consumer resource
- *
- * Return: 0 if the request is granted, negative errno otherwise
- */
-static int hdd_ipa_rm_cons_request(void)
-{
-	int ret = 0;
-
-	if (ghdd_ipa->resource_loading) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_FATAL,
-			    "%s: IPA resource loading in progress",
-			    __func__);
-		ghdd_ipa->pending_cons_req = true;
-		ret = -EINPROGRESS;
-	} else if (ghdd_ipa->resource_unloading) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_FATAL,
-				"%s: IPA resource unloading in progress",
-				__func__);
-		ghdd_ipa->pending_cons_req = true;
-		ret = -EPERM;
-	}
-
-	return ret;
-}
-
-/**
- * hdd_ipa_set_perf_level() - Set IPA performance level
- * @hdd_ctx: Global HDD context
- * @tx_packets: Number of packets transmitted in the last sample period
- * @rx_packets: Number of packets received in the last sample period
- *
- * Return: 0 on success, negative errno on error
- */
-int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets,
-			   uint64_t rx_packets)
-{
-	uint32_t next_cons_bw, next_prod_bw;
-	struct hdd_ipa_priv *hdd_ipa = hdd_ctx->hdd_ipa;
-	struct ipa_rm_perf_profile profile;
-	int ret;
-
-	if ((!hdd_ipa_is_enabled(hdd_ctx)) ||
-		(!hdd_ipa_is_clk_scaling_enabled(hdd_ctx)))
-		return 0;
-
-	memset(&profile, 0, sizeof(profile));
-
-	if (tx_packets > (hdd_ctx->config->busBandwidthHighThreshold / 2))
-		next_cons_bw = hdd_ctx->config->IpaHighBandwidthMbps;
-	else if (tx_packets >
-		 (hdd_ctx->config->busBandwidthMediumThreshold / 2))
-		next_cons_bw = hdd_ctx->config->IpaMediumBandwidthMbps;
-	else
-		next_cons_bw = hdd_ctx->config->IpaLowBandwidthMbps;
-
-	if (rx_packets > (hdd_ctx->config->busBandwidthHighThreshold / 2))
-		next_prod_bw = hdd_ctx->config->IpaHighBandwidthMbps;
-	else if (rx_packets >
-		 (hdd_ctx->config->busBandwidthMediumThreshold / 2))
-		next_prod_bw = hdd_ctx->config->IpaMediumBandwidthMbps;
-	else
-		next_prod_bw = hdd_ctx->config->IpaLowBandwidthMbps;
-
-	HDD_IPA_LOG(LOG1,
-		"CONS perf curr: %d, next: %d",
-		hdd_ipa->curr_cons_bw, next_cons_bw);
-	HDD_IPA_LOG(LOG1,
-		"PROD perf curr: %d, next: %d",
-		hdd_ipa->curr_prod_bw, next_prod_bw);
-
-	if (hdd_ipa->curr_cons_bw != next_cons_bw) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			    "Requesting CONS perf curr: %d, next: %d",
-			    hdd_ipa->curr_cons_bw, next_cons_bw);
-		profile.max_supported_bandwidth_mbps = next_cons_bw;
-		ret = ipa_rm_set_perf_profile(IPA_RM_RESOURCE_WLAN_CONS,
-					      &profile);
-		if (ret) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				    "RM CONS set perf profile failed: %d", ret);
-
-			return ret;
-		}
-		hdd_ipa->curr_cons_bw = next_cons_bw;
-		hdd_ipa->stats.num_cons_perf_req++;
-	}
-
-	if (hdd_ipa->curr_prod_bw != next_prod_bw) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			    "Requesting PROD perf curr: %d, next: %d",
-			    hdd_ipa->curr_prod_bw, next_prod_bw);
-		profile.max_supported_bandwidth_mbps = next_prod_bw;
-		ret = ipa_rm_set_perf_profile(IPA_RM_RESOURCE_WLAN_PROD,
-					      &profile);
-		if (ret) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				    "RM PROD set perf profile failed: %d", ret);
-			return ret;
-		}
-		hdd_ipa->curr_prod_bw = next_prod_bw;
-		hdd_ipa->stats.num_prod_perf_req++;
-	}
-
-	return 0;
-}
-
-/**
- * hdd_ipa_init_uc_rm_work - init ipa uc resource manager work
- * @work: struct work_struct
- * @work_handler: work_handler
- *
- * Return: none
- */
-#ifdef CONFIG_CNSS
-static void  hdd_ipa_init_uc_rm_work(struct work_struct *work,
-					work_func_t work_handler)
-{
-	cnss_init_work(work, work_handler);
-}
-#else
-static void hdd_ipa_init_uc_rm_work(struct work_struct *work,
-					work_func_t work_handler)
-{
-	INIT_WORK(work, work_handler);
-}
-#endif
-
-/**
- * hdd_ipa_setup_rm() - Setup IPA resource management
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: 0 on success, negative errno on error
- */
-static int hdd_ipa_setup_rm(struct hdd_ipa_priv *hdd_ipa)
-{
-	struct ipa_rm_create_params create_params = { 0 };
-	int ret;
-
-	if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-		return 0;
-
-	hdd_ipa_init_uc_rm_work(&hdd_ipa->uc_rm_work.work,
-		hdd_ipa_uc_rm_notify_defer);
-	memset(&create_params, 0, sizeof(create_params));
-	create_params.name = IPA_RM_RESOURCE_WLAN_PROD;
-	create_params.reg_params.user_data = hdd_ipa;
-	create_params.reg_params.notify_cb = hdd_ipa_rm_notify;
-	create_params.floor_voltage = IPA_VOLTAGE_SVS;
-
-	ret = ipa_rm_create_resource(&create_params);
-	if (ret) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "Create RM resource failed: %d", ret);
-		goto setup_rm_fail;
-	}
-
-	memset(&create_params, 0, sizeof(create_params));
-	create_params.name = IPA_RM_RESOURCE_WLAN_CONS;
-	create_params.request_resource = hdd_ipa_rm_cons_request;
-	create_params.release_resource = hdd_ipa_rm_cons_release;
-	create_params.floor_voltage = IPA_VOLTAGE_SVS;
-
-	ret = ipa_rm_create_resource(&create_params);
-	if (ret) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "Create RM CONS resource failed: %d", ret);
-		goto delete_prod;
-	}
-
-	ipa_rm_add_dependency(IPA_RM_RESOURCE_WLAN_PROD,
-			      IPA_RM_RESOURCE_APPS_CONS);
-
-	ret = ipa_rm_inactivity_timer_init(IPA_RM_RESOURCE_WLAN_PROD,
-					   HDD_IPA_RX_INACTIVITY_MSEC_DELAY);
-	if (ret) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "Timer init failed: %d",
-			    ret);
-		goto timer_init_failed;
-	}
-
-	/* Set the lowest bandwidth to start with */
-	ret = hdd_ipa_set_perf_level(hdd_ipa->hdd_ctx, 0, 0);
-
-	if (ret) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "Set perf level failed: %d", ret);
-		goto set_perf_failed;
-	}
-
-	cdf_wake_lock_init(&hdd_ipa->wake_lock, "wlan_ipa");
-#ifdef CONFIG_CNSS
-	cnss_init_delayed_work(&hdd_ipa->wake_lock_work,
-			       hdd_ipa_wake_lock_timer_func);
-#else
-	INIT_DELAYED_WORK(&hdd_ipa->wake_lock_work,
-			  hdd_ipa_wake_lock_timer_func);
-#endif
-	cdf_spinlock_init(&hdd_ipa->rm_lock);
-	hdd_ipa->rm_state = HDD_IPA_RM_RELEASED;
-	hdd_ipa->wake_lock_released = true;
-	atomic_set(&hdd_ipa->tx_ref_cnt, 0);
-
-	return ret;
-
-set_perf_failed:
-	ipa_rm_inactivity_timer_destroy(IPA_RM_RESOURCE_WLAN_PROD);
-
-timer_init_failed:
-	ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_CONS);
-
-delete_prod:
-	ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_PROD);
-
-setup_rm_fail:
-	return ret;
-}
-
-/**
- * hdd_ipa_destroy_rm_resource() - Destroy IPA resources
- * @hdd_ipa: Global HDD IPA context
- *
- * Destroys all resources associated with the IPA resource manager
- *
- * Return: None
- */
-static void hdd_ipa_destroy_rm_resource(struct hdd_ipa_priv *hdd_ipa)
-{
-	int ret;
-
-	if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-		return;
-
-	cancel_delayed_work_sync(&hdd_ipa->wake_lock_work);
-	cdf_wake_lock_destroy(&hdd_ipa->wake_lock);
-
-#ifdef WLAN_OPEN_SOURCE
-	cancel_work_sync(&hdd_ipa->uc_rm_work.work);
-#endif
-	cdf_spinlock_destroy(&hdd_ipa->rm_lock);
-
-	ipa_rm_inactivity_timer_destroy(IPA_RM_RESOURCE_WLAN_PROD);
-
-	ret = ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_PROD);
-	if (ret)
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "RM PROD resource delete failed %d", ret);
-
-	ret = ipa_rm_delete_resource(IPA_RM_RESOURCE_WLAN_CONS);
-	if (ret)
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "RM CONS resource delete failed %d", ret);
-}
-
-/**
- * hdd_ipa_send_skb_to_network() - Send skb to kernel
- * @skb: network buffer
- * @adapter: network adapter
- *
- * Called when a network buffer is received which should not be routed
- * to the IPA module.
- *
- * Return: None
- */
-static void hdd_ipa_send_skb_to_network(cdf_nbuf_t skb,
-	hdd_adapter_t *adapter)
-{
-	struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
-	unsigned int cpu_index;
-
-	if (!adapter || adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO_LOW, "Invalid adapter: 0x%p",
-			    adapter);
-		HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
-		cdf_nbuf_free(skb);
-		return;
-	}
-
-	if (cds_is_driver_unloading()) {
-		HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
-		cdf_nbuf_free(skb);
-		return;
-	}
-
-	skb->destructor = hdd_ipa_uc_rt_debug_destructor;
-	skb->dev = adapter->dev;
-	skb->protocol = eth_type_trans(skb, skb->dev);
-	skb->ip_summed = CHECKSUM_NONE;
-
-	cpu_index = wlan_hdd_get_cpu();
-
-	++adapter->hdd_stats.hddTxRxStats.rxPackets[cpu_index];
-	if (netif_rx_ni(skb) == NET_RX_SUCCESS)
-		++adapter->hdd_stats.hddTxRxStats.rxDelivered[cpu_index];
-	else
-		++adapter->hdd_stats.hddTxRxStats.rxRefused[cpu_index];
-
-	HDD_IPA_INCREASE_NET_SEND_COUNT(hdd_ipa);
-	adapter->dev->last_rx = jiffies;
-}
-
-/**
- * hdd_ipa_w2i_cb() - WLAN to IPA callback handler
- * @priv: pointer to private data registered with IPA (we register a
- *	pointer to the global IPA context)
- * @evt: the IPA event which triggered the callback
- * @data: data associated with the event
- *
- * Return: None
- */
-static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
-			   unsigned long data)
-{
-	struct hdd_ipa_priv *hdd_ipa = NULL;
-	hdd_adapter_t *adapter = NULL;
-	cdf_nbuf_t skb;
-	uint8_t iface_id;
-	uint8_t session_id;
-	struct hdd_ipa_iface_context *iface_context;
-	cdf_nbuf_t copy;
-	uint8_t fw_desc;
-	int ret;
-
-	hdd_ipa = (struct hdd_ipa_priv *)priv;
-
-	switch (evt) {
-	case IPA_RECEIVE:
-		skb = (cdf_nbuf_t) data;
-		if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			session_id = (uint8_t)skb->cb[0];
-			iface_id = vdev_to_iface[session_id];
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO_HIGH,
-				"IPA_RECEIVE: session_id=%u, iface_id=%u",
-				session_id, iface_id);
-		} else {
-			iface_id = HDD_IPA_GET_IFACE_ID(skb->data);
-		}
-
-		if (iface_id >= HDD_IPA_MAX_IFACE) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				    "IPA_RECEIVE: Invalid iface_id: %u",
-				    iface_id);
-			HDD_IPA_DBG_DUMP(CDF_TRACE_LEVEL_INFO_HIGH,
-				"w2i -- skb", skb->data, 8);
-			HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
-			cdf_nbuf_free(skb);
-			return;
-		}
-
-		iface_context = &hdd_ipa->iface_context[iface_id];
-		adapter = iface_context->adapter;
-
-		HDD_IPA_DBG_DUMP(CDF_TRACE_LEVEL_DEBUG,
-				"w2i -- skb", skb->data, 8);
-		if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			hdd_ipa->stats.num_rx_excep++;
-			skb_pull(skb, HDD_IPA_UC_WLAN_CLD_HDR_LEN);
-		} else {
-			skb_pull(skb, HDD_IPA_WLAN_CLD_HDR_LEN);
-		}
-
-		iface_context->stats.num_rx_ipa_excep++;
-
-		/* Disable to forward Intra-BSS Rx packets when
-		 * ap_isolate=1 in hostapd.conf
-		 */
-		if (adapter->sessionCtx.ap.apDisableIntraBssFwd) {
-			/*
-			 * When INTRA_BSS_FWD_OFFLOAD is enabled, FW will send
-			 * all Rx packets to IPA uC, which need to be forwarded
-			 * to other interface.
-			 * And, IPA driver will send back to WLAN host driver
-			 * through exception pipe with fw_desc field set by FW.
-			 * Here we are checking fw_desc field for FORWARD bit
-			 * set, and forward to Tx. Then copy to kernel stack
-			 * only when DISCARD bit is not set.
-			 */
-			fw_desc = (uint8_t)skb->cb[1];
-
-			if (fw_desc & HDD_IPA_FW_RX_DESC_FORWARD_M) {
-				HDD_IPA_LOG(
-					CDF_TRACE_LEVEL_DEBUG,
-					"Forward packet to Tx (fw_desc=%d)",
-					fw_desc);
-				copy = cdf_nbuf_copy(skb);
-				if (copy) {
-					hdd_ipa->ipa_tx_forward++;
-					ret = hdd_softap_hard_start_xmit(
-						(struct sk_buff *)copy,
-						adapter->dev);
-					if (ret) {
-						HDD_IPA_LOG(
-							CDF_TRACE_LEVEL_DEBUG,
-							"Forward packet tx fail");
-						hdd_ipa->stats.
-							num_tx_bcmc_err++;
-					} else {
-						hdd_ipa->stats.num_tx_bcmc++;
-					}
-				}
-			}
-
-			if (fw_desc & HDD_IPA_FW_RX_DESC_DISCARD_M) {
-				HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
-				hdd_ipa->ipa_rx_discard++;
-				cdf_nbuf_free(skb);
-				break;
-			}
-
-		} else {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO_HIGH,
-				"Intra-BSS FWD is disabled-skip forward to Tx");
-		}
-
-		hdd_ipa_send_skb_to_network(skb, adapter);
-		break;
-
-	default:
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "w2i cb wrong event: 0x%x", evt);
-		return;
-	}
-}
-
-/**
- * hdd_ipa_nbuf_cb() - IPA TX complete callback
- * @skb: packet buffer which was transmitted
- *
- * Return: None
- */
-static void hdd_ipa_nbuf_cb(cdf_nbuf_t skb)
-{
-	struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_DEBUG, "%lx", NBUF_OWNER_PRIV_DATA(skb));
-	ipa_free_skb((struct ipa_rx_data *)NBUF_OWNER_PRIV_DATA(skb));
-
-	hdd_ipa->stats.num_tx_comp_cnt++;
-
-	atomic_dec(&hdd_ipa->tx_ref_cnt);
-
-	hdd_ipa_rm_try_release(hdd_ipa);
-}
-
-/**
- * hdd_ipa_send_pkt_to_tl() - Send an IPA packet to TL
- * @iface_context: interface-specific IPA context
- * @ipa_tx_desc: packet data descriptor
- *
- * Return: None
- */
-static void hdd_ipa_send_pkt_to_tl(
-		struct hdd_ipa_iface_context *iface_context,
-		struct ipa_rx_data *ipa_tx_desc)
-{
-	struct hdd_ipa_priv *hdd_ipa = iface_context->hdd_ipa;
-	uint8_t interface_id;
-	hdd_adapter_t *adapter = NULL;
-	cdf_nbuf_t skb;
-
-	cdf_spin_lock_bh(&iface_context->interface_lock);
-	adapter = iface_context->adapter;
-	if (!adapter) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_WARN, "Interface Down");
-		ipa_free_skb(ipa_tx_desc);
-		iface_context->stats.num_tx_drop++;
-		cdf_spin_unlock_bh(&iface_context->interface_lock);
-		hdd_ipa_rm_try_release(hdd_ipa);
-		return;
-	}
-
-	/*
-	 * During CAC period, data packets shouldn't be sent over the air so
-	 * drop all the packets here
-	 */
-	if (WLAN_HDD_GET_AP_CTX_PTR(adapter)->dfs_cac_block_tx) {
-		ipa_free_skb(ipa_tx_desc);
-		cdf_spin_unlock_bh(&iface_context->interface_lock);
-		iface_context->stats.num_tx_cac_drop++;
-		hdd_ipa_rm_try_release(hdd_ipa);
-		return;
-	}
-
-	interface_id = adapter->sessionId;
-	++adapter->stats.tx_packets;
-
-	cdf_spin_unlock_bh(&iface_context->interface_lock);
-
-	skb = ipa_tx_desc->skb;
-
-	cdf_mem_set(skb->cb, sizeof(skb->cb), 0);
-	NBUF_OWNER_ID(skb) = IPA_NBUF_OWNER_ID;
-	NBUF_CALLBACK_FN(skb) = hdd_ipa_nbuf_cb;
-	if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
-		NBUF_MAPPED_PADDR_LO(skb) = ipa_tx_desc->dma_addr
-			+ HDD_IPA_WLAN_FRAG_HEADER
-			+ HDD_IPA_WLAN_IPA_HEADER;
-		ipa_tx_desc->skb->len -=
-			HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_IPA_HEADER;
-	} else
-		NBUF_MAPPED_PADDR_LO(skb) = ipa_tx_desc->dma_addr;
-
-	NBUF_OWNER_PRIV_DATA(skb) = (unsigned long)ipa_tx_desc;
-
-	adapter->stats.tx_bytes += ipa_tx_desc->skb->len;
-
-	skb = ol_tx_send_ipa_data_frame(iface_context->tl_context,
-					 ipa_tx_desc->skb);
-	if (skb) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_DEBUG, "TLSHIM tx fail");
-		ipa_free_skb(ipa_tx_desc);
-		iface_context->stats.num_tx_err++;
-		hdd_ipa_rm_try_release(hdd_ipa);
-		return;
-	}
-
-	atomic_inc(&hdd_ipa->tx_ref_cnt);
-
-	iface_context->stats.num_tx++;
-
-}
-
-/**
- * hdd_ipa_pm_send_pkt_to_tl() - Send queued packets to TL
- * @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_send_pkt_to_tl(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;
-	cdf_nbuf_t skb;
-	uint32_t dequeued = 0;
-
-	cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-
-	while (((skb = cdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) != NULL)) {
-		cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-
-		pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb;
-
-		dequeued++;
-
-		hdd_ipa_send_pkt_to_tl(pm_tx_cb->iface_context,
-				       pm_tx_cb->ipa_tx_desc);
-
-		cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-	}
-
-	cdf_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;
-}
-
-/**
- * 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)
- * @evt: the IPA event which triggered the callback
- * @data: data associated with the event
- *
- * Return: None
- */
-static void hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
-			   unsigned long data)
-{
-	struct hdd_ipa_priv *hdd_ipa = NULL;
-	struct ipa_rx_data *ipa_tx_desc;
-	struct hdd_ipa_iface_context *iface_context;
-	cdf_nbuf_t skb;
-	struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	iface_context = (struct hdd_ipa_iface_context *)priv;
-	if (evt != IPA_RECEIVE) {
-		skb = (cdf_nbuf_t) data;
-		dev_kfree_skb_any(skb);
-		iface_context->stats.num_tx_drop++;
-		return;
-	}
-
-	ipa_tx_desc = (struct ipa_rx_data *)data;
-
-	hdd_ipa = iface_context->hdd_ipa;
-
-	/*
-	 * When SSR is going on or driver is unloading, just drop the packets.
-	 * During SSR, there is no use in queueing the packets as STA has to
-	 * connect back any way
-	 */
-	status = wlan_hdd_validate_context(hdd_ipa->hdd_ctx);
-	if (0 != status) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "HDD context is not valid");
-		ipa_free_skb(ipa_tx_desc);
-		iface_context->stats.num_tx_drop++;
-		return;
-	}
-
-	skb = ipa_tx_desc->skb;
-
-	HDD_IPA_DBG_DUMP(CDF_TRACE_LEVEL_DEBUG, "i2w", skb->data, 8);
-
-	/*
-	 * If PROD resource is not requested here then there may be cases where
-	 * IPA hardware may be clocked down because of not having proper
-	 * dependency graph between WLAN CONS and modem PROD pipes. Adding the
-	 * workaround to request PROD resource while data is going over CONS
-	 * pipe to prevent the IPA hardware clockdown.
-	 */
-	hdd_ipa_rm_request(hdd_ipa);
-
-	cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-	/*
-	 * If host is still suspended then queue the packets and these will be
-	 * drained later when resume completes. When packet is arrived here and
-	 * host is suspended, this means that there is already resume is in
-	 * progress.
-	 */
-	if (hdd_ipa->suspended) {
-		cdf_mem_set(skb->cb, sizeof(skb->cb), 0);
-		pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb;
-		pm_tx_cb->iface_context = iface_context;
-		pm_tx_cb->ipa_tx_desc = ipa_tx_desc;
-		cdf_nbuf_queue_add(&hdd_ipa->pm_queue_head, skb);
-		hdd_ipa->stats.num_tx_queued++;
-
-		cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-		return;
-	}
-
-	cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-
-	/*
-	 * If we are here means, host is not suspended, wait for the work queue
-	 * to finish.
-	 */
-#ifdef WLAN_OPEN_SOURCE
-	flush_work(&hdd_ipa->pm_work);
-#endif
-
-	return hdd_ipa_send_pkt_to_tl(iface_context, ipa_tx_desc);
-}
-
-/**
- * hdd_ipa_suspend() - Suspend IPA
- * @hdd_ctx: Global HDD context
- *
- * Return: 0 on success, negativer errno on error
- */
-int hdd_ipa_suspend(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa = hdd_ctx->hdd_ipa;
-
-	if (!hdd_ipa_is_enabled(hdd_ctx))
-		return 0;
-
-	/*
-	 * Check if IPA is ready for suspend, If we are here means, there is
-	 * high chance that suspend would go through but just to avoid any race
-	 * condition after suspend started, these checks are conducted before
-	 * allowing to suspend.
-	 */
-	if (atomic_read(&hdd_ipa->tx_ref_cnt))
-		return -EAGAIN;
-
-	cdf_spin_lock_bh(&hdd_ipa->rm_lock);
-
-	if (hdd_ipa->rm_state != HDD_IPA_RM_RELEASED) {
-		cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-		return -EAGAIN;
-	}
-	cdf_spin_unlock_bh(&hdd_ipa->rm_lock);
-
-	cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-	hdd_ipa->suspended = true;
-	cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-
-	return 0;
-}
-
-/**
- * hdd_ipa_resume() - Resume IPA following suspend
- * hdd_ctx: Global HDD context
- *
- * Return: 0 on success, negative errno on error
- */
-int hdd_ipa_resume(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa = hdd_ctx->hdd_ipa;
-
-	if (!hdd_ipa_is_enabled(hdd_ctx))
-		return 0;
-
-	schedule_work(&hdd_ipa->pm_work);
-
-	cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-	hdd_ipa->suspended = false;
-	cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-
-	return 0;
-}
-
-/**
- * hdd_ipa_setup_sys_pipe() - Setup all IPA Sys pipes
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: 0 on success, negative errno on error
- */
-static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
-{
-	int i, ret = 0;
-	struct ipa_sys_connect_params *ipa;
-	uint32_t desc_fifo_sz;
-
-	/* The maximum number of descriptors that can be provided to a BAM at
-	 * once is one less than the total number of descriptors that the buffer
-	 * can contain.
-	 * If max_num_of_descriptors = (BAM_PIPE_DESCRIPTOR_FIFO_SIZE / sizeof
-	 * (SPS_DESCRIPTOR)), then (max_num_of_descriptors - 1) descriptors can
-	 * be provided at once.
-	 * Because of above requirement, one extra descriptor will be added to
-	 * make sure hardware always has one descriptor.
-	 */
-	desc_fifo_sz = hdd_ipa->hdd_ctx->config->IpaDescSize
-		       + sizeof(struct sps_iovec);
-
-	/*setup TX pipes */
-	for (i = 0; i < HDD_IPA_MAX_IFACE; i++) {
-		ipa = &hdd_ipa->sys_pipe[i].ipa_sys_params;
-
-		ipa->client = hdd_ipa_adapter_2_client[i].cons_client;
-		ipa->desc_fifo_sz = desc_fifo_sz;
-		ipa->priv = &hdd_ipa->iface_context[i];
-		ipa->notify = hdd_ipa_i2w_cb;
-
-		if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
-			ipa->ipa_ep_cfg.hdr.hdr_len =
-				HDD_IPA_UC_WLAN_TX_HDR_LEN;
-			ipa->ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
-			ipa->ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid = 1;
-			ipa->ipa_ep_cfg.hdr.hdr_ofst_pkt_size = 0;
-			ipa->ipa_ep_cfg.hdr.hdr_additional_const_len =
-				HDD_IPA_UC_WLAN_8023_HDR_SIZE;
-			ipa->ipa_ep_cfg.hdr_ext.hdr_little_endian = true;
-		} else {
-			ipa->ipa_ep_cfg.hdr.hdr_len = HDD_IPA_WLAN_TX_HDR_LEN;
-		}
-		ipa->ipa_ep_cfg.mode.mode = IPA_BASIC;
-
-		if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-			ipa->keep_ipa_awake = 1;
-
-		ret = ipa_setup_sys_pipe(ipa, &(hdd_ipa->sys_pipe[i].conn_hdl));
-		if (ret) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "Failed for pipe %d"
-				    " ret: %d", i, ret);
-			goto setup_sys_pipe_fail;
-		}
-		hdd_ipa->sys_pipe[i].conn_hdl_valid = 1;
-	}
-
-	if (!hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
-		/*
-		 * Hard code it here, this can be extended if in case
-		 * PROD pipe is also per interface.
-		 * Right now there is no advantage of doing this.
-		 */
-		hdd_ipa->prod_client = IPA_CLIENT_WLAN1_PROD;
-
-		ipa = &hdd_ipa->sys_pipe[HDD_IPA_RX_PIPE].ipa_sys_params;
-
-		ipa->client = hdd_ipa->prod_client;
-
-		ipa->desc_fifo_sz = desc_fifo_sz;
-		ipa->priv = hdd_ipa;
-		ipa->notify = hdd_ipa_w2i_cb;
-
-		ipa->ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
-		ipa->ipa_ep_cfg.hdr.hdr_len = HDD_IPA_WLAN_RX_HDR_LEN;
-		ipa->ipa_ep_cfg.hdr.hdr_ofst_metadata_valid = 1;
-		ipa->ipa_ep_cfg.mode.mode = IPA_BASIC;
-
-		if (!hdd_ipa_is_rm_enabled(hdd_ipa->hdd_ctx))
-			ipa->keep_ipa_awake = 1;
-
-		ret = ipa_setup_sys_pipe(ipa, &(hdd_ipa->sys_pipe[i].conn_hdl));
-		if (ret) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-					"Failed for RX pipe: %d", ret);
-			goto setup_sys_pipe_fail;
-		}
-		hdd_ipa->sys_pipe[HDD_IPA_RX_PIPE].conn_hdl_valid = 1;
-	}
-
-	return ret;
-
-setup_sys_pipe_fail:
-
-	while (--i >= 0) {
-		ipa_teardown_sys_pipe(hdd_ipa->sys_pipe[i].conn_hdl);
-		cdf_mem_zero(&hdd_ipa->sys_pipe[i],
-			     sizeof(struct hdd_ipa_sys_pipe));
-	}
-
-	return ret;
-}
-
-/**
- * hdd_ipa_teardown_sys_pipe() - Tear down all IPA Sys pipes
- * @hdd_ipa: Global HDD IPA context
- *
- * Return: None
- */
-static void hdd_ipa_teardown_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
-{
-	int ret = 0, i;
-	for (i = 0; i < HDD_IPA_MAX_SYSBAM_PIPE; i++) {
-		if (hdd_ipa->sys_pipe[i].conn_hdl_valid) {
-			ret =
-				ipa_teardown_sys_pipe(hdd_ipa->sys_pipe[i].
-						      conn_hdl);
-			if (ret)
-				HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "Failed: %d",
-					    ret);
-
-			hdd_ipa->sys_pipe[i].conn_hdl_valid = 0;
-		}
-	}
-}
-
-/**
- * hdd_ipa_register_interface() - register IPA interface
- * @hdd_ipa: Global IPA context
- * @iface_context: Per-interface IPA context
- *
- * Return: 0 on success, negative errno on error
- */
-static int hdd_ipa_register_interface(struct hdd_ipa_priv *hdd_ipa,
-				      struct hdd_ipa_iface_context
-				      *iface_context)
-{
-	struct ipa_tx_intf tx_intf;
-	struct ipa_rx_intf rx_intf;
-	struct ipa_ioc_tx_intf_prop *tx_prop = NULL;
-	struct ipa_ioc_rx_intf_prop *rx_prop = NULL;
-	char *ifname = iface_context->adapter->dev->name;
-
-	char ipv4_hdr_name[IPA_RESOURCE_NAME_MAX];
-	char ipv6_hdr_name[IPA_RESOURCE_NAME_MAX];
-
-	int num_prop = 1;
-	int ret = 0;
-
-	if (hdd_ipa_is_ipv6_enabled(hdd_ipa->hdd_ctx))
-		num_prop++;
-
-	/* Allocate TX properties for TOS categories, 1 each for IPv4 & IPv6 */
-	tx_prop =
-		cdf_mem_malloc(sizeof(struct ipa_ioc_tx_intf_prop) * num_prop);
-	if (!tx_prop) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "tx_prop allocation failed");
-		goto register_interface_fail;
-	}
-
-	/* Allocate RX properties, 1 each for IPv4 & IPv6 */
-	rx_prop =
-		cdf_mem_malloc(sizeof(struct ipa_ioc_rx_intf_prop) * num_prop);
-	if (!rx_prop) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "rx_prop allocation failed");
-		goto register_interface_fail;
-	}
-
-	cdf_mem_zero(&tx_intf, sizeof(tx_intf));
-	cdf_mem_zero(&rx_intf, sizeof(rx_intf));
-
-	snprintf(ipv4_hdr_name, IPA_RESOURCE_NAME_MAX, "%s%s",
-		 ifname, HDD_IPA_IPV4_NAME_EXT);
-	snprintf(ipv6_hdr_name, IPA_RESOURCE_NAME_MAX, "%s%s",
-		 ifname, HDD_IPA_IPV6_NAME_EXT);
-
-	rx_prop[IPA_IP_v4].ip = IPA_IP_v4;
-	rx_prop[IPA_IP_v4].src_pipe = iface_context->prod_client;
-	rx_prop[IPA_IP_v4].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
-	rx_prop[IPA_IP_v4].attrib.attrib_mask = IPA_FLT_META_DATA;
-
-	/*
-	 * Interface ID is 3rd byte in the CLD header. Add the meta data and
-	 * mask to identify the interface in IPA hardware
-	 */
-	rx_prop[IPA_IP_v4].attrib.meta_data =
-		htonl(iface_context->adapter->sessionId << 16);
-	rx_prop[IPA_IP_v4].attrib.meta_data_mask = htonl(0x00FF0000);
-
-	rx_intf.num_props++;
-	if (hdd_ipa_is_ipv6_enabled(hdd_ipa->hdd_ctx)) {
-		rx_prop[IPA_IP_v6].ip = IPA_IP_v6;
-		rx_prop[IPA_IP_v6].src_pipe = iface_context->prod_client;
-		rx_prop[IPA_IP_v6].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
-		rx_prop[IPA_IP_v4].attrib.attrib_mask = IPA_FLT_META_DATA;
-		rx_prop[IPA_IP_v4].attrib.meta_data =
-			htonl(iface_context->adapter->sessionId << 16);
-		rx_prop[IPA_IP_v4].attrib.meta_data_mask = htonl(0x00FF0000);
-
-		rx_intf.num_props++;
-	}
-
-	tx_prop[IPA_IP_v4].ip = IPA_IP_v4;
-	tx_prop[IPA_IP_v4].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
-	tx_prop[IPA_IP_v4].dst_pipe = IPA_CLIENT_WLAN1_CONS;
-	tx_prop[IPA_IP_v4].alt_dst_pipe = iface_context->cons_client;
-	strlcpy(tx_prop[IPA_IP_v4].hdr_name, ipv4_hdr_name,
-			IPA_RESOURCE_NAME_MAX);
-	tx_intf.num_props++;
-
-	if (hdd_ipa_is_ipv6_enabled(hdd_ipa->hdd_ctx)) {
-		tx_prop[IPA_IP_v6].ip = IPA_IP_v6;
-		tx_prop[IPA_IP_v6].hdr_l2_type = IPA_HDR_L2_ETHERNET_II;
-		tx_prop[IPA_IP_v6].dst_pipe = IPA_CLIENT_WLAN1_CONS;
-		tx_prop[IPA_IP_v6].alt_dst_pipe = iface_context->cons_client;
-		strlcpy(tx_prop[IPA_IP_v6].hdr_name, ipv6_hdr_name,
-				IPA_RESOURCE_NAME_MAX);
-		tx_intf.num_props++;
-	}
-
-	tx_intf.prop = tx_prop;
-	rx_intf.prop = rx_prop;
-
-	/* Call the ipa api to register interface */
-	ret = ipa_register_intf(ifname, &tx_intf, &rx_intf);
-
-register_interface_fail:
-	cdf_mem_free(tx_prop);
-	cdf_mem_free(rx_prop);
-	return ret;
-}
-
-/**
- * hdd_remove_ipa_header() - Remove a specific header from IPA
- * @name: Name of the header to be removed
- *
- * Return: None
- */
-static void hdd_ipa_remove_header(char *name)
-{
-	struct ipa_ioc_get_hdr hdrlookup;
-	int ret = 0, len;
-	struct ipa_ioc_del_hdr *ipa_hdr;
-
-	cdf_mem_zero(&hdrlookup, sizeof(hdrlookup));
-	strlcpy(hdrlookup.name, name, sizeof(hdrlookup.name));
-	ret = ipa_get_hdr(&hdrlookup);
-	if (ret) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "Hdr deleted already %s, %d",
-			    name, ret);
-		return;
-	}
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "hdl: 0x%x", hdrlookup.hdl);
-	len = sizeof(struct ipa_ioc_del_hdr) + sizeof(struct ipa_hdr_del) * 1;
-	ipa_hdr = (struct ipa_ioc_del_hdr *)cdf_mem_malloc(len);
-	if (ipa_hdr == NULL) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "ipa_hdr allocation failed");
-		return;
-	}
-	ipa_hdr->num_hdls = 1;
-	ipa_hdr->commit = 0;
-	ipa_hdr->hdl[0].hdl = hdrlookup.hdl;
-	ipa_hdr->hdl[0].status = -1;
-	ret = ipa_del_hdr(ipa_hdr);
-	if (ret != 0)
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "Delete header failed: %d",
-			    ret);
-
-	cdf_mem_free(ipa_hdr);
-}
-
-/**
- * hdd_ipa_add_header_info() - Add IPA header for a given interface
- * @hdd_ipa: Global HDD IPA context
- * @iface_context: Interface-specific HDD IPA context
- * @mac_addr: Interface MAC address
- *
- * Return: 0 on success, negativer errno value on error
- */
-static int hdd_ipa_add_header_info(struct hdd_ipa_priv *hdd_ipa,
-				   struct hdd_ipa_iface_context *iface_context,
-				   uint8_t *mac_addr)
-{
-	hdd_adapter_t *adapter = iface_context->adapter;
-	char *ifname;
-	struct ipa_ioc_add_hdr *ipa_hdr = NULL;
-	int ret = -EINVAL;
-	struct hdd_ipa_tx_hdr *tx_hdr = NULL;
-	struct hdd_ipa_uc_tx_hdr *uc_tx_hdr = NULL;
-
-	ifname = adapter->dev->name;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "Add Partial hdr: %s, %pM",
-		    ifname, mac_addr);
-
-	/* dynamically allocate the memory to add the hdrs */
-	ipa_hdr = cdf_mem_malloc(sizeof(struct ipa_ioc_add_hdr)
-				 + sizeof(struct ipa_hdr_add));
-	if (!ipa_hdr) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "%s: ipa_hdr allocation failed", ifname);
-		ret = -ENOMEM;
-		goto end;
-	}
-
-	ipa_hdr->commit = 0;
-	ipa_hdr->num_hdrs = 1;
-
-	if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-		uc_tx_hdr = (struct hdd_ipa_uc_tx_hdr *)ipa_hdr->hdr[0].hdr;
-		memcpy(uc_tx_hdr, &ipa_uc_tx_hdr, HDD_IPA_UC_WLAN_TX_HDR_LEN);
-		memcpy(uc_tx_hdr->eth.h_source, mac_addr, ETH_ALEN);
-		uc_tx_hdr->ipa_hd.vdev_id = iface_context->adapter->sessionId;
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_DEBUG,
-			"ifname=%s, vdev_id=%d",
-			ifname, uc_tx_hdr->ipa_hd.vdev_id);
-		snprintf(ipa_hdr->hdr[0].name, IPA_RESOURCE_NAME_MAX, "%s%s",
-				ifname, HDD_IPA_IPV4_NAME_EXT);
-		ipa_hdr->hdr[0].hdr_len = HDD_IPA_UC_WLAN_TX_HDR_LEN;
-		ipa_hdr->hdr[0].type = IPA_HDR_L2_ETHERNET_II;
-		ipa_hdr->hdr[0].is_partial = 1;
-		ipa_hdr->hdr[0].hdr_hdl = 0;
-		ipa_hdr->hdr[0].is_eth2_ofst_valid = 1;
-		ipa_hdr->hdr[0].eth2_ofst = HDD_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
-
-		ret = ipa_add_hdr(ipa_hdr);
-	} else {
-		tx_hdr = (struct hdd_ipa_tx_hdr *)ipa_hdr->hdr[0].hdr;
-
-		/* Set the Source MAC */
-		memcpy(tx_hdr, &ipa_tx_hdr, HDD_IPA_WLAN_TX_HDR_LEN);
-		memcpy(tx_hdr->eth.h_source, mac_addr, ETH_ALEN);
-
-		snprintf(ipa_hdr->hdr[0].name, IPA_RESOURCE_NAME_MAX, "%s%s",
-				ifname, HDD_IPA_IPV4_NAME_EXT);
-		ipa_hdr->hdr[0].hdr_len = HDD_IPA_WLAN_TX_HDR_LEN;
-		ipa_hdr->hdr[0].is_partial = 1;
-		ipa_hdr->hdr[0].hdr_hdl = 0;
-		ipa_hdr->hdr[0].is_eth2_ofst_valid = 1;
-		ipa_hdr->hdr[0].eth2_ofst = HDD_IPA_WLAN_HDR_DES_MAC_OFFSET;
-
-		/* Set the type to IPV4 in the header */
-		tx_hdr->llc_snap.eth_type = cpu_to_be16(ETH_P_IP);
-
-		ret = ipa_add_hdr(ipa_hdr);
-	}
-	if (ret) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "%s IPv4 add hdr failed: %d",
-			    ifname, ret);
-		goto end;
-	}
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: IPv4 hdr_hdl: 0x%x",
-		    ipa_hdr->hdr[0].name, ipa_hdr->hdr[0].hdr_hdl);
-
-	if (hdd_ipa_is_ipv6_enabled(hdd_ipa->hdd_ctx)) {
-		snprintf(ipa_hdr->hdr[0].name, IPA_RESOURCE_NAME_MAX, "%s%s",
-			 ifname, HDD_IPA_IPV6_NAME_EXT);
-
-		if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			uc_tx_hdr =
-				(struct hdd_ipa_uc_tx_hdr *)ipa_hdr->hdr[0].hdr;
-			uc_tx_hdr->eth.h_proto = cpu_to_be16(ETH_P_IPV6);
-		} else {
-			/* Set the type to IPV6 in the header */
-			tx_hdr = (struct hdd_ipa_tx_hdr *)ipa_hdr->hdr[0].hdr;
-			tx_hdr->llc_snap.eth_type = cpu_to_be16(ETH_P_IPV6);
-		}
-
-		ret = ipa_add_hdr(ipa_hdr);
-		if (ret) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				    "%s: IPv6 add hdr failed: %d", ifname, ret);
-			goto clean_ipv4_hdr;
-		}
-
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: IPv6 hdr_hdl: 0x%x",
-			    ipa_hdr->hdr[0].name, ipa_hdr->hdr[0].hdr_hdl);
-	}
-
-	cdf_mem_free(ipa_hdr);
-
-	return ret;
-
-clean_ipv4_hdr:
-	snprintf(ipa_hdr->hdr[0].name, IPA_RESOURCE_NAME_MAX, "%s%s",
-		 ifname, HDD_IPA_IPV4_NAME_EXT);
-	hdd_ipa_remove_header(ipa_hdr->hdr[0].name);
-end:
-	if (ipa_hdr)
-		cdf_mem_free(ipa_hdr);
-
-	return ret;
-}
-
-/**
- * hdd_ipa_clean_hdr() - Cleanup IPA on a given adapter
- * @adapter: Adapter upon which IPA was previously configured
- *
- * Return: None
- */
-static void hdd_ipa_clean_hdr(hdd_adapter_t *adapter)
-{
-	struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
-	int ret;
-	char name_ipa[IPA_RESOURCE_NAME_MAX];
-
-	/* Remove the headers */
-	snprintf(name_ipa, IPA_RESOURCE_NAME_MAX, "%s%s",
-		 adapter->dev->name, HDD_IPA_IPV4_NAME_EXT);
-	hdd_ipa_remove_header(name_ipa);
-
-	if (hdd_ipa_is_ipv6_enabled(hdd_ipa->hdd_ctx)) {
-		snprintf(name_ipa, IPA_RESOURCE_NAME_MAX, "%s%s",
-			 adapter->dev->name, HDD_IPA_IPV6_NAME_EXT);
-		hdd_ipa_remove_header(name_ipa);
-	}
-	/* unregister the interface with IPA */
-	ret = ipa_deregister_intf(adapter->dev->name);
-	if (ret)
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			    "%s: ipa_deregister_intf fail: %d",
-			    adapter->dev->name, ret);
-}
-
-/**
- * hdd_ipa_cleanup_iface() - Cleanup IPA on a given interface
- * @iface_context: interface-specific IPA context
- *
- * Return: None
- */
-static void hdd_ipa_cleanup_iface(struct hdd_ipa_iface_context *iface_context)
-{
-	if (iface_context == NULL)
-		return;
-
-	hdd_ipa_clean_hdr(iface_context->adapter);
-
-	cdf_spin_lock_bh(&iface_context->interface_lock);
-	iface_context->adapter->ipa_context = NULL;
-	iface_context->adapter = NULL;
-	iface_context->tl_context = NULL;
-	cdf_spin_unlock_bh(&iface_context->interface_lock);
-	iface_context->ifa_address = 0;
-	if (!iface_context->hdd_ipa->num_iface) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			"NUM INTF 0, Invalid");
-		CDF_ASSERT(0);
-	}
-	iface_context->hdd_ipa->num_iface--;
-}
-
-/**
- * hdd_ipa_setup_iface() - Setup IPA on a given interface
- * @hdd_ipa: HDD IPA global context
- * @adapter: Interface upon which IPA is being setup
- * @sta_id: Station ID of the API instance
- *
- * Return: 0 on success, negative errno value on error
- */
-static int hdd_ipa_setup_iface(struct hdd_ipa_priv *hdd_ipa,
-			       hdd_adapter_t *adapter, uint8_t sta_id)
-{
-	struct hdd_ipa_iface_context *iface_context = NULL;
-	void *tl_context = NULL;
-	int i, ret = 0;
-
-	/* Lower layer may send multiple START_BSS_EVENT in DFS mode or during
-	 * channel change indication. Since these indications are sent by lower
-	 * layer as SAP updates and IPA doesn't have to do anything for these
-	 * updates so ignoring!
-	 */
-	if (WLAN_HDD_SOFTAP == adapter->device_mode && adapter->ipa_context)
-		return 0;
-
-	for (i = 0; i < HDD_IPA_MAX_IFACE; i++) {
-		if (hdd_ipa->iface_context[i].adapter == NULL) {
-			iface_context = &(hdd_ipa->iface_context[i]);
-			break;
-		}
-	}
-
-	if (iface_context == NULL) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "All the IPA interfaces are in use");
-		ret = -ENOMEM;
-		goto end;
-	}
-
-	adapter->ipa_context = iface_context;
-	iface_context->adapter = adapter;
-	iface_context->sta_id = sta_id;
-	tl_context = ol_txrx_get_vdev_by_sta_id(sta_id);
-
-	if (tl_context == NULL) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "Not able to get TL context sta_id: %d", sta_id);
-		ret = -EINVAL;
-		goto end;
-	}
-
-	iface_context->tl_context = tl_context;
-
-	ret = hdd_ipa_add_header_info(hdd_ipa, iface_context,
-				      adapter->dev->dev_addr);
-
-	if (ret)
-		goto end;
-
-	/* Configure the TX and RX pipes filter rules */
-	ret = hdd_ipa_register_interface(hdd_ipa, iface_context);
-	if (ret)
-		goto cleanup_header;
-
-	hdd_ipa->num_iface++;
-	return ret;
-
-cleanup_header:
-
-	hdd_ipa_clean_hdr(adapter);
-end:
-	if (iface_context)
-		hdd_ipa_cleanup_iface(iface_context);
-	return ret;
-}
-
-/**
- * hdd_ipa_msg_free_fn() - Free an IPA message
- * @buff: pointer to the IPA message
- * @len: length of the IPA message
- * @type: type of IPA message
- *
- * Return: None
- */
-static void hdd_ipa_msg_free_fn(void *buff, uint32_t len, uint32_t type)
-{
-	hddLog(LOG1, "msg type:%d, len:%d", type, len);
-	ghdd_ipa->stats.num_free_msg++;
-	cdf_mem_free(buff);
-}
-
-/**
- * hdd_ipa_send_mcc_scc_msg() - send IPA WLAN_SWITCH_TO_MCC/SCC message
- * @mcc_mode: 0=MCC/1=SCC
- *
- * Return: 0 on success, negative errno value on error
- */
-int hdd_ipa_send_mcc_scc_msg(hdd_context_t *pHddCtx, bool mcc_mode)
-{
-	hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *pAdapter;
-	struct ipa_msg_meta meta;
-	struct ipa_wlan_msg *msg;
-	int ret;
-
-	if (!hdd_ipa_uc_sta_is_enabled(pHddCtx))
-		return -EINVAL;
-
-	if (!pHddCtx->mcc_mode) {
-		/* Flush TxRx queue for each adapter before switch to SCC */
-		status =  hdd_get_front_adapter(pHddCtx, &adapter_node);
-		while (NULL != adapter_node && CDF_STATUS_SUCCESS == status) {
-			pAdapter = adapter_node->pAdapter;
-			if (pAdapter->device_mode == WLAN_HDD_INFRA_STATION ||
-				pAdapter->device_mode == WLAN_HDD_SOFTAP) {
-				hddLog(CDF_TRACE_LEVEL_INFO,
-					"MCC->SCC: Flush TxRx queue(d_mode=%d)",
-					pAdapter->device_mode);
-				hdd_deinit_tx_rx(pAdapter);
-			}
-			status = hdd_get_next_adapter(
-					pHddCtx, adapter_node, &next);
-			adapter_node = next;
-		}
-	}
-
-	/* Send SCC/MCC Switching event to IPA */
-	meta.msg_len = sizeof(*msg);
-	msg = cdf_mem_malloc(meta.msg_len);
-	if (msg == NULL) {
-		hddLog(LOGE, "msg allocation failed");
-		return -ENOMEM;
-	}
-
-	meta.msg_type = mcc_mode ?
-			WLAN_SWITCH_TO_MCC : WLAN_SWITCH_TO_SCC;
-	hddLog(LOG1, "ipa_send_msg(Evt:%d)", meta.msg_type);
-
-	ret = ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
-
-	if (ret) {
-		hddLog(LOGE, "ipa_send_msg(Evt:%d) - fail=%d",
-			meta.msg_type,  ret);
-		cdf_mem_free(msg);
-	}
-
-	return ret;
-}
-
-/**
- * hdd_ipa_wlan_event_to_str() - convert IPA WLAN event to string
- * @event: IPA WLAN event to be converted to a string
- *
- * Return: ASCII string representing the IPA WLAN event
- */
-static inline char *hdd_ipa_wlan_event_to_str(enum ipa_wlan_event event)
-{
-	switch (event) {
-	case WLAN_CLIENT_CONNECT:
-		return "WLAN_CLIENT_CONNECT";
-	case WLAN_CLIENT_DISCONNECT:
-		return "WLAN_CLIENT_DISCONNECT";
-	case WLAN_CLIENT_POWER_SAVE_MODE:
-		return "WLAN_CLIENT_POWER_SAVE_MODE";
-	case WLAN_CLIENT_NORMAL_MODE:
-		return "WLAN_CLIENT_NORMAL_MODE";
-	case SW_ROUTING_ENABLE:
-		return "SW_ROUTING_ENABLE";
-	case SW_ROUTING_DISABLE:
-		return "SW_ROUTING_DISABLE";
-	case WLAN_AP_CONNECT:
-		return "WLAN_AP_CONNECT";
-	case WLAN_AP_DISCONNECT:
-		return "WLAN_AP_DISCONNECT";
-	case WLAN_STA_CONNECT:
-		return "WLAN_STA_CONNECT";
-	case WLAN_STA_DISCONNECT:
-		return "WLAN_STA_DISCONNECT";
-	case WLAN_CLIENT_CONNECT_EX:
-		return "WLAN_CLIENT_CONNECT_EX";
-
-	case IPA_WLAN_EVENT_MAX:
-	default:
-		return "UNKNOWN";
-	}
-}
-
-/**
- * hdd_ipa_wlan_evt() - IPA event handler
- * @adapter: adapter upon which the event was received
- * @sta_id: station id for the event
- * @type: the event type
- * @mac_address: MAC address associated with the event
- *
- * Return: 0 on success, negative errno value on error
- */
-int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
-		     enum ipa_wlan_event type, uint8_t *mac_addr)
-{
-	struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
-	struct ipa_msg_meta meta;
-	struct ipa_wlan_msg *msg;
-	struct ipa_wlan_msg_ex *msg_ex = NULL;
-	int ret;
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: %s evt, MAC: %pM sta_id: %d",
-		    adapter->dev->name, hdd_ipa_wlan_event_to_str(type),
-		    mac_addr, sta_id);
-
-	if (type >= IPA_WLAN_EVENT_MAX)
-		return -EINVAL;
-
-	if (WARN_ON(is_zero_ether_addr(mac_addr)))
-		return -EINVAL;
-
-	if (!hdd_ipa || !hdd_ipa_is_enabled(hdd_ipa->hdd_ctx)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "IPA OFFLOAD NOT ENABLED");
-		return -EINVAL;
-	}
-
-	if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx) &&
-		!hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) &&
-		(WLAN_HDD_SOFTAP != adapter->device_mode)) {
-		return 0;
-	}
-
-	/*
-	 * During IPA UC resource loading/unloading new events can be issued.
-	 * Store the events separately and handle them later.
-	 */
-	if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx) &&
-		((hdd_ipa->resource_loading) ||
-		(hdd_ipa->resource_unloading))) {
-		unsigned int pending_event_count;
-		struct ipa_uc_pending_event *pending_event = NULL;
-
-		hdd_err("IPA resource %s inprogress",
-			hdd_ipa->resource_loading ? "load":"unload");
-
-		cdf_mutex_acquire(&hdd_ipa->event_lock);
-
-		cdf_list_size(&hdd_ipa->pending_event, &pending_event_count);
-		if (pending_event_count >= HDD_IPA_MAX_PENDING_EVENT_COUNT) {
-			hdd_notice("Reached max pending event count");
-			cdf_list_remove_front(&hdd_ipa->pending_event,
-				(cdf_list_node_t **)&pending_event);
-		} else {
-			pending_event =
-				(struct ipa_uc_pending_event *)cdf_mem_malloc(
-					sizeof(struct ipa_uc_pending_event));
-		}
-
-		if (!pending_event) {
-			hdd_err("Pending event memory alloc fail");
-			cdf_mutex_release(&hdd_ipa->event_lock);
-			return -ENOMEM;
-		}
-
-		pending_event->adapter = adapter;
-		pending_event->sta_id = sta_id;
-		pending_event->type = type;
-		cdf_mem_copy(pending_event->mac_addr,
-			mac_addr,
-			CDF_MAC_ADDR_SIZE);
-		cdf_list_insert_back(&hdd_ipa->pending_event,
-				&pending_event->node);
-
-		cdf_mutex_release(&hdd_ipa->event_lock);
-		return 0;
-	}
-
-	hdd_ipa->stats.event[type]++;
-
-	meta.msg_type = type;
-	switch (type) {
-	case WLAN_STA_CONNECT:
-		/* STA already connected and without disconnect, connect again
-		 * This is Roaming scenario
-		 */
-		if (hdd_ipa->sta_connected)
-			hdd_ipa_cleanup_iface(adapter->ipa_context);
-
-		if ((hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) &&
-			(!hdd_ipa->sta_connected))
-			hdd_ipa_uc_offload_enable_disable(adapter,
-				SIR_STA_RX_DATA_OFFLOAD, 1);
-
-		cdf_mutex_acquire(&hdd_ipa->event_lock);
-
-		if (!hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-				"%s: Evt: %d, IPA UC OFFLOAD NOT ENABLED",
-				msg_ex->name, meta.msg_type);
-		} else if ((!hdd_ipa->sap_num_connected_sta) &&
-			(!hdd_ipa->sta_connected)) {
-			/* Enable IPA UC TX PIPE when STA connected */
-			ret = hdd_ipa_uc_handle_first_con(hdd_ipa);
-			if (ret) {
-				cdf_mutex_release(&hdd_ipa->event_lock);
-				HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-					"handle 1st con ret %d", ret);
-				hdd_ipa_uc_offload_enable_disable(adapter,
-					SIR_STA_RX_DATA_OFFLOAD, 0);
-				goto end;
-			}
-		}
-		ret = hdd_ipa_setup_iface(hdd_ipa, adapter, sta_id);
-		if (ret) {
-			cdf_mutex_release(&hdd_ipa->event_lock);
-			hdd_ipa_uc_offload_enable_disable(adapter,
-				SIR_STA_RX_DATA_OFFLOAD, 0);
-			goto end;
-
-#ifdef IPA_UC_OFFLOAD
-		vdev_to_iface[adapter->sessionId] =
-			((struct hdd_ipa_iface_context *)
-				(adapter->ipa_context))->iface_id;
-#endif /* IPA_UC_OFFLOAD */
-		}
-
-		cdf_mutex_release(&hdd_ipa->event_lock);
-
-		hdd_ipa->sta_connected = 1;
-		break;
-
-	case WLAN_AP_CONNECT:
-		/* For DFS channel we get two start_bss event (before and after
-		 * CAC). Also when ACS range includes both DFS and non DFS
-		 * channels, we could possibly change channel many times due to
-		 * RADAR detection and chosen channel may not be a DFS channels.
-		 * So dont return error here. Just discard the event.
-		 */
-		if (adapter->ipa_context)
-			return 0;
-
-		if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			hdd_ipa_uc_offload_enable_disable(adapter,
-				SIR_AP_RX_DATA_OFFLOAD, 1);
-		}
-		cdf_mutex_acquire(&hdd_ipa->event_lock);
-		ret = hdd_ipa_setup_iface(hdd_ipa, adapter, sta_id);
-		if (ret) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-				"%s: Evt: %d, Interface setup failed",
-				msg_ex->name, meta.msg_type);
-			cdf_mutex_release(&hdd_ipa->event_lock);
-			goto end;
-
-#ifdef IPA_UC_OFFLOAD
-		vdev_to_iface[adapter->sessionId] =
-			((struct hdd_ipa_iface_context *)
-				(adapter->ipa_context))->iface_id;
-#endif /* IPA_UC_OFFLOAD */
-		}
-		cdf_mutex_release(&hdd_ipa->event_lock);
-		break;
-
-	case WLAN_STA_DISCONNECT:
-		cdf_mutex_acquire(&hdd_ipa->event_lock);
-		hdd_ipa_cleanup_iface(adapter->ipa_context);
-
-		if (!hdd_ipa->sta_connected) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-				"%s: Evt: %d, STA already disconnected",
-				msg_ex->name, meta.msg_type);
-			cdf_mutex_release(&hdd_ipa->event_lock);
-			return -EINVAL;
-		}
-		hdd_ipa->sta_connected = 0;
-		if (!hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-				"%s: IPA UC OFFLOAD NOT ENABLED",
-				msg_ex->name);
-		} else {
-			/* Disable IPA UC TX PIPE when STA disconnected */
-			if ((!hdd_ipa->sap_num_connected_sta) ||
-				((!hdd_ipa->num_iface) &&
-					(HDD_IPA_UC_NUM_WDI_PIPE ==
-					hdd_ipa->activated_fw_pipe))) {
-				hdd_ipa_uc_handle_last_discon(hdd_ipa);
-			}
-		}
-
-		if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
-			hdd_ipa_uc_offload_enable_disable(adapter,
-				SIR_STA_RX_DATA_OFFLOAD, 0);
-			vdev_to_iface[adapter->sessionId] = HDD_IPA_MAX_IFACE;
-		}
-
-		cdf_mutex_release(&hdd_ipa->event_lock);
-		break;
-
-	case WLAN_AP_DISCONNECT:
-		if (!adapter->ipa_context) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-				"%s: Evt: %d, SAP already disconnected",
-				msg_ex->name, meta.msg_type);
-			return -EINVAL;
-		}
-
-		cdf_mutex_acquire(&hdd_ipa->event_lock);
-		hdd_ipa_cleanup_iface(adapter->ipa_context);
-		if ((!hdd_ipa->num_iface) &&
-			(HDD_IPA_UC_NUM_WDI_PIPE ==
-				hdd_ipa->activated_fw_pipe)) {
-			if (cds_is_driver_unloading()) {
-				/*
-				 * We disable WDI pipes directly here since
-				 * IPA_OPCODE_TX/RX_SUSPEND message will not be
-				 * processed when unloading WLAN driver is in
-				 * progress
-				 */
-				hdd_ipa_uc_disable_pipes(hdd_ipa);
-			} else {
-				HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-					"NO INTF left but still pipe clean up");
-				hdd_ipa_uc_handle_last_discon(hdd_ipa);
-			}
-		}
-
-		if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			hdd_ipa_uc_offload_enable_disable(adapter,
-				SIR_AP_RX_DATA_OFFLOAD, 0);
-			vdev_to_iface[adapter->sessionId] = HDD_IPA_MAX_IFACE;
-		}
-		cdf_mutex_release(&hdd_ipa->event_lock);
-		break;
-
-	case WLAN_CLIENT_CONNECT_EX:
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%d %d",
-			    adapter->dev->ifindex, sta_id);
-
-		if (!hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-				"%s: Evt: %d, IPA UC OFFLOAD NOT ENABLED",
-				adapter->dev->name, meta.msg_type);
-			return 0;
-		}
-
-		cdf_mutex_acquire(&hdd_ipa->event_lock);
-		if (hdd_ipa_uc_find_add_assoc_sta(hdd_ipa,
-				true, sta_id)) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				"%s: STA ID %d found, not valid",
-				adapter->dev->name, sta_id);
-			cdf_mutex_release(&hdd_ipa->event_lock);
-			return 0;
-		}
-
-		/* Enable IPA UC Data PIPEs when first STA connected */
-		if ((0 == hdd_ipa->sap_num_connected_sta) &&
-		   (!hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) ||
-		   !hdd_ipa->sta_connected)) {
-			ret = hdd_ipa_uc_handle_first_con(hdd_ipa);
-			if (ret) {
-				cdf_mutex_release(&hdd_ipa->event_lock);
-				HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-					    "%s: handle 1st con ret %d",
-					    adapter->dev->name, ret);
-				return ret;
-			}
-		}
-
-		hdd_ipa->sap_num_connected_sta++;
-
-		cdf_mutex_release(&hdd_ipa->event_lock);
-
-		meta.msg_type = type;
-		meta.msg_len = (sizeof(struct ipa_wlan_msg_ex) +
-				sizeof(struct ipa_wlan_hdr_attrib_val));
-		msg_ex = cdf_mem_malloc(meta.msg_len);
-
-		if (msg_ex == NULL) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				    "msg_ex allocation failed");
-			return -ENOMEM;
-		}
-		strlcpy(msg_ex->name, adapter->dev->name,
-			IPA_RESOURCE_NAME_MAX);
-		msg_ex->num_of_attribs = 1;
-		msg_ex->attribs[0].attrib_type = WLAN_HDR_ATTRIB_MAC_ADDR;
-		if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			msg_ex->attribs[0].offset =
-				HDD_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
-		} else {
-			msg_ex->attribs[0].offset =
-				HDD_IPA_WLAN_HDR_DES_MAC_OFFSET;
-		}
-		memcpy(msg_ex->attribs[0].u.mac_addr, mac_addr,
-		       IPA_MAC_ADDR_SIZE);
-
-		ret = ipa_send_msg(&meta, msg_ex, hdd_ipa_msg_free_fn);
-
-		if (ret) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: Evt: %d : %d",
-				    msg_ex->name, meta.msg_type, ret);
-			cdf_mem_free(msg_ex);
-			return ret;
-		}
-		hdd_ipa->stats.num_send_msg++;
-		return ret;
-
-	case WLAN_CLIENT_DISCONNECT:
-		if (!hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-					"%s: IPA UC OFFLOAD NOT ENABLED",
-					msg_ex->name);
-			return 0;
-		}
-
-		cdf_mutex_acquire(&hdd_ipa->event_lock);
-		if (!hdd_ipa_uc_find_add_assoc_sta(hdd_ipa, false, sta_id)) {
-			HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-				    "%s: STA ID %d NOT found, not valid",
-				    msg_ex->name, sta_id);
-			cdf_mutex_release(&hdd_ipa->event_lock);
-			return 0;
-		}
-		hdd_ipa->sap_num_connected_sta--;
-		/* Disable IPA UC TX PIPE when last STA disconnected */
-		if (!hdd_ipa->sap_num_connected_sta
-			&& (!hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx) ||
-			!hdd_ipa->sta_connected)
-			&& (false == hdd_ipa->resource_unloading)
-			&& (HDD_IPA_UC_NUM_WDI_PIPE ==
-				hdd_ipa->activated_fw_pipe))
-			hdd_ipa_uc_handle_last_discon(hdd_ipa);
-		cdf_mutex_release(&hdd_ipa->event_lock);
-		break;
-
-	default:
-		return 0;
-	}
-
-	meta.msg_len = sizeof(struct ipa_wlan_msg);
-	msg = cdf_mem_malloc(meta.msg_len);
-	if (msg == NULL) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR, "msg allocation failed");
-		return -ENOMEM;
-	}
-
-	meta.msg_type = type;
-	strlcpy(msg->name, adapter->dev->name, IPA_RESOURCE_NAME_MAX);
-	memcpy(msg->mac_addr, mac_addr, ETH_ALEN);
-
-	HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: Evt: %d",
-		    msg->name, meta.msg_type);
-
-	ret = ipa_send_msg(&meta, msg, hdd_ipa_msg_free_fn);
-
-	if (ret) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO, "%s: Evt: %d fail:%d",
-			    msg->name, meta.msg_type, ret);
-		cdf_mem_free(msg);
-		return ret;
-	}
-
-	hdd_ipa->stats.num_send_msg++;
-
-end:
-	return ret;
-}
-
-/**
- * hdd_ipa_rm_state_to_str() - Convert IPA RM state to string
- * @state: IPA RM state value
- *
- * Return: ASCII string representing the IPA RM state
- */
-static inline char *hdd_ipa_rm_state_to_str(enum hdd_ipa_rm_state state)
-{
-	switch (state) {
-	case HDD_IPA_RM_RELEASED:
-		return "RELEASED";
-	case HDD_IPA_RM_GRANT_PENDING:
-		return "GRANT_PENDING";
-	case HDD_IPA_RM_GRANTED:
-		return "GRANTED";
-	}
-
-	return "UNKNOWN";
-}
-
-/**
- * hdd_ipa_init() - IPA initialization function
- * @hdd_ctx: HDD global context
- *
- * Allocate hdd_ipa resources, ipa pipe resource and register
- * wlan interface with IPA module.
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa = NULL;
-	int ret, i;
-	struct hdd_ipa_iface_context *iface_context = NULL;
-
-	if (!hdd_ipa_is_enabled(hdd_ctx))
-		return CDF_STATUS_SUCCESS;
-
-	hdd_ipa = cdf_mem_malloc(sizeof(*hdd_ipa));
-	if (!hdd_ipa) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_FATAL, "hdd_ipa allocation failed");
-		goto fail_return;
-	}
-
-	hdd_ctx->hdd_ipa = hdd_ipa;
-	ghdd_ipa = hdd_ipa;
-	hdd_ipa->hdd_ctx = hdd_ctx;
-	hdd_ipa->num_iface = 0;
-	ol_txrx_ipa_uc_get_resource(cds_get_context(CDF_MODULE_ID_TXRX),
-				&hdd_ipa->ce_sr_base_paddr,
-				&hdd_ipa->ce_sr_ring_size,
-				&hdd_ipa->ce_reg_paddr,
-				&hdd_ipa->tx_comp_ring_base_paddr,
-				&hdd_ipa->tx_comp_ring_size,
-				&hdd_ipa->tx_num_alloc_buffer,
-				&hdd_ipa->rx_rdy_ring_base_paddr,
-				&hdd_ipa->rx_rdy_ring_size,
-				&hdd_ipa->rx_proc_done_idx_paddr,
-				&hdd_ipa->rx_proc_done_idx_vaddr,
-				&hdd_ipa->rx2_rdy_ring_base_paddr,
-				&hdd_ipa->rx2_rdy_ring_size,
-				&hdd_ipa->rx2_proc_done_idx_paddr,
-				&hdd_ipa->rx2_proc_done_idx_vaddr);
-	if ((0 == hdd_ipa->ce_sr_base_paddr) ||
-	    (0 == hdd_ipa->tx_comp_ring_base_paddr) ||
-	    (0 == hdd_ipa->rx_rdy_ring_base_paddr) ||
-	    (0 == hdd_ipa->rx2_rdy_ring_base_paddr)) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_FATAL,
-			"IPA UC resource alloc fail");
-		goto fail_get_resource;
-	}
-
-	/* Create the interface context */
-	for (i = 0; i < HDD_IPA_MAX_IFACE; i++) {
-		iface_context = &hdd_ipa->iface_context[i];
-		iface_context->hdd_ipa = hdd_ipa;
-		iface_context->cons_client =
-			hdd_ipa_adapter_2_client[i].cons_client;
-		iface_context->prod_client =
-			hdd_ipa_adapter_2_client[i].prod_client;
-		iface_context->iface_id = i;
-		iface_context->adapter = NULL;
-		cdf_spinlock_init(&iface_context->interface_lock);
-	}
-
-#ifdef CONFIG_CNSS
-	cnss_init_work(&hdd_ipa->pm_work, hdd_ipa_pm_send_pkt_to_tl);
-#else
-	INIT_WORK(&hdd_ipa->pm_work, hdd_ipa_pm_send_pkt_to_tl);
-#endif
-	cdf_spinlock_init(&hdd_ipa->pm_lock);
-	cdf_nbuf_queue_init(&hdd_ipa->pm_queue_head);
-
-	ret = hdd_ipa_setup_rm(hdd_ipa);
-	if (ret)
-		goto fail_setup_rm;
-
-	if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
-		hdd_ipa_uc_rt_debug_init(hdd_ctx);
-		cdf_mem_zero(&hdd_ipa->stats, sizeof(hdd_ipa->stats));
-		hdd_ipa->sap_num_connected_sta = 0;
-		hdd_ipa->ipa_tx_packets_diff = 0;
-		hdd_ipa->ipa_rx_packets_diff = 0;
-		hdd_ipa->ipa_p_tx_packets = 0;
-		hdd_ipa->ipa_p_rx_packets = 0;
-		hdd_ipa->resource_loading = false;
-		hdd_ipa->resource_unloading = false;
-		hdd_ipa->sta_connected = 0;
-		hdd_ipa->ipa_pipes_down = true;
-		/* Setup IPA sys_pipe for MCC */
-		if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
-			ret = hdd_ipa_setup_sys_pipe(hdd_ipa);
-			if (ret)
-				goto fail_create_sys_pipe;
-		}
-		hdd_ipa_uc_ol_init(hdd_ctx);
-	} else {
-		ret = hdd_ipa_setup_sys_pipe(hdd_ipa);
-		if (ret)
-			goto fail_create_sys_pipe;
-	}
-
-	return CDF_STATUS_SUCCESS;
-
-fail_create_sys_pipe:
-	hdd_ipa_destroy_rm_resource(hdd_ipa);
-fail_setup_rm:
-	cdf_spinlock_destroy(&hdd_ipa->pm_lock);
-fail_get_resource:
-	cdf_mem_free(hdd_ipa);
-	hdd_ctx->hdd_ipa = NULL;
-	ghdd_ipa = NULL;
-fail_return:
-	return CDF_STATUS_E_FAILURE;
-}
-
-/**
- * hdd_ipa_cleanup_pending_event() - Cleanup IPA pending event list
- * @hdd_ipa: pointer to HDD IPA struct
- *
- * Return: none
- */
-void hdd_ipa_cleanup_pending_event(struct hdd_ipa_priv *hdd_ipa)
-{
-	struct ipa_uc_pending_event *pending_event = NULL;
-
-	while (cdf_list_remove_front(&hdd_ipa->pending_event,
-		(cdf_list_node_t **)&pending_event) == CDF_STATUS_SUCCESS) {
-		cdf_mem_free(pending_event);
-	}
-
-	cdf_list_destroy(&hdd_ipa->pending_event);
-}
-
-/**
- * hdd_ipa_cleanup - IPA cleanup function
- * @hdd_ctx: HDD global context
- *
- * Return: CDF_STATUS enumeration
- */
-CDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx)
-{
-	struct hdd_ipa_priv *hdd_ipa = hdd_ctx->hdd_ipa;
-	int i;
-	struct hdd_ipa_iface_context *iface_context = NULL;
-	cdf_nbuf_t skb;
-	struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL;
-
-	if (!hdd_ipa_is_enabled(hdd_ctx))
-		return CDF_STATUS_SUCCESS;
-
-	if (!hdd_ipa_uc_is_enabled(hdd_ctx)) {
-		unregister_inetaddr_notifier(&hdd_ipa->ipv4_notifier);
-		hdd_ipa_teardown_sys_pipe(hdd_ipa);
-	}
-
-	/* Teardown IPA sys_pipe for MCC */
-	if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx))
-		hdd_ipa_teardown_sys_pipe(hdd_ipa);
-
-	hdd_ipa_destroy_rm_resource(hdd_ipa);
-
-#ifdef WLAN_OPEN_SOURCE
-	cancel_work_sync(&hdd_ipa->pm_work);
-#endif
-
-	cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-
-	while (((skb = cdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) != NULL)) {
-		cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-
-		pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb;
-		ipa_free_skb(pm_tx_cb->ipa_tx_desc);
-
-		cdf_spin_lock_bh(&hdd_ipa->pm_lock);
-	}
-	cdf_spin_unlock_bh(&hdd_ipa->pm_lock);
-
-	cdf_spinlock_destroy(&hdd_ipa->pm_lock);
-
-	/* destory the interface lock */
-	for (i = 0; i < HDD_IPA_MAX_IFACE; i++) {
-		iface_context = &hdd_ipa->iface_context[i];
-		cdf_spinlock_destroy(&iface_context->interface_lock);
-	}
-
-	/* This should never hit but still make sure that there are no pending
-	 * descriptor in IPA hardware
-	 */
-	if (hdd_ipa->pending_hw_desc_cnt != 0) {
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "IPA Pending write done: %d Waiting!",
-			    hdd_ipa->pending_hw_desc_cnt);
-
-		for (i = 0; hdd_ipa->pending_hw_desc_cnt != 0 && i < 10; i++) {
-			usleep_range(100, 100);
-		}
-
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_ERROR,
-			    "IPA Pending write done: desc: %d %s(%d)!",
-			    hdd_ipa->pending_hw_desc_cnt,
-			    hdd_ipa->pending_hw_desc_cnt == 0 ? "completed"
-			    : "leak", i);
-	}
-	if (hdd_ipa_uc_is_enabled(hdd_ctx)) {
-		hdd_ipa_uc_rt_debug_deinit(hdd_ctx);
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			    "%s: Disconnect TX PIPE", __func__);
-		ipa_disconnect_wdi_pipe(hdd_ipa->tx_pipe_handle);
-		HDD_IPA_LOG(CDF_TRACE_LEVEL_INFO,
-			    "%s: Disconnect RX PIPE", __func__);
-		ipa_disconnect_wdi_pipe(hdd_ipa->rx_pipe_handle);
-		cdf_mutex_destroy(&hdd_ipa->event_lock);
-		cdf_mutex_destroy(&hdd_ipa->ipa_lock);
-		hdd_ipa_cleanup_pending_event(hdd_ipa);
-
-#ifdef WLAN_OPEN_SOURCE
-		for (i = 0; i < HDD_IPA_UC_OPCODE_MAX; i++) {
-			cancel_work_sync(&hdd_ipa->uc_op_work[i].work);
-			hdd_ipa->uc_op_work[i].msg = NULL;
-		}
-#endif
-	}
-
-	cdf_mem_free(hdd_ipa);
-	hdd_ctx->hdd_ipa = NULL;
-
-	return CDF_STATUS_SUCCESS;
-}
-#endif /* IPA_OFFLOAD */

+ 0 - 659
core/hdd/src/wlan_hdd_lro.c

@@ -1,659 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_lro.c
- *
- * WLAN HDD LRO interface implementation
- */
-
-/* denote that this file does not allow legacy hddLog */
-#define HDD_DISALLOW_LEGACY_HDDLOG 1
-
-#include <wlan_hdd_includes.h>
-#include <cdf_types.h>
-#include <wlan_hdd_lro.h>
-#include <wlan_hdd_napi.h>
-#include <wma_api.h>
-#include <ol_txrx_types.h>
-#include <ol_cfg.h>
-
-#include <linux/inet_lro.h>
-#include <linux/list.h>
-#include <linux/random.h>
-#include <net/tcp.h>
-
-#define LRO_MAX_AGGR_SIZE 100
-
-#define LRO_VALID_FIELDS \
-	(LRO_DESC | LRO_ELIGIBILITY_CHECKED | LRO_TCP_ACK_NUM | \
-	 LRO_TCP_DATA_CSUM | LRO_TCP_SEQ_NUM | LRO_TCP_WIN)
-
-/**
- * hdd_lro_get_skb_header() - LRO callback function
- * @skb: network buffer
- * @ip_hdr: contains a pointer to the IP header
- * @tcpudp_hdr: contains a pointer to the TCP header
- * @hdr_flags: indicates if this is a TCP, IPV4 frame
- * @priv: private driver specific opaque pointer
- *
- * Get the IP and TCP headers from the skb
- *
- * Return: 0 - success, < 0 - failure
- */
-static int hdd_lro_get_skb_header(struct sk_buff *skb, void **ip_hdr,
-	void **tcpudp_hdr, u64 *hdr_flags, void *priv)
-{
-	if (NBUF_IPV6_PROTO(skb)) {
-		hdr_flags = 0;
-		return -EINVAL;
-	}
-
-	*hdr_flags |= (LRO_IPV4 | LRO_TCP);
-	(*ip_hdr) = skb->data;
-	(*tcpudp_hdr) = skb->data + NBUF_TCP_OFFSET(skb);
-	return 0;
-}
-
-/**
- * hdd_lro_desc_pool_init() - Initialize the free pool of LRO
- * descriptors
- * @lro_desc_pool: free pool of the LRO descriptors
- * @lro_mgr: LRO manager
- *
- * Initialize a list that holds the free LRO descriptors
- *
- * Return: none
- */
-static void hdd_lro_desc_pool_init(struct hdd_lro_desc_pool *lro_desc_pool,
-	 struct net_lro_mgr *lro_mgr)
-{
-	int i;
-
-	INIT_LIST_HEAD(&lro_desc_pool->lro_free_list_head);
-
-	for (i = 0; i < LRO_DESC_POOL_SZ; i++) {
-		lro_desc_pool->lro_desc_array[i].lro_desc =
-			 &lro_mgr->lro_arr[i];
-		list_add_tail(&lro_desc_pool->lro_desc_array[i].lro_node,
-			 &lro_desc_pool->lro_free_list_head);
-	}
-	cdf_spinlock_init(&lro_desc_pool->lro_pool_lock);
-}
-
-/**
- * hdd_lro_desc_info_init() - Initialize the LRO descriptors
- * @hdd_info: HDD LRO data structure
- *
- * Initialize the free pool of LRO descriptors and the entries
- * of the hash table
- *
- * Return: none
- */
-static void hdd_lro_desc_info_init(struct hdd_lro_s *hdd_info)
-{
-	int i;
-
-	/* Initialize pool of free LRO desc.*/
-	hdd_lro_desc_pool_init(&hdd_info->lro_desc_info.lro_desc_pool,
-		 hdd_info->lro_mgr);
-
-	/* Initialize the hash table of LRO desc.*/
-	for (i = 0; i < LRO_DESC_TABLE_SZ; i++) {
-		/* initialize the flows in the hash table */
-		INIT_LIST_HEAD(&hdd_info->lro_desc_info.
-			 lro_hash_table[i].lro_desc_list);
-	}
-
-	cdf_spinlock_init(&hdd_info->lro_desc_info.lro_hash_lock);
-}
-
-/**
- * hdd_lro_desc_pool_deinit() - Free the LRO descriptor list
- * @hdd_info: HDD LRO data structure
- *
- * Free the pool of LRO descriptors
- *
- * Return: none
- */
-static void hdd_lro_desc_pool_deinit(struct hdd_lro_desc_pool *lro_desc_pool)
-{
-	INIT_LIST_HEAD(&lro_desc_pool->lro_free_list_head);
-	cdf_spinlock_destroy(&lro_desc_pool->lro_pool_lock);
-}
-
-/**
- * hdd_lro_desc_info_deinit() - Deinitialize the LRO descriptors
- *
- * @hdd_info: HDD LRO data structure
- *
- * Deinitialize the free pool of LRO descriptors and the entries
- * of the hash table
- *
- * Return: none
- */
-static void hdd_lro_desc_info_deinit(struct hdd_lro_s *hdd_info)
-{
-	struct hdd_lro_desc_info *desc_info = &hdd_info->lro_desc_info;
-
-	hdd_lro_desc_pool_deinit(&desc_info->lro_desc_pool);
-	cdf_spinlock_destroy(&desc_info->lro_hash_lock);
-}
-
-/**
- * hdd_lro_tcp_flow_match() - function to check for a flow match
- * @iph: IP header
- * @tcph: TCP header
- * @lro_desc: LRO decriptor
- *
- * Checks if the descriptor belongs to the same flow as the one
- * indicated by the TCP and IP header.
- *
- * Return: true - flow match, false - flow does not match
- */
-static inline bool hdd_lro_tcp_flow_match(struct net_lro_desc *lro_desc,
-	 struct iphdr *iph,
-	 struct tcphdr *tcph)
-{
-	if ((lro_desc->tcph->source != tcph->source) ||
-		 (lro_desc->tcph->dest != tcph->dest) ||
-		 (lro_desc->iph->saddr != iph->saddr) ||
-		 (lro_desc->iph->daddr != iph->daddr))
-		return false;
-
-	return true;
-
-}
-
-/**
- * hdd_lro_desc_find() - LRO descriptor look-up function
- *
- * @adapter: HDD adaptor
- * @skb: network buffer
- * @iph: IP header
- * @tcph: TCP header
- * @lro_desc: contains a pointer to the LRO decriptor
- *
- * Look-up the LRO descriptor in the hash table based on the
- * flow ID toeplitz. If the flow is not found, allocates a new
- * LRO descriptor and places it in the hash table
- *
- * Return: 0 - success, < 0 - failure
- */
-static int hdd_lro_desc_find(hdd_adapter_t *adapter,
-	 struct sk_buff *skb, struct iphdr *iph, struct tcphdr *tcph,
-	 struct net_lro_desc **lro_desc)
-{
-	uint32_t i;
-	struct hdd_lro_desc_table *lro_hash_table;
-	struct list_head *ptr;
-	struct hdd_lro_desc_entry *entry;
-	struct hdd_lro_desc_pool free_pool;
-	struct hdd_lro_desc_info *desc_info = &adapter->lro_info.lro_desc_info;
-
-	*lro_desc = NULL;
-	i = NBUF_FLOW_ID_TOEPLITZ(skb) & LRO_DESC_TABLE_SZ_MASK;
-
-	lro_hash_table = &desc_info->lro_hash_table[i];
-
-	if (!lro_hash_table) {
-		hdd_err("Invalid hash entry");
-		CDF_ASSERT(0);
-		return -EINVAL;
-	}
-
-	cdf_spin_lock_bh(&desc_info->lro_hash_lock);
-	/* Check if this flow exists in the descriptor list */
-	list_for_each(ptr, &lro_hash_table->lro_desc_list) {
-		struct net_lro_desc *tmp_lro_desc = NULL;
-		entry = list_entry(ptr, struct hdd_lro_desc_entry, lro_node);
-		tmp_lro_desc = entry->lro_desc;
-		if (tmp_lro_desc->active) {
-			if (hdd_lro_tcp_flow_match(tmp_lro_desc, iph, tcph)) {
-				*lro_desc = entry->lro_desc;
-				cdf_spin_unlock_bh(&desc_info->lro_hash_lock);
-				return 0;
-			}
-		}
-	}
-	cdf_spin_unlock_bh(&desc_info->lro_hash_lock);
-
-	/* no existing flow found, a new LRO desc needs to be allocated */
-	free_pool = adapter->lro_info.lro_desc_info.lro_desc_pool;
-	cdf_spin_lock_bh(&free_pool.lro_pool_lock);
-	entry = list_first_entry_or_null(
-		 &free_pool.lro_free_list_head,
-		 struct hdd_lro_desc_entry, lro_node);
-	if (NULL == entry) {
-		hdd_err("Could not allocate LRO desc!");
-		cdf_spin_unlock_bh(&free_pool.lro_pool_lock);
-		return -ENOMEM;
-	}
-
-	list_del_init(&entry->lro_node);
-	cdf_spin_unlock_bh(&free_pool.lro_pool_lock);
-
-	if (NULL == entry->lro_desc) {
-		hdd_err("entry->lro_desc is NULL!\n");
-		return -EINVAL;
-	}
-
-	cdf_mem_zero((void *)entry->lro_desc, sizeof(struct net_lro_desc));
-
-	/*
-	 * lro_desc->active should be 0 and lro_desc->tcp_rcv_tsval
-	 * should be 0 for newly allocated lro descriptors
-	 */
-	cdf_spin_lock_bh(&desc_info->lro_hash_lock);
-	list_add_tail(&entry->lro_node,
-		 &lro_hash_table->lro_desc_list);
-	cdf_spin_unlock_bh(&desc_info->lro_hash_lock);
-	*lro_desc = entry->lro_desc;
-
-	return 0;
-}
-
-/**
- * hdd_lro_get_desc() - LRO descriptor look-up function
- * @iph: IP header
- * @tcph: TCP header
- * @lro_arr: Array of LRO decriptors
- * @lro_mgr: LRO manager
- *
- * Looks-up the LRO descriptor for a given flow
- *
- * Return: LRO descriptor
- */
-static struct net_lro_desc *hdd_lro_get_desc(struct net_lro_mgr *lro_mgr,
-	 struct net_lro_desc *lro_arr,
-	 struct iphdr *iph,
-	 struct tcphdr *tcph)
-{
-	int i;
-
-	for (i = 0; i < lro_mgr->max_desc; i++) {
-		if (lro_arr[i].active)
-			if (hdd_lro_tcp_flow_match(&lro_arr[i], iph, tcph))
-				return &lro_arr[i];
-	}
-
-	return NULL;
-}
-
-/**
- * hdd_lro_eligible() - LRO eligibilty check
- * @iph: IP header
- * @tcph: TCP header
- * @adapter: HDD adaptor
- * @desc: LRO descriptor
- * @skb: network buffer
- *
- * Determines if the frame is LRO eligible
- *
- * Return: true - LRO eligible frame, false - frame is not LRO
- * eligible
- */
-static bool hdd_lro_eligible(hdd_adapter_t *adapter, struct sk_buff *skb,
-	 struct iphdr *iph, struct tcphdr *tcph, struct net_lro_desc **desc)
-{
-	struct net_lro_desc *lro_desc = NULL;
-	int hw_lro_eligible =
-		 NBUF_LRO_ELIGIBLE(skb) && (!NBUF_TCP_PURE_ACK(skb));
-
-	if (!hw_lro_eligible)
-		return false;
-
-	if (0 != hdd_lro_desc_find(adapter, skb, iph, tcph, desc)) {
-		hdd_err("finding the LRO desc failed");
-		return false;
-	}
-
-	lro_desc = *desc;
-	if (!lro_desc)
-		return false;
-
-	/* if this is not the first skb, check the timestamp option */
-	if (lro_desc->tcp_rcv_tsval) {
-		if (tcph->doff == 8) {
-			__be32 *topt = (__be32 *)(tcph + 1);
-
-			if (*topt != htonl((TCPOPT_NOP << 24)
-				 |(TCPOPT_NOP << 16)
-				 | (TCPOPT_TIMESTAMP << 8)
-				 | TCPOLEN_TIMESTAMP))
-				return true;
-
-			/* timestamp should be in right order */
-			topt++;
-			if (after(ntohl(lro_desc->tcp_rcv_tsval),
-					 ntohl(*topt)))
-				return false;
-
-			/* timestamp reply should not be zero */
-			topt++;
-			if (*topt == 0)
-				return false;
-		}
-	}
-
-	return true;
-}
-
-/**
- * hdd_lro_desc_free() - Free the LRO descriptor
- * @adapter: HDD adaptor
- * @desc: LRO descriptor
- *
- * Return the LRO descriptor to the free pool
- *
- * Return: none
- */
-static void hdd_lro_desc_free(struct net_lro_desc *desc,
-	 hdd_adapter_t *adapter)
-{
-	struct hdd_lro_desc_entry *entry;
-	struct net_lro_desc *arr_base = adapter->lro_info.lro_mgr->lro_arr;
-	struct hdd_lro_desc_info *desc_info = &adapter->lro_info.lro_desc_info;
-	int i = desc - arr_base;
-
-	if (i >= LRO_DESC_POOL_SZ) {
-		hdd_err("invalid index %d", i);
-		return;
-	}
-
-	entry = &desc_info->lro_desc_pool.lro_desc_array[i];
-
-	cdf_spin_lock_bh(&desc_info->lro_hash_lock);
-	list_del_init(&entry->lro_node);
-	cdf_spin_unlock_bh(&desc_info->lro_hash_lock);
-
-	cdf_spin_lock_bh(&desc_info->lro_desc_pool.lro_pool_lock);
-	list_add_tail(&entry->lro_node, &desc_info->
-		 lro_desc_pool.lro_free_list_head);
-	cdf_spin_unlock_bh(&desc_info->lro_desc_pool.lro_pool_lock);
-}
-
-/**
- * hdd_lro_flush_pkt() - function to flush the LRO flow
- * @iph: IP header
- * @tcph: TCP header
- * @adapter: HDD adaptor
- * @lro_mgr: LRO manager
- *
- * Flush all the packets aggregated in the LRO manager for the
- * flow indicated by the TCP and IP header
- *
- * Return: none
- */
-void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr,
-	 struct iphdr *iph, struct tcphdr *tcph, hdd_adapter_t *adapter)
-{
-	struct net_lro_desc *lro_desc;
-
-	lro_desc = hdd_lro_get_desc(lro_mgr, lro_mgr->lro_arr, iph, tcph);
-
-	if (!lro_desc)
-		return;
-
-	hdd_lro_desc_free(lro_desc, adapter);
-	lro_flush_desc(lro_mgr, lro_desc);
-}
-
-/**
- * hdd_lro_flush() - LRO flush callback
- * @data: opaque pointer containing HDD specific information
- *
- * Callback registered to flush all the packets aggregated in
- * the LRO manager for all the flows
- *
- * Return: none
- */
-void hdd_lro_flush(void *data)
-{
-	hdd_adapter_t *adapter = (hdd_adapter_t *)data;
-	int i;
-
-	for (i = 0; i < adapter->lro_info.lro_mgr->max_desc; i++) {
-		if (adapter->lro_info.lro_mgr->lro_arr[i].active) {
-			hdd_lro_desc_free(
-				 &adapter->lro_info.lro_mgr->lro_arr[i],
-				 (void *)adapter);
-			lro_flush_desc(adapter->lro_info.lro_mgr,
-				 &adapter->lro_info.lro_mgr->lro_arr[i]);
-		}
-	}
-}
-
-/**
- * hdd_lro_init() - initialization for LRO
- * @hdd_ctx: HDD context
- *
- * This function sends the LRO configuration to the firmware
- * via WMA
- *
- * Return: 0 - success, < 0 - failure
- */
-int hdd_lro_init(hdd_context_t *hdd_ctx)
-{
-	struct wma_lro_config_cmd_t lro_config;
-
-	if (!hdd_ctx->config->lro_enable) {
-		hdd_err("LRO Disabled");
-		return 0;
-	}
-
-	lro_config.lro_enable = 1;
-	lro_config.tcp_flag = TCPHDR_ACK;
-	lro_config.tcp_flag_mask = TCPHDR_FIN | TCPHDR_SYN | TCPHDR_RST |
-		TCPHDR_ACK | TCPHDR_URG | TCPHDR_ECE | TCPHDR_CWR;
-
-	get_random_bytes(lro_config.toeplitz_hash_ipv4,
-		 (sizeof(lro_config.toeplitz_hash_ipv4[0]) *
-		 LRO_IPV4_SEED_ARR_SZ));
-
-	get_random_bytes(lro_config.toeplitz_hash_ipv6,
-		 (sizeof(lro_config.toeplitz_hash_ipv6[0]) *
-		 LRO_IPV6_SEED_ARR_SZ));
-
-	hdd_debug("sending the LRO configuration to the fw");
-	if (0 != wma_lro_init(&lro_config)) {
-		hdd_err("Failed to send LRO configuration!");
-		hdd_ctx->config->lro_enable = 0;
-		return -EAGAIN;
-	}
-
-	return 0;
-}
-
-/**
- * hdd_lro_enable() - enable LRO
- * @hdd_ctx: HDD context
- * @adapter: HDD adapter
- *
- * This function enables LRO in the network device attached to
- * the HDD adapter. It also allocates the HDD LRO instance for
- * that network device
- *
- * Return: 0 - success, < 0 - failure
- */
-int hdd_lro_enable(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter)
-{
-	struct hdd_lro_s *hdd_lro;
-	struct ol_txrx_pdev_t *pdev = cds_get_context(CDF_MODULE_ID_TXRX);
-	size_t lro_mgr_sz, desc_arr_sz, desc_pool_sz, hash_table_sz;
-	uint8_t *lro_mem_ptr;
-
-	if (!hdd_ctx->config->lro_enable ||
-		 NL80211_IFTYPE_STATION != adapter->wdev.iftype) {
-		hdd_info("LRO Disabled");
-		return 0;
-	}
-
-	hdd_info("LRO Enabled");
-
-	hdd_lro = &adapter->lro_info;
-	cdf_mem_zero((void *)hdd_lro, sizeof(struct hdd_lro_s));
-	/*
-	* Allocate all the LRO data structures at once and then carve
-	* them up as needed
-	*/
-	lro_mgr_sz = sizeof(struct net_lro_mgr);
-	desc_arr_sz = (LRO_DESC_POOL_SZ * sizeof(struct net_lro_desc));
-	desc_pool_sz = (LRO_DESC_POOL_SZ * sizeof(struct hdd_lro_desc_entry));
-	hash_table_sz = (sizeof(struct hdd_lro_desc_table) * LRO_DESC_TABLE_SZ);
-
-	lro_mem_ptr = cdf_mem_malloc(lro_mgr_sz + desc_arr_sz + desc_pool_sz +
-		 hash_table_sz);
-
-	if (NULL == lro_mem_ptr) {
-		hdd_err("Unable to allocate memory for LRO");
-		hdd_ctx->config->lro_enable = 0;
-		return -ENOMEM;
-	}
-
-	/* LRO manager */
-	hdd_lro->lro_mgr = (struct net_lro_mgr *)lro_mem_ptr;
-	lro_mem_ptr += lro_mgr_sz;
-
-	/* LRO decriptor array */
-	hdd_lro->lro_mgr->lro_arr = (struct net_lro_desc *)lro_mem_ptr;
-	lro_mem_ptr += desc_arr_sz;
-
-	/* LRO descriptor pool */
-	hdd_lro->lro_desc_info.lro_desc_pool.lro_desc_array =
-		 (struct hdd_lro_desc_entry *)lro_mem_ptr;
-	lro_mem_ptr += desc_pool_sz;
-
-	/* hash table to store the LRO descriptors */
-	hdd_lro->lro_desc_info.lro_hash_table =
-		 (struct hdd_lro_desc_table *)lro_mem_ptr;
-
-	/* Initialize the LRO descriptors */
-	 hdd_lro_desc_info_init(hdd_lro);
-
-	hdd_lro->lro_mgr->dev = adapter->dev;
-	if (ol_cfg_is_rx_thread_enabled(pdev->ctrl_pdev))
-		hdd_lro->lro_mgr->features = LRO_F_NI;
-
-	if (hdd_napi_enabled(HDD_NAPI_ANY))
-		hdd_lro->lro_mgr->features |= LRO_F_NAPI;
-
-	hdd_lro->lro_mgr->ip_summed_aggr = CHECKSUM_UNNECESSARY;
-	hdd_lro->lro_mgr->max_aggr = LRO_MAX_AGGR_SIZE;
-	hdd_lro->lro_mgr->get_skb_header = hdd_lro_get_skb_header;
-	hdd_lro->lro_mgr->ip_summed = CHECKSUM_UNNECESSARY;
-	hdd_lro->lro_mgr->max_desc = LRO_DESC_POOL_SZ;
-
-	adapter->dev->features |= NETIF_F_LRO;
-
-	/* Register the flush callback */
-	ol_register_lro_flush_cb(hdd_lro_flush, adapter);
-
-	return 0;
-}
-
-/**
- * hdd_lro_disable() - disable LRO
- * @hdd_ctx: HDD context
- * @adapter: HDD adapter
- *
- * This function frees the HDD LRO instance for the network
- * device attached to the HDD adapter
- *
- * Return: none
- */
-void hdd_lro_disable(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
-{
-	if (!hdd_ctx->config->lro_enable ||
-		 NL80211_IFTYPE_STATION != adapter->wdev.iftype)
-		return;
-
-	/* Deregister the flush callback */
-	ol_deregister_lro_flush_cb();
-
-	if (adapter->lro_info.lro_mgr) {
-		hdd_lro_desc_info_deinit(&adapter->lro_info);
-		cdf_mem_free(adapter->lro_info.lro_mgr);
-		adapter->lro_info.lro_mgr = NULL;
-		adapter->lro_info.lro_desc_info.
-			lro_desc_pool.lro_desc_array = NULL;
-		adapter->lro_info.lro_desc_info.
-			lro_hash_table = NULL;
-	}
-	return;
-}
-
-/**
- * hdd_lro_rx() - LRO receive function
- * @hdd_ctx: HDD context
- * @adapter: HDD adapter
- * @skb: network buffer
- *
- * Delivers LRO eligible frames to the LRO manager
- *
- * Return: HDD_LRO_RX - frame delivered to LRO manager
- * HDD_LRO_NO_RX - frame not delivered
- */
-enum hdd_lro_rx_status hdd_lro_rx(hdd_context_t *hdd_ctx,
-	 hdd_adapter_t *adapter, struct sk_buff *skb)
-{
-	enum hdd_lro_rx_status status = HDD_LRO_NO_RX;
-
-	if ((adapter->dev->features & NETIF_F_LRO) &&
-		 NBUF_TCP_PROTO(skb)) {
-		struct iphdr *iph;
-		struct tcphdr *tcph;
-		struct net_lro_desc *lro_desc = NULL;
-		iph = (struct iphdr *)skb->data;
-		tcph = (struct tcphdr *)(skb->data + NBUF_TCP_OFFSET(skb));
-		if (hdd_lro_eligible(adapter, skb, iph, tcph, &lro_desc)) {
-			struct net_lro_info hdd_lro_info;
-
-			hdd_lro_info.valid_fields = LRO_VALID_FIELDS;
-
-			hdd_lro_info.lro_desc = lro_desc;
-			hdd_lro_info.lro_eligible = 1;
-			hdd_lro_info.tcp_ack_num = NBUF_TCP_ACK_NUM(skb);
-			hdd_lro_info.tcp_data_csum =
-				 csum_unfold(htons(NBUF_TCP_CHKSUM(skb)));
-			hdd_lro_info.tcp_seq_num = NBUF_TCP_SEQ_NUM(skb);
-			hdd_lro_info.tcp_win = NBUF_TCP_WIN(skb);
-
-			lro_receive_skb_ext(adapter->lro_info.lro_mgr, skb,
-				 (void *)adapter, &hdd_lro_info);
-
-			if (!hdd_lro_info.lro_desc->active)
-				hdd_lro_desc_free(lro_desc, adapter);
-
-			status = HDD_LRO_RX;
-		} else {
-			hdd_lro_flush_pkt(adapter->lro_info.lro_mgr,
-				 iph, tcph, adapter);
-		}
-	}
-	return status;
-}

+ 0 - 7000
core/hdd/src/wlan_hdd_main.c

@@ -1,7000 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- *  DOC: wlan_hdd_main.c
- *
- *  WLAN Host Device Driver implementation
- *
- */
-
-/* Include Files */
-#include <wlan_hdd_includes.h>
-#include <cds_api.h>
-#include <cds_sched.h>
-#ifdef WLAN_FEATURE_LPSS
-#include <cds_utils.h>
-#endif
-#include <linux/etherdevice.h>
-#include <linux/firmware.h>
-#include <wlan_hdd_tx_rx.h>
-#include <wni_api.h>
-#include <wlan_hdd_cfg.h>
-#include <wlan_ptt_sock_svc.h>
-#include <dbglog_host.h>
-#include <wlan_logging_sock_svc.h>
-#include <wlan_hdd_wowl.h>
-#include <wlan_hdd_misc.h>
-#include <wlan_hdd_wext.h>
-#include "wlan_hdd_trace.h"
-#include "wlan_hdd_ioctl.h"
-#include "wlan_hdd_ftm.h"
-#include "wlan_hdd_power.h"
-#include "wlan_hdd_stats.h"
-#include "cdf_types.h"
-#include "cdf_trace.h"
-
-#include <net/addrconf.h>
-#include <linux/wireless.h>
-#include <net/cfg80211.h>
-#include <linux/inetdevice.h>
-#include <net/addrconf.h>
-#include "wlan_hdd_cfg80211.h"
-#include "wlan_hdd_ext_scan.h"
-#include "wlan_hdd_p2p.h"
-#include <linux/rtnetlink.h>
-#include "sap_api.h"
-#include <linux/semaphore.h>
-#include <linux/ctype.h>
-#include <linux/compat.h>
-#ifdef MSM_PLATFORM
-#ifdef CONFIG_CNSS
-#include <soc/qcom/subsystem_restart.h>
-#endif
-#endif
-#include <wlan_hdd_hostapd.h>
-#include <wlan_hdd_softap_tx_rx.h>
-#include "cfg_api.h"
-#include "qwlan_version.h"
-#include "wma_types.h"
-#include "wlan_hdd_tdls.h"
-#ifdef FEATURE_WLAN_CH_AVOID
-#ifdef CONFIG_CNSS
-#include <net/cnss.h>
-#endif
-#include "cds_regdomain.h"
-
-#include "wlan_hdd_ocb.h"
-
-extern int hdd_hostapd_stop(struct net_device *dev);
-#endif /* FEATURE_WLAN_CH_AVOID */
-
-#include "wlan_hdd_nan.h"
-#include "wlan_hdd_debugfs.h"
-#include "wlan_hdd_driver_ops.h"
-#include "epping_main.h"
-#include "wlan_hdd_memdump.h"
-
-#include <wlan_hdd_ipa.h>
-#include "hif.h"
-#include "wma.h"
-#include "cds_concurrency.h"
-#include "wlan_hdd_green_ap.h"
-#include "platform_icnss.h"
-
-#ifdef MODULE
-#define WLAN_MODULE_NAME  module_name(THIS_MODULE)
-#else
-#define WLAN_MODULE_NAME  "wlan"
-#endif
-
-#ifdef TIMER_MANAGER
-#define TIMER_MANAGER_STR " +TIMER_MANAGER"
-#else
-#define TIMER_MANAGER_STR ""
-#endif
-
-#ifdef MEMORY_DEBUG
-#define MEMORY_DEBUG_STR " +MEMORY_DEBUG"
-#else
-#define MEMORY_DEBUG_STR ""
-#endif
-
-/* the Android framework expects this param even though we don't use it */
-#define BUF_LEN 20
-static char fwpath_buffer[BUF_LEN];
-static struct kparam_string fwpath = {
-	.string = fwpath_buffer,
-	.maxlen = BUF_LEN,
-};
-
-static char *country_code;
-static int enable_11d = -1;
-static int enable_dfs_chan_scan = -1;
-
-#ifndef MODULE
-static int wlan_hdd_inited;
-#endif
-
-/*
- * spinlock for synchronizing asynchronous request/response
- * (full description of use in wlan_hdd_main.h)
- */
-DEFINE_SPINLOCK(hdd_context_lock);
-
-static cdf_wake_lock_t wlan_wake_lock;
-
-#define WOW_MAX_FILTER_LISTS 1
-#define WOW_MAX_FILTERS_PER_LIST 4
-#define WOW_MIN_PATTERN_SIZE 6
-#define WOW_MAX_PATTERN_SIZE 64
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-static const struct wiphy_wowlan_support wowlan_support_reg_init = {
-	.flags = WIPHY_WOWLAN_ANY |
-		 WIPHY_WOWLAN_MAGIC_PKT |
-		 WIPHY_WOWLAN_DISCONNECT |
-		 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
-		 WIPHY_WOWLAN_GTK_REKEY_FAILURE |
-		 WIPHY_WOWLAN_EAP_IDENTITY_REQ |
-		 WIPHY_WOWLAN_4WAY_HANDSHAKE |
-		 WIPHY_WOWLAN_RFKILL_RELEASE,
-	.n_patterns = WOW_MAX_FILTER_LISTS * WOW_MAX_FILTERS_PER_LIST,
-	.pattern_min_len = WOW_MIN_PATTERN_SIZE,
-	.pattern_max_len = WOW_MAX_PATTERN_SIZE,
-};
-#endif
-
-/* internal function declaration */
-
-struct sock *cesium_nl_srv_sock;
-
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-void wlan_hdd_auto_shutdown_cb(void);
-#endif
-
-/**
- * wlan_hdd_txrx_pause_cb() - pause callback from txrx layer
- * @vdev_id: vdev_id
- * @action: action type
- * @reason: reason type
- *
- * Return: none
- */
-void wlan_hdd_txrx_pause_cb(uint8_t vdev_id,
-		enum netif_action_type action, enum netif_reason_type reason)
-{
-	hdd_context_t *hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	hdd_adapter_t *adapter;
-
-	if (!hdd_ctx) {
-		hdd_err("hdd ctx is NULL");
-		return;
-	}
-	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
-
-	wlan_hdd_netif_queue_control(adapter, action, reason);
-	return;
-}
-
-/*
- * Store WLAN driver version info in a global variable such that crash debugger
- * can extract it from driver debug symbol and crashdump for post processing
- */
-uint8_t g_wlan_driver_version[] = QWLAN_VERSIONSTR;
-
-/**
- * hdd_device_mode_to_string() - return string conversion of device mode
- * @device_mode: device mode
- *
- * This utility function helps log string conversion of device mode.
- *
- * Return: string conversion of device mode, if match found;
- *	   "Unknown" otherwise.
- */
-const char *hdd_device_mode_to_string(uint8_t device_mode)
-{
-	switch (device_mode) {
-	CASE_RETURN_STRING(WLAN_HDD_INFRA_STATION);
-	CASE_RETURN_STRING(WLAN_HDD_SOFTAP);
-	CASE_RETURN_STRING(WLAN_HDD_P2P_CLIENT);
-	CASE_RETURN_STRING(WLAN_HDD_P2P_GO);
-	CASE_RETURN_STRING(WLAN_HDD_FTM);
-	CASE_RETURN_STRING(WLAN_HDD_IBSS);
-	CASE_RETURN_STRING(WLAN_HDD_P2P_DEVICE);
-	CASE_RETURN_STRING(WLAN_HDD_OCB);
-	default:
-		return "Unknown";
-	}
-}
-
-/**
- * hdd_validate_channel_and_bandwidth() - Validate the channel-bandwidth combo
- * @adapter: HDD adapter
- * @chan_number: Channel number
- * @chan_bw: Bandwidth
- *
- * Checks if the given bandwidth is valid for the given channel number.
- *
- * Return: 0 for success, non-zero for failure
- */
-int hdd_validate_channel_and_bandwidth(hdd_adapter_t *adapter,
-		uint32_t chan_number,
-		phy_ch_width chan_bw)
-{
-	uint8_t chan[WNI_CFG_VALID_CHANNEL_LIST_LEN];
-	uint32_t len = WNI_CFG_VALID_CHANNEL_LIST_LEN, i;
-	bool found = false;
-	tHalHandle hal;
-
-	hal = WLAN_HDD_GET_HAL_CTX(adapter);
-	if (!hal) {
-		hdd_err("Invalid HAL context");
-		return -EINVAL;
-	}
-
-	if (0 != sme_cfg_get_str(hal, WNI_CFG_VALID_CHANNEL_LIST, chan, &len)) {
-		hdd_err("No valid channel list");
-		return -EOPNOTSUPP;
-	}
-
-	for (i = 0; i < len; i++) {
-		if (chan[i] == chan_number) {
-			found = true;
-			break;
-		}
-	}
-
-	if (found == false) {
-		hdd_err("Channel not in driver's valid channel list");
-		return -EOPNOTSUPP;
-	}
-
-	if ((!CDS_IS_CHANNEL_24GHZ(chan_number)) &&
-			(!CDS_IS_CHANNEL_5GHZ(chan_number))) {
-		hdd_err("CH %d is not in 2.4GHz or 5GHz", chan_number);
-		return -EINVAL;
-	}
-
-	if (CDS_IS_CHANNEL_24GHZ(chan_number)) {
-		if (chan_bw == CH_WIDTH_80MHZ) {
-			hdd_err("BW80 not possible in 2.4GHz band");
-			return -EINVAL;
-		}
-		if ((chan_bw != CH_WIDTH_20MHZ) && (chan_number == 14) &&
-				(chan_bw != CH_WIDTH_MAX)) {
-			hdd_err("Only BW20 possible on channel 14");
-			return -EINVAL;
-		}
-	}
-
-	if (CDS_IS_CHANNEL_5GHZ(chan_number)) {
-		if ((chan_bw != CH_WIDTH_20MHZ) && (chan_number == 165) &&
-				(chan_bw != CH_WIDTH_MAX)) {
-			hdd_err("Only BW20 possible on channel 165");
-			return -EINVAL;
-		}
-	}
-
-	return 0;
-}
-
-static int __hdd_netdev_notifier_call(struct notifier_block *nb,
-				    unsigned long state, void *data)
-{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-	struct netdev_notifier_info *dev_notif_info = data;
-	struct net_device *dev = dev_notif_info->dev;
-#else
-	struct net_device *dev = data;
-#endif
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-
-	/* Make sure that this callback corresponds to our device. */
-	if ((strncmp(dev->name, "wlan", 4)) && (strncmp(dev->name, "p2p", 3)))
-		return NOTIFY_DONE;
-
-	if ((adapter->magic != WLAN_HDD_ADAPTER_MAGIC) &&
-	    (adapter->dev != dev)) {
-		hddLog(LOGE, FL("device adapter is not matching!!!"));
-		return NOTIFY_DONE;
-	}
-
-	if (!dev->ieee80211_ptr) {
-		hddLog(LOGE, FL("ieee80211_ptr is NULL!!!"));
-		return NOTIFY_DONE;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (NULL == hdd_ctx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("HDD Context Null Pointer"));
-		CDF_ASSERT(0);
-		return NOTIFY_DONE;
-	}
-	if (cds_is_driver_recovering())
-		return NOTIFY_DONE;
-
-	hddLog(CDF_TRACE_LEVEL_INFO, FL("%s New Net Device State = %lu"),
-	       dev->name, state);
-
-	switch (state) {
-	case NETDEV_REGISTER:
-		break;
-
-	case NETDEV_UNREGISTER:
-		break;
-
-	case NETDEV_UP:
-		sme_ch_avoid_update_req(hdd_ctx->hHal);
-		break;
-
-	case NETDEV_DOWN:
-		break;
-
-	case NETDEV_CHANGE:
-		if (true == adapter->isLinkUpSvcNeeded)
-			complete(&adapter->linkup_event_var);
-		break;
-
-	case NETDEV_GOING_DOWN:
-		if (adapter->scan_info.mScanPending != false) {
-			unsigned long rc;
-			INIT_COMPLETION(adapter->scan_info.
-					abortscan_event_var);
-			hdd_abort_mac_scan(adapter->pHddCtx,
-					   adapter->sessionId,
-					   eCSR_SCAN_ABORT_DEFAULT);
-			rc = wait_for_completion_timeout(
-				&adapter->scan_info.abortscan_event_var,
-				msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN));
-			if (!rc) {
-				hddLog(LOGE,
-				       FL("Timeout occurred while waiting for abortscan"));
-			}
-		} else {
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       FL("Scan is not Pending from user"));
-		}
-		break;
-
-	default:
-		break;
-	}
-
-	return NOTIFY_DONE;
-}
-
-/**
- * hdd_netdev_notifier_call() - netdev notifier callback function
- * @nb: pointer to notifier block
- * @state: state
- * @ndev: ndev pointer
- *
- * Return: 0 on success, error number otherwise.
- */
-static int hdd_netdev_notifier_call(struct notifier_block *nb,
-					unsigned long state,
-					void *ndev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_netdev_notifier_call(nb, state, ndev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-struct notifier_block hdd_netdev_notifier = {
-	.notifier_call = hdd_netdev_notifier_call,
-};
-
-/* variable to hold the insmod parameters */
-static int con_mode;
-
-/* Variable to hold connection mode including module parameter con_mode */
-static int curr_con_mode;
-
-/**
- * hdd_map_nl_chan_width() - Map NL channel width to internal representation
- * @ch_width: NL channel width
- *
- * Converts the NL channel width to the driver's internal representation
- *
- * Return: Converted channel width. In case of non matching NL channel width,
- * CH_WIDTH_MAX will be returned.
- */
-phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width)
-{
-	switch (ch_width) {
-	case NL80211_CHAN_WIDTH_20_NOHT:
-	case NL80211_CHAN_WIDTH_20:
-		return CH_WIDTH_20MHZ;
-	case NL80211_CHAN_WIDTH_40:
-		return CH_WIDTH_40MHZ;
-		break;
-	case NL80211_CHAN_WIDTH_80:
-		return CH_WIDTH_80MHZ;
-	case NL80211_CHAN_WIDTH_80P80:
-		return CH_WIDTH_80P80MHZ;
-	case NL80211_CHAN_WIDTH_160:
-		return CH_WIDTH_160MHZ;
-	case NL80211_CHAN_WIDTH_5:
-	case NL80211_CHAN_WIDTH_10:
-	default:
-		hdd_err("Invalid channel width %d, setting to default",
-				ch_width);
-		return CH_WIDTH_MAX;
-	}
-}
-
-/* wlan_hdd_find_opclass() - Find operating class for a channel
- * @hal: handler to HAL
- * @channel: channel id
- * @bw_offset: bandwidth offset
- *
- * Function invokes sme api to find the operating class
- *
- * Return: operating class
- */
-uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel,
-				uint8_t bw_offset)
-{
-	uint8_t opclass = 0;
-
-	sme_get_opclass(hal, channel, bw_offset, &opclass);
-	return opclass;
-}
-
-/**
- * hdd_cdf_trace_enable() - configure initial CDF Trace enable
- * @moduleId:	Module whose trace level is being configured
- * @bitmask:	Bitmask of log levels to be enabled
- *
- * Called immediately after the cfg.ini is read in order to configure
- * the desired trace levels.
- *
- * Return: None
- */
-static void hdd_cdf_trace_enable(CDF_MODULE_ID moduleId, uint32_t bitmask)
-{
-	CDF_TRACE_LEVEL level;
-
-	/*
-	 * if the bitmask is the default value, then a bitmask was not
-	 * specified in cfg.ini, so leave the logging level alone (it
-	 * will remain at the "compiled in" default value)
-	 */
-	if (CFG_CDF_TRACE_ENABLE_DEFAULT == bitmask) {
-		return;
-	}
-
-	/* a mask was specified.  start by disabling all logging */
-	cdf_trace_set_value(moduleId, CDF_TRACE_LEVEL_NONE, 0);
-
-	/* now cycle through the bitmask until all "set" bits are serviced */
-	level = CDF_TRACE_LEVEL_FATAL;
-	while (0 != bitmask) {
-		if (bitmask & 1) {
-			cdf_trace_set_value(moduleId, level, 1);
-		}
-		level++;
-		bitmask >>= 1;
-	}
-}
-
-/**
- * wlan_hdd_validate_context() - check the HDD context
- * @hdd_ctx:	HDD context pointer
- *
- * Return: 0 if the context is valid. Error code otherwise
- */
-int wlan_hdd_validate_context(hdd_context_t *hdd_ctx)
-{
-	if (NULL == hdd_ctx || NULL == hdd_ctx->config) {
-		hddLog(LOGE, FL("HDD context is Null"));
-		return -ENODEV;
-	}
-
-	if (cds_is_driver_recovering()) {
-		hdd_err("Recovery in Progress. State: 0x%x Ignore!!!",
-			 cds_get_driver_state());
-		return -EAGAIN;
-	}
-
-	if (cds_is_load_or_unload_in_progress()) {
-		hdd_err("Unloading/Loading in Progress. Ignore!!!: 0x%x",
-			cds_get_driver_state());
-		return -EAGAIN;
-	}
-	return 0;
-}
-
-void hdd_checkandupdate_phymode(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_t *adapter = NULL;
-	hdd_station_ctx_t *pHddStaCtx = NULL;
-	eCsrPhyMode phyMode;
-	struct hdd_config *cfg_param = NULL;
-
-	if (NULL == hdd_ctx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("HDD Context is null !!"));
-		return;
-	}
-
-	adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_INFRA_STATION);
-	if (NULL == adapter) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("adapter is null !!"));
-		return;
-	}
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-
-	cfg_param = hdd_ctx->config;
-	if (NULL == cfg_param) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("cfg_params not available !!"));
-		return;
-	}
-
-	phyMode = sme_get_phy_mode(WLAN_HDD_GET_HAL_CTX(adapter));
-
-	if (!hdd_ctx->isVHT80Allowed) {
-		if ((eCSR_DOT11_MODE_AUTO == phyMode) ||
-		    (eCSR_DOT11_MODE_11ac == phyMode) ||
-		    (eCSR_DOT11_MODE_11ac_ONLY == phyMode)) {
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       FL("Setting phymode to 11n!!"));
-			sme_set_phy_mode(WLAN_HDD_GET_HAL_CTX(adapter),
-					 eCSR_DOT11_MODE_11n);
-		}
-	} else {
-		/*
-		 * New country Supports 11ac as well resetting value back from
-		 * .ini
-		 */
-		sme_set_phy_mode(WLAN_HDD_GET_HAL_CTX(adapter),
-				 hdd_cfg_xlate_to_csr_phy_mode(cfg_param->
-							       dot11Mode));
-		return;
-	}
-
-	if ((eConnectionState_Associated == pHddStaCtx->conn_info.connState) &&
-	    ((eCSR_CFG_DOT11_MODE_11AC_ONLY == pHddStaCtx->conn_info.dot11Mode)
-	     || (eCSR_CFG_DOT11_MODE_11AC ==
-		 pHddStaCtx->conn_info.dot11Mode))) {
-		CDF_STATUS cdf_status;
-
-		/* need to issue a disconnect to CSR. */
-		INIT_COMPLETION(adapter->disconnect_comp_var);
-		cdf_status = sme_roam_disconnect(WLAN_HDD_GET_HAL_CTX(adapter),
-						 adapter->sessionId,
-						 eCSR_DISCONNECT_REASON_UNSPECIFIED);
-
-		if (CDF_STATUS_SUCCESS == cdf_status) {
-			unsigned long rc;
-
-			rc = wait_for_completion_timeout(
-				&adapter->disconnect_comp_var,
-				msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
-			if (!rc)
-				hddLog(LOGE,
-				       FL("failure waiting for disconnect_comp_var"));
-		}
-	}
-}
-
-/**
- * hdd_set_ibss_power_save_params() - update IBSS Power Save params to WMA.
- * @hdd_adapter_t Hdd adapter.
- *
- * This function sets the IBSS power save config parameters to WMA
- * which will send it to firmware if FW supports IBSS power save
- * before vdev start.
- *
- * Return: CDF_STATUS CDF_STATUS_SUCCESS on Success and CDF_STATUS_E_FAILURE
- *         on failure.
- */
-CDF_STATUS hdd_set_ibss_power_save_params(hdd_adapter_t *adapter)
-{
-	int ret;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-	if (hdd_ctx == NULL) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("HDD context is null"));
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE,
-				  hdd_ctx->config->ibssATIMWinSize,
-				  VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("WMA_VDEV_IBSS_SET_ATIM_WINDOW_SIZE failed %d"), ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED,
-				  hdd_ctx->config->isIbssPowerSaveAllowed,
-				  VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("WMA_VDEV_IBSS_SET_POWER_SAVE_ALLOWED failed %d"),
-		       ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED,
-				  hdd_ctx->config->
-				  isIbssPowerCollapseAllowed, VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("WMA_VDEV_IBSS_SET_POWER_COLLAPSE_ALLOWED failed %d"),
-		       ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX,
-				  hdd_ctx->config->isIbssAwakeOnTxRx,
-				  VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("WMA_VDEV_IBSS_SET_AWAKE_ON_TX_RX failed %d"), ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_SET_INACTIVITY_TIME,
-				  hdd_ctx->config->ibssInactivityCount,
-				  VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("WMA_VDEV_IBSS_SET_INACTIVITY_TIME failed %d"), ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME,
-				  hdd_ctx->config->ibssTxSpEndInactivityTime,
-				  VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL(
-			  "WMA_VDEV_IBSS_SET_TXSP_END_INACTIVITY_TIME failed %d"
-			 ),
-		       ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS,
-				  hdd_ctx->config->ibssPsWarmupTime,
-				  VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("WMA_VDEV_IBSS_PS_SET_WARMUP_TIME_SECS failed %d"),
-		       ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	ret = wma_cli_set_command(adapter->sessionId,
-				  WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW,
-				  hdd_ctx->config->ibssPs1RxChainInAtimEnable,
-				  VDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL(
-			  "WMA_VDEV_IBSS_PS_SET_1RX_CHAIN_IN_ATIM_WINDOW failed %d"
-			 ),
-		       ret);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-#define INTF_MACADDR_MASK       0x7
-
-/**
- * hdd_update_macaddr() - update mac address
- * @config:	hdd configuration
- * @hw_macaddr:	mac address
- *
- * Mac address for multiple virtual interface is found as following
- * i) The mac address of the first interface is just the actual hw mac address.
- * ii) MSM 3 or 4 bits of byte5 of the actual mac address are used to
- *     define the mac address for the remaining interfaces and locally
- *     admistered bit is set. INTF_MACADDR_MASK is based on the number of
- *     supported virtual interfaces, right now this is 0x07 (meaning 8
- *     interface).
- *     Byte[3] of second interface will be hw_macaddr[3](bit5..7) + 1,
- *     for third interface it will be hw_macaddr[3](bit5..7) + 2, etc.
- *
- * Return: None
- */
-void hdd_update_macaddr(struct hdd_config *config,
-			struct cdf_mac_addr hw_macaddr)
-{
-	int8_t i;
-	uint8_t macaddr_b3, tmp_br3;
-
-	cdf_mem_copy(config->intfMacAddr[0].bytes, hw_macaddr.bytes,
-		     CDF_MAC_ADDR_SIZE);
-	for (i = 1; i < CDF_MAX_CONCURRENCY_PERSONA; i++) {
-		cdf_mem_copy(config->intfMacAddr[i].bytes, hw_macaddr.bytes,
-			     CDF_MAC_ADDR_SIZE);
-		macaddr_b3 = config->intfMacAddr[i].bytes[3];
-		tmp_br3 = ((macaddr_b3 >> 4 & INTF_MACADDR_MASK) + i) &
-			  INTF_MACADDR_MASK;
-		macaddr_b3 += tmp_br3;
-
-		/* XOR-ing bit-24 of the mac address. This will give enough
-		 * mac address range before collision
-		 */
-		macaddr_b3 ^= (1 << 7);
-
-		/* Set locally administered bit */
-		config->intfMacAddr[i].bytes[0] |= 0x02;
-		config->intfMacAddr[i].bytes[3] = macaddr_b3;
-		hddLog(CDF_TRACE_LEVEL_INFO, "config->intfMacAddr[%d]: "
-		       MAC_ADDRESS_STR, i,
-		       MAC_ADDR_ARRAY(config->intfMacAddr[i].bytes));
-	}
-}
-
-static void hdd_update_tgt_services(hdd_context_t *hdd_ctx,
-				    struct wma_tgt_services *cfg)
-{
-	struct hdd_config *config = hdd_ctx->config;
-
-	/* Set up UAPSD */
-	config->apUapsdEnabled &= cfg->uapsd;
-
-#ifdef WLAN_FEATURE_11AC
-	/* 11AC mode support */
-	if ((config->dot11Mode == eHDD_DOT11_MODE_11ac ||
-	     config->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY) && !cfg->en_11ac)
-		config->dot11Mode = eHDD_DOT11_MODE_AUTO;
-#endif /* #ifdef WLAN_FEATURE_11AC */
-
-	/* ARP offload: override user setting if invalid  */
-	config->fhostArpOffload &= cfg->arp_offload;
-
-#ifdef FEATURE_WLAN_SCAN_PNO
-	/* PNO offload */
-	hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-	       FL("PNO Capability in f/w = %d"), cfg->pno_offload);
-	if (cfg->pno_offload)
-		config->PnoOffload = true;
-#endif
-#ifdef FEATURE_WLAN_TDLS
-	config->fEnableTDLSSupport &= cfg->en_tdls;
-	config->fEnableTDLSOffChannel &= cfg->en_tdls_offchan;
-	config->fEnableTDLSBufferSta &= cfg->en_tdls_uapsd_buf_sta;
-	if (config->fTDLSUapsdMask && cfg->en_tdls_uapsd_sleep_sta) {
-		config->fEnableTDLSSleepSta = true;
-	} else {
-		config->fEnableTDLSSleepSta = false;
-	}
-#endif
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	config->isRoamOffloadEnabled &= cfg->en_roam_offload;
-#endif
-	sme_update_tgt_services(hdd_ctx->hHal, cfg);
-
-}
-
-static void hdd_update_tgt_ht_cap(hdd_context_t *hdd_ctx,
-				  struct wma_tgt_ht_cap *cfg)
-{
-	CDF_STATUS status;
-	uint32_t value, val32;
-	uint16_t val16;
-	struct hdd_config *pconfig = hdd_ctx->config;
-	tSirMacHTCapabilityInfo *phtCapInfo;
-	uint8_t mcs_set[SIZE_OF_SUPPORTED_MCS_SET];
-	uint8_t enable_tx_stbc;
-
-	/* check and update RX STBC */
-	if (pconfig->enableRxSTBC && !cfg->ht_rx_stbc)
-		pconfig->enableRxSTBC = cfg->ht_rx_stbc;
-
-	/* get the MPDU density */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_MPDU_DENSITY, &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get MPDU DENSITY"));
-		value = 0;
-	}
-
-	/*
-	 * MPDU density:
-	 * override user's setting if value is larger
-	 * than the one supported by target
-	 */
-	if (value > cfg->mpdu_density) {
-		status = sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_MPDU_DENSITY,
-					 cfg->mpdu_density);
-
-		if (status == CDF_STATUS_E_FAILURE)
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set MPDU DENSITY to CCM"));
-	}
-
-	/* get the HT capability info */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, &val32);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get HT capability info"));
-		return;
-	}
-	val16 = (uint16_t) val32;
-	phtCapInfo = (tSirMacHTCapabilityInfo *) &val16;
-
-	/* Set the LDPC capability */
-	phtCapInfo->advCodingCap = cfg->ht_rx_ldpc;
-
-	if (pconfig->ShortGI20MhzEnable && !cfg->ht_sgi_20)
-		pconfig->ShortGI20MhzEnable = cfg->ht_sgi_20;
-
-	if (pconfig->ShortGI40MhzEnable && !cfg->ht_sgi_40)
-		pconfig->ShortGI40MhzEnable = cfg->ht_sgi_40;
-
-	hdd_ctx->num_rf_chains = cfg->num_rf_chains;
-	hdd_ctx->ht_tx_stbc_supported = cfg->ht_tx_stbc;
-
-	enable_tx_stbc = pconfig->enableTxSTBC;
-
-	if (pconfig->enable2x2 && (cfg->num_rf_chains == 2)) {
-		pconfig->enable2x2 = 1;
-	} else {
-		pconfig->enable2x2 = 0;
-		enable_tx_stbc = 0;
-
-		/* 1x1 */
-		/* Update Rx Highest Long GI data Rate */
-		if (sme_cfg_set_int(hdd_ctx->hHal,
-				    WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE,
-				    HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1)
-				== CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE,
-			       FL(
-				  "Could not pass on WNI_CFG_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE to CCM"
-				 ));
-		}
-
-		/* Update Tx Highest Long GI data Rate */
-		if (sme_cfg_set_int
-			    (hdd_ctx->hHal,
-			     WNI_CFG_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE,
-			     HDD_VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_1_1) ==
-			    CDF_STATUS_E_FAILURE) {
-			hddLog(LOGE,
-			       FL(
-				  "Could not pass on HDD_VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_1_1 to CCM"
-				 ));
-		}
-	}
-	if (!(cfg->ht_tx_stbc && pconfig->enable2x2))
-		enable_tx_stbc = 0;
-	phtCapInfo->txSTBC = enable_tx_stbc;
-
-	val32 = val16;
-	status = sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_HT_CAP_INFO, val32);
-	if (status != CDF_STATUS_SUCCESS)
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("could not set HT capability to CCM"));
-#define WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES 0xff
-	value = SIZE_OF_SUPPORTED_MCS_SET;
-	if (sme_cfg_get_str(hdd_ctx->hHal, WNI_CFG_SUPPORTED_MCS_SET, mcs_set,
-			    &value) == CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_INFO, FL("Read MCS rate set"));
-
-		if (pconfig->enable2x2) {
-			for (value = 0; value < cfg->num_rf_chains; value++)
-				mcs_set[value] =
-					WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES;
-
-			status =
-				sme_cfg_set_str(hdd_ctx->hHal,
-						WNI_CFG_SUPPORTED_MCS_SET,
-						mcs_set,
-						SIZE_OF_SUPPORTED_MCS_SET);
-			if (status == CDF_STATUS_E_FAILURE)
-				hddLog(CDF_TRACE_LEVEL_FATAL,
-				       FL("could not set MCS SET to CCM"));
-		}
-	}
-#undef WLAN_HDD_RX_MCS_ALL_NSTREAM_RATES
-}
-
-#ifdef WLAN_FEATURE_11AC
-static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx,
-				   struct wma_tgt_vht_cap *cfg)
-{
-	CDF_STATUS status;
-	uint32_t value = 0;
-	struct hdd_config *pconfig = hdd_ctx->config;
-	struct wiphy *wiphy = hdd_ctx->wiphy;
-	struct ieee80211_supported_band *band_5g =
-		wiphy->bands[IEEE80211_BAND_5GHZ];
-
-	/* Get the current MPDU length */
-	status =
-		sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH,
-				&value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("could not get MPDU LENGTH"));
-		value = 0;
-	}
-
-	/*
-	 * VHT max MPDU length:
-	 * override if user configured value is too high
-	 * that the target cannot support
-	 */
-	if (value > cfg->vht_max_mpdu) {
-		status = sme_cfg_set_int(hdd_ctx->hHal,
-					 WNI_CFG_VHT_MAX_MPDU_LENGTH,
-					 cfg->vht_max_mpdu);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set VHT MAX MPDU LENGTH"));
-		}
-	}
-
-	/* Get the current supported chan width */
-	status = sme_cfg_get_int(hdd_ctx->hHal,
-				WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET,
-				&value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get MPDU LENGTH"));
-		value = 0;
-	}
-
-	/* Get the current RX LDPC setting */
-	status =
-		sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_LDPC_CODING_CAP,
-				&value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT LDPC CODING CAP"));
-		value = 0;
-	}
-
-	/* Set the LDPC capability */
-	if (value && !cfg->vht_rx_ldpc) {
-		status = sme_cfg_set_int(hdd_ctx->hHal,
-					 WNI_CFG_VHT_LDPC_CODING_CAP,
-					 cfg->vht_rx_ldpc);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set VHT LDPC CODING CAP to CCM"));
-		}
-	}
-
-	/* Get current GI 80 value */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_SHORT_GI_80MHZ,
-				&value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get SHORT GI 80MHZ"));
-		value = 0;
-	}
-
-	/* set the Guard interval 80MHz */
-	if (value && !cfg->vht_short_gi_80) {
-		status = sme_cfg_set_int(hdd_ctx->hHal,
-					 WNI_CFG_VHT_SHORT_GI_80MHZ,
-					 cfg->vht_short_gi_80);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set SHORT GI 80MHZ to CCM"));
-		}
-	}
-
-	/* Get current GI 160 value */
-	status = sme_cfg_get_int(hdd_ctx->hHal,
-				 WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ,
-				 &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get SHORT GI 80 & 160"));
-		value = 0;
-	}
-
-	/* Get VHT TX STBC cap */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_TXSTBC, &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT TX STBC"));
-		value = 0;
-	}
-
-	/* VHT TX STBC cap */
-	if (value && !cfg->vht_tx_stbc) {
-		status = sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_TXSTBC,
-					 cfg->vht_tx_stbc);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set the VHT TX STBC to CCM"));
-		}
-	}
-
-	/* Get VHT RX STBC cap */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_RXSTBC, &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT RX STBC"));
-		value = 0;
-	}
-
-	/* VHT RX STBC cap */
-	if (value && !cfg->vht_rx_stbc) {
-		status = sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_RXSTBC,
-					 cfg->vht_rx_stbc);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set the VHT RX STBC to CCM"));
-		}
-	}
-
-	/* Get VHT SU Beamformer cap */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_SU_BEAMFORMER_CAP,
-				 &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT SU BEAMFORMER CAP"));
-		value = 0;
-	}
-
-	/* set VHT SU Beamformer cap */
-	if (value && !cfg->vht_su_bformer) {
-		status = sme_cfg_set_int(hdd_ctx->hHal,
-					 WNI_CFG_VHT_SU_BEAMFORMER_CAP,
-					 cfg->vht_su_bformer);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set VHT SU BEAMFORMER CAP"));
-		}
-	}
-
-	/* check and update SU BEAMFORMEE capabality */
-	if (pconfig->enableTxBF && !cfg->vht_su_bformee)
-		pconfig->enableTxBF = cfg->vht_su_bformee;
-
-	status = sme_cfg_set_int(hdd_ctx->hHal,
-				 WNI_CFG_VHT_SU_BEAMFORMEE_CAP,
-				 pconfig->enableTxBF);
-
-	if (status == CDF_STATUS_E_FAILURE) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("could not set VHT SU BEAMFORMEE CAP"));
-	}
-
-	/* Get VHT MU Beamformer cap */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_MU_BEAMFORMER_CAP,
-				 &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT MU BEAMFORMER CAP"));
-		value = 0;
-	}
-
-	/* set VHT MU Beamformer cap */
-	if (value && !cfg->vht_mu_bformer) {
-		status = sme_cfg_set_int(hdd_ctx->hHal,
-					 WNI_CFG_VHT_MU_BEAMFORMER_CAP,
-					 cfg->vht_mu_bformer);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "could not set the VHT MU BEAMFORMER CAP to CCM"
-				 ));
-		}
-	}
-
-	/* Get VHT MU Beamformee cap */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_MU_BEAMFORMEE_CAP,
-				 &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT MU BEAMFORMEE CAP"));
-		value = 0;
-	}
-
-	/* set VHT MU Beamformee cap */
-	if (value && !cfg->vht_mu_bformee) {
-		status = sme_cfg_set_int(hdd_ctx->hHal,
-					 WNI_CFG_VHT_MU_BEAMFORMEE_CAP,
-					 cfg->vht_mu_bformee);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set VHT MU BEAMFORMER CAP"));
-		}
-	}
-
-	/* Get VHT MAX AMPDU Len exp */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_AMPDU_LEN_EXPONENT,
-				 &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT AMPDU LEN"));
-		value = 0;
-	}
-
-	/*
-	 * VHT max AMPDU len exp:
-	 * override if user configured value is too high
-	 * that the target cannot support.
-	 * Even though Rome publish ampdu_len=7, it can
-	 * only support 4 because of some h/w bug.
-	 */
-
-	if (value > cfg->vht_max_ampdu_len_exp) {
-		status = sme_cfg_set_int(hdd_ctx->hHal,
-					 WNI_CFG_VHT_AMPDU_LEN_EXPONENT,
-					 cfg->vht_max_ampdu_len_exp);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set the VHT AMPDU LEN EXP"));
-		}
-	}
-
-	/* Get VHT TXOP PS CAP */
-	status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_TXOP_PS, &value);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("could not get VHT TXOP PS"));
-		value = 0;
-	}
-
-	/* set VHT TXOP PS cap */
-	if (value && !cfg->vht_txop_ps) {
-		status = sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_VHT_TXOP_PS,
-					 cfg->vht_txop_ps);
-
-		if (status == CDF_STATUS_E_FAILURE) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("could not set the VHT TXOP PS"));
-		}
-	}
-
-	if (WMI_VHT_CAP_MAX_MPDU_LEN_11454 == cfg->vht_max_mpdu)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454;
-	else if (WMI_VHT_CAP_MAX_MPDU_LEN_7935 == cfg->vht_max_mpdu)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991;
-	else
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895;
-
-
-	if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_80P80MHZ)) {
-		band_5g->vht_cap.cap |=
-			IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
-	}
-	if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_160MHZ)) {
-		band_5g->vht_cap.cap |=
-			IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
-	}
-
-	if (cfg->vht_rx_ldpc & WMI_VHT_CAP_RX_LDPC)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXLDPC;
-
-	if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_80;
-	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_tx_stbc & WMI_VHT_CAP_TX_STBC)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_TXSTBC;
-
-	if (cfg->vht_rx_stbc & WMI_VHT_CAP_RX_STBC_1SS)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXSTBC_1;
-	if (cfg->vht_rx_stbc & WMI_VHT_CAP_RX_STBC_2SS)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXSTBC_2;
-	if (cfg->vht_rx_stbc & WMI_VHT_CAP_RX_STBC_3SS)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXSTBC_3;
-
-	band_5g->vht_cap.cap |=
-		(cfg->vht_max_ampdu_len_exp <<
-		 IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT);
-
-	if (cfg->vht_su_bformer & WMI_VHT_CAP_SU_BFORMER)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE;
-	if (cfg->vht_su_bformee & WMI_VHT_CAP_SU_BFORMEE)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE;
-	if (cfg->vht_mu_bformer & WMI_VHT_CAP_MU_BFORMER)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE;
-	if (cfg->vht_mu_bformee & WMI_VHT_CAP_MU_BFORMEE)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
-
-	if (cfg->vht_txop_ps & WMI_VHT_CAP_TXOP_PS)
-		band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_VHT_TXOP_PS;
-
-}
-#endif /* #ifdef WLAN_FEATURE_11AC */
-
-void hdd_update_tgt_cfg(void *context, void *param)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *) context;
-	struct wma_tgt_cfg *cfg = param;
-	uint8_t temp_band_cap;
-
-	/* first store the INI band capability */
-	temp_band_cap = hdd_ctx->config->nBandCapability;
-
-	hdd_ctx->config->nBandCapability = cfg->band_cap;
-
-	/* now overwrite the target band capability with INI
-	   setting if INI setting is a subset */
-
-	if ((hdd_ctx->config->nBandCapability == eCSR_BAND_ALL) &&
-	    (temp_band_cap != eCSR_BAND_ALL))
-		hdd_ctx->config->nBandCapability = temp_band_cap;
-	else if ((hdd_ctx->config->nBandCapability != eCSR_BAND_ALL) &&
-		 (temp_band_cap != eCSR_BAND_ALL) &&
-		 (hdd_ctx->config->nBandCapability != temp_band_cap)) {
-		hddLog(CDF_TRACE_LEVEL_WARN,
-		       FL("ini BandCapability not supported by the target"));
-	}
-
-	if (!cds_is_driver_recovering()) {
-		hdd_ctx->reg.reg_domain = cfg->reg_domain;
-		hdd_ctx->reg.eeprom_rd_ext = cfg->eeprom_rd_ext;
-	}
-
-	/* This can be extended to other configurations like ht, vht cap... */
-
-	if (!cdf_is_macaddr_zero(&cfg->hw_macaddr)) {
-		hdd_update_macaddr(hdd_ctx->config, cfg->hw_macaddr);
-	} else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL(
-			  "Invalid MAC passed from target, using MAC from ini file"
-			  MAC_ADDRESS_STR),
-		       MAC_ADDR_ARRAY(hdd_ctx->config->intfMacAddr[0].bytes));
-	}
-
-	hdd_ctx->target_fw_version = cfg->target_fw_version;
-
-	hdd_ctx->max_intf_count = cfg->max_intf_count;
-
-#ifdef WLAN_FEATURE_LPSS
-	hdd_ctx->lpss_support = cfg->lpss_support;
-#endif
-
-	hdd_wlan_set_egap_support(hdd_ctx, cfg);
-
-	hdd_ctx->ap_arpns_support = cfg->ap_arpns_support;
-	hdd_update_tgt_services(hdd_ctx, &cfg->services);
-
-	hdd_update_tgt_ht_cap(hdd_ctx, &cfg->ht_cap);
-
-#ifdef WLAN_FEATURE_11AC
-	hdd_update_tgt_vht_cap(hdd_ctx, &cfg->vht_cap);
-#endif /* #ifdef WLAN_FEATURE_11AC */
-}
-
-/**
- * hdd_dfs_indicate_radar() - handle radar detection on current SAP channel
- * @context:	HDD context pointer
- * @param:	HDD radar indication pointer
- *
- * This function is invoked when a radar in found on the
- * SAP current operating channel and Data Tx from netif
- * has to be stopped to honor the DFS regulations.
- * Actions: Stop the netif Tx queues,Indicate Radar present
- * in HDD context for future usage.
- *
- * Return: true to allow radar indication to host else false
- */
-bool hdd_dfs_indicate_radar(void *context, void *param)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *) context;
-	struct wma_dfs_radar_ind *hdd_radar_event =
-		(struct wma_dfs_radar_ind *)param;
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	hdd_adapter_t *adapter;
-	CDF_STATUS status;
-
-	if (!hdd_ctx || !hdd_radar_event ||
-		 hdd_ctx->config->disableDFSChSwitch)
-		return true;
-
-	if (true == hdd_radar_event->dfs_radar_status) {
-		mutex_lock(&hdd_ctx->dfs_lock);
-		if (hdd_ctx->dfs_radar_found) {
-			/*
-			 * Application already triggered channel switch
-			 * on current channel, so return here.
-			 */
-			mutex_unlock(&hdd_ctx->dfs_lock);
-			return false;
-		}
-
-		hdd_ctx->dfs_radar_found = true;
-		mutex_unlock(&hdd_ctx->dfs_lock);
-
-		status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-		while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-			adapter = adapterNode->pAdapter;
-			if (WLAN_HDD_SOFTAP == adapter->device_mode ||
-			    WLAN_HDD_P2P_GO == adapter->device_mode) {
-				WLAN_HDD_GET_AP_CTX_PTR(adapter)->
-				dfs_cac_block_tx = true;
-			}
-
-			status = hdd_get_next_adapter(hdd_ctx,
-						      adapterNode,
-						      &pNext);
-			adapterNode = pNext;
-		}
-	}
-
-	return true;
-}
-
-/**
- * hdd_is_valid_mac_address() - validate MAC address
- * @pMacAddr:	Pointer to the input MAC address
- *
- * This function validates whether the given MAC address is valid or not
- * Expected MAC address is of the format XX:XX:XX:XX:XX:XX
- * where X is the hexa decimal digit character and separated by ':'
- * This algorithm works even if MAC address is not separated by ':'
- *
- * This code checks given input string mac contains exactly 12 hexadecimal
- * digits and a separator colon : appears in the input string only after
- * an even number of hex digits.
- *
- * Return: 1 for valid and 0 for invalid
- */
-bool hdd_is_valid_mac_address(const uint8_t *pMacAddr)
-{
-	int xdigit = 0;
-	int separator = 0;
-	while (*pMacAddr) {
-		if (isxdigit(*pMacAddr)) {
-			xdigit++;
-		} else if (':' == *pMacAddr) {
-			if (0 == xdigit || ((xdigit / 2) - 1) != separator)
-				break;
-
-			++separator;
-		} else {
-			/* Invalid MAC found */
-			return 0;
-		}
-		++pMacAddr;
-	}
-	return xdigit == 12 && (separator == 5 || separator == 0);
-}
-
-/**
- * __hdd_open() - HDD Open function
- * @dev:	Pointer to net_device structure
- *
- * This is called in response to ifconfig up
- *
- * Return: 0 for success; non-zero for failure
- */
-static int __hdd_open(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	int ret;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD, TRACE_CODE_HDD_OPEN_REQUEST,
-			 adapter->sessionId, adapter->device_mode));
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return ret;
-	}
-
-	set_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);
-	if (hdd_conn_is_connected(WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
-		hddLog(LOG1, FL("Enabling Tx Queues"));
-		/* Enable TX queues only when we are connected */
-		wlan_hdd_netif_queue_control(adapter,
-					WLAN_START_ALL_NETIF_QUEUE,
-					WLAN_CONTROL_PATH);
-	}
-
-	return ret;
-}
-
-/**
- * hdd_open() - Wrapper function for __hdd_open to protect it from SSR
- * @dev:	Pointer to net_device structure
- *
- * This is called in response to ifconfig up
- *
- * Return: 0 for success; non-zero for failure
- */
-int hdd_open(struct net_device *dev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_open(dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __hdd_stop() - HDD stop function
- * @dev:	Pointer to net_device structure
- *
- * This is called in response to ifconfig down
- *
- * Return: 0 for success; non-zero for failure
- */
-static int __hdd_stop(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	int ret;
-
-	ENTER();
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD, TRACE_CODE_HDD_STOP_REQUEST,
-			 adapter->sessionId, adapter->device_mode));
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	/* Nothing to be done if the interface is not opened */
-	if (false == test_bit(DEVICE_IFACE_OPENED, &adapter->event_flags)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("NETDEV Interface is not OPENED"));
-		return -ENODEV;
-	}
-
-	/* Make sure the interface is marked as closed */
-	clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);
-	hddLog(CDF_TRACE_LEVEL_INFO, FL("Disabling OS Tx queues"));
-
-	/*
-	 * Disable TX on the interface, after this hard_start_xmit() will not
-	 * be called on that interface
-	 */
-	hddLog(LOG1, FL("Disabling queues"));
-	wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_TX_DISABLE_N_CARRIER,
-				   WLAN_CONTROL_PATH);
-
-	/*
-	 * The interface is marked as down for outside world (aka kernel)
-	 * But the driver is pretty much alive inside. The driver needs to
-	 * tear down the existing connection on the netdev (session)
-	 * cleanup the data pipes and wait until the control plane is stabilized
-	 * for this interface. The call also needs to wait until the above
-	 * mentioned actions are completed before returning to the caller.
-	 * Notice that the hdd_stop_adapter is requested not to close the session
-	 * That is intentional to be able to scan if it is a STA/P2P interface
-	 */
-	hdd_stop_adapter(hdd_ctx, adapter, false);
-
-	/* DeInit the adapter. This ensures datapath cleanup as well */
-	hdd_deinit_adapter(hdd_ctx, adapter, true);
-
-	EXIT();
-	return 0;
-}
-
-/**
- * hdd_stop() - Wrapper function for __hdd_stop to protect it from SSR
- * @dev: pointer to net_device structure
- *
- * This is called in response to ifconfig down
- *
- * Return: 0 for success and error number for failure
- */
-int hdd_stop(struct net_device *dev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_stop(dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __hdd_uninit() - HDD uninit function
- * @dev:	Pointer to net_device structure
- *
- * This is called during the netdev unregister to uninitialize all data
- * associated with the device
- *
- * Return: None
- */
-static void __hdd_uninit(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-
-	ENTER();
-
-	do {
-		if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
-			hddLog(LOGP, FL("Invalid magic"));
-			break;
-		}
-
-		if (NULL == adapter->pHddCtx) {
-			hddLog(LOGP, FL("NULL hdd_ctx"));
-			break;
-		}
-
-		if (dev != adapter->dev) {
-			hddLog(LOGP, FL("Invalid device reference"));
-			/*
-			 * we haven't validated all cases so let this go for
-			 * now
-			 */
-		}
-
-		hdd_deinit_adapter(adapter->pHddCtx, adapter, true);
-
-		/* after uninit our adapter structure will no longer be valid */
-		adapter->dev = NULL;
-		adapter->magic = 0;
-	} while (0);
-
-	EXIT();
-}
-
-/**
- * hdd_uninit() - Wrapper function to protect __hdd_uninit from SSR
- * @dev: pointer to net_device structure
- *
- * This is called during the netdev unregister to uninitialize all data
- * associated with the device
- *
- * Return: none
- */
-static void hdd_uninit(struct net_device *dev)
-{
-	cds_ssr_protect(__func__);
-	__hdd_uninit(dev);
-	cds_ssr_unprotect(__func__);
-}
-
-/**
- * __hdd_set_mac_address() - set the user specified mac address
- * @dev:	Pointer to the net device.
- * @addr:	Pointer to the sockaddr.
- *
- * This function sets the user specified mac address using
- * the command ifconfig wlanX hw ether <mac adress>.
- *
- * Return: 0 for success, non zero for failure
- */
-static int __hdd_set_mac_address(struct net_device *dev, void *addr)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	struct sockaddr *psta_mac_addr = addr;
-	CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	memcpy(&adapter->macAddressCurrent, psta_mac_addr->sa_data, ETH_ALEN);
-	memcpy(dev->dev_addr, psta_mac_addr->sa_data, ETH_ALEN);
-
-	EXIT();
-	return cdf_ret_status;
-}
-
-/**
- * hdd_set_mac_address() - Wrapper function to protect __hdd_set_mac_address()
- *			function from SSR
- * @dev: pointer to net_device structure
- * @addr: Pointer to the sockaddr
- *
- * This function sets the user specified mac address using
- * the command ifconfig wlanX hw ether <mac adress>.
- *
- * Return: 0 for success.
- */
-static int hdd_set_mac_address(struct net_device *dev, void *addr)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __hdd_set_mac_address(dev, addr);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-uint8_t *wlan_hdd_get_intf_addr(hdd_context_t *hdd_ctx)
-{
-	int i;
-	for (i = 0; i < CDF_MAX_CONCURRENCY_PERSONA; i++) {
-		if (0 == ((hdd_ctx->config->intfAddrMask) & (1 << i)))
-			break;
-	}
-
-	if (CDF_MAX_CONCURRENCY_PERSONA == i)
-		return NULL;
-
-	hdd_ctx->config->intfAddrMask |= (1 << i);
-	return &hdd_ctx->config->intfMacAddr[i].bytes[0];
-}
-
-void wlan_hdd_release_intf_addr(hdd_context_t *hdd_ctx, uint8_t *releaseAddr)
-{
-	int i;
-	for (i = 0; i < CDF_MAX_CONCURRENCY_PERSONA; i++) {
-		if (!memcmp(releaseAddr,
-			    &hdd_ctx->config->intfMacAddr[i].bytes[0],
-			    6)) {
-			hdd_ctx->config->intfAddrMask &= ~(1 << i);
-			break;
-		}
-	}
-	return;
-}
-
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-/**
- * __hdd_set_multicast_list() - set the multicast address list
- * @dev:	Pointer to the WLAN device.
- * @skb:	Pointer to OS packet (sk_buff).
- *
- * This funciton sets the multicast address list.
- *
- * Return: None
- */
-static void __hdd_set_multicast_list(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	int mc_count;
-	int i = 0, status;
-	struct netdev_hw_addr *ha;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	static const uint8_t ipv6_router_solicitation[]
-			= {0x33, 0x33, 0x00, 0x00, 0x00, 0x02};
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam())
-		return;
-
-	ENTER();
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status)
-		return;
-
-	if (dev->flags & IFF_ALLMULTI) {
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       FL("allow all multicast frames"));
-		adapter->mc_addr_list.mc_cnt = 0;
-	} else {
-		mc_count = netdev_mc_count(dev);
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       FL("mc_count = %u"), mc_count);
-		if (mc_count > WLAN_HDD_MAX_MC_ADDR_LIST) {
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       FL(
-				  "No free filter available; allow all multicast frames"
-				 ));
-			adapter->mc_addr_list.mc_cnt = 0;
-			return;
-		}
-
-		adapter->mc_addr_list.mc_cnt = mc_count;
-
-		netdev_for_each_mc_addr(ha, dev) {
-			if (i == mc_count)
-				break;
-			/*
-			 * Skip following addresses:
-			 * 1)IPv6 router solicitation address
-			 * 2)Any other address pattern if its set during
-			 *  RXFILTER REMOVE driver command based on
-			 *  addr_filter_pattern
-			 */
-			if ((!memcmp(ha->addr, ipv6_router_solicitation,
-			   ETH_ALEN)) ||
-			   (adapter->addr_filter_pattern && (!memcmp(ha->addr,
-			    &adapter->addr_filter_pattern, 1)))) {
-				hdd_info("MC/BC filtering Skip addr ="MAC_ADDRESS_STR,
-					MAC_ADDR_ARRAY(ha->addr));
-				adapter->mc_addr_list.mc_cnt--;
-				continue;
-			}
-
-			memset(&(adapter->mc_addr_list.addr[i][0]), 0,
-			       ETH_ALEN);
-			memcpy(&(adapter->mc_addr_list.addr[i][0]), ha->addr,
-			       ETH_ALEN);
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       FL("mlist[%d] = " MAC_ADDRESS_STR), i,
-			       MAC_ADDR_ARRAY(adapter->mc_addr_list.addr[i]));
-			i++;
-		}
-	}
-	if (hdd_ctx->config->active_mode_offload) {
-		hdd_info("enable mc filtering");
-		wlan_hdd_set_mc_addr_list(adapter, true);
-	} else {
-		hdd_info("skip mc filtering enable it during cfg80211 suspend");
-	}
-	EXIT();
-	return;
-}
-
-/**
- * hdd_set_multicast_list() - SSR wrapper function for __hdd_set_multicast_list
- * @dev: pointer to net_device
- *
- * Return: none
- */
-static void hdd_set_multicast_list(struct net_device *dev)
-{
-	cds_ssr_protect(__func__);
-	__hdd_set_multicast_list(dev);
-	cds_ssr_unprotect(__func__);
-}
-#endif
-
-/**
- * hdd_select_queue() - used by Linux OS to decide which queue to use first
- * @dev:	Pointer to the WLAN device.
- * @skb:	Pointer to OS packet (sk_buff).
- *
- * This function is registered with the Linux OS for network
- * core to decide which queue to use first.
- *
- * Return: ac, Queue Index/access category corresponding to UP in IP header
- */
-static uint16_t hdd_select_queue(struct net_device *dev, struct sk_buff *skb
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
-			  , void *accel_priv
-#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-			  , select_queue_fallback_t fallback
-#endif
-)
-{
-	return hdd_wmm_select_queue(dev, skb);
-}
-
-static struct net_device_ops wlan_drv_ops = {
-	.ndo_open = hdd_open,
-	.ndo_stop = hdd_stop,
-	.ndo_uninit = hdd_uninit,
-	.ndo_start_xmit = hdd_hard_start_xmit,
-	.ndo_tx_timeout = hdd_tx_timeout,
-	.ndo_get_stats = hdd_get_stats,
-	.ndo_do_ioctl = hdd_ioctl,
-	.ndo_set_mac_address = hdd_set_mac_address,
-	.ndo_select_queue = hdd_select_queue,
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-	.ndo_set_rx_mode = hdd_set_multicast_list,
-#endif
-};
-
-void hdd_set_station_ops(struct net_device *pWlanDev)
-{
-	pWlanDev->netdev_ops = &wlan_drv_ops;
-}
-
-static hdd_adapter_t *hdd_alloc_station_adapter(hdd_context_t *hdd_ctx,
-						tSirMacAddr macAddr,
-						const char *name)
-{
-	struct net_device *pWlanDev = NULL;
-	hdd_adapter_t *adapter = NULL;
-	/*
-	 * cfg80211 initialization and registration....
-	 */
-	pWlanDev =
-		alloc_netdev_mq(sizeof(hdd_adapter_t), name,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
-				NET_NAME_UNKNOWN,
-#endif
-				ether_setup,
-				NUM_TX_QUEUES);
-
-	if (pWlanDev != NULL) {
-
-		/* Save the pointer to the net_device in the HDD adapter */
-		adapter = (hdd_adapter_t *) netdev_priv(pWlanDev);
-
-		cdf_mem_zero(adapter, sizeof(hdd_adapter_t));
-
-		adapter->dev = pWlanDev;
-		adapter->pHddCtx = hdd_ctx;
-		adapter->magic = WLAN_HDD_ADAPTER_MAGIC;
-
-		init_completion(&adapter->session_open_comp_var);
-		init_completion(&adapter->session_close_comp_var);
-		init_completion(&adapter->disconnect_comp_var);
-		init_completion(&adapter->linkup_event_var);
-		init_completion(&adapter->cancel_rem_on_chan_var);
-		init_completion(&adapter->rem_on_chan_ready_event);
-		init_completion(&adapter->sta_authorized_event);
-		init_completion(&adapter->offchannel_tx_event);
-		init_completion(&adapter->tx_action_cnf_event);
-#ifdef FEATURE_WLAN_TDLS
-		init_completion(&adapter->tdls_add_station_comp);
-		init_completion(&adapter->tdls_del_station_comp);
-		init_completion(&adapter->tdls_mgmt_comp);
-		init_completion(&adapter->tdls_link_establish_req_comp);
-#endif
-		init_completion(&adapter->change_country_code);
-
-
-		init_completion(&adapter->scan_info.abortscan_event_var);
-
-		adapter->offloads_configured = false;
-		adapter->isLinkUpSvcNeeded = false;
-		adapter->higherDtimTransition = true;
-		/* Init the net_device structure */
-		strlcpy(pWlanDev->name, name, IFNAMSIZ);
-
-		cdf_mem_copy(pWlanDev->dev_addr, (void *)macAddr,
-			     sizeof(tSirMacAddr));
-		cdf_mem_copy(adapter->macAddressCurrent.bytes, macAddr,
-			     sizeof(tSirMacAddr));
-		pWlanDev->watchdog_timeo = HDD_TX_TIMEOUT;
-
-		if (hdd_ctx->config->enable_ip_tcp_udp_checksum_offload)
-			pWlanDev->features |=
-				NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
-		pWlanDev->features |= NETIF_F_RXCSUM;
-
-#if defined(FEATURE_TSO)
-		if (hdd_ctx->config->tso_enable) {
-			hddLog(CDF_TRACE_LEVEL_INFO, FL("TSO Enabled\n"));
-			pWlanDev->features |=
-				 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-				 NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG;
-		}
-#endif
-		hdd_set_station_ops(adapter->dev);
-
-		pWlanDev->destructor = free_netdev;
-		pWlanDev->ieee80211_ptr = &adapter->wdev;
-		pWlanDev->tx_queue_len = HDD_NETDEV_TX_QUEUE_LEN;
-		adapter->wdev.wiphy = hdd_ctx->wiphy;
-		adapter->wdev.netdev = pWlanDev;
-		/* set pWlanDev's parent to underlying device */
-		SET_NETDEV_DEV(pWlanDev, hdd_ctx->parent_dev);
-		hdd_wmm_init(adapter);
-		spin_lock_init(&adapter->pause_map_lock);
-	}
-
-	return adapter;
-}
-
-CDF_STATUS hdd_register_interface(hdd_adapter_t *adapter,
-				  bool rtnl_held)
-{
-	struct net_device *pWlanDev = adapter->dev;
-	/* hdd_station_ctx_t *pHddStaCtx = &adapter->sessionCtx.station; */
-	/* hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX( adapter ); */
-	/* CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS; */
-
-	if (rtnl_held) {
-		if (strnchr(pWlanDev->name, strlen(pWlanDev->name), '%')) {
-			if (dev_alloc_name(pWlanDev, pWlanDev->name) < 0) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("Failed:dev_alloc_name"));
-				return CDF_STATUS_E_FAILURE;
-			}
-		}
-		if (register_netdevice(pWlanDev)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("Failed:register_netdev"));
-			return CDF_STATUS_E_FAILURE;
-		}
-	} else {
-		if (register_netdev(pWlanDev)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("Failed:register_netdev"));
-			return CDF_STATUS_E_FAILURE;
-		}
-	}
-	set_bit(NET_DEVICE_REGISTERED, &adapter->event_flags);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-static CDF_STATUS hdd_sme_close_session_callback(void *pContext)
-{
-	hdd_adapter_t *adapter = pContext;
-
-	if (NULL == adapter) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("NULL adapter"));
-		return CDF_STATUS_E_INVAL;
-	}
-
-	if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("Invalid magic"));
-		return CDF_STATUS_NOT_INITIALIZED;
-	}
-
-	clear_bit(SME_SESSION_OPENED, &adapter->event_flags);
-
-#if !defined (CONFIG_CNSS) && \
-	!defined (WLAN_OPEN_SOURCE)
-	/*
-	 * need to make sure all of our scheduled work has completed.
-	 * This callback is called from MC thread context, so it is safe to
-	 * to call below flush workqueue API from here.
-	 *
-	 * Even though this is called from MC thread context, if there is a faulty
-	 * work item in the system, that can hang this call forever.  So flushing
-	 * this global work queue is not safe; and now we make sure that
-	 * individual work queues are stopped correctly. But the cancel work queue
-	 * is a GPL only API, so the proprietary  version of the driver would still
-	 * rely on the global work queue flush.
-	 */
-	flush_scheduled_work();
-#endif
-
-	/*
-	 * We can be blocked while waiting for scheduled work to be
-	 * flushed, and the adapter structure can potentially be freed, in
-	 * which case the magic will have been reset.  So make sure the
-	 * magic is still good, and hence the adapter structure is still
-	 * valid, before signaling completion
-	 */
-	if (WLAN_HDD_ADAPTER_MAGIC == adapter->magic)
-		complete(&adapter->session_close_comp_var);
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS hdd_init_station_mode(hdd_adapter_t *adapter)
-{
-	struct net_device *pWlanDev = adapter->dev;
-	hdd_station_ctx_t *pHddStaCtx = &adapter->sessionCtx.station;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	uint32_t type, subType;
-	unsigned long rc;
-	int ret_val;
-
-	INIT_COMPLETION(adapter->session_open_comp_var);
-	sme_set_curr_device_mode(hdd_ctx->hHal, adapter->device_mode);
-	status = cds_get_vdev_types(adapter->device_mode, &type, &subType);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGE, FL("failed to get vdev type"));
-		goto error_sme_open;
-	}
-	/* Open a SME session for future operation */
-	cdf_ret_status =
-		sme_open_session(hdd_ctx->hHal, hdd_sme_roam_callback, adapter,
-				 (uint8_t *) &adapter->macAddressCurrent,
-				 &adapter->sessionId, type, subType);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_ret_status)) {
-		hddLog(LOGP,
-		       FL("sme_open_session() failed, status code %08d [x%08x]"),
-		       cdf_ret_status, cdf_ret_status);
-		status = CDF_STATUS_E_FAILURE;
-		goto error_sme_open;
-	}
-	/* Block on a completion variable. Can't wait forever though. */
-	rc = wait_for_completion_timeout(
-		&adapter->session_open_comp_var,
-		msecs_to_jiffies(WLAN_WAIT_TIME_SESSIONOPENCLOSE));
-	if (!rc) {
-		hddLog(LOGP,
-			FL("Session is not opened within timeout period code %ld"),
-			rc);
-		status = CDF_STATUS_E_FAILURE;
-		goto error_sme_open;
-	}
-
-	/* Register wireless extensions */
-	cdf_ret_status = hdd_register_wext(pWlanDev);
-	if (CDF_STATUS_SUCCESS != cdf_ret_status) {
-		hddLog(LOGP,
-		       FL("hdd_register_wext() failed, status code %08d [x%08x]"),
-		       cdf_ret_status, cdf_ret_status);
-		status = CDF_STATUS_E_FAILURE;
-		goto error_register_wext;
-	}
-	/* Set the Connection State to Not Connected */
-	hddLog(LOG1,
-	       FL("Set HDD connState to eConnectionState_NotConnected"));
-	pHddStaCtx->conn_info.connState = eConnectionState_NotConnected;
-
-	/* Set the default operation channel */
-	pHddStaCtx->conn_info.operationChannel =
-		hdd_ctx->config->OperatingChannel;
-
-	/* Make the default Auth Type as OPEN */
-	pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM;
-
-	status = hdd_init_tx_rx(adapter);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGP,
-		       FL("hdd_init_tx_rx() failed, status code %08d [x%08x]"),
-		       status, status);
-		goto error_init_txrx;
-	}
-
-	set_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags);
-
-	status = hdd_wmm_adapter_init(adapter);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGP,
-		       FL("hdd_wmm_adapter_init() failed, status code %08d [x%08x]"),
-		       status, status);
-		goto error_wmm_init;
-	}
-
-	set_bit(WMM_INIT_DONE, &adapter->event_flags);
-
-	ret_val = wma_cli_set_command(adapter->sessionId,
-				      WMI_PDEV_PARAM_BURST_ENABLE,
-				      hdd_ctx->config->enableSifsBurst,
-				      PDEV_CMD);
-
-	if (0 != ret_val) {
-		hddLog(LOGE,
-		       FL("WMI_PDEV_PARAM_BURST_ENABLE set failed %d"),
-		       ret_val);
-	}
-#ifdef FEATURE_WLAN_TDLS
-	if (0 != wlan_hdd_tdls_init(adapter)) {
-		status = CDF_STATUS_E_FAILURE;
-		hddLog(LOGE, FL("wlan_hdd_tdls_init failed"));
-		goto error_tdls_init;
-	}
-	set_bit(TDLS_INIT_DONE, &adapter->event_flags);
-#endif
-
-	return CDF_STATUS_SUCCESS;
-
-#ifdef FEATURE_WLAN_TDLS
-error_tdls_init:
-	clear_bit(WMM_INIT_DONE, &adapter->event_flags);
-	hdd_wmm_adapter_close(adapter);
-#endif
-error_wmm_init:
-	clear_bit(INIT_TX_RX_SUCCESS, &adapter->event_flags);
-	hdd_deinit_tx_rx(adapter);
-error_init_txrx:
-	hdd_unregister_wext(pWlanDev);
-error_register_wext:
-	if (test_bit(SME_SESSION_OPENED, &adapter->event_flags)) {
-		INIT_COMPLETION(adapter->session_close_comp_var);
-		if (CDF_STATUS_SUCCESS == sme_close_session(hdd_ctx->hHal,
-							    adapter->sessionId,
-							    hdd_sme_close_session_callback,
-							    adapter)) {
-			unsigned long rc;
-
-			/*
-			 * Block on a completion variable.
-			 * Can't wait forever though.
-			 */
-			rc = wait_for_completion_timeout(
-				&adapter->session_close_comp_var,
-				msecs_to_jiffies
-					(WLAN_WAIT_TIME_SESSIONOPENCLOSE));
-			if (rc <= 0)
-				hddLog(LOGE,
-				       FL("Session is not opened within timeout period code %ld"),
-				       rc);
-		}
-	}
-error_sme_open:
-	return status;
-}
-
-void hdd_cleanup_actionframe(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
-{
-	hdd_cfg80211_state_t *cfgState;
-
-	cfgState = WLAN_HDD_GET_CFG_STATE_PTR(adapter);
-
-	if (NULL != cfgState->buf) {
-		unsigned long rc;
-		rc = wait_for_completion_timeout(
-			&adapter->tx_action_cnf_event,
-			msecs_to_jiffies(ACTION_FRAME_TX_TIMEOUT));
-		if (!rc) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("HDD Wait for Action Confirmation Failed!!"));
-			/*
-			 * Inform tx status as FAILURE to upper layer and free
-			 * cfgState->buf
-			 */
-			 hdd_send_action_cnf(adapter, false);
-		}
-	}
-	return;
-}
-
-void hdd_deinit_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
-			bool rtnl_held)
-{
-	ENTER();
-	switch (adapter->device_mode) {
-	case WLAN_HDD_INFRA_STATION:
-	case WLAN_HDD_P2P_CLIENT:
-	case WLAN_HDD_P2P_DEVICE:
-	{
-		if (test_bit
-			    (INIT_TX_RX_SUCCESS, &adapter->event_flags)) {
-			hdd_deinit_tx_rx(adapter);
-			clear_bit(INIT_TX_RX_SUCCESS,
-				  &adapter->event_flags);
-		}
-
-		if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) {
-			hdd_wmm_adapter_close(adapter);
-			clear_bit(WMM_INIT_DONE,
-				  &adapter->event_flags);
-		}
-
-		hdd_cleanup_actionframe(hdd_ctx, adapter);
-		wlan_hdd_tdls_exit(adapter);
-		break;
-	}
-
-	case WLAN_HDD_SOFTAP:
-	case WLAN_HDD_P2P_GO:
-	{
-
-		if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) {
-			hdd_wmm_adapter_close(adapter);
-			clear_bit(WMM_INIT_DONE,
-				  &adapter->event_flags);
-		}
-
-		hdd_cleanup_actionframe(hdd_ctx, adapter);
-
-		hdd_unregister_hostapd(adapter, rtnl_held);
-
-		break;
-	}
-
-	default:
-		break;
-	}
-
-	EXIT();
-}
-
-void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
-			 bool rtnl_held)
-{
-	struct net_device *pWlanDev = NULL;
-
-	if (adapter)
-		pWlanDev = adapter->dev;
-	else {
-		hddLog(LOGE, FL("adapter is Null"));
-		return;
-	}
-
-	hdd_lro_disable(hdd_ctx, adapter);
-	/*
-	 * The adapter is marked as closed. When hdd_wlan_exit() call returns,
-	 * the driver is almost closed and cannot handle either control
-	 * messages or data. However, unregister_netdevice() call above will
-	 * eventually invoke hdd_stop (ndo_close) driver callback, which attempts
-	 * to close the active connections (basically excites control path) which
-	 * is not right. Setting this flag helps hdd_stop() to recognize that
-	 * the interface is closed and restricts any operations on that
-	 */
-	clear_bit(DEVICE_IFACE_OPENED, &adapter->event_flags);
-
-	if (test_bit(NET_DEVICE_REGISTERED, &adapter->event_flags)) {
-		if (rtnl_held) {
-			unregister_netdevice(pWlanDev);
-		} else {
-			unregister_netdev(pWlanDev);
-		}
-		/*
-		 * Note that the adapter is no longer valid at this point
-		 * since the memory has been reclaimed
-		 */
-	}
-}
-
-CDF_STATUS hdd_check_for_existing_macaddr(hdd_context_t *hdd_ctx,
-					  tSirMacAddr macAddr)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	hdd_adapter_t *adapter;
-	CDF_STATUS status;
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-		if (adapter
-		    && cdf_mem_compare(adapter->macAddressCurrent.bytes,
-				       macAddr, sizeof(tSirMacAddr))) {
-			return CDF_STATUS_E_FAILURE;
-		}
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
-				const char *iface_name, tSirMacAddr macAddr,
-				bool rtnl_held)
-{
-	hdd_adapter_t *adapter = NULL;
-	hdd_adapter_list_node_t *pHddAdapterNode = NULL;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	hdd_cfg80211_state_t *cfgState;
-	int ret;
-
-	hddLog(LOG2, FL("iface(%s) type(%d)"), iface_name, session_type);
-
-	if (hdd_ctx->current_intf_count >= hdd_ctx->max_intf_count) {
-		/*
-		 * Max limit reached on the number of vdevs configured by the
-		 * host. Return error
-		 */
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL(
-			  "Unable to add virtual intf: currentVdevCnt=%d,hostConfiguredVdevCnt=%d"
-			 ),
-		       hdd_ctx->current_intf_count, hdd_ctx->max_intf_count);
-		return NULL;
-	}
-
-	if (macAddr == NULL) {
-		/* Not received valid macAddr */
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL(
-			  "Unable to add virtual intf: Not able to get valid mac address"
-			 ));
-		return NULL;
-	}
-	status = hdd_check_for_existing_macaddr(hdd_ctx, macAddr);
-	if (CDF_STATUS_E_FAILURE == status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "Duplicate MAC addr: " MAC_ADDRESS_STR
-		       " already exists",
-		       MAC_ADDR_ARRAY(macAddr));
-		return NULL;
-	}
-
-	switch (session_type) {
-	case WLAN_HDD_INFRA_STATION:
-		/* Reset locally administered bit if the device mode is STA */
-		WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macAddr);
-	/* fall through */
-	case WLAN_HDD_P2P_CLIENT:
-	case WLAN_HDD_P2P_DEVICE:
-	case WLAN_HDD_OCB:
-	{
-		adapter =
-			hdd_alloc_station_adapter(hdd_ctx, macAddr, iface_name);
-
-		if (NULL == adapter) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("failed to allocate adapter for session %d"),
-			       session_type);
-			return NULL;
-		}
-
-		if (WLAN_HDD_P2P_CLIENT == session_type)
-			adapter->wdev.iftype = NL80211_IFTYPE_P2P_CLIENT;
-		else if (WLAN_HDD_P2P_DEVICE == session_type)
-			adapter->wdev.iftype = NL80211_IFTYPE_P2P_DEVICE;
-		else
-			adapter->wdev.iftype = NL80211_IFTYPE_STATION;
-
-		adapter->device_mode = session_type;
-
-		status = hdd_init_station_mode(adapter);
-		if (CDF_STATUS_SUCCESS != status)
-			goto err_free_netdev;
-
-		hdd_lro_enable(hdd_ctx, adapter);
-
-		/*
-		 * Workqueue which gets scheduled in IPv4 notification
-		 * callback
-		 */
-#ifdef CONFIG_CNSS
-		cnss_init_work(&adapter->ipv4NotifierWorkQueue,
-			       hdd_ipv4_notifier_work_queue);
-#else
-		INIT_WORK(&adapter->ipv4NotifierWorkQueue,
-			  hdd_ipv4_notifier_work_queue);
-#endif
-
-#ifdef WLAN_NS_OFFLOAD
-		/*
-		 * Workqueue which gets scheduled in IPv6
-		 * notification callback.
-		 */
-#ifdef CONFIG_CNSS
-		cnss_init_work(&adapter->ipv6NotifierWorkQueue,
-			       hdd_ipv6_notifier_work_queue);
-#else
-		INIT_WORK(&adapter->ipv6NotifierWorkQueue,
-			  hdd_ipv6_notifier_work_queue);
-#endif
-#endif
-		status = hdd_register_interface(adapter, rtnl_held);
-		if (CDF_STATUS_SUCCESS != status) {
-			hdd_deinit_adapter(hdd_ctx, adapter, rtnl_held);
-			goto err_lro_cleanup;
-		}
-
-		/* Stop the Interface TX queue. */
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(adapter,
-					   WLAN_NETIF_TX_DISABLE_N_CARRIER,
-					   WLAN_CONTROL_PATH);
-
-		hdd_register_tx_flow_control(adapter,
-				hdd_tx_resume_timer_expired_handler,
-				hdd_tx_resume_cb);
-
-		break;
-	}
-
-	case WLAN_HDD_P2P_GO:
-	case WLAN_HDD_SOFTAP:
-	{
-		adapter =
-			hdd_wlan_create_ap_dev(hdd_ctx, macAddr,
-					       (uint8_t *) iface_name);
-		if (NULL == adapter) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("failed to allocate adapter for session %d"),
-			       session_type);
-			return NULL;
-		}
-
-		adapter->wdev.iftype =
-			(session_type ==
-			 WLAN_HDD_SOFTAP) ? NL80211_IFTYPE_AP :
-			NL80211_IFTYPE_P2P_GO;
-		adapter->device_mode = session_type;
-
-		status = hdd_init_ap_mode(adapter);
-		if (CDF_STATUS_SUCCESS != status)
-			goto err_free_netdev;
-
-		status = hdd_register_hostapd(adapter, rtnl_held);
-		if (CDF_STATUS_SUCCESS != status) {
-			hdd_deinit_adapter(hdd_ctx, adapter, rtnl_held);
-			goto err_free_netdev;
-		}
-
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(adapter,
-					   WLAN_NETIF_TX_DISABLE_N_CARRIER,
-					   WLAN_CONTROL_PATH);
-
-		break;
-	}
-	case WLAN_HDD_FTM:
-	{
-		adapter =
-			hdd_alloc_station_adapter(hdd_ctx, macAddr, iface_name);
-
-		if (NULL == adapter) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("failed to allocate adapter for session %d"),
-			       session_type);
-			return NULL;
-		}
-
-		/*
-		 * Assign NL80211_IFTYPE_STATION as interface type to resolve
-		 * Kernel Warning message while loading driver in FTM mode.
-		 */
-		adapter->wdev.iftype = NL80211_IFTYPE_STATION;
-		adapter->device_mode = session_type;
-		status = hdd_register_interface(adapter, rtnl_held);
-
-		hdd_init_tx_rx(adapter);
-
-		/* Stop the Interface TX queue. */
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(adapter,
-					   WLAN_NETIF_TX_DISABLE_N_CARRIER,
-					   WLAN_CONTROL_PATH);
-	}
-	break;
-	default:
-	{
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("Invalid session type %d"),
-		       session_type);
-		CDF_ASSERT(0);
-		return NULL;
-	}
-	}
-
-	cfgState = WLAN_HDD_GET_CFG_STATE_PTR(adapter);
-	mutex_init(&cfgState->remain_on_chan_ctx_lock);
-
-	if (CDF_STATUS_SUCCESS == status) {
-		/* Add it to the hdd's session list. */
-		pHddAdapterNode =
-			cdf_mem_malloc(sizeof(hdd_adapter_list_node_t));
-		if (NULL == pHddAdapterNode) {
-			status = CDF_STATUS_E_NOMEM;
-		} else {
-			pHddAdapterNode->pAdapter = adapter;
-			status = hdd_add_adapter_back(hdd_ctx, pHddAdapterNode);
-		}
-	}
-
-	if (CDF_STATUS_SUCCESS != status) {
-		if (NULL != adapter) {
-			hdd_cleanup_adapter(hdd_ctx, adapter, rtnl_held);
-			adapter = NULL;
-		}
-		if (NULL != pHddAdapterNode) {
-			cdf_mem_free(pHddAdapterNode);
-		}
-		return NULL;
-	}
-
-	if (CDF_STATUS_SUCCESS == status) {
-		cds_set_concurrency_mode(session_type);
-
-		/* Initialize the WoWL service */
-		if (!hdd_init_wowl(adapter)) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL("hdd_init_wowl failed"));
-			goto err_lro_cleanup;
-		}
-
-		/* Adapter successfully added. Increment the vdev count */
-		hdd_ctx->current_intf_count++;
-
-		hddLog(CDF_TRACE_LEVEL_DEBUG, FL("current_intf_count=%d"),
-		       hdd_ctx->current_intf_count);
-
-		cds_check_and_restart_sap_with_non_dfs_acs();
-	}
-
-	if ((cds_get_conparam() != CDF_GLOBAL_FTM_MODE)
-	    && (!hdd_ctx->config->enable2x2)) {
-#define HDD_DTIM_1CHAIN_RX_ID 0x5
-#define HDD_SMPS_PARAM_VALUE_S 29
-
-		/*
-		 * Disable DTIM 1 chain Rx when in 1x1, we are passing two value
-		 * as param_id << 29 | param_value.
-		 * Below param_value = 0(disable)
-		 */
-		ret = wma_cli_set_command(adapter->sessionId,
-					  WMI_STA_SMPS_PARAM_CMDID,
-					  HDD_DTIM_1CHAIN_RX_ID <<
-						HDD_SMPS_PARAM_VALUE_S,
-					  VDEV_CMD);
-
-		if (ret != 0) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("DTIM 1 chain set failed %d"), ret);
-			goto err_lro_cleanup;
-		}
-
-		ret = wma_cli_set_command(adapter->sessionId,
-					  WMI_PDEV_PARAM_TX_CHAIN_MASK,
-					  hdd_ctx->config->txchainmask1x1,
-					  PDEV_CMD);
-		if (ret != 0) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("WMI_PDEV_PARAM_TX_CHAIN_MASK set failed %d"),
-			       ret);
-			goto err_lro_cleanup;
-		}
-		ret = wma_cli_set_command(adapter->sessionId,
-					  WMI_PDEV_PARAM_RX_CHAIN_MASK,
-					  hdd_ctx->config->rxchainmask1x1,
-					  PDEV_CMD);
-		if (ret != 0) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("WMI_PDEV_PARAM_RX_CHAIN_MASK set failed %d"),
-			       ret);
-			goto err_lro_cleanup;
-		}
-#undef HDD_DTIM_1CHAIN_RX_ID
-#undef HDD_SMPS_PARAM_VALUE_S
-	}
-
-	if (CDF_GLOBAL_FTM_MODE != cds_get_conparam()) {
-		ret = wma_cli_set_command(adapter->sessionId,
-					  WMI_PDEV_PARAM_HYST_EN,
-					  hdd_ctx->config->enableMemDeepSleep,
-					  PDEV_CMD);
-
-		if (ret != 0) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("WMI_PDEV_PARAM_HYST_EN set failed %d"),
-			       ret);
-			goto err_lro_cleanup;
-		}
-	}
-
-#ifdef CONFIG_FW_LOGS_BASED_ON_INI
-
-	/* Enable FW logs based on INI configuration */
-	if ((CDF_GLOBAL_FTM_MODE != cds_get_conparam()) &&
-	    (hdd_ctx->config->enablefwlog)) {
-		uint8_t count = 0;
-		uint32_t value = 0;
-		uint8_t numEntries = 0;
-		uint8_t moduleLoglevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH];
-
-		hdd_ctx->fw_log_settings.dl_type =
-					hdd_ctx->config->enableFwLogType;
-		ret = wma_cli_set_command(adapter->sessionId,
-					  WMI_DBGLOG_TYPE,
-					  hdd_ctx->config->enableFwLogType,
-					  DBG_CMD);
-		if (ret != 0) {
-			hddLog(LOGE, FL("Failed to enable FW log type ret %d"),
-			       ret);
-		}
-
-		hdd_ctx->fw_log_settings.dl_loglevel =
-					hdd_ctx->config->enableFwLogLevel;
-		ret = wma_cli_set_command(adapter->sessionId,
-					  WMI_DBGLOG_LOG_LEVEL,
-					  hdd_ctx->config->enableFwLogLevel,
-					  DBG_CMD);
-		if (ret != 0) {
-			hddLog(LOGE, FL("Failed to enable FW log level ret %d"),
-			       ret);
-		}
-
-		hdd_string_to_u8_array(hdd_ctx->config->enableFwModuleLogLevel,
-				       moduleLoglevel,
-				       &numEntries,
-				       FW_MODULE_LOG_LEVEL_STRING_LENGTH);
-		while (count < numEntries) {
-			/*
-			 * FW module log level input string looks like below:
-			 * gFwDebugModuleLoglevel=<FW Module ID>,<Log Level>,...
-			 * For example:
-			 * gFwDebugModuleLoglevel=1,0,2,1,3,2,4,3,5,4,6,5,7,6
-			 * Above input string means :
-			 * For FW module ID 1 enable log level 0
-			 * For FW module ID 2 enable log level 1
-			 * For FW module ID 3 enable log level 2
-			 * For FW module ID 4 enable log level 3
-			 * For FW module ID 5 enable log level 4
-			 * For FW module ID 6 enable log level 5
-			 * For FW module ID 7 enable log level 6
-			 */
-
-			/* FW expects WMI command value =
-			 *               Module ID * 10 + Module Log level
-			 */
-			value =	((moduleLoglevel[count] * 10) +
-				 moduleLoglevel[count + 1]);
-			ret = wma_cli_set_command(adapter->sessionId,
-						  WMI_DBGLOG_MOD_LOG_LEVEL,
-						  value, DBG_CMD);
-			if (ret != 0) {
-				hddLog(LOGE,
-				       FL
-					       ("Failed to enable FW module log level %d ret %d"),
-				       value, ret);
-			}
-
-			count += 2;
-		}
-	}
-#endif
-
-	return adapter;
-
-err_lro_cleanup:
-	hdd_lro_disable(hdd_ctx, adapter);
-err_free_netdev:
-	free_netdev(adapter->dev);
-	wlan_hdd_release_intf_addr(hdd_ctx, adapter->macAddressCurrent.bytes);
-
-	return NULL;
-}
-
-CDF_STATUS hdd_close_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
-			     bool rtnl_held)
-{
-	hdd_adapter_list_node_t *adapterNode, *pCurrent, *pNext;
-	CDF_STATUS status;
-
-	status = hdd_get_front_adapter(hdd_ctx, &pCurrent);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(CDF_TRACE_LEVEL_WARN, FL("adapter list empty %d"),
-		       status);
-		return status;
-	}
-
-	while (pCurrent->pAdapter != adapter) {
-		status = hdd_get_next_adapter(hdd_ctx, pCurrent, &pNext);
-		if (CDF_STATUS_SUCCESS != status)
-			break;
-
-		pCurrent = pNext;
-	}
-	adapterNode = pCurrent;
-	if (CDF_STATUS_SUCCESS == status) {
-		cds_clear_concurrency_mode(adapter->device_mode);
-		hdd_cleanup_adapter(hdd_ctx, adapterNode->pAdapter, rtnl_held);
-
-		hdd_remove_adapter(hdd_ctx, adapterNode);
-		cdf_mem_free(adapterNode);
-		adapterNode = NULL;
-
-		/* Adapter removed. Decrement vdev count */
-		if (hdd_ctx->current_intf_count != 0)
-			hdd_ctx->current_intf_count--;
-
-		/* Fw will take care incase of concurrency */
-		return CDF_STATUS_SUCCESS;
-	}
-	return CDF_STATUS_E_FAILURE;
-}
-
-/**
- * hdd_close_all_adapters - Close all open adapters
- * @hdd_ctx:	Hdd context
- * rtnl_held:	True if RTNL lock held
- *
- * Close all open adapters.
- *
- * Return: CDF status code
- */
-CDF_STATUS hdd_close_all_adapters(hdd_context_t *hdd_ctx, bool rtnl_held)
-{
-	hdd_adapter_list_node_t *pHddAdapterNode;
-	CDF_STATUS status;
-
-	ENTER();
-
-	do {
-		status = hdd_remove_front_adapter(hdd_ctx, &pHddAdapterNode);
-		if (pHddAdapterNode && CDF_STATUS_SUCCESS == status) {
-			hdd_cleanup_adapter(hdd_ctx, pHddAdapterNode->pAdapter,
-					    rtnl_held);
-			cdf_mem_free(pHddAdapterNode);
-		}
-	} while (NULL != pHddAdapterNode && CDF_STATUS_E_EMPTY != status);
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-void wlan_hdd_reset_prob_rspies(hdd_adapter_t *pHostapdAdapter)
-{
-	struct cdf_mac_addr *bssid = NULL;
-	tSirUpdateIE updateIE;
-	switch (pHostapdAdapter->device_mode) {
-	case WLAN_HDD_INFRA_STATION:
-	case WLAN_HDD_P2P_CLIENT:
-	{
-		hdd_station_ctx_t *pHddStaCtx =
-			WLAN_HDD_GET_STATION_CTX_PTR(pHostapdAdapter);
-		bssid = &pHddStaCtx->conn_info.bssId;
-		break;
-	}
-	case WLAN_HDD_SOFTAP:
-	case WLAN_HDD_P2P_GO:
-	case WLAN_HDD_IBSS:
-	{
-		bssid = &pHostapdAdapter->macAddressCurrent;
-		break;
-	}
-	case WLAN_HDD_FTM:
-	case WLAN_HDD_P2P_DEVICE:
-	default:
-		/*
-		 * wlan_hdd_reset_prob_rspies should not have been called
-		 * for these kind of devices
-		 */
-		hddLog(LOGE,
-		       FL("Unexpected request for the current device type %d"),
-		       pHostapdAdapter->device_mode);
-		return;
-	}
-
-	cdf_copy_macaddr(&updateIE.bssid, bssid);
-	updateIE.smeSessionId = pHostapdAdapter->sessionId;
-	updateIE.ieBufferlength = 0;
-	updateIE.pAdditionIEBuffer = NULL;
-	updateIE.append = true;
-	updateIE.notify = false;
-	if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(pHostapdAdapter),
-			      &updateIE,
-			      eUPDATE_IE_PROBE_RESP) == CDF_STATUS_E_FAILURE) {
-		hddLog(LOGE, FL("Could not pass on PROBE_RSP_BCN data to PE"));
-	}
-}
-
-CDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
-			    const bool bCloseSession)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_SUCCESS;
-	hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(adapter);
-	union iwreq_data wrqu;
-	tSirUpdateIE updateIE;
-	unsigned long rc;
-
-	ENTER();
-
-	hddLog(LOG1, FL("Disabling queues"));
-	wlan_hdd_netif_queue_control(adapter, WLAN_NETIF_TX_DISABLE_N_CARRIER,
-				   WLAN_CONTROL_PATH);
-	switch (adapter->device_mode) {
-	case WLAN_HDD_INFRA_STATION:
-	case WLAN_HDD_P2P_CLIENT:
-	case WLAN_HDD_IBSS:
-	case WLAN_HDD_P2P_DEVICE:
-		if (hdd_conn_is_connected(
-				WLAN_HDD_GET_STATION_CTX_PTR(adapter)) ||
-			hdd_is_connecting(
-				WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
-			if (pWextState->roamProfile.BSSType ==
-			    eCSR_BSS_TYPE_START_IBSS)
-				cdf_ret_status =
-					sme_roam_disconnect(hdd_ctx->hHal,
-							    adapter->sessionId,
-							    eCSR_DISCONNECT_REASON_IBSS_LEAVE);
-			else
-				cdf_ret_status =
-					sme_roam_disconnect(hdd_ctx->hHal,
-							    adapter->sessionId,
-							    eCSR_DISCONNECT_REASON_UNSPECIFIED);
-			/* success implies disconnect command got queued up successfully */
-			if (cdf_ret_status == CDF_STATUS_SUCCESS) {
-				rc = wait_for_completion_timeout(
-					&adapter->disconnect_comp_var,
-					msecs_to_jiffies
-						(WLAN_WAIT_TIME_DISCONNECT));
-				if (!rc) {
-					hddLog(CDF_TRACE_LEVEL_ERROR,
-					       FL(
-						  "wait on disconnect_comp_var failed"
-						 ));
-				}
-			} else {
-				hddLog(LOGE,
-				       FL(
-					  "failed to post disconnect event to SME"
-					 ));
-			}
-			memset(&wrqu, '\0', sizeof(wrqu));
-			wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-			memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
-			wireless_send_event(adapter->dev, SIOCGIWAP, &wrqu,
-					    NULL);
-		} else {
-			hdd_abort_mac_scan(hdd_ctx, adapter->sessionId,
-					   eCSR_SCAN_ABORT_DEFAULT);
-		}
-		wlan_hdd_cleanup_remain_on_channel_ctx(adapter);
-
-#ifdef WLAN_OPEN_SOURCE
-		cancel_work_sync(&adapter->ipv4NotifierWorkQueue);
-#endif
-
-		hdd_deregister_tx_flow_control(adapter);
-
-#ifdef WLAN_NS_OFFLOAD
-#ifdef WLAN_OPEN_SOURCE
-		cancel_work_sync(&adapter->ipv6NotifierWorkQueue);
-#endif
-#endif
-
-		/*
-		 * It is possible that the caller of this function does not
-		 * wish to close the session
-		 */
-		if (true == bCloseSession &&
-		    test_bit(SME_SESSION_OPENED, &adapter->event_flags)) {
-			INIT_COMPLETION(adapter->session_close_comp_var);
-			if (CDF_STATUS_SUCCESS ==
-			    sme_close_session(hdd_ctx->hHal, adapter->sessionId,
-					      hdd_sme_close_session_callback,
-					      adapter)) {
-				/*
-				 * Block on a completion variable. Can't wait
-				 * forever though.
-				 */
-				rc = wait_for_completion_timeout(
-					&adapter->session_close_comp_var,
-					msecs_to_jiffies
-						(WLAN_WAIT_TIME_SESSIONOPENCLOSE));
-				if (!rc) {
-					hddLog(LOGE,
-					       FL(
-						  "failure waiting for session_close_comp_var"
-						 ));
-				}
-			}
-		}
-		break;
-
-	case WLAN_HDD_SOFTAP:
-	case WLAN_HDD_P2P_GO:
-		if (hdd_ctx->config->conc_custom_rule1 &&
-			(WLAN_HDD_SOFTAP == adapter->device_mode)) {
-			/*
-			 * Before stopping the sap adapter, lets make sure there
-			 * is no sap restart work pending.
-			 */
-			cds_flush_work(&hdd_ctx->sap_start_work);
-			hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-			       FL("Canceled the pending SAP restart work"));
-			cds_change_sap_restart_required_status(false);
-		}
-		/* Any softap specific cleanup here... */
-		if (adapter->device_mode == WLAN_HDD_P2P_GO)
-			wlan_hdd_cleanup_remain_on_channel_ctx(adapter);
-
-		hdd_deregister_tx_flow_control(adapter);
-
-		mutex_lock(&hdd_ctx->sap_lock);
-		if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) {
-			CDF_STATUS status;
-
-			/* Stop Bss. */
-#ifdef WLAN_FEATURE_MBSSID
-			status = wlansap_stop_bss(
-					WLAN_HDD_GET_SAP_CTX_PTR(adapter));
-#else
-			status = wlansap_stop_bss(
-				(WLAN_HDD_GET_CTX(adapter))->pcds_context);
-#endif
-
-			if (CDF_IS_STATUS_SUCCESS(status)) {
-				hdd_hostapd_state_t *hostapd_state =
-					WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter);
-				cdf_event_reset(&hostapd_state->
-						cdf_stop_bss_event);
-				status =
-					cdf_wait_single_event(&hostapd_state->
-							cdf_stop_bss_event,
-							BSS_WAIT_TIMEOUT);
-
-				if (!CDF_IS_STATUS_SUCCESS(status)) {
-					hddLog(LOGE,
-					       FL(
-						  "failure waiting for wlansap_stop_bss %d"
-						 ),
-					       status);
-				}
-			} else {
-				hddLog(LOGE, FL("failure in wlansap_stop_bss"));
-			}
-			clear_bit(SOFTAP_BSS_STARTED, &adapter->event_flags);
-			cds_decr_session_set_pcl(
-						     adapter->device_mode,
-							adapter->sessionId);
-
-			cdf_copy_macaddr(&updateIE.bssid,
-					 &adapter->macAddressCurrent);
-			updateIE.smeSessionId = adapter->sessionId;
-			updateIE.ieBufferlength = 0;
-			updateIE.pAdditionIEBuffer = NULL;
-			updateIE.append = false;
-			updateIE.notify = false;
-			/* Probe bcn reset */
-			if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
-					      &updateIE, eUPDATE_IE_PROBE_BCN)
-			    == CDF_STATUS_E_FAILURE) {
-				hddLog(LOGE,
-				       FL(
-					  "Could not pass on PROBE_RSP_BCN data to PE"
-					 ));
-			}
-			/* Assoc resp reset */
-			if (sme_update_add_ie(WLAN_HDD_GET_HAL_CTX(adapter),
-					      &updateIE,
-					      eUPDATE_IE_ASSOC_RESP) ==
-			    CDF_STATUS_E_FAILURE) {
-				hddLog(LOGE,
-				       FL(
-					  "Could not pass on ASSOC_RSP data to PE"
-					 ));
-			}
-			/* Reset WNI_CFG_PROBE_RSP Flags */
-			wlan_hdd_reset_prob_rspies(adapter);
-			kfree(adapter->sessionCtx.ap.beacon);
-			adapter->sessionCtx.ap.beacon = NULL;
-		}
-		mutex_unlock(&hdd_ctx->sap_lock);
-		break;
-	case WLAN_HDD_OCB:
-		ol_txrx_clear_peer(WLAN_HDD_GET_STATION_CTX_PTR(adapter)->
-			conn_info.staId[0]);
-		break;
-	default:
-		break;
-	}
-
-	EXIT();
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS hdd_stop_all_adapters(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-
-	ENTER();
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-		hdd_stop_adapter(hdd_ctx, adapter, true);
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS hdd_reset_all_adapters(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-
-	ENTER();
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(adapter,
-					   WLAN_NETIF_TX_DISABLE_N_CARRIER,
-					   WLAN_CONTROL_PATH);
-
-		adapter->sessionCtx.station.hdd_ReassocScenario = false;
-
-		hdd_deinit_tx_rx(adapter);
-		cds_decr_session_set_pcl(adapter->device_mode,
-						adapter->sessionId);
-		if (test_bit(WMM_INIT_DONE, &adapter->event_flags)) {
-			hdd_wmm_adapter_close(adapter);
-			clear_bit(WMM_INIT_DONE, &adapter->event_flags);
-		}
-
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS hdd_start_all_adapters(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-#ifndef MSM_PLATFORM
-	struct cdf_mac_addr bcastMac = CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-#endif
-	eConnectionState connState;
-
-	ENTER();
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-
-		hdd_wmm_init(adapter);
-
-		switch (adapter->device_mode) {
-		case WLAN_HDD_INFRA_STATION:
-		case WLAN_HDD_P2P_CLIENT:
-		case WLAN_HDD_P2P_DEVICE:
-
-			connState = (WLAN_HDD_GET_STATION_CTX_PTR(adapter))
-					->conn_info.connState;
-
-			hdd_init_station_mode(adapter);
-			/* Open the gates for HDD to receive Wext commands */
-			adapter->isLinkUpSvcNeeded = false;
-			adapter->scan_info.mScanPending = false;
-
-			/* Indicate disconnect event to supplicant if associated previously */
-			if (eConnectionState_Associated == connState ||
-			    eConnectionState_IbssConnected == connState ||
-			    eConnectionState_NotConnected == connState ||
-			    eConnectionState_IbssDisconnected == connState ||
-			    eConnectionState_Disconnecting == connState) {
-				union iwreq_data wrqu;
-				memset(&wrqu, '\0', sizeof(wrqu));
-				wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-				memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
-				wireless_send_event(adapter->dev, SIOCGIWAP,
-						    &wrqu, NULL);
-				adapter->sessionCtx.station.
-				hdd_ReassocScenario = false;
-
-				/* indicate disconnected event to nl80211 */
-				cfg80211_disconnected(adapter->dev,
-						      WLAN_REASON_UNSPECIFIED,
-						      NULL, 0, GFP_KERNEL);
-			} else if (eConnectionState_Connecting == connState) {
-				/*
-				 * Indicate connect failure to supplicant if we were in the
-				 * process of connecting
-				 */
-				cfg80211_connect_result(adapter->dev, NULL,
-							NULL, 0, NULL, 0,
-							WLAN_STATUS_ASSOC_DENIED_UNSPEC,
-							GFP_KERNEL);
-			}
-
-			hdd_register_tx_flow_control(adapter,
-					hdd_tx_resume_timer_expired_handler,
-					hdd_tx_resume_cb);
-
-			break;
-
-		case WLAN_HDD_SOFTAP:
-			/* softAP can handle SSR */
-			break;
-
-		case WLAN_HDD_P2P_GO:
-#ifdef MSM_PLATFORM
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("[SSR] send stop ap to supplicant"));
-			cfg80211_ap_stopped(adapter->dev, GFP_KERNEL);
-#else
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("[SSR] send restart supplicant"));
-			/* event supplicant to restart */
-			cfg80211_del_sta(adapter->dev,
-					 (const u8 *)&bcastMac.bytes[0],
-					 GFP_KERNEL);
-#endif
-			break;
-
-		default:
-			break;
-		}
-
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS hdd_get_front_adapter(hdd_context_t *hdd_ctx,
-				 hdd_adapter_list_node_t **padapterNode)
-{
-	CDF_STATUS status;
-	cdf_spin_lock(&hdd_ctx->hdd_adapter_lock);
-	status = cdf_list_peek_front(&hdd_ctx->hddAdapters,
-				     (cdf_list_node_t **) padapterNode);
-	cdf_spin_unlock(&hdd_ctx->hdd_adapter_lock);
-	return status;
-}
-
-CDF_STATUS hdd_get_next_adapter(hdd_context_t *hdd_ctx,
-				hdd_adapter_list_node_t *adapterNode,
-				hdd_adapter_list_node_t **pNextAdapterNode)
-{
-	CDF_STATUS status;
-	cdf_spin_lock(&hdd_ctx->hdd_adapter_lock);
-	status = cdf_list_peek_next(&hdd_ctx->hddAdapters,
-				    (cdf_list_node_t *) adapterNode,
-				    (cdf_list_node_t **) pNextAdapterNode);
-
-	cdf_spin_unlock(&hdd_ctx->hdd_adapter_lock);
-	return status;
-}
-
-CDF_STATUS hdd_remove_adapter(hdd_context_t *hdd_ctx,
-			      hdd_adapter_list_node_t *adapterNode)
-{
-	CDF_STATUS status;
-	cdf_spin_lock(&hdd_ctx->hdd_adapter_lock);
-	status = cdf_list_remove_node(&hdd_ctx->hddAdapters,
-				      &adapterNode->node);
-	cdf_spin_unlock(&hdd_ctx->hdd_adapter_lock);
-	return status;
-}
-
-CDF_STATUS hdd_remove_front_adapter(hdd_context_t *hdd_ctx,
-				    hdd_adapter_list_node_t **padapterNode)
-{
-	CDF_STATUS status;
-	cdf_spin_lock(&hdd_ctx->hdd_adapter_lock);
-	status = cdf_list_remove_front(&hdd_ctx->hddAdapters,
-				       (cdf_list_node_t **) padapterNode);
-	cdf_spin_unlock(&hdd_ctx->hdd_adapter_lock);
-	return status;
-}
-
-CDF_STATUS hdd_add_adapter_back(hdd_context_t *hdd_ctx,
-				hdd_adapter_list_node_t *adapterNode)
-{
-	CDF_STATUS status;
-	cdf_spin_lock(&hdd_ctx->hdd_adapter_lock);
-	status = cdf_list_insert_back(&hdd_ctx->hddAdapters,
-				      (cdf_list_node_t *) adapterNode);
-	cdf_spin_unlock(&hdd_ctx->hdd_adapter_lock);
-	return status;
-}
-
-CDF_STATUS hdd_add_adapter_front(hdd_context_t *hdd_ctx,
-				 hdd_adapter_list_node_t *adapterNode)
-{
-	CDF_STATUS status;
-	cdf_spin_lock(&hdd_ctx->hdd_adapter_lock);
-	status = cdf_list_insert_front(&hdd_ctx->hddAdapters,
-				       (cdf_list_node_t *) adapterNode);
-	cdf_spin_unlock(&hdd_ctx->hdd_adapter_lock);
-	return status;
-}
-
-hdd_adapter_t *hdd_get_adapter_by_macaddr(hdd_context_t *hdd_ctx,
-					  tSirMacAddr macAddr)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	hdd_adapter_t *adapter;
-	CDF_STATUS status;
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-
-		if (adapter
-		    && cdf_mem_compare(adapter->macAddressCurrent.bytes,
-				       macAddr, sizeof(tSirMacAddr))) {
-			return adapter;
-		}
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	return NULL;
-
-}
-
-hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *hdd_ctx,
-				       uint32_t vdev_id)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	hdd_adapter_t *adapter;
-	CDF_STATUS cdf_status;
-
-	cdf_status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while ((NULL != adapterNode) && (CDF_STATUS_SUCCESS == cdf_status)) {
-		adapter = adapterNode->pAdapter;
-
-		if (adapter->sessionId == vdev_id)
-			return adapter;
-
-		cdf_status =
-			hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	hddLog(CDF_TRACE_LEVEL_ERROR,
-	       FL("vdev_id %d does not exist with host"), vdev_id);
-
-	return NULL;
-}
-
-/**
- * hdd_get_adapter_by_sme_session_id() - Return adapter with
- * the sessionid
- * @hdd_ctx: hdd context.
- * @sme_session_id: sme session is for the adapter to get.
- *
- * This function is used to get the adapter with provided session id
- *
- * Return: adapter pointer if found
- *
- */
-hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx,
-						uint32_t sme_session_id)
-{
-	hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
-	hdd_adapter_t *adapter;
-	CDF_STATUS cdf_status;
-
-
-	cdf_status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
-
-	while ((NULL != adapter_node) &&
-			(CDF_STATUS_SUCCESS == cdf_status)) {
-		adapter = adapter_node->pAdapter;
-
-		if (adapter &&
-			 adapter->sessionId == sme_session_id)
-			return adapter;
-
-		cdf_status =
-			hdd_get_next_adapter(hdd_ctx,
-				 adapter_node, &next);
-		adapter_node = next;
-	}
-	return NULL;
-}
-
-hdd_adapter_t *hdd_get_adapter(hdd_context_t *hdd_ctx, device_mode_t mode)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	hdd_adapter_t *adapter;
-	CDF_STATUS status;
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-
-		if (adapter && (mode == adapter->device_mode))
-			return adapter;
-
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	return NULL;
-
-}
-
-/**
- * hdd_get_operating_channel() - return operating channel of the device mode
- * @hdd_ctx:	Pointer to the HDD context.
- * @mode:	Device mode for which operating channel is required.
- *              Suported modes:
- *			WLAN_HDD_INFRA_STATION,
- *			WLAN_HDD_P2P_CLIENT,
- *			WLAN_HDD_SOFTAP,
- *			WLAN_HDD_P2P_GO.
- *
- * This API returns the operating channel of the requested device mode
- *
- * Return: channel number. "0" id the requested device is not found OR it is
- *	   not connected.
- */
-uint8_t hdd_get_operating_channel(hdd_context_t *hdd_ctx, device_mode_t mode)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-	uint8_t operatingChannel = 0;
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-
-		if (mode == adapter->device_mode) {
-			switch (adapter->device_mode) {
-			case WLAN_HDD_INFRA_STATION:
-			case WLAN_HDD_P2P_CLIENT:
-				if (hdd_conn_is_connected
-					    (WLAN_HDD_GET_STATION_CTX_PTR
-						(adapter))) {
-					operatingChannel =
-						(WLAN_HDD_GET_STATION_CTX_PTR
-						(adapter))->conn_info.
-							operationChannel;
-				}
-				break;
-			case WLAN_HDD_SOFTAP:
-			case WLAN_HDD_P2P_GO:
-				/* softap connection info */
-				if (test_bit
-					    (SOFTAP_BSS_STARTED,
-					    &adapter->event_flags))
-					operatingChannel =
-						(WLAN_HDD_GET_AP_CTX_PTR
-						(adapter))->operatingChannel;
-				break;
-			default:
-				break;
-			}
-
-			break;  /* Found the device of interest. break the loop */
-		}
-
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-	return operatingChannel;
-}
-
-static inline CDF_STATUS hdd_unregister_wext_all_adapters(hdd_context_t *
-							  hdd_ctx)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-
-	ENTER();
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-		if ((adapter->device_mode == WLAN_HDD_INFRA_STATION) ||
-		    (adapter->device_mode == WLAN_HDD_P2P_CLIENT) ||
-		    (adapter->device_mode == WLAN_HDD_IBSS) ||
-		    (adapter->device_mode == WLAN_HDD_P2P_DEVICE) ||
-		    (adapter->device_mode == WLAN_HDD_SOFTAP) ||
-		    (adapter->device_mode == WLAN_HDD_P2P_GO)) {
-			wlan_hdd_cfg80211_deregister_frames(adapter);
-			hdd_unregister_wext(adapter->dev);
-		}
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-CDF_STATUS hdd_abort_mac_scan_all_adapters(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-
-	ENTER();
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-		if ((adapter->device_mode == WLAN_HDD_INFRA_STATION) ||
-		    (adapter->device_mode == WLAN_HDD_P2P_CLIENT) ||
-		    (adapter->device_mode == WLAN_HDD_IBSS) ||
-		    (adapter->device_mode == WLAN_HDD_P2P_DEVICE) ||
-		    (adapter->device_mode == WLAN_HDD_SOFTAP) ||
-		    (adapter->device_mode == WLAN_HDD_P2P_GO)) {
-			hdd_abort_mac_scan(hdd_ctx, adapter->sessionId,
-					   eCSR_SCAN_ABORT_DEFAULT);
-		}
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-#ifdef WLAN_NS_OFFLOAD
-/**
- * hdd_wlan_unregister_ip6_notifier() - unregister IP6 change notifier
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: None
- */
-static void hdd_wlan_unregister_ip6_notifier(hdd_context_t *hdd_ctx)
-{
-	unregister_inet6addr_notifier(&hdd_ctx->ipv6_notifier);
-
-	return;
-}
-
-/**
- * hdd_wlan_register_ip6_notifier() - register IP6 change notifier
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: None
- */
-static void hdd_wlan_register_ip6_notifier(hdd_context_t *hdd_ctx)
-{
-	int ret;
-
-	hdd_ctx->ipv6_notifier.notifier_call = wlan_hdd_ipv6_changed;
-	ret = register_inet6addr_notifier(&hdd_ctx->ipv6_notifier);
-	if (ret)
-		hddLog(LOGE, FL("Failed to register IPv6 notifier"));
-	else
-		hdd_info("Registered IPv6 notifier");
-
-	return;
-}
-#else
-/**
- * hdd_wlan_unregister_ip6_notifier() - unregister IP6 change notifier
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: None
- */
-static void hdd_wlan_unregister_ip6_notifier(hdd_context_t *hdd_ctx)
-{
-}
-/**
- * hdd_wlan_register_ip6_notifier() - register IP6 change notifier
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: None
- */
-static void hdd_wlan_register_ip6_notifier(hdd_context_t *hdd_ctx)
-{
-}
-#endif
-
-#ifdef QCA_WIFI_FTM
-/**
- * hdd_disable_ftm() - Disable FTM mode
- * @hdd_ctx:	HDD context
- *
- * Helper function to disable FTM mode.
- *
- * Return: None.
- */
-static void hdd_disable_ftm(hdd_context_t *hdd_ctx)
-{
-	hdd_notice("Disabling FTM mode");
-
-	if (hdd_ftm_stop(hdd_ctx)) {
-		hdd_alert("hdd_ftm_stop Failed!");
-		CDF_ASSERT(0);
-	}
-
-	hdd_ctx->ftm.ftm_state = WLAN_FTM_STOPPED;
-
-	wlan_hdd_ftm_close(hdd_ctx);
-
-	return;
-}
-
-/**
- * hdd_enable_ftm() - Enable FTM mode
- * @hdd_ctx:	HDD context
- *
- * Helper function to enable FTM mode.
- *
- * Return: 0 on success and errno on failure.
- */
-int hdd_enable_ftm(hdd_context_t *hdd_ctx)
-{
-	int ret;
-
-	ret = wlan_hdd_ftm_open(hdd_ctx);
-	if (ret) {
-		hdd_alert("wlan_hdd_ftm_open Failed: %d", ret);
-		goto err_out;
-	}
-
-	ret = hdd_ftm_start(hdd_ctx);
-
-	if (ret) {
-		hdd_alert("hdd_ftm_start Failed: %d", ret);
-		goto err_ftm_close;
-	}
-
-	ret = wiphy_register(hdd_ctx->wiphy);
-	if (ret) {
-		hdd_alert("wiphy register failed: %d", ret);
-		goto err_ftm_stop;
-	}
-
-	hdd_err("FTM driver loaded");
-
-	return 0;
-
-err_ftm_stop:
-	hdd_ftm_stop(hdd_ctx);
-err_ftm_close:
-	wlan_hdd_ftm_close(hdd_ctx);
-err_out:
-	return ret;
-
-}
-#else
-int hdd_enable_ftm(hdd_context_t *hdd_ctx)
-{
-	hdd_err("Driver built without FTM feature enabled!");
-
-	return -ENOTSUPP;
-}
-
-static inline void hdd_disable_ftm(hdd_context_t *hdd_ctx) { }
-#endif
-
-#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-/**
- * hdd_logging_sock_activate_svc() - Activate logging
- * @hdd_ctx: HDD context
- *
- * Activates the logging service
- *
- * Return: Zero in case of success, negative value otherwise
- */
-static int hdd_logging_sock_activate_svc(hdd_context_t *hdd_ctx)
-{
-	int ret;
-	struct hdd_config *config = hdd_ctx->config;
-
-	if (!config->wlanLoggingEnable)
-		return 0;
-
-	ret = wlan_logging_sock_activate_svc(config->wlanLoggingFEToConsole,
-					     config->wlanLoggingNumBuf);
-	if (ret)
-		hdd_err("wlan_logging_sock_activate_svc failed: %d", ret);
-	return ret;
-}
-
-/**
- * wlan_hdd_logging_sock_deactivate_svc() - Deactivate logging
- * @hdd_ctx: HDD context
- *
- * Deactivates the logging service
- *
- * Return: 0 on deactivating the logging service
- */
-static int hdd_logging_sock_deactivate_svc(hdd_context_t *hdd_ctx)
-{
-	if (hdd_ctx && hdd_ctx->config->wlanLoggingEnable)
-		return wlan_logging_sock_deactivate_svc();
-
-	return 0;
-}
-#else
-static inline int hdd_logging_sock_activate_svc(hdd_context_t *hdd_ctx)
-{
-	return 0;
-}
-
-static inline int hdd_logging_sock_deactivate_svc(hdd_context_t *hdd_ctx)
-{
-	return 0;
-}
-#endif
-
-/**
- * hdd_free_context - Free HDD context
- * @hdd_ctx:	HDD context to be freed.
- *
- * Free config and HDD context.
- *
- * Return: None
- */
-static void hdd_free_context(hdd_context_t *hdd_ctx)
-{
-	if (CDF_GLOBAL_FTM_MODE != hdd_get_conparam())
-		hdd_logging_sock_deactivate_svc(hdd_ctx);
-
-	cdf_mem_free(hdd_ctx->config);
-	hdd_ctx->config = NULL;
-
-	wiphy_free(hdd_ctx->wiphy);
-}
-
-/**
- * hdd_wlan_exit() - HDD WLAN exit function
- * @hdd_ctx:	Pointer to the HDD Context
- *
- * This is the driver exit point (invoked during rmmod)
- *
- * Return: None
- */
-void hdd_wlan_exit(hdd_context_t *hdd_ctx)
-{
-	v_CONTEXT_t p_cds_context = hdd_ctx->pcds_context;
-	CDF_STATUS cdf_status;
-	struct wiphy *wiphy = hdd_ctx->wiphy;
-
-	ENTER();
-
-	hddLog(LOGE, FL("Unregister IPv6 notifier"));
-	hdd_wlan_unregister_ip6_notifier(hdd_ctx);
-	hddLog(LOGE, FL("Unregister IPv4 notifier"));
-	unregister_inetaddr_notifier(&hdd_ctx->ipv4_notifier);
-
-	hdd_unregister_wext_all_adapters(hdd_ctx);
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_disable_ftm(hdd_ctx);
-
-		hdd_alert("FTM driver unloaded");
-		goto free_hdd_ctx;
-	}
-
-	/*
-	 * Cancel any outstanding scan requests.  We are about to close all
-	 * of our adapters, but an adapter structure is what SME passes back
-	 * to our callback function.  Hence if there are any outstanding scan
-	 * requests then there is a race condition between when the adapter
-	 * is closed and when the callback is invoked.  We try to resolve that
-	 * race condition here by canceling any outstanding scans before we
-	 * close the adapters.
-	 * Note that the scans may be cancelled in an asynchronous manner, so
-	 * ideally there needs to be some kind of synchronization.  Rather than
-	 * introduce a new synchronization here, we will utilize the fact that
-	 * we are about to Request Full Power, and since that is synchronized,
-	 * the expectation is that by the time Request Full Power has completed,
-	 * all scans will be cancelled
-	 */
-	hdd_abort_mac_scan_all_adapters(hdd_ctx);
-
-#ifdef MSM_PLATFORM
-	if (CDF_TIMER_STATE_RUNNING ==
-	    cdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer)) {
-		cdf_mc_timer_stop(&hdd_ctx->bus_bw_timer);
-	}
-
-	if (!CDF_IS_STATUS_SUCCESS
-		    (cdf_mc_timer_destroy(&hdd_ctx->bus_bw_timer))) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Cannot deallocate Bus bandwidth timer"));
-	}
-#endif
-
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-	if (CDF_TIMER_STATE_RUNNING ==
-	    cdf_mc_timer_get_current_state(&hdd_ctx->skip_acs_scan_timer)) {
-		cdf_mc_timer_stop(&hdd_ctx->skip_acs_scan_timer);
-	}
-
-	if (!CDF_IS_STATUS_SUCCESS
-		    (cdf_mc_timer_destroy(&hdd_ctx->skip_acs_scan_timer))) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Cannot deallocate ACS Skip timer"));
-	}
-#endif
-	if (CDF_TIMER_STATE_RUNNING ==
-		cdf_mc_timer_get_current_state(
-			&hdd_ctx->dbs_opportunistic_timer)) {
-		cdf_mc_timer_stop(&hdd_ctx->dbs_opportunistic_timer);
-	}
-
-	if (!CDF_IS_STATUS_SUCCESS
-			(cdf_mc_timer_destroy(
-				&hdd_ctx->dbs_opportunistic_timer))) {
-		hdd_err("Cannot deallocate dbs opportunistic timer");
-	}
-
-	/*
-	 * Powersave Offload Case
-	 * Disable Idle Power Save Mode
-	 */
-	hdd_set_idle_ps_config(hdd_ctx, false);
-
-	hdd_debugfs_exit(hdd_ctx);
-
-	/* Unregister the Net Device Notifier */
-	unregister_netdevice_notifier(&hdd_netdev_notifier);
-
-	/*
-	 * Stop all adapters, this will ensure the termination of active
-	 * connections on the interface. Make sure the cds_scheduler is
-	 * still available to handle those control messages
-	 */
-	hdd_stop_all_adapters(hdd_ctx);
-
-	/* Stop all the modules */
-	cdf_status = cds_disable(p_cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("Failed to stop CDS"));
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-
-	/*
-	 * Close the scheduler before calling cds_close to make sure no thread
-	 * is scheduled after the each module close is called i.e after all the
-	 * data structures are freed.
-	 */
-	cdf_status = cds_sched_close(p_cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("Failed to close CDS Scheduler"));
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-	}
-#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
-	/* Destroy the wake lock */
-	cdf_wake_lock_destroy(&hdd_ctx->rx_wake_lock);
-#endif
-	/* Destroy the wake lock */
-	cdf_wake_lock_destroy(&hdd_ctx->sap_wake_lock);
-
-	hdd_hostapd_channel_wakelock_deinit(hdd_ctx);
-
-	/*
-	 * Close CDS
-	 * This frees pMac(HAL) context. There should not be any call
-	 * that requires pMac access after this.
-	 */
-	cds_close(p_cds_context);
-
-	hdd_wlan_green_ap_deinit(hdd_ctx);
-
-#ifdef WLAN_KD_READY_NOTIFIER
-	cnss_diag_notify_wlan_close();
-	ptt_sock_deactivate_svc();
-#endif /* WLAN_KD_READY_NOTIFIER */
-	nl_srv_exit();
-
-	hdd_close_all_adapters(hdd_ctx, false);
-
-	hdd_ipa_cleanup(hdd_ctx);
-
-	/* Free up RoC request queue and flush workqueue */
-	cds_flush_work(&hdd_ctx->roc_req_work);
-	cdf_list_destroy(&hdd_ctx->hdd_roc_req_q);
-	cdf_list_destroy(&hdd_ctx->hdd_scan_req_q);
-
-	if (!CDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) {
-		hdd_err("Failed to deinit policy manager");
-		/* Proceed and complete the clean up */
-	}
-
-free_hdd_ctx:
-
-	wiphy_unregister(wiphy);
-
-	hdd_free_context(hdd_ctx);
-}
-
-void __hdd_wlan_exit(void)
-{
-	hdd_context_t *hdd_ctx;
-
-	ENTER();
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("Invalid HDD Context"));
-		EXIT();
-		return;
-	}
-
-	/* Check IPA HW Pipe shutdown */
-	hdd_ipa_uc_force_pipe_shutdown(hdd_ctx);
-
-#ifdef WLAN_FEATURE_LPSS
-	wlan_hdd_send_status_pkg(NULL, NULL, 0, 0);
-#endif
-
-	memdump_deinit();
-
-#ifdef QCA_PKT_PROTO_TRACE
-	cds_pkt_proto_trace_close();
-#endif
-	/* Do all the cleanup before deregistering the driver */
-	hdd_wlan_exit(hdd_ctx);
-	EXIT();
-}
-
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-void hdd_skip_acs_scan_timer_handler(void *data)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *) data;
-
-	hddLog(LOG1, FL("ACS Scan result expired. Reset ACS scan skip"));
-	hdd_ctx->skip_acs_scan_status = eSAP_DO_NEW_ACS_SCAN;
-
-	if (!hdd_ctx->hHal)
-		return;
-	sme_scan_flush_result(hdd_ctx->hHal);
-}
-#endif
-
-#ifdef QCA_HT_2040_COEX
-/**
- * hdd_wlan_set_ht2040_mode() - notify FW with HT20/HT40 mode
- * @adapter: pointer to adapter
- * @staId: station id
- * @macAddrSTA: station MAC address
- * @channel_type: channel type
- *
- * This function notifies FW with HT20/HT40 mode
- *
- * Return: 0 if successful, error number otherwise
- */
-int hdd_wlan_set_ht2040_mode(hdd_adapter_t *adapter, uint16_t staId,
-			     struct cdf_mac_addr macAddrSTA, int channel_type)
-{
-	int status;
-	CDF_STATUS cdf_status;
-	hdd_context_t *hdd_ctx = NULL;
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return status;
-	}
-	if (!hdd_ctx->hHal)
-		return -EINVAL;
-
-	cdf_status = sme_notify_ht2040_mode(hdd_ctx->hHal, staId, macAddrSTA,
-					    adapter->sessionId, channel_type);
-	if (CDF_STATUS_SUCCESS != cdf_status) {
-		hddLog(LOGE, "Fail to send notification with ht2040 mode");
-		return -EINVAL;
-	}
-
-	return 0;
-}
-#endif
-
-/**
- * hdd_wlan_notify_modem_power_state() - notify FW with modem power status
- * @state: state
- *
- * This function notifies FW with modem power status
- *
- * Return: 0 if successful, error number otherwise
- */
-int hdd_wlan_notify_modem_power_state(int state)
-{
-	int status;
-	CDF_STATUS cdf_status;
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return status;
-	}
-	if (!hdd_ctx->hHal)
-		return -EINVAL;
-
-	cdf_status = sme_notify_modem_power_state(hdd_ctx->hHal, state);
-	if (CDF_STATUS_SUCCESS != cdf_status) {
-		hddLog(LOGE,
-		       "Fail to send notification with modem power state %d",
-		       state);
-		return -EINVAL;
-	}
-	return 0;
-}
-
-/**
- *
- * hdd_post_cds_enable_config() - HDD post cds start config helper
- * @adapter - Pointer to the HDD
- *
- * Return: None
- */
-CDF_STATUS hdd_post_cds_enable_config(hdd_context_t *hdd_ctx)
-{
-	CDF_STATUS cdf_ret_status;
-
-	/*
-	 * Send ready indication to the HDD.  This will kick off the MAC
-	 * into a 'running' state and should kick off an initial scan.
-	 */
-	cdf_ret_status = sme_hdd_ready_ind(hdd_ctx->hHal);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_ret_status)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL(
-			  "sme_hdd_ready_ind() failed with status code %08d [x%08x]"
-			 ),
-		       cdf_ret_status, cdf_ret_status);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/* wake lock APIs for HDD */
-void hdd_prevent_suspend(uint32_t reason)
-{
-	cdf_wake_lock_acquire(&wlan_wake_lock, reason);
-}
-
-void hdd_allow_suspend(uint32_t reason)
-{
-	cdf_wake_lock_release(&wlan_wake_lock, reason);
-}
-
-void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason)
-{
-	cdf_wake_lock_timeout_acquire(&wlan_wake_lock, timeout, reason);
-}
-
-/**
- * hdd_exchange_version_and_caps() - exchange version and capability with target
- * @hdd_ctx:	Pointer to HDD context
- *
- * This is the HDD function to exchange version and capability information
- * between Host and Target
- *
- * This function gets reported version of FW.
- * It also finds the version of target headers used to compile the host;
- * It compares the above two and prints a warning if they are different;
- * It gets the SW and HW version string;
- * Finally, it exchanges capabilities between host and target i.e. host
- * and target exchange a msg indicating the features they support through a
- * bitmap
- *
- * Return: None
- */
-void hdd_exchange_version_and_caps(hdd_context_t *hdd_ctx)
-{
-
-	tSirVersionType versionCompiled;
-	tSirVersionType versionReported;
-	tSirVersionString versionString;
-	uint8_t fwFeatCapsMsgSupported = 0;
-	CDF_STATUS vstatus;
-
-	memset(&versionCompiled, 0, sizeof(versionCompiled));
-	memset(&versionReported, 0, sizeof(versionReported));
-
-	/* retrieve and display WCNSS version information */
-	do {
-
-		vstatus = sme_get_wcnss_wlan_compiled_version(hdd_ctx->hHal,
-							      &versionCompiled);
-		if (!CDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "unable to retrieve WCNSS WLAN compiled version"
-				 ));
-			break;
-		}
-
-		vstatus = sme_get_wcnss_wlan_reported_version(hdd_ctx->hHal,
-							      &versionReported);
-		if (!CDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "unable to retrieve WCNSS WLAN reported version"
-				 ));
-			break;
-		}
-
-		if ((versionCompiled.major != versionReported.major) ||
-		    (versionCompiled.minor != versionReported.minor) ||
-		    (versionCompiled.version != versionReported.version) ||
-		    (versionCompiled.revision != versionReported.revision)) {
-			pr_err("%s: WCNSS WLAN Version %u.%u.%u.%u, "
-			       "Host expected %u.%u.%u.%u\n",
-			       WLAN_MODULE_NAME,
-			       (int)versionReported.major,
-			       (int)versionReported.minor,
-			       (int)versionReported.version,
-			       (int)versionReported.revision,
-			       (int)versionCompiled.major,
-			       (int)versionCompiled.minor,
-			       (int)versionCompiled.version,
-			       (int)versionCompiled.revision);
-		} else {
-			pr_info("%s: WCNSS WLAN version %u.%u.%u.%u\n",
-				WLAN_MODULE_NAME,
-				(int)versionReported.major,
-				(int)versionReported.minor,
-				(int)versionReported.version,
-				(int)versionReported.revision);
-		}
-
-		vstatus = sme_get_wcnss_software_version(hdd_ctx->hHal,
-							 versionString,
-							 sizeof(versionString));
-		if (!CDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "unable to retrieve WCNSS software version string"
-				 ));
-			break;
-		}
-
-		pr_info("%s: WCNSS software version %s\n",
-			WLAN_MODULE_NAME, versionString);
-
-		vstatus = sme_get_wcnss_hardware_version(hdd_ctx->hHal,
-							 versionString,
-							 sizeof(versionString));
-		if (!CDF_IS_STATUS_SUCCESS(vstatus)) {
-			hddLog(CDF_TRACE_LEVEL_FATAL,
-			       FL(
-				  "unable to retrieve WCNSS hardware version string"
-				 ));
-			break;
-		}
-
-		pr_info("%s: WCNSS hardware version %s\n",
-			WLAN_MODULE_NAME, versionString);
-
-		/*
-		 * 1.Check if FW version is greater than 0.1.1.0. Only then
-		 * send host-FW capability exchange message
-		 * 2.Host-FW capability exchange message  is only present on
-		 * target 1.1 so send the message only if it the target is 1.1
-		 * minor numbers for different target branches:
-		 * 0 -> (1.0)Mainline Build
-		 * 1 -> (1.1)Mainline Build
-		 * 2->(1.04) Stability Build
-		 */
-		if (((versionReported.major > 0) || (versionReported.minor > 1)
-		     || ((versionReported.minor >= 1)
-			 && (versionReported.version >= 1)))
-		    && ((versionReported.major == 1)
-			&& (versionReported.minor >= 1)))
-			fwFeatCapsMsgSupported = 1;
-
-		if (fwFeatCapsMsgSupported) {
-			/*
-			 * Indicate if IBSS heartbeat monitoring needs to be
-			 * offloaded
-			 */
-			if (!hdd_ctx->config->enableIbssHeartBeatOffload) {
-				sme_disable_feature_capablity
-					(IBSS_HEARTBEAT_OFFLOAD);
-			}
-
-			sme_feature_caps_exchange(hdd_ctx->hHal);
-		}
-
-	} while (0);
-
-}
-
-/* Initialize channel list in sme based on the country code */
-CDF_STATUS hdd_set_sme_chan_list(hdd_context_t *hdd_ctx)
-{
-	return sme_init_chan_list(hdd_ctx->hHal, hdd_ctx->reg.alpha2,
-				  hdd_ctx->reg.cc_src);
-}
-
-/**
- * hdd_is_5g_supported() - check if hardware supports 5GHz
- * @hdd_ctx:	Pointer to the hdd context
- *
- * HDD function to know if hardware supports 5GHz
- *
- * Return:  true if hardware supports 5GHz
- */
-bool hdd_is_5g_supported(hdd_context_t *hdd_ctx)
-{
-	/*
-	 * If wcnss_wlan_iris_xo_mode() returns WCNSS_XO_48MHZ(1);
-	 * then hardware support 5Ghz.
-	 */
-	return true;
-}
-
-static CDF_STATUS wlan_hdd_regulatory_init(hdd_context_t *hdd_ctx)
-{
-	struct wiphy *wiphy;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	wiphy = hdd_ctx->wiphy;
-
-	/*
-	 * The channel information in
-	 * wiphy needs to be initialized before wiphy registration
-	 */
-	status = cds_regulatory_init();
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("cds_init_wiphy failed"));
-		return status;
-	}
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-	wiphy->wowlan = &wowlan_support_reg_init;
-#else
-	wiphy->wowlan.flags = WIPHY_WOWLAN_ANY |
-			      WIPHY_WOWLAN_MAGIC_PKT |
-			      WIPHY_WOWLAN_DISCONNECT |
-			      WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
-			      WIPHY_WOWLAN_GTK_REKEY_FAILURE |
-			      WIPHY_WOWLAN_EAP_IDENTITY_REQ |
-			      WIPHY_WOWLAN_4WAY_HANDSHAKE |
-			      WIPHY_WOWLAN_RFKILL_RELEASE;
-
-	wiphy->wowlan.n_patterns = (WOW_MAX_FILTER_LISTS *
-				    WOW_MAX_FILTERS_PER_LIST);
-	wiphy->wowlan.pattern_min_len = WOW_MIN_PATTERN_SIZE;
-	wiphy->wowlan.pattern_max_len = WOW_MAX_PATTERN_SIZE;
-#endif
-
-	/* registration of wiphy dev with cfg80211 */
-	if (0 > wlan_hdd_cfg80211_register(wiphy)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("wiphy register failed"));
-		status = CDF_STATUS_E_FAILURE;
-	}
-
-	return status;
-}
-
-#ifdef MSM_PLATFORM
-void hdd_cnss_request_bus_bandwidth(hdd_context_t *hdd_ctx,
-			const uint64_t tx_packets, const uint64_t rx_packets)
-{
-#ifdef CONFIG_CNSS
-	uint64_t total = tx_packets + rx_packets;
-	uint64_t temp_rx = 0;
-	uint64_t temp_tx = 0;
-	enum cnss_bus_width_type next_vote_level = CNSS_BUS_WIDTH_NONE;
-	enum wlan_tp_level next_rx_level = WLAN_SVC_TP_NONE;
-	enum wlan_tp_level next_tx_level = WLAN_SVC_TP_NONE;
-
-
-	if (total > hdd_ctx->config->busBandwidthHighThreshold)
-		next_vote_level = CNSS_BUS_WIDTH_HIGH;
-	else if (total > hdd_ctx->config->busBandwidthMediumThreshold)
-		next_vote_level = CNSS_BUS_WIDTH_MEDIUM;
-	else if (total > hdd_ctx->config->busBandwidthLowThreshold)
-		next_vote_level = CNSS_BUS_WIDTH_LOW;
-	else
-		next_vote_level = CNSS_BUS_WIDTH_NONE;
-
-	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].next_vote_level =
-							next_vote_level;
-
-	if (hdd_ctx->cur_vote_level != next_vote_level) {
-		hddLog(CDF_TRACE_LEVEL_DEBUG,
-		       FL(
-			  "trigger level %d, tx_packets: %lld, rx_packets: %lld"
-			 ),
-		       next_vote_level, tx_packets, rx_packets);
-		hdd_ctx->cur_vote_level = next_vote_level;
-		cnss_request_bus_bandwidth(next_vote_level);
-	}
-
-	/* fine-tuning parameters for RX Flows */
-	temp_rx = (rx_packets + hdd_ctx->prev_rx) / 2;
-
-	hdd_ctx->prev_rx = rx_packets;
-	if (temp_rx > hdd_ctx->config->tcpDelackThresholdHigh)
-		next_rx_level = WLAN_SVC_TP_HIGH;
-	else
-		next_rx_level = WLAN_SVC_TP_LOW;
-
-	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].next_rx_level =
-								next_rx_level;
-
-	if (hdd_ctx->cur_rx_level != next_rx_level) {
-		hddLog(CDF_TRACE_LEVEL_DEBUG,
-		       FL("TCP DELACK trigger level %d, average_rx: %llu"),
-		       next_rx_level, temp_rx);
-		hdd_ctx->cur_rx_level = next_rx_level;
-		wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_TP_IND,
-					    &next_rx_level,
-					    sizeof(next_rx_level));
-	}
-
-	/* fine-tuning parameters for TX Flows */
-	temp_tx = (tx_packets + hdd_ctx->prev_tx) / 2;
-	hdd_ctx->prev_tx = tx_packets;
-	if (temp_tx > hdd_ctx->config->tcp_tx_high_tput_thres)
-		next_tx_level = WLAN_SVC_TP_HIGH;
-	else
-		next_tx_level = WLAN_SVC_TP_LOW;
-
-	 if (hdd_ctx->cur_tx_level != next_tx_level) {
-		hdd_debug("change TCP TX trigger level %d, average_tx: %llu",
-				next_tx_level, temp_tx);
-		hdd_ctx->cur_tx_level = next_tx_level;
-		wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_TP_TX_IND,
-				&next_tx_level,
-				sizeof(next_tx_level));
-	}
-
-	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].next_tx_level =
-								next_tx_level;
-	hdd_ctx->hdd_txrx_hist_idx++;
-	hdd_ctx->hdd_txrx_hist_idx &= NUM_TX_RX_HISTOGRAM_MASK;
-#endif
-}
-
-#define HDD_BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1)
-static void hdd_bus_bw_compute_cbk(void *priv)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *) priv;
-	hdd_adapter_t *adapter = NULL;
-	uint64_t tx_packets = 0, rx_packets = 0;
-	uint64_t total_tx = 0, total_rx = 0;
-	hdd_adapter_list_node_t *adapterNode = NULL;
-	CDF_STATUS status = 0;
-	bool connected = false;
-	uint32_t ipa_tx_packets = 0, ipa_rx_packets = 0;
-
-	for (status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-	     NULL != adapterNode && CDF_STATUS_SUCCESS == status;
-	     status =
-		     hdd_get_next_adapter(hdd_ctx, adapterNode, &adapterNode)) {
-
-		if (adapterNode->pAdapter == NULL)
-			continue;
-		adapter = adapterNode->pAdapter;
-
-		if ((adapter->device_mode == WLAN_HDD_INFRA_STATION ||
-		     adapter->device_mode == WLAN_HDD_P2P_CLIENT) &&
-		    WLAN_HDD_GET_STATION_CTX_PTR(adapter)->conn_info.connState
-		    != eConnectionState_Associated) {
-
-			continue;
-		}
-
-		if ((adapter->device_mode == WLAN_HDD_SOFTAP ||
-		     adapter->device_mode == WLAN_HDD_P2P_GO) &&
-		    WLAN_HDD_GET_AP_CTX_PTR(adapter)->bApActive == false) {
-
-			continue;
-		}
-
-		tx_packets += HDD_BW_GET_DIFF(adapter->stats.tx_packets,
-					      adapter->prev_tx_packets);
-		rx_packets += HDD_BW_GET_DIFF(adapter->stats.rx_packets,
-					      adapter->prev_rx_packets);
-
-		total_rx += adapter->stats.rx_packets;
-		total_tx += adapter->stats.tx_packets;
-
-		spin_lock_bh(&hdd_ctx->bus_bw_lock);
-		adapter->prev_tx_packets = adapter->stats.tx_packets;
-		adapter->prev_rx_packets = adapter->stats.rx_packets;
-		spin_unlock_bh(&hdd_ctx->bus_bw_lock);
-		connected = true;
-	}
-
-	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].total_rx = total_rx;
-	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].total_tx = total_tx;
-	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].interval_rx =
-								rx_packets;
-	hdd_ctx->hdd_txrx_hist[hdd_ctx->hdd_txrx_hist_idx].interval_tx =
-								tx_packets;
-
-	hdd_ipa_uc_stat_query(hdd_ctx, &ipa_tx_packets, &ipa_rx_packets);
-	tx_packets += (uint64_t)ipa_tx_packets;
-	rx_packets += (uint64_t)ipa_rx_packets;
-
-	if (!connected) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("bus bandwidth timer running in disconnected state"));
-		return;
-	}
-
-	hdd_cnss_request_bus_bandwidth(hdd_ctx, tx_packets, rx_packets);
-
-	hdd_ipa_set_perf_level(hdd_ctx, tx_packets, rx_packets);
-	hdd_ipa_uc_stat_request(adapter, 2);
-
-	cdf_mc_timer_start(&hdd_ctx->bus_bw_timer,
-			   hdd_ctx->config->busBandwidthComputeInterval);
-}
-#endif
-
-/**
- * wlan_hdd_display_tx_rx_histogram() - display tx rx histogram
- * @hdd_ctx: hdd context
- *
- * Return: none
- */
-void wlan_hdd_display_tx_rx_histogram(hdd_context_t *hdd_ctx)
-{
-	int i;
-
-#ifdef MSM_PLATFORM
-	hddLog(CDF_TRACE_LEVEL_ERROR, "BW Interval: %d curr_index %d",
-		hdd_ctx->config->busBandwidthComputeInterval,
-		hdd_ctx->hdd_txrx_hist_idx);
-	hddLog(CDF_TRACE_LEVEL_ERROR,
-		"BW High TH: %d BW Med TH: %d BW Low TH: %d",
-		hdd_ctx->config->busBandwidthHighThreshold,
-		hdd_ctx->config->busBandwidthMediumThreshold,
-		hdd_ctx->config->busBandwidthLowThreshold);
-	hddLog(CDF_TRACE_LEVEL_ERROR, "TCP DEL High TH: %d TCP DEL Low TH: %d",
-		hdd_ctx->config->tcpDelackThresholdHigh,
-		hdd_ctx->config->tcpDelackThresholdLow);
-#endif
-
-	hddLog(CDF_TRACE_LEVEL_ERROR,
-		"index, total_rx, interval_rx, total_tx, interval_tx, next_vote_level, next_rx_level, next_tx_level");
-
-	for (i = 0; i < NUM_TX_RX_HISTOGRAM; i++) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			"%d: %llu, %llu, %llu, %llu, %d, %d, %d",
-			i, hdd_ctx->hdd_txrx_hist[i].total_rx,
-			hdd_ctx->hdd_txrx_hist[i].interval_rx,
-			hdd_ctx->hdd_txrx_hist[i].total_tx,
-			hdd_ctx->hdd_txrx_hist[i].interval_tx,
-			hdd_ctx->hdd_txrx_hist[i].next_vote_level,
-			hdd_ctx->hdd_txrx_hist[i].next_rx_level,
-			hdd_ctx->hdd_txrx_hist[i].next_tx_level);
-	}
-	return;
-}
-
-/**
- * wlan_hdd_clear_tx_rx_histogram() - clear tx rx histogram
- * @hdd_ctx: hdd context
- *
- * Return: none
- */
-void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *hdd_ctx)
-{
-	hdd_ctx->hdd_txrx_hist_idx = 0;
-	cdf_mem_zero(hdd_ctx->hdd_txrx_hist, sizeof(hdd_ctx->hdd_txrx_hist));
-}
-
-/**
- * wlan_hdd_display_netif_queue_history() - display netif queue operation history
- * @pHddCtx: hdd context
- *
- * Return: none
- */
-void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx)
-{
-
-	hdd_adapter_t *adapter = NULL;
-	hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
-	CDF_STATUS status;
-	int i;
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
-	while (NULL != adapter_node && CDF_STATUS_SUCCESS == status) {
-		adapter = adapter_node->pAdapter;
-
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			"Session_id %d device mode %d current index %d",
-			adapter->sessionId, adapter->device_mode,
-			adapter->history_index);
-
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			"Netif queue operation statistics:");
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			"Current pause_map value %x", adapter->pause_map);
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			"  reason_type: pause_cnt: unpause_cnt");
-
-		for (i = 0; i < WLAN_REASON_TYPE_MAX; i++) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-				"%s: %d: %d",
-				hdd_reason_type_to_string(i),
-				adapter->queue_oper_stats[i].pause_count,
-				adapter->queue_oper_stats[i].unpause_count);
-		}
-
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			"Netif queue operation history:");
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			"index: time: action_type: reason_type: pause_map");
-
-		for (i = 0; i < WLAN_HDD_MAX_HISTORY_ENTRY; i++) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-				"%d: %u: %s: %s: %x",
-				i, cdf_system_ticks_to_msecs(
-					adapter->queue_oper_history[i].time),
-				hdd_action_type_to_string(
-				adapter->queue_oper_history[i].netif_action),
-				hdd_reason_type_to_string(
-				adapter->queue_oper_history[i].netif_reason),
-				adapter->queue_oper_history[i].pause_map);
-		}
-
-		status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next);
-		adapter_node = next;
-	}
-
-
-}
-
-/**
- * wlan_hdd_clear_netif_queue_history() - clear netif queue operation history
- * @hdd_ctx: hdd context
- *
- * Return: none
- */
-void wlan_hdd_clear_netif_queue_history(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_t *adapter = NULL;
-	hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
-	CDF_STATUS status;
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
-	while (NULL != adapter_node && CDF_STATUS_SUCCESS == status) {
-		adapter = adapter_node->pAdapter;
-
-		cdf_mem_zero(adapter->queue_oper_stats,
-					sizeof(adapter->queue_oper_stats));
-		cdf_mem_zero(adapter->queue_oper_history,
-					sizeof(adapter->queue_oper_history));
-
-		status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next);
-		adapter_node = next;
-	}
-}
-
-/**
- * hdd_11d_scan_done() - callback for 11d scan completion of flushing results
- * @halHandle:	Hal handle
- * @pContext:	Pointer to the context
- * @sessionId:	Session ID
- * @scanId:	Scan ID
- * @status:	Status
- *
- * This is the callback to be executed when 11d scan is completed to flush out
- * the scan results
- *
- * 11d scan is done during driver load and is a passive scan on all
- * channels supported by the device, 11d scans may find some APs on
- * frequencies which are forbidden to be used in the regulatory domain
- * the device is operating in. If these APs are notified to the supplicant
- * it may try to connect to these APs, thus flush out all the scan results
- * which are present in SME after 11d scan is done.
- *
- * Return:  CDF_STATUS_SUCCESS
- */
-static CDF_STATUS hdd_11d_scan_done(tHalHandle halHandle, void *pContext,
-				    uint8_t sessionId, uint32_t scanId,
-				    eCsrScanStatus status)
-{
-	ENTER();
-
-	sme_scan_flush_result(halHandle);
-
-	EXIT();
-
-	return CDF_STATUS_SUCCESS;
-}
-
-#ifdef WLAN_FEATURE_OFFLOAD_PACKETS
-/**
- * hdd_init_offloaded_packets_ctx() - Initialize offload packets context
- * @hdd_ctx: hdd global context
- *
- * Return: none
- */
-static void hdd_init_offloaded_packets_ctx(hdd_context_t *hdd_ctx)
-{
-	uint8_t i;
-
-	mutex_init(&hdd_ctx->op_ctx.op_lock);
-	for (i = 0; i < MAXNUM_PERIODIC_TX_PTRNS; i++) {
-		hdd_ctx->op_ctx.op_table[i].request_id = MAX_REQUEST_ID;
-		hdd_ctx->op_ctx.op_table[i].pattern_id = i;
-	}
-}
-#else
-static void hdd_init_offloaded_packets_ctx(hdd_context_t *hdd_ctx)
-{
-}
-#endif
-
-#ifdef WLAN_FEATURE_FASTPATH
-/**
- * hdd_enable_fastpath() - Enable fastpath if enabled in config INI
- * @hdd_cfg: hdd config
- * @context: lower layer context
- *
- * Return: none
- */
-static void hdd_enable_fastpath(struct hdd_config *hdd_cfg,
-				void *context)
-{
-	if (hdd_cfg->fastpath_enable)
-		hif_enable_fastpath(context);
-}
-#else
-static void hdd_enable_fastpath(struct hdd_config *hdd_cfg,
-				void *context)
-{
-}
-#endif
-
-#if defined(FEATURE_WLAN_CH_AVOID) && defined(CONFIG_CNSS)
-/**
- * hdd_set_thermal_level_cb() - set thermal level callback function
- * @context:	hdd context pointer
- * @level:	thermal level
- *
- * Change IPA data path to SW path when the thermal throttle level greater
- * than 0, and restore the original data path when throttle level is 0
- *
- * Return: none
- */
-static void hdd_set_thermal_level_cb(void *context, u_int8_t level)
-{
-	hdd_context_t *hdd_ctx = context;
-
-	/* Change IPA to SW path when throttle level greater than 0 */
-	if (level > THROTTLE_LEVEL_0)
-		hdd_ipa_send_mcc_scc_msg(hdd_ctx, true);
-	else
-		/* restore original concurrency mode */
-		hdd_ipa_send_mcc_scc_msg(hdd_ctx, hdd_ctx->mcc_mode);
-}
-
-/**
- * hdd_find_prefd_safe_chnl() - find safe channel within preferred channel
- * @hdd_ctxt:	hdd context pointer
- * @ap_adapter: hdd hostapd adapter pointer
- *
- * Try to find safe channel within preferred channel
- * In case auto channel selection enabled
- *  - Preferred and safe channel should be used
- *  - If no overlapping, preferred channel should be used
- *
- * Return: 1: found preferred safe channel
- *         0: could not found preferred safe channel
- */
-static uint8_t hdd_find_prefd_safe_chnl(hdd_context_t *hdd_ctxt,
-					hdd_adapter_t *ap_adapter)
-{
-	uint16_t safe_channels[NUM_20MHZ_RF_CHANNELS];
-	uint16_t safe_channel_count;
-	uint16_t unsafe_channel_count;
-	uint8_t is_unsafe = 1;
-	uint16_t i;
-	uint16_t channel_loop;
-
-	if (!hdd_ctxt || !ap_adapter) {
-		hdd_err("invalid context/adapter");
-		return 0;
-	}
-
-	safe_channel_count = 0;
-	unsafe_channel_count = CDF_MIN((uint16_t)hdd_ctxt->unsafe_channel_count,
-				       (uint16_t)NUM_20MHZ_RF_CHANNELS);
-
-	for (i = 0; i < NUM_20MHZ_RF_CHANNELS; i++) {
-		is_unsafe = 0;
-		for (channel_loop = 0;
-		     channel_loop < unsafe_channel_count; channel_loop++) {
-			if (CDS_CHANNEL_NUM(i) ==
-			    hdd_ctxt->unsafe_channel_list[channel_loop]) {
-				is_unsafe = 1;
-				break;
-			}
-		}
-		if (!is_unsafe) {
-			safe_channels[safe_channel_count] =
-			  CDS_CHANNEL_NUM(i);
-			hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-			       FL("safe channel %d"),
-			       safe_channels[safe_channel_count]);
-			safe_channel_count++;
-		}
-	}
-	hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-	       FL("perferred range %d - %d"),
-		ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.start_ch,
-		ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.end_ch);
-	for (i = 0; i < safe_channel_count; i++) {
-		if (safe_channels[i] >=
-			ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.start_ch
-		    && safe_channels[i] <=
-			ap_adapter->sessionCtx.ap.sapConfig.acs_cfg.end_ch) {
-			hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-			       FL("safe channel %d is in perferred range"),
-			       safe_channels[i]);
-			return 1;
-		}
-	}
-	return 0;
-}
-/**
- * hdd_indicate_mgmt_frame() - Wrapper to indicate management frame to
- * user space
- * @frame_ind: Management frame data to be informed.
- *
- * This function is used to indicate management frame to
- * user space
- *
- * Return: None
- *
- */
-void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind)
-{
-	hdd_context_t *hdd_ctx = NULL;
-	hdd_adapter_t *adapter = NULL;
-	void *cds_context = NULL;
-	int i;
-
-	/* Get the global VOSS context.*/
-	cds_context = cds_get_global_context();
-	if (!cds_context) {
-		hddLog(LOGE, FL("Global VOS context is Null"));
-		return;
-	}
-	/* Get the HDD context.*/
-	hdd_ctx =
-	  (hdd_context_t *)cds_get_context(CDF_MODULE_ID_HDD);
-
-	if (0 != wlan_hdd_validate_context(hdd_ctx))
-		return;
-
-	if (SME_SESSION_ID_ANY == frame_ind->sessionId) {
-		for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) {
-			adapter =
-				hdd_get_adapter_by_sme_session_id(hdd_ctx, i);
-			if (adapter)
-				break;
-		}
-	} else {
-		adapter = hdd_get_adapter_by_sme_session_id(hdd_ctx,
-					frame_ind->sessionId);
-	}
-
-	if ((NULL != adapter) &&
-		(WLAN_HDD_ADAPTER_MAGIC == adapter->magic))
-		__hdd_indicate_mgmt_frame(adapter,
-						frame_ind->frame_len,
-						frame_ind->frameBuf,
-						frame_ind->frameType,
-						frame_ind->rxChan,
-						frame_ind->rxRssi);
-	return;
-}
-
-/**
- * hdd_ch_avoid_cb() - Avoid notified channels from FW handler
- * @adapter:	HDD adapter pointer
- * @indParam:	Channel avoid notification parameter
- *
- * Avoid channel notification from FW handler.
- * FW will send un-safe channel list to avoid over wrapping.
- * hostapd should not use notified channel
- *
- * Return: None
- */
-static void hdd_ch_avoid_cb(void *hdd_context, void *indi_param)
-{
-	hdd_adapter_t *hostapd_adapter = NULL;
-	hdd_context_t *hdd_ctxt;
-	tSirChAvoidIndType *ch_avoid_indi;
-	uint8_t range_loop;
-	enum channel_enum channel_loop, start_channel_idx = INVALID_RF_CHANNEL,
-					end_channel_idx = INVALID_RF_CHANNEL;
-	uint16_t start_channel;
-	uint16_t end_channel;
-	v_CONTEXT_t cds_context;
-	static int restart_sap_in_progress;
-	tHddAvoidFreqList hdd_avoid_freq_list;
-	uint32_t i;
-
-	/* Basic sanity */
-	if (!hdd_context || !indi_param) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("Invalid arguments"));
-		return;
-	}
-
-	hdd_ctxt = (hdd_context_t *) hdd_context;
-	ch_avoid_indi = (tSirChAvoidIndType *) indi_param;
-	cds_context = hdd_ctxt->pcds_context;
-
-	/* Make unsafe channel list */
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       FL("band count %d"),
-	       ch_avoid_indi->avoid_range_count);
-
-	/* generate vendor specific event */
-	cdf_mem_zero((void *)&hdd_avoid_freq_list, sizeof(tHddAvoidFreqList));
-	for (i = 0; i < ch_avoid_indi->avoid_range_count; i++) {
-		hdd_avoid_freq_list.avoidFreqRange[i].startFreq =
-			ch_avoid_indi->avoid_freq_range[i].start_freq;
-		hdd_avoid_freq_list.avoidFreqRange[i].endFreq =
-			ch_avoid_indi->avoid_freq_range[i].end_freq;
-	}
-	hdd_avoid_freq_list.avoidFreqRangeCount =
-		ch_avoid_indi->avoid_range_count;
-
-	wlan_hdd_send_avoid_freq_event(hdd_ctxt, &hdd_avoid_freq_list);
-
-	/* clear existing unsafe channel cache */
-	hdd_ctxt->unsafe_channel_count = 0;
-	cdf_mem_zero(hdd_ctxt->unsafe_channel_list,
-					sizeof(hdd_ctxt->unsafe_channel_list));
-
-	for (range_loop = 0; range_loop < ch_avoid_indi->avoid_range_count;
-								range_loop++) {
-		if (hdd_ctxt->unsafe_channel_count >= NUM_20MHZ_RF_CHANNELS) {
-			hddLog(LOGW, FL("LTE Coex unsafe channel list full"));
-			break;
-		}
-
-		start_channel = ieee80211_frequency_to_channel(
-			ch_avoid_indi->avoid_freq_range[range_loop].start_freq);
-		end_channel   = ieee80211_frequency_to_channel(
-			ch_avoid_indi->avoid_freq_range[range_loop].end_freq);
-		hddLog(LOG1, "%s : start %d : %d, end %d : %d", __func__,
-			ch_avoid_indi->avoid_freq_range[range_loop].start_freq,
-			start_channel,
-			ch_avoid_indi->avoid_freq_range[range_loop].end_freq,
-			end_channel);
-
-		/* do not process frequency bands that are not mapped to
-		 * predefined channels
-		 */
-		if (start_channel == 0 || end_channel == 0)
-			continue;
-
-		for (channel_loop = MIN_20MHZ_RF_CHANNEL; channel_loop <=
-					MAX_20MHZ_RF_CHANNEL; channel_loop++) {
-			if (CDS_CHANNEL_FREQ(channel_loop) >=
-						ch_avoid_indi->avoid_freq_range[
-						range_loop].start_freq) {
-				start_channel_idx = channel_loop;
-				break;
-			}
-		}
-		for (channel_loop = MIN_20MHZ_RF_CHANNEL; channel_loop <=
-					MAX_20MHZ_RF_CHANNEL; channel_loop++) {
-			if (CDS_CHANNEL_FREQ(channel_loop) >=
-						ch_avoid_indi->avoid_freq_range[
-						range_loop].end_freq) {
-				end_channel_idx = channel_loop;
-				if (CDS_CHANNEL_FREQ(channel_loop) >
-						ch_avoid_indi->avoid_freq_range[
-						range_loop].end_freq)
-					end_channel_idx--;
-				break;
-			}
-		}
-
-		if (start_channel_idx == INVALID_RF_CHANNEL ||
-					end_channel_idx == INVALID_RF_CHANNEL)
-			continue;
-
-		for (channel_loop = start_channel_idx; channel_loop <=
-					end_channel_idx; channel_loop++) {
-			hdd_ctxt->unsafe_channel_list[
-				hdd_ctxt->unsafe_channel_count++] =
-				CDS_CHANNEL_FREQ(channel_loop);
-			if (hdd_ctxt->unsafe_channel_count >=
-							NUM_20MHZ_RF_CHANNELS) {
-				hddLog(LOGW, FL("LTECoex unsafe ch list full"));
-				break;
-			}
-		}
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       FL("number of unsafe channels is %d "),
-	       hdd_ctxt->unsafe_channel_count);
-
-	if (cnss_set_wlan_unsafe_channel(hdd_ctxt->unsafe_channel_list,
-				hdd_ctxt->unsafe_channel_count)) {
-		hdd_err("Failed to set unsafe channel");
-
-		/* clear existing unsafe channel cache */
-		hdd_ctxt->unsafe_channel_count = 0;
-		cdf_mem_zero(hdd_ctxt->unsafe_channel_list,
-			sizeof(hdd_ctxt->unsafe_channel_list));
-
-		return;
-	}
-
-	for (channel_loop = 0;
-	     channel_loop < hdd_ctxt->unsafe_channel_count; channel_loop++) {
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       FL("channel %d is not safe "),
-		       hdd_ctxt->unsafe_channel_list[channel_loop]);
-	}
-
-	/*
-	 * If auto channel select is enabled
-	 * preferred channel is in safe channel,
-	 * re-start softap interface with safe channel.
-	 * no overlap with preferred channel and safe channel
-	 * do not re-start softap interface
-	 * stay current operating channel.
-	 */
-	if (hdd_ctxt->unsafe_channel_count) {
-		hostapd_adapter = hdd_get_adapter(hdd_ctxt, WLAN_HDD_SOFTAP);
-		if (hostapd_adapter) {
-			if ((hostapd_adapter->sessionCtx.ap.sapConfig.
-				acs_cfg.acs_mode) &&
-				(!hdd_find_prefd_safe_chnl(hdd_ctxt,
-				hostapd_adapter)))
-				return;
-
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       FL(
-				  "Current operation channel %d, sessionCtx.ap.sapConfig.channel %d"
-				 ),
-			       hostapd_adapter->sessionCtx.ap.
-			       operatingChannel,
-			       hostapd_adapter->sessionCtx.ap.sapConfig.
-			       channel);
-			for (channel_loop = 0;
-			     channel_loop < hdd_ctxt->unsafe_channel_count;
-			     channel_loop++) {
-				if (((hdd_ctxt->
-					unsafe_channel_list[channel_loop] ==
-						hostapd_adapter->sessionCtx.ap.
-						      operatingChannel)) &&
-					(hostapd_adapter->sessionCtx.ap.
-						sapConfig.acs_cfg.acs_mode
-								 == true) &&
-					!restart_sap_in_progress) {
-					hddLog(CDF_TRACE_LEVEL_INFO,
-					       FL("Restarting SAP"));
-					wlan_hdd_send_svc_nlink_msg
-						(WLAN_SVC_LTE_COEX_IND, NULL, 0);
-					restart_sap_in_progress = 1;
-					/*
-					 * current operating channel is un-safe
-					 * channel, restart driver
-					 */
-					hdd_hostapd_stop(hostapd_adapter->dev);
-					break;
-				}
-			}
-		}
-	}
-	return;
-}
-
-/**
- * hdd_init_channel_avoidance() - Initialize channel avoidance
- * @hdd_ctx:	HDD global context
- *
- * Initialize the channel avoidance logic by retrieving the unsafe
- * channel list from the CNSS platform driver and plumbing the data
- * down to the lower layers.  Then subscribe to subsequent channel
- * avoidance events.
- *
- * Return: None
- */
-static void hdd_init_channel_avoidance(hdd_context_t *hdd_ctx)
-{
-	uint16_t unsafe_channel_count;
-	int index;
-
-	cnss_get_wlan_unsafe_channel(hdd_ctx->unsafe_channel_list,
-				     &(hdd_ctx->unsafe_channel_count),
-				     sizeof(uint16_t) * NUM_20MHZ_RF_CHANNELS);
-
-	hddLog(CDF_TRACE_LEVEL_INFO, FL("num of unsafe channels is %d"),
-	       hdd_ctx->unsafe_channel_count);
-
-	unsafe_channel_count = CDF_MIN((uint16_t)hdd_ctx->unsafe_channel_count,
-				       (uint16_t)NUM_20MHZ_RF_CHANNELS);
-
-	for (index = 0; index < unsafe_channel_count; index++) {
-		hddLog(CDF_TRACE_LEVEL_INFO, FL("channel %d is not safe"),
-		       hdd_ctx->unsafe_channel_list[index]);
-
-	}
-
-	/* Plug in avoid channel notification callback */
-	sme_add_ch_avoid_callback(hdd_ctx->hHal, hdd_ch_avoid_cb);
-}
-#else
-static void hdd_init_channel_avoidance(hdd_context_t *hdd_ctx)
-{
-}
-static void hdd_set_thermal_level_cb(void *context, u_int8_t level)
-{
-}
-#endif /* defined(FEATURE_WLAN_CH_AVOID) && defined(CONFIG_CNSS) */
-
-/**
- * wlan_hdd_disable_all_dual_mac_features() - Disable dual mac features
- * @hdd_ctx: HDD context
- *
- * Disables all the dual mac features like DBS, Agile DFS etc.
- *
- * Return: CDF_STATUS_SUCCESS on success
- */
-static CDF_STATUS wlan_hdd_disable_all_dual_mac_features(hdd_context_t *hdd_ctx)
-{
-	struct sir_dual_mac_config cfg;
-	CDF_STATUS status;
-
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cfg.scan_config = 0;
-	cfg.fw_mode_config = 0;
-	cfg.set_dual_mac_cb =
-		(void *)cds_soc_set_dual_mac_cfg_cb;
-
-	hdd_debug("Disabling all dual mac features...");
-
-	status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
-	if (status != CDF_STATUS_SUCCESS) {
-		hdd_err("sme_soc_set_dual_mac_config failed %d", status);
-		return status;
-	}
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_override_ini_config - Override INI config
- * @hdd_ctx: HDD context
- *
- * Override INI config based on module parameter.
- *
- * Return: None
- */
-static void hdd_override_ini_config(hdd_context_t *hdd_ctx)
-{
-
-	if (0 == enable_dfs_chan_scan || 1 == enable_dfs_chan_scan) {
-		hdd_ctx->config->enableDFSChnlScan = enable_dfs_chan_scan;
-		hdd_notice("Module enable_dfs_chan_scan set to %d",
-			   enable_dfs_chan_scan);
-	}
-	if (0 == enable_11d || 1 == enable_11d) {
-		hdd_ctx->config->Is11dSupportEnabled = enable_11d;
-		hdd_notice("Module enable_11d set to %d", enable_11d);
-	}
-}
-
-/**
- * hdd_set_trace_level_for_each - Set trace level for each INI config
- * @hdd_ctx - HDD context
- *
- * Set trace level for each module based on INI config.
- *
- * Return: None
- */
-static void hdd_set_trace_level_for_each(hdd_context_t *hdd_ctx)
-{
-	hdd_cdf_trace_enable(CDF_MODULE_ID_WMI,
-			     hdd_ctx->config->cdf_trace_enable_wdi);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_HDD,
-			     hdd_ctx->config->cdf_trace_enable_hdd);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_SME,
-			     hdd_ctx->config->cdf_trace_enable_sme);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_PE,
-			     hdd_ctx->config->cdf_trace_enable_pe);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_WMA,
-			     hdd_ctx->config->cdf_trace_enable_wma);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_SYS,
-			     hdd_ctx->config->cdf_trace_enable_sys);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_CDF,
-			     hdd_ctx->config->cdf_trace_enable_cdf);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_SAP,
-			     hdd_ctx->config->cdf_trace_enable_sap);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_HDD_SOFTAP,
-			     hdd_ctx->config->cdf_trace_enable_hdd_sap);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_BMI,
-				hdd_ctx->config->cdf_trace_enable_bmi);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_CFG,
-				hdd_ctx->config->cdf_trace_enable_cfg);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_EPPING,
-				hdd_ctx->config->cdf_trace_enable_epping);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_CDF_DEVICE,
-				hdd_ctx->config->cdf_trace_enable_cdf_devices);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_TXRX,
-				hdd_ctx->config->cfd_trace_enable_txrx);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_HTC,
-				hdd_ctx->config->cdf_trace_enable_htc);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_HIF,
-				hdd_ctx->config->cdf_trace_enable_hif);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_HDD_SAP_DATA,
-				hdd_ctx->config->cdf_trace_enable_hdd_sap_data);
-	hdd_cdf_trace_enable(CDF_MODULE_ID_HDD_DATA,
-				hdd_ctx->config->cdf_trace_enable_hdd_data);
-
-	hdd_cfg_print(hdd_ctx);
-}
-
-/**
- * hdd_init_context - Alloc and initialize HDD context
- * @dev:	Pointer to the underlying device
- * @hif_sc:	HIF context
- *
- * Allocate and initialize HDD context. HDD context is allocated as part of
- * wiphy allocation and then context is initialized.
- *
- * Return: HDD context on success and ERR_PTR on failure
- */
-hdd_context_t *hdd_init_context(struct device *dev, void *hif_sc)
-{
-	CDF_STATUS status;
-	int ret = 0;
-	hdd_context_t *hdd_ctx;
-	v_CONTEXT_t p_cds_context;
-
-	ENTER();
-
-	p_cds_context = cds_get_global_context();
-	if (p_cds_context == NULL) {
-		hdd_alert("Failed to get CDS global context");
-		ret = -EINVAL;
-		goto err_out;
-	}
-
-	hdd_ctx = hdd_cfg80211_wiphy_alloc(sizeof(hdd_context_t));
-
-	if (hdd_ctx == NULL) {
-		ret = -ENOMEM;
-		goto err_out;
-	}
-
-	hdd_ctx->pcds_context = p_cds_context;
-
-	hdd_ctx->config = cdf_mem_malloc(sizeof(struct hdd_config));
-	if (hdd_ctx->config == NULL) {
-		hdd_alert("Failed to alloc memory for HDD config!");
-		ret = -ENOMEM;
-		goto err_free_hdd_context;
-	}
-
-	/* Read and parse the qcom_cfg.ini file */
-	status = hdd_parse_config_ini(hdd_ctx);
-	if (CDF_STATUS_SUCCESS != status) {
-		hdd_alert("Error (status: %d) parsing INI file: %s", status,
-			  WLAN_INI_FILE);
-		ret = -EINVAL;
-		goto err_free_config;
-	}
-
-	((cds_context_type *) (p_cds_context))->pHDDContext = (void *)hdd_ctx;
-
-	hdd_ctx->parent_dev = dev;
-
-	hdd_ctx->ioctl_scan_mode = eSIR_ACTIVE_SCAN;
-
-	hdd_init_ll_stats_ctx();
-
-	init_completion(&hdd_ctx->mc_sus_event_var);
-	init_completion(&hdd_ctx->ready_to_suspend);
-
-	cdf_spinlock_init(&hdd_ctx->connection_status_lock);
-	cdf_spinlock_init(&hdd_ctx->sched_scan_lock);
-
-	cdf_spinlock_init(&hdd_ctx->hdd_adapter_lock);
-	cdf_list_init(&hdd_ctx->hddAdapters, MAX_NUMBER_OF_ADAPTERS);
-
-	wlan_hdd_cfg80211_extscan_init(hdd_ctx);
-
-	hdd_tdls_pre_init(hdd_ctx);
-	mutex_init(&hdd_ctx->dfs_lock);
-
-	hdd_ctx->target_type = ((struct ol_softc *)hif_sc)->target_type;
-
-	hdd_init_offloaded_packets_ctx(hdd_ctx);
-
-	icnss_set_fw_debug_mode(hdd_ctx->config->enablefwlog);
-
-	hdd_ctx->max_intf_count = CSR_ROAM_SESSION_MAX;
-
-	hdd_ctx->configuredMcastBcastFilter =
-		hdd_ctx->config->mcastBcastFilterSetting;
-
-	hdd_notice("Setting configuredMcastBcastFilter: %d",
-		   hdd_ctx->config->mcastBcastFilterSetting);
-
-	hdd_override_ini_config(hdd_ctx);
-
-	ret = wlan_hdd_cfg80211_init(dev, hdd_ctx->wiphy, hdd_ctx->config);
-
-	if (ret) {
-		hdd_err("CFG80211 wiphy init failed: %d", ret);
-		goto err_free_config;
-	}
-
-	hdd_enable_fastpath(hdd_ctx->config, hif_sc);
-
-	/* Uses to enabled logging after SSR */
-	hdd_ctx->fw_log_settings.enable = hdd_ctx->config->enablefwlog;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam())
-		goto skip_multicast_logging;
-
-	cds_set_multicast_logging(hdd_ctx->config->multicast_host_fw_msgs);
-
-	ret = hdd_logging_sock_activate_svc(hdd_ctx);
-	if (ret)
-		goto err_free_config;
-
-	/*
-	 * Update CDF trace levels based upon the code. The multicast
-	 * levels of the code need not be set when the logger thread
-	 * is not enabled.
-	 */
-	if (cds_is_multicast_logging())
-		wlan_logging_set_log_level();
-
-skip_multicast_logging:
-	hdd_set_trace_level_for_each(hdd_ctx);
-
-	return hdd_ctx;
-
-err_free_config:
-	cdf_mem_free(hdd_ctx->config);
-
-err_free_hdd_context:
-	wiphy_free(hdd_ctx->wiphy);
-
-err_out:
-	return ERR_PTR(ret);
-}
-
-#ifdef WLAN_OPEN_P2P_INTERFACE
-/**
- * hdd_open_p2p_interface - Open P2P interface
- * @hdd_ctx:	HDD context
- * @rtnl_held:	True if RTNL lock held
- *
- * Open P2P interface during probe. This function called to open the P2P
- * interface at probe along with STA interface.
- *
- * Return: 0 on success and errno on failure
- */
-static int hdd_open_p2p_interface(hdd_context_t *hdd_ctx, bool rtnl_held)
-{
-	hdd_adapter_t *adapter;
-	uint8_t *p2p_dev_addr;
-
-	if (hdd_ctx->config->isP2pDeviceAddrAdministrated &&
-	    !(hdd_ctx->config->intfMacAddr[0].bytes[0] & 0x02)) {
-		cdf_mem_copy(hdd_ctx->p2pDeviceAddress.bytes,
-			     hdd_ctx->config->intfMacAddr[0].bytes,
-			     sizeof(tSirMacAddr));
-
-		/*
-		 * Generate the P2P Device Address.  This consists of
-		 * the device's primary MAC address with the locally
-		 * administered bit set.
-		 */
-		hdd_ctx->p2pDeviceAddress.bytes[0] |= 0x02;
-	} else {
-		p2p_dev_addr = wlan_hdd_get_intf_addr(hdd_ctx);
-		if (p2p_dev_addr == NULL) {
-			hdd_alert("Failed to allocate mac_address for p2p_device");
-			return -ENOSPC;
-		}
-
-		cdf_mem_copy(&hdd_ctx->p2pDeviceAddress.bytes[0], p2p_dev_addr,
-			     CDF_MAC_ADDR_SIZE);
-	}
-
-	adapter = hdd_open_adapter(hdd_ctx, WLAN_HDD_P2P_DEVICE, "p2p%d",
-				   &hdd_ctx->p2pDeviceAddress.bytes[0],
-				   rtnl_held);
-
-	if (NULL == adapter) {
-		hdd_alert("Failed to do hdd_open_adapter for P2P Device Interface");
-		return -ENOSPC;
-	}
-
-	return 0;
-}
-#else
-static inline int hdd_open_p2p_interface(struct hdd_context_t *hdd_ctx,
-					 bool rtnl_held)
-{
-	return 0;
-}
-#endif
-
-/**
- * hdd_open_interfaces - Open all required interfaces
- * hdd_ctx:	HDD context
- * rtnl_held: True if RTNL lock is held
- *
- * Open all the interfaces like STA, P2P and OCB based on the configuration.
- *
- * Return: Primary adapter on success and PTR_ERR on failure
- */
-static hdd_adapter_t *hdd_open_interfaces(hdd_context_t *hdd_ctx,
-					  bool rtnl_held)
-{
-	hdd_adapter_t *adapter = NULL;
-	hdd_adapter_t *adapter_11p = NULL;
-	int ret;
-
-	/* Create only 802.11p interface */
-	if (hdd_ctx->config->dot11p_mode == WLAN_HDD_11P_STANDALONE) {
-		adapter = hdd_open_adapter(hdd_ctx, WLAN_HDD_OCB, "wlanocb%d",
-					   wlan_hdd_get_intf_addr(hdd_ctx),
-					   rtnl_held);
-
-		if (adapter == NULL)
-			return ERR_PTR(-ENOSPC);
-
-		return adapter;
-	}
-
-	adapter = hdd_open_adapter(hdd_ctx, WLAN_HDD_INFRA_STATION, "wlan%d",
-				   wlan_hdd_get_intf_addr(hdd_ctx),
-				   rtnl_held);
-
-	if (adapter == NULL)
-		return ERR_PTR(-ENOSPC);
-
-	ret = hdd_open_p2p_interface(hdd_ctx, rtnl_held);
-	if (ret)
-		goto err_close_adapter;
-
-	/* Open 802.11p Interface */
-	if (hdd_ctx->config->dot11p_mode == WLAN_HDD_11P_CONCURRENT) {
-		adapter_11p = hdd_open_adapter(hdd_ctx, WLAN_HDD_OCB,
-					       "wlanocb%d",
-					       wlan_hdd_get_intf_addr(hdd_ctx),
-					       rtnl_held);
-		if (adapter_11p == NULL) {
-			hdd_err("Failed to open 802.11p interface");
-			goto err_close_adapter;
-		}
-	}
-
-	return adapter;
-
-err_close_adapter:
-	hdd_close_all_adapters(hdd_ctx, rtnl_held);
-	return ERR_PTR(ret);
-}
-
-/**
- * hdd_update_country_code - Update country code
- * @hdd_ctx: HDD context
- * @adapter: Primary adapter context
- *
- * Update country code based on module parameter country_code at SME and wait
- * for the settings to take effect.
- *
- * Return: 0 on success and errno on failure
- */
-static int hdd_update_country_code(hdd_context_t *hdd_ctx,
-				  hdd_adapter_t *adapter)
-{
-	CDF_STATUS status;
-	int ret = 0;
-	unsigned long rc;
-
-	if (country_code == NULL)
-		return 0;
-
-	INIT_COMPLETION(adapter->change_country_code);
-
-	status = sme_change_country_code(hdd_ctx->hHal,
-					 wlan_hdd_change_country_code_callback,
-					 country_code, adapter,
-					 hdd_ctx->pcds_context, eSIR_TRUE,
-					 eSIR_TRUE);
-
-
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hdd_err("SME Change Country code from module param fail ret=%d",
-			ret);
-		return -EINVAL;
-	}
-
-	rc = wait_for_completion_timeout(&adapter->change_country_code,
-			 msecs_to_jiffies(WLAN_WAIT_TIME_COUNTRY));
-	if (!rc) {
-		hdd_err("SME while setting country code timed out");
-		ret = -ETIMEDOUT;
-	}
-
-	return ret;
-}
-
-/**
- * hdd_init_thermal_info - Initialize thermal level
- * @hdd_ctx:	HDD context
- *
- * Initialize thermal level at SME layer and set the thermal level callback
- * which would be called when a configured thermal threshold is hit.
- *
- * Return: 0 on success and errno on failure
- */
-static int hdd_init_thermal_info(hdd_context_t *hdd_ctx)
-{
-	tSmeThermalParams thermal_param;
-	CDF_STATUS status;
-
-	thermal_param.smeThermalMgmtEnabled =
-		hdd_ctx->config->thermalMitigationEnable;
-	thermal_param.smeThrottlePeriod = hdd_ctx->config->throttlePeriod;
-
-	thermal_param.smeThermalLevels[0].smeMinTempThreshold =
-		hdd_ctx->config->thermalTempMinLevel0;
-	thermal_param.smeThermalLevels[0].smeMaxTempThreshold =
-		hdd_ctx->config->thermalTempMaxLevel0;
-	thermal_param.smeThermalLevels[1].smeMinTempThreshold =
-		hdd_ctx->config->thermalTempMinLevel1;
-	thermal_param.smeThermalLevels[1].smeMaxTempThreshold =
-		hdd_ctx->config->thermalTempMaxLevel1;
-	thermal_param.smeThermalLevels[2].smeMinTempThreshold =
-		hdd_ctx->config->thermalTempMinLevel2;
-	thermal_param.smeThermalLevels[2].smeMaxTempThreshold =
-		hdd_ctx->config->thermalTempMaxLevel2;
-	thermal_param.smeThermalLevels[3].smeMinTempThreshold =
-		hdd_ctx->config->thermalTempMinLevel3;
-	thermal_param.smeThermalLevels[3].smeMaxTempThreshold =
-		hdd_ctx->config->thermalTempMaxLevel3;
-
-	status = sme_init_thermal_info(hdd_ctx->hHal, thermal_param);
-
-	if (!CDF_IS_STATUS_SUCCESS(status))
-		return cdf_status_to_os_return(status);
-
-	sme_add_set_thermal_level_callback(hdd_ctx->hHal,
-					   hdd_set_thermal_level_cb);
-
-	return 0;
-
-}
-
-#if defined(CONFIG_HDD_INIT_WITH_RTNL_LOCK)
-/**
- * hdd_hold_rtnl_lock - Hold RTNL lock
- *
- * Hold RTNL lock
- *
- * Return: True if held and false otherwise
- */
-static inline bool hdd_hold_rtnl_lock(void)
-{
-	rtnl_lock();
-	return true;
-}
-
-/**
- * hdd_release_rtnl_lock - Release RTNL lock
- *
- * Release RTNL lock
- *
- * Return: None
- */
-static inline void hdd_release_rtnl_lock(void)
-{
-	rtnl_unlock();
-}
-#else
-static inline bool hdd_hold_rtnl_lock(void) { return false; }
-static inline void hdd_release_rtnl_lock(void) { }
-#endif
-
-/**
- * hdd_wlan_startup() - HDD init function
- * @dev:	Pointer to the underlying device
- *
- * This is the driver startup code executed once a WLAN device has been detected
- *
- * Return:  0 for success, < 0 for failure
- */
-int hdd_wlan_startup(struct device *dev, void *hif_sc)
-{
-	CDF_STATUS status;
-	hdd_adapter_t *adapter = NULL;
-	hdd_context_t *hdd_ctx = NULL;
-	int ret;
-	tSirTxPowerLimit hddtxlimit;
-	bool rtnl_held;
-	tSirRetStatus hal_status;
-
-	ENTER();
-
-	if (WLAN_IS_EPPING_ENABLED(con_mode)) {
-		ret = epping_enable(dev);
-		EXIT();
-		return ret;
-	}
-
-	hdd_ctx = hdd_init_context(dev, hif_sc);
-
-	if (IS_ERR(hdd_ctx))
-		return PTR_ERR(hdd_ctx);
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		ret = hdd_enable_ftm(hdd_ctx);
-
-		if (ret)
-			goto err_hdd_free_context;
-
-		goto success;
-	}
-
-	hdd_wlan_green_ap_init(hdd_ctx);
-
-	status = cds_open();
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("cds_open failed"));
-		goto err_hdd_free_context;
-	}
-
-	wlan_hdd_update_wiphy(hdd_ctx->wiphy, hdd_ctx->config);
-
-	hdd_ctx->hHal = cds_get_context(CDF_MODULE_ID_SME);
-
-	if (NULL == hdd_ctx->hHal) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("HAL context is null"));
-		goto err_cds_close;
-	}
-
-	status = cds_pre_enable(hdd_ctx->pcds_context);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("cds_pre_enable failed"));
-		goto err_cds_close;
-	}
-
-	ol_txrx_register_pause_cb(wlan_hdd_txrx_pause_cb);
-
-	status = wlan_hdd_regulatory_init(hdd_ctx);
-
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("Failed to init channel list"));
-		goto err_cds_close;
-	}
-
-	/*
-	 * Set 802.11p config
-	 * TODO-OCB: This has been temporarily added here to ensure this
-	 * parameter is set in CSR when we init the channel list. This should
-	 * be removed once the 5.9 GHz channels are added to the regulatory
-	 * domain.
-	 */
-	hdd_set_dot11p_config(hdd_ctx);
-
-	/*
-	 * Note that the cds_pre_enable() sequence triggers the cfg download.
-	 * The cfg download must occur before we update the SME config
-	 * since the SME config operation must access the cfg database
-	 */
-	status = hdd_set_sme_config(hdd_ctx);
-
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("Failed hdd_set_sme_config"));
-		goto err_wiphy_unregister;
-	}
-
-	ret = wma_cli_set_command(0, WMI_PDEV_PARAM_TX_CHAIN_MASK_1SS,
-				  hdd_ctx->config->tx_chain_mask_1ss,
-				  PDEV_CMD);
-	if (0 != ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: WMI_PDEV_PARAM_TX_CHAIN_MASK_1SS failed %d",
-		       __func__, ret);
-	}
-
-	status = hdd_set_sme_chan_list(hdd_ctx);
-	if (status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("Failed to init channel list"));
-		goto err_wiphy_unregister;
-	}
-
-	/* Apply the cfg.ini to cfg.dat */
-	if (false == hdd_update_config_dat(hdd_ctx)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("config update failed"));
-		goto err_wiphy_unregister;
-	}
-
-	if (CDF_STATUS_SUCCESS != hdd_update_mac_config(hdd_ctx)) {
-		hddLog(CDF_TRACE_LEVEL_WARN,
-		       FL("can't update mac config, using MAC from ini file"));
-	}
-
-	/*
-	 * Set the MAC Address Currently this is used by HAL to add self sta.
-	 * Remove this once self sta is added as part of session open.
-	 */
-	hal_status = cfg_set_str(hdd_ctx->hHal, WNI_CFG_STA_ID,
-				     hdd_ctx->config->intfMacAddr[0].bytes,
-				     sizeof(hdd_ctx->config->intfMacAddr[0]));
-
-	if (!IS_SIR_STATUS_SUCCESS(hal_status)) {
-		hdd_err("Failed to set MAC Address. HALStatus is %08d [x%08x]",
-			hal_status, hal_status);
-		ret = -EINVAL;
-		goto err_wiphy_unregister;
-	}
-
-	if (hdd_ipa_init(hdd_ctx) == CDF_STATUS_E_FAILURE)
-		goto err_wiphy_unregister;
-
-	/*
-	 * Start CDS which starts up the SME/MAC/HAL modules and everything
-	 * else
-	 */
-	status = cds_enable(hdd_ctx->pcds_context);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("cds_enable failed"));
-		goto err_ipa_cleanup;
-	}
-
-	hdd_init_channel_avoidance(hdd_ctx);
-
-	status = hdd_post_cds_enable_config(hdd_ctx);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("hdd_post_cds_enable_config failed"));
-		goto err_cds_disable;
-	}
-
-	cds_pkt_proto_trace_init();
-
-	rtnl_held = hdd_hold_rtnl_lock();
-
-	adapter = hdd_open_interfaces(hdd_ctx, rtnl_held);
-
-	if (IS_ERR(adapter)) {
-		ret = PTR_ERR(adapter);
-		goto err_cds_disable;
-	}
-
-	/*
-	 * target hw version/revision would only be retrieved after firmware
-	 * donwload
-	 */
-	hif_get_hw_info(hif_sc, &hdd_ctx->target_hw_version,
-			&hdd_ctx->target_hw_revision,
-			&hdd_ctx->target_hw_name);
-
-	/* Get the wlan hw/fw version */
-	hdd_wlan_get_version(adapter, NULL, NULL);
-
-	/* pass target_fw_version to HIF layer */
-	hif_set_fw_info(hif_sc, hdd_ctx->target_fw_version);
-
-	ret = hdd_update_country_code(hdd_ctx, adapter);
-
-	if (ret)
-		goto err_cds_disable;
-
-	sme_register11d_scan_done_callback(hdd_ctx->hHal, hdd_11d_scan_done);
-
-	sme_register_oem_data_rsp_callback(hdd_ctx->hHal,
-					hdd_send_oem_data_rsp_msg);
-
-	status = hdd_debugfs_init(adapter);
-
-	if (CDF_IS_STATUS_SUCCESS(status))
-		hdd_err("hdd_debugfs_init failed: %d!", status);
-
-	/* FW capabilities received, Set the Dot11 mode */
-	sme_setdef_dot11mode(hdd_ctx->hHal);
-
-	/* Initialize the nlink service */
-	if (nl_srv_init() != 0) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("nl_srv_init failed"));
-		goto err_close_adapter;
-	}
-
-	ret = oem_activate_service(hdd_ctx);
-	if (ret) {
-		hdd_alert("oem_activate_service failed: %d", ret);
-		goto err_nl_srv;
-	}
-
-	ret = ptt_sock_activate_svc();
-	if (ret) {
-		hdd_alert("ptt_sock_activate_svc failed: %d", ret);
-		goto err_nl_srv;
-	}
-
-	ret = cnss_diag_activate_service();
-	if (ret) {
-		hdd_alert("cnss_diag_activate_service failed: %d", ret);
-		goto err_nl_srv;
-	}
-
-	/*
-	 * Action frame registered in one adapter which will
-	 * applicable to all interfaces
-	 */
-	wlan_hdd_cfg80211_register_frames(adapter);
-
-	mutex_init(&hdd_ctx->sap_lock);
-
-	hdd_release_rtnl_lock();
-	rtnl_held = false;
-
-	ret = register_netdevice_notifier(&hdd_netdev_notifier);
-	if (ret < 0) {
-		hdd_err("register_netdevice_notifier failed: %d", ret);
-		goto err_nl_srv;
-	}
-
-#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
-	/* Initialize the wake lcok */
-	cdf_wake_lock_init(&hdd_ctx->rx_wake_lock, "qcom_rx_wakelock");
-#endif
-	/* Initialize the wake lcok */
-	cdf_wake_lock_init(&hdd_ctx->sap_wake_lock, "qcom_sap_wakelock");
-
-	hdd_hostapd_channel_wakelock_init(hdd_ctx);
-
-	if (hdd_ctx->config->fIsImpsEnabled)
-		hdd_set_idle_ps_config(hdd_ctx, true);
-	else
-		hdd_set_idle_ps_config(hdd_ctx, false);
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-	if (hdd_ctx->config->WlanAutoShutdown != 0)
-		if (sme_set_auto_shutdown_cb
-			    (hdd_ctx->hHal, wlan_hdd_auto_shutdown_cb)
-		    != CDF_STATUS_SUCCESS)
-			hddLog(LOGE,
-			       FL(
-				  "Auto shutdown feature could not be enabled"
-				 ));
-#endif
-
-#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
-	status = cdf_mc_timer_init(&hdd_ctx->skip_acs_scan_timer,
-				   CDF_TIMER_TYPE_SW,
-				   hdd_skip_acs_scan_timer_handler,
-				   (void *)hdd_ctx);
-	if (!CDF_IS_STATUS_SUCCESS(status))
-		hddLog(LOGE, FL("Failed to init ACS Skip timer"));
-#endif
-
-	wlan_hdd_nan_init(hdd_ctx);
-	status = cds_init_policy_mgr();
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hdd_err("Policy manager initialization failed");
-		goto err_unreg_netdev_notifier;
-	}
-
-	ret = hdd_init_thermal_info(hdd_ctx);
-
-	if (ret) {
-		hdd_err("Error while initializing thermal information");
-		goto err_unreg_netdev_notifier;
-	}
-
-	if (0 != hdd_lro_init(hdd_ctx))
-		hdd_err("Unable to initialize LRO in fw");
-
-	hddtxlimit.txPower2g = hdd_ctx->config->TxPower2g;
-	hddtxlimit.txPower5g = hdd_ctx->config->TxPower5g;
-	status = sme_txpower_limit(hdd_ctx->hHal, &hddtxlimit);
-	if (CDF_IS_STATUS_SUCCESS(status))
-		hdd_err("Error setting txlimit in sme: %d", status);
-
-#ifdef MSM_PLATFORM
-	spin_lock_init(&hdd_ctx->bus_bw_lock);
-	cdf_mc_timer_init(&hdd_ctx->bus_bw_timer,
-			  CDF_TIMER_TYPE_SW,
-			  hdd_bus_bw_compute_cbk, (void *)hdd_ctx);
-#endif
-
-	wlan_hdd_cfg80211_stats_ext_init(hdd_ctx);
-
-	sme_ext_scan_register_callback(hdd_ctx->hHal,
-				       wlan_hdd_cfg80211_extscan_callback);
-
-	sme_set_rssi_threshold_breached_cb(hdd_ctx->hHal,
-				hdd_rssi_threshold_breached);
-
-	hdd_cfg80211_link_layer_stats_init(hdd_ctx);
-
-	wlan_hdd_send_all_scan_intf_info(hdd_ctx);
-	wlan_hdd_send_version_pkg(hdd_ctx->target_fw_version,
-				  hdd_ctx->target_hw_version,
-				  hdd_ctx->target_hw_name);
-
-	cdf_spinlock_init(&hdd_ctx->hdd_roc_req_q_lock);
-	cdf_list_init((&hdd_ctx->hdd_roc_req_q), MAX_ROC_REQ_QUEUE_ENTRY);
-	cdf_spinlock_init(&hdd_ctx->hdd_scan_req_q_lock);
-	cdf_list_init((&hdd_ctx->hdd_scan_req_q), CFG_MAX_SCAN_COUNT_MAX);
-#ifdef CONFIG_CNSS
-	cnss_init_delayed_work(&hdd_ctx->roc_req_work,
-			wlan_hdd_roc_request_dequeue);
-#else
-	INIT_DELAYED_WORK(&hdd_ctx->roc_req_work, wlan_hdd_roc_request_dequeue);
-#endif
-
-	/*
-	 * Register IPv6 notifier to notify if any change in IP
-	 * So that we can reconfigure the offload parameters
-	*/
-	hdd_wlan_register_ip6_notifier(hdd_ctx);
-
-	/*
-	 * Register IPv4 notifier to notify if any change in IP
-	 * So that we can reconfigure the offload parameters
-	 */
-	hdd_ctx->ipv4_notifier.notifier_call = wlan_hdd_ipv4_changed;
-	ret = register_inetaddr_notifier(&hdd_ctx->ipv4_notifier);
-	if (ret)
-		hddLog(LOGE, FL("Failed to register IPv4 notifier"));
-	else
-		hdd_info("Registered IPv4 notifier");
-
-	wlan_hdd_dcc_register_for_dcc_stats_event(hdd_ctx);
-
-	if (hdd_ctx->config->dual_mac_feature_disable) {
-		status = wlan_hdd_disable_all_dual_mac_features(hdd_ctx);
-		if (status != CDF_STATUS_SUCCESS) {
-			hdd_err("Failed to disable dual mac features");
-			goto err_unreg_netdev_notifier;
-		}
-	}
-
-	hif_enable_power_gating(hif_sc);
-
-	memdump_init();
-
-	goto success;
-
-err_unreg_netdev_notifier:
-	unregister_netdevice_notifier(&hdd_netdev_notifier);
-
-err_nl_srv:
-#ifdef WLAN_KD_READY_NOTIFIER
-	cnss_diag_notify_wlan_close();
-	ptt_sock_deactivate_svc();
-#endif /* WLAN_KD_READY_NOTIFIER */
-	nl_srv_exit();
-
-	if (!CDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) {
-		hdd_err("Failed to deinit policy manager");
-		/* Proceed and complete the clean up */
-	}
-
-	hdd_debugfs_exit(hdd_ctx);
-
-err_close_adapter:
-	hdd_release_rtnl_lock();
-
-	hdd_close_all_adapters(hdd_ctx, false);
-
-err_cds_disable:
-	cds_disable(hdd_ctx->pcds_context);
-
-err_ipa_cleanup:
-	hdd_ipa_cleanup(hdd_ctx);
-
-err_wiphy_unregister:
-	wiphy_unregister(hdd_ctx->wiphy);
-
-err_cds_close:
-	status = cds_sched_close(hdd_ctx->pcds_context);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       FL("Failed to close CDS Scheduler"));
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(status));
-	}
-	cds_close(hdd_ctx->pcds_context);
-
-err_hdd_free_context:
-	hdd_free_context(hdd_ctx);
-	CDF_BUG(1);
-
-	return -EIO;
-
-success:
-	EXIT();
-	return 0;
-}
-
-/**
- * hdd_softap_sta_deauth() - handle deauth req from HDD
- * @adapter:	Pointer to the HDD
- * @enable:	bool value
- *
- * This to take counter measure to handle deauth req from HDD
- *
- * Return: None
- */
-CDF_STATUS hdd_softap_sta_deauth(hdd_adapter_t *adapter,
-				 struct tagCsrDelStaParams *pDelStaParams)
-{
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t p_cds_context = (WLAN_HDD_GET_CTX(adapter))->pcds_context;
-#endif
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAULT;
-
-	ENTER();
-
-	hddLog(LOG1, FL("hdd_softap_sta_deauth:(%p, false)"),
-	       (WLAN_HDD_GET_CTX(adapter))->pcds_context);
-
-	/* Ignore request to deauth bcmc station */
-	if (pDelStaParams->peerMacAddr.bytes[0] & 0x1)
-		return cdf_status;
-
-#ifdef WLAN_FEATURE_MBSSID
-	cdf_status =
-		wlansap_deauth_sta(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
-				   pDelStaParams);
-#else
-	cdf_status = wlansap_deauth_sta(p_cds_context, pDelStaParams);
-#endif
-
-	EXIT();
-	return cdf_status;
-}
-
-/**
- * hdd_softap_sta_disassoc() - take counter measure to handle deauth req from HDD
- * @adapter:	Pointer to the HDD
- *
- * This to take counter measure to handle deauth req from HDD
- *
- * Return: None
- */
-void hdd_softap_sta_disassoc(hdd_adapter_t *adapter,
-			     uint8_t *pDestMacAddress)
-{
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t p_cds_context = (WLAN_HDD_GET_CTX(adapter))->pcds_context;
-#endif
-
-	ENTER();
-
-	hddLog(LOGE, FL("hdd_softap_sta_disassoc:(%p, false)"),
-	       (WLAN_HDD_GET_CTX(adapter))->pcds_context);
-
-	/* Ignore request to disassoc bcmc station */
-	if (pDestMacAddress[0] & 0x1)
-		return;
-
-#ifdef WLAN_FEATURE_MBSSID
-	wlansap_disassoc_sta(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
-			     pDestMacAddress);
-#else
-	wlansap_disassoc_sta(p_cds_context, pDestMacAddress);
-#endif
-}
-
-void hdd_softap_tkip_mic_fail_counter_measure(hdd_adapter_t *adapter,
-					      bool enable)
-{
-#ifndef WLAN_FEATURE_MBSSID
-	v_CONTEXT_t p_cds_context = (WLAN_HDD_GET_CTX(adapter))->pcds_context;
-#endif
-
-	ENTER();
-
-	hddLog(LOGE, FL("hdd_softap_tkip_mic_fail_counter_measure:(%p, false)"),
-	       (WLAN_HDD_GET_CTX(adapter))->pcds_context);
-
-#ifdef WLAN_FEATURE_MBSSID
-	wlansap_set_counter_measure(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
-				    (bool) enable);
-#else
-	wlansap_set_counter_measure(p_cds_context, (bool) enable);
-#endif
-}
-
-/**
- * hdd_issta_p2p_clientconnected() - check if sta or p2p client is connected
- * @hdd_ctx:	HDD Context
- *
- * API to find if there is any STA or P2P-Client is connected
- *
- * Return: true if connected; false otherwise
- */
-CDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *hdd_ctx)
-{
-	return sme_is_sta_p2p_client_connected(hdd_ctx->hHal);
-}
-
-#ifdef WLAN_FEATURE_LPSS
-int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
-				  hdd_adapter_t *adapter,
-				  hdd_station_ctx_t *pHddStaCtx,
-				  uint8_t is_on, uint8_t is_connected)
-{
-	hdd_context_t *hdd_ctx = NULL;
-	uint8_t buflen = WLAN_SVC_COUNTRY_CODE_LEN;
-
-	if (!data) {
-		hddLog(LOGE, FL("invalid data pointer"));
-		return -EINVAL;
-	}
-	if (!adapter) {
-		if (is_on) {
-			/* no active interface */
-			data->lpss_support = 0;
-			data->is_on = is_on;
-			return 0;
-		}
-		hddLog(LOGE, FL("invalid adapter pointer"));
-		return -EINVAL;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (hdd_ctx->lpss_support && hdd_ctx->config->enablelpasssupport)
-		data->lpss_support = 1;
-	else
-		data->lpss_support = 0;
-	data->numChannels = WLAN_SVC_MAX_NUM_CHAN;
-	sme_get_cfg_valid_channels(hdd_ctx->hHal, data->channel_list,
-				   &data->numChannels);
-	sme_get_country_code(hdd_ctx->hHal, data->country_code, &buflen);
-	data->is_on = is_on;
-	data->vdev_id = adapter->sessionId;
-	data->vdev_mode = adapter->device_mode;
-	if (pHddStaCtx) {
-		data->is_connected = is_connected;
-		data->rssi = adapter->rssi;
-		data->freq =
-			cds_chan_to_freq(pHddStaCtx->conn_info.operationChannel);
-		if (WLAN_SVC_MAX_SSID_LEN >=
-		    pHddStaCtx->conn_info.SSID.SSID.length) {
-			data->ssid_len = pHddStaCtx->conn_info.SSID.SSID.length;
-			memcpy(data->ssid,
-			       pHddStaCtx->conn_info.SSID.SSID.ssId,
-			       pHddStaCtx->conn_info.SSID.SSID.length);
-		}
-		if (CDF_MAC_ADDR_SIZE >=
-		    sizeof(pHddStaCtx->conn_info.bssId))
-			memcpy(data->bssid, pHddStaCtx->conn_info.bssId.bytes,
-			       CDF_MAC_ADDR_SIZE);
-	}
-	return 0;
-}
-
-int wlan_hdd_gen_wlan_version_pack(struct wlan_version_data *data,
-				   uint32_t fw_version,
-				   uint32_t chip_id, const char *chip_name)
-{
-	if (!data) {
-		hddLog(LOGE, FL("invalid data pointer"));
-		return -EINVAL;
-	}
-
-	data->chip_id = chip_id;
-	strlcpy(data->chip_name, chip_name, WLAN_SVC_MAX_STR_LEN);
-	if (strncmp(chip_name, "Unknown", 7))
-		strlcpy(data->chip_from, "Qualcomm", WLAN_SVC_MAX_STR_LEN);
-	else
-		strlcpy(data->chip_from, "Unknown", WLAN_SVC_MAX_STR_LEN);
-	strlcpy(data->host_version, QWLAN_VERSIONSTR, WLAN_SVC_MAX_STR_LEN);
-	scnprintf(data->fw_version, WLAN_SVC_MAX_STR_LEN, "%d.%d.%d.%d",
-		  (fw_version & 0xf0000000) >> 28,
-		  (fw_version & 0xf000000) >> 24,
-		  (fw_version & 0xf00000) >> 20, (fw_version & 0x7fff));
-	return 0;
-}
-#endif
-
-/**
- * wlan_hdd_disable_roaming() - disable roaming on all STAs except the input one
- * @adapter:	HDD adapter pointer
- *
- * This function loop through each adapter and disable roaming on each STA
- * device mode except the input adapter.
- *
- * Note: On the input adapter roaming is not enabled yet hence no need to
- *       disable.
- *
- * Return: None
- */
-void wlan_hdd_disable_roaming(hdd_adapter_t *adapter)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	hdd_adapter_t *adapterIdx = NULL;
-	hdd_adapter_list_node_t *adapterNode = NULL;
-	hdd_adapter_list_node_t *pNext = NULL;
-	CDF_STATUS status;
-
-	if (hdd_ctx->config->isFastRoamIniFeatureEnabled &&
-	    hdd_ctx->config->isRoamOffloadScanEnabled &&
-	    WLAN_HDD_INFRA_STATION == adapter->device_mode &&
-	    cds_is_sta_active_connection_exists()) {
-		hddLog(LOG1, FL("Connect received on STA sessionId(%d)"),
-		       adapter->sessionId);
-		/*
-		 * Loop through adapter and disable roaming for each STA device
-		 * mode except the input adapter.
-		 */
-		status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-		while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-			adapterIdx = adapterNode->pAdapter;
-
-			if (WLAN_HDD_INFRA_STATION == adapterIdx->device_mode
-			    && adapter->sessionId != adapterIdx->sessionId) {
-				hddLog(LOG1,
-				       FL("Disable Roaming on sessionId(%d)"),
-				       adapterIdx->sessionId);
-				sme_stop_roaming(WLAN_HDD_GET_HAL_CTX
-							 (adapterIdx),
-						 adapterIdx->sessionId, 0);
-			}
-
-			status = hdd_get_next_adapter(hdd_ctx,
-						      adapterNode,
-						      &pNext);
-			adapterNode = pNext;
-		}
-	}
-}
-
-/**
- * wlan_hdd_enable_roaming() - enable roaming on all STAs except the input one
- * @adapter:	HDD adapter pointer
- *
- * This function loop through each adapter and enable roaming on each STA
- * device mode except the input adapter.
- * Note: On the input adapter no need to enable roaming because link got
- *       disconnected on this.
- *
- * Return: None
- */
-void wlan_hdd_enable_roaming(hdd_adapter_t *adapter)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	hdd_adapter_t *adapterIdx = NULL;
-	hdd_adapter_list_node_t *adapterNode = NULL;
-	hdd_adapter_list_node_t *pNext = NULL;
-	CDF_STATUS status;
-
-	if (hdd_ctx->config->isFastRoamIniFeatureEnabled &&
-	    hdd_ctx->config->isRoamOffloadScanEnabled &&
-	    WLAN_HDD_INFRA_STATION == adapter->device_mode &&
-	    cds_is_sta_active_connection_exists()) {
-		hddLog(LOG1, FL("Disconnect received on STA sessionId(%d)"),
-		       adapter->sessionId);
-		/*
-		 * Loop through adapter and enable roaming for each STA device
-		 * mode except the input adapter.
-		 */
-		status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-		while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-			adapterIdx = adapterNode->pAdapter;
-
-			if (WLAN_HDD_INFRA_STATION == adapterIdx->device_mode
-			    && adapter->sessionId != adapterIdx->sessionId) {
-				hddLog(LOG1,
-				       FL("Enabling Roaming on sessionId(%d)"),
-				       adapterIdx->sessionId);
-				sme_start_roaming(WLAN_HDD_GET_HAL_CTX
-							  (adapterIdx),
-						  adapterIdx->sessionId,
-						  REASON_CONNECT);
-			}
-
-			status = hdd_get_next_adapter(hdd_ctx,
-						      adapterNode,
-						      &pNext);
-			adapterNode = pNext;
-		}
-	}
-}
-
-void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len)
-{
-	struct sk_buff *skb;
-	struct nlmsghdr *nlh;
-	tAniMsgHdr *ani_hdr;
-	void *nl_data = NULL;
-	int flags = GFP_KERNEL;
-
-	if (in_interrupt() || irqs_disabled() || in_atomic())
-		flags = GFP_ATOMIC;
-
-	skb = alloc_skb(NLMSG_SPACE(WLAN_NL_MAX_PAYLOAD), flags);
-
-	if (skb == NULL) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("alloc_skb failed"));
-		return;
-	}
-
-	nlh = (struct nlmsghdr *)skb->data;
-	nlh->nlmsg_pid = 0;     /* from kernel */
-	nlh->nlmsg_flags = 0;
-	nlh->nlmsg_seq = 0;
-	nlh->nlmsg_type = WLAN_NL_MSG_SVC;
-
-	ani_hdr = NLMSG_DATA(nlh);
-	ani_hdr->type = type;
-
-	switch (type) {
-	case WLAN_SVC_FW_CRASHED_IND:
-	case WLAN_SVC_LTE_COEX_IND:
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-	case WLAN_SVC_WLAN_AUTO_SHUTDOWN_IND:
-#endif
-		ani_hdr->length = 0;
-		nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr)));
-		skb_put(skb, NLMSG_SPACE(sizeof(tAniMsgHdr)));
-		break;
-	case WLAN_SVC_WLAN_STATUS_IND:
-	case WLAN_SVC_WLAN_VERSION_IND:
-	case WLAN_SVC_DFS_CAC_START_IND:
-	case WLAN_SVC_DFS_CAC_END_IND:
-	case WLAN_SVC_DFS_RADAR_DETECT_IND:
-	case WLAN_SVC_DFS_ALL_CHANNEL_UNAVAIL_IND:
-	case WLAN_SVC_WLAN_TP_IND:
-	case WLAN_SVC_WLAN_TP_TX_IND:
-		ani_hdr->length = len;
-		nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + len));
-		nl_data = (char *)ani_hdr + sizeof(tAniMsgHdr);
-		memcpy(nl_data, data, len);
-		skb_put(skb, NLMSG_SPACE(sizeof(tAniMsgHdr) + len));
-		break;
-
-	default:
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("WLAN SVC: Attempt to send unknown nlink message %d"),
-		       type);
-		kfree_skb(skb);
-		return;
-	}
-
-	nl_srv_bcast(skb);
-
-	return;
-}
-
-#ifdef WLAN_FEATURE_LPSS
-void wlan_hdd_send_status_pkg(hdd_adapter_t *adapter,
-			      hdd_station_ctx_t *pHddStaCtx,
-			      uint8_t is_on, uint8_t is_connected)
-{
-	int ret = 0;
-	struct wlan_status_data data;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam())
-		return;
-
-	memset(&data, 0, sizeof(struct wlan_status_data));
-	if (is_on)
-		ret = wlan_hdd_gen_wlan_status_pack(&data, adapter, pHddStaCtx,
-						    is_on, is_connected);
-	if (!ret)
-		wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_STATUS_IND,
-					    &data,
-					    sizeof(struct wlan_status_data));
-}
-
-void wlan_hdd_send_version_pkg(uint32_t fw_version,
-			       uint32_t chip_id, const char *chip_name)
-{
-	int ret = 0;
-	struct wlan_version_data data;
-#ifdef CONFIG_CNSS
-	struct cnss_platform_cap cap;
-
-	ret = cnss_get_platform_cap(&cap);
-	if (ret) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("platform capability info from CNSS not available"));
-		return;
-	}
-
-	if (!(cap.cap_flag & CNSS_HAS_UART_ACCESS))
-		return;
-#endif
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam())
-		return;
-
-	memset(&data, 0, sizeof(struct wlan_version_data));
-	ret =
-		wlan_hdd_gen_wlan_version_pack(&data, fw_version, chip_id,
-					       chip_name);
-	if (!ret)
-		wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_VERSION_IND,
-					    &data,
-					    sizeof(struct wlan_version_data));
-}
-
-void wlan_hdd_send_all_scan_intf_info(hdd_context_t *hdd_ctx)
-{
-	hdd_adapter_t *pDataAdapter = NULL;
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	bool scan_intf_found = false;
-	CDF_STATUS status;
-
-	if (!hdd_ctx) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("NULL pointer for hdd_ctx"));
-		return;
-	}
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		pDataAdapter = adapterNode->pAdapter;
-		if (pDataAdapter) {
-			if (pDataAdapter->device_mode == WLAN_HDD_INFRA_STATION
-			    || pDataAdapter->device_mode == WLAN_HDD_P2P_CLIENT
-			    || pDataAdapter->device_mode ==
-			    WLAN_HDD_P2P_DEVICE) {
-				scan_intf_found = true;
-				wlan_hdd_send_status_pkg(pDataAdapter, NULL, 1,
-							 0);
-			}
-		}
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	if (!scan_intf_found)
-		wlan_hdd_send_status_pkg(pDataAdapter, NULL, 1, 0);
-}
-#else
-static inline void wlan_hdd_send_status_pkg(hdd_adapter_t *pAdapter,
-					    hdd_station_ctx_t *pHddStaCtx,
-					    uint8_t is_on, uint8_t is_connected)
-{
-	return;
-}
-
-static inline void wlan_hdd_send_version_pkg(uint32_t fw_version, uint32_t
-					     chip_id, const char *chip_name)
-{
-	return;
-}
-
-static inline void wlan_hdd_send_all_scan_intf_info(hdd_context_t *pHddCtx)
-{
-	return;
-}
-#endif
-
-#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
-void wlan_hdd_auto_shutdown_cb(void)
-{
-	hddLog(LOGE, FL("Wlan Idle. Sending Shutdown event.."));
-	wlan_hdd_send_svc_nlink_msg(WLAN_SVC_WLAN_AUTO_SHUTDOWN_IND, NULL, 0);
-}
-
-void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, bool enable)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	hdd_adapter_t *adapter;
-	bool ap_connected = false, sta_connected = false;
-	tHalHandle hal_handle;
-
-	hal_handle = hdd_ctx->hHal;
-	if (hal_handle == NULL)
-		return;
-
-	if (hdd_ctx->config->WlanAutoShutdown == 0)
-		return;
-
-	if (enable == false) {
-		if (sme_set_auto_shutdown_timer(hal_handle, 0) !=
-							CDF_STATUS_SUCCESS) {
-			hddLog(LOGE,
-			       FL("Failed to stop wlan auto shutdown timer"));
-		}
-		return;
-	}
-
-	/* To enable shutdown timer check conncurrency */
-	if (cds_concurrent_open_sessions_running()) {
-		status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-		while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-			adapter = adapterNode->pAdapter;
-			if (adapter
-			    && adapter->device_mode ==
-			    WLAN_HDD_INFRA_STATION) {
-				if (WLAN_HDD_GET_STATION_CTX_PTR(adapter)->
-				    conn_info.connState ==
-				    eConnectionState_Associated) {
-					sta_connected = true;
-					break;
-				}
-			}
-			if (adapter
-			    && adapter->device_mode == WLAN_HDD_SOFTAP) {
-				if (WLAN_HDD_GET_AP_CTX_PTR(adapter)->
-				    bApActive == true) {
-					ap_connected = true;
-					break;
-				}
-			}
-			status = hdd_get_next_adapter(hdd_ctx,
-						      adapterNode,
-						      &pNext);
-			adapterNode = pNext;
-		}
-	}
-
-	if (ap_connected == true || sta_connected == true) {
-		hddLog(LOG1,
-		       FL("CC Session active. Shutdown timer not enabled"));
-		return;
-	} else {
-		if (sme_set_auto_shutdown_timer(hal_handle,
-						hdd_ctx->config->
-						WlanAutoShutdown)
-		    != CDF_STATUS_SUCCESS)
-			hddLog(LOGE,
-			       FL("Failed to start wlan auto shutdown timer"));
-		else
-			hddLog(LOG1,
-			       FL("Auto Shutdown timer for %d seconds enabled"),
-			       hdd_ctx->config->WlanAutoShutdown);
-
-	}
-}
-#endif
-
-hdd_adapter_t *hdd_get_con_sap_adapter(hdd_adapter_t *this_sap_adapter,
-							bool check_start_bss)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(this_sap_adapter);
-	hdd_adapter_t *adapter, *con_sap_adapter;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-
-	con_sap_adapter = NULL;
-
-	status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-	while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-		adapter = adapterNode->pAdapter;
-		if (adapter && ((adapter->device_mode == WLAN_HDD_SOFTAP) ||
-				(adapter->device_mode == WLAN_HDD_P2P_GO)) &&
-						adapter != this_sap_adapter) {
-			if (check_start_bss) {
-				if (test_bit(SOFTAP_BSS_STARTED,
-						&adapter->event_flags)) {
-					con_sap_adapter = adapter;
-					break;
-				}
-			} else {
-				con_sap_adapter = adapter;
-				break;
-			}
-		}
-		status = hdd_get_next_adapter(hdd_ctx, adapterNode, &pNext);
-		adapterNode = pNext;
-	}
-
-	return con_sap_adapter;
-}
-
-#ifdef MSM_PLATFORM
-void hdd_start_bus_bw_compute_timer(hdd_adapter_t *adapter)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-	if (CDF_TIMER_STATE_RUNNING ==
-	    cdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer))
-		return;
-
-	cdf_mc_timer_start(&hdd_ctx->bus_bw_timer,
-			   hdd_ctx->config->busBandwidthComputeInterval);
-}
-
-void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *adapter)
-{
-	hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-	bool can_stop = true;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-	if (CDF_TIMER_STATE_RUNNING !=
-	    cdf_mc_timer_get_current_state(&hdd_ctx->bus_bw_timer)) {
-		/* trying to stop timer, when not running is not good */
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("bus band width compute timer is not running"));
-		return;
-	}
-
-	if (cds_concurrent_open_sessions_running()) {
-		status = hdd_get_front_adapter(hdd_ctx, &adapterNode);
-
-		while (NULL != adapterNode && CDF_STATUS_SUCCESS == status) {
-			adapter = adapterNode->pAdapter;
-			if (adapter
-			    && (adapter->device_mode == WLAN_HDD_INFRA_STATION
-				|| adapter->device_mode == WLAN_HDD_P2P_CLIENT)
-			    && WLAN_HDD_GET_STATION_CTX_PTR(adapter)->
-			    conn_info.connState ==
-			    eConnectionState_Associated) {
-				can_stop = false;
-				break;
-			}
-			if (adapter
-			    && (adapter->device_mode == WLAN_HDD_SOFTAP
-				|| adapter->device_mode == WLAN_HDD_P2P_GO)
-			    && WLAN_HDD_GET_AP_CTX_PTR(adapter)->bApActive ==
-			    true) {
-				can_stop = false;
-				break;
-			}
-			status = hdd_get_next_adapter(hdd_ctx,
-						      adapterNode,
-						      &pNext);
-			adapterNode = pNext;
-		}
-	}
-
-	if (can_stop == true)
-		cdf_mc_timer_stop(&hdd_ctx->bus_bw_timer);
-}
-#endif
-
-/**
- * wlan_hdd_check_custom_con_channel_rules() - This function checks the sap's
- *                                            and sta's operating channel.
- * @sta_adapter:  Describe the first argument to foobar.
- * @ap_adapter:   Describe the second argument to foobar.
- * @roam_profile: Roam profile of AP to which STA wants to connect.
- * @concurrent_chnl_same: If both SAP and STA channels are same then
- *                        set this flag to true else false.
- *
- * This function checks the sap's operating channel and sta's operating channel.
- * if both are same then it will return false else it will restart the sap in
- * sta's channel and return true.
- *
- * Return: CDF_STATUS_SUCCESS or CDF_STATUS_E_FAILURE.
- */
-CDF_STATUS wlan_hdd_check_custom_con_channel_rules(hdd_adapter_t *sta_adapter,
-						  hdd_adapter_t *ap_adapter,
-						  tCsrRoamProfile *roam_profile,
-						  tScanResultHandle *scan_cache,
-						  bool *concurrent_chnl_same)
-{
-	hdd_ap_ctx_t *hdd_ap_ctx;
-	uint8_t channel_id;
-	CDF_STATUS status;
-	device_mode_t device_mode = ap_adapter->device_mode;
-	*concurrent_chnl_same = true;
-
-	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	status =
-	 sme_get_ap_channel_from_scan_cache(WLAN_HDD_GET_HAL_CTX(sta_adapter),
-					    roam_profile,
-					    scan_cache,
-					    &channel_id);
-	if ((CDF_STATUS_SUCCESS == status)) {
-		if ((WLAN_HDD_SOFTAP == device_mode) &&
-			(channel_id < SIR_11A_CHANNEL_BEGIN)) {
-			if (hdd_ap_ctx->operatingChannel != channel_id) {
-				*concurrent_chnl_same = false;
-				hddLog(CDF_TRACE_LEVEL_INFO_MED,
-					FL("channels are different"));
-			}
-		} else if ((WLAN_HDD_P2P_GO == device_mode) &&
-				(channel_id >= SIR_11A_CHANNEL_BEGIN)) {
-			if (hdd_ap_ctx->operatingChannel != channel_id) {
-				*concurrent_chnl_same = false;
-				hddLog(CDF_TRACE_LEVEL_INFO_MED,
-					FL("channels are different"));
-			}
-		}
-	} else {
-		/*
-		 * Lets handle worst case scenario here, Scan cache lookup is
-		 * failed so we have to stop the SAP to avoid any channel
-		 * discrepancy  between SAP's channel and STA's channel.
-		 * Return the status as failure so caller function could know
-		 * that scan look up is failed.
-		 */
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Finding AP from scan cache failed"));
-		return CDF_STATUS_E_FAILURE;
-	}
-	return CDF_STATUS_SUCCESS;
-}
-
-#ifdef WLAN_FEATURE_MBSSID
-/**
- * wlan_hdd_stop_sap() - This function stops bss of SAP.
- * @ap_adapter: SAP adapter
- *
- * This function will process the stopping of sap adapter.
- *
- * Return: None
- */
-void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter)
-{
-	hdd_ap_ctx_t *hdd_ap_ctx;
-	hdd_hostapd_state_t *hostapd_state;
-	CDF_STATUS cdf_status;
-	hdd_context_t *hdd_ctx;
-#ifdef CFG80211_DEL_STA_V2
-	struct station_del_parameters delStaParams;
-#endif
-
-	if (NULL == ap_adapter) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("ap_adapter is NULL here"));
-		return;
-	}
-
-	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
-	if (0 != wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("HDD context is not valid"));
-		return;
-	}
-	mutex_lock(&hdd_ctx->sap_lock);
-	if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags)) {
-#ifdef CFG80211_DEL_STA_V2
-		delStaParams.mac = NULL;
-		delStaParams.subtype = SIR_MAC_MGMT_DEAUTH >> 4;
-		delStaParams.reason_code = eCsrForcedDeauthSta;
-		wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy,
-				ap_adapter->dev,
-				&delStaParams);
-#else
-		wlan_hdd_cfg80211_del_station(ap_adapter->wdev.wiphy,
-				ap_adapter->dev,
-				NULL);
-#endif
-		hdd_cleanup_actionframe(hdd_ctx, ap_adapter);
-		hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
-		hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-		       FL("Now doing SAP STOPBSS"));
-		cdf_event_reset(&hostapd_state->cdf_stop_bss_event);
-		if (CDF_STATUS_SUCCESS == wlansap_stop_bss(hdd_ap_ctx->
-							sapContext)) {
-			cdf_status = cdf_wait_single_event(&hostapd_state->
-							   cdf_stop_bss_event,
-							   BSS_WAIT_TIMEOUT);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				mutex_unlock(&hdd_ctx->sap_lock);
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("SAP Stop Failed"));
-				return;
-			}
-		}
-		clear_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags);
-		cds_decr_session_set_pcl(ap_adapter->device_mode,
-						ap_adapter->sessionId);
-		hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-		       FL("SAP Stop Success"));
-	} else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Can't stop ap because its not started"));
-	}
-	mutex_unlock(&hdd_ctx->sap_lock);
-	return;
-}
-
-/**
- * wlan_hdd_start_sap() - this function starts bss of SAP.
- * @ap_adapter: SAP adapter
- *
- * This function will process the starting of sap adapter.
- *
- * Return: None
- */
-void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter)
-{
-	hdd_ap_ctx_t *hdd_ap_ctx;
-	hdd_hostapd_state_t *hostapd_state;
-	CDF_STATUS cdf_status;
-	hdd_context_t *hdd_ctx;
-	tsap_Config_t *sap_config;
-
-	if (NULL == ap_adapter) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("ap_adapter is NULL here"));
-		return;
-	}
-
-	if (WLAN_HDD_SOFTAP != ap_adapter->device_mode) {
-		hdd_err("SoftAp role has not been enabled");
-		return;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
-	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
-	sap_config = &ap_adapter->sessionCtx.ap.sapConfig;
-
-	if (0 != wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("HDD context is not valid"));
-		return;
-	}
-	mutex_lock(&hdd_ctx->sap_lock);
-	if (test_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags))
-		goto end;
-
-	if (0 != wlan_hdd_cfg80211_update_apies(ap_adapter)) {
-		hddLog(LOGE, FL("SAP Not able to set AP IEs"));
-		wlansap_reset_sap_config_add_ie(sap_config, eUPDATE_IE_ALL);
-		goto end;
-	}
-
-	if (wlansap_start_bss(hdd_ap_ctx->sapContext, hdd_hostapd_sap_event_cb,
-			      &hdd_ap_ctx->sapConfig,
-			      ap_adapter->dev)
-			      != CDF_STATUS_SUCCESS)
-		goto end;
-
-	hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-	       FL("Waiting for SAP to start"));
-	cdf_status = cdf_wait_single_event(&hostapd_state->cdf_event,
-					BSS_WAIT_TIMEOUT);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("SAP Start failed"));
-		goto end;
-	}
-	hddLog(CDF_TRACE_LEVEL_INFO_HIGH, FL("SAP Start Success"));
-	set_bit(SOFTAP_BSS_STARTED, &ap_adapter->event_flags);
-	cds_incr_active_session(ap_adapter->device_mode,
-					ap_adapter->sessionId);
-	hostapd_state->bCommit = true;
-
-end:
-	mutex_unlock(&hdd_ctx->sap_lock);
-	return;
-}
-#endif
-
-/**
- * hdd_get_fw_version() - Get FW version
- * @hdd_ctx:     pointer to HDD context.
- * @major_spid:  FW version - major spid.
- * @minor_spid:  FW version - minor spid
- * @ssid:        FW version - ssid
- * @crmid:       FW version - crmid
- *
- * This function is called to get the firmware build version stored
- * as part of the HDD context
- *
- * Return:   None
- */
-void hdd_get_fw_version(hdd_context_t *hdd_ctx,
-			uint32_t *major_spid, uint32_t *minor_spid,
-			uint32_t *siid, uint32_t *crmid)
-{
-	*major_spid = (hdd_ctx->target_fw_version & 0xf0000000) >> 28;
-	*minor_spid = (hdd_ctx->target_fw_version & 0xf000000) >> 24;
-	*siid = (hdd_ctx->target_fw_version & 0xf00000) >> 20;
-	*crmid = hdd_ctx->target_fw_version & 0x7fff;
-}
-
-#ifdef QCA_CONFIG_SMP
-/**
- * wlan_hdd_get_cpu() - get cpu_index
- *
- * Return: cpu_index
- */
-int wlan_hdd_get_cpu(void)
-{
-	int cpu_index = get_cpu();
-	put_cpu();
-	return cpu_index;
-}
-#endif
-
-/**
- * hdd_get_fwpath() - get framework path
- *
- * This function is used to get the string written by
- * userspace to start the wlan driver
- *
- * Return: string
- */
-const char *hdd_get_fwpath(void)
-{
-	return fwpath.string;
-}
-
-/**
- * hdd_init() - Initialize Driver
- *
- * This function initilizes CDS global context with the help of cds_init. This
- * has to be the first function called after probe to get a valid global
- * context.
- *
- * Return: 0 for success, errno on failure
- */
-int hdd_init(void)
-{
-	v_CONTEXT_t p_cds_context = NULL;
-	int ret = 0;
-
-#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-	wlan_logging_sock_init_svc();
-#endif
-	p_cds_context = cds_init();
-
-	if (p_cds_context == NULL) {
-		hdd_alert("Failed to allocate CDS context");
-		ret = -ENOMEM;
-		goto err_out;
-	}
-
-	hdd_trace_init();
-
-err_out:
-	return ret;
-}
-
-/**
- * hdd_deinit() - Deinitialize Driver
- *
- * This function frees CDS global context with the help of cds_deinit. This
- * has to be the last function call in remove callback to free the global
- * context.
- */
-void hdd_deinit(void)
-{
-	cds_deinit();
-
-#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
-	wlan_logging_sock_deinit_svc();
-#endif
-}
-
-#ifdef QCA_WIFI_3_0_ADRASTEA
-#define HDD_WLAN_START_WAIT_TIME (3600 * 1000)
-#else
-#define HDD_WLAN_START_WAIT_TIME (CDS_WMA_TIMEOUT + 5000)
-#endif
-
-/**
- * __hdd_module_init - Module init helper
- *
- * Module init helper function used by both module and static driver.
- *
- * Return: 0 for success, errno on failure
- */
-static int __hdd_module_init(void)
-{
-	int ret = 0;
-
-	pr_info("%s: Loading driver v%s\n", WLAN_MODULE_NAME,
-		QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR);
-
-	cdf_wake_lock_init(&wlan_wake_lock, "wlan");
-
-	hdd_set_conparam((uint32_t) con_mode);
-
-	ret = wlan_hdd_register_driver();
-	if (ret) {
-		pr_err("%s: driver load failure\n", WLAN_MODULE_NAME);
-		goto out;
-	}
-
-	pr_info("%s: driver loaded\n", WLAN_MODULE_NAME);
-
-	return 0;
-out:
-	cdf_wake_lock_destroy(&wlan_wake_lock);
-	return ret;
-}
-
-/**
- * __hdd_module_exit - Module exit helper
- *
- * Module exit helper function used by both module and static driver.
- */
-static void __hdd_module_exit(void)
-{
-	pr_info("%s: Unloading driver v%s\n", WLAN_MODULE_NAME,
-		QWLAN_VERSIONSTR);
-
-	wlan_hdd_unregister_driver();
-
-	cdf_wake_lock_destroy(&wlan_wake_lock);
-
-	return;
-}
-
-/**
- * hdd_module_init() - Init Function
- *
- * This is the driver entry point (invoked when module is loaded using insmod)
- *
- * Return: 0 for success, non zero for failure
- */
-#ifdef MODULE
-static int __init hdd_module_init(void)
-{
-	return __hdd_module_init();
-}
-#else /* #ifdef MODULE */
-static int __init hdd_module_init(void)
-{
-	/* Driver initialization is delayed to fwpath_changed_handler */
-	return 0;
-}
-#endif /* #ifdef MODULE */
-
-/**
- * hdd_module_exit() - Exit function
- *
- * This is the driver exit point (invoked when module is unloaded using rmmod)
- *
- * Return: None
- */
-static void __exit hdd_module_exit(void)
-{
-	__hdd_module_exit();
-}
-
-#ifdef MODULE
-static int fwpath_changed_handler(const char *kmessage, struct kernel_param *kp)
-{
-	return param_set_copystring(kmessage, kp);
-}
-#else /* #ifdef MODULE */
-
-/**
- * kickstart_driver() - driver entry point
- *
- * This is the driver entry point
- * - delayed driver initialization when driver is statically linked
- * - invoked when module parameter fwpath is modified from userspace to signal
- *   initializing the WLAN driver or when con_mode is modified from userspace
- *   to signal a switch in operating mode
- *
- * Return: 0 for success, non zero for failure
- */
-static int kickstart_driver(void)
-{
-	int ret = 0;
-
-	if (!wlan_hdd_inited) {
-		ret = __hdd_module_init();
-		wlan_hdd_inited = ret ? 0 : 1;
-
-		return ret;
-	}
-
-	__hdd_module_exit();
-
-	msleep(200);
-
-	ret = __hdd_module_init();
-
-	wlan_hdd_inited = ret ? 0 : 1;
-
-	return ret;
-}
-
-/**
- * fwpath_changed_handler() - Handler Function
- *
- * Handle changes to the fwpath parameter
- *
- * Return: 0 for success, non zero for failure
- */
-static int fwpath_changed_handler(const char *kmessage, struct kernel_param *kp)
-{
-	int ret;
-
-	ret = param_set_copystring(kmessage, kp);
-	if (0 == ret)
-		ret = kickstart_driver();
-	return ret;
-}
-
-#ifdef QCA_WIFI_FTM
-/**
- * con_mode_handler() - Handles module param con_mode change
- *
- * Handler function for module param con_mode when it is changed by userspace
- * Dynamically linked - do nothing
- * Statically linked - exit and init driver, as in rmmod and insmod
- *
- * Return -
- */
-static int con_mode_handler(const char *kmessage, struct kernel_param *kp)
-{
-	int ret;
-
-	ret = param_set_int(kmessage, kp);
-	if (0 == ret)
-		ret = kickstart_driver();
-	return ret;
-}
-#endif /* QCA_WIFI_FTM */
-#endif /* #ifdef MODULE */
-
-/**
- * hdd_get_conparam() - driver exit point
- *
- * This is the driver exit point (invoked when module is unloaded using rmmod)
- *
- * Return: enum tCDF_GLOBAL_CON_MODE
- */
-enum tCDF_GLOBAL_CON_MODE hdd_get_conparam(void)
-{
-	return (enum tCDF_GLOBAL_CON_MODE) curr_con_mode;
-}
-
-void hdd_set_conparam(uint32_t con_param)
-{
-	curr_con_mode = con_param;
-}
-
-/* Register the module init/exit functions */
-module_init(hdd_module_init);
-module_exit(hdd_module_exit);
-
-MODULE_LICENSE("Dual BSD/GPL");
-MODULE_AUTHOR("Qualcomm Atheros, Inc.");
-MODULE_DESCRIPTION("WLAN HOST DEVICE DRIVER");
-
-#if !defined(MODULE) && defined(QCA_WIFI_FTM)
-module_param_call(con_mode, con_mode_handler, param_get_int, &con_mode,
-		  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-#else
-module_param(con_mode, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-#endif
-
-module_param_call(fwpath, fwpath_changed_handler, param_get_string, &fwpath,
-		  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-
-module_param(enable_dfs_chan_scan, int, S_IRUSR | S_IRGRP | S_IROTH);
-
-module_param(enable_11d, int, S_IRUSR | S_IRGRP | S_IROTH);
-
-module_param(country_code, charp, S_IRUSR | S_IRGRP | S_IROTH);

+ 0 - 637
core/hdd/src/wlan_hdd_memdump.c

@@ -1,637 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC : wlan_hdd_memdump.c
- *
- * WLAN Host Device Driver file for dumping firmware memory
- *
- */
-
-#include <sme_api.h>
-#include <wlan_hdd_includes.h>
-#include "wlan_hdd_memdump.h"
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/version.h>
-#include <linux/proc_fs.h> /* Necessary because we use the proc fs */
-#include <linux/uaccess.h> /* for copy_to_user */
-
-/**
- * hdd_fw_dump_context - hdd firmware memory dump context
- *
- * @request_id: userspace assigned firmware memory dump request ID
- * @response_event: firmware memory dump request wait event
- */
-struct hdd_fw_dump_context {
-	uint32_t request_id;
-	struct completion response_event;
-};
-static struct hdd_fw_dump_context fw_dump_context;
-
-/**
- * memdump_cleanup_timer_cb() - Timer callback function for memory dump cleanup.
- *
- * @data: Callback data (used to stored HDD context)
- *
- * Callback function registered for memory dump cleanup VOS timer.
- *
- * Return: none
- */
-
-static void memdump_cleanup_timer_cb(void *data)
-{
-	int status;
-	hdd_context_t *hdd_ctx = data;
-	cdf_dma_addr_t paddr;
-	cdf_dma_addr_t dma_ctx = 0;
-	cdf_device_t cdf_ctx;
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return;
-	}
-
-	if (!hdd_ctx->fw_dump_loc) {
-		hddLog(LOG1, FL("Memory dump already freed"));
-		return;
-	}
-
-	cdf_ctx = cds_get_context(CDF_MODULE_ID_CDF_DEVICE);
-	if (!cdf_ctx) {
-		hddLog(LOGE, FL("CDF context is NULL"));
-		return;
-	}
-
-	paddr = hdd_ctx->dump_loc_paddr;
-	mutex_lock(&hdd_ctx->memdump_lock);
-	cdf_os_mem_free_consistent(cdf_ctx,
-		FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
-	hdd_ctx->fw_dump_loc = NULL;
-	hdd_ctx->memdump_in_progress = false;
-	mutex_unlock(&hdd_ctx->memdump_lock);
-
-}
-
-/**
- * wlan_hdd_cfg80211_fw_mem_dump_cb() -  Callback to receive FW memory dump
- * @ctx: pointer to HDD context.
- * @rsp: pointer to fw dump copy complete response
- *
- * This is a callback function used to indicate user space about the
- * availability for firmware memory dump via vendor event.
- *
- * Return: None
- */
-static void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx,
-					     struct fw_dump_rsp *dump_rsp)
-{
-	hdd_context_t *hdd_ctx = ctx;
-	struct hdd_fw_dump_context *context;
-	int status;
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return;
-	}
-
-	spin_lock(&hdd_context_lock);
-	context = &fw_dump_context;
-	/* validate the response received */
-	if (!dump_rsp->dump_complete ||
-	    context->request_id != dump_rsp->request_id) {
-		spin_unlock(&hdd_context_lock);
-		hddLog(LOGE,
-		       FL("Error @ request_id: %d response_id: %d status: %d"),
-		       context->request_id, dump_rsp->request_id,
-		       dump_rsp->dump_complete);
-		return;
-	} else {
-		complete(&context->response_event);
-	}
-	spin_unlock(&hdd_context_lock);
-
-	return;
-}
-
-/**
- * wlan_hdd_send_memdump_rsp - send memory dump response to user space
- * @hdd_ctx: Pointer to hdd context
- *
- * Return: 0 for success; non-zero for failure
- */
-static int wlan_hdd_send_memdump_rsp(hdd_context_t *hdd_ctx)
-{
-	struct sk_buff *skb;
-	int status;
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return status;
-	}
-
-	skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy,
-			NLMSG_HDRLEN + NLA_HDRLEN + sizeof(uint32_t));
-
-	if (!skb) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return -ENOMEM;
-	}
-
-	if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_MEMDUMP_SIZE,
-			     FW_MEM_DUMP_SIZE)) {
-		hddLog(LOGE, FL("nla put fail"));
-		goto nla_put_failure;
-	}
-
-	cfg80211_vendor_cmd_reply(skb);
-	hddLog(LOG1, FL("Memdump event sent successfully to user space"));
-	return 0;
-
-nla_put_failure:
-	kfree_skb(skb);
-	return -EINVAL;
-}
-
-/**
- * __wlan_hdd_cfg80211_get_fw_mem_dump() - Get FW memory dump
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the NL data.
- * @data_len:Length of @data
- *
- * This is called when wlan driver needs to get the firmware memory dump
- * via vendor specific command.
- *
- * Return:   0 on success, error number otherwise.
- */
-static int __wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
-					       struct wireless_dev *wdev,
-					       const void *data, int data_len)
-{
-	int status;
-	CDF_STATUS sme_status;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct fw_dump_req fw_mem_dump_req;
-	struct fw_dump_seg_req *seg_req;
-	uint8_t loop;
-	cdf_dma_addr_t paddr;
-	cdf_dma_addr_t dma_ctx = 0;
-	cdf_device_t cdf_ctx;
-	unsigned long rc;
-	struct hdd_fw_dump_context *context;
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is invalid"));
-		return status;
-	}
-
-	cdf_ctx = cds_get_context(CDF_MODULE_ID_CDF_DEVICE);
-	if (!cdf_ctx) {
-		hddLog(LOGE, FL("CDF context is NULL"));
-		return -EINVAL;
-	}
-
-	if (hdd_ctx->memdump_in_progress) {
-		hddLog(LOGE, FL("Already a memdump req in progress."));
-		return -EBUSY;
-	}
-
-	/*
-	 * Allocate memory for fw memory dump. Memory allocated should be
-	 * contiguous. Physical address of the allocated memory is passed
-	 * to the FW for copy
-	 *
-	 * Reuse the memory if available.
-	 */
-	mutex_lock(&hdd_ctx->memdump_lock);
-	if (!hdd_ctx->fw_dump_loc) {
-		hdd_ctx->fw_dump_loc = cdf_os_mem_alloc_consistent(
-			cdf_ctx, FW_MEM_DUMP_SIZE, &paddr, dma_ctx);
-		if (!hdd_ctx->fw_dump_loc) {
-			mutex_unlock(&hdd_ctx->memdump_lock);
-			hddLog(LOGE, FL("cdf_os_mem_alloc_consistent failed"));
-			return -ENOMEM;
-		}
-		hdd_ctx->dump_loc_paddr = paddr;
-	}
-	mutex_unlock(&hdd_ctx->memdump_lock);
-
-	/*
-	 * Currently request_id and num_seg is assumed to be default(1)
-	 * It is assumed that firmware dump requested is for DRAM section
-	 * only
-	 */
-
-	fw_mem_dump_req.request_id = FW_MEM_DUMP_REQ_ID;
-	fw_mem_dump_req.num_seg = FW_MEM_DUMP_NUM_SEG;
-
-	hddLog(LOG1, FL("request_id:%d num_seg:%d"),
-		fw_mem_dump_req.request_id, fw_mem_dump_req.num_seg);
-	seg_req = (struct fw_dump_seg_req *) fw_mem_dump_req.segment;
-	for (loop = 0; loop < fw_mem_dump_req.num_seg; loop++) {
-		seg_req->seg_id = 1;
-		seg_req->seg_start_addr_lo = FW_DRAM_LOCATION;
-		seg_req->seg_start_addr_hi = 0;
-		seg_req->seg_length = FW_MEM_DUMP_SIZE;
-		seg_req->dst_addr_lo = hdd_ctx->dump_loc_paddr;
-		seg_req->dst_addr_hi = 0;
-		hddLog(LOG1, FL("seg_number:%d"), loop);
-		hddLog(LOG1,
-		    FL("seg_id:%d start_addr_lo:0x%x start_addr_hi:0x%x"),
-		    seg_req->seg_id, seg_req->seg_start_addr_lo,
-		    seg_req->seg_start_addr_hi);
-		hddLog(LOG1,
-		    FL("seg_length:%d dst_addr_lo:0x%x dst_addr_hi:0x%x"),
-		    seg_req->seg_length, seg_req->dst_addr_lo,
-		    seg_req->dst_addr_hi);
-		seg_req++;
-	}
-
-	/**
-	 * Start the cleanup timer.
-	 * Memory allocated for this request will be freed up
-	 * once the timer expires. Memory dump request is expected to be
-	 * completed by this time.
-	 *
-	 * User space will not be able to access the dump after this time.
-	 * New request should be issued to get the dump again.
-	 */
-	cdf_mc_timer_start(&hdd_ctx->memdump_cleanup_timer,
-			MEMDUMP_COMPLETION_TIME_MS);
-	hdd_ctx->memdump_in_progress = true;
-
-	spin_lock(&hdd_context_lock);
-	context = &fw_dump_context;
-	context->request_id = fw_mem_dump_req.request_id;
-	INIT_COMPLETION(context->response_event);
-	spin_unlock(&hdd_context_lock);
-
-	sme_status = sme_fw_mem_dump(hdd_ctx->hHal, &fw_mem_dump_req);
-	if (CDF_STATUS_SUCCESS != sme_status) {
-		hddLog(LOGE, FL("sme_fw_mem_dump Failed"));
-		mutex_lock(&hdd_ctx->memdump_lock);
-		cdf_os_mem_free_consistent(cdf_ctx,
-			FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
-		hdd_ctx->fw_dump_loc = NULL;
-		mutex_unlock(&hdd_ctx->memdump_lock);
-		hdd_ctx->memdump_in_progress = false;
-		if (CDF_TIMER_STATE_RUNNING ==
-			cdf_mc_timer_get_current_state(
-				&hdd_ctx->memdump_cleanup_timer)) {
-			cdf_mc_timer_stop(&hdd_ctx->memdump_cleanup_timer);
-		}
-		return -EINVAL;
-	}
-
-	rc = wait_for_completion_timeout(&context->response_event,
-		msecs_to_jiffies(MEMDUMP_COMPLETION_TIME_MS));
-	if (!rc) {
-		hddLog(LOGE, FL("Target response timed out for request_id: %d"),
-		       context->request_id);
-		return -ETIMEDOUT;
-	}
-
-	status = wlan_hdd_send_memdump_rsp(hdd_ctx);
-	if (status)
-		hddLog(LOGE,
-			FL("Failed to send FW memory dump rsp to user space"));
-
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_get_fw_mem_dump() - Get FW memory dump
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the NL data.
- * @data_len:Length of @data
- *
- * This is called when wlan driver needs to get the firmware memory dump
- * via vendor specific command.
- *
- * Return:   0 on success, error number otherwise.
- */
-int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy,
-				      struct wireless_dev *wdev,
-				      const void *data, int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_fw_mem_dump(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#define PROCFS_MEMDUMP_DIR "debug"
-#define PROCFS_MEMDUMP_NAME "fwdump"
-#define PROCFS_MEMDUMP_PERM 0444
-
-static struct proc_dir_entry *proc_file, *proc_dir;
-
-/** memdump_get_file_data() - get data available in proc file
- *
- * @file - handle for the proc file.
- *
- * This function is used to retrieve the data passed while
- * creating proc file entry.
- *
- * Return: void pointer to hdd_context
- */
-static void *memdump_get_file_data(struct file *file)
-{
-	void *hdd_ctx;
-
-	hdd_ctx = PDE_DATA(file_inode(file));
-	return hdd_ctx;
-}
-
-/**
- * memdump_read() - perform read operation in memory dump proc file
- *
- * @file  - handle for the proc file.
- * @buf   - pointer to user space buffer.
- * @count - number of bytes to be read.
- * @pos   - offset in the from buffer.
- *
- * This function performs read operation for the memory dump proc file.
- *
- * Return: number of bytes read on success, error code otherwise.
- */
-static ssize_t memdump_read(struct file *file, char __user *buf,
-					size_t count, loff_t *pos)
-{
-	int status;
-	hdd_context_t *hdd_ctx;
-	cdf_dma_addr_t paddr;
-	cdf_dma_addr_t dma_ctx = 0;
-	cdf_device_t cdf_ctx;
-
-	hdd_ctx = memdump_get_file_data(file);
-
-	hddLog(LOG1, FL("Read req for size:%zu pos:%llu"), count, *pos);
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-	cdf_ctx = cds_get_context(CDF_MODULE_ID_CDF_DEVICE);
-	if (!cdf_ctx) {
-		hddLog(LOGE, FL("CDF context is NULL"));
-		return -EINVAL;
-	}
-
-	if (!hdd_ctx->memdump_in_progress) {
-		hddLog(LOGE, FL("Current mem dump request timed out/failed"));
-		return -EINVAL;
-	}
-
-	if (*pos < 0) {
-		hddLog(LOGE, FL("Invalid start offset for memdump read"));
-		return -EINVAL;
-	} else if (*pos >= FW_MEM_DUMP_SIZE || !count) {
-		hddLog(LOGE, FL("No more data to copy"));
-		return 0;
-	} else if (count > FW_MEM_DUMP_SIZE - *pos) {
-		count = FW_MEM_DUMP_SIZE - *pos;
-	}
-
-	if (!hdd_ctx->fw_dump_loc) {
-		hddLog(LOGE, FL("Invalid fw mem dump location"));
-		return -EINVAL;
-	}
-
-	if (copy_to_user(buf, hdd_ctx->fw_dump_loc + *pos, count)) {
-		hddLog(LOGE, FL("copy to user space failed"));
-		return -EFAULT;
-	}
-
-	/* offset(pos) should be updated here based on the copy done*/
-	*pos += count;
-
-	/* Entire FW memory dump copy completed */
-	if (*pos >= FW_MEM_DUMP_SIZE) {
-		paddr = hdd_ctx->dump_loc_paddr;
-		mutex_lock(&hdd_ctx->memdump_lock);
-		cdf_os_mem_free_consistent(cdf_ctx,
-			FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
-		hdd_ctx->fw_dump_loc = NULL;
-		hdd_ctx->memdump_in_progress = false;
-		if (CDF_TIMER_STATE_RUNNING ==
-			cdf_mc_timer_get_current_state(
-				&hdd_ctx->memdump_cleanup_timer)) {
-			cdf_mc_timer_stop(&hdd_ctx->memdump_cleanup_timer);
-		}
-		mutex_unlock(&hdd_ctx->memdump_lock);
-	}
-
-	return count;
-}
-
-/**
- * struct memdump_fops - file operations for memory dump feature
- * @read - read function for memory dump operation.
- *
- * This structure initialize the file operation handle for memory
- * dump feature
- */
-static const struct file_operations memdump_fops = {
-	read: memdump_read
-};
-
-/**
- * memdump_procfs_init() - Initialize procfs for memory dump
- *
- * This function create file under proc file system to be used later for
- * processing firmware memory dump
- *
- * Return:   0 on success, error code otherwise.
- */
-static int memdump_procfs_init(void)
-{
-	hdd_context_t *hdd_ctx;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hddLog(LOGE , FL("Invalid HDD context"));
-		return -EINVAL;
-	}
-
-	proc_dir = proc_mkdir(PROCFS_MEMDUMP_DIR, NULL);
-	if (proc_dir == NULL) {
-		remove_proc_entry(PROCFS_MEMDUMP_DIR, NULL);
-		pr_debug("Error: Could not initialize /proc/%s\n",
-			 PROCFS_MEMDUMP_DIR);
-		return -ENOMEM;
-	}
-
-	proc_file = proc_create_data(PROCFS_MEMDUMP_NAME,
-				     PROCFS_MEMDUMP_PERM, proc_dir,
-				     &memdump_fops, hdd_ctx);
-	if (proc_file == NULL) {
-		remove_proc_entry(PROCFS_MEMDUMP_NAME, proc_dir);
-		pr_debug("Error: Could not initialize /proc/%s\n",
-			  PROCFS_MEMDUMP_NAME);
-		return -ENOMEM;
-	}
-
-	pr_debug("/proc/%s/%s created\n", PROCFS_MEMDUMP_DIR,
-		 PROCFS_MEMDUMP_NAME);
-	return 0;
-}
-
-/**
- * memdump_procfs_remove() - Remove file/dir under procfs for memory dump
- *
- * This function removes file/dir under proc file system that was
- * processing firmware memory dump
- *
- * Return:  None
- */
-static void memdump_procfs_remove(void)
-{
-	remove_proc_entry(PROCFS_MEMDUMP_NAME, proc_dir);
-	pr_debug("/proc/%s/%s removed\n", PROCFS_MEMDUMP_DIR,
-					  PROCFS_MEMDUMP_NAME);
-	remove_proc_entry(PROCFS_MEMDUMP_DIR, NULL);
-	pr_debug("/proc/%s removed\n", PROCFS_MEMDUMP_DIR);
-}
-
-/**
- * memdump_init() - Intialization function for memory dump feature
- *
- * This function creates proc file for memdump feature and registers
- * HDD callback function with SME.
- *
- * Return - 0 on success, error otherwise
- */
-int memdump_init(void)
-{
-	hdd_context_t *hdd_ctx;
-	int status = 0;
-	CDF_STATUS cb_status;
-	CDF_STATUS cdf_status;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hddLog(LOGE , FL("Invalid HDD context"));
-		return -EINVAL;
-	}
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Not initializing memdump in FTM mode"));
-		return -EINVAL;
-	}
-
-	cb_status = sme_fw_mem_dump_register_cb(hdd_ctx->hHal,
-				wlan_hdd_cfg80211_fw_mem_dump_cb);
-	if (CDF_STATUS_SUCCESS != cb_status) {
-		hddLog(LOGE , FL("Failed to register the callback"));
-		return -EINVAL;
-	}
-
-	status = memdump_procfs_init();
-	if (status) {
-		hddLog(LOGE , FL("Failed to create proc file"));
-		return status;
-	}
-
-	init_completion(&fw_dump_context.response_event);
-
-	cdf_status = cdf_mc_timer_init(&hdd_ctx->memdump_cleanup_timer,
-				    CDF_TIMER_TYPE_SW, memdump_cleanup_timer_cb,
-				    (void *)hdd_ctx);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGE, FL("Failed to init memdump cleanup timer"));
-		return -EINVAL;
-	}
-
-	mutex_init(&hdd_ctx->memdump_lock);
-
-	return 0;
-}
-
-/**
- * memdump_deinit() - De initialize memdump feature
- *
- * This function removes proc file created for memdump feature.
- *
- * Return: None
- */
-void memdump_deinit(void)
-{
-	hdd_context_t *hdd_ctx;
-	cdf_dma_addr_t paddr;
-	cdf_dma_addr_t dma_ctx = 0;
-	cdf_device_t cdf_ctx;
-	CDF_STATUS cdf_status;
-
-	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hddLog(LOGE , FL("Invalid HDD context"));
-		return;
-	}
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Not deinitializing memdump in FTM mode"));
-		return;
-	}
-
-	cdf_ctx = cds_get_context(CDF_MODULE_ID_CDF_DEVICE);
-	if (!cdf_ctx) {
-		hddLog(LOGE, FL("CDF context is NULL"));
-		return;
-	}
-
-	memdump_procfs_remove();
-	sme_fw_mem_dump_unregister_cb(hdd_ctx->hHal);
-
-	mutex_lock(&hdd_ctx->memdump_lock);
-	if (hdd_ctx->fw_dump_loc) {
-		paddr = hdd_ctx->dump_loc_paddr;
-		cdf_os_mem_free_consistent(cdf_ctx,
-			FW_MEM_DUMP_SIZE, hdd_ctx->fw_dump_loc, paddr, dma_ctx);
-		hdd_ctx->fw_dump_loc = NULL;
-		hdd_ctx->memdump_in_progress = false;
-	}
-	mutex_unlock(&hdd_ctx->memdump_lock);
-
-	if (CDF_TIMER_STATE_RUNNING ==
-	  cdf_mc_timer_get_current_state(&hdd_ctx->memdump_cleanup_timer)) {
-		cdf_mc_timer_stop(&hdd_ctx->memdump_cleanup_timer);
-	}
-
-	cdf_status = cdf_mc_timer_destroy(&hdd_ctx->memdump_cleanup_timer);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status))
-		hddLog(LOGE, FL("Failed to deallocate timer"));
-}

+ 0 - 193
core/hdd/src/wlan_hdd_nan.c

@@ -1,193 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_nan.c
- *
- * WLAN Host Device Driver NAN API implementation
- */
-
-/* denote that this file does not allow legacy hddLog */
-#define HDD_DISALLOW_LEGACY_HDDLOG 1
-
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <net/cfg80211.h>
-#include <ani_global.h>
-#include "sme_api.h"
-#include "nan_api.h"
-#include "wlan_hdd_main.h"
-#include "wlan_hdd_nan.h"
-
-/**
- * __wlan_hdd_cfg80211_nan_request() - cfg80211 NAN request handler
- * @wiphy: driver's wiphy struct
- * @wdev: wireless device to which the request is targeted
- * @data: actual request data (netlink-encapsulated)
- * @data_len: length of @data
- *
- * This is called when userspace needs to send a nan request to
- * firmware. The wlan host driver simply de-encapsulates the
- * request from the netlink payload and then forwards it to
- * firmware via SME.
- *
- * Return: 0 on success, negative errno on failure
- */
-static int __wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   const void *data,
-					   int data_len)
-{
-	tNanRequestReq nan_req;
-	CDF_STATUS status;
-	int ret_val;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-
-	ENTER();
-
-	ret_val = wlan_hdd_validate_context(hdd_ctx);
-	if (ret_val)
-		return ret_val;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	if (!hdd_ctx->config->enable_nan_support) {
-		hdd_err("NaN support is not enabled in INI");
-		return -EPERM;
-	}
-
-	nan_req.request_data_len = data_len;
-	nan_req.request_data = data;
-
-	status = sme_nan_request(&nan_req);
-	if (CDF_STATUS_SUCCESS != status) {
-		ret_val = -EINVAL;
-	}
-	return ret_val;
-}
-
-/**
- * wlan_hdd_cfg80211_nan_request() - handle NAN request
- * @wiphy:   pointer to wireless wiphy structure.
- * @wdev:    pointer to wireless_dev structure.
- * @data:    Pointer to the data to be passed via vendor interface
- * @data_len:Length of the data to be passed
- *
- * This function is called by userspace to send a NAN request to
- * firmware.  This is an SSR-protected wrapper function.
- *
- * Return: 0 on success, negative errno on failure
- */
-int wlan_hdd_cfg80211_nan_request(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  const void *data,
-				  int data_len)
-
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_nan_request(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_nan_callback() - cfg80211 NAN event handler
- * @ctx: global HDD context
- * @msg: NAN event message
- *
- * This is a callback function and it gets called when we need to report
- * a nan event to userspace.  The wlan host driver simply encapsulates the
- * event into a netlink payload and then forwards it to userspace via a
- * cfg80211 vendor event.
- *
- * Return: nothing
- */
-static void wlan_hdd_cfg80211_nan_callback(void *ctx, tSirNanEvent *msg)
-{
-	hdd_context_t *hdd_ctx = ctx;
-	struct sk_buff *vendor_event;
-	int status;
-
-	if (NULL == msg) {
-		hdd_err("msg received here is null");
-		return;
-	}
-
-	status = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != status) {
-		hdd_err("HDD context is not valid");
-		return;
-	}
-
-	vendor_event =
-		cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
-					    NULL,
-					    msg->event_data_len + NLMSG_HDRLEN,
-					    QCA_NL80211_VENDOR_SUBCMD_NAN_INDEX,
-					    GFP_KERNEL);
-
-	if (!vendor_event) {
-		hdd_err("cfg80211_vendor_event_alloc failed");
-		return;
-	}
-	if (nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_NAN,
-		    msg->event_data_len, msg->event_data)) {
-		hdd_err("QCA_WLAN_VENDOR_ATTR_NAN put fail");
-		kfree_skb(vendor_event);
-		return;
-	}
-	cfg80211_vendor_event(vendor_event, GFP_KERNEL);
-}
-
-/**
- * wlan_hdd_nan_is_supported() - HDD NAN support query function
- *
- * This function is called to determine if NAN is supported by the
- * driver and by the firmware.
- *
- * Return: true if NAN is supported by the driver and firmware
- */
-bool wlan_hdd_nan_is_supported(void)
-{
-	return sme_is_feature_supported_by_fw(NAN);
-}
-
-/**
- * wlan_hdd_nan_init() - HDD NAN initialization function
- * @hdd_ctx: Global HDD context
- *
- * This function is called to initialize the HDD NAN feature.  Currently
- * the only operation required is to register a callback with SME.
- *
- * Return: void
- */
-void wlan_hdd_nan_init(hdd_context_t *hdd_ctx)
-{
-	sme_nan_register_callback(hdd_ctx->hHal,
-				  wlan_hdd_cfg80211_nan_callback);
-}

+ 0 - 273
core/hdd/src/wlan_hdd_napi.c

@@ -1,273 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_napi.c
- *
- * WLAN HDD NAPI interface implementation
- */
-#include <smp.h> /* get_cpu */
-
-#include "wlan_hdd_napi.h"
-#include "cds_api.h"       /* cds_get_context */
-#include "hif.h"           /* hif_map_service...*/
-#include "wlan_hdd_main.h" /* hdd_err/warn... */
-#include "cdf_types.h"     /* CDF_MODULE_ID_... */
-#include "ce_api.h"
-
-/*  guaranteed to be initialized to zero/NULL by the standard */
-static struct qca_napi_data *hdd_napi_ctx;
-
-/**
- * hdd_napi_get_all() - return the whole NAPI structure from HIF
- *
- * Gets to the data structure common to all NAPI instances.
- *
- * Return:
- *  NULL  : probably NAPI not initialized yet.
- *  <addr>: the address of the whole NAPI structure
- */
-struct qca_napi_data *hdd_napi_get_all(void)
-{
-	struct qca_napi_data *rp = NULL;
-	struct ol_softc *hif;
-
-	NAPI_DEBUG("-->\n");
-
-	hif = cds_get_context(CDF_MODULE_ID_HIF);
-	if (unlikely(NULL == hif))
-		CDF_ASSERT(NULL != hif); /* WARN */
-	else
-		rp = hif_napi_get_all(hif);
-
-	NAPI_DEBUG("<-- [addr=%p]\n", rp);
-	return rp;
-}
-
-/**
- * hdd_napi_get_map() - get a copy of napi pipe map
- *
- * Return:
- *  uint32_t  : copy of pipe map
- */
-static uint32_t hdd_napi_get_map(void)
-{
-	uint32_t map = 0;
-
-	NAPI_DEBUG("-->\n");
-	/* cache once, use forever */
-	if (hdd_napi_ctx == NULL)
-		hdd_napi_ctx = hdd_napi_get_all();
-	if (hdd_napi_ctx != NULL)
-		map = hdd_napi_ctx->ce_map;
-
-	NAPI_DEBUG("<--[map=0x%08x]\n", map);
-	return map;
-}
-
-/**
- * hdd_napi_create() - creates the NAPI structures for a given netdev
- *
- * Creates NAPI instances. This function is called
- * unconditionally during initialization. It creates
- * napi structures through the proper HTC/HIF calls.
- * The structures are disabled on creation.
- *
- * Return:
- *   single-queue: <0: err, >0=id, 0 (should not happen)
- *   multi-queue: bitmap of created instances (0: none)
- */
-int hdd_napi_create(void)
-{
-	struct ol_softc *hif_ctx;
-	uint8_t ul, dl;
-	int     ul_polled, dl_polled;
-	int     rc = 0;
-
-	NAPI_DEBUG("-->\n");
-
-	hif_ctx = cds_get_context(CDF_MODULE_ID_HIF);
-	if (unlikely(NULL == hif_ctx)) {
-		CDF_ASSERT(NULL != hif_ctx);
-		rc = -EFAULT;
-	} else {
-		/*
-		 * Note: hif_service_to_pipe returns one pipe id per service.
-		 * For multi-queue NAPI for Adrastea, we will use multiple
-		 * services/calls.
-		 * For Rome, there is only one service, hence a single call
-		 */
-		if (CDF_STATUS_SUCCESS !=
-		    hif_map_service_to_pipe(hif_ctx, HTT_DATA_MSG_SVC,
-					    &ul, &dl, &ul_polled, &dl_polled)) {
-			hdd_err("cannot map service to pipe");
-			rc = -EINVAL;
-		} else {
-			rc = hif_napi_create(hif_ctx, dl, hdd_napi_poll,
-					     QCA_NAPI_BUDGET,
-					     QCA_NAPI_DEF_SCALE);
-			if (rc < 0)
-				hdd_err("ERR(%d) creating NAPI on pipe %d",
-					rc, dl);
-			else {
-				hdd_info("napi instance %d created on pipe %d",
-					 rc, dl);
-				/* rc = (0x01 << rc); -- phase 2 */
-			}
-		}
-	}
-	NAPI_DEBUG("<-- [rc=%d]\n", rc);
-
-	return rc;
-}
-
-/**
- * hdd_napi_destroy() - destroys the NAPI structures for a given netdev
- * @force: if set, will force-disable the instance before _del'ing
- *
- * Destroy NAPI instances. This function is called
- * unconditionally during module removal. It destroy
- * napi structures through the proper HTC/HIF calls.
- *
- * Return:
- *    number of NAPI instances destroyed
- */
-int hdd_napi_destroy(int force)
-{
-	int rc = 0;
-	int i;
-	uint32_t hdd_napi_map = hdd_napi_get_map();
-
-	NAPI_DEBUG("--> (force=%d)\n", force);
-	if (hdd_napi_map) {
-		struct ol_softc *hif_ctx;
-
-		hif_ctx = cds_get_context(CDF_MODULE_ID_HIF);
-		if (unlikely(NULL == hif_ctx))
-			CDF_ASSERT(NULL != hif_ctx);
-		else
-			for (i = 0; i < CE_COUNT_MAX; i++)
-				if (hdd_napi_map & (0x01 << i)) {
-					if (0 <= hif_napi_destroy(
-						    hif_ctx,
-						    NAPI_PIPE2ID(i), force)) {
-						rc++;
-						hdd_napi_map &= ~(0x01 << i);
-					} else
-						hdd_err("cannot destroy napi %d: (pipe:%d), f=%d\n",
-							i,
-							NAPI_PIPE2ID(i), force);
-				}
-	}
-
-	/* if all instances are removed, it is likely that hif_context has been
-	 * removed as well, so the cached value of the napi context also needs
-	 * to be removed
-	 */
-	if (force)
-		CDF_ASSERT(hdd_napi_map == 0);
-	if (0 == hdd_napi_map)
-		hdd_napi_ctx = NULL;
-
-	NAPI_DEBUG("<-- [rc=%d]\n", rc);
-	return rc;
-}
-
-/**
- * hdd_napi_enabled() - checks if NAPI is enabled (for a given id)
- * @id: the id of the NAPI to check (any= -1)
- *
- * Return:
- *   int: 0  = false (NOT enabled)
- *        !0 = true  (enabbled)
- */
-int hdd_napi_enabled(int id)
-{
-	struct ol_softc *hif;
-	int rc = 0; /* NOT enabled */
-
-	hif = cds_get_context(CDF_MODULE_ID_HIF);
-	if (unlikely(NULL == hif))
-		CDF_ASSERT(hif != NULL); /* WARN_ON; rc = 0 */
-	else if (-1 == id)
-		rc = hif_napi_enabled(hif, id);
-	else
-		rc = hif_napi_enabled(hif, NAPI_ID2PIPE(id));
-	return rc;
-}
-
-/**
- * hdd_napi_event() - relay the event detected by HDD to HIF NAPI decision maker
- * @event: event code
- * @data : event-specific auxiliary data
- *
- * Return code does not indicate a change, but whether or not NAPI is
- * enabled at the time of the return of the function. That is, if NAPI
- * was disabled before the call, and the event does not cause NAPI to be
- * enabled, a value of 0 will be returned indicating that it is (still)
- * disabled.
- *
- * Return:
- *  < 0: error code
- *  = 0: NAPI state = disabled (after processing the event)
- *  = 1: NAPI state = enabled  (after processing the event)
- */
-int hdd_napi_event(enum qca_napi_event event, void *data)
-{
-	int rc = -EFAULT;  /* assume err */
-	struct ol_softc *hif;
-
-	NAPI_DEBUG("-->(event=%d, aux=%p)\n", event, data);
-
-	hif = cds_get_context(CDF_MODULE_ID_HIF);
-	if (unlikely(NULL == hif))
-		CDF_ASSERT(hif != NULL);
-	else
-		rc = hif_napi_event(hif, event, data);
-
-	NAPI_DEBUG("<--[rc=%d]\n", rc);
-	return rc;
-}
-
-/**
- * hdd_napi_poll() - NAPI poll function
- * @napi  : pointer to NAPI struct
- * @budget: the pre-declared budget
- *
- * Implementation of poll function. This function is called
- * by kernel during softirq processing.
- *
- * NOTE FOR THE MAINTAINER:
- *   Make sure this is very close to the ce_tasklet code.
- *
- * Return:
- *   int: the amount of work done ( <= budget )
- */
-int hdd_napi_poll(struct napi_struct *napi, int budget)
-{
-	return hif_napi_poll(napi, budget);
-}

+ 0 - 1997
core/hdd/src/wlan_hdd_ocb.c

@@ -1,1997 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_ocb.c
- *
- * WLAN Host Device Driver 802.11p OCB implementation
- */
-
-#include "cds_sched.h"
-#include "wlan_hdd_assoc.h"
-#include "wlan_hdd_main.h"
-#include "wlan_hdd_ocb.h"
-#include "wlan_hdd_trace.h"
-#include "wlan_tgt_def_config.h"
-#include "sch_api.h"
-#include "wma_api.h"
-
-/* Structure definitions for WLAN_SET_DOT11P_CHANNEL_SCHED */
-#define AIFSN_MIN		(2)
-#define AIFSN_MAX		(15)
-#define CW_MIN			(1)
-#define CW_MAX			(10)
-
-/* 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
- * @hdd_ctx: HDD Context pointer
- *
- * TODO-OCB: This has been temporarily added to ensure this paramter
- * is set in CSR when we init the channel list. This should be removed
- * once the 5.9 GHz channels are added to the regulatory domain.
- */
-void hdd_set_dot11p_config(hdd_context_t *hdd_ctx)
-{
-	sme_set_dot11p_config(hdd_ctx->hHal,
-			      hdd_ctx->config->dot11p_mode !=
-				WLAN_HDD_11P_DISABLED);
-}
-
-/**
- * dot11p_validate_qos_params() - Check if QoS parameters are valid
- * @qos_params:   Array of QoS parameters
- *
- * Return: 0 on success. error code on failure.
- */
-static int dot11p_validate_qos_params(struct sir_qos_params qos_params[])
-{
-	int i;
-
-	for (i = 0; i < MAX_NUM_AC; i++) {
-		if ((!qos_params[i].aifsn) && (!qos_params[i].cwmin)
-				&& (!qos_params[i].cwmax))
-			continue;
-
-		/* Validate AIFSN */
-		if ((qos_params[i].aifsn < AIFSN_MIN)
-				|| (qos_params[i].aifsn > AIFSN_MAX)) {
-			hddLog(LOGE, FL("Invalid QoS parameter aifsn %d"),
-				qos_params[i].aifsn);
-			return -EINVAL;
-		}
-
-		/* Validate CWMin */
-		if ((qos_params[i].cwmin < CW_MIN)
-				|| (qos_params[i].cwmin > CW_MAX)) {
-			hddLog(LOGE, FL("Invalid QoS parameter cwmin %d"),
-				qos_params[i].cwmin);
-			return -EINVAL;
-		}
-
-		/* Validate CWMax */
-		if ((qos_params[i].cwmax < CW_MIN)
-				|| (qos_params[i].cwmax > CW_MAX)) {
-			hddLog(LOGE, FL("Invalid QoS parameter cwmax %d"),
-				qos_params[i].cwmax);
-			return -EINVAL;
-		}
-	}
-
-	return 0;
-}
-
-/**
- * dot11p_validate_channel() - validates a DSRC channel
- * @center_freq: the channel's center frequency
- * @bandwidth: the channel's bandwidth
- * @tx_power: transmit power
- * @reg_power: (output) the max tx power from the regulatory domain
- * @antenna_max: (output) the max antenna gain from the regulatory domain
- *
- * Return: 0 if the channel is valid, error code otherwise.
- */
-static int dot11p_validate_channel(struct wiphy *wiphy,
-				   uint32_t channel_freq, uint32_t bandwidth,
-				   uint32_t tx_power, uint8_t *reg_power,
-				   uint8_t *antenna_max)
-{
-	int band_idx, channel_idx;
-	struct ieee80211_supported_band *current_band;
-	struct ieee80211_channel *current_channel;
-
-	for (band_idx = 0; band_idx < IEEE80211_NUM_BANDS; band_idx++) {
-		current_band = wiphy->bands[band_idx];
-		if (!current_band)
-			continue;
-
-		for (channel_idx = 0; channel_idx < current_band->n_channels;
-		      channel_idx++) {
-			current_channel = &current_band->channels[channel_idx];
-
-			if (channel_freq == current_channel->center_freq) {
-				if (current_channel->flags &
-				    IEEE80211_CHAN_DISABLED)
-					return -EINVAL;
-
-				if (reg_power)
-					*reg_power =
-						current_channel->max_reg_power;
-				if (antenna_max)
-					*antenna_max =
-						current_channel->
-						max_antenna_gain;
-
-				switch (bandwidth) {
-				case 0:
-					if (current_channel->flags &
-					    IEEE80211_CHAN_NO_10MHZ)
-						bandwidth = 5;
-					else if (current_channel->flags &
-						 IEEE80211_CHAN_NO_20MHZ)
-						bandwidth = 10;
-					else
-						bandwidth = 20;
-					break;
-				case 5:
-					break;
-				case 10:
-					if (current_channel->flags &
-					    IEEE80211_CHAN_NO_10MHZ)
-						return -EINVAL;
-					break;
-				case 20:
-					if (current_channel->flags &
-					    IEEE80211_CHAN_NO_20MHZ)
-						return -EINVAL;
-					break;
-				default:
-					return -EINVAL;
-				}
-
-				if (tx_power > current_channel->max_power)
-					return -EINVAL;
-
-				return 0;
-			}
-		}
-	}
-
-	return -EINVAL;
-}
-
-/**
- * hdd_ocb_validate_config() - Validates the config data
- * @config: configuration to be validated
- *
- * Return: 0 on success.
- */
-static int hdd_ocb_validate_config(hdd_adapter_t *adapter,
-				   struct sir_ocb_config *config)
-{
-	int i;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-
-	for (i = 0; i < config->channel_count; i++) {
-		if (dot11p_validate_channel(hdd_ctx->wiphy,
-					    config->channels[i].chan_freq,
-					    config->channels[i].bandwidth,
-					    config->channels[i].max_pwr,
-					    &config->channels[i].reg_pwr,
-					    &config->channels[i].antenna_max)) {
-			hddLog(LOGE, FL("Invalid channel frequency %d"),
-				config->channels[i].chan_freq);
-			return -EINVAL;
-		}
-		if (dot11p_validate_qos_params(config->channels[i].qos_params))
-			return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * hdd_ocb_register_sta() - Register station with Transport Layer
- * @adapter: Pointer to HDD Adapter
- *
- * This function should be invoked in the OCB Set Schedule callback
- * to enable the data path in the TL by calling RegisterSTAClient
- *
- * Return: 0 on success. -1 on failure.
- */
-static int hdd_ocb_register_sta(hdd_adapter_t *adapter)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	struct ol_txrx_desc_type sta_desc = {0};
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-	uint8_t peer_id;
-
-	cdf_status = ol_txrx_register_ocb_peer(hdd_ctx->pcds_context,
-					       adapter->macAddressCurrent.bytes,
-					       &peer_id);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGE, FL("Error registering OCB Self Peer!"));
-		return -EINVAL;
-	}
-
-	hdd_ctx->sta_to_adapter[peer_id] = adapter;
-
-	sta_desc.sta_id = peer_id;
-	sta_desc.is_qos_enabled = 1;
-
-	cdf_status = ol_txrx_register_peer(hdd_rx_packet_cbk,
-						&sta_desc);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(LOGE, FL("Failed to register. Status= %d [0x%08X]"),
-		       cdf_status, cdf_status);
-		return -EINVAL;
-	}
-
-	if (pHddStaCtx->conn_info.staId[0] != 0 &&
-	     pHddStaCtx->conn_info.staId[0] != peer_id) {
-		hddLog(LOGE, FL("The ID for the OCB station has changed."));
-	}
-
-	pHddStaCtx->conn_info.staId[0] = peer_id;
-	cdf_copy_macaddr(&pHddStaCtx->conn_info.peerMacAddress[0],
-			 &adapter->macAddressCurrent);
-
-	return 0;
-}
-
-/**
- * hdd_ocb_config_new() - Creates a new OCB configuration
- * @num_channels: the number of channels
- * @num_schedule: the schedule size
- * @ndl_chan_list_len: length in bytes of the NDL chan blob
- * @ndl_active_state_list_len: length in bytes of the active state blob
- *
- * Return: A pointer to the OCB configuration struct, NULL on failure.
- */
-static struct sir_ocb_config *hdd_ocb_config_new(int num_channels,
-						 int num_schedule,
-						 int ndl_chan_list_len,
-						 int ndl_active_state_list_len)
-{
-	struct sir_ocb_config *ret = 0;
-	uint32_t len;
-	void *cursor;
-
-	if (num_channels > CFG_TGT_NUM_OCB_CHANNELS ||
-			num_schedule > CFG_TGT_NUM_OCB_SCHEDULES)
-		return NULL;
-
-	len = sizeof(*ret) +
-		num_channels * sizeof(struct sir_ocb_config_channel) +
-		num_schedule * sizeof(struct sir_ocb_config_sched) +
-		ndl_chan_list_len +
-		ndl_active_state_list_len;
-
-	cursor = cdf_mem_malloc(len);
-	if (!cursor)
-		goto fail;
-
-	cdf_mem_zero(cursor, len);
-	ret = cursor;
-	cursor += sizeof(*ret);
-
-	ret->channel_count = num_channels;
-	ret->channels = cursor;
-	cursor += num_channels * sizeof(*ret->channels);
-
-	ret->schedule_size = num_schedule;
-	ret->schedule = cursor;
-	cursor += num_schedule * sizeof(*ret->schedule);
-
-	ret->dcc_ndl_chan_list = cursor;
-	cursor += ndl_chan_list_len;
-
-	ret->dcc_ndl_active_state_list = cursor;
-	cursor += ndl_active_state_list_len;
-
-	return ret;
-
-fail:
-	cdf_mem_free(ret);
-	return NULL;
-}
-
-/**
- * hdd_ocb_set_config_callback() - OCB set config callback function
- * @context_ptr: OCB call context
- * @response_ptr: Pointer to response structure
- *
- * This function is registered as a callback with the lower layers
- * and is used to respond with the status of a OCB set config command.
- */
-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;
-
-	if (!context)
-		return;
-
-	if (resp && resp->status)
-		hddLog(LOGE, FL("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;
-		}
-
-		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)) {
-				netif_carrier_on(adapter->dev);
-				netif_tx_start_all_queues(
-				    adapter->dev);
-			}
-		}
-
-		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_ocb_set_config_req() - Send an OCB set config request
- * @adapter: a pointer to the adapter
- * @config: a pointer to the OCB configuration
- *
- * Return: 0 on success.
- */
-static int hdd_ocb_set_config_req(hdd_adapter_t *adapter,
-				  struct sir_ocb_config *config)
-{
-	int rc;
-	CDF_STATUS cdf_status;
-	struct hdd_ocb_ctxt context = {0};
-
-	if (hdd_ocb_validate_config(adapter, config)) {
-		hddLog(LOGE, FL("The configuration is invalid"));
-		return -EINVAL;
-	}
-
-	init_completion(&context.completion_evt);
-	context.adapter = adapter;
-	context.magic = HDD_OCB_MAGIC;
-
-	hddLog(LOG1, FL("Disabling queues"));
-	netif_tx_disable(adapter->dev);
-	netif_carrier_off(adapter->dev);
-
-	/* Call the SME API to set the config */
-	cdf_status = sme_ocb_set_config(
-		((hdd_context_t *)adapter->pHddCtx)->hHal, &context,
-		hdd_ocb_set_config_callback, config);
-	if (cdf_status != CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("Error calling SME function."));
-		/* Convert from ecdf_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) {
-		rc = -ETIMEDOUT;
-		goto end;
-	}
-	rc = 0;
-
-	if (context.status) {
-		rc = context.status;
-		goto end;
-	}
-
-	if (adapter->ocb_set_config_resp.status) {
-		rc = -EINVAL;
-		goto end;
-	}
-
-	/* fall through */
-end:
-	spin_lock(&hdd_context_lock);
-	context.magic = 0;
-	spin_unlock(&hdd_context_lock);
-	if (rc)
-		hddLog(LOGE, FL("Operation failed: %d"), rc);
-	return rc;
-}
-
-/**
- * __iw_set_dot11p_channel_sched() - Handler for WLAN_SET_DOT11P_CHANNEL_SCHED
- *				     ioctl
- * @dev: Pointer to net_device structure
- * @iw_request_info: IW Request Info
- * @wrqu: IW Request Userspace Data Pointer
- * @extra: IW Request Kernel Data Pointer
- *
- * Return: 0 on success
- */
-static int __iw_set_dot11p_channel_sched(struct net_device *dev,
-					 struct iw_request_info *info,
-					 union iwreq_data *wrqu, char *extra)
-{
-	int rc = 0;
-	struct dot11p_channel_sched *sched;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	struct sir_ocb_config *config = NULL;
-	uint8_t *mac_addr;
-	int i, j;
-	struct sir_ocb_config_channel *curr_chan;
-
-	if (wlan_hdd_validate_context(WLAN_HDD_GET_CTX(adapter))) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	sched = (struct dot11p_channel_sched *)extra;
-
-	/* Scheduled slots same as num channels for compatibility */
-	config = hdd_ocb_config_new(sched->num_channels, sched->num_channels,
-				    0, 0);
-	if (config == NULL) {
-		hddLog(LOGE, FL("Failed to allocate memory!"));
-		return -ENOMEM;
-	}
-
-	/* Identify the vdev interface */
-	config->session_id = adapter->sessionId;
-
-	/* Release all the mac addresses used for OCB */
-	for (i = 0; i < adapter->ocb_mac_addr_count; i++) {
-		wlan_hdd_release_intf_addr(adapter->pHddCtx,
-					   adapter->ocb_mac_address[i].bytes);
-	}
-	adapter->ocb_mac_addr_count = 0;
-
-	config->channel_count = 0;
-	for (i = 0; i < sched->num_channels; i++) {
-		if (0 == sched->channels[i].channel_freq)
-			continue;
-
-		curr_chan = &(config->channels[config->channel_count]);
-
-		curr_chan->chan_freq = sched->channels[i].channel_freq;
-		/*
-		 * tx_power is divided by 2 because ocb_channel.tx_power is
-		 * in half dB increments and sir_ocb_config_channel.max_pwr
-		 * is in 1 dB increments.
-		 */
-		curr_chan->max_pwr = sched->channels[i].tx_power / 2;
-		curr_chan->bandwidth = sched->channels[i].channel_bandwidth;
-		/* assume 10 as default if not provided */
-		if (curr_chan->bandwidth == 0)
-			curr_chan->bandwidth = 10;
-
-		/*
-		 * Setup locally administered mac addresses for each channel.
-		 * First channel uses the adapter's address.
-		 */
-		if (i == 0) {
-			cdf_copy_macaddr(&curr_chan->mac_address,
-				     &adapter->macAddressCurrent);
-		} else {
-			mac_addr = wlan_hdd_get_intf_addr(adapter->pHddCtx);
-			if (mac_addr == NULL) {
-				hddLog(LOGE, FL("Cannot obtain mac address"));
-				rc = -EINVAL;
-				goto fail;
-			}
-			cdf_mem_copy(config->channels[
-				     config->channel_count].mac_address.bytes,
-				     mac_addr, sizeof(tSirMacAddr));
-			/* Save the mac address to release later */
-			cdf_mem_copy(adapter->ocb_mac_address[
-				     adapter->ocb_mac_addr_count].bytes,
-				     mac_addr, CDF_MAC_ADDR_SIZE);
-			adapter->ocb_mac_addr_count++;
-		}
-
-		for (j = 0; j < MAX_NUM_AC; j++) {
-			curr_chan->qos_params[j].aifsn =
-				sched->channels[i].qos_params[j].aifsn;
-			curr_chan->qos_params[j].cwmin =
-				sched->channels[i].qos_params[j].cwmin;
-			curr_chan->qos_params[j].cwmax =
-				sched->channels[i].qos_params[j].cwmax;
-		}
-
-		config->channel_count++;
-	}
-
-	/*
-	 * Scheduled slots same as num channels for compatibility with
-	 * legacy use.
-	 */
-	for (i = 0; i < sched->num_channels; i++) {
-		config->schedule[i].chan_freq = sched->channels[i].channel_freq;
-		config->schedule[i].guard_interval =
-			sched->channels[i].start_guard_interval;
-		config->schedule[i].total_duration =
-			sched->channels[i].duration;
-	}
-
-	rc = hdd_ocb_set_config_req(adapter, config);
-	if (rc) {
-		hddLog(LOGE, FL("Error while setting OCB config"));
-		goto fail;
-	}
-
-	rc = 0;
-
-fail:
-	cdf_mem_free(config);
-	return rc;
-}
-
-/**
- * iw_set_dot11p_channel_sched() - IOCTL interface for setting channel schedule
- * @dev: Pointer to net_device structure
- * @iw_request_info: IW Request Info
- * @wrqu: IW Request Userspace Data Pointer
- * @extra: IW Request Kernel Data Pointer
- *
- * Return: 0 on success.
- */
-int iw_set_dot11p_channel_sched(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_dot11p_channel_sched(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-static const struct nla_policy qca_wlan_vendor_ocb_set_config_policy[
-		QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_COUNT] = {
-		.type = NLA_U32
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE] = {
-		.type = NLA_U32
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY] = {
-		.type = NLA_BINARY
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_ARRAY] = {
-		.type = NLA_BINARY
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY] = {
-		.type = NLA_BINARY
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY] = {
-		.type = NLA_BINARY
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS] = {
-		.type = NLA_U32
-	},
-};
-
-static const struct nla_policy qca_wlan_vendor_ocb_set_utc_time_policy[
-		QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_VALUE] = {
-		.type = NLA_BINARY, .len = SIZE_UTC_TIME
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_ERROR] = {
-		.type = NLA_BINARY, .len = SIZE_UTC_TIME_ERROR
-	},
-};
-
-static const struct nla_policy qca_wlan_vendor_ocb_start_timing_advert_policy[
-		QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_CHANNEL_FREQ] = {
-		.type = NLA_U32
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_REPEAT_RATE] = {
-		.type = NLA_U32
-	},
-};
-
-static const struct nla_policy  qca_wlan_vendor_ocb_stop_timing_advert_policy[
-		QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_CHANNEL_FREQ] = {
-		.type = NLA_U32
-	},
-};
-
-static const struct nla_policy qca_wlan_vendor_ocb_get_tsf_timer_resp[] = {
-	[QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_HIGH] = {
-		.type = NLA_U32
-	},
-	[QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_LOW] = {
-		.type = NLA_U32
-	},
-};
-
-static const struct nla_policy qca_wlan_vendor_dcc_get_stats[] = {
-	[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_CHANNEL_COUNT] = {
-		.type = NLA_U32
-	},
-	[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_REQUEST_ARRAY] = {
-		.type = NLA_BINARY
-	},
-};
-
-static const struct nla_policy qca_wlan_vendor_dcc_get_stats_resp[] = {
-	[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_CHANNEL_COUNT] = {
-		.type = NLA_U32
-	},
-	[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_STATS_ARRAY] = {
-		.type = NLA_BINARY
-	},
-};
-
-static const struct nla_policy qca_wlan_vendor_dcc_clear_stats[] = {
-	[QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_BITMAP] = {
-		.type = NLA_U32
-	},
-};
-
-static const struct nla_policy qca_wlan_vendor_dcc_update_ndl[
-		QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT] = {
-		.type = NLA_U32
-	},
-	[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY] = {
-		.type = NLA_BINARY
-	},
-	[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY] = {
-		.type = NLA_BINARY
-	},
-};
-
-/**
- * struct wlan_hdd_ocb_config_channel
- * @chan_freq: frequency of the channel
- * @bandwidth: bandwidth of the channel, either 10 or 20 MHz
- * @mac_address: MAC address assigned to this channel
- * @qos_params: QoS parameters
- * @max_pwr: maximum transmit power of the channel (1/2 dBm)
- * @min_pwr: minimum transmit power of the channel (1/2 dBm)
- */
-struct wlan_hdd_ocb_config_channel {
-	uint32_t chan_freq;
-	uint32_t bandwidth;
-	uint16_t flags;
-	uint8_t reserved[4];
-	struct sir_qos_params qos_params[MAX_NUM_AC];
-	uint32_t max_pwr;
-	uint32_t min_pwr;
-};
-
-static void wlan_hdd_ocb_config_channel_to_sir_ocb_config_channel(
-	struct sir_ocb_config_channel *dest,
-	struct wlan_hdd_ocb_config_channel *src,
-	uint32_t channel_count)
-{
-	uint32_t i;
-
-	cdf_mem_zero(dest, channel_count * sizeof(*dest));
-
-	for (i = 0; i < channel_count; i++) {
-		dest[i].chan_freq = src[i].chan_freq;
-		dest[i].bandwidth = src[i].bandwidth;
-		cdf_mem_copy(dest[i].qos_params, src[i].qos_params,
-			     sizeof(dest[i].qos_params));
-		/*
-		 *  max_pwr and min_pwr are divided by 2 because
-		 *  wlan_hdd_ocb_config_channel.max_pwr and min_pwr
-		 *  are in 1/2 dB increments and
-		 *  sir_ocb_config_channel.max_pwr and min_pwr are in
-		 *  1 dB increments.
-		 */
-		dest[i].max_pwr = src[i].max_pwr / 2;
-		dest[i].min_pwr = (src[i].min_pwr + 1) / 2;
-		dest[i].flags = src[i].flags;
-	}
-}
-
-/**
- * __wlan_hdd_cfg80211_ocb_set_config() - Interface for set config command
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
-					      struct wireless_dev *wdev,
-					      const void *data,
-					      int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX + 1];
-	struct nlattr *channel_array;
-	struct nlattr *sched_array;
-	struct nlattr *ndl_chan_list;
-	uint32_t ndl_chan_list_len;
-	struct nlattr *ndl_active_state_list;
-	uint32_t ndl_active_state_list_len;
-	uint32_t flags = 0;
-	int i;
-	int channel_count, schedule_size;
-	struct sir_ocb_config *config;
-	int rc = -EINVAL;
-	uint8_t *mac_addr;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	/* Parse the netlink message */
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX,
-			data,
-			data_len, qca_wlan_vendor_ocb_set_config_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	/* Get the number of channels in the schedule */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_COUNT]) {
-		hddLog(LOGE, FL("CHANNEL_COUNT is not present"));
-		return -EINVAL;
-	}
-	channel_count = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_COUNT]);
-
-	/* Get the size of the channel schedule */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE]) {
-		hddLog(LOGE, FL("SCHEDULE_SIZE is not present"));
-		return -EINVAL;
-	}
-	schedule_size = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE]);
-
-	/* Get the ndl chan array and the ndl active state array. */
-	ndl_chan_list =
-		tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY];
-	ndl_chan_list_len = (ndl_chan_list ? nla_len(ndl_chan_list) : 0);
-
-	ndl_active_state_list =
-		tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY];
-	ndl_active_state_list_len = (ndl_active_state_list ?
-				    nla_len(ndl_active_state_list) : 0);
-
-	/* Get the flags */
-	if (tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS])
-		flags = nla_get_u32(tb[
-				QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS]);
-
-	config = hdd_ocb_config_new(channel_count, schedule_size,
-				    ndl_chan_list_len,
-				    ndl_active_state_list_len);
-	if (config == NULL) {
-		hddLog(LOGE, FL("Failed to allocate memory!"));
-		return -ENOMEM;
-	}
-
-	config->channel_count = channel_count;
-	config->schedule_size = schedule_size;
-	config->flags = flags;
-
-	/* Read the channel array */
-	channel_array = tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY];
-	if (!channel_array) {
-		hddLog(LOGE, FL("No channel present"));
-		goto fail;
-	}
-	if (nla_len(channel_array) != channel_count *
-	    sizeof(struct wlan_hdd_ocb_config_channel)) {
-		hddLog(LOGE, FL("CHANNEL_ARRAY is not the correct size"));
-		goto fail;
-	}
-	wlan_hdd_ocb_config_channel_to_sir_ocb_config_channel(
-	    config->channels, nla_data(channel_array), channel_count);
-
-	/* Identify the vdev interface */
-	config->session_id = adapter->sessionId;
-
-	/* Release all the mac addresses used for OCB */
-	for (i = 0; i < adapter->ocb_mac_addr_count; i++) {
-		wlan_hdd_release_intf_addr(adapter->pHddCtx,
-					   adapter->ocb_mac_address[i].bytes);
-	}
-	adapter->ocb_mac_addr_count = 0;
-
-	/*
-	 * Setup locally administered mac addresses for each channel.
-	 * First channel uses the adapter's address.
-	 */
-	for (i = 0; i < config->channel_count; i++) {
-		if (i == 0) {
-			cdf_copy_macaddr(&config->channels[i].mac_address,
-				&adapter->macAddressCurrent);
-		} else {
-			mac_addr = wlan_hdd_get_intf_addr(adapter->pHddCtx);
-			if (mac_addr == NULL) {
-				hddLog(LOGE, FL("Cannot obtain mac address"));
-				goto fail;
-			}
-			cdf_mem_copy(config->channels[i].mac_address.bytes,
-				mac_addr, CDF_MAC_ADDR_SIZE);
-			/* Save the mac address to release later */
-			cdf_copy_macaddr(&adapter->ocb_mac_address[
-				     adapter->ocb_mac_addr_count],
-				     &config->channels[i].mac_address);
-			adapter->ocb_mac_addr_count++;
-		}
-	}
-
-	/* Read the schedule array */
-	sched_array = tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_ARRAY];
-	if (!sched_array) {
-		hddLog(LOGE, FL("No channel present"));
-		goto fail;
-	}
-	if (nla_len(sched_array) != schedule_size * sizeof(*config->schedule)) {
-		hddLog(LOGE, FL("SCHEDULE_ARRAY is not the correct size"));
-		goto fail;
-	}
-	cdf_mem_copy(config->schedule, nla_data(sched_array),
-		nla_len(sched_array));
-
-	/* Copy the NDL chan array */
-	if (ndl_chan_list_len) {
-		config->dcc_ndl_chan_list_len = ndl_chan_list_len;
-		cdf_mem_copy(config->dcc_ndl_chan_list, nla_data(ndl_chan_list),
-			nla_len(ndl_chan_list));
-	}
-
-	/* Copy the NDL active state array */
-	if (ndl_active_state_list_len) {
-		config->dcc_ndl_active_state_list_len =
-			ndl_active_state_list_len;
-		cdf_mem_copy(config->dcc_ndl_active_state_list,
-			nla_data(ndl_active_state_list),
-			nla_len(ndl_active_state_list));
-	}
-
-	rc = hdd_ocb_set_config_req(adapter, config);
-	if (rc)
-		hddLog(LOGE, FL("Error while setting OCB config: %d"), rc);
-
-fail:
-	cdf_mem_free(config);
-	return rc;
-}
-
-/**
- * wlan_hdd_cfg80211_ocb_set_config() - Interface for set config command
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
-				     struct wireless_dev *wdev,
-				     const void *data,
-				     int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_set_config(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_ocb_set_utc_time() - Interface for set UTC time command
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int __wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy,
-						struct wireless_dev *wdev,
-						const void *data,
-						int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_MAX + 1];
-	struct nlattr *utc_attr;
-	struct nlattr *time_error_attr;
-	struct sir_ocb_utc *utc;
-	int rc = -EINVAL;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	if (!wma_is_vdev_up(adapter->sessionId)) {
-		hddLog(LOGE, FL("The device has not been started"));
-		return -EINVAL;
-	}
-
-	/* Parse the netlink message */
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_MAX,
-		      data,
-		      data_len, qca_wlan_vendor_ocb_set_utc_time_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	/* Read the UTC time */
-	utc_attr = tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_VALUE];
-	if (!utc_attr) {
-		hddLog(LOGE, FL("UTC_TIME is not present"));
-		return -EINVAL;
-	}
-	if (nla_len(utc_attr) != SIZE_UTC_TIME) {
-		hddLog(LOGE, FL("UTC_TIME is not the correct size"));
-		return -EINVAL;
-	}
-
-	/* Read the time error */
-	time_error_attr = tb[QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_ERROR];
-	if (!time_error_attr) {
-		hddLog(LOGE, FL("UTC_TIME is not present"));
-		return -EINVAL;
-	}
-	if (nla_len(time_error_attr) != SIZE_UTC_TIME_ERROR) {
-		hddLog(LOGE, FL("UTC_TIME is not the correct size"));
-		return -EINVAL;
-	}
-
-	utc = cdf_mem_malloc(sizeof(*utc));
-	if (!utc) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-	utc->vdev_id = adapter->sessionId;
-	cdf_mem_copy(utc->utc_time, nla_data(utc_attr), SIZE_UTC_TIME);
-	cdf_mem_copy(utc->time_error, nla_data(time_error_attr),
-		SIZE_UTC_TIME_ERROR);
-
-	if (sme_ocb_set_utc_time(hdd_ctx->hHal, utc) != CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("Error while setting UTC time"));
-		rc = -EINVAL;
-	} else {
-		rc = 0;
-	}
-
-	cdf_mem_free(utc);
-	return rc;
-}
-
-/**
- * wlan_hdd_cfg80211_ocb_set_utc_time() - Interface for the set UTC time command
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy,
-				       struct wireless_dev *wdev,
-				       const void *data,
-				       int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_set_utc_time(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_ocb_start_timing_advert() - Interface for start TA cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int
-__wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
-					    struct wireless_dev *wdev,
-					    const void *data,
-					    int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_MAX + 1];
-	struct sir_ocb_timing_advert *timing_advert;
-	int rc = -EINVAL;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	if (!wma_is_vdev_up(adapter->sessionId)) {
-		hddLog(LOGE, FL("The device has not been started"));
-		return -EINVAL;
-	}
-
-	timing_advert = cdf_mem_malloc(sizeof(*timing_advert));
-	if (!timing_advert) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-	cdf_mem_zero(timing_advert, sizeof(*timing_advert));
-	timing_advert->vdev_id = adapter->sessionId;
-
-	/* Parse the netlink message */
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_MAX,
-		      data,
-		      data_len,
-		      qca_wlan_vendor_ocb_start_timing_advert_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		goto fail;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_CHANNEL_FREQ]) {
-		hddLog(LOGE, FL("CHANNEL_FREQ is not present"));
-		goto fail;
-	}
-	timing_advert->chan_freq = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_CHANNEL_FREQ]);
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_REPEAT_RATE]) {
-		hddLog(LOGE, FL("REPEAT_RATE is not present"));
-		goto fail;
-	}
-	timing_advert->repeat_rate = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_REPEAT_RATE]);
-
-	timing_advert->template_length =
-		sme_ocb_gen_timing_advert_frame(hdd_ctx->hHal,
-			*(tSirMacAddr *)&adapter->macAddressCurrent.bytes,
-			&timing_advert->template_value,
-			&timing_advert->timestamp_offset,
-			&timing_advert->time_value_offset);
-	if (timing_advert->template_length <= 0) {
-		hddLog(LOGE, FL("Error while generating the TA frame"));
-		goto fail;
-	}
-
-	if (sme_ocb_start_timing_advert(hdd_ctx->hHal, timing_advert) !=
-			CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("Error while starting timing advert"));
-		rc = -EINVAL;
-	} else {
-		rc = 0;
-	}
-
-fail:
-	if (timing_advert->template_value)
-		cdf_mem_free(timing_advert->template_value);
-	cdf_mem_free(timing_advert);
-	return rc;
-}
-
-/**
- * wlan_hdd_cfg80211_ocb_start_timing_advert() - Interface for the start TA cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
-					      struct wireless_dev *wdev,
-					      const void *data,
-					      int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_start_timing_advert(wiphy, wdev,
-							  data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_ocb_stop_timing_advert() - Interface for the stop TA cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int
-__wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   const void *data,
-					   int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_MAX + 1];
-	struct sir_ocb_timing_advert *timing_advert;
-	int rc = -EINVAL;
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	if (!wma_is_vdev_up(adapter->sessionId)) {
-		hddLog(LOGE, FL("The device has not been started"));
-		return -EINVAL;
-	}
-
-	timing_advert = cdf_mem_malloc(sizeof(*timing_advert));
-	if (!timing_advert) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-	cdf_mem_zero(timing_advert, sizeof(sizeof(*timing_advert)));
-	timing_advert->vdev_id = adapter->sessionId;
-
-	/* Parse the netlink message */
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_MAX,
-		      data,
-		      data_len,
-		      qca_wlan_vendor_ocb_stop_timing_advert_policy)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		goto fail;
-	}
-
-	if (!tb[QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_CHANNEL_FREQ]) {
-		hddLog(LOGE, FL("CHANNEL_FREQ is not present"));
-		goto fail;
-	}
-	timing_advert->chan_freq = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_CHANNEL_FREQ]);
-
-	if (sme_ocb_stop_timing_advert(hdd_ctx->hHal, timing_advert) !=
-			CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("Error while stopping timing advert"));
-		rc = -EINVAL;
-	} else {
-		rc = 0;
-	}
-
-fail:
-	cdf_mem_free(timing_advert);
-	return rc;
-}
-
-/**
- * wlan_hdd_cfg80211_ocb_stop_timing_advert() - Interface for the stop TA cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data,
-					     int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_stop_timing_advert(wiphy, wdev,
-							 data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_ocb_get_tsf_timer_callback() - Callback to get TSF command
- * @context_ptr: request context
- * @response_ptr: response data
- */
-static void hdd_ocb_get_tsf_timer_callback(void *context_ptr,
-					   void *response_ptr)
-{
-	struct hdd_ocb_ctxt *context = context_ptr;
-	struct sir_ocb_get_tsf_timer_response *response = response_ptr;
-
-	if (!context)
-		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);
-	}
-	spin_unlock(&hdd_context_lock);
-}
-
-/**
- * __wlan_hdd_cfg80211_ocb_get_tsf_timer() - Interface for get TSF timer cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int
-__wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy,
-				      struct wireless_dev *wdev,
-				      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;
-	struct sir_ocb_get_tsf_timer request = {0};
-	struct hdd_ocb_ctxt context = {0};
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	if (!wma_is_vdev_up(adapter->sessionId)) {
-		hddLog(LOGE, FL("The device has not been started"));
-		return -EINVAL;
-	}
-
-	/* Initialize the callback context */
-	init_completion(&context.completion_evt);
-	context.adapter = adapter;
-	context.magic = HDD_OCB_MAGIC;
-
-	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) {
-		hddLog(LOGE, FL("Error calling SME function"));
-		/* Need to convert from ecdf_status to errno. */
-		return -EINVAL;
-	}
-
-	rc = wait_for_completion_timeout(&context.completion_evt,
-		msecs_to_jiffies(WLAN_WAIT_TIME_OCB_CMD));
-	if (rc == 0) {
-		hddLog(LOGE, FL("Operation timed out"));
-		rc = -ETIMEDOUT;
-		goto end;
-	}
-	rc = 0;
-
-	if (context.status) {
-		hddLog(LOGE, FL("Operation failed: %d"), context.status);
-		rc = context.status;
-		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) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		rc = -ENOMEM;
-		goto end;
-	}
-
-	hddLog(LOGE, FL("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;
-
-	/* Send the response. */
-	rc = cfg80211_vendor_cmd_reply(nl_resp);
-	nl_resp = NULL;
-	if (rc) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_reply failed: %d"), rc);
-		goto end;
-	}
-
-end:
-	spin_lock(&hdd_context_lock);
-	context.magic = 0;
-	spin_unlock(&hdd_context_lock);
-	if (nl_resp)
-		kfree_skb(nl_resp);
-	return rc;
-}
-
-/**
- * wlan_hdd_cfg80211_ocb_get_tsf_timer() - Interface for get TSF timer cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ocb_get_tsf_timer(wiphy, wdev,
-						    data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_dcc_get_stats_callback() - Callback to get stats command
- * @context_ptr: request context
- * @response_ptr: response data
- */
-static void hdd_dcc_get_stats_callback(void *context_ptr, void *response_ptr)
-{
-	struct hdd_ocb_ctxt *context = context_ptr;
-	struct sir_dcc_get_stats_response *response = response_ptr;
-	struct sir_dcc_get_stats_response *hdd_resp;
-
-	if (!context)
-		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) {
-				cdf_mem_free(
-				    context->adapter->dcc_get_stats_resp);
-			}
-			context->adapter->dcc_get_stats_resp =
-				cdf_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);
-				cdf_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);
-	}
-	spin_unlock(&hdd_context_lock);
-}
-
-/**
- * __wlan_hdd_cfg80211_dcc_get_stats() - Interface for get dcc stats
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data,
-					     int data_len)
-{
-	uint32_t channel_count = 0;
-	uint32_t request_array_len = 0;
-	void *request_array = 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);
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_MAX + 1];
-	struct sk_buff *nl_resp = 0;
-	int rc = -EINVAL;
-	struct sir_dcc_get_stats request = {0};
-	struct hdd_ocb_ctxt context = {0};
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	if (!wma_is_vdev_up(adapter->sessionId)) {
-		hddLog(LOGE, FL("The device has not been started"));
-		return -EINVAL;
-	}
-
-	/* Parse the netlink message */
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_MAX,
-		      data,
-		      data_len,
-		      qca_wlan_vendor_dcc_get_stats)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	/* Validate all the parameters are present */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_CHANNEL_COUNT] ||
-	    !tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_REQUEST_ARRAY]) {
-		hddLog(LOGE, FL("Parameters are not present."));
-		return -EINVAL;
-	}
-
-	channel_count = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_CHANNEL_COUNT]);
-	request_array_len = nla_len(
-		tb[QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_REQUEST_ARRAY]);
-	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;
-
-	request.vdev_id = adapter->sessionId;
-	request.channel_count = channel_count;
-	request.request_array_len = request_array_len;
-	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) {
-		hddLog(LOGE, FL("Error calling SME function"));
-		/* Need to convert from cdf_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) {
-		hddLog(LOGE, FL("Operation failed: %d"), rc);
-		rc = -ETIMEDOUT;
-		goto end;
-	}
-
-	if (context.status) {
-		hddLog(LOGE, FL("There was error: %d"), context.status);
-		rc = context.status;
-		goto end;
-	}
-
-	if (!adapter->dcc_get_stats_resp) {
-		hddLog(LOGE, FL("The response was NULL"));
-		rc = -EINVAL;
-		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) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		rc = -ENOMEM;
-		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;
-	if (rc) {
-		hddLog(LOGE, FL("cfg80211_vendor_cmd_reply failed: %d"), rc);
-		goto end;
-	}
-
-	/* fall through */
-end:
-	spin_lock(&hdd_context_lock);
-	context.magic = 0;
-	cdf_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);
-	return rc;
-}
-
-/**
- * wlan_hdd_cfg80211_dcc_get_stats() - Interface for get dcc stats
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy,
-				    struct wireless_dev *wdev,
-				    const void *data,
-				    int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dcc_get_stats(wiphy, wdev,
-						data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_dcc_clear_stats() - Interface for clear dcc stats cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int __wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy,
-					       struct wireless_dev *wdev,
-					       const void *data,
-					       int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(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_CLEAR_STATS_MAX + 1];
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		return -EINVAL;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		return -EINVAL;
-	}
-
-	if (!wma_is_vdev_up(adapter->sessionId)) {
-		hddLog(LOGE, FL("The device has not been started"));
-		return -EINVAL;
-	}
-
-	/* Parse the netlink message */
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_MAX,
-		      data,
-		      data_len,
-		      qca_wlan_vendor_dcc_clear_stats)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		return -EINVAL;
-	}
-
-	/* Verify that the parameter is present */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_BITMAP]) {
-		hddLog(LOGE, FL("Parameters are not present."));
-		return -EINVAL;
-	}
-
-	/* Call the SME function */
-	if (sme_dcc_clear_stats(hdd_ctx->hHal, adapter->sessionId,
-		nla_get_u32(
-			tb[QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_BITMAP])) !=
-			CDF_STATUS_SUCCESS) {
-		hddLog(LOGE, FL("Error calling SME function."));
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_dcc_clear_stats() - Interface for clear dcc stats cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy,
-				      struct wireless_dev *wdev,
-				      const void *data,
-				      int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dcc_clear_stats(wiphy, wdev,
-						  data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_dcc_update_ndl_callback() - Callback to update NDL command
- * @context_ptr: request context
- * @response_ptr: response data
- */
-static void hdd_dcc_update_ndl_callback(void *context_ptr, void *response_ptr)
-{
-	struct hdd_ocb_ctxt *context = context_ptr;
-	struct sir_dcc_update_ndl_response *response = response_ptr;
-
-	if (!context)
-		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);
-}
-
-/**
- * __wlan_hdd_cfg80211_dcc_update_ndl() - Interface for update dcc cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy,
-					      struct wireless_dev *wdev,
-					      const void *data,
-					      int data_len)
-{
-	hdd_context_t *hdd_ctx = wiphy_priv(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_UPDATE_NDL_MAX + 1];
-	struct sir_dcc_update_ndl request;
-	uint32_t channel_count;
-	uint32_t ndl_channel_array_len;
-	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};
-
-	ENTER();
-
-	if (wlan_hdd_validate_context(hdd_ctx)) {
-		hddLog(LOGE, FL("HDD context is not valid"));
-		goto end;
-	}
-
-	if (adapter->device_mode != WLAN_HDD_OCB) {
-		hddLog(LOGE, FL("Device not in OCB mode!"));
-		goto end;
-	}
-
-	if (!wma_is_vdev_up(adapter->sessionId)) {
-		hddLog(LOGE, FL("The device has not been started"));
-		return -EINVAL;
-	}
-
-	/* Parse the netlink message */
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX,
-		      data,
-		      data_len,
-		      qca_wlan_vendor_dcc_update_ndl)) {
-		hddLog(LOGE, FL("Invalid ATTR"));
-		goto end;
-	}
-
-	/* Verify that the parameter is present */
-	if (!tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT] ||
-	    !tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY] ||
-	    !tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY]) {
-		hddLog(LOGE, FL("Parameters are not present."));
-		return -EINVAL;
-	}
-
-	channel_count = nla_get_u32(
-		tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT]);
-	ndl_channel_array_len = nla_len(
-		tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY]);
-	ndl_channel_array = nla_data(
-		tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY]);
-	ndl_active_state_array_len = nla_len(
-		tb[QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY]);
-	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;
-
-	/* Copy the parameters to the request structure. */
-	request.vdev_id = adapter->sessionId;
-	request.channel_count = channel_count;
-	request.dcc_ndl_chan_list_len = ndl_channel_array_len;
-	request.dcc_ndl_chan_list = ndl_channel_array;
-	request.dcc_ndl_active_state_list_len = ndl_active_state_array_len;
-	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) {
-		hddLog(LOGE, FL("Error calling SME function."));
-		/* Convert from cdf_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) {
-		hddLog(LOGE, FL("Operation timed out"));
-		rc = -ETIMEDOUT;
-		goto end;
-	}
-	rc = 0;
-
-	if (context.status) {
-		hddLog(LOGE, FL("Operation failed: %d"), context.status);
-		rc = context.status;
-		goto end;
-	}
-
-	if (adapter->dcc_update_ndl_resp.status) {
-		hddLog(LOGE, FL("Operation returned: %d"),
-		       adapter->dcc_update_ndl_resp.status);
-		rc = -EINVAL;
-		goto end;
-	}
-
-	/* fall through */
-end:
-	spin_lock(&hdd_context_lock);
-	context.magic = 0;
-	spin_unlock(&hdd_context_lock);
-	return rc;
-}
-
-/**
- * wlan_hdd_cfg80211_dcc_update_ndl() - Interface for update dcc cmd
- * @wiphy: pointer to the wiphy
- * @wdev: pointer to the wdev
- * @data: The netlink data
- * @data_len: The length of the netlink data in bytes
- *
- * Return: 0 on success.
- */
-int wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy,
-				     struct wireless_dev *wdev,
-				     const void *data,
-				     int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dcc_update_ndl(wiphy, wdev,
-						 data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_dcc_stats_event_callback() - Callback to get stats event
- * @context_ptr: request context
- * @response_ptr: response data
- */
-static void wlan_hdd_dcc_stats_event_callback(void *context_ptr,
-					      void *response_ptr)
-{
-	hdd_context_t *hdd_ctx = (hdd_context_t *)context_ptr;
-	struct sir_dcc_get_stats_response *resp = response_ptr;
-	struct sk_buff *vendor_event;
-
-	ENTER();
-
-	vendor_event =
-		cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
-			NULL, sizeof(uint32_t) + resp->channel_stats_array_len +
-			NLMSG_HDRLEN,
-			QCA_NL80211_VENDOR_SUBCMD_DCC_STATS_EVENT_INDEX,
-			GFP_KERNEL);
-
-	if (!vendor_event) {
-		hddLog(LOGE, FL("cfg80211_vendor_event_alloc failed"));
-		return;
-	}
-
-	if (nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_CHANNEL_COUNT,
-			resp->num_channels) ||
-		nla_put(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_STATS_ARRAY,
-			resp->channel_stats_array_len,
-			resp->channel_stats_array)) {
-		hddLog(LOGE, FL("nla put failed"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	cfg80211_vendor_event(vendor_event, GFP_KERNEL);
-}
-
-/**
- * wlan_hdd_dcc_register_for_dcc_stats_event() - Register for dcc stats events
- * @hdd_ctx: hdd context
- */
-void wlan_hdd_dcc_register_for_dcc_stats_event(hdd_context_t *hdd_ctx)
-{
-	int rc;
-
-	rc = sme_register_for_dcc_stats_event(hdd_ctx->hHal, hdd_ctx,
-		wlan_hdd_dcc_stats_event_callback);
-	if (rc)
-		hddLog(LOGE, FL("Register callback failed: %d"), rc);
-}

+ 0 - 292
core/hdd/src/wlan_hdd_ocb.h

@@ -1,292 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifndef __WLAN_HDD_OCB_H
-#define __WLAN_HDD_OCB_H
-
-#include <net/iw_handler.h>
-#include "sir_api.h"
-
-#define WLAN_OCB_CHANNEL_MAX 5
-
-/**
- * struct ocb_qos_params - QoS Parameters for each AC
- * @aifsn:  Arbitration Inter-Frame Spacing
- * @cwmin:  Contention Window (Min)
- * @cwmax:  Contention Window (Max)
- */
-struct ocb_qos_params {
-	uint8_t aifsn;
-	uint8_t cwmin;
-	uint8_t cwmax;
-};
-
-/**
- * struct ocb_channel - Parameters for each OCB channel
- * @channel_freq:           Channel Center Frequency (MHz)
- * @duration:               Channel Duration (ms)
- * @start_guard_interval:   Start Guard Interval (ms)
- * @channel_bandwidth:      Channel Bandwidth (MHz)
- * @tx_power:               Transmit Power (1/2 dBm)
- * @tx_rate:                Transmit Data Rate (mbit)
- * @qos_params:             Array of QoS Parameters
- * @per_packet_rx_stats:    Enable per packet RX statistics
- */
-struct ocb_channel {
-	uint32_t channel_freq;
-	uint32_t duration;
-	uint32_t start_guard_interval;
-	uint32_t channel_bandwidth;
-	uint32_t tx_power;
-	uint32_t tx_rate;
-	struct ocb_qos_params qos_params[MAX_NUM_AC];
-	uint32_t per_packet_rx_stats;
-};
-
-/**
- * struct dot11p_channel_sched - OCB channel schedule
- * @num_channels:   Number of channels
- * @channels:       Array of channel parameters
- * @off_channel_tx: Enable off channel TX
- */
-struct dot11p_channel_sched {
-	uint32_t num_channels;
-	struct ocb_channel channels[WLAN_OCB_CHANNEL_MAX];
-	uint32_t off_channel_tx;
-};
-
-/**
- * enum qca_wlan_vendor_attr_ocb_set_config - vendor subcmd to set ocb config
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_COUNT:
- *	number of channels in the configuration
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE: size of the schedule
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY: array of channels
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_ARRAY:
- *	array of channels to be scheduled
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY:
- *	array of NDL channel information
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY:
- *	array of NDL active state configuration
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS:
- *	flag to set the absolute expiry
- */
-enum qca_wlan_vendor_attr_ocb_set_config {
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_COUNT,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_SIZE,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_CHANNEL_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_SCHEDULE_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_CHANNEL_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_NDL_ACTIVE_STATE_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_FLAGS,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_MAX =
-		QCA_WLAN_VENDOR_ATTR_OCB_SET_CONFIG_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_ocb_set_utc_time - vendor subcmd to set UTC time
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_VALUE:
- *	the UTC time as an array of 10 bytes
- * @QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_ERROR:
- *	the time error as an array of 5 bytes
- */
-enum qca_wlan_vendor_attr_ocb_set_utc_time {
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_VALUE,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_ERROR,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_MAX =
-		QCA_WLAN_VENDOR_ATTR_OCB_SET_UTC_TIME_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_ocb_start_timing_advert - vendor subcmd to start
-						       sending timing advert
-						       frames
- * @QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_CHANNEL_FREQ:
- *	channel frequency on which to send the frames
- * @QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_REPEAT_RATE:
- *	number of times the frame is sent in 5 seconds
- */
-enum qca_wlan_vendor_attr_ocb_start_timing_advert {
-	QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_CHANNEL_FREQ,
-	QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_REPEAT_RATE,
-	QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_MAX =
-		QCA_WLAN_VENDOR_ATTR_OCB_START_TIMING_ADVERT_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_ocb_stop_timing_advert - vendor subcmd to stop
- *						      timing advert
- * @QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_CHANNEL_FREQ:
- *	the channel frequency on which to stop the timing advert
- */
-enum qca_wlan_vendor_attr_ocb_stop_timing_advert {
-	QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_CHANNEL_FREQ,
-	QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_MAX =
-		QCA_WLAN_VENDOR_ATTR_OCB_STOP_TIMING_ADVERT_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_dcc_get_tsf_response - vendor subcmd to get TSF
- *						    timer value
- * @QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_HIGH:
- *      higher 32 bits of the timer
- * @QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_LOW:
- *      lower 32 bits of the timer
- */
-enum qca_wlan_vendor_attr_ocb_get_tsf_resp {
-	QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_HIGH,
-	QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_TIMER_LOW,
-	QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_MAX =
-		QCA_WLAN_VENDOR_ATTR_OCB_GET_TSF_RESP_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_dcc_get_stats - vendor subcmd to get
- *					     dcc stats
- * @QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_CHANNEL_COUNT:
- *      the number of channels in the request array
- * @QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_REQUEST_ARRAY
- *      array of the channel and information being requested
- */
-enum qca_wlan_vendor_attr_dcc_get_stats {
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_CHANNEL_COUNT,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_REQUEST_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_MAX =
-		QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_dcc_get_stats_resp - response event from get
- *						  dcc stats
- * @QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_CHANNEL_COUNT:
- *      the number of channels in the request array
- * @QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_STATS_ARRAY
- *      array of the information being requested
- */
-enum qca_wlan_vendor_attr_dcc_get_stats_resp {
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_CHANNEL_COUNT,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_STATS_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_MAX =
-		QCA_WLAN_VENDOR_ATTR_DCC_GET_STATS_RESP_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_dcc_clear_stats - vendor subcmd to clear DCC stats
- * @QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_BITMAP:
- *      mask of the type of stats to be cleared
- */
-enum qca_wlan_vendor_attr_dcc_clear_stats {
-	QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_BITMAP,
-	QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_MAX =
-		QCA_WLAN_VENDOR_ATTR_DCC_CLEAR_STATS_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_ocb_set_config - vendor subcmd to update dcc
- * @QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT:
- *	number of channels in the configuration
- * @QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY: the array of NDL
- *  channel info
- * @QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY: the array of
- *  NDL active states
- */
-enum qca_wlan_vendor_attr_dcc_update_ndl {
-	QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_INVALID = 0,
-	QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_COUNT,
-	QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_CHANNEL_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_ACTIVE_STATE_ARRAY,
-	QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST,
-	QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_MAX =
-		QCA_WLAN_VENDOR_ATTR_DCC_UPDATE_NDL_AFTER_LAST - 1,
-};
-
-void hdd_set_dot11p_config(hdd_context_t *hdd_ctx);
-
-void hdd_remove_ocb_tx_header(struct sk_buff *skb);
-
-int iw_set_dot11p_channel_sched(struct net_device *dev,
-				struct iw_request_info *info,
-				union iwreq_data *wrqu, char *extra);
-
-int wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy,
-				     struct wireless_dev *wdev,
-				     const void *data,
-				     int data_len);
-
-int wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy,
-				       struct wireless_dev *wdev,
-				       const void *data,
-				       int data_len);
-
-int wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy,
-					      struct wireless_dev *wdev,
-					      const void *data,
-					      int data_len);
-
-int wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy,
-					     struct wireless_dev *wdev,
-					     const void *data,
-					     int data_len);
-
-int wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len);
-
-int wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy,
-				    struct wireless_dev *wdev,
-				    const void *data,
-				    int data_len);
-
-int wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy,
-				      struct wireless_dev *wdev,
-				      const void *data,
-				      int data_len);
-
-int wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy,
-				     struct wireless_dev *wdev,
-				     const void *data,
-				     int data_len);
-
-void wlan_hdd_dcc_register_for_dcc_stats_event(hdd_context_t *hdd_ctx);
-
-#endif /* __WLAN_HDD_OCB_H */

+ 0 - 811
core/hdd/src/wlan_hdd_oemdata.c

@@ -1,811 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-#ifdef FEATURE_OEM_DATA_SUPPORT
-
-/**
- *  DOC: wlan_hdd_oemdata.c
- *
- *  Support for generic OEM Data Request handling
- *
- */
-
-#include <linux/version.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/wireless.h>
-#include <wlan_hdd_includes.h>
-#include <net/arp.h>
-#include "qwlan_version.h"
-#include "cds_utils.h"
-#include "wma.h"
-
-static struct hdd_context_s *p_hdd_ctx;
-
-/**
- * iw_get_oem_data_cap() - Get OEM Data Capabilities
- * @dev: net device upon which the request was received
- * @info: ioctl request information
- * @wrqu: ioctl request data
- * @extra: ioctl data payload
- *
- * This function gets the capability information for OEM Data Request
- * and Response.
- *
- * Return: 0 for success, negative errno value on failure
- */
-int iw_get_oem_data_cap(struct net_device *dev,
-			struct iw_request_info *info,
-			union iwreq_data *wrqu, char *extra)
-{
-	CDF_STATUS status;
-	t_iw_oem_data_cap oemDataCap;
-	t_iw_oem_data_cap *pHddOemDataCap;
-	hdd_adapter_t *pAdapter = (netdev_priv(dev));
-	hdd_context_t *pHddContext;
-	struct hdd_config *pConfig;
-	uint32_t numChannels;
-	uint8_t chanList[OEM_CAP_MAX_NUM_CHANNELS];
-	uint32_t i;
-	int ret;
-
-	ENTER();
-
-	pHddContext = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddContext);
-	if (0 != ret)
-		return ret;
-
-	pConfig = pHddContext->config;
-	if (!pConfig) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s:HDD configuration is null", __func__);
-		return -ENOENT;
-	}
-
-	do {
-		cdf_mem_zero(&oemDataCap, sizeof(oemDataCap));
-		strlcpy(oemDataCap.oem_target_signature, OEM_TARGET_SIGNATURE,
-			OEM_TARGET_SIGNATURE_LEN);
-		oemDataCap.oem_target_type = pHddContext->target_type;
-		oemDataCap.oem_fw_version = pHddContext->target_fw_version;
-		oemDataCap.driver_version.major = QWLAN_VERSION_MAJOR;
-		oemDataCap.driver_version.minor = QWLAN_VERSION_MINOR;
-		oemDataCap.driver_version.patch = QWLAN_VERSION_PATCH;
-		oemDataCap.driver_version.build = QWLAN_VERSION_BUILD;
-		oemDataCap.allowed_dwell_time_min =
-			pConfig->nNeighborScanMinChanTime;
-		oemDataCap.allowed_dwell_time_max =
-			pConfig->nNeighborScanMaxChanTime;
-		oemDataCap.curr_dwell_time_min =
-			sme_get_neighbor_scan_min_chan_time(pHddContext->hHal,
-							    pAdapter->sessionId);
-		oemDataCap.curr_dwell_time_max =
-			sme_get_neighbor_scan_max_chan_time(pHddContext->hHal,
-							    pAdapter->sessionId);
-		oemDataCap.supported_bands = pConfig->nBandCapability;
-
-		/* request for max num of channels */
-		numChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-		status = sme_get_cfg_valid_channels(pHddContext->hHal,
-						    &chanList[0], &numChannels);
-		if (CDF_STATUS_SUCCESS != status) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s:failed to get valid channel list",
-				  __func__);
-			return -ENOENT;
-		} else {
-			/* make sure num channels is not more than chan list array */
-			if (numChannels > OEM_CAP_MAX_NUM_CHANNELS) {
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_ERROR,
-					  "%s:Num of channels(%d) more than length(%d) of chanlist",
-					  __func__, numChannels,
-					  OEM_CAP_MAX_NUM_CHANNELS);
-				return -ENOMEM;
-			}
-
-			oemDataCap.num_channels = numChannels;
-			for (i = 0; i < numChannels; i++) {
-				oemDataCap.channel_list[i] = chanList[i];
-			}
-		}
-
-		pHddOemDataCap = (t_iw_oem_data_cap *) (extra);
-		cdf_mem_copy(pHddOemDataCap, &oemDataCap,
-			     sizeof(*pHddOemDataCap));
-	} while (0);
-
-	EXIT();
-	return 0;
-}
-
-/**
- * send_oem_reg_rsp_nlink_msg() - send oem registration response
- *
- * This function sends oem message to registered application process
- *
- * Return:  none
- */
-static void send_oem_reg_rsp_nlink_msg(void)
-{
-	struct sk_buff *skb;
-	struct nlmsghdr *nlh;
-	tAniMsgHdr *aniHdr;
-	uint8_t *buf;
-	uint8_t *numInterfaces;
-	uint8_t *deviceMode;
-	uint8_t *vdevId;
-	hdd_adapter_list_node_t *pAdapterNode = NULL;
-	hdd_adapter_list_node_t *pNext = NULL;
-	hdd_adapter_t *pAdapter = NULL;
-	CDF_STATUS status = 0;
-
-	/* OEM message is always to a specific process and cannot be a broadcast */
-	if (p_hdd_ctx->oem_pid == 0) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: invalid dest pid", __func__);
-		return;
-	}
-
-	skb = alloc_skb(NLMSG_SPACE(WLAN_NL_MAX_PAYLOAD), GFP_KERNEL);
-	if (skb == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: alloc_skb failed", __func__);
-		return;
-	}
-
-	nlh = (struct nlmsghdr *)skb->data;
-	nlh->nlmsg_pid = 0;     /* from kernel */
-	nlh->nlmsg_flags = 0;
-	nlh->nlmsg_seq = 0;
-	nlh->nlmsg_type = WLAN_NL_MSG_OEM;
-	aniHdr = NLMSG_DATA(nlh);
-	aniHdr->type = ANI_MSG_APP_REG_RSP;
-
-	/* Fill message body:
-	 *   First byte will be number of interfaces, followed by
-	 *   two bytes for each interfaces
-	 *     - one byte for device mode
-	 *     - one byte for vdev id
-	 */
-	buf = (char *)((char *)aniHdr + sizeof(tAniMsgHdr));
-	numInterfaces = buf++;
-	*numInterfaces = 0;
-
-	/* Iterate through each of the adapters and fill device mode and vdev id */
-	status = hdd_get_front_adapter(p_hdd_ctx, &pAdapterNode);
-	while ((CDF_STATUS_SUCCESS == status) && pAdapterNode) {
-		pAdapter = pAdapterNode->pAdapter;
-		if (pAdapter) {
-			deviceMode = buf++;
-			vdevId = buf++;
-			*deviceMode = pAdapter->device_mode;
-			*vdevId = pAdapter->sessionId;
-			(*numInterfaces)++;
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				  "%s: numInterfaces: %d, deviceMode: %d, vdevId: %d",
-				  __func__, *numInterfaces, *deviceMode,
-				  *vdevId);
-		}
-		status = hdd_get_next_adapter(p_hdd_ctx, pAdapterNode, &pNext);
-		pAdapterNode = pNext;
-	}
-
-	aniHdr->length =
-		sizeof(uint8_t) + (*numInterfaces) * 2 * sizeof(uint8_t);
-	nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + aniHdr->length));
-
-	skb_put(skb, NLMSG_SPACE((sizeof(tAniMsgHdr) + aniHdr->length)));
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: sending App Reg Response length (%d) to process pid (%d)",
-		  __func__, aniHdr->length, p_hdd_ctx->oem_pid);
-
-	(void)nl_srv_ucast(skb, p_hdd_ctx->oem_pid, MSG_DONTWAIT);
-
-	return;
-}
-
-/**
- * send_oem_err_rsp_nlink_msg() - send oem error response
- * @app_pid: PID of oem application process
- * @error_code: response error code
- *
- * This function sends error response to oem app
- *
- * Return: none
- */
-static void send_oem_err_rsp_nlink_msg(int32_t app_pid, uint8_t error_code)
-{
-	struct sk_buff *skb;
-	struct nlmsghdr *nlh;
-	tAniMsgHdr *aniHdr;
-	uint8_t *buf;
-
-	skb = alloc_skb(NLMSG_SPACE(WLAN_NL_MAX_PAYLOAD), GFP_KERNEL);
-	if (skb == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: alloc_skb failed", __func__);
-		return;
-	}
-
-	nlh = (struct nlmsghdr *)skb->data;
-	nlh->nlmsg_pid = 0;     /* from kernel */
-	nlh->nlmsg_flags = 0;
-	nlh->nlmsg_seq = 0;
-	nlh->nlmsg_type = WLAN_NL_MSG_OEM;
-	aniHdr = NLMSG_DATA(nlh);
-	aniHdr->type = ANI_MSG_OEM_ERROR;
-	aniHdr->length = sizeof(uint8_t);
-	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(tAniMsgHdr) + aniHdr->length);
-
-	/* message body will contain one byte of error code */
-	buf = (char *)((char *)aniHdr + sizeof(tAniMsgHdr));
-	*buf = error_code;
-
-	skb_put(skb, NLMSG_SPACE(sizeof(tAniMsgHdr) + aniHdr->length));
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: sending oem error response to process pid (%d)",
-		  __func__, app_pid);
-
-	(void)nl_srv_ucast(skb, app_pid, MSG_DONTWAIT);
-
-	return;
-}
-
-/**
- * hdd_send_oem_data_rsp_msg() - send oem data response
- * @length: length of the OEM Data Response message
- * @oemDataRsp: the actual OEM Data Response message
- *
- * This function sends an OEM Data Response message to a registered
- * application process over the netlink socket.
- *
- * Return: 0 for success, non zero for failure
- */
-void hdd_send_oem_data_rsp_msg(int length, uint8_t *oemDataRsp)
-{
-	struct sk_buff *skb;
-	struct nlmsghdr *nlh;
-	tAniMsgHdr *aniHdr;
-	uint8_t *oemData;
-
-	/* OEM message is always to a specific process and cannot be a broadcast */
-	if (p_hdd_ctx->oem_pid == 0) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: invalid dest pid", __func__);
-		return;
-	}
-
-	if (length > OEM_DATA_RSP_SIZE) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: invalid length of Oem Data response", __func__);
-		return;
-	}
-
-	skb = alloc_skb(NLMSG_SPACE(sizeof(tAniMsgHdr) + OEM_DATA_RSP_SIZE),
-			GFP_KERNEL);
-	if (skb == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: alloc_skb failed", __func__);
-		return;
-	}
-
-	nlh = (struct nlmsghdr *)skb->data;
-	nlh->nlmsg_pid = 0;     /* from kernel */
-	nlh->nlmsg_flags = 0;
-	nlh->nlmsg_seq = 0;
-	nlh->nlmsg_type = WLAN_NL_MSG_OEM;
-	aniHdr = NLMSG_DATA(nlh);
-	aniHdr->type = ANI_MSG_OEM_DATA_RSP;
-
-	aniHdr->length = length;
-	nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + aniHdr->length));
-	oemData = (uint8_t *) ((char *)aniHdr + sizeof(tAniMsgHdr));
-	cdf_mem_copy(oemData, oemDataRsp, length);
-
-	skb_put(skb, NLMSG_SPACE((sizeof(tAniMsgHdr) + aniHdr->length)));
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: sending Oem Data Response of len (%d) to process pid (%d)",
-		  __func__, length, p_hdd_ctx->oem_pid);
-
-	(void)nl_srv_ucast(skb, p_hdd_ctx->oem_pid, MSG_DONTWAIT);
-
-	return;
-}
-
-/**
- * oem_process_data_req_msg() - process oem data request
- * @oemDataLen: Length to OEM Data buffer
- * @oemData: Pointer to OEM Data buffer
- *
- * This function sends oem message to SME
- *
- * Return: CDF_STATUS enumeration
- */
-static CDF_STATUS oem_process_data_req_msg(int oemDataLen, char *oemData)
-{
-	hdd_adapter_t *pAdapter = NULL;
-	tOemDataReqConfig oemDataReqConfig;
-	uint32_t oemDataReqID = 0;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	/* for now, STA interface only */
-	pAdapter = hdd_get_adapter(p_hdd_ctx, WLAN_HDD_INFRA_STATION);
-	if (!pAdapter) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: No adapter for STA mode", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (!oemData) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: oemData is null", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_mem_zero(&oemDataReqConfig, sizeof(tOemDataReqConfig));
-
-	oemDataReqConfig.data = cdf_mem_malloc(oemDataLen);
-	if (!oemDataReqConfig.data) {
-		hddLog(LOGE, FL("malloc failed for data req buffer"));
-		return CDF_STATUS_E_NOMEM;
-	}
-
-	oemDataReqConfig.data_len = oemDataLen;
-	cdf_mem_copy(oemDataReqConfig.data, oemData, oemDataLen);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: calling sme_oem_data_req", __func__);
-
-	status = sme_oem_data_req(p_hdd_ctx->hHal,
-				  pAdapter->sessionId,
-				  &oemDataReqConfig,
-				  &oemDataReqID);
-
-	cdf_mem_free(oemDataReqConfig.data);
-	oemDataReqConfig.data = NULL;
-
-	return status;
-}
-
-/**
- * oem_process_channel_info_req_msg() - process oem channel_info request
- * @numOfChannels: number of channels
- * @chanList: list of channel information
- *
- * This function responds with channel info to oem process
- *
- * Return: 0 for success, non zero for failure
- */
-static int oem_process_channel_info_req_msg(int numOfChannels, char *chanList)
-{
-	struct sk_buff *skb;
-	struct nlmsghdr *nlh;
-	tAniMsgHdr *aniHdr;
-	tHddChannelInfo *pHddChanInfo;
-	tHddChannelInfo hddChanInfo;
-	uint8_t chanId;
-	uint32_t reg_info_1;
-	uint32_t reg_info_2;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	int i;
-	uint8_t *buf;
-
-	/* OEM message is always to a specific process and cannot be a broadcast */
-	if (p_hdd_ctx->oem_pid == 0) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: invalid dest pid", __func__);
-		return -EPERM;
-	}
-
-	skb = alloc_skb(NLMSG_SPACE(sizeof(tAniMsgHdr) + sizeof(uint8_t) +
-				    numOfChannels * sizeof(tHddChannelInfo)),
-			GFP_KERNEL);
-	if (skb == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: alloc_skb failed", __func__);
-		return -ENOMEM;
-	}
-
-	nlh = (struct nlmsghdr *)skb->data;
-	nlh->nlmsg_pid = 0;     /* from kernel */
-	nlh->nlmsg_flags = 0;
-	nlh->nlmsg_seq = 0;
-	nlh->nlmsg_type = WLAN_NL_MSG_OEM;
-	aniHdr = NLMSG_DATA(nlh);
-	aniHdr->type = ANI_MSG_CHANNEL_INFO_RSP;
-
-	aniHdr->length =
-		sizeof(uint8_t) + numOfChannels * sizeof(tHddChannelInfo);
-	nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + aniHdr->length));
-
-	/* First byte of message body will have num of channels */
-	buf = (char *)((char *)aniHdr + sizeof(tAniMsgHdr));
-	*buf++ = numOfChannels;
-
-	/* Next follows channel info struct for each channel id.
-	 * If chan id is wrong or SME returns failure for a channel
-	 * then fill in 0 in channel info for that particular channel
-	 */
-	for (i = 0; i < numOfChannels; i++) {
-		pHddChanInfo = (tHddChannelInfo *) ((char *)buf +
-						    i *
-						    sizeof(tHddChannelInfo));
-
-		chanId = chanList[i];
-		status = sme_get_reg_info(p_hdd_ctx->hHal, chanId,
-					  &reg_info_1, &reg_info_2);
-		if (CDF_STATUS_SUCCESS == status) {
-			/* copy into hdd chan info struct */
-			hddChanInfo.chan_id = chanId;
-			hddChanInfo.reserved0 = 0;
-			hddChanInfo.mhz = cds_chan_to_freq(chanId);
-			hddChanInfo.band_center_freq1 = hddChanInfo.mhz;
-			hddChanInfo.band_center_freq2 = 0;
-
-			hddChanInfo.info = 0;
-			if (CHANNEL_STATE_DFS ==
-			    cds_get_channel_state(chanId))
-				WMI_SET_CHANNEL_FLAG(&hddChanInfo,
-						     WMI_CHAN_FLAG_DFS);
-			hddChanInfo.reg_info_1 = reg_info_1;
-			hddChanInfo.reg_info_2 = reg_info_2;
-		} else {
-			/* channel info is not returned, fill in zeros in channel
-			 * info struct
-			 */
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				  "%s: sme_get_reg_info failed for chan (%d), return info 0",
-				  __func__, chanId);
-			hddChanInfo.chan_id = chanId;
-			hddChanInfo.reserved0 = 0;
-			hddChanInfo.mhz = 0;
-			hddChanInfo.band_center_freq1 = 0;
-			hddChanInfo.band_center_freq2 = 0;
-			hddChanInfo.info = 0;
-			hddChanInfo.reg_info_1 = 0;
-			hddChanInfo.reg_info_2 = 0;
-		}
-		cdf_mem_copy(pHddChanInfo, &hddChanInfo,
-			     sizeof(tHddChannelInfo));
-	}
-
-	skb_put(skb, NLMSG_SPACE((sizeof(tAniMsgHdr) + aniHdr->length)));
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: sending channel info resp for num channels (%d) to pid (%d)",
-		  __func__, numOfChannels, p_hdd_ctx->oem_pid);
-
-	(void)nl_srv_ucast(skb, p_hdd_ctx->oem_pid, MSG_DONTWAIT);
-
-	return 0;
-}
-
-/**
- * hdd_send_peer_status_ind_to_oem_app() -
- *	Function to send peer status to a registered application
- * @peerMac: MAC address of peer
- * @peerStatus: ePeerConnected or ePeerDisconnected
- * @peerTimingMeasCap: 0: RTT/RTT2, 1: RTT3. Default is 0
- * @sessionId: SME session id, i.e. vdev_id
- * @chan_info: operating channel information
- *
- * Return: none
- */
-void hdd_send_peer_status_ind_to_oem_app(struct cdf_mac_addr *peerMac,
-					 uint8_t peerStatus,
-					 uint8_t peerTimingMeasCap,
-					 uint8_t sessionId,
-					 tSirSmeChanInfo *chan_info)
-{
-	struct sk_buff *skb;
-	struct nlmsghdr *nlh;
-	tAniMsgHdr *aniHdr;
-	tPeerStatusInfo *pPeerInfo;
-
-	if (!p_hdd_ctx || !p_hdd_ctx->hHal) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Either HDD Ctx is null or Hal Ctx is null",
-			  __func__);
-		return;
-	}
-
-	/* check if oem app has registered and pid is valid */
-	if ((!p_hdd_ctx->oem_app_registered) || (p_hdd_ctx->oem_pid == 0)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "%s: OEM app is not registered(%d) or pid is invalid(%d)",
-			  __func__, p_hdd_ctx->oem_app_registered,
-			  p_hdd_ctx->oem_pid);
-		return;
-	}
-
-	skb = alloc_skb(NLMSG_SPACE(sizeof(tAniMsgHdr) +
-				    sizeof(tPeerStatusInfo)),
-			GFP_KERNEL);
-	if (skb == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: alloc_skb failed", __func__);
-		return;
-	}
-
-	nlh = (struct nlmsghdr *)skb->data;
-	nlh->nlmsg_pid = 0;     /* from kernel */
-	nlh->nlmsg_flags = 0;
-	nlh->nlmsg_seq = 0;
-	nlh->nlmsg_type = WLAN_NL_MSG_OEM;
-	aniHdr = NLMSG_DATA(nlh);
-	aniHdr->type = ANI_MSG_PEER_STATUS_IND;
-
-	aniHdr->length = sizeof(tPeerStatusInfo);
-	nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + aniHdr->length));
-
-	pPeerInfo = (tPeerStatusInfo *) ((char *)aniHdr + sizeof(tAniMsgHdr));
-
-	cdf_mem_copy(pPeerInfo->peer_mac_addr, peerMac->bytes,
-		     sizeof(peerMac->bytes));
-	pPeerInfo->peer_status = peerStatus;
-	pPeerInfo->vdev_id = sessionId;
-	pPeerInfo->peer_capability = peerTimingMeasCap;
-	pPeerInfo->reserved0 = 0;
-
-	if (chan_info) {
-		pPeerInfo->peer_chan_info.chan_id = chan_info->chan_id;
-		pPeerInfo->peer_chan_info.reserved0 = 0;
-		pPeerInfo->peer_chan_info.mhz = chan_info->mhz;
-		pPeerInfo->peer_chan_info.band_center_freq1 =
-			chan_info->band_center_freq1;
-		pPeerInfo->peer_chan_info.band_center_freq2 =
-			chan_info->band_center_freq2;
-		pPeerInfo->peer_chan_info.info = chan_info->info;
-		pPeerInfo->peer_chan_info.reg_info_1 = chan_info->reg_info_1;
-		pPeerInfo->peer_chan_info.reg_info_2 = chan_info->reg_info_2;
-	} else {
-		pPeerInfo->peer_chan_info.chan_id = 0;
-		pPeerInfo->peer_chan_info.reserved0 = 0;
-		pPeerInfo->peer_chan_info.mhz = 0;
-		pPeerInfo->peer_chan_info.band_center_freq1 = 0;
-		pPeerInfo->peer_chan_info.band_center_freq2 = 0;
-		pPeerInfo->peer_chan_info.info = 0;
-		pPeerInfo->peer_chan_info.reg_info_1 = 0;
-		pPeerInfo->peer_chan_info.reg_info_2 = 0;
-	}
-	skb_put(skb, NLMSG_SPACE((sizeof(tAniMsgHdr) + aniHdr->length)));
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO_HIGH,
-		  "%s: sending peer " MAC_ADDRESS_STR
-		  " status(%d), peerTimingMeasCap(%d), vdevId(%d), chanId(%d)"
-		  " to oem app pid(%d), center freq 1 (%d), center freq 2 (%d),"
-		  " info (0x%x), frequency (%d),reg info 1 (0x%x),"
-		  " reg info 2 (0x%x)", __func__,
-		  MAC_ADDR_ARRAY(peerMac->bytes),
-		  peerStatus, peerTimingMeasCap,
-		  sessionId, pPeerInfo->peer_chan_info.chan_id,
-		  p_hdd_ctx->oem_pid,
-		  pPeerInfo->peer_chan_info.band_center_freq1,
-		  pPeerInfo->peer_chan_info.band_center_freq2,
-		  pPeerInfo->peer_chan_info.info,
-		  pPeerInfo->peer_chan_info.mhz,
-		  pPeerInfo->peer_chan_info.reg_info_1,
-		  pPeerInfo->peer_chan_info.reg_info_2);
-
-	(void)nl_srv_ucast(skb, p_hdd_ctx->oem_pid, MSG_DONTWAIT);
-
-	return;
-}
-
-/*
- * Callback function invoked by Netlink service for all netlink
- * messages (from user space) addressed to WLAN_NL_MSG_OEM
- */
-
-/**
- * oem_msg_callback() - callback invoked by netlink service
- * @skb:    skb with netlink message
- *
- * This function gets invoked by netlink service when a message
- * is received from user space addressed to WLAN_NL_MSG_OEM
- *
- * Return: zero on success
- *         On error, error number will be returned.
- */
-static int oem_msg_callback(struct sk_buff *skb)
-{
-	struct nlmsghdr *nlh;
-	tAniMsgHdr *msg_hdr;
-	int ret;
-	char *sign_str = NULL;
-	nlh = (struct nlmsghdr *)skb->data;
-
-	if (!nlh) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Netlink header null", __func__);
-		return -EPERM;
-	}
-
-	ret = wlan_hdd_validate_context(p_hdd_ctx);
-	if (0 != ret) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  FL("HDD context is not valid"));
-		return ret;
-	}
-
-	msg_hdr = NLMSG_DATA(nlh);
-
-	if (!msg_hdr) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Message header null", __func__);
-		send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-					   OEM_ERR_NULL_MESSAGE_HEADER);
-		return -EPERM;
-	}
-
-	if (nlh->nlmsg_len <
-	    NLMSG_LENGTH(sizeof(tAniMsgHdr) + msg_hdr->length)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Invalid nl msg len, nlh->nlmsg_len (%d), msg_hdr->len (%d)",
-			  __func__, nlh->nlmsg_len, msg_hdr->length);
-		send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-					   OEM_ERR_INVALID_MESSAGE_LENGTH);
-		return -EPERM;
-	}
-
-	switch (msg_hdr->type) {
-	case ANI_MSG_APP_REG_REQ:
-		/* Registration request is only allowed for Qualcomm Application */
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-			  "%s: Received App Req Req from App process pid(%d), len(%d)",
-			  __func__, nlh->nlmsg_pid, msg_hdr->length);
-
-		sign_str = (char *)((char *)msg_hdr + sizeof(tAniMsgHdr));
-		if ((OEM_APP_SIGNATURE_LEN == msg_hdr->length) &&
-		    (0 == strncmp(sign_str, OEM_APP_SIGNATURE_STR,
-				  OEM_APP_SIGNATURE_LEN))) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				  "%s: Valid App Req Req from oem app process pid(%d)",
-				  __func__, nlh->nlmsg_pid);
-
-			p_hdd_ctx->oem_app_registered = true;
-			p_hdd_ctx->oem_pid = nlh->nlmsg_pid;
-			send_oem_reg_rsp_nlink_msg();
-		} else {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Invalid signature in App Reg Request from pid(%d)",
-				  __func__, nlh->nlmsg_pid);
-			send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-						   OEM_ERR_INVALID_SIGNATURE);
-			return -EPERM;
-		}
-		break;
-
-	case ANI_MSG_OEM_DATA_REQ:
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-			  "%s: Received Oem Data Request length(%d) from pid: %d",
-			  __func__, msg_hdr->length, nlh->nlmsg_pid);
-
-		if ((!p_hdd_ctx->oem_app_registered) ||
-		    (nlh->nlmsg_pid != p_hdd_ctx->oem_pid)) {
-			/* either oem app is not registered yet or pid is different */
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: OEM DataReq: app not registered(%d) or incorrect pid(%d)",
-				  __func__, p_hdd_ctx->oem_app_registered,
-				  nlh->nlmsg_pid);
-			send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-						   OEM_ERR_APP_NOT_REGISTERED);
-			return -EPERM;
-		}
-
-		if ((!msg_hdr->length) || (OEM_DATA_REQ_SIZE < msg_hdr->length)) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Invalid length (%d) in Oem Data Request",
-				  __func__, msg_hdr->length);
-			send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-						   OEM_ERR_INVALID_MESSAGE_LENGTH);
-			return -EPERM;
-		}
-		oem_process_data_req_msg(msg_hdr->length,
-					 (char *)((char *)msg_hdr +
-						  sizeof(tAniMsgHdr)));
-		break;
-
-	case ANI_MSG_CHANNEL_INFO_REQ:
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-			  "%s: Received channel info request, num channel(%d) from pid: %d",
-			  __func__, msg_hdr->length, nlh->nlmsg_pid);
-
-		if ((!p_hdd_ctx->oem_app_registered) ||
-		    (nlh->nlmsg_pid != p_hdd_ctx->oem_pid)) {
-			/* either oem app is not registered yet or pid is different */
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Chan InfoReq: app not registered(%d) or incorrect pid(%d)",
-				  __func__, p_hdd_ctx->oem_app_registered,
-				  nlh->nlmsg_pid);
-			send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-						   OEM_ERR_APP_NOT_REGISTERED);
-			return -EPERM;
-		}
-
-		/* message length contains list of channel ids */
-		if ((!msg_hdr->length) ||
-		    (WNI_CFG_VALID_CHANNEL_LIST_LEN < msg_hdr->length)) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: Invalid length (%d) in channel info request",
-				  __func__, msg_hdr->length);
-			send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-						   OEM_ERR_INVALID_MESSAGE_LENGTH);
-			return -EPERM;
-		}
-		oem_process_channel_info_req_msg(msg_hdr->length,
-						 (char *)((char *)msg_hdr +
-							  sizeof(tAniMsgHdr)));
-		break;
-
-	default:
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Received Invalid message type (%d), length (%d)",
-			  __func__, msg_hdr->type, msg_hdr->length);
-		send_oem_err_rsp_nlink_msg(nlh->nlmsg_pid,
-					   OEM_ERR_INVALID_MESSAGE_TYPE);
-		return -EPERM;
-	}
-	return 0;
-}
-
-static int __oem_msg_callback(struct sk_buff *skb)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = oem_msg_callback(skb);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * oem_activate_service() - Activate oem message handler
- * @hdd_ctx:   pointer to global HDD context
- *
- * This function registers a handler to receive netlink message from
- * an OEM application process.
- *
- * Return: zero on success
- *         On error, error number will be returned.
- */
-int oem_activate_service(struct hdd_context_s *hdd_ctx)
-{
-	p_hdd_ctx = hdd_ctx;
-
-	/* Register the msg handler for msgs addressed to WLAN_NL_MSG_OEM */
-	return nl_srv_register(WLAN_NL_MSG_OEM, __oem_msg_callback);
-}
-
-#endif

+ 0 - 2396
core/hdd/src/wlan_hdd_p2p.c

@@ -1,2396 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- *
- * @file  wlan_hdd_p2p.c
- *
- * @brief WLAN Host Device Driver implementation for P2P commands interface
- *
- */
-
-#include <wlan_hdd_includes.h>
-#include <wlan_hdd_hostapd.h>
-#include <net/cfg80211.h>
-#include "sme_api.h"
-#include "sme_qos_api.h"
-#include "wlan_hdd_p2p.h"
-#include "sap_api.h"
-#include "wlan_hdd_main.h"
-#include "cdf_trace.h"
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <linux/etherdevice.h>
-#include <net/ieee80211_radiotap.h>
-#include "wlan_hdd_tdls.h"
-#include "wlan_hdd_trace.h"
-#include "cdf_types.h"
-#include "cdf_trace.h"
-#include "cds_sched.h"
-#include "cds_concurrency.h"
-
-/* Ms to Micro Sec */
-#define MS_TO_MUS(x)   ((x) * 1000)
-
-static uint8_t *hdd_get_action_string(uint16_t MsgType)
-{
-	switch (MsgType) {
-		CASE_RETURN_STRING(SIR_MAC_ACTION_SPECTRUM_MGMT);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_QOS_MGMT);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_DLP);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_PUBLIC_USAGE);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_RRM);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_FAST_BSS_TRNST);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_HT);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_SA_QUERY);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_PROT_DUAL_PUB);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_WNM);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_UNPROT_WNM);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_TDLS);
-		CASE_RETURN_STRING(SIR_MAC_ACITON_MESH);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_MHF);
-		CASE_RETURN_STRING(SIR_MAC_SELF_PROTECTED);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_WME);
-		CASE_RETURN_STRING(SIR_MAC_ACTION_VHT);
-	default:
-		return "UNKNOWN";
-	}
-}
-
-#ifdef WLAN_FEATURE_P2P_DEBUG
-#define MAX_P2P_ACTION_FRAME_TYPE 9
-const char *p2p_action_frame_type[] = { "GO Negotiation Request",
-					"GO Negotiation Response",
-					"GO Negotiation Confirmation",
-					"P2P Invitation Request",
-					"P2P Invitation Response",
-					"Device Discoverability Request",
-					"Device Discoverability Response",
-					"Provision Discovery Request",
-					"Provision Discovery Response"};
-
-/* We no need to protect this variable since
- * there is no chance of race to condition
- * and also not make any complicating the code
- * just for debugging log
- */
-tP2PConnectionStatus global_p2p_connection_status = P2P_NOT_ACTIVE;
-
-#endif
-#define MAX_TDLS_ACTION_FRAME_TYPE 11
-const char *tdls_action_frame_type[] = { "TDLS Setup Request",
-					 "TDLS Setup Response",
-					 "TDLS Setup Confirm",
-					 "TDLS Teardown",
-					 "TDLS Peer Traffic Indication",
-					 "TDLS Channel Switch Request",
-					 "TDLS Channel Switch Response",
-					 "TDLS Peer PSM Request",
-					 "TDLS Peer PSM Response",
-					 "TDLS Peer Traffic Response",
-					 "TDLS Discovery Request"};
-
-static bool wlan_hdd_is_type_p2p_action(const u8 *buf)
-{
-	const u8 *ouiPtr;
-
-	if (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET] !=
-	    WLAN_HDD_PUBLIC_ACTION_FRAME) {
-		return false;
-	}
-
-	if (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET] !=
-	    WLAN_HDD_VENDOR_SPECIFIC_ACTION) {
-		return false;
-	}
-
-	ouiPtr = &buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_OFFSET];
-
-	if (WPA_GET_BE24(ouiPtr) != WLAN_HDD_WFA_OUI) {
-		return false;
-	}
-
-	if (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_TYPE_OFFSET] !=
-	    WLAN_HDD_WFA_P2P_OUI_TYPE) {
-		return false;
-	}
-
-	return true;
-}
-
-static bool hdd_p2p_is_action_type_rsp(const u8 *buf)
-{
-	tActionFrmType actionFrmType;
-
-	if (wlan_hdd_is_type_p2p_action(buf)) {
-		actionFrmType =
-			buf[WLAN_HDD_PUBLIC_ACTION_FRAME_SUB_TYPE_OFFSET];
-		if (actionFrmType != WLAN_HDD_INVITATION_REQ
-		    && actionFrmType != WLAN_HDD_GO_NEG_REQ
-		    && actionFrmType != WLAN_HDD_DEV_DIS_REQ
-		    && actionFrmType != WLAN_HDD_PROV_DIS_REQ)
-			return true;
-	}
-
-	return false;
-}
-
-static
-CDF_STATUS wlan_hdd_remain_on_channel_callback(tHalHandle hHal, void *pCtx,
-			CDF_STATUS status, uint32_t scan_id)
-{
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) pCtx;
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx;
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-
-	if (!hdd_ctx) {
-		hdd_err("Invalid HDD context");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	pRemainChanCtx = cfgState->remain_on_chan_ctx;
-
-	if (pRemainChanCtx == NULL) {
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		hddLog(LOGW,
-		       "%s: No Rem on channel pending for which Rsp is received",
-		       __func__);
-		return CDF_STATUS_SUCCESS;
-	}
-
-	hddLog(LOG1, "Received remain on channel rsp");
-	cdf_mc_timer_stop(&pRemainChanCtx->hdd_remain_on_chan_timer);
-	cdf_mc_timer_destroy(&pRemainChanCtx->hdd_remain_on_chan_timer);
-
-	cfgState->remain_on_chan_ctx = NULL;
-	/*
-	 * Resetting the roc in progress early ensures that the subsequent
-	 * roc requests are immediately processed without being queued
-	 */
-	pAdapter->is_roc_inprogress = false;
-	/*
-	 * If the allow suspend is done later, the scheduled roc wil prevent
-	 * the system from going into suspend and immediately this logic
-	 * will allow the system to go to suspend breaking the exising logic.
-	 * Basically, the system must not go into suspend while roc is in
-	 * progress.
-	 */
-	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-	mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-
-	if (REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request) {
-		if (cfgState->buf) {
-			hddLog(LOGP,
-			       "%s: We need to receive yet an ack from one of tx packet",
-			       __func__);
-		}
-		cfg80211_remain_on_channel_expired(
-			pRemainChanCtx->dev->
-			ieee80211_ptr,
-			pRemainChanCtx->
-			cookie,
-			&pRemainChanCtx->chan,
-			GFP_KERNEL);
-		pAdapter->last_roc_ts = cdf_mc_timer_get_system_time();
-	}
-
-	/* Schedule any pending RoC: Any new roc request during this time
-	 * would have got queued in 'wlan_hdd_request_remain_on_channel'
-	 * since the queue is not empty. So, the roc at the head of the
-	 * queue will only get the priority. Scheduling the work queue
-	 * after sending any cancel remain on channel event will also
-	 * ensure that the cancel roc is sent without any delays.
-	 */
-	schedule_delayed_work(&hdd_ctx->roc_req_work, 0);
-
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
-	    ) {
-		uint8_t sessionId = pAdapter->sessionId;
-		if (REMAIN_ON_CHANNEL_REQUEST ==
-		    pRemainChanCtx->rem_on_chan_request) {
-			sme_deregister_mgmt_frame(hHal, sessionId,
-						  (SIR_MAC_MGMT_FRAME << 2) |
-						  (SIR_MAC_MGMT_PROBE_REQ << 4),
-						  NULL, 0);
-		}
-	} else if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
-		   (WLAN_HDD_P2P_GO == pAdapter->device_mode)
-		   ) {
-		wlansap_de_register_mgmt_frame(
-#ifdef WLAN_FEATURE_MBSSID
-			WLAN_HDD_GET_SAP_CTX_PTR
-				(pAdapter),
-#else
-			(WLAN_HDD_GET_CTX
-				 (pAdapter))->pcds_context,
-#endif
-			(SIR_MAC_MGMT_FRAME << 2) |
-			(SIR_MAC_MGMT_PROBE_REQ <<
-			 4), NULL, 0);
-
-	}
-
-	if (pRemainChanCtx->action_pkt_buff.frame_ptr != NULL
-	    && pRemainChanCtx->action_pkt_buff.frame_length != 0) {
-		cdf_mem_free(pRemainChanCtx->action_pkt_buff.frame_ptr);
-		pRemainChanCtx->action_pkt_buff.frame_ptr = NULL;
-		pRemainChanCtx->action_pkt_buff.frame_length = 0;
-	}
-	cdf_mem_free(pRemainChanCtx);
-	complete(&pAdapter->cancel_rem_on_chan_var);
-	if (CDF_STATUS_SUCCESS != status)
-		complete(&pAdapter->rem_on_chan_ready_event);
-	return CDF_STATUS_SUCCESS;
-}
-
-void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter)
-{
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx;
-	unsigned long rc;
-
-	mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	if (cfgState->remain_on_chan_ctx != NULL) {
-		hddLog(LOGE, "Cancel Existing Remain on Channel");
-
-		if (CDF_TIMER_STATE_RUNNING == cdf_mc_timer_get_current_state(
-                    &cfgState->remain_on_chan_ctx->hdd_remain_on_chan_timer))
-			cdf_mc_timer_stop(&cfgState->remain_on_chan_ctx->
-					  hdd_remain_on_chan_timer);
-
-		pRemainChanCtx = cfgState->remain_on_chan_ctx;
-		if (pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress ==
-		    true) {
-			mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-			hddLog(LOGE,
-			       "ROC timer cancellation in progress,"
-			       " wait for completion");
-			rc = wait_for_completion_timeout(&pAdapter->
-							 cancel_rem_on_chan_var,
-							 msecs_to_jiffies
-								 (WAIT_CANCEL_REM_CHAN));
-			if (!rc) {
-				hddLog(LOGE,
-				       "%s:wait on cancel_rem_on_chan_var timed out",
-				       __func__);
-			}
-			return;
-		}
-		pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = true;
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		/* Wait till remain on channel ready indication before issuing cancel
-		 * remain on channel request, otherwise if remain on channel not
-		 * received and if the driver issues cancel remain on channel then lim
-		 * will be in unknown state.
-		 */
-		rc = wait_for_completion_timeout(&pAdapter->
-						 rem_on_chan_ready_event,
-						 msecs_to_jiffies
-							 (WAIT_REM_CHAN_READY));
-		if (!rc) {
-			hddLog(LOGE,
-			       "%s: timeout waiting for remain on channel ready indication",
-			       __func__);
-		}
-
-		INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var);
-
-		/* Issue abort remain on chan request to sme.
-		 * The remain on channel callback will make sure the remain_on_chan
-		 * expired event is sent.
-		 */
-		if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-		    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-		    (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
-		    ) {
-			sme_cancel_remain_on_channel(WLAN_HDD_GET_HAL_CTX
-							     (pAdapter),
-				pAdapter->sessionId,
-				pRemainChanCtx->scan_id);
-		} else if ((WLAN_HDD_SOFTAP == pAdapter->device_mode)
-			   || (WLAN_HDD_P2P_GO == pAdapter->device_mode)
-			   ) {
-			wlansap_cancel_remain_on_channel(
-#ifdef WLAN_FEATURE_MBSSID
-				WLAN_HDD_GET_SAP_CTX_PTR
-					(pAdapter),
-#else
-			(WLAN_HDD_GET_CTX(pAdapter))->pcds_context,
-#endif
-			pRemainChanCtx->scan_id);
-		}
-
-		rc = wait_for_completion_timeout(&pAdapter->
-						 cancel_rem_on_chan_var,
-						 msecs_to_jiffies
-							 (WAIT_CANCEL_REM_CHAN));
-
-		if (!rc) {
-			hddLog(LOGE,
-			       "%s: timeout waiting for cancel remain on channel ready"
-			       " indication", __func__);
-		}
-		hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-	} else
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-}
-
-int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter)
-{
-	int status = 0;
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-
-	if (WLAN_HDD_P2P_GO != pAdapter->device_mode) {
-		/* Cancel Existing Remain On Channel */
-		/* If no action frame is pending */
-		if (cfgState->remain_on_chan_ctx != NULL) {
-			/* Check whether Action Frame is pending or not */
-			if (cfgState->buf == NULL) {
-				wlan_hdd_cancel_existing_remain_on_channel
-					(pAdapter);
-			} else {
-				hddLog(LOG1,
-				       "Cannot Cancel Existing Remain on Channel");
-				status = -EBUSY;
-			}
-		}
-	}
-	return status;
-}
-
-/**
- * wlan_hdd_cancel_pending_roc() - Cancel pending roc
- * @adapter: HDD adapter
- *
- * Cancels any pending remain on channel request
- *
- * Return: None
- */
-void wlan_hdd_cancel_pending_roc(hdd_adapter_t *adapter)
-{
-	hdd_remain_on_chan_ctx_t *roc_ctx;
-	unsigned long rc;
-	hdd_cfg80211_state_t *cfg_state = WLAN_HDD_GET_CFG_STATE_PTR(adapter);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			"%s: ROC completion is not received.!!!",
-			__func__);
-
-	mutex_lock(&cfg_state->remain_on_chan_ctx_lock);
-	roc_ctx = cfg_state->remain_on_chan_ctx;
-
-	if (roc_ctx->hdd_remain_on_chan_cancel_in_progress) {
-		mutex_unlock(&cfg_state->remain_on_chan_ctx_lock);
-		hdd_debug("roc cancel already in progress");
-		/*
-		 * Since a cancel roc is already issued and is
-		 * in progress, we need not send another
-		 * cancel roc again. Instead we can just wait
-		 * for cancel roc completion
-		 */
-		goto wait;
-	}
-	mutex_unlock(&cfg_state->remain_on_chan_ctx_lock);
-
-	if (adapter->device_mode == WLAN_HDD_P2P_GO) {
-		wlansap_cancel_remain_on_channel((WLAN_HDD_GET_CTX
-					(adapter))->pcds_context,
-					cfg_state->remain_on_chan_ctx->scan_id);
-	} else if (adapter->device_mode == WLAN_HDD_P2P_CLIENT
-			|| adapter->device_mode ==
-			WLAN_HDD_P2P_DEVICE) {
-		sme_cancel_remain_on_channel(WLAN_HDD_GET_HAL_CTX
-				(adapter),
-				adapter->sessionId,
-				cfg_state->remain_on_chan_ctx->scan_id);
-	}
-
-wait:
-	rc = wait_for_completion_timeout(&adapter->cancel_rem_on_chan_var,
-			msecs_to_jiffies
-			(WAIT_CANCEL_REM_CHAN));
-	if (!rc) {
-		CDF_TRACE(CDF_MODULE_ID_HDD,
-		    CDF_TRACE_LEVEL_ERROR,
-		    "%s: Timeout occurred while waiting for RoC Cancellation",
-		    __func__);
-		mutex_lock(&cfg_state->remain_on_chan_ctx_lock);
-		roc_ctx = cfg_state->remain_on_chan_ctx;
-		if (roc_ctx != NULL) {
-			cfg_state->remain_on_chan_ctx = NULL;
-			cdf_mc_timer_stop(&roc_ctx->hdd_remain_on_chan_timer);
-			cdf_mc_timer_destroy(
-					&roc_ctx->hdd_remain_on_chan_timer);
-			if (roc_ctx->action_pkt_buff.frame_ptr != NULL
-				&& roc_ctx->action_pkt_buff.frame_length != 0) {
-				cdf_mem_free(
-					roc_ctx->action_pkt_buff.frame_ptr);
-				roc_ctx->action_pkt_buff.frame_ptr = NULL;
-				roc_ctx->action_pkt_buff.frame_length = 0;
-			}
-			cdf_mem_free(roc_ctx);
-			adapter->is_roc_inprogress = false;
-		}
-		mutex_unlock(&cfg_state->remain_on_chan_ctx_lock);
-	}
-}
-
-/* Clean up RoC context at hdd_stop_adapter*/
-void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter)
-{
-	uint8_t retry = 0;
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-
-	mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	while (pAdapter->is_roc_inprogress) {
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: ROC in progress for session %d!!!",
-			  __func__, pAdapter->sessionId);
-		msleep(500);
-		if (retry++ > 3) {
-			wlan_hdd_cancel_pending_roc(pAdapter);
-			/* hold the lock before break from the loop */
-			mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-			break;
-		}
-		mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	} /* end of while */
-	mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-
-}
-
-void wlan_hdd_remain_on_chan_timeout(void *data)
-{
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) data;
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx;
-	hdd_cfg80211_state_t *cfgState;
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, "%s: pAdapter is NULL !!!", __func__);
-		return;
-	}
-
-	cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-	mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	pRemainChanCtx = cfgState->remain_on_chan_ctx;
-
-	if (NULL == pRemainChanCtx) {
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		hddLog(LOGE, "%s: No Remain on channel is pending", __func__);
-		return;
-	}
-
-	if (true == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress) {
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		hddLog(LOGE, FL("Cancellation already in progress"));
-		return;
-	}
-
-	pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = true;
-	mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-	hddLog(LOG1, "%s: Cancel Remain on Channel on timeout", __func__);
-
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
-	    ) {
-		sme_cancel_remain_on_channel(WLAN_HDD_GET_HAL_CTX(pAdapter),
-			pAdapter->sessionId,
-			pRemainChanCtx->scan_id);
-	} else if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
-		   (WLAN_HDD_P2P_GO == pAdapter->device_mode)
-		   ) {
-		wlansap_cancel_remain_on_channel(
-			(WLAN_HDD_GET_CTX(pAdapter))->pcds_context,
-			pRemainChanCtx->scan_id);
-	}
-
-	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-
-}
-
-static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
-		      hdd_remain_on_chan_ctx_t *pRemainChanCtx)
-{
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
-	hdd_adapter_t *pAdapter_temp;
-	CDF_STATUS status;
-	bool isGoPresent = false;
-	unsigned int duration;
-
-
-	mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	if (pAdapter->is_roc_inprogress == true) {
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-			FL("remain on channel request is in execution"));
-		return -EBUSY;
-	}
-
-	cfgState->remain_on_chan_ctx = pRemainChanCtx;
-	cfgState->current_freq = pRemainChanCtx->chan.center_freq;
-	pAdapter->is_roc_inprogress = true;
-	mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-
-	/* Initialize Remain on chan timer */
-	cdf_status =
-		cdf_mc_timer_init(&pRemainChanCtx->hdd_remain_on_chan_timer,
-				  CDF_TIMER_TYPE_SW,
-				  wlan_hdd_remain_on_chan_timeout, pAdapter);
-	if (cdf_status != CDF_STATUS_SUCCESS) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Not able to initialize remain_on_chan timer"));
-		mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-		cfgState->remain_on_chan_ctx = NULL;
-		pAdapter->is_roc_inprogress = false;
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		cdf_mem_free(pRemainChanCtx);
-		return -EINVAL;
-	}
-
-	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
-	while (NULL != pAdapterNode && CDF_STATUS_SUCCESS == status) {
-		pAdapter_temp = pAdapterNode->pAdapter;
-		if (pAdapter_temp->device_mode == WLAN_HDD_P2P_GO) {
-			isGoPresent = true;
-		}
-		status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
-		pAdapterNode = pNext;
-	}
-
-	/* Extending duration for proactive extension logic for RoC */
-	duration = pRemainChanCtx->duration;
-	if (isGoPresent == true)
-		duration = P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT * duration;
-	else
-		duration = P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT * duration;
-
-	hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-	INIT_COMPLETION(pAdapter->rem_on_chan_ready_event);
-
-	/* call sme API to start remain on channel. */
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
-	    ) {
-		uint8_t sessionId = pAdapter->sessionId;
-		/* call sme API to start remain on channel. */
-
-		if (CDF_STATUS_SUCCESS != sme_remain_on_channel(
-				WLAN_HDD_GET_HAL_CTX(pAdapter),
-				sessionId,
-				pRemainChanCtx->chan.hw_value, duration,
-				wlan_hdd_remain_on_channel_callback,
-				pAdapter,
-				(pRemainChanCtx->rem_on_chan_request ==
-				 REMAIN_ON_CHANNEL_REQUEST) ? true : false,
-				 &pRemainChanCtx->scan_id)) {
-			hddLog(LOGE, FL("sme_remain_on_channel failed"));
-			mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-			cfgState->remain_on_chan_ctx = NULL;
-			pAdapter->is_roc_inprogress = false;
-			mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-			cdf_mc_timer_destroy(
-				&pRemainChanCtx->hdd_remain_on_chan_timer);
-			cdf_mem_free(pRemainChanCtx);
-			hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-			return -EINVAL;
-		}
-
-		if (REMAIN_ON_CHANNEL_REQUEST ==
-		    pRemainChanCtx->rem_on_chan_request) {
-			if (CDF_STATUS_SUCCESS != sme_register_mgmt_frame(
-						WLAN_HDD_GET_HAL_CTX(pAdapter),
-						sessionId,
-						(SIR_MAC_MGMT_FRAME << 2) |
-						(SIR_MAC_MGMT_PROBE_REQ << 4),
-						NULL, 0))
-				hddLog(LOGE,
-					FL("sme_register_mgmt_frame failed"));
-		}
-
-	} else if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
-		   (WLAN_HDD_P2P_GO == pAdapter->device_mode)) {
-		/* call sme API to start remain on channel. */
-		if (CDF_STATUS_SUCCESS != wlansap_remain_on_channel(
-#ifdef WLAN_FEATURE_MBSSID
-			    WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
-#else
-			    (WLAN_HDD_GET_CTX(pAdapter))->pcds_context,
-#endif
-			    pRemainChanCtx->chan.hw_value,
-			    duration, wlan_hdd_remain_on_channel_callback,
-			    pAdapter, &pRemainChanCtx->scan_id)) {
-			hddLog(LOGE, FL("wlansap_remain_on_channel failed"));
-			mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-			cfgState->remain_on_chan_ctx = NULL;
-			pAdapter->is_roc_inprogress = false;
-			mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-			cdf_mc_timer_destroy(
-				&pRemainChanCtx->hdd_remain_on_chan_timer);
-			cdf_mem_free(pRemainChanCtx);
-			hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-			return -EINVAL;
-		}
-
-		if (CDF_STATUS_SUCCESS != wlansap_register_mgmt_frame(
-#ifdef WLAN_FEATURE_MBSSID
-			    WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
-#else
-			    (WLAN_HDD_GET_CTX(pAdapter))->pcds_context,
-#endif
-			(SIR_MAC_MGMT_FRAME << 2) |
-			(SIR_MAC_MGMT_PROBE_REQ << 4), NULL, 0)) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				FL("wlansap_register_mgmt_frame return fail"));
-			wlansap_cancel_remain_on_channel(
-#ifdef WLAN_FEATURE_MBSSID
-				WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
-#else
-				(WLAN_HDD_GET_CTX(pAdapter))->pcds_context,
-#endif
-			pRemainChanCtx->scan_id);
-			hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-			return -EINVAL;
-		}
-
-	}
-	return 0;
-}
-
-/**
- * wlan_hdd_roc_request_enqueue() - enqueue remain on channel request
- * @adapter: Pointer to the adapter
- * @remain_chan_ctx: Pointer to the remain on channel context
- *
- * Return: 0 on success, error number otherwise
- */
-static int wlan_hdd_roc_request_enqueue(hdd_adapter_t *adapter,
-			hdd_remain_on_chan_ctx_t *remain_chan_ctx)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	hdd_roc_req_t *hdd_roc_req;
-	CDF_STATUS status;
-
-	/*
-	 * "Driver is busy" OR "there is already RoC request inside the queue"
-	 * so enqueue this RoC Request and execute sequentially later.
-	 */
-
-	hdd_roc_req = cdf_mem_malloc(sizeof(*hdd_roc_req));
-
-	if (NULL == hdd_roc_req) {
-		hddLog(LOGP, FL("malloc failed for roc req context"));
-		return -ENOMEM;
-	}
-
-	hdd_roc_req->pAdapter = adapter;
-	hdd_roc_req->pRemainChanCtx = remain_chan_ctx;
-
-	/* Enqueue this RoC request */
-	cdf_spin_lock(&hdd_ctx->hdd_roc_req_q_lock);
-	status = cdf_list_insert_back(&hdd_ctx->hdd_roc_req_q,
-					&hdd_roc_req->node);
-	cdf_spin_unlock(&hdd_ctx->hdd_roc_req_q_lock);
-
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGP, FL("Not able to enqueue RoC Req context"));
-		cdf_mem_free(hdd_roc_req);
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-/**
- * wlan_hdd_indicate_roc_drop() - Indicate roc drop to userspace
- * @adapter: HDD adapter
- * @ctx: Remain on channel context
- *
- * Send remain on channel ready and cancel event for the queued
- * roc that is being dropped. This will ensure that the userspace
- * will send more roc requests. If this drop is not indicated to
- * userspace, subsequent roc will not be sent to the driver since
- * the userspace times out waiting for the remain on channel ready
- * event.
- *
- * Return: None
- */
-void wlan_hdd_indicate_roc_drop(hdd_adapter_t *adapter,
-				hdd_remain_on_chan_ctx_t *ctx)
-{
-	hdd_debug("indicate roc drop to userspace");
-	cfg80211_ready_on_channel(
-			adapter->dev->ieee80211_ptr,
-			(uintptr_t)ctx,
-			&ctx->chan,
-			ctx->duration, GFP_KERNEL);
-
-	cfg80211_remain_on_channel_expired(
-			ctx->dev->ieee80211_ptr,
-			ctx->cookie,
-			&ctx->chan,
-			GFP_KERNEL);
-}
-
-/**
- * wlan_hdd_roc_request_dequeue() - dequeue remain on channel request
- * @work: Pointer to work queue struct
- *
- * Return: none
- */
-void wlan_hdd_roc_request_dequeue(struct work_struct *work)
-{
-	CDF_STATUS status;
-	int ret = 0;
-	hdd_roc_req_t *hdd_roc_req;
-	hdd_context_t *hdd_ctx =
-			container_of(work, hdd_context_t, roc_req_work.work);
-
-	hdd_debug("going to dequeue roc");
-
-	if (0 != (wlan_hdd_validate_context(hdd_ctx)))
-		return;
-
-	/*
-	 * The queued roc requests is dequeued and processed one at a time.
-	 * Callback 'wlan_hdd_remain_on_channel_callback' ensures
-	 * that any pending roc in the queue will be scheduled
-	 * on the current roc completion by scheduling the work queue.
-	 */
-	cdf_spin_lock(&hdd_ctx->hdd_roc_req_q_lock);
-	if (list_empty(&hdd_ctx->hdd_roc_req_q.anchor)) {
-		cdf_spin_unlock(&hdd_ctx->hdd_roc_req_q_lock);
-		hdd_debug("list is empty");
-		return;
-	}
-	status = cdf_list_remove_front(&hdd_ctx->hdd_roc_req_q,
-			(cdf_list_node_t **) &hdd_roc_req);
-	cdf_spin_unlock(&hdd_ctx->hdd_roc_req_q_lock);
-	if (CDF_STATUS_SUCCESS != status) {
-		hdd_debug("unable to remove roc element from list");
-		return;
-	}
-	ret = wlan_hdd_execute_remain_on_channel(
-			hdd_roc_req->pAdapter,
-			hdd_roc_req->pRemainChanCtx);
-	if (ret == -EBUSY) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-				FL("dropping RoC request"));
-		wlan_hdd_indicate_roc_drop(hdd_roc_req->pAdapter,
-					   hdd_roc_req->pRemainChanCtx);
-		cdf_mem_free(hdd_roc_req->pRemainChanCtx);
-	}
-	cdf_mem_free(hdd_roc_req);
-}
-
-static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy,
-					      struct net_device *dev,
-					      struct ieee80211_channel *chan,
-					      unsigned int duration,
-					      u64 *cookie,
-					      rem_on_channel_request_type_t
-					      request_type)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx;
-	bool isBusy = false;
-	uint32_t size = 0;
-	hdd_adapter_t *sta_adapter;
-	int ret;
-	int status = 0;
-
-	ENTER();
-
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-	       hdd_device_mode_to_string(pAdapter->device_mode),
-	       pAdapter->device_mode);
-	hddLog(LOG1,
-	       "chan(hw_val)0x%x chan(centerfreq) %d, duration %d",
-	       chan->hw_value, chan->center_freq, duration);
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ret;
-	if (cds_is_connection_in_progress()) {
-		hddLog(LOGE, FL("Connection is in progress"));
-		isBusy = true;
-	}
-	pRemainChanCtx = cdf_mem_malloc(sizeof(hdd_remain_on_chan_ctx_t));
-	if (NULL == pRemainChanCtx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       "%s: Not able to allocate memory for Channel context",
-		       __func__);
-		return -ENOMEM;
-	}
-
-	cdf_mem_zero(pRemainChanCtx, sizeof(*pRemainChanCtx));
-	cdf_mem_copy(&pRemainChanCtx->chan, chan,
-		     sizeof(struct ieee80211_channel));
-	pRemainChanCtx->duration = duration;
-	pRemainChanCtx->dev = dev;
-	*cookie = (uintptr_t) pRemainChanCtx;
-	pRemainChanCtx->cookie = *cookie;
-	pRemainChanCtx->rem_on_chan_request = request_type;
-	pRemainChanCtx->action_pkt_buff.freq = 0;
-	pRemainChanCtx->action_pkt_buff.frame_ptr = NULL;
-	pRemainChanCtx->action_pkt_buff.frame_length = 0;
-	pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = false;
-	if (REMAIN_ON_CHANNEL_REQUEST == request_type) {
-		sta_adapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION);
-		if ((NULL != sta_adapter)&&
-			hdd_conn_is_connected(
-				WLAN_HDD_GET_STATION_CTX_PTR(sta_adapter))) {
-			if (pAdapter->last_roc_ts !=0 &&
-				((cdf_mc_timer_get_system_time() -
-					 pAdapter->last_roc_ts) <
-				pHddCtx->config->p2p_listen_defer_interval)) {
-			if (pRemainChanCtx->duration > HDD_P2P_MAX_ROC_DURATION)
-				pRemainChanCtx->duration =
-						HDD_P2P_MAX_ROC_DURATION;
-
-			wlan_hdd_roc_request_enqueue(pAdapter, pRemainChanCtx);
-			schedule_delayed_work(&pHddCtx->roc_req_work,
-			msecs_to_jiffies(
-				pHddCtx->config->p2p_listen_defer_interval));
-			hddLog(LOG1, "Defer interval is %hu, pAdapter %p",
-				pHddCtx->config->p2p_listen_defer_interval,
-				pAdapter);
-			return 0;
-			}
-		}
-	}
-
-	cdf_spin_lock(&pHddCtx->hdd_roc_req_q_lock);
-	cdf_list_size(&(pHddCtx->hdd_roc_req_q), &size);
-	cdf_spin_unlock(&pHddCtx->hdd_roc_req_q_lock);
-	if ((isBusy == false) && (!size)) {
-		status = wlan_hdd_execute_remain_on_channel(pAdapter,
-							    pRemainChanCtx);
-		if (status == -EBUSY) {
-			if (wlan_hdd_roc_request_enqueue(pAdapter,
-							 pRemainChanCtx)) {
-				cdf_mem_free(pRemainChanCtx);
-				return -EAGAIN;
-			}
-		}
-		return 0;
-	} else {
-		if (wlan_hdd_roc_request_enqueue(pAdapter, pRemainChanCtx)) {
-			cdf_mem_free(pRemainChanCtx);
-			return -EAGAIN;
-		}
-	}
-
-	/*
-	 * If a connection is not in progress (isBusy), before scheduling
-	 * the work queue it is necessary to check if a roc in in progress
-	 * or not because: if an roc is in progress, the dequeued roc
-	 * that will be processed will be dropped. To ensure that this new
-	 * roc request is not dropped, it is suggested to check if an roc
-	 * is in progress or not. The existing roc completion will provide
-	 * the trigger to dequeue the next roc request.
-	 */
-	if (isBusy == false && pAdapter->is_roc_inprogress == false) {
-		hdd_debug("scheduling delayed work: no connection/roc active");
-		schedule_delayed_work(&pHddCtx->roc_req_work, 0);
-	}
-	EXIT();
-	return 0;
-}
-
-int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
-					  struct wireless_dev *wdev,
-					  struct ieee80211_channel *chan,
-					  unsigned int duration, u64 *cookie)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_REMAIN_ON_CHANNEL,
-			 pAdapter->sessionId, REMAIN_ON_CHANNEL_REQUEST));
-
-	ret = wlan_hdd_request_remain_on_channel(wiphy, dev, chan,
-						  duration, cookie,
-						  REMAIN_ON_CHANNEL_REQUEST);
-	EXIT();
-	return ret;
-}
-
-int wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					struct ieee80211_channel *chan,
-					unsigned int duration, u64 *cookie)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_remain_on_channel(wiphy,
-						    wdev,
-						    chan,
-						    duration, cookie);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter,
-	uint32_t scan_id)
-{
-	hdd_cfg80211_state_t *cfgState = NULL;
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL;
-	CDF_STATUS status;
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("pAdapter is NULL"));
-		return;
-	}
-	cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-	hddLog(LOG1, "Ready on chan ind %d", scan_id);
-
-	pAdapter->start_roc_ts = cdf_mc_timer_get_system_time();
-	mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	pRemainChanCtx = cfgState->remain_on_chan_ctx;
-	if (pRemainChanCtx != NULL) {
-		MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-				 TRACE_CODE_HDD_REMAINCHANREADYHANDLER,
-				 pAdapter->sessionId,
-				 pRemainChanCtx->duration));
-		/* start timer for actual duration */
-		if (CDF_TIMER_STATE_RUNNING ==
-			cdf_mc_timer_get_current_state(
-				&pRemainChanCtx->hdd_remain_on_chan_timer)) {
-			hddLog(LOGE, "Timer Started before ready event!!!");
-			cdf_mc_timer_stop(&pRemainChanCtx->
-					  hdd_remain_on_chan_timer);
-		}
-		status =
-			cdf_mc_timer_start(&pRemainChanCtx->
-					   hdd_remain_on_chan_timer,
-					   (pRemainChanCtx->duration +
-					    COMPLETE_EVENT_PROPOGATE_TIME));
-		if (status != CDF_STATUS_SUCCESS) {
-			hddLog(LOGE, "%s: Remain on Channel timer start failed",
-			       __func__);
-		}
-
-		if (REMAIN_ON_CHANNEL_REQUEST ==
-		    pRemainChanCtx->rem_on_chan_request) {
-			cfg80211_ready_on_channel(
-				pAdapter->dev->
-				ieee80211_ptr,
-				(uintptr_t)
-				pRemainChanCtx,
-				&pRemainChanCtx->chan,
-				pRemainChanCtx->
-				duration, GFP_KERNEL);
-		} else if (OFF_CHANNEL_ACTION_TX ==
-			   pRemainChanCtx->rem_on_chan_request) {
-			complete(&pAdapter->offchannel_tx_event);
-		}
-		/* Check for cached action frame */
-		if (pRemainChanCtx->action_pkt_buff.frame_length != 0) {
-			hddLog(LOGE,
-			       "%s: Sent cached action frame to supplicant",
-			       __func__);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
-			cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr,
-				pRemainChanCtx->action_pkt_buff.freq, 0,
-				pRemainChanCtx->action_pkt_buff.frame_ptr,
-				pRemainChanCtx->action_pkt_buff.frame_length,
-				NL80211_RXMGMT_FLAG_ANSWERED);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-			cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr,
-				pRemainChanCtx->action_pkt_buff.freq, 0,
-				pRemainChanCtx->action_pkt_buff.frame_ptr,
-				pRemainChanCtx->action_pkt_buff.frame_length,
-				NL80211_RXMGMT_FLAG_ANSWERED, GFP_ATOMIC);
-#else
-			cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr,
-					 pRemainChanCtx->action_pkt_buff.freq,
-					 0,
-					 pRemainChanCtx->action_pkt_buff.
-					 frame_ptr,
-					 pRemainChanCtx->action_pkt_buff.
-					 frame_length, GFP_ATOMIC);
-#endif /* LINUX_VERSION_CODE */
-
-			cdf_mem_free(pRemainChanCtx->action_pkt_buff.frame_ptr);
-			pRemainChanCtx->action_pkt_buff.frame_length = 0;
-			pRemainChanCtx->action_pkt_buff.freq = 0;
-			pRemainChanCtx->action_pkt_buff.frame_ptr = NULL;
-		}
-		complete(&pAdapter->rem_on_chan_ready_event);
-	} else {
-		hddLog(LOGW, "%s: No Pending Remain on channel Request",
-		       __func__);
-	}
-	mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-	return;
-}
-
-int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
-						 struct wireless_dev *wdev,
-						 u64 cookie)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	int status;
-	unsigned long rc;
-	cdf_list_node_t *tmp, *q;
-	hdd_roc_req_t *curr_roc_req;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-	cdf_spin_lock(&pHddCtx->hdd_roc_req_q_lock);
-	list_for_each_safe(tmp, q, &pHddCtx->hdd_roc_req_q.anchor) {
-		curr_roc_req = list_entry(tmp, hdd_roc_req_t, node);
-		if ((uintptr_t) curr_roc_req->pRemainChanCtx == cookie) {
-			status = cdf_list_remove_node(&pHddCtx->hdd_roc_req_q,
-						      (cdf_list_node_t *)
-						      curr_roc_req);
-			cdf_spin_unlock(&pHddCtx->hdd_roc_req_q_lock);
-			if (status == CDF_STATUS_SUCCESS) {
-				cdf_mem_free(curr_roc_req->pRemainChanCtx);
-				cdf_mem_free(curr_roc_req);
-			}
-			return 0;
-		}
-	}
-	cdf_spin_unlock(&pHddCtx->hdd_roc_req_q_lock);
-	/* FIXME cancel currently running remain on chan.
-	 * Need to check cookie and cancel accordingly
-	 */
-	mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-	pRemainChanCtx = cfgState->remain_on_chan_ctx;
-	if ((cfgState->remain_on_chan_ctx == NULL) ||
-	    (cfgState->remain_on_chan_ctx->cookie != cookie)) {
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		hddLog(LOGE,
-		       "%s: No Remain on channel pending with specified cookie value",
-		       __func__);
-		return -EINVAL;
-	}
-
-	if (NULL != cfgState->remain_on_chan_ctx) {
-		cdf_mc_timer_stop(&cfgState->remain_on_chan_ctx->
-				  hdd_remain_on_chan_timer);
-		if (true ==
-		    pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress) {
-			mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-			hddLog(LOG1,
-			       FL("ROC timer cancellation in progress,"
-				  " wait for completion"));
-			rc = wait_for_completion_timeout(&pAdapter->
-							 cancel_rem_on_chan_var,
-							 msecs_to_jiffies
-								 (WAIT_CANCEL_REM_CHAN));
-			if (!rc) {
-				hddLog(LOGE,
-				       "%s:wait on cancel_rem_on_chan_var timed out",
-				       __func__);
-			}
-			return 0;
-		} else
-			pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress =
-				true;
-	}
-	mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-
-	/* wait until remain on channel ready event received
-	 * for already issued remain on channel request */
-	rc = wait_for_completion_timeout(&pAdapter->rem_on_chan_ready_event,
-					 msecs_to_jiffies(WAIT_REM_CHAN_READY));
-	if (!rc) {
-		hddLog(LOGE,
-		       "%s: timeout waiting for remain on channel ready indication",
-		       __func__);
-
-		if (cds_is_driver_recovering()) {
-			hdd_err("Recovery in Progress. State: 0x%x Ignore!!!",
-				 cds_get_driver_state());
-			return -EAGAIN;
-		}
-	}
-	INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var);
-	/* Issue abort remain on chan request to sme.
-	 * The remain on channel callback will make sure the remain_on_chan
-	 * expired event is sent.
-	 */
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
-	    ) {
-
-		uint8_t sessionId = pAdapter->sessionId;
-		sme_cancel_remain_on_channel(WLAN_HDD_GET_HAL_CTX(pAdapter),
-			sessionId,
-			pRemainChanCtx->scan_id);
-	} else if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
-		   (WLAN_HDD_P2P_GO == pAdapter->device_mode)
-		   ) {
-		wlansap_cancel_remain_on_channel(
-#ifdef WLAN_FEATURE_MBSSID
-			WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
-#else
-			(WLAN_HDD_GET_CTX(pAdapter))->pcds_context,
-#endif
-			pRemainChanCtx->scan_id);
-
-	} else {
-		hddLog(LOGE, FL("Invalid device_mode %s(%d)"),
-		       hdd_device_mode_to_string(pAdapter->device_mode),
-		       pAdapter->device_mode);
-		return -EIO;
-	}
-	rc = wait_for_completion_timeout(&pAdapter->cancel_rem_on_chan_var,
-					 msecs_to_jiffies
-						 (WAIT_CANCEL_REM_CHAN));
-	if (!rc) {
-		hddLog(LOGE,
-		       "%s:wait on cancel_rem_on_chan_var timed out ",
-		       __func__);
-	}
-	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
-	EXIT();
-	return 0;
-}
-
-int wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
-					       struct wireless_dev *wdev,
-					       u64 cookie)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy,
-							   wdev,
-							   cookie);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
-		       struct ieee80211_channel *chan, bool offchan,
-		       unsigned int wait,
-		       const u8 *buf, size_t len, bool no_cck,
-		       bool dont_wait_for_ack, u64 *cookie)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	uint16_t extendedWait = 0;
-	uint8_t type = WLAN_HDD_GET_TYPE_FRM_FC(buf[0]);
-	uint8_t subType = WLAN_HDD_GET_SUBTYPE_FRM_FC(buf[0]);
-	tActionFrmType actionFrmType;
-	bool noack = 0;
-	int status;
-	unsigned long rc;
-	hdd_adapter_t *goAdapter;
-	uint16_t current_freq;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_ACTION, pAdapter->sessionId,
-			 pAdapter->device_mode));
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	hddLog(LOG1, FL("Device_mode %s(%d) type: %d"),
-	       hdd_device_mode_to_string(pAdapter->device_mode),
-	       pAdapter->device_mode, type);
-
-#ifdef WLAN_FEATURE_P2P_DEBUG
-	if ((type == SIR_MAC_MGMT_FRAME) &&
-	    (subType == SIR_MAC_MGMT_ACTION) &&
-	    wlan_hdd_is_type_p2p_action(&buf
-				[WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET])) {
-		actionFrmType = buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET];
-		if (actionFrmType >= MAX_P2P_ACTION_FRAME_TYPE) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "[P2P] unknown[%d] ---> OTA to " MAC_ADDRESS_STR,
-			       actionFrmType,
-			       MAC_ADDR_ARRAY(&buf
-					      [WLAN_HDD_80211_FRM_DA_OFFSET]));
-		} else {
-			hddLog(CDF_TRACE_LEVEL_ERROR, "[P2P] %s ---> OTA to "
-			       MAC_ADDRESS_STR,
-			       p2p_action_frame_type[actionFrmType],
-			       MAC_ADDR_ARRAY(&buf
-					      [WLAN_HDD_80211_FRM_DA_OFFSET]));
-			if ((actionFrmType == WLAN_HDD_PROV_DIS_REQ)
-			    && (global_p2p_connection_status == P2P_NOT_ACTIVE)) {
-				global_p2p_connection_status = P2P_GO_NEG_PROCESS;
-				hddLog(LOGE, "[P2P State]Inactive state to "
-				       "GO negotiation progress state");
-			} else if ((actionFrmType == WLAN_HDD_GO_NEG_CNF) &&
-				   (global_p2p_connection_status ==
-				    P2P_GO_NEG_PROCESS)) {
-				global_p2p_connection_status =
-					P2P_GO_NEG_COMPLETED;
-				hddLog(LOGE,
-				       "[P2P State]GO nego progress to GO nego"
-				       " completed state");
-			}
-		}
-	}
-#endif
-
-	noack = dont_wait_for_ack;
-
-	/* If the wait is coming as 0 with off channel set */
-	/* then set the wait to 200 ms */
-	if (offchan && !wait) {
-		wait = ACTION_FRAME_DEFAULT_WAIT;
-		mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-		if (cfgState->remain_on_chan_ctx) {
-
-			uint32_t current_time = cdf_mc_timer_get_system_time();
-			int remaining_roc_time =
-				((int) cfgState->remain_on_chan_ctx->duration -
-				(current_time - pAdapter->start_roc_ts));
-
-			if (remaining_roc_time > ACTION_FRAME_DEFAULT_WAIT)
-				wait = remaining_roc_time;
-		}
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-	}
-
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) &&
-		(type == SIR_MAC_MGMT_FRAME &&
-		subType == SIR_MAC_MGMT_PROBE_RSP)) {
-			/* Drop Probe response received
-			 * from supplicant in sta mode
-			 */
-			goto err_rem_channel;
-	}
-
-	/* Call sme API to send out a action frame. */
-	/* OR can we send it directly through data path?? */
-	/* After tx completion send tx status back. */
-	if ((WLAN_HDD_SOFTAP == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_GO == pAdapter->device_mode)
-	    ) {
-		if (type == SIR_MAC_MGMT_FRAME) {
-			if (subType == SIR_MAC_MGMT_PROBE_RSP) {
-				/* Drop Probe response recieved from supplicant, as for GO and
-				   SAP PE itself sends probe response
-				 */
-				goto err_rem_channel;
-			} else if ((subType == SIR_MAC_MGMT_DISASSOC) ||
-				   (subType == SIR_MAC_MGMT_DEAUTH)) {
-				/* During EAP failure or P2P Group Remove supplicant
-				 * is sending del_station command to driver. From
-				 * del_station function, Driver will send deauth frame to
-				 * p2p client. No need to send disassoc frame from here.
-				 * so Drop the frame here and send tx indication back to
-				 * supplicant.
-				 */
-				uint8_t dstMac[ETH_ALEN] = { 0 };
-				memcpy(&dstMac,
-				       &buf[WLAN_HDD_80211_FRM_DA_OFFSET],
-				       ETH_ALEN);
-				hddLog(CDF_TRACE_LEVEL_INFO,
-				       "%s: Deauth/Disassoc received for STA:"
-				       MAC_ADDRESS_STR, __func__,
-				       MAC_ADDR_ARRAY(dstMac));
-				goto err_rem_channel;
-			}
-		}
-	}
-
-	if (NULL != cfgState->buf) {
-		if (!noack) {
-			hddLog(LOGE,
-			       "(%s):Previous P2P Action frame packet pending",
-			       __func__);
-			hdd_cleanup_actionframe(pAdapter->pHddCtx, pAdapter);
-		} else {
-			hddLog(LOGE,
-			       "(%s):Pending Action frame packet return EBUSY",
-			       __func__);
-			return -EBUSY;
-		}
-	}
-
-	if (subType == SIR_MAC_MGMT_ACTION) {
-		hddLog(LOG1, "Action frame tx request : %s",
-		       hdd_get_action_string(buf
-					     [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET]));
-	}
-
-	goAdapter = hdd_get_adapter(pAdapter->pHddCtx, WLAN_HDD_P2P_GO);
-
-	/* If GO adapter exists and operating on same frequency */
-	/* then we will not request remain on channel */
-	if (goAdapter && (ieee80211_frequency_to_channel(chan->center_freq)
-			  == goAdapter->sessionCtx.ap.operatingChannel)) {
-		/* if GO exist and is not off channel
-		 * wait time should be zero
-		 */
-		wait = 0;
-		goto send_frame;
-	}
-
-	if (offchan && wait) {
-		int status;
-		rem_on_channel_request_type_t req_type = OFF_CHANNEL_ACTION_TX;
-		/* In case of P2P Client mode if we are already */
-		/* on the same channel then send the frame directly */
-
-		mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-		pRemainChanCtx = cfgState->remain_on_chan_ctx;
-		if ((type == SIR_MAC_MGMT_FRAME) &&
-		    (subType == SIR_MAC_MGMT_ACTION) &&
-		    hdd_p2p_is_action_type_rsp(&buf
-					       [WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET])
-		    && cfgState->remain_on_chan_ctx
-		    && cfgState->current_freq == chan->center_freq) {
-			if (CDF_TIMER_STATE_RUNNING ==
-			    cdf_mc_timer_get_current_state(&cfgState->
-						   remain_on_chan_ctx->
-						   hdd_remain_on_chan_timer)) {
-				cdf_mc_timer_stop(&cfgState->
-						  remain_on_chan_ctx->
-						  hdd_remain_on_chan_timer);
-				status =
-					cdf_mc_timer_start(&cfgState->
-							   remain_on_chan_ctx->
-							   hdd_remain_on_chan_timer,
-							   wait);
-				if (status != CDF_STATUS_SUCCESS) {
-					hddLog(LOGE,
-					       "%s: Remain on Channel timer start failed",
-					       __func__);
-				}
-				mutex_unlock(&cfgState->
-					     remain_on_chan_ctx_lock);
-				goto send_frame;
-			} else {
-				if (pRemainChanCtx->
-				    hdd_remain_on_chan_cancel_in_progress ==
-				    true) {
-					mutex_unlock(&cfgState->
-						     remain_on_chan_ctx_lock);
-					hddLog(CDF_TRACE_LEVEL_INFO,
-					       "action frame tx: waiting for completion of ROC ");
-
-					rc = wait_for_completion_timeout
-						     (&pAdapter->cancel_rem_on_chan_var,
-						     msecs_to_jiffies
-							     (WAIT_CANCEL_REM_CHAN));
-					if (!rc) {
-						hddLog(LOGE,
-						       "%s:wait on cancel_rem_on_chan_var timed out",
-						       __func__);
-					}
-
-				} else
-					mutex_unlock(&cfgState->
-						     remain_on_chan_ctx_lock);
-			}
-		} else
-			mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-
-		if ((cfgState->remain_on_chan_ctx != NULL) &&
-		    (cfgState->current_freq == chan->center_freq)
-		    ) {
-			hddLog(LOG1, "action frame: extending the wait time");
-			extendedWait = (uint16_t) wait;
-			goto send_frame;
-		}
-
-		INIT_COMPLETION(pAdapter->offchannel_tx_event);
-
-		status = wlan_hdd_request_remain_on_channel(wiphy, dev, chan,
-							    wait, cookie,
-							    req_type);
-		if (0 != status) {
-			if ((-EBUSY == status) &&
-			    (cfgState->current_freq == chan->center_freq)) {
-				goto send_frame;
-			}
-			goto err_rem_channel;
-		}
-		/* This will extend timer in LIM when sending Any action frame
-		 * It will cover remain on channel timer till next action frame
-		 * in rx direction.
-		 */
-		extendedWait = (uint16_t) wait;
-		/* Wait for driver to be ready on the requested channel */
-		rc = wait_for_completion_timeout(&pAdapter->offchannel_tx_event,
-						 msecs_to_jiffies
-							 (WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX));
-		if (!rc) {
-			hddLog(LOGE, "wait on offchannel_tx_event timed out");
-			goto err_rem_channel;
-		}
-	} else if (offchan) {
-		/* Check before sending action frame
-		   whether we already remain on channel */
-		if (NULL == cfgState->remain_on_chan_ctx) {
-			goto err_rem_channel;
-		}
-	}
-send_frame:
-
-	if (!noack) {
-		cfgState->buf = cdf_mem_malloc(len);    /* buf; */
-		if (cfgState->buf == NULL)
-			return -ENOMEM;
-
-		cfgState->len = len;
-
-		cdf_mem_copy(cfgState->buf, buf, len);
-
-		mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-
-		if (cfgState->remain_on_chan_ctx) {
-			cfgState->action_cookie =
-				cfgState->remain_on_chan_ctx->cookie;
-			*cookie = cfgState->action_cookie;
-		} else {
-			*cookie = (uintptr_t) cfgState->buf;
-			cfgState->action_cookie = *cookie;
-		}
-
-		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-	}
-
-	/*
-	 * Firmware needs channel information for action frames
-	 * which are not sent on the current operating channel of VDEV
-	 */
-	if ((WLAN_HDD_P2P_DEVICE == pAdapter->device_mode) ||
-		(WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-		(WLAN_HDD_P2P_GO == pAdapter->device_mode)) {
-		if (chan && (chan->center_freq != 0))
-			current_freq = chan->center_freq;
-		else
-			current_freq = cfgState->current_freq;
-	} else {
-		current_freq = 0;
-	}
-
-	INIT_COMPLETION(pAdapter->tx_action_cnf_event);
-
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-	    (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
-	    ) {
-		uint8_t sessionId = pAdapter->sessionId;
-
-		if ((type == SIR_MAC_MGMT_FRAME) &&
-		    (subType == SIR_MAC_MGMT_ACTION) &&
-		    (buf[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] ==
-		     WLAN_HDD_PUBLIC_ACTION_FRAME)) {
-			actionFrmType =
-				buf[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET];
-			hddLog(LOG1, "Tx Action Frame %u", actionFrmType);
-			if (actionFrmType == WLAN_HDD_PROV_DIS_REQ) {
-				cfgState->actionFrmState =
-					HDD_PD_REQ_ACK_PENDING;
-				hddLog(LOG1, "%s: HDD_PD_REQ_ACK_PENDING",
-				       __func__);
-			} else if (actionFrmType == WLAN_HDD_GO_NEG_REQ) {
-				cfgState->actionFrmState =
-					HDD_GO_NEG_REQ_ACK_PENDING;
-				hddLog(LOG1, "%s: HDD_GO_NEG_REQ_ACK_PENDING",
-				       __func__);
-			}
-		}
-
-		if (CDF_STATUS_SUCCESS !=
-		    sme_send_action(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				    sessionId, buf, len, extendedWait, noack,
-				    current_freq)) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-				  "%s: sme_send_action returned fail", __func__);
-			goto err;
-		}
-	} else if (WLAN_HDD_SOFTAP == pAdapter->device_mode ||
-		   WLAN_HDD_P2P_GO == pAdapter->device_mode) {
-		if (CDF_STATUS_SUCCESS !=
-#ifdef WLAN_FEATURE_MBSSID
-		    wlansap_send_action(WLAN_HDD_GET_SAP_CTX_PTR(pAdapter),
-#else
-		    wlansap_send_action((WLAN_HDD_GET_CTX(pAdapter))->
-					pcds_context,
-#endif
-					buf, len, 0, current_freq)) {
-			hddLog(LOGE,
-				FL("wlansap_send_action returned fail"));
-			goto err;
-		}
-	}
-
-	return 0;
-err:
-	if (!noack) {
-		hdd_send_action_cnf(pAdapter, false);
-	}
-	return 0;
-err_rem_channel:
-	*cookie = (uintptr_t) cfgState;
-	cfg80211_mgmt_tx_status(
-		pAdapter->dev->ieee80211_ptr,
-		*cookie, buf, len, false, GFP_KERNEL);
-	EXIT();
-	return 0;
-}
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
-		     struct cfg80211_mgmt_tx_params *params, u64 *cookie)
-#else
-int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
-		     struct ieee80211_channel *chan, bool offchan,
-		     unsigned int wait,
-		     const u8 *buf, size_t len, bool no_cck,
-		     bool dont_wait_for_ack, u64 *cookie)
-#endif /* LINUX_VERSION_CODE */
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
-	ret = __wlan_hdd_mgmt_tx(wiphy, wdev, params->chan, params->offchan,
-				 params->wait, params->buf, params->len,
-				 params->no_cck, params->dont_wait_for_ack,
-				 cookie);
-#else
-	ret = __wlan_hdd_mgmt_tx(wiphy, wdev, chan, offchan,
-				 wait, buf, len, no_cck,
-				 dont_wait_for_ack, cookie);
-#endif /* LINUX_VERSION_CODE */
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
-					    struct wireless_dev *wdev,
-					    u64 cookie)
-{
-	return wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy, wdev, cookie);
-}
-
-int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
-					  struct wireless_dev *wdev, u64 cookie)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(wiphy, wdev, cookie);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-void hdd_send_action_cnf(hdd_adapter_t *pAdapter, bool actionSendSuccess)
-{
-	hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-
-	cfgState->actionFrmState = HDD_IDLE;
-
-	hddLog(LOG1, "Send Action cnf, actionSendSuccess %d",
-	       actionSendSuccess);
-
-	if (NULL == cfgState->buf) {
-		return;
-	}
-
-	/*
-	 * buf is the same pointer it passed us to send. Since we are sending
-	 * it through control path, we use different buffers.
-	 * In case of mac80211, they just push it to the skb and pass the same
-	 * data while sending tx ack status.
-	 * */
-	cfg80211_mgmt_tx_status(
-		pAdapter->dev->ieee80211_ptr,
-		cfgState->action_cookie,
-		cfgState->buf, cfgState->len,
-		actionSendSuccess, GFP_KERNEL);
-
-	cdf_mem_free(cfgState->buf);
-	cfgState->buf = NULL;
-
-	complete(&pAdapter->tx_action_cnf_event);
-}
-
-/**
- * hdd_set_p2p_noa
- *
- ***FUNCTION:
- * This function is called from hdd_hostapd_ioctl function when Driver
- * get P2P_SET_NOA comand from wpa_supplicant using private ioctl
- *
- ***LOGIC:
- * Fill NoA Struct According to P2P Power save Option and Pass it to SME layer
- *
- ***ASSUMPTIONS:
- *
- *
- ***NOTE:
- *
- * @param dev          Pointer to net device structure
- * @param command      Pointer to command
- *
- * @return Status
- */
-
-int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	tP2pPsConfig NoA;
-	int count, duration, start_time;
-	char *param;
-	int ret;
-
-	param = strnchr(command, strlen(command), ' ');
-	if (param == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: strnchr failed to find delimeter", __func__);
-		return -EINVAL;
-	}
-	param++;
-	ret = sscanf(param, "%d %d %d", &count, &start_time, &duration);
-	if (ret != 3) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: P2P_SET GO NoA: fail to read params, ret=%d",
-			  __func__, ret);
-		return -EINVAL;
-	}
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: P2P_SET GO NoA: count=%d start_time=%d duration=%d",
-		  __func__, count, start_time, duration);
-	duration = MS_TO_MUS(duration);
-	/* PS Selection
-	 * Periodic NoA (2)
-	 * Single NOA   (4)
-	 */
-	NoA.opp_ps = 0;
-	NoA.ctWindow = 0;
-	if (count == 1) {
-		NoA.duration = 0;
-		NoA.single_noa_duration = duration;
-		NoA.psSelection = P2P_POWER_SAVE_TYPE_SINGLE_NOA;
-	} else {
-		NoA.duration = duration;
-		NoA.single_noa_duration = 0;
-		NoA.psSelection = P2P_POWER_SAVE_TYPE_PERIODIC_NOA;
-	}
-	NoA.interval = MS_TO_MUS(100);
-	NoA.count = count;
-	NoA.sessionid = pAdapter->sessionId;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: P2P_PS_ATTR:oppPS %d ctWindow %d duration %d "
-		  "interval %d count %d single noa duration %d "
-		  "PsSelection %x", __func__, NoA.opp_ps,
-		  NoA.ctWindow, NoA.duration, NoA.interval,
-		  NoA.count, NoA.single_noa_duration, NoA.psSelection);
-
-	sme_p2p_set_ps(hHal, &NoA);
-	return 0;
-}
-
-/**
- * hdd_set_p2p_opps
- *
- ***FUNCTION:
- * This function is called from hdd_hostapd_ioctl function when Driver
- * get P2P_SET_PS comand from wpa_supplicant using private ioctl
- *
- ***LOGIC:
- * Fill NoA Struct According to P2P Power save Option and Pass it to SME layer
- *
- ***ASSUMPTIONS:
- *
- *
- ***NOTE:
- *
- * @param  dev         Pointer to net device structure
- * @param  command     Pointer to command
- *
- * @return Status
- */
-
-int hdd_set_p2p_opps(struct net_device *dev, uint8_t *command)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	tP2pPsConfig NoA;
-	char *param;
-	int legacy_ps, opp_ps, ctwindow;
-	int ret;
-
-	param = strnchr(command, strlen(command), ' ');
-	if (param == NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: strnchr failed to find delimiter", __func__);
-		return -EINVAL;
-	}
-	param++;
-	ret = sscanf(param, "%d %d %d", &legacy_ps, &opp_ps, &ctwindow);
-	if (ret != 3) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: P2P_SET GO PS: fail to read params, ret=%d",
-			  __func__, ret);
-		return -EINVAL;
-	}
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: P2P_SET GO PS: legacy_ps=%d opp_ps=%d ctwindow=%d",
-		  __func__, legacy_ps, opp_ps, ctwindow);
-
-	/* PS Selection
-	 * Opportunistic Power Save (1)
-	 */
-
-	/* From wpa_cli user need to use separate command to set ctWindow and Opps
-	 * When user want to set ctWindow during that time other parameters
-	 * values are coming from wpa_supplicant as -1.
-	 * Example : User want to set ctWindow with 30 then wpa_cli command :
-	 * P2P_SET ctwindow 30
-	 * Command Received at hdd_hostapd_ioctl is as below:
-	 * P2P_SET_PS -1 -1 30 (legacy_ps = -1, opp_ps = -1, ctwindow = 30)
-	 */
-	if (ctwindow != -1) {
-
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-			  "Opportunistic Power Save is %s",
-			  (true == pAdapter->ops) ? "Enable" : "Disable");
-
-		if (ctwindow != pAdapter->ctw) {
-			pAdapter->ctw = ctwindow;
-
-			if (pAdapter->ops) {
-				NoA.opp_ps = pAdapter->ops;
-				NoA.ctWindow = pAdapter->ctw;
-				NoA.duration = 0;
-				NoA.single_noa_duration = 0;
-				NoA.interval = 0;
-				NoA.count = 0;
-				NoA.psSelection =
-					P2P_POWER_SAVE_TYPE_OPPORTUNISTIC;
-				NoA.sessionid = pAdapter->sessionId;
-
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: P2P_PS_ATTR:oppPS %d ctWindow %d duration %d "
-					  "interval %d count %d single noa duration %d "
-					  "PsSelection %x", __func__,
-					  NoA.opp_ps, NoA.ctWindow,
-					  NoA.duration, NoA.interval, NoA.count,
-					  NoA.single_noa_duration,
-					  NoA.psSelection);
-
-				sme_p2p_set_ps(hHal, &NoA);
-			}
-			return 0;
-		}
-	}
-
-	if (opp_ps != -1) {
-		pAdapter->ops = opp_ps;
-
-		if ((opp_ps != -1) && (pAdapter->ctw)) {
-			NoA.opp_ps = opp_ps;
-			NoA.ctWindow = pAdapter->ctw;
-			NoA.duration = 0;
-			NoA.single_noa_duration = 0;
-			NoA.interval = 0;
-			NoA.count = 0;
-			NoA.psSelection = P2P_POWER_SAVE_TYPE_OPPORTUNISTIC;
-			NoA.sessionid = pAdapter->sessionId;
-
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				  "%s: P2P_PS_ATTR:oppPS %d ctWindow %d duration %d "
-				  "interval %d count %d single noa duration %d "
-				  "PsSelection %x", __func__, NoA.opp_ps,
-				  NoA.ctWindow, NoA.duration, NoA.interval,
-				  NoA.count, NoA.single_noa_duration,
-				  NoA.psSelection);
-
-			sme_p2p_set_ps(hHal, &NoA);
-		}
-	}
-	return 0;
-}
-
-int hdd_set_p2p_ps(struct net_device *dev, void *msgData)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	tP2pPsConfig NoA;
-	p2p_app_setP2pPs_t *pappNoA = (p2p_app_setP2pPs_t *) msgData;
-
-	NoA.opp_ps = pappNoA->opp_ps;
-	NoA.ctWindow = pappNoA->ctWindow;
-	NoA.duration = pappNoA->duration;
-	NoA.interval = pappNoA->interval;
-	NoA.count = pappNoA->count;
-	NoA.single_noa_duration = pappNoA->single_noa_duration;
-	NoA.psSelection = pappNoA->psSelection;
-	NoA.sessionid = pAdapter->sessionId;
-
-	sme_p2p_set_ps(hHal, &NoA);
-	return status;
-}
-
-static uint8_t wlan_hdd_get_session_type(enum nl80211_iftype type)
-{
-	uint8_t sessionType;
-
-	switch (type) {
-	case NL80211_IFTYPE_AP:
-		sessionType = WLAN_HDD_SOFTAP;
-		break;
-	case NL80211_IFTYPE_P2P_GO:
-		sessionType = WLAN_HDD_P2P_GO;
-		break;
-	case NL80211_IFTYPE_P2P_CLIENT:
-		sessionType = WLAN_HDD_P2P_CLIENT;
-		break;
-	case NL80211_IFTYPE_STATION:
-		sessionType = WLAN_HDD_INFRA_STATION;
-		break;
-	default:
-		sessionType = WLAN_HDD_INFRA_STATION;
-		break;
-	}
-
-	return sessionType;
-}
-
-struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
-						 const char *name,
-						 enum nl80211_iftype type,
-						 u32 *flags,
-						 struct vif_params *params)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
-	hdd_adapter_t *pAdapter = NULL;
-	hdd_scaninfo_t *scan_info = NULL;
-	int ret;
-	uint8_t session_type;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return ERR_PTR(-EINVAL);
-	}
-
-	ret = wlan_hdd_validate_context(pHddCtx);
-	if (0 != ret)
-		return ERR_PTR(ret);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_ADD_VIRTUAL_INTF, NO_SESSION, type));
-	/*
-	 * Allow addition multiple interfaces for WLAN_HDD_P2P_GO,
-	 * WLAN_HDD_SOFTAP, WLAN_HDD_P2P_CLIENT and WLAN_HDD_INFRA_STATION
-	 * session type.
-	 */
-	session_type = wlan_hdd_get_session_type(type);
-	if ((hdd_get_adapter(pHddCtx, session_type) != NULL)
-#ifdef WLAN_FEATURE_MBSSID
-	    && WLAN_HDD_SOFTAP != session_type
-	    && WLAN_HDD_P2P_GO != session_type
-#endif
-	    && WLAN_HDD_P2P_CLIENT != session_type
-	    && WLAN_HDD_INFRA_STATION != session_type) {
-		hddLog(LOGE,
-		       "%s: Interface type %d already exists. "
-		       "Two interfaces of same type are not supported currently.",
-		       __func__, type);
-		return ERR_PTR(-EINVAL);
-	}
-
-	wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx);
-
-	pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION);
-	if (pAdapter != NULL) {
-		scan_info = &pAdapter->scan_info;
-		if (scan_info->mScanPending) {
-			hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId,
-						eCSR_SCAN_ABORT_DEFAULT);
-			hddLog(LOG1,
-			       FL("Abort Scan while adding virtual interface"));
-		}
-	}
-
-	pAdapter = NULL;
-	if (pHddCtx->config->isP2pDeviceAddrAdministrated &&
-	    ((NL80211_IFTYPE_P2P_GO == type) ||
-	     (NL80211_IFTYPE_P2P_CLIENT == type))) {
-		/*
-		 * Generate the P2P Interface Address. this address must be
-		 * different from the P2P Device Address.
-		 */
-		struct cdf_mac_addr p2pDeviceAddress =
-						pHddCtx->p2pDeviceAddress;
-		p2pDeviceAddress.bytes[4] ^= 0x80;
-		pAdapter = hdd_open_adapter(pHddCtx,
-					    wlan_hdd_get_session_type(type),
-					    name, p2pDeviceAddress.bytes, true);
-	} else {
-		pAdapter =
-			hdd_open_adapter(pHddCtx, wlan_hdd_get_session_type(type),
-					 name, wlan_hdd_get_intf_addr(pHddCtx),
-					 true);
-	}
-
-	if (NULL == pAdapter) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: hdd_open_adapter failed",
-		       __func__);
-		return ERR_PTR(-ENOSPC);
-	}
-	EXIT();
-	return pAdapter->dev->ieee80211_ptr;
-}
-
-struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
-					       const char *name,
-					       enum nl80211_iftype type,
-					       u32 *flags,
-					       struct vif_params *params)
-{
-	struct wireless_dev *wdev;
-
-	cds_ssr_protect(__func__);
-	wdev = __wlan_hdd_add_virtual_intf(wiphy, name, type, flags, params);
-	cds_ssr_unprotect(__func__);
-	return wdev;
-}
-
-int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
-{
-	struct net_device *dev = wdev->netdev;
-	hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
-	hdd_adapter_t *pVirtAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	int status;
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_DEL_VIRTUAL_INTF,
-			 pVirtAdapter->sessionId, pVirtAdapter->device_mode));
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-	       hdd_device_mode_to_string(pVirtAdapter->device_mode),
-	       pVirtAdapter->device_mode);
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	wlan_hdd_release_intf_addr(pHddCtx,
-				   pVirtAdapter->macAddressCurrent.bytes);
-
-	hdd_stop_adapter(pHddCtx, pVirtAdapter, true);
-	hdd_close_adapter(pHddCtx, pVirtAdapter, true);
-	EXIT();
-	return 0;
-}
-
-int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_del_virtual_intf(wiphy, wdev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-void __hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
-			     uint32_t nFrameLength,
-			     uint8_t *pbFrames,
-			     uint8_t frameType, uint32_t rxChan, int8_t rxRssi)
-{
-	uint16_t freq;
-	uint16_t extend_time;
-	uint8_t type = 0;
-	uint8_t subType = 0;
-	tActionFrmType actionFrmType;
-	hdd_cfg80211_state_t *cfgState = NULL;
-	CDF_STATUS status;
-	hdd_remain_on_chan_ctx_t *pRemainChanCtx = NULL;
-	hdd_context_t *pHddCtx;
-
-	hddLog(CDF_TRACE_LEVEL_INFO, "%s: Frame Type = %d Frame Length = %d",
-	       __func__, frameType, nFrameLength);
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("pAdapter is NULL"));
-		return;
-	}
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	if (0 == nFrameLength) {
-		hddLog(LOGE, FL("Frame Length is Invalid ZERO"));
-		return;
-	}
-
-	if (NULL == pbFrames) {
-		hddLog(LOGE, FL("pbFrames is NULL"));
-		return;
-	}
-
-	type = WLAN_HDD_GET_TYPE_FRM_FC(pbFrames[0]);
-	subType = WLAN_HDD_GET_SUBTYPE_FRM_FC(pbFrames[0]);
-
-	/* Get pAdapter from Destination mac address of the frame */
-	if ((type == SIR_MAC_MGMT_FRAME) && (subType != SIR_MAC_MGMT_PROBE_REQ)) {
-		pAdapter =
-			hdd_get_adapter_by_macaddr(WLAN_HDD_GET_CTX(pAdapter),
-						   &pbFrames
-						   [WLAN_HDD_80211_FRM_DA_OFFSET]);
-		if (NULL == pAdapter) {
-			/*
-			 * Under assumtion that we don't receive any action
-			 * frame with BCST as destination,
-			 * we are dropping action frame
-			 */
-			hddLog(LOGP,
-			       "pAdapter for action frame is NULL Macaddr = "
-			       MAC_ADDRESS_STR,
-			       MAC_ADDR_ARRAY(&pbFrames
-					      [WLAN_HDD_80211_FRM_DA_OFFSET]));
-			hddLog(LOGP,
-			       FL("Frame Type = %d Frame Length = %d subType = %d"),
-				frameType, nFrameLength, subType);
-			return;
-		}
-	}
-
-	if (NULL == pAdapter->dev) {
-		hddLog(LOGE, FL("pAdapter->dev is NULL"));
-		return;
-	}
-
-	if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) {
-		hddLog(LOGE, FL("pAdapter has invalid magic"));
-		return;
-	}
-
-	/* Channel indicated may be wrong. TODO */
-	/* Indicate an action frame. */
-	if (rxChan <= MAX_NO_OF_2_4_CHANNELS)
-		freq = ieee80211_channel_to_frequency(rxChan,
-						      IEEE80211_BAND_2GHZ);
-	else
-		freq = ieee80211_channel_to_frequency(rxChan,
-						      IEEE80211_BAND_5GHZ);
-
-	cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
-
-	if ((type == SIR_MAC_MGMT_FRAME) && (subType == SIR_MAC_MGMT_ACTION)) {
-		if (pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] ==
-		    WLAN_HDD_PUBLIC_ACTION_FRAME) {
-			/* Public action frame */
-			if ((pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1]
-			     == SIR_MAC_ACTION_VENDOR_SPECIFIC) &&
-			    cdf_mem_compare(&pbFrames
-					    [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET
-					     + 2], SIR_MAC_P2P_OUI,
-					    SIR_MAC_P2P_OUI_SIZE)) {
-			/* P2P action frames */
-				u8 *macFrom =
-					&pbFrames[WLAN_HDD_80211_FRM_DA_OFFSET + 6];
-				actionFrmType =
-					pbFrames
-					[WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET];
-				hddLog(LOG1, "Rx Action Frame %u",
-				       actionFrmType);
-#ifdef WLAN_FEATURE_P2P_DEBUG
-				if (actionFrmType >= MAX_P2P_ACTION_FRAME_TYPE) {
-					hddLog(CDF_TRACE_LEVEL_ERROR,
-					       "[P2P] unknown[%d] <--- OTA"
-					       " from " MAC_ADDRESS_STR,
-					       actionFrmType,
-					       MAC_ADDR_ARRAY(macFrom));
-				} else {
-					hddLog(CDF_TRACE_LEVEL_ERROR,
-					       "[P2P] %s <--- OTA" " from "
-					       MAC_ADDRESS_STR,
-					       p2p_action_frame_type
-					       [actionFrmType],
-					       MAC_ADDR_ARRAY(macFrom));
-					if ((actionFrmType ==
-					     WLAN_HDD_PROV_DIS_REQ)
-					    && (global_p2p_connection_status ==
-						P2P_NOT_ACTIVE)) {
-						global_p2p_connection_status =
-							P2P_GO_NEG_PROCESS;
-						hddLog(LOGE,
-						       "[P2P State]Inactive state to "
-						       "GO negotiation progress state");
-					} else
-					if ((actionFrmType ==
-					     WLAN_HDD_GO_NEG_CNF)
-					    && (global_p2p_connection_status ==
-						P2P_GO_NEG_PROCESS)) {
-						global_p2p_connection_status =
-							P2P_GO_NEG_COMPLETED;
-						hddLog(LOGE,
-						       "[P2P State]GO negotiation progress to "
-						       "GO negotiation completed state");
-					} else
-					if ((actionFrmType ==
-					     WLAN_HDD_INVITATION_REQ)
-					    && (global_p2p_connection_status ==
-						P2P_NOT_ACTIVE)) {
-						global_p2p_connection_status =
-							P2P_GO_NEG_COMPLETED;
-						hddLog(LOGE,
-						       "[P2P State]Inactive state to GO negotiation"
-						       " completed state Autonomous GO formation");
-					}
-				}
-#endif
-				mutex_lock(&cfgState->remain_on_chan_ctx_lock);
-				pRemainChanCtx = cfgState->remain_on_chan_ctx;
-				if (pRemainChanCtx != NULL) {
-					if (actionFrmType == WLAN_HDD_GO_NEG_REQ
-					    || actionFrmType ==
-					    WLAN_HDD_GO_NEG_RESP
-					    || actionFrmType ==
-					    WLAN_HDD_INVITATION_REQ
-					    || actionFrmType ==
-					    WLAN_HDD_DEV_DIS_REQ
-					    || actionFrmType ==
-					    WLAN_HDD_PROV_DIS_REQ) {
-						hddLog(LOG1,
-						       "Extend RoC timer on reception of Action Frame");
-
-						if ((actionFrmType ==
-						     WLAN_HDD_GO_NEG_REQ)
-						    || (actionFrmType ==
-							WLAN_HDD_GO_NEG_RESP))
-							extend_time =
-								2 *
-								ACTION_FRAME_DEFAULT_WAIT;
-						else
-							extend_time =
-								ACTION_FRAME_DEFAULT_WAIT;
-
-						if (completion_done
-							    (&pAdapter->
-							    rem_on_chan_ready_event)) {
-							if (CDF_TIMER_STATE_RUNNING == cdf_mc_timer_get_current_state(&pRemainChanCtx->hdd_remain_on_chan_timer)) {
-								cdf_mc_timer_stop
-									(&pRemainChanCtx->
-									hdd_remain_on_chan_timer);
-								status =
-									cdf_mc_timer_start
-										(&pRemainChanCtx->
-										hdd_remain_on_chan_timer,
-										extend_time);
-								if (status !=
-								    CDF_STATUS_SUCCESS) {
-									hddLog
-										(LOGE,
-										"%s: Remain on Channel timer start failed",
-										__func__);
-								}
-							} else {
-								hddLog(LOG1,
-								       "%s: Rcvd action frame after timer expired",
-								       __func__);
-							}
-						} else {
-							/* Buffer Packet */
-							if (pRemainChanCtx->
-							    action_pkt_buff.
-							    frame_length == 0) {
-								pRemainChanCtx->
-								action_pkt_buff.
-								frame_length
-									=
-										nFrameLength;
-								pRemainChanCtx->
-								action_pkt_buff.
-								freq = freq;
-								pRemainChanCtx->
-								action_pkt_buff.
-								frame_ptr =
-									cdf_mem_malloc
-										(nFrameLength);
-								cdf_mem_copy
-									(pRemainChanCtx->
-									action_pkt_buff.
-									frame_ptr,
-									pbFrames,
-									nFrameLength);
-								hddLog(LOGE,
-								       "%s:"
-								       "Action Pkt Cached successfully !!!",
-								       __func__);
-							} else {
-								hddLog(LOGE,
-								       "%s:"
-								       "Frames are pending. dropping frame !!!",
-								       __func__);
-							}
-							mutex_unlock(&cfgState->
-								     remain_on_chan_ctx_lock);
-							return;
-						}
-					}
-				}
-				mutex_unlock(&cfgState->
-					     remain_on_chan_ctx_lock);
-
-				if (((actionFrmType == WLAN_HDD_PROV_DIS_RESP)
-				     && (cfgState->actionFrmState ==
-					 HDD_PD_REQ_ACK_PENDING))
-				    || ((actionFrmType == WLAN_HDD_GO_NEG_RESP)
-					&& (cfgState->actionFrmState ==
-					    HDD_GO_NEG_REQ_ACK_PENDING))) {
-					hddLog(LOG1,
-					       "%s: ACK_PENDING and But received RESP for Action frame ",
-					       __func__);
-					hdd_send_action_cnf(pAdapter, true);
-				}
-			}
-#ifdef FEATURE_WLAN_TDLS
-			else if (pbFrames
-				 [WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1] ==
-				 WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP) {
-				u8 *mac =
-					&pbFrames[WLAN_HDD_80211_FRM_DA_OFFSET + 6];
-
-				hddLog(LOG1,
-				       "[TDLS] TDLS Discovery Response,"
-				       MAC_ADDRESS_STR " RSSI[%d] <--- OTA",
-				       MAC_ADDR_ARRAY(mac), rxRssi);
-
-				wlan_hdd_tdls_set_rssi(pAdapter, mac, rxRssi);
-				wlan_hdd_tdls_recv_discovery_resp(pAdapter,
-								  mac);
-			}
-#endif
-		}
-
-		if (pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] ==
-		    WLAN_HDD_TDLS_ACTION_FRAME) {
-			actionFrmType =
-				pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1];
-			if (actionFrmType >= MAX_TDLS_ACTION_FRAME_TYPE) {
-				hddLog(LOG1,
-				       "[TDLS] unknown[%d] <--- OTA",
-				       actionFrmType);
-			} else {
-				hddLog(LOG1,
-				       "[TDLS] %s <--- OTA",
-				       tdls_action_frame_type[actionFrmType]);
-			}
-		}
-
-		if ((pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET] ==
-		     WLAN_HDD_QOS_ACTION_FRAME)
-		    && (pbFrames[WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET + 1] ==
-			WLAN_HDD_QOS_MAP_CONFIGURE)) {
-			sme_update_dsc_pto_up_mapping(pHddCtx->hHal,
-						      pAdapter->hddWmmDscpToUpMap,
-						      pAdapter->sessionId);
-		}
-	}
-	/* Indicate Frame Over Normal Interface */
-	hddLog(LOG1, FL("Indicate Frame over NL80211 Interface"));
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
-	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames,
-			 nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
-	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames,
-			 nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED,
-			 GFP_ATOMIC);
-#else
-	cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0,
-			 pbFrames, nFrameLength, GFP_ATOMIC);
-#endif /* LINUX_VERSION_CODE */
-}
-

+ 0 - 2325
core/hdd/src/wlan_hdd_power.c

@@ -1,2325 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_power.c
- *
- * WLAN power management functions
- *
- */
-
-/* Include files */
-
-#include <linux/pm.h>
-#include <linux/wait.h>
-#include <linux/cpu.h>
-#include <wlan_hdd_includes.h>
-#if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)
-#include <linux/wakelock.h>
-#endif
-#include "cdf_types.h"
-#include "sme_api.h"
-#include <cds_api.h>
-#include <cds_sched.h>
-#include <mac_init_api.h>
-#include <wlan_qct_sys.h>
-#include <wlan_hdd_main.h>
-#include <wlan_hdd_assoc.h>
-#include <wlan_nlink_srv.h>
-#include <wlan_hdd_misc.h>
-#include <wlan_hdd_power.h>
-#include <dbglog_host.h>
-#include <wlan_hdd_trace.h>
-
-#include <linux/semaphore.h>
-#include <wlan_hdd_hostapd.h>
-#include "cfg_api.h"
-
-#include <linux/inetdevice.h>
-#include <wlan_hdd_cfg.h>
-#include <wlan_hdd_cfg80211.h>
-#include <net/addrconf.h>
-#include <wlan_hdd_ipa.h>
-
-#include <wma_types.h>
-#include "hif.h"
-#include "sme_power_save_api.h"
-#include "cds_concurrency.h"
-
-/* Preprocessor definitions and constants */
-#define HDD_SSR_BRING_UP_TIME 30000
-
-/* Type declarations */
-
-/**
- * enum hdd_power_mode - Power Mode enumerations
- * @DRIVER_POWER_MODE_AUTO: Driver can place device into power save
- * @DRIVER_POWER_MODE_ACTIVE: Driver should operate at full power
- */
-enum hdd_power_mode {
-	DRIVER_POWER_MODE_AUTO = 0,
-	DRIVER_POWER_MODE_ACTIVE = 1,
-};
-
-/* Function and variables declarations */
-
-extern struct notifier_block hdd_netdev_notifier;
-
-static struct timer_list ssr_timer;
-static bool ssr_timer_started;
-/**
- * hdd_conf_gtk_offload() - Configure GTK offload
- * @pAdapter:   pointer to the adapter
- * @fenable:    flag set to enable (1) or disable (0) GTK offload
- *
- * Central function to enable or disable GTK offload.
- *
- * Return: nothing
- */
-#ifdef WLAN_FEATURE_GTK_OFFLOAD
-static void hdd_conf_gtk_offload(hdd_adapter_t *pAdapter, bool fenable)
-{
-	CDF_STATUS ret;
-	tSirGtkOffloadParams hddGtkOffloadReqParams;
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	if (fenable) {
-		if ((eConnectionState_Associated ==
-		     pHddStaCtx->conn_info.connState)
-		    && (GTK_OFFLOAD_ENABLE ==
-			pHddStaCtx->gtkOffloadReqParams.ulFlags)) {
-			cdf_mem_copy(&hddGtkOffloadReqParams,
-				     &pHddStaCtx->gtkOffloadReqParams,
-				     sizeof(tSirGtkOffloadParams));
-
-			ret = sme_set_gtk_offload(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						  &hddGtkOffloadReqParams,
-						  pAdapter->sessionId);
-			if (CDF_STATUS_SUCCESS != ret) {
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_ERROR,
-					  "%s: sme_set_gtk_offload failed, returned %d",
-					  __func__, ret);
-				return;
-			}
-
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				  "%s: sme_set_gtk_offload successfull",
-				  __func__);
-		}
-
-	} else {
-		if ((eConnectionState_Associated ==
-		     pHddStaCtx->conn_info.connState)
-		    && (cdf_is_macaddr_equal(&pHddStaCtx->gtkOffloadReqParams.bssid,
-			       &pHddStaCtx->conn_info.bssId))
-		    && (GTK_OFFLOAD_ENABLE ==
-			pHddStaCtx->gtkOffloadReqParams.ulFlags)) {
-
-			/* Host driver has previously offloaded GTK rekey  */
-			ret = sme_get_gtk_offload
-				(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				 wlan_hdd_cfg80211_update_replay_counter_callback,
-				 pAdapter, pAdapter->sessionId);
-			if (CDF_STATUS_SUCCESS != ret) {
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_ERROR,
-					  "%s: sme_get_gtk_offload failed, returned %d",
-					  __func__, ret);
-				return;
-			} else {
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: sme_get_gtk_offload successful",
-					  __func__);
-
-				/* Sending GTK offload dissable */
-				memcpy(&hddGtkOffloadReqParams,
-				       &pHddStaCtx->gtkOffloadReqParams,
-				       sizeof(tSirGtkOffloadParams));
-				hddGtkOffloadReqParams.ulFlags =
-					GTK_OFFLOAD_DISABLE;
-				ret =
-					sme_set_gtk_offload(WLAN_HDD_GET_HAL_CTX
-								    (pAdapter),
-							    &hddGtkOffloadReqParams,
-							    pAdapter->sessionId);
-				if (CDF_STATUS_SUCCESS != ret) {
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: failed to dissable GTK offload, returned %d",
-						  __func__, ret);
-					return;
-				}
-				CDF_TRACE(CDF_MODULE_ID_HDD,
-					  CDF_TRACE_LEVEL_INFO,
-					  "%s: successfully dissabled GTK offload request to HAL",
-					  __func__);
-			}
-		}
-	}
-	return;
-}
-#else /* WLAN_FEATURE_GTK_OFFLOAD */
-static void hdd_conf_gtk_offload(hdd_adapter_t *pAdapter, bool fenable)
-{
-}
-#endif /*WLAN_FEATURE_GTK_OFFLOAD */
-
-#ifdef WLAN_NS_OFFLOAD
-/**
- * __wlan_hdd_ipv6_changed() - IPv6 notifier callback function
- * @nb: notifier block that was registered with the kernel
- * @data: (unused) generic data that was registered with the kernel
- * @arg: (unused) generic argument that was registered with the kernel
- *
- * This is a callback function that is registered with the kernel via
- * register_inet6addr_notifier() which allows the driver to be
- * notified when there is an IPv6 address change.
- *
- * Return: NOTIFY_DONE to indicate we don't care what happens with
- *	other callbacks
- */
-static int __wlan_hdd_ipv6_changed(struct notifier_block *nb,
-				 unsigned long data, void *arg)
-{
-	struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)arg;
-	struct net_device *ndev = ifa->idev->dev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *pHddCtx;
-	int status;
-
-	ENTER();
-
-	if ((pAdapter == NULL) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
-		hddLog(LOGE, FL("Adapter context is invalid %p"), pAdapter);
-		return -EINVAL;
-	}
-
-	if ((pAdapter->dev == ndev) &&
-		(pAdapter->device_mode == WLAN_HDD_INFRA_STATION ||
-		pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)) {
-		pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-		status = wlan_hdd_validate_context(pHddCtx);
-		if (0 != status)
-			return NOTIFY_DONE;
-
-		schedule_work(&pAdapter->ipv6NotifierWorkQueue);
-	}
-	EXIT();
-	return NOTIFY_DONE;
-}
-
-/**
- * wlan_hdd_ipv6_changed() - IPv6 change notifier callback
- * @nb: pointer to notifier block
- * @data: data
- * @arg: arg
- *
- * This is the IPv6 notifier callback function gets invoked
- * if any change in IP and then invoke the function @__wlan_hdd_ipv6_changed
- * to reconfigure the offload parameters.
- *
- * Return: 0 on success, error number otherwise.
- */
-int wlan_hdd_ipv6_changed(struct notifier_block *nb,
-				unsigned long data, void *arg)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_ipv6_changed(nb, data, arg);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_conf_ns_offload() - Configure NS offload
- * @pAdapter:   pointer to the adapter
- * @fenable:    flag to enable or disable
- *              0 - disable
- *              1 - enable
- *
- * Return: nothing
- */
-static void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, bool fenable)
-{
-	struct inet6_dev *in6_dev;
-	struct inet6_ifaddr *ifp;
-	struct list_head *p;
-	uint8_t
-		selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA]
-	[SIR_MAC_IPV6_ADDR_LEN] = { {0,} };
-	bool selfIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA] = { 0 };
-	tSirHostOffloadReq offLoadRequest;
-	hdd_context_t *pHddCtx;
-
-	int i = 0;
-	CDF_STATUS returnStatus;
-	uint32_t count = 0, scope;
-
-	ENTER();
-	hddLog(LOG1, FL(" fenable = %d"), fenable);
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	/* In SAP/P2PGo mode, ARP/NS offload feature capability
-	 * is controlled by one bit.
-	 */
-
-	if ((WLAN_HDD_SOFTAP == pAdapter->device_mode ||
-		WLAN_HDD_P2P_GO == pAdapter->device_mode) &&
-		!pHddCtx->ap_arpns_support) {
-		hddLog(LOG1,
-			FL("NS Offload is not supported in SAP/P2PGO mode"));
-		return;
-	}
-
-	if (fenable) {
-		in6_dev = __in6_dev_get(pAdapter->dev);
-		if (NULL != in6_dev) {
-			/* read_lock_bh(&in6_dev->lock); */
-			list_for_each(p, &in6_dev->addr_list) {
-				if (count >=
-					SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA) {
-					hdd_err("Reached max supported NS Offload addresses");
-					break;
-				}
-				ifp =
-					list_entry(p, struct inet6_ifaddr, if_list);
-				scope = ipv6_addr_src_scope(&ifp->addr);
-
-				switch (scope) {
-				case IPV6_ADDR_SCOPE_GLOBAL:
-				case IPV6_ADDR_SCOPE_LINKLOCAL:
-					cdf_mem_copy(&selfIPv6Addr[count],
-						&ifp->addr.s6_addr,
-						sizeof(ifp->addr.s6_addr));
-					selfIPv6AddrValid[count] =
-						SIR_IPV6_ADDR_VALID;
-					hdd_info("Index %d scope = %s Address : %pI6",
-					  count,
-					  (scope == IPV6_ADDR_SCOPE_LINKLOCAL) ?
-					  "LINK LOCAL" : "GLOBAL",
-					  selfIPv6Addr[count]);
-					count += 1;
-					break;
-				default:
-					hdd_err("The Scope %d is not supported",
-						scope);
-				}
-			}
-			/* read_unlock_bh(&in6_dev->lock); */
-			cdf_mem_zero(&offLoadRequest, sizeof(offLoadRequest));
-			for (i = 0; i < count; i++) {
-				/* Filling up the request structure
-				 * Filling the selfIPv6Addr with solicited address
-				 * A Solicited-Node multicast address is created by
-				 * taking the last 24 bits of a unicast or anycast
-				 * address and appending them to the prefix
-				 *
-				 * FF02:0000:0000:0000:0000:0001:FFXX:XXXX
-				 *
-				 * here XX is the unicast/anycast bits
-				 */
-				offLoadRequest.nsOffloadInfo.selfIPv6Addr[i][0] = 0xFF;
-				offLoadRequest.nsOffloadInfo.selfIPv6Addr[i][1] = 0x02;
-				offLoadRequest.nsOffloadInfo.selfIPv6Addr[i][11] = 0x01;
-				offLoadRequest.nsOffloadInfo.selfIPv6Addr[i][12] = 0xFF;
-				offLoadRequest.nsOffloadInfo.selfIPv6Addr[i][13] =
-					selfIPv6Addr[i][13];
-				offLoadRequest.nsOffloadInfo.selfIPv6Addr[i][14] =
-					selfIPv6Addr[i][14];
-				offLoadRequest.nsOffloadInfo.selfIPv6Addr[i][15] =
-					selfIPv6Addr[i][15];
-				offLoadRequest.nsOffloadInfo.slotIdx = i;
-				cdf_mem_copy(&offLoadRequest.nsOffloadInfo.targetIPv6Addr[i],
-					&selfIPv6Addr[i][0], SIR_MAC_IPV6_ADDR_LEN);
-
-				offLoadRequest.nsOffloadInfo.targetIPv6AddrValid[i] =
-					SIR_IPV6_ADDR_VALID;
-
-				hdd_info("configuredMcastBcastFilter: %d",
-					pHddCtx->configuredMcastBcastFilter);
-
-				if ((true == pHddCtx->sus_res_mcastbcast_filter_valid)
-					&& ((HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST ==
-					pHddCtx->sus_res_mcastbcast_filter) ||
-					(HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST_BROADCAST ==
-					pHddCtx->sus_res_mcastbcast_filter))) {
-					hdd_info("Set offLoadRequest with SIR_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE");
-					offLoadRequest.enableOrDisable =
-						SIR_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE;
-				}
-
-				cdf_mem_copy(&offLoadRequest.params.hostIpv6Addr,
-					&offLoadRequest.nsOffloadInfo.targetIPv6Addr[i],
-					SIR_MAC_IPV6_ADDR_LEN);
-
-				hdd_info("Setting NSOffload with solicitedIp: %pI6, targetIp: %pI6, Index %d",
-					&offLoadRequest.nsOffloadInfo.selfIPv6Addr[i],
-					&offLoadRequest.nsOffloadInfo.targetIPv6Addr[i], i);
-			}
-			offLoadRequest.offloadType =  SIR_IPV6_NS_OFFLOAD;
-			offLoadRequest.enableOrDisable = SIR_OFFLOAD_ENABLE;
-			cdf_copy_macaddr(&offLoadRequest.nsOffloadInfo.self_macaddr,
-					 &pAdapter->macAddressCurrent);
-			/* set number of ns offload address count */
-			offLoadRequest.num_ns_offload_count = count;
-			/* Configure the Firmware with this */
-			returnStatus = sme_set_host_offload(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				pAdapter->sessionId, &offLoadRequest);
-			if (CDF_STATUS_SUCCESS != returnStatus) {
-				hdd_err("Failed to enable HostOffload feature with status: %d",
-					returnStatus);
-			}
-		} else {
-			hdd_err("IPv6 dev does not exist. Failed to request NSOffload");
-			return;
-		}
-	} else {
-		/* Disable NSOffload */
-		cdf_mem_zero((void *)&offLoadRequest, sizeof(tSirHostOffloadReq));
-		offLoadRequest.enableOrDisable = SIR_OFFLOAD_DISABLE;
-		offLoadRequest.offloadType =  SIR_IPV6_NS_OFFLOAD;
-
-		if (CDF_STATUS_SUCCESS !=
-			sme_set_host_offload(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				pAdapter->sessionId, &offLoadRequest))
-				hdd_err("Failed to disable NS Offload");
-	}
-	EXIT();
-	return;
-}
-
-/**
- * __hdd_ipv6_notifier_work_queue() - IPv6 notification work function
- * @work: registered work item
- *
- * This function performs the work initially trigged by a callback
- * from the IPv6 netdev notifier.  Since this means there has been a
- * change in IPv6 state for the interface, the NS offload is
- * reconfigured.
- *
- * Return: None
- */
-void __hdd_ipv6_notifier_work_queue(struct work_struct *work)
-{
-	hdd_adapter_t *pAdapter =
-		container_of(work, hdd_adapter_t, ipv6NotifierWorkQueue);
-	hdd_context_t *pHddCtx;
-	int status;
-
-	ENTER();
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return;
-
-	if (!pHddCtx->config->active_mode_offload) {
-		hdd_err("Active mode offload is disabled");
-		return;
-	}
-
-	if (false == pHddCtx->sus_res_mcastbcast_filter_valid) {
-		pHddCtx->sus_res_mcastbcast_filter =
-			pHddCtx->configuredMcastBcastFilter;
-		pHddCtx->sus_res_mcastbcast_filter_valid = true;
-	}
-
-	if ((eConnectionState_Associated ==
-	     (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState))
-		if (pHddCtx->config->fhostNSOffload)
-			hdd_conf_ns_offload(pAdapter, true);
-	EXIT();
-}
-
-/**
- * hdd_ipv6_notifier_work_queue() - IP V6 change notifier work handler
- * @work: Pointer to work context
- *
- * Return: none
- */
-void hdd_ipv6_notifier_work_queue(struct work_struct *work)
-{
-	cds_ssr_protect(__func__);
-	__hdd_ipv6_notifier_work_queue(work);
-	cds_ssr_unprotect(__func__);
-}
-
-/**
- * hdd_conf_hostoffload() - Central function to configure the supported offloads
- * @pAdapter:   pointer to the adapter
- * @fenable:    flag set to enable (1) or disable (0)
- *
- * Central function to configure the supported offloads either
- * enable or disable them.
- *
- * Return: nothing
- */
-void hdd_conf_hostoffload(hdd_adapter_t *pAdapter, bool fenable)
-{
-	hdd_context_t *pHddCtx;
-
-	ENTER();
-
-	hdd_info("Configuring offloads with flag: %d", fenable);
-
-	/* Get the HDD context. */
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	if (((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) &&
-	     (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode))) {
-		hdd_err("Offloads not supported in mode %d",
-			pAdapter->device_mode);
-		return;
-	}
-
-	if (eConnectionState_Associated !=
-	       (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState) {
-		hdd_err("Offloads not supported in state %d",
-			(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->
-							conn_info.connState);
-		return;
-	}
-
-	hdd_conf_gtk_offload(pAdapter, fenable);
-
-	/* Configure ARP/NS offload during cfg80211 suspend/resume and
-	 * Enable MC address filtering during cfg80211 suspend
-	 * only if active mode offload is disabled
-	 */
-	if (!pHddCtx->config->active_mode_offload) {
-		hdd_info("configuring unconfigured active mode offloads");
-		hdd_conf_arp_offload(pAdapter, fenable);
-		wlan_hdd_set_mc_addr_list(pAdapter, fenable);
-
-		if (pHddCtx->config->fhostNSOffload)
-			hdd_conf_ns_offload(pAdapter, fenable);
-	}
-	EXIT();
-	return;
-}
-#endif
-
-/**
- * __hdd_ipv4_notifier_work_queue() - IPv4 notification work function
- * @work: registered work item
- *
- * This function performs the work initially trigged by a callback
- * from the IPv4 netdev notifier.  Since this means there has been a
- * change in IPv4 state for the interface, the ARP offload is
- * reconfigured.
- *
- * Return: None
- */
-void __hdd_ipv4_notifier_work_queue(struct work_struct *work)
-{
-	hdd_adapter_t *pAdapter =
-		container_of(work, hdd_adapter_t, ipv4NotifierWorkQueue);
-	hdd_context_t *pHddCtx;
-	int status;
-
-	hdd_info("Configuring ARP Offload");
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status) {
-		hddLog(LOGE, FL("HDD context is invalid"));
-		return;
-	}
-
-	if (!pHddCtx->config->active_mode_offload) {
-		hdd_err("Active mode offload is disabled");
-		return;
-	}
-
-	if (false == pHddCtx->sus_res_mcastbcast_filter_valid) {
-		pHddCtx->sus_res_mcastbcast_filter =
-			pHddCtx->configuredMcastBcastFilter;
-		pHddCtx->sus_res_mcastbcast_filter_valid = true;
-	}
-
-	if ((eConnectionState_Associated ==
-	     (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState))
-		hdd_conf_arp_offload(pAdapter, true);
-}
-
-/**
- * hdd_ipv4_notifier_work_queue() - IP V4 change notifier work handler
- * @work: Pointer to work context
- *
- * Return: none
- */
-void hdd_ipv4_notifier_work_queue(struct work_struct *work)
-{
-	cds_ssr_protect(__func__);
-	__hdd_ipv4_notifier_work_queue(work);
-	cds_ssr_unprotect(__func__);
-}
-
-/**
- * __wlan_hdd_ipv4_changed() - IPv4 notifier callback function
- * @nb: notifier block that was registered with the kernel
- * @data: (unused) generic data that was registered with the kernel
- * @arg: (unused) generic argument that was registered with the kernel
- *
- * This is a callback function that is registered with the kernel via
- * register_inetaddr_notifier() which allows the driver to be
- * notified when there is an IPv4 address change.
- *
- * Return: NOTIFY_DONE to indicate we don't care what happens with
- *	other callbacks
- */
-static int __wlan_hdd_ipv4_changed(struct notifier_block *nb,
-				 unsigned long data, void *arg)
-{
-	struct in_ifaddr *ifa = (struct in_ifaddr *)arg;
-	struct in_ifaddr **ifap = NULL;
-	struct in_device *in_dev;
-
-	struct net_device *ndev = ifa->ifa_dev->dev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
-	hdd_context_t *pHddCtx;
-	int status;
-
-	ENTER();
-
-	if ((pAdapter == NULL) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
-		hddLog(LOGE, FL("Adapter context is invalid %p"), pAdapter);
-		return -EINVAL;
-	}
-
-	if ((pAdapter && pAdapter->dev == ndev) &&
-		(pAdapter->device_mode == WLAN_HDD_INFRA_STATION ||
-		pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)) {
-
-		pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-		status = wlan_hdd_validate_context(pHddCtx);
-		if (0 != status)
-			return NOTIFY_DONE;
-
-		if (!pHddCtx->config->fhostArpOffload) {
-			hddLog(LOG1,
-				FL("Offload not enabled ARPOffload=%d"),
-				pHddCtx->config->fhostArpOffload);
-			return NOTIFY_DONE;
-		}
-
-		in_dev = __in_dev_get_rtnl(pAdapter->dev);
-		if (in_dev) {
-			for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
-			     ifap = &ifa->ifa_next) {
-				if (!strcmp(pAdapter->dev->name,
-					    ifa->ifa_label)) {
-					break;  /* found */
-				}
-			}
-		}
-		if (ifa && ifa->ifa_local) {
-			schedule_work(&pAdapter->ipv4NotifierWorkQueue);
-		}
-	}
-	EXIT();
-	return NOTIFY_DONE;
-}
-
-/**
- * wlan_hdd_ipv4_changed() - IPv4 change notifier callback
- * @nb: pointer to notifier block
- * @data: data
- * @arg: arg
- *
- * This is the IPv4 notifier callback function gets invoked
- * if any change in IP and then invoke the function @__wlan_hdd_ipv4_changed
- * to reconfigure the offload parameters.
- *
- * Return: 0 on success, error number otherwise.
- */
-int wlan_hdd_ipv4_changed(struct notifier_block *nb,
-			unsigned long data, void *arg)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_ipv4_changed(nb, data, arg);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_conf_arp_offload() - Configure ARP offload
- * @pAdapter: Adapter context for which ARP offload is to be configured
- * @fenable: true : enable ARP offload false : disable arp offload
- *
- * Return:
- *	CDF_STATUS_SUCCESS - on successful operation,
- *	CDF_STATUS_E_FAILURE - on failure of operation
- */
-CDF_STATUS hdd_conf_arp_offload(hdd_adapter_t *pAdapter, bool fenable)
-{
-	struct in_ifaddr **ifap = NULL;
-	struct in_ifaddr *ifa = NULL;
-	struct in_device *in_dev;
-	int i = 0;
-	tSirHostOffloadReq offLoadRequest;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	hdd_info("fenable = %d", fenable);
-
-	/* In SAP/P2P Go mode, ARP/NS Offload feature capability
-	 * is controlled by one bit.
-	 */
-	if ((WLAN_HDD_SOFTAP == pAdapter->device_mode ||
-		WLAN_HDD_P2P_GO == pAdapter->device_mode) &&
-		!pHddCtx->ap_arpns_support) {
-		hddLog(LOG1,
-			FL("ARP Offload is not supported in SAP/P2PGO mode"));
-		return CDF_STATUS_SUCCESS;
-	}
-
-	if (fenable) {
-		in_dev = __in_dev_get_rtnl(pAdapter->dev);
-		if (in_dev) {
-			for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
-			     ifap = &ifa->ifa_next) {
-				if (!strcmp(pAdapter->dev->name,
-					    ifa->ifa_label)) {
-					break;  /* found */
-				}
-			}
-		}
-		if (ifa && ifa->ifa_local) {
-			offLoadRequest.offloadType = SIR_IPV4_ARP_REPLY_OFFLOAD;
-			offLoadRequest.enableOrDisable = SIR_OFFLOAD_ENABLE;
-
-			hddLog(CDF_TRACE_LEVEL_INFO, "%s: Enabled", __func__);
-
-			if (((HDD_MCASTBCASTFILTER_FILTER_ALL_BROADCAST ==
-			      pHddCtx->sus_res_mcastbcast_filter) ||
-			     (HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST_BROADCAST
-			      == pHddCtx->sus_res_mcastbcast_filter))
-			    && (true ==
-				pHddCtx->sus_res_mcastbcast_filter_valid)) {
-				offLoadRequest.enableOrDisable =
-					SIR_OFFLOAD_ARP_AND_BCAST_FILTER_ENABLE;
-				hddLog(CDF_TRACE_LEVEL_INFO,
-				       "offload: inside arp offload conditional check");
-			}
-
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       "offload: arp filter programmed = %d",
-			       offLoadRequest.enableOrDisable);
-
-			/* converting u32 to IPV4 address */
-			for (i = 0; i < 4; i++) {
-				offLoadRequest.params.hostIpv4Addr[i] =
-					(ifa->ifa_local >> (i * 8)) & 0xFF;
-			}
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       " Enable SME HostOffload: %d.%d.%d.%d",
-			       offLoadRequest.params.hostIpv4Addr[0],
-			       offLoadRequest.params.hostIpv4Addr[1],
-			       offLoadRequest.params.hostIpv4Addr[2],
-			       offLoadRequest.params.hostIpv4Addr[3]);
-
-			if (CDF_STATUS_SUCCESS !=
-			    sme_set_host_offload(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						 pAdapter->sessionId,
-						 &offLoadRequest)) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       "%s: Failed to enable HostOffload feature",
-				       __func__);
-				return CDF_STATUS_E_FAILURE;
-			}
-		} else {
-			hddLog(CDF_TRACE_LEVEL_INFO,
-			       FL("IP Address is not assigned"));
-		}
-
-		return CDF_STATUS_SUCCESS;
-	} else {
-		cdf_mem_zero((void *)&offLoadRequest,
-			     sizeof(tSirHostOffloadReq));
-		offLoadRequest.enableOrDisable = SIR_OFFLOAD_DISABLE;
-		offLoadRequest.offloadType = SIR_IPV4_ARP_REPLY_OFFLOAD;
-
-		if (CDF_STATUS_SUCCESS !=
-		    sme_set_host_offload(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					 pAdapter->sessionId, &offLoadRequest)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: Failure to disable host " "offload feature",
-			       __func__);
-			return CDF_STATUS_E_FAILURE;
-		}
-		return CDF_STATUS_SUCCESS;
-	}
-}
-
-/**
- * hdd_mcbc_filter_modification() - MCBC Filter Modifier
- * @pHddCtx: Global Hdd Context
- * @pMcBcFilter: Multicast/Broadcast filter to be modified
- *
- * This function is called before setting mcbc filters
- * to modify filter value considering different offloads
- *
- * Return: None.
- */
-static void hdd_mcbc_filter_modification(hdd_context_t *pHddCtx,
-					 uint8_t *pMcBcFilter)
-{
-	if (NULL == pHddCtx) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("NULL HDD context passed"));
-		return;
-	}
-
-	*pMcBcFilter = pHddCtx->configuredMcastBcastFilter;
-	if (pHddCtx->config->fhostArpOffload) {
-		/* ARP offload is enabled, do not block bcast packets at RXP
-		 * Will be using Bitmasking to reset the filter. As we have
-		 * disable Broadcast filtering, Anding with the negation
-		 * of Broadcast BIT
-		 */
-		*pMcBcFilter &= ~(HDD_MCASTBCASTFILTER_FILTER_ALL_BROADCAST);
-	}
-#ifdef WLAN_NS_OFFLOAD
-	if (pHddCtx->config->fhostNSOffload) {
-		/* NS offload is enabled, do not block mcast packets at RXP
-		 * Will be using Bitmasking to reset the filter. As we have
-		 * disable Multicast filtering, Anding with the negation
-		 * of Multicast BIT
-		 */
-		*pMcBcFilter &= ~(HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST);
-	}
-#endif
-
-	pHddCtx->configuredMcastBcastFilter = *pMcBcFilter;
-}
-
-/**
- * hdd_conf_mcastbcast_filter() - Configure multicast/broadcast filter
- * @pHddCtx: Global HDD context
- * @setfilter: true if filter is being set, false if filter is being cleared
- *
- * Return: None.
- */
-void hdd_conf_mcastbcast_filter(hdd_context_t *pHddCtx, bool setfilter)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-	tpSirWlanSetRxpFilters wlanRxpFilterParam =
-		cdf_mem_malloc(sizeof(tSirWlanSetRxpFilters));
-	if (NULL == wlanRxpFilterParam) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       "%s: cdf_mem_alloc failed ", __func__);
-		return;
-	}
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "%s: Configuring Mcast/Bcast Filter Setting. setfilter %d",
-	       __func__, setfilter);
-	if (true == setfilter) {
-		hdd_mcbc_filter_modification(pHddCtx,
-					     &wlanRxpFilterParam->
-					     configuredMcstBcstFilterSetting);
-	} else {
-		/*Use the current configured value to clear */
-		wlanRxpFilterParam->configuredMcstBcstFilterSetting =
-			pHddCtx->configuredMcastBcastFilter;
-	}
-
-	wlanRxpFilterParam->setMcstBcstFilter = setfilter;
-	cdf_ret_status =
-		sme_configure_rxp_filter(pHddCtx->hHal, wlanRxpFilterParam);
-
-	if (setfilter && (CDF_STATUS_SUCCESS == cdf_ret_status))
-		pHddCtx->hdd_mcastbcast_filter_set = true;
-
-	hddLog(LOG1,
-		FL("%s to post set/reset filter to lower mac with status %d configuredMcstBcstFilterSetting = %d setMcstBcstFilter = %d"),
-		(CDF_STATUS_SUCCESS != cdf_ret_status) ? "Failed" : "Success",
-		cdf_ret_status,
-		wlanRxpFilterParam->configuredMcstBcstFilterSetting,
-		wlanRxpFilterParam->setMcstBcstFilter);
-
-	if (CDF_STATUS_SUCCESS != cdf_ret_status)
-		cdf_mem_free(wlanRxpFilterParam);
-}
-
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-/**
- * wlan_hdd_set_mc_addr_list() - set MC address list in FW
- * @pAdapter: adapter whose MC list is being set
- * @set: flag which indicates if addresses are being set or cleared
- */
-void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set)
-{
-	uint8_t i;
-	tpSirRcvFltMcAddrList pMulticastAddrs = NULL;
-	tHalHandle hHal = NULL;
-	hdd_context_t *pHddCtx = (hdd_context_t *) pAdapter->pHddCtx;
-
-	if (NULL == pHddCtx) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HDD CTX is NULL"));
-		return;
-	}
-
-	hHal = pHddCtx->hHal;
-
-	if (NULL == hHal) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HAL Handle is NULL"));
-		return;
-	}
-
-	/* Check if INI is enabled or not, other wise just return
-	 */
-	if (!pHddCtx->config->fEnableMCAddrList) {
-		hddLog(CDF_TRACE_LEVEL_INFO,
-		       FL("gMCAddrListEnable is not enabled in INI"));
-		return;
-	}
-	pMulticastAddrs = cdf_mem_malloc(sizeof(tSirRcvFltMcAddrList));
-	if (NULL == pMulticastAddrs) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Could not allocate Memory"));
-		return;
-	}
-	cdf_mem_zero(pMulticastAddrs, sizeof(tSirRcvFltMcAddrList));
-	pMulticastAddrs->action = set;
-
-	if (set) {
-		/* Following pre-conditions should be satisfied before we
-		 * configure the MC address list.
-		 */
-		if (((pAdapter->device_mode == WLAN_HDD_INFRA_STATION)
-		     || (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT))
-		    && pAdapter->mc_addr_list.mc_cnt
-		    && (eConnectionState_Associated ==
-			(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->
-			conn_info.connState)) {
-			pMulticastAddrs->ulMulticastAddrCnt =
-				pAdapter->mc_addr_list.mc_cnt;
-			for (i = 0; i < pAdapter->mc_addr_list.mc_cnt;
-			     i++) {
-				memcpy(pMulticastAddrs->multicastAddr[i].bytes,
-				       pAdapter->mc_addr_list.addr[i],
-				       sizeof(pAdapter->mc_addr_list.
-					      addr[i]));
-				hdd_info("%s multicast filter: addr ="
-				       MAC_ADDRESS_STR,
-				       set ? "setting" : "clearing",
-				       MAC_ADDR_ARRAY(pMulticastAddrs->
-						      multicastAddr[i].bytes));
-			}
-			/* Set multicast filter */
-			sme_8023_multicast_list(hHal, pAdapter->sessionId,
-						pMulticastAddrs);
-		}
-	} else {
-		/* Need to clear only if it was previously configured */
-		if (pAdapter->mc_addr_list.isFilterApplied) {
-			pMulticastAddrs->ulMulticastAddrCnt =
-				pAdapter->mc_addr_list.mc_cnt;
-			for (i = 0; i < pAdapter->mc_addr_list.mc_cnt;
-			     i++) {
-				memcpy(pMulticastAddrs->multicastAddr[i].bytes,
-				       pAdapter->mc_addr_list.addr[i],
-				       sizeof(pAdapter->mc_addr_list.
-					      addr[i]));
-			}
-			sme_8023_multicast_list(hHal, pAdapter->sessionId,
-						pMulticastAddrs);
-		}
-
-	}
-	/* MAddrCnt is MulticastAddrCnt */
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "smeSessionId:%d; set:%d; MCAdddrCnt :%d",
-	       pAdapter->sessionId, set,
-	       pMulticastAddrs->ulMulticastAddrCnt);
-
-	pAdapter->mc_addr_list.isFilterApplied = set ? true : false;
-	cdf_mem_free(pMulticastAddrs);
-	return;
-}
-#endif
-
-/**
- * hdd_update_mcastbcast_filter(): cache multi and broadcast filter for suspend
- * @hdd_ctx: hdd context
- *
- * Cache the configured filter to be used in suspend resume.
- */
-static void hdd_update_mcastbcast_filter(hdd_context_t *hdd_ctx)
-{
-	if (false == hdd_ctx->sus_res_mcastbcast_filter_valid) {
-		hdd_ctx->sus_res_mcastbcast_filter =
-			hdd_ctx->configuredMcastBcastFilter;
-		hdd_ctx->sus_res_mcastbcast_filter_valid = true;
-		hdd_info("configuredMCastBcastFilter saved = %d",
-			hdd_ctx->configuredMcastBcastFilter);
-	}
-}
-
-/**
- * hdd_conf_suspend_ind() - Send Suspend notification
- * @pHddCtx: HDD Global context
- * @pAdapter: adapter being suspended
- * @callback: callback function to be called upon completion
- * @callbackContext: callback context to be passed back to callback function
- *
- * Return: None.
- */
-static void hdd_send_suspend_ind(hdd_context_t *pHddCtx,
-				uint32_t conn_state_mask,
-				 void (*callback)(void *callbackContext,
-						  bool suspended),
-				 void *callbackContext)
-{
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-
-	hdd_info("%s: send wlan suspend indication", __func__);
-
-	cdf_ret_status =
-		sme_configure_suspend_ind(pHddCtx->hHal, conn_state_mask,
-					  callback, callbackContext);
-
-	if (CDF_STATUS_SUCCESS == cdf_ret_status) {
-		pHddCtx->hdd_mcastbcast_filter_set = true;
-	} else {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("sme_configure_suspend_ind returned failure %d"),
-		       cdf_ret_status);
-	}
-}
-
-/**
- * hdd_conf_suspend_ind() - Send Resume notification
- * @pAdapter: adapter being resumed
- *
- * Return: None.
- */
-static void hdd_conf_resume_ind(hdd_adapter_t *pAdapter)
-{
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
-
-	cdf_ret_status = sme_configure_resume_req(pHddCtx->hHal, NULL);
-
-	if (CDF_STATUS_SUCCESS != cdf_ret_status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: sme_configure_resume_req return failure %d",
-		       __func__, cdf_ret_status);
-
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "%s: send wlan resume indication", __func__);
-	/* Disable supported OffLoads */
-	hdd_conf_hostoffload(pAdapter, false);
-	pHddCtx->hdd_mcastbcast_filter_set = false;
-
-	if (true == pHddCtx->sus_res_mcastbcast_filter_valid) {
-		pHddCtx->configuredMcastBcastFilter =
-			pHddCtx->sus_res_mcastbcast_filter;
-		pHddCtx->sus_res_mcastbcast_filter_valid = false;
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "offload: in hdd_conf_resume_ind, restoring configuredMcastBcastFilter");
-	hddLog(CDF_TRACE_LEVEL_INFO, "configuredMcastBcastFilter = %d",
-	       pHddCtx->configuredMcastBcastFilter);
-}
-
-/**
- * hdd_update_conn_state_mask(): record info needed by wma_suspend_req
- * @adapter: adapter to get info from
- * @conn_state_mask: mask of connection info
- *
- * currently only need to send connection info.
- */
-static void
-hdd_update_conn_state_mask(hdd_adapter_t *adapter, uint32_t *conn_state_mask)
-{
-
-	eConnectionState connState;
-	hdd_station_ctx_t *sta_ctx;
-	sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
-	connState = sta_ctx->conn_info.connState;
-
-	if (connState == eConnectionState_Associated ||
-			connState == eConnectionState_IbssConnected)
-		*conn_state_mask |= (1 << adapter->sessionId);
-}
-
-/**
- * hdd_suspend_wlan() - Driver suspend function
- * @callback: Callback function to invoke when driver is ready to suspend
- * @callbackContext: Context to pass back to @callback function
- *
- * Return: None.
- */
-static void
-hdd_suspend_wlan(void (*callback)(void *callbackContext, bool suspended),
-		 void *callbackContext)
-{
-	hdd_context_t *pHddCtx;
-
-	CDF_STATUS status;
-	hdd_adapter_t *pAdapter = NULL;
-	hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
-	uint32_t conn_state_mask = 0;
-
-	hdd_info("%s: WLAN being suspended by OS", __func__);
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!pHddCtx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: HDD context is Null",
-		       __func__);
-		return;
-	}
-
-	if (cds_is_driver_recovering()) {
-		hdd_err("Recovery in Progress. State: 0x%x Ignore suspend!!!",
-			 cds_get_driver_state());
-		return;
-	}
-
-	hdd_update_mcastbcast_filter(pHddCtx);
-
-	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
-	while (NULL != pAdapterNode && CDF_STATUS_SUCCESS == status) {
-		pAdapter = pAdapterNode->pAdapter;
-
-		/* stop all TX queues before suspend */
-		hddLog(LOG1, FL("Disabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE,
-					   WLAN_CONTROL_PATH);
-
-		/* Configure supported OffLoads */
-		hdd_conf_hostoffload(pAdapter, true);
-
-		hdd_update_conn_state_mask(pAdapter, &conn_state_mask);
-
-		status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
-
-		pAdapterNode = pNext;
-	}
-
-	hdd_send_suspend_ind(pHddCtx, conn_state_mask, callback,
-			callbackContext);
-
-	pHddCtx->hdd_wlan_suspended = true;
-
-	return;
-}
-
-/**
- * hdd_resume_wlan() - Driver resume function
- *
- * Return: None.
- */
-static void hdd_resume_wlan(void)
-{
-	hdd_context_t *pHddCtx;
-	hdd_adapter_t *pAdapter = NULL;
-	hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
-	CDF_STATUS status;
-
-	hddLog(CDF_TRACE_LEVEL_INFO, "%s: WLAN being resumed by OS",
-	       __func__);
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!pHddCtx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: HDD context is Null",
-		       __func__);
-		return;
-	}
-
-	if (cds_is_driver_recovering()) {
-		hdd_warn("Recovery in Progress. State: 0x%x Ignore resume!!!",
-			 cds_get_driver_state());
-		return;
-	}
-
-	pHddCtx->hdd_wlan_suspended = false;
-
-	/*loop through all adapters. Concurrency */
-	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
-
-	while (NULL != pAdapterNode && CDF_STATUS_SUCCESS == status) {
-		pAdapter = pAdapterNode->pAdapter;
-
-		/* wake the tx queues */
-		hddLog(LOG1, FL("Enabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter,
-					WLAN_WAKE_ALL_NETIF_QUEUE,
-					WLAN_CONTROL_PATH);
-
-		hdd_conf_resume_ind(pAdapter);
-
-		status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
-		pAdapterNode = pNext;
-	}
-	hdd_ipa_resume(pHddCtx);
-
-	return;
-}
-
-/**
- * DOC: SSR Timer
- *
- * When SSR is initiated, an SSR timer is started.  Under normal
- * circumstances SSR should complete amd the timer should be deleted
- * before it fires.  If the SSR timer does fire, it indicates SSR has
- * taken too long, and our only recourse is to invoke the CDF_BUG()
- * API which can allow a crashdump to be captured.
- */
-
-/**
- * hdd_ssr_timer_init() - Initialize SSR Timer
- *
- * Return: None.
- */
-static void hdd_ssr_timer_init(void)
-{
-	init_timer(&ssr_timer);
-}
-
-/**
- * hdd_ssr_timer_del() - Delete SSR Timer
- *
- * Return: None.
- */
-static void hdd_ssr_timer_del(void)
-{
-	del_timer(&ssr_timer);
-	ssr_timer_started = false;
-}
-
-/**
- * hdd_ssr_timer_cb() - SSR Timer callback function
- * @data: opaque data registered with timer infrastructure
- *
- * Return: None.
- */
-static void hdd_ssr_timer_cb(unsigned long data)
-{
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: HDD SSR timer expired!", __func__);
-	CDF_BUG(0);
-}
-
-/**
- * hdd_ssr_timer_start() - Start SSR Timer
- * @msec: Timer timeout value in milliseconds
- *
- * Return: None.
- */
-static void hdd_ssr_timer_start(int msec)
-{
-	if (ssr_timer_started) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       "%s: Trying to start SSR timer when " "it's running!",
-		       __func__);
-	}
-	ssr_timer.expires = jiffies + msecs_to_jiffies(msec);
-	ssr_timer.function = hdd_ssr_timer_cb;
-	add_timer(&ssr_timer);
-	ssr_timer_started = true;
-}
-
-/**
- * hdd_wlan_shutdown() - HDD SSR shutdown function
- *
- * This function is called by the HIF to shutdown the driver during SSR.
- *
- * Return: CDF_STATUS_SUCCESS if the driver was shut down,
- *	or an error status otherwise
- */
-CDF_STATUS hdd_wlan_shutdown(void)
-{
-	CDF_STATUS cdf_status;
-	v_CONTEXT_t p_cds_context = NULL;
-	hdd_context_t *pHddCtx;
-	p_cds_sched_context cds_sched_context = NULL;
-
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: WLAN driver shutting down!",
-	       __func__);
-
-#ifdef WLAN_FEATURE_LPSS
-	wlan_hdd_send_status_pkg(NULL, NULL, 0, 0);
-#endif
-
-	/* If SSR never completes, then do kernel panic. */
-	hdd_ssr_timer_init();
-	hdd_ssr_timer_start(HDD_SSR_BRING_UP_TIME);
-
-	/* Get the global CDS context. */
-	p_cds_context = cds_get_global_context();
-	if (!p_cds_context) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: Global CDS context is Null",
-		       __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* Get the HDD context. */
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!pHddCtx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: HDD context is Null",
-		       __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cds_set_recovery_in_progress(true);
-
-	cds_clear_concurrent_session_count();
-
-	hdd_reset_all_adapters(pHddCtx);
-
-	hdd_ipa_uc_ssr_deinit();
-
-	cds_sched_context = get_cds_sched_ctxt();
-
-	/* Wakeup all driver threads */
-	if (true == pHddCtx->isMcThreadSuspended) {
-		complete(&cds_sched_context->ResumeMcEvent);
-		pHddCtx->isMcThreadSuspended = false;
-	}
-#ifdef QCA_CONFIG_SMP
-	if (true == pHddCtx->is_ol_rx_thread_suspended) {
-		complete(&cds_sched_context->ol_resume_rx_event);
-		pHddCtx->is_ol_rx_thread_suspended = false;
-	}
-#endif
-
-	/* Stop all the threads; we do not want any messages to be a processed,
-	 * any more and the best way to ensure that is to terminate the threads
-	 * gracefully.
-	 */
-	/* Wait for MC to exit */
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: Shutting down MC thread", __func__);
-	set_bit(MC_SHUTDOWN_EVENT_MASK, &cds_sched_context->mcEventFlag);
-	set_bit(MC_POST_EVENT_MASK, &cds_sched_context->mcEventFlag);
-	wake_up_interruptible(&cds_sched_context->mcWaitQueue);
-	wait_for_completion(&cds_sched_context->McShutdown);
-
-#ifdef QCA_CONFIG_SMP
-	/* Wait for OL RX to exit */
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: Shutting down OL RX thread",
-	       __func__);
-	unregister_hotcpu_notifier(cds_sched_context->cpu_hot_plug_notifier);
-	set_bit(RX_SHUTDOWN_EVENT_MASK, &cds_sched_context->ol_rx_event_flag);
-	set_bit(RX_POST_EVENT_MASK, &cds_sched_context->ol_rx_event_flag);
-	wake_up_interruptible(&cds_sched_context->ol_rx_wait_queue);
-	wait_for_completion(&cds_sched_context->ol_rx_shutdown);
-	cds_sched_context->ol_rx_thread = NULL;
-	cds_drop_rxpkt_by_staid(cds_sched_context, WLAN_MAX_STA_COUNT);
-	cds_free_ol_rx_pkt_freeq(cds_sched_context);
-#endif
-
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: Doing WMA STOP", __func__);
-	cdf_status = wma_stop(p_cds_context, HAL_STOP_TYPE_RF_KILL);
-
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to stop WMA", __func__);
-		CDF_ASSERT(CDF_IS_STATUS_SUCCESS(cdf_status));
-		wma_setneedshutdown(p_cds_context);
-	}
-
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: Doing SME STOP", __func__);
-	/* Stop SME - Cannot invoke cds_disable as cds_disable relies
-	 * on threads being running to process the SYS Stop
-	 */
-	cdf_status = sme_stop(pHddCtx->hHal, HAL_STOP_TYPE_SYS_RESET);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to stop sme %d", __func__, cdf_status);
-		CDF_ASSERT(0);
-	}
-
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: Doing MAC STOP", __func__);
-	/* Stop MAC (PE and HAL) */
-	cdf_status = mac_stop(pHddCtx->hHal, HAL_STOP_TYPE_SYS_RESET);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to stop mac %d", __func__, cdf_status);
-		CDF_ASSERT(0);
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO, "%s: Flush Queues", __func__);
-	/* Clean up message queues of TX, RX and MC thread */
-	cds_sched_flush_mc_mqs(cds_sched_context);
-
-	/* Deinit all the TX, RX and MC queues */
-	cds_sched_deinit_mqs(cds_sched_context);
-
-	hddLog(CDF_TRACE_LEVEL_INFO, "%s: Doing CDS Shutdown", __func__);
-	/* shutdown CDS */
-	cds_shutdown(p_cds_context);
-
-	/*mac context has already been released in mac_close call
-	   so setting it to NULL in hdd context */
-	pHddCtx->hHal = (tHalHandle) NULL;
-
-	hddLog(CDF_TRACE_LEVEL_FATAL, "%s: WLAN driver shutdown complete",
-	       __func__);
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_wlan_re_init() - HDD SSR re-init function
- *
- * This function is called by the HIF to re-initialize the driver after SSR.
- *
- * Return: CDF_STATUS_SUCCESS if the driver was re-initialized,
- *	or an error status otherwise
- */
-CDF_STATUS hdd_wlan_re_init(void *hif_sc)
-{
-	CDF_STATUS cdf_status;
-	v_CONTEXT_t p_cds_context = NULL;
-	hdd_context_t *pHddCtx = NULL;
-	CDF_STATUS cdf_ret_status;
-	hdd_adapter_t *pAdapter;
-	int i;
-
-	hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT);
-
-	/* Get the CDS context */
-	p_cds_context = cds_get_global_context();
-	if (p_cds_context == NULL) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       "%s: Failed cds_get_global_context", __func__);
-		goto err_re_init;
-	}
-
-	/* Get the HDD context */
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (!pHddCtx) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: HDD context is Null",
-		       __func__);
-		goto err_re_init;
-	}
-
-	if (!hif_sc) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: hif_sc is NULL", __func__);
-		goto err_re_init;
-	}
-
-	((cds_context_type *) p_cds_context)->pHIFContext = hif_sc;
-
-	/* The driver should always be initialized in STA mode after SSR */
-	hdd_set_conparam(0);
-
-	/* Re-open CDS, it is a re-open b'se control transport was never closed. */
-	cdf_status = cds_open();
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: cds_open failed", __func__);
-		goto err_re_init;
-	}
-
-	/* Save the hal context in Adapter */
-	pHddCtx->hHal = cds_get_context(CDF_MODULE_ID_SME);
-	if (NULL == pHddCtx->hHal) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: HAL context is null",
-		       __func__);
-		goto err_cds_close;
-	}
-
-	cdf_status = cds_pre_enable(pHddCtx->pcds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hdd_alert("cds_pre_enable failed");
-		goto err_cds_close;
-	}
-
-	/*
-	 * Note that the cds_pre_enable() sequence triggers the cfg download.
-	 * The cfg download must occur before we update the SME config
-	 * since the SME config operation must access the cfg database.
-	 * Set the SME configuration parameters.
-	 */
-	cdf_status = hdd_set_sme_config(pHddCtx);
-	if (CDF_STATUS_SUCCESS != cdf_status) {
-		hdd_alert("Failed hdd_set_sme_config");
-		goto err_cds_close;
-	}
-
-	ol_txrx_register_pause_cb(wlan_hdd_txrx_pause_cb);
-
-	cdf_status = hdd_set_sme_chan_list(pHddCtx);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       "%s: Failed to init channel list", __func__);
-		goto err_cds_close;
-	}
-
-	/* Apply the cfg.ini to cfg.dat */
-	if (false == hdd_update_config_dat(pHddCtx)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: config update failed",
-		       __func__);
-		goto err_cds_close;
-	}
-
-	/* Set the MAC Address, currently this is used by HAL to add self sta.
-	 * Remove this once self sta is added as part of session open. */
-	cdf_ret_status = cfg_set_str(pHddCtx->hHal, WNI_CFG_STA_ID,
-				     (uint8_t *) &pHddCtx->config->
-				     intfMacAddr[0],
-				     sizeof(pHddCtx->config->intfMacAddr[0]));
-	if (!CDF_IS_STATUS_SUCCESS(cdf_ret_status)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s: Failed to set MAC Address. "
-		       "HALStatus is %08d [x%08x]", __func__, cdf_ret_status,
-		       cdf_ret_status);
-		goto err_cds_close;
-	}
-
-	/* Start CDS which starts up the SME/MAC/HAL modules and everything else
-	   Note: Firmware image will be read and downloaded inside cds_enable API */
-	cdf_status = cds_enable(p_cds_context);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, "%s: cds_enable failed", __func__);
-		goto err_cds_close;
-	}
-
-	cdf_status = hdd_post_cds_enable_config(pHddCtx);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       "%s: hdd_post_cds_enable_config failed", __func__);
-		goto err_cds_disable;
-	}
-
-	/* Try to get an adapter from mode ID */
-	pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION);
-	if (!pAdapter) {
-		pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_SOFTAP);
-		if (!pAdapter) {
-			pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_IBSS);
-			if (!pAdapter) {
-				hddLog(CDF_TRACE_LEVEL_FATAL,
-				       "%s: Failed to get Adapter!", __func__);
-			}
-		}
-	}
-
-	if (hdd_ipa_uc_ssr_reinit())
-		hddLog(LOGE, "%s: HDD IPA UC reinit failed", __func__);
-
-	/* Get WLAN Host/FW/HW version */
-	if (pAdapter)
-		hdd_wlan_get_version(pAdapter, NULL, NULL);
-
-	/* Pass FW version to HIF layer */
-	hif_set_fw_info(hif_sc, pHddCtx->target_fw_version);
-
-	/* Restart all adapters */
-	hdd_start_all_adapters(pHddCtx);
-
-	/* Reconfigure FW logs after SSR */
-	if (pAdapter) {
-		if (pHddCtx->fw_log_settings.enable != 0) {
-			wma_cli_set_command(pAdapter->sessionId,
-					    WMI_DBGLOG_MODULE_ENABLE,
-					    pHddCtx->fw_log_settings.enable,
-					    DBG_CMD);
-		} else {
-			wma_cli_set_command(pAdapter->sessionId,
-					    WMI_DBGLOG_MODULE_DISABLE,
-					    pHddCtx->fw_log_settings.enable,
-					    DBG_CMD);
-		}
-
-		if (pHddCtx->fw_log_settings.dl_report != 0) {
-			wma_cli_set_command(pAdapter->sessionId,
-					    WMI_DBGLOG_REPORT_ENABLE,
-					    pHddCtx->fw_log_settings.
-					    dl_report, DBG_CMD);
-
-			wma_cli_set_command(pAdapter->sessionId,
-					    WMI_DBGLOG_TYPE,
-					    pHddCtx->fw_log_settings.
-					    dl_type, DBG_CMD);
-
-			wma_cli_set_command(pAdapter->sessionId,
-					    WMI_DBGLOG_LOG_LEVEL,
-					    pHddCtx->fw_log_settings.
-					    dl_loglevel, DBG_CMD);
-
-			for (i = 0; i < MAX_MOD_LOGLEVEL; i++) {
-				if (pHddCtx->fw_log_settings.
-						dl_mod_loglevel[i] != 0) {
-					wma_cli_set_command(
-						pAdapter->sessionId,
-						WMI_DBGLOG_MOD_LOG_LEVEL,
-						pHddCtx->fw_log_settings.
-							dl_mod_loglevel[i],
-						DBG_CMD);
-				}
-			}
-		}
-	}
-
-	pHddCtx->hdd_mcastbcast_filter_set = false;
-	pHddCtx->btCoexModeSet = false;
-	hdd_ssr_timer_del();
-
-	wlan_hdd_send_svc_nlink_msg(WLAN_SVC_FW_CRASHED_IND, NULL, 0);
-
-	/* Allow the phone to go to sleep */
-	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT);
-
-	sme_ext_scan_register_callback(pHddCtx->hHal,
-				wlan_hdd_cfg80211_extscan_callback);
-	sme_set_rssi_threshold_breached_cb(pHddCtx->hHal, hdd_rssi_threshold_breached);
-
-#ifdef WLAN_FEATURE_LPSS
-	wlan_hdd_send_all_scan_intf_info(pHddCtx);
-	wlan_hdd_send_version_pkg(pHddCtx->target_fw_version,
-				  pHddCtx->target_hw_version,
-				  pHddCtx->target_hw_name);
-#endif
-
-	hif_enable_power_gating(hif_sc);
-	hddLog(LOGE,
-		"%s: WLAN host driver reinitiation completed!", __func__);
-	goto success;
-
-err_cds_disable:
-	cds_disable(p_cds_context);
-
-err_cds_close:
-	cds_close(p_cds_context);
-	cds_sched_close(p_cds_context);
-	if (pHddCtx) {
-		/* Unregister the Net Device Notifier */
-		unregister_netdevice_notifier(&hdd_netdev_notifier);
-#ifdef WLAN_KD_READY_NOTIFIER
-		cnss_diag_notify_wlan_close();
-		ptt_sock_deactivate_svc();
-#endif /* WLAN_KD_READY_NOTIFIER */
-		nl_srv_exit();
-
-		/* Free up dynamically allocated members inside HDD Adapter */
-		kfree(pHddCtx->config);
-		pHddCtx->config = NULL;
-
-		wiphy_unregister(pHddCtx->wiphy);
-		wiphy_free(pHddCtx->wiphy);
-
-		if (!CDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) {
-			hdd_err("Failed to deinit policy manager");
-			/* Proceed and complete the clean up */
-		}
-	}
-
-err_re_init:
-	/* Allow the phone to go to sleep */
-	hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT);
-	CDF_BUG(0);
-	return -EPERM;
-
-success:
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * wlan_hdd_set_powersave() - Set powersave mode
- * @adapter: adapter upon which the request was received
- * @mode: desired powersave mode
- *
- * Return: 0 on success, non-zero on any error
- */
-static int
-wlan_hdd_set_powersave(hdd_adapter_t *adapter, enum hdd_power_mode mode)
-{
-	tHalHandle hal;
-	hdd_context_t *hdd_ctx;
-
-	if (NULL == adapter) {
-		hddLog(CDF_TRACE_LEVEL_FATAL, FL("Adapter NULL"));
-		return -ENODEV;
-	}
-
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (!hdd_ctx) {
-		hdd_err(FL("hdd context is NULL"));
-		return -EINVAL;
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO_HIGH, FL("power mode=%d"), mode);
-	hal = WLAN_HDD_GET_HAL_CTX(adapter);
-
-
-	if (DRIVER_POWER_MODE_ACTIVE == mode) {
-		hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-		       FL("Wlan driver Entering Full Power"));
-
-		/*
-		 * Enter Full power command received from GUI
-		 * this means we are disconnected
-		 */
-		sme_ps_enable_disable(hal, adapter->sessionId, SME_PS_DISABLE);
-	} else if (DRIVER_POWER_MODE_AUTO == mode) {
-		if ((WLAN_HDD_INFRA_STATION == adapter->device_mode) ||
-				(WLAN_HDD_P2P_CLIENT == adapter->device_mode)) {
-			hddLog(LOG1, FL("Disabling Auto Power save timer"));
-			sme_ps_disable_auto_ps_timer(WLAN_HDD_GET_HAL_CTX
-					(adapter),
-					adapter->sessionId);
-		}
-		if (hdd_ctx->config && hdd_ctx->config->is_ps_enabled) {
-			hddLog(LOG1, FL("Wlan driver Entering Power save"));
-
-			/*
-			 * Enter Power Save command received from GUI
-			 * this means DHCP is completed
-			 */
-			sme_ps_enable_disable(hal, adapter->sessionId,
-					SME_PS_ENABLE);
-		} else {
-			hddLog(CDF_TRACE_LEVEL_INFO_HIGH,
-				FL("Power Save is not enabled in the cfg"));
-		}
-	}
-	return 0;
-}
-
-/**
- * __wlan_hdd_cfg80211_resume_wlan() - cfg80211 resume callback
- * @wiphy: Pointer to wiphy
- *
- * This API is called when cfg80211 driver resumes driver updates
- * latest sched_scan scan result(if any) to cfg80211 database
- *
- * Return: integer status
- */
-static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
-{
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	hdd_adapter_t *pAdapter;
-	hdd_adapter_list_node_t *pAdapterNode, *pNext;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	int result;
-	p_cds_sched_context cds_sched_context = get_cds_sched_ctxt();
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	result = wlan_hdd_validate_context(pHddCtx);
-	if (0 != result)
-		return result;
-#ifdef CONFIG_CNSS
-	cnss_request_bus_bandwidth(CNSS_BUS_WIDTH_MEDIUM);
-#endif
-
-	/* Resume MC thread */
-	if (pHddCtx->isMcThreadSuspended) {
-		complete(&cds_sched_context->ResumeMcEvent);
-		pHddCtx->isMcThreadSuspended = false;
-	}
-#ifdef QCA_CONFIG_SMP
-	/* Resume tlshim Rx thread */
-	if (pHddCtx->is_ol_rx_thread_suspended) {
-		complete(&cds_sched_context->ol_resume_rx_event);
-		pHddCtx->is_ol_rx_thread_suspended = false;
-	}
-#endif
-	hdd_resume_wlan();
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_RESUME_WLAN,
-			 NO_SESSION, pHddCtx->isWiphySuspended));
-	cdf_spin_lock(&pHddCtx->sched_scan_lock);
-	pHddCtx->isWiphySuspended = false;
-	if (true != pHddCtx->isSchedScanUpdatePending) {
-		cdf_spin_unlock(&pHddCtx->sched_scan_lock);
-		hddLog(LOG1, FL("Return resume is not due to PNO indication"));
-		return 0;
-	}
-	/* Reset flag to avoid updatating cfg80211 data old results again */
-	pHddCtx->isSchedScanUpdatePending = false;
-	cdf_spin_unlock(&pHddCtx->sched_scan_lock);
-
-	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
-
-	while (NULL != pAdapterNode && CDF_STATUS_SUCCESS == status) {
-		pAdapter = pAdapterNode->pAdapter;
-		if ((NULL != pAdapter) &&
-		    (WLAN_HDD_INFRA_STATION == pAdapter->device_mode)) {
-			if (0 !=
-			    wlan_hdd_cfg80211_update_bss(pHddCtx->wiphy,
-							 pAdapter, 0)) {
-				hddLog(LOGW, FL("NO SCAN result"));
-			} else {
-				/* Acquire wakelock to handle the case where
-				 * APP's tries to suspend immediately after
-				 * updating the scan results. Whis results in
-				 * app's is in suspended state and not able to
-				 * process the connect request to AP
-				 */
-				hdd_prevent_suspend_timeout(2000,
-					WIFI_POWER_EVENT_WAKELOCK_RESUME_WLAN);
-				cfg80211_sched_scan_results(pHddCtx->wiphy);
-			}
-
-			hddLog(LOG1,
-			       FL("cfg80211 scan result database updated"));
-			EXIT();
-			return result;
-		}
-		status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
-		pAdapterNode = pNext;
-	}
-
-	hddLog(LOG1, FL("Failed to find Adapter"));
-	EXIT();
-	return result;
-}
-
-/**
- * wlan_hdd_cfg80211_ready_to_suspend() - set cfg80211 ready to suspend event
- * @callbackContext: Pointer to callback context
- * @suspended: Suspend flag
- *
- * Return: none
- */
-static void wlan_hdd_cfg80211_ready_to_suspend(void *callbackContext,
-						bool suspended)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) callbackContext;
-	pHddCtx->suspended = suspended;
-	complete(&pHddCtx->ready_to_suspend);
-}
-
-/**
- * wlan_hdd_cfg80211_resume_wlan() - cfg80211 resume callback
- * @wiphy: Pointer to wiphy
- *
- * This API is called when cfg80211 driver resumes driver updates
- * latest sched_scan scan result(if any) to cfg80211 database
- *
- * Return: integer status
- */
-int wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_resume_wlan(wiphy);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_suspend_wlan() - cfg80211 suspend callback
- * @wiphy: Pointer to wiphy
- * @wow: Pointer to wow
- *
- * This API is called when cfg80211 driver suspends
- *
- * Return: integer status
- */
-static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
-				     struct cfg80211_wowlan *wow)
-{
-#ifdef QCA_CONFIG_SMP
-#define RX_TLSHIM_SUSPEND_TIMEOUT 200   /* msecs */
-#endif
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	p_cds_sched_context cds_sched_context = get_cds_sched_ctxt();
-	hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL;
-	hdd_adapter_t *pAdapter;
-	hdd_scaninfo_t *pScanInfo;
-	CDF_STATUS status;
-	int rc;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	rc = wlan_hdd_validate_context(pHddCtx);
-	if (0 != rc)
-		return rc;
-
-	/* If RADAR detection is in progress (HDD), prevent suspend. The flag
-	 * "dfs_cac_block_tx" is set to true when RADAR is found and stay true
-	 * until CAC is done for a SoftAP which is in started state.
-	 */
-	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
-	while (NULL != pAdapterNode && CDF_STATUS_SUCCESS == status) {
-		pAdapter = pAdapterNode->pAdapter;
-		if (WLAN_HDD_SOFTAP == pAdapter->device_mode) {
-			if (BSS_START ==
-			    WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter)->bssState &&
-			    true ==
-			    WLAN_HDD_GET_AP_CTX_PTR(pAdapter)->
-			    dfs_cac_block_tx) {
-				hddLog(LOG1,
-					FL("RADAR detection in progress, do not allow suspend"));
-				return -EAGAIN;
-			} else if (!pHddCtx->config->enableSapSuspend) {
-				/* return -EOPNOTSUPP if SAP does not support
-				 * suspend
-				 */
-				hddLog(LOGE,
-					FL("SAP does not support suspend!!"));
-				return -EOPNOTSUPP;
-			}
-		} else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) {
-			if (!pHddCtx->config->enableSapSuspend) {
-				/* return -EOPNOTSUPP if GO does not support
-				 * suspend
-				 */
-				hddLog(LOGE,
-					FL("GO does not support suspend!!"));
-				return -EOPNOTSUPP;
-			}
-		}
-		status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
-		pAdapterNode = pNext;
-	}
-
-	/* Stop ongoing scan on each interface */
-	status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
-	while (NULL != pAdapterNode && CDF_STATUS_SUCCESS == status) {
-		pAdapter = pAdapterNode->pAdapter;
-		pScanInfo = &pAdapter->scan_info;
-
-		if (sme_sta_in_middle_of_roaming
-			    (pHddCtx->hHal, pAdapter->sessionId)) {
-			hddLog(LOG1,
-				FL("Roaming in progress, do not allow suspend"));
-			return -EAGAIN;
-		}
-
-		if (pHddCtx->config->is_ps_enabled) {
-			if (sme_is_auto_ps_timer_running(pHddCtx->hHal,
-						pAdapter->sessionId)) {
-				hddLog(LOGE,
-					FL("Auto Power save timer is running; Do not allow suspend"));
-				return -EAGAIN;
-			} else {
-				sme_ps_enable_disable(pHddCtx->hHal,
-						pAdapter->sessionId,
-						SME_PS_ENABLE);
-				hddLog(LOG1,
-					FL("Auto PS timer is not running; allow suspend and enter into power save"));
-			}
-		}
-
-		if (pScanInfo->mScanPending) {
-			INIT_COMPLETION(pScanInfo->abortscan_event_var);
-			hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId,
-					   eCSR_SCAN_ABORT_DEFAULT);
-
-			status =
-				wait_for_completion_timeout(&pScanInfo->
-				    abortscan_event_var,
-				    msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN));
-			if (!status) {
-				hddLog(LOGE,
-					FL("Timeout occurred while waiting for abort scan"));
-				return -ETIME;
-			}
-		}
-		status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
-		pAdapterNode = pNext;
-	}
-
-	/*
-	 * Suspend IPA early before proceeding to suspend other entities like
-	 * firmware to avoid any race conditions.
-	 */
-	if (hdd_ipa_suspend(pHddCtx)) {
-		hddLog(LOG1, FL("IPA not ready to suspend!"));
-		return -EAGAIN;
-	}
-
-	/* Wait for the target to be ready for suspend */
-	INIT_COMPLETION(pHddCtx->ready_to_suspend);
-
-	hdd_suspend_wlan(&wlan_hdd_cfg80211_ready_to_suspend, pHddCtx);
-
-	rc = wait_for_completion_timeout(&pHddCtx->ready_to_suspend,
-		msecs_to_jiffies(WLAN_WAIT_TIME_READY_TO_SUSPEND));
-	if (!rc) {
-		hddLog(LOGE, FL("Failed to get ready to suspend"));
-		goto resume_tx;
-	}
-
-	if (!pHddCtx->suspended) {
-		hddLog(LOGE, FL("Faied as suspend_status is wrong:%d"),
-			pHddCtx->suspended);
-		goto resume_tx;
-	}
-
-	/* Suspend MC thread */
-	set_bit(MC_SUSPEND_EVENT_MASK, &cds_sched_context->mcEventFlag);
-	wake_up_interruptible(&cds_sched_context->mcWaitQueue);
-
-	/* Wait for suspend confirmation from MC thread */
-	rc = wait_for_completion_timeout(&pHddCtx->mc_sus_event_var,
-		msecs_to_jiffies(WLAN_WAIT_TIME_MCTHREAD_SUSPEND));
-	if (!rc) {
-		clear_bit(MC_SUSPEND_EVENT_MASK,
-			  &cds_sched_context->mcEventFlag);
-		hddLog(LOGE, FL("Failed to stop mc thread"));
-		goto resume_tx;
-	}
-
-	pHddCtx->isMcThreadSuspended = true;
-
-#ifdef QCA_CONFIG_SMP
-	/* Suspend tlshim rx thread */
-	set_bit(RX_SUSPEND_EVENT_MASK, &cds_sched_context->ol_rx_event_flag);
-	wake_up_interruptible(&cds_sched_context->ol_rx_wait_queue);
-	rc = wait_for_completion_timeout(&cds_sched_context->
-					 ol_suspend_rx_event,
-					 msecs_to_jiffies
-						 (RX_TLSHIM_SUSPEND_TIMEOUT));
-	if (!rc) {
-		clear_bit(RX_SUSPEND_EVENT_MASK,
-			  &cds_sched_context->ol_rx_event_flag);
-		hddLog(LOGE, FL("Failed to stop tl_shim rx thread"));
-		goto resume_all;
-	}
-	pHddCtx->is_ol_rx_thread_suspended = true;
-#endif
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SUSPEND_WLAN,
-			 NO_SESSION, pHddCtx->isWiphySuspended));
-	pHddCtx->isWiphySuspended = true;
-
-#ifdef CONFIG_CNSS
-	cnss_request_bus_bandwidth(CNSS_BUS_WIDTH_NONE);
-#endif
-
-	EXIT();
-	return 0;
-
-#ifdef QCA_CONFIG_SMP
-resume_all:
-
-	complete(&cds_sched_context->ResumeMcEvent);
-	pHddCtx->isMcThreadSuspended = false;
-#endif
-
-resume_tx:
-
-	hdd_resume_wlan();
-	return -ETIME;
-
-}
-
-/**
- * wlan_hdd_cfg80211_suspend_wlan() - cfg80211 suspend callback
- * @wiphy: Pointer to wiphy
- * @wow: Pointer to wow
- *
- * This API is called when cfg80211 driver suspends
- *
- * Return: integer status
- */
-int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
-				   struct cfg80211_wowlan *wow)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_suspend_wlan(wiphy, wow);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_power_mgmt() - set cfg80211 power management config
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @mode: Driver mode
- * @timeout: Timeout value
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
-					      struct net_device *dev, bool mode,
-					      int timeout)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	CDF_STATUS cdf_status;
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_POWER_MGMT,
-			 pAdapter->sessionId, timeout));
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	if ((DRIVER_POWER_MODE_AUTO == !mode) &&
-	    (true == pHddCtx->hdd_wlan_suspended) &&
-	    (pHddCtx->config->fhostArpOffload) &&
-	    (eConnectionState_Associated ==
-	     (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState)) {
-
-		hddLog(LOG1,
-			FL("offload: in cfg80211_set_power_mgmt, calling arp offload"));
-		cdf_status = hdd_conf_arp_offload(pAdapter, true);
-		if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-			hddLog(LOG1,
-				FL("Failed to enable ARPOFFLOAD Feature %d"),
-				cdf_status);
-		}
-	}
-
-	status = wlan_hdd_set_powersave(pAdapter, !mode);
-
-	if (!mode) {
-		hddLog(LOGE, FL("DHCP start indicated through power save"));
-		sme_dhcp_start_ind(pHddCtx->hHal, pAdapter->device_mode,
-				   pAdapter->macAddressCurrent.bytes,
-				   pAdapter->sessionId);
-	} else {
-		hddLog(LOGW, FL("DHCP stop indicated through power save"));
-		sme_dhcp_stop_ind(pHddCtx->hHal, pAdapter->device_mode,
-				  pAdapter->macAddressCurrent.bytes,
-				  pAdapter->sessionId);
-	}
-
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_set_power_mgmt() - set cfg80211 power management config
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @mode: Driver mode
- * @timeout: Timeout value
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
-				     struct net_device *dev, bool mode,
-				     int timeout)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_power_mgmt(wiphy, dev, mode, timeout);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_set_txpower() - set TX power
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to network device
- * @type: TX power setting type
- * @dbm: TX power in dbm
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
-					   struct wireless_dev *wdev,
-					   enum nl80211_tx_power_setting type,
-					   int dbm)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
-	tHalHandle hHal = NULL;
-	struct cdf_mac_addr bssid = CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-	struct cdf_mac_addr selfMac = CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SET_TXPOWER,
-			 NO_SESSION, type));
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return status;
-
-	hHal = pHddCtx->hHal;
-
-	if (0 != sme_cfg_set_int(hHal, WNI_CFG_CURRENT_TX_POWER_LEVEL, dbm)) {
-		hddLog(LOGE, FL("sme_cfg_set_int failed for tx power %hu"),
-				dbm);
-		return -EIO;
-	}
-
-	hddLog(LOG2, FL("Set tx power level %d dbm"), dbm);
-
-	switch (type) {
-	/* Automatically determine transmit power */
-	case NL80211_TX_POWER_AUTOMATIC:
-	/* Fall through */
-	case NL80211_TX_POWER_LIMITED:  /* Limit TX power by the mBm parameter */
-		if (sme_set_max_tx_power(hHal, bssid, selfMac, dbm) !=
-		    CDF_STATUS_SUCCESS) {
-			hddLog(LOGE, FL("Setting maximum tx power failed"));
-			return -EIO;
-		}
-		break;
-
-	case NL80211_TX_POWER_FIXED:    /* Fix TX power to the mBm parameter */
-		hddLog(LOGE, FL("NL80211_TX_POWER_FIXED not supported"));
-		return -EOPNOTSUPP;
-		break;
-
-	default:
-		hddLog(LOGE, FL("Invalid power setting type %d"), type);
-		return -EIO;
-	}
-
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_set_txpower() - set TX power
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to network device
- * @type: TX power setting type
- * @dbm: TX power in dbm
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  enum nl80211_tx_power_setting type,
-				  int dbm)
-{
-	int ret;
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_set_txpower(wiphy,
-					      wdev,
-					      type, dbm);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_get_txpower() - get TX power
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to network device
- * @dbm: Pointer to TX power in dbm
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
-				  struct wireless_dev *wdev,
-				  int *dbm)
-{
-
-	hdd_adapter_t *pAdapter;
-	hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status) {
-		*dbm = 0;
-		return status;
-	}
-
-	pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION);
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("pAdapter is NULL"));
-		return -ENOENT;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_GET_TXPOWER,
-			 pAdapter->sessionId, pAdapter->device_mode));
-	wlan_hdd_get_class_astats(pAdapter);
-	*dbm = pAdapter->hdd_stats.ClassA_stat.max_pwr;
-
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_get_txpower() - cfg80211 get power handler function
- * @wiphy: Pointer to wiphy structure.
- * @wdev: Pointer to wireless_dev structure.
- * @dbm: dbm
- *
- * This is the cfg80211 get txpower handler function which invokes
- * the internal function @__wlan_hdd_cfg80211_get_txpower with
- * SSR protection.
- *
- * Return: 0 for success, error number on failure.
- */
-int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
-					 struct wireless_dev *wdev,
-					 int *dbm)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_txpower(wiphy,
-						wdev,
-						dbm);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}

+ 0 - 2417
core/hdd/src/wlan_hdd_scan.c

@@ -1,2417 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC: wlan_hdd_scan.c
- *
- * WLAN Host Device Driver scan implementation
- */
-
-#include <linux/wireless.h>
-#include <net/cfg80211.h>
-
-#include "wlan_hdd_includes.h"
-#include "cds_api.h"
-#include "cds_api.h"
-#include "ani_global.h"
-#include "dot11f.h"
-#include "cds_sched.h"
-#include "wlan_hdd_p2p.h"
-#include "wlan_hdd_trace.h"
-#include "wlan_hdd_scan.h"
-#include "cds_concurrency.h"
-#include "wma_api.h"
-
-#define MAX_RATES                       12
-#define HDD_WAKE_LOCK_SCAN_DURATION (5 * 1000) /* in msec */
-
-#define SCAN_DONE_EVENT_BUF_SIZE 4096
-#define RATE_MASK 0x7f
-
-/**
- * typedef tSSIDBcastType - SSID broadcast type
- * @eBCAST_UNKNOWN: Broadcast unknown
- * @eBCAST_NORMAL: Broadcast normal
- * @eBCAST_HIDDEN: Broadcast hidden
- */
-typedef enum eSSIDBcastType {
-	eBCAST_UNKNOWN = 0,
-	eBCAST_NORMAL = 1,
-	eBCAST_HIDDEN = 2,
-} tSSIDBcastType;
-
-
-/**
- * typedef hdd_scan_info_t - HDD scan info
- * @dev: Pointer to net device
- * @info: Pointer to request info
- * @start: Start pointer
- * @end: End pointer
- */
-typedef struct hdd_scan_info {
-	struct net_device *dev;
-	struct iw_request_info *info;
-	char *start;
-	char *end;
-} hdd_scan_info_t, *hdd_scan_info_tp;
-
-/**
- * hdd_translate_abg_rate_to_mbps_rate() - translate abg rate to Mbps rate
- * @pFcRate: Rate pointer
- *
- * Return: Mbps rate in integer
- */
-static int32_t hdd_translate_abg_rate_to_mbps_rate(uint8_t *pFcRate)
-{
-	/* Slightly more sophisticated processing has to take place here.
-	 * Basic rates are rounded DOWN.  HT rates are rounded UP
-	 */
-	return ((((int32_t) *pFcRate) & 0x007f) * 1000000) / 2;
-}
-
-/**
- * hdd_add_iw_stream_event() - add iw stream event
- * @cmd: Command
- * @length: Length
- * @data: Pointer to data
- * @pscanInfo: Pointer to scan info
- * @last_event: Pointer to pointer to last event
- * @current_event: Pointer to pointer to current event
- *
- * Return: 0 for success, non zero for failure
- */
-static int hdd_add_iw_stream_event(int cmd, int length, char *data,
-				   hdd_scan_info_t *pscanInfo,
-				   char **last_event,
-				   char **current_event)
-{
-	struct iw_event event;
-
-	*last_event = *current_event;
-	cdf_mem_zero(&event, sizeof(struct iw_event));
-	event.cmd = cmd;
-	event.u.data.flags = 1;
-	event.u.data.length = length;
-	*current_event =
-		iwe_stream_add_point(pscanInfo->info, *current_event,
-				     pscanInfo->end, &event, data);
-
-	if (*last_event == *current_event) {
-		/* no space to add event */
-		hddLog(LOGE, "%s: no space left to add event", __func__);
-		return -E2BIG;  /* Error code, may be E2BIG */
-	}
-
-	return 0;
-}
-
-/**
- * hdd_get_wparsn_ies() - get wpa RSN IEs
- * @ieFields: Pointer to the Bss Descriptor IEs
- * @ie_length: IE Length
- * @last_event: Points to last event
- * @current_event: Points to current event
- *
- * This function extract the WPA/RSN IE from the Bss descriptor IEs fields
- *
- * Return: 0 for success, non zero for failure
- */
-static int hdd_get_wparsn_ies(uint8_t *ieFields, uint16_t ie_length,
-			      char **last_event, char **current_event,
-			      hdd_scan_info_t *pscanInfo)
-{
-	uint8_t eid, elen, *element;
-	uint16_t tie_length = 0;
-
-	ENTER();
-
-	element = ieFields;
-	tie_length = ie_length;
-
-	while (tie_length > 2 && element != NULL) {
-		eid = element[0];
-		elen = element[1];
-
-		/* If element length is greater than total remaining ie length,
-		 * break the loop
-		 */
-		if ((elen + 2) > tie_length)
-			break;
-
-		switch (eid) {
-		case DOT11F_EID_WPA:
-		case DOT11F_EID_RSN:
-#ifdef FEATURE_WLAN_WAPI
-		case DOT11F_EID_WAPI:
-#endif
-			if (hdd_add_iw_stream_event
-				    (IWEVGENIE, elen + 2, (char *)element, pscanInfo,
-				    last_event, current_event) < 0)
-				return -E2BIG;
-			break;
-
-		default:
-			break;
-		}
-
-		/* Next element */
-		tie_length -= (2 + elen);
-		element += 2 + elen;
-	}
-
-	return 0;
-}
-
-/**
- * hdd_indicate_scan_result() - indicate scan results
- * @scanInfo: Pointer to the scan info structure.
- * @descriptor: Pointer to the Bss Descriptor.
- *
- * This function returns the scan results to the wpa_supplicant
- *
- * @Return: 0 for success, non zero for failure
- */
-#define MAX_CUSTOM_LEN 64
-static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
-				    tCsrScanResultInfo *scan_result)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(scanInfo->dev);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	tSirBssDescription *descriptor = &scan_result->BssDescriptor;
-	struct iw_event event;
-	char *current_event = scanInfo->start;
-	char *end = scanInfo->end;
-	char *last_event;
-	char *current_pad;
-	uint16_t ie_length = 0;
-	uint16_t capabilityInfo;
-	char *modestr;
-	int error;
-	char custom[MAX_CUSTOM_LEN];
-	char *p;
-
-	hddLog(LOG1, "hdd_indicate_scan_result " MAC_ADDRESS_STR,
-	       MAC_ADDR_ARRAY(descriptor->bssId));
-
-	error = 0;
-	last_event = current_event;
-	cdf_mem_zero(&event, sizeof(event));
-
-	/* BSSID */
-	event.cmd = SIOCGIWAP;
-	event.u.ap_addr.sa_family = ARPHRD_ETHER;
-	cdf_mem_copy(event.u.ap_addr.sa_data, descriptor->bssId,
-		     sizeof(descriptor->bssId));
-	current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
-					     &event, IW_EV_ADDR_LEN);
-
-	if (last_event == current_event) {
-		/* no space to add event */
-		/* Error code may be E2BIG */
-		hddLog(LOGE, "hdd_indicate_scan_result: no space for SIOCGIWAP ");
-		return -E2BIG;
-	}
-
-	last_event = current_event;
-	cdf_mem_zero(&event, sizeof(struct iw_event));
-
-	/* Protocol Name */
-	event.cmd = SIOCGIWNAME;
-
-	switch (descriptor->nwType) {
-	case eSIR_11A_NW_TYPE:
-		modestr = "a";
-		break;
-	case eSIR_11B_NW_TYPE:
-		modestr = "b";
-		break;
-	case eSIR_11G_NW_TYPE:
-		modestr = "g";
-		break;
-	case eSIR_11N_NW_TYPE:
-		modestr = "n";
-		break;
-	default:
-		hddLog(LOGW, "%s: Unknown network type [%d]",
-		       __func__, descriptor->nwType);
-		modestr = "?";
-		break;
-	}
-	snprintf(event.u.name, IFNAMSIZ, "IEEE 802.11%s", modestr);
-	current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
-					     &event, IW_EV_CHAR_LEN);
-
-	if (last_event == current_event) {      /* no space to add event */
-		hddLog(LOGE,
-		       "hdd_indicate_scan_result: no space for SIOCGIWNAME");
-		/* Error code, may be E2BIG */
-		return -E2BIG;
-	}
-
-	last_event = current_event;
-	cdf_mem_zero(&event, sizeof(struct iw_event));
-
-	/*Freq */
-	event.cmd = SIOCGIWFREQ;
-
-	event.u.freq.m = descriptor->channelId;
-	event.u.freq.e = 0;
-	event.u.freq.i = 0;
-	current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
-					     &event, IW_EV_FREQ_LEN);
-
-	if (last_event == current_event) {      /* no space to add event */
-		hddLog(LOGE,
-		       "hdd_indicate_scan_result: no space for SIOCGIWFREQ");
-		return -E2BIG;
-	}
-
-	last_event = current_event;
-	cdf_mem_zero(&event, sizeof(struct iw_event));
-
-	/* BSS Mode */
-	event.cmd = SIOCGIWMODE;
-
-	capabilityInfo = descriptor->capabilityInfo;
-
-	if (SIR_MAC_GET_ESS(capabilityInfo)) {
-		event.u.mode = IW_MODE_MASTER;
-	} else if (SIR_MAC_GET_IBSS(capabilityInfo)) {
-		event.u.mode = IW_MODE_ADHOC;
-	} else {
-		/* neither ESS or IBSS */
-		event.u.mode = IW_MODE_AUTO;
-	}
-
-	current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
-					     &event, IW_EV_UINT_LEN);
-
-	if (last_event == current_event) {      /* no space to add event */
-		hddLog(LOGE,
-		       "hdd_indicate_scan_result: no space for SIOCGIWMODE");
-		return -E2BIG;
-	}
-	/* To extract SSID */
-	ie_length = GET_IE_LEN_IN_BSS(descriptor->length);
-
-	if (ie_length > 0) {
-		/* dot11BeaconIEs is a large struct, so we make it static to
-		   avoid stack overflow.  This API is only invoked via ioctl,
-		   so it is serialized by the kernel rtnl_lock and hence does
-		   not need to be reentrant */
-		static tDot11fBeaconIEs dot11BeaconIEs;
-		tDot11fIESSID *pDot11SSID;
-		tDot11fIESuppRates *pDot11SuppRates;
-		tDot11fIEExtSuppRates *pDot11ExtSuppRates;
-		tDot11fIEHTCaps *pDot11IEHTCaps;
-		int numBasicRates = 0;
-		int maxNumRates = 0;
-
-		pDot11IEHTCaps = NULL;
-
-		dot11f_unpack_beacon_i_es((tpAniSirGlobal)
-					  hHal, (uint8_t *) descriptor->ieFields,
-					  ie_length, &dot11BeaconIEs);
-
-		pDot11SSID = &dot11BeaconIEs.SSID;
-
-		if (pDot11SSID->present) {
-			last_event = current_event;
-			cdf_mem_zero(&event, sizeof(struct iw_event));
-
-			event.cmd = SIOCGIWESSID;
-			event.u.data.flags = 1;
-			event.u.data.length = scan_result->ssId.length;
-			current_event =
-				iwe_stream_add_point(scanInfo->info, current_event,
-						     end, &event,
-						     (char *)scan_result->ssId.
-						     ssId);
-
-			if (last_event == current_event) {      /* no space to add event */
-				hddLog(LOGE,
-				       "hdd_indicate_scan_result: no space for SIOCGIWESSID");
-				return -E2BIG;
-			}
-		}
-
-		if (hdd_get_wparsn_ies
-			    ((uint8_t *) descriptor->ieFields, ie_length, &last_event,
-			    &current_event, scanInfo) < 0) {
-			hddLog(LOGE,
-			       "hdd_indicate_scan_result: no space for SIOCGIWESSID");
-			return -E2BIG;
-		}
-
-		last_event = current_event;
-		current_pad = current_event + IW_EV_LCP_LEN;
-		cdf_mem_zero(&event, sizeof(struct iw_event));
-
-		/*Rates */
-		event.cmd = SIOCGIWRATE;
-
-		pDot11SuppRates = &dot11BeaconIEs.SuppRates;
-
-		if (pDot11SuppRates->present) {
-			int i;
-
-			numBasicRates = pDot11SuppRates->num_rates;
-			for (i = 0; i < pDot11SuppRates->num_rates; i++) {
-				if (0 != (pDot11SuppRates->rates[i] & 0x7F)) {
-					event.u.bitrate.value =
-						hdd_translate_abg_rate_to_mbps_rate
-							(&pDot11SuppRates->rates[i]);
-
-					current_pad =
-						iwe_stream_add_value(scanInfo->info,
-								     current_event,
-								     current_pad,
-								     end, &event,
-								     IW_EV_PARAM_LEN);
-				}
-			}
-
-		}
-
-		pDot11ExtSuppRates = &dot11BeaconIEs.ExtSuppRates;
-
-		if (pDot11ExtSuppRates->present) {
-			int i, no_of_rates;
-			maxNumRates =
-				numBasicRates + pDot11ExtSuppRates->num_rates;
-
-			/* Check to make sure the total number of rates
-			 * doesn't exceed IW_MAX_BITRATES
-			 */
-
-			maxNumRates = CDF_MIN(maxNumRates, IW_MAX_BITRATES);
-
-			if ((maxNumRates - numBasicRates) > MAX_RATES) {
-				no_of_rates = MAX_RATES;
-				hddLog(LOGW,
-				       "Accessing array out of bound that array is pDot11ExtSuppRates->rates ");
-			} else {
-				no_of_rates = maxNumRates - numBasicRates;
-			}
-			for (i = 0; i < no_of_rates; i++) {
-				if (0 != (pDot11ExtSuppRates->rates[i] & 0x7F)) {
-					event.u.bitrate.value =
-						hdd_translate_abg_rate_to_mbps_rate
-							(&pDot11ExtSuppRates->rates[i]);
-
-					current_pad =
-						iwe_stream_add_value(scanInfo->info,
-								     current_event,
-								     current_pad,
-								     end, &event,
-								     IW_EV_PARAM_LEN);
-				}
-			}
-		}
-
-		if ((current_pad - current_event) >= IW_EV_LCP_LEN) {
-			current_event = current_pad;
-		} else {
-			if (last_event == current_event) {      /* no space to add event */
-				hddLog(LOGE,
-				       "hdd_indicate_scan_result: no space for SIOCGIWRATE");
-				return -E2BIG;
-			}
-		}
-
-		last_event = current_event;
-		cdf_mem_zero(&event, sizeof(struct iw_event));
-
-		event.cmd = SIOCGIWENCODE;
-
-		if (SIR_MAC_GET_PRIVACY(capabilityInfo)) {
-			event.u.data.flags =
-				IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
-		} else {
-			event.u.data.flags = IW_ENCODE_DISABLED;
-		}
-		event.u.data.length = 0;
-
-		current_event =
-			iwe_stream_add_point(scanInfo->info, current_event, end,
-					     &event, (char *)pDot11SSID->ssid);
-		if (last_event == current_event) {
-			hddLog(LOGE,
-			       "hdd_indicate_scan_result: no space for SIOCGIWENCODE");
-			return -E2BIG;
-		}
-	}
-
-	last_event = current_event;
-	cdf_mem_zero(&event, sizeof(struct iw_event));
-
-	/* RSSI */
-	event.cmd = IWEVQUAL;
-	event.u.qual.qual = descriptor->rssi;
-	event.u.qual.noise = descriptor->sinr;
-	event.u.qual.level = CDF_MIN((descriptor->rssi + descriptor->sinr), 0);
-
-	event.u.qual.updated = IW_QUAL_ALL_UPDATED;
-
-	current_event = iwe_stream_add_event(scanInfo->info, current_event,
-					     end, &event, IW_EV_QUAL_LEN);
-
-	if (last_event == current_event) {      /* no space to add event */
-		hddLog(LOGE, "hdd_indicate_scan_result: no space for IWEVQUAL");
-		return -E2BIG;
-	}
-
-	/* AGE */
-	event.cmd = IWEVCUSTOM;
-	p = custom;
-	p += scnprintf(p, MAX_CUSTOM_LEN, " Age: %lu",
-		       cdf_mc_timer_get_system_ticks() -
-		       descriptor->nReceivedTime);
-	event.u.data.length = p - custom;
-	current_event = iwe_stream_add_point(scanInfo->info, current_event, end,
-					     &event, custom);
-	if (last_event == current_event) {      /* no space to add event */
-		hddLog(LOGE,
-		       "hdd_indicate_scan_result: no space for IWEVCUSTOM (age)");
-		return -E2BIG;
-	}
-
-	scanInfo->start = current_event;
-
-	return 0;
-}
-
-
-/**
- * wlan_hdd_scan_request_enqueue() - enqueue Scan Request
- * @adapter: Pointer to the adapter
- * @scan_req: Pointer to the scan request
- *
- * Enqueue scan request in the global HDD scan list.This list
- * stores the active scan request information.
- *
- * Return: 0 on success, error number otherwise
- */
-static int wlan_hdd_scan_request_enqueue(hdd_adapter_t *adapter,
-			struct cfg80211_scan_request *scan_req,
-			uint8_t source, uint32_t scan_id,
-			uint32_t timestamp)
-{
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	struct hdd_scan_req *hdd_scan_req;
-	CDF_STATUS status;
-
-	ENTER();
-	hdd_scan_req = cdf_mem_malloc(sizeof(*hdd_scan_req));
-	if (NULL == hdd_scan_req) {
-		hddLog(LOGP, FL("malloc failed for Scan req"));
-		return -ENOMEM;
-	}
-
-	hdd_scan_req->adapter = adapter;
-	hdd_scan_req->scan_request = scan_req;
-	hdd_scan_req->source = source;
-	hdd_scan_req->scan_id = scan_id;
-	hdd_scan_req->timestamp = timestamp;
-
-	cdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock);
-	status = cdf_list_insert_back(&hdd_ctx->hdd_scan_req_q,
-					&hdd_scan_req->node);
-	cdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-
-	if (CDF_STATUS_SUCCESS != status) {
-		hdd_err("Failed to enqueue Scan Req");
-		cdf_mem_free(hdd_scan_req);
-		return -EINVAL;
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_scan_request_dequeue() - dequeue scan request
- * @hdd_ctx: Global HDD context
- * @scan_id: scan id
- * @req: scan request
- * @source : returns source of the scan request
- * @timestamp: scan request timestamp
- *
- * Return: CDF_STATUS
- */
-CDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx,
-	uint32_t scan_id, struct cfg80211_scan_request **req, uint8_t *source,
-	uint32_t *timestamp)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	struct hdd_scan_req *hdd_scan_req;
-	cdf_list_node_t *pNode = NULL, *ppNode = NULL;
-
-	hdd_info("Dequeue Scan id: %d", scan_id);
-
-	if ((source == NULL) && (timestamp == NULL) && (req == NULL))
-		return CDF_STATUS_E_NULL_VALUE;
-
-	cdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock);
-
-	if (list_empty(&hdd_ctx->hdd_scan_req_q.anchor)) {
-		cdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (CDF_STATUS_SUCCESS !=
-		cdf_list_peek_front(&hdd_ctx->hdd_scan_req_q, &ppNode)) {
-		cdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-		hdd_err("Failed to remove Scan Req from queue");
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	do {
-		pNode = ppNode;
-		hdd_scan_req = (struct hdd_scan_req *)pNode;
-		if (hdd_scan_req->scan_id == scan_id) {
-			status = cdf_list_remove_node(&hdd_ctx->hdd_scan_req_q,
-					pNode);
-			if (status == CDF_STATUS_SUCCESS) {
-				*req = hdd_scan_req->scan_request;
-				*source = hdd_scan_req->source;
-				*timestamp = hdd_scan_req->timestamp;
-				cdf_mem_free(hdd_scan_req);
-				cdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-				hdd_info("removed Scan id: %d, req = %p",
-					scan_id, req);
-				return CDF_STATUS_SUCCESS;
-			} else {
-				cdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-				hdd_err("Failed to remove node scan id %d",
-					scan_id);
-				return status;
-			}
-		}
-	} while (CDF_STATUS_SUCCESS ==
-		cdf_list_peek_next(&hdd_ctx->hdd_scan_req_q, pNode, &ppNode));
-
-	cdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
-	hdd_err("Failed to find scan id %d", scan_id);
-	return status;
-}
-
-/**
- * hdd_scan_request_callback() - scan complete callback from SME
- * @halHandle: Pointer to the Hal Handle
- * @pContext: Pointer to the data context
- * @sessionId: Session identifier
- * @scanId: Scan ID
- * @status: CSR Status
- *
- * The sme module calls this callback function once it finish the scan request
- * and this function notifies the scan complete event to the wpa_supplicant.
- *
- * Return: 0 for success, non zero for failure
- */
-
-static CDF_STATUS
-hdd_scan_request_callback(tHalHandle halHandle, void *pContext,
-			  uint8_t sessionId, uint32_t scanId,
-			  eCsrScanStatus status)
-{
-	struct net_device *dev = (struct net_device *)pContext;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hddctx = WLAN_HDD_GET_CTX(pAdapter);
-	union iwreq_data wrqu;
-	int we_event;
-	char *msg;
-	uint8_t source;
-	struct cfg80211_scan_request *req;
-	uint32_t timestamp;
-	uint32_t size = 0;
-
-	ENTER();
-	hddLog(LOGW,
-	       "%s called with halHandle = %p, pContext = %p, scanID = %d,"
-	       " returned status = %d", __func__, halHandle, pContext,
-	       (int)scanId, (int)status);
-
-	/* if there is a scan request pending when the wlan driver is unloaded
-	 * we may be invoked as SME flushes its pending queue.  If that is the
-	 * case, the underlying net_device may have already been destroyed, so
-	 * do some quick sanity before proceeding
-	 */
-	if (pAdapter->dev != dev) {
-		hddLog(LOGW, "%s: device mismatch %p vs %p",
-		       __func__, pAdapter->dev, dev);
-		return CDF_STATUS_SUCCESS;
-	}
-
-	wlan_hdd_scan_request_dequeue(hddctx, scanId, &req, &source,
-		&timestamp);
-
-	if (req != NULL)
-		hdd_err("Got unexpected request struct for Scan id %d",
-			scanId);
-
-	cdf_spin_lock(&hddctx->hdd_scan_req_q_lock);
-	cdf_list_size(&(hddctx->hdd_scan_req_q), &size);
-	if (!size)
-		/* Scan is no longer pending */
-		pAdapter->scan_info.mScanPending = false;
-	cdf_spin_unlock(&hddctx->hdd_scan_req_q_lock);
-
-	/* notify any applications that may be interested */
-	memset(&wrqu, '\0', sizeof(wrqu));
-	we_event = SIOCGIWSCAN;
-	msg = NULL;
-	wireless_send_event(dev, we_event, &wrqu, msg);
-
-	EXIT();
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * __iw_set_scan() - set scan request
- * @dev: Pointer to the net device
- * @info: Pointer to the iw_request_info
- * @wrqu: Pointer to the iwreq_data
- * @extra: Pointer to the data
- *
- * This function process the scan request from the wpa_supplicant
- * and set the scan request to the SME
- *
- * Return: 0 for success, non zero for failure
- */
-
-static int __iw_set_scan(struct net_device *dev, struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	tCsrScanRequest scanRequest;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	struct iw_scan_req *scanReq = (struct iw_scan_req *)extra;
-	hdd_adapter_t *con_sap_adapter;
-	uint16_t con_dfs_ch;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	/* Block All Scan during DFS operation and send null scan result */
-	con_sap_adapter = hdd_get_con_sap_adapter(pAdapter, true);
-	if (con_sap_adapter) {
-		con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
-
-		if (CDS_IS_DFS_CH(con_dfs_ch)) {
-			hddLog(LOGW, FL("##In DFS Master mode. Scan aborted"));
-			return -EOPNOTSUPP;
-		}
-	}
-
-	cdf_mem_zero(&scanRequest, sizeof(scanRequest));
-
-	if (NULL != wrqu->data.pointer) {
-		/* set scanType, active or passive */
-		if ((IW_SCAN_TYPE_ACTIVE == scanReq->scan_type) ||
-		    (eSIR_ACTIVE_SCAN == hdd_ctx->ioctl_scan_mode)) {
-			scanRequest.scanType = eSIR_ACTIVE_SCAN;
-		} else {
-			scanRequest.scanType = eSIR_PASSIVE_SCAN;
-		}
-
-		/* set bssid using sockaddr from iw_scan_req */
-		cdf_mem_copy(scanRequest.bssid.bytes,
-			     &scanReq->bssid.sa_data,
-			     CDF_MAC_ADDR_SIZE);
-
-		if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
-
-			if (scanReq->essid_len) {
-				scanRequest.SSIDs.numOfSSIDs = 1;
-				scanRequest.SSIDs.SSIDList =
-					(tCsrSSIDInfo *)
-					cdf_mem_malloc(sizeof(tCsrSSIDInfo));
-				if (scanRequest.SSIDs.SSIDList) {
-					scanRequest.SSIDs.SSIDList->SSID.
-					length = scanReq->essid_len;
-					cdf_mem_copy(scanRequest.SSIDs.
-						     SSIDList->SSID.ssId,
-						     scanReq->essid,
-						     scanReq->essid_len);
-				} else {
-					scanRequest.SSIDs.numOfSSIDs = 0;
-					CDF_TRACE(CDF_MODULE_ID_HDD,
-						  CDF_TRACE_LEVEL_ERROR,
-						  "%s: Unable to allocate memory",
-						  __func__);
-					CDF_ASSERT(0);
-				}
-			}
-		}
-
-		/* set min and max channel time */
-		scanRequest.minChnTime = scanReq->min_channel_time;
-		scanRequest.maxChnTime = scanReq->max_channel_time;
-
-	} else {
-		if (hdd_ctx->ioctl_scan_mode == eSIR_ACTIVE_SCAN) {
-			/* set the scan type to active */
-			scanRequest.scanType = eSIR_ACTIVE_SCAN;
-		} else {
-			scanRequest.scanType = eSIR_PASSIVE_SCAN;
-		}
-
-		cdf_set_macaddr_broadcast(&scanRequest.bssid);
-
-		/* set min and max channel time to zero */
-		scanRequest.minChnTime = 0;
-		scanRequest.maxChnTime = 0;
-	}
-
-	/* set BSSType to default type */
-	scanRequest.BSSType = eCSR_BSS_TYPE_ANY;
-
-	/*Scan all the channels */
-	scanRequest.ChannelInfo.numOfChannels = 0;
-
-	scanRequest.ChannelInfo.ChannelList = NULL;
-
-	/* set requestType to full scan */
-	scanRequest.requestType = eCSR_SCAN_REQUEST_FULL_SCAN;
-
-	/* if previous genIE is not NULL, update ScanIE */
-	if (0 != pwextBuf->genIE.length) {
-		memset(&pAdapter->scan_info.scanAddIE, 0,
-		       sizeof(pAdapter->scan_info.scanAddIE));
-		memcpy(pAdapter->scan_info.scanAddIE.addIEdata,
-		       pwextBuf->genIE.addIEdata, pwextBuf->genIE.length);
-		pAdapter->scan_info.scanAddIE.length = pwextBuf->genIE.length;
-
-		pwextBuf->roamProfile.pAddIEScan =
-			pAdapter->scan_info.scanAddIE.addIEdata;
-		pwextBuf->roamProfile.nAddIEScanLength =
-			pAdapter->scan_info.scanAddIE.length;
-
-		/* clear previous genIE after use it */
-		memset(&pwextBuf->genIE, 0, sizeof(pwextBuf->genIE));
-	}
-
-	/* push addIEScan in scanRequset if exist */
-	if (pAdapter->scan_info.scanAddIE.addIEdata &&
-	    pAdapter->scan_info.scanAddIE.length) {
-		scanRequest.uIEFieldLen = pAdapter->scan_info.scanAddIE.length;
-		scanRequest.pIEField = pAdapter->scan_info.scanAddIE.addIEdata;
-	}
-	scanRequest.timestamp = cdf_mc_timer_get_system_ticks();
-	status = sme_scan_request((WLAN_HDD_GET_CTX(pAdapter))->hHal,
-				  pAdapter->sessionId, &scanRequest,
-				  &hdd_scan_request_callback, dev);
-	if (!CDF_IS_STATUS_SUCCESS(status)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s:sme_scan_request  fail %d!!!", __func__, status);
-		goto error;
-	}
-
-	wlan_hdd_scan_request_enqueue(pAdapter, NULL, NL_SCAN,
-			scanRequest.scan_id,
-			scanRequest.timestamp);
-
-	pAdapter->scan_info.mScanPending = true;
-error:
-	if ((wrqu->data.flags & IW_SCAN_THIS_ESSID) && (scanReq->essid_len))
-		cdf_mem_free(scanRequest.SSIDs.SSIDList);
-	EXIT();
-	return status;
-}
-
-/**
- * iw_set_scan() - SSR wrapper for __iw_set_scan
- * @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 on success, error number otherwise
- */
-int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
-		 union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_set_scan(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __iw_get_scan() - get scan
- * @dev: Pointer to the net device.
- * @info: Pointer to the iw_request_info.
- * @wrqu: Pointer to the iwreq_data.
- * @extra: Pointer to the data.
- *
- * This function returns the scan results to the wpa_supplicant
- *
- * Return: 0 for success, non zero for failure
- */
-
-static int __iw_get_scan(struct net_device *dev,
-		struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	tCsrScanResultInfo *pScanResult;
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	hdd_scan_info_t scanInfo;
-	tScanResultHandle pResult;
-	int i = 0;
-	int ret;
-
-	ENTER();
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: enter buffer length %d!!!", __func__,
-		  (wrqu->data.length) ? wrqu->data.length : IW_SCAN_MAX_DATA);
-
-	if (true == pAdapter->scan_info.mScanPending) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_FATAL,
-			  "%s:mScanPending is true !!!", __func__);
-		return -EAGAIN;
-	}
-
-	scanInfo.dev = dev;
-	scanInfo.start = extra;
-	scanInfo.info = info;
-
-	if (0 == wrqu->data.length) {
-		scanInfo.end = extra + IW_SCAN_MAX_DATA;
-	} else {
-		scanInfo.end = extra + wrqu->data.length;
-	}
-
-	status = sme_scan_get_result(hHal, pAdapter->sessionId, NULL, &pResult);
-
-	if (NULL == pResult) {
-		/* no scan results */
-		hddLog(LOG1, "iw_get_scan: NULL Scan Result ");
-		return 0;
-	}
-
-	pScanResult = sme_scan_result_get_first(hHal, pResult);
-
-	while (pScanResult) {
-		status = hdd_indicate_scan_result(&scanInfo, pScanResult);
-		if (0 != status) {
-			break;
-		}
-		i++;
-		pScanResult = sme_scan_result_get_next(hHal, pResult);
-	}
-
-	sme_scan_result_purge(hHal, pResult);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: exit total %d BSS reported !!!", __func__, i);
-	EXIT();
-	return status;
-}
-
-/**
- * iw_get_scan() - SSR wrapper function for __iw_get_scan
- * @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 on success, error number otherwise
- */
-int iw_get_scan(struct net_device *dev,
-			 struct iw_request_info *info,
-			 union iwreq_data *wrqu, char *extra)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __iw_get_scan(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_abort_mac_scan() - aborts ongoing mac scan
- * @pHddCtx: Pointer to hdd context
- * @sessionId: session id
- * @reason: abort reason
- *
- * Abort any MAC scan if in progress
- *
- * Return: none
- */
-void hdd_abort_mac_scan(hdd_context_t *pHddCtx, uint8_t sessionId,
-			eCsrAbortReason reason)
-{
-	sme_abort_mac_scan(pHddCtx->hHal, sessionId, reason);
-}
-
-/**
- * hdd_vendor_scan_callback() - Scan completed callback event
- * @hddctx: HDD context
- * @req : Scan request
- * @aborted : true scan aborted false scan success
- *
- * This function sends scan completed callback event to NL.
- *
- * Return: none
- */
-static void hdd_vendor_scan_callback(hdd_adapter_t *adapter,
-					struct cfg80211_scan_request *req,
-					bool aborted)
-{
-	hdd_context_t *hddctx = WLAN_HDD_GET_CTX(adapter);
-	struct sk_buff *skb;
-	struct nlattr *attr;
-	int i;
-	uint8_t scan_status;
-	uint64_t cookie;
-
-	ENTER();
-
-	if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
-		hdd_err("Invalid adapter magic");
-		cdf_mem_free(req);
-		return;
-	}
-	skb = cfg80211_vendor_event_alloc(hddctx->wiphy, NULL,
-			SCAN_DONE_EVENT_BUF_SIZE + 4 + NLMSG_HDRLEN,
-			QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE_INDEX,
-			GFP_KERNEL);
-
-	if (!skb) {
-		hdd_err("skb alloc failed");
-		cdf_mem_free(req);
-		return;
-	}
-
-	if (0 != hdd_vendor_put_ifindex(skb, adapter->dev->ifindex))
-		goto nla_put_failure;
-
-	cookie = (uintptr_t)req;
-
-	attr = nla_nest_start(skb, QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS);
-	if (!attr)
-		goto nla_put_failure;
-	for (i = 0; i < req->n_ssids; i++) {
-		if (nla_put(skb, i, req->ssids[i].ssid_len, req->ssids[i].ssid))
-			goto nla_put_failure;
-	}
-	nla_nest_end(skb, attr);
-
-	attr = nla_nest_start(skb, QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES);
-	if (!attr)
-		goto nla_put_failure;
-	for (i = 0; i < req->n_channels; i++) {
-		if (nla_put_u32(skb, i, req->channels[i]->center_freq))
-			goto nla_put_failure;
-	}
-	nla_nest_end(skb, attr);
-
-	if (req->ie &&
-		nla_put(skb, QCA_WLAN_VENDOR_ATTR_SCAN_IE, req->ie_len,
-			req->ie))
-		goto nla_put_failure;
-
-	if (req->flags &&
-		nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS, req->flags))
-		goto nla_put_failure;
-
-	if (nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie))
-		goto nla_put_failure;
-
-	scan_status = (aborted == true) ? VENDOR_SCAN_STATUS_ABORTED :
-		VENDOR_SCAN_STATUS_NEW_RESULTS;
-	if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_SCAN_STATUS, scan_status))
-		goto nla_put_failure;
-
-	cfg80211_vendor_event(skb, GFP_KERNEL);
-	cdf_mem_free(req);
-	return;
-
-nla_put_failure:
-	kfree_skb(skb);
-	cdf_mem_free(req);
-	return;
-}
-
-/**
- * hdd_cfg80211_scan_done_callback() - scan done callback function called after
- *				       scan is finished
- * @halHandle: Pointer to handle
- * @pContext: Pointer to context
- * @sessionId: Session Id
- * @scanId: Scan Id
- * @status: Scan status
- *
- * Return: CDF status
- */
-static CDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
-					   void *pContext,
-					   uint8_t sessionId,
-					   uint32_t scanId,
-					   eCsrScanStatus status)
-{
-	struct net_device *dev = (struct net_device *)pContext;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_scaninfo_t *pScanInfo = &pAdapter->scan_info;
-	struct cfg80211_scan_request *req = NULL;
-	bool aborted = false;
-	hdd_context_t *hddctx = WLAN_HDD_GET_CTX(pAdapter);
-	int ret = 0;
-	uint8_t source;
-	uint32_t scan_time;
-	uint32_t size = 0;
-
-	ret = wlan_hdd_validate_context(hddctx);
-	if (0 != ret)
-		return CDF_STATUS_E_INVAL;
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-		"%s called with hal = %p, pContext = %p, ID = %d, status = %d",
-		__func__, halHandle, pContext, (int)scanId, (int)status);
-
-	pScanInfo->mScanPendingCounter = 0;
-
-	if (pScanInfo->mScanPending != true) {
-		CDF_ASSERT(pScanInfo->mScanPending);
-		goto allow_suspend;
-	}
-
-	if (CDF_STATUS_SUCCESS !=
-		wlan_hdd_scan_request_dequeue(hddctx, scanId, &req, &source,
-			&scan_time)) {
-		hdd_err("Dequeue of scan request failed ID: %d", scanId);
-		goto allow_suspend;
-	}
-
-	ret = wlan_hdd_cfg80211_update_bss((WLAN_HDD_GET_CTX(pAdapter))->wiphy,
-					   pAdapter, scan_time);
-	if (0 > ret)
-		hddLog(CDF_TRACE_LEVEL_INFO, "%s: NO SCAN result", __func__);
-
-	/*
-	 * cfg80211_scan_done informing NL80211 about completion
-	 * of scanning
-	 */
-	if (status == eCSR_SCAN_ABORT || status == eCSR_SCAN_FAILURE) {
-		aborted = true;
-	}
-
-	cdf_spin_lock(&hddctx->hdd_scan_req_q_lock);
-	cdf_list_size(&(hddctx->hdd_scan_req_q), &size);
-	if (!size) {
-		/* Scan is no longer pending */
-		pScanInfo->mScanPending = false;
-		complete(&pScanInfo->abortscan_event_var);
-	}
-	cdf_spin_unlock(&hddctx->hdd_scan_req_q_lock);
-	/*
-	 * Scan can be triggred from NL or vendor scan
-	 * - If scan is triggered from NL then cfg80211 scan done should be
-	 * called to updated scan completion to NL.
-	 * - If scan is triggred through vendor command then
-	 * scan done event will be posted
-	 */
-	if (NL_SCAN == source)
-		cfg80211_scan_done(req, aborted);
-	else
-		hdd_vendor_scan_callback(pAdapter, req, aborted);
-
-allow_suspend:
-	if (!size) {
-		/* release the wake lock at the end of the scan */
-		hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN);
-
-		/* Acquire wakelock to handle the case where APP's tries
-		 * to suspend immediatly after the driver gets connect
-		 * request(i.e after scan) from supplicant, this result in
-		 * app's is suspending and not ableto process the connect
-		 * request to AP
-		 */
-		hdd_prevent_suspend_timeout(1000,
-			WIFI_POWER_EVENT_WAKELOCK_SCAN);
-	}
-
-#ifdef FEATURE_WLAN_TDLS
-	wlan_hdd_tdls_scan_done_callback(pAdapter);
-#endif
-
-	EXIT();
-	return 0;
-}
-
-
-/**
- * wlan_hdd_cfg80211_scan_block_cb() - scan block work handler
- * @work: Pointer to work
- *
- * Return: none
- */
-static void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
-{
-	hdd_adapter_t *adapter = container_of(work,
-					      hdd_adapter_t, scan_block_work);
-	struct cfg80211_scan_request *request;
-	if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
-		hddLog(LOGE,
-			"%s: HDD adapter context is invalid", __func__);
-		return;
-	}
-
-	request = adapter->request;
-	if (request) {
-		request->n_ssids = 0;
-		request->n_channels = 0;
-
-		hddLog(LOGE,
-		   FL("##In DFS Master mode. Scan aborted. Null result sent"));
-		cfg80211_scan_done(request, true);
-		adapter->request = NULL;
-	}
-}
-
-/**
- * __wlan_hdd_cfg80211_scan() - API to process cfg80211 scan request
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to net device
- * @request: Pointer to scan request
- * @source: scan request source(NL/Vendor scan)
- *
- * This API responds to scan trigger and update cfg80211 scan database
- * later, scan dump command can be used to recieve scan results
- *
- * Return: 0 for success, non zero for failure
- */
-static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
-				    struct cfg80211_scan_request *request,
-				    uint8_t source)
-{
-	struct net_device *dev = request->wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
-	struct hdd_config *cfg_param = NULL;
-	tCsrScanRequest scan_req;
-	uint8_t *channelList = NULL, i;
-	int status;
-	hdd_scaninfo_t *pScanInfo = NULL;
-	uint8_t *pP2pIe = NULL;
-	hdd_adapter_t *con_sap_adapter;
-	uint16_t con_dfs_ch;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SCAN,
-			 pAdapter->sessionId, request->n_channels));
-
-	hddLog(LOG1, FL("Device_mode %s(%d)"),
-		hdd_device_mode_to_string(pAdapter->device_mode),
-		pAdapter->device_mode);
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	cfg_param = pHddCtx->config;
-	pScanInfo = &pAdapter->scan_info;
-
-	/* Block All Scan during DFS operation and send null scan result */
-	con_sap_adapter = hdd_get_con_sap_adapter(pAdapter, true);
-	if (con_sap_adapter) {
-		con_dfs_ch = con_sap_adapter->sessionCtx.ap.sapConfig.channel;
-		if (con_dfs_ch == AUTO_CHANNEL_SELECT)
-			con_dfs_ch =
-				con_sap_adapter->sessionCtx.ap.operatingChannel;
-
-		if (CDS_IS_DFS_CH(con_dfs_ch)) {
-			/* Provide empty scan result during DFS operation since
-			 * scanning not supported during DFS. Reason is
-			 * following case:
-			 * DFS is supported only in SCC for MBSSID Mode.
-			 * We shall not return EBUSY or ENOTSUPP as when Primary
-			 * AP is operating in DFS channel and secondary AP is
-			 * started. Though we force SCC in driver, the hostapd
-			 * issues obss scan before starting secAP. This results
-			 * in MCC in DFS mode. Thus we return null scan result.
-			 * If we return scan failure hostapd fails secondary AP
-			 * startup.
-			 */
-			pAdapter->request = request;
-
-#ifdef CONFIG_CNSS
-			cnss_init_work(&pAdapter->scan_block_work,
-				       wlan_hdd_cfg80211_scan_block_cb);
-#else
-			INIT_WORK(&pAdapter->scan_block_work,
-				  wlan_hdd_cfg80211_scan_block_cb);
-#endif
-			schedule_work(&pAdapter->scan_block_work);
-			return 0;
-		}
-	}
-	if (!wma_is_hw_dbs_capable()) {
-		if (true == pScanInfo->mScanPending) {
-			if (MAX_PENDING_LOG >
-				pScanInfo->mScanPendingCounter++) {
-				hddLog(LOGE, FL("mScanPending is true"));
-			}
-			return -EBUSY;
-		}
-
-		/* Don't Allow Scan and return busy if Remain On
-		 * Channel and action frame is pending
-		 * Otherwise Cancel Remain On Channel and allow Scan
-		 * If no action frame pending
-		 */
-		if (0 != wlan_hdd_check_remain_on_channel(pAdapter)) {
-			hddLog(LOGE, FL("Remain On Channel Pending"));
-			return -EBUSY;
-		}
-	}
-#ifdef FEATURE_WLAN_TDLS
-	/* if tdls disagree scan right now, return immediately.
-	 * tdls will schedule the scan when scan is allowed.
-	 * (return SUCCESS)
-	 * or will reject the scan if any TDLS is in progress.
-	 * (return -EBUSY)
-	 */
-	status = wlan_hdd_tdls_scan_callback(pAdapter, wiphy,
-					request);
-	if (status <= 0) {
-		if (!status)
-			hddLog(LOGE,
-			FL("TDLS in progress.scan rejected %d"),
-			status);
-		else
-			hddLog(LOGE, FL("TDLS teardown is ongoing %d"),
-			       status);
-		return status;
-	}
-#endif
-
-	/* Check if scan is allowed at this point of time */
-	if (cds_is_connection_in_progress()) {
-		hddLog(LOGE, FL("Scan not allowed"));
-		return -EBUSY;
-	}
-
-	cdf_mem_zero(&scan_req, sizeof(scan_req));
-
-	hddLog(LOG1, "scan request for ssid = %d", request->n_ssids);
-	scan_req.timestamp = cdf_mc_timer_get_system_ticks();
-
-	/* Even though supplicant doesn't provide any SSIDs, n_ssids is
-	 * set to 1.  Because of this, driver is assuming that this is not
-	 * wildcard scan and so is not aging out the scan results.
-	 */
-	if ((request->ssids) && (request->n_ssids == 1) &&
-	    ('\0' == request->ssids->ssid[0])) {
-		request->n_ssids = 0;
-	}
-
-	if ((request->ssids) && (0 < request->n_ssids)) {
-		tCsrSSIDInfo *SsidInfo;
-		int j;
-		scan_req.SSIDs.numOfSSIDs = request->n_ssids;
-		/* Allocate num_ssid tCsrSSIDInfo structure */
-		SsidInfo = scan_req.SSIDs.SSIDList =
-			cdf_mem_malloc(request->n_ssids * sizeof(tCsrSSIDInfo));
-
-		if (NULL == scan_req.SSIDs.SSIDList) {
-			hddLog(LOGE, FL("memory alloc failed SSIDInfo buffer"));
-			return -ENOMEM;
-		}
-
-		/* copy all the ssid's and their length */
-		for (j = 0; j < request->n_ssids; j++, SsidInfo++) {
-			/* get the ssid length */
-			SsidInfo->SSID.length = request->ssids[j].ssid_len;
-			cdf_mem_copy(SsidInfo->SSID.ssId,
-				     &request->ssids[j].ssid[0],
-				     SsidInfo->SSID.length);
-			SsidInfo->SSID.ssId[SsidInfo->SSID.length] = '\0';
-			hddLog(LOG1, FL("SSID number %d: %s"), j,
-				SsidInfo->SSID.ssId);
-		}
-		/* set the scan type to active */
-		scan_req.scanType = eSIR_ACTIVE_SCAN;
-	} else if (WLAN_HDD_P2P_GO == pAdapter->device_mode) {
-		/* set the scan type to active */
-		scan_req.scanType = eSIR_ACTIVE_SCAN;
-	} else {
-		/*
-		 * Set the scan type to passive if there is no ssid list
-		 * provided else set default type configured in the driver.
-		 */
-		if (!request->ssids)
-			scan_req.scanType = eSIR_PASSIVE_SCAN;
-		else
-			scan_req.scanType = pHddCtx->ioctl_scan_mode;
-	}
-	scan_req.minChnTime = cfg_param->nActiveMinChnTime;
-	scan_req.maxChnTime = cfg_param->nActiveMaxChnTime;
-
-	/* set BSSType to default type */
-	scan_req.BSSType = eCSR_BSS_TYPE_ANY;
-
-	if (MAX_CHANNEL < request->n_channels) {
-		hddLog(LOGW, FL("No of Scan Channels exceeded limit: %d"),
-		       request->n_channels);
-		request->n_channels = MAX_CHANNEL;
-	}
-
-	hddLog(LOG1, FL("No of Scan Channels: %d"), request->n_channels);
-
-	if (request->n_channels) {
-		char chList[(request->n_channels * 5) + 1];
-		int len;
-		channelList = cdf_mem_malloc(request->n_channels);
-		if (NULL == channelList) {
-			hddLog(LOGE,
-			       FL("channelList malloc failed channelList"));
-			status = -ENOMEM;
-			goto free_mem;
-		}
-		for (i = 0, len = 0; i < request->n_channels; i++) {
-			channelList[i] = request->channels[i]->hw_value;
-			len += snprintf(chList + len, 5, "%d ", channelList[i]);
-		}
-
-		hddLog(LOG1, FL("Channel-List: %s"), chList);
-
-	}
-	scan_req.ChannelInfo.numOfChannels = request->n_channels;
-	scan_req.ChannelInfo.ChannelList = channelList;
-
-	/* set requestType to full scan */
-	scan_req.requestType = eCSR_SCAN_REQUEST_FULL_SCAN;
-
-	/* Flush the scan results(only p2p beacons) for STA scan and P2P
-	 * search (Flush on both full  scan and social scan but not on single
-	 * channel scan).P2P  search happens on 3 social channels (1, 6, 11)
-	 */
-
-	/* Supplicant does single channel scan after 8-way handshake
-	 * and in that case driver shoudnt flush scan results. If
-	 * driver flushes the scan results here and unfortunately if
-	 * the AP doesnt respond to our probe req then association
-	 * fails which is not desired
-	 */
-
-	if (request->n_channels != WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN) {
-		hddLog(CDF_TRACE_LEVEL_DEBUG, "Flushing P2P Results");
-		sme_scan_flush_p2p_result(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					   pAdapter->sessionId);
-	}
-
-	if (request->ie_len) {
-		/* save this for future association (join requires this) */
-		memset(&pScanInfo->scanAddIE, 0, sizeof(pScanInfo->scanAddIE));
-		memcpy(pScanInfo->scanAddIE.addIEdata, request->ie,
-		       request->ie_len);
-		pScanInfo->scanAddIE.length = request->ie_len;
-
-		if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-		    (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-		    (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
-		    ) {
-			pwextBuf->roamProfile.pAddIEScan =
-				pScanInfo->scanAddIE.addIEdata;
-			pwextBuf->roamProfile.nAddIEScanLength =
-				pScanInfo->scanAddIE.length;
-		}
-
-		scan_req.uIEFieldLen = pScanInfo->scanAddIE.length;
-		scan_req.pIEField = pScanInfo->scanAddIE.addIEdata;
-
-		pP2pIe = wlan_hdd_get_p2p_ie_ptr((uint8_t *) request->ie,
-						 request->ie_len);
-		if (pP2pIe != NULL) {
-#ifdef WLAN_FEATURE_P2P_DEBUG
-			if (((global_p2p_connection_status == P2P_GO_NEG_COMPLETED)
-			     || (global_p2p_connection_status ==
-				 P2P_GO_NEG_PROCESS))
-			    && (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) {
-				global_p2p_connection_status =
-					P2P_CLIENT_CONNECTING_STATE_1;
-				hddLog(LOGE,
-				       FL("[P2P State] Changing state from Go nego completed to Connection is started"));
-				hddLog(LOGE,
-				       FL("[P2P]P2P Scanning is started for 8way Handshake"));
-			} else
-			if ((global_p2p_connection_status ==
-			     P2P_CLIENT_DISCONNECTED_STATE)
-			    && (WLAN_HDD_P2P_CLIENT ==
-				pAdapter->device_mode)) {
-				global_p2p_connection_status =
-					P2P_CLIENT_CONNECTING_STATE_2;
-				hddLog(LOGE,
-				       FL("[P2P State] Changing state from Disconnected state to Connection is started"));
-				hddLog(LOGE,
-				       FL("[P2P]P2P Scanning is started for 4way Handshake"));
-			}
-#endif
-
-			/* no_cck will be set during p2p find to disable 11b rates */
-			if (request->no_cck) {
-				hddLog(CDF_TRACE_LEVEL_INFO,
-				       "%s: This is a P2P Search", __func__);
-				scan_req.p2pSearch = 1;
-
-				if (request->n_channels ==
-				    WLAN_HDD_P2P_SOCIAL_CHANNELS) {
-					/* set requestType to P2P Discovery */
-					scan_req.requestType =
-						eCSR_SCAN_P2P_DISCOVERY;
-				}
-
-				/*
-				 * Skip Dfs Channel in case of P2P Search if it is set in
-				 * ini file
-				 */
-				if (cfg_param->skipDfsChnlInP2pSearch) {
-					scan_req.skipDfsChnlInP2pSearch = 1;
-				} else {
-					scan_req.skipDfsChnlInP2pSearch = 0;
-				}
-
-			}
-		}
-	}
-
-	/* acquire the wakelock to avoid the apps suspend during the scan. To
-	 * address the following issues.
-	 * 1) Disconnected scenario: we are not allowing the suspend as WLAN is not in
-	 * BMPS/IMPS this result in android trying to suspend aggressively and backing off
-	 * for long time, this result in apps running at full power for long time.
-	 * 2) Connected scenario: If we allow the suspend during the scan, RIVA will
-	 * be stuck in full power because of resume BMPS
-	 */
-	hdd_prevent_suspend_timeout(HDD_WAKE_LOCK_SCAN_DURATION,
-				    WIFI_POWER_EVENT_WAKELOCK_SCAN);
-
-	hddLog(LOG2,
-	       FL("requestType %d, scanType %d, minChnTime %d, maxChnTime %d,p2pSearch %d, skipDfsChnlIn P2pSearch %d"),
-	       scan_req.requestType, scan_req.scanType,
-	       scan_req.minChnTime, scan_req.maxChnTime,
-	       scan_req.p2pSearch, scan_req.skipDfsChnlInP2pSearch);
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 7, 0))
-	if (request->flags & NL80211_SCAN_FLAG_FLUSH)
-		sme_scan_flush_result(WLAN_HDD_GET_HAL_CTX(pAdapter));
-#endif
-	status = sme_scan_request(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				pAdapter->sessionId, &scan_req,
-				&hdd_cfg80211_scan_done_callback, dev);
-
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGE, FL("sme_scan_request returned error %d"), status);
-		if (CDF_STATUS_E_RESOURCES == status) {
-			hddLog(LOGE,
-			       FL("HO is in progress.So defer the scan by informing busy"));
-			status = -EBUSY;
-		} else {
-			status = -EIO;
-		}
-
-		hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_SCAN);
-		goto free_mem;
-	}
-	wlan_hdd_scan_request_enqueue(pAdapter, request, source,
-			scan_req.scan_id, scan_req.timestamp);
-	pAdapter->scan_info.mScanPending = true;
-
-free_mem:
-	if (scan_req.SSIDs.SSIDList)
-		cdf_mem_free(scan_req.SSIDs.SSIDList);
-
-	if (channelList)
-		cdf_mem_free(channelList);
-
-	EXIT();
-	return status;
-}
-
-/**
- * wlan_hdd_cfg80211_scan() - API to process cfg80211 scan request
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to net device
- * @request: Pointer to scan request
- *
- * This API responds to scan trigger and update cfg80211 scan database
- * later, scan dump command can be used to recieve scan results
- *
- * Return: 0 for success, non zero for failure
- */
-int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
-			   struct cfg80211_scan_request *request)
-{
-	int ret;
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_scan(wiphy,
-				request, NL_SCAN);
-	cds_ssr_unprotect(__func__);
-	return ret;
-}
-
-/**
- * wlan_hdd_get_rates() -API to get the rates from scan request
- * @wiphy: Pointer to wiphy
- * @band: Band
- * @rates: array of rates
- * @rate_count: number of rates
- *
- * Return: o for failure, rate bitmap for success
- */
-static uint32_t wlan_hdd_get_rates(struct wiphy *wiphy,
-	enum ieee80211_band band,
-	const u8 *rates, unsigned int rate_count)
-{
-	uint32_t j, count, rate_bitmap = 0;
-	uint32_t rate;
-	bool found;
-
-	for (count = 0; count < rate_count; count++) {
-		rate = ((rates[count]) & RATE_MASK) * 5;
-		found = false;
-		for (j = 0; j < wiphy->bands[band]->n_bitrates; j++) {
-			if (wiphy->bands[band]->bitrates[j].bitrate == rate) {
-				found = true;
-				rate_bitmap |= (1 << j);
-				break;
-			}
-		}
-		if (!found)
-			return 0;
-	}
-	return rate_bitmap;
-}
-
-/**
- * wlan_hdd_send_scan_start_event() -API to send the scan start event
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to net device
- * @cookie: scan identifier
- *
- * Return: return 0 on success and negative error code on failure
- */
-static int wlan_hdd_send_scan_start_event(struct wiphy *wiphy,
-		struct wireless_dev *wdev, uint64_t cookie)
-{
-	struct sk_buff *skb;
-	int ret;
-
-	skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u64) +
-			NLA_HDRLEN + NLMSG_HDRLEN);
-	if (!skb) {
-		hddLog(LOGE, FL(" reply skb alloc failed"));
-		return -ENOMEM;
-	}
-
-	if (nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie)) {
-		hddLog(LOGE, FL("nla put fail"));
-		kfree_skb(skb);
-		return -EINVAL;
-	}
-
-	ret = cfg80211_vendor_cmd_reply(skb);
-
-	/* Send a scan started event to supplicant */
-	skb = cfg80211_vendor_event_alloc(wiphy, wdev,
-		sizeof(u64) + 4 + NLMSG_HDRLEN,
-		QCA_NL80211_VENDOR_SUBCMD_SCAN_INDEX, GFP_KERNEL);
-	if (!skb) {
-		hddLog(LOGE, FL("skb alloc failed"));
-		return -ENOMEM;
-	}
-
-	ret = hdd_vendor_put_ifindex(skb, wdev->netdev->ifindex);
-	if (ret) {
-		kfree_skb(skb);
-		return -EINVAL;
-	}
-
-	if (nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie)) {
-		kfree_skb(skb);
-		return -EINVAL;
-	}
-	cfg80211_vendor_event(skb, GFP_KERNEL);
-
-	return ret;
-}
-/**
- * __wlan_hdd_cfg80211_vendor_scan() - API to process venor scan request
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to net device
- * @data : Pointer to the data
- * @data_len : length of the data
- *
- * API to process venor scan request.
- *
- * Return: return 0 on success and negative error code on failure
- */
-static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
-		struct wireless_dev *wdev, const void *data,
-		int data_len)
-{
-	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SCAN_MAX + 1];
-	struct cfg80211_scan_request *request = NULL;
-	struct nlattr *attr;
-	enum ieee80211_band band;
-	uint8_t n_channels = 0, n_ssid = 0, ie_len = 0;
-	uint32_t tmp, count, j;
-	unsigned int len;
-	struct ieee80211_channel *chan;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-	int ret;
-
-	ENTER();
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_SCAN_MAX, data,
-		data_len, NULL)) {
-		hdd_err("Invalid ATTR");
-		return -EINVAL;
-	}
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES]) {
-		nla_for_each_nested(attr,
-			tb[QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES], tmp)
-			n_channels++;
-	} else {
-		for (band = 0; band < IEEE80211_NUM_BANDS; band++)
-			if (wiphy->bands[band])
-				n_channels += wiphy->bands[band]->n_channels;
-	}
-
-	if (MAX_CHANNEL < n_channels) {
-		hdd_err("Exceed max number of channels: %d", n_channels);
-		return -EINVAL;
-	}
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS])
-		nla_for_each_nested(attr,
-			tb[QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS], tmp)
-			n_ssid++;
-
-	if (MAX_SCAN_SSID < n_ssid) {
-		hdd_err("Exceed max number of SSID: %d", n_ssid);
-		return -EINVAL;
-	}
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE])
-		ie_len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]);
-	else
-		ie_len = 0;
-
-	len = sizeof(*request) + (sizeof(*request->ssids) * n_ssid) +
-			(sizeof(*request->channels) * n_channels) + ie_len;
-
-	request = cdf_mem_malloc(len);
-	if (!request)
-		goto error;
-	if (n_ssid)
-		request->ssids = (void *)&request->channels[n_channels];
-	request->n_ssids = n_ssid;
-	if (ie_len) {
-		if (request->ssids)
-			request->ie = (void *)(request->ssids + n_ssid);
-		else
-			request->ie = (void *)(request->channels + n_channels);
-	}
-
-	count = 0;
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES]) {
-		nla_for_each_nested(attr,
-				tb[QCA_WLAN_VENDOR_ATTR_SCAN_FREQUENCIES],
-				tmp) {
-			chan = __ieee80211_get_channel(wiphy,
-							nla_get_u32(attr));
-			if (!chan)
-				goto error;
-			if (chan->flags & IEEE80211_CHAN_DISABLED)
-				continue;
-			request->channels[count] = chan;
-			count++;
-		}
-	} else {
-		for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
-			if (!wiphy->bands[band])
-				continue;
-			for (j = 0; j < wiphy->bands[band]->n_channels;
-				j++) {
-				chan = &wiphy->bands[band]->channels[j];
-				if (chan->flags & IEEE80211_CHAN_DISABLED)
-					continue;
-				request->channels[count] = chan;
-				count++;
-			}
-		}
-	}
-
-	if (!count)
-		goto error;
-
-	request->n_channels = count;
-	count = 0;
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS]) {
-		nla_for_each_nested(attr, tb[QCA_WLAN_VENDOR_ATTR_SCAN_SSIDS],
-				tmp) {
-			request->ssids[count].ssid_len = nla_len(attr);
-			memcpy(request->ssids[count].ssid, nla_data(attr),
-					nla_len(attr));
-			count++;
-		}
-	}
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]) {
-		request->ie_len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]);
-		memcpy((void *)request->ie,
-				nla_data(tb[QCA_WLAN_VENDOR_ATTR_SCAN_IE]),
-				request->ie_len);
-	}
-
-	for (count = 0; count < IEEE80211_NUM_BANDS; count++)
-		if (wiphy->bands[count])
-			request->rates[count] =
-				(1 << wiphy->bands[count]->n_bitrates) - 1;
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES]) {
-		nla_for_each_nested(attr,
-			tb[QCA_WLAN_VENDOR_ATTR_SCAN_SUPP_RATES],
-			tmp) {
-			band = nla_type(attr);
-			if (!wiphy->bands[band])
-				continue;
-			request->rates[band] = wlan_hdd_get_rates(wiphy,
-							band, nla_data(attr),
-							nla_len(attr));
-		}
-	}
-
-	if (tb[QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS]) {
-		request->flags =
-			nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS]);
-		if ((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) &&
-		!(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) {
-			hddLog(LOGE, FL("LOW PRIORITY SCAN not supported"));
-			goto error;
-		}
-	}
-	request->no_cck =
-		nla_get_flag(tb[QCA_WLAN_VENDOR_ATTR_SCAN_TX_NO_CCK_RATE]);
-	request->wdev = wdev;
-	request->wiphy = wiphy;
-	request->scan_start = jiffies;
-
-	if (0 != __wlan_hdd_cfg80211_scan(wiphy, request, VENDOR_SCAN))
-		goto error;
-
-	ret = wlan_hdd_send_scan_start_event(wiphy, wdev, (uintptr_t)request);
-
-	return ret;
-error:
-	hdd_err("Scan Request Failed");
-	cdf_mem_free(request);
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_vendor_scan() -API to process venor scan request
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to net device
- * @data : Pointer to the data
- * @data_len : length of the data
- *
- * This is called from userspace to request scan.
- *
- * Return: Return the Success or Failure code.
- */
-int wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
-		struct wireless_dev *wdev, const void *data,
-		int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_vendor_scan(wiphy, wdev,
-					      data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-/**
- * wlan_hdd_scan_abort() - abort ongoing scan
- * @pAdapter: Pointer to interface adapter
- *
- * Return: 0 for success, non zero for failure
- */
-#ifdef FEATURE_WLAN_SCAN_PNO
-int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter)
-{
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	hdd_scaninfo_t *pScanInfo = NULL;
-	unsigned long rc;
-
-	pScanInfo = &pAdapter->scan_info;
-
-	if (pScanInfo->mScanPending) {
-		INIT_COMPLETION(pScanInfo->abortscan_event_var);
-		hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId,
-				   eCSR_SCAN_ABORT_DEFAULT);
-
-		rc = wait_for_completion_timeout(
-			&pScanInfo->abortscan_event_var,
-				msecs_to_jiffies(5000));
-		if (!rc) {
-			hddLog(LOGE,
-				FL("Timeout occurred while waiting for abort scan"));
-			return -ETIME;
-		}
-	}
-	return 0;
-}
-
-/**
- * hdd_sched_scan_callback - scheduled scan callback
- * @callbackContext: Callback context
- * @pPrefNetworkFoundInd: Preferred network found indication
- *
- * This is a callback function that is registerd with SME that is
- * invoked when a preferred network is discovered by firmware.
- *
- * Return: none
- */
-static void
-hdd_sched_scan_callback(void *callbackContext,
-			tSirPrefNetworkFoundInd *pPrefNetworkFoundInd)
-{
-	int ret;
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) callbackContext;
-	hdd_context_t *pHddCtx;
-
-	ENTER();
-
-	if (NULL == pAdapter) {
-		hddLog(LOGE, FL("HDD adapter is Null"));
-		return;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	if (NULL == pHddCtx) {
-		hddLog(LOGE, FL("HDD context is Null!!!"));
-		return;
-	}
-
-	cdf_spin_lock(&pHddCtx->sched_scan_lock);
-	if (true == pHddCtx->isWiphySuspended) {
-		pHddCtx->isSchedScanUpdatePending = true;
-		cdf_spin_unlock(&pHddCtx->sched_scan_lock);
-		hddLog(LOG1,
-		       FL("Update cfg80211 scan database after it resume"));
-		return;
-	}
-	cdf_spin_unlock(&pHddCtx->sched_scan_lock);
-
-	ret = wlan_hdd_cfg80211_update_bss(pHddCtx->wiphy, pAdapter, 0);
-
-	if (0 > ret)
-		hddLog(LOG1, FL("NO SCAN result"));
-
-	cfg80211_sched_scan_results(pHddCtx->wiphy);
-	hddLog(LOG1,
-		FL("cfg80211 scan result database updated"));
-}
-
-/**
- * wlan_hdd_is_pno_allowed() -  Check if PNO is allowed
- * @adapter: HDD Device Adapter
- *
- * The PNO Start request is coming from upper layers.
- * It is to be allowed only for Infra STA device type
- * and the link should be in a disconnected state.
- *
- * Return: Success if PNO is allowed, Failure otherwise.
- */
-static CDF_STATUS wlan_hdd_is_pno_allowed(hdd_adapter_t *adapter)
-{
-	hddLog(LOG1,
-		FL("dev_mode=%d, conn_state=%d, session ID=%d"),
-		adapter->device_mode,
-		adapter->sessionCtx.station.conn_info.connState,
-		adapter->sessionId);
-	if ((adapter->device_mode == WLAN_HDD_INFRA_STATION) &&
-		(eConnectionState_NotConnected ==
-		 adapter->sessionCtx.station.conn_info.connState))
-		return CDF_STATUS_SUCCESS;
-	else
-		return CDF_STATUS_E_FAILURE;
-
-}
-
-/**
- * __wlan_hdd_cfg80211_sched_scan_start() - cfg80211 scheduled scan(pno) start
- * @wiphy: Pointer to wiphy
- * @dev: Pointer network device
- * @request: Pointer to cfg80211 scheduled scan start request
- *
- * Return: 0 for success, non zero for failure
- */
-static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
-						struct net_device *dev,
-						struct
-						cfg80211_sched_scan_request
-						*request)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	tpSirPNOScanReq pPnoRequest = NULL;
-	hdd_context_t *pHddCtx;
-	tHalHandle hHal;
-	uint32_t i, indx, num_ch, j;
-	u8 valid_ch[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
-	u8 channels_allowed[WNI_CFG_VALID_CHANNEL_LIST_LEN] = { 0 };
-	uint32_t num_channels_allowed = WNI_CFG_VALID_CHANNEL_LIST_LEN;
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	int ret = 0;
-	hdd_scaninfo_t *pScanInfo = &pAdapter->scan_info;
-	struct hdd_config *config = NULL;
-	uint32_t num_ignore_dfs_ch = 0;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != ret)
-		return ret;
-
-	config = pHddCtx->config;
-	hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	if (NULL == hHal) {
-		hddLog(LOGE, FL("HAL context  is Null!!!"));
-		return -EINVAL;
-	}
-
-	if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) &&
-	    (eConnectionState_Connecting ==
-	     (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState)) {
-		hddLog(LOGE,
-		       FL("%p(%d) Connection in progress: sched_scan_start denied (EBUSY)"),
-		       WLAN_HDD_GET_STATION_CTX_PTR(pAdapter),
-		       pAdapter->sessionId);
-		return -EBUSY;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SCHED_SCAN_START,
-			 pAdapter->sessionId, pAdapter->device_mode));
-	/*
-	 * The current umac is unable to handle the SCAN_PREEMPT and SCAN_DEQUEUED
-	 * so its necessary to terminate the existing scan which is already issued
-	 * otherwise the host won't enter into the suspend state due to the reason
-	 * that the wlan wakelock which was held in the wlan_hdd_cfg80211_scan
-	 * function.
-	 */
-	sme_scan_flush_result(hHal);
-	if (true == pScanInfo->mScanPending) {
-		ret = wlan_hdd_scan_abort(pAdapter);
-		if (ret < 0) {
-			hddLog(LOGE,
-				  FL("aborting the existing scan is unsuccessful"));
-			return -EBUSY;
-		}
-	}
-
-	if (CDF_STATUS_E_FAILURE == wlan_hdd_is_pno_allowed(pAdapter)) {
-		hddLog(LOGE, FL("pno is not allowed"));
-		return -ENOTSUPP;
-	}
-
-	pPnoRequest = (tpSirPNOScanReq) cdf_mem_malloc(sizeof(tSirPNOScanReq));
-	if (NULL == pPnoRequest) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	memset(pPnoRequest, 0, sizeof(tSirPNOScanReq));
-	pPnoRequest->enable = 1;        /*Enable PNO */
-	pPnoRequest->ucNetworksCount = request->n_match_sets;
-
-	if ((!pPnoRequest->ucNetworksCount) ||
-	    (pPnoRequest->ucNetworksCount > SIR_PNO_MAX_SUPP_NETWORKS)) {
-		hddLog(LOGE, FL("Network input is not correct %d"),
-			pPnoRequest->ucNetworksCount);
-		ret = -EINVAL;
-		goto error;
-	}
-
-	if (SIR_PNO_MAX_NETW_CHANNELS_EX < request->n_channels) {
-		hddLog(LOGE, FL("Incorrect number of channels %d"),
-			request->n_channels);
-		ret = -EINVAL;
-		goto error;
-	}
-
-	/* Framework provides one set of channels(all)
-	 * common for all saved profile */
-	if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
-				 channels_allowed, &num_channels_allowed)) {
-		hddLog(LOGE,
-			 FL("failed to get valid channel list"));
-		ret = -EINVAL;
-		goto error;
-	}
-	/* Checking each channel against allowed channel list */
-	num_ch = 0;
-	if (request->n_channels) {
-		char chList[(request->n_channels * 5) + 1];
-		int len;
-		for (i = 0, len = 0; i < request->n_channels; i++) {
-			for (indx = 0; indx < num_channels_allowed; indx++) {
-				if (request->channels[i]->hw_value ==
-				    channels_allowed[indx]) {
-
-					if ((!config->enable_dfs_pno_chnl_scan)
-						&& (CHANNEL_STATE_DFS ==
-						cds_get_channel_state(
-						    channels_allowed[indx]))) {
-						CDF_TRACE(CDF_MODULE_ID_HDD,
-						    CDF_TRACE_LEVEL_INFO,
-						    "%s : Dropping DFS channel : %d",
-						     __func__,
-						    channels_allowed[indx]);
-						num_ignore_dfs_ch++;
-						break;
-					}
-
-					valid_ch[num_ch++] =
-						request->channels[i]->hw_value;
-					len +=
-						snprintf(chList + len, 5, "%d ",
-							 request->channels[i]->
-							 hw_value);
-					break;
-				}
-			}
-		}
-		hddLog(LOG1, FL("Channel-List: %s "), chList);
-
-		/* If all channels are DFS and dropped,
-		 * then ignore the PNO request
-		 */
-		if (num_ignore_dfs_ch == request->n_channels) {
-			CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-				"%s : All requested channels are DFS channels",
-				 __func__);
-			ret = -EINVAL;
-			goto error;
-		}
-
-	}
-	/* Filling per profile  params */
-	for (i = 0; i < pPnoRequest->ucNetworksCount; i++) {
-		pPnoRequest->aNetworks[i].ssId.length =
-			request->match_sets[i].ssid.ssid_len;
-
-		if ((0 == pPnoRequest->aNetworks[i].ssId.length) ||
-		    (pPnoRequest->aNetworks[i].ssId.length > 32)) {
-			hddLog(LOGE,
-				FL(" SSID Len %d is not correct for network %d"),
-				  pPnoRequest->aNetworks[i].ssId.length, i);
-			ret = -EINVAL;
-			goto error;
-		}
-
-		memcpy(pPnoRequest->aNetworks[i].ssId.ssId,
-		       request->match_sets[i].ssid.ssid,
-		       request->match_sets[i].ssid.ssid_len);
-		pPnoRequest->aNetworks[i].authentication = 0;   /*eAUTH_TYPE_ANY */
-		pPnoRequest->aNetworks[i].encryption = 0;       /*eED_ANY */
-		pPnoRequest->aNetworks[i].bcastNetwType = 0;    /*eBCAST_UNKNOWN */
-
-		/*Copying list of valid channel into request */
-		memcpy(pPnoRequest->aNetworks[i].aChannels, valid_ch, num_ch);
-		pPnoRequest->aNetworks[i].ucChannelCount = num_ch;
-		pPnoRequest->aNetworks[i].rssiThreshold =
-			request->match_sets[i].rssi_thold;
-	}
-
-	for (i = 0; i < request->n_ssids; i++) {
-		j = 0;
-		while (j < pPnoRequest->ucNetworksCount) {
-			if ((pPnoRequest->aNetworks[j].ssId.length ==
-			     request->ssids[i].ssid_len) &&
-			    (0 == memcmp(pPnoRequest->aNetworks[j].ssId.ssId,
-					 request->ssids[i].ssid,
-					 pPnoRequest->aNetworks[j].ssId.
-					 length))) {
-				pPnoRequest->aNetworks[j].bcastNetwType =
-					eBCAST_HIDDEN;
-				break;
-			}
-			j++;
-		}
-	}
-	hddLog(LOG1, FL("Number of hidden networks being Configured = %d"),
-		  request->n_ssids);
-
-	hddLog(LOG1, FL("request->ie_len = %zu"), request->ie_len);
-	if ((0 < request->ie_len) && (NULL != request->ie)) {
-		pPnoRequest->us24GProbeTemplateLen = request->ie_len;
-		memcpy(&pPnoRequest->p24GProbeTemplate, request->ie,
-		       pPnoRequest->us24GProbeTemplateLen);
-
-		pPnoRequest->us5GProbeTemplateLen = request->ie_len;
-		memcpy(&pPnoRequest->p5GProbeTemplate, request->ie,
-		       pPnoRequest->us5GProbeTemplateLen);
-	}
-
-	/*
-	 * Driver gets only one time interval which is hard coded in
-	 * supplicant for 10000ms. Taking power consumption into account
-	 * firmware after gPNOScanTimerRepeatValue times fast_scan_period
-	 * switches slow_scan_period. This is less frequent scans and firmware
-	 * shall be in slow_scan_period mode until next PNO Start.
-	 */
-	pPnoRequest->fast_scan_period = request->interval;
-	pPnoRequest->fast_scan_max_cycles =
-				config->configPNOScanTimerRepeatValue;
-	pPnoRequest->slow_scan_period =
-			config->pno_slow_scan_multiplier *
-				pPnoRequest->fast_scan_period;
-
-	hdd_info("Base scan interval: %d sec PNOScanTimerRepeatValue: %d",
-			(request->interval / 1000),
-			config->configPNOScanTimerRepeatValue);
-
-	pPnoRequest->modePNO = SIR_PNO_MODE_IMMEDIATE;
-
-	hdd_info("SessionId %d, enable %d, modePNO %d",
-		pAdapter->sessionId, pPnoRequest->enable, pPnoRequest->modePNO);
-
-	status = sme_set_preferred_network_list(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						pPnoRequest,
-						pAdapter->sessionId,
-						hdd_sched_scan_callback,
-						pAdapter);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGE, FL("Failed to enable PNO"));
-		ret = -EINVAL;
-		goto error;
-	}
-
-	hddLog(LOG1, FL("PNO scanRequest offloaded"));
-
-error:
-	cdf_mem_free(pPnoRequest);
-	EXIT();
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_sched_scan_start() - cfg80211 scheduled scan(pno) start
- * @wiphy: Pointer to wiphy
- * @dev: Pointer network device
- * @request: Pointer to cfg80211 scheduled scan start request
- *
- * Return: 0 for success, non zero for failure
- */
-int wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
-				       struct net_device *dev,
-				       struct cfg80211_sched_scan_request
-				       *request)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_sched_scan_start(wiphy, dev, request);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * __wlan_hdd_cfg80211_sched_scan_stop() - stop cfg80211 scheduled scan(pno)
- * @wiphy: Pointer to wiphy
- * @dev: Pointer network device
- *
- * Return: 0 for success, non zero for failure
- */
-static int __wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
-					       struct net_device *dev)
-{
-	CDF_STATUS status = CDF_STATUS_E_FAILURE;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	tHalHandle hHal;
-	tpSirPNOScanReq pPnoRequest = NULL;
-	int ret = 0;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	if (NULL == pHddCtx) {
-		hddLog(LOGE, FL("HDD context is Null"));
-		return -ENODEV;
-	}
-
-	/* The return 0 is intentional when Recovery and Load/Unload in
-	 * progress. We did observe a crash due to a return of
-	 * failure in sched_scan_stop , especially for a case where the unload
-	 * of the happens at the same time. The function __cfg80211_stop_sched_scan
-	 * was clearing rdev->sched_scan_req only when the sched_scan_stop returns
-	 * success. If it returns a failure , then its next invocation due to the
-	 * clean up of the second interface will have the dev pointer corresponding
-	 * to the first one leading to a crash.
-	 */
-	if (cds_is_driver_recovering()) {
-		hdd_err("Recovery in Progress. State: 0x%x Ignore!!!",
-			 cds_get_driver_state());
-		return ret;
-	}
-
-	if (cds_is_load_or_unload_in_progress()) {
-		hdd_err("Unload/Load in Progress, state: 0x%x.  Ignore!!!",
-			cds_get_driver_state());
-		return ret;
-	}
-
-	hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	if (NULL == hHal) {
-		hddLog(LOGE, FL(" HAL context  is Null!!!"));
-		return -EINVAL;
-	}
-
-	pPnoRequest = (tpSirPNOScanReq) cdf_mem_malloc(sizeof(tSirPNOScanReq));
-	if (NULL == pPnoRequest) {
-		hddLog(LOGE, FL("cdf_mem_malloc failed"));
-		return -ENOMEM;
-	}
-
-	memset(pPnoRequest, 0, sizeof(tSirPNOScanReq));
-	pPnoRequest->enable = 0;        /* Disable PNO */
-	pPnoRequest->ucNetworksCount = 0;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_SCHED_SCAN_STOP,
-			 pAdapter->sessionId, pAdapter->device_mode));
-	status = sme_set_preferred_network_list(hHal, pPnoRequest,
-						pAdapter->sessionId,
-						NULL, pAdapter);
-	if (CDF_STATUS_SUCCESS != status) {
-		hddLog(LOGE, FL("Failed to disabled PNO"));
-		ret = -EINVAL;
-	}
-
-	hddLog(LOG1, FL("PNO scan disabled"));
-
-	cdf_mem_free(pPnoRequest);
-
-	EXIT();
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_sched_scan_stop() - stop cfg80211 scheduled scan(pno)
- * @wiphy: Pointer to wiphy
- * @dev: Pointer network device
- *
- * Return: 0 for success, non zero for failure
- */
-int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
-				      struct net_device *dev)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_sched_scan_stop(wiphy, dev);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-#endif /*FEATURE_WLAN_SCAN_PNO */
-
-/**
- * hdd_vendor_put_ifindex() -send interface index
- * @skb: buffer pointer
- * @ifindex: interface index
- *
- * Send the IF index to differentiate the events on each interface
- * Return: 0 for success, non zero for failure
- */
-int hdd_vendor_put_ifindex(struct sk_buff *skb, int ifindex)
-{
-	struct nlattr *attr;
-
-	nla_nest_cancel(skb, ((void **)skb->cb)[2]);
-	if (nla_put_u32(skb, NL80211_ATTR_IFINDEX, ifindex))
-		return -EINVAL;
-
-	attr = nla_nest_start(skb, NL80211_ATTR_VENDOR_DATA);
-	((void **)skb->cb)[2] = attr;
-
-	return 0;
-}

+ 0 - 72
core/hdd/src/wlan_hdd_scan.h

@@ -1,72 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC : wlan_hdd_scan.h
- *
- * WLAN Host Device Driver scan related implementation
- *
- */
-
-#if !defined(WLAN_HDD_SCAN_H)
-#define WLAN_HDD_SCAN_H
-
-#include "wlan_hdd_main.h"
-
-#define MAX_PENDING_LOG 5
-
-/*
- * enum scan_source - scan request source
- *
- * @NL_SCAN: Scan initiated from NL
- * @VENDOR_SCAN: Scan intiated from vendor command
-*/
-enum scan_source {
-	NL_SCAN,
-	VENDOR_SCAN,
-};
-
-int iw_get_scan(struct net_device *dev, struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra);
-
-int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
-		union iwreq_data *wrqu, char *extra);
-
-int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
-			   struct cfg80211_scan_request *request);
-
-#ifdef FEATURE_WLAN_SCAN_PNO
-int wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
-				       struct net_device *dev,
-				       struct cfg80211_sched_scan_request
-				       *request);
-
-int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
-				      struct net_device *dev);
-#endif /* End of FEATURE_WLAN_SCAN_PNO */
-
-int wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
-		struct wireless_dev *wdev, const void *data,
-		int data_len);
-
-int hdd_vendor_put_ifindex(struct sk_buff *skb, int ifindex);
-#endif /* end #if !defined(WLAN_HDD_SCAN_H) */
-

+ 0 - 919
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -1,919 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/* Include files */
-#include <linux/semaphore.h>
-#include <wlan_hdd_tx_rx.h>
-#include <wlan_hdd_softap_tx_rx.h>
-#include <linux/netdevice.h>
-#include <linux/skbuff.h>
-#include <linux/etherdevice.h>
-#include <cdf_types.h>
-#include <ani_global.h>
-#include <cdf_types.h>
-#include <net/ieee80211_radiotap.h>
-#include <cds_sched.h>
-#include <wlan_hdd_napi.h>
-
-#ifdef IPA_OFFLOAD
-#include <wlan_hdd_ipa.h>
-#endif
-
-/* Preprocessor definitions and constants */
-#undef QCA_HDD_SAP_DUMP_SK_BUFF
-
-/* Type declarations */
-
-/* Function definitions and documenation */
-#ifdef QCA_HDD_SAP_DUMP_SK_BUFF
-/**
- * hdd_softap_dump_sk_buff() - Dump an skb
- * @skb: skb to dump
- *
- * Return: None
- */
-static void hdd_softap_dump_sk_buff(struct sk_buff *skb)
-{
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "%s: head = %p ", __func__, skb->head);
-	/* CDF_TRACE( CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,"%s: data = %p ", __func__, skb->data); */
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "%s: tail = %p ", __func__, skb->tail);
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "%s: end = %p ", __func__, skb->end);
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "%s: len = %d ", __func__, skb->len);
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "%s: data_len = %d ", __func__, skb->data_len);
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "%s: mac_len = %d", __func__, skb->mac_len);
-
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x ", skb->data[0],
-		  skb->data[1], skb->data[2], skb->data[3], skb->data[4],
-		  skb->data[5], skb->data[6], skb->data[7]);
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x", skb->data[8],
-		  skb->data[9], skb->data[10], skb->data[11], skb->data[12],
-		  skb->data[13], skb->data[14], skb->data[15]);
-}
-#else
-static void hdd_softap_dump_sk_buff(struct sk_buff *skb)
-{
-}
-#endif
-
-#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
-/**
- * hdd_softap_tx_resume_timer_expired_handler() - TX Q resume timer handler
- * @adapter_context: pointer to vdev adapter
- *
- * TX Q resume timer handler for SAP and P2P GO interface.  If Blocked
- * OS Q is not resumed during timeout period, to prevent permanent
- * stall, resume OS Q forcefully for SAP and P2P GO interface.
- *
- * Return: None
- */
-void hdd_softap_tx_resume_timer_expired_handler(void *adapter_context)
-{
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) adapter_context;
-
-	if (!pAdapter) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: INV ARG", __func__);
-		/* INVALID ARG */
-		return;
-	}
-
-	hddLog(LOG1, FL("Enabling queues"));
-	wlan_hdd_netif_queue_control(pAdapter, WLAN_WAKE_ALL_NETIF_QUEUE,
-				   WLAN_CONTROL_PATH);
-	return;
-}
-
-/**
- * hdd_softap_tx_resume_cb() - Resume OS TX Q.
- * @adapter_context: pointer to vdev apdapter
- * @tx_resume: TX Q resume trigger
- *
- * Q was stopped due to WLAN TX path low resource condition
- *
- * Return: None
- */
-void hdd_softap_tx_resume_cb(void *adapter_context, bool tx_resume)
-{
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) adapter_context;
-
-	if (!pAdapter) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: INV ARG", __func__);
-		/* INVALID ARG */
-		return;
-	}
-
-	/* Resume TX  */
-	if (true == tx_resume) {
-		if (CDF_TIMER_STATE_STOPPED !=
-		    cdf_mc_timer_get_current_state(&pAdapter->
-						   tx_flow_control_timer)) {
-			cdf_mc_timer_stop(&pAdapter->tx_flow_control_timer);
-		}
-
-		hddLog(LOG1, FL("Enabling queues"));
-		wlan_hdd_netif_queue_control(pAdapter,
-					WLAN_WAKE_ALL_NETIF_QUEUE,
-					WLAN_DATA_FLOW_CONTROL);
-	}
-	return;
-}
-#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
-
-/**
- * hdd_softap_hard_start_xmit() - Transmit a frame
- * @skb: pointer to OS packet (sk_buff)
- * @dev: pointer to network device
- *
- * Function registered with the Linux OS for transmitting
- * packets. This version of the function directly passes
- * the packet to Transport Layer.
- *
- * Return: Always returns NETDEV_TX_OK
- */
-int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-	sme_ac_enum_type ac = SME_AC_BE;
-	hdd_adapter_t *pAdapter = (hdd_adapter_t *) netdev_priv(dev);
-	hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
-	struct cdf_mac_addr *pDestMacAddress;
-	uint8_t STAId;
-	uint8_t proto_type = 0;
-#ifdef QCA_PKT_PROTO_TRACE
-	hdd_context_t *hddCtxt = (hdd_context_t *) pAdapter->pHddCtx;
-#endif /* QCA_PKT_PROTO_TRACE */
-
-	++pAdapter->hdd_stats.hddTxRxStats.txXmitCalled;
-	/* Prevent this function from being called during SSR since TL
-	 * context may not be reinitialized at this time which may
-	 * lead to a crash.
-	 */
-	if (cds_is_driver_recovering()) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO_HIGH,
-			  "%s: Recovery in Progress. Ignore!!!", __func__);
-		goto drop_pkt;
-	}
-
-	/*
-	 * If the device is operating on a DFS Channel
-	 * then check if SAP is in CAC WAIT state and
-	 * drop the packets. In CAC WAIT state device
-	 * is expected not to transmit any frames.
-	 * SAP starts Tx only after the BSS START is
-	 * done.
-	 */
-	if (pHddApCtx->dfs_cac_block_tx) {
-		goto drop_pkt;
-	}
-
-	pDestMacAddress = (struct cdf_mac_addr *) skb->data;
-
-	if (cdf_is_macaddr_broadcast(pDestMacAddress) ||
-	    cdf_is_macaddr_group(pDestMacAddress)) {
-		/* The BC/MC station ID is assigned during BSS
-		 * starting phase.  SAP will return the station ID
-		 * used for BC/MC traffic.
-		 */
-		STAId = pHddApCtx->uBCStaId;
-	} else {
-		if (CDF_STATUS_SUCCESS !=
-			 hdd_softap_get_sta_id(pAdapter,
-				 pDestMacAddress, &STAId)) {
-			CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA,
-				  CDF_TRACE_LEVEL_WARN,
-				  "%s: Failed to find right station", __func__);
-			goto drop_pkt;
-		}
-
-		if (STAId == HDD_WLAN_INVALID_STA_ID) {
-			CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA,
-				  CDF_TRACE_LEVEL_WARN,
-				  "%s: Failed to find right station", __func__);
-			goto drop_pkt;
-		} else if (false == pAdapter->aStaInfo[STAId].isUsed) {
-			CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA,
-				  CDF_TRACE_LEVEL_WARN,
-				  "%s: STA %d is unregistered", __func__,
-				  STAId);
-			goto drop_pkt;
-		}
-
-		if ((ol_txrx_peer_state_conn !=
-		     pAdapter->aStaInfo[STAId].tlSTAState)
-		    && (ol_txrx_peer_state_auth !=
-			pAdapter->aStaInfo[STAId].tlSTAState)) {
-			CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA,
-				  CDF_TRACE_LEVEL_WARN,
-				  "%s: Station not connected yet", __func__);
-			goto drop_pkt;
-		} else if (ol_txrx_peer_state_conn ==
-			   pAdapter->aStaInfo[STAId].tlSTAState) {
-			if (ntohs(skb->protocol) != HDD_ETHERTYPE_802_1_X) {
-				CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA,
-					  CDF_TRACE_LEVEL_WARN,
-					  "%s: NON-EAPOL packet in non-Authenticated state",
-					  __func__);
-				goto drop_pkt;
-			}
-		}
-	}
-
-	hdd_get_tx_resource(pAdapter, STAId,
-			WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME);
-
-	/* Get TL AC corresponding to Qdisc queue index/AC. */
-	ac = hdd_qdisc_ac_to_tl_ac[skb->queue_mapping];
-	++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac];
-
-#if defined (IPA_OFFLOAD)
-	if (!(NBUF_OWNER_ID(skb) == IPA_NBUF_OWNER_ID)) {
-#endif
-		/* Check if the buffer has enough header room */
-		skb = skb_unshare(skb, GFP_ATOMIC);
-		if (!skb)
-			goto drop_pkt_accounting;
-
-		if (skb_headroom(skb) < dev->hard_header_len) {
-			struct sk_buff *tmp;
-			tmp = skb;
-			skb = skb_realloc_headroom(tmp, dev->hard_header_len);
-			dev_kfree_skb(tmp);
-			if (!skb)
-				goto drop_pkt_accounting;
-		}
-#if defined (IPA_OFFLOAD)
-	}
-#endif
-
-	wlan_hdd_log_eapol(skb,
-			   WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED);
-
-#ifdef QCA_PKT_PROTO_TRACE
-	if ((hddCtxt->config->gEnableDebugLog & CDS_PKT_TRAC_TYPE_EAPOL) ||
-	    (hddCtxt->config->gEnableDebugLog & CDS_PKT_TRAC_TYPE_DHCP)) {
-		/* Proto Trace enabled */
-		proto_type = cds_pkt_get_proto_type(skb,
-						    hddCtxt->config->
-						    gEnableDebugLog, 0);
-		if (CDS_PKT_TRAC_TYPE_EAPOL & proto_type) {
-			cds_pkt_trace_buf_update("HA:T:EPL");
-		} else if (CDS_PKT_TRAC_TYPE_DHCP & proto_type) {
-			cds_pkt_trace_buf_update("HA:T:DHC");
-		}
-	}
-#endif /* QCA_PKT_PROTO_TRACE */
-	pAdapter->stats.tx_bytes += skb->len;
-	++pAdapter->stats.tx_packets;
-
-	/* Zero out skb's context buffer for the driver to use */
-	cdf_mem_set(skb->cb, sizeof(skb->cb), 0);
-	NBUF_SET_PACKET_TRACK(skb, NBUF_TX_PKT_DATA_TRACK);
-	NBUF_UPDATE_TX_PKT_COUNT(skb, NBUF_TX_PKT_HDD);
-
-	cdf_dp_trace_set_track(skb);
-	DPTRACE(cdf_dp_trace(skb, CDF_DP_TRACE_HDD_PACKET_PTR_RECORD,
-				(uint8_t *)skb->data, sizeof(skb->data)));
-	DPTRACE(cdf_dp_trace(skb, CDF_DP_TRACE_HDD_PACKET_RECORD,
-				(uint8_t *)skb->data, cdf_nbuf_len(skb)));
-	if (cdf_nbuf_len(skb) > CDF_DP_TRACE_RECORD_SIZE)
-		DPTRACE(cdf_dp_trace(skb, CDF_DP_TRACE_HDD_PACKET_RECORD,
-				(uint8_t *)&skb->data[CDF_DP_TRACE_RECORD_SIZE],
-				(cdf_nbuf_len(skb)-CDF_DP_TRACE_RECORD_SIZE)));
-
-	if (ol_tx_send_data_frame(STAId, skb,
-							  proto_type) != NULL) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_WARN,
-			  "%s: Failed to send packet to txrx for staid:%d",
-			  __func__, STAId);
-		++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac];
-		goto drop_pkt;
-	}
-	dev->trans_start = jiffies;
-
-	return NETDEV_TX_OK;
-
-drop_pkt:
-
-	DPTRACE(cdf_dp_trace(skb, CDF_DP_TRACE_DROP_PACKET_RECORD,
-				(uint8_t *)skb->data, cdf_nbuf_len(skb)));
-	if (cdf_nbuf_len(skb) > CDF_DP_TRACE_RECORD_SIZE)
-		DPTRACE(cdf_dp_trace(skb, CDF_DP_TRACE_DROP_PACKET_RECORD,
-				(uint8_t *)&skb->data[CDF_DP_TRACE_RECORD_SIZE],
-				(cdf_nbuf_len(skb)-CDF_DP_TRACE_RECORD_SIZE)));
-	kfree_skb(skb);
-
-drop_pkt_accounting:
-	++pAdapter->stats.tx_dropped;
-	++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
-
-	return NETDEV_TX_OK;
-}
-
-/**
- * __hdd_softap_tx_timeout() - TX timeout handler
- * @dev: pointer to network device
- *
- * This function is registered as a netdev ndo_tx_timeout method, and
- * is invoked by the kernel if the driver takes too long to transmit a
- * frame.
- *
- * Return: None
- */
-static void __hdd_softap_tx_timeout(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *hdd_ctx;
-
-	DPTRACE(cdf_dp_trace(NULL, CDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT,
-				NULL, 0));
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-		  "%s: Transmission timeout occurred", __func__);
-	/* Getting here implies we disabled the TX queues for too
-	 * long. Queues are disabled either because of disassociation
-	 * or low resource scenarios. In case of disassociation it is
-	 * ok to ignore this. But if associated, we have do possible
-	 * recovery here
-	 */
-	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (cds_is_driver_recovering()) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			 "%s: Recovery in Progress. Ignore!!!", __func__);
-		return;
-	}
-}
-
-/**
- * hdd_softap_tx_timeout() - SSR wrapper for __hdd_softap_tx_timeout
- * @dev: pointer to net_device
- *
- * Return: none
- */
-void hdd_softap_tx_timeout(struct net_device *dev)
-{
-	cds_ssr_protect(__func__);
-	__hdd_softap_tx_timeout(dev);
-	cds_ssr_unprotect(__func__);
-}
-
-/**
- * @hdd_softap_init_tx_rx() - Initialize Tx/RX module
- * @pAdapter: pointer to adapter context
- *
- * Return: CDF_STATUS_E_FAILURE if any errors encountered,
- *	   CDF_STATUS_SUCCESS otherwise
- */
-CDF_STATUS hdd_softap_init_tx_rx(hdd_adapter_t *pAdapter)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	uint8_t STAId = 0;
-
-	cdf_mem_zero(&pAdapter->stats, sizeof(struct net_device_stats));
-
-	spin_lock_init(&pAdapter->staInfo_lock);
-
-	for (STAId = 0; STAId < WLAN_MAX_STA_COUNT; STAId++) {
-		cdf_mem_zero(&pAdapter->aStaInfo[STAId],
-			     sizeof(hdd_station_info_t));
-	}
-
-	return status;
-}
-
-/**
- * @hdd_softap_deinit_tx_rx() - Deinitialize Tx/RX module
- * @pAdapter: pointer to adapter context
- *
- * Return: CDF_STATUS_E_FAILURE if any errors encountered,
- *	   CDF_STATUS_SUCCESS otherwise
- */
-CDF_STATUS hdd_softap_deinit_tx_rx(hdd_adapter_t *pAdapter)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-
-	return status;
-}
-
-/**
- * hdd_softap_init_tx_rx_sta() - Initialize tx/rx for a softap station
- * @pAdapter: pointer to adapter context
- * @STAId: Station ID to initialize
- * @pmacAddrSTA: pointer to the MAC address of the station
- *
- * Return: CDF_STATUS_E_FAILURE if any errors encountered,
- *	   CDF_STATUS_SUCCESS otherwise
- */
-CDF_STATUS hdd_softap_init_tx_rx_sta(hdd_adapter_t *pAdapter, uint8_t STAId,
-				     struct cdf_mac_addr *pmacAddrSTA)
-{
-	spin_lock_bh(&pAdapter->staInfo_lock);
-	if (pAdapter->aStaInfo[STAId].isUsed) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Reinit station %d", __func__, STAId);
-		spin_unlock_bh(&pAdapter->staInfo_lock);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_mem_zero(&pAdapter->aStaInfo[STAId], sizeof(hdd_station_info_t));
-
-	pAdapter->aStaInfo[STAId].isUsed = true;
-	pAdapter->aStaInfo[STAId].isDeauthInProgress = false;
-	cdf_copy_macaddr(&pAdapter->aStaInfo[STAId].macAddrSTA, pmacAddrSTA);
-
-	spin_unlock_bh(&pAdapter->staInfo_lock);
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_softap_deinit_tx_rx_sta() - Deinitialize tx/rx for a softap station
- * @pAdapter: pointer to adapter context
- * @STAId: Station ID to deinitialize
- *
- * Return: CDF_STATUS_E_FAILURE if any errors encountered,
- *	   CDF_STATUS_SUCCESS otherwise
- */
-CDF_STATUS hdd_softap_deinit_tx_rx_sta(hdd_adapter_t *pAdapter, uint8_t STAId)
-{
-	CDF_STATUS status = CDF_STATUS_SUCCESS;
-	hdd_hostapd_state_t *pHostapdState;
-
-	pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
-
-	spin_lock_bh(&pAdapter->staInfo_lock);
-
-	if (false == pAdapter->aStaInfo[STAId].isUsed) {
-		spin_unlock_bh(&pAdapter->staInfo_lock);
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Deinit station not inited %d", __func__, STAId);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	pAdapter->aStaInfo[STAId].isUsed = false;
-	pAdapter->aStaInfo[STAId].isDeauthInProgress = false;
-
-	spin_unlock_bh(&pAdapter->staInfo_lock);
-	return status;
-}
-
-/**
- * hdd_softap_rx_packet_cbk() - Receive packet handler
- * @cds_context: pointer to CDS context
- * @rxBuf: pointer to rx cdf_nbuf
- * @staId: Station Id
- *
- * Receive callback registered with TL.  TL will call this to notify
- * the HDD when one or more packets were received for a registered
- * STA.
- *
- * Return: CDF_STATUS_E_FAILURE if any errors encountered,
- *	   CDF_STATUS_SUCCESS otherwise
- */
-CDF_STATUS hdd_softap_rx_packet_cbk(void *cds_context,
-				    cdf_nbuf_t rxBuf, uint8_t staId)
-{
-	hdd_adapter_t *pAdapter = NULL;
-	int rxstat;
-	unsigned int cpu_index;
-	struct sk_buff *skb = NULL;
-	hdd_context_t *pHddCtx = NULL;
-#ifdef QCA_PKT_PROTO_TRACE
-	uint8_t proto_type;
-#endif /* QCA_PKT_PROTO_TRACE */
-
-	/* Sanity check on inputs */
-	if ((NULL == cds_context) || (NULL == rxBuf)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Null params being passed", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	pHddCtx = cds_get_context(CDF_MODULE_ID_HDD);
-	if (NULL == pHddCtx) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: HDD context is Null", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	pAdapter = pHddCtx->sta_to_adapter[staId];
-	if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
-		hddLog(LOGE,
-			FL("invalid adapter %p or adapter has invalid magic"),
-			pAdapter);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	/* walk the chain until all are processed */
-	skb = (struct sk_buff *)rxBuf;
-
-	hdd_softap_dump_sk_buff(skb);
-
-	skb->dev = pAdapter->dev;
-
-	if (skb->dev == NULL) {
-
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: ERROR!!Invalid netdevice", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-	cpu_index = wlan_hdd_get_cpu();
-	++pAdapter->hdd_stats.hddTxRxStats.rxPackets[cpu_index];
-	++pAdapter->stats.rx_packets;
-	pAdapter->stats.rx_bytes += skb->len;
-
-	wlan_hdd_log_eapol(skb, WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED);
-
-#ifdef QCA_PKT_PROTO_TRACE
-	if ((pHddCtx->config->gEnableDebugLog & CDS_PKT_TRAC_TYPE_EAPOL) ||
-	    (pHddCtx->config->gEnableDebugLog & CDS_PKT_TRAC_TYPE_DHCP)) {
-		proto_type = cds_pkt_get_proto_type(skb,
-						    pHddCtx->config->
-						    gEnableDebugLog, 0);
-		if (CDS_PKT_TRAC_TYPE_EAPOL & proto_type) {
-			cds_pkt_trace_buf_update("HA:R:EPL");
-		} else if (CDS_PKT_TRAC_TYPE_DHCP & proto_type) {
-			cds_pkt_trace_buf_update("HA:R:DHC");
-		}
-	}
-#endif /* QCA_PKT_PROTO_TRACE */
-
-	skb->protocol = eth_type_trans(skb, skb->dev);
-#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
-	cdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock,
-				      HDD_WAKE_LOCK_DURATION,
-				      WIFI_POWER_EVENT_WAKELOCK_HOLD_RX);
-#endif
-
-	/* Remove SKB from internal tracking table before submitting
-	 * it to stack
-	 */
-	cdf_net_buf_debug_release_skb(rxBuf);
-
-	if (hdd_napi_enabled(HDD_NAPI_ANY) && !pHddCtx->config->enableRxThread)
-		rxstat = netif_receive_skb(skb);
-	else
-		rxstat = netif_rx_ni(skb);
-	if (NET_RX_SUCCESS == rxstat) {
-		++pAdapter->hdd_stats.hddTxRxStats.rxDelivered[cpu_index];
-	} else {
-		++pAdapter->hdd_stats.hddTxRxStats.rxRefused[cpu_index];
-	}
-
-	pAdapter->dev->last_rx = jiffies;
-
-	return CDF_STATUS_SUCCESS;
-}
-
-/**
- * hdd_softap_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId)
- * @pAdapter: pointer to adapter context
- * @staId: Station ID to deregister
- *
- * Return: CDF_STATUS_SUCCESS on success, CDF_STATUS_E_* on error
- */
-CDF_STATUS hdd_softap_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-	hdd_context_t *pHddCtx;
-
-	if (NULL == pAdapter) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: pAdapter is NULL", __func__);
-		return CDF_STATUS_E_INVAL;
-	}
-
-	if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Invalid pAdapter magic", __func__);
-		return CDF_STATUS_E_INVAL;
-	}
-
-	pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx);
-	/* Clear station in TL and then update HDD data
-	 * structures. This helps to block RX frames from other
-	 * station to this station.
-	 */
-	cdf_status = ol_txrx_clear_peer(staId);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "ol_txrx_clear_peer() failed to for staID %d.  "
-			  "Status= %d [0x%08X]", staId, cdf_status, cdf_status);
-	}
-
-	if (pAdapter->aStaInfo[staId].isUsed) {
-		spin_lock_bh(&pAdapter->staInfo_lock);
-		cdf_mem_zero(&pAdapter->aStaInfo[staId],
-			     sizeof(hdd_station_info_t));
-		spin_unlock_bh(&pAdapter->staInfo_lock);
-	}
-	pHddCtx->sta_to_adapter[staId] = NULL;
-
-	return cdf_status;
-}
-
-/**
- * hdd_softap_register_sta() - Register a SoftAP STA
- * @pAdapter: pointer to adapter context
- * @fAuthRequired: is additional authentication required?
- * @fPrivacyBit: should 802.11 privacy bit be set?
- * @staId: station ID assigned to this station
- * @ucastSig: unicast security signature
- * @bcastSig: broadcast security signature
- * @pPeerMacAddress: station MAC address
- * @fWmmEnabled: is WMM enabled for this STA?
- *
- * Return: CDF_STATUS_SUCCESS on success, CDF_STATUS_E_* on error
- */
-CDF_STATUS hdd_softap_register_sta(hdd_adapter_t *pAdapter,
-				   bool fAuthRequired,
-				   bool fPrivacyBit,
-				   uint8_t staId,
-				   uint8_t ucastSig,
-				   uint8_t bcastSig,
-				   struct cdf_mac_addr *pPeerMacAddress,
-				   bool fWmmEnabled)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	struct ol_txrx_desc_type staDesc = { 0 };
-	hdd_context_t *pHddCtx = pAdapter->pHddCtx;
-
-	/*
-	 * Clean up old entry if it is not cleaned up properly
-	 */
-	if (pAdapter->aStaInfo[staId].isUsed) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO,
-			  "clean up old entry for STA %d", staId);
-		hdd_softap_deregister_sta(pAdapter, staId);
-	}
-	/* Get the Station ID from the one saved during the assocation. */
-
-	staDesc.sta_id = staId;
-
-	/*Save the pAdapter Pointer for this staId */
-	pHddCtx->sta_to_adapter[staId] = pAdapter;
-
-	cdf_status =
-		hdd_softap_init_tx_rx_sta(pAdapter, staId,
-					  pPeerMacAddress);
-
-	staDesc.is_qos_enabled = fWmmEnabled;
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO,
-		  "HDD SOFTAP register TL QoS_enabled=%d",
-		  staDesc.is_qos_enabled);
-
-
-	cdf_status =
-		ol_txrx_register_peer(hdd_softap_rx_packet_cbk,
-					   &staDesc);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "SOFTAP ol_txrx_register_peer() failed to register.  Status= %d [0x%08X]",
-			  cdf_status, cdf_status);
-		return cdf_status;
-	}
-
-	/* if ( WPA ), tell TL to go to 'connected' and after keys come to the
-	 * driver then go to 'authenticated'.  For all other authentication
-	 * types (those that do not require upper layer authentication) we can
-	 * put TL directly into 'authenticated' state
-	 */
-
-	pAdapter->aStaInfo[staId].ucSTAId = staId;
-	pAdapter->aStaInfo[staId].isQosEnabled = fWmmEnabled;
-
-	if (!fAuthRequired) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO,
-			  "open/shared auth StaId= %d.  Changing TL state to AUTHENTICATED at Join time",
-			  pAdapter->aStaInfo[staId].ucSTAId);
-
-		/* Connections that do not need Upper layer auth,
-		 * transition TL directly to 'Authenticated' state.
-		 */
-		cdf_status = hdd_change_peer_state(pAdapter, staDesc.sta_id,
-						ol_txrx_peer_state_auth, false);
-
-		pAdapter->aStaInfo[staId].tlSTAState = ol_txrx_peer_state_auth;
-		pAdapter->sessionCtx.ap.uIsAuthenticated = true;
-	} else {
-
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO,
-			  "ULA auth StaId= %d.  Changing TL state to CONNECTED at Join time",
-			  pAdapter->aStaInfo[staId].ucSTAId);
-
-		cdf_status = hdd_change_peer_state(pAdapter, staDesc.sta_id,
-						ol_txrx_peer_state_conn, false);
-		pAdapter->aStaInfo[staId].tlSTAState = ol_txrx_peer_state_conn;
-
-		pAdapter->sessionCtx.ap.uIsAuthenticated = false;
-
-	}
-
-	/* Enable Tx queue */
-	hddLog(LOG1, FL("Enabling queues"));
-	wlan_hdd_netif_queue_control(pAdapter,
-				   WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
-				   WLAN_CONTROL_PATH);
-
-	return cdf_status;
-}
-
-/**
- * hdd_softap_register_bc_sta() - Register the SoftAP broadcast STA
- * @pAdapter: pointer to adapter context
- * @fPrivacyBit: should 802.11 privacy bit be set?
- *
- * Return: CDF_STATUS_SUCCESS on success, CDF_STATUS_E_* on error
- */
-CDF_STATUS hdd_softap_register_bc_sta(hdd_adapter_t *pAdapter,
-				      bool fPrivacyBit)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	struct cdf_mac_addr broadcastMacAddr =
-					CDF_MAC_ADDR_BROADCAST_INITIALIZER;
-	hdd_ap_ctx_t *pHddApCtx;
-
-	pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
-
-	pHddCtx->sta_to_adapter[WLAN_RX_BCMC_STA_ID] = pAdapter;
-#ifdef WLAN_FEATURE_MBSSID
-	pHddCtx->sta_to_adapter[pHddApCtx->uBCStaId] = pAdapter;
-#else
-	pHddCtx->sta_to_adapter[WLAN_RX_SAP_SELF_STA_ID] = pAdapter;
-#endif
-	cdf_status =
-		hdd_softap_register_sta(pAdapter, false, fPrivacyBit,
-					(WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->
-					uBCStaId, 0, 1, &broadcastMacAddr, 0);
-
-	return cdf_status;
-}
-
-/**
- * hdd_softap_deregister_bc_sta() - Deregister the SoftAP broadcast STA
- * @pAdapter: pointer to adapter context
- *
- * Return: CDF_STATUS_SUCCESS on success, CDF_STATUS_E_* on error
- */
-CDF_STATUS hdd_softap_deregister_bc_sta(hdd_adapter_t *pAdapter)
-{
-	return hdd_softap_deregister_sta(pAdapter,
-					 (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->
-					 uBCStaId);
-}
-
-/**
- * hdd_softap_stop_bss() - Stop the BSS
- * @pAdapter: pointer to adapter context
- *
- * Return: CDF_STATUS_SUCCESS on success, CDF_STATUS_E_* on error
- */
-CDF_STATUS hdd_softap_stop_bss(hdd_adapter_t *pAdapter)
-{
-	CDF_STATUS cdf_status = CDF_STATUS_E_FAILURE;
-	uint8_t staId = 0;
-	hdd_context_t *pHddCtx;
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	/* bss deregister is not allowed during wlan driver loading or
-	 * unloading
-	 */
-	if (cds_is_load_or_unload_in_progress()) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Loading_unloading in Progress, state: 0x%x. Ignore!!!",
-			  __func__, cds_get_driver_state());
-		return CDF_STATUS_E_PERM;
-	}
-
-	cdf_status = hdd_softap_deregister_bc_sta(pAdapter);
-
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to deregister BC sta Id %d", __func__,
-			  (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->uBCStaId);
-	}
-
-	for (staId = 0; staId < WLAN_MAX_STA_COUNT; staId++) {
-		/* This excludes BC sta as it is already deregistered */
-		if (pAdapter->aStaInfo[staId].isUsed) {
-			cdf_status = hdd_softap_deregister_sta(pAdapter, staId);
-			if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-				CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA,
-					  CDF_TRACE_LEVEL_ERROR,
-					  "%s: Failed to deregister sta Id %d",
-					  __func__, staId);
-			}
-		}
-	}
-	return cdf_status;
-}
-
-/**
- * hdd_softap_change_sta_state() - Change the state of a SoftAP station
- * @pAdapter: pointer to adapter context
- * @pDestMacAddress: MAC address of the station
- * @state: new state of the station
- *
- * Return: CDF_STATUS_SUCCESS on success, CDF_STATUS_E_* on error
- */
-CDF_STATUS hdd_softap_change_sta_state(hdd_adapter_t *pAdapter,
-				       struct cdf_mac_addr *pDestMacAddress,
-				       enum ol_txrx_peer_state state)
-{
-	uint8_t ucSTAId = WLAN_MAX_STA_COUNT;
-	CDF_STATUS cdf_status = CDF_STATUS_SUCCESS;
-
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO,
-		  "%s: enter", __func__);
-
-	if (CDF_STATUS_SUCCESS !=
-		 hdd_softap_get_sta_id(pAdapter,
-			 pDestMacAddress, &ucSTAId)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Failed to find right station", __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	if (false ==
-	    cdf_is_macaddr_equal(&pAdapter->aStaInfo[ucSTAId].macAddrSTA,
-				 pDestMacAddress)) {
-		CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_ERROR,
-			  "%s: Station MAC address does not matching",
-			  __func__);
-		return CDF_STATUS_E_FAILURE;
-	}
-
-	cdf_status =
-		hdd_change_peer_state(pAdapter, ucSTAId, state, false);
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO,
-		  "%s: change station to state %d succeed", __func__, state);
-
-	if (CDF_STATUS_SUCCESS == cdf_status) {
-		pAdapter->aStaInfo[ucSTAId].tlSTAState =
-			ol_txrx_peer_state_auth;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD_SAP_DATA, CDF_TRACE_LEVEL_INFO,
-		  "%s exit", __func__);
-
-	return cdf_status;
-}
-
-/*
- * hdd_softap_get_sta_id() - Find station ID from MAC address
- * @pAdapter: pointer to adapter context
- * @pDestMacAddress: MAC address of the destination
- * @staId: Station ID associated with the MAC address
- *
- * Return: CDF_STATUS_SUCCESS if a match was found, in which case
- *	   staId is populated, CDF_STATUS_E_FAILURE if a match is
- *	   not found
- */
-CDF_STATUS hdd_softap_get_sta_id(hdd_adapter_t *pAdapter,
-				 struct cdf_mac_addr *pMacAddress,
-				 uint8_t *staId)
-{
-	uint8_t i;
-
-	for (i = 0; i < WLAN_MAX_STA_COUNT; i++) {
-		if (cdf_mem_compare
-			(&pAdapter->aStaInfo[i].macAddrSTA, pMacAddress,
-			CDF_MAC_ADDR_SIZE) && pAdapter->aStaInfo[i].isUsed) {
-			*staId = i;
-			return CDF_STATUS_SUCCESS;
-		}
-	}
-
-	return CDF_STATUS_E_FAILURE;
-}

+ 0 - 2343
core/hdd/src/wlan_hdd_stats.c

@@ -1,2343 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC : wlan_hdd_stats.c
- *
- * WLAN Host Device Driver statistics related implementation
- *
- */
-
-#include "wlan_hdd_stats.h"
-#include "sme_api.h"
-#include "cds_sched.h"
-#include "wlan_hdd_trace.h"
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-
-/**
- * struct hdd_ll_stats_context - hdd link layer stats context
- *
- * @request_id: userspace-assigned link layer stats request id
- * @request_bitmap: userspace-assigned link layer stats request bitmap
- * @response_event: LL stats request wait event
- */
-struct hdd_ll_stats_context {
-	uint32_t request_id;
-	uint32_t request_bitmap;
-	struct completion response_event;
-	spinlock_t context_lock;
-};
-
-static struct hdd_ll_stats_context ll_stats_context;
-
-#endif /* End of WLAN_FEATURE_LINK_LAYER_STATS */
-
-/* 11B, 11G Rate table include Basic rate and Extended rate
- * The IDX field is the rate index
- * The HI field is the rate when RSSI is strong or being ignored
- *  (in this case we report actual rate)
- * The MID field is the rate when RSSI is moderate
- * (in this case we cap 11b rates at 5.5 and 11g rates at 24)
- * The LO field is the rate when RSSI is low
- *  (in this case we don't report rates, actual current rate used)
- */
-static const struct {
-	uint8_t beacon_rate_index;
-	uint16_t supported_rate[4];
-} supported_data_rate[] = {
-/* IDX     HI  HM  LM LO (RSSI-based index */
-	{
-		2, {
-			10, 10, 10, 0
-		}
-	}, {
-		4, {
-			20, 20, 10, 0
-		}
-	}, {
-		11, {
-			55, 20, 10, 0
-		}
-	}, {
-		12, {
-			60, 55, 20, 0
-		}
-	}, {
-		18, {
-			90, 55, 20, 0
-		}
-	}, {
-		22, {
-			110, 55, 20, 0
-		}
-	}, {
-		24, {
-			120, 90, 60, 0
-		}
-	}, {
-		36, {
-			180, 120, 60, 0
-		}
-	}, {
-		44, {
-			220, 180, 60, 0
-		}
-	}, {
-		48, {
-			240, 180, 90, 0
-		}
-	}, {
-		66, {
-			330, 180, 90, 0
-		}
-	}, {
-		72, {
-			360, 240, 90, 0
-		}
-	}, {
-		96, {
-			480, 240, 120, 0
-		}
-	}, {
-		108, {
-			540, 240, 120, 0
-		}
-	}
-};
-/* MCS Based rate table HT MCS parameters with Nss = 1 */
-static struct index_data_rate_type supported_mcs_rate_nss1[] = {
-/* MCS  L20   L40   S20  S40 */
-	{0, {65, 135, 72, 150} },
-	{1, {130, 270, 144, 300} },
-	{2, {195, 405, 217, 450} },
-	{3, {260, 540, 289, 600} },
-	{4, {390, 810, 433, 900} },
-	{5, {520, 1080, 578, 1200} },
-	{6, {585, 1215, 650, 1350} },
-	{7, {650, 1350, 722, 1500} }
-};
-
-/* HT MCS parameters with Nss = 2 */
-static struct index_data_rate_type supported_mcs_rate_nss2[] = {
-/* MCS  L20    L40   S20   S40 */
-	{0, {130, 270, 144, 300} },
-	{1, {260, 540, 289, 600} },
-	{2, {390, 810, 433, 900} },
-	{3, {520, 1080, 578, 1200} },
-	{4, {780, 1620, 867, 1800} },
-	{5, {1040, 2160, 1156, 2400} },
-	{6, {1170, 2430, 1300, 2700} },
-	{7, {1300, 2700, 1444, 3000} }
-};
-
-#ifdef WLAN_FEATURE_11AC
-/* MCS Based VHT rate table MCS parameters with Nss = 1*/
-static struct index_vht_data_rate_type supported_vht_mcs_rate_nss1[] = {
-/* MCS  L80    S80     L40   S40    L20   S40*/
-	{0, {293, 325}, {135, 150}, {65, 72} },
-	{1, {585, 650}, {270, 300}, {130, 144} },
-	{2, {878, 975}, {405, 450}, {195, 217} },
-	{3, {1170, 1300}, {540, 600}, {260, 289} },
-	{4, {1755, 1950}, {810, 900}, {390, 433} },
-	{5, {2340, 2600}, {1080, 1200}, {520, 578} },
-	{6, {2633, 2925}, {1215, 1350}, {585, 650} },
-	{7, {2925, 3250}, {1350, 1500}, {650, 722} },
-	{8, {3510, 3900}, {1620, 1800}, {780, 867} },
-	{9, {3900, 4333}, {1800, 2000}, {780, 867} }
-};
-
-/*MCS parameters with Nss = 2*/
-static struct index_vht_data_rate_type supported_vht_mcs_rate_nss2[] = {
-/* MCS  L80    S80     L40   S40    L20   S40*/
-	{0, {585, 650}, {270, 300}, {130, 144} },
-	{1, {1170, 1300}, {540, 600}, {260, 289} },
-	{2, {1755, 1950}, {810, 900}, {390, 433} },
-	{3, {2340, 2600}, {1080, 1200}, {520, 578} },
-	{4, {3510, 3900}, {1620, 1800}, {780, 867} },
-	{5, {4680, 5200}, {2160, 2400}, {1040, 1156} },
-	{6, {5265, 5850}, {2430, 2700}, {1170, 1300} },
-	{7, {5850, 6500}, {2700, 3000}, {1300, 1444} },
-	{8, {7020, 7800}, {3240, 3600}, {1560, 1733} },
-	{9, {7800, 8667}, {3600, 4000}, {1560, 1733} }
-};
-#endif /* End of WLAN_FEATURE_11AC */
-
-/*array index ponints to MCS and array value points respective rssi*/
-static int rssi_mcs_tbl[][10] = {
-/*MCS 0   1     2   3    4    5    6    7    8    9*/
-	{-82, -79, -77, -74, -70, -66, -65, -64, -59, -57},     /* 20 */
-	{-79, -76, -74, -71, -67, -63, -62, -61, -56, -54},     /* 40 */
-	{-76, -73, -71, -68, -64, -60, -59, -58, -53, -51} /* 80 */
-};
-
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-
-/**
- * put_wifi_rate_stat() - put wifi rate stats
- * @stats: Pointer to stats context
- * @vendor_event: Pointer to vendor event
- *
- * Return: bool
- */
-static bool put_wifi_rate_stat(tpSirWifiRateStat stats,
-			       struct sk_buff *vendor_event)
-{
-	if (nla_put_u8(vendor_event,
-		       QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_PREAMBLE,
-		       stats->rate.preamble) ||
-	    nla_put_u8(vendor_event,
-		       QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_NSS,
-		       stats->rate.nss) ||
-	    nla_put_u8(vendor_event,
-		       QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BW,
-		       stats->rate.bw) ||
-	    nla_put_u8(vendor_event,
-		       QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MCS_INDEX,
-		       stats->rate.rateMcsIdx) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BIT_RATE,
-			stats->rate.bitrate) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_TX_MPDU,
-			   stats->txMpdu) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RX_MPDU,
-			   stats->rxMpdu) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MPDU_LOST,
-			   stats->mpduLost) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES,
-			   stats->retries) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_SHORT,
-			   stats->retriesShort) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_LONG,
-			   stats->retriesLong)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-		return false;
-	}
-
-	return true;
-}
-
-/**
- * put_wifi_peer_info() - put wifi peer info
- * @stats: Pointer to stats context
- * @vendor_event: Pointer to vendor event
- *
- * Return: bool
- */
-static bool put_wifi_peer_info(tpSirWifiPeerInfo stats,
-			       struct sk_buff *vendor_event)
-{
-	u32 i = 0;
-	tpSirWifiRateStat pRateStats;
-
-	if (nla_put_u32
-		    (vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_TYPE,
-		    stats->type) ||
-	    nla_put(vendor_event,
-		       QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_MAC_ADDRESS,
-		       CDF_MAC_ADDR_SIZE, &stats->peerMacAddress.bytes[0]) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_CAPABILITIES,
-			   stats->capabilities) ||
-	    nla_put_u32(vendor_event,
-			   QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_NUM_RATES,
-			   stats->numRate)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-		goto error;
-	}
-
-	if (stats->numRate) {
-		struct nlattr *rateInfo;
-		struct nlattr *rates;
-
-		rateInfo = nla_nest_start(vendor_event,
-					  QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_RATE_INFO);
-		if (rateInfo == NULL)
-			goto error;
-
-		for (i = 0; i < stats->numRate; i++) {
-			pRateStats = (tpSirWifiRateStat) ((uint8_t *)
-							  stats->rateStats +
-							  (i *
-							   sizeof
-							   (tSirWifiRateStat)));
-			rates = nla_nest_start(vendor_event, i);
-			if (rates == NULL)
-				goto error;
-
-			if (false ==
-			    put_wifi_rate_stat(pRateStats, vendor_event)) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-				return false;
-			}
-			nla_nest_end(vendor_event, rates);
-		}
-		nla_nest_end(vendor_event, rateInfo);
-	}
-
-	return true;
-error:
-	return false;
-}
-
-/**
- * put_wifi_wmm_ac_stat() - put wifi wmm ac stats
- * @stats: Pointer to stats context
- * @vendor_event: Pointer to vendor event
- *
- * Return: bool
- */
-static bool put_wifi_wmm_ac_stat(tpSirWifiWmmAcStat stats,
-				 struct sk_buff *vendor_event)
-{
-	if (nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_AC,
-			stats->ac) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MPDU,
-			stats->txMpdu) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MPDU,
-			stats->rxMpdu) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MCAST,
-			stats->txMcast) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MCAST,
-			stats->rxMcast) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_AMPDU,
-			stats->rxAmpdu) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_AMPDU,
-			stats->txAmpdu) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_MPDU_LOST,
-			stats->mpduLost) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES,
-			stats->retries) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES_SHORT,
-			stats->retriesShort) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES_LONG,
-			stats->retriesLong) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MIN,
-			stats->contentionTimeMin) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MAX,
-			stats->contentionTimeMax) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_AVG,
-			stats->contentionTimeAvg) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_NUM_SAMPLES,
-			stats->contentionNumSamples)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-		return false;
-	}
-
-	return true;
-}
-
-/**
- * put_wifi_interface_info() - put wifi interface info
- * @stats: Pointer to stats context
- * @vendor_event: Pointer to vendor event
- *
- * Return: bool
- */
-static bool put_wifi_interface_info(tpSirWifiInterfaceInfo stats,
-				    struct sk_buff *vendor_event)
-{
-	if (nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MODE,
-			stats->mode) ||
-	    nla_put(vendor_event,
-		    QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MAC_ADDR,
-		    CDF_MAC_ADDR_SIZE, stats->macAddr.bytes) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_STATE,
-			stats->state) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_ROAMING,
-			stats->roaming) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_CAPABILITIES,
-			stats->capabilities) ||
-	    nla_put(vendor_event,
-		    QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_SSID,
-		    strlen(stats->ssid), stats->ssid) ||
-	    nla_put(vendor_event,
-		    QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_BSSID,
-		    CDF_MAC_ADDR_SIZE, stats->bssid.bytes) ||
-	    nla_put(vendor_event,
-		    QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_AP_COUNTRY_STR,
-		    WNI_CFG_COUNTRY_CODE_LEN, stats->apCountryStr) ||
-	    nla_put(vendor_event,
-		    QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_COUNTRY_STR,
-		    WNI_CFG_COUNTRY_CODE_LEN, stats->countryStr)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-		return false;
-	}
-
-	return true;
-}
-
-/**
- * put_wifi_iface_stats() - put wifi interface stats
- * @pWifiIfaceStat: Pointer to interface stats context
- * @num_peer: Number of peers
- * @vendor_event: Pointer to vendor event
- *
- * Return: bool
- */
-static bool put_wifi_iface_stats(tpSirWifiIfaceStat pWifiIfaceStat,
-				 u32 num_peers, struct sk_buff *vendor_event)
-{
-	int i = 0;
-	struct nlattr *wmmInfo;
-	struct nlattr *wmmStats;
-	u64 average_tsf_offset;
-
-	if (false == put_wifi_interface_info(&pWifiIfaceStat->info,
-					     vendor_event)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-		return false;
-
-	}
-
-	average_tsf_offset =  pWifiIfaceStat->avg_bcn_spread_offset_high;
-	average_tsf_offset =  (average_tsf_offset << 32) |
-		pWifiIfaceStat->avg_bcn_spread_offset_low ;
-
-	if (nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_IFACE) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS,
-			num_peers) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_BEACON_RX,
-			pWifiIfaceStat->beaconRx) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_RX,
-			pWifiIfaceStat->mgmtRx) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_RX,
-			pWifiIfaceStat->mgmtActionRx) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_TX,
-			pWifiIfaceStat->mgmtActionTx) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_MGMT,
-			pWifiIfaceStat->rssiMgmt) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_DATA,
-			pWifiIfaceStat->rssiData) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_ACK,
-			pWifiIfaceStat->rssiAck) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_DETECTED,
-			pWifiIfaceStat->is_leaky_ap) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED,
-			pWifiIfaceStat->avg_rx_frms_leaked) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME,
-			pWifiIfaceStat->rx_leak_window) ||
-	    nla_put_u64(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET,
-			average_tsf_offset)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-		return false;
-	}
-
-	wmmInfo = nla_nest_start(vendor_event,
-				 QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_INFO);
-	if (wmmInfo == NULL)
-		return false;
-
-	for (i = 0; i < WIFI_AC_MAX; i++) {
-		wmmStats = nla_nest_start(vendor_event, i);
-		if (wmmStats == NULL)
-			return false;
-
-		if (false ==
-		    put_wifi_wmm_ac_stat(&pWifiIfaceStat->AccessclassStats[i],
-					 vendor_event)) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       FL("put_wifi_wmm_ac_stat Fail"));
-			return false;
-		}
-
-		nla_nest_end(vendor_event, wmmStats);
-	}
-	nla_nest_end(vendor_event, wmmInfo);
-	return true;
-}
-
-/**
- * hdd_map_device_to_ll_iface_mode() - map device to link layer interface mode
- * @deviceMode: Device mode
- *
- * Return: interface mode
- */
-static tSirWifiInterfaceMode hdd_map_device_to_ll_iface_mode(int deviceMode)
-{
-	switch (deviceMode) {
-	case WLAN_HDD_INFRA_STATION:
-		return WIFI_INTERFACE_STA;
-	case WLAN_HDD_SOFTAP:
-		return WIFI_INTERFACE_SOFTAP;
-	case WLAN_HDD_P2P_CLIENT:
-		return WIFI_INTERFACE_P2P_CLIENT;
-	case WLAN_HDD_P2P_GO:
-		return WIFI_INTERFACE_P2P_GO;
-	case WLAN_HDD_IBSS:
-		return WIFI_INTERFACE_IBSS;
-	default:
-		/* Return Interface Mode as STA for all the unsupported modes */
-		return WIFI_INTERFACE_STA;
-	}
-}
-
-/**
- * hdd_get_interface_info() - get interface info
- * @pAdapter: Pointer to device adapter
- * @pInfo: Pointer to interface info
- *
- * Return: bool
- */
-static bool hdd_get_interface_info(hdd_adapter_t *pAdapter,
-				   tpSirWifiInterfaceInfo pInfo)
-{
-	uint8_t *staMac = NULL;
-	hdd_station_ctx_t *pHddStaCtx;
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-
-	pInfo->mode = hdd_map_device_to_ll_iface_mode(pAdapter->device_mode);
-
-	cdf_copy_macaddr(&pInfo->macAddr, &pAdapter->macAddressCurrent);
-
-	if (((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
-	     (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
-	     (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode))) {
-		pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-		if (eConnectionState_NotConnected ==
-		    pHddStaCtx->conn_info.connState) {
-			pInfo->state = WIFI_DISCONNECTED;
-		}
-		if (eConnectionState_Connecting ==
-		    pHddStaCtx->conn_info.connState) {
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: Session ID %d, Connection is in progress",
-			       __func__, pAdapter->sessionId);
-			pInfo->state = WIFI_ASSOCIATING;
-		}
-		if ((eConnectionState_Associated ==
-		     pHddStaCtx->conn_info.connState)
-		    && (false == pHddStaCtx->conn_info.uIsAuthenticated)) {
-			staMac =
-				(uint8_t *) &(pAdapter->macAddressCurrent.
-					      bytes[0]);
-			hddLog(CDF_TRACE_LEVEL_ERROR,
-			       "%s: client " MAC_ADDRESS_STR
-			       " is in the middle of WPS/EAPOL exchange.",
-			       __func__, MAC_ADDR_ARRAY(staMac));
-			pInfo->state = WIFI_AUTHENTICATING;
-		}
-		if (eConnectionState_Associated ==
-		    pHddStaCtx->conn_info.connState) {
-			pInfo->state = WIFI_ASSOCIATED;
-			cdf_copy_macaddr(&pInfo->bssid,
-					 &pHddStaCtx->conn_info.bssId);
-			cdf_mem_copy(pInfo->ssid,
-				     pHddStaCtx->conn_info.SSID.SSID.ssId,
-				     pHddStaCtx->conn_info.SSID.SSID.length);
-			/*
-			 * NULL Terminate the string
-			 */
-			pInfo->ssid[pHddStaCtx->conn_info.SSID.SSID.length] = 0;
-		}
-	}
-
-	cdf_mem_copy(pInfo->countryStr,
-		     pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN);
-
-	cdf_mem_copy(pInfo->apCountryStr,
-		     pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN);
-
-	return true;
-}
-
-/**
- * hdd_link_layer_process_peer_stats() - This function is called after
- * @pAdapter: Pointer to device adapter
- * @more_data: More data
- * @pData: Pointer to stats data
- *
- * Receiving Link Layer Peer statistics from FW.This function converts
- * the firmware data to the NL data and sends the same to the kernel/upper
- * layers.
- *
- * Return: None
- */
-static void hdd_link_layer_process_peer_stats(hdd_adapter_t *pAdapter,
-					      u32 more_data,
-					      tpSirWifiPeerStat pData)
-{
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	tpSirWifiPeerStat pWifiPeerStat;
-	tpSirWifiPeerInfo pWifiPeerInfo;
-	struct sk_buff *vendor_event;
-	int status, i;
-	struct nlattr *peers;
-	int numRate;
-
-	ENTER();
-
-	pWifiPeerStat = pData;
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return;
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "LL_STATS_PEER_ALL : numPeers %u, more data = %u",
-	       pWifiPeerStat->numPeers, more_data);
-
-	/*
-	 * Allocate a size of 4096 for the peer stats comprising
-	 * each of size = sizeof (tSirWifiPeerInfo) + numRate *
-	 * sizeof (tSirWifiRateStat).Each field is put with an
-	 * NL attribute.The size of 4096 is considered assuming
-	 * that number of rates shall not exceed beyond 50 with
-	 * the sizeof (tSirWifiRateStat) being 32.
-	 */
-	vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy,
-				LL_STATS_EVENT_BUF_SIZE);
-
-	if (!vendor_event) {
-		hddLog(LOGE,
-		       FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return;
-	}
-
-	if (nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_PEER) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA,
-			more_data) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS,
-			pWifiPeerStat->numPeers)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       "%s: QCA_WLAN_VENDOR_ATTR put fail", __func__);
-
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	pWifiPeerInfo = (tpSirWifiPeerInfo) ((uint8_t *)
-					     pWifiPeerStat->peerInfo);
-
-	if (pWifiPeerStat->numPeers) {
-		struct nlattr *peerInfo;
-		peerInfo = nla_nest_start(vendor_event,
-					  QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO);
-		if (peerInfo == NULL) {
-			hddLog(LOGE, FL("nla_nest_start failed"));
-			kfree_skb(vendor_event);
-			return;
-		}
-
-		for (i = 1; i <= pWifiPeerStat->numPeers; i++) {
-			peers = nla_nest_start(vendor_event, i);
-			if (peers == NULL) {
-				hddLog(LOGE, FL("nla_nest_start failed"));
-				kfree_skb(vendor_event);
-				return;
-			}
-
-			numRate = pWifiPeerInfo->numRate;
-
-			if (false ==
-			    put_wifi_peer_info(pWifiPeerInfo, vendor_event)) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("put_wifi_peer_info fail"));
-				kfree_skb(vendor_event);
-				return;
-			}
-
-			pWifiPeerInfo = (tpSirWifiPeerInfo) ((uint8_t *)
-							     pWifiPeerStat->
-							     peerInfo +
-							     (i *
-							      sizeof
-							      (tSirWifiPeerInfo))
-							     +
-							     (numRate *
-							      sizeof
-							      (tSirWifiRateStat)));
-			nla_nest_end(vendor_event, peers);
-		}
-		nla_nest_end(vendor_event, peerInfo);
-	}
-	cfg80211_vendor_cmd_reply(vendor_event);
-	EXIT();
-	return;
-}
-
-/**
- * hdd_link_layer_process_iface_stats() - This function is called after
- * @pAdapter: Pointer to device adapter
- * @pData: Pointer to stats data
- * @num_peers: Number of peers
- *
- * Receiving Link Layer Interface statistics from FW.This function converts
- * the firmware data to the NL data and sends the same to the kernel/upper
- * layers.
- *
- * Return: None
- */
-static void hdd_link_layer_process_iface_stats(hdd_adapter_t *pAdapter,
-					       tpSirWifiIfaceStat pData,
-					       u32 num_peers)
-{
-	tpSirWifiIfaceStat pWifiIfaceStat;
-	struct sk_buff *vendor_event;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	int status;
-
-	ENTER();
-
-	pWifiIfaceStat = pData;
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return;
-
-	/*
-	 * Allocate a size of 4096 for the interface stats comprising
-	 * sizeof (tpSirWifiIfaceStat).The size of 4096 is considered
-	 * assuming that all these fit with in the limit.Please take
-	 * a call on the limit based on the data requirements on
-	 * interface statistics.
-	 */
-	vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy,
-				LL_STATS_EVENT_BUF_SIZE);
-
-	if (!vendor_event) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return;
-	}
-
-	hddLog(CDF_TRACE_LEVEL_INFO, "WMI_LINK_STATS_IFACE Data");
-
-	if (false == hdd_get_interface_info(pAdapter, &pWifiIfaceStat->info)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("hdd_get_interface_info get fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	if (false ==
-	    put_wifi_iface_stats(pWifiIfaceStat, num_peers, vendor_event)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("put_wifi_iface_stats fail"));
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	cfg80211_vendor_cmd_reply(vendor_event);
-	EXIT();
-	return;
-}
-
-/**
- * hdd_link_layer_process_radio_stats() - This function is called after
- * @pAdapter: Pointer to device adapter
- * @more_data: More data
- * @pData: Pointer to stats data
- * @num_radios: Number of radios
- *
- * Receiving Link Layer Radio statistics from FW.This function converts
- * the firmware data to the NL data and sends the same to the kernel/upper
- * layers.
- *
- * Return: None
- */
-static void hdd_link_layer_process_radio_stats(hdd_adapter_t *pAdapter,
-					       u32 more_data,
-					       tpSirWifiRadioStat pData,
-					       u32 num_radio)
-{
-	int status, i;
-	tpSirWifiRadioStat pWifiRadioStat;
-	tpSirWifiChannelStats pWifiChannelStats;
-	struct sk_buff *vendor_event;
-	hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-
-	ENTER();
-
-	pWifiRadioStat = pData;
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return;
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-	       "LL_STATS_RADIO"
-	       " number of radios = %u"
-	       " radio is %d onTime is %u"
-	       " txTime is %u  rxTime is %u"
-	       " onTimeScan is %u  onTimeNbd is %u"
-	       " onTimeGscan is %u onTimeRoamScan is %u"
-	       " onTimePnoScan is %u  onTimeHs20 is %u"
-	       " numChannels is %u",
-	       num_radio,
-	       pWifiRadioStat->radio,
-	       pWifiRadioStat->onTime,
-	       pWifiRadioStat->txTime,
-	       pWifiRadioStat->rxTime,
-	       pWifiRadioStat->onTimeScan,
-	       pWifiRadioStat->onTimeNbd,
-	       pWifiRadioStat->onTimeGscan,
-	       pWifiRadioStat->onTimeRoamScan,
-	       pWifiRadioStat->onTimePnoScan,
-	       pWifiRadioStat->onTimeHs20, pWifiRadioStat->numChannels);
-
-	/*
-	 * Allocate a size of 4096 for the Radio stats comprising
-	 * sizeof (tSirWifiRadioStat) + numChannels * sizeof
-	 * (tSirWifiChannelStats).Each channel data is put with an
-	 * NL attribute.The size of 4096 is considered assuming that
-	 * number of channels shall not exceed beyond  60 with the
-	 * sizeof (tSirWifiChannelStats) being 24 bytes.
-	 */
-
-	vendor_event = cfg80211_vendor_cmd_alloc_reply_skb(pHddCtx->wiphy,
-				LL_STATS_EVENT_BUF_SIZE);
-
-	if (!vendor_event) {
-		hddLog(LOGE,
-		       FL("cfg80211_vendor_cmd_alloc_reply_skb failed"));
-		return;
-	}
-
-	if (nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE_RADIO) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA,
-			more_data) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_NUM_RADIOS,
-			num_radio) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ID,
-			pWifiRadioStat->radio) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME,
-			pWifiRadioStat->onTime) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_TX_TIME,
-			pWifiRadioStat->txTime) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_RX_TIME,
-			pWifiRadioStat->rxTime) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_SCAN,
-			pWifiRadioStat->onTimeScan) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_NBD,
-			pWifiRadioStat->onTimeNbd) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_GSCAN,
-			pWifiRadioStat->onTimeGscan) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_ROAM_SCAN,
-			pWifiRadioStat->onTimeRoamScan) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_PNO_SCAN,
-			pWifiRadioStat->onTimePnoScan) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_HS20,
-			pWifiRadioStat->onTimeHs20) ||
-	    nla_put_u32(vendor_event,
-			QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_NUM_CHANNELS,
-			pWifiRadioStat->numChannels)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("QCA_WLAN_VENDOR_ATTR put fail"));
-
-		kfree_skb(vendor_event);
-		return;
-	}
-
-	if (pWifiRadioStat->numChannels) {
-		struct nlattr *chList;
-		struct nlattr *chInfo;
-
-		chList = nla_nest_start(vendor_event,
-					QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO);
-		if (chList == NULL) {
-			hddLog(LOGE, FL("nla_nest_start failed"));
-			kfree_skb(vendor_event);
-			return;
-		}
-
-		for (i = 0; i < pWifiRadioStat->numChannels; i++) {
-			pWifiChannelStats = (tpSirWifiChannelStats) ((uint8_t *)
-								     pWifiRadioStat->
-								     channels +
-								     (i *
-								      sizeof
-								      (tSirWifiChannelStats)));
-
-			chInfo = nla_nest_start(vendor_event, i);
-			if (chInfo == NULL) {
-				hddLog(LOGE, FL("nla_nest_start failed"));
-				kfree_skb(vendor_event);
-				return;
-			}
-
-			if (nla_put_u32(vendor_event,
-					QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_WIDTH,
-					pWifiChannelStats->channel.width) ||
-			    nla_put_u32(vendor_event,
-					QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ,
-					pWifiChannelStats->channel.centerFreq) ||
-			    nla_put_u32(vendor_event,
-					   QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ0,
-					   pWifiChannelStats->channel.
-					   centerFreq0) ||
-			    nla_put_u32(vendor_event,
-					   QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ1,
-					   pWifiChannelStats->channel.
-					   centerFreq1) ||
-			    nla_put_u32(vendor_event,
-					   QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_ON_TIME,
-					   pWifiChannelStats->onTime) ||
-			    nla_put_u32(vendor_event,
-					   QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_CCA_BUSY_TIME,
-					   pWifiChannelStats->ccaBusyTime)) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("nla_put failed"));
-				kfree_skb(vendor_event);
-				return;
-			}
-			nla_nest_end(vendor_event, chInfo);
-		}
-		nla_nest_end(vendor_event, chList);
-	}
-	cfg80211_vendor_cmd_reply(vendor_event);
-	EXIT();
-	return;
-}
-
-/**
- * wlan_hdd_cfg80211_link_layer_stats_callback() - This function is called
- * @ctx: Pointer to hdd context
- * @indType: Indication type
- * @pRsp: Pointer to response
- *
- * After receiving Link Layer indications from FW.This callback converts the
- * firmware data to the NL data and send the same to the kernel/upper layers.
- *
- * Return: None
- */
-static void wlan_hdd_cfg80211_link_layer_stats_callback(void *ctx,
-							int indType, void *pRsp)
-{
-	hdd_context_t *pHddCtx = (hdd_context_t *) ctx;
-	struct hdd_ll_stats_context *context;
-	hdd_adapter_t *pAdapter = NULL;
-	tpSirLLStatsResults linkLayerStatsResults = (tpSirLLStatsResults) pRsp;
-	int status;
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("HDD context is not valid"));
-		return;
-	}
-
-	pAdapter = hdd_get_adapter_by_vdev(pHddCtx,
-					   linkLayerStatsResults->ifaceId);
-
-	if (NULL == pAdapter) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: vdev_id %d does not exist with host",
-			  __func__, linkLayerStatsResults->ifaceId);
-		return;
-	}
-
-	CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_INFO,
-		  "%s: Link Layer Indication indType: %d", __func__, indType);
-
-	switch (indType) {
-	case SIR_HAL_LL_STATS_RESULTS_RSP:
-	{
-		hddLog(CDF_TRACE_LEVEL_INFO,
-			"LL_STATS RESP paramID = 0x%x, ifaceId = %u, respId= %u , moreResultToFollow = %u, num radio = %u result = %p",
-			linkLayerStatsResults->paramId,
-			linkLayerStatsResults->ifaceId,
-			linkLayerStatsResults->rspId,
-			linkLayerStatsResults->moreResultToFollow,
-			linkLayerStatsResults->num_radio,
-			linkLayerStatsResults->results);
-
-		context = &ll_stats_context;
-		spin_lock(&context->context_lock);
-		/* validate response received from target */
-		if ((context->request_id != linkLayerStatsResults->rspId) ||
-		  !(context->request_bitmap & linkLayerStatsResults->paramId)) {
-			spin_unlock(&context->context_lock);
-			hddLog(LOGE,
-				FL("Error : Request id %d response id %d request bitmap 0x%x response bitmap 0x%x"),
-			context->request_id, linkLayerStatsResults->rspId,
-			context->request_bitmap, linkLayerStatsResults->paramId);
-			return;
-		}
-		spin_unlock(&context->context_lock);
-
-		if (linkLayerStatsResults->
-		    paramId & WMI_LINK_STATS_RADIO) {
-			hdd_link_layer_process_radio_stats(pAdapter,
-				linkLayerStatsResults->moreResultToFollow,
-				(tpSirWifiRadioStat)linkLayerStatsResults->results,
-				linkLayerStatsResults->num_radio);
-
-			spin_lock(&context->context_lock);
-			if (!linkLayerStatsResults->moreResultToFollow)
-				context->request_bitmap &= ~(WMI_LINK_STATS_RADIO);
-			spin_unlock(&context->context_lock);
-
-		} else if (linkLayerStatsResults->
-			   paramId & WMI_LINK_STATS_IFACE) {
-			hdd_link_layer_process_iface_stats(pAdapter,
-				(tpSirWifiIfaceStat)linkLayerStatsResults->results,
-				linkLayerStatsResults->num_peers);
-
-			spin_lock(&context->context_lock);
-			/* Firmware doesn't send peerstats event if no peers are
-			 * connected. HDD should not wait for any peerstats in
-			 * this case and return the status to middleware after
-			 * receiving iface stats
-			 */
-			if (!linkLayerStatsResults->num_peers)
-				context->request_bitmap &=
-					~(WMI_LINK_STATS_ALL_PEER);
-			context->request_bitmap &= ~(WMI_LINK_STATS_IFACE);
-			spin_unlock(&context->context_lock);
-
-		} else if (linkLayerStatsResults->
-			   paramId & WMI_LINK_STATS_ALL_PEER) {
-			hdd_link_layer_process_peer_stats(pAdapter,
-				linkLayerStatsResults->moreResultToFollow,
-				(tpSirWifiPeerStat)linkLayerStatsResults->results);
-
-			spin_lock(&context->context_lock);
-			if (!linkLayerStatsResults->moreResultToFollow)
-				context->request_bitmap &= ~(WMI_LINK_STATS_ALL_PEER);
-			spin_unlock(&context->context_lock);
-
-		} else {
-			hddLog(LOGE,
-			       FL("INVALID LL_STATS_NOTIFY RESPONSE"));
-		}
-
-		spin_lock(&context->context_lock);
-		/* complete response event if all requests are completed */
-		if (0 == context->request_bitmap)
-			complete(&context->response_event);
-		spin_unlock(&context->context_lock);
-
-		break;
-	}
-	default:
-		hddLog(CDF_TRACE_LEVEL_ERROR, "invalid event type %d", indType);
-		break;
-	}
-
-	return;
-}
-
-/**
- * hdd_cfg80211_link_layer_stats_init() - Initialize link layer stats
- * @pHddCtx: Pointer to hdd context
- *
- * Return: None
- */
-void hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx)
-{
-	sme_set_link_layer_stats_ind_cb(pHddCtx->hHal,
-					wlan_hdd_cfg80211_link_layer_stats_callback);
-}
-
-const struct
-nla_policy
-	qca_wlan_vendor_ll_set_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_MPDU_SIZE_THRESHOLD] = {
-						.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING] = {
-						.type = NLA_U32},
-};
-
-/**
- * __wlan_hdd_cfg80211_ll_stats_set() - set link layer stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-static int
-__wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data,
-				   int data_len)
-{
-	int status;
-	struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX + 1];
-	tSirLLStatsSetReq LinkLayerStatsSetReq;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return -EINVAL;
-
-	if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX,
-		      (struct nlattr *)data,
-		      data_len, qca_wlan_vendor_ll_set_policy)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("maximum attribute not present"));
-		return -EINVAL;
-	}
-
-	if (!tb_vendor
-	    [QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_MPDU_SIZE_THRESHOLD]) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("MPDU size Not present"));
-		return -EINVAL;
-	}
-
-	if (!tb_vendor
-	    [QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING]) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Stats Gathering Not Present"));
-		return -EINVAL;
-	}
-
-	/* Shall take the request Id if the Upper layers pass. 1 For now. */
-	LinkLayerStatsSetReq.reqId = 1;
-
-	LinkLayerStatsSetReq.mpduSizeThreshold =
-		nla_get_u32(tb_vendor
-			    [QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_MPDU_SIZE_THRESHOLD]);
-
-	LinkLayerStatsSetReq.aggressiveStatisticsGathering =
-		nla_get_u32(tb_vendor
-			    [QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING]);
-
-	LinkLayerStatsSetReq.staId = pAdapter->sessionId;
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-		"LL_STATS_SET reqId = %d, staId = %d, mpduSizeThreshold = %d, Statistics Gathering  = %d",
-		LinkLayerStatsSetReq.reqId, LinkLayerStatsSetReq.staId,
-		LinkLayerStatsSetReq.mpduSizeThreshold,
-		LinkLayerStatsSetReq.aggressiveStatisticsGathering);
-
-	if (CDF_STATUS_SUCCESS != sme_ll_stats_set_req(pHddCtx->hHal,
-						       &LinkLayerStatsSetReq)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s:"
-		       "sme_ll_stats_set_req Failed", __func__);
-		return -EINVAL;
-	}
-
-	pAdapter->isLinkLayerStatsSet = 1;
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_ll_stats_set() - set ll stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 if success, non-zero for failure
- */
-int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ll_stats_set(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-const struct
-nla_policy
-	qca_wlan_vendor_ll_get_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX + 1] = {
-	/* Unsigned 32bit value provided by the caller issuing the GET stats
-	 * command. When reporting
-	 * the stats results, the driver uses the same value to indicate
-	 * which GET request the results
-	 * correspond to.
-	 */
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_ID] = {.type = NLA_U32},
-
-	/* Unsigned 32bit value . bit mask to identify what statistics are
-	   requested for retrieval */
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK] = {.type = NLA_U32}
-};
-
-/**
- * __wlan_hdd_cfg80211_ll_stats_get() - get link layer stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-static int
-__wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data,
-				   int data_len)
-{
-	unsigned long rc;
-	struct hdd_ll_stats_context *context;
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX + 1];
-	tSirLLStatsGetReq LinkLayerStatsGetReq;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	int status;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return -EINVAL;
-
-	if (!pAdapter->isLinkLayerStatsSet) {
-		hdd_warn("isLinkLayerStatsSet : %d", pAdapter->isLinkLayerStatsSet);
-		return -EINVAL;
-	}
-
-	if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX,
-		      (struct nlattr *)data,
-		      data_len, qca_wlan_vendor_ll_get_policy)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("max attribute not present"));
-		return -EINVAL;
-	}
-
-	if (!tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_ID]) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("Request Id Not present"));
-		return -EINVAL;
-	}
-
-	if (!tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK]) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, FL("Req Mask Not present"));
-		return -EINVAL;
-	}
-
-	LinkLayerStatsGetReq.reqId =
-		nla_get_u32(tb_vendor
-			    [QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_ID]);
-	LinkLayerStatsGetReq.paramIdMask =
-		nla_get_u32(tb_vendor
-			    [QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK]);
-
-	LinkLayerStatsGetReq.staId = pAdapter->sessionId;
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-		"LL_STATS_GET reqId = %d, staId = %d, paramIdMask = %d",
-		LinkLayerStatsGetReq.reqId,
-		LinkLayerStatsGetReq.staId,
-		LinkLayerStatsGetReq.paramIdMask);
-
-	context = &ll_stats_context;
-	spin_lock(&context->context_lock);
-	context->request_id = LinkLayerStatsGetReq.reqId;
-	context->request_bitmap = LinkLayerStatsGetReq.paramIdMask;
-	INIT_COMPLETION(context->response_event);
-	spin_unlock(&context->context_lock);
-
-	if (CDF_STATUS_SUCCESS != sme_ll_stats_get_req(pHddCtx->hHal,
-						       &LinkLayerStatsGetReq)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR, "%s:"
-		       "sme_ll_stats_get_req Failed", __func__);
-		return -EINVAL;
-	}
-
-	rc = wait_for_completion_timeout(&context->response_event,
-			msecs_to_jiffies(WLAN_WAIT_TIME_LL_STATS));
-	if (!rc) {
-		hddLog(LOGE,
-			FL("Target response timed out request id %d request bitmap 0x%x"),
-			context->request_id, context->request_bitmap);
-		return -ETIMEDOUT;
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_ll_stats_get() - get ll stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 if success, non-zero for failure
- */
-int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy,
-				struct wireless_dev *wdev,
-				const void *data,
-				int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ll_stats_get(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-const struct
-nla_policy
-	qca_wlan_vendor_ll_clr_policy[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX + 1] = {
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_REQ_MASK] = {.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_REQ] = {.type = NLA_U8},
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_RSP_MASK] = {.type = NLA_U32},
-	[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_RSP] = {.type = NLA_U8},
-};
-
-/**
- * __wlan_hdd_cfg80211_ll_stats_clear() - clear link layer stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-static int
-__wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy,
-				    struct wireless_dev *wdev,
-				    const void *data,
-				    int data_len)
-{
-	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
-	struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX + 1];
-	tSirLLStatsClearReq LinkLayerStatsClearReq;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	u32 statsClearReqMask;
-	u8 stopReq;
-	int status;
-	struct sk_buff *temp_skbuff;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	status = wlan_hdd_validate_context(pHddCtx);
-	if (0 != status)
-		return -EINVAL;
-
-	if (!pAdapter->isLinkLayerStatsSet) {
-		hddLog(CDF_TRACE_LEVEL_FATAL,
-		       "%s: isLinkLayerStatsSet : %d",
-		       __func__, pAdapter->isLinkLayerStatsSet);
-		return -EINVAL;
-	}
-
-	if (nla_parse(tb_vendor, QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX,
-		      (struct nlattr *)data,
-		      data_len, qca_wlan_vendor_ll_clr_policy)) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("STATS_CLR_MAX is not present"));
-		return -EINVAL;
-	}
-
-	if (!tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_REQ_MASK] ||
-	    !tb_vendor[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_REQ]) {
-		hddLog(CDF_TRACE_LEVEL_ERROR,
-		       FL("Error in LL_STATS CLR CONFIG PARA"));
-		return -EINVAL;
-	}
-
-	statsClearReqMask = LinkLayerStatsClearReq.statsClearReqMask =
-				    nla_get_u32(tb_vendor
-						[QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_REQ_MASK]);
-
-	stopReq = LinkLayerStatsClearReq.stopReq =
-			  nla_get_u8(tb_vendor
-				     [QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_REQ]);
-
-	/*
-	 * Shall take the request Id if the Upper layers pass. 1 For now.
-	 */
-	LinkLayerStatsClearReq.reqId = 1;
-
-	LinkLayerStatsClearReq.staId = pAdapter->sessionId;
-
-	hddLog(CDF_TRACE_LEVEL_INFO,
-		"LL_STATS_CLEAR reqId = %d, staId = %d, statsClearReqMask = 0x%X, stopReq  = %d",
-		LinkLayerStatsClearReq.reqId,
-		LinkLayerStatsClearReq.staId,
-		LinkLayerStatsClearReq.statsClearReqMask,
-		LinkLayerStatsClearReq.stopReq);
-
-	if (CDF_STATUS_SUCCESS == sme_ll_stats_clear_req(pHddCtx->hHal,
-					&LinkLayerStatsClearReq)) {
-		temp_skbuff = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
-								  2 *
-								  sizeof(u32) +
-								  2 *
-								  NLMSG_HDRLEN);
-		if (temp_skbuff != NULL) {
-			if (nla_put_u32(temp_skbuff,
-					QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_RSP_MASK,
-					statsClearReqMask) ||
-			    nla_put_u32(temp_skbuff,
-					QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_RSP,
-					stopReq)) {
-				hddLog(CDF_TRACE_LEVEL_ERROR,
-				       FL("LL_STATS_CLR put fail"));
-				kfree_skb(temp_skbuff);
-				return -EINVAL;
-			}
-
-			/* If the ask is to stop the stats collection as part of clear
-			 * (stopReq = 1) , ensure that no further requests of get
-			 * go to the firmware by having isLinkLayerStatsSet set to 0.
-			 * However it the stopReq as part of the clear request is 0 ,
-			 * the request to get the statistics are honoured as in this
-			 * case the firmware is just asked to clear the statistics.
-			 */
-			if (stopReq == 1)
-				pAdapter->isLinkLayerStatsSet = 0;
-
-			return cfg80211_vendor_cmd_reply(temp_skbuff);
-		}
-		EXIT();
-		return -ENOMEM;
-	}
-
-	return -EINVAL;
-}
-
-/**
- * wlan_hdd_cfg80211_ll_stats_clear() - clear ll stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: 0 if success, non-zero for failure
- */
-int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len)
-{
-	int ret = 0;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_ll_stats_clear(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-#endif /* WLAN_FEATURE_LINK_LAYER_STATS */
-
-#ifdef WLAN_FEATURE_STATS_EXT
-/**
- * __wlan_hdd_cfg80211_stats_ext_request() - ext stats request
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-static int __wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
-						 struct wireless_dev *wdev,
-						 const void *data,
-						 int data_len)
-{
-	tStatsExtRequestReq stats_ext_req;
-	struct net_device *dev = wdev->netdev;
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	int ret_val;
-	CDF_STATUS status;
-	hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
-
-	ENTER();
-
-	ret_val = wlan_hdd_validate_context(hdd_ctx);
-	if (ret_val)
-		return ret_val;
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hdd_err("Command not allowed in FTM mode");
-		return -EPERM;
-	}
-
-	stats_ext_req.request_data_len = data_len;
-	stats_ext_req.request_data = (void *)data;
-
-	status = sme_stats_ext_request(pAdapter->sessionId, &stats_ext_req);
-
-	if (CDF_STATUS_SUCCESS != status)
-		ret_val = -EINVAL;
-
-	return ret_val;
-}
-
-/**
- * wlan_hdd_cfg80211_stats_ext_request() - ext stats request
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-int wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_stats_ext_request(wiphy, wdev,
-						    data, data_len);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * wlan_hdd_cfg80211_stats_ext_callback() - ext stats callback
- * @ctx: Pointer to HDD context
- * @msg: Message received
- *
- * Return: nothing
- */
-static void wlan_hdd_cfg80211_stats_ext_callback(void *ctx,
-						 tStatsExtEvent *msg)
-{
-
-	hdd_context_t *pHddCtx = (hdd_context_t *) ctx;
-	struct sk_buff *vendor_event;
-	int status;
-	int ret_val;
-	tStatsExtEvent *data = msg;
-	hdd_adapter_t *pAdapter = NULL;
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: HDD context is not valid", __func__);
-		return;
-	}
-
-	pAdapter = hdd_get_adapter_by_vdev(pHddCtx, data->vdev_id);
-
-	if (NULL == pAdapter) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: vdev_id %d does not exist with host",
-			  __func__, data->vdev_id);
-		return;
-	}
-
-	vendor_event = cfg80211_vendor_event_alloc(pHddCtx->wiphy,
-						   NULL,
-						   data->event_data_len +
-						   sizeof(uint32_t) +
-						   NLMSG_HDRLEN + NLMSG_HDRLEN,
-						   QCA_NL80211_VENDOR_SUBCMD_STATS_EXT_INDEX,
-						   GFP_KERNEL);
-
-	if (!vendor_event) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: cfg80211_vendor_event_alloc failed", __func__);
-		return;
-	}
-
-	ret_val = nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_IFINDEX,
-			      pAdapter->dev->ifindex);
-	if (ret_val) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: QCA_WLAN_VENDOR_ATTR_IFINDEX put fail",
-			  __func__);
-		kfree_skb(vendor_event);
-
-		return;
-	}
-
-	ret_val = nla_put(vendor_event, QCA_WLAN_VENDOR_ATTR_STATS_EXT,
-			  data->event_data_len, data->event_data);
-
-	if (ret_val) {
-		CDF_TRACE(CDF_MODULE_ID_HDD, CDF_TRACE_LEVEL_ERROR,
-			  "%s: QCA_WLAN_VENDOR_ATTR_STATS_EXT put fail",
-			  __func__);
-		kfree_skb(vendor_event);
-
-		return;
-	}
-
-	cfg80211_vendor_event(vendor_event, GFP_KERNEL);
-
-}
-
-/**
- * wlan_hdd_cfg80211_stats_ext_init() - ext stats init
- * @ctx: Pointer to HDD context
- *
- * Return: nothing
- */
-void wlan_hdd_cfg80211_stats_ext_init(hdd_context_t *pHddCtx)
-{
-	sme_stats_ext_register_callback(pHddCtx->hHal,
-					wlan_hdd_cfg80211_stats_ext_callback);
-}
-#endif /* End of WLAN_FEATURE_STATS_EXT */
-
-/**
- * __wlan_hdd_cfg80211_get_station() - get station statistics
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @mac: Pointer to mac
- * @sinfo: Pointer to station info
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
-					   struct net_device *dev,
-					   const uint8_t *mac,
-					   struct station_info *sinfo)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-	int ssidlen = pHddStaCtx->conn_info.SSID.SSID.length;
-	uint8_t rate_flags;
-
-	hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
-	struct hdd_config *pCfg = pHddCtx->config;
-
-	uint8_t OperationalRates[CSR_DOT11_SUPPORTED_RATES_MAX];
-	uint32_t ORLeng = CSR_DOT11_SUPPORTED_RATES_MAX;
-	uint8_t ExtendedRates[CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX];
-	uint32_t ERLeng = CSR_DOT11_EXTENDED_SUPPORTED_RATES_MAX;
-	uint8_t MCSRates[SIZE_OF_BASIC_MCS_SET];
-	uint32_t MCSLeng = SIZE_OF_BASIC_MCS_SET;
-	uint16_t maxRate = 0;
-	uint16_t myRate;
-	uint16_t currentRate = 0;
-	uint8_t maxSpeedMCS = 0;
-	uint8_t maxMCSIdx = 0;
-	uint8_t rateFlag = 1;
-	uint8_t i, j, rssidx;
-	uint8_t nss = 1;
-	int status, mode = 0, maxHtIdx;
-	struct index_vht_data_rate_type *supported_vht_mcs_rate;
-	struct index_data_rate_type *supported_mcs_rate;
-
-#ifdef WLAN_FEATURE_11AC
-	uint32_t vht_mcs_map;
-	enum eDataRate11ACMaxMcs vhtMaxMcs;
-#endif /* WLAN_FEATURE_11AC */
-
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	if ((eConnectionState_Associated != pHddStaCtx->conn_info.connState) ||
-	    (0 == ssidlen)) {
-		hddLog(LOG1, FL("Not associated or Invalid ssidlen, %d"),
-			ssidlen);
-		/*To keep GUI happy */
-		return 0;
-	}
-
-	if (true == pHddStaCtx->hdd_ReassocScenario) {
-		hddLog(LOG1,
-			FL("Roaming is in progress, cannot continue with this request"));
-		return 0;
-	}
-
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	wlan_hdd_get_rssi(pAdapter, &sinfo->signal);
-	sinfo->filled |= STATION_INFO_SIGNAL;
-
-#ifdef WLAN_FEATURE_LPSS
-	if (!pAdapter->rssi_send) {
-		pAdapter->rssi_send = true;
-		if (cds_is_driver_unloading())
-			wlan_hdd_send_status_pkg(pAdapter, pHddStaCtx, 1, 1);
-	}
-#endif
-
-	wlan_hdd_get_station_stats(pAdapter);
-	rate_flags = pAdapter->hdd_stats.ClassA_stat.tx_rate_flags;
-
-	/* convert to the UI units of 100kbps */
-	myRate = pAdapter->hdd_stats.ClassA_stat.tx_rate * 5;
-	if (!(rate_flags & eHAL_TX_RATE_LEGACY)) {
-		nss = pAdapter->hdd_stats.ClassA_stat.rx_frag_cnt;
-
-		if (eHDD_LINK_SPEED_REPORT_ACTUAL == pCfg->reportMaxLinkSpeed) {
-			/* Get current rate flags if report actual */
-			rate_flags =
-				pAdapter->hdd_stats.ClassA_stat.
-				promiscuous_rx_frag_cnt;
-		}
-
-		if (pAdapter->hdd_stats.ClassA_stat.mcs_index ==
-		    INVALID_MCS_IDX) {
-			rate_flags = eHAL_TX_RATE_LEGACY;
-			pAdapter->hdd_stats.ClassA_stat.mcs_index = 0;
-		}
-	}
-
-	hdd_info("RSSI %d, RLMS %u, rate %d, rssi high %d, rssi mid %d, rssi low %d, rate_flags 0x%x, MCS %d",
-		 sinfo->signal, pCfg->reportMaxLinkSpeed, myRate,
-		 (int)pCfg->linkSpeedRssiHigh, (int)pCfg->linkSpeedRssiMid,
-		 (int)pCfg->linkSpeedRssiLow, (int)rate_flags,
-		 (int)pAdapter->hdd_stats.ClassA_stat.mcs_index);
-
-	if (eHDD_LINK_SPEED_REPORT_ACTUAL != pCfg->reportMaxLinkSpeed) {
-		/* we do not want to necessarily report the current speed */
-		if (eHDD_LINK_SPEED_REPORT_MAX == pCfg->reportMaxLinkSpeed) {
-			/* report the max possible speed */
-			rssidx = 0;
-		} else if (eHDD_LINK_SPEED_REPORT_MAX_SCALED ==
-			   pCfg->reportMaxLinkSpeed) {
-			/* report the max possible speed with RSSI scaling */
-			if (sinfo->signal >= pCfg->linkSpeedRssiHigh) {
-				/* report the max possible speed */
-				rssidx = 0;
-			} else if (sinfo->signal >= pCfg->linkSpeedRssiMid) {
-				/* report middle speed */
-				rssidx = 1;
-			} else if (sinfo->signal >= pCfg->linkSpeedRssiLow) {
-				/* report middle speed */
-				rssidx = 2;
-			} else {
-				/* report actual speed */
-				rssidx = 3;
-			}
-		} else {
-			/* unknown, treat as eHDD_LINK_SPEED_REPORT_MAX */
-			hddLog(LOGE,
-			       FL("Invalid value for reportMaxLinkSpeed: %u"),
-			       pCfg->reportMaxLinkSpeed);
-			rssidx = 0;
-		}
-
-		maxRate = 0;
-
-		/* Get Basic Rate Set */
-		if (0 !=
-		    sme_cfg_get_str(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				    WNI_CFG_OPERATIONAL_RATE_SET,
-				    OperationalRates,
-				    &ORLeng)) {
-			hddLog(LOGE, FL("cfg get returned failure"));
-			/*To keep GUI happy */
-			return 0;
-		}
-
-		for (i = 0; i < ORLeng; i++) {
-			for (j = 0;
-			     j < ARRAY_SIZE(supported_data_rate); j++) {
-				/* Validate Rate Set */
-				if (supported_data_rate[j].beacon_rate_index ==
-				    (OperationalRates[i] & 0x7F)) {
-					currentRate =
-						supported_data_rate[j].
-						supported_rate[rssidx];
-					break;
-				}
-			}
-			/* Update MAX rate */
-			maxRate =
-				(currentRate > maxRate) ? currentRate : maxRate;
-		}
-
-		/* Get Extended Rate Set */
-		if (0 !=
-		    sme_cfg_get_str(WLAN_HDD_GET_HAL_CTX(pAdapter),
-				    WNI_CFG_EXTENDED_OPERATIONAL_RATE_SET,
-				    ExtendedRates, &ERLeng)) {
-			hddLog(LOGE, FL("cfg get returned failure"));
-			/*To keep GUI happy */
-			return 0;
-		}
-
-		for (i = 0; i < ERLeng; i++) {
-			for (j = 0;
-			     j < ARRAY_SIZE(supported_data_rate); j++) {
-				if (supported_data_rate[j].beacon_rate_index ==
-				    (ExtendedRates[i] & 0x7F)) {
-					currentRate =
-						supported_data_rate[j].
-						supported_rate[rssidx];
-					break;
-				}
-			}
-			/* Update MAX rate */
-			maxRate =
-				(currentRate > maxRate) ? currentRate : maxRate;
-		}
-		/* Get MCS Rate Set --
-		   Only if we are connected in non legacy mode and not reporting
-		   actual speed */
-		if ((3 != rssidx) && !(rate_flags & eHAL_TX_RATE_LEGACY)) {
-			if (0 !=
-			    sme_cfg_get_str(WLAN_HDD_GET_HAL_CTX(pAdapter),
-					    WNI_CFG_CURRENT_MCS_SET, MCSRates,
-					    &MCSLeng)) {
-				hddLog(LOGE, FL("cfg get returned failure"));
-				/*To keep GUI happy */
-				return 0;
-			}
-			rateFlag = 0;
-#ifdef WLAN_FEATURE_11AC
-			supported_vht_mcs_rate =
-				(struct index_vht_data_rate_type *)
-				((nss ==
-				  1) ? &supported_vht_mcs_rate_nss1 :
-				 &supported_vht_mcs_rate_nss2);
-
-			if (rate_flags & eHAL_TX_RATE_VHT80)
-				mode = 2;
-			else if ((rate_flags & eHAL_TX_RATE_VHT40) ||
-				 (rate_flags & eHAL_TX_RATE_HT40))
-				mode = 1;
-			else
-				mode = 0;
-
-			/* VHT80 rate has seperate rate table */
-			if (rate_flags &
-			    (eHAL_TX_RATE_VHT20 | eHAL_TX_RATE_VHT40 |
-			     eHAL_TX_RATE_VHT80)) {
-				sme_cfg_get_int(WLAN_HDD_GET_HAL_CTX(pAdapter),
-						WNI_CFG_VHT_TX_MCS_MAP,
-						&vht_mcs_map);
-				vhtMaxMcs = (enum eDataRate11ACMaxMcs)
-					(vht_mcs_map & DATA_RATE_11AC_MCS_MASK);
-				if (rate_flags & eHAL_TX_RATE_SGI)
-					rateFlag |= 1;
-				if (DATA_RATE_11AC_MAX_MCS_7 == vhtMaxMcs)
-					maxMCSIdx = 7;
-				else if (DATA_RATE_11AC_MAX_MCS_8 ==
-					   vhtMaxMcs)
-					maxMCSIdx = 8;
-				else if (DATA_RATE_11AC_MAX_MCS_9 ==
-					   vhtMaxMcs) {
-					/* VHT20 is supporting 0~8 */
-					if (rate_flags & eHAL_TX_RATE_VHT20)
-						maxMCSIdx = 8;
-					else
-						maxMCSIdx = 9;
-				}
-
-				if (rssidx != 0) {
-					for (i = 0; i <= maxMCSIdx; i++) {
-						if (sinfo->signal <=
-						    rssi_mcs_tbl[mode][i]) {
-							maxMCSIdx = i;
-							break;
-						}
-					}
-				}
-
-				if (rate_flags & eHAL_TX_RATE_VHT80) {
-					currentRate =
-					  supported_vht_mcs_rate[pAdapter->
-					  hdd_stats.ClassA_stat.mcs_index].
-					  supported_VHT80_rate[rateFlag];
-					maxRate =
-					  supported_vht_mcs_rate[maxMCSIdx].
-						supported_VHT80_rate[rateFlag];
-				} else if (rate_flags & eHAL_TX_RATE_VHT40) {
-					currentRate =
-					  supported_vht_mcs_rate[pAdapter->
-					  hdd_stats.ClassA_stat.mcs_index].
-					  supported_VHT40_rate[rateFlag];
-					maxRate =
-					  supported_vht_mcs_rate[maxMCSIdx].
-						supported_VHT40_rate[rateFlag];
-				} else if (rate_flags & eHAL_TX_RATE_VHT20) {
-					currentRate =
-					  supported_vht_mcs_rate[pAdapter->
-					  hdd_stats.ClassA_stat.mcs_index].
-					  supported_VHT20_rate[rateFlag];
-					maxRate =
-					  supported_vht_mcs_rate[maxMCSIdx].
-					  supported_VHT20_rate[rateFlag];
-				}
-
-				maxSpeedMCS = 1;
-				if (currentRate > maxRate)
-					maxRate = currentRate;
-
-			} else
-#endif /* WLAN_FEATURE_11AC */
-			{
-				if (rate_flags & eHAL_TX_RATE_HT40)
-					rateFlag |= 1;
-				if (rate_flags & eHAL_TX_RATE_SGI)
-					rateFlag |= 2;
-
-				supported_mcs_rate =
-					(struct index_data_rate_type *)
-					((nss ==
-					  1) ? &supported_mcs_rate_nss1 :
-					 &supported_mcs_rate_nss2);
-
-				maxHtIdx = MAX_HT_MCS_IDX;
-				if (rssidx != 0) {
-					for (i = 0; i < MAX_HT_MCS_IDX; i++) {
-						if (sinfo->signal <=
-						    rssi_mcs_tbl[mode][i]) {
-							maxHtIdx = i + 1;
-							break;
-						}
-					}
-				}
-
-				for (i = 0; i < MCSLeng; i++) {
-					for (j = 0; j < maxHtIdx; j++) {
-						if (supported_mcs_rate[j].
-						    beacon_rate_index ==
-						    MCSRates[i]) {
-							currentRate =
-							  supported_mcs_rate[j].
-							  supported_rate
-							  [rateFlag];
-							maxMCSIdx =
-							  supported_mcs_rate[j].
-							  beacon_rate_index;
-							break;
-						}
-					}
-
-					if ((j < MAX_HT_MCS_IDX)
-					    && (currentRate > maxRate)) {
-						maxRate = currentRate;
-					}
-					maxSpeedMCS = 1;
-				}
-			}
-		}
-
-		else if (!(rate_flags & eHAL_TX_RATE_LEGACY)) {
-			maxRate = myRate;
-			maxSpeedMCS = 1;
-			maxMCSIdx = pAdapter->hdd_stats.ClassA_stat.mcs_index;
-		}
-		/* report a value at least as big as current rate */
-		if ((maxRate < myRate) || (0 == maxRate)) {
-			maxRate = myRate;
-			if (rate_flags & eHAL_TX_RATE_LEGACY) {
-				maxSpeedMCS = 0;
-			} else {
-				maxSpeedMCS = 1;
-				maxMCSIdx =
-				  pAdapter->hdd_stats.ClassA_stat.mcs_index;
-			}
-		}
-
-		if (rate_flags & eHAL_TX_RATE_LEGACY) {
-			sinfo->txrate.legacy = maxRate;
-#ifdef LINKSPEED_DEBUG_ENABLED
-			pr_info("Reporting legacy rate %d\n",
-				sinfo->txrate.legacy);
-#endif /* LINKSPEED_DEBUG_ENABLED */
-		} else {
-			sinfo->txrate.mcs = maxMCSIdx;
-#ifdef WLAN_FEATURE_11AC
-			sinfo->txrate.nss = nss;
-			if (rate_flags & eHAL_TX_RATE_VHT80) {
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
-				sinfo->txrate.flags |=
-					RATE_INFO_FLAGS_80_MHZ_WIDTH;
-			} else if (rate_flags & eHAL_TX_RATE_VHT40) {
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
-				sinfo->txrate.flags |=
-					RATE_INFO_FLAGS_40_MHZ_WIDTH;
-			} else if (rate_flags & eHAL_TX_RATE_VHT20) {
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
-			} else
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
-#endif /* WLAN_FEATURE_11AC */
-			if (rate_flags &
-			    (eHAL_TX_RATE_HT20 | eHAL_TX_RATE_HT40)) {
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
-				if (rate_flags & eHAL_TX_RATE_HT40) {
-					sinfo->txrate.flags |=
-						RATE_INFO_FLAGS_40_MHZ_WIDTH;
-				}
-			}
-			if (rate_flags & eHAL_TX_RATE_SGI) {
-				if (!
-				    (sinfo->txrate.
-				     flags & RATE_INFO_FLAGS_VHT_MCS))
-					sinfo->txrate.flags |=
-						RATE_INFO_FLAGS_MCS;
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
-			}
-#ifdef LINKSPEED_DEBUG_ENABLED
-			pr_info("Reporting MCS rate %d flags %x\n",
-				sinfo->txrate.mcs, sinfo->txrate.flags);
-#endif /* LINKSPEED_DEBUG_ENABLED */
-		}
-	} else {
-		/* report current rate instead of max rate */
-
-		if (rate_flags & eHAL_TX_RATE_LEGACY) {
-			/* provide to the UI in units of 100kbps */
-			sinfo->txrate.legacy = myRate;
-#ifdef LINKSPEED_DEBUG_ENABLED
-			pr_info("Reporting actual legacy rate %d\n",
-				sinfo->txrate.legacy);
-#endif /* LINKSPEED_DEBUG_ENABLED */
-		} else {
-			/* must be MCS */
-			sinfo->txrate.mcs =
-				pAdapter->hdd_stats.ClassA_stat.mcs_index;
-#ifdef WLAN_FEATURE_11AC
-			sinfo->txrate.nss = nss;
-			sinfo->txrate.flags |= RATE_INFO_FLAGS_VHT_MCS;
-			if (rate_flags & eHAL_TX_RATE_VHT80) {
-				sinfo->txrate.flags |=
-					RATE_INFO_FLAGS_80_MHZ_WIDTH;
-			} else if (rate_flags & eHAL_TX_RATE_VHT40) {
-				sinfo->txrate.flags |=
-					RATE_INFO_FLAGS_40_MHZ_WIDTH;
-			}
-#endif /* WLAN_FEATURE_11AC */
-			if (rate_flags &
-			    (eHAL_TX_RATE_HT20 | eHAL_TX_RATE_HT40)) {
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
-				if (rate_flags & eHAL_TX_RATE_HT40) {
-					sinfo->txrate.flags |=
-						RATE_INFO_FLAGS_40_MHZ_WIDTH;
-				}
-			}
-			if (rate_flags & eHAL_TX_RATE_SGI) {
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
-				sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
-			}
-#ifdef LINKSPEED_DEBUG_ENABLED
-			pr_info("Reporting actual MCS rate %d flags %x\n",
-				sinfo->txrate.mcs, sinfo->txrate.flags);
-#endif /* LINKSPEED_DEBUG_ENABLED */
-		}
-	}
-
-	if (rate_flags & eHAL_TX_RATE_LEGACY)
-		hdd_info("Reporting legacy rate %d", sinfo->txrate.legacy);
-	else
-		hdd_info("Reporting MCS rate %d flags 0x%x",
-			 sinfo->txrate.mcs, sinfo->txrate.flags);
-
-	sinfo->filled |= STATION_INFO_TX_BITRATE;
-
-	sinfo->tx_bytes = pAdapter->stats.tx_bytes;
-	sinfo->filled |= STATION_INFO_TX_BYTES;
-
-	sinfo->tx_packets =
-		pAdapter->hdd_stats.summary_stat.tx_frm_cnt[0] +
-		pAdapter->hdd_stats.summary_stat.tx_frm_cnt[1] +
-		pAdapter->hdd_stats.summary_stat.tx_frm_cnt[2] +
-		pAdapter->hdd_stats.summary_stat.tx_frm_cnt[3];
-
-	sinfo->tx_retries =
-		pAdapter->hdd_stats.summary_stat.retry_cnt[0] +
-		pAdapter->hdd_stats.summary_stat.retry_cnt[1] +
-		pAdapter->hdd_stats.summary_stat.retry_cnt[2] +
-		pAdapter->hdd_stats.summary_stat.retry_cnt[3];
-
-	sinfo->tx_failed =
-		pAdapter->hdd_stats.summary_stat.fail_cnt[0] +
-		pAdapter->hdd_stats.summary_stat.fail_cnt[1] +
-		pAdapter->hdd_stats.summary_stat.fail_cnt[2] +
-		pAdapter->hdd_stats.summary_stat.fail_cnt[3];
-
-	sinfo->filled |=
-		STATION_INFO_TX_PACKETS |
-		STATION_INFO_TX_RETRIES | STATION_INFO_TX_FAILED;
-
-	sinfo->rx_bytes = pAdapter->stats.rx_bytes;
-	sinfo->filled |= STATION_INFO_RX_BYTES;
-
-	sinfo->rx_packets = pAdapter->stats.rx_packets;
-	sinfo->filled |= STATION_INFO_RX_PACKETS;
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_GET_STA,
-			 pAdapter->sessionId, maxRate));
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_get_station() - get station statistics
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @mac: Pointer to mac
- * @sinfo: Pointer to station info
- *
- * Return: 0 for success, non-zero for failure
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
-				  struct net_device *dev, const uint8_t *mac,
-				  struct station_info *sinfo)
-#else
-int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
-				  struct net_device *dev, uint8_t *mac,
-				  struct station_info *sinfo)
-#endif
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_station(wiphy, dev, mac, sinfo);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
-/**
- * hdd_get_stats() - Function to retrieve interface statistics
- * @dev: pointer to network device
- *
- * This function is the ndo_get_stats method for all netdevs
- * registered with the kernel
- *
- * Return: pointer to net_device_stats structure
- */
-struct net_device_stats *hdd_get_stats(struct net_device *dev)
-{
-	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
-
-	return &adapter->stats;
-}
-/**
- * __wlan_hdd_cfg80211_dump_survey() - get survey related info
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @idx: Index
- * @survey: Pointer to survey info
- *
- * Return: 0 for success, non-zero for failure
- */
-static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
-					   struct net_device *dev,
-					   int idx, struct survey_info *survey)
-{
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx;
-	hdd_station_ctx_t *pHddStaCtx;
-	tHalHandle halHandle;
-	uint32_t channel = 0, freq = 0; /* Initialization Required */
-	int8_t snr, rssi;
-	int status, i, j, filled = 0;
-
-	ENTER();
-
-	if (CDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
-		hddLog(LOGE, FL("Command not allowed in FTM mode"));
-		return -EINVAL;
-	}
-
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
-
-	pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
-
-	if (0 == pHddCtx->config->fEnableSNRMonitoring ||
-	    0 != pAdapter->survey_idx ||
-	    eConnectionState_Associated != pHddStaCtx->conn_info.connState) {
-		/* The survey dump ops when implemented completely is expected
-		 * to return a survey of all channels and the ops is called by
-		 * the kernel with incremental values of the argument 'idx'
-		 * till it returns -ENONET. But we can only support the survey
-		 * for the operating channel for now. survey_idx is used to
-		 * track that the ops is called only once and then return
-		 * -ENONET for the next iteration
-		 */
-		pAdapter->survey_idx = 0;
-		return -ENONET;
-	}
-
-	if (!pHddStaCtx->hdd_ReassocScenario) {
-		hdd_err("Roaming in progress, hence return");
-		return -ENONET;
-	}
-
-	halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
-
-	wlan_hdd_get_snr(pAdapter, &snr);
-	wlan_hdd_get_rssi(pAdapter, &rssi);
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
-			 TRACE_CODE_HDD_CFG80211_DUMP_SURVEY,
-			 pAdapter->sessionId, pAdapter->device_mode));
-
-	sme_get_operation_channel(halHandle, &channel, pAdapter->sessionId);
-	hdd_wlan_get_freq(channel, &freq);
-
-	for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
-		if (NULL == wiphy->bands[i])
-			continue;
-
-		for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
-			struct ieee80211_supported_band *band = wiphy->bands[i];
-
-			if (band->channels[j].center_freq == (uint16_t) freq) {
-				survey->channel = &band->channels[j];
-				/* The Rx BDs contain SNR values in dB for the
-				 * received frames while the supplicant expects
-				 * noise. So we calculate and return the value
-				 * of noise (dBm)
-				 *  SNR (dB) = RSSI (dBm) - NOISE (dBm)
-				 */
-				survey->noise = rssi - snr;
-				survey->filled = SURVEY_INFO_NOISE_DBM;
-				filled = 1;
-			}
-		}
-	}
-
-	if (filled)
-		pAdapter->survey_idx = 1;
-	else {
-		pAdapter->survey_idx = 0;
-		return -ENONET;
-	}
-	EXIT();
-	return 0;
-}
-
-/**
- * wlan_hdd_cfg80211_dump_survey() - get survey related info
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @idx: Index
- * @survey: Pointer to survey info
- *
- * Return: 0 for success, non-zero for failure
- */
-int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  int idx, struct survey_info *survey)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_dump_survey(wiphy, dev, idx, survey);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-/**
- * hdd_init_ll_stats_ctx() - initialize link layer stats context
- *
- * Return: none
- */
-inline void hdd_init_ll_stats_ctx(void)
-{
-	spin_lock_init(&ll_stats_context.context_lock);
-	init_completion(&ll_stats_context.response_event);
-	ll_stats_context.request_bitmap = 0;
-
-	return;
-}

+ 0 - 209
core/hdd/src/wlan_hdd_stats.h

@@ -1,209 +0,0 @@
-/*
- * 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
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * 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.
- */
-
-/**
- * DOC : wlan_hdd_stats.h
- *
- * WLAN Host Device Driver statistics related implementation
- *
- */
-
-#if !defined(WLAN_HDD_STATS_H)
-#define WLAN_HDD_STATS_H
-
-#include "wlan_hdd_main.h"
-
-#define INVALID_MCS_IDX 255
-#define MAX_HT_MCS_IDX 8
-#define MAX_VHT_MCS_IDX 10
-
-#ifdef WLAN_FEATURE_11AC
-#define DATA_RATE_11AC_MCS_MASK    0x03
-
-/* LL stats get request time out value */
-#define WLAN_WAIT_TIME_LL_STATS 5000
-
-/**
- * struct index_vht_data_rate_type - vht data rate type
- * @beacon_rate_index: Beacon rate index
- * @supported_VHT80_rate: VHT80 rate
- * @supported_VHT40_rate: VHT40 rate
- * @supported_VHT20_rate: VHT20 rate
- */
-struct index_vht_data_rate_type {
-	uint8_t beacon_rate_index;
-	uint16_t supported_VHT80_rate[2];
-	uint16_t supported_VHT40_rate[2];
-	uint16_t supported_VHT20_rate[2];
-};
-
-/**
- * enum - eDataRate11ACMaxMcs
- * @DATA_RATE_11AC_MAX_MCS_7: MCS7 rate
- * @DATA_RATE_11AC_MAX_MCS_8: MCS8 rate
- * @DATA_RATE_11AC_MAX_MCS_9: MCS9 rate
- * @DATA_RATE_11AC_MAX_MCS_NA:i Not applicable
- */
-enum eDataRate11ACMaxMcs{
-	DATA_RATE_11AC_MAX_MCS_7,
-	DATA_RATE_11AC_MAX_MCS_8,
-	DATA_RATE_11AC_MAX_MCS_9,
-	DATA_RATE_11AC_MAX_MCS_NA
-};
-#endif /* End of WLAN_FEATURE_11AC */
-
-/**
- * struct index_data_rate_type - non vht data rate type
- * @beacon_rate_index: Beacon rate index
- * @supported_rate: Supported rate table
- */
-struct index_data_rate_type {
-	uint8_t beacon_rate_index;
-	uint16_t supported_rate[4];
-};
-
-#ifdef WLAN_FEATURE_LINK_LAYER_STATS
-/*
- * Used to allocate the size of 4096 for the link layer stats.
- * The size of 4096 is considered assuming that all data per
- * respective event fit with in the limit.Please take a call
- * on the limit based on the data requirements on link layer
- * statistics.
- */
-#define LL_STATS_EVENT_BUF_SIZE 4096
-
-void hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx);
-
-/**
- * wlan_hdd_cfg80211_ll_stats_set() - set link layer stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-int wlan_hdd_cfg80211_ll_stats_set(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data,
-				   int data_len);
-
-/**
- * wlan_hdd_cfg80211_ll_stats_get() - get link layer stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-int wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy,
-				   struct wireless_dev *wdev,
-				   const void *data,
-				   int data_len);
-
-
-/**
- * wlan_hdd_cfg80211_ll_stats_clear() - clear link layer stats
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-int wlan_hdd_cfg80211_ll_stats_clear(struct wiphy *wiphy,
-				     struct wireless_dev *wdev,
-				     const void *data,
-				     int data_len);
-
-void hdd_init_ll_stats_ctx(void);
-
-static inline bool hdd_link_layer_stats_supported(void)
-{
-	return true;
-}
-
-#else
-
-static inline void hdd_cfg80211_link_layer_stats_init(hdd_context_t *pHddCtx)
-{
-	return;
-}
-
-static inline void hdd_init_ll_stats_ctx(void)
-{
-	return;
-}
-
-static inline bool hdd_link_layer_stats_supported(void)
-{
-	return false;
-}
-
-#endif /* End of WLAN_FEATURE_LINK_LAYER_STATS */
-
-#ifdef WLAN_FEATURE_STATS_EXT
-/**
- * wlan_hdd_cfg80211_stats_ext_request() - ext stats request
- * @wiphy: Pointer to wiphy
- * @wdev: Pointer to wdev
- * @data: Pointer to data
- * @data_len: Data length
- *
- * Return: int
- */
-int wlan_hdd_cfg80211_stats_ext_request(struct wiphy *wiphy,
-					struct wireless_dev *wdev,
-					const void *data,
-					int data_len);
-
-void wlan_hdd_cfg80211_stats_ext_init(hdd_context_t *pHddCtx);
-#else
-static inline void wlan_hdd_cfg80211_stats_ext_init(hdd_context_t *pHddCtx) {}
-#endif /* End of WLAN_FEATURE_STATS_EXT */
-
-/**
- * wlan_hdd_cfg80211_get_station() - get station statistics
- * @wiphy: Pointer to wiphy
- * @dev: Pointer to network device
- * @mac: Pointer to mac
- * @sinfo: Pointer to station info
- *
- * Return: 0 for success, non-zero for failure
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
-int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
-				  struct net_device *dev, const uint8_t *mac,
-				  struct station_info *sinfo);
-#else
-int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
-				  struct net_device *dev, uint8_t *mac,
-				  struct station_info *sinfo);
-#endif
-
-struct net_device_stats *hdd_get_stats(struct net_device *dev);
-
-int wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
-				  struct net_device *dev,
-				  int idx, struct survey_info *survey);
-#endif /* end #if !defined(WLAN_HDD_STATS_H) */
-

Some files were not shown because too many files changed in this diff