aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkecinzer <kecinzer@gmail.com>2014-06-06 13:06:28 +0200
committerkecinzer <kecinzer@gmail.com>2014-06-06 13:06:28 +0200
commit634fac6f482e2502561f844a3bb71038e58a05a8 (patch)
tree57b7adc9bf32b6a27cbbb586842a7bb3cfc02fab
parent9458f7e7b0a2bba0107d7b17792706db1a8faa26 (diff)
parenta6edd5e48e963f32d0d7017e290f1c0658265d5a (diff)
Merge remote-tracking branch 'aosp/android-msm-mako-3.4-kitkat-mr2' into kitkat
-rw-r--r--android/configs/README15
-rw-r--r--android/configs/android-base.cfg140
-rw-r--r--android/configs/android-recommended.cfg118
-rw-r--r--arch/arm/configs/mako_defconfig38
-rw-r--r--drivers/base/sync.c14
-rw-r--r--drivers/input/touchscreen/lge_touch_core.c2
-rw-r--r--drivers/net/wireless/ath/regd.c1
-rw-r--r--drivers/staging/android/ashmem.c4
-rw-r--r--drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h22
-rwxr-xr-xdrivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h11
-rw-r--r--drivers/staging/prima/CORE/HDD/inc/wlan_hdd_power.h2
-rwxr-xr-xdrivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c17
-rw-r--r--drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c36
-rwxr-xr-xdrivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c26
-rw-r--r--drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c304
-rwxr-xr-xdrivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c28
-rw-r--r--drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c36
-rw-r--r--drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c96
-rw-r--r--drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c9
-rw-r--r--drivers/staging/prima/CORE/MAC/inc/qwlan_version.h4
-rw-r--r--drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h24
-rw-r--r--drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h14
-rw-r--r--drivers/staging/prima/CORE/MAC/src/cfg/cfgParamName.c2
-rw-r--r--drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt28
-rw-r--r--drivers/staging/prima/CORE/MAC/src/include/sirParams.h1
-rw-r--r--drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c19
-rw-r--r--drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c31
-rw-r--r--drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h4
-rw-r--r--drivers/staging/prima/CORE/SME/inc/csrApi.h9
-rwxr-xr-xdrivers/staging/prima/CORE/SME/inc/csrInternal.h11
-rw-r--r--drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c313
-rwxr-xr-xdrivers/staging/prima/CORE/SME/src/csr/csrApiScan.c89
-rw-r--r--drivers/staging/prima/CORE/SME/src/csr/csrUtil.c7
-rwxr-xr-xdrivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c5
-rw-r--r--drivers/staging/prima/CORE/VOSS/src/vos_sched.c5
-rw-r--r--drivers/staging/prima/CORE/VOSS/src/vos_sched.h1
-rw-r--r--drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c32
-rw-r--r--drivers/staging/prima/firmware_bin/WCNSS_cfg.datbin10330 -> 10394 bytes
-rw-r--r--drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini14
-rw-r--r--drivers/staging/prima/riva/inc/wlan_hal_cfg.h5
-rw-r--r--drivers/staging/prima/riva/inc/wlan_hal_msg.h1
-rw-r--r--drivers/usb/gadget/f_accessory.c32
-rw-r--r--drivers/video/msm/mdp4_overlay.c26
-rw-r--r--drivers/video/msm/msm_fb.h1
-rw-r--r--fs/dcache.c2
-rw-r--r--fs/seq_file.c5
-rw-r--r--include/net/cfg80211.h70
-rw-r--r--include/net/tcp.h1
-rw-r--r--net/ipv4/ping.c33
-rw-r--r--net/ipv4/sysctl_net_ipv4.c24
-rw-r--r--net/ipv4/tcp_input.c5
-rw-r--r--net/ipv4/tcp_output.c7
-rw-r--r--net/netfilter/xt_qtaguid.c150
-rw-r--r--net/wireless/reg.c10
-rw-r--r--security/selinux/include/classmap.h4
-rw-r--r--security/selinux/ss/services.c4
56 files changed, 1318 insertions, 594 deletions
diff --git a/android/configs/README b/android/configs/README
new file mode 100644
index 00000000000..8798731f890
--- /dev/null
+++ b/android/configs/README
@@ -0,0 +1,15 @@
+The files in this directory are meant to be used as a base for an Android
+kernel config. All devices should have the options in android-base.cfg enabled.
+While not mandatory, the options in android-recommended.cfg enable advanced
+Android features.
+
+Assuming you already have a minimalist defconfig for your device, a possible
+way to enable these options would be:
+
+ ARCH=<arch> scripts/kconfig/merge_config.sh <path_to>/<device>_defconfig android/configs/android-base.cfg android/configs/android-recommended.cfg
+
+This will generate a .config that can then be used to save a new defconfig or
+compile a new kernel with Android features enabled.
+
+Because there is no tool to consistently generate these config fragments,
+lets keep them alphabetically sorted instead of random.
diff --git a/android/configs/android-base.cfg b/android/configs/android-base.cfg
new file mode 100644
index 00000000000..6b67601b7f1
--- /dev/null
+++ b/android/configs/android-base.cfg
@@ -0,0 +1,140 @@
+# KEEP ALPHABETICALLY SORTED
+# CONFIG_INET_LRO is not set
+# CONFIG_MODULES is not set
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_INTF_ALARM_DEV=y
+CONFIG_ANDROID_LOGGER=y
+CONFIG_ANDROID_LOW_MEMORY_KILLER=y
+CONFIG_ASHMEM=y
+CONFIG_BLK_DEV_DM=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_DEBUG=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_DM_CRYPT=y
+CONFIG_EMBEDDED=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_FB=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_INET6_AH=y
+CONFIG_INET6_ESP=y
+CONFIG_INET6_IPCOMP=y
+CONFIG_INET=y
+CONFIG_INET_ESP=y
+CONFIG_IP6_NF_FILTER=y
+CONFIG_IP6_NF_IPTABLES=y
+CONFIG_IP6_NF_MANGLE=y
+CONFIG_IP6_NF_RAW=y
+CONFIG_IP6_NF_TARGET_REJECT=y
+CONFIG_IP6_NF_TARGET_REJECT_SKERR=y
+CONFIG_IPV6_MIP6=y
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_OPTIMISTIC_DAD=y
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_IPV6_ROUTER_PREF=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_NF_ARPFILTER=y
+CONFIG_IP_NF_ARPTABLES=y
+CONFIG_IP_NF_ARP_MANGLE=y
+CONFIG_IP_NF_FILTER=y
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_MANGLE=y
+CONFIG_IP_NF_MATCH_AH=y
+CONFIG_IP_NF_MATCH_ECN=y
+CONFIG_IP_NF_MATCH_TTL=y
+CONFIG_IP_NF_RAW=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_IP_NF_TARGET_NETMAP=y
+CONFIG_IP_NF_TARGET_REDIRECT=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP_NF_TARGET_REJECT_SKERR=y
+CONFIG_NET=y
+CONFIG_NETDEVICES=y
+CONFIG_NETFILTER=y
+CONFIG_NETFILTER_TPROXY=y
+CONFIG_NETFILTER_XT_MATCH_COMMENT=y
+CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
+CONFIG_NETFILTER_XT_MATCH_HELPER=y
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
+CONFIG_NETFILTER_XT_MATCH_LENGTH=y
+CONFIG_NETFILTER_XT_MATCH_LIMIT=y
+CONFIG_NETFILTER_XT_MATCH_MAC=y
+CONFIG_NETFILTER_XT_MATCH_MARK=y
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
+CONFIG_NETFILTER_XT_MATCH_POLICY=y
+CONFIG_NETFILTER_XT_MATCH_QTAGUID=y
+CONFIG_NETFILTER_XT_MATCH_QUOTA2=y
+CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG=y
+CONFIG_NETFILTER_XT_MATCH_QUOTA=y
+CONFIG_NETFILTER_XT_MATCH_SOCKET=y
+CONFIG_NETFILTER_XT_MATCH_STATE=y
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
+CONFIG_NETFILTER_XT_MATCH_STRING=y
+CONFIG_NETFILTER_XT_MATCH_TIME=y
+CONFIG_NETFILTER_XT_MATCH_U32=y
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
+CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
+CONFIG_NETFILTER_XT_TARGET_MARK=y
+CONFIG_NETFILTER_XT_TARGET_NFLOG=y
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
+CONFIG_NETFILTER_XT_TARGET_TPROXY=y
+CONFIG_NETFILTER_XT_TARGET_TRACE=y
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_CLS_U32=y
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_U32=y
+CONFIG_NET_KEY=y
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_HTB=y
+CONFIG_NF_CONNTRACK=y
+CONFIG_NF_CONNTRACK_AMANDA=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CONNTRACK_FTP=y
+CONFIG_NF_CONNTRACK_H323=y
+CONFIG_NF_CONNTRACK_IPV4=y
+CONFIG_NF_CONNTRACK_IPV6=y
+CONFIG_NF_CONNTRACK_IRC=y
+CONFIG_NF_CONNTRACK_NETBIOS_NS=y
+CONFIG_NF_CONNTRACK_PPTP=y
+CONFIG_NF_CONNTRACK_SANE=y
+CONFIG_NF_CONNTRACK_TFTP=y
+CONFIG_NF_CT_NETLINK=y
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_SCTP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
+CONFIG_NF_NAT=y
+CONFIG_NO_HZ=y
+CONFIG_PACKET=y
+CONFIG_PM_AUTOSLEEP=y
+CONFIG_PM_WAKELOCKS=y
+CONFIG_PPP=y
+CONFIG_PPPOLAC=y
+CONFIG_PPPOPNS=y
+CONFIG_PPP_BSDCOMP=y
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_MPPE=y
+CONFIG_PREEMPT=y
+CONFIG_RESOURCE_COUNTERS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RT_GROUP_SCHED=y
+CONFIG_STAGING=y
+CONFIG_SWITCH=y
+CONFIG_SYNC=y
+CONFIG_SYSVIPC=y
+CONFIG_TUN=y
+CONFIG_UNIX=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_G_ANDROID=y
+CONFIG_USB_OTG_WAKELOCK=y
+CONFIG_XFRM_USER=y
diff --git a/android/configs/android-recommended.cfg b/android/configs/android-recommended.cfg
new file mode 100644
index 00000000000..9caa089c5d1
--- /dev/null
+++ b/android/configs/android-recommended.cfg
@@ -0,0 +1,118 @@
+# KEEP ALPHABETICALLY SORTED
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_NF_CONNTRACK_SIP is not set
+# CONFIG_PM_WAKELOCKS_GC is not set
+# CONFIG_VT is not set
+CONFIG_ANDROID_RAM_CONSOLE=y
+CONFIG_ANDROID_TIMED_GPIO=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_COMPACTION=y
+CONFIG_DM_UEVENT=y
+CONFIG_DRAGONRISE_FF=y
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_SECURITY=y
+CONFIG_FUSE_FS=y
+CONFIG_GREENASIA_FF=y
+CONFIG_HIDRAW=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_ACRUX=y
+CONFIG_HID_ACRUX_FF=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_DRAGONRISE=y
+CONFIG_HID_ELECOM=y
+CONFIG_HID_EMS_FF=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_GREENASIA=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_HOLTEK=y
+CONFIG_HID_KENSINGTON=y
+CONFIG_HID_KEYTOUCH=y
+CONFIG_HID_KYE=y
+CONFIG_HID_LCPOWER=y
+CONFIG_HID_LOGITECH=y
+CONFIG_HID_LOGITECH_DJ=y
+CONFIG_HID_MAGICMOUSE=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_MULTITOUCH=y
+CONFIG_HID_NTRIG=y
+CONFIG_HID_ORTEK=y
+CONFIG_HID_PANTHERLORD=y
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_PICOLCD=y
+CONFIG_HID_PRIMAX=y
+CONFIG_HID_PRODIKEYS=y
+CONFIG_HID_ROCCAT=y
+CONFIG_HID_SAITEK=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SMARTJOYPLUS=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SPEEDLINK=y
+CONFIG_HID_SUNPLUS=y
+CONFIG_HID_THRUSTMASTER=y
+CONFIG_HID_TIVO=y
+CONFIG_HID_TOPSEED=y
+CONFIG_HID_TWINHAN=y
+CONFIG_HID_UCLOGIC=y
+CONFIG_HID_WACOM=y
+CONFIG_HID_WALTOP=y
+CONFIG_HID_WIIMOTE=y
+CONFIG_HID_ZEROPLUS=y
+CONFIG_HID_ZYDACRON=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_GPIO=y
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_INPUT_KEYCHORD=y
+CONFIG_INPUT_KEYRESET=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_TABLET=y
+CONFIG_INPUT_UINPUT=y
+CONFIG_ION=y
+CONFIG_JOYSTICK_XPAD=y
+CONFIG_JOYSTICK_XPAD_FF=y
+CONFIG_JOYSTICK_XPAD_LEDS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KSM=y
+CONFIG_LOGIG940_FF=y
+CONFIG_LOGIRUMBLEPAD2_FF=y
+CONFIG_LOGITECH_FF=y
+CONFIG_MD=y
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MSDOS_FS=y
+CONFIG_PANIC_TIMEOUT=5
+CONFIG_PANTHERLORD_FF=y
+CONFIG_PERF_EVENTS=y
+CONFIG_PM_DEBUG=y
+CONFIG_PM_RUNTIME=y
+CONFIG_PM_WAKELOCKS_LIMIT=0
+CONFIG_POWER_SUPPLY=y
+CONFIG_SCHEDSTATS=y
+CONFIG_SMARTJOYPLUS_FF=y
+CONFIG_SND=y
+CONFIG_SOUND=y
+CONFIG_SUSPEND_TIME=y
+CONFIG_TABLET_USB_ACECAD=y
+CONFIG_TABLET_USB_AIPTEK=y
+CONFIG_TABLET_USB_GTCO=y
+CONFIG_TABLET_USB_HANWANG=y
+CONFIG_TABLET_USB_KBTAB=y
+CONFIG_TABLET_USB_WACOM=y
+CONFIG_TIMER_STATS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_UHID=y
+CONFIG_UID_STAT=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_USBNET=y
+CONFIG_VFAT_FS=y
diff --git a/arch/arm/configs/mako_defconfig b/arch/arm/configs/mako_defconfig
index 5d1639c0ab1..061020c00a9 100644
--- a/arch/arm/configs/mako_defconfig
+++ b/arch/arm/configs/mako_defconfig
@@ -1,13 +1,14 @@
# CONFIG_ARM_PATCH_PHYS_VIRT is not set
CONFIG_EXPERIMENTAL=y
CONFIG_LOCALVERSION="-perf"
+# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_AUDIT=y
CONFIG_IKCONFIG=y
-# CONFIG_IKCONFIG_PROC is not set
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
@@ -25,10 +26,8 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_PANIC_TIMEOUT=5
CONFIG_KALLSYMS_ALL=y
-CONFIG_ASHMEM=y
CONFIG_EMBEDDED=y
CONFIG_PROFILING=y
-# CONFIG_OPROFILE is not set
CONFIG_PARTITION_ADVANCED=y
CONFIG_EFI_PARTITION=y
# CONFIG_IOSCHED_TEST is not set
@@ -39,11 +38,11 @@ CONFIG_MSM_KRAIT_TBB_ABORT_HANDLER=y
CONFIG_MACH_MSM_DUMMY=y
CONFIG_BOARD_HEADER_FILE="mach/lge/board_mako.h"
CONFIG_MACH_APQ8064_MAKO=y
-CONFIG_LGE_CRASH_HANDLER=y
CONFIG_LGE_QFPROM_INTERFACE=y
CONFIG_UPDATE_LCDC_LUT=y
CONFIG_LCD_KCAL=y
CONFIG_EARJACK_DEBUGGER=y
+CONFIG_LGE_CRASH_HANDLER=y
# CONFIG_MSM_STACKED_MEMORY is not set
CONFIG_KERNEL_MSM_CONTIG_MEM_REGION=y
# CONFIG_MSM_FIQ_SUPPORT is not set
@@ -57,13 +56,13 @@ CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
# CONFIG_MSM_HW3D is not set
# CONFIG_MSM_DMA_TEST is not set
+CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_PIL_QDSP6V4=y
CONFIG_MSM_PIL_RIVA=y
CONFIG_MSM_PIL_TZAPPS=y
CONFIG_MSM_PIL_DSPS=y
CONFIG_MSM_PIL_VIDC=y
CONFIG_MSM_PIL_GSS=y
-CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_MODEM_8960=y
CONFIG_MSM_LPASS_8960=y
CONFIG_MSM_WCNSS_SSR_8960=y
@@ -76,6 +75,7 @@ CONFIG_MSM_BUS_SCALING=y
CONFIG_MSM_BUS_RPM_MULTI_TIER_ENABLED=y
CONFIG_MSM_WATCHDOG=y
CONFIG_MSM_DLOAD_MODE=y
+CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_ULTRASOUND=y
CONFIG_MSM_CACHE_ERP=y
CONFIG_MSM_L1_ERR_PANIC=y
@@ -84,7 +84,6 @@ CONFIG_MSM_DCVS=y
CONFIG_MSM_CACHE_DUMP=y
CONFIG_MSM_CACHE_DUMP_ON_PANIC=y
CONFIG_MSM_HSIC_SYSMON=y
-CONFIG_MSM_ADSP_LOADER=y
CONFIG_STRICT_MEMORY_RWX=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
@@ -93,7 +92,6 @@ CONFIG_SMP=y
CONFIG_PREEMPT=y
CONFIG_AEABI=y
CONFIG_HIGHMEM=y
-CONFIG_VMALLOC_RESERVE=0x19000000
CONFIG_COMPACTION=y
CONFIG_CC_STACKPROTECTOR=y
CONFIG_CPU_FREQ=y
@@ -137,6 +135,7 @@ CONFIG_IPV6_MULTIPLE_TABLES=y
CONFIG_IPV6_SUBTREES=y
CONFIG_NETFILTER=y
CONFIG_NF_CONNTRACK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CT_PROTO_DCCP=y
CONFIG_NF_CT_PROTO_SCTP=y
@@ -148,17 +147,19 @@ CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
CONFIG_NF_CONNTRACK_PPTP=y
CONFIG_NF_CONNTRACK_SANE=y
-#CONFIG_NF_CONNTRACK_SIP is not set
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NETFILTER_TPROXY=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
+CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_MARK=y
CONFIG_NETFILTER_XT_TARGET_NFLOG=y
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
CONFIG_NETFILTER_XT_TARGET_TPROXY=y
CONFIG_NETFILTER_XT_TARGET_TRACE=y
+CONFIG_NETFILTER_XT_TARGET_SECMARK=y
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
@@ -198,6 +199,7 @@ CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
CONFIG_IP_NF_MANGLE=y
CONFIG_IP_NF_RAW=y
+CONFIG_IP_NF_SECURITY=y
CONFIG_IP_NF_ARPTABLES=y
CONFIG_IP_NF_ARPFILTER=y
CONFIG_IP_NF_ARP_MANGLE=y
@@ -232,6 +234,7 @@ CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y
# CONFIG_MSM_BT_POWER is not set
CONFIG_CFG80211=y
+CONFIG_CFG80211_INTERNAL_REGDB=y
# CONFIG_CFG80211_WEXT is not set
CONFIG_RFKILL=y
CONFIG_BCM2079X=y
@@ -426,17 +429,15 @@ CONFIG_USB_STORAGE_ONETOUCH=y
CONFIG_USB_STORAGE_KARMA=y
CONFIG_USB_STORAGE_CYPRESS_ATACB=y
CONFIG_USB_SERIAL=y
-# CONFIG_USB_SERIAL_QUALCOMM is not set
-CONFIG_USB_QCOM_KS_BRIDGE=y
CONFIG_USB_SERIAL_CSVT=y
CONFIG_USB_EHSET_TEST_FIXTURE=y
CONFIG_USB_QCOM_DIAG_BRIDGE=y
CONFIG_USB_QCOM_MDM_BRIDGE=y
+CONFIG_USB_QCOM_KS_BRIDGE=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_CI13XXX_MSM=y
CONFIG_USB_G_ANDROID=y
-CONFIG_USB_ANDROID_RMNET_CTRL_SMD=y
CONFIG_MMC=y
CONFIG_MMC_PERF_PROFILING=y
CONFIG_MMC_UNSAFE_RESUME=y
@@ -459,6 +460,7 @@ CONFIG_RTC_DRV_PM8XXX=y
CONFIG_STAGING=y
CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ASHMEM=y
CONFIG_ANDROID_LOGGER=y
CONFIG_ANDROID_RAM_CONSOLE=y
CONFIG_ANDROID_TIMED_GPIO=y
@@ -470,7 +472,6 @@ CONFIG_MSM_SSBI=y
CONFIG_SPS=y
CONFIG_SPS_SUPPORT_BAMDMA=y
CONFIG_MSM_IOMMU=y
-CONFIG_MSM_QDSS=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT3_FS=y
@@ -496,17 +497,10 @@ CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_ENABLE_DEFAULT_TRACERS=y
CONFIG_PID_IN_CONTEXTIDR=y
-CONFIG_CRYPTO_TWOFISH=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
-CONFIG_AUDIT=y
-CONFIG_NF_CONNTRACK_SECMARK=y
-CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
-CONFIG_NETFILTER_XT_TARGET_SECMARK=y
-CONFIG_IP_NF_SECURITY=y
CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
CONFIG_LSM_MMAP_MIN_ADDR=4096
CONFIG_SECURITY_SELINUX=y
-CONFIG_CFG80211_INTERNAL_REGDB=y
-CONFIG_SWAP=n
+CONFIG_CRYPTO_TWOFISH=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/drivers/base/sync.c b/drivers/base/sync.c
index 2e359968919..95819987fbe 100644
--- a/drivers/base/sync.c
+++ b/drivers/base/sync.c
@@ -79,27 +79,27 @@ static void sync_timeline_free(struct kref *kref)
container_of(kref, struct sync_timeline, kref);
unsigned long flags;
- if (obj->ops->release_obj)
- obj->ops->release_obj(obj);
-
spin_lock_irqsave(&sync_timeline_list_lock, flags);
list_del(&obj->sync_timeline_list);
spin_unlock_irqrestore(&sync_timeline_list_lock, flags);
+ if (obj->ops->release_obj)
+ obj->ops->release_obj(obj);
+
kfree(obj);
}
void sync_timeline_destroy(struct sync_timeline *obj)
{
obj->destroyed = true;
+ smp_wmb();
/*
- * If this is not the last reference, signal any children
- * that their parent is going away.
+ * signal any children that their parent is going away.
*/
+ sync_timeline_signal(obj);
- if (!kref_put(&obj->kref, sync_timeline_free))
- sync_timeline_signal(obj);
+ kref_put(&obj->kref, sync_timeline_free);
}
EXPORT_SYMBOL(sync_timeline_destroy);
diff --git a/drivers/input/touchscreen/lge_touch_core.c b/drivers/input/touchscreen/lge_touch_core.c
index 2c1793fc9b8..e83a8acfe46 100644
--- a/drivers/input/touchscreen/lge_touch_core.c
+++ b/drivers/input/touchscreen/lge_touch_core.c
@@ -954,6 +954,8 @@ static void touch_fw_upgrade_func(struct work_struct *work_fw_upgrade)
ktime_set(0, ts->pdata->role->report_period),
HRTIMER_MODE_REL);
+ msleep(ts->pdata->role->booting_delay);
+
touch_ic_init(ts);
if (saved_state == POWER_WAKE || saved_state == POWER_SLEEP)
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 10dea37431b..bd4ecf34eca 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -520,6 +520,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
*/
regd = ath_world_regdomain(reg);
wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
+ wiphy->country_ie_pref = NL80211_COUNTRY_IE_FOLLOW_POWER;
} else {
/*
* This gets applied in the case of the absence of CRDA,
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 16c411cbe5b..4f13907543e 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -365,7 +365,9 @@ static int ashmem_shrink(struct shrinker *s, struct shrink_control *sc)
if (!sc->nr_to_scan)
return lru_count;
- mutex_lock(&ashmem_mutex);
+ if (!mutex_trylock(&ashmem_mutex))
+ return -1;
+
list_for_each_entry_safe(range, next, &ashmem_lru_list, lru) {
struct inode *inode = range->asma->file->f_dentry->d_inode;
loff_t start = range->pgstart * PAGE_SIZE;
diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h
index 3a2d70b8577..ea8505b5841 100644
--- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -1342,13 +1342,6 @@ typedef enum
#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_MAX ( 1 )
#define CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED_DEFAULT ( 0 )
-#ifdef WLAN_FEATURE_PACKET_FILTERING
-#define CFG_MC_ADDR_LIST_FILTER_NAME "isMcAddrListFilter"
-#define CFG_MC_ADDR_LIST_FILTER_MIN ( 0 )
-#define CFG_MC_ADDR_LIST_FILTER_MAX ( 1 )
-#define CFG_MC_ADDR_LIST_FILTER_DEFAULT ( 0 )
-#endif
-
#define CFG_ENABLE_SSR "gEnableSSR"
#define CFG_ENABLE_SSR_MIN ( 0 )
#define CFG_ENABLE_SSR_MAX ( 1 )
@@ -1783,6 +1776,16 @@ typedef enum
#define CFG_SPLIT_SCAN_TRAFFIC_MONITOR_TIMER_MAX ( 10000 )
#define CFG_SPLIT_SCAN_TRAFFIC_MONITOR_TIMER_DEFAULT ( 5000 )
+#define CFG_RA_FILTER_ENABLE_NAME "gRAFilterEnable"
+#define CFG_RA_FILTER_ENABLE_DEFAULT (1)
+#define CFG_RA_FILTER_ENABLE_MIN (0)
+#define CFG_RA_FILTER_ENABLE_MAX (1)
+
+#define CFG_RA_RATE_LIMIT_INTERVAL_NAME "gRARateLimitInterval"
+#define CFG_RA_RATE_LIMIT_INTERVAL_DEFAULT (60)
+#define CFG_RA_RATE_LIMIT_INTERVAL_MIN (0)
+#define CFG_RA_RATE_LIMIT_INTERVAL_MAX (60)
+
/*---------------------------------------------------------------------------
Type declarations
-------------------------------------------------------------------------*/
@@ -2110,9 +2113,6 @@ typedef struct
v_U8_t allowMCCGODiffBI;
v_BOOL_t isP2pDeviceAddrAdministrated;
v_U8_t thermalMitigationEnable;
-#ifdef WLAN_FEATURE_PACKET_FILTERING
- v_BOOL_t isMcAddrListFilter;
-#endif
#ifdef WLAN_FEATURE_11AC
v_U8_t vhtChannelWidth;
v_U8_t vhtRxMCS;
@@ -2165,6 +2165,8 @@ typedef struct
v_U32_t cfgMaxMediumTime;
v_U8_t enableTrafficMonitor;
v_U32_t trafficIdleTimeout;
+ v_BOOL_t cfgRAFilterEnable;
+ v_U16_t cfgRARateLimitInterval;
} hdd_config_t;
/*---------------------------------------------------------------------------
Function declarations and documenation
diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h
index 33fb44e8cbf..4c8c3075131 100755
--- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h
+++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h
@@ -682,6 +682,13 @@ struct hdd_adapter_s
/** Handle to the network device */
struct net_device *dev;
+
+#ifdef WLAN_NS_OFFLOAD
+ /** IPv6 notifier callback for handling NS offload on change in IP */
+ struct notifier_block ipv6_notifier;
+ bool ipv6_notifier_registered;
+ struct work_struct ipv6NotifierWorkQueue;
+#endif
//TODO Move this to sta Ctx
struct wireless_dev wdev ;
@@ -1100,5 +1107,7 @@ int wlan_hdd_validate_context(hdd_context_t *pHddCtx);
int wlan_hdd_setIPv6Filter(hdd_context_t *pHddCtx, tANI_U8 filterType, tANI_U8 sessionId);
#endif
VOS_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx);
-
+#ifdef WLAN_NS_OFFLOAD
+void hdd_ipv6_notifier_work_queue(struct work_struct *work);
+#endif
#endif // end #if !defined( WLAN_HDD_MAIN_H )
diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_power.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_power.h
index a1498a12ebc..0810397b29b 100644
--- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_power.h
+++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_power.h
@@ -102,6 +102,6 @@ void hdd_conf_hostoffload(hdd_adapter_t * pAdapter, v_BOOL_t fenable);
void hdd_conf_gtk_offload(hdd_adapter_t *pAdapter, v_BOOL_t fenable);
#endif
#ifdef WLAN_NS_OFFLOAD
-void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, v_BOOL_t fenable);
+void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, int fenable);
#endif
#endif // if !defined __WLAN_QCT_DRIVER_H
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c
index d3bf1a024bb..e235595251e 100755
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c
@@ -2311,19 +2311,12 @@ eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, tANI_U3
"offload: already called mcastbcast filter");
(WLAN_HDD_GET_CTX(pAdapter))->hdd_mcastbcast_filter_set = FALSE;
}
-#ifdef WLAN_FEATURE_PACKET_FILTERING
- if (pHddCtx->cfg_ini->isMcAddrListFilter)
- {
- /*Multicast addr filtering is enabled*/
- if (pAdapter->mc_addr_list.isFilterApplied)
- {
- /*Filter applied during suspend mode*/
- /*Clear it here*/
- wlan_hdd_set_mc_addr_list(pAdapter, FALSE);
- }
- }
+#ifdef WLAN_FEATURE_PACKET_FILTERING
+ /* Call to clear any MC Addr List filter applied after
+ * successful connection.
+ */
+ wlan_hdd_set_mc_addr_list(pAdapter, FALSE);
#endif
-
}
break;
case eCSR_ROAM_IBSS_LEAVE:
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c
index cb9a5b9a367..96796fafc87 100644
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg.c
@@ -1998,14 +1998,6 @@ REG_VARIABLE( CFG_THERMAL_MIGRATION_ENABLE_NAME, WLAN_PARAM_Integer,
CFG_THERMAL_MIGRATION_ENABLE_DEFAULT,
CFG_THERMAL_MIGRATION_ENABLE_MIN,
CFG_THERMAL_MIGRATION_ENABLE_MAX ),
-#ifdef WLAN_FEATURE_PACKET_FILTERING
- REG_VARIABLE( CFG_MC_ADDR_LIST_FILTER_NAME, WLAN_PARAM_Integer,
- hdd_config_t, isMcAddrListFilter,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_MC_ADDR_LIST_FILTER_DEFAULT,
- CFG_MC_ADDR_LIST_FILTER_MIN,
- CFG_MC_ADDR_LIST_FILTER_MAX ),
-#endif
REG_VARIABLE( CFG_ENABLE_MODULATED_DTIM_NAME, WLAN_PARAM_Integer,
hdd_config_t, enableModulatedDTIM,
@@ -2298,6 +2290,20 @@ REG_VARIABLE(CFG_MAX_MEDIUM_TIME, WLAN_PARAM_Integer,
CFG_TRAFFIC_IDLE_TIMEOUT_DEFAULT,
CFG_TRAFFIC_IDLE_TIMEOUT_MIN,
CFG_TRAFFIC_IDLE_TIMEOUT_MAX),
+
+ REG_VARIABLE(CFG_RA_FILTER_ENABLE_NAME, WLAN_PARAM_Integer,
+ hdd_config_t, cfgRAFilterEnable,
+ 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,
+ hdd_config_t, cfgRARateLimitInterval,
+ 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 ),
};
/*
@@ -3788,6 +3794,20 @@ v_BOOL_t hdd_update_config_dat( hdd_context_t *pHddCtx )
hddLog(LOGE, "Could not pass on WNI_CFG_MAX_MEDIUM_TIME to CCM");
}
+ if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_RA_FILTER_ENABLE, pConfig->cfgRAFilterEnable,
+ NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE)
+ {
+ fStatus = FALSE;
+ hddLog(LOGE, "Could not pass on WNI_CFG_RA_FILTER_ENABLE to CCM");
+ }
+
+ if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_RA_RATE_LIMIT_INTERVAL, pConfig->cfgRARateLimitInterval,
+ NULL, eANI_BOOLEAN_FALSE) == eHAL_STATUS_FAILURE)
+ {
+ fStatus = FALSE;
+ hddLog(LOGE, "Could not pass on WNI_CFG_RA_FILTER_ENABLE to CCM");
+ }
+
return fStatus;
}
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c
index 2986887774a..25b9f1a802e 100755
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -511,6 +511,8 @@ struct wiphy *wlan_hdd_cfg80211_wiphy_alloc(int priv_size)
return NULL;
}
+ wiphy->country_ie_pref = NL80211_COUNTRY_IE_IGNORE_CORE;
+
return wiphy;
}
@@ -4686,19 +4688,31 @@ int wlan_hdd_cfg80211_scan( struct wiphy *wiphy,
if( request->ie_len )
{
/* save this for future association (join requires this) */
+ /*TODO: Array needs to be converted to dynamic allocation,
+ * as multiple ie.s can be sent in cfg80211_scan_request structure
+ * CR 597966
+ */
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) ||
+ if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) ||
(WLAN_HDD_P2P_CLIENT == pAdapter->device_mode) ||
- (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode)
- )
+ (WLAN_HDD_P2P_DEVICE == pAdapter->device_mode))
{
- pwextBuf->roamProfile.pAddIEScan = pScanInfo->scanAddIE.addIEdata;
- pwextBuf->roamProfile.nAddIEScanLength = pScanInfo->scanAddIE.length;
- }
+ if ( request->ie_len <= SIR_MAC_MAX_IE_LENGTH)
+ {
+ pwextBuf->roamProfile.nAddIEScanLength = request->ie_len;
+ memcpy( pwextBuf->roamProfile.addIEScan,
+ request->ie, request->ie_len);
+ }
+ else
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, "Scan Ie length is invalid:"
+ "%d", request->ie_len);
+ }
+ }
scanRequest.uIEFieldLen = pScanInfo->scanAddIE.length;
scanRequest.pIEField = pScanInfo->scanAddIE.addIEdata;
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c
index b3e798efe53..6af5370921b 100644
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -107,6 +107,8 @@
#include "wlan_hdd_packet_filtering.h"
#define HDD_SSR_BRING_UP_TIME 180000
+#define NS_DEFAULT_SLOT_INDEX 4
+#define NS_EXTENDED_SLOT_INDEX 18
static eHalStatus g_full_pwr_status;
static eHalStatus g_standby_status;
@@ -560,22 +562,157 @@ void hdd_conf_hostoffload(hdd_adapter_t *pAdapter, v_BOOL_t fenable)
}
#ifdef WLAN_NS_OFFLOAD
-void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, v_BOOL_t fenable)
+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;
+
+ hddLog(LOG1, FL("Reconfiguring NS 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 ((eConnectionState_Associated ==
+ (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState)
+ && (VOS_TRUE == pHddCtx->sus_res_mcastbcast_filter_valid))
+ {
+ // This invocation being part of the IPv6 registration callback,
+ // we are passing second parameter as 2 to avoid registration
+ // of IPv6 notifier again.
+ hdd_conf_ns_offload(pAdapter, 2);
+ }
+}
+
+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 =
+ container_of(nb, struct hdd_adapter_s, ipv6_notifier);
+ hdd_context_t *pHddCtx;
+ int status;
+
+ if (pAdapter && pAdapter->dev == ndev)
+ {
+ pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+ status = wlan_hdd_validate_context(pHddCtx);
+ if (0 != status)
+ {
+ hddLog(LOGE, FL("HDD context is invalid"));
+ return NOTIFY_DONE;
+ }
+
+ schedule_work(&pAdapter->ipv6NotifierWorkQueue);
+ }
+
+ return NOTIFY_DONE;
+}
+
+/**----------------------------------------------------------------------------
+
+ \brief hdd_conf_ns_offload() - Configure NS offload
+
+ Called during SUSPEND to configure the NS offload (MC BC filter) which
+ reduces power consumption.
+
+ \param - pAdapter - Adapter context for which NS offload is to be configured
+ \param - fenable - 0 - disable.
+ 1 - enable. (with IPv6 notifier registration)
+ 2 - enable. (without IPv6 notifier registration)
+
+ \return - void
+
+ ---------------------------------------------------------------------------*/
+void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, int fenable)
{
struct inet6_dev *in6_dev;
struct inet6_ifaddr *ifp;
struct list_head *p;
- tANI_U8 selfIPv6Addr[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA][SIR_MAC_IPV6_ADDR_LEN] = {{0,}};
- tANI_BOOLEAN selfIPv6AddrValid[SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA] = {0};
tSirHostOffloadReq offLoadRequest;
+ int slot_index = NS_DEFAULT_SLOT_INDEX;
+ tANI_U8 **selfIPv6Addr;
+ tANI_U8 *selfIPv6AddrValid;
hdd_context_t *pHddCtx;
+ tHalHandle halHandle;
+ int status;
- int i =0;
+ int i = 0, slot = 0;
+ int ret = 0;
eHalStatus returnStatus;
+ ENTER();
+ hddLog(LOG1, FL(" fenable = %d"), fenable);
+
+ if (NULL == pAdapter)
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD adapter is Null"));
+ return;
+ }
+
+ halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
- ENTER();
+ status = wlan_hdd_validate_context(pHddCtx);
+
+ if (0 != status)
+ {
+ VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "%s: HDD context is not valid", __func__);
+ return;
+ }
+
+ if (sme_IsFeatureSupportedByFW(EXTENDED_NSOFFLOAD_SLOT))
+ {
+ slot_index = NS_EXTENDED_SLOT_INDEX;
+ }
+
+ hddLog(VOS_TRACE_LEVEL_INFO, FL("slot_idex = %d"), slot_index);
+
+ selfIPv6AddrValid =
+ (tANI_U8 *)vos_mem_malloc(sizeof(tANI_U8) * slot_index);
+
+ if (NULL == selfIPv6AddrValid)
+ {
+ hddLog (VOS_TRACE_LEVEL_ERROR, FL("Failed to allocate memory for"
+ " selfIPv6AddrValid"));
+ goto end;
+ }
+
+ memset(selfIPv6AddrValid, 0, slot_index * sizeof(tANI_U8));
+
+ selfIPv6Addr = (tANI_U8 **)vos_mem_malloc(sizeof(tANI_U8 *) * slot_index);
+
+ if (NULL == selfIPv6Addr)
+ {
+ hddLog (VOS_TRACE_LEVEL_ERROR, FL("Failed to allocate memory for"
+ " selfIPv6Addr"));
+ goto end;
+ }
+
+ memset(selfIPv6Addr, 0, slot_index * sizeof(tANI_U8 *));
+
+ for (slot = 0; slot < slot_index; slot++)
+ {
+ selfIPv6Addr[slot] =
+ (tANI_U8 *)vos_mem_malloc(SIR_MAC_IPV6_ADDR_LEN);
+ if (NULL == selfIPv6Addr[slot])
+ {
+ hddLog (VOS_TRACE_LEVEL_ERROR, FL("Failed to allocate memory"
+ "for selfIPv6Addr"));
+ goto end;
+ }
+ memset(selfIPv6Addr[slot], 0, SIR_MAC_IPV6_ADDR_LEN);
+ }
+
+ i = 0;
+
if (fenable)
{
in6_dev = __in6_dev_get(pAdapter->dev);
@@ -584,34 +721,47 @@ void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, v_BOOL_t fenable)
//read_lock_bh(&in6_dev->lock);
list_for_each(p, &in6_dev->addr_list)
{
+ if (i >= slot_index)
+ {
+ hddLog (VOS_TRACE_LEVEL_ERROR,
+ FL("IPv6 address list is greater than IPv6"
+ "address supported by firmware"));
+ hddLog (VOS_TRACE_LEVEL_ERROR,
+ FL("FW supported IPv6 address = %d"), slot_index);
+ break;
+ }
ifp = list_entry(p, struct inet6_ifaddr, if_list);
switch(ipv6_addr_src_scope(&ifp->addr))
{
case IPV6_ADDR_SCOPE_LINKLOCAL:
- vos_mem_copy(&selfIPv6Addr[0], &ifp->addr.s6_addr,
+ vos_mem_copy(selfIPv6Addr[i], &ifp->addr.s6_addr,
sizeof(ifp->addr.s6_addr));
- selfIPv6AddrValid[0] = SIR_IPV6_ADDR_VALID;
+ selfIPv6AddrValid[i] = SIR_IPV6_ADDR_VALID;
hddLog (VOS_TRACE_LEVEL_INFO,
- "Found IPV6_ADDR_SCOPE_LINKLOCAL Address : %pI6",
- selfIPv6Addr[0]);
+ FL("Found IPV6_ADDR_SCOPE_LINKLOCAL Address : %pI6"),
+ selfIPv6Addr[i]);
break;
case IPV6_ADDR_SCOPE_GLOBAL:
- vos_mem_copy(&selfIPv6Addr[1], &ifp->addr.s6_addr,
+ vos_mem_copy(selfIPv6Addr[i], &ifp->addr.s6_addr,
sizeof(ifp->addr.s6_addr));
- selfIPv6AddrValid[1] = SIR_IPV6_ADDR_VALID;
+ selfIPv6AddrValid[i] = SIR_IPV6_ADDR_VALID;
hddLog (VOS_TRACE_LEVEL_INFO,
- "Found IPV6_ADDR_SCOPE_GLOBAL Address : %pI6",
- selfIPv6Addr[1]);
+ FL("Found IPV6_ADDR_SCOPE_GLOBAL Address : %pI6"),
+ selfIPv6Addr[i]);
break;
default:
- hddLog(LOGE, "The Scope %d is not supported",
- ipv6_addr_src_scope(&ifp->addr));
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ FL("The Scope %d is not supported"),
+ ipv6_addr_src_scope(&ifp->addr));
+ }
+ if (selfIPv6AddrValid[i] == SIR_IPV6_ADDR_VALID)
+ {
+ i++;
}
-
}
- //read_unlock_bh(&in6_dev->lock);
+
vos_mem_zero(&offLoadRequest, sizeof(offLoadRequest));
- for (i =0; i<SIR_MAC_NUM_TARGET_IPV6_NS_OFFLOAD_NA; i++)
+ for (i =0; i < slot_index; i++)
{
if (selfIPv6AddrValid[i])
{
@@ -629,32 +779,40 @@ void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, v_BOOL_t fenable)
offLoadRequest.nsOffloadInfo.selfIPv6Addr[1] = 0x02;
offLoadRequest.nsOffloadInfo.selfIPv6Addr[11] = 0x01;
offLoadRequest.nsOffloadInfo.selfIPv6Addr[12] = 0xFF;
- offLoadRequest.nsOffloadInfo.selfIPv6Addr[13] = selfIPv6Addr[i][13];
- offLoadRequest.nsOffloadInfo.selfIPv6Addr[14] = selfIPv6Addr[i][14];
- offLoadRequest.nsOffloadInfo.selfIPv6Addr[15] = selfIPv6Addr[i][15];
+ offLoadRequest.nsOffloadInfo.selfIPv6Addr[13] =
+ selfIPv6Addr[i][13];
+ offLoadRequest.nsOffloadInfo.selfIPv6Addr[14] =
+ selfIPv6Addr[i][14];
+ offLoadRequest.nsOffloadInfo.selfIPv6Addr[15] =
+ selfIPv6Addr[i][15];
offLoadRequest.nsOffloadInfo.slotIdx = i;
vos_mem_copy(&offLoadRequest.nsOffloadInfo.targetIPv6Addr[0],
- &selfIPv6Addr[i][0], sizeof(tANI_U8)*SIR_MAC_IPV6_ADDR_LEN);
+ selfIPv6Addr[i], sizeof(tANI_U8)*SIR_MAC_IPV6_ADDR_LEN);
vos_mem_copy(&offLoadRequest.nsOffloadInfo.selfMacAddr,
&pAdapter->macAddressCurrent.bytes,
sizeof(tANI_U8)*SIR_MAC_ADDR_LEN);
- offLoadRequest.nsOffloadInfo.targetIPv6AddrValid[0] = SIR_IPV6_ADDR_VALID;
+ offLoadRequest.nsOffloadInfo.targetIPv6AddrValid[0] =
+ SIR_IPV6_ADDR_VALID;
offLoadRequest.offloadType = SIR_IPV6_NS_OFFLOAD;
offLoadRequest.enableOrDisable = SIR_OFFLOAD_ENABLE;
hddLog (VOS_TRACE_LEVEL_INFO,
- "configuredMcastBcastFilter: %d",pHddCtx->configuredMcastBcastFilter);
+ FL("configuredMcastBcastFilter: %d"
+ "NSOffload Slot = %d"),
+ pHddCtx->configuredMcastBcastFilter, i);
if ((VOS_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_MCASTBCASTFILTER_FILTER_ALL_MULTICAST_BROADCAST ==
+ pHddCtx->sus_res_mcastbcast_filter))
+ && (!pHddCtx->cfg_ini->fEnableMCAddrList))
{
hddLog (VOS_TRACE_LEVEL_INFO,
- "Set offLoadRequest with SIR_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE \n", __func__);
+ FL("Set offLoadRequest with"
+ "SIR_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE"));
offLoadRequest.enableOrDisable =
SIR_OFFLOAD_NS_AND_MCAST_FILTER_ENABLE;
}
@@ -664,45 +822,87 @@ void hdd_conf_ns_offload(hdd_adapter_t *pAdapter, v_BOOL_t fenable)
sizeof(tANI_U8)*SIR_MAC_IPV6_ADDR_LEN);
hddLog (VOS_TRACE_LEVEL_INFO,
- "Setting NSOffload with solicitedIp: %pI6, targetIp: %pI6",
+ FL("Setting NSOffload with solicitedIp: %pI6,"
+ "targetIp: %pI6"),
offLoadRequest.nsOffloadInfo.selfIPv6Addr,
offLoadRequest.nsOffloadInfo.targetIPv6Addr[0]);
//Configure the Firmware with this
- returnStatus = sme_SetHostOffload(WLAN_HDD_GET_HAL_CTX(pAdapter),
+ returnStatus = sme_SetHostOffload(halHandle,
pAdapter->sessionId, &offLoadRequest);
if(eHAL_STATUS_SUCCESS != returnStatus)
{
hddLog(VOS_TRACE_LEVEL_ERROR,
- FL("Failed to enable HostOffload feature with status: %d"),
- returnStatus);
+ FL("Failed to enable HostOffload feature with"
+ " status: %d"), returnStatus);
}
vos_mem_zero(&offLoadRequest, sizeof(offLoadRequest));
}
}
+ if (fenable == 1 && !pAdapter->ipv6_notifier_registered)
+ {
+ // Register IPv6 notifier to notify if any change in IP
+ // So that we can reconfigure the offload parameters
+ pAdapter->ipv6_notifier.notifier_call =
+ wlan_hdd_ipv6_changed;
+ ret = register_inet6addr_notifier(&pAdapter->ipv6_notifier);
+ if (ret)
+ {
+ hddLog(LOGE, FL("Failed to register IPv6 notifier"));
+ }
+ else
+ {
+ hddLog(LOG1, FL("Registered IPv6 notifier"));
+ pAdapter->ipv6_notifier_registered = true;
+ }
+ }
}
else
{
hddLog(VOS_TRACE_LEVEL_ERROR,
FL("IPv6 dev does not exist. Failed to request NSOffload"));
- return;
+ goto end;
}
}
else
{
//Disable NSOffload
+ if (pAdapter->ipv6_notifier_registered)
+ {
+ hddLog(LOG1, FL("Unregistered IPv6 notifier"));
+ unregister_inet6addr_notifier(&pAdapter->ipv6_notifier);
+ pAdapter->ipv6_notifier_registered = false;
+ }
vos_mem_zero((void *)&offLoadRequest, sizeof(tSirHostOffloadReq));
offLoadRequest.enableOrDisable = SIR_OFFLOAD_DISABLE;
offLoadRequest.offloadType = SIR_IPV6_NS_OFFLOAD;
- if (eHAL_STATUS_SUCCESS !=
+ for (i = 0; i < slot_index; i++)
+ {
+ hddLog(VOS_TRACE_LEVEL_INFO, FL("Disable Slot= %d"), i);
+ offLoadRequest.nsOffloadInfo.slotIdx = i;
+ if (eHAL_STATUS_SUCCESS !=
sme_SetHostOffload(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId, &offLoadRequest))
- {
- hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failure to disable"
- "NSOffload feature"));
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, FL("Failure to disable"
+ " %d Slot"), i);
+ }
}
}
+end:
+ while (slot > 0 && selfIPv6Addr[--slot])
+ {
+ vos_mem_free(selfIPv6Addr[slot]);
+ }
+ if (selfIPv6Addr)
+ {
+ vos_mem_free(selfIPv6Addr);
+ }
+ if (selfIPv6AddrValid)
+ {
+ vos_mem_free(selfIPv6AddrValid);
+ }
return;
}
#endif
@@ -905,19 +1105,11 @@ static void hdd_conf_suspend_ind(hdd_context_t* pHddCtx,
wlanSuspendParam->configuredMcstBcstFilterSetting = pHddCtx->configuredMcastBcastFilter;
#ifdef WLAN_FEATURE_PACKET_FILTERING
- if (pHddCtx->cfg_ini->isMcAddrListFilter)
- {
- /*Multicast addr list filter is enabled during suspend*/
- 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))
- {
- /*set the filter*/
- wlan_hdd_set_mc_addr_list(pAdapter, TRUE);
- }
- }
+ /* During suspend, configure MC Addr list filter to the firmware
+ * function takes care of checking necessary conditions before
+ * configuring.
+ */
+ wlan_hdd_set_mc_addr_list(pAdapter, TRUE);
#endif
}
@@ -972,16 +1164,10 @@ static void hdd_conf_resume_ind(hdd_adapter_t *pAdapter)
#ifdef WLAN_FEATURE_PACKET_FILTERING
- if (pHddCtx->cfg_ini->isMcAddrListFilter)
- {
- /*Multicast addr filtering is enabled*/
- if (pAdapter->mc_addr_list.isFilterApplied)
- {
- /*Filter applied during suspend mode*/
- /*Clear it here*/
- wlan_hdd_set_mc_addr_list(pAdapter, FALSE);
- }
- }
+ /* Filer was applied during suspend inditication
+ * clear it when we resume.
+ */
+ wlan_hdd_set_mc_addr_list(pAdapter, FALSE);
#endif
}
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c
index 5a53219454d..0330179741c 100755
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c
@@ -101,6 +101,8 @@
#include <bapInternal.h>
#endif // WLAN_BTAMP_FEATURE
+#include <linux/inetdevice.h>
+#include <net/addrconf.h>
#include <linux/wireless.h>
#include <net/cfg80211.h>
#include "wlan_hdd_cfg80211.h"
@@ -195,7 +197,6 @@ static void hdd_set_multicast_list(struct net_device *dev);
#endif
void hdd_wlan_initial_scan(hdd_adapter_t *pAdapter);
-int isWDresetInProgress(void);
extern int hdd_setBand_helper(struct net_device *dev, tANI_U8* ptr);
#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
@@ -226,9 +227,6 @@ static int hdd_netdev_notifier_call(struct notifier_block * nb,
(strncmp(dev->name, "p2p", 3)))
return NOTIFY_DONE;
- if (isWDresetInProgress())
- return NOTIFY_DONE;
-
if (!dev->ieee80211_ptr)
return NOTIFY_DONE;
@@ -247,6 +245,9 @@ static int hdd_netdev_notifier_call(struct notifier_block * nb,
return NOTIFY_DONE;
}
+ if (pHddCtx->isLogpInProgress)
+ return NOTIFY_DONE;
+
hddLog(VOS_TRACE_LEVEL_INFO, "%s: %s New Net Device State = %lu",
__func__, dev->name, state);
@@ -3770,6 +3771,11 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
hdd_deinit_adapter(pHddCtx, pAdapter);
goto err_free_netdev;
}
+
+#ifdef WLAN_NS_OFFLOAD
+ // Workqueue which gets scheduled in IPv6 notification callback.
+ INIT_WORK(&pAdapter->ipv6NotifierWorkQueue, hdd_ipv6_notifier_work_queue);
+#endif
//Stop the Interface TX queue.
netif_tx_disable(pAdapter->dev);
//netif_tx_disable(pWlanDev);
@@ -3863,7 +3869,6 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
}
}
-
if( VOS_STATUS_SUCCESS == status )
{
//Add it to the hdd's session list.
@@ -4060,6 +4065,17 @@ VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter )
{
hdd_abort_mac_scan(pHddCtx);
}
+#ifdef WLAN_NS_OFFLOAD
+#ifdef WLAN_OPEN_SOURCE
+ cancel_work_sync(&pAdapter->ipv6NotifierWorkQueue);
+#endif
+ if (pAdapter->ipv6_notifier_registered)
+ {
+ hddLog(LOG1, FL("Unregistered IPv6 notifier"));
+ unregister_inet6addr_notifier(&pAdapter->ipv6_notifier);
+ pAdapter->ipv6_notifier_registered = false;
+ }
+#endif
if (test_bit(SME_SESSION_OPENED, &pAdapter->event_flags))
{
@@ -6277,7 +6293,7 @@ static void hdd_driver_exit(void)
}
else
{
- while(isWDresetInProgress()) {
+ while(pHddCtx->isLogpInProgress) {
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
"%s:SSR in Progress; block rmmod for 1 second!!!", __func__);
msleep(1000);
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c
index 3f5fbd3257b..7f00efce5f9 100644
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_scan.c
@@ -740,10 +740,20 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
memcpy( pHddCtx->scan_info.scanAddIE.addIEdata, pwextBuf->genIE.addIEdata,
pwextBuf->genIE.length );
pHddCtx->scan_info.scanAddIE.length = pwextBuf->genIE.length;
-
- pwextBuf->roamProfile.pAddIEScan = pHddCtx->scan_info.scanAddIE.addIEdata;
- pwextBuf->roamProfile.nAddIEScanLength = pHddCtx->scan_info.scanAddIE.length;
-
+ /* Maximum length of each IE is SIR_MAC_MAX_IE_LENGTH */
+ if (SIR_MAC_MAX_IE_LENGTH >= pwextBuf->genIE.length)
+ {
+ memcpy( pwextBuf->roamProfile.addIEScan,
+ pHddCtx->scan_info.scanAddIE.addIEdata,
+ pHddCtx->scan_info.scanAddIE.length);
+ pwextBuf->roamProfile.nAddIEScanLength =
+ pHddCtx->scan_info.scanAddIE.length;
+ }
+ else
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "Invalid ScanIE, Length is %d", pwextBuf->genIE.length);
+ }
/* clear previous genIE after use it */
memset( &pwextBuf->genIE, 0, sizeof(pwextBuf->genIE) );
}
@@ -1121,10 +1131,20 @@ int iw_set_cscan(struct net_device *dev, struct iw_request_info *info,
memcpy( pHddCtx->scan_info.scanAddIE.addIEdata, pwextBuf->genIE.addIEdata,
pwextBuf->genIE.length );
pHddCtx->scan_info.scanAddIE.length = pwextBuf->genIE.length;
-
- pwextBuf->roamProfile.pAddIEScan = pHddCtx->scan_info.scanAddIE.addIEdata;
- pwextBuf->roamProfile.nAddIEScanLength = pHddCtx->scan_info.scanAddIE.length;
-
+ if (SIR_MAC_MAX_IE_LENGTH >= pwextBuf->genIE.length)
+ {
+ memcpy( pwextBuf->roamProfile.addIEScan,
+ pHddCtx->scan_info.scanAddIE.addIEdata,
+ pHddCtx->scan_info.scanAddIE.length);
+ pwextBuf->roamProfile.nAddIEScanLength =
+ pHddCtx->scan_info.scanAddIE.length;
+ }
+ else
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "Invalid ScanIE, Length is %d",
+ pwextBuf->genIE.length);
+ }
/* clear previous genIE after use it */
memset( &pwextBuf->genIE, 0, sizeof(pwextBuf->genIE) );
}
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
index 543a3273171..964ed65bebd 100644
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c
@@ -908,8 +908,8 @@ void hdd_clearRoamProfileIe( hdd_adapter_t *pAdapter)
pWextState->roamProfile.pRSNReqIE = (tANI_U8 *)NULL;
pWextState->roamProfile.bWPSAssociation = VOS_FALSE;
- pWextState->roamProfile.pAddIEScan = (tANI_U8 *)NULL;
pWextState->roamProfile.nAddIEScanLength = 0;
+ memset(pWextState->roamProfile.addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH+2);
pWextState->roamProfile.pAddIEAssoc = (tANI_U8 *)NULL;
pWextState->roamProfile.nAddIEAssocLength = 0;
@@ -5743,43 +5743,87 @@ int wlan_hdd_setIPv6Filter(hdd_context_t *pHddCtx, tANI_U8 filterType,
void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, v_U8_t set)
{
- v_U8_t filterAction;
- tPacketFilterCfg request;
v_U8_t i;
- hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
+ tpSirRcvFltMcAddrList pMulticastAddrs = NULL;
+ tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
+ hdd_context_t* pHddCtx = (hdd_context_t*)pAdapter->pHddCtx;
- filterAction = set ? HDD_RCV_FILTER_SET : HDD_RCV_FILTER_CLEAR;
+ if (NULL == hHal)
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, FL("HAL Handle is NULL"));
+ return;
+ }
+ if (NULL == pHddCtx)
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD CTX is NULL"));
+ return;
+ }
- /*set mulitcast addr list*/
- for (i = 0; i < pAdapter->mc_addr_list.mc_cnt; i++)
+ /* Check if INI is enabled or not, other wise just return
+ */
+ if (pHddCtx->cfg_ini->fEnableMCAddrList)
{
- memset(&request, 0, sizeof (tPacketFilterCfg));
- request.filterAction = filterAction;
- request.filterId = i;
+ pMulticastAddrs = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList));
+ if (NULL == pMulticastAddrs)
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, FL("Could not allocate Memory"));
+ return;
+ }
+
if (set)
{
- request.numParams = 1;
- request.paramsData[0].protocolLayer = HDD_FILTER_PROTO_TYPE_MAC;
- request.paramsData[0].cmpFlag = HDD_FILTER_CMP_TYPE_EQUAL;
- request.paramsData[0].dataOffset = WLAN_HDD_80211_FRM_DA_OFFSET;
- request.paramsData[0].dataLength = ETH_ALEN;
- memcpy(&(request.paramsData[0].compareData[0]),
- &(pAdapter->mc_addr_list.addr[i][0]), ETH_ALEN);
- /*set mulitcast filters*/
- hddLog(VOS_TRACE_LEVEL_INFO,
- "%s: %s multicast filter: addr ="
- MAC_ADDRESS_STR,
- __func__, set ? "setting" : "clearing",
- MAC_ADDR_ARRAY(request.paramsData[0].compareData));
+ /* Following pre-conditions should be satisfied before wei
+ * 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][0]),
+ &(pAdapter->mc_addr_list.addr[i][0]),
+ sizeof(pAdapter->mc_addr_list.addr[i]));
+ hddLog(VOS_TRACE_LEVEL_INFO,
+ "%s: %s multicast filter: addr ="
+ MAC_ADDRESS_STR,
+ __func__, set ? "setting" : "clearing",
+ MAC_ADDR_ARRAY(pMulticastAddrs->multicastAddr[i]));
+ }
+ /* Set multicast filter */
+ sme_8023MulticastList(hHal, pAdapter->sessionId,
+ pMulticastAddrs);
+ }
+ }
+ else
+ {
+ /* Need to clear only if it was previously configured
+ */
+ if (pAdapter->mc_addr_list.isFilterApplied)
+ {
+ pMulticastAddrs->ulMulticastAddrCnt = 0;
+ sme_8023MulticastList(hHal, pAdapter->sessionId,
+ pMulticastAddrs);
+ }
+
}
- wlan_hdd_set_filter(pHddCtx, &request, pAdapter->sessionId);
+ pAdapter->mc_addr_list.isFilterApplied = set ? TRUE : FALSE;
}
- pAdapter->mc_addr_list.isFilterApplied = set ? TRUE : FALSE;
+ else
+ {
+ hddLog(VOS_TRACE_LEVEL_INFO,
+ FL("fEnableMCAddrList is not enabled in INI"));
+ }
+ return;
}
static int iw_set_packet_filter_params(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);
tpPacketFilterCfg pRequest = (tpPacketFilterCfg)wrqu->data.pointer;
diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c
index 5992c6ead7c..d8a880286bf 100644
--- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c
+++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wmm.c
@@ -81,6 +81,7 @@
#include <linux/semaphore.h>
#include <wlan_hdd_hostapd.h>
#include <wlan_hdd_softap_tx_rx.h>
+#include <vos_sched.h>
// change logging behavior based upon debug flag
#ifdef HDD_WMM_DEBUG
@@ -1813,6 +1814,14 @@ v_U16_t hdd_wmm_select_queue(struct net_device * dev, struct sk_buff *skb)
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ if (isWDresetInProgress())
+ {
+ VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
+ FL("called during WDReset"));
+ skb->priority = SME_QOS_WMM_UP_BE;
+ return HDD_LINUX_AC_BE;
+ }
+
// if we don't want QoS or the AP doesn't support Qos
// All traffic will get equal opportuniy to transmit data frames.
if( hdd_wmm_is_active(pAdapter) ) {
diff --git a/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h b/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h
index 50398427319..7bc4959e549 100644
--- a/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h
+++ b/drivers/staging/prima/CORE/MAC/inc/qwlan_version.h
@@ -60,9 +60,9 @@ BRIEF DESCRIPTION:
#define QWLAN_VERSION_MINOR 2
#define QWLAN_VERSION_PATCH 3
#define QWLAN_VERSION_EXTRA ""
-#define QWLAN_VERSION_BUILD 13
+#define QWLAN_VERSION_BUILD 18
-#define QWLAN_VERSIONSTR "3.2.3.13"
+#define QWLAN_VERSIONSTR "3.2.3.18"
#endif /* QWLAN_VERSION_H */
diff --git a/drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h b/drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h
index 615ff731050..fcf8f83c684 100644
--- a/drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h
+++ b/drivers/staging/prima/CORE/MAC/inc/wniCfgAp.h
@@ -360,6 +360,8 @@
#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED 295
#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP 296
#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT 297
+#define WNI_CFG_RA_FILTER_ENABLE 298
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL 299
/*
* String parameter lengths
@@ -2486,10 +2488,26 @@
#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_APMAX 255
#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_APDEF 3
-#define CFG_PARAM_MAX_NUM 298
-#define CFG_AP_IBUF_MAX_SIZE 237
+#define WNI_CFG_RA_FILTER_ENABLE_STAMIN 0
+#define WNI_CFG_RA_FILTER_ENABLE_STAMAX 1
+#define WNI_CFG_RA_FILTER_ENABLE_STADEF 1
+
+#define WNI_CFG_RA_FILTER_ENABLE_APMIN 0
+#define WNI_CFG_RA_FILTER_ENABLE_APMAX 1
+#define WNI_CFG_RA_FILTER_ENABLE_APDEF 1
+
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMIN 0
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMAX 60
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STADEF 60
+
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_APMIN 0
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_APMAX 60
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_APDEF 60
+
+#define CFG_PARAM_MAX_NUM 300
+#define CFG_AP_IBUF_MAX_SIZE 239
#define CFG_AP_SBUF_MAX_SIZE 3422
-#define CFG_STA_IBUF_MAX_SIZE 232
+#define CFG_STA_IBUF_MAX_SIZE 234
#define CFG_STA_SBUF_MAX_SIZE 3388
#define CFG_SEM_MAX_NUM 19
diff --git a/drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h b/drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h
index 4d1e31a012d..caa5a0099e2 100644
--- a/drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h
+++ b/drivers/staging/prima/CORE/MAC/inc/wniCfgSta.h
@@ -354,6 +354,8 @@
#define WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED 295
#define WNI_CFG_DISABLE_LDPC_WITH_TXBF_AP 296
#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT 297
+#define WNI_CFG_RA_FILTER_ENABLE 298
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL 299
/*
* String parameter lengths
@@ -1615,8 +1617,16 @@
#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STAMAX 255
#define WNI_CFG_AP_LINK_MONITOR_TIMEOUT_STADEF 3
-#define CFG_PARAM_MAX_NUM 298
-#define CFG_STA_IBUF_MAX_SIZE 232
+#define WNI_CFG_RA_FILTER_ENABLE_STAMIN 0
+#define WNI_CFG_RA_FILTER_ENABLE_STAMAX 1
+#define WNI_CFG_RA_FILTER_ENABLE_STADEF 1
+
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMIN 0
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STAMAX 60
+#define WNI_CFG_RA_RATE_LIMIT_INTERVAL_STADEF 60
+
+#define CFG_PARAM_MAX_NUM 300
+#define CFG_STA_IBUF_MAX_SIZE 234
#define CFG_STA_SBUF_MAX_SIZE 3388
#define CFG_SEM_MAX_NUM 19
diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgParamName.c b/drivers/staging/prima/CORE/MAC/src/cfg/cfgParamName.c
index c0db1a067af..81a01e6b482 100644
--- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgParamName.c
+++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgParamName.c
@@ -350,6 +350,8 @@ unsigned char *gCfgParamName[] = {
(unsigned char *)"ENABLE_MCC_ADAPTIVE_SCHED",
(unsigned char *)"DISABLE_LDPC_WITH_TXBF_AP",
(unsigned char *)"AP_LINK_MONITOR_TIMEOUT",
+ (unsigned char *)"RA_FILTER_ENABLE",
+ (unsigned char *)"RA_RATE_LIMIT_INTERVAL",
};
diff --git a/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt b/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt
index 7240b7db62f..e32ca7bcce4 100644
--- a/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt
+++ b/drivers/staging/prima/CORE/MAC/src/cfg/cfgUtil/cfg.txt
@@ -1,4 +1,4 @@
-/*
+ *
* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
@@ -17,7 +17,7 @@
* 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.
- */
+ *
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
@@ -4498,3 +4498,27 @@ HAL
V RW NP
HAL
1 255 3
+
+* RA filter enable/disable
+*
+WNI_CFG_RA_FILTER_ENABLE I 4 7
+V RW NP
+HAL
+0 1 1
+V RW NP
+HAL
+0 1 1
+*
+*
+
+* RA filter rate interval
+*
+WNI_CFG_RA_RATE_LIMIT_INTERVAL I 4 7
+V RW NP
+HAL
+0 60 60
+V RW NP
+HAL
+0 60 60
+*
+*
diff --git a/drivers/staging/prima/CORE/MAC/src/include/sirParams.h b/drivers/staging/prima/CORE/MAC/src/include/sirParams.h
index f539fb274f5..42144cf372b 100644
--- a/drivers/staging/prima/CORE/MAC/src/include/sirParams.h
+++ b/drivers/staging/prima/CORE/MAC/src/include/sirParams.h
@@ -97,6 +97,7 @@ typedef enum {
#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
WLAN_ROAM_SCAN_OFFLOAD = 23,
#endif
+ EXTENDED_NSOFFLOAD_SLOT = 24,
//MAX_FEATURE_SUPPORTED = 128
} placeHolderInCapBitmap;
diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
index bebfa11b842..c6ece4d95c9 100644
--- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
+++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
@@ -157,14 +157,9 @@ limProcessBeaconFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo,tpPESession ps
if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) ||
(pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE))
{
- //If we are scanning for P2P, only accept probe rsp
- if((pMac->lim.gLimHalScanState != eLIM_HAL_SCANNING_STATE) || (NULL == pMac->lim.gpLimMlmScanReq)
- || !pMac->lim.gpLimMlmScanReq->p2pSearch )
- {
- limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo,
- ((pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE) ? eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE),
- eANI_BOOLEAN_FALSE);
- }
+ limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo,
+ ((pMac->lim.gLimHalScanState == eLIM_HAL_SCANNING_STATE) ? eANI_BOOLEAN_TRUE : eANI_BOOLEAN_FALSE),
+ eANI_BOOLEAN_FALSE);
}
else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)
{
@@ -281,12 +276,8 @@ limProcessBeaconFrameNoSession(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo)
if ( (pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) ||
(pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) )
{
- //If we are scanning for P2P, only accept probe rsp
- if((pMac->lim.gLimHalScanState != eLIM_HAL_SCANNING_STATE) || (NULL == pMac->lim.gpLimMlmScanReq)
- || !pMac->lim.gpLimMlmScanReq->p2pSearch )
- {
- limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_FALSE);
- }
+ limCheckAndAddBssDescription(pMac, pBeacon, pRxPacketInfo,
+ eANI_BOOLEAN_TRUE, eANI_BOOLEAN_FALSE);
}
else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)
{
diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c
index abd96363fb0..4ce22cc09d3 100644
--- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c
+++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.c
@@ -139,14 +139,14 @@ limDeactivateMinChannelTimerDuringScan(tpAniSirGlobal pMac)
* @return None
*/
#if defined WLAN_FEATURE_VOWIFI
-void
+eHalStatus
limCollectBssDescription(tpAniSirGlobal pMac,
tSirBssDescription *pBssDescr,
tpSirProbeRespBeacon pBPR,
tANI_U8 *pRxPacketInfo,
tANI_U8 fScanning)
#else
-void
+eHalStatus
limCollectBssDescription(tpAniSirGlobal pMac,
tSirBssDescription *pBssDescr,
tpSirProbeRespBeacon pBPR,
@@ -165,6 +165,17 @@ limCollectBssDescription(tpAniSirGlobal pMac,
rxChannel = WDA_GET_RX_CH(pRxPacketInfo);
pBody = WDA_GET_RX_MPDU_DATA(pRxPacketInfo);
+ /**
+ * Drop all the beacons and probe response without P2P IE during P2P search
+ */
+ if (NULL != pMac->lim.gpLimMlmScanReq && pMac->lim.gpLimMlmScanReq->p2pSearch)
+ {
+ if (NULL == limGetP2pIEPtr(pMac, (pBody + SIR_MAC_B_PR_SSID_OFFSET), ieLen))
+ {
+ limLog( pMac, LOG3, MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pHdr->bssId));
+ return eHAL_STATUS_FAILURE;
+ }
+ }
/**
* Length of BSS desription is without length of
@@ -283,7 +294,7 @@ limCollectBssDescription(tpAniSirGlobal pMac,
pBssDescr->aniIndicator,
ieLen );
- return;
+ return eHAL_STATUS_SUCCESS;
} /*** end limCollectBssDescription() ***/
/**
@@ -497,11 +508,19 @@ limCheckAndAddBssDescription(tpAniSirGlobal pMac,
// In scan state, store scan result.
#if defined WLAN_FEATURE_VOWIFI
- limCollectBssDescription(pMac, &pBssDescr->bssDescription,
+ status = limCollectBssDescription(pMac, &pBssDescr->bssDescription,
pBPR, pRxPacketInfo, fScanning);
+ if (eHAL_STATUS_SUCCESS != status)
+ {
+ goto last;
+ }
#else
- limCollectBssDescription(pMac, &pBssDescr->bssDescription,
+ status = limCollectBssDescription(pMac, &pBssDescr->bssDescription,
pBPR, pRxPacketInfo);
+ if (eHAL_STATUS_SUCCESS != status)
+ {
+ goto last;
+ }
#endif
/* Calling dfsChannelList which will convert DFS channel
* to Active channel for x secs if this channel is DFS channel */
@@ -595,10 +614,12 @@ limCheckAndAddBssDescription(tpAniSirGlobal pMac,
}
}//(eANI_BOOLEAN_TRUE == fScanning)
+last:
if( eHAL_STATUS_SUCCESS != status )
{
palFreeMemory( pMac->hHdd, pBssDescr );
}
+ return;
} /****** end limCheckAndAddBssDescription() ******/
diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h
index b16147dd9a3..13aa8f4ec71 100644
--- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h
+++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limScanResultUtils.h
@@ -76,13 +76,13 @@ void limReInitLfrScanResults(tpAniSirGlobal);
tANI_U32 limDeactivateMinChannelTimerDuringScan(tpAniSirGlobal);
void limCheckAndAddBssDescription(tpAniSirGlobal, tpSirProbeRespBeacon, tANI_U8 *, tANI_BOOLEAN, tANI_U8);
#if defined WLAN_FEATURE_VOWIFI
-void limCollectBssDescription(tpAniSirGlobal,
+eHalStatus limCollectBssDescription(tpAniSirGlobal,
tSirBssDescription *,
tpSirProbeRespBeacon,
tANI_U8 *,
tANI_U8);
#else
-void limCollectBssDescription(tpAniSirGlobal,
+eHalStatus limCollectBssDescription(tpAniSirGlobal,
tSirBssDescription *,
tpSirProbeRespBeacon,
tANI_U8 *);
diff --git a/drivers/staging/prima/CORE/SME/inc/csrApi.h b/drivers/staging/prima/CORE/SME/inc/csrApi.h
index 9373f0231f5..05a240f868a 100644
--- a/drivers/staging/prima/CORE/SME/inc/csrApi.h
+++ b/drivers/staging/prima/CORE/SME/inc/csrApi.h
@@ -846,8 +846,13 @@ typedef struct tagCsrRoamProfile
tANI_U8 *pWAPIReqIE; //If not null, it has the IE byte stream for WAPI
#endif /* FEATURE_WLAN_WAPI */
- tANI_U32 nAddIEScanLength; //The byte count in the pAddIE for scan (at the time of join)
- tANI_U8 *pAddIEScan; //If not null, it has the IE byte stream for additional IE, which can be WSC IE and/or P2P IE
+ //The byte count in the pAddIE for scan (at the time of join)
+ tANI_U32 nAddIEScanLength;
+ /* Additional IE information.
+ * It has the IE byte stream for additional IE,
+ * which can be WSC IE and/or P2P IE
+ */
+ tANI_U8 addIEScan[SIR_MAC_MAX_IE_LENGTH+2]; //Additional IE information.
tANI_U32 nAddIEAssocLength; //The byte count in the pAddIE for assoc
tANI_U8 *pAddIEAssoc; //If not null, it has the IE byte stream for additional IE, which can be WSC IE and/or P2P IE
diff --git a/drivers/staging/prima/CORE/SME/inc/csrInternal.h b/drivers/staging/prima/CORE/SME/inc/csrInternal.h
index 366fa397ea3..91a8427afd6 100755
--- a/drivers/staging/prima/CORE/SME/inc/csrInternal.h
+++ b/drivers/staging/prima/CORE/SME/inc/csrInternal.h
@@ -883,8 +883,11 @@ typedef struct tagCsrRoamSession
tANI_U32 nWapiRspIeLength; //the byte count for pWapiRspIE
tANI_U8 *pWapiRspIE; //this contain the WAPI IE in beacon/probe rsp
#endif /* FEATURE_WLAN_WAPI */
- tANI_U32 nAddIEScanLength; //the byte count of pAddIeScanIE;
- tANI_U8 *pAddIEScan; //this contains the additional IE in (unicast) probe request at the time of join
+ tANI_U32 nAddIEScanLength; //length of addIeScan
+ /* This contains the additional IE in (unicast)
+ * probe request at the time of join
+ */
+ tANI_U8 addIEScan[SIR_MAC_MAX_IE_LENGTH+2];
tANI_U32 nAddIEAssocLength; //the byte count for pAddIeAssocIE
tANI_U8 *pAddIEAssoc; //this contains the additional IE in (re) assoc request
@@ -1109,10 +1112,6 @@ void csrScanSuspendIMPS( tpAniSirGlobal pMac );
void csrScanResumeIMPS( tpAniSirGlobal pMac );
eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
-// Getting the 5GHz Channel list
-eHalStatus csrGet5GChannels(tpAniSirGlobal pMac);
-// Getting the 2.4GHz Channel list
-eHalStatus csrGet24GChannels(tpAniSirGlobal pMac);
eHalStatus csrSetModifyProfileFields(tpAniSirGlobal pMac, tANI_U32 sessionId,
tCsrRoamModifyProfileFields *pModifyProfileFields);
diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c b/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c
index 5f5653b9700..40c08303551 100644
--- a/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c
+++ b/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c
@@ -1902,121 +1902,6 @@ eHalStatus csrIsValidChannel(tpAniSirGlobal pMac, tANI_U8 chnNum)
return status;
}
-eHalStatus csrGet5GChannels(tpAniSirGlobal pMac)
-{
- eHalStatus status = eHAL_STATUS_SUCCESS;
- tANI_U8 num20MHzChannelsFound = 0;
- VOS_STATUS vosStatus;
- tANI_U8 num40MHzChannelsFound = 0;
- tANI_U8 Index = 0;
- tANI_U8 channelList = 0;
-
- // Updating the defaultpower Table for changed Domain Id
- vosStatus = vos_nv_getChannelListWithPower( pMac->scan.defaultPowerTable, &num20MHzChannelsFound,
- pMac->scan.defaultPowerTable40MHz, &num40MHzChannelsFound);
-
- if ( (VOS_STATUS_SUCCESS != vosStatus) || (num20MHzChannelsFound == 0) )
- {
- smsLog( pMac, LOGE, FL("failed to get channels"));
- status = eHAL_STATUS_FAILURE;
- }
- else
- {
- if ( num20MHzChannelsFound > WNI_CFG_VALID_CHANNEL_LIST_LEN )
- {
- num20MHzChannelsFound = WNI_CFG_VALID_CHANNEL_LIST_LEN;
- }
-
- // Move the only 5GHZ channel list to the global data,
- // As 2.4GHZ list coming from the AP for the changed domain
- // structure -- this will be used as the scan list
- for(channelList = 0; channelList < WNI_CFG_VALID_CHANNEL_LIST_LEN; channelList++)
- {
- // If Channel is 5GHz just break the for loop
- if(!(pMac->scan.base20MHzChannels.channelList[ channelList ] > 0 && pMac->scan.base20MHzChannels.channelList[ channelList ] <= 14))
- break;
- }
- // Update the 5G channels from nv.bin
- for ( Index = 0; Index < num20MHzChannelsFound; Index++)
- {
- if(pMac->scan.defaultPowerTable[Index].chanId >= 36 && pMac->scan.defaultPowerTable[Index].chanId <= 165)
- {
- if(channelList < WNI_CFG_VALID_CHANNEL_LIST_LEN)
- {
- pMac->scan.base20MHzChannels.channelList[ channelList ] = pMac->scan.defaultPowerTable[Index].chanId;
- channelList++;
- }
- }
- }
-
- pMac->scan.numChannelsDefault = (num20MHzChannelsFound > channelList) ? num20MHzChannelsFound : channelList;
- pMac->scan.base20MHzChannels.numChannels = (num20MHzChannelsFound > channelList) ? num20MHzChannelsFound : channelList;
- // Filling the remaining index as Zero Just for causion
- for(Index = pMac->scan.base20MHzChannels.numChannels; Index < WNI_CFG_VALID_CHANNEL_LIST_LEN; Index++)
- pMac->scan.base20MHzChannels.channelList[ Index ] = 0;
- }
- return status;
-}
-
-eHalStatus csrGet24GChannels(tpAniSirGlobal pMac)
-{
- eHalStatus status = eHAL_STATUS_SUCCESS;
- tANI_U8 num20MHzChannelsFound = 0;
- VOS_STATUS vosStatus;
- tANI_U8 Index = 0;
- tANI_U8 num40MHzChannelsFound = 0;
- tANI_U8 channelList5GBackup[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}, nuum5GchannelListBackup;
- tANI_U8 channelList = 0;
-
- // Read the scan channel list (including the power limit) from EEPROM
- vosStatus = vos_nv_getChannelListWithPower( pMac->scan.defaultPowerTable, &num20MHzChannelsFound,
- pMac->scan.defaultPowerTable40MHz, &num40MHzChannelsFound);
-
- if ( (VOS_STATUS_SUCCESS != vosStatus) || (num20MHzChannelsFound == 0) )
- {
- smsLog( pMac, LOGE, FL("failed to get channels \n"));
- status = eHAL_STATUS_FAILURE;
- }
- else
- {
- if ( num20MHzChannelsFound > WNI_CFG_VALID_CHANNEL_LIST_LEN )
- {
- num20MHzChannelsFound = WNI_CFG_VALID_CHANNEL_LIST_LEN;
- }
-
- // Move the 2.4GHZ channel list only to the global data,
- // As 5GHz list been provided by AP as part of 11d IE
- // structure -- this will be used as the scan list
- for(channelList = 0, nuum5GchannelListBackup = 0; channelList < WNI_CFG_VALID_CHANNEL_LIST_LEN; channelList++)
- {
- if(pMac->scan.base20MHzChannels.channelList[ channelList ] >= 36 && pMac->scan.base20MHzChannels.channelList[ channelList ] <= 165)
- {
- // First taking the 5GHz channel list backup
- channelList5GBackup[nuum5GchannelListBackup] = pMac->scan.base20MHzChannels.channelList[ channelList ];
- nuum5GchannelListBackup++;
- }
- }
- // Updating the 2.4GHz list
- for ( Index = 0; Index < num20MHzChannelsFound; Index++)
- {
- if(pMac->scan.defaultPowerTable[Index].chanId > 0 && pMac->scan.defaultPowerTable[Index].chanId <= 14)
- pMac->scan.base20MHzChannels.channelList[ Index ] = pMac->scan.defaultPowerTable[Index].chanId;
- }
- // Restoring the Backed up 5 GHZ channels
- for(channelList = 0;channelList < nuum5GchannelListBackup; channelList++ )
- {
- if (Index < WNI_CFG_VALID_CHANNEL_LIST_LEN)
- {
- pMac->scan.base20MHzChannels.channelList[ Index ] = channelList5GBackup[channelList];
- Index++;
- }
- }
-
- pMac->scan.numChannelsDefault = (num20MHzChannelsFound > Index) ? num20MHzChannelsFound : Index;
- pMac->scan.base20MHzChannels.numChannels = (num20MHzChannelsFound > Index) ? num20MHzChannelsFound : Index;
- }
- return (status);
-}
eHalStatus csrInitGetChannels(tpAniSirGlobal pMac)
{
@@ -5745,15 +5630,19 @@ eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile,
#endif /* FEATURE_WLAN_WAPI */
if(pSrcProfile->nAddIEScanLength)
{
- status = palAllocateMemory(pMac->hHdd,
- (void **)&pDstProfile->pAddIEScan, pSrcProfile->nAddIEScanLength);
- if(!HAL_STATUS_SUCCESS(status))
+ memset(pDstProfile->addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH);
+ if ( SIR_MAC_MAX_IE_LENGTH >= pSrcProfile->nAddIEScanLength)
{
- break;
+ vos_mem_copy(pDstProfile->addIEScan, pSrcProfile->addIEScan,
+ pSrcProfile->nAddIEScanLength);
+ pDstProfile->nAddIEScanLength = pSrcProfile->nAddIEScanLength;
+ }
+ else
+ {
+ VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+ FL(" AddIEScanLength is not valid %u"),
+ pSrcProfile->nAddIEScanLength);
}
- pDstProfile->nAddIEScanLength = pSrcProfile->nAddIEScanLength;
- palCopyMemory(pMac->hHdd, pDstProfile->pAddIEScan, pSrcProfile->pAddIEScan,
- pSrcProfile->nAddIEScanLength);
}
if(pSrcProfile->nAddIEAssocLength)
{
@@ -6953,7 +6842,17 @@ void csrRoamReissueRoamCommand(tpAniSirGlobal pMac)
smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
return;
}
-
+
+ /* While switching between two AP, csr will reissue roam command again
+ to the nextbss if it was interrupted by the dissconnect req for the
+ previous bss.During this csr is incrementing bRefAssocStartCnt twice.
+ so reset the bRefAssocStartCnt.
+ */
+ if(pSession->bRefAssocStartCnt > 0)
+ {
+ pSession->bRefAssocStartCnt--;
+ }
+
if( pCommand->u.roamCmd.fStopWds )
{
palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
@@ -8630,7 +8529,6 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg )
tCsrRoamSession *pSession = NULL;
tpSirSmeSwitchChannelInd pSwitchChnInd;
tSmeMaxAssocInd *pSmeMaxAssocInd;
- tSmeCmd pCommand;
pSirMsg->messageType = (pSirMsg->messageType);
pSirMsg->length = (pSirMsg->length);
pSirMsg->statusCode = (pSirMsg->statusCode);
@@ -8712,77 +8610,105 @@ void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg )
}
break;
case eWNI_SME_DISASSOC_IND:
- smsLog( pMac, LOGE, FL("DISASSOCIATION Indication from MAC"));
- // Check if AP dis-associated us because of MIC failure. If so,
- // then we need to take action immediately and not wait till the
- // the WmStatusChange requests is pushed and processed
- pDisassocInd = (tSirSmeDisassocInd *)pSirMsg;
- status = csrRoamGetSessionIdFromBSSID( pMac, (tCsrBssid *)pDisassocInd->bssId, &sessionId );
- if( HAL_STATUS_SUCCESS( status ) )
{
- // If we are in neighbor preauth done state then on receiving
- // disassoc or deauth we dont roam instead we just disassoc
- // from current ap and then go to disconnected state
- // This happens for CCX and 11r FT connections ONLY.
-#ifdef WLAN_FEATURE_VOWIFI_11R
- if (csrRoamIs11rAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac)))
+ // Check if AP dis-associated us because of MIC failure. If so,
+ // then we need to take action immediately and not wait till the
+ // the WmStatusChange requests is pushed and processed
+ tSmeCmd *pCommand;
+
+ pDisassocInd = (tSirSmeDisassocInd *)pSirMsg;
+ status = csrRoamGetSessionIdFromBSSID( pMac,
+ (tCsrBssid *)pDisassocInd->bssId, &sessionId );
+ if( HAL_STATUS_SUCCESS( status ) )
{
- csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
- }
+ smsLog( pMac, LOGE, FL("DISASSOCIATION Indication from MAC"
+ " for session %d "), sessionId);
+ smsLog( pMac, LOGE, FL("DISASSOCIATION from peer ="
+ MAC_ADDRESS_STR " "
+ " reason = %d status = %d "),
+ MAC_ADDR_ARRAY(pDisassocInd->peerMacAddr),
+ pDisassocInd->reasonCode,
+ pDisassocInd->statusCode);
+ // If we are in neighbor preauth done state then on receiving
+ // disassoc or deauth we dont roam instead we just disassoc
+ // from current ap and then go to disconnected state
+ // This happens for CCX and 11r FT connections ONLY.
+#ifdef WLAN_FEATURE_VOWIFI_11R
+ if (csrRoamIs11rAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac)))
+ {
+ csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
+ }
#endif
#ifdef FEATURE_WLAN_CCX
- if (csrRoamIsCCXAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac)))
- {
- csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
- }
+ if (csrRoamIsCCXAssoc(pMac) && (csrNeighborRoamStatePreauthDone(pMac)))
+ {
+ csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
+ }
#endif
#ifdef FEATURE_WLAN_LFR
- if (csrRoamIsFastRoamEnabled(pMac, sessionId) && (csrNeighborRoamStatePreauthDone(pMac)))
- {
- csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
- }
+ if (csrRoamIsFastRoamEnabled(pMac, sessionId) && (csrNeighborRoamStatePreauthDone(pMac)))
+ {
+ csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
+ }
#endif
- pSession = CSR_GET_SESSION( pMac, sessionId );
+ pSession = CSR_GET_SESSION( pMac, sessionId );
- if(!pSession)
- {
- smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
- return;
- }
+ if (!pSession)
+ {
+ smsLog(pMac, LOGE, FL(" session %d not found "), sessionId);
+ return;
+ }
- if ( csrIsConnStateInfra( pMac, sessionId ) )
- {
- pSession->connectState = eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
- }
+ if ( csrIsConnStateInfra( pMac, sessionId ) )
+ {
+ pSession->connectState = eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
+ }
#ifndef WLAN_MDM_CODE_REDUCTION_OPT
- sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, SME_QOS_CSR_DISCONNECT_IND, NULL);
+ sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, SME_QOS_CSR_DISCONNECT_IND, NULL);
#endif
- csrRoamLinkDown(pMac, sessionId);
- csrRoamIssueWmStatusChange( pMac, sessionId, eCsrDisassociated, pSirMsg );
- if(CSR_IS_INFRA_AP(&pSession->connectedProfile))
- {
-
- pRoamInfo = &roamInfo;
+ csrRoamLinkDown(pMac, sessionId);
+ csrRoamIssueWmStatusChange( pMac, sessionId, eCsrDisassociated, pSirMsg );
+ if (CSR_IS_INFRA_AP(&pSession->connectedProfile))
+ {
- pRoamInfo->statusCode = pDisassocInd->statusCode;
- pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
+ pCommand = csrGetCommandBuffer(pMac);
+ if (NULL == pCommand)
+ {
+ smsLog( pMac, LOGE, FL(" fail to get command buffer") );
+ status = eHAL_STATUS_RESOURCES;
+ }
+ pRoamInfo = &roamInfo;
+ pRoamInfo->statusCode = pDisassocInd->statusCode;
+ pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
+ pRoamInfo->staId = (tANI_U8)pDisassocInd->staId;
- pRoamInfo->staId = (tANI_U8)pDisassocInd->staId;
+ vos_mem_copy(pRoamInfo->peerMac, pDisassocInd->peerMacAddr,
+ sizeof(tSirMacAddr));
+ vos_mem_copy(&pRoamInfo->bssid, pDisassocInd->bssId,
+ sizeof(tCsrBssid));
- palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pDisassocInd->peerMacAddr, sizeof(tSirMacAddr));
- palCopyMemory(pMac->hHdd, &pRoamInfo->bssid, pDisassocInd->bssId, sizeof(tCsrBssid));
+ status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0,
+ eCSR_ROAM_INFRA_IND, eCSR_ROAM_RESULT_DISASSOC_IND);
- status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_INFRA_IND, eCSR_ROAM_RESULT_DISASSOC_IND);
+ /*
+ * STA/P2P client got disassociated so remove any pending deauth
+ * commands in sme pending list
+ */
+ pCommand->command = eSmeCommandRoam;
+ pCommand->sessionId = (tANI_U8)sessionId;
+ pCommand->u.roamCmd.roamReason = eCsrForcedDeauthSta;
+ vos_mem_copy(pCommand->u.roamCmd.peerMac,
+ pDisassocInd->peerMacAddr,
+ sizeof(tSirMacAddr));
+ csrRoamRemoveDuplicateCommand(pMac, sessionId, pCommand, eCsrForcedDeauthSta);
+ csrReleaseCommand( pMac, pCommand );
- /*
- * STA/P2P client got disassociated so remove any pending deauth
- * commands in sme pending list
- */
- pCommand.command = eSmeCommandRoam;
- pCommand.sessionId = (tANI_U8)sessionId;
- pCommand.u.roamCmd.roamReason = eCsrForcedDeauthSta;
- vos_mem_copy(pCommand.u.roamCmd.peerMac, pDisassocInd->peerMacAddr, sizeof(tSirMacAddr));
- csrRoamRemoveDuplicateCommand(pMac, sessionId, &pCommand, eCsrForcedDeauthSta);
+ }
+ }
+ else
+ {
+ smsLog(pMac, LOGE, FL(" Session Id not found for BSSID " MAC_ADDRESS_STR),
+ MAC_ADDR_ARRAY(pDisassocInd->bssId));
}
}
break;
@@ -12004,36 +11930,22 @@ eHalStatus csrSendJoinReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDe
}
#endif /* FEATURE_WLAN_CCX */
// addIEScan
- if(pProfile->nAddIEScanLength && pProfile->pAddIEScan)
+ if (pProfile->nAddIEScanLength)
{
ieLen = pProfile->nAddIEScanLength;
- if(ieLen > pSession->nAddIEScanLength)
- {
- if(pSession->pAddIEScan && pSession->nAddIEScanLength)
- {
- palFreeMemory(pMac->hHdd, pSession->pAddIEScan);
- }
- status = palAllocateMemory(pMac->hHdd,
- (void **)&pSession->pAddIEScan, ieLen);
- if(!HAL_STATUS_SUCCESS(status)) break;
- }
+ memset(pSession->addIEScan, 0 , pSession->nAddIEScanLength);
pSession->nAddIEScanLength = ieLen;
- palCopyMemory(pMac->hHdd, pSession->pAddIEScan,
- pProfile->pAddIEScan, ieLen);
+ vos_mem_copy(pSession->addIEScan, pProfile->addIEScan, ieLen);
wTmp = pal_cpu_to_be16( ieLen );
palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
pBuf += sizeof(tANI_U16);
- palCopyMemory( pMac->hHdd, pBuf, pProfile->pAddIEScan, ieLen );
+ vos_mem_copy(pBuf, pProfile->addIEScan, ieLen);
pBuf += ieLen;
}
else
{
+ memset(pSession->addIEScan, 0, pSession->nAddIEScanLength);
pSession->nAddIEScanLength = 0;
- if(pSession->pAddIEScan)
- {
- palFreeMemory(pMac->hHdd, pSession->pAddIEScan);
- pSession->pAddIEScan = NULL;
- }
*pBuf = 0;
*(pBuf + 1) = 0;
pBuf += 2;
@@ -13549,10 +13461,9 @@ static void csrInitSession( tpAniSirGlobal pMac, tANI_U32 sessionId )
}
pSession->nWapiRspIeLength = 0;
#endif /* FEATURE_WLAN_WAPI */
- if(pSession->pAddIEScan)
+ if (pSession->nAddIEScanLength)
{
- palFreeMemory(pMac->hHdd, pSession->pAddIEScan);
- pSession->pAddIEScan = NULL;
+ memset(pSession->addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH);
}
pSession->nAddIEScanLength = 0;
if(pSession->pAddIEAssoc)
diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c b/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c
index 839b1204379..ec7518752c6 100755
--- a/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c
+++ b/drivers/staging/prima/CORE/SME/src/csr/csrApiScan.c
@@ -3664,12 +3664,14 @@ void csrSetOppositeBandChannelInfo( tpAniSirGlobal pMac )
if ( CSR_IS_CHANNEL_5GHZ( pMac->scan.channelOf11dInfo ) )
{
// and the 2.4 band is empty, then populate the 2.4 channel info
+ if ( !csrLLIsListEmpty( &pMac->scan.channelPowerInfoList24, LL_ACCESS_LOCK ) ) break;
fPopulate5GBand = FALSE;
}
else
{
// else, we found channel info in the 2.4 GHz band. If the 5.0 band is empty
// set the 5.0 band info from the 2.4 country code.
+ if ( !csrLLIsListEmpty( &pMac->scan.channelPowerInfoList5G, LL_ACCESS_LOCK ) ) break;
fPopulate5GBand = TRUE;
}
csrSaveChannelPowerForBand( pMac, fPopulate5GBand );
@@ -3764,7 +3766,6 @@ void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pCh
tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription *pSirBssDesc,
tDot11fBeaconIEs *pIes, tANI_BOOLEAN fForce)
{
- tANI_U8 Num2GChannels, bMaxNumChn;
eHalStatus status;
tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
v_REGDOMAIN_t domainId;
@@ -3884,56 +3885,66 @@ tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription
}
}
smsLog(pMac, LOG3, FL(" %d sets each one is %d"), pIesLocal->Country.num_triplets, sizeof(tSirMacChanInfo));
- // save the channel/power information from the Channel IE.
- //sizeof(tSirMacChanInfo) has to be 3
- if (eHAL_STATUS_SUCCESS != csrSaveToChannelPower2G_5G( pMac, pIesLocal->Country.num_triplets * sizeof(tSirMacChanInfo),
- (tSirMacChanInfo *)(&pIesLocal->Country.triplets[0]) ))
+
+ // set the indicator of the channel where the country IE was found...
+ pMac->scan.channelOf11dInfo = pSirBssDesc->channelId;
+ status = csrGetRegulatoryDomainForCountry(pMac,
+ pIesLocal->Country.country, &domainId );
+ if ( status != eHAL_STATUS_SUCCESS )
{
+ smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainId );
fRet = eANI_BOOLEAN_FALSE;
return fRet;
}
-
- // set the indicator of the channel where the country IE was found...
- pMac->scan.channelOf11dInfo = pSirBssDesc->channelId;
- csrGetRegulatoryDomainForCountry(pMac, pIesLocal->Country.country, &domainId );
// Checking for Domain Id change
if ( domainId != pMac->scan.domainIdCurrent )
{
- tSirMacChanInfo* pMacChnSet = (tSirMacChanInfo *)(&pIesLocal->Country.triplets[0]);
- palCopyMemory( pMac->hHdd, pMac->scan.countryCode11d, pIesLocal->Country.country,
- sizeof( pMac->scan.countryCode11d ) );
+ vos_mem_copy(pMac->scan.countryCode11d,
+ pIesLocal->Country.country,
+ sizeof( pMac->scan.countryCode11d ) );
+ /* Set Current Country code and Current Regulatory domain */
+ status = csrSetRegulatoryDomain(pMac, domainId, NULL);
+ if (eHAL_STATUS_SUCCESS != status)
+ {
+ smsLog(pMac, LOGE, "Set Reg Domain Fail %d", status);
+ fRet = eANI_BOOLEAN_FALSE;
+ return fRet;
+ }
+ //csrSetRegulatoryDomain will fail if the country doesn't fit our domain criteria.
+ vos_mem_copy(pMac->scan.countryCodeCurrent,
+ pIesLocal->Country.country, WNI_CFG_COUNTRY_CODE_LEN);
+ //Simply set it to cfg.
csrSetCfgCountryCode(pMac, pIesLocal->Country.country);
- WDA_SetRegDomain(pMac, domainId);
- pMac->scan.domainIdCurrent = domainId;
- // Check whether AP provided the 2.4GHZ list or 5GHZ list
- if(CSR_IS_CHANNEL_24GHZ(pMacChnSet[0].firstChanNum))
+
+ /* overwrite the defualt country code */
+ vos_mem_copy(pMac->scan.countryCodeDefault,
+ pMac->scan.countryCodeCurrent,
+ WNI_CFG_COUNTRY_CODE_LEN);
+ /* Set Current RegDomain */
+ status = WDA_SetRegDomain(pMac, domainId);
+ if ( status != eHAL_STATUS_SUCCESS )
{
- // AP Provided the 2.4 Channels, Update the 5GHz channels from nv.bin
- csrGet5GChannels(pMac );
+ smsLog( pMac, LOGE, FL(" fail to Set regId %d"), domainId );
+ fRet = eANI_BOOLEAN_FALSE;
+ return fRet;
}
- else
+ /* set to default domain ID */
+ pMac->scan.domainIdCurrent = domainId;
+ /* get the channels based on new cc */
+ status = csrInitGetChannels( pMac );
+
+ if ( status != eHAL_STATUS_SUCCESS )
{
- // AP Provided the 5G Channels, Update the 2.4GHZ channel list from nv.bin
- csrGet24GChannels(pMac );
+ smsLog( pMac, LOGE, FL(" fail to get Channels "));
+ fRet = eANI_BOOLEAN_FALSE;
+ return fRet;
}
- }
- // Populate both band channel lists based on what we found in the country information...
- csrSetOppositeBandChannelInfo( pMac );
- bMaxNumChn = WNI_CFG_VALID_CHANNEL_LIST_LEN;
- // construct 2GHz channel list first
- csrConstructCurrentValidChannelList( pMac, &pMac->scan.channelPowerInfoList24, pMac->scan.channels11d.channelList,
- bMaxNumChn, &Num2GChannels );
- // construct 5GHz channel list now
- if(bMaxNumChn > Num2GChannels)
- {
- csrConstructCurrentValidChannelList( pMac, &pMac->scan.channelPowerInfoList5G, pMac->scan.channels11d.channelList + Num2GChannels,
- bMaxNumChn - Num2GChannels,
- &pMac->scan.channels11d.numChannels );
- }
- pMac->scan.channels11d.numChannels += Num2GChannels;
- fRet = eANI_BOOLEAN_TRUE;
+ /* reset info based on new cc, and we are done */
+ csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE);
+ fRet = eANI_BOOLEAN_TRUE;
+ }
} while( 0 );
if( !pIes && pIesLocal )
@@ -6774,7 +6785,7 @@ eHalStatus csrScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi
{
pScanCmd->u.scanCmd.u.scanRequest.p2pSearch = 1;
}
- if(pProfile->pAddIEScan)
+ if(pProfile->nAddIEScanLength)
{
status = palAllocateMemory(pMac->hHdd,
(void **)&pScanCmd->u.scanCmd.u.scanRequest.pIEField,
@@ -6782,7 +6793,7 @@ eHalStatus csrScanForSSID(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfi
palZeroMemory(pMac->hHdd, pScanCmd->u.scanCmd.u.scanRequest.pIEField, pProfile->nAddIEScanLength);
if(HAL_STATUS_SUCCESS(status))
{
- palCopyMemory(pMac->hHdd, pScanCmd->u.scanCmd.u.scanRequest.pIEField, pProfile->pAddIEScan, pProfile->nAddIEScanLength);
+ palCopyMemory(pMac->hHdd, pScanCmd->u.scanCmd.u.scanRequest.pIEField, pProfile->addIEScan, pProfile->nAddIEScanLength);
pScanCmd->u.scanCmd.u.scanRequest.uIEFieldLen = pProfile->nAddIEScanLength;
}
else
diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c b/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c
index a315822efb6..7e38dc47de4 100644
--- a/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c
+++ b/drivers/staging/prima/CORE/SME/src/csr/csrUtil.c
@@ -5759,11 +5759,10 @@ void csrReleaseProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile)
pProfile->pWAPIReqIE = NULL;
}
#endif /* FEATURE_WLAN_WAPI */
-
- if(pProfile->pAddIEScan)
+ if (pProfile->nAddIEScanLength)
{
- palFreeMemory(pMac->hHdd, pProfile->pAddIEScan);
- pProfile->pAddIEScan = NULL;
+ memset(pProfile->addIEScan, 0 , SIR_MAC_MAX_IE_LENGTH+2);
+ pProfile->nAddIEScanLength = 0;
}
if(pProfile->pAddIEAssoc)
diff --git a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c
index 1f50bc871f1..ccedacffa44 100755
--- a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c
+++ b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c
@@ -5960,6 +5960,11 @@ eHalStatus sme_PreferredNetworkFoundInd (tHalHandle hHal, void* pMsg)
smsLog(pMac, LOG2, "%s:SSID=%s frame length %d",
__func__, dumpSsId, pPrefNetworkFoundInd->frameLength);
+ /* Flush scan results, So as to avoid indication/updation of
+ * stale entries, which may not have aged out during APPS collapse
+ */
+ sme_ScanFlushResult(hHal,0);
+
//Save the frame to scan result
if (pPrefNetworkFoundInd->mesgLen > sizeof(tSirPrefNetworkFoundInd))
{
diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_sched.c b/drivers/staging/prima/CORE/VOSS/src/vos_sched.c
index cff46c48882..32c8a0ba875 100644
--- a/drivers/staging/prima/CORE/VOSS/src/vos_sched.c
+++ b/drivers/staging/prima/CORE/VOSS/src/vos_sched.c
@@ -626,7 +626,8 @@ VosMCThread
"%s: MC Thread exiting!!!!", __func__);
complete_and_exit(&pSchedContext->McShutdown, 0);
} /* VosMCThread() */
-int isWDresetInProgress(void)
+
+v_BOOL_t isWDresetInProgress(void)
{
VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
"%s: Reset is in Progress...",__func__);
@@ -636,7 +637,7 @@ int isWDresetInProgress(void)
}
else
{
- return 0;
+ return FALSE;
}
}
/*---------------------------------------------------------------------------
diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_sched.h b/drivers/staging/prima/CORE/VOSS/src/vos_sched.h
index 8426b2a3fb4..9bac9d4226e 100644
--- a/drivers/staging/prima/CORE/VOSS/src/vos_sched.h
+++ b/drivers/staging/prima/CORE/VOSS/src/vos_sched.h
@@ -504,5 +504,6 @@ void clearWlanResetReason(void);
void vos_timer_module_init( void );
VOS_STATUS vos_watchdog_wlan_shutdown(void);
VOS_STATUS vos_watchdog_wlan_re_init(void);
+v_BOOL_t isWDresetInProgress(void);
#endif // #if !defined __VOSS_SCHED_H
diff --git a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c
index 2ff8273ece0..f26d559cf84 100644
--- a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c
+++ b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c
@@ -1477,6 +1477,38 @@ VOS_STATUS WDA_prepareConfigTLV(v_PVOID_t pVosContext,
tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct
+ sizeof(tHalCfg) + tlvStruct->length) ;
+ /* QWLAN_HAL_CFG_RA_FILTER_ENABLE */
+ tlvStruct->type = QWLAN_HAL_CFG_RA_FILTER_ENABLE ;
+ tlvStruct->length = sizeof(tANI_U32);
+ configDataValue = (tANI_U32 *)(tlvStruct + 1);
+
+ if (wlan_cfgGetInt(pMac, WNI_CFG_RA_FILTER_ENABLE,
+ configDataValue ) != eSIR_SUCCESS)
+ {
+ VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+ "Failed to get value for WNI_CFG_RA_FILTER_ENABLE");
+ goto handle_failure;
+ }
+
+ tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct
+ + sizeof(tHalCfg) + tlvStruct->length) ;
+
+ /* QWLAN_HAL_CFG_RA_RATE_LIMIT_INTERVAL */
+ tlvStruct->type = QWLAN_HAL_CFG_RA_RATE_LIMIT_INTERVAL ;
+ tlvStruct->length = sizeof(tANI_U32);
+ configDataValue = (tANI_U32 *)(tlvStruct + 1);
+
+ if (wlan_cfgGetInt(pMac, WNI_CFG_RA_RATE_LIMIT_INTERVAL,
+ configDataValue ) != eSIR_SUCCESS)
+ {
+ VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+ "Failed to get value for WNI_CFG_RA_RATE_LIMIT_INTERVAL");
+ goto handle_failure;
+ }
+
+ tlvStruct = (tHalCfg *)( (tANI_U8 *) tlvStruct
+ + sizeof(tHalCfg) + tlvStruct->length) ;
+
wdiStartParams->usConfigBufferLen = (tANI_U8 *)tlvStruct - tlvStructStart ;
#ifdef WLAN_DEBUG
{
diff --git a/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat b/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat
index a5ee46c6abd..16ba06f087a 100644
--- a/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat
+++ b/drivers/staging/prima/firmware_bin/WCNSS_cfg.dat
Binary files differ
diff --git a/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini b/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini
index 8b32fbd0c1b..ae2894a18dd 100644
--- a/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini
+++ b/drivers/staging/prima/firmware_bin/WCNSS_qcom_cfg.ini
@@ -396,6 +396,20 @@ gRrmOperChanMax=8
gRrmNonOperChanMax=8
gRrmRandIntvl=100
+# TDLS Support
+gEnableTDLSSupport=1
+gEnableTDLSImplicitTrigger=1
+gTDLSExternalControl=1
+gTDLSTxStatsPeriod=500
+gTDLSTxPacketThreshold=10
+gTDLSDiscoveryPeriod=20000
+gTDLSMaxDiscoveryAttempt=5
+gTDLSIdleTimeout=40000
+gTDLSRssiHysteresis=100
+gTDLSRSSITriggerThreshold=-60
+gTDLSIdlePacketThreshold=5
+gTDLSRSSITeardownThreshold=-70
+
END
# Note: Configuration parser would not read anything past the END marker
diff --git a/drivers/staging/prima/riva/inc/wlan_hal_cfg.h b/drivers/staging/prima/riva/inc/wlan_hal_cfg.h
index c9a319c7756..899577e0b91 100644
--- a/drivers/staging/prima/riva/inc/wlan_hal_cfg.h
+++ b/drivers/staging/prima/riva/inc/wlan_hal_cfg.h
@@ -155,8 +155,9 @@
#define QWLAN_HAL_CFG_ENABLE_DETECT_PS_SUPPORT 101
#define QWLAN_HAL_CFG_AP_LINK_MONITOR_TIMEOUT 102
#define QWLAN_HAL_CFG_BTC_DWELL_TIME_MULTIPLIER 103
-#define QWLAN_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE 104
-#define QWLAN_HAL_CFG_MAX_PARAMS 105
+#define QWLAN_HAL_CFG_RA_FILTER_ENABLE 104
+#define QWLAN_HAL_CFG_RA_RATE_LIMIT_INTERVAL 105
+#define QWLAN_HAL_CFG_MAX_PARAMS 106
diff --git a/drivers/staging/prima/riva/inc/wlan_hal_msg.h b/drivers/staging/prima/riva/inc/wlan_hal_msg.h
index 3526e330cd2..ff26657ce95 100644
--- a/drivers/staging/prima/riva/inc/wlan_hal_msg.h
+++ b/drivers/staging/prima/riva/inc/wlan_hal_msg.h
@@ -5666,6 +5666,7 @@ typedef enum {
RATECTRL = 21,
WOW = 22,
WLAN_ROAM_SCAN_OFFLOAD = 23,
+ EXTENDED_NSOFFLOAD_SLOT = 24,
//MAX_FEATURE_SUPPORTED = 128
} placeHolderInCapBitmap;
diff --git a/drivers/usb/gadget/f_accessory.c b/drivers/usb/gadget/f_accessory.c
index 42a6c43aaf1..61fd736bebb 100644
--- a/drivers/usb/gadget/f_accessory.c
+++ b/drivers/usb/gadget/f_accessory.c
@@ -261,8 +261,10 @@ static void acc_complete_in(struct usb_ep *ep, struct usb_request *req)
{
struct acc_dev *dev = _acc_dev;
- if (req->status != 0)
+ if (req->status == -ESHUTDOWN) {
+ pr_debug("acc_complete_in set disconnected");
acc_set_disconnected(dev);
+ }
req_put(dev, &dev->tx_idle, req);
@@ -274,8 +276,10 @@ static void acc_complete_out(struct usb_ep *ep, struct usb_request *req)
struct acc_dev *dev = _acc_dev;
dev->rx_done = 1;
- if (req->status != 0)
+ if (req->status == -ESHUTDOWN) {
+ pr_debug("acc_complete_out set disconnected");
acc_set_disconnected(dev);
+ }
wake_up(&dev->read_wq);
}
@@ -557,8 +561,10 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
pr_debug("acc_read(%d)\n", count);
- if (dev->disconnected)
+ if (dev->disconnected) {
+ pr_debug("acc_read disconnected");
return -ENODEV;
+ }
if (count > BULK_BUFFER_SIZE)
count = BULK_BUFFER_SIZE;
@@ -571,6 +577,12 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
goto done;
}
+ if (dev->rx_done) {
+ // last req cancelled. try to get it.
+ req = dev->rx_req[0];
+ goto copy_data;
+ }
+
requeue_req:
/* queue a request */
req = dev->rx_req[0];
@@ -588,9 +600,17 @@ requeue_req:
ret = wait_event_interruptible(dev->read_wq, dev->rx_done);
if (ret < 0) {
r = ret;
- usb_ep_dequeue(dev->ep_out, req);
+ ret = usb_ep_dequeue(dev->ep_out, req);
+ if (ret != 0) {
+ // cancel failed. There can be a data already received.
+ // it will be retrieved in the next read.
+ pr_debug("acc_read: cancelling failed %d", ret);
+ }
goto done;
}
+
+copy_data:
+ dev->rx_done = 0;
if (dev->online) {
/* If we got a 0-len packet, throw it back and try again. */
if (req->actual == 0)
@@ -619,8 +639,10 @@ static ssize_t acc_write(struct file *fp, const char __user *buf,
pr_debug("acc_write(%d)\n", count);
- if (!dev->online || dev->disconnected)
+ if (!dev->online || dev->disconnected) {
+ pr_debug("acc_write disconnected or not online");
return -ENODEV;
+ }
while (count > 0) {
if (!dev->online) {
diff --git a/drivers/video/msm/mdp4_overlay.c b/drivers/video/msm/mdp4_overlay.c
index b0cef309ed7..c3b92759b06 100644
--- a/drivers/video/msm/mdp4_overlay.c
+++ b/drivers/video/msm/mdp4_overlay.c
@@ -143,9 +143,9 @@ static int mdp4_map_sec_resource(struct msm_fb_data_type *mfd)
return -ENODEV;
}
- pr_debug("%s %d mfd->index=%d,mapped=%d,active=%d\n",
+ pr_debug("%s %d mfd->index=%d,mapped=%d\n",
__func__, __LINE__,
- mfd->index, mfd->sec_mapped, mfd->sec_active);
+ mfd->index, mfd->sec_mapped);
if (mfd->sec_mapped)
return 0;
@@ -168,18 +168,31 @@ static int mdp4_map_sec_resource(struct msm_fb_data_type *mfd)
int mdp4_unmap_sec_resource(struct msm_fb_data_type *mfd)
{
int ret = 0;
+ int i, sec_cnt = 0;
+ struct mdp4_overlay_pipe *pipe;
+
if (!mfd) {
pr_err("%s: mfd is invalid\n", __func__);
return -ENODEV;
}
- if ((mfd->sec_mapped == 0) || (mfd->sec_active))
+ if (mfd->sec_mapped == 0)
+ return 0;
+
+ for (i = 0; i < OVERLAY_PIPE_MAX; i++) {
+ pipe = &ctrl->plist[i];
+ if ((pipe->mixer_num == mfd->index) &&
+ pipe->flags & MDP_SECURE_OVERLAY_SESSION)
+ sec_cnt++;
+ }
+
+ if (sec_cnt)
return 0;
- pr_debug("%s %d mfd->index=%d,mapped=%d,active=%d\n",
+ pr_debug("%s %d mfd->index=%d,mapped=%d\n",
__func__, __LINE__,
- mfd->index, mfd->sec_mapped, mfd->sec_active);
+ mfd->index, mfd->sec_mapped);
ret = mdp_enable_iommu_clocks();
if (ret) {
@@ -3326,7 +3339,6 @@ int mdp4_overlay_set(struct fb_info *info, struct mdp_overlay *req)
if (pipe->flags & MDP_SECURE_OVERLAY_SESSION) {
mdp4_map_sec_resource(mfd);
- mfd->sec_active = TRUE;
}
/* return id back to user */
@@ -3442,8 +3454,6 @@ int mdp4_overlay_unset(struct fb_info *info, int ndx)
mdp4_stat.overlay_unset[pipe->mixer_num]++;
- if (pipe->flags & MDP_SECURE_OVERLAY_SESSION)
- mfd->sec_active = FALSE;
mdp4_overlay_pipe_free(pipe);
mutex_unlock(&mfd->dma->ov_mutex);
diff --git a/drivers/video/msm/msm_fb.h b/drivers/video/msm/msm_fb.h
index 086cf2411d5..e39709f9621 100644
--- a/drivers/video/msm/msm_fb.h
+++ b/drivers/video/msm/msm_fb.h
@@ -208,7 +208,6 @@ struct msm_fb_data_type {
boolean panel_driver_on;
int vsync_sysfs_created;
uint32 sec_mapped;
- uint32 sec_active;
};
struct msm_fb_backup_type {
struct fb_info info;
diff --git a/fs/dcache.c b/fs/dcache.c
index 09e2eda55c5..4560aeda813 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2724,7 +2724,7 @@ char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen,
const char *fmt, ...)
{
va_list args;
- char temp[64];
+ char temp[256];
int sz;
va_start(args, fmt);
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 0cbd0494b79..b857a379616 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -132,6 +132,7 @@ static int traverse(struct seq_file *m, loff_t offset)
Eoverflow:
m->op->stop(m, p);
kfree(m->buf);
+ m->count = 0;
m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
return !m->buf ? -ENOMEM : -EAGAIN;
}
@@ -228,10 +229,10 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
goto Fill;
m->op->stop(m, p);
kfree(m->buf);
+ m->count = 0;
m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
if (!m->buf)
goto Enomem;
- m->count = 0;
m->version = 0;
pos = m->index;
p = m->op->start(m, &pos);
@@ -324,6 +325,8 @@ loff_t seq_lseek(struct file *file, loff_t offset, int origin)
m->read_pos = offset;
retval = file->f_pos = offset;
}
+ } else {
+ file->f_pos = offset;
}
}
file->f_version = m->version;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bc5c1465ebd..c32ef56c5e0 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1799,22 +1799,28 @@ struct cfg80211_ops {
* enum wiphy_flags - wiphy capability flags
*
* @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
- * has its own custom regulatory domain and cannot identify the
- * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
- * we will disregard the first regulatory hint (when the
- * initiator is %REGDOM_SET_BY_CORE).
- * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
- * ignore regulatory domain settings until it gets its own regulatory
- * domain via its regulatory_hint() unless the regulatory hint is
- * from a country IE. After its gets its own regulatory domain it will
- * only allow further regulatory domain settings to further enhance
- * compliance. For example if channel 13 and 14 are disabled by this
- * regulatory domain no user regulatory domain can enable these channels
- * at a later time. This can be used for devices which do not have
- * calibration information guaranteed for frequencies or settings
- * outside of its regulatory domain. If used in combination with
- * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings
- * will be followed.
+ * has its own custom regulatory domain and cannot identify the
+ * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
+ * we will disregard the first regulatory hint (when the
+ * initiator is %REGDOM_SET_BY_CORE). wiphys can set the custom
+ * regulatory domain using wiphy_apply_custom_regulatory()
+ * prior to wiphy registration.
+ * @WIPHY_FLAG_STRICT_REGULATORY: tells us that the wiphy for this device
+ * has regulatory domain that it wishes to be considered as the
+ * superset for regulatory rules. After this device gets its regulatory
+ * domain programmed further regulatory hints shall only be considered
+ * for this device to enhance regulatory compliance, forcing the
+ * device to only possibly use subsets of the original regulatory
+ * rules. For example if channel 13 and 14 are disabled by this
+ * device's regulatory domain no user specified regulatory hint which
+ * has these channels enabled would enable them for this wiphy,
+ * the device's original regulatory domain will be trusted as the
+ * base. You can program the superset of regulatory rules for this
+ * wiphy with regulatory_hint() for cards programmed with an
+ * ISO3166-alpha2 country code. wiphys that use regulatory_hint()
+ * will have their wiphy->regd programmed once the regulatory
+ * domain is set, and all other regulatory hints will be ignored
+ * until their own regulatory domain gets programmed.
* @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
* that passive scan flags and beaconing flags may not be lifted by
* cfg80211 due to regulatory beacon hints. For more information on beacon
@@ -1882,6 +1888,34 @@ enum wiphy_flags {
};
/**
+ * enum nl80211_country_ie_pref - country IE processing preferences
+ *
+ * enumerates the different preferences a 802.11 card can advertize
+ * for parsing the country IEs. As per the current implementation
+ * country IEs are only used derive the apha2, the information
+ * for power settings that comes with the country IE is ignored
+ * and we use the power settings from regdb.
+ *
+ * @NL80211_COUNTRY_IE_FOLLOW_CORE - This is the default behaviour.
+ * It allows the core to update channel flags according to the
+ * ISO3166-alpha2 in the country IE. The applied power is -
+ * MIN(power specified by custom domain, power obtained from regdb)
+ * @NL80211_COUNTRY_IE_FOLLOW_POWER - for devices that have a
+ * preference that even though they may have programmed their own
+ * custom power setting prior to wiphy registration, they want
+ * to ensure their channel power settings are updated for this
+ * connection with the power settings derived from alpha2 of the
+ * country IE.
+ * @NL80211_COUNTRY_IE_IGNORE_CORE - for devices that have a preference to
+ * to ignore all country IE information processed by the core.
+ */
+enum nl80211_country_ie_pref {
+ NL80211_COUNTRY_IE_FOLLOW_CORE,
+ NL80211_COUNTRY_IE_FOLLOW_POWER,
+ NL80211_COUNTRY_IE_IGNORE_CORE,
+};
+
+/**
* struct ieee80211_iface_limit - limit on certain interface types
* @max: maximum number of interfaces of these types
* @types: interface types (bits)
@@ -2098,6 +2132,8 @@ struct wiphy_wowlan_support {
*
* @max_acl_mac_addrs: Maximum number of MAC addresses that the device
* supports for ACL.
+ * @country_ie_pref: country IE processing preferences specified
+ * by enum nl80211_country_ie_pref
*/
struct wiphy {
/* assign these fields before you register the wiphy */
@@ -2162,6 +2198,8 @@ struct wiphy {
*/
u32 probe_resp_offload;
+ u8 country_ie_pref;
+
/* If multiple wiphys are registered and you're handed e.g.
* a regular netdev with assigned ieee80211_ptr, you won't
* know whether it points to a wiphy your driver has registered
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 269e99f2a02..1d094ca4607 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -253,6 +253,7 @@ extern int sysctl_tcp_cookie_size;
extern int sysctl_tcp_thin_linear_timeouts;
extern int sysctl_tcp_thin_dupack;
extern int sysctl_tcp_challenge_ack_limit;
+extern int sysctl_tcp_default_init_rwnd;
extern atomic_long_t tcp_memory_allocated;
extern struct percpu_counter tcp_sockets_allocated;
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 78c51db9910..65f6db06aa2 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -873,11 +873,12 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
/* Copy the address and add cmsg data. */
if (family == AF_INET) {
sin = (struct sockaddr_in *) msg->msg_name;
- sin->sin_family = AF_INET;
- sin->sin_port = 0 /* skb->h.uh->source */;
- sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
- memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
- *addr_len = sizeof(*sin);
+ if (sin) {
+ sin->sin_family = AF_INET;
+ sin->sin_port = 0 /* skb->h.uh->source */;
+ sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
+ memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
+ }
if (isk->cmsg_flags)
ip_cmsg_recv(msg, skb);
@@ -887,17 +888,19 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
struct ipv6_pinfo *np = inet6_sk(sk);
struct ipv6hdr *ip6 = ipv6_hdr(skb);
sin6 = (struct sockaddr_in6 *) msg->msg_name;
- sin6->sin6_family = AF_INET6;
- sin6->sin6_port = 0;
- sin6->sin6_addr = ip6->saddr;
-
- sin6->sin6_flowinfo = 0;
- if (np->sndflow)
- sin6->sin6_flowinfo =
- *(__be32 *)ip6 & IPV6_FLOWINFO_MASK;
- sin6->sin6_scope_id = ipv6_iface_scope_id(&sin6->sin6_addr,
- IP6CB(skb)->iif);
+ if (sin6) {
+ sin6->sin6_family = AF_INET6;
+ sin6->sin6_port = 0;
+ sin6->sin6_addr = ip6->saddr;
+ sin6->sin6_flowinfo = 0;
+ if (np->sndflow)
+ sin6->sin6_flowinfo =
+ *(__be32 *)ip6 & IPV6_FLOWINFO_MASK;
+ sin6->sin6_scope_id =
+ ipv6_iface_scope_id(&sin6->sin6_addr,
+ IP6CB(skb)->iif);
+ }
if (inet6_sk(sk)->rxopt.all)
pingv6_ops.datagram_recv_ctl(sk, msg, skb);
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 086c97327b9..906b95686e9 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -123,6 +123,21 @@ static int ipv4_ping_group_range(ctl_table *table, int write,
return ret;
}
+/* Validate changes from /proc interface. */
+static int proc_tcp_default_init_rwnd(ctl_table *ctl, int write,
+ void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+{
+ int old_value = *(int *)ctl->data;
+ int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
+ int new_value = *(int *)ctl->data;
+
+ if (write && ret == 0 && (new_value < 3 || new_value > 100))
+ *(int *)ctl->data = old_value;
+
+ return ret;
+}
+
static int proc_tcp_congestion_control(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
@@ -680,7 +695,7 @@ static struct ctl_table ipv4_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec
},
- {
+ {
.procname = "tcp_thin_dupack",
.data = &sysctl_tcp_thin_dupack,
.maxlen = sizeof(int),
@@ -688,6 +703,13 @@ static struct ctl_table ipv4_table[] = {
.proc_handler = proc_dointvec
},
{
+ .procname = "tcp_default_init_rwnd",
+ .data = &sysctl_tcp_default_init_rwnd,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_tcp_default_init_rwnd
+ },
+ {
.procname = "udp_mem",
.data = &sysctl_udp_mem,
.maxlen = sizeof(sysctl_udp_mem),
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 51e4301eb48..d9026bec22e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -102,6 +102,7 @@ int sysctl_tcp_thin_dupack __read_mostly;
int sysctl_tcp_moderate_rcvbuf __read_mostly = 1;
int sysctl_tcp_abc __read_mostly;
+int sysctl_tcp_default_init_rwnd __read_mostly = TCP_DEFAULT_INIT_RCVWND;
#define FLAG_DATA 0x01 /* Incoming frame contained data. */
#define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */
@@ -352,14 +353,14 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)
static void tcp_fixup_rcvbuf(struct sock *sk)
{
u32 mss = tcp_sk(sk)->advmss;
- u32 icwnd = TCP_DEFAULT_INIT_RCVWND;
+ u32 icwnd = sysctl_tcp_default_init_rwnd;
int rcvmem;
/* Limit to 10 segments if mss <= 1460,
* or 14600/mss segments, with a minimum of two segments.
*/
if (mss > 1460)
- icwnd = max_t(u32, (1460 * TCP_DEFAULT_INIT_RCVWND) / mss, 2);
+ icwnd = max_t(u32, (1460 * icwnd) / mss, 2);
rcvmem = SKB_TRUESIZE(mss + MAX_TCP_HEADER);
while (tcp_win_from_space(rcvmem) < mss)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 987f5cc706b..b83551d7c60 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -229,14 +229,13 @@ void tcp_select_initial_window(int __space, __u32 mss,
}
/* Set initial window to a value enough for senders starting with
- * initial congestion window of TCP_DEFAULT_INIT_RCVWND. Place
+ * initial congestion window of sysctl_tcp_default_init_rwnd. Place
* a limit on the initial window when mss is larger than 1460.
*/
if (mss > (1 << *rcv_wscale)) {
- int init_cwnd = TCP_DEFAULT_INIT_RCVWND;
+ int init_cwnd = sysctl_tcp_default_init_rwnd;
if (mss > 1460)
- init_cwnd =
- max_t(u32, (1460 * TCP_DEFAULT_INIT_RCVWND) / mss, 2);
+ init_cwnd = max_t(u32, (1460 * init_cwnd) / mss, 2);
/* when initializing use the value from init_rcv_wnd
* rather than the default from above
*/
diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c
index 88c61bdf1d2..aa5f0919a1b 100644
--- a/net/netfilter/xt_qtaguid.c
+++ b/net/netfilter/xt_qtaguid.c
@@ -1298,6 +1298,38 @@ static void iface_stat_update(struct net_device *net_dev, bool stash_only)
spin_unlock_bh(&iface_stat_list_lock);
}
+/* Guarantied to return a net_device that has a name */
+static void get_dev_and_dir(const struct sk_buff *skb,
+ struct xt_action_param *par,
+ enum ifs_tx_rx *direction,
+ const struct net_device **el_dev)
+{
+ BUG_ON(!direction || !el_dev);
+
+ if (par->in) {
+ *el_dev = par->in;
+ *direction = IFS_RX;
+ } else if (par->out) {
+ *el_dev = par->out;
+ *direction = IFS_TX;
+ } else {
+ pr_err("qtaguid[%d]: %s(): no par->in/out?!!\n",
+ par->hooknum, __func__);
+ BUG();
+ }
+ if (unlikely(!(*el_dev)->name)) {
+ pr_err("qtaguid[%d]: %s(): no dev->name?!!\n",
+ par->hooknum, __func__);
+ BUG();
+ }
+ if (skb->dev && *el_dev != skb->dev) {
+ MT_DEBUG("qtaguid[%d]: skb->dev=%p %s vs par->%s=%p %s\n",
+ par->hooknum, skb->dev, skb->dev->name,
+ *direction == IFS_RX ? "in" : "out", *el_dev,
+ (*el_dev)->name);
+ }
+}
+
/*
* Update stats for the specified interface from the skb.
* Do nothing if the entry
@@ -1309,50 +1341,27 @@ static void iface_stat_update_from_skb(const struct sk_buff *skb,
{
struct iface_stat *entry;
const struct net_device *el_dev;
- enum ifs_tx_rx direction = par->in ? IFS_RX : IFS_TX;
+ enum ifs_tx_rx direction;
int bytes = skb->len;
int proto;
- if (!skb->dev) {
- MT_DEBUG("qtaguid[%d]: no skb->dev\n", par->hooknum);
- el_dev = par->in ? : par->out;
- } else {
- const struct net_device *other_dev;
- el_dev = skb->dev;
- other_dev = par->in ? : par->out;
- if (el_dev != other_dev) {
- MT_DEBUG("qtaguid[%d]: skb->dev=%p %s vs "
- "par->(in/out)=%p %s\n",
- par->hooknum, el_dev, el_dev->name, other_dev,
- other_dev->name);
- }
- }
-
- if (unlikely(!el_dev)) {
- pr_err_ratelimited("qtaguid[%d]: %s(): no par->in/out?!!\n",
- par->hooknum, __func__);
- BUG();
- } else if (unlikely(!el_dev->name)) {
- pr_err_ratelimited("qtaguid[%d]: %s(): no dev->name?!!\n",
- par->hooknum, __func__);
- BUG();
- } else {
- proto = ipx_proto(skb, par);
- MT_DEBUG("qtaguid[%d]: dev name=%s type=%d fam=%d proto=%d\n",
- par->hooknum, el_dev->name, el_dev->type,
- par->family, proto);
- }
+ get_dev_and_dir(skb, par, &direction, &el_dev);
+ proto = ipx_proto(skb, par);
+ MT_DEBUG("qtaguid[%d]: iface_stat: %s(%s): "
+ "type=%d fam=%d proto=%d dir=%d\n",
+ par->hooknum, __func__, el_dev->name, el_dev->type,
+ par->family, proto, direction);
spin_lock_bh(&iface_stat_list_lock);
entry = get_iface_entry(el_dev->name);
if (entry == NULL) {
- IF_DEBUG("qtaguid: iface_stat: %s(%s): not tracked\n",
- __func__, el_dev->name);
+ IF_DEBUG("qtaguid[%d]: iface_stat: %s(%s): not tracked\n",
+ par->hooknum, __func__, el_dev->name);
spin_unlock_bh(&iface_stat_list_lock);
return;
}
- IF_DEBUG("qtaguid: %s(%s): entry=%p\n", __func__,
+ IF_DEBUG("qtaguid[%d]: %s(%s): entry=%p\n", par->hooknum, __func__,
el_dev->name, entry);
data_counters_update(&entry->totals_via_skb, 0, direction, proto,
@@ -1417,13 +1426,13 @@ static void if_tag_stat_update(const char *ifname, uid_t uid,
iface_entry = get_iface_entry(ifname);
if (!iface_entry) {
- pr_err_ratelimited("qtaguid: iface_stat: stat_update() "
+ pr_err_ratelimited("qtaguid: tag_stat: stat_update() "
"%s not found\n", ifname);
return;
}
/* It is ok to process data when an iface_entry is inactive */
- MT_DEBUG("qtaguid: iface_stat: stat_update() dev=%s entry=%p\n",
+ MT_DEBUG("qtaguid: tag_stat: stat_update() dev=%s entry=%p\n",
ifname, iface_entry);
/*
@@ -1440,7 +1449,7 @@ static void if_tag_stat_update(const char *ifname, uid_t uid,
tag = combine_atag_with_uid(acct_tag, uid);
uid_tag = make_tag_from_uid(uid);
}
- MT_DEBUG("qtaguid: iface_stat: stat_update(): "
+ MT_DEBUG("qtaguid: tag_stat: stat_update(): "
" looking for tag=0x%llx (uid=%u) in ife=%p\n",
tag, get_uid_from_tag(tag), iface_entry);
/* Loop over tag list under this interface for {acct_tag,uid_tag} */
@@ -1673,8 +1682,8 @@ static struct sock *qtaguid_find_sk(const struct sk_buff *skb,
struct sock *sk;
unsigned int hook_mask = (1 << par->hooknum);
- MT_DEBUG("qtaguid: find_sk(skb=%p) hooknum=%d family=%d\n", skb,
- par->hooknum, par->family);
+ MT_DEBUG("qtaguid[%d]: find_sk(skb=%p) family=%d\n",
+ par->hooknum, skb, par->family);
/*
* Let's not abuse the the xt_socket_get*_sk(), or else it will
@@ -1700,8 +1709,8 @@ static struct sock *qtaguid_find_sk(const struct sk_buff *skb,
* Not fixed in 3.0-r3 :(
*/
if (sk) {
- MT_DEBUG("qtaguid: %p->sk_proto=%u "
- "->sk_state=%d\n", sk, sk->sk_protocol, sk->sk_state);
+ MT_DEBUG("qtaguid[%d]: %p->sk_proto=%u->sk_state=%d\n",
+ par->hooknum, sk, sk->sk_protocol, sk->sk_state);
if (sk->sk_state == TCP_TIME_WAIT) {
xt_socket_put_sk(sk);
sk = NULL;
@@ -1715,37 +1724,19 @@ static void account_for_uid(const struct sk_buff *skb,
struct xt_action_param *par)
{
const struct net_device *el_dev;
+ enum ifs_tx_rx direction;
+ int proto;
- if (!skb->dev) {
- MT_DEBUG("qtaguid[%d]: no skb->dev\n", par->hooknum);
- el_dev = par->in ? : par->out;
- } else {
- const struct net_device *other_dev;
- el_dev = skb->dev;
- other_dev = par->in ? : par->out;
- if (el_dev != other_dev) {
- MT_DEBUG("qtaguid[%d]: skb->dev=%p %s vs "
- "par->(in/out)=%p %s\n",
- par->hooknum, el_dev, el_dev->name, other_dev,
- other_dev->name);
- }
- }
-
- if (unlikely(!el_dev)) {
- pr_info("qtaguid[%d]: no par->in/out?!!\n", par->hooknum);
- } else if (unlikely(!el_dev->name)) {
- pr_info("qtaguid[%d]: no dev->name?!!\n", par->hooknum);
- } else {
- int proto = ipx_proto(skb, par);
- MT_DEBUG("qtaguid[%d]: dev name=%s type=%d fam=%d proto=%d\n",
- par->hooknum, el_dev->name, el_dev->type,
- par->family, proto);
+ get_dev_and_dir(skb, par, &direction, &el_dev);
+ proto = ipx_proto(skb, par);
+ MT_DEBUG("qtaguid[%d]: dev name=%s type=%d fam=%d proto=%d dir=%d\n",
+ par->hooknum, el_dev->name, el_dev->type,
+ par->family, proto, direction);
- if_tag_stat_update(el_dev->name, uid,
- skb->sk ? skb->sk : alternate_sk,
- par->in ? IFS_RX : IFS_TX,
- proto, skb->len);
- }
+ if_tag_stat_update(el_dev->name, uid,
+ skb->sk ? skb->sk : alternate_sk,
+ direction,
+ proto, skb->len);
}
static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
@@ -1756,6 +1747,11 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
struct sock *sk;
uid_t sock_uid;
bool res;
+ /*
+ * TODO: unhack how to force just accounting.
+ * For now we only do tag stats when the uid-owner is not requested
+ */
+ bool do_tag_stat = !(info->match & XT_QTAGUID_UID);
if (unlikely(module_passive))
return (info->match ^ info->invert) == 0;
@@ -1820,12 +1816,7 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
* couldn't find the owner, so for now we just count them
* against the system.
*/
- /*
- * TODO: unhack how to force just accounting.
- * For now we only do iface stats when the uid-owner is not
- * requested.
- */
- if (!(info->match & XT_QTAGUID_UID))
+ if (do_tag_stat)
account_for_uid(skb, sk, 0, par);
MT_DEBUG("qtaguid[%d]: leaving (sk?sk->sk_socket)=%p\n",
par->hooknum,
@@ -1840,18 +1831,15 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
filp = sk->sk_socket->file;
if (filp == NULL) {
MT_DEBUG("qtaguid[%d]: leaving filp=NULL\n", par->hooknum);
- account_for_uid(skb, sk, 0, par);
+ if (do_tag_stat)
+ account_for_uid(skb, sk, 0, par);
res = ((info->match ^ info->invert) &
(XT_QTAGUID_UID | XT_QTAGUID_GID)) == 0;
atomic64_inc(&qtu_events.match_no_sk_file);
goto put_sock_ret_res;
}
sock_uid = filp->f_cred->fsuid;
- /*
- * TODO: unhack how to force just accounting.
- * For now we only do iface stats when the uid-owner is not requested
- */
- if (!(info->match & XT_QTAGUID_UID))
+ if (do_tag_stat)
account_for_uid(skb, sk, sock_uid, par);
/*
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 796a0eeb26a..97d7cb1842f 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -898,13 +898,11 @@ static void handle_channel(struct wiphy *wiphy,
chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
if (chan->orig_mpwr) {
/*
- * Devices that have their own custom regulatory domain
- * but also use WIPHY_FLAG_STRICT_REGULATORY will follow the
- * passed country IE power settings.
+ * Devices that use NL80211_COUNTRY_IE_FOLLOW_POWER will always
+ * follow the passed country IE power settings.
*/
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
- wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY &&
- wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY)
+ wiphy->country_ie_pref & NL80211_COUNTRY_IE_FOLLOW_POWER)
chan->max_power = chan->max_reg_power;
else
chan->max_power = min(chan->orig_mpwr,
@@ -1322,6 +1320,8 @@ static int ignore_request(struct wiphy *wiphy,
case NL80211_REGDOM_SET_BY_CORE:
return 0;
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
+ if (wiphy->country_ie_pref & NL80211_COUNTRY_IE_IGNORE_CORE)
+ return -EALREADY;
last_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
index 4a4a9aebca9..20b00fc37cc 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -145,7 +145,9 @@ struct security_class_mapping secclass_map[] = {
"node_bind", "name_connect", NULL } },
{ "memprotect", { "mmap_zero", NULL } },
{ "peer", { "recv", NULL } },
- { "capability2", { "mac_override", "mac_admin", "syslog", NULL } },
+ { "capability2",
+ { "mac_override", "mac_admin", "syslog", "wake_alarm", "block_suspend",
+ NULL } },
{ "kernel_service", { "use_as_override", "create_files_as", NULL } },
{ "tun_socket",
{ COMMON_SOCK_PERMS, NULL } },
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 185f849a26f..72b20b1089d 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -1229,6 +1229,10 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
struct context context;
int rc = 0;
+ /* An empty security context is never valid. */
+ if (!scontext_len)
+ return -EINVAL;
+
if (!ss_initialized) {
int i;