diff -Nru bcmwl-6.30.223.141+bdcom/debian/changelog bcmwl-6.30.223.248+bdcom/debian/changelog --- bcmwl-6.30.223.141+bdcom/debian/changelog 2014-08-01 20:52:38.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/debian/changelog 2014-08-01 20:52:39.000000000 +1200 @@ -1,3 +1,19 @@ +bcmwl (6.30.223.248+bdcom-0ubuntu1) UNRELEASED; urgency=medium + + * New upstream release: (LP: #1342645) + - This is an official public release from Broadcom. + * debian/dkms.conf.in: + - Drop patches for kernels 3.10 (now upstream) + + -- Robert Ancell Fri, 01 Aug 2014 11:09:43 +1200 + +bcmwl (6.30.223.141+bdcom-0ubuntu4) utopic; urgency=medium + + * debian/patches/0013-gcc.patch: + - Fix build with recent version of GCC (LP: #1328858) + + -- Robert Ancell Fri, 01 Aug 2014 10:38:46 +1200 + bcmwl (6.30.223.141+bdcom-0ubuntu3) utopic; urgency=medium * debian/patches/0012-add-support-for-Linux-3.15.patch: diff -Nru bcmwl-6.30.223.141+bdcom/debian/dkms.conf.in bcmwl-6.30.223.248+bdcom/debian/dkms.conf.in --- bcmwl-6.30.223.141+bdcom/debian/dkms.conf.in 2014-08-01 20:52:38.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/debian/dkms.conf.in 2014-08-01 20:52:39.000000000 +1200 @@ -8,9 +8,9 @@ PATCH[0]="0001-MODULE_LICENSE.patch" PATCH[1]="0002-Makefile.patch" PATCH[2]="0003-Make-up-for-missing-init_MUTEX.patch" -PATCH[3]="0009-add-support-for-linux-3.10.0.patch" -PATCH[4]="0010-change-the-network-interface-name-from-eth-to-wlan.patch" -PATCH[5]="0011-do-not-define-__devinit-as-__init-in-linux-3.8-as-__.patch" -PATCH[6]="0012-add-support-for-Linux-3.15.patch" +PATCH[3]="0010-change-the-network-interface-name-from-eth-to-wlan.patch" +PATCH[4]="0011-do-not-define-__devinit-as-__init-in-linux-3.8-as-__.patch" +PATCH[5]="0012-add-support-for-Linux-3.15.patch" +PATCH[6]="0013-gcc.patch" #PATCH_MATCH[6]="^3.[10-11]" AUTOINSTALL="yes" diff -Nru bcmwl-6.30.223.141+bdcom/debian/patches/0013-gcc.patch bcmwl-6.30.223.248+bdcom/debian/patches/0013-gcc.patch --- bcmwl-6.30.223.141+bdcom/debian/patches/0013-gcc.patch 1970-01-01 12:00:00.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/debian/patches/0013-gcc.patch 2014-08-01 20:52:39.000000000 +1200 @@ -0,0 +1,11 @@ +--- a/Makefile 2014-06-26 10:42:08.000000000 +0000 ++++ b/Makefile 2014-07-17 22:44:01.662297228 +0000 +@@ -132,6 +132,8 @@ + EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include + #EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR + ++EXTRA_CFLAGS += -Wno-date-time ++ + EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped_$(BINARCH) + + KBASE ?= /lib/modules/`uname -r` diff -Nru bcmwl-6.30.223.141+bdcom/Makefile bcmwl-6.30.223.248+bdcom/Makefile --- bcmwl-6.30.223.141+bdcom/Makefile 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/Makefile 2014-08-01 11:15:21.000000000 +1200 @@ -2,7 +2,7 @@ # Makefile fragment for Linux 2.6 # Broadcom 802.11abg Networking Device Driver # -# Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. +# Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -# $Id: Makefile_kbuild_portsrc 384222 2013-02-10 01:56:57Z $ +# $Id: Makefile_kbuild_portsrc 458427 2014-02-26 23:12:38Z $ ifneq ($(KERNELRELEASE),) @@ -124,7 +124,7 @@ EXTRA_CFLAGS += -I$(src)/src/include -I$(src)/src/common/include EXTRA_CFLAGS += -I$(src)/src/wl/sys -I$(src)/src/wl/phy -I$(src)/src/wl/ppr/include EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include -#EXTRA_CFLAGS += -DBCMDBG_ASSERT +#EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped @@ -132,9 +132,16 @@ KBUILD_DIR ?= $(KBASE)/build MDEST_DIR ?= $(KBASE)/kernel/drivers/net/wireless +# Cross compile setup. Tool chain and kernel tree, replace with your own. +CROSS_TOOLS = /path/to/tools +CROSS_KBUILD_DIR = /path/to/kernel/tree + all: KBUILD_NOPEDANTIC=1 make -C $(KBUILD_DIR) M=`pwd` +cross: + KBUILD_NOPEDANTIC=1 make CROSS_COMPILE=${CROSS_TOOLS} -C $(CROSS_KBUILD_DIR) M=`pwd` + clean: KBUILD_NOPEDANTIC=1 make -C $(KBUILD_DIR) M=`pwd` clean Binary files /tmp/uORvaIiLvh/bcmwl-6.30.223.141+bdcom/src/lib/wlc_hybrid.o_shipped_i386 and /tmp/4gwJwzuLCh/bcmwl-6.30.223.248+bdcom/src/lib/wlc_hybrid.o_shipped_i386 differ Binary files /tmp/uORvaIiLvh/bcmwl-6.30.223.141+bdcom/src/lib/wlc_hybrid.o_shipped_x86_64 and /tmp/4gwJwzuLCh/bcmwl-6.30.223.248+bdcom/src/lib/wlc_hybrid.o_shipped_x86_64 differ diff -Nru bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/802.11.h bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/802.11.h --- bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/802.11.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/802.11.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/802.1d.h bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/802.1d.h --- bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/802.1d.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/802.1d.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/bcmeth.h bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/bcmeth.h --- bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/bcmeth.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/bcmeth.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Broadcom Ethernettype protocol definitions * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/bcmevent.h bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/bcmevent.h --- bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/bcmevent.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/bcmevent.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Broadcom Event protocol definitions * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -270,14 +270,6 @@ #define WLC_E_SUP_DEAUTH 14 #define WLC_E_SUP_WPA_PSK_TMO 15 -#ifdef WLAWDL -#define WLC_E_AWDL_SCAN_START 1 -#define WLC_E_AWDL_SCAN_DONE 0 - -#define WLC_E_AWDL_RX_ACT_FRAME 1 -#define WLC_E_AWDL_RX_PRB_RESP 2 - -#endif typedef BWL_PRE_PACKED_STRUCT struct wl_event_rx_frame_data { uint16 version; uint16 channel; diff -Nru bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/bcmip.h bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/bcmip.h --- bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/bcmip.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/bcmip.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/ethernet.h bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/ethernet.h --- bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/ethernet.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/ethernet.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * From FreeBSD 2.2.7: Fundamental constants relating to ethernet. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -50,11 +50,6 @@ #define ETHER_TYPE_IPV6 0x86dd #define ETHER_TYPE_BRCM 0x886c #define ETHER_TYPE_802_1X 0x888e -#ifdef PLC -#define ETHER_TYPE_88E1 0x88e1 -#define ETHER_TYPE_8912 0x8912 -#define ETHER_TYPE_GIGLED 0xffff -#endif #define ETHER_TYPE_802_1X_PREAUTH 0x88c7 #define ETHER_TYPE_WAI 0x88b4 #define ETHER_TYPE_89_0D 0x890d diff -Nru bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/wpa.h bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/wpa.h --- bcmwl-6.30.223.141+bdcom/src/src/common/include/proto/wpa.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/common/include/proto/wpa.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Fundamental types and constants relating to WPA * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/bcmcrypto/tkhash.h bcmwl-6.30.223.248+bdcom/src/src/include/bcmcrypto/tkhash.h --- bcmwl-6.30.223.141+bdcom/src/src/include/bcmcrypto/tkhash.h 1970-01-01 12:00:00.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/bcmcrypto/tkhash.h 2014-06-26 22:42:08.000000000 +1200 @@ -0,0 +1,33 @@ +/* + * tkhash.h + * Prototypes for TKIP hash functions. + * + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: tkhash.h 458337 2014-02-26 18:39:26Z $ + */ + +#ifndef _TKHASH_H_ +#define _TKHASH_H_ + +#include + +#define TKHASH_P1_KEY_SIZE 10 +#define TKHASH_P2_KEY_SIZE 16 + +extern void BCMROMFN(tkhash_phase1)(uint16 *P1K, const uint8 *TK, const uint8 *TA, uint32 IV32); +extern void BCMROMFN(tkhash_phase2)(uint8 *RC4KEY, const uint8 *TK, const uint16 *P1K, uint16 IV16); + +#endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/bcmdefs.h bcmwl-6.30.223.248+bdcom/src/src/include/bcmdefs.h --- bcmwl-6.30.223.141+bdcom/src/src/include/bcmdefs.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/bcmdefs.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Misc system wide definitions * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: bcmdefs.h 381895 2013-01-30 07:06:40Z $ + * $Id: bcmdefs.h 432150 2013-10-25 20:57:18Z $ */ #ifndef _bcmdefs_h_ @@ -23,11 +23,17 @@ #define BCM_REFERENCE(data) ((void)(data)) +#ifdef __GNUC__ +#define UNUSED_VAR __attribute__ ((unused)) +#else +#define UNUSED_VAR +#endif + #define STATIC_ASSERT(expr) { \ \ - typedef enum { _STATIC_ASSERT_NOT_CONSTANT = (expr) } _static_assert_e; \ + typedef enum { _STATIC_ASSERT_NOT_CONSTANT = (expr) } _static_assert_e UNUSED_VAR; \ \ - typedef char STATIC_ASSERT_FAIL[(expr) ? 1 : -1]; \ + typedef char STATIC_ASSERT_FAIL[(expr) ? 1 : -1] UNUSED_VAR; \ } #define bcmreclaimed 0 diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/bcmendian.h bcmwl-6.30.223.248+bdcom/src/src/include/bcmendian.h --- bcmwl-6.30.223.141+bdcom/src/src/include/bcmendian.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/bcmendian.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Byte order utilities * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/bcmutils.h bcmwl-6.30.223.248+bdcom/src/src/include/bcmutils.h --- bcmwl-6.30.223.141+bdcom/src/src/include/bcmutils.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/bcmutils.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Misc useful os-independent macros and functions. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/epivers.h bcmwl-6.30.223.248+bdcom/src/src/include/epivers.h --- bcmwl-6.30.223.141+bdcom/src/src/include/epivers.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/epivers.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -26,16 +26,16 @@ #define EPI_RC_NUMBER 223 -#define EPI_INCREMENTAL_NUMBER 141 +#define EPI_INCREMENTAL_NUMBER 248 #define EPI_BUILD_NUMBER 0 -#define EPI_VERSION 6, 30, 223, 141 +#define EPI_VERSION 6, 30, 223, 248 -#define EPI_VERSION_NUM 0x061edf8d +#define EPI_VERSION_NUM 0x061edff8 #define EPI_VERSION_DEV 6.30.223 -#define EPI_VERSION_STR "6.30.223.141 (r415941)" +#define EPI_VERSION_STR "6.30.223.248 (r487574)" #endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/linux_osl.h bcmwl-6.30.223.248+bdcom/src/src/include/linux_osl.h --- bcmwl-6.30.223.141+bdcom/src/src/include/linux_osl.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/linux_osl.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Linux OS Independent Layer * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -89,12 +89,24 @@ #define BUS_SWAP32(v) (v) +#ifdef BCMDBG_MEM + #define MALLOC(osh, size) osl_debug_malloc((osh), (size), __LINE__, __FILE__) + #define MFREE(osh, addr, size) osl_debug_mfree((osh), (addr), (size), __LINE__, __FILE__) + #define MALLOCED(osh) osl_malloced((osh)) + #define MALLOC_DUMP(osh, b) osl_debug_memdump((osh), (b)) + extern void *osl_debug_malloc(osl_t *osh, uint size, int line, const char* file); + extern void osl_debug_mfree(osl_t *osh, void *addr, uint size, int line, const char* file); + extern uint osl_malloced(osl_t *osh); + struct bcmstrbuf; + extern int osl_debug_memdump(osl_t *osh, struct bcmstrbuf *b); +#else #define MALLOC(osh, size) osl_malloc((osh), (size)) #define MFREE(osh, addr, size) osl_mfree((osh), (addr), (size)) #define MALLOCED(osh) osl_malloced((osh)) extern void *osl_malloc(osl_t *osh, uint size); extern void osl_mfree(osl_t *osh, void *addr, uint size); extern uint osl_malloced(osl_t *osh); +#endif #define NATIVE_MALLOC(osh, size) kmalloc(size, GFP_ATOMIC) #define NATIVE_MFREE(osh, addr, size) kfree(addr) @@ -271,15 +283,9 @@ #define W_SM(r, v) (*(r) = (v)) #define BZERO_SM(r, len) bzero((r), (len)) -#ifdef BCMDBG_CTRACE -#define PKTGET(osh, len, send) osl_pktget((osh), (len), __LINE__, __FILE__) -#define PKTDUP(osh, skb) osl_pktdup((osh), (skb), __LINE__, __FILE__) -#define PKTFRMNATIVE(osh, skb) osl_pkt_frmnative((osh), (skb), __LINE__, __FILE__) -#else #define PKTGET(osh, len, send) osl_pktget((osh), (len)) #define PKTDUP(osh, skb) osl_pktdup((osh), (skb)) #define PKTFRMNATIVE(osh, skb) osl_pkt_frmnative((osh), (skb)) -#endif #define PKTLIST_DUMP(osh, buf) #define PKTDBG_TRACE(osh, pkt, bit) #define PKTFREE(osh, skb, send) osl_pktfree((osh), (skb), (send)) diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/linuxver.h bcmwl-6.30.223.248+bdcom/src/src/include/linuxver.h --- bcmwl-6.30.223.141+bdcom/src/src/include/linuxver.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/linuxver.h 2014-08-01 11:15:21.000000000 +1200 @@ -2,7 +2,7 @@ * Linux-specific abstractions to gain some independence from linux kernel versions. * Pave over some 2.2 versus 2.4 versus 2.6 kernel differences. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/osl.h bcmwl-6.30.223.248+bdcom/src/src/include/osl.h --- bcmwl-6.30.223.141+bdcom/src/src/include/osl.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/osl.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * OS Abstraction Layer * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: osl.h 382794 2013-02-04 17:34:08Z $ + * $Id: osl.h 431503 2013-10-23 21:42:47Z $ */ #ifndef _osl_h_ diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/packed_section_end.h bcmwl-6.30.223.248+bdcom/src/src/include/packed_section_end.h --- bcmwl-6.30.223.141+bdcom/src/src/include/packed_section_end.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/packed_section_end.h 2014-06-26 22:42:08.000000000 +1200 @@ -15,7 +15,7 @@ * #include * * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/packed_section_start.h bcmwl-6.30.223.248+bdcom/src/src/include/packed_section_start.h --- bcmwl-6.30.223.141+bdcom/src/src/include/packed_section_start.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/packed_section_start.h 2014-06-26 22:42:08.000000000 +1200 @@ -15,7 +15,7 @@ * #include * * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/pcicfg.h bcmwl-6.30.223.248+bdcom/src/src/include/pcicfg.h --- bcmwl-6.30.223.141+bdcom/src/src/include/pcicfg.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/pcicfg.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * pcicfg.h: PCI configuration constants and structures. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/siutils.h bcmwl-6.30.223.248+bdcom/src/src/include/siutils.h --- bcmwl-6.30.223.141+bdcom/src/src/include/siutils.h 1970-01-01 12:00:00.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/siutils.h 2014-06-26 22:42:08.000000000 +1200 @@ -0,0 +1,409 @@ +/* + * Misc utility routines for accessing the SOC Interconnects + * of Broadcom HNBU chips. + * + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: siutils.h 434387 2013-11-06 04:50:08Z $ + */ + +#ifndef _siutils_h_ +#define _siutils_h_ + +#include + +struct si_pub { + uint socitype; + + uint bustype; + uint buscoretype; + uint buscorerev; + uint buscoreidx; + int ccrev; + uint32 cccaps; + uint32 cccaps_ext; + int pmurev; + uint32 pmucaps; + uint boardtype; + uint boardrev; + uint boardvendor; + uint boardflags; + uint boardflags2; + uint chip; + uint chiprev; + uint chippkg; + uint32 chipst; + bool issim; + uint socirev; + bool pci_pr32414; + +#ifdef SI_ENUM_BASE_VARIABLE + uint32 si_enum_base; +#endif +}; + +typedef const struct si_pub si_t; + +#ifdef ATE_BUILD +typedef struct _ate_params { + void* wl; + uint8 gpio_input; + uint8 gpio_output; + bool cmd_proceed; + uint16 cmd_idx; + bool ate_cmd_done; +} ate_params_t; +#endif + +#define SI_OSH NULL + +#define BADIDX (SI_MAXCORES + 1) + +#define XTAL 0x1 +#define PLL 0x2 + +#define CLK_FAST 0 +#define CLK_DYNAMIC 2 + +#define GPIO_DRV_PRIORITY 0 +#define GPIO_APP_PRIORITY 1 +#define GPIO_HI_PRIORITY 2 + +#define GPIO_PULLUP 0 +#define GPIO_PULLDN 1 + +#define GPIO_REGEVT 0 +#define GPIO_REGEVT_INTMSK 1 +#define GPIO_REGEVT_INTPOL 2 + +#define SI_DEVPATH_BUFSZ 16 + +#define SI_DOATTACH 1 +#define SI_PCIDOWN 2 +#define SI_PCIUP 3 + +#define ISSIM_ENAB(sih) FALSE + +#if defined(BCMPMUCTL) +#define PMUCTL_ENAB(sih) (BCMPMUCTL) +#else +#define PMUCTL_ENAB(sih) ((sih)->cccaps & CC_CAP_PMU) +#endif + +#if defined(BCMPMUCTL) && BCMPMUCTL +#define CCCTL_ENAB(sih) (0) +#define CCPLL_ENAB(sih) (0) +#else +#define CCCTL_ENAB(sih) ((sih)->cccaps & CC_CAP_PWR_CTL) +#define CCPLL_ENAB(sih) ((sih)->cccaps & CC_CAP_PLL_MASK) +#endif + +typedef void (*gpio_handler_t)(uint32 stat, void *arg); + +#define CC_BTCOEX_EN_MASK 0x01 + +#define GPIO_CTRL_EPA_EN_MASK 0x40 + +#define GPIO_CTRL_5_6_EN_MASK 0x60 +#define GPIO_CTRL_7_6_EN_MASK 0xC0 +#define GPIO_OUT_7_EN_MASK 0x80 + +#define SI_CR4_CAP (0x04) +#define SI_CR4_BANKIDX (0x40) +#define SI_CR4_BANKINFO (0x44) + +#define ARMCR4_TCBBNB_MASK 0xf0 +#define ARMCR4_TCBBNB_SHIFT 4 +#define ARMCR4_TCBANB_MASK 0xf +#define ARMCR4_TCBANB_SHIFT 0 + +#define SICF_CPUHALT (0x0020) +#define ARMCR4_BSZ_MASK 0x3f +#define ARMCR4_BSZ_MULT 8192 + +extern si_t *si_attach(uint pcidev, osl_t *osh, void *regs, uint bustype, + void *sdh, char **vars, uint *varsz); +extern si_t *si_kattach(osl_t *osh); +extern void si_detach(si_t *sih); +extern bool si_pci_war16165(si_t *sih); + +extern uint si_corelist(si_t *sih, uint coreid[]); +extern uint si_coreid(si_t *sih); +extern uint si_flag(si_t *sih); +extern uint si_flag_alt(si_t *sih); +extern uint si_intflag(si_t *sih); +extern uint si_coreidx(si_t *sih); +extern uint si_coreunit(si_t *sih); +extern uint si_corevendor(si_t *sih); +extern uint si_corerev(si_t *sih); +extern void *si_osh(si_t *sih); +extern void si_setosh(si_t *sih, osl_t *osh); +extern uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val); +extern void *si_coreregs(si_t *sih); +extern uint si_wrapperreg(si_t *sih, uint32 offset, uint32 mask, uint32 val); +extern uint si_core_wrapperreg(si_t *sih, uint32 coreidx, uint32 offset, uint32 mask, uint32 val); +extern void *si_wrapperregs(si_t *sih); +extern uint32 si_core_cflags(si_t *sih, uint32 mask, uint32 val); +extern void si_core_cflags_wo(si_t *sih, uint32 mask, uint32 val); +extern uint32 si_core_sflags(si_t *sih, uint32 mask, uint32 val); +extern bool si_iscoreup(si_t *sih); +extern uint si_findcoreidx(si_t *sih, uint coreid, uint coreunit); +extern void *si_setcoreidx(si_t *sih, uint coreidx); +extern void *si_setcore(si_t *sih, uint coreid, uint coreunit); +extern void *si_switch_core(si_t *sih, uint coreid, uint *origidx, uint *intr_val); +extern void si_restore_core(si_t *sih, uint coreid, uint intr_val); +extern int si_numaddrspaces(si_t *sih); +extern uint32 si_addrspace(si_t *sih, uint asidx); +extern uint32 si_addrspacesize(si_t *sih, uint asidx); +extern void si_coreaddrspaceX(si_t *sih, uint asidx, uint32 *addr, uint32 *size); +extern int si_corebist(si_t *sih); +extern void si_core_reset(si_t *sih, uint32 bits, uint32 resetbits); +extern void si_core_disable(si_t *sih, uint32 bits); +extern uint32 si_clock_rate(uint32 pll_type, uint32 n, uint32 m); +extern uint si_chip_hostif(si_t *sih); +extern bool si_read_pmu_autopll(si_t *sih); +extern uint32 si_clock(si_t *sih); +extern uint32 si_alp_clock(si_t *sih); +extern uint32 si_ilp_clock(si_t *sih); +extern void si_pci_setup(si_t *sih, uint coremask); +extern void si_pcmcia_init(si_t *sih); +extern void si_setint(si_t *sih, int siflag); +extern bool si_backplane64(si_t *sih); +extern void si_register_intr_callback(si_t *sih, void *intrsoff_fn, void *intrsrestore_fn, + void *intrsenabled_fn, void *intr_arg); +extern void si_deregister_intr_callback(si_t *sih); +extern void si_clkctl_init(si_t *sih); +extern uint16 si_clkctl_fast_pwrup_delay(si_t *sih); +extern bool si_clkctl_cc(si_t *sih, uint mode); +extern int si_clkctl_xtal(si_t *sih, uint what, bool on); +extern uint32 si_gpiotimerval(si_t *sih, uint32 mask, uint32 val); +extern void si_btcgpiowar(si_t *sih); +extern bool si_deviceremoved(si_t *sih); +extern uint32 si_socram_size(si_t *sih); +extern uint32 si_socdevram_size(si_t *sih); +extern void si_socdevram(si_t *sih, bool set, uint8 *ennable, uint8 *protect, uint8 *remap); +extern bool si_socdevram_pkg(si_t *sih); +extern bool si_socdevram_remap_isenb(si_t *sih); +extern uint32 si_socdevram_remap_size(si_t *sih); + +extern void si_watchdog(si_t *sih, uint ticks); +extern void si_watchdog_ms(si_t *sih, uint32 ms); +extern uint32 si_watchdog_msticks(void); +extern void *si_gpiosetcore(si_t *sih); +extern uint32 si_gpiocontrol(si_t *sih, uint32 mask, uint32 val, uint8 priority); +extern uint32 si_gpioouten(si_t *sih, uint32 mask, uint32 val, uint8 priority); +extern uint32 si_gpioout(si_t *sih, uint32 mask, uint32 val, uint8 priority); +extern uint32 si_gpioin(si_t *sih); +extern uint32 si_gpiointpolarity(si_t *sih, uint32 mask, uint32 val, uint8 priority); +extern uint32 si_gpiointmask(si_t *sih, uint32 mask, uint32 val, uint8 priority); +extern uint32 si_gpioled(si_t *sih, uint32 mask, uint32 val); +extern uint32 si_gpioreserve(si_t *sih, uint32 gpio_num, uint8 priority); +extern uint32 si_gpiorelease(si_t *sih, uint32 gpio_num, uint8 priority); +extern uint32 si_gpiopull(si_t *sih, bool updown, uint32 mask, uint32 val); +extern uint32 si_gpioevent(si_t *sih, uint regtype, uint32 mask, uint32 val); +extern uint32 si_gpio_int_enable(si_t *sih, bool enable); + +extern void *si_gpio_handler_register(si_t *sih, uint32 e, bool lev, gpio_handler_t cb, void *arg); +extern void si_gpio_handler_unregister(si_t *sih, void* gpioh); +extern void si_gpio_handler_process(si_t *sih); + +extern bool si_pci_pmecap(si_t *sih); +struct osl_info; +extern bool si_pci_fastpmecap(struct osl_info *osh); +extern bool si_pci_pmestat(si_t *sih); +extern void si_pci_pmeclr(si_t *sih); +extern void si_pci_pmeen(si_t *sih); +extern void si_pci_pmestatclr(si_t *sih); +extern uint si_pcie_readreg(void *sih, uint addrtype, uint offset); +extern uint si_pcie_writereg(void *sih, uint addrtype, uint offset, uint val); + +extern uint16 si_d11_devid(si_t *sih); +extern int si_corepciid(si_t *sih, uint func, uint16 *pcivendor, uint16 *pcidevice, + uint8 *pciclass, uint8 *pcisubclass, uint8 *pciprogif, uint8 *pciheader); + +#if defined(BCMECICOEX) +extern bool si_eci(si_t *sih); +extern int si_eci_init(si_t *sih); +extern void si_eci_notify_bt(si_t *sih, uint32 mask, uint32 val, bool interrupt); +extern bool si_seci(si_t *sih); +extern void* si_seci_init(si_t *sih, uint8 seci_mode); +extern void* si_gci_init(si_t *sih); +extern void si_seci_down(si_t *sih); +extern void si_seci_upd(si_t *sih, bool enable); +extern bool si_gci(si_t *sih); +#else +#define si_eci(sih) 0 +static INLINE void * si_eci_init(si_t *sih) {return NULL;} +#define si_eci_notify_bt(sih, type, val) (0) +#define si_seci(sih) 0 +#define si_seci_upd(sih, a) do {} while (0) +static INLINE void * si_seci_init(si_t *sih, uint8 use_seci) {return NULL;} +static INLINE void * si_gci_init(si_t *sih) {return NULL;} +#define si_seci_down(sih) do {} while (0) +#define si_gci(sih) 0 +#endif + +extern bool si_is_otp_disabled(si_t *sih); +extern bool si_is_otp_powered(si_t *sih); +extern void si_otp_power(si_t *sih, bool on); + +extern bool si_is_sprom_available(si_t *sih); +extern bool si_is_sprom_enabled(si_t *sih); +extern void si_sprom_enable(si_t *sih, bool enable); +#ifdef SI_SPROM_PROBE +extern void si_sprom_init(si_t *sih); +#endif + +extern int si_cis_source(si_t *sih); +#define CIS_DEFAULT 0 +#define CIS_SROM 1 +#define CIS_OTP 2 + +#define DEFAULT_FAB 0x0 +#define CSM_FAB7 0x1 +#define TSMC_FAB12 0x2 +#define SMIC_FAB4 0x3 + +extern int BCMINITFN(si_otp_fabid)(si_t *sih, uint16 *fabid, bool rw); +extern uint16 BCMATTACHFN(si_fabid)(si_t *sih); + +extern int si_devpath(si_t *sih, char *path, int size); + +extern char *si_getdevpathvar(si_t *sih, const char *name); +extern int si_getdevpathintvar(si_t *sih, const char *name); +extern char *si_coded_devpathvar(si_t *sih, char *varname, int var_len, const char *name); + +extern uint8 si_pcieclkreq(si_t *sih, uint32 mask, uint32 val); +extern uint32 si_pcielcreg(si_t *sih, uint32 mask, uint32 val); +extern uint8 si_pcieltrenable(si_t *sih, uint32 mask, uint32 val); +extern uint8 si_pcieobffenable(si_t *sih, uint32 mask, uint32 val); +extern uint32 si_pcieltr_reg(si_t *sih, uint32 reg, uint32 mask, uint32 val); +extern uint32 si_pcieltrspacing_reg(si_t *sih, uint32 mask, uint32 val); +extern uint32 si_pcieltrhysteresiscnt_reg(si_t *sih, uint32 mask, uint32 val); +extern void si_pcie_set_error_injection(si_t *sih, uint32 mode); +extern void si_pcie_set_L1substate(si_t *sih, uint32 substate); +extern uint32 si_pcie_get_L1substate(si_t *sih); +extern void si_war42780_clkreq(si_t *sih, bool clkreq); +extern void si_pci_down(si_t *sih); +extern void si_pci_up(si_t *sih); +extern void si_pci_sleep(si_t *sih); +extern void si_pcie_war_ovr_update(si_t *sih, uint8 aspm); +extern void si_pcie_power_save_enable(si_t *sih, bool enable); +extern void si_pcie_extendL1timer(si_t *sih, bool extend); +extern int si_pci_fixcfg(si_t *sih); +extern bool si_ldo_war(si_t *sih, uint devid); +extern void si_chippkg_set(si_t *sih, uint); + +extern void si_chipcontrl_btshd0_4331(si_t *sih, bool on); +extern void si_chipcontrl_restore(si_t *sih, uint32 val); +extern uint32 si_chipcontrl_read(si_t *sih); +extern void si_chipcontrl_epa4331(si_t *sih, bool on); +extern void si_chipcontrl_epa4331_wowl(si_t *sih, bool enter_wowl); +extern void si_chipcontrl_srom4360(si_t *sih, bool on); + +extern void si_epa_4313war(si_t *sih); +extern void si_btc_enable_chipcontrol(si_t *sih); + +extern void si_btcombo_p250_4313_war(si_t *sih); +extern void si_btcombo_43228_war(si_t *sih); +extern void si_clk_pmu_htavail_set(si_t *sih, bool set_clear); +extern void si_pmu_synth_pwrsw_4313_war(si_t *sih); +extern uint si_pll_reset(si_t *sih); + +extern bool si_taclear(si_t *sih, bool details); + +#ifdef BCMDBG +extern void si_view(si_t *sih, bool verbose); +extern void si_viewall(si_t *sih, bool verbose); +#if defined(BCM_BACKPLANE_TIMEOUT) +extern void si_setup_backplanetimeout(osl_t *osh, si_t *sih, uint val); +extern void si_setup_curmap(osl_t *osh, si_t *sih); +#endif +#endif +#if defined(BCMDBG) || defined(BCMDBG_DUMP) +extern int si_dump_pcieinfo(si_t *sih, struct bcmstrbuf *b); +#endif + +#if defined(BCMDBG) || defined(BCMDBG_DUMP) +struct bcmstrbuf; +extern void si_dumpregs(si_t *sih, struct bcmstrbuf *b); +#endif +extern uint32 si_ccreg(si_t *sih, uint32 offset, uint32 mask, uint32 val); +extern uint32 si_pciereg(si_t *sih, uint32 offset, uint32 mask, uint32 val, uint type); +extern uint32 write_ccreg(si_t *sih, uint32 offset, uint32 mask, uint32 val); +extern uint32 si_pcieserdesreg(si_t *sih, uint32 mdioslave, uint32 offset, uint32 mask, uint32 val); +extern void si_pcie_set_request_size(si_t *sih, uint16 size); +extern uint16 si_pcie_get_request_size(si_t *sih); +extern void si_pcie_set_maxpayload_size(si_t *sih, uint16 size); +extern uint16 si_pcie_get_maxpayload_size(si_t *sih); +extern uint16 si_pcie_get_ssid(si_t *sih); +extern uint32 si_pcie_get_bar0(si_t *sih); +extern int si_pcie_configspace_cache(si_t *sih); +extern int si_pcie_configspace_restore(si_t *sih); +extern int si_pcie_configspace_get(si_t *sih, uint8 *buf, uint size); + +char *si_getnvramflvar(si_t *sih, const char *name); + +extern void BCMATTACHFN(si_muxenab)(si_t *sih, uint32 w); + +extern uint32 si_tcm_size(si_t *sih); +extern bool si_has_flops(si_t *sih); + +extern uint32 si_gci_direct(si_t *sih, uint offset, uint32 mask, uint32 val); +extern uint32 si_gci_indirect(si_t *sih, uint regidx, uint offset, uint32 mask, uint32 val); +extern uint32 si_gci_output(si_t *sih, uint reg, uint32 mask, uint32 val); +extern uint32 si_gci_input(si_t *sih, uint reg); +extern uint32 si_gci_int_enable(si_t *sih, bool enable); +extern void si_gci_reset(si_t *sih); +extern void si_ercx_init(si_t *sih); +extern void si_wci2_init(si_t *sih); +extern void si_gci_seci_init(si_t *sih); +extern void si_gci_set_functionsel(si_t *sih, uint32 pin, uint8 fnsel); +extern uint8 si_gci_get_chipctrlreg_idx(uint32 pin, uint32 *regidx, uint32 *pos); +extern uint32 si_gci_chipcontrol(si_t *sih, uint reg, uint32 mask, uint32 val); +extern int si_set_sromctl(si_t *sih, uint32 value); +extern uint32 si_get_sromctl(si_t *sih); + +extern uint16 si_cc_get_reg16(uint32 reg_offs); +extern uint32 si_cc_get_reg32(uint32 reg_offs); +extern uint32 si_cc_set_reg32(uint32 reg_offs, uint32 val); +extern uint32 si_gci_preinit_upd_indirect(uint32 regidx, uint32 setval, uint32 mask); + +#define CHIPCTRLREG1 0x1 +#define CHIPCTRLREG2 0x2 +#define CHIPCTRLREG3 0x3 +#define CHIPCTRLREG4 0x4 +#define CHIPCTRLREG5 0x5 +#define REGCTRLREG4 0x4 +#define MINRESMASKREG 0x618 +#define MAXRESMASKREG 0x61c +#define CHIPCTRLADDR 0x650 +#define CHIPCTRLDATA 0x654 +#define RSRCTABLEADDR 0x620 +#define RSRCUPDWNTIME 0x628 +#define PMUREG_RESREQ_MASK 0x68c + +extern void si_update_masks(si_t *sih); + +extern void si_force_islanding(si_t *sih, bool enable); + +extern uint32 si_pmu_res_req_timer_clr(si_t *sih); +extern void si_pmu_rfldo(si_t *sih, bool on); +extern void si_survive_perst_war(si_t *sih, bool reset, uint32 sperst_mask, uint32 spert_val); +extern void si_pcie_ltr_war(si_t *sih); +extern uint si_jtag_ureg_read(si_t *sih, uint num); +extern void si_jtag_ureg_write(si_t *sih, uint num, uint data); +extern uint si_bbpll_war(si_t *sih, uint state); +#endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/typedefs.h bcmwl-6.30.223.248+bdcom/src/src/include/typedefs.h --- bcmwl-6.30.223.141+bdcom/src/src/include/typedefs.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/typedefs.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/include/wlioctl.h bcmwl-6.30.223.248+bdcom/src/src/include/wlioctl.h --- bcmwl-6.30.223.141+bdcom/src/src/include/wlioctl.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/include/wlioctl.h 2014-06-26 22:42:08.000000000 +1200 @@ -4,7 +4,7 @@ * * Definitions subject to change without notice. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,7 +18,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: wlioctl.h 415531 2013-07-30 18:39:00Z $ + * $Id: wlioctl.h 464835 2014-03-26 01:35:40Z $ */ #ifndef _wlioctl_h_ @@ -290,6 +290,32 @@ uint needed; } wl_ioctl_t; +#define ioctl_subtype set +#define ioctl_pid used +#define ioctl_status needed + +typedef struct wlc_rev_info { + uint vendorid; + uint deviceid; + uint radiorev; + uint chiprev; + uint corerev; + uint boardid; + uint boardvendor; + uint boardrev; + uint driverrev; + uint ucoderev; + uint bus; + uint chipnum; + uint phytype; + uint phyrev; + uint anarev; + uint chippkg; + uint nvramrev; +} wlc_rev_info_t; + +#define WL_REV_INFO_LEGACY_LENGTH 48 + #define WLC_IOCTL_MAXLEN 8192 #define WLC_IOCTL_SMLEN 256 #define WLC_IOCTL_MEDLEN 1536 @@ -725,6 +751,29 @@ uint32 reinitreason[NREINITREASONCOUNT]; } wl_cnt_t; +typedef struct { + bool auto_en; + uint8 active_ant; + uint32 rxcount; + int16 avg_snr_per_ant0; + int16 avg_snr_per_ant1; + uint32 swap_ge_rxcount0; + uint32 swap_ge_rxcount1; + uint32 swap_ge_snrthresh0; + uint32 swap_ge_snrthresh1; + uint32 swap_txfail0; + uint32 swap_txfail1; + uint32 swap_timer0; + uint32 swap_timer1; + uint32 swap_alivecheck0; + uint32 swap_alivecheck1; + uint32 rxcount_per_ant0; + uint32 rxcount_per_ant1; + uint32 acc_rxcount; + uint32 acc_rxcount_per_ant0; + uint32 acc_rxcount_per_ant1; +} wlc_swdiv_stats_t; + #define WL_WME_CNT_VERSION 1 typedef struct { @@ -747,56 +796,296 @@ } wl_wme_cnt_t; -typedef struct { - uint8 protocol; - uint16 query_len; - uint16 response_len; - uint8 qrbuf[1]; -} wl_p2po_qr_t; - -typedef struct { - uint16 period; - uint16 interval; -} wl_p2po_listen_t; +typedef struct wl_mkeep_alive_pkt { + uint16 version; + uint16 length; + uint32 period_msec; + uint16 len_bytes; + uint8 keep_alive_id; + uint8 data[1]; +} wl_mkeep_alive_pkt_t; + +#define WL_MKEEP_ALIVE_VERSION 1 +#define WL_MKEEP_ALIVE_FIXED_LEN OFFSETOF(wl_mkeep_alive_pkt_t, data) +#define WL_MKEEP_ALIVE_PRECISION 500 + +typedef struct wl_mtcpkeep_alive_conn_pkt { + struct ether_addr saddr; + struct ether_addr daddr; + struct ipv4_addr sipaddr; + struct ipv4_addr dipaddr; + uint16 sport; + uint16 dport; + uint32 seq; + uint32 ack; + uint16 tcpwin; +} wl_mtcpkeep_alive_conn_pkt_t; + +typedef struct wl_mtcpkeep_alive_timers_pkt { + uint16 interval; + uint16 retry_interval; + uint16 retry_count; +} wl_mtcpkeep_alive_timers_pkt_t; -#define ANQPO_MAX_QUERY_SIZE 256 -typedef struct { - uint16 max_retransmit; - uint16 response_timeout; - uint16 max_comeback_delay; - uint16 max_retries; - uint16 query_len; - uint8 query_data[1]; -} wl_anqpo_set_t; +#ifndef ETHER_MAX_DATA +#define ETHER_MAX_DATA 1500 +#endif -typedef struct { - uint16 channel; - struct ether_addr addr; -} wl_anqpo_peer_t; +typedef struct wake_info { + uint32 wake_reason; + uint32 wake_info_len; + uchar packet[1]; +} wake_info_t; + +typedef struct wake_pkt { + uint32 wake_pkt_len; + uchar packet[1]; +} wake_pkt_t; + +#define WL_MTCPKEEP_ALIVE_VERSION 1 + +#ifdef WLBA + +#define WLC_BA_CNT_VERSION 1 + +typedef struct wlc_ba_cnt { + uint16 version; + uint16 length; + + uint32 txpdu; + uint32 txsdu; + uint32 txfc; + uint32 txfci; + uint32 txretrans; + uint32 txbatimer; + uint32 txdrop; + uint32 txaddbareq; + uint32 txaddbaresp; + uint32 txdelba; + uint32 txba; + uint32 txbar; + uint32 txpad[4]; + + uint32 rxpdu; + uint32 rxqed; + uint32 rxdup; + uint32 rxnobuf; + uint32 rxaddbareq; + uint32 rxaddbaresp; + uint32 rxdelba; + uint32 rxba; + uint32 rxbar; + uint32 rxinvba; + uint32 rxbaholes; + uint32 rxunexp; + uint32 rxpad[4]; +} wlc_ba_cnt_t; +#endif -#define ANQPO_MAX_PEER_LIST 64 -typedef struct { - uint16 count; - wl_anqpo_peer_t peer[1]; -} wl_anqpo_peer_list_t; +struct ampdu_tid_control { + uint8 tid; + uint8 enable; +}; -#define ANQPO_MAX_IGNORE_SSID 64 -typedef struct { - bool is_clear; - uint16 count; - wlc_ssid_t ssid[1]; -} wl_anqpo_ignore_ssid_list_t; +struct ampdu_ea_tid { + struct ether_addr ea; + uint8 tid; +}; -#define ANQPO_MAX_IGNORE_BSSID 64 -typedef struct { - bool is_clear; - uint16 count; - struct ether_addr bssid[1]; -} wl_anqpo_ignore_bssid_list_t; +struct ampdu_retry_tid { + uint8 tid; + uint8 retry; +}; #define TOE_TX_CSUM_OL 0x00000001 #define TOE_RX_CSUM_OL 0x00000002 +#define TOE_ERRTEST_TX_CSUM 0x00000001 +#define TOE_ERRTEST_RX_CSUM 0x00000002 +#define TOE_ERRTEST_RX_CSUM2 0x00000004 + +struct toe_ol_stats_t { + + uint32 tx_summed; + + uint32 tx_iph_fill; + uint32 tx_tcp_fill; + uint32 tx_udp_fill; + uint32 tx_icmp_fill; + + uint32 rx_iph_good; + uint32 rx_iph_bad; + uint32 rx_tcp_good; + uint32 rx_tcp_bad; + uint32 rx_udp_good; + uint32 rx_udp_bad; + uint32 rx_icmp_good; + uint32 rx_icmp_bad; + + uint32 tx_tcp_errinj; + uint32 tx_udp_errinj; + uint32 tx_icmp_errinj; + + uint32 rx_tcp_errinj; + uint32 rx_udp_errinj; + uint32 rx_icmp_errinj; +}; + +#define ARP_OL_AGENT 0x00000001 +#define ARP_OL_SNOOP 0x00000002 +#define ARP_OL_HOST_AUTO_REPLY 0x00000004 +#define ARP_OL_PEER_AUTO_REPLY 0x00000008 + +#define ARP_ERRTEST_REPLY_PEER 0x1 +#define ARP_ERRTEST_REPLY_HOST 0x2 + +#define ARP_MULTIHOMING_MAX 8 +#define ND_MULTIHOMING_MAX 10 + +struct arp_ol_stats_t { + uint32 host_ip_entries; + uint32 host_ip_overflow; + + uint32 arp_table_entries; + uint32 arp_table_overflow; + + uint32 host_request; + uint32 host_reply; + uint32 host_service; + + uint32 peer_request; + uint32 peer_request_drop; + uint32 peer_reply; + uint32 peer_reply_drop; + uint32 peer_service; +}; + +struct nd_ol_stats_t { + uint32 host_ip_entries; + uint32 host_ip_overflow; + uint32 peer_request; + uint32 peer_request_drop; + uint32 peer_reply_drop; + uint32 peer_service; +}; + +typedef struct wl_keep_alive_pkt { + uint32 period_msec; + uint16 len_bytes; + uint8 data[1]; +} wl_keep_alive_pkt_t; + +#define WL_KEEP_ALIVE_FIXED_LEN OFFSETOF(wl_keep_alive_pkt_t, data) + +typedef enum wl_pkt_filter_type { + WL_PKT_FILTER_TYPE_PATTERN_MATCH +} wl_pkt_filter_type_t; + +#define WL_PKT_FILTER_TYPE wl_pkt_filter_type_t + +typedef struct wl_pkt_filter_pattern { + uint32 offset; + uint32 size_bytes; + uint8 mask_and_pattern[1]; + +} wl_pkt_filter_pattern_t; + +typedef struct wl_pkt_filter { + uint32 id; + uint32 type; + uint32 negate_match; + union { + wl_pkt_filter_pattern_t pattern; + } u; +} wl_pkt_filter_t; + +typedef struct wl_tcp_keep_set { + uint32 val1; + uint32 val2; +} wl_tcp_keep_set_t; + +#define WL_PKT_FILTER_FIXED_LEN OFFSETOF(wl_pkt_filter_t, u) +#define WL_PKT_FILTER_PATTERN_FIXED_LEN OFFSETOF(wl_pkt_filter_pattern_t, mask_and_pattern) + +typedef struct wl_pkt_filter_enable { + uint32 id; + uint32 enable; +} wl_pkt_filter_enable_t; + +typedef struct wl_pkt_filter_list { + uint32 num; + wl_pkt_filter_t filter[1]; +} wl_pkt_filter_list_t; + +#define WL_PKT_FILTER_LIST_FIXED_LEN OFFSETOF(wl_pkt_filter_list_t, filter) + +typedef struct wl_pkt_filter_stats { + uint32 num_pkts_matched; + uint32 num_pkts_forwarded; + uint32 num_pkts_discarded; +} wl_pkt_filter_stats_t; + +#define WL_WOWL_MAGIC (1 << 0) +#define WL_WOWL_NET (1 << 1) +#define WL_WOWL_DIS (1 << 2) +#define WL_WOWL_RETR (1 << 3) +#define WL_WOWL_BCN (1 << 4) +#define WL_WOWL_TST (1 << 5) +#define WL_WOWL_M1 (1 << 6) +#define WL_WOWL_EAPID (1 << 7) +#define WL_WOWL_PME_GPIO (1 << 8) +#define WL_WOWL_NEEDTKIP1 (1 << 9) +#define WL_WOWL_GTK_FAILURE (1 << 10) +#define WL_WOWL_EXTMAGPAT (1 << 11) +#define WL_WOWL_ARPOFFLOAD (1 << 12) +#define WL_WOWL_WPA2 (1 << 13) +#define WL_WOWL_KEYROT (1 << 14) +#define WL_WOWL_BCAST (1 << 15) +#define WL_WOWL_SCANOL (1 << 16) +#define WL_WOWL_TCPKEEP_TIME (1 << 17) +#define WL_WOWL_MDNS_CONFLICT (1 << 18) +#define WL_WOWL_MDNS_SERVICE (1 << 19) +#define WL_WOWL_TCPKEEP_DATA (1 << 20) +#define WL_WOWL_FW_HALT (1 << 21) +#define WL_WOWL_ENAB_HWRADIO (1 << 22) +#define WL_WOWL_MIC_FAIL (1 << 23) +#define WL_WOWL_LINKDOWN (1 << 31) + +#define MAGIC_PKT_MINLEN 102 +#define MAGIC_PKT_NUM_MAC_ADDRS 16 + +typedef enum { + wowl_pattern_type_bitmap = 0, + wowl_pattern_type_arp, + wowl_pattern_type_na +} wowl_pattern_type_t; + +typedef struct wl_wowl_pattern { + uint32 masksize; + uint32 offset; + uint32 patternoffset; + uint32 patternsize; + uint32 id; + uint32 reasonsize; + wowl_pattern_type_t type; + +} wl_wowl_pattern_t; + +typedef struct wl_wowl_pattern_list { + uint count; + wl_wowl_pattern_t pattern[1]; +} wl_wowl_pattern_list_t; + +typedef struct wl_wowl_wakeind { + uint8 pci_wakeind; + uint32 ucode_wakeind; +} wl_wowl_wakeind_t; + +typedef struct { + uint32 pktlen; + void *sdu; +} tcp_keepalive_wake_pkt_infop_t; + typedef BWL_PRE_PACKED_STRUCT struct nbr_element { uint8 id; uint8 len; @@ -862,4 +1151,15 @@ struct ether_addr ea; } wlc_dwds_config_t; +#define WLC_KCK_LEN 16 +#define WLC_KEK_LEN 16 +#define WLC_REPLAY_CTR_LEN 8 + +typedef struct wlc_rekey_info { + uint32 offload_id; + uint8 kek[WLC_KEK_LEN]; + uint8 kck[WLC_KCK_LEN]; + uint8 replay_counter[WLC_REPLAY_CTR_LEN]; +} wlc_rekey_info_t; + #endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/shared/bcmwifi/include/bcmwifi_channels.h bcmwl-6.30.223.248+bdcom/src/src/shared/bcmwifi/include/bcmwifi_channels.h --- bcmwl-6.30.223.141+bdcom/src/src/shared/bcmwifi/include/bcmwifi_channels.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/shared/bcmwifi/include/bcmwifi_channels.h 2014-06-26 22:42:08.000000000 +1200 @@ -3,7 +3,7 @@ * This header file housing the define and function prototype use by * both the wl driver, tools & Apps. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -284,6 +284,8 @@ extern int wf_channel2mhz(uint channel, uint start_factor); +extern chanspec_t wf_chspec_80(uint8 ctrl_channel, uint8 primary_channel); + extern uint16 wf_channel2chspec(uint ctl_ch, uint bw); extern uint wf_channel2freq(uint channel); diff -Nru bcmwl-6.30.223.141+bdcom/src/src/shared/bcmwifi/include/bcmwifi_rates.h bcmwl-6.30.223.248+bdcom/src/src/shared/bcmwifi/include/bcmwifi_rates.h --- bcmwl-6.30.223.141+bdcom/src/src/shared/bcmwifi/include/bcmwifi_rates.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/shared/bcmwifi/include/bcmwifi_rates.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Indices for 802.11 a/b/g/n/ac 1-3 chain symmetric transmit rates * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/shared/linux_osl.c bcmwl-6.30.223.248+bdcom/src/src/shared/linux_osl.c --- bcmwl-6.30.223.141+bdcom/src/src/shared/linux_osl.c 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/shared/linux_osl.c 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Linux OS Independent Layer * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -55,11 +55,6 @@ uint bustype; bcm_mem_link_t *dbgmem_list; spinlock_t dbgmem_lock; -#ifdef BCMDBG_CTRACE - spinlock_t ctrace_lock; - struct list_head ctrace_list; - int ctrace_num; -#endif spinlock_t pktalloc_lock; }; @@ -179,12 +174,6 @@ break; } -#ifdef BCMDBG_CTRACE - spin_lock_init(&osh->ctrace_lock); - INIT_LIST_HEAD(&osh->ctrace_list); - osh->ctrace_num = 0; -#endif - spin_lock_init(&(osh->pktalloc_lock)); #ifdef BCMDBG @@ -224,9 +213,6 @@ osl_pkt_tonative(osl_t *osh, void *pkt) { struct sk_buff *nskb; -#ifdef BCMDBG_CTRACE - struct sk_buff *nskb1, *nskb2; -#endif if (osh->pub.pkttag) OSL_PKTTAG_CLEAR(pkt); @@ -234,33 +220,14 @@ for (nskb = (struct sk_buff *)pkt; nskb; nskb = nskb->next) { atomic_sub(PKTISCHAINED(nskb) ? PKTCCNT(nskb) : 1, &osh->pktalloced); -#ifdef BCMDBG_CTRACE - for (nskb1 = nskb; nskb1 != NULL; nskb1 = nskb2) { - if (PKTISCHAINED(nskb1)) { - nskb2 = PKTCLINK(nskb1); - } - else - nskb2 = NULL; - - DEL_CTRACE(osh, nskb1); - } -#endif } return (struct sk_buff *)pkt; } -#ifdef BCMDBG_CTRACE -void * BCMFASTPATH -osl_pkt_frmnative(osl_t *osh, void *pkt, int line, char *file) -#else void * BCMFASTPATH osl_pkt_frmnative(osl_t *osh, void *pkt) -#endif { struct sk_buff *nskb; -#ifdef BCMDBG_CTRACE - struct sk_buff *nskb1, *nskb2; -#endif if (osh->pub.pkttag) OSL_PKTTAG_CLEAR(pkt); @@ -268,28 +235,12 @@ for (nskb = (struct sk_buff *)pkt; nskb; nskb = nskb->next) { atomic_add(PKTISCHAINED(nskb) ? PKTCCNT(nskb) : 1, &osh->pktalloced); -#ifdef BCMDBG_CTRACE - for (nskb1 = nskb; nskb1 != NULL; nskb1 = nskb2) { - if (PKTISCHAINED(nskb1)) { - nskb2 = PKTCLINK(nskb1); - } - else - nskb2 = NULL; - - ADD_CTRACE(osh, nskb1, file, line); - } -#endif } return (void *)pkt; } -#ifdef BCMDBG_CTRACE -void * BCMFASTPATH -osl_pktget(osl_t *osh, uint len, int line, char *file) -#else void * BCMFASTPATH osl_pktget(osl_t *osh, uint len) -#endif { struct sk_buff *skb; @@ -302,9 +253,6 @@ #endif skb->priority = 0; -#ifdef BCMDBG_CTRACE - ADD_CTRACE(osh, skb, file, line); -#endif atomic_inc(&osh->pktalloced); } @@ -327,10 +275,6 @@ nskb = skb->next; skb->next = NULL; -#ifdef BCMDBG_CTRACE - DEL_CTRACE(osh, skb); -#endif - { if (skb->destructor) @@ -438,6 +382,10 @@ osl_pcmcia_attr(osh, offset, (char *) buf, size, TRUE); } +#ifdef BCMDBG_MEM + +static +#endif void * osl_malloc(osl_t *osh, uint size) { @@ -457,6 +405,10 @@ return (addr); } +#ifdef BCMDBG_MEM + +static +#endif void osl_mfree(osl_t *osh, void *addr, uint size) { @@ -481,6 +433,151 @@ return (osh->failed); } +#ifdef BCMDBG_MEM +#define MEMLIST_LOCK(osh, flags) spin_lock_irqsave(&(osh)->dbgmem_lock, flags) +#define MEMLIST_UNLOCK(osh, flags) spin_unlock_irqrestore(&(osh)->dbgmem_lock, flags) + +void * +osl_debug_malloc(osl_t *osh, uint size, int line, const char* file) +{ + bcm_mem_link_t *p; + const char* basename; + unsigned long flags = 0; + + if (!size) { + printk("%s: allocating zero sized mem at %s line %d\n", __FUNCTION__, file, line); + ASSERT(0); + } + + if (osh) { + MEMLIST_LOCK(osh, flags); + } + if ((p = (bcm_mem_link_t*)osl_malloc(osh, sizeof(bcm_mem_link_t) + size)) == NULL) { + if (osh) { + MEMLIST_UNLOCK(osh, flags); + } + return (NULL); + } + + p->size = size; + p->line = line; + p->osh = (void *)osh; + + basename = strrchr(file, '/'); + + if (basename) + basename++; + + if (!basename) + basename = file; + + strncpy(p->file, basename, BCM_MEM_FILENAME_LEN); + p->file[BCM_MEM_FILENAME_LEN - 1] = '\0'; + + if (osh) { + p->prev = NULL; + p->next = osh->dbgmem_list; + if (p->next) + p->next->prev = p; + osh->dbgmem_list = p; + MEMLIST_UNLOCK(osh, flags); + } + + return p + 1; +} + +void +osl_debug_mfree(osl_t *osh, void *addr, uint size, int line, const char* file) +{ + bcm_mem_link_t *p = (bcm_mem_link_t *)((int8*)addr - sizeof(bcm_mem_link_t)); + unsigned long flags = 0; + + ASSERT(osh == NULL || osh->magic == OS_HANDLE_MAGIC); + + if (p->size == 0) { + printk("osl_debug_mfree: double free on addr %p size %d at line %d file %s\n", + addr, size, line, file); + ASSERT(p->size); + return; + } + + if (p->size != size) { + printk("%s: dealloca size does not match alloc size\n", __FUNCTION__); + printk("Dealloc addr %p size %d at line %d file %s\n", addr, size, line, file); + printk("Alloc size %d line %d file %s\n", p->size, p->line, p->file); + ASSERT(p->size == size); + return; + } + + if (p->osh != (void *)osh) { + printk("osl_debug_mfree: alloc osh %p does not match dealloc osh %p\n", + p->osh, osh); + printk("Dealloc addr %p size %d at line %d file %s\n", addr, size, line, file); + printk("Alloc size %d line %d file %s\n", p->size, p->line, p->file); + ASSERT(p->osh == (void *)osh); + return; + } + + if (osh) { + MEMLIST_LOCK(osh, flags); + if (p->prev) + p->prev->next = p->next; + if (p->next) + p->next->prev = p->prev; + if (osh->dbgmem_list == p) + osh->dbgmem_list = p->next; + p->next = p->prev = NULL; + } + p->size = 0; + + osl_mfree(osh, p, size + sizeof(bcm_mem_link_t)); + if (osh) { + MEMLIST_UNLOCK(osh, flags); + } +} + +int +osl_debug_memdump(osl_t *osh, struct bcmstrbuf *b) +{ + bcm_mem_link_t *p; + unsigned long flags = 0; + + ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); + + MEMLIST_LOCK(osh, flags); + if (osh->dbgmem_list) { + if (b != NULL) + bcm_bprintf(b, " Address Size File:line\n"); + else + printf(" Address Size File:line\n"); + + for (p = osh->dbgmem_list; p; p = p->next) { + if (b != NULL) + bcm_bprintf(b, "%p %6d %s:%d\n", (char*)p + sizeof(bcm_mem_link_t), + p->size, p->file, p->line); + else + printf("%p %6d %s:%d\n", (char*)p + sizeof(bcm_mem_link_t), + p->size, p->file, p->line); + + if (p == p->next) { + if (b != NULL) + bcm_bprintf(b, "WARNING: loop-to-self " + "p %p p->next %p\n", p, p->next); + else + printf("WARNING: loop-to-self " + "p %p p->next %p\n", p, p->next); + + break; + } + } + } + MEMLIST_UNLOCK(osh, flags); + + return 0; +} + +#endif + uint osl_dma_consistent_align(void) { @@ -630,13 +727,8 @@ } } -#ifdef BCMDBG_CTRACE -void * -osl_pktdup(osl_t *osh, void *skb, int line, char *file) -#else void * osl_pktdup(osl_t *osh, void *skb) -#endif { void * p; @@ -656,71 +748,9 @@ OSL_PKTTAG_CLEAR(p); atomic_inc(&osh->pktalloced); -#ifdef BCMDBG_CTRACE - ADD_CTRACE(osh, (struct sk_buff *)p, file, line); -#endif return (p); } -#ifdef BCMDBG_CTRACE -int osl_pkt_is_frmnative(osl_t *osh, struct sk_buff *pkt) -{ - unsigned long flags; - struct sk_buff *skb; - int ck = FALSE; - - spin_lock_irqsave(&osh->ctrace_lock, flags); - - list_for_each_entry(skb, &osh->ctrace_list, ctrace_list) { - if (pkt == skb) { - ck = TRUE; - break; - } - } - - spin_unlock_irqrestore(&osh->ctrace_lock, flags); - return ck; -} - -void osl_ctrace_dump(osl_t *osh, struct bcmstrbuf *b) -{ - unsigned long flags; - struct sk_buff *skb; - int idx = 0; - int i, j; - - spin_lock_irqsave(&osh->ctrace_lock, flags); - - if (b != NULL) - bcm_bprintf(b, " Total %d sbk not free\n", osh->ctrace_num); - else - printk(" Total %d sbk not free\n", osh->ctrace_num); - - list_for_each_entry(skb, &osh->ctrace_list, ctrace_list) { - if (b != NULL) - bcm_bprintf(b, "[%d] skb %p:\n", ++idx, skb); - else - printk("[%d] skb %p:\n", ++idx, skb); - - for (i = 0; i < skb->ctrace_count; i++) { - j = (skb->ctrace_start + i) % CTRACE_NUM; - if (b != NULL) - bcm_bprintf(b, " [%s(%d)]\n", skb->func[j], skb->line[j]); - else - printk(" [%s(%d)]\n", skb->func[j], skb->line[j]); - } - if (b != NULL) - bcm_bprintf(b, "\n"); - else - printk("\n"); - } - - spin_unlock_irqrestore(&osh->ctrace_lock, flags); - - return; -} -#endif - uint32 osl_sysuptime(void) { diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_ethereal.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_ethereal.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_ethereal.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_ethereal.h 2014-06-26 22:42:08.000000000 +1200 @@ -4,7 +4,7 @@ * Broadcom 802.11abg Networking Device Driver * Derived from http://airsnort.shmoo.com/orinoco-09b-packet-1.diff * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.c bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.c --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.c 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.c 2014-08-01 11:15:21.000000000 +1200 @@ -2,7 +2,7 @@ * Linux-specific portion of Broadcom 802.11abg Networking Device Driver * cfg80211 interface * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -43,7 +43,11 @@ #define EVENT_FLAGS(e) dtoh16((e)->flags) #define EVENT_STATUS(e) dtoh32((e)->status) +#ifdef BCMDBG u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO; +#else +u32 wl_dbg_level = WL_DBG_ERR; +#endif static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev, enum nl80211_iftype type, u32 *flags, struct vif_params *params); @@ -1271,6 +1275,9 @@ } key_endian_to_device(&key); + if (wl->passive) { + schedule(); + } err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key)); if (err) { WL_ERR(("WLC_SET_KEY error (%d)\n", err)); @@ -1425,7 +1432,7 @@ s32 err = 0; if (memcmp(mac, wl->profile->bssid, ETHER_ADDR_LEN)) { - WL_ERR(("Wrong Mac address\n")); + WL_ERR(("Wrong Mac address, mac = %pM profile =%pM\n", mac, wl->profile->bssid)); return -ENOENT; } @@ -1584,6 +1591,184 @@ #endif +#ifdef CONFIG_PM +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + +static int +wl_wowl_ind_wake_reason(struct wl_cfg80211_priv *wl, struct cfg80211_wowlan_wakeup *wakeup) +{ + wl_wowl_wakeind_t wowl_ind; + s32 err; + + err = wl_dev_bufvar_get(wl_to_ndev(wl), "wowl_wakeind", + (s8 *)&wowl_ind, sizeof(wowl_ind)); + if (err != 0) { + WL_ERR(("Unable to get wake reason, err = %d\n", err)); + return -1; + } + + if (wowl_ind.ucode_wakeind == 0) { + WL_DBG(("System woke, but not by us\n")); + return 0; + } + WL_DBG(("wake reason is 0x%x\n", wowl_ind.ucode_wakeind)); + + if (wowl_ind.ucode_wakeind & WL_WOWL_MAGIC) { + WL_ERR(("WOWLAN Woke for: Magic Pkt\n")); + wakeup->magic_pkt = true; + } + if (wowl_ind.ucode_wakeind & WL_WOWL_DIS) { + WL_ERR(("WOWLAN Woke for: Disconnect\n")); + wakeup->disconnect = true; + } + if (wowl_ind.ucode_wakeind & WL_WOWL_BCN) { + WL_ERR(("WOWLAN Woke for: Beacon Loss\n")); + wakeup->disconnect = true; + } + if (wowl_ind.ucode_wakeind & WL_WOWL_GTK_FAILURE) { + WL_ERR(("WOWLAN Woke for: GTK failure\n")); + wakeup->gtk_rekey_failure = true; + } + if (wowl_ind.ucode_wakeind & WL_WOWL_EAPID) { + WL_ERR(("WOWLAN Woke for: EAP identify request\n")); + wakeup->eap_identity_req = true; + } + if (wowl_ind.ucode_wakeind & WL_WOWL_M1) { + WL_ERR(("WOWLAN Woke for: 4-way handshake request\n")); + wakeup->four_way_handshake = true; + } + return 1; +} +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) +static int +wl_cfg80211_rekey(struct wiphy *wiphy, struct net_device *ndev, + struct cfg80211_gtk_rekey_data *data) +{ + struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); + wlc_rekey_info_t rekey; + s32 err; + + if (!wl->offloads) { + return 0; + } + + memset(&rekey, 0, sizeof(rekey)); + memcpy(&rekey.kek, data->kek, WLC_KEK_LEN); + memcpy(&rekey.kck, data->kck, WLC_KCK_LEN); + memcpy(&rekey.replay_counter, data->replay_ctr, WLC_REPLAY_CTR_LEN); + WL_INF(("Send down replay counter %x%x%x%x%x%x%x%x\n", + rekey.replay_counter[0], rekey.replay_counter[1], rekey.replay_counter[2], + rekey.replay_counter[3], rekey.replay_counter[4], rekey.replay_counter[5], + rekey.replay_counter[6], rekey.replay_counter[7])); + + err = wl_dev_bufvar_set(wl_to_ndev(wl), "wowl_replay", (s8 *)&rekey, sizeof(rekey)); + if (err) { + WL_ERR(("Error calling wowl_set_key\n")); + return err; + } + return err; +} +#endif + +static int wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wowlan) +{ + struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); + uint wowl = 0; + s32 err; + + if (!wowlan) { + WL_DBG(("No wowlan requested\n")); + return 0; + } + if (!test_bit(WL_STATUS_CONNECTED, &wl->status)) { + WL_INF(("No wowl when not associated.\n")); + return 0; + } + + err = wl_dev_intvar_get(wl_to_ndev(wl), "wowl", &wowl); + if (err) { + WL_ERR(("Error fetching WOWL %d\n", err)); + } + if (wowlan->disconnect) { + WL_INF(("Requesting wake on Disconnect\n")); + wowl |= WL_WOWL_DIS | WL_WOWL_BCN; + } + if (wowlan->magic_pkt) { + WL_INF(("Requesting wake on Magic Pkt\n")); + wowl |= WL_WOWL_MAGIC; + } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) + if (wowlan->gtk_rekey_failure) { + WL_INF(("Requesting wake GTK rekey failure Pkt\n")); + wowl |= WL_WOWL_GTK_FAILURE; + } + if (wowlan->four_way_handshake) { + WL_INF(("Requesting wake on 4way handshake request\n")); + wowl |= WL_WOWL_M1; + } +#endif + + wowl |= WL_WOWL_KEYROT; + + err = wl_dev_intvar_set(wl_to_ndev(wl), "wowl", wowl); + if (err) { + WL_ERR(("Error enabling WOWL %d\n", err)); + } + + return err; +} +#else +static int wl_cfg80211_suspend(struct wiphy *wiphy) +{ + return 0; +} +#endif + +static int wl_cfg80211_resume(struct wiphy *wiphy) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) + struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy); + wlc_rekey_info_t *rekey = (wlc_rekey_info_t *)wl->extra_buf; + s32 err; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + struct cfg80211_wowlan_wakeup wakeup; + int result; + + memset(&wakeup, 0, sizeof(wakeup)); + wakeup.pattern_idx = -1; + + result = wl_wowl_ind_wake_reason(wl, &wakeup); + switch (result) { + case -1: + break; + case 0: + cfg80211_report_wowlan_wakeup(wl_to_wdev(wl), NULL, GFP_KERNEL); + break; + case 1: + cfg80211_report_wowlan_wakeup(wl_to_wdev(wl), &wakeup, GFP_KERNEL); + break; + } +#endif + + err = wl_dev_bufvar_get(wl_to_ndev(wl), "wowl_replay", (s8 *)rekey, + sizeof(wlc_rekey_info_t)); + if (!err) { + WL_INF(("Send up replay counter %x%x%x%x%x%x%x%x\n", + rekey->replay_counter[0], rekey->replay_counter[1], + rekey->replay_counter[2], rekey->replay_counter[3], + rekey->replay_counter[4], rekey->replay_counter[5], + rekey->replay_counter[6], rekey->replay_counter[7])); + cfg80211_gtk_rekey_notify(wl_to_ndev(wl), (u8 *)&wl->bssid.octet, + rekey->replay_counter, GFP_KERNEL); + } +#endif + return 0; +} +#endif + static struct cfg80211_ops wl_cfg80211_ops = { .change_virtual_intf = wl_cfg80211_change_iface, .scan = wl_cfg80211_scan, @@ -1600,6 +1785,13 @@ .set_power_mgmt = wl_cfg80211_set_power_mgmt, .connect = wl_cfg80211_connect, .disconnect = wl_cfg80211_disconnect, +#ifdef CONFIG_PM + .suspend = wl_cfg80211_suspend, + .resume = wl_cfg80211_resume, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) + .set_rekey_data = wl_cfg80211_rekey, +#endif +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33) .set_pmksa = wl_cfg80211_set_pmksa, .del_pmksa = wl_cfg80211_del_pmksa, @@ -1607,6 +1799,23 @@ #endif }; +#ifdef CONFIG_PM +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) +static const struct wiphy_wowlan_support wl_wowlan_support = { +#else +static struct wiphy_wowlan_support wl_wowlan_support = { +#endif + .flags = WIPHY_WOWLAN_MAGIC_PKT +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0) + | WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | WIPHY_WOWLAN_GTK_REKEY_FAILURE | + WIPHY_WOWLAN_EAP_IDENTITY_REQ +#endif + | WIPHY_WOWLAN_DISCONNECT, +}; +#endif +#endif + static s32 wl_mode_to_nl80211_iftype(s32 mode) { s32 err = 0; @@ -1655,6 +1864,17 @@ wdev->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; #endif + +#ifdef CONFIG_PM +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) + wdev->wiphy->wowlan = &wl_wowlan_support; +#else + wdev->wiphy->wowlan = wl_wowlan_support; +#endif +#endif +#endif + err = wiphy_register(wdev->wiphy); if (err < 0) { WL_ERR(("Couldn not register wiphy device (%d)\n", err)); @@ -1763,7 +1983,17 @@ #else freq = ieee80211_channel_to_frequency(notif_bss_info->channel); #endif + if (freq == 0) { + WL_ERR(("Invalid channel, fail to chcnage channel to freq\n")); + kfree(notif_bss_info); + return -EINVAL; + } channel = ieee80211_get_channel(wiphy, freq); + if (unlikely(!channel)) { + WL_ERR(("ieee80211_get_channel error\n")); + kfree(notif_bss_info); + return -EINVAL; + } WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n", bi->SSID, notif_bss_info->rssi, notif_bss_info->channel, @@ -1902,7 +2132,7 @@ BUG_ON(!len); err = wl_dev_ioctl(dev, WLC_GET_VAR, (void *)wl->ioctl_buf, WL_IOCTL_LEN_MAX); if (err) { - WL_ERR(("error (%d)\n", err)); + WL_INF(("error (%d)\n", err)); return err; } memcpy(buf, wl->ioctl_buf, buf_len); @@ -2046,6 +2276,7 @@ ie = bss->information_elements; ie_len = bss->len_information_elements; #endif + wl->conf->channel = *bss->channel; #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) cfg80211_put_bss(wiphy, bss); #else @@ -2079,11 +2310,12 @@ s32 err = 0; wl_get_assoc_ies(wl); + memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); wl_update_bss_info(wl); cfg80211_roamed(ndev, #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) - NULL, + &wl->conf->channel, #endif (u8 *)&wl->bssid, conn_info->req_ie, conn_info->req_ie_len, @@ -2102,27 +2334,28 @@ struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); s32 err = 0; - wl_get_assoc_ies(wl); - memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); - wl_update_bss_info(wl); + if (wl->scan_request) { + WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); + cfg80211_scan_done(wl->scan_request, true); + wl->scan_request = NULL; + } - WL_DBG(("Reporting BSS network join result \"%s\"\n", wl->profile->ssid.SSID)); if (test_and_clear_bit(WL_STATUS_CONNECTING, &wl->status)) { + if (completed) { + wl_get_assoc_ies(wl); + memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN); + memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN); + wl_update_bss_info(wl); + set_bit(WL_STATUS_CONNECTED, &wl->status); + } + + WL_DBG(("Reporting BSS network join result \"%s\"\n", + wl->profile->ssid.SSID)); cfg80211_connect_result(ndev, (u8 *)&wl->bssid, conn_info->req_ie, conn_info->req_ie_len, conn_info->resp_ie, conn_info->resp_ie_len, completed ? WLAN_STATUS_SUCCESS : WLAN_STATUS_AUTH_TIMEOUT, GFP_KERNEL); - WL_DBG(("connection %s\n", completed ? "succeeded" : "failed")); - } - else { - cfg80211_roamed(ndev, -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) - NULL, -#endif - (u8 *)&wl->bssid, conn_info->req_ie, conn_info->req_ie_len, - conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); - WL_DBG(("roaming result\n")); + WL_DBG(("Connection %s\n", completed ? "Succeeded" : "FAILed")); } - set_bit(WL_STATUS_CONNECTED, &wl->status); return err; } @@ -2356,7 +2589,7 @@ wl_deinit_priv_mem(wl); } -s32 wl_cfg80211_attach(struct net_device *ndev, struct device *dev) +s32 wl_cfg80211_attach(struct net_device *ndev, struct device *dev, int passive) { struct wireless_dev *wdev; struct wl_cfg80211_priv *wl; @@ -2382,6 +2615,7 @@ WL_ERR(("Failed to init iwm_priv (%d)\n", err)); goto cfg80211_attach_out; } + wl->passive = !!passive; if (!err) { WL_INF(("Registered CFG80211 phy\n")); @@ -2420,8 +2654,8 @@ WL_ERR(("eqeue empty..\n")); BUG(); } - WL_DBG(("event type (%d)\n", e->etype)); if (wl->el.handler[e->etype]) { + WL_DBG(("event type (%d)\n", e->etype)); wl->el.handler[e->etype] (wl, wl_to_ndev(wl), &e->emsg, e->edata); } else { WL_DBG(("Unknown Event (%d): ignoring\n", e->etype)); @@ -2550,6 +2784,32 @@ return 0; } +static void wl_update_wowl(struct net_device *ndev) +{ +#ifdef CONFIG_PM + struct wl_cfg80211_priv *wl = ndev_to_wl(ndev); + struct wireless_dev *wdev = ndev->ieee80211_ptr; + s32 offloads = 0; + s32 err = 0; + err = wl_dev_bufvar_get(wl_to_ndev(wl), "offloads", + (s8 *)&offloads, sizeof(offloads)); + if (err == 0 && offloads == 1) { + WL_INF(("Supports offloads\n")); + wl->offloads = true; + } else { + WL_INF(("No offloads supported\n")); + wl->offloads = false; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) + wdev->wiphy->wowlan = NULL; +#else + memset(&wdev->wiphy->wowlan, 0, sizeof(struct wiphy_wowlan_support)); +#endif +#endif + } +#endif +} + static s32 wl_update_wiphybands(struct wl_cfg80211_priv *wl) { struct wiphy *wiphy; @@ -2566,7 +2826,7 @@ phy = ((char *)&phy_list)[0]; WL_DBG(("%c phy\n", phy)); - if (phy == 'n' || phy == 'a') { + if (phy == 'n' || phy == 'a' || phy == 'v') { wiphy = wl_to_wiphy(wl); wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n; } @@ -2581,10 +2841,13 @@ struct wireless_dev *wdev = ndev->ieee80211_ptr; wl_set_mode(ndev, wdev->iftype); - err = wl_update_wiphybands(wl); + if (err) { + return err; + } - return err; + wl_update_wowl(ndev); + return 0; } s32 wl_cfg80211_down(struct net_device *ndev) diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.h 2014-06-26 22:42:08.000000000 +1200 @@ -2,7 +2,7 @@ * Linux-specific portion of Broadcom 802.11abg Networking Device Driver * cfg80211 interface * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -194,6 +194,8 @@ struct task_struct *event_tsk; unsigned long status; bool active_scan; + bool passive; + bool offloads; u8 *ioctl_buf; u8 *extra_buf; u8 ci[0] __attribute__ ((__aligned__(NETDEV_ALIGN))); @@ -219,7 +221,7 @@ #define for_each_bss(list, bss, __i) \ for (__i = 0; __i < list->count && __i < WL_AP_MAX; __i++, bss = next_bss(list, bss)) -extern s32 wl_cfg80211_attach(struct net_device *ndev, struct device *dev); +extern s32 wl_cfg80211_attach(struct net_device *ndev, struct device *dev, int flags); extern void wl_cfg80211_detach(struct net_device *ndev); extern void wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t *e, void *data); diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_key.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_key.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_key.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_key.h 2014-06-26 22:42:08.000000000 +1200 @@ -3,7 +3,7 @@ * and exported functions for * Broadcom 802.11abg Networking Device Driver * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -17,18 +17,27 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: wlc_key.h 382794 2013-02-04 17:34:08Z $ + * $Id: wlc_key.h 458427 2014-02-26 23:12:38Z $ */ #ifndef _wlc_key_h_ #define _wlc_key_h_ +#include + +typedef struct tkip_info { + uint16 phase1[TKHASH_P1_KEY_SIZE/sizeof(uint16)]; + uint8 phase2[TKHASH_P2_KEY_SIZE]; + uint32 micl; + uint32 micr; +} tkip_info_t; + typedef struct wsec_iv { uint32 hi; uint16 lo; } wsec_iv_t; -#define WLC_NUMRXIVS 16 +#define WLC_NUMRXIVS 4 #define TWSIZE 128 @@ -48,8 +57,17 @@ uint8 data[DOT11_MAX_KEY_SIZE]; wsec_iv_t rxiv[WLC_NUMRXIVS]; wsec_iv_t txiv; + tkip_info_t tkip_tx; + tkip_info_t tkip_rx; + uint32 tkip_rx_iv32; + uint8 tkip_rx_ividx; + uint8 tkip_tx_lefts; + uint8 tkip_tx_left[4]; + uint16 tkip_tx_offset; + uint8 tkip_tx_fmic[8]; + int tkip_tx_fmic_written; -#ifdef WLOFFLD +#if defined(UCODE_SEQ) wsec_iv_t bk_iv; tkip_info_t tkip_bk_tx; #endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_pub.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_pub.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_pub.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_pub.h 2014-06-26 22:42:08.000000000 +1200 @@ -2,7 +2,7 @@ * Common (OS-independent) definitions for * Broadcom 802.11abg Networking Device Driver * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: wlc_pub.h 413887 2013-07-22 20:36:17Z $ + * $Id: wlc_pub.h 458427 2014-02-26 23:12:38Z $ */ #ifndef _wlc_pub_h_ @@ -279,31 +279,18 @@ bool promisc; bool delayed_down; -#ifdef TRAFFIC_MGMT - bool _traffic_mgmt; -#endif -#ifdef NET_DETECT - bool _net_detect; -#endif -#ifdef PLC - bool _plc; -#ifdef PLC_WET - bool plc_path; -#endif -#endif bool _ap; bool _apsta; bool _assoc_recreate; int _wme; uint8 _mbss; -#ifdef WLAWDL - bool _awdl; -#endif bool associated; bool phytest_on; bool bf_preempt_4306; + bool _wowl; + bool _wowl_active; bool _ampdu_tx; bool _ampdu_rx; bool _amsdu_tx; @@ -349,6 +336,7 @@ pktpool_t *pktpool; uint8 _ampdumac; bool _wleind; + bool _sup_enab; uint driverrev; bool _11h; @@ -429,7 +417,6 @@ uint encoding; uint nfrmtype; struct wl_if *wlif; -#ifdef WL11AC uint8 nss; uint8 coding; uint16 aid; @@ -438,7 +425,6 @@ uint16 vhtflags; uint8 bw_nonht; uint32 ampdu_counter; -#endif } wl_rxsts_t; typedef struct wl_txsts { @@ -584,6 +570,152 @@ #define PROP_TXSTATUS_ENAB(pub) 0 +#define WLOFFLD_CAP(wlc) ((wlc)->ol != NULL) +#define WLOFFLD_ENAB(pub) ((pub)->_ol) +#define WLOFFLD_BCN_ENAB(pub) ((pub)->_ol & OL_BCN_ENAB) +#define WLOFFLD_ARP_ENAB(pub) ((pub)->_ol & OL_ARP_ENAB) +#define WLOFFLD_ND_ENAB(pub) ((pub)->_ol & OL_ND_ENAB) +#define WLOFFLD_ARM_TX(pub) ((pub)->_ol & OL_ARM_TX_ENAB) + +#define WOWL_ENAB(pub) ((pub)->_wowl) +#define WOWL_ACTIVE(pub) ((pub)->_wowl_active) + + #define DPT_ENAB(pub) 0 + + #define TDLS_SUPPORT(pub) (0) + #define TDLS_ENAB(pub) (0) + +#define WLDLS_ENAB(pub) 0 + +#ifdef WL_OKC + #if defined(WL_ENAB_RUNTIME_CHECK) +#define OKC_ENAB(pub) ((pub)->_okc) + #elif defined(WL_OKC_DISABLED) + #define OKC_ENAB(pub) (0) +#else + #define OKC_ENAB(pub) ((pub)->_okc) +#endif +#else + #define OKC_ENAB(pub) (0) +#endif + +#define WLBSSLOAD_ENAB(pub) (0) + + #define MCNX_ENAB(pub) 0 + + #define P2P_ENAB(pub) 0 + + #define MCHAN_ENAB(pub) (0) + #define MCHAN_ACTIVE(pub) (0) + + #define MQUEUE_ENAB(pub) (0) + + #define BTA_ENAB(pub) (0) + +#define PIO_ENAB(pub) 0 + +#define CAC_ENAB(pub) ((pub)->_cac) + +#define COEX_ACTIVE(wlc) 0 +#define COEX_ENAB(pub) 0 + +#define RXIQEST_ENAB(pub) (0) + +#define EDCF_ENAB(pub) (WME_ENAB(pub)) +#define QOS_ENAB(pub) (WME_ENAB(pub) || N_ENAB(pub)) + +#define PRIOFC_ENAB(pub) ((pub)->_priofc) + +#define MONITOR_ENAB(wlc) ((wlc)->monitor != 0) + +#define PROMISC_ENAB(wlc_pub) (wlc_pub)->promisc + +#define WLC_SENDUP_MGMT_ENAB(cfg) 0 + + #define TOE_ENAB(pub) (0) + + #define ARPOE_SUPPORT(pub) (0) + #define ARPOE_ENAB(pub) (0) +#define ICMPOE_ENAB(pub) 0 + + #define NWOE_ENAB(pub) (0) + +#define TRAFFIC_MGMT_ENAB(pub) 0 + + #define L2_FILTER_ENAB(pub) (0) + +#define NET_DETECT_ENAB(pub) 0 + +#ifdef PACKET_FILTER +#define PKT_FILTER_ENAB(pub) ((pub)->_pkt_filter) +#else +#define PKT_FILTER_ENAB(pub) 0 +#endif + +#ifdef P2PO + #if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD) + #define P2PO_ENAB(pub) ((pub)->_p2po) + #elif defined(P2PO_DISABLED) + #define P2PO_ENAB(pub) (0) + #else + #define P2PO_ENAB(pub) (1) + #endif +#else + #define P2PO_ENAB(pub) 0 +#endif + +#ifdef ANQPO + #if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD) + #define ANQPO_ENAB(pub) ((pub)->_anqpo) + #elif defined(ANQPO_DISABLED) + #define ANQPO_ENAB(pub) (0) + #else + #define ANQPO_ENAB(pub) (1) + #endif +#else + #define ANQPO_ENAB(pub) 0 +#endif + +#define ASSOC_RECREATE_ENAB(pub) 0 + +#define WLFBT_ENAB(pub) (0) + +#if 0 && (NDISVER >= 0x0620) +#define WIN7_AND_UP_OS(pub) ((pub)->_ndis_cap) +#else +#define WIN7_AND_UP_OS(pub) 0 +#endif + + #define NDOE_ENAB(pub) (0) + + #define WLEXTSTA_ENAB(pub) 0 + + #define IBSS_PEER_GROUP_KEY_ENAB(pub) (0) + + #define IBSS_PEER_DISCOVERY_EVENT_ENAB(pub) (0) + + #define IBSS_PEER_MGMT_ENAB(pub) (0) + + #if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD) + #define WLEIND_ENAB(pub) ((pub)->_wleind) + #elif defined(WLEIND_DISABLED) + #define WLEIND_ENAB(pub) (0) + #else + #define WLEIND_ENAB(pub) (1) + #endif + + #define CCX_ENAB(pub) 0 + + #define BCMAUTH_PSK_ENAB(pub) 0 + + #if defined(WL_ENAB_RUNTIME_CHECK) || !defined(DONGLEBUILD) + #define SUP_ENAB(pub) ((pub)->_sup_enab) + #elif defined(BCMSUP_PSK_DISABLED) + #define SUP_ENAB(pub) (0) + #else + #define SUP_ENAB(pub) (1) + #endif + #define WLC_PREC_BMP_ALL MAXBITVAL(WLC_PREC_COUNT) #define WLC_PREC_BMP_AC_BE (NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_BE)) | \ @@ -622,7 +754,7 @@ #define LPC_ENAB(wlc) (FALSE) -#if defined(WLOLPC) && defined(WL11AC) +#if defined(WLOLPC) #define OLPC_ENAB(wlc) ((wlc)->pub->_olpc) #else #define OLPC_ENAB(wlc) (FALSE) @@ -701,11 +833,9 @@ extern wlc_pub_t *wlc_pub(void *wlc); -#if defined(BCMPCIDEV) || defined(WLOFFLD) - extern void tcm_sem_enter(wlc_info_t *wlc); extern void tcm_sem_exit(wlc_info_t *wlc); -#endif +extern void tcm_sem_cleanup(wlc_info_t *wlc); extern int wlc_module_register(wlc_pub_t *pub, const bcm_iovar_t *iovars, const char *name, void *hdl, iovar_fn_t iovar_fn, @@ -735,7 +865,7 @@ void wlc_update_isr_stats(wlc_info_t *wlc, uint32 macintstatus); #endif -#define WLC_REPLAY_CNTRS_VALUE WPA_CAP_16_REPLAY_CNTRS +#define WLC_REPLAY_CNTRS_VALUE WPA_CAP_4_REPLAY_CNTRS #if WLC_REPLAY_CNTRS_VALUE == WPA_CAP_16_REPLAY_CNTRS #define PRIO2IVIDX(prio) (prio) diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_types.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_types.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_types.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_types.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Forward declarations for commonly used wl driver structs * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -50,15 +50,13 @@ typedef struct wlc_ap_info wlc_ap_info_t; typedef struct wlc_scan_info wlc_scan_info_t; typedef struct dpt_info dpt_info_t; -#ifdef WLAWDL -typedef struct awdl_info awdl_info_t; -#endif typedef struct tdls_info tdls_info_t; typedef struct dls_info dls_info_t; typedef struct l2_filter_info l2_filter_info_t; typedef struct wlc_auth_info wlc_auth_info_t; typedef struct wlc_psta_info wlc_psta_info_t; typedef struct wlc_psa wlc_psa_t; +typedef struct wowl_info wowl_info_t; typedef struct wlc_plt_info wlc_plt_pub_t; typedef struct supplicant supplicant_t; typedef struct authenticator authenticator_t; @@ -83,9 +81,7 @@ typedef struct cca_info cca_info_t; typedef struct itfr_info itfr_info_t; -#ifdef WLOFFLD typedef struct wlc_ol_info_t wlc_ol_info_t; -#endif #ifdef WLOLPC typedef struct wlc_olpc_eng_info_t wlc_olpc_eng_info_t; #endif @@ -113,15 +109,6 @@ typedef struct wlc_rfc wlc_rfc_t; typedef struct wlc_pktc_info wlc_pktc_info_t; -#ifdef TRAFFIC_MGMT -typedef struct wlc_trf_mgmt_ctxt wlc_trf_mgmt_ctxt_t; -typedef struct wlc_trf_mgmt_info wlc_trf_mgmt_info_t; -#endif - -#ifdef NET_DETECT -typedef struct wlc_net_detect_ctxt wlc_net_detect_ctxt_t; -#endif - typedef struct wlc_lpc_info wlc_lpc_info_t; typedef struct lpc_info lpc_info_t; typedef struct rate_lcb_info rate_lcb_info_t; @@ -129,17 +116,6 @@ typedef struct wlc_txbf_info wlc_txbf_info_t; typedef struct wlc_bcn_clsg_info wlc_bcn_clsg_info_t; -#ifdef WLRXOE -typedef struct wlc_dngl_ol_info wlc_dngl_ol_info_t; -typedef struct wlc_dngl_ol_bcn_info wlc_dngl_ol_bcn_info_t; -typedef struct wlc_dngl_ol_pkt_filter_info wlc_dngl_ol_pkt_filter_info_t; -typedef struct wlc_dngl_ol_wowl_info wlc_dngl_ol_wowl_info_t; -typedef struct wlc_dngl_ol_l2keepalive_info wlc_dngl_ol_l2keepalive_info_t; -typedef struct wlc_dngl_ol_gtk_info wlc_dngl_ol_gtk_info_t; -typedef struct wlc_dngl_ol_mdns_info wlc_dngl_ol_mdns_info_t; -typedef struct wlc_dngl_ol_rssi_info wlc_dngl_ol_rssi_info_t; -typedef struct wlc_dngl_ol_eventlog_info wlc_dngl_ol_eventlog_info_t; -#endif typedef struct wlc_nar_info wlc_nar_info_t; diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_utils.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_utils.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_utils.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_utils.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * utilities related header file * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_wowl.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_wowl.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wlc_wowl.h 1970-01-01 12:00:00.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wlc_wowl.h 2014-06-26 22:42:08.000000000 +1200 @@ -0,0 +1,86 @@ +/* + * Wake-on-Wireless related header file + * + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: wlc_wowl.h 458427 2014-02-26 23:12:38Z $ +*/ + +#ifndef _wlc_wowl_h_ +#define _wlc_wowl_h_ + +#define WLC_WOWL_OFFLOADS + +extern wowl_info_t *wlc_wowl_attach(wlc_info_t *wlc); +extern void wlc_wowl_detach(wowl_info_t *wowl); +extern bool wlc_wowl_cap(struct wlc_info *wlc); +extern bool wlc_wowl_enable(wowl_info_t *wowl); +extern uint32 wlc_wowl_clear(wowl_info_t *wowl); +void wlc_wowl_wake_reason_process(wlc_info_t *wlc); +#if defined(WLC_WOWL_OFFLOADS) +extern void wlc_wowl_set_wpa_m1(wowl_info_t *wowl); +extern void wlc_wowl_set_eapol_id(wowl_info_t *wowl); +extern int wlc_wowl_set_key_info(wowl_info_t *wowl, uint32 offload_id, void *kek, + int kek_len, void* kck, int kck_len, void *replay_counter, int replay_counter_len); +extern int wlc_wowl_add_offload_ipv4_arp(wowl_info_t *wowl, uint32 offload_id, + uint8 * RemoteIPv4Address, uint8 *HostIPv4Address, uint8 * MacAddress); +extern int wlc_wowl_add_offload_ipv6_ns(wowl_info_t *wowl, uint32 offload_id, + uint8 * RemoteIPv6Address, uint8 *SolicitedNodeIPv6Address, + uint8 * MacAddress, uint8 * TargetIPv6Address1, uint8 * TargetIPv6Address2); + +extern void wlc_wowl_set_keepalive(wowl_info_t *wowl, uint16 period_keepalive); +extern uint8 *wlc_wowl_solicitipv6_addr(uint8 *TargetIPv6Address1, uint8 *solicitaddress); +extern int wlc_wowl_remove_offload(wowl_info_t *wowl, uint32 offload_id, uint32 * type); +extern int wlc_wowl_get_replay_counter(wowl_info_t *wowl, void *replay_counter, int *len); + +extern void wlc_wowl_enable_completed(wowl_info_t *wowl); +extern void wlc_wowl_disable_completed(wowl_info_t *wowl, void *wowl_host_info); +#endif + +#define WOWL_IPV4_ARP_TYPE 0 +#define WOWL_IPV6_NS_TYPE 1 +#define WOWL_DOT11_RSN_REKEY_TYPE 2 +#define WOWL_OFFLOAD_INVALID_TYPE 3 + +#define WOWL_IPV4_ARP_IDX 0 +#define WOWL_IPV6_NS_0_IDX 1 +#define WOWL_IPV6_NS_1_IDX 2 +#define WOWL_DOT11_RSN_REKEY_IDX 3 +#define WOWL_OFFLOAD_INVALID_IDX 4 + +#define MAX_WOWL_OFFLOAD_ROWS 4 +#define MAX_WOWL_IPV6_ARP_PATTERNS 1 +#define MAX_WOWL_IPV6_NS_PATTERNS 2 +#define MAX_WOWL_IPV6_NS_OFFLOADS 1 + +#define WOWL_INT_RESERVED_MASK 0xFF000000 +#define WOWL_INT_DATA_MASK 0x00FFFFFF +#define WOWL_INT_PATTERN_FLAG 0x80000000 +#define WOWL_INT_NS_TA2_FLAG 0x40000000 +#define WOWL_INT_PATTERN_IDX_MASK 0x0F000000 +#define WOWL_INT_PATTERN_IDX_SHIFT 24 + +#define MAXPATTERNS(wlc) \ + (wlc_wowl_cap(wlc) ? \ + (WLOFFLD_CAP(wlc) ? 12 : \ + ((D11REV_GE((wlc)->pub->corerev, 15) && D11REV_LT((wlc)->pub->corerev, 40)) ? 12 : 4)) \ + : 0) + +#define WOWL_OFFLOAD_ENABLED(wlc) \ + ((CHIPID(wlc->pub->sih->chip) == BCM4360_CHIP_ID) || WIN7_AND_UP_OS(wlc->pub)) + +#define WOWL_KEEPALIVE_FIXED_PARAM 11 + +#endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_dbg.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_dbg.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_dbg.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_dbg.h 2014-06-26 22:42:08.000000000 +1200 @@ -2,7 +2,7 @@ * Minimal debug/trace/assert driver definitions for * Broadcom 802.11 Networking Adapter. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_export.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_export.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_export.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_export.h 2014-06-26 22:42:08.000000000 +1200 @@ -2,7 +2,7 @@ * Required functions exported by the port-specific (os-dependent) driver * to common (os-independent) driver code. * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: wl_export.h 395432 2013-04-08 00:59:35Z $ + * $Id: wl_export.h 419219 2013-08-20 07:39:11Z $ */ #ifndef _wl_export_h_ @@ -43,17 +43,7 @@ extern void wl_recover_nocard(struct wl_info *wl); extern void wl_devicerecovery(struct wl_info *wl ); -#ifdef WLOFFLD extern uint32 wl_pcie_bar1(struct wl_info *wl, uchar** addr); -#endif -#ifdef WLRXOE -extern void wl_watchdog(struct wl_info *wl); -extern void wl_msgup(struct wl_info *wl, osl_t *osh, void* resp); -extern void * wl_get_arpi(struct wl_info *wl, struct wl_if *wlif); -extern void * wl_get_icmpi(struct wl_info *wl, struct wl_if *wlif); -extern void * wl_get_tcpkeepi(struct wl_info *wl, struct wl_if *wlif); -extern void * wl_get_ndi(struct wl_info *wl, struct wl_if *wlif); -#endif struct wl_timer; extern struct wl_timer *wl_init_timer(struct wl_info *wl, void (*fn)(void* arg), void *arg, @@ -87,11 +77,5 @@ #define wl_sort_bsslist(a, b) FALSE -extern int wl_tkip_miccheck(struct wl_info *wl, void *p, int hdr_len, bool group_key, int id); -extern int wl_tkip_micadd(struct wl_info *wl, void *p, int hdr_len); -extern int wl_tkip_encrypt(struct wl_info *wl, void *p, int hdr_len); -extern int wl_tkip_decrypt(struct wl_info *wl, void *p, int hdr_len, bool group_key); -extern void wl_tkip_printstats(struct wl_info *wl, bool group_key); -extern int wl_tkip_keyset(struct wl_info *wl, wsec_key_t *key); #define wl_outputpacket_complete(a, b, c) do { } while (0) #endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_iw.c bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_iw.c --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_iw.c 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_iw.c 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Linux Wireless Extensions support * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -15,7 +15,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: wl_iw.c 362836 2012-10-14 22:48:41Z $ + * $Id: wl_iw.c 458427 2014-02-26 23:12:38Z $ */ #if defined(USE_IW) diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_iw.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_iw.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_iw.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_iw.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * Linux Wireless Extensions support * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_linux.c bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_linux.c --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_linux.c 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_linux.c 2014-08-01 11:15:21.000000000 +1200 @@ -2,7 +2,7 @@ * Linux-specific portion of * Broadcom 802.11abg Networking Device Driver * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,7 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: wl_linux.c 397462 2013-04-18 22:02:26Z $ + * $Id: wl_linux.c 461277 2014-03-11 18:55:39Z $ */ #define LINUX_PORT @@ -67,8 +67,7 @@ #include #include #include - -typedef const struct si_pub si_t; +#include #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 4, 5) #error "No support for Kernel Rev <= 2.4.5, As the older kernel revs doesn't support Tasklets" @@ -92,6 +91,8 @@ #include #endif +#include + static void wl_timer(ulong data); static void _wl_timer(wl_timer_t *t); static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); @@ -103,41 +104,17 @@ #define TXQ_LOCK(_wl) spin_lock_bh(&(_wl)->txq_lock) #define TXQ_UNLOCK(_wl) spin_unlock_bh(&(_wl)->txq_lock) +static void wl_set_multicast_list_workitem(struct work_struct *work); + +static void wl_timer_task(wl_task_t *task); +static void wl_dpc_rxwork(struct wl_task *task); + static int wl_reg_proc_entry(wl_info_t *wl); static int wl_linux_watchdog(void *ctx); static int wl_found = 0; -struct ieee80211_tkip_data { -#define TKIP_KEY_LEN 32 - u8 key[TKIP_KEY_LEN]; - int key_set; - - u32 tx_iv32; - u16 tx_iv16; - u16 tx_ttak[5]; - int tx_phase1_done; - - u32 rx_iv32; - u16 rx_iv16; - u16 rx_ttak[5]; - int rx_phase1_done; - u32 rx_iv32_new; - u16 rx_iv16_new; - - u32 dot11RSNAStatsTKIPReplays; - u32 dot11RSNAStatsTKIPICVErrors; - u32 dot11RSNAStatsTKIPLocalMICFailures; - - int key_idx; - - struct crypto_tfm *tfm_arc4; - struct crypto_tfm *tfm_michael; - - u8 rx_hdr[16], tx_hdr[16]; -}; - typedef struct priv_link { wl_if_t *wlif; } priv_link_t; @@ -204,6 +181,9 @@ module_param(assert_type, int, 0); #endif +static int passivemode = 0; +module_param(passivemode, int, 0); + #define WL_TXQ_THRESH 0 static int wl_txq_thresh = WL_TXQ_THRESH; module_param(wl_txq_thresh, int, 0); @@ -545,6 +525,18 @@ wl->unit = unit; atomic_set(&wl->callbacks, 0); + wl->all_dispatch_mode = (passivemode == 0) ? TRUE : FALSE; + if (WL_ALL_PASSIVE_ENAB(wl)) { + + MY_INIT_WORK(&wl->txq_task.work, (work_func_t)wl_start_txqwork); + wl->txq_task.context = wl; + + MY_INIT_WORK(&wl->multicast_task.work, (work_func_t)wl_set_multicast_list_workitem); + + MY_INIT_WORK(&wl->wl_dpc_task.work, (work_func_t)wl_dpc_rxwork); + wl->wl_dpc_task.context = wl; + } + wl->txq_dispatched = FALSE; wl->txq_head = wl->txq_tail = NULL; wl->txq_cnt = 0; @@ -593,10 +585,8 @@ goto fail; } -#ifdef WLOFFLD wl->bar1_addr = bar1_addr; wl->bar1_size = bar1_size; -#endif spin_lock_init(&wl->lock); spin_lock_init(&wl->isr_lock); @@ -640,16 +630,7 @@ #endif bcopy(&wl->pub->cur_etheraddr, dev->dev_addr, ETHER_ADDR_LEN); -#ifdef CONFIG_SMP - - online_cpus = num_online_cpus(); -#if defined(BCM47XX_CA9) - if (online_cpus > 1 && wl_txq_thresh == 0) - wl_txq_thresh = 512; -#endif -#else online_cpus = 1; -#endif WL_ERROR(("wl%d: online cpus %d\n", unit, online_cpus)); @@ -657,14 +638,6 @@ tasklet_init(&wl->tx_tasklet, wl_tx_tasklet, (ulong)wl); -#ifdef KEEP_ALIVE - - if ((wl->keep_alive_info = wl_keep_alive_attach(wl->wlc)) == NULL) { - WL_ERROR(("wl%d: wl_keep_alive_attach failed\n", unit)); - goto fail; - } -#endif - { if (request_irq(irq, wl_isr, IRQF_SHARED, dev->name, wl)) { WL_ERROR(("wl%d: request_irq() failed\n", unit)); @@ -683,7 +656,7 @@ parentdev = &((struct pci_dev *)btparam)->dev; } if (parentdev) { - if (wl_cfg80211_attach(dev, parentdev)) { + if (wl_cfg80211_attach(dev, parentdev, WL_ALL_PASSIVE_ENAB(wl))) { goto fail; } } @@ -707,20 +680,6 @@ wlif->dev_registed = TRUE; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) - wl->tkipmodops = lib80211_get_crypto_ops("TKIP"); - if (wl->tkipmodops == NULL) { - request_module("lib80211_crypt_tkip"); - wl->tkipmodops = lib80211_get_crypto_ops("TKIP"); - } -#else - wl->tkipmodops = ieee80211_get_crypto_ops("TKIP"); - if (wl->tkipmodops == NULL) { - request_module("ieee80211_crypt_tkip"); - wl->tkipmodops = ieee80211_get_crypto_ops("TKIP"); - } -#endif #endif #ifdef USE_IW wlif->iw.wlinfo = (void *)wl; @@ -758,8 +717,9 @@ wl_reg_proc_entry(wl); - printf("%s: Broadcom BCM%04x 802.11 Hybrid Wireless Controller " EPI_VERSION_STR, - dev->name, device); + printf("%s: Broadcom BCM%04x 802.11 Hybrid Wireless Controller%s %s", + dev->name, device, + WL_ALL_PASSIVE_ENAB(wl) ? ", Passive Mode" : "", EPI_VERSION_STR); #ifdef BCMDBG printf(" (Compiled in " SRCBASE " at " __TIME__ " on " __DATE__ ")"); @@ -809,11 +769,9 @@ pci_read_config_dword(pdev, 0x40, &val); if ((val & 0x0000ff00) != 0) pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); -#ifdef WLOFFLD bar1_size = pci_resource_len(pdev, 2); bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2), bar1_size); -#endif wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev, pdev->irq, bar1_addr, bar1_size); @@ -826,60 +784,66 @@ } static int +#if !defined(SIMPLE_DEV_PM_OPS) wl_suspend(struct pci_dev *pdev, DRV_SUSPEND_STATE_TYPE state) { +#else +wl_suspend(struct device *dev) +{ + struct pci_dev *pdev = to_pci_dev(dev); +#endif wl_info_t *wl = (wl_info_t *) pci_get_drvdata(pdev); - - WL_TRACE(("wl: wl_suspend\n")); - - wl = (wl_info_t *) pci_get_drvdata(pdev); if (!wl) { WL_ERROR(("wl: wl_suspend: pci_get_drvdata failed\n")); return -ENODEV; } + WL_ERROR(("%s: PCI Suspend handler\n", __FUNCTION__)); WL_LOCK(wl); - WL_APSTA_UPDN(("wl%d (%s): wl_suspend() -> wl_down()\n", wl->pub->unit, wl->dev->name)); - wl_down(wl); - wl->pub->hw_up = FALSE; + if (WLOFFLD_ENAB(wl->pub) && wlc_iovar_setint(wl->wlc, "wowl_activate", 1) == 0) { + WL_TRACE(("%s: Enabled WOWL OFFLOAD\n", __FUNCTION__)); + } else { + WL_ERROR(("%s: Not WOWL capable\n", __FUNCTION__)); + wl_down(wl); + wl->pub->hw_up = FALSE; + } WL_UNLOCK(wl); - PCI_SAVE_STATE(pdev, wl->pci_psstate); - pci_disable_device(pdev); - return pci_set_power_state(pdev, PCI_D3hot); + + if (BUSTYPE(wl->pub->sih->bustype) == PCI_BUS) + si_pci_sleep(wl->pub->sih); + + return 0; } static int +#if !defined(SIMPLE_DEV_PM_OPS) wl_resume(struct pci_dev *pdev) { - wl_info_t *wl = (wl_info_t *) pci_get_drvdata(pdev); +#else +wl_resume(struct device *dev) +{ + struct pci_dev *pdev = to_pci_dev(dev); +#endif int err = 0; - uint32 val; - - WL_TRACE(("wl: wl_resume\n")); - + wl_info_t *wl = (wl_info_t *) pci_get_drvdata(pdev); if (!wl) { WL_ERROR(("wl: wl_resume: pci_get_drvdata failed\n")); return -ENODEV; } - err = pci_set_power_state(pdev, PCI_D0); - if (err) - return err; - - PCI_RESTORE_STATE(pdev, wl->pci_psstate); - - err = pci_enable_device(pdev); - if (err) - return err; - - pci_set_master(pdev); - - pci_read_config_dword(pdev, 0x40, &val); - if ((val & 0x0000ff00) != 0) - pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + WL_ERROR(("%s: PCI Resume handler\n", __FUNCTION__)); + if (WLOFFLD_ENAB(wl->pub)) { + wlc_iovar_setint(wl->wlc, "wowl_activate", 0); + wlc_wowl_wake_reason_process(wl->wlc); + + if (WOWL_ACTIVE(wl->pub)) { + if (BUSTYPE(wl->pub->sih->bustype) == PCI_BUS) { + si_pci_pmeclr(wl->pub->sih); + } + } + } WL_LOCK(wl); - WL_APSTA_UPDN(("wl%d: (%s): wl_resume() -> wl_up()\n", wl->pub->unit, wl->dev->name)); err = wl_up(wl); WL_UNLOCK(wl); @@ -910,14 +874,22 @@ pci_set_drvdata(pdev, NULL); } +#if defined(SIMPLE_DEV_PM_OPS) +static SIMPLE_DEV_PM_OPS(wl_pm_ops, wl_suspend, wl_resume); +#endif + static struct pci_driver wl_pci_driver = { - name: "wl", - probe: wl_pci_probe, - suspend: wl_suspend, - resume: wl_resume, - remove: __devexit_p(wl_remove), - id_table: wl_id_table, - }; + .name = "wl", + .probe = wl_pci_probe, + .remove = __devexit_p(wl_remove), + .id_table = wl_id_table, +#ifdef SIMPLE_DEV_PM_OPS + .driver.pm = &wl_pm_ops, +#else + .suspend = wl_suspend, + .resume = wl_resume, +#endif +}; static int __init wl_module_init(void) @@ -955,13 +927,20 @@ } #endif + { + const char *var = getvar(NULL, "wl_dispatch_mode"); + if (var) + passivemode = bcm_strtoul(var, NULL, 0); + if (passivemode) + printf("%s: passivemode enabled\n", __FUNCTION__); + } + #ifdef BCMDBG_ASSERT if (assert_type != 0xdeadbeef) g_assert_type = assert_type; #endif -#if defined(CONFIG_WL_ALL_PASSIVE_RUNTIME) { char *var = getvar(NULL, "wl_txq_thresh"); if (var) @@ -971,7 +950,6 @@ __FUNCTION__, wl_txq_thresh)); #endif } -#endif if (!(error = pci_module_init(&wl_pci_driver))) return (0); @@ -1011,10 +989,6 @@ wl->dev = NULL; } -#ifdef KEEP_ALIVE - wl_keep_alive_detach(wl->keep_alive_info); -#endif - tasklet_kill(&wl->tasklet); tasklet_kill(&wl->tx_tasklet); @@ -1054,42 +1028,30 @@ } wl->regsva = NULL; -#ifdef WLOFFLD if (wl->bar1_addr) { iounmap(wl->bar1_addr); wl->bar1_addr = NULL; } -#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - - if (wl->tkipmodops != NULL) { - int idx; - if (wl->tkip_ucast_data) { - wl->tkipmodops->deinit(wl->tkip_ucast_data); - wl->tkip_ucast_data = NULL; - } - for (idx = 0; idx < NUM_GROUP_KEYS; idx++) { - if (wl->tkip_bcast_data[idx]) { - wl->tkipmodops->deinit(wl->tkip_bcast_data[idx]); - wl->tkip_bcast_data[idx] = NULL; - } - } - } #endif wl_txq_free(wl); MFREE(osh, wl, sizeof(wl_info_t)); -#ifdef BCMDBG_CTRACE - PKT_CTRACE_DUMP(osh, NULL); -#endif if (MALLOCED(osh)) { printf("Memory leak of bytes %d\n", MALLOCED(osh)); +#ifndef BCMDBG_MEM ASSERT(0); +#endif } +#ifdef BCMDBG_MEM + + MALLOC_DUMP(osh, NULL); +#endif + osl_detach(osh); } @@ -1497,6 +1459,14 @@ WL_UNLOCK(wl); + if (WL_ALL_PASSIVE_ENAB(wl)) { + int i = 0; + for (i = 0; (atomic_read(&wl->callbacks) > callbacks) && i < 10000; i++) { + schedule(); + flush_scheduled_work(); + } + } + else { SPINWAIT((atomic_read(&wl->callbacks) > callbacks), 100 * 1000); @@ -1838,6 +1808,15 @@ { if (!WL_ALL_PASSIVE_ENAB((wl_info_t *)WL_INFO(dev))) _wl_set_multicast_list(dev); + else { + wl_info_t *wl = WL_INFO(dev); + wl->multicast_task.context = dev; + + if (schedule_work(&wl->multicast_task.work)) { + + atomic_inc(&wl->callbacks); + } + } } static void @@ -1851,7 +1830,7 @@ wl_info_t *wl; int i, buflen; struct maclist *maclist; - bool allmulti; + int allmulti; if (!dev) return; @@ -1926,6 +1905,12 @@ if (wantdpc) { ASSERT(wl->resched == FALSE); + if (WL_ALL_PASSIVE_ENAB(wl)) { + if (schedule_work(&wl->wl_dpc_task.work)) + atomic_inc(&wl->callbacks); + else + ASSERT(0); + } else tasklet_schedule(&wl->tasklet); } } @@ -1960,13 +1945,26 @@ } if (!wl->pub->up) { + + if ((WL_ALL_PASSIVE_ENAB(wl))) { + atomic_dec(&wl->callbacks); + } goto done; } - if (wl->resched) - tasklet_schedule(&wl->tasklet); + if (wl->resched) { + if (!(WL_ALL_PASSIVE_ENAB(wl))) + tasklet_schedule(&wl->tasklet); + else + if (!schedule_work(&wl->wl_dpc_task.work)) { + + ASSERT(0); + } + } else { + if (WL_ALL_PASSIVE_ENAB(wl)) + atomic_dec(&wl->callbacks); wl_intrson(wl); } @@ -1975,6 +1973,16 @@ return; } +static void BCMFASTPATH +wl_dpc_rxwork(struct wl_task *task) +{ + wl_info_t *wl = (wl_info_t *)task->context; + WL_TRACE(("wl%d: %s\n", wl->pub->unit, __FUNCTION__)); + + wl_dpc((unsigned long)wl); + return; +} + void BCMFASTPATH wl_sendup(wl_info_t *wl, wl_if_t *wlif, void *p, int numpkt) { @@ -2068,9 +2076,6 @@ if (i) bcm_bprintf(b, "\n"); -#ifdef BCMDBG_CTRACE - PKT_CTRACE_DUMP(wl->osh, b); -#endif return 0; } #endif @@ -2138,11 +2143,7 @@ tasklet_schedule(&wl->tx_tasklet); } -#ifdef CONFIG_SMP -#define WL_CONFIG_SMP() TRUE -#else #define WL_CONFIG_SMP() FALSE -#endif static int BCMFASTPATH wl_start(struct sk_buff *skb, struct net_device *dev) @@ -2180,6 +2181,8 @@ if (!WL_ALL_PASSIVE_ENAB(wl)) wl_sched_tx_tasklet(wl); + else + err = (int32)(schedule_work(&wl->txq_task.work) == 0); if (!err) { atomic_inc(&wl->callbacks); @@ -2262,12 +2265,39 @@ } static void +wl_set_multicast_list_workitem(struct work_struct *work) +{ + wl_task_t *task = (wl_task_t *)work; + struct net_device *dev = (struct net_device*)task->context; + wl_info_t *wl; + + wl = WL_INFO(dev); + + atomic_dec(&wl->callbacks); + + _wl_set_multicast_list(dev); +} + +static void +wl_timer_task(wl_task_t *task) +{ + wl_timer_t *t = (wl_timer_t *)task->context; + + _wl_timer(t); + MFREE(t->wl->osh, task, sizeof(wl_task_t)); + + atomic_dec(&t->wl->callbacks); +} + +static void wl_timer(ulong data) { wl_timer_t *t = (wl_timer_t *)data; if (!WL_ALL_PASSIVE_ENAB(t->wl)) _wl_timer(t); + else + wl_schedule_task(t->wl, wl_timer_task, t); } static void @@ -2364,7 +2394,7 @@ #ifdef BCMDBG WL_INFORM(("wl%d: Failed to delete timer %s\n", wl->unit, t->name)); #endif - return FALSE; + return TRUE; } atomic_dec(&wl->callbacks); } @@ -2614,10 +2644,8 @@ if (rxsts->phytype == WL_RXS_PHY_N) { if (rxsts->encoding == WL_RXS_ENCODING_HT) rtap_len = sizeof(wl_radiotap_ht_t); -#ifdef WL11AC else if (rxsts->encoding == WL_RXS_ENCODING_VHT) rtap_len = sizeof(wl_radiotap_vht_t); -#endif else rtap_len = sizeof(wl_radiotap_legacy_t); } else { @@ -2668,13 +2696,9 @@ if (rxsts->pkterror & WL_RXS_CRC_ERROR) flags |= IEEE80211_RADIOTAP_F_BADFCS; -#ifdef WL11AC if ((rxsts->phytype != WL_RXS_PHY_N) || ((rxsts->encoding != WL_RXS_ENCODING_HT) && (rxsts->encoding != WL_RXS_ENCODING_VHT))) { -#else - if (rxsts->phytype != WL_RXS_PHY_N || rxsts->encoding != WL_RXS_ENCODING_HT) { -#endif wl_radiotap_legacy_t *rtl = (wl_radiotap_legacy_t *)skb->data; rtl->ieee_radiotap.it_version = 0; @@ -2699,7 +2723,6 @@ memset(&rtl->nonht_vht, 0, sizeof(rtl->nonht_vht)); rtl->nonht_vht.len = WL_RADIOTAP_NONHT_VHT_LEN; -#ifdef WL11AC if (((fc & FC_KIND_MASK) == FC_RTS) || ((fc & FC_KIND_MASK) == FC_CTS)) { rtl->nonht_vht.flags |= WL_RADIOTAP_F_NONHT_VHT_BW; @@ -2712,9 +2735,7 @@ rtl->nonht_vht.flags |= WL_RADIOTAP_F_NONHT_VHT_DYN_BW; } -#endif } -#ifdef WL11AC else if (rxsts->encoding == WL_RXS_ENCODING_VHT) { wl_radiotap_vht_t *rtvht = (wl_radiotap_vht_t *)skb->data; @@ -2809,7 +2830,6 @@ if (rxsts->nfrmtype & WL_RXS_NFRM_AMPDU_NONE) rtvht->ampdu_flags |= IEEE80211_RADIOTAP_AMPDU_MPDU_ONLY; } -#endif else if (rxsts->encoding == WL_RXS_ENCODING_HT) { wl_radiotap_ht_t *rtht = (wl_radiotap_ht_t *)skb->data; @@ -3047,213 +3067,6 @@ return len; } -int -wl_tkip_miccheck(wl_info_t *wl, void *p, int hdr_len, bool group_key, int key_index) -{ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - struct sk_buff *skb = (struct sk_buff *)p; - skb->dev = wl->dev; - - if (wl->tkipmodops) { - if (group_key && wl->tkip_bcast_data[key_index]) - return (wl->tkipmodops->decrypt_msdu(skb, key_index, hdr_len, - wl->tkip_bcast_data[key_index])); - else if (!group_key && wl->tkip_ucast_data) - return (wl->tkipmodops->decrypt_msdu(skb, key_index, hdr_len, - wl->tkip_ucast_data)); - } -#endif - WL_ERROR(("%s: No tkip mod ops\n", __FUNCTION__)); - return -1; - -} - -int -wl_tkip_micadd(wl_info_t *wl, void *p, int hdr_len) -{ - int error = -1; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - struct sk_buff *skb = (struct sk_buff *)p; - skb->dev = wl->dev; - - if (wl->tkipmodops) { - if (wl->tkip_ucast_data) - error = wl->tkipmodops->encrypt_msdu(skb, hdr_len, wl->tkip_ucast_data); - if (error) - WL_ERROR(("Error encrypting MSDU %d\n", error)); - } - else -#endif - WL_ERROR(("%s: No tkip mod ops\n", __FUNCTION__)); - return error; -} - -int -wl_tkip_encrypt(wl_info_t *wl, void *p, int hdr_len) -{ - int error = -1; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - struct sk_buff *skb = (struct sk_buff *)p; - skb->dev = wl->dev; - - if (wl->tkipmodops) { - if (wl->tkip_ucast_data) - error = wl->tkipmodops->encrypt_mpdu(skb, hdr_len, wl->tkip_ucast_data); - if (error) { - WL_ERROR(("Error encrypting MPDU %d\n", error)); - } - } - else -#endif - WL_ERROR(("%s: No tkip mod ops\n", __FUNCTION__)); - return error; - -} - -int -wl_tkip_decrypt(wl_info_t *wl, void *p, int hdr_len, bool group_key) -{ - int err = -1; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - struct sk_buff *skb = (struct sk_buff *)p; - uint8 *pos; - uint8 key_idx = 0; - - if (group_key) { - skb->dev = wl->dev; - pos = skb->data + hdr_len; - key_idx = pos[3]; - key_idx >>= 6; - WL_ERROR(("%s: Invalid key_idx %d\n", __FUNCTION__, key_idx)); - ASSERT(key_idx < NUM_GROUP_KEYS); - } - - if (wl->tkipmodops) { - if (group_key && key_idx < NUM_GROUP_KEYS && wl->tkip_bcast_data[key_idx]) - err = wl->tkipmodops->decrypt_mpdu(skb, hdr_len, - wl->tkip_bcast_data[key_idx]); - else if (!group_key && wl->tkip_ucast_data) - err = wl->tkipmodops->decrypt_mpdu(skb, hdr_len, wl->tkip_ucast_data); - } - else - WL_ERROR(("%s: No tkip mod ops\n", __FUNCTION__)); - -#endif - - return err; -} - -int -wl_tkip_keyset(wl_info_t *wl, wsec_key_t *key) -{ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - bool group_key = FALSE; - uchar rxseq[IW_ENCODE_SEQ_MAX_SIZE]; - - if (key->len != 0) { - WL_WSEC(("%s: Key Length is Not zero\n", __FUNCTION__)); - if (key->algo != CRYPTO_ALGO_TKIP) { - WL_WSEC(("%s: Algo is Not TKIP %d\n", __FUNCTION__, key->algo)); - return 0; - } - WL_WSEC(("%s: Trying to set a key in TKIP Mod\n", __FUNCTION__)); - } - else - WL_WSEC(("%s: Trying to Remove a Key from TKIP Mod\n", __FUNCTION__)); - - if (ETHER_ISNULLADDR(&key->ea) || ETHER_ISBCAST(&key->ea)) { - group_key = TRUE; - WL_WSEC(("Group Key index %d\n", key->id)); - } - else - WL_WSEC(("Unicast Key index %d\n", key->id)); - - if (wl->tkipmodops) { - uint8 keybuf[8]; - if (group_key) { - if (key->len) { - if (!wl->tkip_bcast_data[key->id]) { - WL_WSEC(("Init TKIP Bcast Module\n")); - WL_UNLOCK(wl); - wl->tkip_bcast_data[key->id] = - wl->tkipmodops->init(key->id); - WL_LOCK(wl); - } - if (wl->tkip_bcast_data[key->id]) { - WL_WSEC(("TKIP SET BROADCAST KEY******************\n")); - bzero(rxseq, IW_ENCODE_SEQ_MAX_SIZE); - bcopy(&key->rxiv, rxseq, 6); - bcopy(&key->data[24], keybuf, sizeof(keybuf)); - bcopy(&key->data[16], &key->data[24], sizeof(keybuf)); - bcopy(keybuf, &key->data[16], sizeof(keybuf)); - wl->tkipmodops->set_key(&key->data, key->len, - (uint8 *)&key->rxiv, wl->tkip_bcast_data[key->id]); - } - } - else { - if (wl->tkip_bcast_data[key->id]) { - WL_WSEC(("Deinit TKIP Bcast Module\n")); - wl->tkipmodops->deinit(wl->tkip_bcast_data[key->id]); - wl->tkip_bcast_data[key->id] = NULL; - } - } - } - else { - if (key->len) { - if (!wl->tkip_ucast_data) { - WL_WSEC(("Init TKIP Ucast Module\n")); - WL_UNLOCK(wl); - wl->tkip_ucast_data = wl->tkipmodops->init(key->id); - WL_LOCK(wl); - } - if (wl->tkip_ucast_data) { - WL_WSEC(("TKIP SET UNICAST KEY******************\n")); - bzero(rxseq, IW_ENCODE_SEQ_MAX_SIZE); - bcopy(&key->rxiv, rxseq, 6); - bcopy(&key->data[24], keybuf, sizeof(keybuf)); - bcopy(&key->data[16], &key->data[24], sizeof(keybuf)); - bcopy(keybuf, &key->data[16], sizeof(keybuf)); - wl->tkipmodops->set_key(&key->data, key->len, - (uint8 *)&key->rxiv, wl->tkip_ucast_data); - } - } - else { - if (wl->tkip_ucast_data) { - WL_WSEC(("Deinit TKIP Ucast Module\n")); - wl->tkipmodops->deinit(wl->tkip_ucast_data); - wl->tkip_ucast_data = NULL; - } - } - } - } - else -#endif - WL_WSEC(("%s: No tkip mod ops\n", __FUNCTION__)); - return 0; -} - -void -wl_tkip_printstats(wl_info_t *wl, bool group_key) -{ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) - char debug_buf[512]; - int idx; - if (wl->tkipmodops) { - if (group_key) { - for (idx = 0; idx < NUM_GROUP_KEYS; idx++) { - if (wl->tkip_bcast_data[idx]) - wl->tkipmodops->print_stats(debug_buf, - wl->tkip_bcast_data[idx]); - } - } else if (!group_key && wl->tkip_ucast_data) - wl->tkipmodops->print_stats(debug_buf, wl->tkip_ucast_data); - else - return; - printk("%s: TKIP stats from module: %s\n", debug_buf, group_key?"Bcast":"Ucast"); - } -#endif -} - #if defined(WL_CONFIG_RFKILL) static int @@ -3408,31 +3221,43 @@ return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) static int wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data) +#else +static ssize_t +wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *data) +#endif { wl_info_t * wl = (wl_info_t *)data; - int bcmerror, to_user; + int to_user; int len; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) if (offset > 0) { *eof = 1; return 0; } +#endif if (!length) { WL_ERROR(("%s: Not enough return buf space\n", __FUNCTION__)); return 0; } WL_LOCK(wl); - bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL); + wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL); len = sprintf(buffer, "%d\n", to_user); WL_UNLOCK(wl); return len; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) static int wl_proc_write(struct file *filp, const char *buff, unsigned long length, void *data) +#else +static ssize_t +wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *data) +#endif { wl_info_t * wl = (wl_info_t *)data; int from_user = 0; @@ -3462,25 +3287,38 @@ return length; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +static const struct file_operations wl_fops = { + .owner = THIS_MODULE, + .read = wl_proc_read, + .write = wl_proc_write, +}; +#endif + static int wl_reg_proc_entry(wl_info_t *wl) { char tmp[32]; sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) { WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp)); +#else + if ((wl->proc_entry = proc_create(tmp, 0644, NULL, &wl_fops)) == NULL) { + WL_ERROR(("%s: proc_create %s failed\n", __FUNCTION__, tmp)); +#endif ASSERT(0); return -1; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) wl->proc_entry->read_proc = wl_proc_read; wl->proc_entry->write_proc = wl_proc_write; wl->proc_entry->data = wl; +#endif return 0; } -#ifdef WLOFFLD uint32 wl_pcie_bar1(struct wl_info *wl, uchar** addr) { *addr = wl->bar1_addr; return (wl->bar1_size); } -#endif diff -Nru bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_linux.h bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_linux.h --- bcmwl-6.30.223.141+bdcom/src/src/wl/sys/wl_linux.h 2013-08-01 18:52:22.000000000 +1200 +++ bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_linux.h 2014-06-26 22:42:08.000000000 +1200 @@ -1,7 +1,7 @@ /* * wl_linux.c exported functions and definitions * - * Copyright (C) 2013, Broadcom Corporation. All Rights Reserved. + * Copyright (C) 2014, Broadcom Corporation. All Rights Reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -121,6 +121,12 @@ struct sk_buff *txq_tail; int txq_cnt; + wl_task_t txq_task; + wl_task_t multicast_task; + + wl_task_t wl_dpc_task; + bool all_dispatch_mode; + #if defined(WL_CONFIG_RFKILL) struct rfkill_stuff wl_rfkill; mbool last_phyind; @@ -128,13 +134,8 @@ uint processed; struct proc_dir_entry *proc_entry; -#ifdef WLOFFLD uchar* bar1_addr; uint32 bar1_size; -#endif -#ifdef KEEP_ALIVE - wl_keep_alive_info_t *keep_alive_info; -#endif }; #define HYBRID_PROC "brcm_monitor" @@ -142,7 +143,7 @@ #if defined(WL_ALL_PASSIVE_ON) #define WL_ALL_PASSIVE_ENAB(wl) 1 #else -#define WL_ALL_PASSIVE_ENAB(wl) 0 +#define WL_ALL_PASSIVE_ENAB(wl) (!(wl)->all_dispatch_mode) #endif #define WL_LOCK(wl) \