endif
ifneq ($(CONFIG_BCMDHD_SDIO),)
- # DHDCFLAGS += -DBDC -DOOB_INTR_ONLY -DDHD_BCMEVENTS -DMMC_SDIO_ABORT
+# DHDCFLAGS += -DBDC -DOOB_INTR_ONLY -DDHD_BCMEVENTS -DMMC_SDIO_ABORT -DHW_OOB
DHDCFLAGS += -DBDC -DSDIO_ISR_THREAD -DDHD_BCMEVENTS -DMMC_SDIO_ABORT
DHDCFLAGS += -DBCMSDIO -DBCMLXSDMMC -DUSE_SDIOFIFO_IOVAR
endif
* Misc utility routines for accessing chip-specific features
* of the SiliconBackplane-based Broadcom chips.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: aiutils.c 432226 2013-10-26 04:34:36Z $
+ * $Id: aiutils.c 530682 2015-01-30 18:48:21Z $
*/
#include <bcm_cfg.h>
#include <typedefs.h>
{
uint32 ent;
uint inv = 0, nom = 0;
+ uint32 size = 0;
while (TRUE) {
ent = R_REG(si_osh(sih), *eromptr);
if ((ent & mask) == match)
break;
+ /* escape condition related EROM size if it has invalid values */
+ size += sizeof(*eromptr);
+ if (size >= ER_SZ_MAX) {
+ SI_ERROR(("Failed to find end of EROM marker\n"));
+ break;
+ }
+
nom++;
}
/*
* bcmevent read-only data shared by kernel or app layers
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
BCMEVENT_NAME(WLC_E_ACTION_FRAME_RX),
BCMEVENT_NAME(WLC_E_ACTION_FRAME_COMPLETE),
#endif
-#ifdef BCMWAPI_WAI
- BCMEVENT_NAME(WLC_E_WAI_STA_EVENT),
- BCMEVENT_NAME(WLC_E_WAI_MSG),
-#endif /* BCMWAPI_WAI */
BCMEVENT_NAME(WLC_E_ESCAN_RESULT),
BCMEVENT_NAME(WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE),
#ifdef WLP2P
* BCMSDH interface glue
* implement bcmsdh API for SDIOH driver
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* SDIO access interface for drivers - linux specific (pci only)
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh_sdmmc.c 457662 2014-02-24 15:07:28Z $
+ * $Id: bcmsdh_sdmmc.c 557203 2015-05-18 02:05:14Z $
*/
#include <typedefs.h>
static void IRQHandlerF2(struct sdio_func *func);
#endif /* !defined(OOB_INTR_ONLY) */
static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, uint32 regaddr);
-static int sdio_reset_comm(struct mmc_card *card);
+//extern int sdio_reset_comm(struct mmc_card *card);
+
+/* workaround to simply return 0 as suggested by Broadcom */
+static int sdio_reset_comm(struct mmc_card *card)
+{
+ return 0;
+}
#define DEFAULT_SDIO_F2_BLKSIZE 512
#ifndef CUSTOM_SDIO_F2_BLKSIZE
int sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, uint32 regaddr, int regsize, uint32 *data);
-/* workaround to simply return 0 as suggested by Broadcom */
-static int sdio_reset_comm(struct mmc_card *card)
-{
- return 0;
-}
-
static int
sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
{
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
}
+#ifdef BCMSDIOH_TXGLOM
static SDIOH_API_RC
sdioh_request_packet_chain(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
uint addr, void *pkt)
sd_trace(("%s: Exit\n", __FUNCTION__));
return SDIOH_API_RC_SUCCESS;
}
+#endif /* BCMSDIOH_TXGLOM */
static SDIOH_API_RC
sdioh_buffer_tofrom_bus(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
if (pkt) {
+#ifdef BCMSDIOH_TXGLOM
/* packet chain, only used for tx/rx glom, all packets length
* are aligned, total length is a block multiple
*/
if (PKTNEXT(sd->osh, pkt))
return sdioh_request_packet_chain(sd, fix_inc, write, func, addr, pkt);
-
+#endif /* BCMSDIOH_TXGLOM */
/* non-glom mode, ignore the buffer parameter and use the packet pointer
* (this shouldn't happen)
*/
/*
* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh_sdmmc_linux.c 434724 2013-11-07 05:38:43Z $
+ * $Id: bcmsdh_sdmmc_linux.c 523920 2015-01-05 06:07:16Z $
*/
#include <typedefs.h>
if (func->num != 2)
return 0;
+ dhd_mmc_suspend = TRUE;
sdioh = sdio_get_drvdata(func);
err = bcmsdh_suspend(sdioh->bcmsdh);
- if (err)
+ if (err) {
+ dhd_mmc_suspend = FALSE;
return err;
+ }
sdio_flags = sdio_get_host_pm_caps(func);
if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
sd_err(("%s: can't keep power while host is suspended\n", __FUNCTION__));
+ dhd_mmc_suspend = FALSE;
return -EINVAL;
}
err = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
if (err) {
sd_err(("%s: error while trying to keep power\n", __FUNCTION__));
+ dhd_mmc_suspend = FALSE;
return err;
}
#if defined(OOB_INTR_ONLY)
bcmsdh_oob_intr_set(sdioh->bcmsdh, FALSE);
#endif
- dhd_mmc_suspend = TRUE;
smp_mb();
return 0;
/*
* Broadcom SPI Host Controller Driver - Linux Per-port
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom BCMSDH to gSPI Protocol Conversion Layer
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Driver O/S-independent utility routines
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
- * $Id: bcmutils.c 490613 2014-07-11 05:23:34Z $
+ * $Id: bcmutils.c 530682 2015-01-30 18:48:21Z $
*/
#include <bcm_cfg.h>
struct pktq_prec *q;
ASSERT(prec >= 0 && prec < pq->num_prec);
- ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))); /* queueing chains not allowed */
+ /* queueing chains not allowed and no segmented SKB (Kernel-3.18.y) */
+ ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p)));
ASSERT(!pktq_full(pq));
ASSERT(!pktq_pfull(pq, prec));
- PKTSETLINK(p, NULL);
q = &pq->q[prec];
if (q->head)
struct pktq_prec *q;
ASSERT(prec >= 0 && prec < pq->num_prec);
- ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))); /* queueing chains not allowed */
+ /* queueing chains not allowed and no segmented SKB (Kernel-3.18.y) */
+ ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p)));
ASSERT(!pktq_full(pq));
ASSERT(!pktq_pfull(pq, prec));
- PKTSETLINK(p, NULL);
q = &pq->q[prec];
bcm_tlv_t *elt;
int totlen;
- elt = (bcm_tlv_t*)buf;
+ if ((elt = (bcm_tlv_t*)buf) == NULL) {
+ return NULL;
+ }
totlen = buflen;
/* find tagged parameter */
/* indicate the str was too short */
if (flags != 0) {
- if (len < 2)
- p -= 2 - len; /* overwrite last char */
p += snprintf(p, 2, ">");
}
strncpy(buf, name, buflen);
/* append data onto the end of the name string */
- memcpy(&buf[len], data, datalen);
- len += datalen;
+ if (data) {
+ memcpy(&buf[len], data, datalen);
+ len += datalen;
+ }
return len;
}
* Contents are wifi-specific, used by any kernel or app-level
* software that might want wifi things as it grows.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* This header file housing the define and function prototype use by
* both the wl driver, tools & Apps.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Indices for 802.11 a/b/g/n/ac 1-3 chain symmetric transmit rates
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Initialization and support routines for self-booting compressed image.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd.h 492809 2014-07-23 11:21:52Z $
+ * $Id: dhd.h 557502 2015-05-19 06:32:03Z $
*/
/****************
#include <wlfc_proto.h>
-#if defined(WL11U)
-#define MFP /* Applying interaction with MFP by spec HS2.0 REL2 */
-#endif /* WL11U */
-
#if defined(KEEP_ALIVE)
/* Default KEEP_ALIVE Period is 55 sec to prevent AP from sending Keep Alive probe frame */
#define KEEP_ALIVE_PERIOD 55000
DHD_PREALLOC_RXBUF,
DHD_PREALLOC_DATABUF,
DHD_PREALLOC_OSL_BUF,
-#if defined(STATIC_WL_PRIV_STRUCT)
DHD_PREALLOC_WIPHY_ESCAN0 = 5,
-#endif /* STATIC_WL_PRIV_STRUCT */
- DHD_PREALLOC_DHD_INFO = 7
+ DHD_PREALLOC_WIPHY_ESCAN1 = 6,
+ DHD_PREALLOC_DHD_INFO = 7,
+ DHD_PREALLOC_DHD_WLFC_INFO = 8,
+ DHD_PREALLOC_SECTION_MAX = DHD_PREALLOC_DHD_WLFC_INFO
};
+#define PREALLOC_MASK_LEN 4
+
/* Packet alignment for most efficient SDIO (can change based on platform) */
#ifndef DHD_SDALIGN
#define DHD_SDALIGN 32
wl_country_t dhd_cspec; /* Current Locale info */
char eventmask[WL_EVENTING_MASK_LEN];
+ char prealloc_malloc_mask[PREALLOC_MASK_LEN];
int op_mode; /* STA, HostAPD, WFD, SoftAP */
/* Set this to 1 to use a seperate interface (p2p0) for p2p operations.
uint32 tick; /* O/S tick time (usec) */
} dhd_timeout_t;
+#ifdef SHOW_LOGTRACE
+typedef struct {
+ int num_fmts;
+ char **fmts;
+ char *raw_fmts;
+ char *raw_sstr;
+ uint32 ramstart;
+ uint32 rodata_start;
+ uint32 rodata_end;
+ char *rom_raw_sstr;
+ uint32 rom_ramstart;
+ uint32 rom_rodata_start;
+ uint32 rom_rodata_end;
+} dhd_event_log_t;
+#endif /* SHOW_LOGTRACE */
+
extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int dhd_timeout_expired(dhd_timeout_t *tmo);
extern struct net_device * dhd_idx2net(void *pub, int ifidx);
extern int net_os_send_hang_message(struct net_device *dev);
extern int wl_host_event(dhd_pub_t *dhd_pub, int *idx, void *pktdata,
- wl_event_msg_t *, void **data_ptr);
+ wl_event_msg_t *, void **data_ptr, void *raw_event);
extern void wl_event_to_host_order(wl_event_msg_t * evt);
extern int dhd_wl_ioctl(dhd_pub_t *dhd_pub, int ifindex, wl_ioctl_t *ioc, void *buf, int len);
#endif /* PROP_TXSTATUS */
uint8* dhd_os_prealloc(dhd_pub_t *dhdpub, int section, uint size, bool kmalloc_if_fail);
-void dhd_os_prefree(dhd_pub_t *dhdpub, void *addr, uint size);
+void dhd_os_prefree(dhd_pub_t *dhdpub, int section, void *addr, uint size);
#if defined(CONFIG_DHD_USE_STATIC_BUF)
-#define DHD_OS_PREALLOC(dhdpub, section, size) dhd_os_prealloc(dhdpub, section, size, FALSE)
-#define DHD_OS_PREFREE(dhdpub, addr, size) dhd_os_prefree(dhdpub, addr, size)
+#define DHD_OS_PREALLOC(dhdpub, section, size) dhd_os_prealloc(dhdpub, section, size, TRUE)
+#define DHD_OS_PREFREE(dhdpub, section, addr, size) dhd_os_prefree(dhdpub, section, addr, size)
#else
#define DHD_OS_PREALLOC(dhdpub, section, size) MALLOC(dhdpub->osh, size)
-#define DHD_OS_PREFREE(dhdpub, addr, size) MFREE(dhdpub->osh, addr, size)
+#define DHD_OS_PREFREE(dhdpub, section, addr, size) MFREE(dhdpub->osh, addr, size)
#endif /* defined(CONFIG_DHD_USE_STATIC_BUF) */
/*
* BT-AMP support routines
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* BT-AMP support routines
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* DHD Protocol Module for CDC and BDC.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_cdc.c 498632 2014-08-25 14:09:22Z $
+ * $Id: dhd_cdc.c 557252 2015-05-18 08:55:13Z $
*
* BDC is like CDC, except it includes a header for data packets to convey
* packet priority over the bus, and flags (e.g. to indicate checksum status
return 0;
fail:
- if (cdc != NULL)
- DHD_OS_PREFREE(dhd, cdc, sizeof(dhd_prot_t));
+ if (cdc != NULL) {
+ DHD_OS_PREFREE(dhd, DHD_PREALLOC_PROT, cdc, sizeof(dhd_prot_t));
+ }
return BCME_NOMEM;
}
#ifdef PROP_TXSTATUS
dhd_wlfc_deinit(dhd);
#endif
- DHD_OS_PREFREE(dhd, dhd->prot, sizeof(dhd_prot_t));
+ DHD_OS_PREFREE(dhd, DHD_PREALLOC_PROT, dhd->prot, sizeof(dhd_prot_t));
dhd->prot = NULL;
}
/*
* Linux cfg80211 driver - Dongle Host Driver (DHD) related
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Linux cfg80211 driver - Dongle Host Driver (DHD) related
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom Dongle Host Driver (DHD), common DHD core.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_common.c 496755 2014-08-14 04:56:53Z $
+ * $Id: dhd_common.c 557502 2015-05-19 06:32:03Z $
*/
#include <typedefs.h>
#include <osl.h>
#include <proto/bcmevent.h>
+#ifdef SHOW_LOGTRACE
+#include <event_log.h>
+#endif /* SHOW_LOGTRACE */
+
#include <dhd_bus.h>
#include <dhd_proto.h>
#include <dhd_dbg.h>
}
#ifdef SHOW_EVENTS
+#ifdef SHOW_LOGTRACE
+
+#define MAX_NO_OF_ARG 16
+
+#define FMTSTR_SIZE 100
+#define SIZE_LOC_STR 50
+#define MIN_DLEN 4
+#define TAG_BYTES 12
+#define TAG_WORDS 3
+
+static int
+check_event_log_sequence_number(uint32 seq_no)
+{
+ int32 diff;
+ uint32 ret;
+ static uint32 logtrace_seqnum_prev = 0;
+
+ diff = ntoh32(seq_no)-logtrace_seqnum_prev;
+ switch (diff)
+ {
+ case 0:
+ ret = -1; /* duplicate packet . drop */
+ break;
+
+ case 1:
+ ret =0; /* in order */
+ break;
+
+ default:
+ if ((ntoh32(seq_no) == 0) &&
+ (logtrace_seqnum_prev == 0xFFFFFFFF) ) { /* in-order - Roll over */
+ ret = 0;
+ } else {
+
+ if (diff > 0) {
+ DHD_EVENT(("WLC_E_TRACE:"
+ "Event lost (log) seqnum %d nblost %d\n",
+ ntoh32(seq_no), (diff-1)));
+ } else {
+ DHD_EVENT(("WLC_E_TRACE:"
+ "Event Packets coming out of order!!\n"));
+ }
+ ret = 0;
+ }
+ }
+
+ logtrace_seqnum_prev = ntoh32(seq_no);
+
+ return ret;
+}
+
+static void
+dhd_eventmsg_print(dhd_pub_t *dhd_pub, void *event_data, void *raw_event_ptr,
+ uint datalen, const char *event_name)
+{
+ msgtrace_hdr_t hdr;
+ uint32 nblost;
+ uint8 count;
+ char *s, *p;
+ static uint32 seqnum_prev = 0;
+ uint32 *log_ptr = NULL;
+ uchar *buf;
+ event_log_hdr_t event_hdr;
+ uint32 i;
+ int32 j;
+
+ dhd_event_log_t *raw_event = (dhd_event_log_t *) raw_event_ptr;
+
+ char fmtstr_loc_buf[FMTSTR_SIZE] = {0};
+ char (*str_buf)[SIZE_LOC_STR] = NULL;
+ char * str_tmpptr = NULL;
+ uint32 addr = 0;
+ uint32 **hdr_ptr = NULL;
+ uint32 h_i = 0;
+ uint32 hdr_ptr_len = 0;
+
+ typedef union {
+ uint32 val;
+ char * addr;
+ } u_arg;
+ u_arg arg[MAX_NO_OF_ARG] = {{0}};
+ char *c_ptr = NULL;
+
+ buf = (uchar *) event_data;
+ memcpy(&hdr, buf, MSGTRACE_HDRLEN);
+
+ if (hdr.version != MSGTRACE_VERSION) {
+ DHD_EVENT(("\nMACEVENT: %s [unsupported version --> "
+ "dhd version:%d dongle version:%d]\n",
+ event_name, MSGTRACE_VERSION, hdr.version));
+ /* Reset datalen to avoid display below */
+ datalen = 0;
+ return;
+ }
+
+ if (hdr.trace_type == MSGTRACE_HDR_TYPE_MSG) {
+ /* There are 2 bytes available at the end of data */
+ buf[MSGTRACE_HDRLEN + ntoh16(hdr.len)] = '\0';
+
+ if (ntoh32(hdr.discarded_bytes) || ntoh32(hdr.discarded_printf)) {
+ DHD_EVENT(("WLC_E_TRACE: [Discarded traces in dongle -->"
+ "discarded_bytes %d discarded_printf %d]\n",
+ ntoh32(hdr.discarded_bytes),
+ ntoh32(hdr.discarded_printf)));
+ }
+
+ nblost = ntoh32(hdr.seqnum) - seqnum_prev - 1;
+ if (nblost > 0) {
+ DHD_EVENT(("WLC_E_TRACE:"
+ "[Event lost (msg) --> seqnum %d nblost %d\n",
+ ntoh32(hdr.seqnum), nblost));
+ }
+ seqnum_prev = ntoh32(hdr.seqnum);
+
+ /* Display the trace buffer. Advance from
+ * \n to \n to avoid display big
+ * printf (issue with Linux printk )
+ */
+ p = (char *)&buf[MSGTRACE_HDRLEN];
+ while (*p != '\0' && (s = strstr(p, "\n")) != NULL) {
+ *s = '\0';
+ DHD_EVENT(("%s\n", p));
+ p = s+1;
+ }
+ if (*p)
+ DHD_EVENT(("%s", p));
+
+ /* Reset datalen to avoid display below */
+ datalen = 0;
+
+ } else if (hdr.trace_type == MSGTRACE_HDR_TYPE_LOG) {
+ /* Let the standard event printing work for now */
+ uint32 timestamp, w;
+
+ if (check_event_log_sequence_number(hdr.seqnum)) {
+ DHD_EVENT(("%s: WLC_E_TRACE:"
+ "[Event duplicate (log) %d] dropping!!\n",
+ __FUNCTION__, hdr.seqnum));
+ return; /* drop duplicate events */
+ }
+
+ p = (char *)&buf[MSGTRACE_HDRLEN];
+ datalen -= MSGTRACE_HDRLEN;
+ w = ntoh32((uint32)*p);
+ p += MIN_DLEN;
+ datalen -= MIN_DLEN;
+ timestamp = ntoh32((uint32)*p);
+ BCM_REFERENCE(timestamp);
+ BCM_REFERENCE(w);
+
+ /*
+ * Allocating max possible number of event TAGs in the received buffer
+ * considering that each event requires minimum of TAG_BYTES.
+ */
+ hdr_ptr_len = ((datalen/TAG_BYTES)+1) * sizeof(uint32*);
+
+ if ((raw_event->fmts)) {
+ if (!(str_buf = MALLOC(dhd_pub->osh, (MAX_NO_OF_ARG * SIZE_LOC_STR)))) {
+ DHD_ERROR(("%s: malloc failed\n", __FUNCTION__));
+ }
+
+ if (!(hdr_ptr = MALLOC(dhd_pub->osh, hdr_ptr_len))) {
+ DHD_ERROR(("%s: malloc failed\n", __FUNCTION__));
+ }
+ }
+
+ DHD_EVENT(("timestamp %x%x\n", timestamp, w));
+ if ((!raw_event->fmts) || (!str_buf) || (!hdr_ptr)) {
+ while (datalen > MIN_DLEN) {
+ p += MIN_DLEN;
+ datalen -= MIN_DLEN;
+ /* Print each word. DO NOT ntoh it. */
+ DHD_EVENT((" %8.8x", *((uint32 *) p)));
+ }
+ DHD_EVENT(("\n"));
+ datalen = 0;
+ if (str_buf) {
+ MFREE(dhd_pub->osh, str_buf, (MAX_NO_OF_ARG * SIZE_LOC_STR));
+ }
+ if (hdr_ptr) {
+ MFREE(dhd_pub->osh, hdr_ptr, hdr_ptr_len);
+ }
+ return;
+ }
+
+ /* (raw_event->fmts) has value */
+
+ log_ptr = (uint32 *) (p + datalen);
+
+ while (datalen > MIN_DLEN) {
+ log_ptr--;
+ datalen -= MIN_DLEN;
+ event_hdr.t = *log_ptr;
+ /*
+ * Check for partially overriten entries
+ */
+ if (log_ptr - (uint32 *) p < event_hdr.count) {
+ break;
+ }
+ /*
+ * Check for end of the Frame.
+ */
+ if (event_hdr.tag == EVENT_LOG_TAG_NULL) {
+ continue;
+ }
+ /*
+ * Check For Special Time Stamp Packet
+ */
+ if (event_hdr.tag == EVENT_LOG_TAG_TS) {
+ datalen -= TAG_BYTES;
+ log_ptr = log_ptr - TAG_WORDS;
+ continue;
+ }
+
+ log_ptr[0] = event_hdr.t;
+ if (h_i < (hdr_ptr_len / sizeof(uint32*))) {
+ hdr_ptr[h_i++] = log_ptr;
+ }
+ if (event_hdr.count > MAX_NO_OF_ARG) {
+ break;
+ }
+
+ /* Now place the header at the front
+ * and copy back.
+ */
+ log_ptr -= event_hdr.count;
+
+ c_ptr = NULL;
+ datalen = datalen - (event_hdr.count * MIN_DLEN);
+ }
+ datalen = 0;
+
+ for (j = (h_i-1); j >= 0; j--) {
+ if (!(hdr_ptr[j])) {
+ break;
+ }
+
+ event_hdr.t = *hdr_ptr[j];
+
+ log_ptr = hdr_ptr[j];
+
+ /* Now place the header at the front
+ * and copy back.
+ */
+ log_ptr -= event_hdr.count;
+
+ /* Copy the format string to parse %s and add "CONSOLE: " ??? */
+ if ((event_hdr.fmt_num >> 2) < raw_event->num_fmts) {
+ snprintf(fmtstr_loc_buf, FMTSTR_SIZE,
+ "CONSOLE: [0x%x] %s", log_ptr[event_hdr.count-1],
+ raw_event->fmts[event_hdr.fmt_num >> 2]);
+ c_ptr = fmtstr_loc_buf;
+ }
+
+ for (count = 0; count < (event_hdr.count-1); count++) {
+ if (c_ptr != NULL) {
+ if ((c_ptr = strstr(c_ptr, "%")) != NULL) {
+ c_ptr++;
+ }
+ }
+
+ if ((c_ptr != NULL) && (*c_ptr == 's')) {
+ if ((raw_event->raw_sstr) &&
+ ((log_ptr[count] > raw_event->rodata_start) &&
+ (log_ptr[count] < raw_event->rodata_end))) {
+ /* ram static string */
+ addr = log_ptr[count] - raw_event->rodata_start;
+ str_tmpptr = raw_event->raw_sstr + addr;
+ memcpy(str_buf[count], str_tmpptr, SIZE_LOC_STR);
+ str_buf[count][SIZE_LOC_STR-1] = '\0';
+ arg[count].addr = str_buf[count];
+ } else if ((raw_event->rom_raw_sstr) &&
+ ((log_ptr[count] >
+ raw_event->rom_rodata_start) &&
+ (log_ptr[count] <
+ raw_event->rom_rodata_end))) {
+ /* rom static string */
+ addr = log_ptr[count] - raw_event->rom_rodata_start;
+ str_tmpptr = raw_event->rom_raw_sstr + addr;
+ memcpy(str_buf[count], str_tmpptr, SIZE_LOC_STR);
+ str_buf[count][SIZE_LOC_STR-1] = '\0';
+ arg[count].addr = str_buf[count];
+ } else {
+ /*
+ * Dynamic string OR
+ * No data for static string.
+ * So store all string's address as string.
+ */
+ snprintf(str_buf[count], SIZE_LOC_STR, "(s)0x%x",
+ log_ptr[count]);
+ arg[count].addr = str_buf[count];
+ }
+ } else {
+ /* Other than string */
+ arg[count].val = log_ptr[count];
+ }
+ }
+
+ DHD_EVENT((fmtstr_loc_buf, arg[0], arg[1], arg[2], arg[3],
+ arg[4], arg[5], arg[6], arg[7], arg[8], arg[9], arg[10],
+ arg[11], arg[12], arg[13], arg[14], arg[15]));
+
+ for (i = 0; i < MAX_NO_OF_ARG; i++) {
+ arg[i].addr = 0;
+ }
+ for (i = 0; i < MAX_NO_OF_ARG; i++) {
+ memset(str_buf[i], 0, SIZE_LOC_STR);
+ }
+
+ }
+
+ if (str_buf) {
+ MFREE(dhd_pub->osh, str_buf, (MAX_NO_OF_ARG * SIZE_LOC_STR));
+ }
+
+ if (hdr_ptr) {
+ MFREE(dhd_pub->osh, hdr_ptr, hdr_ptr_len);
+ }
+ }
+}
+
+#endif /* SHOW_LOGTRACE */
+
static void
-wl_show_host_event(wl_event_msg_t *event, void *event_data)
+wl_show_host_event(dhd_pub_t *dhd_pub, wl_event_msg_t *event, void *event_data,
+ void *raw_event_ptr)
{
uint i, status, reason;
bool group = FALSE, flush_txq = FALSE, link = FALSE;
break;
#endif /* WIFI_ACT_FRAME */
- case WLC_E_TRACE: {
- static uint32 seqnum_prev = 0;
- static uint32 logtrace_seqnum_prev = 0;
- msgtrace_hdr_t hdr;
- uint32 nblost;
- char *s, *p;
-
- buf = (uchar *) event_data;
- memcpy(&hdr, buf, MSGTRACE_HDRLEN);
-
- if (hdr.version != MSGTRACE_VERSION) {
- printf("\nMACEVENT: %s [unsupported version --> "
- "dhd version:%d dongle version:%d]\n",
- event_name, MSGTRACE_VERSION, hdr.version);
- /* Reset datalen to avoid display below */
- datalen = 0;
- break;
- }
-
- if (hdr.trace_type == MSGTRACE_HDR_TYPE_MSG) {
- /* There are 2 bytes available at the end of data */
- buf[MSGTRACE_HDRLEN + ntoh16(hdr.len)] = '\0';
-
- if (ntoh32(hdr.discarded_bytes) || ntoh32(hdr.discarded_printf)) {
- printf("\nWLC_E_TRACE: [Discarded traces in dongle -->"
- "discarded_bytes %d discarded_printf %d]\n",
- ntoh32(hdr.discarded_bytes), ntoh32(hdr.discarded_printf));
- }
-
- nblost = ntoh32(hdr.seqnum) - seqnum_prev - 1;
- if (nblost > 0) {
- printf("\nWLC_E_TRACE: [Event lost (msg) --> seqnum %d nblost %d\n",
- ntoh32(hdr.seqnum), nblost);
- }
- seqnum_prev = ntoh32(hdr.seqnum);
-
- /* Display the trace buffer. Advance from \n to \n to avoid display big
- * printf (issue with Linux printk )
- */
- p = (char *)&buf[MSGTRACE_HDRLEN];
- while (*p != '\0' && (s = strstr(p, "\n")) != NULL) {
- *s = '\0';
- printf("WLC_E_TRACE: %s\n", p);
- p = s+1;
- }
- if (*p) printf("WLC_E_TRACE: %s", p);
-
- /* Reset datalen to avoid display below */
- datalen = 0;
-
- } else if (hdr.trace_type == MSGTRACE_HDR_TYPE_LOG) {
- /* Let the standard event printing work for now */
- uint32 timestamp, w;
- if (ntoh32(hdr.seqnum) == logtrace_seqnum_prev) {
- printf("\nWLC_E_TRACE: [Event duplicate (log) %d",
- logtrace_seqnum_prev);
- } else {
- nblost = ntoh32(hdr.seqnum) - logtrace_seqnum_prev - 1;
- if (nblost > 0) {
- printf("\nWLC_E_TRACE: [Event lost (log)"
- " --> seqnum %d nblost %d\n",
- ntoh32(hdr.seqnum), nblost);
- }
- logtrace_seqnum_prev = ntoh32(hdr.seqnum);
-
- p = (char *)&buf[MSGTRACE_HDRLEN];
- datalen -= MSGTRACE_HDRLEN;
- w = ntoh32((uint32) *p);
- p += 4;
- datalen -= 4;
- timestamp = ntoh32((uint32) *p);
- printf("Logtrace %x timestamp %x %x",
- logtrace_seqnum_prev, timestamp, w);
-
- while (datalen > 4) {
- p += 4;
- datalen -= 4;
- /* Print each word. DO NOT ntoh it. */
- printf(" %8.8x", *((uint32 *) p));
- }
- printf("\n");
- }
- datalen = 0;
- }
-
+#ifdef SHOW_LOGTRACE
+ case WLC_E_TRACE:
+ {
+ dhd_eventmsg_print(dhd_pub, event_data, raw_event_ptr, datalen, event_name);
break;
}
+#endif /* SHOW_LOGTRACE */
case WLC_E_RSSI:
int
wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
- wl_event_msg_t *event, void **data_ptr)
+ wl_event_msg_t *event, void **data_ptr, void *raw_event)
{
/* check whether packet is a BRCM event pkt */
bcm_event_t *pvt_data = (bcm_event_t *)pktdata;
#endif /* DHD_DEBUG */
#ifdef PROP_TXSTATUS
case WLC_E_FIFO_CREDIT_MAP:
- dhd_wlfc_enable(dhd_pub);
+ if (dhd_wlfc_enable(dhd_pub) != BCME_OK) {
+ DHD_ERROR(("%s: dhd_wlfc_enable failed\n", __FUNCTION__));
+ return (BCME_ERROR);
+ }
dhd_wlfc_FIFOcreditmap_event(dhd_pub, event_data);
WLFC_DBGMESG(("WLC_E_FIFO_CREDIT_MAP:(AC0,AC1,AC2,AC3),(BC_MC),(OTHER): "
"(%d,%d,%d,%d),(%d),(%d)\n", event_data[0], event_data[1],
case WLC_E_BCMC_CREDIT_SUPPORT:
dhd_wlfc_BCMCCredit_support_event(dhd_pub);
break;
-#endif
+#endif /* PROP_TXSTATUS */
case WLC_E_IF: {
struct wl_event_data_if *ifevent = (struct wl_event_data_if *)event_data;
}
#ifdef SHOW_EVENTS
- wl_show_host_event(event, (void *)event_data);
+ wl_show_host_event(dhd_pub, event, (void *)event_data, raw_event);
#endif /* SHOW_EVENTS */
return (BCME_OK);
/*
* Customer code to add GPIO control during WLAN start/stop
-* Copyright (C) 1999-2014, Broadcom Corporation
+* Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Debug/trace/assert driver definitions for Dongle Host Driver.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* IP Packet Parser Module.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_ip.c 486237 2014-06-19 09:22:00Z $
+ * $Id: dhd_ip.c 529177 2015-01-26 12:49:53Z $
*/
#include <typedefs.h>
#include <osl.h>
} tdata_psh_info_t;
typedef struct {
- uint8 src_ip_addr[IPV4_ADDR_LEN]; /* SRC ip addrs of this TCP stream */
- uint8 dst_ip_addr[IPV4_ADDR_LEN]; /* DST ip addrs of this TCP stream */
- uint8 src_tcp_port[TCP_PORT_LEN]; /* SRC tcp ports of this TCP stream */
- uint8 dst_tcp_port[TCP_PORT_LEN]; /* DST tcp ports of this TCP stream */
+ struct {
+ uint8 src[IPV4_ADDR_LEN]; /* SRC ip addrs of this TCP stream */
+ uint8 dst[IPV4_ADDR_LEN]; /* DST ip addrs of this TCP stream */
+ } ip_addr;
+ struct {
+ uint8 src[TCP_PORT_LEN]; /* SRC tcp ports of this TCP stream */
+ uint8 dst[TCP_PORT_LEN]; /* DST tcp ports of this TCP stream */
+ } tcp_port;
tdata_psh_info_t *tdata_psh_info_head; /* Head of received TCP PSH DATA chain */
tdata_psh_info_t *tdata_psh_info_tail; /* Tail of received TCP PSH DATA chain */
uint32 last_used_time; /* The last time this tcpdata_info was used(in ms) */
tcpdata_info_t *tcpdata_info_tmp = &tcpack_sup_mod->tcpdata_info_tbl[i];
DHD_TRACE(("%s %d: data info[%d], IP addr "IPV4_ADDR_STR" "IPV4_ADDR_STR
" TCP port %d %d\n", __FUNCTION__, __LINE__, i,
- IPV4_ADDR_TO_STR(ntoh32_ua(tcpdata_info_tmp->src_ip_addr)),
- IPV4_ADDR_TO_STR(ntoh32_ua(tcpdata_info_tmp->dst_ip_addr)),
- ntoh16_ua(tcpdata_info_tmp->src_tcp_port),
- ntoh16_ua(tcpdata_info_tmp->dst_tcp_port)));
+ IPV4_ADDR_TO_STR(ntoh32_ua(tcpdata_info_tmp->ip_addr.src)),
+ IPV4_ADDR_TO_STR(ntoh32_ua(tcpdata_info_tmp->ip_addr.dst)),
+ ntoh16_ua(tcpdata_info_tmp->tcp_port.src),
+ ntoh16_ua(tcpdata_info_tmp->tcp_port.dst)));
/* If either IP address or TCP port number does not match, skip. */
if (memcmp(&ip_hdr[IPV4_SRC_IP_OFFSET],
- tcpdata_info_tmp->dst_ip_addr, IPV4_ADDR_LEN) == 0 &&
+ tcpdata_info_tmp->ip_addr.dst, IPV4_ADDR_LEN) == 0 &&
memcmp(&ip_hdr[IPV4_DEST_IP_OFFSET],
- tcpdata_info_tmp->src_ip_addr, IPV4_ADDR_LEN) == 0 &&
+ tcpdata_info_tmp->ip_addr.src, IPV4_ADDR_LEN) == 0 &&
memcmp(&tcp_hdr[TCP_SRC_PORT_OFFSET],
- tcpdata_info_tmp->dst_tcp_port, TCP_PORT_LEN) == 0 &&
+ tcpdata_info_tmp->tcp_port.dst, TCP_PORT_LEN) == 0 &&
memcmp(&tcp_hdr[TCP_DEST_PORT_OFFSET],
- tcpdata_info_tmp->src_tcp_port, TCP_PORT_LEN) == 0) {
+ tcpdata_info_tmp->tcp_port.src, TCP_PORT_LEN) == 0) {
tcpdata_info = tcpdata_info_tmp;
break;
}
ntoh16_ua(&old_tcp_hdr[TCP_SRC_PORT_OFFSET]),
ntoh16_ua(&old_tcp_hdr[TCP_DEST_PORT_OFFSET])));
- /* If either of IP address or TCP port number does not match, skip. */
+ /* If either of IP address or TCP port number does not match, skip.
+ * Note that src/dst addr fields in ip header are contiguous being 8 bytes in total.
+ * Also, src/dst port fields in TCP header are contiguous being 4 bytes in total.
+ */
if (memcmp(&new_ip_hdr[IPV4_SRC_IP_OFFSET],
&old_ip_hdr[IPV4_SRC_IP_OFFSET], IPV4_ADDR_LEN * 2) ||
memcmp(&new_tcp_hdr[TCP_SRC_PORT_OFFSET],
uint32 now_in_ms = OSL_SYSUPTIME();
DHD_TRACE(("%s %d: data info[%d], IP addr "IPV4_ADDR_STR" "IPV4_ADDR_STR
" TCP port %d %d\n", __FUNCTION__, __LINE__, i,
- IPV4_ADDR_TO_STR(ntoh32_ua(tdata_info_tmp->src_ip_addr)),
- IPV4_ADDR_TO_STR(ntoh32_ua(tdata_info_tmp->dst_ip_addr)),
- ntoh16_ua(tdata_info_tmp->src_tcp_port),
- ntoh16_ua(tdata_info_tmp->dst_tcp_port)));
-
- /* If both IP address and TCP port number match, we found it so break. */
+ IPV4_ADDR_TO_STR(ntoh32_ua(tdata_info_tmp->ip_addr.src)),
+ IPV4_ADDR_TO_STR(ntoh32_ua(tdata_info_tmp->ip_addr.dst)),
+ ntoh16_ua(tdata_info_tmp->tcp_port.src),
+ ntoh16_ua(tdata_info_tmp->tcp_port.dst)));
+
+ /* If both IP address and TCP port number match, we found it so break.
+ * Note that src/dst addr fields in ip header are contiguous being 8 bytes in total.
+ * Also, src/dst port fields in TCP header are contiguous being 4 bytes in total.
+ */
if (memcmp(&ip_hdr[IPV4_SRC_IP_OFFSET],
- (void *)tdata_info_tmp->src_ip_addr, IPV4_ADDR_LEN * 2) == 0 &&
+ (void *)&tdata_info_tmp->ip_addr, IPV4_ADDR_LEN * 2) == 0 &&
memcmp(&tcp_hdr[TCP_SRC_PORT_OFFSET],
- (void *)tdata_info_tmp->src_tcp_port, TCP_PORT_LEN * 2) == 0) {
+ (void *)&tdata_info_tmp->tcp_port, TCP_PORT_LEN * 2) == 0) {
tcpdata_info = tdata_info_tmp;
tcpdata_info->last_used_time = now_in_ms;
break;
bcopy(last_tdata_info, tdata_info_tmp, sizeof(tcpdata_info_t));
}
bzero(last_tdata_info, sizeof(tcpdata_info_t));
- DHD_ERROR(("%s %d: tcpdata_info(idx %d) is aged out. ttl cnt is now %d\n",
+ DHD_INFO(("%s %d: tcpdata_info(idx %d) is aged out. ttl cnt is now %d\n",
__FUNCTION__, __LINE__, i, tcpack_sup_mod->tcpdata_info_cnt));
/* Don't increase "i" here, so that the prev last tcpdata_info is checked */
} else
/* No TCP flow with the same IP addr and TCP port is found
* in tcp_data_info_tbl. So add this flow to the table.
*/
- DHD_ERROR(("%s %d: Add data info to tbl[%d]: IP addr "IPV4_ADDR_STR" "IPV4_ADDR_STR
+ DHD_INFO(("%s %d: Add data info to tbl[%d]: IP addr "IPV4_ADDR_STR" "IPV4_ADDR_STR
" TCP port %d %d\n",
__FUNCTION__, __LINE__, tcpack_sup_mod->tcpdata_info_cnt,
IPV4_ADDR_TO_STR(ntoh32_ua(&ip_hdr[IPV4_SRC_IP_OFFSET])),
IPV4_ADDR_TO_STR(ntoh32_ua(&ip_hdr[IPV4_DEST_IP_OFFSET])),
ntoh16_ua(&tcp_hdr[TCP_SRC_PORT_OFFSET]),
ntoh16_ua(&tcp_hdr[TCP_DEST_PORT_OFFSET])));
-
- bcopy(&ip_hdr[IPV4_SRC_IP_OFFSET], (void *)tcpdata_info->src_ip_addr,
+ /* Note that src/dst addr fields in ip header are contiguous being 8 bytes in total.
+ * Also, src/dst port fields in TCP header are contiguous being 4 bytes in total.
+ */
+ bcopy(&ip_hdr[IPV4_SRC_IP_OFFSET], (void *)&tcpdata_info->ip_addr,
IPV4_ADDR_LEN * 2);
- bcopy(&tcp_hdr[TCP_SRC_PORT_OFFSET], (void *)tcpdata_info->src_tcp_port,
+ bcopy(&tcp_hdr[TCP_SRC_PORT_OFFSET], (void *)&tcpdata_info->tcp_port,
TCP_PORT_LEN * 2);
tcpdata_info->last_used_time = OSL_SYSUPTIME();
*
* Provides type definitions and function prototypes used to parse ip packet.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Broadcom Dongle Host Driver (DHD), Linux-specific network interface
* Basically selected code segments from usb-cdc.c and usb-rndis.c
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_linux.c 512574 2014-11-04 03:07:46Z $
+ * $Id: dhd_linux.c 589976 2015-10-01 07:01:27Z $
*/
#include <typedefs.h>
#include <linuxver.h>
#include <osl.h>
+#ifdef SHOW_LOGTRACE
+#include <linux/syscalls.h>
+#include <event_log.h>
+#endif /* SHOW_LOGTRACE */
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/earlysuspend.h>
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND) */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
+#include <linux/nl80211.h>
+#endif /* OEM_ANDROID && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) */
+
extern int dhd_get_suspend_bcn_li_dtim(dhd_pub_t *dhd);
#ifdef PKT_FILTER_SUPPORT
wait_queue_head_t ctrl_wait;
atomic_t pend_8021x_cnt;
dhd_attach_states_t dhd_state;
+#ifdef SHOW_LOGTRACE
+ dhd_event_log_t event_data;
+#endif /* SHOW_LOGTRACE */
#if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
struct early_suspend early_suspend;
goto exit;
}
/* In case of P2P GO or GC, apply pkt filter to pass arp pkt to host */
+#if defined(ARP_OFFLOAD_SUPPORT)
if ((dhd->arp_version == 1) &&
+#else
+ if (
+#endif
(op_mode & (DHD_FLAG_P2P_GC_MODE | DHD_FLAG_P2P_GO_MODE))) {
_apply = TRUE;
goto exit;
extern tsk_ctl_t ap_eth_ctl; /* ap netdev heper thread ctl */
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
+int32 dhd_role_to_nl80211_iftype(int32 role)
+{
+ switch (role) {
+ case WLC_E_IF_ROLE_STA:
+ return NL80211_IFTYPE_STATION;
+ case WLC_E_IF_ROLE_AP:
+ return NL80211_IFTYPE_AP;
+ case WLC_E_IF_ROLE_WDS:
+ return NL80211_IFTYPE_WDS;
+ case WLC_E_IF_ROLE_P2P_GO:
+ return NL80211_IFTYPE_P2P_GO;
+ case WLC_E_IF_ROLE_P2P_CLIENT:
+ return NL80211_IFTYPE_P2P_CLIENT;
+ case WLC_E_IF_ROLE_IBSS:
+ return NL80211_IFTYPE_ADHOC;
+ default:
+ return NL80211_IFTYPE_UNSPECIFIED;
+ }
+}
+#endif /* OEM_ANDROID && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) */
+
static void
dhd_ifadd_event_handler(void *handle, void *event_info, u8 event)
{
struct net_device *ndev;
int ifidx, bssidx;
int ret;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
+ struct wireless_dev *vwdev, *primary_wdev;
+ struct net_device *primary_ndev;
+#endif /* OEM_ANDROID && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) */
if (event != DHD_WQ_WORK_IF_ADD) {
DHD_ERROR(("%s: unexpected event \n", __FUNCTION__));
goto done;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
+ vwdev = kzalloc(sizeof(*vwdev), GFP_KERNEL);
+ if (unlikely(!vwdev)) {
+ DHD_ERROR(("Could not allocate wireless device\n"));
+ goto done;
+ }
+ primary_ndev = dhd->pub.info->iflist[0]->net;
+ primary_wdev = ndev_to_wdev(primary_ndev);
+ vwdev->wiphy = primary_wdev->wiphy;
+ vwdev->iftype = dhd_role_to_nl80211_iftype(if_event->event.role);
+ vwdev->netdev = ndev;
+ ndev->ieee80211_ptr = vwdev;
+ SET_NETDEV_DEV(ndev, wiphy_dev(vwdev->wiphy));
+ DHD_ERROR(("virtual interface(%s) is created\n", if_event->name));
+#endif /* OEM_ANDROID && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) */
+
ret = dhd_register_if(&dhd->pub, ifidx, TRUE);
if (ret != BCME_OK) {
DHD_ERROR(("%s: dhd_register_if failed\n", __FUNCTION__));
dhd_info_t *dhd = (dhd_info_t *)(dhdp->info);
struct ether_header *eh;
uint16 type;
- uint datalen;
- dhd_if_t *ifp;
dhd_prot_hdrpull(dhdp, NULL, txp, NULL, NULL);
#ifdef PROP_TXSTATUS
if (dhdp->wlfc_state && (dhdp->proptxstatus_mode != WLFC_FCMODE_NONE)) {
- ifp = dhd->iflist[DHD_PKTTAG_IF(PKTTAG(txp))];
- /* if the interface is released somewhere just return */
- if (ifp == NULL)
- return;
+ dhd_if_t *ifp = dhd->iflist[DHD_PKTTAG_IF(PKTTAG(txp))];
+ uint datalen = PKTLEN(dhd->pub.osh, txp);
- datalen = PKTLEN(dhd->pub.osh, txp);
if (success) {
dhd->pub.tx_packets++;
ifp->stats.tx_packets++;
setScheduler(current, SCHED_FIFO, ¶m);
}
- DAEMONIZE("dhd_rxf");
- /* DHD_OS_WAKE_LOCK is called in dhd_sched_dpc[dhd_linux.c] down below */
-
- /* signal: thread has started */
- complete(&tsk->completed);
#ifdef CUSTOM_SET_CPUCORE
dhd->pub.current_rxf = current;
(dhd->dhd_state & DHD_ATTACH_STATE_CFG80211)) {
int i;
+
dhd_net_if_lock_local(dhd);
for (i = 1; i < DHD_MAX_IFS; i++)
dhd_remove_if(&dhd->pub, i, FALSE);
dhd_net_if_unlock_local(dhd);
}
+ cancel_work_sync(dhd->dhd_deferred_wq);
}
}
#endif /* WL_CFG80211 */
*/
if (ifevent->ifidx > 0) {
dhd_if_event_t *if_event = MALLOC(dhdinfo->pub.osh, sizeof(dhd_if_event_t));
-
+ if (if_event == NULL) {
+ DHD_ERROR(("dhd_event_ifadd: Failed MALLOC, malloced %d bytes",
+ MALLOCED(dhdinfo->pub.osh)));
+ return BCME_NOMEM;
+ }
memcpy(&if_event->event, ifevent, sizeof(if_event->event));
memcpy(if_event->mac, mac, ETHER_ADDR_LEN);
strncpy(if_event->name, name, IFNAMSIZ);
* anything else
*/
if_event = MALLOC(dhdinfo->pub.osh, sizeof(dhd_if_event_t));
+ if (if_event == NULL) {
+ DHD_ERROR(("dhd_event_ifdel: malloc failed for if_event, malloced %d bytes",
+ MALLOCED(dhdinfo->pub.osh)));
+ return BCME_NOMEM;
+ }
memcpy(&if_event->event, ifevent, sizeof(if_event->event));
memcpy(if_event->mac, mac, ETHER_ADDR_LEN);
strncpy(if_event->name, name, IFNAMSIZ);
#endif
+#ifdef SHOW_LOGTRACE
+static char *logstrs_path = "/root/logstrs.bin";
+static char *st_str_file_path = "/root/rtecdc.bin";
+static char *map_file_path = "/root/rtecdc.map";
+static char *rom_st_str_file_path = "/root/roml.bin";
+static char *rom_map_file_path = "/root/roml.map";
+
+#define BYTES_AHEAD_NUM 11 /* address in map file is before these many bytes */
+#define READ_NUM_BYTES 1000 /* read map file each time this No. of bytes */
+#define GO_BACK_FILE_POS_NUM_BYTES 100 /* set file pos back to cur pos */
+static char *ramstart_str = "text_start"; /* string in mapfile has addr ramstart */
+static char *rodata_start_str = "rodata_start"; /* string in mapfile has addr rodata start */
+static char *rodata_end_str = "rodata_end"; /* string in mapfile has addr rodata end */
+static char *ram_file_str = "rtecdc";
+static char *rom_file_str = "roml";
+#define RAMSTART_BIT 0x01
+#define RDSTART_BIT 0x02
+#define RDEND_BIT 0x04
+#define ALL_MAP_VAL (RAMSTART_BIT | RDSTART_BIT | RDEND_BIT)
+
+module_param(logstrs_path, charp, S_IRUGO);
+module_param(st_str_file_path, charp, S_IRUGO);
+module_param(map_file_path, charp, S_IRUGO);
+module_param(rom_st_str_file_path, charp, S_IRUGO);
+module_param(rom_map_file_path, charp, S_IRUGO);
+
+static void
+dhd_init_logstrs_array(dhd_event_log_t *temp)
+{
+ struct file *filep = NULL;
+ struct kstat stat;
+ mm_segment_t fs;
+ char *raw_fmts = NULL;
+ int logstrs_size = 0;
+
+ logstr_header_t *hdr = NULL;
+ uint32 *lognums = NULL;
+ char *logstrs = NULL;
+ int ram_index = 0;
+ char **fmts;
+ int num_fmts = 0;
+ uint32 i = 0;
+ int error = 0;
+
+ fs = get_fs();
+ set_fs(KERNEL_DS);
+
+ filep = filp_open(logstrs_path, O_RDONLY, 0);
+
+ if (IS_ERR(filep)) {
+ DHD_ERROR(("%s: Failed to open the file %s \n", __FUNCTION__, logstrs_path));
+ goto fail;
+ }
+ error = vfs_stat(logstrs_path, &stat);
+ if (error) {
+ DHD_ERROR(("%s: Failed to stat file %s \n", __FUNCTION__, logstrs_path));
+ goto fail;
+ }
+ logstrs_size = (int) stat.size;
+
+ raw_fmts = kmalloc(logstrs_size, GFP_KERNEL);
+ if (raw_fmts == NULL) {
+ DHD_ERROR(("%s: Failed to allocate memory \n", __FUNCTION__));
+ goto fail;
+ }
+ if (vfs_read(filep, raw_fmts, logstrs_size, &filep->f_pos) != logstrs_size) {
+ DHD_ERROR(("%s: Failed to read file %s", __FUNCTION__, logstrs_path));
+ goto fail;
+ }
+
+ /* Remember header from the logstrs.bin file */
+ hdr = (logstr_header_t *) (raw_fmts + logstrs_size -
+ sizeof(logstr_header_t));
+
+ if (hdr->log_magic == LOGSTRS_MAGIC) {
+ /*
+ * logstrs.bin start with header.
+ */
+ num_fmts = hdr->rom_logstrs_offset / sizeof(uint32);
+ ram_index = (hdr->ram_lognums_offset -
+ hdr->rom_lognums_offset) / sizeof(uint32);
+ lognums = (uint32 *) &raw_fmts[hdr->rom_lognums_offset];
+ logstrs = (char *) &raw_fmts[hdr->rom_logstrs_offset];
+ } else {
+ /*
+ * Legacy logstrs.bin format without header.
+ */
+ num_fmts = *((uint32 *) (raw_fmts)) / sizeof(uint32);
+ if (num_fmts == 0) {
+ /* Legacy ROM/RAM logstrs.bin format:
+ * - ROM 'lognums' section
+ * - RAM 'lognums' section
+ * - ROM 'logstrs' section.
+ * - RAM 'logstrs' section.
+ *
+ * 'lognums' is an array of indexes for the strings in the
+ * 'logstrs' section. The first uint32 is 0 (index of first
+ * string in ROM 'logstrs' section).
+ *
+ * The 4324b5 is the only ROM that uses this legacy format. Use the
+ * fixed number of ROM fmtnums to find the start of the RAM
+ * 'lognums' section. Use the fixed first ROM string ("Con\n") to
+ * find the ROM 'logstrs' section.
+ */
+ #define NUM_4324B5_ROM_FMTS 186
+ #define FIRST_4324B5_ROM_LOGSTR "Con\n"
+ ram_index = NUM_4324B5_ROM_FMTS;
+ lognums = (uint32 *) raw_fmts;
+ num_fmts = ram_index;
+ logstrs = (char *) &raw_fmts[num_fmts << 2];
+ while (strncmp(FIRST_4324B5_ROM_LOGSTR, logstrs, 4)) {
+ num_fmts++;
+ logstrs = (char *) &raw_fmts[num_fmts << 2];
+ }
+ } else {
+ /* Legacy RAM-only logstrs.bin format:
+ * - RAM 'lognums' section
+ * - RAM 'logstrs' section.
+ *
+ * 'lognums' is an array of indexes for the strings in the
+ * 'logstrs' section. The first uint32 is an index to the
+ * start of 'logstrs'. Therefore, if this index is divided
+ * by 'sizeof(uint32)' it provides the number of logstr
+ * entries.
+ */
+ ram_index = 0;
+ lognums = (uint32 *) raw_fmts;
+ logstrs = (char *) &raw_fmts[num_fmts << 2];
+ }
+ }
+ fmts = kmalloc(num_fmts * sizeof(char *), GFP_KERNEL);
+ if (fmts == NULL) {
+ DHD_ERROR(("Failed to allocate fmts memory"));
+ goto fail;
+ }
+
+ for (i = 0; i < num_fmts; i++) {
+ /* ROM lognums index into logstrs using 'rom_logstrs_offset' as a base
+ * (they are 0-indexed relative to 'rom_logstrs_offset').
+ *
+ * RAM lognums are already indexed to point to the correct RAM logstrs (they
+ * are 0-indexed relative to the start of the logstrs.bin file).
+ */
+ if (i == ram_index) {
+ logstrs = raw_fmts;
+ }
+ fmts[i] = &logstrs[lognums[i]];
+ }
+ temp->fmts = fmts;
+ temp->raw_fmts = raw_fmts;
+ temp->num_fmts = num_fmts;
+ filp_close(filep, NULL);
+ set_fs(fs);
+ return;
+fail:
+ if (raw_fmts) {
+ kfree(raw_fmts);
+ raw_fmts = NULL;
+ }
+ if (!IS_ERR(filep))
+ filp_close(filep, NULL);
+ set_fs(fs);
+ temp->fmts = NULL;
+ return;
+}
+
+static int
+dhd_read_map(char *fname, uint32 *ramstart, uint32 *rodata_start,
+ uint32 *rodata_end)
+{
+ struct file *filep = NULL;
+ mm_segment_t fs;
+ char *raw_fmts = NULL;
+ uint32 read_size = READ_NUM_BYTES;
+ int error = 0;
+ char * cptr = NULL;
+ char c;
+ uint8 count = 0;
+
+ *ramstart = 0;
+ *rodata_start = 0;
+ *rodata_end = 0;
+
+ if (fname == NULL) {
+ DHD_ERROR(("%s: ERROR fname is NULL \n", __FUNCTION__));
+ return BCME_ERROR;
+ }
+
+ fs = get_fs();
+ set_fs(KERNEL_DS);
+
+ filep = filp_open(fname, O_RDONLY, 0);
+ if (IS_ERR(filep)) {
+ DHD_ERROR(("%s: Failed to open %s \n", __FUNCTION__, fname));
+ goto fail;
+ }
+
+ raw_fmts = kmalloc(read_size, GFP_KERNEL);
+ if (raw_fmts == NULL) {
+ DHD_ERROR(("%s: Failed to allocate raw_fmts memory \n", __FUNCTION__));
+ goto fail;
+ }
+
+ /* read ram start, rodata_start and rodata_end values from map file */
+
+ while (count != ALL_MAP_VAL)
+ {
+ error = vfs_read(filep, raw_fmts, read_size, (&filep->f_pos));
+ if (error < 0) {
+ DHD_ERROR(("%s: read failed %s err:%d \n", __FUNCTION__,
+ map_file_path, error));
+ goto fail;
+ }
+
+ if (error < read_size) {
+ /*
+ * since we reset file pos back to earlier pos by
+ * GO_BACK_FILE_POS_NUM_BYTES bytes we won't reach EOF.
+ * So if ret value is less than read_size, reached EOF don't read further
+ */
+ break;
+ }
+
+ /* Get ramstart address */
+ if ((cptr = strstr(raw_fmts, ramstart_str))) {
+ cptr = cptr - BYTES_AHEAD_NUM;
+ sscanf(cptr, "%x %c text_start", ramstart, &c);
+ count |= RAMSTART_BIT;
+ }
+
+ /* Get ram rodata start address */
+ if ((cptr = strstr(raw_fmts, rodata_start_str))) {
+ cptr = cptr - BYTES_AHEAD_NUM;
+ sscanf(cptr, "%x %c rodata_start", rodata_start, &c);
+ count |= RDSTART_BIT;
+ }
+
+ /* Get ram rodata end address */
+ if ((cptr = strstr(raw_fmts, rodata_end_str))) {
+ cptr = cptr - BYTES_AHEAD_NUM;
+ sscanf(cptr, "%x %c rodata_end", rodata_end, &c);
+ count |= RDEND_BIT;
+ }
+ memset(raw_fmts, 0, read_size);
+ /*
+ * go back to predefined NUM of bytes so that we won't miss
+ * the string and addr even if it comes as splited in next read.
+ */
+ filep->f_pos = filep->f_pos - GO_BACK_FILE_POS_NUM_BYTES;
+ }
+
+ DHD_ERROR(("---ramstart: 0x%x, rodata_start: 0x%x, rodata_end:0x%x\n",
+ *ramstart, *rodata_start, *rodata_end));
+
+ DHD_ERROR(("readmap over \n"));
+
+fail:
+ if (raw_fmts) {
+ kfree(raw_fmts);
+ raw_fmts = NULL;
+ }
+ if (!IS_ERR(filep))
+ filp_close(filep, NULL);
+
+ set_fs(fs);
+ if (count == ALL_MAP_VAL) {
+ return BCME_OK;
+ }
+ DHD_ERROR(("readmap error 0X%x \n", count));
+ return BCME_ERROR;
+}
+
+static void
+dhd_init_static_strs_array(dhd_event_log_t *temp, char *str_file, char *map_file)
+{
+ struct file *filep = NULL;
+ mm_segment_t fs;
+ char *raw_fmts = NULL;
+ uint32 logstrs_size = 0;
+
+ int error = 0;
+ uint32 ramstart = 0;
+ uint32 rodata_start = 0;
+ uint32 rodata_end = 0;
+ uint32 logfilebase = 0;
+
+ error = dhd_read_map(map_file, &ramstart, &rodata_start, &rodata_end);
+ if (error == BCME_ERROR) {
+ DHD_ERROR(("readmap Error!! \n"));
+ /* don't do event log parsing in actual case */
+ temp->raw_sstr = NULL;
+ return;
+ }
+ DHD_ERROR(("ramstart: 0x%x, rodata_start: 0x%x, rodata_end:0x%x\n",
+ ramstart, rodata_start, rodata_end));
+
+ fs = get_fs();
+ set_fs(KERNEL_DS);
+
+ filep = filp_open(str_file, O_RDONLY, 0);
+ if (IS_ERR(filep)) {
+ DHD_ERROR(("%s: Failed to open the file %s \n", __FUNCTION__, str_file));
+ goto fail;
+ }
+
+ /* Full file size is huge. Just read required part */
+ logstrs_size = rodata_end - rodata_start;
+
+ raw_fmts = kmalloc(logstrs_size, GFP_KERNEL);
+ if (raw_fmts == NULL) {
+ DHD_ERROR(("%s: Failed to allocate raw_fmts memory \n", __FUNCTION__));
+ goto fail;
+ }
+
+ logfilebase = rodata_start - ramstart;
+
+ error = generic_file_llseek(filep, logfilebase, SEEK_SET);
+ if (error < 0) {
+ DHD_ERROR(("%s: %s llseek failed %d \n", __FUNCTION__, str_file, error));
+ goto fail;
+ }
+
+ error = vfs_read(filep, raw_fmts, logstrs_size, (&filep->f_pos));
+ if (error != logstrs_size) {
+ DHD_ERROR(("%s: %s read failed %d \n", __FUNCTION__, str_file, error));
+ goto fail;
+ }
+
+ if (strstr(str_file, ram_file_str) != NULL) {
+ temp->raw_sstr = raw_fmts;
+ temp->ramstart = ramstart;
+ temp->rodata_start = rodata_start;
+ temp->rodata_end = rodata_end;
+ } else if (strstr(str_file, rom_file_str) != NULL) {
+ temp->rom_raw_sstr = raw_fmts;
+ temp->rom_ramstart = ramstart;
+ temp->rom_rodata_start = rodata_start;
+ temp->rom_rodata_end = rodata_end;
+ }
+
+ filp_close(filep, NULL);
+ set_fs(fs);
+
+ return;
+fail:
+ if (raw_fmts) {
+ kfree(raw_fmts);
+ raw_fmts = NULL;
+ }
+ if (!IS_ERR(filep))
+ filp_close(filep, NULL);
+ set_fs(fs);
+ if (strstr(str_file, ram_file_str) != NULL) {
+ temp->raw_sstr = NULL;
+ } else if (strstr(str_file, rom_file_str) != NULL) {
+ temp->rom_raw_sstr = NULL;
+ }
+ return;
+}
+
+#endif /* SHOW_LOGTRACE */
+
dhd_pub_t *
dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
{
}
#endif /* defined(WL_WIRELESS_EXT) */
+#ifdef SHOW_LOGTRACE
+ dhd_init_logstrs_array(&dhd->event_data);
+ dhd_init_static_strs_array(&dhd->event_data, st_str_file_path, map_file_path);
+ dhd_init_static_strs_array(&dhd->event_data, rom_st_str_file_path, rom_map_file_path);
+#endif /* SHOW_LOGTRACE */
+
/* Set up the watchdog timer */
init_timer(&dhd->timer);
}
#endif /* WL_CFG80211 */
setbit(eventmask, WLC_E_TRACE);
+ setbit(eventmask, WLC_E_CSA_COMPLETE_IND);
/* Write updated Event mask */
bcm_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf, sizeof(iovbuf));
dhd_pub = &dhd->pub;
+#if defined(ARP_OFFLOAD_SUPPORT)
if (dhd_pub->arp_version == 1) {
idx = 0;
}
else {
+#else
+ {
+#endif
for (idx = 0; idx < DHD_MAX_IFS; idx++) {
if (dhd->iflist[idx] && dhd->iflist[idx]->net == ifa->ifa_dev->dev)
break;
up(&dhd_registration_sem);
#endif
if (!dhd_download_fw_on_driverload) {
+#ifdef WL_CFG80211
+ wl_terminate_event_handler();
+#endif /* WL_CFG80211 */
#ifdef BCMSDIO
dhd_net_bus_devreset(net, TRUE);
dhd_net_bus_suspend(net);
dhd_deferred_work_deinit(dhd->dhd_deferred_wq);
dhd->dhd_deferred_wq = NULL;
+#ifdef SHOW_LOGTRACE
+ if (dhd->event_data.fmts)
+ kfree(dhd->event_data.fmts);
+ if (dhd->event_data.raw_fmts)
+ kfree(dhd->event_data.raw_fmts);
+ if (dhd->event_data.raw_sstr)
+ kfree(dhd->event_data.raw_sstr);
+#endif /* SHOW_LOGTRACE */
#ifdef PNO_SUPPORT
if (dhdp->pno_state)
dhd_pno_deinit(dhdp);
uint8* buf;
gfp_t flags = CAN_SLEEP() ? GFP_KERNEL: GFP_ATOMIC;
+ if (section > DHD_PREALLOC_SECTION_MAX) {
+ DHD_ERROR(("%s: Invalid Section ID: %d\n", __FUNCTION__, section));
+ return NULL;
+ }
+
buf = (uint8*)wifi_platform_prealloc(dhdpub->info->adapter, section, size);
- if (buf == NULL && kmalloc_if_fail)
+ if (buf == NULL && kmalloc_if_fail) {
+ if (isset(dhdpub->prealloc_malloc_mask, section)) {
+ DHD_ERROR(("%s: Section %d(size: %d) is already allocated\n",
+ __FUNCTION__, section, size));
+ return NULL;
+ }
+
buf = kmalloc(size, flags);
+ if (buf) {
+ DHD_ERROR(("%s: Preallocated memory section %d(size: %d)"
+ "allocated by kmalloc\n", __FUNCTION__,
+ section, size));
+ setbit(dhdpub->prealloc_malloc_mask, section);
+ }
+ }
return buf;
}
-void dhd_os_prefree(dhd_pub_t *dhdpub, void *addr, uint size)
+void dhd_os_prefree(dhd_pub_t *dhdpub, int section, void *addr, uint size)
{
+ if (section > DHD_PREALLOC_SECTION_MAX) {
+ DHD_ERROR(("%s: Invalid Section ID: %d\n", __FUNCTION__, section));
+ return;
+ }
+
+ if (addr && isset(dhdpub->prealloc_malloc_mask, section)) {
+ DHD_ERROR(("%s: Preallocated memory section %d(size: %d)"
+ "memory is freed by kfree\n", __FUNCTION__,
+ section, size));
+ clrbit(dhdpub->prealloc_malloc_mask, section);
+ kfree(addr);
+ }
}
#if defined(WL_WIRELESS_EXT)
int bcmerror = 0;
ASSERT(dhd != NULL);
- bcmerror = wl_host_event(&dhd->pub, ifidx, pktdata, event, data);
+#ifdef SHOW_LOGTRACE
+ bcmerror = wl_host_event(&dhd->pub, ifidx, pktdata, event, data, &dhd->event_data);
+#else
+ bcmerror = wl_host_event(&dhd->pub, ifidx, pktdata, event, data, NULL);
+#endif /* SHOW_LOGTRACE */
+
if (bcmerror != BCME_OK)
return (bcmerror);
/*
* DHD Linux header file (dhd_linux exports for cfg80211 and other components)
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Linux platform device for DHD WLAN adapter
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
#endif /* CONFIG_DTS */
#if !defined(CONFIG_WIFI_CONTROL_FUNC)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 58))
+#define WLAN_PLAT_NODFS_FLAG 0x01
+#endif
struct wifi_platform_data {
int (*set_power)(int val);
int (*set_reset)(int val);
int (*set_carddetect)(int val);
void *(*mem_prealloc)(int section, unsigned long size);
int (*get_mac_addr)(unsigned char *buf);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 58))
+ void *(*get_country_code)(char *ccode, u32 flags);
+#else
void *(*get_country_code)(char *ccode);
+#endif
};
#endif /* CONFIG_WIFI_CONTROL_FUNC */
}
#if 1
-/* Murata debug: this function is re-worked because "wifi_plat_data" is NULL. */
-/* Need to investigate how this pointer/data is being passed into probe function. */
-/* "wifi_plat_data" used to be "wifi_ctrl". */
-/* All this code is done for only one reason -- calling mmc_detect_change() in /drivers/mmc/core/core.c. */
extern void wifi_card_detect(void);
int wifi_platform_bus_enumerate(wifi_adapter_info_t *adapter, bool device_present)
{
- int err = 0;
- struct wifi_platform_data *plat_data;
+ int err = 0;
+ struct wifi_platform_data *plat_data;
- if (!adapter) {
- pr_err("!!!! %s: failed! adapter variable is NULL!!!!!\n", __FUNCTION__);
- return -EINVAL;
- }
+ if (!adapter) {
+ pr_err("!!!! %s: failed! adapter variable is NULL!!!!!\n", __FUNCTION__);
+ return -EINVAL;
+ }
- DHD_ERROR(("%s device present %d\n", __FUNCTION__, device_present));
+ DHD_ERROR(("%s device present %d\n", __FUNCTION__, device_present));
- if (!adapter->wifi_plat_data) {
- wifi_card_detect(); /* hook for card_detect */
- } else {
- plat_data = adapter->wifi_plat_data;
- if (plat_data->set_carddetect)
- err = plat_data->set_carddetect(device_present);
- }
+ if (!adapter->wifi_plat_data) {
+ wifi_card_detect(); /* hook for card_detect */
+ } else {
+ plat_data = adapter->wifi_plat_data;
+ if (plat_data->set_carddetect)
+ err = plat_data->set_carddetect(device_present);
+ }
- return 0; /* force success status returned */
+ return 0; /* force success status returned */
}
#else
-
int wifi_platform_bus_enumerate(wifi_adapter_info_t *adapter, bool device_present)
{
int err = 0;
DHD_TRACE(("%s\n", __FUNCTION__));
if (plat_data->get_country_code) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 58))
+ return plat_data->get_country_code(ccode, WLAN_PLAT_NODFS_FLAG);
+#else
return plat_data->get_country_code(ccode);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 58)) */
}
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) */
struct resource *resource;
wifi_adapter_info_t *adapter;
#ifdef CONFIG_DTS
-// int irq, gpio;
+#if defined(OOB_INTR_ONLY) && defined (HW_OOB)
+ int irq, gpio;
+#endif /* defined(OOB_INTR_ONLY) && defined (HW_OOB) */
#endif /* CONFIG_DTS */
/* Android style wifi platform data device ("bcmdhd_wlan" or "bcm4329_wlan")
DHD_ERROR(("%s regulator is null\n", __FUNCTION__));
return -1;
}
-
-#if 0
+#if defined(OOB_INTR_ONLY) && defined (HW_OOB)
/* This is to get the irq for the OOB */
gpio = of_get_gpio(pdev->dev.of_node, 0);
/* need to change the flags according to our requirement */
adapter->intr_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL |
IORESOURCE_IRQ_SHAREABLE;
-#endif
+#endif /* defined(OOB_INTR_ONLY) && defined (HW_OOB) */
#endif /* CONFIG_DTS */
wifi_plat_dev_probe_ret = dhd_wifi_platform_load();
void wifi_ctrlfunc_unregister_drv(void)
{
+
#ifdef CONFIG_DTS
DHD_ERROR(("unregister wifi platform drivers\n"));
platform_driver_unregister(&wifi_platform_dev_driver);
#else
struct device *dev1, *dev2;
-
dev1 = bus_find_device(&platform_bus_type, NULL, WIFI_PLAT_NAME, wifi_platdev_match);
dev2 = bus_find_device(&platform_bus_type, NULL, WIFI_PLAT_NAME2, wifi_platdev_match);
if (!dts_enabled)
/*
* Expose some of the kernel scheduler routines
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Broadcom Dongle Host Driver (DHD), Generic work queue framework
* Generic interface to handle dhd deferred work events
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_linux_wq.c 411851 2013-07-10 20:48:00Z $
+ * $Id: dhd_linux_wq.c 589976 2015-10-01 07:01:27Z $
*/
#include <linux/init.h>
return NULL;
}
kfifo_init(fifo, buf, size);
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)) */
+#endif
return fifo;
}
* Broadcom Dongle Host Driver (DHD), Generic work queue framework
* Generic interface to handle dhd deferred work events
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* DHD Bus Module for PCIE
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Linux DHD Bus Module for PCIE
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Linux DHD Bus Module for PCIE
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Broadcom Dongle Host Driver (DHD)
* Prefered Network Offload and Wi-Fi Location Service(WLS) code.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Header file of Broadcom Dongle Host Driver (DHD)
* Prefered Network Offload code and Wi-Fi Location Service(WLS) code.
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* DHD Bus Module for SDIO
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_sdio.c 506047 2014-10-02 12:43:31Z $
+ * $Id: dhd_sdio.c 572232 2015-07-17 12:14:31Z $
*/
-#include <linux/mmc/host.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/sdio_func.h>
-
#include <typedefs.h>
#include <osl.h>
#include <bcmsdh.h>
#include <sbsdpcmdev.h>
#include <bcmsdpcm.h>
#include <bcmsdbus.h>
-#include <bcmsdh_sdmmc.h>
#include <proto/ethernet.h>
#include <proto/802.1d.h>
#if (PMU_MAX_TRANSITION_DLY <= 1000000)
#undef PMU_MAX_TRANSITION_DLY
#define PMU_MAX_TRANSITION_DLY 1000000
+#define PMU_TRANSITION_DLY_EXTRA 500000
#endif
/* hooks for limiting threshold custom tx num in rx processing */
int err;
uint8 clkctl, clkreq, devctl;
bcmsdh_info_t *sdh;
+ uint32 delay = PMU_MAX_TRANSITION_DLY;
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
}
}
+ /* Give the 43362 chip a little bit extra time for HT Avail */
+ if (bus->sih->chip == BCM43362_CHIP_ID) {
+ delay += PMU_TRANSITION_DLY_EXTRA;
+ }
+
/* Otherwise, wait here (polling) for HT Avail */
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
SPINWAIT_SLEEP(sdioh_spinwait_sleep,
((clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
- SBSDIO_FUNC1_CHIPCLKCSR, &err)),
- !SBSDIO_CLKAV(clkctl, bus->alp_only)), PMU_MAX_TRANSITION_DLY);
+ SBSDIO_FUNC1_CHIPCLKCSR, &err)),
+ !SBSDIO_CLKAV(clkctl, bus->alp_only)),
+ delay);
}
if (err) {
DHD_ERROR(("%s: HT Avail request error: %d\n", __FUNCTION__, err));
uint32 swhdr_offset;
bool alloc_new_pkt = FALSE;
uint8 sdpcm_hdrlen = bus->txglom_enable ? SDPCM_HDRLEN_TXGLOM : SDPCM_HDRLEN;
- sdioh_info_t *sd = bus->sdh->sdioh;
- struct sdio_func *sdio_func = sd->func[0];
- struct mmc_host *host = sdio_func->card->host;
*new_pkt = NULL;
osh = bus->dhd->osh;
* Use the padding packet to avoid memory copy if applicable,
* otherwise, just allocate a new pkt.
*/
- if (bus->pad_pkt && (host->max_segs > 1)) {
+ if (bus->pad_pkt) {
*pad_pkt_len = chain_tail_padding;
bus->tx_tailpad_chain++;
} else {
PKTALIGN(osh, tmp_pkt, PKTLEN(osh, pkt), DHD_SDALIGN);
bcopy(PKTDATA(osh, pkt), PKTDATA(osh, tmp_pkt), PKTLEN(osh, pkt));
*new_pkt = tmp_pkt;
- /*
- * pull back sdpcm_hdrlen length from old skb as new skb here
- * is passed to postprocessing
- */
+ /* pull back sdpcm_hdrlen length from old skb as new skb here is passed
+ * to postprocessing
+ */
PKTPULL(osh, pkt, sdpcm_hdrlen);
pkt = tmp_pkt;
}
DHD_ERROR(("%s: MALLOC of %d-byte databuf failed\n",
__FUNCTION__, MAX_DATA_BUF));
/* release rxbuf which was already located as above */
- if (!bus->rxblen)
- DHD_OS_PREFREE(bus->dhd, bus->rxbuf, bus->rxblen);
+ if (bus->rxbuf) {
+ DHD_OS_PREFREE(bus->dhd, DHD_PREALLOC_RXBUF, bus->rxbuf, bus->rxblen);
+ }
goto fail;
}
/*
* DHD PROP_TXSTATUS Module.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_wlfc.c 505040 2014-09-26 06:39:18Z $
+ * $Id: dhd_wlfc.c 557502 2015-05-19 06:32:03Z $
*
*/
if (!p)
return;
-
ASSERT(prec >= 0 && prec < pq->num_prec);
- ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p))); /* queueing chains not allowed */
+ /* queueing chains not allowed and no segmented SKB (Kernel-3.18.y) */
+ ASSERT(!((PKTLINK(p) != NULL) && (PKTLINK(p) != p)));
ASSERT(!pktq_full(pq));
ASSERT(!pktq_pfull(pq, prec));
}
/* allocate space to track txstatus propagated from firmware */
- dhd->wlfc_state = MALLOC(dhd->osh, sizeof(athost_wl_status_info_t));
+ dhd->wlfc_state = DHD_OS_PREALLOC(dhd, DHD_PREALLOC_DHD_WLFC_INFO,
+ sizeof(athost_wl_status_info_t));
+
if (dhd->wlfc_state == NULL) {
rc = BCME_NOMEM;
goto exit;
if (!WLFC_GET_AFQ(dhd->wlfc_mode)) {
wlfc->hanger = _dhd_wlfc_hanger_create(dhd->osh, WLFC_HANGER_MAXITEMS);
if (wlfc->hanger == NULL) {
- MFREE(dhd->osh, dhd->wlfc_state, sizeof(athost_wl_status_info_t));
+ DHD_OS_PREFREE(dhd, DHD_PREALLOC_DHD_WLFC_INFO,
+ dhd->wlfc_state, sizeof(athost_wl_status_info_t));
dhd->wlfc_state = NULL;
rc = BCME_NOMEM;
goto exit;
/* free top structure */
- MFREE(dhd->osh, dhd->wlfc_state, sizeof(athost_wl_status_info_t));
+ DHD_OS_PREFREE(dhd, DHD_PREALLOC_DHD_WLFC_INFO,
+ dhd->wlfc_state, sizeof(athost_wl_status_info_t));
dhd->wlfc_state = NULL;
dhd->proptxstatus_mode = hostreorder ?
WLFC_ONLY_AMPDU_HOSTREORDER : WLFC_FCMODE_NONE;
/*
-* Copyright (C) 1999-2014, Broadcom Corporation
+* Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Common stats definitions for clients of dongle
* ports
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Dongle WL Header definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Misc utility routines for accessing PMU corerev specific features
* of the SiliconBackplane-based Broadcom chips.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: hndpmu.c 433378 2013-10-31 17:19:39Z $
+ * $Id: hndpmu.c 530682 2015-01-30 18:48:21Z $
*/
/*
* Broadcom AMBA Interconnect definitions.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: aidmp.h 404499 2013-05-28 01:06:37Z $
+ * $Id: aidmp.h 530682 2015-01-30 18:48:21Z $
*/
#ifndef _AIDMP_H
#define ER_ADD 4
#define ER_END 0xe
#define ER_BAD 0xffffffff
+#define ER_SZ_MAX 4096 /* 4KB */
/* EROM CompIdentA */
#define CIA_MFG_MASK 0xfff00000
/*
* BCM common config options
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* and instrumentation on top of the heap, without modifying the heap
* allocation implementation.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* Definitions subject to change without notice.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Misc system wide definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom device-specific manifest constants.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Byte order utilities
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* Definitions subject to change without notice.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* NVRAM variable manipulation
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Broadcom PCIE
* Software-specific definitions shared between device and host side
* Explains the shared area between host and dongle
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom PCI-SPI Host Controller Register Definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Performance counters software interface.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Definitions for API from sdio common code (bcmsdh) to individual
* host controller drivers.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* export functions to client drivers
* abstract OS and BUS specific details of SDIO
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Broadcom SDIO/PCMCIA
* Software-specific definitions shared between device and host side
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* SD-SPI Protocol Conversion - BCMSDH->SPI Translation Layer
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* 'Standard' SDIO HOST CONTROLLER driver
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom SPI Low-Level Hardware Driver API
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* SD-SPI Protocol Conversion - BCMSDH->gSPI Translation Layer
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* SROM format definition.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Table that encodes the srom formats for PCI/PCIe NICs.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Misc useful os-independent macros and functions.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Definitions for nl80211 testmode access to host driver
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Initialization and support routines for self-booting compressed image.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Dongle BUS interface Abstraction layer
* target serial buses like USB, SDIO, SPI, etc.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* Definitions subject to change without notice.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
#define AES_ENABLED 0x0004
#define WSEC_SWFLAG 0x0008
#define SES_OW_ENABLED 0x0040 /* to go into transition mode without setting wep */
-#ifdef BCMWAPI_WPI
-#define SMS4_ENABLED 0x0100
-#endif /* BCMWAPI_WPI */
/* wsec macros for operating on the above definitions */
#define WSEC_WEP_ENABLED(wsec) ((wsec) & WEP_ENABLED)
#define WSEC_TKIP_ENABLED(wsec) ((wsec) & TKIP_ENABLED)
#define WSEC_AES_ENABLED(wsec) ((wsec) & AES_ENABLED)
-#ifdef BCMWAPI_WPI
-#define WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED | SMS4_ENABLED))
-#else /* BCMWAPI_WPI */
#define WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
-#endif /* BCMWAPI_WPI */
#define WSEC_SES_OW_ENABLED(wsec) ((wsec) & SES_OW_ENABLED)
-#ifdef BCMWAPI_WAI
-#define WSEC_SMS4_ENABLED(wsec) ((wsec) & SMS4_ENABLED)
-#endif /* BCMWAPI_WAI */
#define MFP_CAPABLE 0x0200
#define MFP_REQUIRED 0x0400
#define WPA2_AUTH_PSK 0x0080 /* Pre-shared key */
#define BRCM_AUTH_PSK 0x0100 /* BRCM specific PSK */
#define BRCM_AUTH_DPT 0x0200 /* DPT PSK without group keys */
-#if defined(BCMWAPI_WAI) || defined(BCMWAPI_WPI)
-#define WPA_AUTH_WAPI 0x0400
-#define WAPI_AUTH_NONE WPA_AUTH_NONE /* none (IBSS) */
-#define WAPI_AUTH_UNSPECIFIED 0x0400 /* over AS */
-#define WAPI_AUTH_PSK 0x0800 /* Pre-shared key */
-#endif /* BCMWAPI_WAI || BCMWAPI_WPI */
//#define WPA2_AUTH_MFP 0x1000 /* MFP (11w) in contrast to CCX */
#define WPA2_AUTH_1X_SHA256 0x1000 /* 1X with SHA256 key derivation */
#define WPA2_AUTH_TPK 0x2000 /* TDLS Peer Key */
*
* Definitions subject to change without notice.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
#define EPI_MINOR_VERSION 141
-#define EPI_RC_NUMBER 72
+#define EPI_RC_NUMBER 0
#define EPI_INCREMENTAL_NUMBER 0
#define EPI_BUILD_NUMBER 0
-#define EPI_VERSION 1, 141, 72, 0
+#define EPI_VERSION 1, 141, 0, 0
-#define EPI_VERSION_NUM 0x018d4800
+#define EPI_VERSION_NUM 0x018d0000
-#define EPI_VERSION_DEV 1.141.72
+#define EPI_VERSION_DEV 1.141.0
/* Driver Version String, ASCII, 32 chars max */
-#define EPI_VERSION_STR "1.141.72 (r)"
+#define EPI_VERSION_STR "1.141 (TOB) (r)"
#endif /* _epivers_h_ */
/*
* HND SiliconBackplane PMU support.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* HNDRTE arm trap handling.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Console support for hndrte.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom HND chip & on-chip-interconnect-related definitions.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Linux OS Independent Layer
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* 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) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Command line options parser.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Trace messages sent over HBUS
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* OS Abstraction Layer
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* #include <packed_section_end.h>
*
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* #include <packed_section_end.h>
*
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* pcicfg.h: PCI configuration constants and structures.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* BCM43XX PCIE core hardware definitions.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
#define WCN_OUI "\x00\x50\xf2" /* WCN OUI */
#define WCN_TYPE 4 /* WCN type */
-#ifdef BCMWAPI_WPI
-#define SMS4_KEY_LEN 16
-#define SMS4_WPI_CBC_MAC_LEN 16
-#endif
/* 802.11r protocol definitions */
#define BSSID_INVALID "\x00\x00\x00\x00\x00\x00"
#define BSSID_BROADCAST "\xFF\xFF\xFF\xFF\xFF\xFF"
-#ifdef BCMWAPI_WAI
-#define WAPI_IE_MIN_LEN 20 /* WAPI IE min length */
-#define WAPI_VERSION 1 /* WAPI version */
-#define WAPI_VERSION_LEN 2 /* WAPI version length */
-#define WAPI_OUI "\x00\x14\x72" /* WAPI OUI */
-#define WAPI_OUI_LEN DOT11_OUI_LEN /* WAPI OUI length */
-#endif /* BCMWAPI_WAI */
/* ************* WMM Parameter definitions. ************* */
#define WMM_OUI "\x00\x50\xF2" /* WNN OUI */
/*
* BT-AMP (BlueTooth Alternate Mac and Phy) 802.11 PAL (Protocol Adaptation Layer)
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* 802.11e protocol header file
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom Ethernettype protocol definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom Event protocol definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* Dependencies: proto/bcmeth.h
*
- * $Id: bcmevent.h 502360 2014-09-12 19:31:22Z $
+ * $Id: bcmevent.h 589976 2015-10-01 07:01:27Z $
*
*/
#define WLC_E_IF_ROLE_WDS 2 /* WDS link */
#define WLC_E_IF_ROLE_P2P_GO 3 /* P2P Group Owner */
#define WLC_E_IF_ROLE_P2P_CLIENT 4 /* P2P Client */
+#define WLC_E_IF_ROLE_IBSS 8 /* IBSS */
/* WLC_E_RSSI event data */
typedef struct wl_event_data_rssi {
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Fundamental constants relating to TCP Protocol
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* BT-AMP (BlueTooth Alternate Mac and Phy) HCI (Host/Controller Interface)
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* IEEE Std 802.1X-2001
* IEEE 802.1X RADIUS Usage Guidelines
*
- * Copyright Open Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
+ *
+ * Unless you and Broadcom execute a separate written software license
+ * agreement governing use of this software, this software is licensed to you
+ * under the terms of the GNU General Public License version 2 (the "GPL"),
+ * available at http://www.broadcom.com/licenses/GPLv2.php, with the
+ * following added to such license:
+ *
+ * As a special exception, the copyright holders of this software give you
+ * permission to link this software with independent modules, and to copy and
+ * distribute the resulting executable under terms of your choice, provided that
+ * you also meet, for each linked independent module, the terms and conditions of
+ * the license of that module. An independent module is a module which is not
+ * derived from this software. The special exception does not apply to any
+ * modifications of the software.
+ *
+ * Notwithstanding the above, under no circumstances may you combine this
+ * software in any way with any other Broadcom software provided under a license
+ * other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: eapol.h 452678 2014-01-31 19:16:29Z $
+ * $Id: eapol.h 526865 2015-01-15 07:44:19Z $
*/
#ifndef _eapol_h_
/*
* From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* SD-SPI Protocol Standard
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* 802.1Q VLAN protocol definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Fundamental types and constants relating to WPA
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
#define WPA_CIPHER_BIP 6 /* WEP (104-bit) */
#define WPA_CIPHER_TPK 7 /* Group addressed traffic not allowed */
-#ifdef BCMWAPI_WAI
-#define WAPI_CIPHER_NONE WPA_CIPHER_NONE
-#define WAPI_CIPHER_SMS4 11
-
-#define WAPI_CSE_WPI_SMS4 1
-#endif /* BCMWAPI_WAI */
#define IS_WPA_CIPHER(cipher) ((cipher) == WPA_CIPHER_NONE || \
(cipher) == WPA_CIPHER_WEP_40 || \
(cipher) == WPA_CIPHER_AES_CCM || \
(cipher) == WPA_CIPHER_TPK)
-#ifdef BCMWAPI_WAI
-#define IS_WAPI_CIPHER(cipher) ((cipher) == WAPI_CIPHER_NONE || \
- (cipher) == WAPI_CSE_WPI_SMS4)
-
-/* convert WAPI_CSE_WPI_XXX to WAPI_CIPHER_XXX */
-#define WAPI_CSE_WPI_2_CIPHER(cse) ((cse) == WAPI_CSE_WPI_SMS4 ? \
- WAPI_CIPHER_SMS4 : WAPI_CIPHER_NONE)
-
-#define WAPI_CIPHER_2_CSE_WPI(cipher) ((cipher) == WAPI_CIPHER_SMS4 ? \
- WAPI_CSE_WPI_SMS4 : WAPI_CIPHER_NONE)
-#endif /* BCMWAPI_WAI */
/* WPA TKIP countermeasures parameters */
#define WPA_TKIP_CM_DETECT 60 /* multiple MIC failure window (seconds) */
#define WPA2_PMKID_COUNT_LEN 2
-#ifdef BCMWAPI_WAI
-#define WAPI_CAP_PREAUTH RSN_CAP_PREAUTH
-
-/* Other WAI definition */
-#define WAPI_WAI_REQUEST 0x00F1
-#define WAPI_UNICAST_REKEY 0x00F2
-#define WAPI_STA_AGING 0x00F3
-#define WAPI_MUTIL_REKEY 0x00F4
-#define WAPI_STA_STATS 0x00F5
-
-#define WAPI_USK_REKEY_COUNT 0x4000000 /* 0xA00000 */
-#define WAPI_MSK_REKEY_COUNT 0x4000000 /* 0xA00000 */
-#endif /* BCMWAPI_WAI */
/* This marks the end of a packed structure section. */
#include <packed_section_end.h>
/*
* WPS IE definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* $Id: sbchipc.h 468568 2014-04-08 05:33:12Z $
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom SiliconBackplane hardware register definitions.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Generic Broadcom Home Networking Division (HND) DMA engine HW interface
* This supports the following chips: BCM42xx, 44xx, 47xx .
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: sbhnddma.h 424099 2013-09-16 07:44:34Z $
+ * $Id: sbhnddma.h 530682 2015-01-30 18:48:21Z $
*/
#ifndef _sbhnddma_h_
/*
* BCM43XX Sonics SiliconBackplane PCMCIA core hardware definitions.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* SDIO core support 1bit, 4 bit SDIO mode as well as SPI mode.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Broadcom SiliconBackplane SDIO/PCMCIA hardware-specific
* device core support
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* BCM47XX Sonics SiliconBackplane embedded ram core
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* SDIO spec header file
* Protocol and standard (common) device definitions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* SDIO Host Controller Spec header file
* Register map and definitions for the Standard Host Controller
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Structure used by apps whose drivers access SDIO drivers.
* Pulled out separately so dhdu and wlu can both use it.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Misc utility routines for accessing the SOC Interconnects
* of Broadcom HNBU chips.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: siutils.h 481592 2014-05-29 22:10:51Z $
+ * $Id: siutils.h 530682 2015-01-30 18:48:21Z $
*/
#ifndef _siutils_h_
/*
* SPI device spec header file
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* TRX image file header format.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
-* Copyright (C) 1999-2014, Broadcom Corporation
+* Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* Definitions subject to change without notice.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wlioctl.h 502360 2014-09-12 19:31:22Z $
+ * $Id: wlioctl.h 575651 2015-07-30 13:49:47Z $
*/
#ifndef _wlioctl_h_
cca_congest_t secs[1]; /* Data */
} cca_congest_channel_req_t;
+typedef struct {
+ uint32 msrmnt_time; /**< Time for Measurement (msec) */
+ uint32 msrmnt_done; /**< flag set when measurement complete */
+ char buf[1];
+} cca_stats_n_flags;
+
+typedef struct {
+ uint32 msrmnt_query; /* host to driver query for measurement done */
+ uint32 time_req; /* time required for measurement */
+ uint8 report_opt; /* option to print different stats in report */
+} cca_msrmnt_query;
+
/* interference sources */
enum interference_source {
ITFR_NONE = 0, /* interference */
#define LOGRRC_FIX_LEN 8
#define IOBUF_ALLOWED_NUM_OF_LOGREC(type, len) ((len - LOGRRC_FIX_LEN)/sizeof(type))
-#ifdef BCMWAPI_WAI
-#define IV_LEN 16
- struct wapi_sta_msg_t
- {
- uint16 msg_type;
- uint16 datalen;
- uint8 vap_mac[6];
- uint8 reserve_data1[2];
- uint8 sta_mac[6];
- uint8 reserve_data2[2];
- uint8 gsn[IV_LEN];
- uint8 wie[256];
- };
-#endif /* BCMWAPI_WAI */
/* chanim acs record */
typedef struct {
/*
* Linux OS Independent Layer
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: linux_osl.c 513768 2014-11-07 09:12:55Z $
+ * $Id: linux_osl.c 542523 2015-03-20 03:21:32Z $
*/
#define LINUX_PORT
#define STATIC_BUF_TOTAL_LEN (STATIC_BUF_MAX_NUM * STATIC_BUF_SIZE)
typedef struct bcm_static_buf {
- struct semaphore static_sem;
+ spinlock_t static_lock;
unsigned char *buf_ptr;
unsigned char buf_use[STATIC_BUF_MAX_NUM];
} bcm_static_buf_t;
ASSERT(osh->magic == OS_HANDLE_MAGIC);
kfree(osh);
return -ENOMEM;
+ } else {
+ printk("alloc static buf at %p!\n", bcm_static_buf);
}
- else
- printk("alloc static buf at %x!\n", (unsigned int)bcm_static_buf);
-
- sema_init(&bcm_static_buf->static_sem, 1);
+ spin_lock_init(&bcm_static_buf->static_lock);
bcm_static_buf->buf_ptr = (unsigned char *)bcm_static_buf + STATIC_BUF_SIZE;
}
bcm_static_skb->pkt_use[i] = 1;
skb = bcm_static_skb->skb_4k[i];
- skb->tail = skb->data + len;
+ skb_set_tail_pointer(skb, len);
skb->len = len;
up(&bcm_static_skb->osl_pkt_sem);
if (i != STATIC_PKT_MAX_NUM) {
bcm_static_skb->pkt_use[i + STATIC_PKT_MAX_NUM] = 1;
skb = bcm_static_skb->skb_8k[i];
- skb->tail = skb->data + len;
+ skb_set_tail_pointer(skb, len);
skb->len = len;
up(&bcm_static_skb->osl_pkt_sem);
bcm_static_skb->pkt_use[STATIC_PKT_MAX_NUM * 2] = 1;
skb = bcm_static_skb->skb_16k;
- skb->tail = skb->data + len;
+ skb_set_tail_pointer(skb, len);
skb->len = len;
up(&bcm_static_skb->osl_pkt_sem);
#ifdef CONFIG_DHD_USE_STATIC_BUF
if (bcm_static_buf)
{
+ unsigned long irq_flags;
int i = 0;
if ((size >= PAGE_SIZE)&&(size <= STATIC_BUF_SIZE))
{
- down(&bcm_static_buf->static_sem);
+ spin_lock_irqsave(&bcm_static_buf->static_lock, irq_flags);
for (i = 0; i < STATIC_BUF_MAX_NUM; i++)
{
if (i == STATIC_BUF_MAX_NUM)
{
- up(&bcm_static_buf->static_sem);
+ spin_unlock_irqrestore(&bcm_static_buf->static_lock, irq_flags);
printk("all static buff in use!\n");
goto original;
}
bcm_static_buf->buf_use[i] = 1;
- up(&bcm_static_buf->static_sem);
+ spin_unlock_irqrestore(&bcm_static_buf->static_lock, irq_flags);
bzero(bcm_static_buf->buf_ptr+STATIC_BUF_SIZE*i, size);
if (osh)
osl_mfree(osl_t *osh, void *addr, uint size)
{
#ifdef CONFIG_DHD_USE_STATIC_BUF
+ unsigned long flags;
+
if (bcm_static_buf)
{
if ((addr > (void *)bcm_static_buf) && ((unsigned char *)addr
buf_idx = ((unsigned char *)addr - bcm_static_buf->buf_ptr)/STATIC_BUF_SIZE;
- down(&bcm_static_buf->static_sem);
+ spin_lock_irqsave(&bcm_static_buf->static_lock, flags);
bcm_static_buf->buf_use[buf_idx] = 0;
- up(&bcm_static_buf->static_sem);
+ spin_unlock_irqrestore(&bcm_static_buf->static_lock, flags);
if (osh && osh->cmn) {
ASSERT(osh->magic == OS_HANDLE_MAGIC);
* Misc utility routines for accessing chip-specific features
* of the SiliconBackplane-based Broadcom chips.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* Misc utility routines for accessing chip-specific features
* of the SiliconBackplane-based Broadcom chips.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: siutils.c 498632 2014-08-25 14:09:22Z $
+ * $Id: siutils.c 550969 2015-04-22 00:27:43Z $
*/
#include <bcm_cfg.h>
}
}
+/*
+ * Divide the clock by the divisor with protection for
+ * a zero divisor.
+ */
+static uint32
+divide_clock(uint32 clock, uint32 div)
+{
+ return div ? clock / div : 0;
+}
+
+
/** calculate the speed the SI would run at given a set of clockcontrol values */
uint32
si_clock_rate(uint32 pll_type, uint32 n, uint32 m)
switch (mc) {
case CC_MC_BYPASS: return (clock);
- case CC_MC_M1: return (clock / m1);
- case CC_MC_M1M2: return (clock / (m1 * m2));
- case CC_MC_M1M2M3: return (clock / (m1 * m2 * m3));
- case CC_MC_M1M3: return (clock / (m1 * m3));
+ case CC_MC_M1: return divide_clock(clock, m1);
+ case CC_MC_M1M2: return divide_clock(clock, m1 * m2);
+ case CC_MC_M1M2M3: return divide_clock(clock, m1 * m2 * m3);
+ case CC_MC_M1M3: return divide_clock(clock, m1 * m3);
default: return (0);
}
} else {
/*
* Include file private to the SOC Interconnect support files.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
*
* Description: Universal AMP API
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Linux cfg80211 driver - Android related functions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wl_android.c 513774 2014-11-07 09:30:34Z $
+ * $Id: wl_android.c 555968 2015-05-12 01:56:23Z $
*/
#include <linux/module.h>
#define CMD_CHANSPEC "CHANSPEC"
#define CMD_DATARATE "DATARATE"
#define CMD_ASSOC_CLIENTS "ASSOCLIST"
+#define CMD_SET_CSA "SETCSA"
#define CMD_KEEP_ALIVE "KEEPALIVE"
extern char iface_name[IFNAMSIZ];
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+#define strnicmp(str1, str2, len) strncasecmp((str1), (str2), (len))
+#else
+#define strnicmp(str1, str2, len) strnicmp((str1), (str2), (len))
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) */
+
/**
* Local (static) functions and variables
*/
int bytes_written = 0;
int error = 0;
scb_val_t scbval;
-
- if (*(command + 4) == ' ') {
- DHD_ERROR(("%s: cmd:%s\n", __FUNCTION__, (command+5)));
- if (!(bcm_ether_atoe((command+5), &scbval.ea)))
+ char *delim = NULL;
+
+ delim = strchr(command, ' ');
+ /* For Ap mode rssi command would be
+ * driver rssi <sta_mac_addr>
+ * for STA/GC mode
+ * driver rssi
+ */
+ if (delim) {
+ /* Ap/GO mode
+ * driver rssi <sta_mac_addr>
+ */
+ DHD_TRACE(("%s: cmd:%s\n", __FUNCTION__, delim));
+ /* skip space from delim after finding char */
+ delim++;
+ if (!(bcm_ether_atoe((delim), &scbval.ea)))
{
DHD_ERROR(("%s:address err\n", __FUNCTION__));
return -1;
}
scbval.val = htod32(0);
- DHD_ERROR(("%s: address:"MACDBG, __FUNCTION__, MAC2STRDBG(scbval.ea.octet)));
+ DHD_TRACE(("%s: address:"MACDBG, __FUNCTION__, MAC2STRDBG(scbval.ea.octet)));
}
else {
+ /* STA/GC mode */
memset(&scbval, 0, sizeof(scb_val_t));
}
bytes_written = ssid.SSID_len;
}
bytes_written += snprintf(&command[bytes_written], total_len, " rssi %d", scbval.val);
- DHD_INFO(("%s: command result is %s (%d)\n", __FUNCTION__, command, bytes_written));
+ DHD_TRACE(("%s: command result is %s (%d)\n", __FUNCTION__, command, bytes_written));
return bytes_written;
}
return -1;
DHD_INFO(("%s: mode:%s\n", __FUNCTION__, mode));
- bytes_written = snprintf(command, total_len, "%s %s %s", CMD_80211_MODE, "mode", mode);
+ bytes_written = snprintf(command, total_len, "%s %s", CMD_80211_MODE, mode);
DHD_INFO(("%s: command:%s EXIT\n", __FUNCTION__, command));
return bytes_written;
uint16 bw = 0;
uint16 channel = 0;
u32 sb = 0;
- char ba[3];
chanspec_t chanspec;
- /* Get channel & Freq */
+ /* command is
+ * driver chanspec
+ */
error = wldev_iovar_getint(dev, "chanspec", &chsp);
if (error)
return -1;
DHD_INFO(("%s:channel:%d band:%d bandwidth:%d\n", __FUNCTION__, channel, band, bw));
- if (band == WL_CHANSPEC_BAND_2G)
- strcpy(ba, "2G");
- else if (band == WL_CHANSPEC_BAND_5G)
- strcpy(ba, "5G");
-
if (bw == WL_CHANSPEC_BW_80)
bw = WL_CH_BANDWIDTH_80MHZ;
else if (bw == WL_CHANSPEC_BW_40)
channel += (CH_10MHZ_APART + CH_20MHZ_APART);
}
}
- bytes_written = snprintf(command, total_len, "%s %s %d %s %s %s %d", CMD_CHANSPEC,
- "channel", channel, "band", ba, "bw", bw);
+ bytes_written = snprintf(command, total_len, "%s channel %d band %s bw %d", CMD_CHANSPEC,
+ channel, band == WL_CHANSPEC_BAND_5G ? "5G":"2G", bw);
DHD_INFO(("%s: command:%s EXIT\n", __FUNCTION__, command));
return bytes_written;
DHD_INFO(("%s:datarate:%d\n", __FUNCTION__, datarate));
- bytes_written = snprintf(command, total_len, "%s %s %d", CMD_DATARATE,
- "datarate", (datarate/2));
+ bytes_written = snprintf(command, total_len, "%s %d", CMD_DATARATE, (datarate/2));
return bytes_written;
}
int wl_android_get_assoclist(struct net_device *dev, char *command, int total_len)
return -1;
assoc_maclist->count = dtoh32(assoc_maclist->count);
- bytes_written = snprintf(command, total_len, "%s %s %d %s", CMD_ASSOC_CLIENTS,
- "listcount", assoc_maclist->count, "assoclist:");
+ bytes_written = snprintf(command, total_len, "%s listcount: %d Stations:",
+ CMD_ASSOC_CLIENTS, assoc_maclist->count);
for (i = 0; i < assoc_maclist->count; i++) {
- bytes_written = snprintf(command, total_len, "%s"MACDBG"%c",
- command, MAC2STRDBG(assoc_maclist->ea[i].octet), ' ');
+ bytes_written += snprintf(command + bytes_written, total_len, " " MACDBG,
+ MAC2STRDBG(assoc_maclist->ea[i].octet));
}
return bytes_written;
}
+extern chanspec_t
+wl_chspec_host_to_driver(chanspec_t chanspec);
+static int wl_android_set_csa(struct net_device *dev, char *command, int total_len)
+{
+ int error = 0;
+ char smbuf[WLC_IOCTL_SMLEN];
+ wl_chan_switch_t csa_arg;
+ char buf[32];
+ u32 chnsp = 0;
+ int err = 0;
+
+ DHD_INFO(("%s: command:%s\n", __FUNCTION__, command));
+
+ command = (command + strlen(CMD_SET_CSA));
+ /* Order is mode, count channel */
+ if (!*++command) {
+ DHD_ERROR(("%s:error missing arguments\n", __FUNCTION__));
+ return -1;
+ }
+ csa_arg.mode = bcm_atoi(command);
+ if (csa_arg.mode != 0 && csa_arg.mode != 1) {
+ DHD_ERROR(("Invalid mode\n"));
+ return -1;
+ } if (!*++command) {
+ DHD_ERROR(("%s:error missing count\n", __FUNCTION__));
+ return -1;
+ }
+ command++;
+ csa_arg.count = bcm_atoi(command);
+ if (!*++command) {
+ DHD_ERROR(("%s:error missing channel\n", __FUNCTION__));
+ return -1;
+ }
+ csa_arg.reg = 0;
+ csa_arg.chspec = 0;
+ command += 2;
+ if (sizeof(buf) > strlen(command))
+ bcm_strncpy_s(buf, sizeof(buf), command, strlen(command));
+ else {
+ DHD_ERROR(("%s:command is invalid\n", __FUNCTION__));
+ return -1;
+ }
+ chnsp = wf_chspec_aton(buf);
+ if (chnsp == 0) {
+ DHD_ERROR(("%s:chsp is not correct\n", __FUNCTION__));
+ return -1;
+ }
+ chnsp = wl_chspec_host_to_driver(chnsp);
+ csa_arg.chspec = chnsp;
+
+ if (chnsp & WL_CHANSPEC_BAND_5G) {
+ u32 chanspec = chnsp;
+ err = wldev_iovar_getint(dev, "per_chan_info", &chanspec);
+ if (!err) {
+ if ((chanspec & WL_CHAN_RADAR) || (chanspec & WL_CHAN_PASSIVE)) {
+ DHD_ERROR(("Channel is radar sensitive\n"));
+ return -1;
+ }
+ if (chanspec == 0) {
+ DHD_ERROR(("Invalid hw channel\n"));
+ return -1;
+ }
+ } else {
+ DHD_ERROR(("does not support per_chan_info\n"));
+ return -1;
+ }
+ DHD_INFO(("non radar sensitivity\n"));
+ }
+ error = wldev_iovar_setbuf(dev, "csa", &csa_arg, sizeof(csa_arg),
+ smbuf, sizeof(smbuf), NULL);
+ if (error) {
+ DHD_ERROR(("%s:set csa failed:%d\n", __FUNCTION__, error));
+ return -1;
+ }
+ return 0;
+}
static int wl_android_get_band(struct net_device *dev, char *command, int total_len)
{
uint band;
int err = BCME_OK;
uint i, tokens;
char *pos, *pos2, *token, *token2, *delim;
- char param[PNO_PARAM_SIZE], value[VALUE_SIZE];
+ char param[PNO_PARAM_SIZE+1], value[VALUE_SIZE+1];
struct dhd_pno_batch_params batch_params;
DHD_PNO(("%s: command=%s, len=%d\n", __FUNCTION__, command, total_len));
if (total_len < strlen(CMD_WLS_BATCHING)) {
int macmode = MACLIST_MODE_DISABLED;
struct maclist *list;
char eabuf[ETHER_ADDR_STR_LEN];
+ char *token;
/* string should look like below (macmode/macnum/maclist) */
/* 1 2 00:11:22:33:44:55 00:11:22:33:44:ff */
/* get the MAC filter mode */
- macmode = bcm_atoi(strsep((char**)&str, " "));
+ token = strsep((char**)&str, " ");
+ if (!token) {
+ return -1;
+ }
+ macmode = bcm_atoi(token);
if (macmode < MACLIST_MODE_DISABLED || macmode > MACLIST_MODE_ALLOW) {
DHD_ERROR(("%s : invalid macmode %d\n", __FUNCTION__, macmode));
return -1;
}
- macnum = bcm_atoi(strsep((char**)&str, " "));
+ token = strsep((char**)&str, " ");
+ if (!token) {
+ return -1;
+ }
+ macnum = bcm_atoi(token);
if (macnum < 0 || macnum > MAX_NUM_MAC_FILT) {
DHD_ERROR(("%s : invalid number of MAC address entries %d\n",
__FUNCTION__, macnum));
DHD_INFO(("%s: enter miracast mode %d\n", __FUNCTION__, mode));
- if (miracast_cur_mode == mode)
+ if (miracast_cur_mode == mode) {
return 0;
+ }
wl_android_iolist_resume(dev, &miracast_resume_list);
miracast_cur_mode = MIRACAST_MODE_OFF;
DHD_ERROR(("%s: Connected station's beacon interval: "
"%d and set mchan_algo to %d \n",
__FUNCTION__, val, config.param));
- }
- else {
+ } else {
config.param = MIRACAST_MCHAN_ALGO;
}
ret = wl_android_iolist_add(dev, &miracast_resume_list, &config);
- if (ret)
+ if (ret) {
goto resume;
+ }
/* setting mchan_bw to platform specific value */
config.iovar = "mchan_bw";
config.param = MIRACAST_MCHAN_BW;
ret = wl_android_iolist_add(dev, &miracast_resume_list, &config);
- if (ret)
+ if (ret) {
goto resume;
+ }
/* setting apmdu to platform specific value */
config.iovar = "ampdu_mpdu";
config.param = MIRACAST_AMPDU_SIZE;
ret = wl_android_iolist_add(dev, &miracast_resume_list, &config);
- if (ret)
+ if (ret) {
goto resume;
+ }
/* FALLTROUGH */
/* Source mode shares most configurations with sink mode.
* Fall through here to avoid code duplication
config.iovar = "roam_off";
config.param = 1;
ret = wl_android_iolist_add(dev, &miracast_resume_list, &config);
- if (ret)
+ if (ret) {
goto resume;
+ }
+
/* tunr off pm */
- val = 0;
- config.iovar = NULL;
- config.ioctl = WLC_GET_PM;
- config.arg = &val;
- config.len = sizeof(int);
- ret = wl_android_iolist_add(dev, &miracast_resume_list, &config);
- if (ret)
+ ret = wldev_ioctl(dev, WLC_GET_PM, &val, sizeof(val), false);
+ if (ret) {
goto resume;
+ }
+
+ if (val != PM_OFF) {
+ val = PM_OFF;
+ config.iovar = NULL;
+ config.ioctl = WLC_GET_PM;
+ config.arg = &val;
+ config.len = sizeof(int);
+ ret = wl_android_iolist_add(dev, &miracast_resume_list, &config);
+ if (ret) {
+ goto resume;
+ }
+ }
break;
case MIRACAST_MODE_OFF:
DHD_INFO(("%s: Android private cmd \"%s\" on %s\n", __FUNCTION__, command, ifr->ifr_name));
- if (strncasecmp(command, CMD_START, strlen(CMD_START)) == 0) {
+ if (strnicmp(command, CMD_START, strlen(CMD_START)) == 0) {
DHD_INFO(("%s, Received regular START command\n", __FUNCTION__));
bytes_written = wl_android_wifi_on(net);
}
- else if (strncasecmp(command, CMD_SETFWPATH, strlen(CMD_SETFWPATH)) == 0) {
+ else if (strnicmp(command, CMD_SETFWPATH, strlen(CMD_SETFWPATH)) == 0) {
bytes_written = wl_android_set_fwpath(net, command, priv_cmd.total_len);
}
goto exit;
}
- if (strncasecmp(command, CMD_STOP, strlen(CMD_STOP)) == 0) {
+ if (strnicmp(command, CMD_STOP, strlen(CMD_STOP)) == 0) {
bytes_written = wl_android_wifi_off(net);
}
- else if (strncasecmp(command, CMD_SCAN_ACTIVE, strlen(CMD_SCAN_ACTIVE)) == 0) {
+ else if (strnicmp(command, CMD_SCAN_ACTIVE, strlen(CMD_SCAN_ACTIVE)) == 0) {
/* TBD: SCAN-ACTIVE */
}
- else if (strncasecmp(command, CMD_SCAN_PASSIVE, strlen(CMD_SCAN_PASSIVE)) == 0) {
+ else if (strnicmp(command, CMD_SCAN_PASSIVE, strlen(CMD_SCAN_PASSIVE)) == 0) {
/* TBD: SCAN-PASSIVE */
}
- else if (strncasecmp(command, CMD_RSSI, strlen(CMD_RSSI)) == 0) {
+ else if (strnicmp(command, CMD_RSSI, strlen(CMD_RSSI)) == 0) {
bytes_written = wl_android_get_rssi(net, command, priv_cmd.total_len);
}
- else if (strncasecmp(command, CMD_LINKSPEED, strlen(CMD_LINKSPEED)) == 0) {
+ else if (strnicmp(command, CMD_LINKSPEED, strlen(CMD_LINKSPEED)) == 0) {
bytes_written = wl_android_get_link_speed(net, command, priv_cmd.total_len);
}
#ifdef PKT_FILTER_SUPPORT
- else if (strncasecmp(command, CMD_RXFILTER_START, strlen(CMD_RXFILTER_START)) == 0) {
+ else if (strnicmp(command, CMD_RXFILTER_START, strlen(CMD_RXFILTER_START)) == 0) {
bytes_written = net_os_enable_packet_filter(net, 1);
}
- else if (strncasecmp(command, CMD_RXFILTER_STOP, strlen(CMD_RXFILTER_STOP)) == 0) {
+ else if (strnicmp(command, CMD_RXFILTER_STOP, strlen(CMD_RXFILTER_STOP)) == 0) {
bytes_written = net_os_enable_packet_filter(net, 0);
}
- else if (strncasecmp(command, CMD_RXFILTER_ADD, strlen(CMD_RXFILTER_ADD)) == 0) {
+ else if (strnicmp(command, CMD_RXFILTER_ADD, strlen(CMD_RXFILTER_ADD)) == 0) {
int filter_num = *(command + strlen(CMD_RXFILTER_ADD) + 1) - '0';
bytes_written = net_os_rxfilter_add_remove(net, TRUE, filter_num);
}
- else if (strncasecmp(command, CMD_RXFILTER_REMOVE, strlen(CMD_RXFILTER_REMOVE)) == 0) {
+ else if (strnicmp(command, CMD_RXFILTER_REMOVE, strlen(CMD_RXFILTER_REMOVE)) == 0) {
int filter_num = *(command + strlen(CMD_RXFILTER_REMOVE) + 1) - '0';
bytes_written = net_os_rxfilter_add_remove(net, FALSE, filter_num);
}
#endif /* PKT_FILTER_SUPPORT */
- else if (strncasecmp(command, CMD_BTCOEXSCAN_START, strlen(CMD_BTCOEXSCAN_START)) == 0) {
+ else if (strnicmp(command, CMD_BTCOEXSCAN_START, strlen(CMD_BTCOEXSCAN_START)) == 0) {
/* TBD: BTCOEXSCAN-START */
}
- else if (strncasecmp(command, CMD_BTCOEXSCAN_STOP, strlen(CMD_BTCOEXSCAN_STOP)) == 0) {
+ else if (strnicmp(command, CMD_BTCOEXSCAN_STOP, strlen(CMD_BTCOEXSCAN_STOP)) == 0) {
/* TBD: BTCOEXSCAN-STOP */
}
- else if (strncasecmp(command, CMD_BTCOEXMODE, strlen(CMD_BTCOEXMODE)) == 0) {
+ else if (strnicmp(command, CMD_BTCOEXMODE, strlen(CMD_BTCOEXMODE)) == 0) {
#ifdef WL_CFG80211
void *dhdp = wl_cfg80211_get_dhdp();
bytes_written = wl_cfg80211_set_btcoex_dhcp(net, dhdp, command);
#endif /* PKT_FILTER_SUPPORT */
#endif /* WL_CFG80211 */
}
- else if (strncasecmp(command, CMD_SETSUSPENDOPT, strlen(CMD_SETSUSPENDOPT)) == 0) {
+ else if (strnicmp(command, CMD_SETSUSPENDOPT, strlen(CMD_SETSUSPENDOPT)) == 0) {
bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len);
}
- else if (strncasecmp(command, CMD_SETSUSPENDMODE, strlen(CMD_SETSUSPENDMODE)) == 0) {
+ else if (strnicmp(command, CMD_SETSUSPENDMODE, strlen(CMD_SETSUSPENDMODE)) == 0) {
bytes_written = wl_android_set_suspendmode(net, command, priv_cmd.total_len);
}
- else if (strncasecmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) == 0) {
+ else if (strnicmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) == 0) {
uint band = *(command + strlen(CMD_SETBAND) + 1) - '0';
bytes_written = wldev_set_band(net, band);
}
- else if (strncasecmp(command, CMD_GETBAND, strlen(CMD_GETBAND)) == 0) {
+ else if (strnicmp(command, CMD_GETBAND, strlen(CMD_GETBAND)) == 0) {
bytes_written = wl_android_get_band(net, command, priv_cmd.total_len);
}
#ifdef WL_CFG80211
/* CUSTOMER_SET_COUNTRY feature is define for only GGSM model */
- else if (strncasecmp(command, CMD_COUNTRY, strlen(CMD_COUNTRY)) == 0) {
+ else if (strnicmp(command, CMD_COUNTRY, strlen(CMD_COUNTRY)) == 0) {
char *country_code = command + strlen(CMD_COUNTRY) + 1;
bytes_written = wldev_set_country(net, country_code, true, true);
}
#endif /* WL_CFG80211 */
- else if (strncasecmp(command, CMD_80211_MODE, strlen(CMD_80211_MODE)) == 0) {
+ else if (strnicmp(command, CMD_SET_CSA, strlen(CMD_SET_CSA)) == 0) {
+ bytes_written = wl_android_set_csa(net, command, priv_cmd.total_len);
+ } else if (strnicmp(command, CMD_80211_MODE, strlen(CMD_80211_MODE)) == 0) {
bytes_written = wl_android_get_80211_mode(net, command, priv_cmd.total_len);
- } else if (strncasecmp(command, CMD_CHANSPEC, strlen(CMD_CHANSPEC)) == 0) {
+ } else if (strnicmp(command, CMD_CHANSPEC, strlen(CMD_CHANSPEC)) == 0) {
bytes_written = wl_android_get_chanspec(net, command, priv_cmd.total_len);
- } else if (strncasecmp(command, CMD_DATARATE, strlen(CMD_DATARATE)) == 0) {
+ } else if (strnicmp(command, CMD_DATARATE, strlen(CMD_DATARATE)) == 0) {
bytes_written = wl_android_get_datarate(net, command, priv_cmd.total_len);
- } else if (strncasecmp(command, CMD_ASSOC_CLIENTS, strlen(CMD_ASSOC_CLIENTS)) == 0) {
+ } else if (strnicmp(command, CMD_ASSOC_CLIENTS, strlen(CMD_ASSOC_CLIENTS)) == 0) {
bytes_written = wl_android_get_assoclist(net, command, priv_cmd.total_len);
}
#ifdef PNO_SUPPORT
- else if (strncasecmp(command, CMD_PNOSSIDCLR_SET, strlen(CMD_PNOSSIDCLR_SET)) == 0) {
+ else if (strnicmp(command, CMD_PNOSSIDCLR_SET, strlen(CMD_PNOSSIDCLR_SET)) == 0) {
bytes_written = dhd_dev_pno_stop_for_ssid(net);
}
#ifndef WL_SCHED_SCAN
- else if (strncasecmp(command, CMD_PNOSETUP_SET, strlen(CMD_PNOSETUP_SET)) == 0) {
+ else if (strnicmp(command, CMD_PNOSETUP_SET, strlen(CMD_PNOSETUP_SET)) == 0) {
bytes_written = wl_android_set_pno_setup(net, command, priv_cmd.total_len);
}
#endif /* !WL_SCHED_SCAN */
- else if (strncasecmp(command, CMD_PNOENABLE_SET, strlen(CMD_PNOENABLE_SET)) == 0) {
+ else if (strnicmp(command, CMD_PNOENABLE_SET, strlen(CMD_PNOENABLE_SET)) == 0) {
int enable = *(command + strlen(CMD_PNOENABLE_SET) + 1) - '0';
bytes_written = (enable)? 0 : dhd_dev_pno_stop_for_ssid(net);
}
- else if (strncasecmp(command, CMD_WLS_BATCHING, strlen(CMD_WLS_BATCHING)) == 0) {
+ else if (strnicmp(command, CMD_WLS_BATCHING, strlen(CMD_WLS_BATCHING)) == 0) {
bytes_written = wls_parse_batching_cmd(net, command, priv_cmd.total_len);
}
#endif /* PNO_SUPPORT */
- else if (strncasecmp(command, CMD_P2P_DEV_ADDR, strlen(CMD_P2P_DEV_ADDR)) == 0) {
+ else if (strnicmp(command, CMD_P2P_DEV_ADDR, strlen(CMD_P2P_DEV_ADDR)) == 0) {
bytes_written = wl_android_get_p2p_dev_addr(net, command, priv_cmd.total_len);
}
- else if (strncasecmp(command, CMD_P2P_SET_NOA, strlen(CMD_P2P_SET_NOA)) == 0) {
+ else if (strnicmp(command, CMD_P2P_SET_NOA, strlen(CMD_P2P_SET_NOA)) == 0) {
int skip = strlen(CMD_P2P_SET_NOA) + 1;
bytes_written = wl_cfg80211_set_p2p_noa(net, command + skip,
priv_cmd.total_len - skip);
}
#ifdef WL_NAN
- else if (strncasecmp(command, CMD_NAN, strlen(CMD_NAN)) == 0) {
+ else if (strnicmp(command, CMD_NAN, strlen(CMD_NAN)) == 0) {
bytes_written = wl_cfg80211_nan_cmd_handler(net, command,
priv_cmd.total_len);
}
#endif /* WL_NAN */
#if !defined WL_ENABLE_P2P_IF
- else if (strncasecmp(command, CMD_P2P_GET_NOA, strlen(CMD_P2P_GET_NOA)) == 0) {
+ else if (strnicmp(command, CMD_P2P_GET_NOA, strlen(CMD_P2P_GET_NOA)) == 0) {
bytes_written = wl_cfg80211_get_p2p_noa(net, command, priv_cmd.total_len);
}
#endif /* WL_ENABLE_P2P_IF */
- else if (strncasecmp(command, CMD_P2P_SET_PS, strlen(CMD_P2P_SET_PS)) == 0) {
+ else if (strnicmp(command, CMD_P2P_SET_PS, strlen(CMD_P2P_SET_PS)) == 0) {
int skip = strlen(CMD_P2P_SET_PS) + 1;
bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip,
priv_cmd.total_len - skip);
}
#ifdef WL_CFG80211
- else if (strncasecmp(command, CMD_SET_AP_WPS_P2P_IE,
+ else if (strnicmp(command, CMD_SET_AP_WPS_P2P_IE,
strlen(CMD_SET_AP_WPS_P2P_IE)) == 0) {
int skip = strlen(CMD_SET_AP_WPS_P2P_IE) + 3;
bytes_written = wl_cfg80211_set_wps_p2p_ie(net, command + skip,
priv_cmd.total_len - skip, *(command + skip - 2) - '0');
}
#endif /* WL_CFG80211 */
- else if (strncasecmp(command, CMD_OKC_SET_PMK, strlen(CMD_OKC_SET_PMK)) == 0)
+ else if (strnicmp(command, CMD_OKC_SET_PMK, strlen(CMD_OKC_SET_PMK)) == 0)
bytes_written = wl_android_set_pmk(net, command, priv_cmd.total_len);
- else if (strncasecmp(command, CMD_OKC_ENABLE, strlen(CMD_OKC_ENABLE)) == 0)
+ else if (strnicmp(command, CMD_OKC_ENABLE, strlen(CMD_OKC_ENABLE)) == 0)
bytes_written = wl_android_okc_enable(net, command, priv_cmd.total_len);
#if defined(WL_SUPPORT_AUTO_CHANNEL)
- else if (strncasecmp(command, CMD_GET_BEST_CHANNELS,
+ else if (strnicmp(command, CMD_GET_BEST_CHANNELS,
strlen(CMD_GET_BEST_CHANNELS)) == 0) {
bytes_written = wl_cfg80211_get_best_channels(net, command,
priv_cmd.total_len);
}
#endif /* WL_SUPPORT_AUTO_CHANNEL */
- else if (strncasecmp(command, CMD_HAPD_MAC_FILTER, strlen(CMD_HAPD_MAC_FILTER)) == 0) {
+ else if (strnicmp(command, CMD_HAPD_MAC_FILTER, strlen(CMD_HAPD_MAC_FILTER)) == 0) {
int skip = strlen(CMD_HAPD_MAC_FILTER) + 1;
wl_android_set_mac_address_filter(net, (const char*)command+skip);
}
- else if (strncasecmp(command, CMD_SETROAMMODE, strlen(CMD_SETROAMMODE)) == 0)
+ else if (strnicmp(command, CMD_SETROAMMODE, strlen(CMD_SETROAMMODE)) == 0)
bytes_written = wl_android_set_roam_mode(net, command, priv_cmd.total_len);
#if defined(BCMFW_ROAM_ENABLE)
- else if (strncasecmp(command, CMD_SET_ROAMPREF, strlen(CMD_SET_ROAMPREF)) == 0) {
+ else if (strnicmp(command, CMD_SET_ROAMPREF, strlen(CMD_SET_ROAMPREF)) == 0) {
bytes_written = wl_android_set_roampref(net, command, priv_cmd.total_len);
}
#endif /* BCMFW_ROAM_ENABLE */
- else if (strncasecmp(command, CMD_MIRACAST, strlen(CMD_MIRACAST)) == 0)
+ else if (strnicmp(command, CMD_MIRACAST, strlen(CMD_MIRACAST)) == 0)
bytes_written = wl_android_set_miracast(net, command, priv_cmd.total_len);
- else if (strncasecmp(command, CMD_SETIBSSBEACONOUIDATA, strlen(CMD_SETIBSSBEACONOUIDATA)) == 0)
+ else if (strnicmp(command, CMD_SETIBSSBEACONOUIDATA, strlen(CMD_SETIBSSBEACONOUIDATA)) == 0)
bytes_written = wl_android_set_ibss_beacon_ouidata(net,
command, priv_cmd.total_len);
- else if (strncasecmp(command, CMD_KEEP_ALIVE, strlen(CMD_KEEP_ALIVE)) == 0) {
+ else if (strnicmp(command, CMD_KEEP_ALIVE, strlen(CMD_KEEP_ALIVE)) == 0) {
int skip = strlen(CMD_KEEP_ALIVE) + 1;
bytes_written = wl_keep_alive_set(net, command + skip, priv_cmd.total_len - skip);
}
- else if (strncasecmp(command, CMD_ROAM_OFFLOAD, strlen(CMD_ROAM_OFFLOAD)) == 0) {
+ else if (strnicmp(command, CMD_ROAM_OFFLOAD, strlen(CMD_ROAM_OFFLOAD)) == 0) {
int enable = *(command + strlen(CMD_ROAM_OFFLOAD) + 1) - '0';
bytes_written = wl_cfg80211_enable_roam_offload(net, enable);
}
#ifdef CONNECTION_STATISTICS
- else if (strncasecmp(command, CMD_GET_CONNECTION_STATS,
+ else if (strnicmp(command, CMD_GET_CONNECTION_STATS,
strlen(CMD_GET_CONNECTION_STATS)) == 0) {
bytes_written = wl_android_get_connection_stats(net, command,
priv_cmd.total_len);
/*
* Linux cfg80211 driver - Android related functions
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wl_cfg80211.c 513448 2014-11-06 13:44:21Z $
+ * $Id: wl_cfg80211.c 589976 2015-10-01 07:01:27Z $
*/
/* */
#include <typedefs.h>
#endif /* !WL_ENABLE_P2P_IF && !WL_CFG80211_P2P_DEV_IF */
#endif /* WL11U */
-#ifdef BCMWAPI_WPI
-/* these items should evetually go into wireless.h of the linux system headfile dir */
-#ifndef IW_ENCODE_ALG_SM4
-#define IW_ENCODE_ALG_SM4 0x20
-#endif
-
-#ifndef IW_AUTH_WAPI_ENABLED
-#define IW_AUTH_WAPI_ENABLED 0x20
-#endif
-
-#ifndef IW_AUTH_WAPI_VERSION_1
-#define IW_AUTH_WAPI_VERSION_1 0x00000008
-#endif
-
-#ifndef IW_AUTH_CIPHER_SMS4
-#define IW_AUTH_CIPHER_SMS4 0x00000020
-#endif
-#ifndef IW_AUTH_KEY_MGMT_WAPI_PSK
-#define IW_AUTH_KEY_MGMT_WAPI_PSK 4
-#endif
+#define IW_WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
-#ifndef IW_AUTH_KEY_MGMT_WAPI_CERT
-#define IW_AUTH_KEY_MGMT_WAPI_CERT 8
-#endif
-#endif /* BCMWAPI_WPI */
-#ifdef BCMWAPI_WPI
-#define IW_WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED | SMS4_ENABLED))
-#else /* BCMWAPI_WPI */
-#define IW_WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
-#endif /* BCMWAPI_WPI */
static struct device *cfg80211_parent_dev = NULL;
/* g_bcm_cfg should be static. Do not change */
#define CH_MIN_2G_CHANNEL 1
+#ifdef WL_RELMCAST
enum rmc_event_type {
RMC_EVENT_NONE,
RMC_EVENT_LEADER_CHECK_FAIL
};
+#endif /* WL_RELMCAST */
/* This is to override regulatory domains defined in cfg80211 module (reg.c)
* By default world regulatory domain defined in reg.c puts the flags NL80211_RRF_PASSIVE_SCAN
#define WPS_CONFIG_PHY_DISPLAY 0x4008
-
#define WL_AKM_SUITE_SHA256_1X 0x000FAC05
#define WL_AKM_SUITE_SHA256_PSK 0x000FAC06
#define WL_MFP_CAPABLE 0x1
#endif
#define CUSTOM_RETRY_MASK 0xff000000 /* Mask for retry counter of custom dwell time */
+#define LONG_LISTEN_TIME 2000
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+#define STA_INFO_BIT(info) (1ul << NL80211_STA_ ## info)
+#else
+#define STA_INFO_BIT(info) (STATION_ ## info)
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) */
+
/*
* cfg80211_ops api/callback list
*/
struct cfg80211_ibss_params *params);
static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy,
struct net_device *dev);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
struct net_device *dev, const u8 *mac,
struct station_info *sinfo);
+#else
+static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
+ struct net_device *dev, u8 *mac,
+ struct station_info *sinfo);
+#endif
static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
struct net_device *dev, bool enabled,
s32 timeout);
2, 0))
static s32 wl_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
bcm_struct_cfgdev *cfgdev, u64 cookie);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
+static s32 wl_cfg80211_del_station(
+ struct wiphy *wiphy, struct net_device *ndev,
+ struct station_del_parameters *params);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static s32 wl_cfg80211_del_station(struct wiphy *wiphy,
- struct net_device *ndev,
- struct station_del_parameters *params);
+ struct net_device *ndev, const u8* mac_addr);
+#else
+static s32 wl_cfg80211_del_station(struct wiphy *wiphy,
+ struct net_device *ndev, u8* mac_addr);
+#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static s32 wl_cfg80211_change_station(struct wiphy *wiphy,
struct net_device *dev, const u8 *mac, struct station_parameters *params);
+#else
+static s32 wl_cfg80211_change_station(struct wiphy *wiphy,
+ struct net_device *dev, u8 *mac, struct station_parameters *params);
+#endif
#endif /* WL_SUPPORT_BACKPORTED_KPATCHES || KERNEL_VER >= KERNEL_VERSION(3, 2, 0)) */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39))
static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
static s32 wl_notify_escan_complete(struct bcm_cfg80211 *cfg,
struct net_device *ndev, bool aborted, bool fw_abort);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 2, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
+static s32
+wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, bool initiator, const u8 *data, size_t len);
+#else
+#if defined(CONFIG_ARCH_MSM) && defined(TDLS_MGMT_VERSION2)
+static s32 wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, const u8 *data, size_t len);
+#else
static s32 wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
- const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
- u32 peer_capability, bool initiator, const u8 *data,
+ u8 *peer, u8 action_code, u8 dialog_token, u16 status_code, const u8 *data,
size_t len);
-static s32 wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
+#endif /* CONFIG_ARCH_MSM && TDLS_MGMT_VERSION2 */
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0) */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+static s32
+wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
const u8 *peer, enum nl80211_tdls_operation oper);
+#else
+static s32 wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
+ u8 *peer, enum nl80211_tdls_operation oper);
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) */
#endif
#ifdef WL_SCHED_SCAN
static int wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev);
struct cfg80211_connect_params *sme);
static s32 wl_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme);
-#ifdef BCMWAPI_WPI
-static s32 wl_set_set_wapi_ie(struct net_device *dev,
- struct cfg80211_connect_params *sme);
-#endif
static s32 wl_get_assoc_ies(struct bcm_cfg80211 *cfg, struct net_device *ndev);
static void wl_ch_to_chanspec(int ch,
struct wl_join_params *join_params, size_t *join_params_size);
#ifdef PROP_TXSTATUS_VSDB
extern int disable_proptx;
#endif /* PROP_TXSTATUS_VSDB */
+static s32
+wl_csa_complete_ind(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
+const wl_event_msg_t *e, void *data);
+#if ((LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0)) && (LINUX_VERSION_CODE <= (3, 7, \
+ 0)))
+struct chan_info {
+ int freq;
+ int chan_type;
+};
+#endif
+
#if (WL_DBG_LEVEL > 0)
#define WL_DBG_ESTR_MAX 50
WLAN_CIPHER_SUITE_TKIP,
WLAN_CIPHER_SUITE_CCMP,
WLAN_CIPHER_SUITE_AES_CMAC,
-#ifdef BCMWAPI_WPI
- WLAN_CIPHER_SUITE_SMS4,
-#endif
};
+#ifdef WL_SUPPORT_ACS
+/*
+ * The firmware code required for this feature to work is currently under
+ * BCMINTERNAL flag. In future if this is to enabled we need to bring the
+ * required firmware code out of the BCMINTERNAL flag.
+ */
+struct wl_dump_survey {
+ u32 obss;
+ u32 ibss;
+ u32 no_ctg;
+ u32 no_pckt;
+ u32 tx;
+ u32 idle;
+};
+#endif /* WL_SUPPORT_ACS */
+
+#ifdef WL_SUPPORT_ACS
+uint8 g_hostap_chan_count;
+uint16 g_hostap_chan_cache[50];
+#endif /* WL_SUPPORT_ACS */
+
#if defined(USE_DYNAMIC_MAXPKT_RXGLOM)
static int maxrxpktglom = 0;
#else
char *name,
#endif /* WL_CFG80211_P2P_DEV_IF */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
unsigned char name_assign_type,
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)) */
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
} else {
wl_clr_p2p_status(cfg, IF_ADDING);
WL_ERR((" virtual interface(%s) is not created \n", cfg->p2p->vir_ifname));
+
+ WL_ERR(("left timeout : %d\n", timeout));
+ WL_ERR(("IF_ADDING status : %d\n", wl_get_p2p_status(cfg, IF_ADDING)));
+ WL_ERR(("event valid : %d\n", cfg->if_event_info.valid));
+
+ wl_clr_p2p_status(cfg, GO_NEG_PHASE);
+ wl_set_p2p_status(cfg, IF_DELETING);
+
+ err = wl_cfgp2p_ifdel(cfg, &cfg->p2p->int_addr);
+ if (err == BCME_OK) {
+ timeout = wait_event_interruptible_timeout(cfg->netif_change_event,
+ (wl_get_p2p_status(cfg, IF_DELETING) == false),
+ msecs_to_jiffies(MAX_WAIT_TIME));
+ if (timeout > 0 && !wl_get_p2p_status(cfg, IF_DELETING) &&
+ cfg->if_event_info.valid) {
+ WL_ERR(("IFDEL operation done\n"));
+ } else {
+ WL_ERR(("IFDEL didn't complete properly\n"));
+ err = BCME_ERROR;
+ }
+ }
+ if (err != BCME_OK) {
+ struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg);
+
+ WL_ERR(("p2p_ifdel failed, error %d, sent HANG event to %s\n",
+ err, ndev->name));
+ net_os_send_hang_message(ndev);
+ }
+
memset(cfg->p2p->vir_ifname, '\0', IFNAMSIZ);
cfg->p2p->vif_created = false;
#ifdef PROP_TXSTATUS_VSDB
#endif /* PROP_TXSTATUS_VSDB */
}
+ dhd_net_if_lock(ndev);
wl_cfg80211_remove_if(cfg, if_event_info->ifidx, ndev);
+ dhd_net_if_unlock(ndev);
+
return BCME_OK;
}
u8 chan_buf[sizeof(u32)*(WL_NUMCHANNELS + 1)];
u32 num_chans = 0;
s32 channel;
- s32 n_valid_chan;
+ u32 n_valid_chan;
s32 search_state = WL_P2P_DISC_ST_SCAN;
u32 i, j, n_nodfs = 0;
u16 *default_chan_list = NULL;
struct net_device *remain_on_channel_ndev = NULL;
#endif
- dhd_pub_t *dhd;
-
- dhd = (dhd_pub_t *)(cfg->pub);
- if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) {
+#ifdef WL_SUPPORT_ACS
+ /*
+ * Hostapd triggers scan before starting automatic channel selection
+ * to collect channel characteristics. However firmware scan engine
+ * doesn't support any channel characteristics collection along with
+ * scan. Hence return scan success.
+ */
+ if (request && (scan_req_iftype(request) == NL80211_IFTYPE_AP)) {
+ struct cfg80211_scan_info info = {
+ .aborted = 0,
+ };
+ /*
+ * In case of ACS, store the channel number that hostap
+ * interested in. can be used to filter out when
+ * wl_cfg80211_dump_survey() handler is called.
+ */
+ { struct ieee80211_channel *chan = request->channels[0];
+ g_hostap_chan_count = 0;
+ while (g_hostap_chan_count < request->n_channels)
+ {
+ g_hostap_chan_cache[g_hostap_chan_count] =
+ chan[g_hostap_chan_count].center_freq;
+ g_hostap_chan_count++;
+ }
+ WL_DBG(("channel count hostapd interested in %d",
+ g_hostap_chan_count));
+ }
+ /* Indicate cfg80211 that we are done with scan */
+ cfg80211_scan_done(request, &info);
+ WL_INFO(("Scan Command on SoftAP Interface. Ignoring...\n"));
+ return 0;
+ }
+#elif BCMDONGLEHOST
+ if (((dhd_pub_t *)(cfg->pub))->op_mode & DHD_FLAG_HOSTAP_MODE) {
WL_ERR(("Invalid Scan Command at SoftAP mode\n"));
return -EINVAL;
}
+#endif /* BCMDONGLEHOST */
ndev = ndev_to_wlc_ndev(ndev, cfg);
}
wl_update_prof(cfg, dev, NULL, &join_params.ssid, WL_PROF_SSID);
wl_update_prof(cfg, dev, NULL, &cfg->channel, WL_PROF_CHAN);
+#ifdef WL_RELMCAST
cfg->rmc_event_seq = 0; /* initialize rmcfail sequence */
+#endif /* WL_RELMCAST */
return err;
}
if (is_wps_conn(sme))
val = WPA_AUTH_DISABLED;
-#ifdef BCMWAPI_WPI
- if (sme->crypto.wpa_versions & NL80211_WAPI_VERSION_1) {
- WL_DBG((" * wl_set_wpa_version, set wpa_auth"
- " to WPA_AUTH_WAPI 0x400"));
- val = WAPI_AUTH_PSK | WAPI_AUTH_UNSPECIFIED;
- }
-#endif
WL_DBG(("setting wpa_auth to 0x%0x\n", val));
err = wldev_iovar_setint_bsscfg(dev, "wpa_auth", val, bssidx);
if (unlikely(err)) {
return err;
}
-#ifdef BCMWAPI_WPI
-static s32
-wl_set_set_wapi_ie(struct net_device *dev, struct cfg80211_connect_params *sme)
-{
- struct bcm_cfg80211 *cfg = g_bcm_cfg;
- s32 err = 0;
- s32 bssidx;
- if (wl_cfgp2p_find_idx(cfg, dev, &bssidx) != BCME_OK) {
- WL_ERR(("Find p2p index from dev(%p) failed\n", dev));
- return BCME_ERROR;
- }
-
- WL_DBG((" %s \n", __FUNCTION__));
-
- if (sme->crypto.wpa_versions & NL80211_WAPI_VERSION_1) {
- err = wldev_iovar_setbuf_bsscfg(dev, "wapiie", sme->ie, sme->ie_len,
- cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync);
-
- if (unlikely(err)) {
- WL_ERR(("===> set_wapi_ie Error (%d)\n", err));
- return err;
- }
- } else
- WL_DBG((" * skip \n"));
- return err;
-}
-#endif /* BCMWAPI_WPI */
static s32
wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
s32 err = 0;
s32 wsec_val = 0;
-#ifdef BCMWAPI_WPI
- s32 val = 0;
-#endif
s32 bssidx;
if (wl_cfgp2p_find_idx(cfg, dev, &bssidx) != BCME_OK) {
WL_ERR(("Find p2p index from dev(%p) failed\n", dev));
case WLAN_CIPHER_SUITE_AES_CMAC:
pval = AES_ENABLED;
break;
-#ifdef BCMWAPI_WPI
- case WLAN_CIPHER_SUITE_SMS4:
- val = SMS4_ENABLED;
- pval = SMS4_ENABLED;
- break;
-#endif
default:
WL_ERR(("invalid cipher pairwise (%d)\n",
sme->crypto.ciphers_pairwise[0]));
case WLAN_CIPHER_SUITE_AES_CMAC:
gval = AES_ENABLED;
break;
-#ifdef BCMWAPI_WPI
- case WLAN_CIPHER_SUITE_SMS4:
- val = SMS4_ENABLED;
- gval = SMS4_ENABLED;
- break;
-#endif
default:
WL_ERR(("invalid cipher group (%d)\n",
sme->crypto.cipher_group));
/* WPS-2.0 allows no security */
err = wldev_iovar_setint_bsscfg(dev, "wsec", 0, bssidx);
} else {
-#ifdef BCMWAPI_WPI
- if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_SMS4) {
- WL_DBG((" NO, is_wps_conn, WAPI set to SMS4_ENABLED"));
- err = wldev_iovar_setint_bsscfg(dev, "wsec", val, bssidx);
- } else {
-#endif
WL_DBG((" NO, is_wps_conn, Set pval | gval to WSEC"));
wsec_val = pval | gval;
WL_DBG((" Set WSEC to fW 0x%x \n", wsec_val));
err = wldev_iovar_setint_bsscfg(dev, "wsec",
wsec_val, bssidx);
-#ifdef BCMWAPI_WPI
- }
-#endif
}
if (unlikely(err)) {
WL_ERR(("error (%d)\n", err));
return -EINVAL;
}
}
-#ifdef BCMWAPI_WPI
- else if (val & (WAPI_AUTH_PSK | WAPI_AUTH_UNSPECIFIED)) {
- switch (sme->crypto.akm_suites[0]) {
- case WLAN_AKM_SUITE_WAPI_CERT:
- val = WAPI_AUTH_UNSPECIFIED;
- break;
- case WLAN_AKM_SUITE_WAPI_PSK:
- val = WAPI_AUTH_PSK;
- break;
- default:
- WL_ERR(("invalid cipher group (%d)\n",
- sme->crypto.cipher_group));
- return -EINVAL;
- }
- }
-#endif
WL_DBG(("setting wpa_auth to %d\n", val));
err = wldev_iovar_setint_bsscfg(dev, "wpa_auth", val, bssidx);
sec = wl_read_prof(cfg, dev, WL_PROF_SEC);
WL_DBG(("wpa_versions 0x%x cipher_pairwise 0x%x\n",
sec->wpa_versions, sec->cipher_pairwise));
- if (!(sec->wpa_versions & (NL80211_WPA_VERSION_1 |
-#ifdef BCMWAPI_WPI
- NL80211_WPA_VERSION_2 | NL80211_WAPI_VERSION_1)) &&
-#else
- NL80211_WPA_VERSION_2)) &&
-#endif
- (sec->cipher_pairwise & (WLAN_CIPHER_SUITE_WEP40 |
-#ifdef BCMWAPI_WPI
- WLAN_CIPHER_SUITE_WEP104 | WLAN_CIPHER_SUITE_SMS4)))
-#else
+ if ((!(sec->wpa_versions & (NL80211_WPA_VERSION_1 |
+ NL80211_WPA_VERSION_2))) &&
+ (sec->cipher_pairwise & (WLAN_CIPHER_SUITE_WEP40 |
WLAN_CIPHER_SUITE_WEP104)))
-#endif
{
memset(&key, 0, sizeof(key));
key.len = (u32) sme->key_len;
case WLAN_CIPHER_SUITE_WEP104:
key.algo = CRYPTO_ALGO_WEP128;
break;
-#ifdef BCMWAPI_WPI
- case WLAN_CIPHER_SUITE_SMS4:
- key.algo = CRYPTO_ALGO_SMS4;
- break;
-#endif
default:
WL_ERR(("Invalid algorithm (%d)\n",
sme->crypto.ciphers_pairwise[0]));
WL_DBG(("In\n"));
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
+ if (sme->channel_hint) {
+ chan = sme->channel_hint;
+ WL_DBG(("channel_hint (%d), channel_hint center_freq (%d)\n",
+ ieee80211_frequency_to_channel(sme->channel_hint->center_freq),
+ sme->channel_hint->center_freq));
+ }
+ if (sme->bssid_hint) {
+ sme->bssid = sme->bssid_hint;
+ WL_DBG(("bssid_hint "MACDBG" \n", MAC2STRDBG(sme->bssid_hint)));
+ }
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) */
if (unlikely(!sme->ssid)) {
WL_ERR(("Invalid ssid\n"));
return -EOPNOTSUPP;
return -EINVAL;
}
+ WL_DBG(("SME IE : len=%zu\n", sme->ie_len));
+ if (sme->ie != NULL && sme->ie_len > 0 && (wl_dbg_level & WL_DBG_DBG)) {
+ prhex(NULL, (void *)sme->ie, sme->ie_len);
+ }
+
RETURN_EIO_IF_NOT_UP(cfg);
/*
chan->center_freq, chan_cnt));
} else
cfg->channel = 0;
-#ifdef BCMWAPI_WPI
- WL_DBG(("1. enable wapi auth\n"));
- if (sme->crypto.wpa_versions & NL80211_WAPI_VERSION_1) {
- WL_DBG(("2. set wapi ie \n"));
- err = wl_set_set_wapi_ie(dev, sme);
- if (unlikely(err))
- return err;
- } else
- WL_DBG(("2. Not wapi ie \n"));
-#endif
- WL_DBG(("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len));
+
WL_DBG(("3. set wapi version \n"));
err = wl_set_wpa_version(dev, sme);
if (unlikely(err)) {
WL_ERR(("Invalid wpa_version\n"));
return err;
}
-#ifdef BCMWAPI_WPI
- if (sme->crypto.wpa_versions & NL80211_WAPI_VERSION_1)
- WL_DBG(("4. WAPI Dont Set wl_set_auth_type\n"));
- else {
- WL_DBG(("4. wl_set_auth_type\n"));
-#endif
err = wl_set_auth_type(dev, sme);
if (unlikely(err)) {
WL_ERR(("Invalid auth type\n"));
return err;
}
-#ifdef BCMWAPI_WPI
- }
-#endif
err = wl_set_set_cipher(dev, sme);
if (unlikely(err)) {
err = wldev_iovar_setbuf_bsscfg(dev, "join", ext_join_params, join_params_size,
cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync);
- WL_ERR(("Connectting with" MACDBG " channel (%d) ssid \"%s\", len (%d)\n\n",
+ WL_ERR(("Connecting with" MACDBG " channel (%d) ssid \"%s\", len (%d)\n\n",
MAC2STRDBG((u8*)(&ext_join_params->assoc.bssid)), cfg->channel,
ext_join_params->ssid.SSID, ext_join_params->ssid.SSID_len));
}
#endif /* CUSTOM_SET_CPUCORE */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
+ /* cfg80211 expects disconnect event from DHD to release wdev->current_bss */
+ cfg80211_disconnected(dev, reason_code, NULL, 0, false, GFP_KERNEL);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) */
+
return err;
}
key.algo = CRYPTO_ALGO_AES_CCM;
WL_DBG(("WLAN_CIPHER_SUITE_CCMP\n"));
break;
-#ifdef BCMWAPI_WPI
- case WLAN_CIPHER_SUITE_SMS4:
- key.algo = CRYPTO_ALGO_SMS4;
- WL_DBG(("WLAN_CIPHER_SUITE_SMS4\n"));
- break;
-#endif
default:
WL_ERR(("Invalid cipher (0x%x)\n", params->cipher));
return -EINVAL;
val = AES_ENABLED;
WL_DBG(("WLAN_CIPHER_SUITE_CCMP\n"));
break;
-#ifdef BCMWAPI_WPI
- case WLAN_CIPHER_SUITE_SMS4:
- key.algo = CRYPTO_ALGO_SMS4;
- WL_DBG(("WLAN_CIPHER_SUITE_SMS4\n"));
- val = SMS4_ENABLED;
- break;
-#endif /* BCMWAPI_WPI */
default:
WL_ERR(("Invalid cipher (0x%x)\n", params->cipher));
return -EINVAL;
params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
WL_DBG(("WLAN_CIPHER_SUITE_AES_CMAC\n"));
break;
-#ifdef BCMWAPI_WPI
- case WLAN_CIPHER_SUITE_SMS4:
- key.algo = CRYPTO_ALGO_SMS4;
- WL_DBG(("WLAN_CIPHER_SUITE_SMS4\n"));
- break;
-#endif
default:
WL_ERR(("Invalid algo (0x%x)\n", wsec));
return -EINVAL;
return -EOPNOTSUPP;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static s32
-wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
- const u8 *mac, struct station_info *sinfo)
+wl_cfg80211_get_station(struct wiphy *wiphy,
+ struct net_device *dev, const u8 *mac,
+ struct station_info *sinfo)
+#else
+static s32
+wl_cfg80211_get_station(struct wiphy *wiphy,
+ struct net_device *dev, u8 *mac,
+ struct station_info *sinfo)
+#endif
{
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
scb_val_t scb_val;
WL_ERR(("GET STA INFO failed, %d\n", err));
return err;
}
- sinfo->filled = BIT(NL80211_STA_INFO_INACTIVE_TIME);
+ sinfo->filled = STA_INFO_BIT(INFO_INACTIVE_TIME);
sta = (sta_info_t *)cfg->ioctl_buf;
sta->len = dtoh16(sta->len);
sta->cap = dtoh16(sta->cap);
sinfo->inactive_time = sta->idle * 1000;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
if (sta->flags & WL_STA_ASSOC) {
- sinfo->filled |= BIT(NL80211_STA_INFO_CONNECTED_TIME);
+ sinfo->filled |= STA_INFO_BIT(INFO_CONNECTED_TIME);
sinfo->connected_time = sta->in;
}
WL_INFO(("STA %s : idle time : %d sec, connected time :%d ms\n",
wl_get_mode_by_netdev(cfg, dev) == WL_MODE_IBSS) {
get_pktcnt_t pktcnt;
u8 *curmacp;
+ struct ether_addr bssid;
if (cfg->roam_offload) {
- struct ether_addr bssid;
err = wldev_ioctl(dev, WLC_GET_BSSID, &bssid, ETHER_ADDR_LEN, false);
if (err) {
WL_ERR(("Failed to get current BSSID\n"));
} else {
- if (memcmp(mac, &bssid.octet, ETHER_ADDR_LEN) != 0) {
+ if (!ETHER_ISNULLADDR(&bssid.octet) &&
+ memcmp(mac, &bssid.octet, ETHER_ADDR_LEN) != 0) {
/* roaming is detected */
err = wl_cfg80211_delayed_roam(cfg, dev, &bssid);
if (err)
int rxpktglom;
#endif
rate = dtoh32(rate);
- sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
+ sinfo->filled |= STA_INFO_BIT(INFO_TX_BITRATE);
sinfo->txrate.legacy = rate * 5;
WL_DBG(("Rate %d Mbps\n", (rate / 2)));
#if defined(USE_DYNAMIC_MAXPKT_RXGLOM)
goto get_station_err;
}
rssi = wl_rssi_offset(dtoh32(scb_val.val));
- sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
+ sinfo->filled |= STA_INFO_BIT(INFO_SIGNAL);
sinfo->signal = rssi;
WL_DBG(("RSSI %d dBm\n", rssi));
err = wldev_ioctl(dev, WLC_GET_PKTCNTS, &pktcnt,
sizeof(pktcnt), false);
if (!err) {
- sinfo->filled |= (BIT(NL80211_STA_INFO_RX_PACKETS) |
- BIT(NL80211_STA_INFO_RX_DROP_MISC) |
- BIT(NL80211_STA_INFO_TX_PACKETS) |
- BIT(NL80211_STA_INFO_TX_FAILED));
+ sinfo->filled |= (STA_INFO_BIT(INFO_RX_PACKETS) |
+ STA_INFO_BIT(INFO_RX_DROP_MISC) |
+ STA_INFO_BIT(INFO_TX_PACKETS) |
+ STA_INFO_BIT(INFO_TX_FAILED));
sinfo->rx_packets = pktcnt.rx_good_pkt;
sinfo->rx_dropped_misc = pktcnt.rx_bad_pkt;
sinfo->tx_packets = pktcnt.tx_good_pkt;
{
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg);
- s32 err = 0;
+ s32 err = BCME_OK;
if (unlikely(!wl_get_drv_status(cfg, READY, ndev))) {
WL_INFO(("device is not ready\n"));
- return 0;
+ return err;
}
+
return err;
}
+
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39))
static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
#else
static s32 wl_cfg80211_suspend(struct wiphy *wiphy)
#endif
{
+ s32 err = BCME_OK;
#ifdef DHD_CLEAR_ON_SUSPEND
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
struct net_info *iter, *next;
if (unlikely(!wl_get_drv_status(cfg, READY, ndev))) {
WL_INFO(("device is not ready : status (%d)\n",
(int)cfg->status));
- return 0;
+ return err;
}
for_each_ndev(cfg, iter, next)
wl_set_drv_status(cfg, SCAN_ABORTING, iter->ndev);
}
}
#endif /* DHD_CLEAR_ON_SUSPEND */
- return 0;
+
+
+ return err;
}
static s32
struct timer_list *_timer;
WL_DBG(("scan is running. go to fake listen state\n"));
- wl_set_drv_status(cfg, FAKE_REMAINING_ON_CHANNEL, ndev);
+ if (duration > LONG_LISTEN_TIME) {
+ wl_cfg80211_scan_abort(cfg);
+ } else {
+ wl_set_drv_status(cfg, FAKE_REMAINING_ON_CHANNEL, ndev);
- if (timer_pending(&cfg->p2p->listen_timer)) {
- WL_DBG(("cancel current listen timer \n"));
- del_timer_sync(&cfg->p2p->listen_timer);
- }
+ if (timer_pending(&cfg->p2p->listen_timer)) {
+ WL_DBG(("cancel current listen timer \n"));
+ del_timer_sync(&cfg->p2p->listen_timer);
+ }
- _timer = &cfg->p2p->listen_timer;
- wl_clr_p2p_status(cfg, LISTEN_EXPIRED);
+ _timer = &cfg->p2p->listen_timer;
+ wl_clr_p2p_status(cfg, LISTEN_EXPIRED);
- INIT_TIMER(_timer, wl_cfgp2p_listen_expired, duration, 0);
+ INIT_TIMER(_timer, wl_cfgp2p_listen_expired, duration, 0);
- err = BCME_OK;
- goto exit;
+ err = BCME_OK;
+ goto exit;
+ }
}
#endif /* WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
s32 err = 0;
+ RETURN_EIO_IF_NOT_UP(cfg);
#if defined(WL_CFG80211_P2P_DEV_IF)
if (cfgdev->iftype == NL80211_IFTYPE_P2P_DEVICE) {
WL_DBG((" enter ) on P2P dedicated discover interface\n"));
wl_notify_escan_complete(cfg, cfg->escan_info.ndev, true, true);
}
+ /* Abort P2P listen */
+ if (discover_cfgdev(cfgdev, cfg)) {
+ if (cfg->p2p_supported && cfg->p2p) {
+ wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SCAN, 0, 0,
+ wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE));
+ }
+ }
+
#ifdef WL11U
/* handling DFS channel exceptions */
if (!wl_cfg80211_check_DFS_channel(cfg, af_params, action_frame->data, action_frame->len)) {
/* save af_params for rx process */
cfg->afx_hdl->pending_tx_act_frm = af_params;
+ if (wl_cfgp2p_is_p2p_gas_action(action_frame->data, action_frame->len)) {
+ WL_DBG(("Set GAS action frame config.\n"));
+ config_af_params.search_channel = false;
+ config_af_params.max_tx_retry = 1;
+ }
+
/* search peer's channel */
if (config_af_params.search_channel) {
/* initialize afx_hdl */
wl_cfgp2p_print_actframe(true, action_frame->data, action_frame->len, af_params->channel);
+ wl_cfgp2p_need_wait_actfrmae(cfg, action_frame->data, action_frame->len, true);
+
/* Now send a tx action frame */
ack = wl_cfgp2p_tx_action_frame(cfg, dev, af_params, bssidx) ? false : true;
if (dev == wl_to_p2p_bss_ndev(cfg, P2PAPI_BSSCFG_CONNECTION))
dev = bcmcfg_to_prmry_ndev(cfg);
#endif
- if ((dev == bcmcfg_to_prmry_ndev(cfg)) && cfg->p2p)
+ if ((dev == bcmcfg_to_prmry_ndev(cfg)) && cfg->p2p) {
bssidx = wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE);
- wl_cfgp2p_set_management_ie(cfg, dev, bssidx,
+ }
+ wl_cfgp2p_set_management_ie(cfg, dev, bssidx,
VNDR_IE_PRBRSP_FLAG, (u8 *)(buf + ie_offset), ie_len);
cfg80211_mgmt_tx_status(cfgdev, *cookie, buf, len, true, GFP_KERNEL);
goto exit;
case WPA_CIPHER_AES_CCM:
gval = AES_ENABLED;
break;
-#ifdef BCMWAPI_WPI
- case WAPI_CIPHER_SMS4:
- gval = SMS4_ENABLED;
- break;
-#endif
default:
WL_ERR(("No Security Info\n"));
break;
case WPA_CIPHER_AES_CCM:
pval = AES_ENABLED;
break;
-#ifdef BCMWAPI_WPI
- case WAPI_CIPHER_SMS4:
- pval = SMS4_ENABLED;
- break;
-#endif
default:
WL_ERR(("No Security Info\n"));
}
#if defined(WL_SUPPORT_BACKPORTED_KPATCHES) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, \
2, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
+static s32 wl_cfg80211_del_station(
+ struct wiphy *wiphy, struct net_device *ndev,
+ struct station_del_parameters *params)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static s32
-wl_cfg80211_del_station(
- struct wiphy *wiphy,
- struct net_device *ndev,
- struct station_del_parameters *params)
+wl_cfg80211_del_station(struct wiphy *wiphy,
+ struct net_device *ndev, const u8* mac_addr)
+#else
+static s32
+wl_cfg80211_del_station(struct wiphy *wiphy,
+ struct net_device *ndev, u8* mac_addr)
+#endif
{
struct net_device *dev;
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
struct maclist *assoc_maclist = (struct maclist *)mac_buf;
int num_associated = 0;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
+ const u8 *mac_addr = params->mac;
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) */
+
WL_DBG(("Entry\n"));
- if (params->mac == NULL) {
+ if (mac_addr == NULL) {
WL_DBG(("mac_addr is NULL ignore it\n"));
return 0;
}
else
num_associated = assoc_maclist->count;
- memcpy(scb_val.ea.octet, params->mac, ETHER_ADDR_LEN);
+ memcpy(scb_val.ea.octet, mac_addr, ETHER_ADDR_LEN);
scb_val.val = DOT11_RC_DEAUTH_LEAVING;
err = wldev_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON, &scb_val,
sizeof(scb_val_t), true);
if (err < 0)
WL_ERR(("WLC_SCB_DEAUTHENTICATE_FOR_REASON err %d\n", err));
WL_ERR(("Disconnect STA : %s scb_val.val %d\n",
- bcm_ether_ntoa((const struct ether_addr *)(params->mac), eabuf),
+ bcm_ether_ntoa((const struct ether_addr *)mac_addr, eabuf),
scb_val.val));
- if (num_associated > 0 && ETHER_ISBCAST(params->mac))
+ if (num_associated > 0 && ETHER_ISBCAST(mac_addr))
wl_delay(400);
return 0;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static s32
-wl_cfg80211_change_station(
- struct wiphy *wiphy,
- struct net_device *dev,
- const u8 *mac,
- struct station_parameters *params)
+wl_cfg80211_change_station(struct wiphy *wiphy,
+ struct net_device *dev, const u8 *mac, struct station_parameters *params)
+#else
+static s32
+wl_cfg80211_change_station(struct wiphy *wiphy,
+ struct net_device *dev, u8 *mac, struct station_parameters *params)
+#endif
{
int err;
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
return -ENOTSUPP;
if (!(params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED))) {
- err = wldev_ioctl(primary_ndev, WLC_SCB_DEAUTHORIZE, (void *)mac, ETH_ALEN, true);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+ err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, (u8 *)mac, ETH_ALEN, true);
+#else
+ err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, mac, ETH_ALEN, true);
+#endif
if (err)
WL_ERR(("WLC_SCB_DEAUTHORIZE error (%d)\n", err));
return err;
}
- err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, (void *)mac, ETH_ALEN, true);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
+ err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, (u8 *)mac, ETH_ALEN, true);
+#else
+ err = wldev_ioctl(primary_ndev, WLC_SCB_AUTHORIZE, mac, ETH_ALEN, true);
+#endif
if (err)
WL_ERR(("WLC_SCB_AUTHORIZE error (%d)\n", err));
return err;
int i;
int ret = 0;
+ if (!request) {
+ WL_ERR(("Sched scan request was NULL\n"));
+ return -EINVAL;
+ }
+
WL_DBG(("Enter \n"));
WL_PNO((">>> SCHED SCAN START\n"));
WL_PNO(("Enter n_match_sets:%d n_ssids:%d \n",
request->n_ssids, pno_time, pno_repeat, pno_freq_expo_max));
- if (!request || !request->n_ssids || !request->n_match_sets) {
+ if (!request->n_ssids || !request->n_match_sets) {
WL_ERR(("Invalid sched scan req!! n_ssids:%d \n", request->n_ssids));
return -EINVAL;
}
}
#endif /* WL_SCHED_SCAN */
-static struct cfg80211_ops wl_cfg80211_ops = {
- .add_virtual_intf = wl_cfg80211_add_virtual_iface,
- .del_virtual_intf = wl_cfg80211_del_virtual_iface,
- .change_virtual_intf = wl_cfg80211_change_virtual_iface,
-#if defined(WL_CFG80211_P2P_DEV_IF)
- .start_p2p_device = wl_cfgp2p_start_p2p_device,
- .stop_p2p_device = wl_cfgp2p_stop_p2p_device,
-#endif /* WL_CFG80211_P2P_DEV_IF */
- .scan = wl_cfg80211_scan,
- .set_wiphy_params = wl_cfg80211_set_wiphy_params,
- .join_ibss = wl_cfg80211_join_ibss,
- .leave_ibss = wl_cfg80211_leave_ibss,
- .get_station = wl_cfg80211_get_station,
- .set_tx_power = wl_cfg80211_set_tx_power,
- .get_tx_power = wl_cfg80211_get_tx_power,
- .add_key = wl_cfg80211_add_key,
- .del_key = wl_cfg80211_del_key,
- .get_key = wl_cfg80211_get_key,
- .set_default_key = wl_cfg80211_config_default_key,
- .set_default_mgmt_key = wl_cfg80211_config_default_mgmt_key,
- .set_power_mgmt = wl_cfg80211_set_power_mgmt,
- .connect = wl_cfg80211_connect,
- .disconnect = wl_cfg80211_disconnect,
- .suspend = wl_cfg80211_suspend,
- .resume = wl_cfg80211_resume,
- .set_pmksa = wl_cfg80211_set_pmksa,
- .del_pmksa = wl_cfg80211_del_pmksa,
- .flush_pmksa = wl_cfg80211_flush_pmksa,
- .remain_on_channel = wl_cfg80211_remain_on_channel,
- .cancel_remain_on_channel = wl_cfg80211_cancel_remain_on_channel,
- .mgmt_tx = wl_cfg80211_mgmt_tx,
- .mgmt_frame_register = wl_cfg80211_mgmt_frame_register,
- .change_bss = wl_cfg80211_change_bss,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
- .set_channel = wl_cfg80211_set_channel,
-#endif
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
- .set_beacon = wl_cfg80211_add_set_beacon,
- .add_beacon = wl_cfg80211_add_set_beacon,
-#else
- .change_beacon = wl_cfg80211_change_beacon,
+#ifdef WL_SUPPORT_ACS
+/*
+ * Currently the dump_obss IOVAR is returning string as output so we need to
+ * parse the output buffer in an unoptimized way. Going forward if we get the
+ * IOVAR output in binary format this method can be optimized
+ */
+static int wl_parse_dump_obss(char *buf, struct wl_dump_survey *survey)
+{
+ int i;
+ char *token;
+ char delim[] = " \n";
+
+ token = strsep(&buf, delim);
+ while (token != NULL) {
+ if (!strcmp(token, "OBSS")) {
+ for (i = 0; i < OBSS_TOKEN_IDX; i++)
+ token = strsep(&buf, delim);
+ survey->obss = simple_strtoul(token, NULL, 10);
+ }
+
+ if (!strcmp(token, "IBSS")) {
+ for (i = 0; i < IBSS_TOKEN_IDX; i++)
+ token = strsep(&buf, delim);
+ survey->ibss = simple_strtoul(token, NULL, 10);
+ }
+
+ if (!strcmp(token, "TXDur")) {
+ for (i = 0; i < TX_TOKEN_IDX; i++)
+ token = strsep(&buf, delim);
+ survey->tx = simple_strtoul(token, NULL, 10);
+ }
+
+ if (!strcmp(token, "Category")) {
+ for (i = 0; i < CTG_TOKEN_IDX; i++)
+ token = strsep(&buf, delim);
+ survey->no_ctg = simple_strtoul(token, NULL, 10);
+ }
+
+ if (!strcmp(token, "Packet")) {
+ for (i = 0; i < PKT_TOKEN_IDX; i++)
+ token = strsep(&buf, delim);
+ survey->no_pckt = simple_strtoul(token, NULL, 10);
+ }
+
+ if (!strcmp(token, "Opp(time):")) {
+ for (i = 0; i < IDLE_TOKEN_IDX; i++)
+ token = strsep(&buf, delim);
+ survey->idle = simple_strtoul(token, NULL, 10);
+ }
+
+ token = strsep(&buf, delim);
+ }
+
+ return 0;
+}
+
+static int wl_dump_obss(struct net_device *ndev, cca_msrmnt_query req,
+ struct wl_dump_survey *survey)
+{
+ cca_stats_n_flags *results;
+ char *buf;
+ int retry, err;
+
+ buf = kzalloc(sizeof(char) * WLC_IOCTL_MAXLEN, GFP_KERNEL);
+ if (unlikely(!buf)) {
+ WL_ERR(("%s: buf alloc failed\n", __func__));
+ return -ENOMEM;
+ }
+
+ retry = IOCTL_RETRY_COUNT;
+ while (retry--) {
+ err = wldev_iovar_getbuf(ndev, "dump_obss", &req, sizeof(req),
+ buf, WLC_IOCTL_MAXLEN, NULL);
+ if (err >= 0) {
+ break;
+ }
+ WL_DBG(("attempt = %d, err = %d, \n",
+ (IOCTL_RETRY_COUNT - retry), err));
+ }
+
+ if (retry <= 0) {
+ WL_ERR(("failure, dump_obss IOVAR failed\n"));
+ err = -EINVAL;
+ goto exit;
+ }
+
+ results = (cca_stats_n_flags *)(buf);
+ wl_parse_dump_obss(results->buf, survey);
+ kfree(buf);
+
+ return 0;
+exit:
+ kfree(buf);
+ return err;
+}
+
+static int wl_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev,
+ int idx, struct survey_info *info)
+{
+ struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
+ struct wl_dump_survey *survey;
+ struct ieee80211_supported_band *band;
+ struct ieee80211_channel*chan;
+ cca_msrmnt_query req;
+ int val, err, noise, retry;
+ uint8 cache_idx;
+
+ dhd_pub_t *dhd = (dhd_pub_t *)(cfg->pub);
+ if (!(dhd->op_mode & DHD_FLAG_HOSTAP_MODE)) {
+ return -ENOENT;
+ }
+ band = wiphy->bands[NL80211_BAND_2GHZ];
+ if (band && idx >= band->n_channels) {
+ idx -= band->n_channels;
+ band = NULL;
+ }
+
+ if (!band || idx >= band->n_channels) {
+ /* Move to 5G band */
+ band = wiphy->bands[NL80211_BAND_5GHZ];
+ if (idx >= band->n_channels) {
+ return -ENOENT;
+ }
+ }
+
+ chan = &band->channels[idx];
+ /*
+ * Avoid unnecessary time spent on getting obss on channels
+ * which are not used by hostapd in current mode.
+ */
+ for (cache_idx = 0; cache_idx < g_hostap_chan_count; cache_idx++) {
+ if (g_hostap_chan_cache[cache_idx] == chan->center_freq)
+ break;
+ }
+ if (cache_idx == g_hostap_chan_count)
+ {
+ WL_DBG(("%s channel %d is ignored & dummy value is passed \n",
+ __func__, ieee80211_frequency_to_channel(chan->center_freq)));
+ info->channel = chan;
+ info->noise = 0;
+ info->channel_time = 0;
+ info->channel_time_busy = 0;
+ info->channel_time_rx = 0;
+ info->channel_time_tx = 0;
+ info->filled = SURVEY_INFO_NOISE_DBM |SURVEY_INFO_CHANNEL_TIME |
+ SURVEY_INFO_CHANNEL_TIME_BUSY | SURVEY_INFO_CHANNEL_TIME_RX |
+ SURVEY_INFO_CHANNEL_TIME_TX;
+ return 0;
+ }
+
+ /* Setting current channel to the requested channel */
+ if ((err = wl_cfg80211_set_channel(wiphy, ndev, chan,
+ NL80211_CHAN_HT20) < 0)) {
+ WL_ERR(("Set channel failed \n"));
+ }
+
+ if (!idx) {
+ /* Disable mpc */
+ val = 0;
+ err = wldev_iovar_setbuf_bsscfg(ndev, "mpc", (void *)&val,
+ sizeof(val), cfg->ioctl_buf, WLC_IOCTL_SMLEN, 0,
+ &cfg->ioctl_buf_sync);
+ if (err < 0) {
+ WL_ERR(("set 'mpc' failed, error = %d\n", err));
+ }
+
+ /* Set interface up, explicitly. */
+ val = 1;
+ err = wldev_ioctl(ndev, WLC_UP, (void *)&val, sizeof(val), true);
+ if (err < 0) {
+ WL_ERR(("set interface up failed, error = %d\n", err));
+ }
+ }
+
+ /* Get noise value */
+ retry = IOCTL_RETRY_COUNT;
+ while (retry--) {
+ err = wldev_ioctl(ndev, WLC_GET_PHY_NOISE, &noise,
+ sizeof(noise), false);
+ if (err >= 0) {
+ break;
+ }
+ WL_DBG(("attempt = %d, err = %d, \n",
+ (IOCTL_RETRY_COUNT - retry), err));
+ }
+
+ if (retry <= 0) {
+ WL_ERR(("Get Phy Noise failed, error = %d\n", err));
+ noise = CHAN_NOISE_DUMMY;
+ }
+
+ survey = (struct wl_dump_survey *) kzalloc(sizeof(struct wl_dump_survey),
+ GFP_KERNEL);
+ if (unlikely(!survey)) {
+ WL_ERR(("%s: alloc failed\n", __func__));
+ return -ENOMEM;
+ }
+
+ /* Start Measurement for obss stats on current channel */
+ req.msrmnt_query = 0;
+ req.time_req = ACS_MSRMNT_DELAY;
+ if ((err = wl_dump_obss(ndev, req, survey)) < 0) {
+ goto exit;
+ }
+
+ /*
+ * Wait for the meaurement to complete, adding a buffer value of 10 to take
+ * into consideration any delay in IOVAR completion
+ */
+ msleep(ACS_MSRMNT_DELAY + 10);
+
+ /* Issue IOVAR to collect measurement results */
+ req.msrmnt_query = 1;
+ if ((err = wl_dump_obss(ndev, req, survey)) < 0) {
+ goto exit;
+ }
+
+ info->channel = chan;
+ info->noise = noise;
+ info->channel_time = ACS_MSRMNT_DELAY;
+ info->channel_time_busy = ACS_MSRMNT_DELAY - survey->idle;
+ info->channel_time_rx = survey->obss + survey->ibss + survey->no_ctg +
+ survey->no_pckt;
+ info->channel_time_tx = survey->tx;
+ info->filled = SURVEY_INFO_NOISE_DBM |SURVEY_INFO_CHANNEL_TIME |
+ SURVEY_INFO_CHANNEL_TIME_BUSY | SURVEY_INFO_CHANNEL_TIME_RX |
+ SURVEY_INFO_CHANNEL_TIME_TX;
+ kfree(survey);
+
+ return 0;
+exit:
+ kfree(survey);
+ return err;
+}
+#endif /* WL_SUPPORT_ACS */
+
+static struct cfg80211_ops wl_cfg80211_ops = {
+ .add_virtual_intf = wl_cfg80211_add_virtual_iface,
+ .del_virtual_intf = wl_cfg80211_del_virtual_iface,
+ .change_virtual_intf = wl_cfg80211_change_virtual_iface,
+#if defined(WL_CFG80211_P2P_DEV_IF)
+ .start_p2p_device = wl_cfgp2p_start_p2p_device,
+ .stop_p2p_device = wl_cfgp2p_stop_p2p_device,
+#endif /* WL_CFG80211_P2P_DEV_IF */
+ .scan = wl_cfg80211_scan,
+ .set_wiphy_params = wl_cfg80211_set_wiphy_params,
+ .join_ibss = wl_cfg80211_join_ibss,
+ .leave_ibss = wl_cfg80211_leave_ibss,
+ .get_station = wl_cfg80211_get_station,
+ .set_tx_power = wl_cfg80211_set_tx_power,
+ .get_tx_power = wl_cfg80211_get_tx_power,
+ .add_key = wl_cfg80211_add_key,
+ .del_key = wl_cfg80211_del_key,
+ .get_key = wl_cfg80211_get_key,
+ .set_default_key = wl_cfg80211_config_default_key,
+ .set_default_mgmt_key = wl_cfg80211_config_default_mgmt_key,
+ .set_power_mgmt = wl_cfg80211_set_power_mgmt,
+ .connect = wl_cfg80211_connect,
+ .disconnect = wl_cfg80211_disconnect,
+ .suspend = wl_cfg80211_suspend,
+ .resume = wl_cfg80211_resume,
+ .set_pmksa = wl_cfg80211_set_pmksa,
+ .del_pmksa = wl_cfg80211_del_pmksa,
+ .flush_pmksa = wl_cfg80211_flush_pmksa,
+ .remain_on_channel = wl_cfg80211_remain_on_channel,
+ .cancel_remain_on_channel = wl_cfg80211_cancel_remain_on_channel,
+ .mgmt_tx = wl_cfg80211_mgmt_tx,
+ .mgmt_frame_register = wl_cfg80211_mgmt_frame_register,
+ .change_bss = wl_cfg80211_change_bss,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
+ .set_channel = wl_cfg80211_set_channel,
+#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
+ .set_beacon = wl_cfg80211_add_set_beacon,
+ .add_beacon = wl_cfg80211_add_set_beacon,
+#else
+ .change_beacon = wl_cfg80211_change_beacon,
.start_ap = wl_cfg80211_start_ap,
.stop_ap = wl_cfg80211_stop_ap,
#endif
.tdls_mgmt = wl_cfg80211_tdls_mgmt,
.tdls_oper = wl_cfg80211_tdls_oper,
#endif
+#ifdef WL_SUPPORT_ACS
+ .dump_survey = wl_cfg80211_dump_survey,
+#endif /* WL_SUPPORT_ACS */
#ifdef WL_CFG80211_ACL
.set_mac_acl = wl_cfg80211_set_mac_acl,
#endif /* WL_CFG80211_ACL */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
static const struct wiphy_wowlan_support brcm_wowlan_support = {
.flags = WIPHY_WOWLAN_ANY,
+ .n_patterns = WL_WOWLAN_MAX_PATTERNS,
+ .pattern_min_len = WL_WOWLAN_MIN_PATTERN_LEN,
+ .pattern_max_len = WL_WOWLAN_MAX_PATTERN_LEN,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
+ .max_pkt_offset = WL_WOWLAN_MAX_PATTERN_LEN,
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) */
};
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) */
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
-static struct cfg80211_wowlan brcm_wowlan_config = {
- .disconnect = true,
- .gtk_rekey_failure = true,
- .eap_identity_req = true,
- .four_way_handshake = true,
-};
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) */
#endif /* CONFIG_PM */
static s32 wl_setup_wiphy(struct wireless_dev *wdev, struct device *sdiofunc_dev, void *context)
{
s32 err = 0;
+#ifdef CONFIG_PM
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
+ struct cfg80211_wowlan *brcm_wowlan_config = NULL;
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) */
+#endif /* CONFIG_PM */
+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
dhd_pub_t *dhd = (dhd_pub_t *)context;
BCM_REFERENCE(dhd);
/* If this is not provided cfg stack will get disconnect
* during suspend.
*/
- wdev->wiphy->wowlan_config = &brcm_wowlan_config;
+ brcm_wowlan_config = kmalloc(sizeof(struct cfg80211_wowlan), GFP_KERNEL);
+ if (brcm_wowlan_config) {
+ brcm_wowlan_config->disconnect = true;
+ brcm_wowlan_config->gtk_rekey_failure = true;
+ brcm_wowlan_config->eap_identity_req = true;
+ brcm_wowlan_config->four_way_handshake = true;
+ brcm_wowlan_config->patterns = NULL;
+ brcm_wowlan_config->n_patterns = 0;
+ brcm_wowlan_config->tcp = NULL;
+ } else {
+ WL_ERR(("Can not allocate memory for brcm_wowlan_config,"
+ " So wiphy->wowlan_config is set to NULL\n"));
+ }
+ wdev->wiphy->wowlan_config = brcm_wowlan_config;
#else
wdev->wiphy->wowlan.flags = WIPHY_WOWLAN_ANY;
+ wdev->wiphy->wowlan.n_patterns = WL_WOWLAN_MAX_PATTERNS;
+ wdev->wiphy->wowlan.pattern_min_len = WL_WOWLAN_MIN_PATTERN_LEN;
+ wdev->wiphy->wowlan.pattern_max_len = WL_WOWLAN_MAX_PATTERN_LEN;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
+ wdev->wiphy->wowlan.max_pkt_offset = WL_WOWLAN_MAX_PATTERN_LEN;
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) */
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) */
#endif /* CONFIG_PM && WL_CFG80211_P2P_DEV_IF */
static void wl_free_wdev(struct bcm_cfg80211 *cfg)
{
struct wireless_dev *wdev = cfg->wdev;
- struct wiphy *wiphy;
+ struct wiphy *wiphy = NULL;
if (!wdev) {
WL_ERR(("wdev is invalid\n"));
return;
}
- wiphy = wdev->wiphy;
-
- wdev->wiphy->wowlan = NULL;
- wdev->wiphy->wowlan_config = NULL;
-
+ if (wdev->wiphy) {
+ wiphy = wdev->wiphy;
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 13, 0)) || defined(WL_VENDOR_EXT_SUPPORT)
- wl_cfgvendor_detach(wdev->wiphy);
+ wl_cfgvendor_detach(wdev->wiphy);
+ wdev->wiphy->wowlan = NULL;
#endif /* if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 13, 0)) || defined(WL_VENDOR_EXT_SUPPORT) */
-
- wiphy_unregister(wdev->wiphy);
- wdev->wiphy->dev.parent = NULL;
+ wiphy_unregister(wdev->wiphy);
+ wdev->wiphy->dev.parent = NULL;
+ wdev->wiphy = NULL;
+ }
wl_delete_all_netinfo(cfg);
- wiphy_free(wiphy);
+ if (wiphy)
+ wiphy_free(wiphy);
/* PLEASE do NOT call any function after wiphy_free, the driver's private structure "cfg",
* which is the private part of wiphy, has been freed in wiphy_free !!!!!!!!!!!
*/
goto exit;
isfree = true;
- if (event == WLC_E_ASSOC_IND && reason == DOT11_SC_SUCCESS) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
- cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
- cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len);
+ if ((event == WLC_E_ASSOC_IND && reason == DOT11_SC_SUCCESS) ||
+ (event == WLC_E_DISASSOC_IND) ||
+ ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH))) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
+ defined(WL_COMPAT_WIRELESS)
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
#else
- cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len);
-#endif /* KERNEL VERSION 3, 12 */
+ cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
+#endif
} else if (event == WLC_E_DISASSOC_IND) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
- cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
- cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len);
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
#else
- cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len);
-#endif /* version 3.12*/
+ cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
+#endif
} else if ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
- cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
- cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len);
+ cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, GFP_ATOMIC);
#else
- cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len);
-#endif /* version 3.12 */
+ cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
+#endif
}
-
exit:
if (isfree)
kfree(mgmt_frame);
sinfo.filled = 0;
if (((event == WLC_E_ASSOC_IND) || (event == WLC_E_REASSOC_IND)) &&
reason == DOT11_SC_SUCCESS) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0))
+ sinfo.filled = STA_INFO_BIT(INFO_ASSOC_REQ_IES);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) */
if (!data) {
WL_ERR(("No IEs present in ASSOC/REASSOC_IND"));
return -EINVAL;
struct net_device *ndev = NULL;
s32 err = 0;
u32 event = ntoh32(e->event_type);
+ struct wiphy *wiphy = NULL;
+ struct cfg80211_bss *bss = NULL;
+ struct wlc_ssid *ssid = NULL;
+ u8 *bssid = 0;
ndev = cfgdev_to_wlc_ndev(cfgdev, cfg);
} else if (wl_is_linkdown(cfg, e)) {
if (cfg->scan_request)
wl_notify_escan_complete(cfg, ndev, true, true);
+ /* Explicitly calling unlink to remove BSS in CFG */
+ wiphy = bcmcfg_to_wiphy(cfg);
+ ssid = (struct wlc_ssid *)wl_read_prof(cfg, ndev, WL_PROF_SSID);
+ bssid = (u8 *)wl_read_prof(cfg, ndev, WL_PROF_BSSID);
+ if (ssid && bssid) {
+ bss = cfg80211_get_bss(wiphy, NULL, bssid,
+ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS,
+ WLAN_CAPABILITY_ESS);
+ if (bss) {
+ cfg80211_unlink_bss(wiphy, bss);
+ }
+ }
if (wl_get_drv_status(cfg, CONNECTED, ndev)) {
scb_val_t scbval;
u8 *curbssid = wl_read_prof(cfg, ndev, WL_PROF_BSSID);
return 0;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
- cfg80211_disconnected(ndev, reason, NULL, 0, false, GFP_KERNEL);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) */
-
wl_clr_drv_status(cfg, CONNECTED, ndev);
+
if (! wl_get_drv_status(cfg, DISCONNECTING, ndev)) {
/* To make sure disconnect, explictly send dissassoc
* for BSSID 00:00:00:00:00:00 issue
cfg80211_disconnected(ndev, reason, NULL, 0, false, GFP_KERNEL);
wl_link_down(cfg);
wl_init_prof(cfg, ndev);
+ memset(&cfg->last_roamed_addr, 0, ETHER_ADDR_LEN);
}
}
else if (wl_get_drv_status(cfg, CONNECTING, ndev)) {
return err;
}
+#ifdef WL_RELMCAST
void wl_cfg80211_set_rmc_pid(int pid)
{
struct bcm_cfg80211 *cfg = g_bcm_cfg;
cfg->rmc_event_pid = pid;
WL_DBG(("set pid for rmc event : pid=%d\n", pid));
}
+#endif /* WL_RELMCAST */
+#ifdef WL_RELMCAST
static s32
wl_notify_rmc_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
const wl_event_msg_t *e, void *data)
WL_DBG(("rmcevent : evt=%d, pid=%d, ret=%d\n", evt, cfg->rmc_event_pid, ret));
return ret;
}
+#endif /* WL_RELMCAST */
static s32
wl_notify_roaming_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
return err;
if ((event == WLC_E_ROAM || event == WLC_E_BSSID) && status == WLC_E_STATUS_SUCCESS) {
- if (wl_get_drv_status(cfg, CONNECTED, ndev))
+ if (wl_get_drv_status(cfg, CONNECTED, ndev)) {
+ if (cfg->roam_offload &&
+ memcmp(&cfg->last_roamed_addr, &e->addr, ETHER_ADDR_LEN) == 0) {
+ WL_INFO(("BSSID already updated\n"));
+ return err;
+ }
wl_bss_roaming_done(cfg, ndev, e, data);
- else
+ memcpy(&cfg->last_roamed_addr, (void *)&e->addr, ETHER_ADDR_LEN);
+ } else {
wl_bss_connect_done(cfg, ndev, e, data, true);
+ }
act = true;
wl_update_prof(cfg, ndev, e, &act, WL_PROF_ACT);
wl_update_prof(cfg, ndev, NULL, (void *)&e->addr, WL_PROF_BSSID);
WL_DBG((" device name is ndev %s \n", ndev->name));
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+ retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, 0, GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
defined(WL_COMPAT_WIRELESS)
- retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len);
+ retval = cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, GFP_ATOMIC);
#else
- retval = cfg80211_rx_mgmt(cfgdev, freq, mgmt_frame, mgmt_frame_len);
-#endif /* LINUX_VERSION >= VERSION(3, 12, 0) */
+ retval = cfg80211_rx_mgmt(cfgdev, freq, mgmt_frame, mgmt_frame_len, GFP_ATOMIC);
+#endif /* LINUX_VERSION >= VERSION(3, 18, 0) */
WL_DBG(("mgmt_frame_len (%d) , e->datalen (%d), channel (%d), freq (%d) retval (%d)\n",
- mgmt_frame_len, ntoh32(e->datalen), channel, freq, retval));
+ mgmt_frame_len, ntoh32(e->datalen), channel, freq, retval));
exit:
if (isfree)
kfree(mgmt_frame);
cfg->evt_handler[WLC_E_TDLS_PEER_EVENT] = wl_tdls_event_handler;
#endif /* WLTDLS */
cfg->evt_handler[WLC_E_BSSID] = wl_notify_roaming_status;
+#ifdef WL_RELMCAST
cfg->evt_handler[WLC_E_RMC_EVENT] = wl_notify_rmc_status;
+#endif /* WL_RELMCAST */
#ifdef WL_NAN
cfg->evt_handler[WLC_E_NAN] = wl_cfgnan_notify_nan_status;
cfg->evt_handler[WLC_E_PROXD] = wl_cfgnan_notify_proxd_status;
#endif /* WL_NAN */
+
+ cfg->evt_handler[WLC_E_CSA_COMPLETE_IND] = wl_csa_complete_ind;
}
#if defined(STATIC_WL_PRIV_STRUCT)
-static void
+static int
wl_init_escan_result_buf(struct bcm_cfg80211 *cfg)
{
- cfg->escan_info.escan_buf = DHD_OS_PREALLOC(cfg->pub, DHD_PREALLOC_WIPHY_ESCAN0, 0);
+ cfg->escan_info.escan_buf = DHD_OS_PREALLOC(cfg->pub,
+ DHD_PREALLOC_WIPHY_ESCAN0, ESCAN_BUF_SIZE);
+ if (cfg->escan_info.escan_buf == NULL) {
+ WL_ERR(("Failed to alloc ESCAN_BUF\n"));
+ return -ENOMEM;
+ }
bzero(cfg->escan_info.escan_buf, ESCAN_BUF_SIZE);
+
+ return 0;
}
static void
wl_deinit_escan_result_buf(struct bcm_cfg80211 *cfg)
{
- cfg->escan_info.escan_buf = NULL;
-
+ if (cfg->escan_info.escan_buf != NULL) {
+ DHD_OS_PREFREE(cfg->pub, DHD_PREALLOC_WIPHY_ESCAN0,
+ cfg->escan_info.escan_buf, ESCAN_BUF_SIZE);
+ cfg->escan_info.escan_buf = NULL;
+ }
}
#endif /* STATIC_WL_PRIV_STRUCT */
WL_ERR(("cfg->ie alloc failed\n"));
goto init_priv_mem_out;
}
- wl_init_escan_result_buf(cfg);
+ if (unlikely(wl_init_escan_result_buf(cfg))) {
+ WL_ERR(("Failed to init escan result buf\n"));
+ goto init_priv_mem_out;
+ }
#endif /* STATIC_WL_PRIV_STRUCT */
cfg->afx_hdl = (void *)kzalloc(sizeof(*cfg->afx_hdl), GFP_KERNEL);
if (unlikely(!cfg->afx_hdl)) {
PROC_STOP(&cfg->event_tsk);
}
+void wl_terminate_event_handler(void)
+{
+ struct bcm_cfg80211 *cfg = g_bcm_cfg;
+
+ if (cfg) {
+ wl_destroy_event_handler(cfg);
+ }
+}
+
static void wl_scan_timeout(unsigned long data)
{
wl_event_msg_t msg;
static s32
wl_cfg80211_netdev_notifier_call(struct notifier_block * nb,
unsigned long state,
- void *ndev)
+ void *ptr)
{
- struct net_device *dev = ndev;
- struct wireless_dev *wdev = dev->ieee80211_ptr;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0))
+ struct net_device *dev = ptr;
+#else
+ struct net_device *dev = netdev_notifier_info_to_dev(ptr);
+#endif /* LINUX_VERSION < VERSION(3, 11, 0) */
+ struct wireless_dev *wdev = ndev_to_wdev(dev);
struct bcm_cfg80211 *cfg = g_bcm_cfg;
WL_DBG(("Enter \n"));
case NETDEV_UNREGISTER:
/* after calling list_del_rcu(&wdev->list) */
- wl_dealloc_netinfo(cfg, ndev);
+ wl_dealloc_netinfo(cfg, dev);
break;
case NETDEV_GOING_DOWN:
/* At NETDEV_DOWN state, wdev_cleanup_work work will be called.
return err;
}
+#ifdef ESCAN_BUF_OVERFLOW_MGMT
+static void
+wl_cfg80211_find_removal_candidate(wl_bss_info_t *bss, removal_element_t *candidate)
+{
+ int idx;
+ for (idx = 0; idx < BUF_OVERFLOW_MGMT_COUNT; idx++) {
+ int len = BUF_OVERFLOW_MGMT_COUNT - idx - 1;
+ if (bss->RSSI < candidate[idx].RSSI) {
+ if (len)
+ memcpy(&candidate[idx + 1], &candidate[idx],
+ sizeof(removal_element_t) * len);
+ candidate[idx].RSSI = bss->RSSI;
+ candidate[idx].length = bss->length;
+ memcpy(&candidate[idx].BSSID, &bss->BSSID, ETHER_ADDR_LEN);
+ return;
+ }
+ }
+}
+
+static void
+wl_cfg80211_remove_lowRSSI_info(wl_scan_results_t *list, removal_element_t *candidate,
+ wl_bss_info_t *bi)
+{
+ int idx1, idx2;
+ int total_delete_len = 0;
+ for (idx1 = 0; idx1 < BUF_OVERFLOW_MGMT_COUNT; idx1++) {
+ int cur_len = WL_SCAN_RESULTS_FIXED_SIZE;
+ wl_bss_info_t *bss = NULL;
+ if (candidate[idx1].RSSI >= bi->RSSI)
+ continue;
+ for (idx2 = 0; idx2 < list->count; idx2++) {
+ bss = bss ? (wl_bss_info_t *)((uintptr)bss + dtoh32(bss->length)) :
+ list->bss_info;
+ if (!bcmp(&candidate[idx1].BSSID, &bss->BSSID, ETHER_ADDR_LEN) &&
+ candidate[idx1].RSSI == bss->RSSI &&
+ candidate[idx1].length == dtoh32(bss->length)) {
+ u32 delete_len = dtoh32(bss->length);
+ WL_DBG(("delete scan info of " MACDBG " to add new AP\n",
+ MAC2STRDBG(bss->BSSID.octet)));
+ if (idx2 < list->count -1) {
+ memmove((u8 *)bss, (u8 *)bss + delete_len,
+ list->buflen - cur_len - delete_len);
+ }
+ list->buflen -= delete_len;
+ list->count--;
+ total_delete_len += delete_len;
+ /* if delete_len is greater than or equal to result length */
+ if (total_delete_len >= bi->length) {
+ return;
+ }
+ break;
+ }
+ cur_len += dtoh32(bss->length);
+ }
+ }
+}
+#endif /* ESCAN_BUF_OVERFLOW_MGMT */
+
static s32 wl_escan_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
const wl_event_msg_t *e, void *data)
{
} else {
int cur_len = WL_SCAN_RESULTS_FIXED_SIZE;
+#ifdef ESCAN_BUF_OVERFLOW_MGMT
+ removal_element_t candidate[BUF_OVERFLOW_MGMT_COUNT];
+ int remove_lower_rssi = FALSE;
+
+ bzero(candidate, sizeof(removal_element_t)*BUF_OVERFLOW_MGMT_COUNT);
+#endif /* ESCAN_BUF_OVERFLOW_MGMT */
+
list = wl_escan_get_buf(cfg, FALSE);
if (scan_req_match(cfg)) {
/* p2p scan && allow only probe response */
goto exit;
}
}
+#ifdef ESCAN_BUF_OVERFLOW_MGMT
+ if (bi_length > ESCAN_BUF_SIZE - list->buflen)
+ remove_lower_rssi = TRUE;
+#endif /* ESCAN_BUF_OVERFLOW_MGMT */
+
for (i = 0; i < list->count; i++) {
bss = bss ? (wl_bss_info_t *)((uintptr)bss + dtoh32(bss->length))
: list->bss_info;
+#ifdef ESCAN_BUF_OVERFLOW_MGMT
+ WL_TRACE(("%s("MACDBG"), i=%d bss: RSSI %d list->count %d\n",
+ bss->SSID, MAC2STRDBG(bss->BSSID.octet),
+ i, bss->RSSI, list->count));
+
+ if (remove_lower_rssi)
+ wl_cfg80211_find_removal_candidate(bss, candidate);
+#endif /* ESCAN_BUF_OVERFLOW_MGMT */
if (!bcmp(&bi->BSSID, &bss->BSSID, ETHER_ADDR_LEN) &&
(CHSPEC_BAND(wl_chspec_driver_to_host(bi->chanspec))
cur_len += dtoh32(bss->length);
}
if (bi_length > ESCAN_BUF_SIZE - list->buflen) {
+#ifdef ESCAN_BUF_OVERFLOW_MGMT
+ wl_cfg80211_remove_lowRSSI_info(list, candidate, bi);
+ if (bi_length > ESCAN_BUF_SIZE - list->buflen) {
+ WL_DBG(("RSSI(" MACDBG ") is too low(%d) to add Buffer\n",
+ MAC2STRDBG(bi->BSSID.octet), bi->RSSI));
+ goto exit;
+ }
+#else
WL_ERR(("Buffer is too small: ignoring\n"));
goto exit;
+#endif /* ESCAN_BUF_OVERFLOW_MGMT */
}
memcpy(&(((char *)list)[list->buflen]), bi, bi_length);
list->buflen += bi_length;
list->count++;
+ /*
+ * !Broadcast && number of ssid = 1 && number of channels =1
+ * means specific scan to association
+ */
+ if (wl_cfgp2p_is_p2p_specific_scan(cfg->scan_request)) {
+ WL_ERR(("P2P assoc scan fast aborted.\n"));
+ wl_notify_escan_complete(cfg, cfg->escan_info.ndev, false, true);
+ goto exit;
+ }
}
}
while (down_interruptible (&tsk->sema) == 0) {
SMP_RD_BARRIER_DEPENDS();
- if (tsk->terminated)
+ if (tsk->terminated) {
+ DHD_OS_WAKE_UNLOCK(cfg->pub);
break;
+ }
while ((e = wl_deq_event(cfg))) {
WL_DBG(("event type (%d), if idx: %d\n", e->etype, e->emsg.ifidx));
/* All P2P device address related events comes on primary interface since
s32 err = 0;
s32 index = 0;
s32 nmode = 0;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
+ u32 j = 0;
+ s32 vhtmode = 0;
+ s32 txstreams = 0;
+ s32 rxstreams = 0;
+ s32 ldpc_cap = 0;
+ s32 stbc_rx = 0;
+ s32 stbc_tx = 0;
+ s32 txbf_bfe_cap = 0;
+ s32 txbf_bfr_cap = 0;
+#endif
bool rollback_lock = false;
s32 bw_cap = 0;
s32 cur_band = -1;
err = wldev_iovar_getint(dev, "nmode", &nmode);
if (unlikely(err)) {
WL_ERR(("error reading nmode (%d)\n", err));
- } else {
- /* For nmodeonly check bw cap */
+ }
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
+ err = wldev_iovar_getint(dev, "vhtmode", &vhtmode);
+ if (unlikely(err)) {
+ WL_ERR(("error reading vhtmode (%d)\n", err));
+ }
+
+ if (vhtmode) {
+ err = wldev_iovar_getint(dev, "txstreams", &txstreams);
+ if (unlikely(err)) {
+ WL_ERR(("error reading txstreams (%d)\n", err));
+ }
+
+ err = wldev_iovar_getint(dev, "rxstreams", &rxstreams);
+ if (unlikely(err)) {
+ WL_ERR(("error reading rxstreams (%d)\n", err));
+ }
+
+ err = wldev_iovar_getint(dev, "ldpc_cap", &ldpc_cap);
+ if (unlikely(err)) {
+ WL_ERR(("error reading ldpc_cap (%d)\n", err));
+ }
+
+ err = wldev_iovar_getint(dev, "stbc_rx", &stbc_rx);
+ if (unlikely(err)) {
+ WL_ERR(("error reading stbc_rx (%d)\n", err));
+ }
+
+ err = wldev_iovar_getint(dev, "stbc_tx", &stbc_tx);
+ if (unlikely(err)) {
+ WL_ERR(("error reading stbc_tx (%d)\n", err));
+ }
+
+ err = wldev_iovar_getint(dev, "txbf_bfe_cap", &txbf_bfe_cap);
+ if (unlikely(err)) {
+ WL_ERR(("error reading txbf_bfe_cap (%d)\n", err));
+ }
+
+ err = wldev_iovar_getint(dev, "txbf_bfr_cap", &txbf_bfr_cap);
+ if (unlikely(err)) {
+ WL_ERR(("error reading txbf_bfr_cap (%d)\n", err));
+ }
+ }
+#endif
+
+ /* For nmode and vhtmode check bw cap */
+ if (nmode ||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
+ vhtmode ||
+#endif
+ 0) {
err = wldev_iovar_getint(dev, "mimo_bw_cap", &bw_cap);
if (unlikely(err)) {
WL_ERR(("error get mimo_bw_cap (%d)\n", err));
bands[NL80211_BAND_5GHZ] =
&__wl_band_5ghz_a;
index = NL80211_BAND_5GHZ;
- if (bw_cap == WLC_N_BW_40ALL || bw_cap == WLC_N_BW_20IN2G_40IN5G)
+ if (nmode && (bw_cap == WLC_N_BW_40ALL || bw_cap == WLC_N_BW_20IN2G_40IN5G))
bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40;
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
+ /* VHT capabilities. */
+ if (vhtmode) {
+ /* Supported */
+ bands[index]->vht_cap.vht_supported = TRUE;
+
+ for (j = 1; j <= VHT_CAP_MCS_MAP_NSS_MAX; j++) {
+ /* TX stream rates. */
+ if (j <= txstreams) {
+ VHT_MCS_MAP_SET_MCS_PER_SS(j, VHT_CAP_MCS_MAP_0_9,
+ bands[index]->vht_cap.vht_mcs.tx_mcs_map);
+ } else {
+ VHT_MCS_MAP_SET_MCS_PER_SS(j, VHT_CAP_MCS_MAP_NONE,
+ bands[index]->vht_cap.vht_mcs.tx_mcs_map);
+ }
+
+ /* RX stream rates. */
+ if (j <= rxstreams) {
+ VHT_MCS_MAP_SET_MCS_PER_SS(j, VHT_CAP_MCS_MAP_0_9,
+ bands[index]->vht_cap.vht_mcs.rx_mcs_map);
+ } else {
+ VHT_MCS_MAP_SET_MCS_PER_SS(j, VHT_CAP_MCS_MAP_NONE,
+ bands[index]->vht_cap.vht_mcs.rx_mcs_map);
+ }
+ }
+
+
+ /* Capabilities */
+ /* 80 MHz is mandatory */
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_SHORT_GI_80;
+
+ if (WL_BW_CAP_160MHZ(bw_cap)) {
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_SHORT_GI_160;
+ }
+
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454;
+
+ if (ldpc_cap)
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_RXLDPC;
+
+ if (stbc_tx)
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_TXSTBC;
+
+ if (stbc_rx)
+ bands[index]->vht_cap.cap |=
+ (stbc_rx << VHT_CAP_INFO_RX_STBC_SHIFT);
+
+ if (txbf_bfe_cap)
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE;
+
+ if (txbf_bfr_cap) {
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE;
+ }
+
+ if (txbf_bfe_cap || txbf_bfr_cap) {
+ bands[index]->vht_cap.cap |=
+ (2 << VHT_CAP_INFO_NUM_BMFMR_ANT_SHIFT);
+ bands[index]->vht_cap.cap |=
+ ((txstreams - 1) <<
+ VHT_CAP_INFO_NUM_SOUNDING_DIM_SHIFT);
+ bands[index]->vht_cap.cap |=
+ IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB;
+ }
+
+ /* AMPDU length limit, support max 1MB (2 ^ (13 + 7)) */
+ bands[index]->vht_cap.cap |=
+ (7 << VHT_CAP_INFO_AMPDU_MAXLEN_EXP_SHIFT);
+ WL_INFO(("%s band[%d] vht_enab=%d vht_cap=%08x "
+ "vht_rx_mcs_map=%04x vht_tx_mcs_map=%04x\n",
+ __FUNCTION__, index,
+ bands[index]->vht_cap.vht_supported,
+ bands[index]->vht_cap.cap,
+ bands[index]->vht_cap.vht_mcs.rx_mcs_map,
+ bands[index]->vht_cap.vht_mcs.tx_mcs_map));
+ }
+#endif
}
else if (bandlist[i] == WLC_BAND_2G && __wl_band_2ghz.n_channels > 0) {
bands[NL80211_BAND_2GHZ] =
wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
}
- if (notify)
+ if (notify) {
+ struct ieee80211_supported_band *sband;
+ enum nl80211_band wiphy_band;
+ struct ieee80211_channel *chan;
+ for (wiphy_band = 0; wiphy_band < NUM_NL80211_BANDS;
+ wiphy_band++) {
+ sband = wiphy->bands[wiphy_band];
+ if (!sband)
+ continue;
+ for (i = 0; i < sband->n_channels; i++) {
+ chan = &sband->channels[i];
+ chan->beacon_found = false;
+ }
+ }
wiphy_apply_custom_regulatory(wiphy, &brcm_regdom);
+ }
end_bands:
if (rollback_lock)
}
}
+ err = wl_create_event_handler(cfg);
+ if (err) {
+ WL_ERR(("wl_create_event_handler failed\n"));
+ return err;
+ }
+ wl_init_event_handler(cfg);
+
+ err = wl_init_scan(cfg);
+ if (err) {
+ WL_ERR(("wl_init_scan failed\n"));
+ return err;
+ }
+
err = dhd_monitor_init(cfg->pub);
INIT_DELAYED_WORK(&cfg->pm_enable_work, wl_cfg80211_work_handler);
return err; /* it is even not ready */
}
+
/* If primary BSS is operational (for e.g SoftAP), bring it down */
if (!(wl_cfgp2p_find_idx(cfg, ndev, &bssidx)) &&
wl_cfgp2p_bss_isup(ndev, bssidx)) {
dev_close(p2p_net);
#endif
DNGL_FUNC(dhd_cfg80211_down, (cfg));
+
+ /* Avoid deadlock from wl_cfg80211_down */
+ mutex_unlock(&cfg->usr_sync);
+ wl_destroy_event_handler(cfg);
+ mutex_lock(&cfg->usr_sync);
wl_flush_eq(cfg);
wl_link_down(cfg);
- if (cfg->p2p_supported)
+ if (cfg->p2p_supported) {
+ if (timer_pending(&cfg->p2p->listen_timer))
+ del_timer_sync(&cfg->p2p->listen_timer);
wl_cfgp2p_down(cfg);
+ }
+
+ if (timer_pending(&cfg->scan_timeout)) {
+ del_timer_sync(&cfg->scan_timeout);
+ }
+
if (cfg->ap_info) {
kfree(cfg->ap_info->wpa_ie);
kfree(cfg->ap_info->rsn_ie);
s32 err = 0;
int val = 1;
dhd_pub_t *dhd;
-
(void)para;
WL_DBG(("In\n"));
cfg = g_bcm_cfg;
err = __wl_cfg80211_up(cfg);
if (unlikely(err))
WL_ERR(("__wl_cfg80211_up failed\n"));
+
+
mutex_unlock(&cfg->usr_sync);
return err;
}
int wl_cfg80211_hang(struct net_device *dev, u16 reason)
{
struct bcm_cfg80211 *cfg;
+#if defined(SOFTAP_SEND_HANGEVT)
+ /* specifc mac address used for hang event */
+ uint8 hang_mac[ETHER_ADDR_LEN] = {0x11, 0x11, 0x11, 0x11, 0x11, 0x11};
+ dhd_pub_t *dhd;
+#endif /* SOFTAP_SEND_HANGEVT */
+ if (!g_bcm_cfg) {
+ return BCME_ERROR;
+ }
cfg = g_bcm_cfg;
WL_ERR(("In : chip crash eventing\n"));
wl_add_remove_pm_enable_work(cfg, FALSE, WL_HANDLER_DEL);
- cfg80211_disconnected(dev, reason, NULL, 0, false, GFP_KERNEL);
+#if defined(SOFTAP_SEND_HANGEVT)
+ dhd = (dhd_pub_t *)(cfg->pub);
+ if (dhd->op_mode & DHD_FLAG_HOSTAP_MODE) {
+ cfg80211_del_sta(dev, hang_mac, GFP_ATOMIC);
+ } else
+#endif /* SOFTAP_SEND_HANGEVT */
+ {
+ cfg80211_disconnected(dev, reason, NULL, 0, false, GFP_KERNEL);
+ }
if (cfg != NULL) {
wl_link_down(cfg);
}
break;
case WLC_E_TDLS_PEER_CONNECTED :
if (cfg->tdls_mgmt_frame) {
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
- cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+ cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len, 0);
- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || defined(WL_COMPAT_WIRELESS)
- cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
- cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len);
- #else
- cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq,
- cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len);
- #endif
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+ cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
+ cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len, 0,
+ GFP_ATOMIC);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
+ defined(WL_COMPAT_WIRELESS)
+ cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
+ cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len,
+ GFP_ATOMIC);
+#else
+ cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq,
+ cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len, GFP_ATOMIC);
+
+#endif
}
msg = " TDLS PEER CONNECTED ";
break;
#endif /* WLTDLS */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 2, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
+static s32
+wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, bool initiator, const u8 *data, size_t len)
+#else
static s32
+#if defined(CONFIG_ARCH_MSM) && defined(TDLS_MGMT_VERSION2)
wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
- const u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
- u32 peer_capability, bool initiator, const u8 *data,
+ u8 *peer, u8 action_code, u8 dialog_token, u16 status_code,
+ u32 peer_capability, const u8 *data, size_t len)
+#else
+wl_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ u8 *peer, u8 action_code, u8 dialog_token, u16 status_code, const u8 *data,
size_t len)
+#endif /* CONFIG_ARCH_MSM && TDLS_MGMT_VERSION2 */
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) */
{
s32 ret = 0;
#ifdef WLTDLS
tdls_wfd_ie_iovar_t info;
memset(&info, 0, sizeof(tdls_wfd_ie_iovar_t));
cfg = g_bcm_cfg;
+
+#if defined(CONFIG_ARCH_MSM) && defined(TDLS_MGMT_VERSION2)
+ /* Some customer platform back ported this feature from kernel 3.15 to kernel 3.10
+ * and that cuases build error
+ */
+ BCM_REFERENCE(peer_capability);
+#endif /* CONFIG_ARCH_MSM && TDLS_MGMT_VERSION2 */
+
switch (action_code) {
/* We need to set TDLS Wifi Display IE to firmware
* using tdls_wfd_ie iovar
return ret;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
static s32
wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
const u8 *peer, enum nl80211_tdls_operation oper)
+#else
+static s32
+wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev,
+ u8 *peer, enum nl80211_tdls_operation oper)
+#endif
{
s32 ret = 0;
#ifdef WLTDLS
tdls_iovar_t info;
cfg = g_bcm_cfg;
memset(&info, 0, sizeof(tdls_iovar_t));
- if (peer)
+ if (peer) {
memcpy(&info.ea, peer, ETHER_ADDR_LEN);
+ } else {
+ return -1;
+ }
switch (oper) {
case NL80211_TDLS_DISCOVERY_REQ:
/* turn on TDLS */
cfg->pm_enable_work_on = false;
for_each_ndev(cfg, iter, next) {
if (!wl_get_drv_status(cfg, CONNECTED, iter->ndev) ||
- (wl_get_mode_by_netdev(cfg, iter->ndev) != WL_MODE_BSS))
+ (wl_get_mode_by_netdev(cfg, iter->ndev) != WL_MODE_BSS &&
+ wl_get_mode_by_netdev(cfg, iter->ndev) != WL_MODE_IBSS))
continue;
if (iter->ndev) {
if ((err = wldev_ioctl(iter->ndev, WLC_SET_PM,
e.event_type = cpu_to_be32(WLC_E_ROAM);
memcpy(&e.addr, bssid, ETHER_ADDR_LEN);
/* trigger the roam event handler */
+ WL_INFO(("Delayed roam to " MACDBG "\n", MAC2STRDBG((u8*)(bssid))));
err = wl_notify_roaming_status(cfg, ndev_to_cfgdev(ndev), &e, NULL);
return err;
return ret;
}
#endif /* WL_CFG80211_ACL */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0))
+int wl_chspec_chandef(chanspec_t chanspec,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
+struct cfg80211_chan_def *chandef,
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0) && (LINUX_VERSION_CODE <= (3, 7, \
+ \
+ 0)))
+struct chan_info *chaninfo,
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) */
+struct wiphy *wiphy)
+{
+ uint16 freq = 0;
+ int chan_type;
+ int channel = 0;
+
+ if (!chandef) {
+ return -1;
+ }
+ channel = CHSPEC_CHANNEL(chanspec);
+
+ switch (CHSPEC_BW(chanspec)) {
+ case WL_CHANSPEC_BW_20:
+ chan_type = NL80211_CHAN_HT20;
+ break;
+ case WL_CHANSPEC_BW_40:
+ {
+ if (CHSPEC_SB_UPPER(chanspec)) {
+ channel += CH_10MHZ_APART;
+ } else {
+ channel -= CH_10MHZ_APART;
+ }
+ }
+ chan_type = NL80211_CHAN_HT40PLUS;
+ break;
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0))
+ case WL_CHANSPEC_BW_80:
+ case WL_CHANSPEC_BW_8080:
+ {
+ uint16 sb = CHSPEC_CTL_SB(chanspec);
+
+ if (sb == WL_CHANSPEC_CTL_SB_LL) {
+ channel -= (CH_10MHZ_APART + CH_20MHZ_APART);
+ } else if (sb == WL_CHANSPEC_CTL_SB_LU) {
+ channel -= CH_10MHZ_APART;
+ } else if (sb == WL_CHANSPEC_CTL_SB_UL) {
+ channel += CH_10MHZ_APART;
+ } else {
+ /* WL_CHANSPEC_CTL_SB_UU */
+ channel += (CH_10MHZ_APART + CH_20MHZ_APART);
+ }
+ }
+
+ chan_type = NL80211_CHAN_WIDTH_80P80;
+ break;
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0)) */
+ default:
+ chan_type = NL80211_CHAN_HT20;
+ break;
+
+ }
+
+ if (CHSPEC_IS5G(chanspec))
+ freq = ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ);
+ else
+ freq = ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0))
+ cfg80211_chandef_create(chandef, ieee80211_get_channel(wiphy, freq), chan_type);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0) && (LINUX_VERSION_CODE <= (3, 7, \
+ \
+ 0)))
+ chaninfo->freq = freq;
+ chaninfo->chan_type = chan_type;
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0)) */
+ return 0;
+}
+
+void
+wl_cfg80211_ch_switch_notify(struct net_device *dev, uint16 chanspec, struct wiphy *wiphy)
+{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0))
+ struct cfg80211_chan_def chandef;
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0) && (LINUX_VERSION_CODE <= (3, 7, \
+ \
+ 0)))
+ struct chan_info chaninfo;
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0)) */
+
+ if (!wiphy) {
+ printk("wiphy is null\n");
+ return;
+ }
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0))
+ if (wl_chspec_chandef(chanspec, &chandef, wiphy)) {
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0) && (LINUX_VERSION_CODE <= (3, 7, \
+ \
+ 0)))
+ if (wl_chspec_chandef(chanspec, &chaninfo, wiphy)) {
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0)) */
+
+ WL_ERR(("%s:chspec_chandef failed\n", __FUNCTION__));
+ return;
+ }
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0))
+ cfg80211_ch_switch_notify(dev, &chandef);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0) && (LINUX_VERSION_CODE <= (3, 7, \
+ \
+ 0)))
+ cfg80211_ch_switch_notify(dev, chan_info.freq, chan_info.chan_type);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0)) */
+ return;
+}
+
+static s32
+wl_csa_complete_ind(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
+const wl_event_msg_t *e, void *data)
+{
+ int error = 0;
+ int chsp = 0;
+ struct net_device *ndev = NULL;
+ struct wiphy *wiphy = NULL;
+ chanspec_t chanspec;
+
+ WL_ERR(("%s\n", __FUNCTION__));
+ if (e->status)
+ return -1;
+ if (cfgdev) {
+ ndev = cfgdev_to_wlc_ndev(cfgdev, cfg);
+ wiphy = bcmcfg_to_wiphy(cfg);
+ error = wldev_iovar_getint(ndev, "chanspec", &chsp);
+ if (error)
+ return -1;
+ chanspec = wl_chspec_driver_to_host(chsp);
+ wl_cfg80211_ch_switch_notify(ndev, chanspec, wiphy);
+ } else {
+ WL_ERR(("%s:cfgdev is null\n", __FUNCTION__));
+ return -1;
+ }
+
+
+ return 0;
+}
+#else
+static s32
+wl_csa_complete_ind(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
+const wl_event_msg_t *e, void *data)
+{
+ WL_ERR(("%s:Not sup for kernel < 3.5\n", __FUNCTION__));
+ return 0;
+}
+#endif /* LINUX_VERSION_CODE >= (3, 5, 0) */
#ifdef WL_NAN
int
/*
* Linux cfg80211 driver
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wl_cfg80211.h 505040 2014-09-26 06:39:18Z $
+ * $Id: wl_cfg80211.h 575651 2015-07-30 13:49:47Z $
*/
#ifndef _wl_cfg80211_h_
#define WL_PM_ENABLE_TIMEOUT 10000
+/* cfg80211 wowlan definitions */
+#define WL_WOWLAN_MAX_PATTERNS 8
+#define WL_WOWLAN_MIN_PATTERN_LEN 1
+#define WL_WOWLAN_MAX_PATTERN_LEN 255
+#define WL_WOWLAN_PKT_FILTER_ID_FIRST 201
+#define WL_WOWLAN_PKT_FILTER_ID_LAST (WL_WOWLAN_PKT_FILTER_ID_FIRST + \
+ WL_WOWLAN_MAX_PATTERNS - 1)
+
/* driver status */
enum wl_status {
struct escan_info {
u32 escan_state;
-#if defined(STATIC_WL_PRIV_STRUCT)
+#ifdef STATIC_WL_PRIV_STRUCT
#ifndef CONFIG_DHD_USE_STATIC_BUF
#error STATIC_WL_PRIV_STRUCT should be used with CONFIG_DHD_USE_STATIC_BUF
#endif /* CONFIG_DHD_USE_STATIC_BUF */
struct net_device *ndev;
};
+#ifdef ESCAN_BUF_OVERFLOW_MGMT
+#define BUF_OVERFLOW_MGMT_COUNT 3
+typedef struct {
+ int RSSI;
+ int length;
+ struct ether_addr BSSID;
+} removal_element_t;
+#endif /* ESCAN_BUF_OVERFLOW_MGMT */
+
struct ap_info {
/* Structure to hold WPS, WPA IEs for a AP */
u8 probe_res_ie[VNDR_IES_MAX_BUF_LEN];
struct delayed_work pm_enable_work;
vndr_ie_setbuf_t *ibss_vsie; /* keep the VSIE for IBSS */
int ibss_vsie_len;
+#ifdef WL_RELMCAST
u32 rmc_event_pid;
u32 rmc_event_seq;
+#endif /* WL_RELMCAST */
bool roam_offload;
#ifdef WLTDLS
u8 *tdls_mgmt_frame;
s32 tdls_mgmt_freq;
#endif /* WLTDLS */
bool nan_running;
+ bool need_wait_afrx;
+ struct ether_addr last_roamed_addr;
};
true : false)
#endif /* WL_CFG80211_P2P_DEV_IF */
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
+#define scan_req_iftype(req) (req->dev->ieee80211_ptr->iftype)
+#else
+#define scan_req_iftype(req) (req->wdev->iftype)
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0) */
+
#define wl_to_sr(w) (w->scan_req_int)
#if defined(STATIC_WL_PRIV_STRUCT)
#define wl_to_ie(w) (w->ie)
struct bcm_cfg80211 *cfg, wl_eventmsg_buf_t *ev);
extern void get_primary_mac(struct bcm_cfg80211 *cfg, struct ether_addr *mac);
extern void wl_cfg80211_update_power_mode(struct net_device *dev);
+extern void wl_terminate_event_handler(void);
#define SCAN_BUF_CNT 2
#define SCAN_BUF_NEXT 1
#define WL_SCANTYPE_LEGACY 0x1
extern void wl_cfg80211_ibss_vsie_set_buffer(vndr_ie_setbuf_t *ibss_vsie, int ibss_vsie_len);
extern s32 wl_cfg80211_ibss_vsie_delete(struct net_device *dev);
+#ifdef WL_RELMCAST
extern void wl_cfg80211_set_rmc_pid(int pid);
-
+#endif /* WL_RELMCAST */
/* Action frame specific functions */
extern u8 wl_get_action_category(void *frame, u32 frame_len);
extern int wl_get_public_action(void *frame, u32 frame_len, u8 *ret_action);
+#ifdef WL_SUPPORT_ACS
+#define ACS_MSRMNT_DELAY 1000 /* dump_obss delay in ms */
+#define IOCTL_RETRY_COUNT 5
+#define CHAN_NOISE_DUMMY -80
+#define OBSS_TOKEN_IDX 15
+#define IBSS_TOKEN_IDX 15
+#define TX_TOKEN_IDX 14
+#define CTG_TOKEN_IDX 13
+#define PKT_TOKEN_IDX 15
+#define IDLE_TOKEN_IDX 12
+#endif /* WL_SUPPORT_ACS */
extern int wl_cfg80211_enable_roam_offload(struct net_device *dev, bool enable);
#ifdef WL_NAN
extern int wl_cfg80211_nan_cmd_handler(struct net_device *ndev, char *cmd,
extern int wl_cfg80211_get_ioctl_version(void);
-#endif /* _wl_cfg80211_h_ */
+#ifdef WL_CFG80211_P2P_DEV_IF
+extern void wl_cfg80211_del_p2p_wdev(void);
+#endif /* WL_CFG80211_P2P_DEV_IF */
+
+#endif /* _wl_cfg80211_h_ */
/*
* Linux cfg80211 driver - Dongle Host Driver (DHD) related
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
#include <dhdioctl.h>
#include <wlioctl.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
+#define strnicmp(str1, str2, len) strncasecmp((str1), (str2), (len))
+#else
+#define strnicmp(str1, str2, len) strnicmp((str1), (str2), (len))
+#endif
+
#ifdef PKT_FILTER_SUPPORT
extern uint dhd_pkt_filter_enable;
extern uint dhd_master_mode;
/* Figure out powermode 1 or o command */
strncpy((char *)&powermode_val, command + strlen("BTCOEXMODE") +1, 1);
- if (strncasecmp((char *)&powermode_val, "1", strlen("1")) == 0) {
+ if (strnicmp((char *)&powermode_val, "1", strlen("1")) == 0) {
WL_TRACE_HW4(("DHCP session starts\n"));
WL_ERR(("was called w/o DHCP OFF. Continue\n"));
}
}
- else if (strncasecmp((char *)&powermode_val, "2", strlen("2")) == 0) {
+ else if (strnicmp((char *)&powermode_val, "2", strlen("2")) == 0) {
/*
* Linux cfgp2p driver
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wl_cfgp2p.c 513084 2014-11-05 12:31:06Z $
+ * $Id: wl_cfgp2p.c 584240 2015-09-04 14:17:53Z $
*
*/
#include <typedefs.h>
else
return false;
}
+
+bool wl_cfgp2p_is_p2p_gas_action(void *frame, u32 frame_len)
+{
+
+ wifi_p2psd_gas_pub_act_frame_t *sd_act_frm;
+
+ if (frame == NULL)
+ return false;
+
+ sd_act_frm = (wifi_p2psd_gas_pub_act_frame_t *)frame;
+ if (frame_len < (sizeof(wifi_p2psd_gas_pub_act_frame_t) - 1))
+ return false;
+ if (sd_act_frm->category != P2PSD_ACTION_CATEGORY)
+ return false;
+
+ if (sd_act_frm->action == P2PSD_ACTION_ID_GAS_IREQ)
+ return wl_cfgp2p_find_gas_subtype(P2PSD_GAS_OUI_SUBTYPE,
+ (u8 *)sd_act_frm->query_data,
+ frame_len);
+ else
+ return false;
+}
+
void wl_cfgp2p_print_actframe(bool tx, void *frame, u32 frame_len, u32 channel)
{
wifi_p2p_pub_act_frame_t *pact_frm;
s32 ret = BCME_OK;
struct net_device *ndev = NULL;
- if (!cfg || !cfg->p2p)
+ if (!cfg || !cfg->p2p || !cfgdev)
return BCME_ERROR;
CFGP2P_DBG((" Enter\n"));
if (status == WLC_E_STATUS_SUCCESS) {
wl_set_p2p_status(cfg, ACTION_TX_COMPLETED);
CFGP2P_DBG(("WLC_E_ACTION_FRAME_COMPLETE : ACK\n"));
+ if (!cfg->need_wait_afrx && cfg->af_sent_channel) {
+ CFGP2P_DBG(("no need to wait next AF.\n"));
+ wl_stop_wait_next_action_frame(cfg, ndev);
+ }
}
else if (!wl_get_p2p_status(cfg, ACTION_TX_COMPLETED)) {
wl_set_p2p_status(cfg, ACTION_TX_NOACK);
if (cfg->p2p_wdev) {
CFGP2P_ERR(("p2p_wdev defined already.\n"));
- return ERR_PTR(-ENFILE);
+ wl_cfgp2p_del_p2p_disc_if(cfg->p2p_wdev, cfg);
+ CFGP2P_ERR(("p2p_wdev deleted.\n"));
}
wdev = kzalloc(sizeof(*wdev), GFP_KERNEL);
if (rollback_lock)
rtnl_unlock();
+ synchronize_rcu();
+
kfree(wdev);
if (cfg)
return 0;
}
#endif /* WL_CFG80211_P2P_DEV_IF */
+
+void
+wl_cfgp2p_need_wait_actfrmae(struct bcm_cfg80211 *cfg, void *frame, u32 frame_len, bool tx)
+{
+ wifi_p2p_pub_act_frame_t *pact_frm;
+ int status = 0;
+
+ if (!frame || (frame_len < (sizeof(*pact_frm) + WL_P2P_AF_STATUS_OFFSET - 1))) {
+ return;
+ }
+
+ if (wl_cfgp2p_is_pub_action(frame, frame_len)) {
+ pact_frm = (wifi_p2p_pub_act_frame_t *)frame;
+ if (pact_frm->subtype == P2P_PAF_GON_RSP && tx) {
+ CFGP2P_ACTION(("Check TX P2P Group Owner Negotiation Rsp Frame status\n"));
+ status = pact_frm->elts[WL_P2P_AF_STATUS_OFFSET];
+ if (status) {
+ cfg->need_wait_afrx = false;
+ return;
+ }
+ }
+ }
+
+ cfg->need_wait_afrx = true;
+ return;
+}
+
+int
+wl_cfgp2p_is_p2p_specific_scan(struct cfg80211_scan_request *request)
+{
+ if (request && (request->n_ssids == 1) &&
+ (request->n_channels == 1) &&
+ IS_P2P_SSID(request->ssids[0].ssid, WL_P2P_WILDCARD_SSID_LEN) &&
+ (request->ssids[0].ssid_len > WL_P2P_WILDCARD_SSID_LEN)) {
+ return true;
+ }
+ return false;
+}
/*
* Linux cfgp2p driver
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wl_cfgp2p.h 476678 2014-05-09 14:46:37Z $
+ * $Id: wl_cfgp2p.h 518957 2014-12-04 08:52:50Z $
*/
#ifndef _wl_cfgp2p_h_
#define _wl_cfgp2p_h_
wl_cfgp2p_is_gas_action(void *frame, u32 frame_len);
extern bool
wl_cfgp2p_find_gas_subtype(u8 subtype, u8* data, u32 len);
+extern bool
+wl_cfgp2p_is_p2p_gas_action(void *frame, u32 frame_len);
extern void
wl_cfgp2p_print_actframe(bool tx, void *frame, u32 frame_len, u32 channel);
extern s32
wl_cfgp2p_del_p2p_disc_if(struct wireless_dev *wdev, struct bcm_cfg80211 *cfg);
#endif /* WL_CFG80211_P2P_DEV_IF */
+extern void
+wl_cfgp2p_need_wait_actfrmae(struct bcm_cfg80211 *cfg, void *frame, u32 frame_len, bool tx);
+
+extern int
+wl_cfgp2p_is_p2p_specific_scan(struct cfg80211_scan_request *request);
+
/* WiFi Direct */
#define SOCIAL_CHAN_1 1
#define SOCIAL_CHAN_2 6
#define WL_P2P_WILDCARD_SSID_LEN 7
#define WL_P2P_INTERFACE_PREFIX "p2p"
#define WL_P2P_TEMP_CHAN 11
+#define WL_P2P_AF_STATUS_OFFSET 9
/* If the provision discovery is for JOIN operations,
* or the device discoverablity frame is destined to GO
kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
/* Alloc the SKB for vendor_event */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
skb = cfg80211_vendor_event_alloc(wiphy, NULL, len, event_id, kflags);
+#else
+ skb = cfg80211_vendor_event_alloc(wiphy, len, event_id, kflags);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) */
if (!skb) {
WL_ERR(("skb alloc failed"));
return -ENOMEM;
* Minimal debug/trace/assert driver definitions for
* Broadcom 802.11 Networking Adapter.
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Linux Wireless Extensions support
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
#include <wl_dbg.h>
#include <wl_iw.h>
-#ifdef BCMWAPI_WPI
-/* these items should evetually go into wireless.h of the linux system headfile dir */
-#ifndef IW_ENCODE_ALG_SM4
-#define IW_ENCODE_ALG_SM4 0x20
-#endif
-
-#ifndef IW_AUTH_WAPI_ENABLED
-#define IW_AUTH_WAPI_ENABLED 0x20
-#endif
-
-#ifndef IW_AUTH_WAPI_VERSION_1
-#define IW_AUTH_WAPI_VERSION_1 0x00000008
-#endif
-
-#ifndef IW_AUTH_CIPHER_SMS4
-#define IW_AUTH_CIPHER_SMS4 0x00000020
-#endif
-
-#ifndef IW_AUTH_KEY_MGMT_WAPI_PSK
-#define IW_AUTH_KEY_MGMT_WAPI_PSK 4
-#endif
-
-#ifndef IW_AUTH_KEY_MGMT_WAPI_CERT
-#define IW_AUTH_KEY_MGMT_WAPI_CERT 8
-#endif
-#endif /* BCMWAPI_WPI */
/* Broadcom extensions to WEXT, linux upstream has obsoleted WEXT */
#ifndef IW_AUTH_KEY_MGMT_FT_802_1X
}
#endif /* WIRELESS_EXT > 17 */
-#ifdef BCMWAPI_WPI
-static inline int _wpa_snprintf_hex(char *buf, size_t buf_size, const u8 *data,
- size_t len, int uppercase)
-{
- size_t i;
- char *pos = buf, *end = buf + buf_size;
- int ret;
- if (buf_size == 0)
- return 0;
- for (i = 0; i < len; i++) {
- ret = snprintf(pos, end - pos, uppercase ? "%02X" : "%02x",
- data[i]);
- if (ret < 0 || ret >= end - pos) {
- end[-1] = '\0';
- return pos - buf;
- }
- pos += ret;
- }
- end[-1] = '\0';
- return pos - buf;
-}
-
-/**
- * wpa_snprintf_hex - Print data as a hex string into a buffer
- * @buf: Memory area to use as the output buffer
- * @buf_size: Maximum buffer size in bytes (should be at least 2 * len + 1)
- * @data: Data to be printed
- * @len: Length of data in bytes
- * Returns: Number of bytes written
- */
-static int
-wpa_snprintf_hex(char *buf, size_t buf_size, const u8 *data, size_t len)
-{
- return _wpa_snprintf_hex(buf, buf_size, data, len, 0);
-}
-#endif /* BCMWAPI_WPI */
static int
wl_iw_handle_scanresults_ies(char **event_p, char *end,
#if WIRELESS_EXT > 17
struct iw_event iwe;
char *event;
-#ifdef BCMWAPI_WPI
- char *buf;
- int custom_event_len;
-#endif
event = *event_p;
if (bi->ie_length) {
}
}
-#ifdef BCMWAPI_WPI
- ptr = ((uint8 *)bi) + sizeof(wl_bss_info_t);
- ptr_len = bi->ie_length;
-
- while ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_WAPI_ID))) {
- WL_TRACE(("%s: found a WAPI IE...\n", __FUNCTION__));
-#ifdef WAPI_IE_USE_GENIE
- iwe.cmd = IWEVGENIE;
- iwe.u.data.length = ie->len + 2;
- event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, (char *)ie);
-#else /* using CUSTOM event */
- iwe.cmd = IWEVCUSTOM;
- custom_event_len = strlen("wapi_ie=") + 2*(ie->len + 2);
- iwe.u.data.length = custom_event_len;
-
- buf = kmalloc(custom_event_len+1, GFP_KERNEL);
- if (buf == NULL)
- {
- WL_ERROR(("malloc(%d) returned NULL...\n", custom_event_len));
- break;
- }
-
- memcpy(buf, "wapi_ie=", 8);
- wpa_snprintf_hex(buf + 8, 2+1, &(ie->id), 1);
- wpa_snprintf_hex(buf + 10, 2+1, &(ie->len), 1);
- wpa_snprintf_hex(buf + 12, 2*ie->len+1, ie->data, ie->len);
- event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, buf);
- kfree(buf);
-#endif /* WAPI_IE_USE_GENIE */
- break;
- }
-#endif /* BCMWAPI_WPI */
*event_p = event;
}
char *extra
)
{
-#if defined(BCMWAPI_WPI)
- uchar buf[WLC_IOCTL_SMLEN] = {0};
- uchar *p = buf;
- int wapi_ie_size;
-
- WL_TRACE(("%s: SIOCSIWGENIE\n", dev->name));
-
- if (extra[0] == DOT11_MNG_WAPI_ID)
- {
- wapi_ie_size = iwp->length;
- memcpy(p, extra, iwp->length);
- dev_wlc_bufvar_set(dev, "wapiie", buf, wapi_ie_size);
- }
- else
-#endif
dev_wlc_bufvar_set(dev, "wpaie", extra, iwp->length);
return 0;
case IW_ENCODE_ALG_CCMP:
key.algo = CRYPTO_ALGO_AES_CCM;
break;
-#ifdef BCMWAPI_WPI
- case IW_ENCODE_ALG_SM4:
- key.algo = CRYPTO_ALGO_SMS4;
- if (iwe->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
- key.flags &= ~WL_PRIMARY_KEY;
- }
- break;
-#endif
default:
break;
}
val = WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED;
else if (paramval & IW_AUTH_WPA_VERSION_WPA2)
val = WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED;
-#ifdef BCMWAPI_WPI
- else if (paramval & IW_AUTH_WAPI_VERSION_1)
- val = WAPI_AUTH_UNSPECIFIED;
-#endif
WL_TRACE(("%s: %d: setting wpa_auth to 0x%0x\n", __FUNCTION__, __LINE__, val));
if ((error = dev_wlc_intvar_set(dev, "wpa_auth", val)))
return error;
val |= TKIP_ENABLED;
if (cipher_combined & IW_AUTH_CIPHER_CCMP)
val |= AES_ENABLED;
-#ifdef BCMWAPI_WPI
- val &= ~SMS4_ENABLED;
- if (cipher_combined & IW_AUTH_CIPHER_SMS4)
- val |= SMS4_ENABLED;
-#endif
if (iw->privacy_invoked && !val) {
WL_WSEC(("%s: %s: 'Privacy invoked' TRUE but clearing wsec, assuming "
if (paramval & (IW_AUTH_KEY_MGMT_FT_802_1X | IW_AUTH_KEY_MGMT_FT_PSK))
val |= WPA2_AUTH_FT;
}
-#ifdef BCMWAPI_WPI
- if (paramval & (IW_AUTH_KEY_MGMT_WAPI_PSK | IW_AUTH_KEY_MGMT_WAPI_CERT))
- val = WAPI_AUTH_UNSPECIFIED;
-#endif
WL_TRACE(("%s: %d: setting wpa_auth to %d\n", __FUNCTION__, __LINE__, val));
if ((error = dev_wlc_intvar_set(dev, "wpa_auth", val)))
return error;
#endif /* WIRELESS_EXT > 17 */
-#ifdef BCMWAPI_WPI
-
- case IW_AUTH_WAPI_ENABLED:
- if ((error = dev_wlc_intvar_get(dev, "wsec", &val)))
- return error;
- if (paramval) {
- val |= SMS4_ENABLED;
- if ((error = dev_wlc_intvar_set(dev, "wsec", val))) {
- WL_ERROR(("%s: setting wsec to 0x%0x returned error %d\n",
- __FUNCTION__, val, error));
- return error;
- }
- if ((error = dev_wlc_intvar_set(dev, "wpa_auth", WAPI_AUTH_UNSPECIFIED))) {
- WL_ERROR(("%s: setting wpa_auth(%d) returned %d\n",
- __FUNCTION__, WAPI_AUTH_UNSPECIFIED,
- error));
- return error;
- }
- }
-
- break;
-
-#endif /* BCMWAPI_WPI */
default:
break;
/*
* Linux Wireless Extensions support
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Broadcom Dongle Host Driver (DHD), Linux monitor network interface
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
/*
* Common function shared by Linux WEXT, cfg80211 and p2p drivers
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wldev_common.c 513448 2014-11-06 13:44:21Z $
+ * $Id: wldev_common.c 540901 2015-03-13 11:50:58Z $
*/
#include <osl.h>
uint16 band = 0;
uint16 bandwidth = 0;
wl_bss_info_t *bss = NULL;
- char* buf = kmalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
+ char* buf = NULL;
+
+ buf = kmalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
+
+ if (!buf) {
+ WLDEV_ERROR(("%s:NOMEM\n", __FUNCTION__));
+ return -ENOMEM;
+ }
*(u32*) buf = htod32(WL_EXTRA_BUF_MAX);
error = wldev_ioctl(dev, WLC_GET_BSS_INFO, (void*)buf, WL_EXTRA_BUF_MAX, false);
if (error) {
WLDEV_ERROR(("%s:failed:%d\n", __FUNCTION__, error));
- return -1;
+ kfree(buf);
+ buf = NULL;
+ return error;
}
bss = (struct wl_bss_info *)(buf + 4);
chanspec = wl_chspec_driver_to_host(bss->chanspec);
strcpy(cap, "a");
} else {
WLDEV_ERROR(("%s:Mode get failed\n", __FUNCTION__));
- return -1;
+ error = BCME_ERROR;
}
}
+ kfree(buf);
+ buf = NULL;
return error;
}
#define MAX_NUM_OF_ASSOCLIST 64
/*
* Common function shared by Linux WEXT, cfg80211 and p2p drivers
*
- * Copyright (C) 1999-2014, Broadcom Corporation
+ * Copyright (C) 1999-2015, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you