提交 dc5a1894 编写于 作者: G Greg Kroah-Hartman

Merge Linus's tree into staging-next

This was done to resolve the conflicts that were in a number of files
due to changes done upstream with others done in the staging-next
branch.
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
...@@ -1533,9 +1533,10 @@ F: drivers/net/tg3.* ...@@ -1533,9 +1533,10 @@ F: drivers/net/tg3.*
BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
M: Brett Rudley <brudley@broadcom.com> M: Brett Rudley <brudley@broadcom.com>
M: Henry Ptasinski <henryp@broadcom.com> M: Henry Ptasinski <henryp@broadcom.com>
M: Dowan Kim <dowan@broadcom.com>
M: Roland Vossen <rvossen@broadcom.com> M: Roland Vossen <rvossen@broadcom.com>
M: Arend van Spriel <arend@broadcom.com> M: Arend van Spriel <arend@broadcom.com>
M: Franky (Zhenhui) Lin <frankyl@broadcom.com>
M: Kan Yan <kanyan@broadcom.com>
L: linux-wireless@vger.kernel.org L: linux-wireless@vger.kernel.org
S: Supported S: Supported
F: drivers/staging/brcm80211/ F: drivers/staging/brcm80211/
......
...@@ -7,6 +7,7 @@ config BRCMSMAC ...@@ -7,6 +7,7 @@ config BRCMSMAC
default n default n
depends on PCI depends on PCI
depends on WLAN && MAC80211 depends on WLAN && MAC80211
depends on !PPC64 && !PPC32
select BRCMUTIL select BRCMUTIL
select FW_LOADER select FW_LOADER
select CRC_CCITT select CRC_CCITT
...@@ -20,6 +21,7 @@ config BRCMFMAC ...@@ -20,6 +21,7 @@ config BRCMFMAC
default n default n
depends on MMC depends on MMC
depends on WLAN && CFG80211 depends on WLAN && CFG80211
depends on !PPC64 && !PPC32
select BRCMUTIL select BRCMUTIL
select FW_LOADER select FW_LOADER
select WIRELESS_EXT select WIRELESS_EXT
......
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
subdir-ccflags-y := -DBCMDMA32 subdir-ccflags-y := -DBCMDMA32
subdir-ccflags-$(CONFIG_BRCMDBG) += -DBCMDBG -DBCMDBG_ASSERT subdir-ccflags-$(CONFIG_BRCMDBG) += -DBCMDBG -DBCMDBG_ASSERT
obj-$(CONFIG_BRCMUTIL) += util/ obj-$(CONFIG_BRCMUTIL) += brcmutil/
obj-$(CONFIG_BRCMFMAC) += brcmfmac/ obj-$(CONFIG_BRCMFMAC) += brcmfmac/
obj-$(CONFIG_BRCMSMAC) += brcmsmac/ obj-$(CONFIG_BRCMSMAC) += brcmsmac/
Broadcom brcmsmac (mac80211-based softmac PCIe) and brcmfmac (SDIO) drivers. refer to: http://linuxwireless.org/en/users/Drivers/brcm80211
Completely open source host drivers, no binary object files.
Support for the following chips:
===============================
brcmsmac (PCIe)
Name Device ID
BCM4313 0x4727
BCM43224 0x4353
BCM43225 0x4357
brcmfmac (SDIO)
Name
BCM4329
Both brcmsmac and brcmfmac drivers require firmware files that need to be
separately downloaded.
Firmware
======================
Firmware is available from the Linux firmware repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git
https://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git
===============================================================
Broadcom brcmsmac driver
===============================================================
- Support for both 32 and 64 bit Linux kernels
Firmware installation
======================
Copy brcm/bcm43xx-0.fw and brcm/bcm43xx_hdr-0.fw to
/lib/firmware/brcm (or wherever firmware is normally installed
on your system).
===============================================================
Broadcom brcmfmac driver
===============================================================
- Support for 32 bit Linux kernel, 64 bit untested
Firmware installation
======================
Copy brcm/bcm4329-fullmac-4.bin and brcm/bcm4329-fullmac-4.txt
to /lib/firmware/brcm (or wherever firmware is normally installed on your
system).
Contact Info:
=============
Brett Rudley brudley@broadcom.com
Henry Ptasinski henryp@broadcom.com
Dowan Kim dowan@broadcom.com
Roland Vossen rvossen@broadcom.com
Arend van Spriel arend@broadcom.com
For more info, refer to: http://linuxwireless.org/en/users/Drivers/brcm80211
...@@ -2,14 +2,22 @@ To Do List for Broadcom Mac80211 driver before getting in mainline ...@@ -2,14 +2,22 @@ To Do List for Broadcom Mac80211 driver before getting in mainline
Bugs Bugs
==== ====
- Oops on AMPDU traffic, to be solved by new ucode (currently under test) - none known at this moment
brcmfmac and brcmsmac brcmfmac and brcmsmac
===================== =====================
- ASSERTS not allowed in mainline, replace by warning + error handling - replace company specific acronym wlc_
- Replace printk and WL_ERROR() with proper routines - Resolve all XXX, TODO, FIXME in code
brcmfmac brcmfmac
===================== =====================
- Remove unnecessary includes, move #includes from .h files into .c files.
- Absorb and delete header files that are included in only one .c file
- ASSERTS not allowed in mainline, replace by warning + error handling
- Replace printk and WL_ERROR() with proper routines
- Replace driver's proprietary ssb interface with generic kernel ssb module - Replace driver's proprietary ssb interface with generic kernel ssb module
- Build and test on 64 bit linux kernel - Build and test on 64 bit linux kernel
brcm80211 info page
=====================
http://linuxwireless.org/en/users/Drivers/brcm80211
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <linux/if_ether.h>
typedef struct cdc_ioctl {
u32 cmd; /* ioctl command value */
u32 len; /* lower 16: output buflen; upper 16:
input buflen (excludes header) */
u32 flags; /* flag defns given below */
u32 status; /* status code returned from the device */
} cdc_ioctl_t;
/* Max valid buffer size that can be sent to the dongle */
#define CDC_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN)
/* len field is divided into input and output buffer lengths */
#define CDCL_IOC_OUTLEN_MASK 0x0000FFFF /* maximum or expected
response length, */
/* excluding IOCTL header */
#define CDCL_IOC_OUTLEN_SHIFT 0
#define CDCL_IOC_INLEN_MASK 0xFFFF0000 /* input buffer length,
excluding IOCTL header */
#define CDCL_IOC_INLEN_SHIFT 16
/* CDC flag definitions */
#define CDCF_IOC_ERROR 0x01 /* 0=success, 1=ioctl cmd failed */
#define CDCF_IOC_SET 0x02 /* 0=get, 1=set cmd */
#define CDCF_IOC_IF_MASK 0xF000 /* I/F index */
#define CDCF_IOC_IF_SHIFT 12
#define CDCF_IOC_ID_MASK 0xFFFF0000 /* used to uniquely id an ioctl
req/resp pairing */
#define CDCF_IOC_ID_SHIFT 16 /* # of bits of shift for ID Mask */
#define CDC_IOC_IF_IDX(flags) \
(((flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT)
#define CDC_IOC_ID(flags) \
(((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
#define CDC_GET_IF_IDX(hdr) \
((int)((((hdr)->flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT))
#define CDC_SET_IF_IDX(hdr, idx) \
((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | \
((idx) << CDCF_IOC_IF_SHIFT)))
/*
* BDC header
*
* The BDC header is used on data packets to convey priority across USB.
*/
#define BDC_HEADER_LEN 4
#define BDC_PROTO_VER 1 /* Protocol version */
#define BDC_FLAG_VER_MASK 0xf0 /* Protocol version mask */
#define BDC_FLAG_VER_SHIFT 4 /* Protocol version shift */
#define BDC_FLAG__UNUSED 0x03 /* Unassigned */
#define BDC_FLAG_SUM_GOOD 0x04 /* Dongle has verified good
RX checksums */
#define BDC_FLAG_SUM_NEEDED 0x08 /* Dongle needs to do TX checksums */
#define BDC_PRIORITY_MASK 0x7
#define BDC_FLAG2_FC_FLAG 0x10 /* flag to indicate if pkt contains */
/* FLOW CONTROL info only */
#define BDC_PRIORITY_FC_SHIFT 4 /* flow control info shift */
#define BDC_FLAG2_IF_MASK 0x0f /* APSTA: interface on which the
packet was received */
#define BDC_FLAG2_IF_SHIFT 0
#define BDC_GET_IF_IDX(hdr) \
((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT))
#define BDC_SET_IF_IDX(hdr, idx) \
((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | \
((idx) << BDC_FLAG2_IF_SHIFT)))
struct bdc_header {
u8 flags; /* Flags */
u8 priority; /* 802.1d Priority 0:2 bits, 4:7 flow
control info for usb */
u8 flags2;
u8 rssi;
};
...@@ -17,12 +17,6 @@ ...@@ -17,12 +17,6 @@
#ifndef _bcmchip_h_ #ifndef _bcmchip_h_
#define _bcmchip_h_ #define _bcmchip_h_
/* Core reg address translation */
#define CORE_CC_REG(base, field) (base + offsetof(chipcregs_t, field))
#define CORE_BUS_REG(base, field) (base + offsetof(sdpcmd_regs_t, field))
#define CORE_SB(base, field) \
(base + SBCONFIGOFF + offsetof(sbconfig_t, field))
/* bcm4329 */ /* bcm4329 */
/* SDIO device core, ID 0x829 */ /* SDIO device core, ID 0x829 */
#define BCM4329_CORE_BUS_BASE 0x18011000 #define BCM4329_CORE_BUS_BASE 0x18011000
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#ifndef _sdio_api_h_ #ifndef _sdio_api_h_
#define _sdio_api_h_ #define _sdio_api_h_
#include "sdio_host.h"
#define SDIOH_API_RC_SUCCESS (0x00) #define SDIOH_API_RC_SUCCESS (0x00)
#define SDIOH_API_RC_FAIL (0x01) #define SDIOH_API_RC_FAIL (0x01)
#define SDIOH_API_SUCCESS(status) (status == 0) #define SDIOH_API_SUCCESS(status) (status == 0)
......
...@@ -18,17 +18,16 @@ ...@@ -18,17 +18,16 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/pci_ids.h> #include <linux/pci_ids.h>
#include <bcmdefs.h> #include <linux/sched.h>
#include <bcmdevs.h> #include <defs.h>
#include <bcmutils.h> #include <brcm_hw_ids.h>
#include <hndsoc.h> #include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include <soc.h>
#include <bcmsdh.h> /* BRCM API for SDIO
clients (such as wl, dhd) */
#include <bcmsdbus.h> /* common SDIO/controller interface */ #include <bcmsdbus.h> /* common SDIO/controller interface */
#include <sbsdio.h> /* BRCM sdio device core */ #include <sbsdio.h> /* BRCM sdio device core */
#include <sdio.h> /* sdio spec */
#include "dngl_stats.h" #include "dngl_stats.h"
#include "dhd.h" #include "dhd.h"
......
...@@ -23,17 +23,17 @@ ...@@ -23,17 +23,17 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/sched.h>
#include <pcicfg.h> #include <defs.h>
#include <bcmdefs.h> #include <brcm_hw_ids.h>
#include <bcmdevs.h> #include <brcmu_utils.h>
#include <bcmutils.h> #include <brcmu_wifi.h>
#include "sdio_host.h"
#if defined(OOB_INTR_ONLY) #if defined(OOB_INTR_ONLY)
#include <linux/irq.h> #include <linux/irq.h>
extern void dhdsdio_isr(void *args); extern void dhdsdio_isr(void *args);
#include <dngl_stats.h>
#include <dhd.h>
#endif /* defined(OOB_INTR_ONLY) */ #endif /* defined(OOB_INTR_ONLY) */
#if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270) #if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)
#if !defined(BCMPLATFORM_BUS) #if !defined(BCMPLATFORM_BUS)
...@@ -365,22 +365,5 @@ void bcmsdh_unregister_oob_intr(void) ...@@ -365,22 +365,5 @@ void bcmsdh_unregister_oob_intr(void)
extern uint sd_msglevel; /* Debug message level */ extern uint sd_msglevel; /* Debug message level */
module_param(sd_msglevel, uint, 0); module_param(sd_msglevel, uint, 0);
extern uint sd_power; /* 0 = SD Power OFF,
1 = SD Power ON. */
module_param(sd_power, uint, 0);
extern uint sd_clock; /* SD Clock Control, 0 = SD Clock OFF,
1 = SD Clock ON */
module_param(sd_clock, uint, 0);
extern uint sd_divisor; /* Divisor (-1 means external clock) */
module_param(sd_divisor, uint, 0);
extern uint sd_sdmode; /* Default is SD4, 0=SPI, 1=SD1, 2=SD4 */
module_param(sd_sdmode, uint, 0);
extern uint sd_hiok; /* Ok to use hi-speed mode */
module_param(sd_hiok, uint, 0);
extern uint sd_f2_blocksize; extern uint sd_f2_blocksize;
module_param(sd_f2_blocksize, int, 0); module_param(sd_f2_blocksize, int, 0);
...@@ -15,11 +15,12 @@ ...@@ -15,11 +15,12 @@
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <bcmdefs.h> #include <linux/mmc/sdio.h>
#include <bcmdevs.h> #include <defs.h>
#include <bcmutils.h> #include <brcm_hw_ids.h>
#include <sdio.h> /* SDIO Device and Protocol Specs */ #include <brcmu_utils.h>
#include <sdioh.h> /* SDIO Host Controller Specification */ #include <brcmu_wifi.h>
#include "sdio_host.h"
#include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */ #include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */
#include <sdiovar.h> /* ioctl/iovars */ #include <sdiovar.h> /* ioctl/iovars */
...@@ -45,16 +46,9 @@ extern int sdio_reset_comm(struct mmc_card *card); ...@@ -45,16 +46,9 @@ extern int sdio_reset_comm(struct mmc_card *card);
extern PBCMSDH_SDMMC_INSTANCE gInstance; extern PBCMSDH_SDMMC_INSTANCE gInstance;
uint sd_sdmode = SDIOH_MODE_SD4; /* Use SD4 mode by default */
uint sd_f2_blocksize = 512; /* Default blocksize */ uint sd_f2_blocksize = 512; /* Default blocksize */
uint sd_divisor = 2; /* Default 48MHz/2 = 24MHz */
uint sd_power = 1; /* Default to SD Slot powered ON */
uint sd_clock = 1; /* Default to SD Clock turned ON */
uint sd_hiok = false; /* Don't use hi-speed mode by default */
uint sd_msglevel = 0x01; uint sd_msglevel = 0x01;
uint sd_use_dma = true;
DHD_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait); DHD_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
DHD_PM_RESUME_WAIT_INIT(sdioh_request_word_wait); DHD_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
DHD_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait); DHD_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait);
...@@ -81,16 +75,16 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd) ...@@ -81,16 +75,16 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
sd_trace(("%s\n", __func__)); sd_trace(("%s\n", __func__));
/* Get the Card's common CIS address */ /* Get the Card's common CIS address */
sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIOD_CCCR_CISPTR_0); sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIO_CCCR_CIS);
sd->func_cis_ptr[0] = sd->com_cis_ptr; sd->func_cis_ptr[0] = sd->com_cis_ptr;
sd_info(("%s: Card's Common CIS Ptr = 0x%x\n", __func__, sd_info(("%s: Card's Common CIS Ptr = 0x%x\n", __func__,
sd->com_cis_ptr)); sd->com_cis_ptr));
/* Get the Card's function CIS (for each function) */ /* Get the Card's function CIS (for each function) */
for (fbraddr = SDIOD_FBR_STARTADDR, func = 1; for (fbraddr = SDIO_FBR_BASE(1), func = 1;
func <= sd->num_funcs; func++, fbraddr += SDIOD_FBR_SIZE) { func <= sd->num_funcs; func++, fbraddr += SDIOD_FBR_SIZE) {
sd->func_cis_ptr[func] = sd->func_cis_ptr[func] =
sdioh_sdmmc_get_cisaddr(sd, SDIOD_FBR_CISPTR_0 + fbraddr); sdioh_sdmmc_get_cisaddr(sd, SDIO_FBR_CIS + fbraddr);
sd_info(("%s: Function %d CIS Ptr = 0x%x\n", __func__, func, sd_info(("%s: Function %d CIS Ptr = 0x%x\n", __func__, func,
sd->func_cis_ptr[func])); sd->func_cis_ptr[func]));
} }
...@@ -138,7 +132,6 @@ sdioh_info_t *sdioh_attach(void *bar0, uint irq) ...@@ -138,7 +132,6 @@ sdioh_info_t *sdioh_attach(void *bar0, uint irq)
} }
sd->num_funcs = 2; sd->num_funcs = 2;
sd->sd_blockmode = true;
sd->use_client_ints = true; sd->use_client_ints = true;
sd->client_block_size[0] = 64; sd->client_block_size[0] = 64;
...@@ -352,46 +345,22 @@ uint sdioh_query_iofnum(sdioh_info_t *sd) ...@@ -352,46 +345,22 @@ uint sdioh_query_iofnum(sdioh_info_t *sd)
/* IOVar table */ /* IOVar table */
enum { enum {
IOV_MSGLEVEL = 1, IOV_MSGLEVEL = 1,
IOV_BLOCKMODE,
IOV_BLOCKSIZE, IOV_BLOCKSIZE,
IOV_DMA,
IOV_USEINTS, IOV_USEINTS,
IOV_NUMINTS, IOV_NUMINTS,
IOV_NUMLOCALINTS,
IOV_HOSTREG,
IOV_DEVREG, IOV_DEVREG,
IOV_DIVISOR,
IOV_SDMODE,
IOV_HISPEED,
IOV_HCIREGS, IOV_HCIREGS,
IOV_POWER,
IOV_CLOCK,
IOV_RXCHAIN IOV_RXCHAIN
}; };
const bcm_iovar_t sdioh_iovars[] = { const struct brcmu_iovar sdioh_iovars[] = {
{"sd_msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0}, {"sd_msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0},
{"sd_blockmode", IOV_BLOCKMODE, 0, IOVT_BOOL, 0},
{"sd_blocksize", IOV_BLOCKSIZE, 0, IOVT_UINT32, 0},/* ((fn << 16) | {"sd_blocksize", IOV_BLOCKSIZE, 0, IOVT_UINT32, 0},/* ((fn << 16) |
size) */ size) */
{"sd_dma", IOV_DMA, 0, IOVT_BOOL, 0},
{"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0}, {"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0},
{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0}, {"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
{"sd_numlocalints", IOV_NUMLOCALINTS, 0, IOVT_UINT32, 0},
{"sd_hostreg", IOV_HOSTREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
,
{"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)} {"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
, ,
{"sd_divisor", IOV_DIVISOR, 0, IOVT_UINT32, 0}
,
{"sd_power", IOV_POWER, 0, IOVT_UINT32, 0}
,
{"sd_clock", IOV_CLOCK, 0, IOVT_UINT32, 0}
,
{"sd_mode", IOV_SDMODE, 0, IOVT_UINT32, 100}
,
{"sd_highspeed", IOV_HISPEED, 0, IOVT_UINT32, 0}
,
{"sd_rxchain", IOV_RXCHAIN, 0, IOVT_BOOL, 0} {"sd_rxchain", IOV_RXCHAIN, 0, IOVT_BOOL, 0}
, ,
{NULL, 0, 0, 0, 0} {NULL, 0, 0, 0, 0}
...@@ -401,7 +370,7 @@ int ...@@ -401,7 +370,7 @@ int
sdioh_iovar_op(sdioh_info_t *si, const char *name, sdioh_iovar_op(sdioh_info_t *si, const char *name,
void *params, int plen, void *arg, int len, bool set) void *params, int plen, void *arg, int len, bool set)
{ {
const bcm_iovar_t *vi = NULL; const struct brcmu_iovar *vi = NULL;
int bcmerror = 0; int bcmerror = 0;
int val_size; int val_size;
s32 int_val = 0; s32 int_val = 0;
...@@ -418,13 +387,13 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -418,13 +387,13 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
sd_trace(("%s: Enter (%s %s)\n", __func__, (set ? "set" : "get"), sd_trace(("%s: Enter (%s %s)\n", __func__, (set ? "set" : "get"),
name)); name));
vi = bcm_iovar_lookup(sdioh_iovars, name); vi = brcmu_iovar_lookup(sdioh_iovars, name);
if (vi == NULL) { if (vi == NULL) {
bcmerror = -ENOTSUPP; bcmerror = -ENOTSUPP;
goto exit; goto exit;
} }
bcmerror = bcm_iovar_lencheck(vi, arg, len, set); bcmerror = brcmu_iovar_lencheck(vi, arg, len, set);
if (bcmerror != 0) if (bcmerror != 0)
goto exit; goto exit;
...@@ -457,16 +426,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -457,16 +426,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
sd_msglevel = int_val; sd_msglevel = int_val;
break; break;
case IOV_GVAL(IOV_BLOCKMODE):
int_val = (s32) si->sd_blockmode;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_BLOCKMODE):
si->sd_blockmode = (bool) int_val;
/* Haven't figured out how to make non-block mode with DMA */
break;
case IOV_GVAL(IOV_BLOCKSIZE): case IOV_GVAL(IOV_BLOCKSIZE):
if ((u32) int_val > si->num_funcs) { if ((u32) int_val > si->num_funcs) {
bcmerror = -EINVAL; bcmerror = -EINVAL;
...@@ -518,15 +477,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -518,15 +477,6 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
memcpy(arg, &int_val, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_GVAL(IOV_DMA):
int_val = (s32) si->sd_use_dma;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_DMA):
si->sd_use_dma = (bool) int_val;
break;
case IOV_GVAL(IOV_USEINTS): case IOV_GVAL(IOV_USEINTS):
int_val = (s32) si->use_client_ints; int_val = (s32) si->use_client_ints;
memcpy(arg, &int_val, val_size); memcpy(arg, &int_val, val_size);
...@@ -541,111 +491,11 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name, ...@@ -541,111 +491,11 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
break; break;
case IOV_GVAL(IOV_DIVISOR):
int_val = (u32) sd_divisor;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_DIVISOR):
sd_divisor = int_val;
break;
case IOV_GVAL(IOV_POWER):
int_val = (u32) sd_power;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_POWER):
sd_power = int_val;
break;
case IOV_GVAL(IOV_CLOCK):
int_val = (u32) sd_clock;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_CLOCK):
sd_clock = int_val;
break;
case IOV_GVAL(IOV_SDMODE):
int_val = (u32) sd_sdmode;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_SDMODE):
sd_sdmode = int_val;
break;
case IOV_GVAL(IOV_HISPEED):
int_val = (u32) sd_hiok;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_HISPEED):
sd_hiok = int_val;
break;
case IOV_GVAL(IOV_NUMINTS): case IOV_GVAL(IOV_NUMINTS):
int_val = (s32) si->intrcount; int_val = (s32) si->intrcount;
memcpy(arg, &int_val, val_size); memcpy(arg, &int_val, val_size);
break; break;
case IOV_GVAL(IOV_NUMLOCALINTS):
int_val = (s32) 0;
memcpy(arg, &int_val, val_size);
break;
case IOV_GVAL(IOV_HOSTREG):
{
sdreg_t *sd_ptr = (sdreg_t *) params;
if (sd_ptr->offset < SD_SysAddr
|| sd_ptr->offset > SD_MaxCurCap) {
sd_err(("%s: bad offset 0x%x\n", __func__,
sd_ptr->offset));
bcmerror = -EINVAL;
break;
}
sd_trace(("%s: rreg%d at offset %d\n", __func__,
(sd_ptr->offset & 1) ? 8
: ((sd_ptr->offset & 2) ? 16 : 32),
sd_ptr->offset));
if (sd_ptr->offset & 1)
int_val = 8; /* sdioh_sdmmc_rreg8(si,
sd_ptr->offset); */
else if (sd_ptr->offset & 2)
int_val = 16; /* sdioh_sdmmc_rreg16(si,
sd_ptr->offset); */
else
int_val = 32; /* sdioh_sdmmc_rreg(si,
sd_ptr->offset); */
memcpy(arg, &int_val, sizeof(int_val));
break;
}
case IOV_SVAL(IOV_HOSTREG):
{
sdreg_t *sd_ptr = (sdreg_t *) params;
if (sd_ptr->offset < SD_SysAddr
|| sd_ptr->offset > SD_MaxCurCap) {
sd_err(("%s: bad offset 0x%x\n", __func__,
sd_ptr->offset));
bcmerror = -EINVAL;
break;
}
sd_trace(("%s: wreg%d value 0x%08x at offset %d\n",
__func__, sd_ptr->value,
(sd_ptr->offset & 1) ? 8
: ((sd_ptr->offset & 2) ? 16 : 32),
sd_ptr->offset));
break;
}
case IOV_GVAL(IOV_DEVREG): case IOV_GVAL(IOV_DEVREG):
{ {
sdreg_t *sd_ptr = (sdreg_t *) params; sdreg_t *sd_ptr = (sdreg_t *) params;
...@@ -792,7 +642,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr, ...@@ -792,7 +642,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
* Handle F2 enable * Handle F2 enable
* as a special case. * as a special case.
*/ */
if (regaddr == SDIOD_CCCR_IOEN) { if (regaddr == SDIO_CCCR_IOEx) {
if (gInstance->func[2]) { if (gInstance->func[2]) {
sdio_claim_host(gInstance->func[2]); sdio_claim_host(gInstance->func[2]);
if (*byte & SDIO_FUNC_ENABLE_2) { if (*byte & SDIO_FUNC_ENABLE_2) {
...@@ -817,7 +667,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr, ...@@ -817,7 +667,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
} }
#if defined(MMC_SDIO_ABORT) #if defined(MMC_SDIO_ABORT)
/* to allow abort command through F1 */ /* to allow abort command through F1 */
else if (regaddr == SDIOD_CCCR_IOABORT) { else if (regaddr == SDIO_CCCR_ABORT) {
sdio_claim_host(gInstance->func[func]); sdio_claim_host(gInstance->func[func]);
/* /*
* this sdio_f0_writeb() can be replaced * this sdio_f0_writeb() can be replaced
...@@ -1039,9 +889,9 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1039,9 +889,9 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (pkt == NULL) { if (pkt == NULL) {
sd_data(("%s: Creating new %s Packet, len=%d\n", sd_data(("%s: Creating new %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", buflen_u)); __func__, write ? "TX" : "RX", buflen_u));
mypkt = bcm_pkt_buf_get_skb(buflen_u); mypkt = brcmu_pkt_buf_get_skb(buflen_u);
if (!mypkt) { if (!mypkt) {
sd_err(("%s: bcm_pkt_buf_get_skb failed: len %d\n", sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n",
__func__, buflen_u)); __func__, buflen_u));
return SDIOH_API_RC_FAIL; return SDIOH_API_RC_FAIL;
} }
...@@ -1057,7 +907,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1057,7 +907,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (!write) if (!write)
memcpy(buffer, mypkt->data, buflen_u); memcpy(buffer, mypkt->data, buflen_u);
bcm_pkt_buf_free_skb(mypkt); brcmu_pkt_buf_free_skb(mypkt);
} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) { } else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
/* Case 2: We have a packet, but it is unaligned. */ /* Case 2: We have a packet, but it is unaligned. */
...@@ -1066,9 +916,9 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1066,9 +916,9 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
sd_data(("%s: Creating aligned %s Packet, len=%d\n", sd_data(("%s: Creating aligned %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", pkt->len)); __func__, write ? "TX" : "RX", pkt->len));
mypkt = bcm_pkt_buf_get_skb(pkt->len); mypkt = brcmu_pkt_buf_get_skb(pkt->len);
if (!mypkt) { if (!mypkt) {
sd_err(("%s: bcm_pkt_buf_get_skb failed: len %d\n", sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n",
__func__, pkt->len)); __func__, pkt->len));
return SDIOH_API_RC_FAIL; return SDIOH_API_RC_FAIL;
} }
...@@ -1084,7 +934,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1084,7 +934,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (!write) if (!write)
memcpy(pkt->data, mypkt->data, mypkt->len); memcpy(pkt->data, mypkt->data, mypkt->len);
bcm_pkt_buf_free_skb(mypkt); brcmu_pkt_buf_free_skb(mypkt);
} else { /* case 3: We have a packet and } else { /* case 3: We have a packet and
it is aligned. */ it is aligned. */
sd_data(("%s: Aligned %s Packet, direct DMA\n", sd_data(("%s: Aligned %s Packet, direct DMA\n",
...@@ -1105,8 +955,8 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func) ...@@ -1105,8 +955,8 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func)
sd_trace(("%s: Enter\n", __func__)); sd_trace(("%s: Enter\n", __func__));
#if defined(MMC_SDIO_ABORT) #if defined(MMC_SDIO_ABORT)
/* issue abort cmd52 command through F1 */ /* issue abort cmd52 command through F0 */
sdioh_request_byte(sd, SD_IO_OP_WRITE, SDIO_FUNC_0, SDIOD_CCCR_IOABORT, sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
&t_func); &t_func);
#endif /* defined(MMC_SDIO_ABORT) */ #endif /* defined(MMC_SDIO_ABORT) */
......
...@@ -85,11 +85,9 @@ struct sdioh_info { ...@@ -85,11 +85,9 @@ struct sdioh_info {
uint irq; /* Client irq */ uint irq; /* Client irq */
int intrcount; /* Client interrupts */ int intrcount; /* Client interrupts */
bool sd_use_dma; /* DMA on CMD53 */
bool sd_blockmode; /* sd_blockmode == false => 64 Byte Cmd 53s. */ bool sd_blockmode; /* sd_blockmode == false => 64 Byte Cmd 53s. */
/* Must be on for sd_multiblock to be effective */ /* Must be on for sd_multiblock to be effective */
bool use_client_ints; /* If this is false, make sure to restore */ bool use_client_ints; /* If this is false, make sure to restore */
int sd_mode; /* SD1/SD4/SPI */
int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */ int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
u8 num_funcs; /* Supported funcs on client */ u8 num_funcs; /* Supported funcs on client */
u32 com_cis_ptr; u32 com_cis_ptr;
......
...@@ -16,9 +16,11 @@ ...@@ -16,9 +16,11 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/sched.h> /* request_irq() */ #include <linux/sched.h> /* request_irq() */
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <bcmdefs.h> #include <net/cfg80211.h>
#include <bcmutils.h> #include <defs.h>
#include <sdio.h> /* SDIO Specs */ #include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include "sdio_host.h"
#include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */ #include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */
#include <sdiovar.h> /* to get msglevel bit values */ #include <sdiovar.h> /* to get msglevel bit values */
......
...@@ -63,7 +63,7 @@ extern int dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name, ...@@ -63,7 +63,7 @@ extern int dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
bool set); bool set);
/* Add bus dump output to a buffer */ /* Add bus dump output to a buffer */
extern void dhd_bus_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf); extern void dhd_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
/* Clear any bus counters */ /* Clear any bus counters */
extern void dhd_bus_clearcounts(dhd_pub_t *dhdp); extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
......
...@@ -16,16 +16,70 @@ ...@@ -16,16 +16,70 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <bcmdefs.h> #include <linux/sched.h>
#include <defs.h>
#include <bcmutils.h> #include <brcmu_utils.h>
#include <bcmcdc.h> #include <brcmu_wifi.h>
#include <dngl_stats.h> #include <dngl_stats.h>
#include <dhd.h> #include <dhd.h>
#include <dhd_proto.h> #include <dhd_proto.h>
#include <dhd_bus.h> #include <dhd_bus.h>
#include <dhd_dbg.h> #include <dhd_dbg.h>
struct cdc_ioctl {
u32 cmd; /* ioctl command value */
u32 len; /* lower 16: output buflen;
* upper 16: input buflen (excludes header) */
u32 flags; /* flag defns given below */
u32 status; /* status code returned from the device */
};
/* Max valid buffer size that can be sent to the dongle */
#define CDC_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN)
/* CDC flag definitions */
#define CDCF_IOC_ERROR 0x01 /* 1=ioctl cmd failed */
#define CDCF_IOC_SET 0x02 /* 0=get, 1=set cmd */
#define CDCF_IOC_IF_MASK 0xF000 /* I/F index */
#define CDCF_IOC_IF_SHIFT 12
#define CDCF_IOC_ID_MASK 0xFFFF0000 /* id an ioctl pairing */
#define CDCF_IOC_ID_SHIFT 16 /* ID Mask shift bits */
#define CDC_IOC_ID(flags) \
(((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
#define CDC_SET_IF_IDX(hdr, idx) \
((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | \
((idx) << CDCF_IOC_IF_SHIFT)))
/*
* BDC header
* Used on data packets to convey priority across USB.
*/
#define BDC_HEADER_LEN 4
#define BDC_PROTO_VER 1 /* Protocol version */
#define BDC_FLAG_VER_MASK 0xf0 /* Protocol version mask */
#define BDC_FLAG_VER_SHIFT 4 /* Protocol version shift */
#define BDC_FLAG_SUM_GOOD 0x04 /* Good RX checksums */
#define BDC_FLAG_SUM_NEEDED 0x08 /* Dongle needs to do TX checksums */
#define BDC_PRIORITY_MASK 0x7
#define BDC_FLAG2_IF_MASK 0x0f /* packet rx interface in APSTA */
#define BDC_FLAG2_IF_SHIFT 0
#define BDC_GET_IF_IDX(hdr) \
((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT))
#define BDC_SET_IF_IDX(hdr, idx) \
((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | \
((idx) << BDC_FLAG2_IF_SHIFT)))
struct bdc_header {
u8 flags;
u8 priority; /* 802.1d Priority, 4:7 flow control info for usb */
u8 flags2;
u8 rssi;
};
#ifdef CUSTOMER_HW2 #ifdef CUSTOMER_HW2
int wifi_get_mac_addr(unsigned char *buf); int wifi_get_mac_addr(unsigned char *buf);
#endif #endif
...@@ -56,14 +110,14 @@ typedef struct dhd_prot { ...@@ -56,14 +110,14 @@ typedef struct dhd_prot {
u8 pending; u8 pending;
u32 lastcmd; u32 lastcmd;
u8 bus_header[BUS_HEADER_LEN]; u8 bus_header[BUS_HEADER_LEN];
cdc_ioctl_t msg; struct cdc_ioctl msg;
unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN]; unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN];
} dhd_prot_t; } dhd_prot_t;
static int dhdcdc_msg(dhd_pub_t *dhd) static int dhdcdc_msg(dhd_pub_t *dhd)
{ {
dhd_prot_t *prot = dhd->prot; dhd_prot_t *prot = dhd->prot;
int len = le32_to_cpu(prot->msg.len) + sizeof(cdc_ioctl_t); int len = le32_to_cpu(prot->msg.len) + sizeof(struct cdc_ioctl);
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -88,7 +142,7 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len) ...@@ -88,7 +142,7 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
do { do {
ret = ret =
dhd_bus_rxctl(dhd->bus, (unsigned char *)&prot->msg, dhd_bus_rxctl(dhd->bus, (unsigned char *)&prot->msg,
len + sizeof(cdc_ioctl_t)); len + sizeof(struct cdc_ioctl));
if (ret < 0) if (ret < 0)
break; break;
} while (CDC_IOC_ID(le32_to_cpu(prot->msg.flags)) != id); } while (CDC_IOC_ID(le32_to_cpu(prot->msg.flags)) != id);
...@@ -100,7 +154,7 @@ int ...@@ -100,7 +154,7 @@ int
dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len) dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
{ {
dhd_prot_t *prot = dhd->prot; dhd_prot_t *prot = dhd->prot;
cdc_ioctl_t *msg = &prot->msg; struct cdc_ioctl *msg = &prot->msg;
void *info; void *info;
int ret = 0, retries = 0; int ret = 0, retries = 0;
u32 id, flags = 0; u32 id, flags = 0;
...@@ -120,7 +174,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len) ...@@ -120,7 +174,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
} }
} }
memset(msg, 0, sizeof(cdc_ioctl_t)); memset(msg, 0, sizeof(struct cdc_ioctl));
msg->cmd = cpu_to_le32(cmd); msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len); msg->len = cpu_to_le32(len);
...@@ -180,14 +234,14 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len) ...@@ -180,14 +234,14 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len) int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
{ {
dhd_prot_t *prot = dhd->prot; dhd_prot_t *prot = dhd->prot;
cdc_ioctl_t *msg = &prot->msg; struct cdc_ioctl *msg = &prot->msg;
int ret = 0; int ret = 0;
u32 flags, id; u32 flags, id;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len)); DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
memset(msg, 0, sizeof(cdc_ioctl_t)); memset(msg, 0, sizeof(struct cdc_ioctl));
msg->cmd = cpu_to_le32(cmd); msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len); msg->len = cpu_to_le32(len);
...@@ -266,14 +320,14 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len) ...@@ -266,14 +320,14 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
else { else {
ret = dhdcdc_query_ioctl(dhd, ifidx, ioc->cmd, buf, len); ret = dhdcdc_query_ioctl(dhd, ifidx, ioc->cmd, buf, len);
if (ret > 0) if (ret > 0)
ioc->used = ret - sizeof(cdc_ioctl_t); ioc->used = ret - sizeof(struct cdc_ioctl);
} }
/* Too many programs assume ioctl() returns 0 on success */ /* Too many programs assume ioctl() returns 0 on success */
if (ret >= 0) if (ret >= 0)
ret = 0; ret = 0;
else { else {
cdc_ioctl_t *msg = &prot->msg; struct cdc_ioctl *msg = &prot->msg;
/* len == needed when set/query fails from dongle */ /* len == needed when set/query fails from dongle */
ioc->needed = le32_to_cpu(msg->len); ioc->needed = le32_to_cpu(msg->len);
} }
...@@ -312,9 +366,9 @@ dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name, ...@@ -312,9 +366,9 @@ dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
return -ENOTSUPP; return -ENOTSUPP;
} }
void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf) void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
{ {
bcm_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid); brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
} }
void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf) void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
...@@ -411,7 +465,8 @@ int dhd_prot_attach(dhd_pub_t *dhd) ...@@ -411,7 +465,8 @@ int dhd_prot_attach(dhd_pub_t *dhd)
#ifdef BDC #ifdef BDC
dhd->hdrlen += BDC_HEADER_LEN; dhd->hdrlen += BDC_HEADER_LEN;
#endif #endif
dhd->maxctl = WLC_IOCTL_MAXLEN + sizeof(cdc_ioctl_t) + ROUND_UP_MARGIN; dhd->maxctl =
WLC_IOCTL_MAXLEN + sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
return 0; return 0;
fail: fail:
......
...@@ -15,16 +15,21 @@ ...@@ -15,16 +15,21 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
#include <bcmdefs.h> #include <linux/sched.h>
#include <defs.h>
#include <brcmu_wifi.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <bcmutils.h> #include <asm/unaligned.h>
#include <brcmu_utils.h>
#include <dngl_stats.h> #include <dngl_stats.h>
#include <dhd.h> #include <dhd.h>
#include <dhd_bus.h> #include <dhd_bus.h>
#include <dhd_proto.h> #include <dhd_proto.h>
#include <dhd_dbg.h> #include <dhd_dbg.h>
#include <msgtrace.h>
#include <wlioctl.h> #define BRCM_OUI "\x00\x10\x18"
#define DOT11_OUI_LEN 3
#define BCMILCP_BCM_SUBTYPE_EVENT 1
int dhd_msg_level; int dhd_msg_level;
char fw_path[MOD_PARAM_PATHLEN]; char fw_path[MOD_PARAM_PATHLEN];
...@@ -51,6 +56,8 @@ void dhd_iscan_unlock(void); ...@@ -51,6 +56,8 @@ void dhd_iscan_unlock(void);
#endif #endif
#define EPI_VERSION_STR "4.218.248.5" #define EPI_VERSION_STR "4.218.248.5"
#define MSGTRACE_VERSION 1
#ifdef DHD_DEBUG #ifdef DHD_DEBUG
const char dhd_version[] = const char dhd_version[] =
"Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__ "Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
...@@ -82,7 +89,7 @@ enum { ...@@ -82,7 +89,7 @@ enum {
IOV_LAST IOV_LAST
}; };
const bcm_iovar_t dhd_iovars[] = { const struct brcmu_iovar dhd_iovars[] = {
{"version", IOV_VERSION, 0, IOVT_BUFFER, sizeof(dhd_version)} {"version", IOV_VERSION, 0, IOVT_BUFFER, sizeof(dhd_version)}
, ,
#ifdef DHD_DEBUG #ifdef DHD_DEBUG
...@@ -112,6 +119,22 @@ const bcm_iovar_t dhd_iovars[] = { ...@@ -112,6 +119,22 @@ const bcm_iovar_t dhd_iovars[] = {
{NULL, 0, 0, 0, 0} {NULL, 0, 0, 0, 0}
}; };
/* Message trace header */
struct msgtrace_hdr {
u8 version;
u8 spare;
u16 len; /* Len of the trace */
u32 seqnum; /* Sequence number of message. Useful
* if the messsage has been lost
* because of DMA error or a bus reset
* (ex: SDIO Func2)
*/
u32 discarded_bytes; /* Number of discarded bytes because of
trace overflow */
u32 discarded_printf; /* Number of discarded printf
because of trace overflow */
} __packed;
void dhd_common_init(void) void dhd_common_init(void)
{ {
/* Init global variables at run-time, not as part of the declaration. /* Init global variables at run-time, not as part of the declaration.
...@@ -137,54 +160,54 @@ void dhd_common_init(void) ...@@ -137,54 +160,54 @@ void dhd_common_init(void)
static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen) static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
{ {
struct bcmstrbuf b; struct brcmu_strbuf b;
struct bcmstrbuf *strbuf = &b; struct brcmu_strbuf *strbuf = &b;
bcm_binit(strbuf, buf, buflen); brcmu_binit(strbuf, buf, buflen);
/* Base DHD info */ /* Base DHD info */
bcm_bprintf(strbuf, "%s\n", dhd_version); brcmu_bprintf(strbuf, "%s\n", dhd_version);
bcm_bprintf(strbuf, "\n"); brcmu_bprintf(strbuf, "\n");
bcm_bprintf(strbuf, "pub.up %d pub.txoff %d pub.busstate %d\n", brcmu_bprintf(strbuf, "pub.up %d pub.txoff %d pub.busstate %d\n",
dhdp->up, dhdp->txoff, dhdp->busstate); dhdp->up, dhdp->txoff, dhdp->busstate);
bcm_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n", brcmu_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n",
dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz); dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz);
bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n", brcmu_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n",
dhdp->iswl, dhdp->drv_version, &dhdp->mac); dhdp->iswl, dhdp->drv_version, &dhdp->mac);
bcm_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror, brcmu_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror,
dhdp->tickcnt); dhdp->tickcnt);
bcm_bprintf(strbuf, "dongle stats:\n"); brcmu_bprintf(strbuf, "dongle stats:\n");
bcm_bprintf(strbuf, brcmu_bprintf(strbuf,
"tx_packets %ld tx_bytes %ld tx_errors %ld tx_dropped %ld\n", "tx_packets %ld tx_bytes %ld tx_errors %ld tx_dropped %ld\n",
dhdp->dstats.tx_packets, dhdp->dstats.tx_bytes, dhdp->dstats.tx_packets, dhdp->dstats.tx_bytes,
dhdp->dstats.tx_errors, dhdp->dstats.tx_dropped); dhdp->dstats.tx_errors, dhdp->dstats.tx_dropped);
bcm_bprintf(strbuf, brcmu_bprintf(strbuf,
"rx_packets %ld rx_bytes %ld rx_errors %ld rx_dropped %ld\n", "rx_packets %ld rx_bytes %ld rx_errors %ld rx_dropped %ld\n",
dhdp->dstats.rx_packets, dhdp->dstats.rx_bytes, dhdp->dstats.rx_packets, dhdp->dstats.rx_bytes,
dhdp->dstats.rx_errors, dhdp->dstats.rx_dropped); dhdp->dstats.rx_errors, dhdp->dstats.rx_dropped);
bcm_bprintf(strbuf, "multicast %ld\n", dhdp->dstats.multicast); brcmu_bprintf(strbuf, "multicast %ld\n", dhdp->dstats.multicast);
bcm_bprintf(strbuf, "bus stats:\n"); brcmu_bprintf(strbuf, "bus stats:\n");
bcm_bprintf(strbuf, "tx_packets %ld tx_multicast %ld tx_errors %ld\n", brcmu_bprintf(strbuf, "tx_packets %ld tx_multicast %ld tx_errors %ld\n",
dhdp->tx_packets, dhdp->tx_multicast, dhdp->tx_errors); dhdp->tx_packets, dhdp->tx_multicast, dhdp->tx_errors);
bcm_bprintf(strbuf, "tx_ctlpkts %ld tx_ctlerrs %ld\n", brcmu_bprintf(strbuf, "tx_ctlpkts %ld tx_ctlerrs %ld\n",
dhdp->tx_ctlpkts, dhdp->tx_ctlerrs); dhdp->tx_ctlpkts, dhdp->tx_ctlerrs);
bcm_bprintf(strbuf, "rx_packets %ld rx_multicast %ld rx_errors %ld\n", brcmu_bprintf(strbuf, "rx_packets %ld rx_multicast %ld rx_errors %ld\n",
dhdp->rx_packets, dhdp->rx_multicast, dhdp->rx_errors); dhdp->rx_packets, dhdp->rx_multicast, dhdp->rx_errors);
bcm_bprintf(strbuf, brcmu_bprintf(strbuf,
"rx_ctlpkts %ld rx_ctlerrs %ld rx_dropped %ld rx_flushed %ld\n", "rx_ctlpkts %ld rx_ctlerrs %ld rx_dropped %ld rx_flushed %ld\n",
dhdp->rx_ctlpkts, dhdp->rx_ctlerrs, dhdp->rx_dropped, dhdp->rx_ctlpkts, dhdp->rx_ctlerrs, dhdp->rx_dropped,
dhdp->rx_flushed); dhdp->rx_flushed);
bcm_bprintf(strbuf, brcmu_bprintf(strbuf,
"rx_readahead_cnt %ld tx_realloc %ld fc_packets %ld\n", "rx_readahead_cnt %ld tx_realloc %ld fc_packets %ld\n",
dhdp->rx_readahead_cnt, dhdp->tx_realloc, dhdp->fc_packets); dhdp->rx_readahead_cnt, dhdp->tx_realloc, dhdp->fc_packets);
bcm_bprintf(strbuf, "wd_dpc_sched %ld\n", dhdp->wd_dpc_sched); brcmu_bprintf(strbuf, "wd_dpc_sched %ld\n", dhdp->wd_dpc_sched);
bcm_bprintf(strbuf, "\n"); brcmu_bprintf(strbuf, "\n");
/* Add any prot info */ /* Add any prot info */
dhd_prot_dump(dhdp, strbuf); dhd_prot_dump(dhdp, strbuf);
bcm_bprintf(strbuf, "\n"); brcmu_bprintf(strbuf, "\n");
/* Add any bus info */ /* Add any bus info */
dhd_bus_dump(dhdp, strbuf); dhd_bus_dump(dhdp, strbuf);
...@@ -193,7 +216,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen) ...@@ -193,7 +216,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
} }
static int static int
dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid, dhd_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
const char *name, void *params, int plen, void *arg, int len, const char *name, void *params, int plen, void *arg, int len,
int val_size) int val_size)
{ {
...@@ -202,7 +225,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid, ...@@ -202,7 +225,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
bcmerror = bcm_iovar_lencheck(vi, arg, len, IOV_ISSET(actionid)); bcmerror = brcmu_iovar_lencheck(vi, arg, len, IOV_ISSET(actionid));
if (bcmerror != 0) if (bcmerror != 0)
goto exit; goto exit;
...@@ -316,7 +339,7 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt, ...@@ -316,7 +339,7 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
* exceeding total queue length * exceeding total queue length
*/ */
if (!pktq_pfull(q, prec) && !pktq_full(q)) { if (!pktq_pfull(q, prec) && !pktq_full(q)) {
bcm_pktq_penq(q, prec, pkt); brcmu_pktq_penq(q, prec, pkt);
return true; return true;
} }
...@@ -324,7 +347,7 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt, ...@@ -324,7 +347,7 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
if (pktq_pfull(q, prec)) if (pktq_pfull(q, prec))
eprec = prec; eprec = prec;
else if (pktq_full(q)) { else if (pktq_full(q)) {
p = bcm_pktq_peek_tail(q, &eprec); p = brcmu_pktq_peek_tail(q, &eprec);
ASSERT(p); ASSERT(p);
if (eprec > prec) if (eprec > prec)
return false; return false;
...@@ -338,21 +361,21 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt, ...@@ -338,21 +361,21 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
if (eprec == prec && !discard_oldest) if (eprec == prec && !discard_oldest)
return false; /* refuse newer (incoming) packet */ return false; /* refuse newer (incoming) packet */
/* Evict packet according to discard policy */ /* Evict packet according to discard policy */
p = discard_oldest ? bcm_pktq_pdeq(q, eprec) : p = discard_oldest ? brcmu_pktq_pdeq(q, eprec) :
bcm_pktq_pdeq_tail(q, eprec); brcmu_pktq_pdeq_tail(q, eprec);
if (p == NULL) { if (p == NULL) {
DHD_ERROR(("%s: bcm_pktq_penq() failed, oldest %d.", DHD_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.",
__func__, discard_oldest)); __func__, discard_oldest));
ASSERT(p); ASSERT(p);
} }
bcm_pkt_buf_free_skb(p); brcmu_pkt_buf_free_skb(p);
} }
/* Enqueue */ /* Enqueue */
p = bcm_pktq_penq(q, prec, pkt); p = brcmu_pktq_penq(q, prec, pkt);
if (p == NULL) { if (p == NULL) {
DHD_ERROR(("%s: bcm_pktq_penq() failed.", __func__)); DHD_ERROR(("%s: brcmu_pktq_penq() failed.", __func__));
ASSERT(p); ASSERT(p);
} }
...@@ -365,7 +388,7 @@ dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name, ...@@ -365,7 +388,7 @@ dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name,
{ {
int bcmerror = 0; int bcmerror = 0;
int val_size; int val_size;
const bcm_iovar_t *vi = NULL; const struct brcmu_iovar *vi = NULL;
u32 actionid; u32 actionid;
DHD_TRACE(("%s: Enter\n", __func__)); DHD_TRACE(("%s: Enter\n", __func__));
...@@ -379,7 +402,7 @@ dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name, ...@@ -379,7 +402,7 @@ dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name,
/* Set does NOT take qualifiers */ /* Set does NOT take qualifiers */
ASSERT(!set || (!params && !plen)); ASSERT(!set || (!params && !plen));
vi = bcm_iovar_lookup(dhd_iovars, name); vi = brcmu_iovar_lookup(dhd_iovars, name);
if (vi == NULL) { if (vi == NULL) {
bcmerror = -ENOTSUPP; bcmerror = -ENOTSUPP;
goto exit; goto exit;
...@@ -726,12 +749,12 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) ...@@ -726,12 +749,12 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
case WLC_E_TRACE: case WLC_E_TRACE:
{ {
static u32 seqnum_prev; static u32 seqnum_prev;
msgtrace_hdr_t hdr; struct msgtrace_hdr hdr;
u32 nblost; u32 nblost;
char *s, *p; char *s, *p;
buf = (unsigned char *) event_data; buf = (unsigned char *) event_data;
memcpy(&hdr, buf, MSGTRACE_HDRLEN); memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));
if (hdr.version != MSGTRACE_VERSION) { if (hdr.version != MSGTRACE_VERSION) {
DHD_ERROR( DHD_ERROR(
...@@ -745,7 +768,8 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) ...@@ -745,7 +768,8 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
} }
/* There are 2 bytes available at the end of data */ /* There are 2 bytes available at the end of data */
buf[MSGTRACE_HDRLEN + be16_to_cpu(hdr.len)] = '\0'; *(buf + sizeof(struct msgtrace_hdr)
+ be16_to_cpu(hdr.len)) = '\0';
if (be32_to_cpu(hdr.discarded_bytes) if (be32_to_cpu(hdr.discarded_bytes)
|| be32_to_cpu(hdr.discarded_printf)) { || be32_to_cpu(hdr.discarded_printf)) {
...@@ -768,7 +792,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) ...@@ -768,7 +792,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
* avoid display big * avoid display big
* printf (issue with Linux printk ) * printf (issue with Linux printk )
*/ */
p = (char *)&buf[MSGTRACE_HDRLEN]; p = (char *)&buf[sizeof(struct msgtrace_hdr)];
while ((s = strstr(p, "\n")) != NULL) { while ((s = strstr(p, "\n")) != NULL) {
*s = '\0'; *s = '\0';
printk(KERN_DEBUG"%s\n", p); printk(KERN_DEBUG"%s\n", p);
...@@ -989,7 +1013,7 @@ dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable, ...@@ -989,7 +1013,7 @@ dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
__func__, arg)); __func__, arg));
/* Contorl the master mode */ /* Contorl the master mode */
bcm_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf, brcmu_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf,
sizeof(buf)); sizeof(buf));
rc = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf)); rc = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
rc = rc >= 0 ? 0 : rc; rc = rc >= 0 ? 0 : rc;
...@@ -1143,7 +1167,7 @@ void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode) ...@@ -1143,7 +1167,7 @@ void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
char iovbuf[32]; char iovbuf[32];
int retcode; int retcode;
bcm_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf)); brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode; retcode = retcode >= 0 ? 0 : retcode;
if (retcode) if (retcode)
...@@ -1159,7 +1183,7 @@ void dhd_arp_offload_enable(dhd_pub_t *dhd, int arp_enable) ...@@ -1159,7 +1183,7 @@ void dhd_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
char iovbuf[32]; char iovbuf[32];
int retcode; int retcode;
bcm_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf)); brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode; retcode = retcode >= 0 ? 0 : retcode;
if (retcode) if (retcode)
...@@ -1198,7 +1222,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd) ...@@ -1198,7 +1222,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
*/ */
ret = dhd_custom_get_mac_address(ea_addr); ret = dhd_custom_get_mac_address(ea_addr);
if (!ret) { if (!ret) {
bcm_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN, brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
buf, sizeof(buf)); buf, sizeof(buf));
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf)); ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
if (ret < 0) { if (ret < 0) {
...@@ -1223,7 +1247,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd) ...@@ -1223,7 +1247,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
/* query for 'ver' to get version info from firmware */ /* query for 'ver' to get version info from firmware */
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
ptr = buf; ptr = buf;
bcm_mkiovar("ver", 0, 0, buf, sizeof(buf)); brcmu_mkiovar("ver", 0, 0, buf, sizeof(buf));
dhdcdc_query_ioctl(dhd, 0, WLC_GET_VAR, buf, sizeof(buf)); dhdcdc_query_ioctl(dhd, 0, WLC_GET_VAR, buf, sizeof(buf));
strsep(&ptr, "\n"); strsep(&ptr, "\n");
/* Print fw version info */ /* Print fw version info */
...@@ -1234,23 +1258,23 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd) ...@@ -1234,23 +1258,23 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
sizeof(power_mode)); sizeof(power_mode));
/* Match Host and Dongle rx alignment */ /* Match Host and Dongle rx alignment */
bcm_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf, brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
/* disable glom option per default */ /* disable glom option per default */
bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf)); brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
/* Setup timeout if Beacons are lost and roam is off to report /* Setup timeout if Beacons are lost and roam is off to report
link down */ link down */
bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
/* Enable/Disable build-in roaming to allowed ext supplicant to take /* Enable/Disable build-in roaming to allowed ext supplicant to take
of romaing */ of romaing */
bcm_mkiovar("roam_off", (char *)&dhd_roam, 4, iovbuf, sizeof(iovbuf)); brcmu_mkiovar("roam_off", (char *)&dhd_roam, 4, iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
/* Force STA UP */ /* Force STA UP */
...@@ -1258,8 +1282,8 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd) ...@@ -1258,8 +1282,8 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
dhdcdc_set_ioctl(dhd, 0, WLC_UP, (char *)&up, sizeof(up)); dhdcdc_set_ioctl(dhd, 0, WLC_UP, (char *)&up, sizeof(up));
/* Setup event_msgs */ /* Setup event_msgs */
bcm_mkiovar("event_msgs", dhd->eventmask, WL_EVENTING_MASK_LEN, iovbuf, brcmu_mkiovar("event_msgs", dhd->eventmask, WL_EVENTING_MASK_LEN,
sizeof(iovbuf)); iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_SCAN_CHANNEL_TIME, dhdcdc_set_ioctl(dhd, 0, WLC_SET_SCAN_CHANNEL_TIME,
...@@ -1623,7 +1647,7 @@ int dhd_iscan_request(void *dhdp, u16 action) ...@@ -1623,7 +1647,7 @@ int dhd_iscan_request(void *dhdp, u16 action)
params.action = action; params.action = action;
params.scan_duration = 0; params.scan_duration = 0;
bcm_mkiovar("iscan", (char *)&params, sizeof(wl_iscan_params_t), buf, brcmu_mkiovar("iscan", (char *)&params, sizeof(wl_iscan_params_t), buf,
WLC_IOCTL_SMLEN); WLC_IOCTL_SMLEN);
rc = dhd_wl_ioctl(dhdp, WLC_SET_VAR, buf, WLC_IOCTL_SMLEN); rc = dhd_wl_ioctl(dhdp, WLC_SET_VAR, buf, WLC_IOCTL_SMLEN);
...@@ -1659,8 +1683,9 @@ static int dhd_iscan_get_partial_result(void *dhdp, uint *scan_count) ...@@ -1659,8 +1683,9 @@ static int dhd_iscan_get_partial_result(void *dhdp, uint *scan_count)
memset(&list, 0, sizeof(list)); memset(&list, 0, sizeof(list));
list.results.buflen = WLC_IW_ISCAN_MAXLEN; list.results.buflen = WLC_IW_ISCAN_MAXLEN;
bcm_mkiovar("iscanresults", (char *)&list, WL_ISCAN_RESULTS_FIXED_SIZE, brcmu_mkiovar("iscanresults", (char *)&list,
iscan_cur->iscan_buf, WLC_IW_ISCAN_MAXLEN); WL_ISCAN_RESULTS_FIXED_SIZE,
iscan_cur->iscan_buf, WLC_IW_ISCAN_MAXLEN);
rc = dhd_wl_ioctl(dhdp, WLC_GET_VAR, iscan_cur->iscan_buf, rc = dhd_wl_ioctl(dhdp, WLC_GET_VAR, iscan_cur->iscan_buf,
WLC_IW_ISCAN_MAXLEN); WLC_IW_ISCAN_MAXLEN);
...@@ -1690,12 +1715,13 @@ int dhd_pno_clean(dhd_pub_t *dhd) ...@@ -1690,12 +1715,13 @@ int dhd_pno_clean(dhd_pub_t *dhd)
int ret; int ret;
/* Disable pfn */ /* Disable pfn */
iov_len = iov_len = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf, sizeof(iovbuf)); sizeof(iovbuf));
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (ret >= 0) { if (ret >= 0) {
/* clear pfn */ /* clear pfn */
iov_len = bcm_mkiovar("pfnclear", 0, 0, iovbuf, sizeof(iovbuf)); iov_len = brcmu_mkiovar("pfnclear", 0, 0, iovbuf,
sizeof(iovbuf));
if (iov_len) { if (iov_len) {
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
iov_len); iov_len);
...@@ -1724,7 +1750,7 @@ int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled) ...@@ -1724,7 +1750,7 @@ int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled)
} }
/* Enable/disable PNO */ /* Enable/disable PNO */
ret = bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf, ret = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
if (ret > 0) { if (ret > 0) {
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
...@@ -1797,7 +1823,7 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc ...@@ -1797,7 +1823,7 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc
if (scan_fr != 0) if (scan_fr != 0)
pfn_param.scan_freq = scan_fr; pfn_param.scan_freq = scan_fr;
bcm_mkiovar("pfn_set", (char *)&pfn_param, sizeof(pfn_param), iovbuf, brcmu_mkiovar("pfn_set", (char *)&pfn_param, sizeof(pfn_param), iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
...@@ -1814,7 +1840,7 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc ...@@ -1814,7 +1840,7 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc
ssids_local[i].SSID_len); ssids_local[i].SSID_len);
pfn_element.ssid.SSID_len = ssids_local[i].SSID_len; pfn_element.ssid.SSID_len = ssids_local[i].SSID_len;
err = bcm_mkiovar("pfn_add", (char *)&pfn_element, err = brcmu_mkiovar("pfn_add", (char *)&pfn_element,
sizeof(pfn_element), iovbuf, sizeof(iovbuf)); sizeof(pfn_element), iovbuf, sizeof(iovbuf));
if (err > 0) { if (err > 0) {
err = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, err = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
*/ */
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <bcmutils.h> #include <linux/sched.h>
#include <brcmu_utils.h>
#include <defs.h>
#include <brcmu_wifi.h>
#include <dngl_stats.h> #include <dngl_stats.h>
#include <dhd.h> #include <dhd.h>
#include <wlioctl.h>
#include <wl_iw.h>
#define WL_ERROR(fmt, args...) printk(fmt, ##args) #define WL_ERROR(fmt, args...) printk(fmt, ##args)
#define WL_TRACE(fmt, args...) no_printk(fmt, ##args) #define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
......
...@@ -97,7 +97,4 @@ ...@@ -97,7 +97,4 @@
#define DHD_NONE(args) #define DHD_NONE(args)
extern int dhd_msg_level; extern int dhd_msg_level;
/* Defines msg bits */
#include <dhdioctl.h>
#endif /* _dhd_dbg_ */ #endif /* _dhd_dbg_ */
...@@ -31,8 +31,10 @@ ...@@ -31,8 +31,10 @@
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <bcmdefs.h> #include <net/cfg80211.h>
#include <bcmutils.h> #include <defs.h>
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include <dngl_stats.h> #include <dngl_stats.h>
#include <dhd.h> #include <dhd.h>
...@@ -483,7 +485,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd) ...@@ -483,7 +485,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
bcn_li_dtim = 3; bcn_li_dtim = 3;
else else
bcn_li_dtim = dhd->dtim_skip; bcn_li_dtim = dhd->dtim_skip;
bcm_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim, brcmu_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim,
4, iovbuf, sizeof(iovbuf)); 4, iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
...@@ -491,7 +493,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd) ...@@ -491,7 +493,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
/* Disable build-in roaming to allowed \ /* Disable build-in roaming to allowed \
* supplicant to take of romaing * supplicant to take of romaing
*/ */
bcm_mkiovar("roam_off", (char *)&roamvar, 4, brcmu_mkiovar("roam_off", (char *)&roamvar, 4,
iovbuf, sizeof(iovbuf)); iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
...@@ -511,14 +513,14 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd) ...@@ -511,14 +513,14 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
dhd_set_packet_filter(0, dhd); dhd_set_packet_filter(0, dhd);
/* restore pre-suspend setting for dtim_skip */ /* restore pre-suspend setting for dtim_skip */
bcm_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip, brcmu_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
4, iovbuf, sizeof(iovbuf)); 4, iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
#ifdef CUSTOMER_HW2 #ifdef CUSTOMER_HW2
roamvar = 0; roamvar = 0;
bcm_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf, brcmu_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
...@@ -748,7 +750,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx) ...@@ -748,7 +750,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
} }
allmulti = cpu_to_le32(allmulti); allmulti = cpu_to_le32(allmulti);
if (!bcm_mkiovar if (!brcmu_mkiovar
("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) { ("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d " DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
"buflen %u\n", dhd_ifname(&dhd->pub, ifidx), "buflen %u\n", dhd_ifname(&dhd->pub, ifidx),
...@@ -800,7 +802,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr) ...@@ -800,7 +802,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
int ret; int ret;
DHD_TRACE(("%s enter\n", __func__)); DHD_TRACE(("%s enter\n", __func__));
if (!bcm_mkiovar if (!brcmu_mkiovar
("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) { ("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) {
DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n", DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
dhd_ifname(&dhd->pub, ifidx))); dhd_ifname(&dhd->pub, ifidx)));
...@@ -2089,8 +2091,8 @@ int dhd_bus_start(dhd_pub_t *dhdp) ...@@ -2089,8 +2091,8 @@ int dhd_bus_start(dhd_pub_t *dhdp)
return -ENODEV; return -ENODEV;
} }
#ifdef EMBEDDED_PLATFORM #ifdef EMBEDDED_PLATFORM
bcm_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN, iovbuf, brcmu_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN,
sizeof(iovbuf)); iovbuf, sizeof(iovbuf));
dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf)); dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN); memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
...@@ -2140,7 +2142,7 @@ dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len, ...@@ -2140,7 +2142,7 @@ dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
wl_ioctl_t ioc; wl_ioctl_t ioc;
int ret; int ret;
len = bcm_mkiovar(name, cmd_buf, cmd_len, buf, len); len = brcmu_mkiovar(name, cmd_buf, cmd_len, buf, len);
memset(&ioc, 0, sizeof(ioc)); memset(&ioc, 0, sizeof(ioc));
......
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#ifndef _dhd_proto_h_ #ifndef _dhd_proto_h_
#define _dhd_proto_h_ #define _dhd_proto_h_
#include <dhdioctl.h>
#include <wlioctl.h>
#ifndef IOCTL_RESP_TIMEOUT #ifndef IOCTL_RESP_TIMEOUT
#define IOCTL_RESP_TIMEOUT 2000 /* In milli second */ #define IOCTL_RESP_TIMEOUT 2000 /* In milli second */
#endif #endif
...@@ -64,7 +61,7 @@ extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name, ...@@ -64,7 +61,7 @@ extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
bool set); bool set);
/* Add prot dump output to a buffer */ /* Add prot dump output to a buffer */
extern void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf); extern void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
/* Update local copy of dongle statistics */ /* Update local copy of dongle statistics */
extern void dhd_prot_dstats(dhd_pub_t *dhdp); extern void dhd_prot_dstats(dhd_pub_t *dhdp);
......
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _dhdioctl_h_
#define _dhdioctl_h_
/* Linux network driver ioctl encoding */
typedef struct dhd_ioctl {
uint cmd; /* common ioctl definition */
void *buf; /* pointer to user buffer */
uint len; /* length of user buffer */
bool set; /* get or set request (optional) */
uint used; /* bytes read or written (optional) */
uint needed; /* bytes needed (optional) */
uint driver; /* to identify target driver */
} dhd_ioctl_t;
/* per-driver magic numbers */
#define DHD_IOCTL_MAGIC 0x00444944
/* bump this number if you change the ioctl interface */
#define DHD_IOCTL_VERSION 1
#define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
#define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
/* common ioctl definitions */
#define DHD_GET_MAGIC 0
#define DHD_GET_VERSION 1
#define DHD_GET_VAR 2
#define DHD_SET_VAR 3
/* message levels */
#define DHD_ERROR_VAL 0x0001
#define DHD_TRACE_VAL 0x0002
#define DHD_INFO_VAL 0x0004
#define DHD_DATA_VAL 0x0008
#define DHD_CTL_VAL 0x0010
#define DHD_TIMER_VAL 0x0020
#define DHD_HDRS_VAL 0x0040
#define DHD_BYTES_VAL 0x0080
#define DHD_INTR_VAL 0x0100
#define DHD_LOG_VAL 0x0200
#define DHD_GLOM_VAL 0x0400
#define DHD_EVENT_VAL 0x0800
#define DHD_BTA_VAL 0x1000
#define DHD_ISCAN_VAL 0x2000
#ifdef SDTEST
/* For pktgen iovar */
typedef struct dhd_pktgen {
uint version; /* To allow structure change tracking */
uint freq; /* Max ticks between tx/rx attempts */
uint count; /* Test packets to send/rcv each attempt */
uint print; /* Print counts every <print> attempts */
uint total; /* Total packets (or bursts) */
uint minlen; /* Minimum length of packets to send */
uint maxlen; /* Maximum length of packets to send */
uint numsent; /* Count of test packets sent */
uint numrcvd; /* Count of test packets received */
uint numfail; /* Count of test send failures */
uint mode; /* Test mode (type of test packets) */
uint stop; /* Stop after this many tx failures */
} dhd_pktgen_t;
/* Version in case structure changes */
#define DHD_PKTGEN_VERSION 2
/* Type of test packets to use */
#define DHD_PKTGEN_ECHO 1 /* Send echo requests */
#define DHD_PKTGEN_SEND 2 /* Send discard packets */
#define DHD_PKTGEN_RXBURST 3 /* Request dongle send N packets */
#define DHD_PKTGEN_RECV 4 /* Continuous rx from continuous
tx dongle */
#endif /* SDTEST */
/* Enter idle immediately (no timeout) */
#define DHD_IDLE_IMMEDIATE (-1)
/* Values for idleclock iovar: other values are the sd_divisor to use
when idle */
#define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change
when idle */
#define DHD_IDLE_STOP (-1) /* Request SD clock be stopped
(and use SD1 mode) */
#endif /* _dhdioctl_h_ */
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _hndrte_armtrap_h
#define _hndrte_armtrap_h
/* ARM trap handling */
/* Trap types defined by ARM (see arminc.h) */
/* Trap locations in lo memory */
#define TRAP_STRIDE 4
#define FIRST_TRAP TR_RST
#define LAST_TRAP (TR_FIQ * TRAP_STRIDE)
#if defined(__ARM_ARCH_4T__)
#define MAX_TRAP_TYPE (TR_FIQ + 1)
#elif defined(__ARM_ARCH_7M__)
#define MAX_TRAP_TYPE (TR_ISR + ARMCM3_NUMINTS)
#endif /* __ARM_ARCH_7M__ */
/* The trap structure is defined here as offsets for assembly */
#define TR_TYPE 0x00
#define TR_EPC 0x04
#define TR_CPSR 0x08
#define TR_SPSR 0x0c
#define TR_REGS 0x10
#define TR_REG(n) (TR_REGS + (n) * 4)
#define TR_SP TR_REG(13)
#define TR_LR TR_REG(14)
#define TR_PC TR_REG(15)
#define TRAP_T_SIZE 80
#ifndef _LANGUAGE_ASSEMBLY
typedef struct _trap_struct {
u32 type;
u32 epc;
u32 cpsr;
u32 spsr;
u32 r0;
u32 r1;
u32 r2;
u32 r3;
u32 r4;
u32 r5;
u32 r6;
u32 r7;
u32 r8;
u32 r9;
u32 r10;
u32 r11;
u32 r12;
u32 r13;
u32 r14;
u32 pc;
} trap_t;
#endif /* !_LANGUAGE_ASSEMBLY */
#endif /* _hndrte_armtrap_h */
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _hndrte_cons_h
#define _hndrte_cons_h
#define CBUF_LEN (128)
#define LOG_BUF_LEN 1024
typedef struct {
u32 buf; /* Can't be pointer on (64-bit) hosts */
uint buf_size;
uint idx;
char *_buf_compat; /* Redundant pointer for backward compat. */
} hndrte_log_t;
typedef struct {
/* Virtual UART
* When there is no UART (e.g. Quickturn),
* the host should write a complete
* input line directly into cbuf and then write
* the length into vcons_in.
* This may also be used when there is a real UART
* (at risk of conflicting with
* the real UART). vcons_out is currently unused.
*/
volatile uint vcons_in;
volatile uint vcons_out;
/* Output (logging) buffer
* Console output is written to a ring buffer log_buf at index log_idx.
* The host may read the output when it sees log_idx advance.
* Output will be lost if the output wraps around faster than the host
* polls.
*/
hndrte_log_t log;
/* Console input line buffer
* Characters are read one at a time into cbuf
* until <CR> is received, then
* the buffer is processed as a command line.
* Also used for virtual UART.
*/
uint cbuf_idx;
char cbuf[CBUF_LEN];
} hndrte_cons_t;
#endif /* _hndrte_cons_h */
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _MSGTRACE_H
#define _MSGTRACE_H
#define MSGTRACE_VERSION 1
/* Message trace header */
typedef struct msgtrace_hdr {
u8 version;
u8 spare;
u16 len; /* Len of the trace */
u32 seqnum; /* Sequence number of message. Useful
* if the messsage has been lost
* because of DMA error or a bus reset
* (ex: SDIO Func2)
*/
u32 discarded_bytes; /* Number of discarded bytes because of
trace overflow */
u32 discarded_printf; /* Number of discarded printf
because of trace overflow */
} __attribute__((packed)) msgtrace_hdr_t;
#define MSGTRACE_HDRLEN sizeof(msgtrace_hdr_t)
/* The hbus driver generates traces when sending a trace message.
* This causes endless traces.
* This flag must be set to true in any hbus traces.
* The flag is reset in the function msgtrace_put.
* This prevents endless traces but generates hasardous
* lost of traces only in bus device code.
* It is recommendat to set this flag in macro SD_TRACE
* but not in SD_ERROR for avoiding missing
* hbus error traces. hbus error trace should not generates endless traces.
*/
extern bool msgtrace_hbus_trace;
typedef void (*msgtrace_func_send_t) (void *hdl1, void *hdl2, u8 *hdr,
u16 hdrlen, u8 *buf,
u16 buflen);
extern void msgtrace_sent(void);
extern void msgtrace_put(char *buf, int count);
extern void msgtrace_init(void *hdl1, void *hdl2,
msgtrace_func_send_t func_send);
#endif /* _MSGTRACE_H */
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/* PCI configuration address space size */ /* PCI configuration address space size */
#define PCI_SZPCR 256 #define PCI_SZPCR 256
/* Everything below is BRCM HND proprietary */ /* Everything below is Broadcom specific */
/* Brcm PCI configuration registers */ /* Brcm PCI configuration registers */
#define PCI_BAR0_WIN 0x80 /* backplane address space accessed by BAR0 */ #define PCI_BAR0_WIN 0x80 /* backplane address space accessed by BAR0 */
......
...@@ -149,4 +149,225 @@ ...@@ -149,4 +149,225 @@
#define SBSDIO_CORE_ADDR_MASK 0x1FFFF /* sdio core function one address mask */ #define SBSDIO_CORE_ADDR_MASK 0x1FFFF /* sdio core function one address mask */
/* corecontrol */
#define CC_CISRDY (1 << 0) /* CIS Ready */
#define CC_BPRESEN (1 << 1) /* CCCR RES signal */
#define CC_F2RDY (1 << 2) /* set CCCR IOR2 bit */
#define CC_CLRPADSISO (1 << 3) /* clear SDIO pads isolation */
#define CC_XMTDATAAVAIL_MODE (1 << 4)
#define CC_XMTDATAAVAIL_CTRL (1 << 5)
/* corestatus */
#define CS_PCMCIAMODE (1 << 0) /* Device Mode; 0=SDIO, 1=PCMCIA */
#define CS_SMARTDEV (1 << 1) /* 1=smartDev enabled */
#define CS_F2ENABLED (1 << 2) /* 1=host has enabled the device */
#define PCMCIA_MES_PA_MASK 0x7fff /* PCMCIA Message Portal Address Mask */
#define PCMCIA_MES_PM_MASK 0x7fff /* PCMCIA Message Portal Mask Mask */
#define PCMCIA_WFBC_MASK 0xffff /* PCMCIA Write Frame Byte Count Mask */
#define PCMCIA_UT_MASK 0x07ff /* PCMCIA Underflow Timer Mask */
/* intstatus */
#define I_SMB_SW0 (1 << 0) /* To SB Mail S/W interrupt 0 */
#define I_SMB_SW1 (1 << 1) /* To SB Mail S/W interrupt 1 */
#define I_SMB_SW2 (1 << 2) /* To SB Mail S/W interrupt 2 */
#define I_SMB_SW3 (1 << 3) /* To SB Mail S/W interrupt 3 */
#define I_SMB_SW_MASK 0x0000000f /* To SB Mail S/W interrupts mask */
#define I_SMB_SW_SHIFT 0 /* To SB Mail S/W interrupts shift */
#define I_HMB_SW0 (1 << 4) /* To Host Mail S/W interrupt 0 */
#define I_HMB_SW1 (1 << 5) /* To Host Mail S/W interrupt 1 */
#define I_HMB_SW2 (1 << 6) /* To Host Mail S/W interrupt 2 */
#define I_HMB_SW3 (1 << 7) /* To Host Mail S/W interrupt 3 */
#define I_HMB_SW_MASK 0x000000f0 /* To Host Mail S/W interrupts mask */
#define I_HMB_SW_SHIFT 4 /* To Host Mail S/W interrupts shift */
#define I_WR_OOSYNC (1 << 8) /* Write Frame Out Of Sync */
#define I_RD_OOSYNC (1 << 9) /* Read Frame Out Of Sync */
#define I_PC (1 << 10) /* descriptor error */
#define I_PD (1 << 11) /* data error */
#define I_DE (1 << 12) /* Descriptor protocol Error */
#define I_RU (1 << 13) /* Receive descriptor Underflow */
#define I_RO (1 << 14) /* Receive fifo Overflow */
#define I_XU (1 << 15) /* Transmit fifo Underflow */
#define I_RI (1 << 16) /* Receive Interrupt */
#define I_BUSPWR (1 << 17) /* SDIO Bus Power Change (rev 9) */
#define I_XMTDATA_AVAIL (1 << 23) /* bits in fifo */
#define I_XI (1 << 24) /* Transmit Interrupt */
#define I_RF_TERM (1 << 25) /* Read Frame Terminate */
#define I_WF_TERM (1 << 26) /* Write Frame Terminate */
#define I_PCMCIA_XU (1 << 27) /* PCMCIA Transmit FIFO Underflow */
#define I_SBINT (1 << 28) /* sbintstatus Interrupt */
#define I_CHIPACTIVE (1 << 29) /* chip from doze to active state */
#define I_SRESET (1 << 30) /* CCCR RES interrupt */
#define I_IOE2 (1U << 31) /* CCCR IOE2 Bit Changed */
#define I_ERRORS (I_PC | I_PD | I_DE | I_RU | I_RO | I_XU)
#define I_DMA (I_RI | I_XI | I_ERRORS)
/* sbintstatus */
#define I_SB_SERR (1 << 8) /* Backplane SError (write) */
#define I_SB_RESPERR (1 << 9) /* Backplane Response Error (read) */
#define I_SB_SPROMERR (1 << 10) /* Error accessing the sprom */
/* sdioaccess */
#define SDA_DATA_MASK 0x000000ff /* Read/Write Data Mask */
#define SDA_ADDR_MASK 0x000fff00 /* Read/Write Address Mask */
#define SDA_ADDR_SHIFT 8 /* Read/Write Address Shift */
#define SDA_WRITE 0x01000000 /* Write bit */
#define SDA_READ 0x00000000 /* Write bit cleared for Read */
#define SDA_BUSY 0x80000000 /* Busy bit */
/* sdioaccess-accessible register address spaces */
#define SDA_CCCR_SPACE 0x000 /* CCCR register space */
#define SDA_F1_FBR_SPACE 0x100 /* F1 FBR register space */
#define SDA_F2_FBR_SPACE 0x200 /* F2 FBR register space */
#define SDA_F1_REG_SPACE 0x300 /* F1 core-specific register space */
/* SDA_F1_REG_SPACE sdioaccess-accessible F1 reg space register offsets */
#define SDA_CHIPCONTROLDATA 0x006 /* ChipControlData */
#define SDA_CHIPCONTROLENAB 0x007 /* ChipControlEnable */
#define SDA_F2WATERMARK 0x008 /* Function 2 Watermark */
#define SDA_DEVICECONTROL 0x009 /* DeviceControl */
#define SDA_SBADDRLOW 0x00a /* SbAddrLow */
#define SDA_SBADDRMID 0x00b /* SbAddrMid */
#define SDA_SBADDRHIGH 0x00c /* SbAddrHigh */
#define SDA_FRAMECTRL 0x00d /* FrameCtrl */
#define SDA_CHIPCLOCKCSR 0x00e /* ChipClockCSR */
#define SDA_SDIOPULLUP 0x00f /* SdioPullUp */
#define SDA_SDIOWRFRAMEBCLOW 0x019 /* SdioWrFrameBCLow */
#define SDA_SDIOWRFRAMEBCHIGH 0x01a /* SdioWrFrameBCHigh */
#define SDA_SDIORDFRAMEBCLOW 0x01b /* SdioRdFrameBCLow */
#define SDA_SDIORDFRAMEBCHIGH 0x01c /* SdioRdFrameBCHigh */
/* SDA_F2WATERMARK */
#define SDA_F2WATERMARK_MASK 0x7f /* F2Watermark Mask */
/* SDA_SBADDRLOW */
#define SDA_SBADDRLOW_MASK 0x80 /* SbAddrLow Mask */
/* SDA_SBADDRMID */
#define SDA_SBADDRMID_MASK 0xff /* SbAddrMid Mask */
/* SDA_SBADDRHIGH */
#define SDA_SBADDRHIGH_MASK 0xff /* SbAddrHigh Mask */
/* SDA_FRAMECTRL */
#define SFC_RF_TERM (1 << 0) /* Read Frame Terminate */
#define SFC_WF_TERM (1 << 1) /* Write Frame Terminate */
#define SFC_CRC4WOOS (1 << 2) /* CRC error for write out of sync */
#define SFC_ABORTALL (1 << 3) /* Abort all in-progress frames */
/* pcmciaframectrl */
#define PFC_RF_TERM (1 << 0) /* Read Frame Terminate */
#define PFC_WF_TERM (1 << 1) /* Write Frame Terminate */
/* intrcvlazy */
#define IRL_TO_MASK 0x00ffffff /* timeout */
#define IRL_FC_MASK 0xff000000 /* frame count */
#define IRL_FC_SHIFT 24 /* frame count */
/* rx header flags */
#define RXF_CRC 0x0001 /* CRC error detected */
#define RXF_WOOS 0x0002 /* write frame out of sync */
#define RXF_WF_TERM 0x0004 /* write frame terminated */
#define RXF_ABORT 0x0008 /* write frame aborted */
#define RXF_DISCARD (RXF_CRC | RXF_WOOS | RXF_WF_TERM | RXF_ABORT)
/* HW frame tag */
#define SDPCM_FRAMETAG_LEN 4 /* 2 bytes len, 2 bytes check val */
/* cpp contortions to concatenate w/arg prescan */
#ifndef PAD
#define _PADLINE(line) pad ## line
#define _XSTR(line) _PADLINE(line)
#define PAD _XSTR(__LINE__)
#endif /* PAD */
/* core registers */
struct sdpcmd_regs {
u32 corecontrol; /* 0x00, rev8 */
u32 corestatus; /* rev8 */
u32 PAD[1];
u32 biststatus; /* rev8 */
/* PCMCIA access */
u16 pcmciamesportaladdr; /* 0x010, rev8 */
u16 PAD[1];
u16 pcmciamesportalmask; /* rev8 */
u16 PAD[1];
u16 pcmciawrframebc; /* rev8 */
u16 PAD[1];
u16 pcmciaunderflowtimer; /* rev8 */
u16 PAD[1];
/* interrupt */
u32 intstatus; /* 0x020, rev8 */
u32 hostintmask; /* rev8 */
u32 intmask; /* rev8 */
u32 sbintstatus; /* rev8 */
u32 sbintmask; /* rev8 */
u32 funcintmask; /* rev4 */
u32 PAD[2];
u32 tosbmailbox; /* 0x040, rev8 */
u32 tohostmailbox; /* rev8 */
u32 tosbmailboxdata; /* rev8 */
u32 tohostmailboxdata; /* rev8 */
/* synchronized access to registers in SDIO clock domain */
u32 sdioaccess; /* 0x050, rev8 */
u32 PAD[3];
/* PCMCIA frame control */
u8 pcmciaframectrl; /* 0x060, rev8 */
u8 PAD[3];
u8 pcmciawatermark; /* rev8 */
u8 PAD[155];
/* interrupt batching control */
u32 intrcvlazy; /* 0x100, rev8 */
u32 PAD[3];
/* counters */
u32 cmd52rd; /* 0x110, rev8 */
u32 cmd52wr; /* rev8 */
u32 cmd53rd; /* rev8 */
u32 cmd53wr; /* rev8 */
u32 abort; /* rev8 */
u32 datacrcerror; /* rev8 */
u32 rdoutofsync; /* rev8 */
u32 wroutofsync; /* rev8 */
u32 writebusy; /* rev8 */
u32 readwait; /* rev8 */
u32 readterm; /* rev8 */
u32 writeterm; /* rev8 */
u32 PAD[40];
u32 clockctlstatus; /* rev8 */
u32 PAD[7];
u32 PAD[128]; /* DMA engines */
/* SDIO/PCMCIA CIS region */
char cis[512]; /* 0x400-0x5ff, rev6 */
/* PCMCIA function control registers */
char pcmciafcr[256]; /* 0x600-6ff, rev6 */
u16 PAD[55];
/* PCMCIA backplane access */
u16 backplanecsr; /* 0x76E, rev6 */
u16 backplaneaddr0; /* rev6 */
u16 backplaneaddr1; /* rev6 */
u16 backplaneaddr2; /* rev6 */
u16 backplaneaddr3; /* rev6 */
u16 backplanedata0; /* rev6 */
u16 backplanedata1; /* rev6 */
u16 backplanedata2; /* rev6 */
u16 backplanedata3; /* rev6 */
u16 PAD[31];
/* sprom "size" & "blank" info */
u16 spromstatus; /* 0x7BE, rev2 */
u32 PAD[464];
u16 PAD[0x80];
};
#endif /* _SBSDIO_H */ #endif /* _SBSDIO_H */
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _bcmsdh_h_ #ifndef _BRCM_SDH_H_
#define _bcmsdh_h_ #define _BRCM_SDH_H_
#include <linux/skbuff.h> #include <linux/skbuff.h>
#define BCMSDH_ERROR_VAL 0x0001 /* Error */ #define BCMSDH_ERROR_VAL 0x0001 /* Error */
...@@ -38,6 +38,27 @@ extern const uint bcmsdh_msglevel; ...@@ -38,6 +38,27 @@ extern const uint bcmsdh_msglevel;
#define BCMSDH_INFO(x) #define BCMSDH_INFO(x)
#endif /* BCMDBG */ #endif /* BCMDBG */
#define SDIO_FUNC_0 0
#define SDIO_FUNC_1 1
#define SDIO_FUNC_2 2
#define SDIOD_FBR_SIZE 0x100
/* io_en */
#define SDIO_FUNC_ENABLE_1 0x02
#define SDIO_FUNC_ENABLE_2 0x04
/* io_rdys */
#define SDIO_FUNC_READY_1 0x02
#define SDIO_FUNC_READY_2 0x04
/* intr_status */
#define INTR_STATUS_FUNC1 0x2
#define INTR_STATUS_FUNC2 0x4
/* Maximum number of I/O funcs */
#define SDIOD_MAX_IOFUNCS 7
/* forward declarations */ /* forward declarations */
typedef struct bcmsdh_info bcmsdh_info_t; typedef struct bcmsdh_info bcmsdh_info_t;
typedef void (*bcmsdh_cb_fn_t) (void *); typedef void (*bcmsdh_cb_fn_t) (void *);
...@@ -202,4 +223,4 @@ extern u32 bcmsdh_cur_sbwad(void *sdh); ...@@ -202,4 +223,4 @@ extern u32 bcmsdh_cur_sbwad(void *sdh);
/* Function to pass chipid and rev to lower layers for controlling pr's */ /* Function to pass chipid and rev to lower layers for controlling pr's */
extern void bcmsdh_chipinfo(void *sdh, u32 chip, u32 chiprev); extern void bcmsdh_chipinfo(void *sdh, u32 chip, u32 chiprev);
#endif /* _bcmsdh_h_ */ #endif /* _BRCM_SDH_H_ */
/*
* Copyright (c) 2010 Broadcom Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _SDIOH_H
#define _SDIOH_H
#define SD_SysAddr 0x000
#define SD_BlockSize 0x004
#define SD_BlockCount 0x006
#define SD_Arg0 0x008
#define SD_Arg1 0x00A
#define SD_TransferMode 0x00C
#define SD_Command 0x00E
#define SD_Response0 0x010
#define SD_Response1 0x012
#define SD_Response2 0x014
#define SD_Response3 0x016
#define SD_Response4 0x018
#define SD_Response5 0x01A
#define SD_Response6 0x01C
#define SD_Response7 0x01E
#define SD_BufferDataPort0 0x020
#define SD_BufferDataPort1 0x022
#define SD_PresentState 0x024
#define SD_HostCntrl 0x028
#define SD_PwrCntrl 0x029
#define SD_BlockGapCntrl 0x02A
#define SD_WakeupCntrl 0x02B
#define SD_ClockCntrl 0x02C
#define SD_TimeoutCntrl 0x02E
#define SD_SoftwareReset 0x02F
#define SD_IntrStatus 0x030
#define SD_ErrorIntrStatus 0x032
#define SD_IntrStatusEnable 0x034
#define SD_ErrorIntrStatusEnable 0x036
#define SD_IntrSignalEnable 0x038
#define SD_ErrorIntrSignalEnable 0x03A
#define SD_CMD12ErrorStatus 0x03C
#define SD_Capabilities 0x040
#define SD_Capabilities_Reserved 0x044
#define SD_MaxCurCap 0x048
#define SD_MaxCurCap_Reserved 0x04C
#define SD_ADMA_SysAddr 0x58
#define SD_SlotInterruptStatus 0x0FC
#define SD_HostControllerVersion 0x0FE
/* SD specific registers in PCI config space */
#define SD_SlotInfo 0x40
#endif /* _SDIOH_H */
...@@ -16,15 +16,16 @@ ...@@ -16,15 +16,16 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/sched.h>
#include <bcmutils.h> #include <brcmu_utils.h>
#include <defs.h>
#include <brcmu_wifi.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <dngl_stats.h> #include <dngl_stats.h>
#include <dhd.h> #include <dhd.h>
#include <dhdioctl.h>
#include <wlioctl.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -45,7 +46,7 @@ static struct sdio_func *cfg80211_sdio_func; ...@@ -45,7 +46,7 @@ static struct sdio_func *cfg80211_sdio_func;
static struct wl_dev *wl_cfg80211_dev; static struct wl_dev *wl_cfg80211_dev;
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255}; static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
u32 wl_dbg_level = WL_DBG_ERR; u32 brcmf_dbg_level = WL_DBG_ERR;
#define WL_4329_FW_FILE "brcm/bcm4329-fullmac-4.bin" #define WL_4329_FW_FILE "brcm/bcm4329-fullmac-4.bin"
#define WL_4329_NVRAM_FILE "brcm/bcm4329-fullmac-4.txt" #define WL_4329_NVRAM_FILE "brcm/bcm4329-fullmac-4.txt"
...@@ -643,7 +644,7 @@ wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param, ...@@ -643,7 +644,7 @@ wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
{ {
s32 iolen; s32 iolen;
iolen = bcm_mkiovar(iovar, param, paramlen, bufptr, buflen); iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen); BUG_ON(!iolen);
return wl_dev_ioctl(dev, WLC_SET_VAR, bufptr, iolen); return wl_dev_ioctl(dev, WLC_SET_VAR, bufptr, iolen);
...@@ -655,7 +656,7 @@ wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param, ...@@ -655,7 +656,7 @@ wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
{ {
s32 iolen; s32 iolen;
iolen = bcm_mkiovar(iovar, param, paramlen, bufptr, buflen); iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen); BUG_ON(!iolen);
return wl_dev_ioctl(dev, WLC_GET_VAR, bufptr, buflen); return wl_dev_ioctl(dev, WLC_GET_VAR, bufptr, buflen);
...@@ -843,7 +844,8 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val) ...@@ -843,7 +844,8 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
s32 err = 0; s32 err = 0;
val = cpu_to_le32(val); val = cpu_to_le32(val);
len = bcm_mkiovar(name, (char *)(&val), sizeof(val), buf, sizeof(buf)); len = brcmu_mkiovar(name, (char *)(&val), sizeof(val), buf,
sizeof(buf));
BUG_ON(!len); BUG_ON(!len);
err = wl_dev_ioctl(dev, WLC_SET_VAR, buf, len); err = wl_dev_ioctl(dev, WLC_SET_VAR, buf, len);
...@@ -865,7 +867,7 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval) ...@@ -865,7 +867,7 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
s32 err = 0; s32 err = 0;
len = len =
bcm_mkiovar(name, (char *)(&data_null), 0, (char *)(&var), brcmu_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
sizeof(var.buf)); sizeof(var.buf));
BUG_ON(!len); BUG_ON(!len);
err = wl_dev_ioctl(dev, WLC_GET_VAR, &var, len); err = wl_dev_ioctl(dev, WLC_GET_VAR, &var, len);
...@@ -1518,7 +1520,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy, ...@@ -1518,7 +1520,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
else else
txpwrmw = (u16) dbm; txpwrmw = (u16) dbm;
err = wl_dev_intvar_set(ndev, "qtxpower", err = wl_dev_intvar_set(ndev, "qtxpower",
(s32) (bcm_mw_to_qdbm(txpwrmw))); (s32) (brcmu_mw_to_qdbm(txpwrmw)));
if (unlikely(err)) if (unlikely(err))
WL_ERR("qtxpower error (%d)\n", err); WL_ERR("qtxpower error (%d)\n", err);
wl->conf->tx_power = dbm; wl->conf->tx_power = dbm;
...@@ -1546,7 +1548,7 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm) ...@@ -1546,7 +1548,7 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
} }
result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE); result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE);
*dbm = (s32) bcm_qdbm_to_mw(result); *dbm = (s32) brcmu_qdbm_to_mw(result);
done: done:
WL_TRACE("Exit\n"); WL_TRACE("Exit\n");
...@@ -2668,7 +2670,7 @@ wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len) ...@@ -2668,7 +2670,7 @@ wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
struct wl_priv *wl = ndev_to_wl(dev); struct wl_priv *wl = ndev_to_wl(dev);
u32 buflen; u32 buflen;
buflen = bcm_mkiovar(name, buf, len, wl->ioctl_buf, WL_IOCTL_LEN_MAX); buflen = brcmu_mkiovar(name, buf, len, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
BUG_ON(!buflen); BUG_ON(!buflen);
return wl_dev_ioctl(dev, WLC_SET_VAR, wl->ioctl_buf, buflen); return wl_dev_ioctl(dev, WLC_SET_VAR, wl->ioctl_buf, buflen);
...@@ -2682,7 +2684,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf, ...@@ -2682,7 +2684,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
u32 len; u32 len;
s32 err = 0; s32 err = 0;
len = bcm_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX); len = brcmu_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
BUG_ON(!len); BUG_ON(!len);
err = wl_dev_ioctl(dev, WLC_GET_VAR, (void *)wl->ioctl_buf, err = wl_dev_ioctl(dev, WLC_GET_VAR, (void *)wl->ioctl_buf,
WL_IOCTL_LEN_MAX); WL_IOCTL_LEN_MAX);
...@@ -2800,7 +2802,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl) ...@@ -2800,7 +2802,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
{ {
struct wl_bss_info *bi; struct wl_bss_info *bi;
struct wlc_ssid *ssid; struct wlc_ssid *ssid;
struct bcm_tlv *tim; struct brcmu_tlv *tim;
u16 beacon_interval; u16 beacon_interval;
u8 dtim_period; u8 dtim_period;
size_t ie_len; size_t ie_len;
...@@ -2830,7 +2832,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl) ...@@ -2830,7 +2832,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
ie_len = bi->ie_length; ie_len = bi->ie_length;
beacon_interval = cpu_to_le16(bi->beacon_period); beacon_interval = cpu_to_le16(bi->beacon_period);
tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM); tim = brcmu_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
if (tim) if (tim)
dtim_period = tim->data[1]; dtim_period = tim->data[1];
else { else {
...@@ -3681,7 +3683,7 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align) ...@@ -3681,7 +3683,7 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align)
s32 err = 0; s32 err = 0;
/* Match Host and Dongle rx alignment */ /* Match Host and Dongle rx alignment */
bcm_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf, brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) { if (unlikely(err)) {
...@@ -3689,7 +3691,7 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align) ...@@ -3689,7 +3691,7 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align)
goto dongle_glom_out; goto dongle_glom_out;
} }
/* disable glom option per default */ /* disable glom option per default */
bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf)); brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) { if (unlikely(err)) {
WL_ERR("txglom error (%d)\n", err); WL_ERR("txglom error (%d)\n", err);
...@@ -3707,7 +3709,7 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol) ...@@ -3707,7 +3709,7 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
s32 err = 0; s32 err = 0;
/* Set ARP offload */ /* Set ARP offload */
bcm_mkiovar("arpoe", (char *)&arpoe, 4, iovbuf, sizeof(iovbuf)); brcmu_mkiovar("arpoe", (char *)&arpoe, 4, iovbuf, sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (err) { if (err) {
if (err == -EOPNOTSUPP) if (err == -EOPNOTSUPP)
...@@ -3717,7 +3719,7 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol) ...@@ -3717,7 +3719,7 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
goto dongle_offload_out; goto dongle_offload_out;
} }
bcm_mkiovar("arp_ol", (char *)&arp_ol, 4, iovbuf, sizeof(iovbuf)); brcmu_mkiovar("arp_ol", (char *)&arp_ol, 4, iovbuf, sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (err) { if (err) {
if (err == -EOPNOTSUPP) if (err == -EOPNOTSUPP)
...@@ -3830,7 +3832,7 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode) ...@@ -3830,7 +3832,7 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
} }
/* set mode to allow pattern */ /* set mode to allow pattern */
bcm_mkiovar("pkt_filter_mode", (char *)&filter_mode, 4, iovbuf, brcmu_mkiovar("pkt_filter_mode", (char *)&filter_mode, 4, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (err) { if (err) {
...@@ -3857,7 +3859,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev) ...@@ -3857,7 +3859,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
WL_TRACE("Enter\n"); WL_TRACE("Enter\n");
/* Setup event_msgs */ /* Setup event_msgs */
bcm_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf, brcmu_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_GET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) { if (unlikely(err)) {
...@@ -3886,7 +3888,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev) ...@@ -3886,7 +3888,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
setbit(eventmask, WLC_E_JOIN_START); setbit(eventmask, WLC_E_JOIN_START);
setbit(eventmask, WLC_E_SCAN_COMPLETE); setbit(eventmask, WLC_E_SCAN_COMPLETE);
bcm_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf, brcmu_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf)); sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) { if (unlikely(err)) {
...@@ -3912,7 +3914,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) ...@@ -3912,7 +3914,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
* off to report link down * off to report link down
*/ */
if (roamvar) { if (roamvar) {
bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout,
sizeof(bcn_timeout), iovbuf, sizeof(iovbuf)); sizeof(bcn_timeout), iovbuf, sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) { if (unlikely(err)) {
...@@ -3926,7 +3928,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout) ...@@ -3926,7 +3928,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
* to take care of roaming * to take care of roaming
*/ */
WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On"); WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On");
bcm_mkiovar("roam_off", (char *)&roamvar, brcmu_mkiovar("roam_off", (char *)&roamvar,
sizeof(roamvar), iovbuf, sizeof(iovbuf)); sizeof(roamvar), iovbuf, sizeof(iovbuf));
err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) { if (unlikely(err)) {
......
...@@ -17,11 +17,6 @@ ...@@ -17,11 +17,6 @@
#ifndef _wl_cfg80211_h_ #ifndef _wl_cfg80211_h_
#define _wl_cfg80211_h_ #define _wl_cfg80211_h_
#include <linux/wireless.h>
#include <linux/wireless.h>
#include <net/cfg80211.h>
#include <wlioctl.h>
struct wl_conf; struct wl_conf;
struct wl_iface; struct wl_iface;
struct wl_priv; struct wl_priv;
...@@ -39,7 +34,7 @@ struct wl_ibss; ...@@ -39,7 +34,7 @@ struct wl_ibss;
#define WL_ERR(fmt, args...) \ #define WL_ERR(fmt, args...) \
do { \ do { \
if (wl_dbg_level & WL_DBG_ERR) { \ if (brcmf_dbg_level & WL_DBG_ERR) { \
if (net_ratelimit()) { \ if (net_ratelimit()) { \
printk(KERN_ERR "ERROR @%s : " fmt, \ printk(KERN_ERR "ERROR @%s : " fmt, \
__func__, ##args); \ __func__, ##args); \
...@@ -50,7 +45,7 @@ do { \ ...@@ -50,7 +45,7 @@ do { \
#if (defined BCMDBG) #if (defined BCMDBG)
#define WL_INFO(fmt, args...) \ #define WL_INFO(fmt, args...) \
do { \ do { \
if (wl_dbg_level & WL_DBG_INFO) { \ if (brcmf_dbg_level & WL_DBG_INFO) { \
if (net_ratelimit()) { \ if (net_ratelimit()) { \
printk(KERN_ERR "INFO @%s : " fmt, \ printk(KERN_ERR "INFO @%s : " fmt, \
__func__, ##args); \ __func__, ##args); \
...@@ -60,7 +55,7 @@ do { \ ...@@ -60,7 +55,7 @@ do { \
#define WL_TRACE(fmt, args...) \ #define WL_TRACE(fmt, args...) \
do { \ do { \
if (wl_dbg_level & WL_DBG_TRACE) { \ if (brcmf_dbg_level & WL_DBG_TRACE) { \
if (net_ratelimit()) { \ if (net_ratelimit()) { \
printk(KERN_ERR "TRACE @%s : " fmt, \ printk(KERN_ERR "TRACE @%s : " fmt, \
__func__, ##args); \ __func__, ##args); \
...@@ -70,7 +65,7 @@ do { \ ...@@ -70,7 +65,7 @@ do { \
#define WL_SCAN(fmt, args...) \ #define WL_SCAN(fmt, args...) \
do { \ do { \
if (wl_dbg_level & WL_DBG_SCAN) { \ if (brcmf_dbg_level & WL_DBG_SCAN) { \
if (net_ratelimit()) { \ if (net_ratelimit()) { \
printk(KERN_ERR "SCAN @%s : " fmt, \ printk(KERN_ERR "SCAN @%s : " fmt, \
__func__, ##args); \ __func__, ##args); \
...@@ -80,7 +75,7 @@ do { \ ...@@ -80,7 +75,7 @@ do { \
#define WL_CONN(fmt, args...) \ #define WL_CONN(fmt, args...) \
do { \ do { \
if (wl_dbg_level & WL_DBG_CONN) { \ if (brcmf_dbg_level & WL_DBG_CONN) { \
if (net_ratelimit()) { \ if (net_ratelimit()) { \
printk(KERN_ERR "CONN @%s : " fmt, \ printk(KERN_ERR "CONN @%s : " fmt, \
__func__, ##args); \ __func__, ##args); \
......
...@@ -16,25 +16,30 @@ ...@@ -16,25 +16,30 @@
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/semaphore.h> #include <linux/semaphore.h>
#include <bcmdefs.h> #include <defs.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <wlioctl.h> #include <linux/etherdevice.h>
#include <linux/wireless.h>
#include <bcmutils.h> #include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <dngl_stats.h> #include <dngl_stats.h>
#include <dhd.h> #include <dhd.h>
#include <dhdioctl.h>
#include <linux/ieee80211.h> #include <linux/ieee80211.h>
typedef const struct si_pub si_t;
#include <wlioctl.h> struct si_pub;
#include <dngl_stats.h> #include <dngl_stats.h>
#include <dhd.h> #include <dhd.h>
#define WPA_OUI "\x00\x50\xF2"
#define DOT11_MNG_RSN_ID 48
#define DOT11_MNG_WPA_ID 221
#define WL_ERROR(fmt, args...) printk(fmt, ##args) #define WL_ERROR(fmt, args...) printk(fmt, ##args)
#define WL_TRACE(fmt, args...) no_printk(fmt, ##args) #define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
#define WL_INFORM(fmt, args...) no_printk(fmt, ##args) #define WL_INFORM(fmt, args...) no_printk(fmt, ##args)
...@@ -113,6 +118,24 @@ typedef struct iscan_info { ...@@ -113,6 +118,24 @@ typedef struct iscan_info {
} iscan_info_t; } iscan_info_t;
iscan_info_t *g_iscan; iscan_info_t *g_iscan;
typedef enum sup_auth_status {
WLC_SUP_DISCONNECTED = 0,
WLC_SUP_CONNECTING,
WLC_SUP_IDREQUIRED,
WLC_SUP_AUTHENTICATING,
WLC_SUP_AUTHENTICATED,
WLC_SUP_KEYXCHANGE,
WLC_SUP_KEYED,
WLC_SUP_TIMEOUT,
WLC_SUP_LAST_BASIC_STATE,
WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
WLC_SUP_KEYXCHANGE_PREP_M4,
WLC_SUP_KEYXCHANGE_WAIT_G1,
WLC_SUP_KEYXCHANGE_PREP_G2
} sup_auth_status_t;
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255}; static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
/* Global ASSERT type flag */ /* Global ASSERT type flag */
...@@ -205,7 +228,8 @@ static int dev_wlc_intvar_set(struct net_device *dev, char *name, int val) ...@@ -205,7 +228,8 @@ static int dev_wlc_intvar_set(struct net_device *dev, char *name, int val)
uint len; uint len;
val = cpu_to_le32(val); val = cpu_to_le32(val);
len = bcm_mkiovar(name, (char *)(&val), sizeof(val), buf, sizeof(buf)); len = brcmu_mkiovar(name, (char *)(&val), sizeof(val), buf,
sizeof(buf));
ASSERT(len); ASSERT(len);
return dev_wlc_ioctl(dev, WLC_SET_VAR, buf, len); return dev_wlc_ioctl(dev, WLC_SET_VAR, buf, len);
...@@ -219,7 +243,7 @@ dev_iw_iovar_setbuf(struct net_device *dev, ...@@ -219,7 +243,7 @@ dev_iw_iovar_setbuf(struct net_device *dev,
{ {
int iolen; int iolen;
iolen = bcm_mkiovar(iovar, param, paramlen, bufptr, buflen); iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
ASSERT(iolen); ASSERT(iolen);
if (iolen == 0) if (iolen == 0)
...@@ -235,7 +259,7 @@ dev_iw_iovar_getbuf(struct net_device *dev, ...@@ -235,7 +259,7 @@ dev_iw_iovar_getbuf(struct net_device *dev,
{ {
int iolen; int iolen;
iolen = bcm_mkiovar(iovar, param, paramlen, bufptr, buflen); iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
ASSERT(iolen); ASSERT(iolen);
return dev_wlc_ioctl(dev, WLC_GET_VAR, bufptr, buflen); return dev_wlc_ioctl(dev, WLC_GET_VAR, bufptr, buflen);
...@@ -249,7 +273,7 @@ dev_wlc_bufvar_set(struct net_device *dev, char *name, char *buf, int len) ...@@ -249,7 +273,7 @@ dev_wlc_bufvar_set(struct net_device *dev, char *name, char *buf, int len)
static char ioctlbuf[MAX_WLIW_IOCTL_LEN]; static char ioctlbuf[MAX_WLIW_IOCTL_LEN];
uint buflen; uint buflen;
buflen = bcm_mkiovar(name, buf, len, ioctlbuf, sizeof(ioctlbuf)); buflen = brcmu_mkiovar(name, buf, len, ioctlbuf, sizeof(ioctlbuf));
ASSERT(buflen); ASSERT(buflen);
return dev_wlc_ioctl(dev, WLC_SET_VAR, ioctlbuf, buflen); return dev_wlc_ioctl(dev, WLC_SET_VAR, ioctlbuf, buflen);
...@@ -263,7 +287,7 @@ dev_wlc_bufvar_get(struct net_device *dev, char *name, char *buf, int buflen) ...@@ -263,7 +287,7 @@ dev_wlc_bufvar_get(struct net_device *dev, char *name, char *buf, int buflen)
int error; int error;
uint len; uint len;
len = bcm_mkiovar(name, NULL, 0, ioctlbuf, sizeof(ioctlbuf)); len = brcmu_mkiovar(name, NULL, 0, ioctlbuf, sizeof(ioctlbuf));
ASSERT(len); ASSERT(len);
error = error =
dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctlbuf, dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctlbuf,
...@@ -286,7 +310,7 @@ static int dev_wlc_intvar_get(struct net_device *dev, char *name, int *retval) ...@@ -286,7 +310,7 @@ static int dev_wlc_intvar_get(struct net_device *dev, char *name, int *retval)
uint data_null; uint data_null;
len = len =
bcm_mkiovar(name, (char *)(&data_null), 0, (char *)(&var), brcmu_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
sizeof(var.buf)); sizeof(var.buf));
ASSERT(len); ASSERT(len);
error = dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)&var, len); error = dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)&var, len);
...@@ -371,7 +395,7 @@ wl_iw_set_freq(struct net_device *dev, ...@@ -371,7 +395,7 @@ wl_iw_set_freq(struct net_device *dev,
if (fwrq->m > 4000 && fwrq->m < 5000) if (fwrq->m > 4000 && fwrq->m < 5000)
sf = WF_CHAN_FACTOR_4_G; sf = WF_CHAN_FACTOR_4_G;
chan = bcm_mhz2channel(fwrq->m, sf); chan = brcmu_mhz2channel(fwrq->m, sf);
} }
chan = cpu_to_le32(chan); chan = cpu_to_le32(chan);
...@@ -1422,11 +1446,11 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end, ...@@ -1422,11 +1446,11 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
event = *event_p; event = *event_p;
if (bi->ie_length) { if (bi->ie_length) {
bcm_tlv_t *ie; struct brcmu_tlv *ie;
u8 *ptr = ((u8 *) bi) + sizeof(wl_bss_info_t); u8 *ptr = ((u8 *) bi) + sizeof(wl_bss_info_t);
int ptr_len = bi->ie_length; int ptr_len = bi->ie_length;
ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_RSN_ID); ie = brcmu_parse_tlvs(ptr, ptr_len, DOT11_MNG_RSN_ID);
if (ie) { if (ie) {
iwe.cmd = IWEVGENIE; iwe.cmd = IWEVGENIE;
iwe.u.data.length = ie->len + 2; iwe.u.data.length = ie->len + 2;
...@@ -1436,7 +1460,8 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end, ...@@ -1436,7 +1460,8 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
} }
ptr = ((u8 *) bi) + sizeof(wl_bss_info_t); ptr = ((u8 *) bi) + sizeof(wl_bss_info_t);
while ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_WPA_ID))) { while ((ie = brcmu_parse_tlvs(
ptr, ptr_len, DOT11_MNG_WPA_ID))) {
if (ie_is_wps_ie(((u8 **)&ie), &ptr, &ptr_len)) { if (ie_is_wps_ie(((u8 **)&ie), &ptr, &ptr_len)) {
iwe.cmd = IWEVGENIE; iwe.cmd = IWEVGENIE;
iwe.u.data.length = ie->len + 2; iwe.u.data.length = ie->len + 2;
...@@ -1449,7 +1474,8 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end, ...@@ -1449,7 +1474,8 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
ptr = ((u8 *) bi) + sizeof(wl_bss_info_t); ptr = ((u8 *) bi) + sizeof(wl_bss_info_t);
ptr_len = bi->ie_length; ptr_len = bi->ie_length;
while ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_WPA_ID))) { while ((ie = brcmu_parse_tlvs(
ptr, ptr_len, DOT11_MNG_WPA_ID))) {
if (ie_is_wpa_ie(((u8 **)&ie), &ptr, &ptr_len)) { if (ie_is_wpa_ie(((u8 **)&ie), &ptr, &ptr_len)) {
iwe.cmd = IWEVGENIE; iwe.cmd = IWEVGENIE;
iwe.u.data.length = ie->len + 2; iwe.u.data.length = ie->len + 2;
...@@ -2174,8 +2200,8 @@ wl_iw_set_txpow(struct net_device *dev, ...@@ -2174,8 +2200,8 @@ wl_iw_set_txpow(struct net_device *dev,
else else
txpwrmw = (u16) vwrq->value; txpwrmw = (u16) vwrq->value;
error = error = dev_wlc_intvar_set(dev, "qtxpower",
dev_wlc_intvar_set(dev, "qtxpower", (int)(bcm_mw_to_qdbm(txpwrmw))); (int)(brcmu_mw_to_qdbm(txpwrmw)));
return error; return error;
} }
...@@ -2199,7 +2225,7 @@ wl_iw_get_txpow(struct net_device *dev, ...@@ -2199,7 +2225,7 @@ wl_iw_get_txpow(struct net_device *dev,
disable = le32_to_cpu(disable); disable = le32_to_cpu(disable);
result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE); result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE);
vwrq->value = (s32) bcm_qdbm_to_mw(result); vwrq->value = (s32) brcmu_qdbm_to_mw(result);
vwrq->fixed = 0; vwrq->fixed = 0;
vwrq->disabled = vwrq->disabled =
(disable & (WL_RADIO_SW_DISABLE | WL_RADIO_HW_DISABLE)) ? 1 : 0; (disable & (WL_RADIO_SW_DISABLE | WL_RADIO_HW_DISABLE)) ? 1 : 0;
......
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
#ifndef _wl_iw_h_ #ifndef _wl_iw_h_
#define _wl_iw_h_ #define _wl_iw_h_
#include <linux/wireless.h>
#include <wlioctl.h>
#define WL_SCAN_PARAMS_SSID_MAX 10 #define WL_SCAN_PARAMS_SSID_MAX 10
#define GET_SSID "SSID=" #define GET_SSID "SSID="
#define GET_CHANNEL "CH=" #define GET_CHANNEL "CH="
......
...@@ -28,30 +28,29 @@ ccflags-y := \ ...@@ -28,30 +28,29 @@ ccflags-y := \
-Idrivers/staging/brcm80211/include -Idrivers/staging/brcm80211/include
BRCMSMAC_OFILES := \ BRCMSMAC_OFILES := \
wl_mac80211.o \ mac80211_if.o \
wl_ucode_loader.o \ ucode_loader.o \
wlc_alloc.o \ alloc.o \
wlc_ampdu.o \ ampdu.o \
wlc_antsel.o \ antsel.o \
wlc_bmac.o \ bmac.o \
wlc_channel.o \ channel.o \
wlc_main.o \ main.o \
wlc_phy_shim.o \ phy_shim.o \
wlc_pmu.o \ pmu.o \
wlc_rate.o \ rate.o \
wlc_stf.o \ stf.o \
aiutils.o \ aiutils.o \
phy/wlc_phy_cmn.o \ phy/phy_cmn.o \
phy/wlc_phy_lcn.o \ phy/phy_lcn.o \
phy/wlc_phy_n.o \ phy/phy_n.o \
phy/wlc_phytbl_lcn.o \ phy/phytbl_lcn.o \
phy/wlc_phytbl_n.o \ phy/phytbl_n.o \
phy/wlc_phy_qmath.o \ phy/phy_qmath.o \
bcmotp.o \ otp.o \
bcmsrom.o \ srom.o \
hnddma.o \ dma.o \
nicpci.o \ nicpci.o
nvram.o
MODULEPFX := brcmsmac MODULEPFX := brcmsmac
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _wlc_ampdu_h_ #ifndef _BRCM_AMPDU_H_
#define _wlc_ampdu_h_ #define _BRCM_AMPDU_H_
extern struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc); extern struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc);
extern void wlc_ampdu_detach(struct ampdu_info *ampdu); extern void wlc_ampdu_detach(struct ampdu_info *ampdu);
...@@ -26,4 +26,4 @@ extern void wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb, ...@@ -26,4 +26,4 @@ extern void wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
extern void wlc_ampdu_macaddr_upd(struct wlc_info *wlc); extern void wlc_ampdu_macaddr_upd(struct wlc_info *wlc);
extern void wlc_ampdu_shm_upd(struct ampdu_info *ampdu); extern void wlc_ampdu_shm_upd(struct ampdu_info *ampdu);
#endif /* _wlc_ampdu_h_ */ #endif /* _BRCM_AMPDU_H_ */
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _wlc_antsel_h_ #ifndef _BRCM_ANTSEL_H_
#define _wlc_antsel_h_ #define _BRCM_ANTSEL_H_
extern struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc); extern struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc);
extern void wlc_antsel_detach(struct antsel_info *asi); extern void wlc_antsel_detach(struct antsel_info *asi);
...@@ -26,4 +26,4 @@ extern void wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef, ...@@ -26,4 +26,4 @@ extern void wlc_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
u8 *fbantcfg); u8 *fbantcfg);
extern u8 wlc_antsel_antsel2id(struct antsel_info *asi, u16 antsel); extern u8 wlc_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
#endif /* _wlc_antsel_h_ */ #endif /* _BRCM_ANTSEL_H_ */
此差异已折叠。
此差异已折叠。
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef _bcmotp_h_ #ifndef _BRCM_OTP_H_
#define _bcmotp_h_ #define _BRCM_OTP_H_
/* OTP regions */ /* OTP regions */
#define OTP_HW_RGN 1 #define OTP_HW_RGN 1
...@@ -37,8 +37,9 @@ ...@@ -37,8 +37,9 @@
extern int otp_status(void *oh); extern int otp_status(void *oh);
extern int otp_size(void *oh); extern int otp_size(void *oh);
extern u16 otp_read_bit(void *oh, uint offset); extern u16 otp_read_bit(void *oh, uint offset);
extern void *otp_init(si_t *sih); extern void *otp_init(struct si_pub *sih);
extern int otp_read_region(si_t *sih, int region, u16 *data, uint *wlen); extern int otp_read_region(struct si_pub *sih, int region, u16 *data,
uint *wlen);
extern int otp_nvread(void *oh, char *data, uint *len); extern int otp_nvread(void *oh, char *data, uint *len);
#endif /* _bcmotp_h_ */ #endif /* _BRCM_OTP_H_ */
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册